diff --git a/nwnds_module/10coins.uti b/nwnds_module/10coins.uti new file mode 100644 index 000000000..5b3d35032 Binary files /dev/null and b/nwnds_module/10coins.uti differ diff --git a/nwnds_module/1perpc50gold.ncs b/nwnds_module/1perpc50gold.ncs new file mode 100644 index 000000000..5e2d242a2 Binary files /dev/null and b/nwnds_module/1perpc50gold.ncs differ diff --git a/nwnds_module/1perpc50gold.nss b/nwnds_module/1perpc50gold.nss new file mode 100644 index 000000000..b2a9aa189 --- /dev/null +++ b/nwnds_module/1perpc50gold.nss @@ -0,0 +1,16 @@ +void main() +{ + +object oPC = GetLastOpenedBy(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +CreateItemOnObject("50gold", OBJECT_SELF); + +} diff --git a/nwnds_module/1perpcalexandrit.ncs b/nwnds_module/1perpcalexandrit.ncs new file mode 100644 index 000000000..1a9664d04 Binary files /dev/null and b/nwnds_module/1perpcalexandrit.ncs differ diff --git a/nwnds_module/1perpcalexandrit.nss b/nwnds_module/1perpcalexandrit.nss new file mode 100644 index 000000000..766755017 --- /dev/null +++ b/nwnds_module/1perpcalexandrit.nss @@ -0,0 +1,16 @@ +void main() +{ + +object oPC = GetLastOpenedBy(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +CreateItemOnObject("nw_it_gem013", OBJECT_SELF); + +} diff --git a/nwnds_module/1perpcchaoskey.ncs b/nwnds_module/1perpcchaoskey.ncs new file mode 100644 index 000000000..9ea3c779b Binary files /dev/null and b/nwnds_module/1perpcchaoskey.ncs differ diff --git a/nwnds_module/1perpcchaoskey.nss b/nwnds_module/1perpcchaoskey.nss new file mode 100644 index 000000000..4cf9a9445 --- /dev/null +++ b/nwnds_module/1perpcchaoskey.nss @@ -0,0 +1,18 @@ +void main() +{ + +object oPC = GetLastOpenedBy(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +CreateItemOnObject("keyofchaos", OBJECT_SELF); + +SetLocked(OBJECT_SELF,1); + +} diff --git a/nwnds_module/1perpcdoomkey.ncs b/nwnds_module/1perpcdoomkey.ncs new file mode 100644 index 000000000..ac61a2850 Binary files /dev/null and b/nwnds_module/1perpcdoomkey.ncs differ diff --git a/nwnds_module/1perpcdoomkey.nss b/nwnds_module/1perpcdoomkey.nss new file mode 100644 index 000000000..0b7e27350 --- /dev/null +++ b/nwnds_module/1perpcdoomkey.nss @@ -0,0 +1,18 @@ +void main() +{ + +object oPC = GetLastOpenedBy(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +CreateItemOnObject("doomkey", OBJECT_SELF); + +SetLocked(OBJECT_SELF,1); + +} diff --git a/nwnds_module/1perpctopaz.ncs b/nwnds_module/1perpctopaz.ncs new file mode 100644 index 000000000..669a63295 Binary files /dev/null and b/nwnds_module/1perpctopaz.ncs differ diff --git a/nwnds_module/1perpctopaz.nss b/nwnds_module/1perpctopaz.nss new file mode 100644 index 000000000..6df63eb1d --- /dev/null +++ b/nwnds_module/1perpctopaz.nss @@ -0,0 +1,16 @@ +void main() +{ + +object oPC = GetLastOpenedBy(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +CreateItemOnObject("nw_it_gem010", OBJECT_SELF); + +} diff --git a/nwnds_module/20ft_fall.ncs b/nwnds_module/20ft_fall.ncs new file mode 100644 index 000000000..2542fc924 Binary files /dev/null and b/nwnds_module/20ft_fall.ncs differ diff --git a/nwnds_module/20ft_fall.nss b/nwnds_module/20ft_fall.nss new file mode 100644 index 000000000..9d9b85ab3 --- /dev/null +++ b/nwnds_module/20ft_fall.nss @@ -0,0 +1,38 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); +object oTarget; +object oWayPoint = GetWaypointByTag("wp_oldwell"); +location lLoc = GetLocation(oWayPoint); + +oTarget = oPC; + +AssignCommand(oPC, TakeGoldFromCreature(d20(2), oPC, TRUE)); + +effect eEffect; +eEffect = EffectDamage(d6(2), DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL); + +ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC); + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_BUMP), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_BUMP), GetLocation(oTarget)); + +FloatingTextStringOnCreature("*You fall about 20 feet.*", oPC, FALSE); + +AssignCommand(oPC,JumpToLocation(lLoc)); + +} diff --git a/nwnds_module/25coins.uti b/nwnds_module/25coins.uti new file mode 100644 index 000000000..81e71f052 Binary files /dev/null and b/nwnds_module/25coins.uti differ diff --git a/nwnds_module/2D8_CONSTRICT.uti b/nwnds_module/2D8_CONSTRICT.uti new file mode 100644 index 000000000..2888d8052 Binary files /dev/null and b/nwnds_module/2D8_CONSTRICT.uti differ diff --git a/nwnds_module/2d8_constrict.ncs b/nwnds_module/2d8_constrict.ncs new file mode 100644 index 000000000..9bafbcff0 Binary files /dev/null and b/nwnds_module/2d8_constrict.ncs differ diff --git a/nwnds_module/2d8_constrict.nss b/nwnds_module/2d8_constrict.nss new file mode 100644 index 000000000..af5ca1f3d --- /dev/null +++ b/nwnds_module/2d8_constrict.nss @@ -0,0 +1,66 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d8(2)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Colossal creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d8 + STR Bonus bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/50gold.uti b/nwnds_module/50gold.uti new file mode 100644 index 000000000..4b179fdde Binary files /dev/null and b/nwnds_module/50gold.uti differ diff --git a/nwnds_module/CRE_HIDE_BABAU.uti b/nwnds_module/CRE_HIDE_BABAU.uti new file mode 100644 index 000000000..b6c352613 Binary files /dev/null and b/nwnds_module/CRE_HIDE_BABAU.uti differ diff --git a/nwnds_module/CRFT_DEFILERASH.uti b/nwnds_module/CRFT_DEFILERASH.uti new file mode 100644 index 000000000..45ca52421 Binary files /dev/null and b/nwnds_module/CRFT_DEFILERASH.uti differ diff --git a/nwnds_module/CRFT_SPWYRM_SKIN.uti b/nwnds_module/CRFT_SPWYRM_SKIN.uti new file mode 100644 index 000000000..b865a48f5 Binary files /dev/null and b/nwnds_module/CRFT_SPWYRM_SKIN.uti differ diff --git a/nwnds_module/CR_HIDE_CRODLU01.uti b/nwnds_module/CR_HIDE_CRODLU01.uti new file mode 100644 index 000000000..be2f53a23 Binary files /dev/null and b/nwnds_module/CR_HIDE_CRODLU01.uti differ diff --git a/nwnds_module/CR_HIDE_GBNCLW01.uti b/nwnds_module/CR_HIDE_GBNCLW01.uti new file mode 100644 index 000000000..970e0dfb8 Binary files /dev/null and b/nwnds_module/CR_HIDE_GBNCLW01.uti differ diff --git a/nwnds_module/CR_HIDE_JANKX001.uti b/nwnds_module/CR_HIDE_JANKX001.uti new file mode 100644 index 000000000..09b97059a Binary files /dev/null and b/nwnds_module/CR_HIDE_JANKX001.uti differ diff --git a/nwnds_module/CR_HIDE_JANKX002.uti b/nwnds_module/CR_HIDE_JANKX002.uti new file mode 100644 index 000000000..0ae0f6503 Binary files /dev/null and b/nwnds_module/CR_HIDE_JANKX002.uti differ diff --git a/nwnds_module/CR_HIDE_PLANT001.uti b/nwnds_module/CR_HIDE_PLANT001.uti new file mode 100644 index 000000000..ba82c3d05 Binary files /dev/null and b/nwnds_module/CR_HIDE_PLANT001.uti differ diff --git a/nwnds_module/CR_HIDE_PTERRAX.uti b/nwnds_module/CR_HIDE_PTERRAX.uti new file mode 100644 index 000000000..bfbf4ab96 Binary files /dev/null and b/nwnds_module/CR_HIDE_PTERRAX.uti differ diff --git a/nwnds_module/CR_HIDE_RASCLINN.uti b/nwnds_module/CR_HIDE_RASCLINN.uti new file mode 100644 index 000000000..d1291d5cc Binary files /dev/null and b/nwnds_module/CR_HIDE_RASCLINN.uti differ diff --git a/nwnds_module/CR_HIDE_SCRAB001.uti b/nwnds_module/CR_HIDE_SCRAB001.uti new file mode 100644 index 000000000..484ecd947 Binary files /dev/null and b/nwnds_module/CR_HIDE_SCRAB001.uti differ diff --git a/nwnds_module/CR_SPINE_HUNTCAC.uti b/nwnds_module/CR_SPINE_HUNTCAC.uti new file mode 100644 index 000000000..364306d17 Binary files /dev/null and b/nwnds_module/CR_SPINE_HUNTCAC.uti differ diff --git a/nwnds_module/DS_AMHVFP_URIKGD.uti b/nwnds_module/DS_AMHVFP_URIKGD.uti new file mode 100644 index 000000000..4a91289d0 Binary files /dev/null and b/nwnds_module/DS_AMHVFP_URIKGD.uti differ diff --git a/nwnds_module/DS_BITE_SLTSRP01.uti b/nwnds_module/DS_BITE_SLTSRP01.uti new file mode 100644 index 000000000..6cf943b8c Binary files /dev/null and b/nwnds_module/DS_BITE_SLTSRP01.uti differ diff --git a/nwnds_module/DS_CLAYGOLEM002.utc b/nwnds_module/DS_CLAYGOLEM002.utc new file mode 100644 index 000000000..22072a23c Binary files /dev/null and b/nwnds_module/DS_CLAYGOLEM002.utc differ diff --git a/nwnds_module/DS_CLAYGOLEM003.utc b/nwnds_module/DS_CLAYGOLEM003.utc new file mode 100644 index 000000000..0772cf7d8 Binary files /dev/null and b/nwnds_module/DS_CLAYGOLEM003.utc differ diff --git a/nwnds_module/DS_HIDE_BRNSEED.uti b/nwnds_module/DS_HIDE_BRNSEED.uti new file mode 100644 index 000000000..746d42e2b Binary files /dev/null and b/nwnds_module/DS_HIDE_BRNSEED.uti differ diff --git a/nwnds_module/DS_HIDE_FORDORN.uti b/nwnds_module/DS_HIDE_FORDORN.uti new file mode 100644 index 000000000..4f5d429a4 Binary files /dev/null and b/nwnds_module/DS_HIDE_FORDORN.uti differ diff --git a/nwnds_module/DS_HIDE_SLTSRP01.uti b/nwnds_module/DS_HIDE_SLTSRP01.uti new file mode 100644 index 000000000..f2582d643 Binary files /dev/null and b/nwnds_module/DS_HIDE_SLTSRP01.uti differ diff --git a/nwnds_module/DS_SCRAB002.utc b/nwnds_module/DS_SCRAB002.utc new file mode 100644 index 000000000..f4d4222d5 Binary files /dev/null and b/nwnds_module/DS_SCRAB002.utc differ diff --git a/nwnds_module/DS_WEZER002.utc b/nwnds_module/DS_WEZER002.utc new file mode 100644 index 000000000..238d12154 Binary files /dev/null and b/nwnds_module/DS_WEZER002.utc differ diff --git a/nwnds_module/Repute.fac b/nwnds_module/Repute.fac new file mode 100644 index 000000000..4a22e3fcf Binary files /dev/null and b/nwnds_module/Repute.fac differ diff --git a/nwnds_module/_inc_battlecry_.nss b/nwnds_module/_inc_battlecry_.nss new file mode 100644 index 000000000..ba6375d00 --- /dev/null +++ b/nwnds_module/_inc_battlecry_.nss @@ -0,0 +1,185 @@ +/////////////////////////////////// +// Carcerian's BattleCry Script // +// "Evil Dead" Edition // +/////////////////////////////////// + +#include "NW_I0_GENERIC" + +const int BattleCryChance = 15; +const int CombatCryChance = 20; +const int DeathCryChance = 20; +const int CustomUndeadChance = 50; + +const string COLOR_RED = ""; +const string COLOR_DARK = ""; +const string COLOR_GREEN = ""; +const string COLOR_WHITE = ""; +const string COLOR_VIOLET = ""; +const string COLOR_YELLOW = ""; + +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() +{ //if undead spotted "i see dead people!" "Dead ahead!" + if (d100()<=BattleCryChance) + { + if (HasSpoken()) return; + if ((GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance)) + { + DoUndeadChatter(); + } + 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 ((GetRacialType(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 ((GetRacialType(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 ((GetRacialType(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 (){} diff --git a/nwnds_module/_inc_livingdead_.ncs b/nwnds_module/_inc_livingdead_.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/_inc_livingdead_.ncs differ diff --git a/nwnds_module/_inc_livingdead_.nss b/nwnds_module/_inc_livingdead_.nss new file mode 100644 index 000000000..33acdc50a --- /dev/null +++ b/nwnds_module/_inc_livingdead_.nss @@ -0,0 +1,200 @@ +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 = GetRacialType(OBJECT_SELF); + int iKillerRace = GetRacialType(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() {} diff --git a/nwnds_module/_omap_trans01.utp b/nwnds_module/_omap_trans01.utp new file mode 100644 index 000000000..92cf6c8e8 Binary files /dev/null and b/nwnds_module/_omap_trans01.utp differ diff --git a/nwnds_module/_well001.utp b/nwnds_module/_well001.utp new file mode 100644 index 000000000..2cc864505 Binary files /dev/null and b/nwnds_module/_well001.utp differ diff --git a/nwnds_module/aarakocra001.utc b/nwnds_module/aarakocra001.utc new file mode 100644 index 000000000..7a4e8216d Binary files /dev/null and b/nwnds_module/aarakocra001.utc differ diff --git a/nwnds_module/aarakocra002.utc b/nwnds_module/aarakocra002.utc new file mode 100644 index 000000000..974b3cde8 Binary files /dev/null and b/nwnds_module/aarakocra002.utc differ diff --git a/nwnds_module/aarakocra003.utc b/nwnds_module/aarakocra003.utc new file mode 100644 index 000000000..64ba48d3d Binary files /dev/null and b/nwnds_module/aarakocra003.utc differ diff --git a/nwnds_module/aarakocra004.utc b/nwnds_module/aarakocra004.utc new file mode 100644 index 000000000..d4a00ec9e Binary files /dev/null and b/nwnds_module/aarakocra004.utc differ diff --git a/nwnds_module/aarakocra005.utc b/nwnds_module/aarakocra005.utc new file mode 100644 index 000000000..e906527ae Binary files /dev/null and b/nwnds_module/aarakocra005.utc differ diff --git a/nwnds_module/aarakocra006.utc b/nwnds_module/aarakocra006.utc new file mode 100644 index 000000000..946beea10 Binary files /dev/null and b/nwnds_module/aarakocra006.utc differ diff --git a/nwnds_module/abandoned_town.are b/nwnds_module/abandoned_town.are new file mode 100644 index 000000000..98dfb8d4e Binary files /dev/null and b/nwnds_module/abandoned_town.are differ diff --git a/nwnds_module/abandoned_town.gic b/nwnds_module/abandoned_town.gic new file mode 100644 index 000000000..af73c2e4a Binary files /dev/null and b/nwnds_module/abandoned_town.gic differ diff --git a/nwnds_module/abandoned_town.git b/nwnds_module/abandoned_town.git new file mode 100644 index 000000000..b120c1e69 Binary files /dev/null and b/nwnds_module/abandoned_town.git differ diff --git a/nwnds_module/abtwn_abanhouse.are b/nwnds_module/abtwn_abanhouse.are new file mode 100644 index 000000000..4f348eee0 Binary files /dev/null and b/nwnds_module/abtwn_abanhouse.are differ diff --git a/nwnds_module/abtwn_abanhouse.gic b/nwnds_module/abtwn_abanhouse.gic new file mode 100644 index 000000000..406bcfd7f Binary files /dev/null and b/nwnds_module/abtwn_abanhouse.gic differ diff --git a/nwnds_module/abtwn_abanhouse.git b/nwnds_module/abtwn_abanhouse.git new file mode 100644 index 000000000..6ca96d972 Binary files /dev/null and b/nwnds_module/abtwn_abanhouse.git differ diff --git a/nwnds_module/abtwn_abanshop.are b/nwnds_module/abtwn_abanshop.are new file mode 100644 index 000000000..0c84e0e12 Binary files /dev/null and b/nwnds_module/abtwn_abanshop.are differ diff --git a/nwnds_module/abtwn_abanshop.gic b/nwnds_module/abtwn_abanshop.gic new file mode 100644 index 000000000..2dad91228 Binary files /dev/null and b/nwnds_module/abtwn_abanshop.gic differ diff --git a/nwnds_module/abtwn_abanshop.git b/nwnds_module/abtwn_abanshop.git new file mode 100644 index 000000000..58ea1fec9 Binary files /dev/null and b/nwnds_module/abtwn_abanshop.git differ diff --git a/nwnds_module/abtwn_arkanos.are b/nwnds_module/abtwn_arkanos.are new file mode 100644 index 000000000..2722dd46f Binary files /dev/null and b/nwnds_module/abtwn_arkanos.are differ diff --git a/nwnds_module/abtwn_arkanos.gic b/nwnds_module/abtwn_arkanos.gic new file mode 100644 index 000000000..3eefc02f2 Binary files /dev/null and b/nwnds_module/abtwn_arkanos.gic differ diff --git a/nwnds_module/abtwn_arkanos.git b/nwnds_module/abtwn_arkanos.git new file mode 100644 index 000000000..3ea3dd452 Binary files /dev/null and b/nwnds_module/abtwn_arkanos.git differ diff --git a/nwnds_module/acid_cloud1.ncs b/nwnds_module/acid_cloud1.ncs new file mode 100644 index 000000000..e9706dca9 Binary files /dev/null and b/nwnds_module/acid_cloud1.ncs differ diff --git a/nwnds_module/acid_cloud1.nss b/nwnds_module/acid_cloud1.nss new file mode 100644 index 000000000..ba0efb746 --- /dev/null +++ b/nwnds_module/acid_cloud1.nss @@ -0,0 +1,14 @@ +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster ) + return; + + effect eAcid = EffectDamage(d6(6),DAMAGE_TYPE_ACID); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcid,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +} diff --git a/nwnds_module/acid_cloud2.ncs b/nwnds_module/acid_cloud2.ncs new file mode 100644 index 000000000..588c8fc78 Binary files /dev/null and b/nwnds_module/acid_cloud2.ncs differ diff --git a/nwnds_module/acid_cloud2.nss b/nwnds_module/acid_cloud2.nss new file mode 100644 index 000000000..902722567 --- /dev/null +++ b/nwnds_module/acid_cloud2.nss @@ -0,0 +1,21 @@ +void main() +{ + effect eAcid; + effect eVis = EffectVisualEffect(VFX_IMP_ACID_S); + + object oCaster = GetAreaOfEffectCreator(); + + object oTarget = GetFirstInPersistentObject(); + + while ( GetIsObjectValid(oTarget ) ) + { + if ( GetIsEnemy(oTarget,oCaster) ) + { + eAcid = EffectDamage(d6(6),DAMAGE_TYPE_ACID); + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcid,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/acid_cloud_aura.ncs b/nwnds_module/acid_cloud_aura.ncs new file mode 100644 index 000000000..16449d22b Binary files /dev/null and b/nwnds_module/acid_cloud_aura.ncs differ diff --git a/nwnds_module/acid_cloud_aura.nss b/nwnds_module/acid_cloud_aura.nss new file mode 100644 index 000000000..971eec050 --- /dev/null +++ b/nwnds_module/acid_cloud_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_PER_FOGACID,"acid_cloud1","acid_cloud2","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/actjumptoalt.ncs b/nwnds_module/actjumptoalt.ncs new file mode 100644 index 000000000..2055703fb Binary files /dev/null and b/nwnds_module/actjumptoalt.ncs differ diff --git a/nwnds_module/actjumptoalt.nss b/nwnds_module/actjumptoalt.nss new file mode 100644 index 000000000..a278397e4 --- /dev/null +++ b/nwnds_module/actjumptoalt.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_AltCaravan")))); +} diff --git a/nwnds_module/actjumptoblue.ncs b/nwnds_module/actjumptoblue.ncs new file mode 100644 index 000000000..5f2ba9e81 Binary files /dev/null and b/nwnds_module/actjumptoblue.ncs differ diff --git a/nwnds_module/actjumptoblue.nss b/nwnds_module/actjumptoblue.nss new file mode 100644 index 000000000..76c141338 --- /dev/null +++ b/nwnds_module/actjumptoblue.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_BlueRiver")))); +} diff --git a/nwnds_module/actjumptored.ncs b/nwnds_module/actjumptored.ncs new file mode 100644 index 000000000..af83440f0 Binary files /dev/null and b/nwnds_module/actjumptored.ncs differ diff --git a/nwnds_module/actjumptored.nss b/nwnds_module/actjumptored.nss new file mode 100644 index 000000000..a0ef78c72 --- /dev/null +++ b/nwnds_module/actjumptored.nss @@ -0,0 +1,5 @@ +void main() +{ +TakeGoldFromCreature(500, GetPCSpeaker(), TRUE); +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_RedRiver")))); +} diff --git a/nwnds_module/adjustability.nss b/nwnds_module/adjustability.nss new file mode 100644 index 000000000..35f0fdbca --- /dev/null +++ b/nwnds_module/adjustability.nss @@ -0,0 +1,25 @@ +void AdjustAbility (int Ability, int Amount); + +void AdjustAbility (int Ability, int Amount) + { + object oSpeaker; + int Score; + effect eAbility, eAdjustAbility; + + oSpeaker = GetPCSpeaker(); + + if (Amount<0) + { + eAbility=EffectAbilityDecrease(Ability,abs(Amount)); + eAdjustAbility=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE,FALSE); + } + else + { + eAbility=EffectAbilityIncrease(Ability,Amount); + eAdjustAbility=EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE,FALSE); + } + + eAbility=ExtraordinaryEffect(eAbility); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eAdjustAbility, oSpeaker, 0.5); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAbility, oSpeaker, 0.0); + } diff --git a/nwnds_module/advanced_ai.ncs b/nwnds_module/advanced_ai.ncs new file mode 100644 index 000000000..b5098b9ce Binary files /dev/null and b/nwnds_module/advanced_ai.ncs differ diff --git a/nwnds_module/advanced_ai.nss b/nwnds_module/advanced_ai.nss new file mode 100644 index 000000000..dce8c2eeb --- /dev/null +++ b/nwnds_module/advanced_ai.nss @@ -0,0 +1,232 @@ + +#include "nw_i0_generic" +#include "x2_inc_switches" +#include "inc_AI" + +void DoPhysical( object oTarget ) +{ + if ( !GetIsObjectValid(oTarget) || !GetIsEnemy(oTarget) ) + { + oTarget = GetNearestEnemy(); + if ( !GetIsObjectValid(oTarget) ) + return; + } + object oEquip = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if ( GetDistanceToObject(oTarget) > FeetToMeters(20.0) ) + { + if ( !GetIsObjectValid( oEquip ) || !GetWeaponRanged( oEquip ) ) + ActionEquipMostDamagingRanged(); + ActionAttack(oTarget); + } + else + { + if ( !GetIsObjectValid( oEquip ) || GetWeaponRanged( oEquip ) ) + ActionEquipMostDamagingMelee(); + TalentMeleeAttack(oTarget); + } + SetCreatureOverrideAIScriptFinished(); + +} + +void main() +{ + // The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + if ( !GetCanAct(OBJECT_SELF) ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + + int bAura = GetLocalInt(OBJECT_SELF,"aura"); + if ( !bAura ) + { +// ActionCastFakeSpellAtLocation(SPELL_SUMMON_SHADOW,GetLocation(OBJECT_SELF)); + + + string sScript = GetLocalString(OBJECT_SELF,"Aura_Script"); +// SpeakString("Running script " + sScript,TALKVOLUME_SHOUT); + +// ClearAllActions(); + if ( sScript != "" ) + ExecuteScript(sScript,OBJECT_SELF); + +// SetCreatureOverrideAIScriptFinished(); + SetLocalInt(OBJECT_SELF,"aura",1); + return; + } + +/* if ( d6() == 1 ) // in case they get busy-stuck, also to add randomness + { + SetLocalInt(OBJECT_SELF,"busy",FALSE); + return; + } */ + // Don't inturupt actions in progress + + + if ( GetCurrentAction() == ACTION_CASTSPELL ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + + if ( GetLocalInt(OBJECT_SELF,"physical") ) + { + ClearAllActions(); + DoPhysical(oIntruder); + return; + } + // Haste = Super awesome; + if ( !GetHasEffect(EFFECT_TYPE_HASTE ) && ( GetHasSpell(SPELL_HASTE) || + GetHasSpell(SPELL_MASS_HASTE) ) ) + { +// SpeakString("Time for haste!!!"); + + if ( GetHasSpell(SPELL_MASS_HASTE) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_MASS_HASTE,OBJECT_SELF); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetHasSpell(SPELL_HASTE) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_HASTE,OBJECT_SELF); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + SpeakString("WTF HASTE ERROR!!!"); + } + + // Get those summons in there! + if ( GetHasSpell(SPELL_ELEMENTAL_SWARM) ) + { + ClearAllActions(); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + PlayVoiceChat(VOICE_CHAT_HELP); + ActionCastSpellAtObject(SPELL_ELEMENTAL_SWARM,OBJECT_SELF); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( TalentSummonAllies() ) + { +// SpeakString("Come to my side! Battle awaits!"); + PlayVoiceChat(VOICE_CHAT_HELP); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + + + // Hostile targeting actions + if ( !GetIsObjectValid(oIntruder) || !GetIsReactionTypeHostile(oIntruder) ) + { + oIntruder = GetNearestPerceivedEnemy(); + if ( !GetIsObjectValid(oIntruder) ) + return; + } + + // Dispel Casters + if ( !GetLocalInt(OBJECT_SELF,"Dispel_once") && + ( GetLevelByClass(CLASS_TYPE_SORCERER, oIntruder) >= 10 || + GetLevelByClass(CLASS_TYPE_WIZARD, oIntruder) >= 10 || + GetLevelByClass(CLASS_TYPE_CLERIC, oIntruder) >= 10 || + GetLevelByClass(CLASS_TYPE_SORCERER, oIntruder) >= 10 || + GetLevelByClass(CLASS_TYPE_DRUID, oIntruder) >= 10 ) ) + { + if ( GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION) || + GetHasSpell(SPELL_GREATER_DISPELLING) || + GetHasSpell(SPELL_DISPEL_MAGIC) || + GetHasSpell(SPELL_GREATER_SPELL_BREACH) || + GetHasSpell(SPELL_LESSER_SPELL_BREACH) ) + { + SetLocalInt(OBJECT_SELF,"Dispel_once",1); +// SpeakString("I will dispel you!!"); + if ( GetHasSpell(SPELL_GREATER_SPELL_BREACH) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_GREATER_SPELL_BREACH,oIntruder); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetHasSpell(SPELL_LESSER_SPELL_BREACH) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_LESSER_SPELL_BREACH,oIntruder); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_MORDENKAINENS_DISJUNCTION,oIntruder); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetHasSpell(SPELL_GREATER_DISPELLING) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_GREATER_DISPELLING,oIntruder); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetHasSpell(SPELL_DISPEL_MAGIC) ) + { + ClearActions(1001); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); + ActionCastSpellAtObject(SPELL_DISPEL_MAGIC,oIntruder); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + SpeakString("WTF! Dispel Error!"); + } + } + + // Melee up sometimes! + + + if ( d10() == 10 ) + { + switch ( d4() ) + { + case 1: + PlayVoiceChat(VOICE_CHAT_BATTLECRY1); + break; + case 2: + PlayVoiceChat(VOICE_CHAT_ATTACK); + break; + case 3: + PlayVoiceChat(VOICE_CHAT_BATTLECRY2); + break; + case 4: + PlayVoiceChat(VOICE_CHAT_BATTLECRY3); + break; + } + + SetLocalInt(OBJECT_SELF,"physical",1); + DelayCommand(24.0,SetLocalInt(OBJECT_SELF,"physical",0)); + ClearAllActions(); + DoPhysical(oIntruder); + return; + } +} + + + diff --git a/nwnds_module/aer_ser_slam.ncs b/nwnds_module/aer_ser_slam.ncs new file mode 100644 index 000000000..7b38ad2b4 Binary files /dev/null and b/nwnds_module/aer_ser_slam.ncs differ diff --git a/nwnds_module/aer_ser_slam.nss b/nwnds_module/aer_ser_slam.nss new file mode 100644 index 000000000..da32b2d7c --- /dev/null +++ b/nwnds_module/aer_ser_slam.nss @@ -0,0 +1,70 @@ +// Choke Attack - Item Unique OnHit Script +// + +//#include "nw_i0_spells" +//#include "x2_inc_spellhook" +//#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d8(2)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + effect eChoke = EffectSilence(); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d8+STR Bonus bludgeoning damage & choke the victim. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eChoke, oTarget, 9.0f); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the choke attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to choke you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is choking you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/aer_ser_slam.uti b/nwnds_module/aer_ser_slam.uti new file mode 100644 index 000000000..80b939fea Binary files /dev/null and b/nwnds_module/aer_ser_slam.uti differ diff --git a/nwnds_module/aerservantprops.uti b/nwnds_module/aerservantprops.uti new file mode 100644 index 000000000..7a4b3eacc Binary files /dev/null and b/nwnds_module/aerservantprops.uti differ diff --git a/nwnds_module/air_cleric.ncs b/nwnds_module/air_cleric.ncs new file mode 100644 index 000000000..e42953a77 Binary files /dev/null and b/nwnds_module/air_cleric.ncs differ diff --git a/nwnds_module/air_cleric.nss b/nwnds_module/air_cleric.nss new file mode 100644 index 000000000..349e89d0d --- /dev/null +++ b/nwnds_module/air_cleric.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If the don't have air domain, unequip the item + if(!GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/airdrakeprops.uti b/nwnds_module/airdrakeprops.uti new file mode 100644 index 000000000..6b018f513 Binary files /dev/null and b/nwnds_module/airdrakeprops.uti differ diff --git a/nwnds_module/airdraketail.uti b/nwnds_module/airdraketail.uti new file mode 100644 index 000000000..881b638da Binary files /dev/null and b/nwnds_module/airdraketail.uti differ diff --git a/nwnds_module/airlessaura.ncs b/nwnds_module/airlessaura.ncs new file mode 100644 index 000000000..78fff5361 Binary files /dev/null and b/nwnds_module/airlessaura.ncs differ diff --git a/nwnds_module/airlessaura.nss b/nwnds_module/airlessaura.nss new file mode 100644 index 000000000..92e18fc98 --- /dev/null +++ b/nwnds_module/airlessaura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_UNEARTHLY,"airlessaura1","airlessaura2","airlessaura3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/airlessaura1.ncs b/nwnds_module/airlessaura1.ncs new file mode 100644 index 000000000..4d853e280 Binary files /dev/null and b/nwnds_module/airlessaura1.ncs differ diff --git a/nwnds_module/airlessaura1.nss b/nwnds_module/airlessaura1.nss new file mode 100644 index 000000000..a9adb6be6 --- /dev/null +++ b/nwnds_module/airlessaura1.nss @@ -0,0 +1,14 @@ +#include "NW_I0_SPELLS" +#include "inc_suffocate" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + + if(GetIsEnemy(oTarget, oCaster)) + { + Suffocate(oTarget); + } +} diff --git a/nwnds_module/airlessaura2.ncs b/nwnds_module/airlessaura2.ncs new file mode 100644 index 000000000..e19b6b806 Binary files /dev/null and b/nwnds_module/airlessaura2.ncs differ diff --git a/nwnds_module/airlessaura2.nss b/nwnds_module/airlessaura2.nss new file mode 100644 index 000000000..3c1aec885 --- /dev/null +++ b/nwnds_module/airlessaura2.nss @@ -0,0 +1,18 @@ +#include "NW_I0_SPELLS" +#include "inc_suffocate" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetFirstInPersistentObject(); + + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + Suffocate(oTarget); + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/airlessaura3.ncs b/nwnds_module/airlessaura3.ncs new file mode 100644 index 000000000..19cc2b5af Binary files /dev/null and b/nwnds_module/airlessaura3.ncs differ diff --git a/nwnds_module/airlessaura3.nss b/nwnds_module/airlessaura3.nss new file mode 100644 index 000000000..609189f9b --- /dev/null +++ b/nwnds_module/airlessaura3.nss @@ -0,0 +1,12 @@ +//#include "NW_I0_SPELLS" +//#include "x2_inc_spellhook" +#include "inc_suffocate" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + + GiveBreath(oTarget); +} diff --git a/nwnds_module/alabasenthide.uti b/nwnds_module/alabasenthide.uti new file mode 100644 index 000000000..92dc1e381 Binary files /dev/null and b/nwnds_module/alabasenthide.uti differ diff --git a/nwnds_module/alabasenttoga.uti b/nwnds_module/alabasenttoga.uti new file mode 100644 index 000000000..f3d936e9c Binary files /dev/null and b/nwnds_module/alabasenttoga.uti differ diff --git a/nwnds_module/alc_imbue_weapon.ncs b/nwnds_module/alc_imbue_weapon.ncs new file mode 100644 index 000000000..1f78519cf Binary files /dev/null and b/nwnds_module/alc_imbue_weapon.ncs differ diff --git a/nwnds_module/alc_imbue_weapon.nss b/nwnds_module/alc_imbue_weapon.nss new file mode 100644 index 000000000..b27671de4 --- /dev/null +++ b/nwnds_module/alc_imbue_weapon.nss @@ -0,0 +1,64 @@ +object oAlc = OBJECT_SELF; +string sTag1,sTag2,sTag3,sTag4,sType,sTag = ""; +string sReg1,sReg2,sReg3,sReg4 = ""; +object oPC = GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +object oItem; +string sItem = ""; +int nStack = 1; +void main() +{ +// Set up first reagent + +sTag = GetTag(GetInventoryDisturbItem()); +if (sTag == "kartangegg") { +SetLocalString(oAlc, "Reg1", "i"); +//FloatingTextStringOnCreature("Debug "+ sTag,oPC,FALSE); +DestroyObject(GetInventoryDisturbItem()); +} + +if (sTag == "drakeblood") { +SetLocalString(oAlc, "Reg1", "df"); +//FloatingTextStringOnCreature("Debug "+ sTag,oPC,FALSE); +DestroyObject(GetInventoryDisturbItem()); +} + + + +if (sTag == "Brimstone" || sTag == "IceNine" || sTag == "AcidCrystal" || sTag == "ChargedCrystal") { +if (sTag == "Brimstone") +sType = "f"; +if (sTag == "IceNine") +sType = "i"; +if (sTag == "AcidCrystal") +sType = "a"; +if (sTag == "ChargedCrystal") +sType = "c"; +SetLocalString(oAlc, "Reg3", sType); +//FloatingTextStringOnCreature("Debug "+ sTag+" "+sType,oPC,FALSE); +DestroyObject(GetInventoryDisturbItem()); +} + +sTag = GetStringLowerCase(sTag); // temp while we fix tags +if (GetSubString(sTag,0,5) == "steel") { +SetLocalString(oAlc, "Reg2", GetSubString(sTag,5,20)); +DestroyObject(GetInventoryDisturbItem()); +//FloatingTextStringOnCreature("Debug "+sTag+" "+GetSubString(sTag,5,20),oPC,FALSE); +} + + +if ((GetLocalString(oAlc, "Reg1") != "") && (GetLocalString(oAlc, "Reg2") != "") && (GetLocalString(oAlc, "Reg3") != "")){ +sItem = GetLocalString(oAlc, "Reg1")+GetLocalString(oAlc, "Reg3")+ GetLocalString(oAlc, "Reg2"); +DeleteLocalString(oAlc, "Reg1"); +DeleteLocalString(oAlc, "Reg2"); +DeleteLocalString(oAlc, "Reg3"); +} + + + +if (sItem != "") { +//sItem = "Nothing was created with that formula"; +//FloatingTextStringOnCreature("You made "+ sItem,oPC,FALSE); +CreateItemOnObject(sItem, oAlc, nStack); +} + +} diff --git a/nwnds_module/alchemy_table.utp b/nwnds_module/alchemy_table.utp new file mode 100644 index 000000000..9fe18026b Binary files /dev/null and b/nwnds_module/alchemy_table.utp differ diff --git a/nwnds_module/algoidhide.uti b/nwnds_module/algoidhide.uti new file mode 100644 index 000000000..fa13fb20b Binary files /dev/null and b/nwnds_module/algoidhide.uti differ diff --git a/nwnds_module/algoidslam_l.uti b/nwnds_module/algoidslam_l.uti new file mode 100644 index 000000000..f5610a84d Binary files /dev/null and b/nwnds_module/algoidslam_l.uti differ diff --git a/nwnds_module/alt_altaruk.are b/nwnds_module/alt_altaruk.are new file mode 100644 index 000000000..64a617242 Binary files /dev/null and b/nwnds_module/alt_altaruk.are differ diff --git a/nwnds_module/alt_altaruk.gic b/nwnds_module/alt_altaruk.gic new file mode 100644 index 000000000..177fe93e3 Binary files /dev/null and b/nwnds_module/alt_altaruk.gic differ diff --git a/nwnds_module/alt_altaruk.git b/nwnds_module/alt_altaruk.git new file mode 100644 index 000000000..d057af779 Binary files /dev/null and b/nwnds_module/alt_altaruk.git differ diff --git a/nwnds_module/alt_caravanmstr.are b/nwnds_module/alt_caravanmstr.are new file mode 100644 index 000000000..640c91d27 Binary files /dev/null and b/nwnds_module/alt_caravanmstr.are differ diff --git a/nwnds_module/alt_caravanmstr.gic b/nwnds_module/alt_caravanmstr.gic new file mode 100644 index 000000000..eb93046a0 Binary files /dev/null and b/nwnds_module/alt_caravanmstr.gic differ diff --git a/nwnds_module/alt_caravanmstr.git b/nwnds_module/alt_caravanmstr.git new file mode 100644 index 000000000..82e76ae7e Binary files /dev/null and b/nwnds_module/alt_caravanmstr.git differ diff --git a/nwnds_module/alt_craftshop.are b/nwnds_module/alt_craftshop.are new file mode 100644 index 000000000..942c7d9b4 Binary files /dev/null and b/nwnds_module/alt_craftshop.are differ diff --git a/nwnds_module/alt_craftshop.gic b/nwnds_module/alt_craftshop.gic new file mode 100644 index 000000000..c85e1a7d8 Binary files /dev/null and b/nwnds_module/alt_craftshop.gic differ diff --git a/nwnds_module/alt_craftshop.git b/nwnds_module/alt_craftshop.git new file mode 100644 index 000000000..eb221b0ab Binary files /dev/null and b/nwnds_module/alt_craftshop.git differ diff --git a/nwnds_module/alt_dockmaster.are b/nwnds_module/alt_dockmaster.are new file mode 100644 index 000000000..157bfd139 Binary files /dev/null and b/nwnds_module/alt_dockmaster.are differ diff --git a/nwnds_module/alt_dockmaster.gic b/nwnds_module/alt_dockmaster.gic new file mode 100644 index 000000000..6eb24ab3d Binary files /dev/null and b/nwnds_module/alt_dockmaster.gic differ diff --git a/nwnds_module/alt_dockmaster.git b/nwnds_module/alt_dockmaster.git new file mode 100644 index 000000000..8ebe42a0b Binary files /dev/null and b/nwnds_module/alt_dockmaster.git differ diff --git a/nwnds_module/alt_easternout.are b/nwnds_module/alt_easternout.are new file mode 100644 index 000000000..bd74850e0 Binary files /dev/null and b/nwnds_module/alt_easternout.are differ diff --git a/nwnds_module/alt_easternout.gic b/nwnds_module/alt_easternout.gic new file mode 100644 index 000000000..7605df744 Binary files /dev/null and b/nwnds_module/alt_easternout.gic differ diff --git a/nwnds_module/alt_easternout.git b/nwnds_module/alt_easternout.git new file mode 100644 index 000000000..10464689e Binary files /dev/null and b/nwnds_module/alt_easternout.git differ diff --git a/nwnds_module/alt_gameroom.are b/nwnds_module/alt_gameroom.are new file mode 100644 index 000000000..030685e86 Binary files /dev/null and b/nwnds_module/alt_gameroom.are differ diff --git a/nwnds_module/alt_gameroom.gic b/nwnds_module/alt_gameroom.gic new file mode 100644 index 000000000..729d0896e Binary files /dev/null and b/nwnds_module/alt_gameroom.gic differ diff --git a/nwnds_module/alt_gameroom.git b/nwnds_module/alt_gameroom.git new file mode 100644 index 000000000..25cdf87d4 Binary files /dev/null and b/nwnds_module/alt_gameroom.git differ diff --git a/nwnds_module/alt_gelradesinn.are b/nwnds_module/alt_gelradesinn.are new file mode 100644 index 000000000..d4ff9e014 Binary files /dev/null and b/nwnds_module/alt_gelradesinn.are differ diff --git a/nwnds_module/alt_gelradesinn.gic b/nwnds_module/alt_gelradesinn.gic new file mode 100644 index 000000000..3c995e7d4 Binary files /dev/null and b/nwnds_module/alt_gelradesinn.gic differ diff --git a/nwnds_module/alt_gelradesinn.git b/nwnds_module/alt_gelradesinn.git new file mode 100644 index 000000000..df971f735 Binary files /dev/null and b/nwnds_module/alt_gelradesinn.git differ diff --git a/nwnds_module/alt_hairyspider.are b/nwnds_module/alt_hairyspider.are new file mode 100644 index 000000000..5ed964038 Binary files /dev/null and b/nwnds_module/alt_hairyspider.are differ diff --git a/nwnds_module/alt_hairyspider.gic b/nwnds_module/alt_hairyspider.gic new file mode 100644 index 000000000..1ea59446f Binary files /dev/null and b/nwnds_module/alt_hairyspider.gic differ diff --git a/nwnds_module/alt_hairyspider.git b/nwnds_module/alt_hairyspider.git new file mode 100644 index 000000000..c154b79ed Binary files /dev/null and b/nwnds_module/alt_hairyspider.git differ diff --git a/nwnds_module/alt_healers.are b/nwnds_module/alt_healers.are new file mode 100644 index 000000000..cdbddde52 Binary files /dev/null and b/nwnds_module/alt_healers.are differ diff --git a/nwnds_module/alt_healers.gic b/nwnds_module/alt_healers.gic new file mode 100644 index 000000000..075ff5a67 Binary files /dev/null and b/nwnds_module/alt_healers.gic differ diff --git a/nwnds_module/alt_healers.git b/nwnds_module/alt_healers.git new file mode 100644 index 000000000..7fad71bbb Binary files /dev/null and b/nwnds_module/alt_healers.git differ diff --git a/nwnds_module/alt_housereestc.are b/nwnds_module/alt_housereestc.are new file mode 100644 index 000000000..ea797a4ff Binary files /dev/null and b/nwnds_module/alt_housereestc.are differ diff --git a/nwnds_module/alt_housereestc.gic b/nwnds_module/alt_housereestc.gic new file mode 100644 index 000000000..d891cb6ff Binary files /dev/null and b/nwnds_module/alt_housereestc.gic differ diff --git a/nwnds_module/alt_housereestc.git b/nwnds_module/alt_housereestc.git new file mode 100644 index 000000000..6de020798 Binary files /dev/null and b/nwnds_module/alt_housereestc.git differ diff --git a/nwnds_module/alt_mayorshouse.are b/nwnds_module/alt_mayorshouse.are new file mode 100644 index 000000000..3d5e46e32 Binary files /dev/null and b/nwnds_module/alt_mayorshouse.are differ diff --git a/nwnds_module/alt_mayorshouse.gic b/nwnds_module/alt_mayorshouse.gic new file mode 100644 index 000000000..b2a0dea2d Binary files /dev/null and b/nwnds_module/alt_mayorshouse.gic differ diff --git a/nwnds_module/alt_mayorshouse.git b/nwnds_module/alt_mayorshouse.git new file mode 100644 index 000000000..f56920884 Binary files /dev/null and b/nwnds_module/alt_mayorshouse.git differ diff --git a/nwnds_module/alt_tomblador_tp.are b/nwnds_module/alt_tomblador_tp.are new file mode 100644 index 000000000..85314dc4c Binary files /dev/null and b/nwnds_module/alt_tomblador_tp.are differ diff --git a/nwnds_module/alt_tomblador_tp.gic b/nwnds_module/alt_tomblador_tp.gic new file mode 100644 index 000000000..f828f5d44 Binary files /dev/null and b/nwnds_module/alt_tomblador_tp.gic differ diff --git a/nwnds_module/alt_tomblador_tp.git b/nwnds_module/alt_tomblador_tp.git new file mode 100644 index 000000000..a6a832b55 Binary files /dev/null and b/nwnds_module/alt_tomblador_tp.git differ diff --git a/nwnds_module/alt_waviramory.are b/nwnds_module/alt_waviramory.are new file mode 100644 index 000000000..2826e9177 Binary files /dev/null and b/nwnds_module/alt_waviramory.are differ diff --git a/nwnds_module/alt_waviramory.gic b/nwnds_module/alt_waviramory.gic new file mode 100644 index 000000000..5de5c4181 Binary files /dev/null and b/nwnds_module/alt_waviramory.gic differ diff --git a/nwnds_module/alt_waviramory.git b/nwnds_module/alt_waviramory.git new file mode 100644 index 000000000..c7deb2f43 Binary files /dev/null and b/nwnds_module/alt_waviramory.git differ diff --git a/nwnds_module/alt_zulshouse.are b/nwnds_module/alt_zulshouse.are new file mode 100644 index 000000000..74833359b Binary files /dev/null and b/nwnds_module/alt_zulshouse.are differ diff --git a/nwnds_module/alt_zulshouse.gic b/nwnds_module/alt_zulshouse.gic new file mode 100644 index 000000000..c018708a5 Binary files /dev/null and b/nwnds_module/alt_zulshouse.gic differ diff --git a/nwnds_module/alt_zulshouse.git b/nwnds_module/alt_zulshouse.git new file mode 100644 index 000000000..e34e73653 Binary files /dev/null and b/nwnds_module/alt_zulshouse.git differ diff --git a/nwnds_module/am_maphelp.ncs b/nwnds_module/am_maphelp.ncs new file mode 100644 index 000000000..99ecd51f0 Binary files /dev/null and b/nwnds_module/am_maphelp.ncs differ diff --git a/nwnds_module/am_maphelp.nss b/nwnds_module/am_maphelp.nss new file mode 100644 index 000000000..2fa80244c --- /dev/null +++ b/nwnds_module/am_maphelp.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName: am_maphelp +//:: Copyright (c) 2006 Bioware Corp. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Alan Miranda +//:: Created On: June 14, 2007 +//::////////////////////////////////////////////// + + +void main() +{ + object oPC = GetPlaceableLastClickedBy(); + object oHelp = GetNearestObjectByTag("wm_help", OBJECT_SELF); + + PlaySound("gui_button"); + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, ActionExamine(oHelp)); +} diff --git a/nwnds_module/ambient_hb.ncs b/nwnds_module/ambient_hb.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ambient_hb.ncs differ diff --git a/nwnds_module/ambient_hb.nss b/nwnds_module/ambient_hb.nss new file mode 100644 index 000000000..8dbf3f240 --- /dev/null +++ b/nwnds_module/ambient_hb.nss @@ -0,0 +1,4 @@ +void main() +{ + +} diff --git a/nwnds_module/amphisbaenabite.uti b/nwnds_module/amphisbaenabite.uti new file mode 100644 index 000000000..c1bbcedc5 Binary files /dev/null and b/nwnds_module/amphisbaenabite.uti differ diff --git a/nwnds_module/amphisbaenahide.uti b/nwnds_module/amphisbaenahide.uti new file mode 100644 index 000000000..3ede8208c Binary files /dev/null and b/nwnds_module/amphisbaenahide.uti differ diff --git a/nwnds_module/anakore1.utc b/nwnds_module/anakore1.utc new file mode 100644 index 000000000..4e18d0967 Binary files /dev/null and b/nwnds_module/anakore1.utc differ diff --git a/nwnds_module/anakorebite.uti b/nwnds_module/anakorebite.uti new file mode 100644 index 000000000..b503657eb Binary files /dev/null and b/nwnds_module/anakorebite.uti differ diff --git a/nwnds_module/angelofdecay001.utc b/nwnds_module/angelofdecay001.utc new file mode 100644 index 000000000..e48f3fe07 Binary files /dev/null and b/nwnds_module/angelofdecay001.utc differ diff --git a/nwnds_module/angelofdecay_ai.ncs b/nwnds_module/angelofdecay_ai.ncs new file mode 100644 index 000000000..f2b68f4e1 Binary files /dev/null and b/nwnds_module/angelofdecay_ai.ncs differ diff --git a/nwnds_module/angelofdecay_ai.nss b/nwnds_module/angelofdecay_ai.nss new file mode 100644 index 000000000..8d9a4b387 --- /dev/null +++ b/nwnds_module/angelofdecay_ai.nss @@ -0,0 +1,28 @@ +#include "nw_i0_generic" +#include "x2_inc_switches" +#include "inc_AI" + +void main() +{ + // The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + + if ( !GetCanAct(OBJECT_SELF) ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + int bAura = GetLocalInt(OBJECT_SELF,"aura"); + if ( !bAura ) + { +// ActionCastFakeSpellAtLocation(SPELL_SUMMON_SHADOW,GetLocation(OBJECT_SELF)); + + ExecuteScript("rotaura",OBJECT_SELF); + +// SetCreatureOverrideAIScriptFinished(); + SetLocalInt(OBJECT_SELF,"aura",1); + return; + } + +} diff --git a/nwnds_module/angleroozeprop.uti b/nwnds_module/angleroozeprop.uti new file mode 100644 index 000000000..2ecfe3f40 Binary files /dev/null and b/nwnds_module/angleroozeprop.uti differ diff --git a/nwnds_module/angleroozeslam.uti b/nwnds_module/angleroozeslam.uti new file mode 100644 index 000000000..35644647a Binary files /dev/null and b/nwnds_module/angleroozeslam.uti differ diff --git a/nwnds_module/ankheg001.utc b/nwnds_module/ankheg001.utc new file mode 100644 index 000000000..259b5cab9 Binary files /dev/null and b/nwnds_module/ankheg001.utc differ diff --git a/nwnds_module/ankheg002.utc b/nwnds_module/ankheg002.utc new file mode 100644 index 000000000..f1c468947 Binary files /dev/null and b/nwnds_module/ankheg002.utc differ diff --git a/nwnds_module/ankheg003.utc b/nwnds_module/ankheg003.utc new file mode 100644 index 000000000..b5a421d46 Binary files /dev/null and b/nwnds_module/ankheg003.utc differ diff --git a/nwnds_module/ankhegbite.uti b/nwnds_module/ankhegbite.uti new file mode 100644 index 000000000..55c6c8e09 Binary files /dev/null and b/nwnds_module/ankhegbite.uti differ diff --git a/nwnds_module/antloid001.utc b/nwnds_module/antloid001.utc new file mode 100644 index 000000000..02f052597 Binary files /dev/null and b/nwnds_module/antloid001.utc differ diff --git a/nwnds_module/antloid002.utc b/nwnds_module/antloid002.utc new file mode 100644 index 000000000..3f8123784 Binary files /dev/null and b/nwnds_module/antloid002.utc differ diff --git a/nwnds_module/antloid003.utc b/nwnds_module/antloid003.utc new file mode 100644 index 000000000..62eafd488 Binary files /dev/null and b/nwnds_module/antloid003.utc differ diff --git a/nwnds_module/antloid004.utc b/nwnds_module/antloid004.utc new file mode 100644 index 000000000..e07e81032 Binary files /dev/null and b/nwnds_module/antloid004.utc differ diff --git a/nwnds_module/antloid005.utc b/nwnds_module/antloid005.utc new file mode 100644 index 000000000..aa12b0677 Binary files /dev/null and b/nwnds_module/antloid005.utc differ diff --git a/nwnds_module/antsoldstng001.uti b/nwnds_module/antsoldstng001.uti new file mode 100644 index 000000000..492f667e0 Binary files /dev/null and b/nwnds_module/antsoldstng001.uti differ diff --git a/nwnds_module/aod_hb.ncs b/nwnds_module/aod_hb.ncs new file mode 100644 index 000000000..7bba56bd1 Binary files /dev/null and b/nwnds_module/aod_hb.ncs differ diff --git a/nwnds_module/aod_hb.nss b/nwnds_module/aod_hb.nss new file mode 100644 index 000000000..14194ede9 --- /dev/null +++ b/nwnds_module/aod_hb.nss @@ -0,0 +1,105 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT1 +/* + Default OnHeartbeat script for NPCs. + + This script causes NPCs to perform default animations + while not otherwise engaged. + + This script duplicates the behavior of the default + script and just cleans up the code and removes + redundant conditional checks. + + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + SetLocalInt(OBJECT_SELF,"AURA_STATE",0); + // * if not runnning normal or better Ai then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + // Buff ourselves up right away if we should + if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY)) + { + // This will return TRUE if an enemy was within 40.0 m + // and we buffed ourselves up instantly to respond -- + // simulates a spellcaster with protections enabled + // already. + if(TalentAdvancedBuff(40.0)) + { + // This is a one-shot deal + SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE); + + // This return means we skip sending the user-defined + // heartbeat signal in this one case. + return; + } + } + + + if(GetHasEffect(EFFECT_TYPE_SLEEP)) + { + // If we're asleep and this is the result of sleeping + // at night, apply the floating 'z's visual effect + // every so often + + if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT)) + { + effect eVis = EffectVisualEffect(VFX_IMP_SLEEP); + if(d10() > 6) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + } + } + } + + // If we have the 'constant' waypoints flag set, walk to the next + // waypoint. + else if ( GetWalkCondition(NW_WALK_FLAG_CONSTANT) ) + { + WalkWayPoints(); + } + + // Check to see if we should be playing default animations + // - make sure we don't have any current targets + else if ( !GetIsObjectValid(GetAttemptedAttackTarget()) + && !GetIsObjectValid(GetAttemptedSpellTarget()) + // && !GetIsPostOrWalking()) + && !GetIsObjectValid(GetNearestSeenEnemy())) + { + if (GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) || GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) || + GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + // This handles special attacking/fleeing behavior + // for omnivores & herbivores. + DetermineSpecialBehavior(); + } + else if (!IsInConversation(OBJECT_SELF)) + { + if (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetIsEncounterCreature()) + { + PlayMobileAmbientAnimations(); + } + else if (GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)) + { + PlayImmobileAmbientAnimations(); + } + } + } + + // Send the user-defined event signal if specified + if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT)); + } +} + diff --git a/nwnds_module/aodhide.uti b/nwnds_module/aodhide.uti new file mode 100644 index 000000000..35f75b97e Binary files /dev/null and b/nwnds_module/aodhide.uti differ diff --git a/nwnds_module/aodrottingtouch.ncs b/nwnds_module/aodrottingtouch.ncs new file mode 100644 index 000000000..c6e58114c Binary files /dev/null and b/nwnds_module/aodrottingtouch.ncs differ diff --git a/nwnds_module/aodrottingtouch.nss b/nwnds_module/aodrottingtouch.nss new file mode 100644 index 000000000..5c7050416 --- /dev/null +++ b/nwnds_module/aodrottingtouch.nss @@ -0,0 +1,19 @@ +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + return; + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + effect eVis2 = EffectVisualEffect(VFX_IMP_HEALING_S); + int nDam = d6()+6; + effect eRot = EffectDamage(nDam); + effect eHeal = EffectHeal(5); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eRot,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oOrigin); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oOrigin); +} diff --git a/nwnds_module/aodrottingtouch.uti b/nwnds_module/aodrottingtouch.uti new file mode 100644 index 000000000..2caa3ccbf Binary files /dev/null and b/nwnds_module/aodrottingtouch.uti differ diff --git a/nwnds_module/aodwingslam.uti b/nwnds_module/aodwingslam.uti new file mode 100644 index 000000000..b00b47267 Binary files /dev/null and b/nwnds_module/aodwingslam.uti differ diff --git a/nwnds_module/aprigbite.uti b/nwnds_module/aprigbite.uti new file mode 100644 index 000000000..d6db0fec8 Binary files /dev/null and b/nwnds_module/aprigbite.uti differ diff --git a/nwnds_module/aps_include.nss b/nwnds_module/aps_include.nss new file mode 100644 index 000000000..4756f8329 --- /dev/null +++ b/nwnds_module/aps_include.nss @@ -0,0 +1,648 @@ +// Name : Avlis Persistence System include +// Purpose : Various APS/NWNX2 related functions +// Authors : Ingmar Stieger, Adam Colon, Josh Simon +// Modified : January 1st, 2005 + +// This file is licensed under the terms of the +// GNU GENERAL PUBLIC LICENSE (GPL) Version 2 + +/************************************/ +/* Return codes */ +/************************************/ + +const int SQL_ERROR = 0; +const int SQL_SUCCESS = 1; + +/************************************/ +/* Function prototypes */ +/************************************/ + +// Setup placeholders for ODBC requests and responses +void SQLInit(); + +// Execute statement in sSQL +void SQLExecDirect(string sSQL); + +// Position cursor on next row of the resultset +// Call this before using SQLGetData(). +// returns: SQL_SUCCESS if there is a row +// SQL_ERROR if there are no more rows +int SQLFetch(); + +// * deprecated. Use SQLFetch instead. +// Position cursor on first row of the resultset and name it sResultSetName +// Call this before using SQLNextRow() and SQLGetData(). +// returns: SQL_SUCCESS if result set is not empty +// SQL_ERROR is result set is empty +int SQLFirstRow(); + +// * deprecated. Use SQLFetch instead. +// Position cursor on next row of the result set sResultSetName +// returns: SQL_SUCCESS if cursor could be advanced to next row +// SQL_ERROR if there was no next row +int SQLNextRow(); + +// Return value of column iCol in the current row of result set sResultSetName +string SQLGetData(int iCol); + +// Return a string value when given a location +string APSLocationToString(location lLocation); + +// Return a location value when given the string form of the location +location APSStringToLocation(string sLocation); + +// Return a string value when given a vector +string APSVectorToString(vector vVector); + +// Return a vector value when given the string form of the vector +vector APSStringToVector(string sVector); + +// Set oObject's persistent string variable sVarName to sValue +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwdata) +void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = + 0, string sTable = "pwdata"); + +// Set oObject's persistent integer variable sVarName to iValue +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwdata) +void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = + 0, string sTable = "pwdata"); + +// Set oObject's persistent float variable sVarName to fValue +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwdata) +void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = + 0, string sTable = "pwdata"); + +// Set oObject's persistent location variable sVarName to lLocation +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwdata) +// This function converts location to a string for storage in the database. +void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = + 0, string sTable = "pwdata"); + +// Set oObject's persistent vector variable sVarName to vVector +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwdata) +// This function converts vector to a string for storage in the database. +void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration = + 0, string sTable = "pwdata"); + +// Set oObject's persistent object with sVarName to sValue +// Optional parameters: +// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) +// sTable: Name of the table where variable should be stored (default: pwobjdata) +void SetPersistentObject(object oObject, string sVarName, object oObject2, int iExpiration = + 0, string sTable = "pwobjdata"); + +// Get oObject's persistent string variable sVarName +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +// * Return value on error: "" +string GetPersistentString(object oObject, string sVarName, string sTable = "pwdata"); + +// Get oObject's persistent integer variable sVarName +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +// * Return value on error: 0 +int GetPersistentInt(object oObject, string sVarName, string sTable = "pwdata"); + +// Get oObject's persistent float variable sVarName +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +// * Return value on error: 0 +float GetPersistentFloat(object oObject, string sVarName, string sTable = "pwdata"); + +// Get oObject's persistent location variable sVarName +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +// * Return value on error: 0 +location GetPersistentLocation(object oObject, string sVarname, string sTable = "pwdata"); + +// Get oObject's persistent vector variable sVarName +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +// * Return value on error: 0 +vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwdata"); + +// Get oObject's persistent object sVarName +// Optional parameters: +// sTable: Name of the table where object is stored (default: pwobjdata) +// * Return value on error: 0 +object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata"); + +// Delete persistent variable sVarName stored on oObject +// Optional parameters: +// sTable: Name of the table where variable is stored (default: pwdata) +void DeletePersistentVariable(object oObject, string sVarName, string sTable = "pwdata"); + +// (private function) Replace special character ' with ~ +string SQLEncodeSpecialChars(string sString); + +// (private function)Replace special character ' with ~ +string SQLDecodeSpecialChars(string sString); + +/************************************/ +/* Implementation */ +/************************************/ + +// Functions for initializing APS and working with result sets + +void SQLInit() +{ + int i; + + // Placeholder for ODBC persistence + string sMemory; + + for (i = 0; i < 8; i++) // reserve 8*128 bytes + sMemory += + "................................................................................................................................"; + + SetLocalString(GetModule(), "NWNX!ODBC!SPACER", sMemory); +} + +void SQLExecDirect(string sSQL) +{ + SetLocalString(GetModule(), "NWNX!ODBC!EXEC", sSQL); +} + +int SQLFetch() +{ + string sRow; + object oModule = GetModule(); + + SetLocalString(oModule, "NWNX!ODBC!FETCH", GetLocalString(oModule, "NWNX!ODBC!SPACER")); + sRow = GetLocalString(oModule, "NWNX!ODBC!FETCH"); + if (GetStringLength(sRow) > 0) + { + SetLocalString(oModule, "NWNX_ODBC_CurrentRow", sRow); + return SQL_SUCCESS; + } + else + { + SetLocalString(oModule, "NWNX_ODBC_CurrentRow", ""); + return SQL_ERROR; + } +} + +// deprecated. use SQLFetch(). +int SQLFirstRow() +{ + return SQLFetch(); +} + +// deprecated. use SQLFetch(). +int SQLNextRow() +{ + return SQLFetch(); +} + +string SQLGetData(int iCol) +{ + int iPos; + string sResultSet = GetLocalString(GetModule(), "NWNX_ODBC_CurrentRow"); + + // find column in current row + int iCount = 0; + string sColValue = ""; + + iPos = FindSubString(sResultSet, "¬"); + if ((iPos == -1) && (iCol == 1)) + { + // only one column, return value immediately + sColValue = sResultSet; + } + else if (iPos == -1) + { + // only one column but requested column > 1 + sColValue = ""; + } + else + { + // loop through columns until found + while (iCount != iCol) + { + iCount++; + if (iCount == iCol) + sColValue = GetStringLeft(sResultSet, iPos); + else + { + sResultSet = GetStringRight(sResultSet, GetStringLength(sResultSet) - iPos - 1); + iPos = FindSubString(sResultSet, "¬"); + } + + // special case: last column in row + if (iPos == -1) + iPos = GetStringLength(sResultSet); + } + } + + return sColValue; +} + +// These functions deal with various data types. Ultimately, all information +// must be stored in the database as strings, and converted back to the proper +// form when retrieved. + +string APSVectorToString(vector vVector) +{ + return "#POSITION_X#" + FloatToString(vVector.x) + "#POSITION_Y#" + FloatToString(vVector.y) + + "#POSITION_Z#" + FloatToString(vVector.z) + "#END#"; +} + +vector APSStringToVector(string sVector) +{ + float fX, fY, fZ; + int iPos, iCount; + int iLen = GetStringLength(sVector); + + if (iLen > 0) + { + iPos = FindSubString(sVector, "#POSITION_X#") + 12; + iCount = FindSubString(GetSubString(sVector, iPos, iLen - iPos), "#"); + fX = StringToFloat(GetSubString(sVector, iPos, iCount)); + + iPos = FindSubString(sVector, "#POSITION_Y#") + 12; + iCount = FindSubString(GetSubString(sVector, iPos, iLen - iPos), "#"); + fY = StringToFloat(GetSubString(sVector, iPos, iCount)); + + iPos = FindSubString(sVector, "#POSITION_Z#") + 12; + iCount = FindSubString(GetSubString(sVector, iPos, iLen - iPos), "#"); + fZ = StringToFloat(GetSubString(sVector, iPos, iCount)); + } + + return Vector(fX, fY, fZ); +} + +string APSLocationToString(location lLocation) +{ + object oArea = GetAreaFromLocation(lLocation); + vector vPosition = GetPositionFromLocation(lLocation); + float fOrientation = GetFacingFromLocation(lLocation); + string sReturnValue; + + if (GetIsObjectValid(oArea)) + sReturnValue = + "#AREA#" + GetTag(oArea) + + "#POSITION_X#" + FloatToString(vPosition.x) + + "#POSITION_Y#" + FloatToString(vPosition.y) + + "#POSITION_Z#" + FloatToString(vPosition.z) + + "#ORIENTATION#" + FloatToString(fOrientation) + + "#END#"; + + return sReturnValue; +} + +location APSStringToLocation(string sLocation) +{ + location lReturnValue; + object oArea; + vector vPosition; + float fOrientation, fX, fY, fZ; + + int iPos, iCount; + int iLen = GetStringLength(sLocation); + + if (iLen > 0) + { + iPos = FindSubString(sLocation, "#AREA#") + 6; + iCount = FindSubString(GetSubString(sLocation, iPos, iLen - iPos), "#"); + oArea = GetObjectByTag(GetSubString(sLocation, iPos, iCount)); + + iPos = FindSubString(sLocation, "#POSITION_X#") + 12; + iCount = FindSubString(GetSubString(sLocation, iPos, iLen - iPos), "#"); + fX = StringToFloat(GetSubString(sLocation, iPos, iCount)); + + iPos = FindSubString(sLocation, "#POSITION_Y#") + 12; + iCount = FindSubString(GetSubString(sLocation, iPos, iLen - iPos), "#"); + fY = StringToFloat(GetSubString(sLocation, iPos, iCount)); + + iPos = FindSubString(sLocation, "#POSITION_Z#") + 12; + iCount = FindSubString(GetSubString(sLocation, iPos, iLen - iPos), "#"); + fZ = StringToFloat(GetSubString(sLocation, iPos, iCount)); + + vPosition = Vector(fX, fY, fZ); + + iPos = FindSubString(sLocation, "#ORIENTATION#") + 13; + iCount = FindSubString(GetSubString(sLocation, iPos, iLen - iPos), "#"); + fOrientation = StringToFloat(GetSubString(sLocation, iPos, iCount)); + + lReturnValue = Location(oArea, vPosition, fOrientation); + } + + return lReturnValue; +} + +// These functions are responsible for transporting the various data types back +// and forth to the database. + +void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = + 0, string sTable = "pwdata") +{ + string sPlayer; + string sTag; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + + sVarName = SQLEncodeSpecialChars(sVarName); + sValue = SQLEncodeSpecialChars(sValue); + + string sSQL = "SELECT player FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + // row exists + sSQL = "UPDATE " + sTable + " SET val='" + sValue + + "',expire=" + IntToString(iExpiration) + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + } + else + { + // row doesn't exist + sSQL = "INSERT INTO " + sTable + " (player,tag,name,val,expire) VALUES" + + "('" + sPlayer + "','" + sTag + "','" + sVarName + "','" + + sValue + "'," + IntToString(iExpiration) + ")"; + SQLExecDirect(sSQL); + } +} + +string GetPersistentString(object oObject, string sVarName, string sTable = "pwdata") +{ + string sPlayer; + string sTag; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + + sVarName = SQLEncodeSpecialChars(sVarName); + + string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + return SQLDecodeSpecialChars(SQLGetData(1)); + else + { + return ""; + // If you want to convert your existing persistent data to APS, this + // would be the place to do it. The requested variable was not found + // in the database, you should + // 1) query it's value using your existing persistence functions + // 2) save the value to the database using SetPersistentString() + // 3) return the string value here. + } +} + +void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = + 0, string sTable = "pwdata") +{ + SetPersistentString(oObject, sVarName, IntToString(iValue), iExpiration, sTable); +} + +int GetPersistentInt(object oObject, string sVarName, string sTable = "pwdata") +{ + string sPlayer; + string sTag; + object oModule; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + + sVarName = SQLEncodeSpecialChars(sVarName); + + string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + + oModule = GetModule(); + SetLocalString(oModule, "NWNX!ODBC!FETCH", "-2147483647"); + return StringToInt(GetLocalString(oModule, "NWNX!ODBC!FETCH")); +} + +void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = + 0, string sTable = "pwdata") +{ + SetPersistentString(oObject, sVarName, FloatToString(fValue), iExpiration, sTable); +} + +float GetPersistentFloat(object oObject, string sVarName, string sTable = "pwdata") +{ + string sPlayer; + string sTag; + object oModule; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + + sVarName = SQLEncodeSpecialChars(sVarName); + + string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + + oModule = GetModule(); + SetLocalString(oModule, "NWNX!ODBC!FETCH", "-340282306073709650000000000000000000000.000000000"); + return StringToFloat(GetLocalString(oModule, "NWNX!ODBC!FETCH")); +} + +void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = + 0, string sTable = "pwdata") +{ + SetPersistentString(oObject, sVarName, APSLocationToString(lLocation), iExpiration, sTable); +} + +location GetPersistentLocation(object oObject, string sVarName, string sTable = "pwdata") +{ + return APSStringToLocation(GetPersistentString(oObject, sVarName, sTable)); +} + +void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration = + 0, string sTable = "pwdata") +{ + SetPersistentString(oObject, sVarName, APSVectorToString(vVector), iExpiration, sTable); +} + +vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwdata") +{ + return APSStringToVector(GetPersistentString(oObject, sVarName, sTable)); +} + +void SetPersistentObject(object oOwner, string sVarName, object oObject, int iExpiration = + 0, string sTable = "pwobjdata") +{ + string sPlayer; + string sTag; + + if (GetIsPC(oOwner)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oOwner)); + sTag = SQLEncodeSpecialChars(GetName(oOwner)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oOwner); + } + sVarName = SQLEncodeSpecialChars(sVarName); + + string sSQL = "SELECT player FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + // row exists + sSQL = "UPDATE " + sTable + " SET val=%s,expire=" + IntToString(iExpiration) + + " WHERE player='" + sPlayer + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); + StoreCampaignObject ("NWNX", "-", oObject); + } + else + { + // row doesn't exist + sSQL = "INSERT INTO " + sTable + " (player,tag,name,val,expire) VALUES" + + "('" + sPlayer + "','" + sTag + "','" + sVarName + "',%s," + IntToString(iExpiration) + ")"; + SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); + StoreCampaignObject ("NWNX", "-", oObject); + } +} + +object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata") +{ + string sPlayer; + string sTag; + object oModule; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + sVarName = SQLEncodeSpecialChars(sVarName); + + string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); + + if (!GetIsObjectValid(oOwner)) + oOwner = oObject; + return RetrieveCampaignObject ("NWNX", "-", GetLocation(oOwner), oOwner); +} + +void DeletePersistentVariable(object oObject, string sVarName, string sTable = "pwdata") +{ + string sPlayer; + string sTag; + + if (GetIsPC(oObject)) + { + sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); + sTag = SQLEncodeSpecialChars(GetName(oObject)); + } + else + { + sPlayer = "~"; + sTag = GetTag(oObject); + } + + sVarName = SQLEncodeSpecialChars(sVarName); + string sSQL = "DELETE FROM " + sTable + " WHERE player='" + sPlayer + + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; + SQLExecDirect(sSQL); +} + +// Problems can arise with SQL commands if variables or values have single quotes +// in their names. These functions are a replace these quote with the tilde character + +string SQLEncodeSpecialChars(string sString) +{ + if (FindSubString(sString, "'") == -1) // not found + return sString; + + int i; + string sReturn = ""; + string sChar; + + // Loop over every character and replace special characters + for (i = 0; i < GetStringLength(sString); i++) + { + sChar = GetSubString(sString, i, 1); + if (sChar == "'") + sReturn += "~"; + else + sReturn += sChar; + } + return sReturn; +} + +string SQLDecodeSpecialChars(string sString) +{ + if (FindSubString(sString, "~") == -1) // not found + return sString; + + int i; + string sReturn = ""; + string sChar; + + // Loop over every character and replace special characters + for (i = 0; i < GetStringLength(sString); i++) + { + sChar = GetSubString(sString, i, 1); + if (sChar == "~") + sReturn += "'"; + else + sReturn += sChar; + } + return sReturn; +} +//void main () {} + diff --git a/nwnds_module/ar_aclap_blsmith.uti b/nwnds_module/ar_aclap_blsmith.uti new file mode 100644 index 000000000..7f9b2673f Binary files /dev/null and b/nwnds_module/ar_aclap_blsmith.uti differ diff --git a/nwnds_module/ar_aclcl_bonemai.uti b/nwnds_module/ar_aclcl_bonemai.uti new file mode 100644 index 000000000..285ceb804 Binary files /dev/null and b/nwnds_module/ar_aclcl_bonemai.uti differ diff --git a/nwnds_module/ar_aclcl_elven01.uti b/nwnds_module/ar_aclcl_elven01.uti new file mode 100644 index 000000000..ae3447d84 Binary files /dev/null and b/nwnds_module/ar_aclcl_elven01.uti differ diff --git a/nwnds_module/ar_aclcl_harness.uti b/nwnds_module/ar_aclcl_harness.uti new file mode 100644 index 000000000..03fc1e347 Binary files /dev/null and b/nwnds_module/ar_aclcl_harness.uti differ diff --git a/nwnds_module/ar_aclcl_harntyr.uti b/nwnds_module/ar_aclcl_harntyr.uti new file mode 100644 index 000000000..180e0f55d Binary files /dev/null and b/nwnds_module/ar_aclcl_harntyr.uti differ diff --git a/nwnds_module/ar_aclcl_skirt.uti b/nwnds_module/ar_aclcl_skirt.uti new file mode 100644 index 000000000..39447f29d Binary files /dev/null and b/nwnds_module/ar_aclcl_skirt.uti differ diff --git a/nwnds_module/ar_aclcl_slave.uti b/nwnds_module/ar_aclcl_slave.uti new file mode 100644 index 000000000..58deed7c4 Binary files /dev/null and b/nwnds_module/ar_aclcl_slave.uti differ diff --git a/nwnds_module/ar_aclcl_tavmaid.uti b/nwnds_module/ar_aclcl_tavmaid.uti new file mode 100644 index 000000000..5a00b684a Binary files /dev/null and b/nwnds_module/ar_aclcl_tavmaid.uti differ diff --git a/nwnds_module/ar_aclcl_tavval.uti b/nwnds_module/ar_aclcl_tavval.uti new file mode 100644 index 000000000..055f4013e Binary files /dev/null and b/nwnds_module/ar_aclcl_tavval.uti differ diff --git a/nwnds_module/ar_acldr_dragon1.uti b/nwnds_module/ar_acldr_dragon1.uti new file mode 100644 index 000000000..53591f433 Binary files /dev/null and b/nwnds_module/ar_acldr_dragon1.uti differ diff --git a/nwnds_module/ar_acldr_evening.uti b/nwnds_module/ar_acldr_evening.uti new file mode 100644 index 000000000..d5fc06b87 Binary files /dev/null and b/nwnds_module/ar_acldr_evening.uti differ diff --git a/nwnds_module/ar_acldr_floral1.uti b/nwnds_module/ar_acldr_floral1.uti new file mode 100644 index 000000000..319f0f171 Binary files /dev/null and b/nwnds_module/ar_acldr_floral1.uti differ diff --git a/nwnds_module/ar_acldr_floral2.uti b/nwnds_module/ar_acldr_floral2.uti new file mode 100644 index 000000000..82bf607d3 Binary files /dev/null and b/nwnds_module/ar_acldr_floral2.uti differ diff --git a/nwnds_module/ar_acldr_noble01.uti b/nwnds_module/ar_acldr_noble01.uti new file mode 100644 index 000000000..deaaf72a0 Binary files /dev/null and b/nwnds_module/ar_acldr_noble01.uti differ diff --git a/nwnds_module/ar_acldr_ribbons.uti b/nwnds_module/ar_acldr_ribbons.uti new file mode 100644 index 000000000..8f51eaf12 Binary files /dev/null and b/nwnds_module/ar_acldr_ribbons.uti differ diff --git a/nwnds_module/ar_acldr_rubyred.uti b/nwnds_module/ar_acldr_rubyred.uti new file mode 100644 index 000000000..81779267a Binary files /dev/null and b/nwnds_module/ar_acldr_rubyred.uti differ diff --git a/nwnds_module/ar_acldr_strplss.uti b/nwnds_module/ar_acldr_strplss.uti new file mode 100644 index 000000000..e1fecd266 Binary files /dev/null and b/nwnds_module/ar_acldr_strplss.uti differ diff --git a/nwnds_module/ar_acldr_tavdanc.uti b/nwnds_module/ar_acldr_tavdanc.uti new file mode 100644 index 000000000..2fb4c7199 Binary files /dev/null and b/nwnds_module/ar_acldr_tavdanc.uti differ diff --git a/nwnds_module/ar_aclgb_common.uti b/nwnds_module/ar_aclgb_common.uti new file mode 100644 index 000000000..167f75a83 Binary files /dev/null and b/nwnds_module/ar_aclgb_common.uti differ diff --git a/nwnds_module/ar_aclgb_dancer1.uti b/nwnds_module/ar_aclgb_dancer1.uti new file mode 100644 index 000000000..9c04b73e0 Binary files /dev/null and b/nwnds_module/ar_aclgb_dancer1.uti differ diff --git a/nwnds_module/ar_aclgb_domme.uti b/nwnds_module/ar_aclgb_domme.uti new file mode 100644 index 000000000..c6b637aaf Binary files /dev/null and b/nwnds_module/ar_aclgb_domme.uti differ diff --git a/nwnds_module/ar_aclgb_ephanie.uti b/nwnds_module/ar_aclgb_ephanie.uti new file mode 100644 index 000000000..04f3e86a2 Binary files /dev/null and b/nwnds_module/ar_aclgb_ephanie.uti differ diff --git a/nwnds_module/ar_aclgb_fcommon.uti b/nwnds_module/ar_aclgb_fcommon.uti new file mode 100644 index 000000000..08d2f5d2d Binary files /dev/null and b/nwnds_module/ar_aclgb_fcommon.uti differ diff --git a/nwnds_module/ar_aclgb_mcommon.uti b/nwnds_module/ar_aclgb_mcommon.uti new file mode 100644 index 000000000..bcd29aa14 Binary files /dev/null and b/nwnds_module/ar_aclgb_mcommon.uti differ diff --git a/nwnds_module/ar_aclgb_slave.uti b/nwnds_module/ar_aclgb_slave.uti new file mode 100644 index 000000000..4e56ae570 Binary files /dev/null and b/nwnds_module/ar_aclgb_slave.uti differ diff --git a/nwnds_module/ar_aclhr_spider.uti b/nwnds_module/ar_aclhr_spider.uti new file mode 100644 index 000000000..11ef30046 Binary files /dev/null and b/nwnds_module/ar_aclhr_spider.uti differ diff --git a/nwnds_module/ar_acljk_evoker.uti b/nwnds_module/ar_acljk_evoker.uti new file mode 100644 index 000000000..f0f5f414b Binary files /dev/null and b/nwnds_module/ar_acljk_evoker.uti differ diff --git a/nwnds_module/ar_aclkm_bamboo1.uti b/nwnds_module/ar_aclkm_bamboo1.uti new file mode 100644 index 000000000..35e57d10f Binary files /dev/null and b/nwnds_module/ar_aclkm_bamboo1.uti differ diff --git a/nwnds_module/ar_aclkm_dragon.uti b/nwnds_module/ar_aclkm_dragon.uti new file mode 100644 index 000000000..147bc6339 Binary files /dev/null and b/nwnds_module/ar_aclkm_dragon.uti differ diff --git a/nwnds_module/ar_aclkm_regal.uti b/nwnds_module/ar_aclkm_regal.uti new file mode 100644 index 000000000..6432ba661 Binary files /dev/null and b/nwnds_module/ar_aclkm_regal.uti differ diff --git a/nwnds_module/ar_aclrb_camo.uti b/nwnds_module/ar_aclrb_camo.uti new file mode 100644 index 000000000..ad4d3cf45 Binary files /dev/null and b/nwnds_module/ar_aclrb_camo.uti differ diff --git a/nwnds_module/ar_aclrb_desert.uti b/nwnds_module/ar_aclrb_desert.uti new file mode 100644 index 000000000..16b9375d0 Binary files /dev/null and b/nwnds_module/ar_aclrb_desert.uti differ diff --git a/nwnds_module/ar_acmrb_rich01.uti b/nwnds_module/ar_acmrb_rich01.uti new file mode 100644 index 000000000..8acff7251 Binary files /dev/null and b/nwnds_module/ar_acmrb_rich01.uti differ diff --git a/nwnds_module/ar_acmrb_rich02.uti b/nwnds_module/ar_acmrb_rich02.uti new file mode 100644 index 000000000..d27123a92 Binary files /dev/null and b/nwnds_module/ar_acmrb_rich02.uti differ diff --git a/nwnds_module/ar_adbp_agafari.uti b/nwnds_module/ar_adbp_agafari.uti new file mode 100644 index 000000000..c4be29d49 Binary files /dev/null and b/nwnds_module/ar_adbp_agafari.uti differ diff --git a/nwnds_module/ar_aerservant001.utc b/nwnds_module/ar_aerservant001.utc new file mode 100644 index 000000000..8738ab482 Binary files /dev/null and b/nwnds_module/ar_aerservant001.utc differ diff --git a/nwnds_module/ar_aerservant002.utc b/nwnds_module/ar_aerservant002.utc new file mode 100644 index 000000000..51355b762 Binary files /dev/null and b/nwnds_module/ar_aerservant002.utc differ diff --git a/nwnds_module/ar_agafari.utm b/nwnds_module/ar_agafari.utm new file mode 100644 index 000000000..f6ab97db3 Binary files /dev/null and b/nwnds_module/ar_agafari.utm differ diff --git a/nwnds_module/ar_ahvbm_alloy.uti b/nwnds_module/ar_ahvbm_alloy.uti new file mode 100644 index 000000000..58d44eccb Binary files /dev/null and b/nwnds_module/ar_ahvbm_alloy.uti differ diff --git a/nwnds_module/ar_ahvbm_iron01.uti b/nwnds_module/ar_ahvbm_iron01.uti new file mode 100644 index 000000000..fc2b0dc29 Binary files /dev/null and b/nwnds_module/ar_ahvbm_iron01.uti differ diff --git a/nwnds_module/ar_ahvfp_alloy.uti b/nwnds_module/ar_ahvfp_alloy.uti new file mode 100644 index 000000000..6d7c0d2d0 Binary files /dev/null and b/nwnds_module/ar_ahvfp_alloy.uti differ diff --git a/nwnds_module/ar_ahvfp_bsthide.uti b/nwnds_module/ar_ahvfp_bsthide.uti new file mode 100644 index 000000000..e9024f6bc Binary files /dev/null and b/nwnds_module/ar_ahvfp_bsthide.uti differ diff --git a/nwnds_module/ar_ahvfp_githyk.uti b/nwnds_module/ar_ahvfp_githyk.uti new file mode 100644 index 000000000..5ab71b824 Binary files /dev/null and b/nwnds_module/ar_ahvfp_githyk.uti differ diff --git a/nwnds_module/ar_ahvfp_iron01.uti b/nwnds_module/ar_ahvfp_iron01.uti new file mode 100644 index 000000000..ab6223dbb Binary files /dev/null and b/nwnds_module/ar_ahvfp_iron01.uti differ diff --git a/nwnds_module/ar_ahvfp_ivory.uti b/nwnds_module/ar_ahvfp_ivory.uti new file mode 100644 index 000000000..5a1777447 Binary files /dev/null and b/nwnds_module/ar_ahvfp_ivory.uti differ diff --git a/nwnds_module/ar_ahvhp_agafari.uti b/nwnds_module/ar_ahvhp_agafari.uti new file mode 100644 index 000000000..7cbb676cf Binary files /dev/null and b/nwnds_module/ar_ahvhp_agafari.uti differ diff --git a/nwnds_module/ar_ahvhp_alloy.uti b/nwnds_module/ar_ahvhp_alloy.uti new file mode 100644 index 000000000..eb629a320 Binary files /dev/null and b/nwnds_module/ar_ahvhp_alloy.uti differ diff --git a/nwnds_module/ar_ahvhp_bone01.uti b/nwnds_module/ar_ahvhp_bone01.uti new file mode 100644 index 000000000..0365c8e38 Binary files /dev/null and b/nwnds_module/ar_ahvhp_bone01.uti differ diff --git a/nwnds_module/ar_ahvhp_iron01.uti b/nwnds_module/ar_ahvhp_iron01.uti new file mode 100644 index 000000000..77f7443a0 Binary files /dev/null and b/nwnds_module/ar_ahvhp_iron01.uti differ diff --git a/nwnds_module/ar_ahvhp_ivory.uti b/nwnds_module/ar_ahvhp_ivory.uti new file mode 100644 index 000000000..4e033f8ae Binary files /dev/null and b/nwnds_module/ar_ahvhp_ivory.uti differ diff --git a/nwnds_module/ar_ahvhp_mekilot.uti b/nwnds_module/ar_ahvhp_mekilot.uti new file mode 100644 index 000000000..a7e563af2 Binary files /dev/null and b/nwnds_module/ar_ahvhp_mekilot.uti differ diff --git a/nwnds_module/ar_alabasent001.utc b/nwnds_module/ar_alabasent001.utc new file mode 100644 index 000000000..14918303f Binary files /dev/null and b/nwnds_module/ar_alabasent001.utc differ diff --git a/nwnds_module/ar_algoid001.utc b/nwnds_module/ar_algoid001.utc new file mode 100644 index 000000000..e42c87bd3 Binary files /dev/null and b/nwnds_module/ar_algoid001.utc differ diff --git a/nwnds_module/ar_altguard_001.utc b/nwnds_module/ar_altguard_001.utc new file mode 100644 index 000000000..597e25179 Binary files /dev/null and b/nwnds_module/ar_altguard_001.utc differ diff --git a/nwnds_module/ar_altguard_002.utc b/nwnds_module/ar_altguard_002.utc new file mode 100644 index 000000000..7ec0b952c Binary files /dev/null and b/nwnds_module/ar_altguard_002.utc differ diff --git a/nwnds_module/ar_altguard_003.utc b/nwnds_module/ar_altguard_003.utc new file mode 100644 index 000000000..4c4ff1e1f Binary files /dev/null and b/nwnds_module/ar_altguard_003.utc differ diff --git a/nwnds_module/ar_altguard_004.utc b/nwnds_module/ar_altguard_004.utc new file mode 100644 index 000000000..b2e9f70ee Binary files /dev/null and b/nwnds_module/ar_altguard_004.utc differ diff --git a/nwnds_module/ar_altlt_agafari.uti b/nwnds_module/ar_altlt_agafari.uti new file mode 100644 index 000000000..cc3b1ab97 Binary files /dev/null and b/nwnds_module/ar_altlt_agafari.uti differ diff --git a/nwnds_module/ar_altlt_catsuit.uti b/nwnds_module/ar_altlt_catsuit.uti new file mode 100644 index 000000000..6b21e871b Binary files /dev/null and b/nwnds_module/ar_altlt_catsuit.uti differ diff --git a/nwnds_module/ar_altlt_leather.uti b/nwnds_module/ar_altlt_leather.uti new file mode 100644 index 000000000..20da508fe Binary files /dev/null and b/nwnds_module/ar_altlt_leather.uti differ diff --git a/nwnds_module/ar_altlt_mekilot.uti b/nwnds_module/ar_altlt_mekilot.uti new file mode 100644 index 000000000..88d6cc889 Binary files /dev/null and b/nwnds_module/ar_altlt_mekilot.uti differ diff --git a/nwnds_module/ar_altpd_cloth01.uti b/nwnds_module/ar_altpd_cloth01.uti new file mode 100644 index 000000000..1eea69282 Binary files /dev/null and b/nwnds_module/ar_altpd_cloth01.uti differ diff --git a/nwnds_module/ar_altpd_darkslk.uti b/nwnds_module/ar_altpd_darkslk.uti new file mode 100644 index 000000000..2db8ceb1e Binary files /dev/null and b/nwnds_module/ar_altpd_darkslk.uti differ diff --git a/nwnds_module/ar_altsl_alloy.uti b/nwnds_module/ar_altsl_alloy.uti new file mode 100644 index 000000000..553393edc Binary files /dev/null and b/nwnds_module/ar_altsl_alloy.uti differ diff --git a/nwnds_module/ar_altsl_bone01.uti b/nwnds_module/ar_altsl_bone01.uti new file mode 100644 index 000000000..75731e063 Binary files /dev/null and b/nwnds_module/ar_altsl_bone01.uti differ diff --git a/nwnds_module/ar_altsl_iron01.uti b/nwnds_module/ar_altsl_iron01.uti new file mode 100644 index 000000000..9f7ca3068 Binary files /dev/null and b/nwnds_module/ar_altsl_iron01.uti differ diff --git a/nwnds_module/ar_altsl_ivory.uti b/nwnds_module/ar_altsl_ivory.uti new file mode 100644 index 000000000..ec4be14db Binary files /dev/null and b/nwnds_module/ar_altsl_ivory.uti differ diff --git a/nwnds_module/ar_amclap_justls.uti b/nwnds_module/ar_amclap_justls.uti new file mode 100644 index 000000000..5630d7fa4 Binary files /dev/null and b/nwnds_module/ar_amclap_justls.uti differ diff --git a/nwnds_module/ar_amclcl_alsoul.uti b/nwnds_module/ar_amclcl_alsoul.uti new file mode 100644 index 000000000..aa1d4c959 Binary files /dev/null and b/nwnds_module/ar_amclcl_alsoul.uti differ diff --git a/nwnds_module/ar_amclcl_decay.uti b/nwnds_module/ar_amclcl_decay.uti new file mode 100644 index 000000000..cafc7dc56 Binary files /dev/null and b/nwnds_module/ar_amclcl_decay.uti differ diff --git a/nwnds_module/ar_amclcl_desert.uti b/nwnds_module/ar_amclcl_desert.uti new file mode 100644 index 000000000..7b7b871eb Binary files /dev/null and b/nwnds_module/ar_amclcl_desert.uti differ diff --git a/nwnds_module/ar_amclcl_dunern.uti b/nwnds_module/ar_amclcl_dunern.uti new file mode 100644 index 000000000..7f929c17e Binary files /dev/null and b/nwnds_module/ar_amclcl_dunern.uti differ diff --git a/nwnds_module/ar_amclcl_giant.uti b/nwnds_module/ar_amclcl_giant.uti new file mode 100644 index 000000000..b5e81ba79 Binary files /dev/null and b/nwnds_module/ar_amclcl_giant.uti differ diff --git a/nwnds_module/ar_amclcl_jizzar.uti b/nwnds_module/ar_amclcl_jizzar.uti new file mode 100644 index 000000000..b0c208da4 Binary files /dev/null and b/nwnds_module/ar_amclcl_jizzar.uti differ diff --git a/nwnds_module/ar_amclcl_magma.uti b/nwnds_module/ar_amclcl_magma.uti new file mode 100644 index 000000000..893aa65c2 Binary files /dev/null and b/nwnds_module/ar_amclcl_magma.uti differ diff --git a/nwnds_module/ar_amclcl_mtnsol.ncs b/nwnds_module/ar_amclcl_mtnsol.ncs new file mode 100644 index 000000000..e0fb7955b Binary files /dev/null and b/nwnds_module/ar_amclcl_mtnsol.ncs differ diff --git a/nwnds_module/ar_amclcl_mtnsol.nss b/nwnds_module/ar_amclcl_mtnsol.nss new file mode 100644 index 000000000..66f1b6af7 --- /dev/null +++ b/nwnds_module/ar_amclcl_mtnsol.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a ranger, unequip the item + if(GetLevelByClass(CLASS_TYPE_RANGER, oPC) <= 0) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amclcl_mtnsol.uti b/nwnds_module/ar_amclcl_mtnsol.uti new file mode 100644 index 000000000..dc78b1757 Binary files /dev/null and b/nwnds_module/ar_amclcl_mtnsol.uti differ diff --git a/nwnds_module/ar_amclcl_rouge.uti b/nwnds_module/ar_amclcl_rouge.uti new file mode 100644 index 000000000..5c81b27a0 Binary files /dev/null and b/nwnds_module/ar_amclcl_rouge.uti differ diff --git a/nwnds_module/ar_amclcl_storyt.uti b/nwnds_module/ar_amclcl_storyt.uti new file mode 100644 index 000000000..6310a24d6 Binary files /dev/null and b/nwnds_module/ar_amclcl_storyt.uti differ diff --git a/nwnds_module/ar_amclcl_vine.uti b/nwnds_module/ar_amclcl_vine.uti new file mode 100644 index 000000000..a7825c7ec Binary files /dev/null and b/nwnds_module/ar_amclcl_vine.uti differ diff --git a/nwnds_module/ar_amclgb_blkslt.uti b/nwnds_module/ar_amclgb_blkslt.uti new file mode 100644 index 000000000..319de49df Binary files /dev/null and b/nwnds_module/ar_amclgb_blkslt.uti differ diff --git a/nwnds_module/ar_amclgb_dedman.uti b/nwnds_module/ar_amclgb_dedman.uti new file mode 100644 index 000000000..66db210a6 Binary files /dev/null and b/nwnds_module/ar_amclgb_dedman.uti differ diff --git a/nwnds_module/ar_amclgb_jandor.ncs b/nwnds_module/ar_amclgb_jandor.ncs new file mode 100644 index 000000000..0ebf55025 Binary files /dev/null and b/nwnds_module/ar_amclgb_jandor.ncs differ diff --git a/nwnds_module/ar_amclgb_jandor.nss b/nwnds_module/ar_amclgb_jandor.nss new file mode 100644 index 000000000..22e970d75 --- /dev/null +++ b/nwnds_module/ar_amclgb_jandor.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 21st level Preserver, unequip the item + if(GetLevelByClass(CLASS_TYPE_WIZARD, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amclgb_jandor.uti b/nwnds_module/ar_amclgb_jandor.uti new file mode 100644 index 000000000..b83694f77 Binary files /dev/null and b/nwnds_module/ar_amclgb_jandor.uti differ diff --git a/nwnds_module/ar_amclgb_jings.uti b/nwnds_module/ar_amclgb_jings.uti new file mode 100644 index 000000000..92afd39fa Binary files /dev/null and b/nwnds_module/ar_amclgb_jings.uti differ diff --git a/nwnds_module/ar_amclgb_master.uti b/nwnds_module/ar_amclgb_master.uti new file mode 100644 index 000000000..c28af0f31 Binary files /dev/null and b/nwnds_module/ar_amclgb_master.uti differ diff --git a/nwnds_module/ar_amclgb_shadow.uti b/nwnds_module/ar_amclgb_shadow.uti new file mode 100644 index 000000000..f0ac5da62 Binary files /dev/null and b/nwnds_module/ar_amclgb_shadow.uti differ diff --git a/nwnds_module/ar_amclhr_gladi8.uti b/nwnds_module/ar_amclhr_gladi8.uti new file mode 100644 index 000000000..b64eee37d Binary files /dev/null and b/nwnds_module/ar_amclhr_gladi8.uti differ diff --git a/nwnds_module/ar_amclhr_hugos.uti b/nwnds_module/ar_amclhr_hugos.uti new file mode 100644 index 000000000..17b0e219f Binary files /dev/null and b/nwnds_module/ar_amclhr_hugos.uti differ diff --git a/nwnds_module/ar_amcljk_dfire.uti b/nwnds_module/ar_amcljk_dfire.uti new file mode 100644 index 000000000..943dddfe6 Binary files /dev/null and b/nwnds_module/ar_amcljk_dfire.uti differ diff --git a/nwnds_module/ar_amclrb_advent.uti b/nwnds_module/ar_amclrb_advent.uti new file mode 100644 index 000000000..971321e84 Binary files /dev/null and b/nwnds_module/ar_amclrb_advent.uti differ diff --git a/nwnds_module/ar_amclrb_arcane.uti b/nwnds_module/ar_amclrb_arcane.uti new file mode 100644 index 000000000..8e7d91e2f Binary files /dev/null and b/nwnds_module/ar_amclrb_arcane.uti differ diff --git a/nwnds_module/ar_amclrb_ashen.ncs b/nwnds_module/ar_amclrb_ashen.ncs new file mode 100644 index 000000000..37103f9a9 Binary files /dev/null and b/nwnds_module/ar_amclrb_ashen.ncs differ diff --git a/nwnds_module/ar_amclrb_ashen.nss b/nwnds_module/ar_amclrb_ashen.nss new file mode 100644 index 000000000..aa68de994 --- /dev/null +++ b/nwnds_module/ar_amclrb_ashen.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 21st level Defiler, unequip the item. + if(GetLevelByClass(CLASS_TYPE_SORCERER, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amclrb_ashen.uti b/nwnds_module/ar_amclrb_ashen.uti new file mode 100644 index 000000000..d28e04276 Binary files /dev/null and b/nwnds_module/ar_amclrb_ashen.uti differ diff --git a/nwnds_module/ar_amclrb_braxat.uti b/nwnds_module/ar_amclrb_braxat.uti new file mode 100644 index 000000000..5c89ea69e Binary files /dev/null and b/nwnds_module/ar_amclrb_braxat.uti differ diff --git a/nwnds_module/ar_amclrb_defbat.uti b/nwnds_module/ar_amclrb_defbat.uti new file mode 100644 index 000000000..3c9166d81 Binary files /dev/null and b/nwnds_module/ar_amclrb_defbat.uti differ diff --git a/nwnds_module/ar_amclrb_deprav.uti b/nwnds_module/ar_amclrb_deprav.uti new file mode 100644 index 000000000..10bee3c15 Binary files /dev/null and b/nwnds_module/ar_amclrb_deprav.uti differ diff --git a/nwnds_module/ar_amclrb_dwalkr.uti b/nwnds_module/ar_amclrb_dwalkr.uti new file mode 100644 index 000000000..187a36cf1 Binary files /dev/null and b/nwnds_module/ar_amclrb_dwalkr.uti differ diff --git a/nwnds_module/ar_amclrb_earth.uti b/nwnds_module/ar_amclrb_earth.uti new file mode 100644 index 000000000..fbae96b47 Binary files /dev/null and b/nwnds_module/ar_amclrb_earth.uti differ diff --git a/nwnds_module/ar_amclrb_elven.uti b/nwnds_module/ar_amclrb_elven.uti new file mode 100644 index 000000000..0570a9d75 Binary files /dev/null and b/nwnds_module/ar_amclrb_elven.uti differ diff --git a/nwnds_module/ar_amclrb_enligh.uti b/nwnds_module/ar_amclrb_enligh.uti new file mode 100644 index 000000000..e7e55166c Binary files /dev/null and b/nwnds_module/ar_amclrb_enligh.uti differ diff --git a/nwnds_module/ar_amclrb_eyes.uti b/nwnds_module/ar_amclrb_eyes.uti new file mode 100644 index 000000000..d669692c6 Binary files /dev/null and b/nwnds_module/ar_amclrb_eyes.uti differ diff --git a/nwnds_module/ar_amclrb_fareli.uti b/nwnds_module/ar_amclrb_fareli.uti new file mode 100644 index 000000000..41ca9b6b8 Binary files /dev/null and b/nwnds_module/ar_amclrb_fareli.uti differ diff --git a/nwnds_module/ar_amclrb_flame.uti b/nwnds_module/ar_amclrb_flame.uti new file mode 100644 index 000000000..786fe34d6 Binary files /dev/null and b/nwnds_module/ar_amclrb_flame.uti differ diff --git a/nwnds_module/ar_amclrb_githyk.uti b/nwnds_module/ar_amclrb_githyk.uti new file mode 100644 index 000000000..9da542534 Binary files /dev/null and b/nwnds_module/ar_amclrb_githyk.uti differ diff --git a/nwnds_module/ar_amclrb_healer.uti b/nwnds_module/ar_amclrb_healer.uti new file mode 100644 index 000000000..ccc7391a8 Binary files /dev/null and b/nwnds_module/ar_amclrb_healer.uti differ diff --git a/nwnds_module/ar_amclrb_illwil.ncs b/nwnds_module/ar_amclrb_illwil.ncs new file mode 100644 index 000000000..37103f9a9 Binary files /dev/null and b/nwnds_module/ar_amclrb_illwil.ncs differ diff --git a/nwnds_module/ar_amclrb_illwil.nss b/nwnds_module/ar_amclrb_illwil.nss new file mode 100644 index 000000000..8912e2830 --- /dev/null +++ b/nwnds_module/ar_amclrb_illwil.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 21st+ level Defiler, unequip the item + if(GetLevelByClass(CLASS_TYPE_SORCERER, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amclrb_illwil.uti b/nwnds_module/ar_amclrb_illwil.uti new file mode 100644 index 000000000..7f413e7d9 Binary files /dev/null and b/nwnds_module/ar_amclrb_illwil.uti differ diff --git a/nwnds_module/ar_amclrb_living.ncs b/nwnds_module/ar_amclrb_living.ncs new file mode 100644 index 000000000..0ebf55025 Binary files /dev/null and b/nwnds_module/ar_amclrb_living.ncs differ diff --git a/nwnds_module/ar_amclrb_living.nss b/nwnds_module/ar_amclrb_living.nss new file mode 100644 index 000000000..22e970d75 --- /dev/null +++ b/nwnds_module/ar_amclrb_living.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 21st level Preserver, unequip the item + if(GetLevelByClass(CLASS_TYPE_WIZARD, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amclrb_living.uti b/nwnds_module/ar_amclrb_living.uti new file mode 100644 index 000000000..60bc19877 Binary files /dev/null and b/nwnds_module/ar_amclrb_living.uti differ diff --git a/nwnds_module/ar_amclrb_mystic.uti b/nwnds_module/ar_amclrb_mystic.uti new file mode 100644 index 000000000..43bbe671c Binary files /dev/null and b/nwnds_module/ar_amclrb_mystic.uti differ diff --git a/nwnds_module/ar_amclrb_sage.uti b/nwnds_module/ar_amclrb_sage.uti new file mode 100644 index 000000000..2a761e329 Binary files /dev/null and b/nwnds_module/ar_amclrb_sage.uti differ diff --git a/nwnds_module/ar_amclrb_skydnc.uti b/nwnds_module/ar_amclrb_skydnc.uti new file mode 100644 index 000000000..e5d05a561 Binary files /dev/null and b/nwnds_module/ar_amclrb_skydnc.uti differ diff --git a/nwnds_module/ar_amclrb_underw.uti b/nwnds_module/ar_amclrb_underw.uti new file mode 100644 index 000000000..f9a6e3c74 Binary files /dev/null and b/nwnds_module/ar_amclrb_underw.uti differ diff --git a/nwnds_module/ar_amclrb_veiled.uti b/nwnds_module/ar_amclrb_veiled.uti new file mode 100644 index 000000000..9814f34a0 Binary files /dev/null and b/nwnds_module/ar_amclrb_veiled.uti differ diff --git a/nwnds_module/ar_amclrb_water.uti b/nwnds_module/ar_amclrb_water.uti new file mode 100644 index 000000000..600a73ec5 Binary files /dev/null and b/nwnds_module/ar_amclrb_water.uti differ diff --git a/nwnds_module/ar_amclrb_wizbat.uti b/nwnds_module/ar_amclrb_wizbat.uti new file mode 100644 index 000000000..505ee3964 Binary files /dev/null and b/nwnds_module/ar_amclrb_wizbat.uti differ diff --git a/nwnds_module/ar_amcltn_ranger.uti b/nwnds_module/ar_amcltn_ranger.uti new file mode 100644 index 000000000..7047fee8b Binary files /dev/null and b/nwnds_module/ar_amcltn_ranger.uti differ diff --git a/nwnds_module/ar_amclvs_dair.uti b/nwnds_module/ar_amclvs_dair.uti new file mode 100644 index 000000000..181c77071 Binary files /dev/null and b/nwnds_module/ar_amclvs_dair.uti differ diff --git a/nwnds_module/ar_amdbm_bronze.uti b/nwnds_module/ar_amdbm_bronze.uti new file mode 100644 index 000000000..a6b271851 Binary files /dev/null and b/nwnds_module/ar_amdbm_bronze.uti differ diff --git a/nwnds_module/ar_amdbp_alloy.uti b/nwnds_module/ar_amdbp_alloy.uti new file mode 100644 index 000000000..d983ca6cd Binary files /dev/null and b/nwnds_module/ar_amdbp_alloy.uti differ diff --git a/nwnds_module/ar_amdbp_iron01.uti b/nwnds_module/ar_amdbp_iron01.uti new file mode 100644 index 000000000..93491b59b Binary files /dev/null and b/nwnds_module/ar_amdbp_iron01.uti differ diff --git a/nwnds_module/ar_amdbp_ivory.uti b/nwnds_module/ar_amdbp_ivory.uti new file mode 100644 index 000000000..f3cbb71e5 Binary files /dev/null and b/nwnds_module/ar_amdbp_ivory.uti differ diff --git a/nwnds_module/ar_amdbp_lfshape.uti b/nwnds_module/ar_amdbp_lfshape.uti new file mode 100644 index 000000000..da5999021 Binary files /dev/null and b/nwnds_module/ar_amdbp_lfshape.uti differ diff --git a/nwnds_module/ar_amdhd_hide01.uti b/nwnds_module/ar_amdhd_hide01.uti new file mode 100644 index 000000000..244af9890 Binary files /dev/null and b/nwnds_module/ar_amdhd_hide01.uti differ diff --git a/nwnds_module/ar_amdsc_alloy.uti b/nwnds_module/ar_amdsc_alloy.uti new file mode 100644 index 000000000..3eda19a7f Binary files /dev/null and b/nwnds_module/ar_amdsc_alloy.uti differ diff --git a/nwnds_module/ar_amdsc_bone01.uti b/nwnds_module/ar_amdsc_bone01.uti new file mode 100644 index 000000000..0a32f01f9 Binary files /dev/null and b/nwnds_module/ar_amdsc_bone01.uti differ diff --git a/nwnds_module/ar_amdsc_erdlu.uti b/nwnds_module/ar_amdsc_erdlu.uti new file mode 100644 index 000000000..0f996daae Binary files /dev/null and b/nwnds_module/ar_amdsc_erdlu.uti differ diff --git a/nwnds_module/ar_amdsc_iron01.uti b/nwnds_module/ar_amdsc_iron01.uti new file mode 100644 index 000000000..2389d8766 Binary files /dev/null and b/nwnds_module/ar_amdsc_iron01.uti differ diff --git a/nwnds_module/ar_amdsc_ivory.uti b/nwnds_module/ar_amdsc_ivory.uti new file mode 100644 index 000000000..7fb0ca4a2 Binary files /dev/null and b/nwnds_module/ar_amdsc_ivory.uti differ diff --git a/nwnds_module/ar_amdsc_mekilot.uti b/nwnds_module/ar_amdsc_mekilot.uti new file mode 100644 index 000000000..5b4a6b515 Binary files /dev/null and b/nwnds_module/ar_amdsc_mekilot.uti differ diff --git a/nwnds_module/ar_amhvfp_divine.uti b/nwnds_module/ar_amhvfp_divine.uti new file mode 100644 index 000000000..c03af17ff Binary files /dev/null and b/nwnds_module/ar_amhvfp_divine.uti differ diff --git a/nwnds_module/ar_amhvfp_drake.uti b/nwnds_module/ar_amhvfp_drake.uti new file mode 100644 index 000000000..1f06e996c Binary files /dev/null and b/nwnds_module/ar_amhvfp_drake.uti differ diff --git a/nwnds_module/ar_amhvfp_earth.uti b/nwnds_module/ar_amhvfp_earth.uti new file mode 100644 index 000000000..5e4f79caf Binary files /dev/null and b/nwnds_module/ar_amhvfp_earth.uti differ diff --git a/nwnds_module/ar_amhvfp_flame.uti b/nwnds_module/ar_amhvfp_flame.uti new file mode 100644 index 000000000..3e952ecd9 Binary files /dev/null and b/nwnds_module/ar_amhvfp_flame.uti differ diff --git a/nwnds_module/ar_amhvfp_fort.uti b/nwnds_module/ar_amhvfp_fort.uti new file mode 100644 index 000000000..10c4067f3 Binary files /dev/null and b/nwnds_module/ar_amhvfp_fort.uti differ diff --git a/nwnds_module/ar_amhvfp_gorgth.ncs b/nwnds_module/ar_amhvfp_gorgth.ncs new file mode 100644 index 000000000..dce837cc6 Binary files /dev/null and b/nwnds_module/ar_amhvfp_gorgth.ncs differ diff --git a/nwnds_module/ar_amhvfp_gorgth.nss b/nwnds_module/ar_amhvfp_gorgth.nss new file mode 100644 index 000000000..c532527af --- /dev/null +++ b/nwnds_module/ar_amhvfp_gorgth.nss @@ -0,0 +1,26 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a Fighter or are a Druid or a Villichi, unequip the item + if((GetLevelByClass(CLASS_TYPE_FIGHTER, oPC) <= 0) || + (GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 1) || + (GetStringLowerCase(GetSubRace(oPC)) == "villichi")) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_amhvfp_gorgth.uti b/nwnds_module/ar_amhvfp_gorgth.uti new file mode 100644 index 000000000..3cc1e5d3d Binary files /dev/null and b/nwnds_module/ar_amhvfp_gorgth.uti differ diff --git a/nwnds_module/ar_amhvfp_magma.uti b/nwnds_module/ar_amhvfp_magma.uti new file mode 100644 index 000000000..20a62f8f0 Binary files /dev/null and b/nwnds_module/ar_amhvfp_magma.uti differ diff --git a/nwnds_module/ar_amhvfp_meteor.uti b/nwnds_module/ar_amhvfp_meteor.uti new file mode 100644 index 000000000..033bf1fef Binary files /dev/null and b/nwnds_module/ar_amhvfp_meteor.uti differ diff --git a/nwnds_module/ar_amhvfp_pyreen.uti b/nwnds_module/ar_amhvfp_pyreen.uti new file mode 100644 index 000000000..be42166af Binary files /dev/null and b/nwnds_module/ar_amhvfp_pyreen.uti differ diff --git a/nwnds_module/ar_amhvfp_roc.uti b/nwnds_module/ar_amhvfp_roc.uti new file mode 100644 index 000000000..2f920b37e Binary files /dev/null and b/nwnds_module/ar_amhvfp_roc.uti differ diff --git a/nwnds_module/ar_amhvfp_underw.uti b/nwnds_module/ar_amhvfp_underw.uti new file mode 100644 index 000000000..4f791d602 Binary files /dev/null and b/nwnds_module/ar_amhvfp_underw.uti differ diff --git a/nwnds_module/ar_amhvfp_urikhg.uti b/nwnds_module/ar_amhvfp_urikhg.uti new file mode 100644 index 000000000..d1ef55f88 Binary files /dev/null and b/nwnds_module/ar_amhvfp_urikhg.uti differ diff --git a/nwnds_module/ar_amhvhp_antiqu.uti b/nwnds_module/ar_amhvhp_antiqu.uti new file mode 100644 index 000000000..e9dfc7ee9 Binary files /dev/null and b/nwnds_module/ar_amhvhp_antiqu.uti differ diff --git a/nwnds_module/ar_amhvhp_dagorr.uti b/nwnds_module/ar_amhvhp_dagorr.uti new file mode 100644 index 000000000..2772028eb Binary files /dev/null and b/nwnds_module/ar_amhvhp_dagorr.uti differ diff --git a/nwnds_module/ar_amhvhp_rampag.uti b/nwnds_module/ar_amhvhp_rampag.uti new file mode 100644 index 000000000..a1e95511c Binary files /dev/null and b/nwnds_module/ar_amhvhp_rampag.uti differ diff --git a/nwnds_module/ar_amhvhp_water.uti b/nwnds_module/ar_amhvhp_water.uti new file mode 100644 index 000000000..e642e7dbe Binary files /dev/null and b/nwnds_module/ar_amhvhp_water.uti differ diff --git a/nwnds_module/ar_amhvsm_sanshi.uti b/nwnds_module/ar_amhvsm_sanshi.uti new file mode 100644 index 000000000..47d57d626 Binary files /dev/null and b/nwnds_module/ar_amhvsm_sanshi.uti differ diff --git a/nwnds_module/ar_amltlt_bless.uti b/nwnds_module/ar_amltlt_bless.uti new file mode 100644 index 000000000..acb55eeec Binary files /dev/null and b/nwnds_module/ar_amltlt_bless.uti differ diff --git a/nwnds_module/ar_amltlt_braxat.uti b/nwnds_module/ar_amltlt_braxat.uti new file mode 100644 index 000000000..760a2dcc0 Binary files /dev/null and b/nwnds_module/ar_amltlt_braxat.uti differ diff --git a/nwnds_module/ar_amltlt_githyk.uti b/nwnds_module/ar_amltlt_githyk.uti new file mode 100644 index 000000000..a3c958874 Binary files /dev/null and b/nwnds_module/ar_amltlt_githyk.uti differ diff --git a/nwnds_module/ar_amltlt_land.uti b/nwnds_module/ar_amltlt_land.uti new file mode 100644 index 000000000..aab7e3740 Binary files /dev/null and b/nwnds_module/ar_amltlt_land.uti differ diff --git a/nwnds_module/ar_amltlt_reaper.uti b/nwnds_module/ar_amltlt_reaper.uti new file mode 100644 index 000000000..711a20274 Binary files /dev/null and b/nwnds_module/ar_amltlt_reaper.uti differ diff --git a/nwnds_module/ar_amltlt_spider.uti b/nwnds_module/ar_amltlt_spider.uti new file mode 100644 index 000000000..fc0c73001 Binary files /dev/null and b/nwnds_module/ar_amltlt_spider.uti differ diff --git a/nwnds_module/ar_amltlt_traabi.uti b/nwnds_module/ar_amltlt_traabi.uti new file mode 100644 index 000000000..ee66c6d64 Binary files /dev/null and b/nwnds_module/ar_amltlt_traabi.uti differ diff --git a/nwnds_module/ar_amltlt_urikhg.uti b/nwnds_module/ar_amltlt_urikhg.uti new file mode 100644 index 000000000..e3bc95d0d Binary files /dev/null and b/nwnds_module/ar_amltlt_urikhg.uti differ diff --git a/nwnds_module/ar_amltpd_archer.uti b/nwnds_module/ar_amltpd_archer.uti new file mode 100644 index 000000000..5f7d85bb3 Binary files /dev/null and b/nwnds_module/ar_amltpd_archer.uti differ diff --git a/nwnds_module/ar_amltpd_bsthed.uti b/nwnds_module/ar_amltpd_bsthed.uti new file mode 100644 index 000000000..58a074d16 Binary files /dev/null and b/nwnds_module/ar_amltpd_bsthed.uti differ diff --git a/nwnds_module/ar_amltsl_bmastr.uti b/nwnds_module/ar_amltsl_bmastr.uti new file mode 100644 index 000000000..a64a50340 Binary files /dev/null and b/nwnds_module/ar_amltsl_bmastr.uti differ diff --git a/nwnds_module/ar_amltsl_dagorr.uti b/nwnds_module/ar_amltsl_dagorr.uti new file mode 100644 index 000000000..e780940dd Binary files /dev/null and b/nwnds_module/ar_amltsl_dagorr.uti differ diff --git a/nwnds_module/ar_amltsl_earth.uti b/nwnds_module/ar_amltsl_earth.uti new file mode 100644 index 000000000..ef3c24b82 Binary files /dev/null and b/nwnds_module/ar_amltsl_earth.uti differ diff --git a/nwnds_module/ar_amltsl_entert.uti b/nwnds_module/ar_amltsl_entert.uti new file mode 100644 index 000000000..63d9a24b9 Binary files /dev/null and b/nwnds_module/ar_amltsl_entert.uti differ diff --git a/nwnds_module/ar_amltsl_flame.uti b/nwnds_module/ar_amltsl_flame.uti new file mode 100644 index 000000000..52e6d820b Binary files /dev/null and b/nwnds_module/ar_amltsl_flame.uti differ diff --git a/nwnds_module/ar_amltsl_hawk.uti b/nwnds_module/ar_amltsl_hawk.uti new file mode 100644 index 000000000..ce200060b Binary files /dev/null and b/nwnds_module/ar_amltsl_hawk.uti differ diff --git a/nwnds_module/ar_amltsl_magma.uti b/nwnds_module/ar_amltsl_magma.uti new file mode 100644 index 000000000..45d6b42f5 Binary files /dev/null and b/nwnds_module/ar_amltsl_magma.uti differ diff --git a/nwnds_module/ar_amltsl_meteor.uti b/nwnds_module/ar_amltsl_meteor.uti new file mode 100644 index 000000000..997f9c536 Binary files /dev/null and b/nwnds_module/ar_amltsl_meteor.uti differ diff --git a/nwnds_module/ar_amltsl_mrange.uti b/nwnds_module/ar_amltsl_mrange.uti new file mode 100644 index 000000000..b1cd633a9 Binary files /dev/null and b/nwnds_module/ar_amltsl_mrange.uti differ diff --git a/nwnds_module/ar_amltsl_rpride.uti b/nwnds_module/ar_amltsl_rpride.uti new file mode 100644 index 000000000..d4df2abd4 Binary files /dev/null and b/nwnds_module/ar_amltsl_rpride.uti differ diff --git a/nwnds_module/ar_amltsl_water.uti b/nwnds_module/ar_amltsl_water.uti new file mode 100644 index 000000000..8aab788d1 Binary files /dev/null and b/nwnds_module/ar_amltsl_water.uti differ diff --git a/nwnds_module/ar_ammdbp_battle.uti b/nwnds_module/ar_ammdbp_battle.uti new file mode 100644 index 000000000..d28d17c4f Binary files /dev/null and b/nwnds_module/ar_ammdbp_battle.uti differ diff --git a/nwnds_module/ar_ammdbp_dagorr.uti b/nwnds_module/ar_ammdbp_dagorr.uti new file mode 100644 index 000000000..0832cdc6f Binary files /dev/null and b/nwnds_module/ar_ammdbp_dagorr.uti differ diff --git a/nwnds_module/ar_ammdbp_earth.uti b/nwnds_module/ar_ammdbp_earth.uti new file mode 100644 index 000000000..49d0de891 Binary files /dev/null and b/nwnds_module/ar_ammdbp_earth.uti differ diff --git a/nwnds_module/ar_ammdbp_flame.uti b/nwnds_module/ar_ammdbp_flame.uti new file mode 100644 index 000000000..704ab4d30 Binary files /dev/null and b/nwnds_module/ar_ammdbp_flame.uti differ diff --git a/nwnds_module/ar_ammdbp_magma.uti b/nwnds_module/ar_ammdbp_magma.uti new file mode 100644 index 000000000..4b9c6cc41 Binary files /dev/null and b/nwnds_module/ar_ammdbp_magma.uti differ diff --git a/nwnds_module/ar_ammdbp_meteor.uti b/nwnds_module/ar_ammdbp_meteor.uti new file mode 100644 index 000000000..4ae5a5dfc Binary files /dev/null and b/nwnds_module/ar_ammdbp_meteor.uti differ diff --git a/nwnds_module/ar_ammdbp_oasis.ncs b/nwnds_module/ar_ammdbp_oasis.ncs new file mode 100644 index 000000000..5c03f841b Binary files /dev/null and b/nwnds_module/ar_ammdbp_oasis.ncs differ diff --git a/nwnds_module/ar_ammdbp_oasis.nss b/nwnds_module/ar_ammdbp_oasis.nss new file mode 100644 index 000000000..73b67a22b --- /dev/null +++ b/nwnds_module/ar_ammdbp_oasis.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a barbarian, unequip the item + if(GetLevelByClass(CLASS_TYPE_DRUID, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_ammdbp_oasis.uti b/nwnds_module/ar_ammdbp_oasis.uti new file mode 100644 index 000000000..ba318fcda Binary files /dev/null and b/nwnds_module/ar_ammdbp_oasis.uti differ diff --git a/nwnds_module/ar_ammdbp_raakle.uti b/nwnds_module/ar_ammdbp_raakle.uti new file mode 100644 index 000000000..6da399c45 Binary files /dev/null and b/nwnds_module/ar_ammdbp_raakle.uti differ diff --git a/nwnds_module/ar_ammdbp_spinew.uti b/nwnds_module/ar_ammdbp_spinew.uti new file mode 100644 index 000000000..5c4c51b16 Binary files /dev/null and b/nwnds_module/ar_ammdbp_spinew.uti differ diff --git a/nwnds_module/ar_ammdbp_umber.uti b/nwnds_module/ar_ammdbp_umber.uti new file mode 100644 index 000000000..534c37499 Binary files /dev/null and b/nwnds_module/ar_ammdbp_umber.uti differ diff --git a/nwnds_module/ar_ammdbp_urikhg.uti b/nwnds_module/ar_ammdbp_urikhg.uti new file mode 100644 index 000000000..3d7b0f995 Binary files /dev/null and b/nwnds_module/ar_ammdbp_urikhg.uti differ diff --git a/nwnds_module/ar_ammdcm_elfgrd.uti b/nwnds_module/ar_ammdcm_elfgrd.uti new file mode 100644 index 000000000..5b1f7e2a0 Binary files /dev/null and b/nwnds_module/ar_ammdcm_elfgrd.uti differ diff --git a/nwnds_module/ar_ammdcm_hereda.uti b/nwnds_module/ar_ammdcm_hereda.uti new file mode 100644 index 000000000..3bdc8091d Binary files /dev/null and b/nwnds_module/ar_ammdcm_hereda.uti differ diff --git a/nwnds_module/ar_ammdsc_bldbne.uti b/nwnds_module/ar_ammdsc_bldbne.uti new file mode 100644 index 000000000..6e5048a05 Binary files /dev/null and b/nwnds_module/ar_ammdsc_bldbne.uti differ diff --git a/nwnds_module/ar_ammdsc_louels.uti b/nwnds_module/ar_ammdsc_louels.uti new file mode 100644 index 000000000..20ef3f0cd Binary files /dev/null and b/nwnds_module/ar_ammdsc_louels.uti differ diff --git a/nwnds_module/ar_ammdsc_siege.uti b/nwnds_module/ar_ammdsc_siege.uti new file mode 100644 index 000000000..792feecf5 Binary files /dev/null and b/nwnds_module/ar_ammdsc_siege.uti differ diff --git a/nwnds_module/ar_ammdsc_urikhg.uti b/nwnds_module/ar_ammdsc_urikhg.uti new file mode 100644 index 000000000..54451c99a Binary files /dev/null and b/nwnds_module/ar_ammdsc_urikhg.uti differ diff --git a/nwnds_module/ar_ammdsc_water.uti b/nwnds_module/ar_ammdsc_water.uti new file mode 100644 index 000000000..0b2f3d43d Binary files /dev/null and b/nwnds_module/ar_ammdsc_water.uti differ diff --git a/nwnds_module/ar_ammdsc_ztal.uti b/nwnds_module/ar_ammdsc_ztal.uti new file mode 100644 index 000000000..8217b3896 Binary files /dev/null and b/nwnds_module/ar_ammdsc_ztal.uti differ diff --git a/nwnds_module/ar_ammo.utm b/nwnds_module/ar_ammo.utm new file mode 100644 index 000000000..b0bdd4e11 Binary files /dev/null and b/nwnds_module/ar_ammo.utm differ diff --git a/nwnds_module/ar_amphis001.utc b/nwnds_module/ar_amphis001.utc new file mode 100644 index 000000000..d22257787 Binary files /dev/null and b/nwnds_module/ar_amphis001.utc differ diff --git a/nwnds_module/ar_anglerooze001.utc b/nwnds_module/ar_anglerooze001.utc new file mode 100644 index 000000000..a6e58d2e8 Binary files /dev/null and b/nwnds_module/ar_anglerooze001.utc differ diff --git a/nwnds_module/ar_apclcl_acid01.uti b/nwnds_module/ar_apclcl_acid01.uti new file mode 100644 index 000000000..90157ede6 Binary files /dev/null and b/nwnds_module/ar_apclcl_acid01.uti differ diff --git a/nwnds_module/ar_apclcl_swift.uti b/nwnds_module/ar_apclcl_swift.uti new file mode 100644 index 000000000..a6f510040 Binary files /dev/null and b/nwnds_module/ar_apclcl_swift.uti differ diff --git a/nwnds_module/ar_apclgb_dmagma.uti b/nwnds_module/ar_apclgb_dmagma.uti new file mode 100644 index 000000000..15e6ee9bf Binary files /dev/null and b/nwnds_module/ar_apclgb_dmagma.uti differ diff --git a/nwnds_module/ar_apclgb_drain.uti b/nwnds_module/ar_apclgb_drain.uti new file mode 100644 index 000000000..a934d8943 Binary files /dev/null and b/nwnds_module/ar_apclgb_drain.uti differ diff --git a/nwnds_module/ar_apclgb_dwater.uti b/nwnds_module/ar_apclgb_dwater.uti new file mode 100644 index 000000000..b60d9b0b5 Binary files /dev/null and b/nwnds_module/ar_apclgb_dwater.uti differ diff --git a/nwnds_module/ar_apclgb_rhul.uti b/nwnds_module/ar_apclgb_rhul.uti new file mode 100644 index 000000000..c85d4bbaa Binary files /dev/null and b/nwnds_module/ar_apclgb_rhul.uti differ diff --git a/nwnds_module/ar_apclgb_villic.uti b/nwnds_module/ar_apclgb_villic.uti new file mode 100644 index 000000000..24866a473 Binary files /dev/null and b/nwnds_module/ar_apclgb_villic.uti differ diff --git a/nwnds_module/ar_apclrb_essenc.uti b/nwnds_module/ar_apclrb_essenc.uti new file mode 100644 index 000000000..31a49be34 Binary files /dev/null and b/nwnds_module/ar_apclrb_essenc.uti differ diff --git a/nwnds_module/ar_apcltg_dsilt.uti b/nwnds_module/ar_apcltg_dsilt.uti new file mode 100644 index 000000000..031e8c124 Binary files /dev/null and b/nwnds_module/ar_apcltg_dsilt.uti differ diff --git a/nwnds_module/ar_apcltg_tyrtmp.uti b/nwnds_module/ar_apcltg_tyrtmp.uti new file mode 100644 index 000000000..a9ec6970e Binary files /dev/null and b/nwnds_module/ar_apcltg_tyrtmp.uti differ diff --git a/nwnds_module/ar_apcltn_fire01.uti b/nwnds_module/ar_apcltn_fire01.uti new file mode 100644 index 000000000..d28672e0c Binary files /dev/null and b/nwnds_module/ar_apcltn_fire01.uti differ diff --git a/nwnds_module/ar_apcltn_ice01.uti b/nwnds_module/ar_apcltn_ice01.uti new file mode 100644 index 000000000..19f35b692 Binary files /dev/null and b/nwnds_module/ar_apcltn_ice01.uti differ diff --git a/nwnds_module/ar_apcltn_thugs.uti b/nwnds_module/ar_apcltn_thugs.uti new file mode 100644 index 000000000..8078a79a4 Binary files /dev/null and b/nwnds_module/ar_apcltn_thugs.uti differ diff --git a/nwnds_module/ar_apclvs_dearth.uti b/nwnds_module/ar_apclvs_dearth.uti new file mode 100644 index 000000000..d1af9d119 Binary files /dev/null and b/nwnds_module/ar_apclvs_dearth.uti differ diff --git a/nwnds_module/ar_apclvs_elec01.uti b/nwnds_module/ar_apclvs_elec01.uti new file mode 100644 index 000000000..b7af10d94 Binary files /dev/null and b/nwnds_module/ar_apclvs_elec01.uti differ diff --git a/nwnds_module/ar_apclwr_dsun.uti b/nwnds_module/ar_apclwr_dsun.uti new file mode 100644 index 000000000..111d3ae7d Binary files /dev/null and b/nwnds_module/ar_apclwr_dsun.uti differ diff --git a/nwnds_module/ar_ape001.utc b/nwnds_module/ar_ape001.utc new file mode 100644 index 000000000..6f2db95c2 Binary files /dev/null and b/nwnds_module/ar_ape001.utc differ diff --git a/nwnds_module/ar_aphvfp_braxat.uti b/nwnds_module/ar_aphvfp_braxat.uti new file mode 100644 index 000000000..660c74eca Binary files /dev/null and b/nwnds_module/ar_aphvfp_braxat.uti differ diff --git a/nwnds_module/ar_aphvfp_dair.uti b/nwnds_module/ar_aphvfp_dair.uti new file mode 100644 index 000000000..9df610a70 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dair.uti differ diff --git a/nwnds_module/ar_aphvfp_dearth.uti b/nwnds_module/ar_aphvfp_dearth.uti new file mode 100644 index 000000000..251638131 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dearth.uti differ diff --git a/nwnds_module/ar_aphvfp_dfire.uti b/nwnds_module/ar_aphvfp_dfire.uti new file mode 100644 index 000000000..66c201813 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dfire.uti differ diff --git a/nwnds_module/ar_aphvfp_dmagma.uti b/nwnds_module/ar_aphvfp_dmagma.uti new file mode 100644 index 000000000..4e0ac2a51 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dmagma.uti differ diff --git a/nwnds_module/ar_aphvfp_drain.uti b/nwnds_module/ar_aphvfp_drain.uti new file mode 100644 index 000000000..ad09611b0 Binary files /dev/null and b/nwnds_module/ar_aphvfp_drain.uti differ diff --git a/nwnds_module/ar_aphvfp_dsilt.uti b/nwnds_module/ar_aphvfp_dsilt.uti new file mode 100644 index 000000000..67f435a97 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dsilt.uti differ diff --git a/nwnds_module/ar_aphvfp_dsun.uti b/nwnds_module/ar_aphvfp_dsun.uti new file mode 100644 index 000000000..430c872e6 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dsun.uti differ diff --git a/nwnds_module/ar_aphvfp_dwater.uti b/nwnds_module/ar_aphvfp_dwater.uti new file mode 100644 index 000000000..cbab18eb4 Binary files /dev/null and b/nwnds_module/ar_aphvfp_dwater.uti differ diff --git a/nwnds_module/ar_aphvhp_acid01.uti b/nwnds_module/ar_aphvhp_acid01.uti new file mode 100644 index 000000000..f1fce156b Binary files /dev/null and b/nwnds_module/ar_aphvhp_acid01.uti differ diff --git a/nwnds_module/ar_aphvhp_elec01.uti b/nwnds_module/ar_aphvhp_elec01.uti new file mode 100644 index 000000000..e08060ca7 Binary files /dev/null and b/nwnds_module/ar_aphvhp_elec01.uti differ diff --git a/nwnds_module/ar_aphvhp_fire01.uti b/nwnds_module/ar_aphvhp_fire01.uti new file mode 100644 index 000000000..aec755596 Binary files /dev/null and b/nwnds_module/ar_aphvhp_fire01.uti differ diff --git a/nwnds_module/ar_aphvhp_ice01.uti b/nwnds_module/ar_aphvhp_ice01.uti new file mode 100644 index 000000000..dd7669787 Binary files /dev/null and b/nwnds_module/ar_aphvhp_ice01.uti differ diff --git a/nwnds_module/ar_apltlt_kank.uti b/nwnds_module/ar_apltlt_kank.uti new file mode 100644 index 000000000..67622d412 Binary files /dev/null and b/nwnds_module/ar_apltlt_kank.uti differ diff --git a/nwnds_module/ar_apltsl_acid01.uti b/nwnds_module/ar_apltsl_acid01.uti new file mode 100644 index 000000000..3473ef1e5 Binary files /dev/null and b/nwnds_module/ar_apltsl_acid01.uti differ diff --git a/nwnds_module/ar_apltsl_braxat.uti b/nwnds_module/ar_apltsl_braxat.uti new file mode 100644 index 000000000..da32a2776 Binary files /dev/null and b/nwnds_module/ar_apltsl_braxat.uti differ diff --git a/nwnds_module/ar_apltsl_dair.uti b/nwnds_module/ar_apltsl_dair.uti new file mode 100644 index 000000000..e31b00904 Binary files /dev/null and b/nwnds_module/ar_apltsl_dair.uti differ diff --git a/nwnds_module/ar_apltsl_dearth.uti b/nwnds_module/ar_apltsl_dearth.uti new file mode 100644 index 000000000..23b5c3e48 Binary files /dev/null and b/nwnds_module/ar_apltsl_dearth.uti differ diff --git a/nwnds_module/ar_apltsl_dfire.uti b/nwnds_module/ar_apltsl_dfire.uti new file mode 100644 index 000000000..f7b92f370 Binary files /dev/null and b/nwnds_module/ar_apltsl_dfire.uti differ diff --git a/nwnds_module/ar_apltsl_dmagma.uti b/nwnds_module/ar_apltsl_dmagma.uti new file mode 100644 index 000000000..cff4c06d8 Binary files /dev/null and b/nwnds_module/ar_apltsl_dmagma.uti differ diff --git a/nwnds_module/ar_apltsl_drain.uti b/nwnds_module/ar_apltsl_drain.uti new file mode 100644 index 000000000..7cf39b82c Binary files /dev/null and b/nwnds_module/ar_apltsl_drain.uti differ diff --git a/nwnds_module/ar_apltsl_dsilt.uti b/nwnds_module/ar_apltsl_dsilt.uti new file mode 100644 index 000000000..6216bbe15 Binary files /dev/null and b/nwnds_module/ar_apltsl_dsilt.uti differ diff --git a/nwnds_module/ar_apltsl_dsun.uti b/nwnds_module/ar_apltsl_dsun.uti new file mode 100644 index 000000000..850b4c1eb Binary files /dev/null and b/nwnds_module/ar_apltsl_dsun.uti differ diff --git a/nwnds_module/ar_apltsl_dwater.uti b/nwnds_module/ar_apltsl_dwater.uti new file mode 100644 index 000000000..47676a673 Binary files /dev/null and b/nwnds_module/ar_apltsl_dwater.uti differ diff --git a/nwnds_module/ar_apltsl_elec01.uti b/nwnds_module/ar_apltsl_elec01.uti new file mode 100644 index 000000000..6b74f4488 Binary files /dev/null and b/nwnds_module/ar_apltsl_elec01.uti differ diff --git a/nwnds_module/ar_apltsl_fire01.uti b/nwnds_module/ar_apltsl_fire01.uti new file mode 100644 index 000000000..64501f681 Binary files /dev/null and b/nwnds_module/ar_apltsl_fire01.uti differ diff --git a/nwnds_module/ar_apltsl_ice01.uti b/nwnds_module/ar_apltsl_ice01.uti new file mode 100644 index 000000000..db8a07028 Binary files /dev/null and b/nwnds_module/ar_apltsl_ice01.uti differ diff --git a/nwnds_module/ar_apmdbp_acid01.uti b/nwnds_module/ar_apmdbp_acid01.uti new file mode 100644 index 000000000..378550d65 Binary files /dev/null and b/nwnds_module/ar_apmdbp_acid01.uti differ diff --git a/nwnds_module/ar_apmdbp_braxat.uti b/nwnds_module/ar_apmdbp_braxat.uti new file mode 100644 index 000000000..f39f8d15f Binary files /dev/null and b/nwnds_module/ar_apmdbp_braxat.uti differ diff --git a/nwnds_module/ar_apmdbp_crimgd.uti b/nwnds_module/ar_apmdbp_crimgd.uti new file mode 100644 index 000000000..6a50e4432 Binary files /dev/null and b/nwnds_module/ar_apmdbp_crimgd.uti differ diff --git a/nwnds_module/ar_apmdbp_dair.uti b/nwnds_module/ar_apmdbp_dair.uti new file mode 100644 index 000000000..ed7844f77 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dair.uti differ diff --git a/nwnds_module/ar_apmdbp_dearth.uti b/nwnds_module/ar_apmdbp_dearth.uti new file mode 100644 index 000000000..2a7f79c06 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dearth.uti differ diff --git a/nwnds_module/ar_apmdbp_dfire.uti b/nwnds_module/ar_apmdbp_dfire.uti new file mode 100644 index 000000000..c1deedd8d Binary files /dev/null and b/nwnds_module/ar_apmdbp_dfire.uti differ diff --git a/nwnds_module/ar_apmdbp_dmagma.uti b/nwnds_module/ar_apmdbp_dmagma.uti new file mode 100644 index 000000000..d10b240a1 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dmagma.uti differ diff --git a/nwnds_module/ar_apmdbp_drain.uti b/nwnds_module/ar_apmdbp_drain.uti new file mode 100644 index 000000000..2e3f03ee5 Binary files /dev/null and b/nwnds_module/ar_apmdbp_drain.uti differ diff --git a/nwnds_module/ar_apmdbp_dsilt.uti b/nwnds_module/ar_apmdbp_dsilt.uti new file mode 100644 index 000000000..c0bc7efe4 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dsilt.uti differ diff --git a/nwnds_module/ar_apmdbp_dsun.uti b/nwnds_module/ar_apmdbp_dsun.uti new file mode 100644 index 000000000..062749741 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dsun.uti differ diff --git a/nwnds_module/ar_apmdbp_dwater.uti b/nwnds_module/ar_apmdbp_dwater.uti new file mode 100644 index 000000000..87bd60110 Binary files /dev/null and b/nwnds_module/ar_apmdbp_dwater.uti differ diff --git a/nwnds_module/ar_apmdbp_elec01.uti b/nwnds_module/ar_apmdbp_elec01.uti new file mode 100644 index 000000000..7b901074a Binary files /dev/null and b/nwnds_module/ar_apmdbp_elec01.uti differ diff --git a/nwnds_module/ar_apmdbp_fire01.uti b/nwnds_module/ar_apmdbp_fire01.uti new file mode 100644 index 000000000..7aa0b93e9 Binary files /dev/null and b/nwnds_module/ar_apmdbp_fire01.uti differ diff --git a/nwnds_module/ar_apmdbp_ice01.uti b/nwnds_module/ar_apmdbp_ice01.uti new file mode 100644 index 000000000..5abb46105 Binary files /dev/null and b/nwnds_module/ar_apmdbp_ice01.uti differ diff --git a/nwnds_module/ar_apmdbp_isteel.uti b/nwnds_module/ar_apmdbp_isteel.uti new file mode 100644 index 000000000..9c7bb7f35 Binary files /dev/null and b/nwnds_module/ar_apmdbp_isteel.uti differ diff --git a/nwnds_module/ar_apmdcm_draqo.uti b/nwnds_module/ar_apmdcm_draqo.uti new file mode 100644 index 000000000..d67f29ede Binary files /dev/null and b/nwnds_module/ar_apmdcm_draqo.uti differ diff --git a/nwnds_module/ar_aranea001.utc b/nwnds_module/ar_aranea001.utc new file mode 100644 index 000000000..ed4584d6e Binary files /dev/null and b/nwnds_module/ar_aranea001.utc differ diff --git a/nwnds_module/ar_ashlw_agafari.uti b/nwnds_module/ar_ashlw_agafari.uti new file mode 100644 index 000000000..5f8f09348 Binary files /dev/null and b/nwnds_module/ar_ashlw_agafari.uti differ diff --git a/nwnds_module/ar_ashlw_alloy.uti b/nwnds_module/ar_ashlw_alloy.uti new file mode 100644 index 000000000..580ab1f60 Binary files /dev/null and b/nwnds_module/ar_ashlw_alloy.uti differ diff --git a/nwnds_module/ar_ashlw_iron01.uti b/nwnds_module/ar_ashlw_iron01.uti new file mode 100644 index 000000000..cdc1307d0 Binary files /dev/null and b/nwnds_module/ar_ashlw_iron01.uti differ diff --git a/nwnds_module/ar_ashlw_ivory.uti b/nwnds_module/ar_ashlw_ivory.uti new file mode 100644 index 000000000..1bfa40412 Binary files /dev/null and b/nwnds_module/ar_ashlw_ivory.uti differ diff --git a/nwnds_module/ar_ashlw_lifesha.uti b/nwnds_module/ar_ashlw_lifesha.uti new file mode 100644 index 000000000..3facbfb31 Binary files /dev/null and b/nwnds_module/ar_ashlw_lifesha.uti differ diff --git a/nwnds_module/ar_ashlw_mekillo.uti b/nwnds_module/ar_ashlw_mekillo.uti new file mode 100644 index 000000000..539e62526 Binary files /dev/null and b/nwnds_module/ar_ashlw_mekillo.uti differ diff --git a/nwnds_module/ar_ashlw_wood01.uti b/nwnds_module/ar_ashlw_wood01.uti new file mode 100644 index 000000000..3f3cd3dfb Binary files /dev/null and b/nwnds_module/ar_ashlw_wood01.uti differ diff --git a/nwnds_module/ar_ashmlw_antiqu.uti b/nwnds_module/ar_ashmlw_antiqu.uti new file mode 100644 index 000000000..c91ad3ab0 Binary files /dev/null and b/nwnds_module/ar_ashmlw_antiqu.uti differ diff --git a/nwnds_module/ar_ashmlw_drair.uti b/nwnds_module/ar_ashmlw_drair.uti new file mode 100644 index 000000000..0a6135136 Binary files /dev/null and b/nwnds_module/ar_ashmlw_drair.uti differ diff --git a/nwnds_module/ar_ashmlw_dreart.uti b/nwnds_module/ar_ashmlw_dreart.uti new file mode 100644 index 000000000..78f9e91f5 Binary files /dev/null and b/nwnds_module/ar_ashmlw_dreart.uti differ diff --git a/nwnds_module/ar_ashmlw_drfire.uti b/nwnds_module/ar_ashmlw_drfire.uti new file mode 100644 index 000000000..05501f86d Binary files /dev/null and b/nwnds_module/ar_ashmlw_drfire.uti differ diff --git a/nwnds_module/ar_ashmlw_drmagm.uti b/nwnds_module/ar_ashmlw_drmagm.uti new file mode 100644 index 000000000..99132ac11 Binary files /dev/null and b/nwnds_module/ar_ashmlw_drmagm.uti differ diff --git a/nwnds_module/ar_ashmlw_drrain.uti b/nwnds_module/ar_ashmlw_drrain.uti new file mode 100644 index 000000000..38be82a31 Binary files /dev/null and b/nwnds_module/ar_ashmlw_drrain.uti differ diff --git a/nwnds_module/ar_ashmlw_drsilt.uti b/nwnds_module/ar_ashmlw_drsilt.uti new file mode 100644 index 000000000..fb97cb1aa Binary files /dev/null and b/nwnds_module/ar_ashmlw_drsilt.uti differ diff --git a/nwnds_module/ar_ashmlw_drsun.uti b/nwnds_module/ar_ashmlw_drsun.uti new file mode 100644 index 000000000..7d74d1183 Binary files /dev/null and b/nwnds_module/ar_ashmlw_drsun.uti differ diff --git a/nwnds_module/ar_ashmlw_drwate.uti b/nwnds_module/ar_ashmlw_drwate.uti new file mode 100644 index 000000000..67a523a53 Binary files /dev/null and b/nwnds_module/ar_ashmlw_drwate.uti differ diff --git a/nwnds_module/ar_ashmlw_dwarf.uti b/nwnds_module/ar_ashmlw_dwarf.uti new file mode 100644 index 000000000..234bbbf1d Binary files /dev/null and b/nwnds_module/ar_ashmlw_dwarf.uti differ diff --git a/nwnds_module/ar_ashmlw_grafna.uti b/nwnds_module/ar_ashmlw_grafna.uti new file mode 100644 index 000000000..b6c2aa540 Binary files /dev/null and b/nwnds_module/ar_ashmlw_grafna.uti differ diff --git a/nwnds_module/ar_ashmlw_half.uti b/nwnds_module/ar_ashmlw_half.uti new file mode 100644 index 000000000..a8304c18e Binary files /dev/null and b/nwnds_module/ar_ashmlw_half.uti differ diff --git a/nwnds_module/ar_ashmlw_meteor.uti b/nwnds_module/ar_ashmlw_meteor.uti new file mode 100644 index 000000000..4b3d720a0 Binary files /dev/null and b/nwnds_module/ar_ashmlw_meteor.uti differ diff --git a/nwnds_module/ar_ashmlw_spell.uti b/nwnds_module/ar_ashmlw_spell.uti new file mode 100644 index 000000000..a116723d1 Binary files /dev/null and b/nwnds_module/ar_ashmlw_spell.uti differ diff --git a/nwnds_module/ar_ashmlw_urikhg.uti b/nwnds_module/ar_ashmlw_urikhg.uti new file mode 100644 index 000000000..46b4e6f9c Binary files /dev/null and b/nwnds_module/ar_ashmlw_urikhg.uti differ diff --git a/nwnds_module/ar_ashmsw_drair.uti b/nwnds_module/ar_ashmsw_drair.uti new file mode 100644 index 000000000..8d6eaf045 Binary files /dev/null and b/nwnds_module/ar_ashmsw_drair.uti differ diff --git a/nwnds_module/ar_ashmsw_dreart.uti b/nwnds_module/ar_ashmsw_dreart.uti new file mode 100644 index 000000000..fd0feba89 Binary files /dev/null and b/nwnds_module/ar_ashmsw_dreart.uti differ diff --git a/nwnds_module/ar_ashmsw_drfire.uti b/nwnds_module/ar_ashmsw_drfire.uti new file mode 100644 index 000000000..93d66e688 Binary files /dev/null and b/nwnds_module/ar_ashmsw_drfire.uti differ diff --git a/nwnds_module/ar_ashmsw_drmagm.uti b/nwnds_module/ar_ashmsw_drmagm.uti new file mode 100644 index 000000000..660d28d31 Binary files /dev/null and b/nwnds_module/ar_ashmsw_drmagm.uti differ diff --git a/nwnds_module/ar_ashmsw_drrain.uti b/nwnds_module/ar_ashmsw_drrain.uti new file mode 100644 index 000000000..420c2dee5 Binary files /dev/null and b/nwnds_module/ar_ashmsw_drrain.uti differ diff --git a/nwnds_module/ar_ashmsw_drsilt.uti b/nwnds_module/ar_ashmsw_drsilt.uti new file mode 100644 index 000000000..953d26f0e Binary files /dev/null and b/nwnds_module/ar_ashmsw_drsilt.uti differ diff --git a/nwnds_module/ar_ashmsw_drsun.uti b/nwnds_module/ar_ashmsw_drsun.uti new file mode 100644 index 000000000..4fd7a8bba Binary files /dev/null and b/nwnds_module/ar_ashmsw_drsun.uti differ diff --git a/nwnds_module/ar_ashmsw_drwate.uti b/nwnds_module/ar_ashmsw_drwate.uti new file mode 100644 index 000000000..969a0ea8b Binary files /dev/null and b/nwnds_module/ar_ashmsw_drwate.uti differ diff --git a/nwnds_module/ar_ashmsw_heartf.uti b/nwnds_module/ar_ashmsw_heartf.uti new file mode 100644 index 000000000..a29ec568b Binary files /dev/null and b/nwnds_module/ar_ashmsw_heartf.uti differ diff --git a/nwnds_module/ar_ashmsw_imbaga.uti b/nwnds_module/ar_ashmsw_imbaga.uti new file mode 100644 index 000000000..36af286f1 Binary files /dev/null and b/nwnds_module/ar_ashmsw_imbaga.uti differ diff --git a/nwnds_module/ar_ashmsw_malif.uti b/nwnds_module/ar_ashmsw_malif.uti new file mode 100644 index 000000000..5785c01fe Binary files /dev/null and b/nwnds_module/ar_ashmsw_malif.uti differ diff --git a/nwnds_module/ar_ashmsw_meteor.uti b/nwnds_module/ar_ashmsw_meteor.uti new file mode 100644 index 000000000..d73b6117a Binary files /dev/null and b/nwnds_module/ar_ashmsw_meteor.uti differ diff --git a/nwnds_module/ar_ashmsw_nghtmr.uti b/nwnds_module/ar_ashmsw_nghtmr.uti new file mode 100644 index 000000000..4dcc83524 Binary files /dev/null and b/nwnds_module/ar_ashmsw_nghtmr.uti differ diff --git a/nwnds_module/ar_ashmsw_obhope.uti b/nwnds_module/ar_ashmsw_obhope.uti new file mode 100644 index 000000000..2ab1a6289 Binary files /dev/null and b/nwnds_module/ar_ashmsw_obhope.uti differ diff --git a/nwnds_module/ar_ashmsw_prglen.uti b/nwnds_module/ar_ashmsw_prglen.uti new file mode 100644 index 000000000..464c3e3d8 Binary files /dev/null and b/nwnds_module/ar_ashmsw_prglen.uti differ diff --git a/nwnds_module/ar_ashmsw_protec.uti b/nwnds_module/ar_ashmsw_protec.uti new file mode 100644 index 000000000..9d9c0e833 Binary files /dev/null and b/nwnds_module/ar_ashmsw_protec.uti differ diff --git a/nwnds_module/ar_ashmto_ashen.uti b/nwnds_module/ar_ashmto_ashen.uti new file mode 100644 index 000000000..1400badab Binary files /dev/null and b/nwnds_module/ar_ashmto_ashen.uti differ diff --git a/nwnds_module/ar_ashmto_dirgan.uti b/nwnds_module/ar_ashmto_dirgan.uti new file mode 100644 index 000000000..eca406dfc Binary files /dev/null and b/nwnds_module/ar_ashmto_dirgan.uti differ diff --git a/nwnds_module/ar_ashmto_drair.uti b/nwnds_module/ar_ashmto_drair.uti new file mode 100644 index 000000000..25805debb Binary files /dev/null and b/nwnds_module/ar_ashmto_drair.uti differ diff --git a/nwnds_module/ar_ashmto_dreart.uti b/nwnds_module/ar_ashmto_dreart.uti new file mode 100644 index 000000000..407e09651 Binary files /dev/null and b/nwnds_module/ar_ashmto_dreart.uti differ diff --git a/nwnds_module/ar_ashmto_drfire.uti b/nwnds_module/ar_ashmto_drfire.uti new file mode 100644 index 000000000..552aea328 Binary files /dev/null and b/nwnds_module/ar_ashmto_drfire.uti differ diff --git a/nwnds_module/ar_ashmto_drmagm.uti b/nwnds_module/ar_ashmto_drmagm.uti new file mode 100644 index 000000000..842f16a58 Binary files /dev/null and b/nwnds_module/ar_ashmto_drmagm.uti differ diff --git a/nwnds_module/ar_ashmto_drrain.uti b/nwnds_module/ar_ashmto_drrain.uti new file mode 100644 index 000000000..79eb39f11 Binary files /dev/null and b/nwnds_module/ar_ashmto_drrain.uti differ diff --git a/nwnds_module/ar_ashmto_drsilt.uti b/nwnds_module/ar_ashmto_drsilt.uti new file mode 100644 index 000000000..b6df85b80 Binary files /dev/null and b/nwnds_module/ar_ashmto_drsilt.uti differ diff --git a/nwnds_module/ar_ashmto_drsun.uti b/nwnds_module/ar_ashmto_drsun.uti new file mode 100644 index 000000000..97ca1b338 Binary files /dev/null and b/nwnds_module/ar_ashmto_drsun.uti differ diff --git a/nwnds_module/ar_ashmto_drwate.uti b/nwnds_module/ar_ashmto_drwate.uti new file mode 100644 index 000000000..b6887ec85 Binary files /dev/null and b/nwnds_module/ar_ashmto_drwate.uti differ diff --git a/nwnds_module/ar_ashmto_giant.uti b/nwnds_module/ar_ashmto_giant.uti new file mode 100644 index 000000000..b63d5774c Binary files /dev/null and b/nwnds_module/ar_ashmto_giant.uti differ diff --git a/nwnds_module/ar_ashmto_guard.uti b/nwnds_module/ar_ashmto_guard.uti new file mode 100644 index 000000000..c92981510 Binary files /dev/null and b/nwnds_module/ar_ashmto_guard.uti differ diff --git a/nwnds_module/ar_ashmto_hope.uti b/nwnds_module/ar_ashmto_hope.uti new file mode 100644 index 000000000..5b19d7b8e Binary files /dev/null and b/nwnds_module/ar_ashmto_hope.uti differ diff --git a/nwnds_module/ar_ashmto_imbaga.uti b/nwnds_module/ar_ashmto_imbaga.uti new file mode 100644 index 000000000..0b6642215 Binary files /dev/null and b/nwnds_module/ar_ashmto_imbaga.uti differ diff --git a/nwnds_module/ar_ashmto_meteor.uti b/nwnds_module/ar_ashmto_meteor.uti new file mode 100644 index 000000000..a9a438eb1 Binary files /dev/null and b/nwnds_module/ar_ashmto_meteor.uti differ diff --git a/nwnds_module/ar_ashmto_mirror.uti b/nwnds_module/ar_ashmto_mirror.uti new file mode 100644 index 000000000..bb996e35d Binary files /dev/null and b/nwnds_module/ar_ashmto_mirror.uti differ diff --git a/nwnds_module/ar_ashmto_rgfury.uti b/nwnds_module/ar_ashmto_rgfury.uti new file mode 100644 index 000000000..4be15b317 Binary files /dev/null and b/nwnds_module/ar_ashmto_rgfury.uti differ diff --git a/nwnds_module/ar_ashmto_sanshr.uti b/nwnds_module/ar_ashmto_sanshr.uti new file mode 100644 index 000000000..7bf5ef280 Binary files /dev/null and b/nwnds_module/ar_ashmto_sanshr.uti differ diff --git a/nwnds_module/ar_ashmto_souls.uti b/nwnds_module/ar_ashmto_souls.uti new file mode 100644 index 000000000..e277676fa Binary files /dev/null and b/nwnds_module/ar_ashmto_souls.uti differ diff --git a/nwnds_module/ar_ashmto_sr14.uti b/nwnds_module/ar_ashmto_sr14.uti new file mode 100644 index 000000000..1483f839f Binary files /dev/null and b/nwnds_module/ar_ashmto_sr14.uti differ diff --git a/nwnds_module/ar_ashplw_imbaga.uti b/nwnds_module/ar_ashplw_imbaga.uti new file mode 100644 index 000000000..102af5f8e Binary files /dev/null and b/nwnds_module/ar_ashplw_imbaga.uti differ diff --git a/nwnds_module/ar_ashpto_fgfort.uti b/nwnds_module/ar_ashpto_fgfort.uti new file mode 100644 index 000000000..20310a1d5 Binary files /dev/null and b/nwnds_module/ar_ashpto_fgfort.uti differ diff --git a/nwnds_module/ar_ashpto_imbued.uti b/nwnds_module/ar_ashpto_imbued.uti new file mode 100644 index 000000000..e171973a8 Binary files /dev/null and b/nwnds_module/ar_ashpto_imbued.uti differ diff --git a/nwnds_module/ar_ashsw_agafari.uti b/nwnds_module/ar_ashsw_agafari.uti new file mode 100644 index 000000000..ef8f1cd70 Binary files /dev/null and b/nwnds_module/ar_ashsw_agafari.uti differ diff --git a/nwnds_module/ar_ashsw_alloy.uti b/nwnds_module/ar_ashsw_alloy.uti new file mode 100644 index 000000000..136d0ee5a Binary files /dev/null and b/nwnds_module/ar_ashsw_alloy.uti differ diff --git a/nwnds_module/ar_ashsw_iron01.uti b/nwnds_module/ar_ashsw_iron01.uti new file mode 100644 index 000000000..9174130b2 Binary files /dev/null and b/nwnds_module/ar_ashsw_iron01.uti differ diff --git a/nwnds_module/ar_ashsw_ivory.uti b/nwnds_module/ar_ashsw_ivory.uti new file mode 100644 index 000000000..edb79d84f Binary files /dev/null and b/nwnds_module/ar_ashsw_ivory.uti differ diff --git a/nwnds_module/ar_ashsw_lifesh.uti b/nwnds_module/ar_ashsw_lifesh.uti new file mode 100644 index 000000000..9adaef389 Binary files /dev/null and b/nwnds_module/ar_ashsw_lifesh.uti differ diff --git a/nwnds_module/ar_ashsw_mekilli.uti b/nwnds_module/ar_ashsw_mekilli.uti new file mode 100644 index 000000000..587255341 Binary files /dev/null and b/nwnds_module/ar_ashsw_mekilli.uti differ diff --git a/nwnds_module/ar_ashsw_wood01.uti b/nwnds_module/ar_ashsw_wood01.uti new file mode 100644 index 000000000..c7ca3d035 Binary files /dev/null and b/nwnds_module/ar_ashsw_wood01.uti differ diff --git a/nwnds_module/ar_ashto_agafari.uti b/nwnds_module/ar_ashto_agafari.uti new file mode 100644 index 000000000..12a5de228 Binary files /dev/null and b/nwnds_module/ar_ashto_agafari.uti differ diff --git a/nwnds_module/ar_ashto_alloy.uti b/nwnds_module/ar_ashto_alloy.uti new file mode 100644 index 000000000..feb22ef65 Binary files /dev/null and b/nwnds_module/ar_ashto_alloy.uti differ diff --git a/nwnds_module/ar_ashto_iron01.uti b/nwnds_module/ar_ashto_iron01.uti new file mode 100644 index 000000000..2c838ca2b Binary files /dev/null and b/nwnds_module/ar_ashto_iron01.uti differ diff --git a/nwnds_module/ar_ashto_ivory.uti b/nwnds_module/ar_ashto_ivory.uti new file mode 100644 index 000000000..b02f1eece Binary files /dev/null and b/nwnds_module/ar_ashto_ivory.uti differ diff --git a/nwnds_module/ar_ashto_mekilli.uti b/nwnds_module/ar_ashto_mekilli.uti new file mode 100644 index 000000000..fedbaf541 Binary files /dev/null and b/nwnds_module/ar_ashto_mekilli.uti differ diff --git a/nwnds_module/ar_ashto_wood01.uti b/nwnds_module/ar_ashto_wood01.uti new file mode 100644 index 000000000..6736ca0d7 Binary files /dev/null and b/nwnds_module/ar_ashto_wood01.uti differ diff --git a/nwnds_module/ar_aviarag_001.utc b/nwnds_module/ar_aviarag_001.utc new file mode 100644 index 000000000..204364bf7 Binary files /dev/null and b/nwnds_module/ar_aviarag_001.utc differ diff --git a/nwnds_module/ar_aviarag_002.utc b/nwnds_module/ar_aviarag_002.utc new file mode 100644 index 000000000..c389767df Binary files /dev/null and b/nwnds_module/ar_aviarag_002.utc differ diff --git a/nwnds_module/ar_aviarag_003.utc b/nwnds_module/ar_aviarag_003.utc new file mode 100644 index 000000000..4e30d4bda Binary files /dev/null and b/nwnds_module/ar_aviarag_003.utc differ diff --git a/nwnds_module/ar_axebeak001.utc b/nwnds_module/ar_axebeak001.utc new file mode 100644 index 000000000..c3f8e972b Binary files /dev/null and b/nwnds_module/ar_axebeak001.utc differ diff --git a/nwnds_module/ar_azer001.utc b/nwnds_module/ar_azer001.utc new file mode 100644 index 000000000..143fc6376 Binary files /dev/null and b/nwnds_module/ar_azer001.utc differ diff --git a/nwnds_module/ar_azer002.utc b/nwnds_module/ar_azer002.utc new file mode 100644 index 000000000..f87399c37 Binary files /dev/null and b/nwnds_module/ar_azer002.utc differ diff --git a/nwnds_module/ar_azer003.utc b/nwnds_module/ar_azer003.utc new file mode 100644 index 000000000..b478a165a Binary files /dev/null and b/nwnds_module/ar_azer003.utc differ diff --git a/nwnds_module/ar_azer004.utc b/nwnds_module/ar_azer004.utc new file mode 100644 index 000000000..a52fe808c Binary files /dev/null and b/nwnds_module/ar_azer004.utc differ diff --git a/nwnds_module/ar_azerhammer.uti b/nwnds_module/ar_azerhammer.uti new file mode 100644 index 000000000..4dd89a23f Binary files /dev/null and b/nwnds_module/ar_azerhammer.uti differ diff --git a/nwnds_module/ar_banditspawn.ncs b/nwnds_module/ar_banditspawn.ncs new file mode 100644 index 000000000..e3007da76 Binary files /dev/null and b/nwnds_module/ar_banditspawn.ncs differ diff --git a/nwnds_module/ar_banditspawn.nss b/nwnds_module/ar_banditspawn.nss new file mode 100644 index 000000000..80e5a4909 --- /dev/null +++ b/nwnds_module/ar_banditspawn.nss @@ -0,0 +1,111 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 2003-07-28: Georg Zoeller: + + If you set a integer 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "ms_name_inc" +#include "x2_inc_switches" +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + /* 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 nSkinColor; + nSkinColor = Random(20); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(12)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + ms_Nomenclature(OBJECT_SELF); + DelayCommand(1.0f, ms_Nomenclature(OBJECT_SELF)); + AssignCommand(OBJECT_SELF, ActionRandomWalk()); +} diff --git a/nwnds_module/ar_bardsfriends.utm b/nwnds_module/ar_bardsfriends.utm new file mode 100644 index 000000000..d81cd26b7 Binary files /dev/null and b/nwnds_module/ar_bardsfriends.utm differ diff --git a/nwnds_module/ar_barredoor_f2o.ncs b/nwnds_module/ar_barredoor_f2o.ncs new file mode 100644 index 000000000..8ee6a75fe Binary files /dev/null and b/nwnds_module/ar_barredoor_f2o.ncs differ diff --git a/nwnds_module/ar_barredoor_f2o.nss b/nwnds_module/ar_barredoor_f2o.nss new file mode 100644 index 000000000..febc5b23a --- /dev/null +++ b/nwnds_module/ar_barredoor_f2o.nss @@ -0,0 +1,80 @@ +//:://///////////////////////////////////////////// +//:: Name Random OnFailToOpen Msg Generator - for Doors +//:: FileName ar_barreddoor_f2o +//:: +//:: +////////////////////////////////////////////// +/* Use this script to show that the door can never be opened with random + messages instead of just 1 (This door has been barred from the other + side.) for example. A big thanks to Kevin Eberwein for giving me a hand + making this work as well as a couple ideas to add to it.*/ +//::////////////////////////////////////////////// +//:: Created By: Kevin Werbenuk (Help from Kevin Eberwein) +//:: Created On: July 14, 2002 +//::////////////////////////////////////////////// + +void main() + { + object oPC = GetLastUsedBy(); // Get the PC that attempted to open the door. + object oDoor = OBJECT_SELF; // Gets the door this is being called from + int nRandomMsg; + int nVar; + int nDoorNumber; + + nVar = GetLocalInt(oPC, "TYR_DOOR_01"); + nDoorNumber = GetLocalInt(OBJECT_SELF, "BARRED"); + + if (nVar != 0) + nRandomMsg = nVar; + + else + nRandomMsg = Random(9); + + switch (nRandomMsg) + { + case 0: + SpeakString("This door is barred from the other side."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 1: + SpeakString("As you reach for the door handle you notice, there isn't one. Looks like you will have to try to find another way if there is."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 2: + SpeakString("As you turn the handle a voice bellows, 'Go away! Your not getting in here!'"); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 3: + SpeakString("Neither push nor pull can get this door open."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 4: + SpeakString("As you attempt entry you hear a 'Thud.' Obviously this door is blocked by some means"); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 5: + SpeakString("Approaching the door you get an overwhelming feeling of magic power. There seems to be some magical ward preventing this door from being opened."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 6: + SpeakString("Unfortunately you are not strong enough to open this door."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 7: + SpeakString("The sound of laughter seems to emminate from the door as it doesn't buldge."); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + + case 8: + SpeakString("Opening doors isn't your strong point, eh?"); + SetLocalInt(oPC, "TYR_DOOR_01", nRandomMsg); + break; + } +} diff --git a/nwnds_module/ar_barrel_001.utp b/nwnds_module/ar_barrel_001.utp new file mode 100644 index 000000000..a897c3db2 Binary files /dev/null and b/nwnds_module/ar_barrel_001.utp differ diff --git a/nwnds_module/ar_bartender.utc b/nwnds_module/ar_bartender.utc new file mode 100644 index 000000000..41fd525ef Binary files /dev/null and b/nwnds_module/ar_bartender.utc differ diff --git a/nwnds_module/ar_basilisk001.utc b/nwnds_module/ar_basilisk001.utc new file mode 100644 index 000000000..865ad4a3c Binary files /dev/null and b/nwnds_module/ar_basilisk001.utc differ diff --git a/nwnds_module/ar_bastardswords.utm b/nwnds_module/ar_bastardswords.utm new file mode 100644 index 000000000..3b9a9b3eb Binary files /dev/null and b/nwnds_module/ar_bastardswords.utm differ diff --git a/nwnds_module/ar_bat001.utc b/nwnds_module/ar_bat001.utc new file mode 100644 index 000000000..b6293499d Binary files /dev/null and b/nwnds_module/ar_bat001.utc differ diff --git a/nwnds_module/ar_bat002.utc b/nwnds_module/ar_bat002.utc new file mode 100644 index 000000000..b6aa6bf59 Binary files /dev/null and b/nwnds_module/ar_bat002.utc differ diff --git a/nwnds_module/ar_battleaxes.utm b/nwnds_module/ar_battleaxes.utm new file mode 100644 index 000000000..1e94e1ad7 Binary files /dev/null and b/nwnds_module/ar_battleaxes.utm differ diff --git a/nwnds_module/ar_bear001.utc b/nwnds_module/ar_bear001.utc new file mode 100644 index 000000000..27ca4681b Binary files /dev/null and b/nwnds_module/ar_bear001.utc differ diff --git a/nwnds_module/ar_bear002.utc b/nwnds_module/ar_bear002.utc new file mode 100644 index 000000000..41891b106 Binary files /dev/null and b/nwnds_module/ar_bear002.utc differ diff --git a/nwnds_module/ar_bear003.utc b/nwnds_module/ar_bear003.utc new file mode 100644 index 000000000..71d16f912 Binary files /dev/null and b/nwnds_module/ar_bear003.utc differ diff --git a/nwnds_module/ar_behir_001.utc b/nwnds_module/ar_behir_001.utc new file mode 100644 index 000000000..84374743d Binary files /dev/null and b/nwnds_module/ar_behir_001.utc differ diff --git a/nwnds_module/ar_behir_hide.uti b/nwnds_module/ar_behir_hide.uti new file mode 100644 index 000000000..070146ec0 Binary files /dev/null and b/nwnds_module/ar_behir_hide.uti differ diff --git a/nwnds_module/ar_behirbite.uti b/nwnds_module/ar_behirbite.uti new file mode 100644 index 000000000..2de2c8e0a Binary files /dev/null and b/nwnds_module/ar_behirbite.uti differ diff --git a/nwnds_module/ar_belker001.utc b/nwnds_module/ar_belker001.utc new file mode 100644 index 000000000..e7bc383f1 Binary files /dev/null and b/nwnds_module/ar_belker001.utc differ diff --git a/nwnds_module/ar_belts.utm b/nwnds_module/ar_belts.utm new file mode 100644 index 000000000..a59efc0d4 Binary files /dev/null and b/nwnds_module/ar_belts.utm differ diff --git a/nwnds_module/ar_bengali.utc b/nwnds_module/ar_bengali.utc new file mode 100644 index 000000000..105bbc311 Binary files /dev/null and b/nwnds_module/ar_bengali.utc differ diff --git a/nwnds_module/ar_berzwasp001.utc b/nwnds_module/ar_berzwasp001.utc new file mode 100644 index 000000000..1c1317a7e Binary files /dev/null and b/nwnds_module/ar_berzwasp001.utc differ diff --git a/nwnds_module/ar_berzwasp002.utc b/nwnds_module/ar_berzwasp002.utc new file mode 100644 index 000000000..ee54c19d6 Binary files /dev/null and b/nwnds_module/ar_berzwasp002.utc differ diff --git a/nwnds_module/ar_bladehood001.utc b/nwnds_module/ar_bladehood001.utc new file mode 100644 index 000000000..96d0c20ac Binary files /dev/null and b/nwnds_module/ar_bladehood001.utc differ diff --git a/nwnds_module/ar_bladehood002.utc b/nwnds_module/ar_bladehood002.utc new file mode 100644 index 000000000..0da0c2a25 Binary files /dev/null and b/nwnds_module/ar_bladehood002.utc differ diff --git a/nwnds_module/ar_bloodhawk_001.utc b/nwnds_module/ar_bloodhawk_001.utc new file mode 100644 index 000000000..2e26b3678 Binary files /dev/null and b/nwnds_module/ar_bloodhawk_001.utc differ diff --git a/nwnds_module/ar_bloodsent001.utc b/nwnds_module/ar_bloodsent001.utc new file mode 100644 index 000000000..96048db06 Binary files /dev/null and b/nwnds_module/ar_bloodsent001.utc differ diff --git a/nwnds_module/ar_books.utm b/nwnds_module/ar_books.utm new file mode 100644 index 000000000..2e493a8ce Binary files /dev/null and b/nwnds_module/ar_books.utm differ diff --git a/nwnds_module/ar_bookshelf_001.utp b/nwnds_module/ar_bookshelf_001.utp new file mode 100644 index 000000000..ab7767c1d Binary files /dev/null and b/nwnds_module/ar_bookshelf_001.utp differ diff --git a/nwnds_module/ar_boots.utm b/nwnds_module/ar_boots.utm new file mode 100644 index 000000000..a45c8f1ae Binary files /dev/null and b/nwnds_module/ar_boots.utm differ diff --git a/nwnds_module/ar_braxat_001.utc b/nwnds_module/ar_braxat_001.utc new file mode 100644 index 000000000..6549a1021 Binary files /dev/null and b/nwnds_module/ar_braxat_001.utc differ diff --git a/nwnds_module/ar_braxat_002.utc b/nwnds_module/ar_braxat_002.utc new file mode 100644 index 000000000..48bbbac5b Binary files /dev/null and b/nwnds_module/ar_braxat_002.utc differ diff --git a/nwnds_module/ar_brdrinker_001.utc b/nwnds_module/ar_brdrinker_001.utc new file mode 100644 index 000000000..5a4dca423 Binary files /dev/null and b/nwnds_module/ar_brdrinker_001.utc differ diff --git a/nwnds_module/ar_bushfern001.utp b/nwnds_module/ar_bushfern001.utp new file mode 100644 index 000000000..0806933c4 Binary files /dev/null and b/nwnds_module/ar_bushfern001.utp differ diff --git a/nwnds_module/ar_bvannen_001.utc b/nwnds_module/ar_bvannen_001.utc new file mode 100644 index 000000000..0673c8ac0 Binary files /dev/null and b/nwnds_module/ar_bvannen_001.utc differ diff --git a/nwnds_module/ar_c_disbeast001.utc b/nwnds_module/ar_c_disbeast001.utc new file mode 100644 index 000000000..696b35d6e Binary files /dev/null and b/nwnds_module/ar_c_disbeast001.utc differ diff --git a/nwnds_module/ar_c_disbeast002.utc b/nwnds_module/ar_c_disbeast002.utc new file mode 100644 index 000000000..b640d1ab8 Binary files /dev/null and b/nwnds_module/ar_c_disbeast002.utc differ diff --git a/nwnds_module/ar_c_jathlagak.utc b/nwnds_module/ar_c_jathlagak.utc new file mode 100644 index 000000000..9225e5986 Binary files /dev/null and b/nwnds_module/ar_c_jathlagak.utc differ diff --git a/nwnds_module/ar_cacti_001.utp b/nwnds_module/ar_cacti_001.utp new file mode 100644 index 000000000..b9fbf4ebc Binary files /dev/null and b/nwnds_module/ar_cacti_001.utp differ diff --git a/nwnds_module/ar_cacti_002.utp b/nwnds_module/ar_cacti_002.utp new file mode 100644 index 000000000..bc703080f Binary files /dev/null and b/nwnds_module/ar_cacti_002.utp differ diff --git a/nwnds_module/ar_cacti_003.utp b/nwnds_module/ar_cacti_003.utp new file mode 100644 index 000000000..0f5aeea99 Binary files /dev/null and b/nwnds_module/ar_cacti_003.utp differ diff --git a/nwnds_module/ar_cacti_004.utp b/nwnds_module/ar_cacti_004.utp new file mode 100644 index 000000000..e03e972f1 Binary files /dev/null and b/nwnds_module/ar_cacti_004.utp differ diff --git a/nwnds_module/ar_cacti_005.utp b/nwnds_module/ar_cacti_005.utp new file mode 100644 index 000000000..22e4bb245 Binary files /dev/null and b/nwnds_module/ar_cacti_005.utp differ diff --git a/nwnds_module/ar_cat001.utc b/nwnds_module/ar_cat001.utc new file mode 100644 index 000000000..1355188c3 Binary files /dev/null and b/nwnds_module/ar_cat001.utc differ diff --git a/nwnds_module/ar_cat002.utc b/nwnds_module/ar_cat002.utc new file mode 100644 index 000000000..b78110192 Binary files /dev/null and b/nwnds_module/ar_cat002.utc differ diff --git a/nwnds_module/ar_cat003.utc b/nwnds_module/ar_cat003.utc new file mode 100644 index 000000000..ba25abc4d Binary files /dev/null and b/nwnds_module/ar_cat003.utc differ diff --git a/nwnds_module/ar_cat004.utc b/nwnds_module/ar_cat004.utc new file mode 100644 index 000000000..cbe79b9aa Binary files /dev/null and b/nwnds_module/ar_cat004.utc differ diff --git a/nwnds_module/ar_chair_001.utp b/nwnds_module/ar_chair_001.utp new file mode 100644 index 000000000..8dfc5beb0 Binary files /dev/null and b/nwnds_module/ar_chair_001.utp differ diff --git a/nwnds_module/ar_cheetah001.utc b/nwnds_module/ar_cheetah001.utc new file mode 100644 index 000000000..67d2ee2ca Binary files /dev/null and b/nwnds_module/ar_cheetah001.utc differ diff --git a/nwnds_module/ar_chimera001.utc b/nwnds_module/ar_chimera001.utc new file mode 100644 index 000000000..77edaa4b1 Binary files /dev/null and b/nwnds_module/ar_chimera001.utc differ diff --git a/nwnds_module/ar_cistfiend_001.utc b/nwnds_module/ar_cistfiend_001.utc new file mode 100644 index 000000000..a4dac3ca3 Binary files /dev/null and b/nwnds_module/ar_cistfiend_001.utc differ diff --git a/nwnds_module/ar_cl_crimson01.ncs b/nwnds_module/ar_cl_crimson01.ncs new file mode 100644 index 000000000..f4e00cfc4 Binary files /dev/null and b/nwnds_module/ar_cl_crimson01.ncs differ diff --git a/nwnds_module/ar_cl_crimson01.nss b/nwnds_module/ar_cl_crimson01.nss new file mode 100644 index 000000000..e21f83510 --- /dev/null +++ b/nwnds_module/ar_cl_crimson01.nss @@ -0,0 +1,188 @@ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +//:: +//:: AR_CL_Crimson01 +//:: +//:: Crimson Depths to Crimson Ruins 2 +//:: +//:: +//:: +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +////////////////////////////////////////// +//ari_climb_ou written by JJRittenhouse// +// +//This script is placed on the OnUsed event of any useable +//placeable. It will calculate a climb check, adding a +1 +//modifier for each level the creature has in a class that +//normally gets Climb as a class skill in the PnP version. +//This check will take armor class check into account. On +//a failure by ten or more the script will move the player +//to the ClimbDestinationFall waypoint. +//It is also set to add +20 to any creature with the Spider +//climb effect item in their inventory, and a +10 to anyone +//marked as using a Climbing Rope. +//This script requires #include "ari_climbing_inc" and the +//ClimbCheck(), GetClimbClassMod(), and the +//JumpAllAssociatesToLocation() functions + +#include "ari_climbing_inc" + +void main() +{ +string sDirection=GetLocalString (OBJECT_SELF, "sDirection");//local variable set manually on the climbing placeable +int nDC=GetLocalInt(OBJECT_SELF, "nDC");//Local variable set manually on the placeable +object oDestination;//later assings one of two waypoints to this variable + +//For Builders using the climbing system to transition between areas +//if the fall location is in a different area than the climbing placeable +//change the "GetNearestObjectByTag" function below to "GetObjectByTag" +//The tag of the ClimbDestinationFall waypoint used will need to be +//changed to a unique tag and substitued for "ClimbDestinationFall". +//See notes at the bottom of this script for more information regarding +//applying falling damage to characters during a transition between areas + +object oFall=GetNearestObjectByTag ("WP_CDEPTHStoCRUINS2");//the object that stores the fall location, set manually by the builder +location lFall = GetLocation (oFall);//location of the above waypoint +location lDestination;//the location of oDestination, assinged later +object oCreature = GetLastUsedBy();//creature using the placeable +effect eFall= EffectKnockdown(); //knockdown effect in simple failure +//this effect keeps a player from simply spam clicking the placeable until they succeed or +//fall, and makes them vulnerable to attack by hostiles while they +//recover from failing the climb. This effect will work on creatures +//using the placeable as well + + + +//get which waypoint to move the player to if the climb succeeds +//by retrieving the direction local string set on the placeable +//this allows the same script to be used for all the placeables + +//If the builder is using the climb system as a means to transition +//between areas, change the "oDestination=GetNearestObjectByTag" to +//"=GetObjectByTag" below. The tag given to the waypoint will need to be +//unique, and should be substituted for the "ClimbDestination" type tags +//See the notes at the bottom of this script about falling and +//special conditions arising from falling damage applied to players +//during a transition between areas. + if (sDirection == "UP")//If the placeable is a climb UP placeable + { + oDestination=GetObjectByTag ("WP_CRuins2toCDepths");//get the climb up waypoint + } + else if (sDirection == "DOWN")//if the placeable is a climb DOWN placeable + { + oDestination=GetObjectByTag ("WP_CDEPTHStoCRUINS2");//Get the climb down waypoint + } + +//assign the location to jump the creature to if they succeed. +lDestination=GetLocation(oDestination);//stores the location to move the player if they succeed +int nClimb=ClimbCheck(oCreature, nDC); //perform the check +object oHostileFollow;//hostile creature that might follow the player +int nNth=1;//counter to get the next nearest creature until no more are found +object OClimbable=OBJECT_SELF;//assign to variable to use within an +//AssignAction command which would return the creature instead of the +//placeable as OBJECT_SELF. This is the climbing placeable now being +//used. + +switch(nClimb) + { + case 0: //fail, apply knockdown for 6 seconds + AssignCommand(oCreature, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eFall, oCreature, 6.0)); + FloatingTextStringOnCreature("*You could not make the climb.*", oCreature); + break; + case 1: //succeed, move to appropriate waypoint, move associates + // to the waypoint, find the nearest hostile creatures and + // have them use the placeable to try to follow. + // The script will make a random check, giving more chance + // for the creature to try the climb the more they are capable + AssignCommand(oCreature, JumpToLocation(lDestination));//move the creature using the placeable to the climb location + FloatingTextStringOnCreature("*You have successfully made the climb.*", oCreature); + JumpAllAssociatesToLocation (oCreature, lDestination);//move all associates to the same location +//This next block handles the ability of hostile creatures to follow the player using the Climbable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the first Non-pc creature to the placeable + //does not return PC's so it will not force them to use the placeable. + while (GetIsObjectValid(oHostileFollow))//break condition, when all the creatures in the area have been checked this will break + { + if (!GetIsFriend(oHostileFollow, oCreature))//checks if hostile to the creature using the placeable. + { + if (GetObjectSeen(oCreature, oHostileFollow))//checks if the hostile can see the creature that just used the placeable + { +//compare the creature's climb skill modifier to the DC +//the greater the chance for the creature to succeed, the more +//likely it is to follow + int nChance=d20(); +//finds the difference between the climb DC and the class modifier of the hostile creature + int nFollow=nDC-GetClimbClassMod(oHostileFollow); +//5% chance to try to follow even if the creauture can't make the +//climb. To remove this behaviour comment out this if statement and the following three lines. + if (nFollow>19) + { + nFollow=19; + } +//add the d20 roll to the difference between the DC and the creatures climb modifier. +//If the creature's climb modifier is greater than the DC it will always follow. +//If it is less than 20 (no chance) it will only follow on a roll of 20. The better the +//chance the creature has to make the climb, the more likely it will try. + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE));//clear all actions in cue, including combat + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable));//use the climbable to try to follow (running this script for the hostile as well) + } + + + } + } + nNth++;//advance the counter to the next nearest creature to the placeable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the next nearest non-pc creature and test While condition(above) + } + break; + case 2: //Critical Failure + AssignCommand(oCreature, JumpToLocation(lFall));//fall location from the waypoint ClimbDestinationFall placed manually by the builder + AssignCommand(oCreature, ActionPlayAnimation (ANIMATION_LOOPING_DEAD_BACK, 6.0));//fall animation, no actual knockdown effect. + FloatingTextStringOnCreature("*You could not make the climb & have injured yourself in the fall*", oCreature); + SetLocalInt (oCreature, "bFall", TRUE);//The FallTrigger painted at the location of the fall will read this local variable on the creature. + //only if it is true (through this part of the script) will it fire the OnEnter commands. + SetLocalInt (oCreature, "nFallDistance", GetLocalInt (OBJECT_SELF, "nClimbDistance"));//sets the fall distance as a local variable on the creature to be read by the Fall Trigger +//controls hostile creatures climbing down to follow a creature who falls, same conditions as above + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + while (GetIsObjectValid(oHostileFollow)) + { + if (!GetIsFriend(oHostileFollow, oCreature)) + { + if (GetObjectSeen(oCreature, oHostileFollow)) + { + int nChance=d20(); + int nFollow=nDC-GetClimbClassMod(oHostileFollow); + if (nFollow>19) + { + nFollow=19; + } + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE)); + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable)); + } + + + } + } + nNth++; + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + } + break; + } + + + +} +//The use of the fall Trigger is so that this script can be altered to act as +//a transition between areas. Originally this system was set up to apply the damage +//by this script, however in cases where the player was moved to a new area because of a fall +//and that fall killed the player, the player would die at the placeable instead of at the fall location. +//In order to move a player into another area they cannot die when they enter the area. Even using +//delay commands could get around this. In order to cause creatures to fall into other map areas +//you will need to paint the fall trigger surrounding the fall location in a ring so that the player +//does not enter the trigger until after they have loaded the area and move themselves. Once the players move +//they will enter the trigger, make a tumble check and have damage assigned to them. This is not normally +//a problem unless the player dies as a result of the fall. +//The Fall Trigger is used to standardize everything, and make it easier to modify this script +//for using climbs as transitions to other areas. diff --git a/nwnds_module/ar_cl_tari001.ncs b/nwnds_module/ar_cl_tari001.ncs new file mode 100644 index 000000000..11603b8bb Binary files /dev/null and b/nwnds_module/ar_cl_tari001.ncs differ diff --git a/nwnds_module/ar_cl_tari001.nss b/nwnds_module/ar_cl_tari001.nss new file mode 100644 index 000000000..1595f2d75 --- /dev/null +++ b/nwnds_module/ar_cl_tari001.nss @@ -0,0 +1,188 @@ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +//:: +//:: AR_ClimbDown02 +//:: +//:: Abandoned Home to UnderTyr Passage (3) +//:: +//:: +//:: +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +////////////////////////////////////////// +//ari_climb_ou written by JJRittenhouse// +// +//This script is placed on the OnUsed event of any useable +//placeable. It will calculate a climb check, adding a +1 +//modifier for each level the creature has in a class that +//normally gets Climb as a class skill in the PnP version. +//This check will take armor class check into account. On +//a failure by ten or more the script will move the player +//to the ClimbDestinationFall waypoint. +//It is also set to add +20 to any creature with the Spider +//climb effect item in their inventory, and a +10 to anyone +//marked as using a Climbing Rope. +//This script requires #include "ari_climbing_inc" and the +//ClimbCheck(), GetClimbClassMod(), and the +//JumpAllAssociatesToLocation() functions + +#include "ari_climbing_inc" + +void main() +{ +string sDirection=GetLocalString (OBJECT_SELF, "sDirection");//local variable set manually on the climbing placeable +int nDC=GetLocalInt(OBJECT_SELF, "nDC");//Local variable set manually on the placeable +object oDestination;//later assings one of two waypoints to this variable + +//For Builders using the climbing system to transition between areas +//if the fall location is in a different area than the climbing placeable +//change the "GetNearestObjectByTag" function below to "GetObjectByTag" +//The tag of the ClimbDestinationFall waypoint used will need to be +//changed to a unique tag and substitued for "ClimbDestinationFall". +//See notes at the bottom of this script for more information regarding +//applying falling damage to characters during a transition between areas + +object oFall=GetNearestObjectByTag ("WP_Passage3");//the object that stores the fall location, set manually by the builder +location lFall = GetLocation (oFall);//location of the above waypoint +location lDestination;//the location of oDestination, assinged later +object oCreature = GetLastUsedBy();//creature using the placeable +effect eFall= EffectKnockdown(); //knockdown effect in simple failure +//this effect keeps a player from simply spam clicking the placeable until they succeed or +//fall, and makes them vulnerable to attack by hostiles while they +//recover from failing the climb. This effect will work on creatures +//using the placeable as well + + + +//get which waypoint to move the player to if the climb succeeds +//by retrieving the direction local string set on the placeable +//this allows the same script to be used for all the placeables + +//If the builder is using the climb system as a means to transition +//between areas, change the "oDestination=GetNearestObjectByTag" to +//"=GetObjectByTag" below. The tag given to the waypoint will need to be +//unique, and should be substituted for the "ClimbDestination" type tags +//See the notes at the bottom of this script about falling and +//special conditions arising from falling damage applied to players +//during a transition between areas. + if (sDirection == "UP")//If the placeable is a climb UP placeable + { + oDestination=GetObjectByTag ("WP_FromPassage3");//get the climb up waypoint + } + else if (sDirection == "DOWN")//if the placeable is a climb DOWN placeable + { + oDestination=GetObjectByTag ("WP_Passage3");//Get the climb down waypoint + } + +//assign the location to jump the creature to if they succeed. +lDestination=GetLocation(oDestination);//stores the location to move the player if they succeed +int nClimb=ClimbCheck(oCreature, nDC); //perform the check +object oHostileFollow;//hostile creature that might follow the player +int nNth=1;//counter to get the next nearest creature until no more are found +object OClimbable=OBJECT_SELF;//assign to variable to use within an +//AssignAction command which would return the creature instead of the +//placeable as OBJECT_SELF. This is the climbing placeable now being +//used. + +switch(nClimb) + { + case 0: //fail, apply knockdown for 6 seconds + AssignCommand(oCreature, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eFall, oCreature, 6.0)); + FloatingTextStringOnCreature("*You could not make the climb.*", oCreature); + break; + case 1: //succeed, move to appropriate waypoint, move associates + // to the waypoint, find the nearest hostile creatures and + // have them use the placeable to try to follow. + // The script will make a random check, giving more chance + // for the creature to try the climb the more they are capable + AssignCommand(oCreature, JumpToLocation(lDestination));//move the creature using the placeable to the climb location + FloatingTextStringOnCreature("*You have successfully made the climb.*", oCreature); + JumpAllAssociatesToLocation (oCreature, lDestination);//move all associates to the same location +//This next block handles the ability of hostile creatures to follow the player using the Climbable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the first Non-pc creature to the placeable + //does not return PC's so it will not force them to use the placeable. + while (GetIsObjectValid(oHostileFollow))//break condition, when all the creatures in the area have been checked this will break + { + if (!GetIsFriend(oHostileFollow, oCreature))//checks if hostile to the creature using the placeable. + { + if (GetObjectSeen(oCreature, oHostileFollow))//checks if the hostile can see the creature that just used the placeable + { +//compare the creature's climb skill modifier to the DC +//the greater the chance for the creature to succeed, the more +//likely it is to follow + int nChance=d20(); +//finds the difference between the climb DC and the class modifier of the hostile creature + int nFollow=nDC-GetClimbClassMod(oHostileFollow); +//5% chance to try to follow even if the creauture can't make the +//climb. To remove this behaviour comment out this if statement and the following three lines. + if (nFollow>19) + { + nFollow=19; + } +//add the d20 roll to the difference between the DC and the creatures climb modifier. +//If the creature's climb modifier is greater than the DC it will always follow. +//If it is less than 20 (no chance) it will only follow on a roll of 20. The better the +//chance the creature has to make the climb, the more likely it will try. + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE));//clear all actions in cue, including combat + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable));//use the climbable to try to follow (running this script for the hostile as well) + } + + + } + } + nNth++;//advance the counter to the next nearest creature to the placeable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the next nearest non-pc creature and test While condition(above) + } + break; + case 2: //Critical Failure + AssignCommand(oCreature, JumpToLocation(lFall));//fall location from the waypoint ClimbDestinationFall placed manually by the builder + AssignCommand(oCreature, ActionPlayAnimation (ANIMATION_LOOPING_DEAD_BACK, 6.0));//fall animation, no actual knockdown effect. + FloatingTextStringOnCreature("*You could not make the climb & have injured yourself in the fall*", oCreature); + SetLocalInt (oCreature, "bFall", TRUE);//The FallTrigger painted at the location of the fall will read this local variable on the creature. + //only if it is true (through this part of the script) will it fire the OnEnter commands. + SetLocalInt (oCreature, "nFallDistance", GetLocalInt (OBJECT_SELF, "nClimbDistance"));//sets the fall distance as a local variable on the creature to be read by the Fall Trigger +//controls hostile creatures climbing down to follow a creature who falls, same conditions as above + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + while (GetIsObjectValid(oHostileFollow)) + { + if (!GetIsFriend(oHostileFollow, oCreature)) + { + if (GetObjectSeen(oCreature, oHostileFollow)) + { + int nChance=d20(); + int nFollow=nDC-GetClimbClassMod(oHostileFollow); + if (nFollow>19) + { + nFollow=19; + } + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE)); + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable)); + } + + + } + } + nNth++; + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + } + break; + } + + + +} +//The use of the fall Trigger is so that this script can be altered to act as +//a transition between areas. Originally this system was set up to apply the damage +//by this script, however in cases where the player was moved to a new area because of a fall +//and that fall killed the player, the player would die at the placeable instead of at the fall location. +//In order to move a player into another area they cannot die when they enter the area. Even using +//delay commands could get around this. In order to cause creatures to fall into other map areas +//you will need to paint the fall trigger surrounding the fall location in a ring so that the player +//does not enter the trigger until after they have loaded the area and move themselves. Once the players move +//they will enter the trigger, make a tumble check and have damage assigned to them. This is not normally +//a problem unless the player dies as a result of the fall. +//The Fall Trigger is used to standardize everything, and make it easier to modify this script +//for using climbs as transitions to other areas. diff --git a/nwnds_module/ar_cl_unearth002.ncs b/nwnds_module/ar_cl_unearth002.ncs new file mode 100644 index 000000000..b1ca8144d Binary files /dev/null and b/nwnds_module/ar_cl_unearth002.ncs differ diff --git a/nwnds_module/ar_cl_unearth002.nss b/nwnds_module/ar_cl_unearth002.nss new file mode 100644 index 000000000..13075ec9b --- /dev/null +++ b/nwnds_module/ar_cl_unearth002.nss @@ -0,0 +1,188 @@ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +//:: +//:: AR_CL_Unearth002 +//:: +//:: Unearthed to Abandoned Mines +//:: +//:: +//:: +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +////////////////////////////////////////// +//ari_climb_ou written by JJRittenhouse// +// +//This script is placed on the OnUsed event of any useable +//placeable. It will calculate a climb check, adding a +1 +//modifier for each level the creature has in a class that +//normally gets Climb as a class skill in the PnP version. +//This check will take armor class check into account. On +//a failure by ten or more the script will move the player +//to the ClimbDestinationFall waypoint. +//It is also set to add +20 to any creature with the Spider +//climb effect item in their inventory, and a +10 to anyone +//marked as using a Climbing Rope. +//This script requires #include "ari_climbing_inc" and the +//ClimbCheck(), GetClimbClassMod(), and the +//JumpAllAssociatesToLocation() functions + +#include "ari_climbing_inc" + +void main() +{ +string sDirection=GetLocalString (OBJECT_SELF, "sDirection");//local variable set manually on the climbing placeable +int nDC=GetLocalInt(OBJECT_SELF, "nDC");//Local variable set manually on the placeable +object oDestination;//later assings one of two waypoints to this variable + +//For Builders using the climbing system to transition between areas +//if the fall location is in a different area than the climbing placeable +//change the "GetNearestObjectByTag" function below to "GetObjectByTag" +//The tag of the ClimbDestinationFall waypoint used will need to be +//changed to a unique tag and substitued for "ClimbDestinationFall". +//See notes at the bottom of this script for more information regarding +//applying falling damage to characters during a transition between areas + +object oFall=GetNearestObjectByTag ("WP_unearth01");//the object that stores the fall location, set manually by the builder +location lFall = GetLocation (oFall);//location of the above waypoint +location lDestination;//the location of oDestination, assinged later +object oCreature = GetLastUsedBy();//creature using the placeable +effect eFall= EffectKnockdown(); //knockdown effect in simple failure +//this effect keeps a player from simply spam clicking the placeable until they succeed or +//fall, and makes them vulnerable to attack by hostiles while they +//recover from failing the climb. This effect will work on creatures +//using the placeable as well + + + +//get which waypoint to move the player to if the climb succeeds +//by retrieving the direction local string set on the placeable +//this allows the same script to be used for all the placeables + +//If the builder is using the climb system as a means to transition +//between areas, change the "oDestination=GetNearestObjectByTag" to +//"=GetObjectByTag" below. The tag given to the waypoint will need to be +//unique, and should be substituted for the "ClimbDestination" type tags +//See the notes at the bottom of this script about falling and +//special conditions arising from falling damage applied to players +//during a transition between areas. + if (sDirection == "UP")//If the placeable is a climb UP placeable + { + oDestination=GetObjectByTag ("WP_abandonedm02");//get the climb up waypoint + } + else if (sDirection == "DOWN")//if the placeable is a climb DOWN placeable + { + oDestination=GetObjectByTag ("WP_unearth01");//Get the climb down waypoint + } + +//assign the location to jump the creature to if they succeed. +lDestination=GetLocation(oDestination);//stores the location to move the player if they succeed +int nClimb=ClimbCheck(oCreature, nDC); //perform the check +object oHostileFollow;//hostile creature that might follow the player +int nNth=1;//counter to get the next nearest creature until no more are found +object OClimbable=OBJECT_SELF;//assign to variable to use within an +//AssignAction command which would return the creature instead of the +//placeable as OBJECT_SELF. This is the climbing placeable now being +//used. + +switch(nClimb) + { + case 0: //fail, apply knockdown for 6 seconds + AssignCommand(oCreature, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eFall, oCreature, 6.0)); + FloatingTextStringOnCreature("*You could not make the climb.*", oCreature); + break; + case 1: //succeed, move to appropriate waypoint, move associates + // to the waypoint, find the nearest hostile creatures and + // have them use the placeable to try to follow. + // The script will make a random check, giving more chance + // for the creature to try the climb the more they are capable + AssignCommand(oCreature, JumpToLocation(lDestination));//move the creature using the placeable to the climb location + FloatingTextStringOnCreature("*You have successfully made the climb.*", oCreature); + JumpAllAssociatesToLocation (oCreature, lDestination);//move all associates to the same location +//This next block handles the ability of hostile creatures to follow the player using the Climbable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the first Non-pc creature to the placeable + //does not return PC's so it will not force them to use the placeable. + while (GetIsObjectValid(oHostileFollow))//break condition, when all the creatures in the area have been checked this will break + { + if (!GetIsFriend(oHostileFollow, oCreature))//checks if hostile to the creature using the placeable. + { + if (GetObjectSeen(oCreature, oHostileFollow))//checks if the hostile can see the creature that just used the placeable + { +//compare the creature's climb skill modifier to the DC +//the greater the chance for the creature to succeed, the more +//likely it is to follow + int nChance=d20(); +//finds the difference between the climb DC and the class modifier of the hostile creature + int nFollow=nDC-GetClimbClassMod(oHostileFollow); +//5% chance to try to follow even if the creauture can't make the +//climb. To remove this behaviour comment out this if statement and the following three lines. + if (nFollow>19) + { + nFollow=19; + } +//add the d20 roll to the difference between the DC and the creatures climb modifier. +//If the creature's climb modifier is greater than the DC it will always follow. +//If it is less than 20 (no chance) it will only follow on a roll of 20. The better the +//chance the creature has to make the climb, the more likely it will try. + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE));//clear all actions in cue, including combat + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable));//use the climbable to try to follow (running this script for the hostile as well) + } + + + } + } + nNth++;//advance the counter to the next nearest creature to the placeable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the next nearest non-pc creature and test While condition(above) + } + break; + case 2: //Critical Failure + AssignCommand(oCreature, JumpToLocation(lFall));//fall location from the waypoint ClimbDestinationFall placed manually by the builder + AssignCommand(oCreature, ActionPlayAnimation (ANIMATION_LOOPING_DEAD_BACK, 6.0));//fall animation, no actual knockdown effect. + FloatingTextStringOnCreature("*You could not make the climb & have injured yourself in the fall*", oCreature); + SetLocalInt (oCreature, "bFall", TRUE);//The FallTrigger painted at the location of the fall will read this local variable on the creature. + //only if it is true (through this part of the script) will it fire the OnEnter commands. + SetLocalInt (oCreature, "nFallDistance", GetLocalInt (OBJECT_SELF, "nClimbDistance"));//sets the fall distance as a local variable on the creature to be read by the Fall Trigger +//controls hostile creatures climbing down to follow a creature who falls, same conditions as above + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + while (GetIsObjectValid(oHostileFollow)) + { + if (!GetIsFriend(oHostileFollow, oCreature)) + { + if (GetObjectSeen(oCreature, oHostileFollow)) + { + int nChance=d20(); + int nFollow=nDC-GetClimbClassMod(oHostileFollow); + if (nFollow>19) + { + nFollow=19; + } + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE)); + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable)); + } + + + } + } + nNth++; + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + } + break; + } + + + +} +//The use of the fall Trigger is so that this script can be altered to act as +//a transition between areas. Originally this system was set up to apply the damage +//by this script, however in cases where the player was moved to a new area because of a fall +//and that fall killed the player, the player would die at the placeable instead of at the fall location. +//In order to move a player into another area they cannot die when they enter the area. Even using +//delay commands could get around this. In order to cause creatures to fall into other map areas +//you will need to paint the fall trigger surrounding the fall location in a ring so that the player +//does not enter the trigger until after they have loaded the area and move themselves. Once the players move +//they will enter the trigger, make a tumble check and have damage assigned to them. This is not normally +//a problem unless the player dies as a result of the fall. +//The Fall Trigger is used to standardize everything, and make it easier to modify this script +//for using climbs as transitions to other areas. diff --git a/nwnds_module/ar_climbdown01.ncs b/nwnds_module/ar_climbdown01.ncs new file mode 100644 index 000000000..defeb76d8 Binary files /dev/null and b/nwnds_module/ar_climbdown01.ncs differ diff --git a/nwnds_module/ar_climbdown01.nss b/nwnds_module/ar_climbdown01.nss new file mode 100644 index 000000000..9ff1598f1 --- /dev/null +++ b/nwnds_module/ar_climbdown01.nss @@ -0,0 +1,184 @@ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +//:: +//:: AR_ClimbDown01 +//:: +//:: Western Dunes to Abandoned Mines +//:: +//:: Conversation based +//:: +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +////////////////////////////////////////// +//ari_climb_ou written by JJRittenhouse// +// +//This script is placed on the OnUsed event of any useable +//placeable. It will calculate a climb check, adding a +1 +//modifier for each level the creature has in a class that +//normally gets Climb as a class skill in the PnP version. +//This check will take armor class check into account. On +//a failure by ten or more the script will move the player +//to the ClimbDestinationFall waypoint. +//It is also set to add +20 to any creature with the Spider +//climb effect item in their inventory, and a +10 to anyone +//marked as using a Climbing Rope. +//This script requires #include "ari_climbing_inc" and the +//ClimbCheck(), GetClimbClassMod(), and the +//JumpAllAssociatesToLocation() functions + +#include "ari_climbing_inc" + +void main() +{ +string sDirection = "DOWN"; +string oDestination = "wp_oldwell"; + +//For Builders using the climbing system to transition between areas +//if the fall location is in a different area than the climbing placeable +//change the "GetNearestObjectByTag" function below to "GetObjectByTag" +//The tag of the ClimbDestinationFall waypoint used will need to be +//changed to a unique tag and substitued for "ClimbDestinationFall". +//See notes at the bottom of this script for more information regarding +//applying falling damage to characters during a transition between areas + +object oFall=GetObjectByTag ("wp_oldwell"); +//the object that stores the fall location, set manually by the builder + +location lFall = GetLocation(oFall); +//location of the above waypoint + +location lDestination = GetLocation(oFall); +//same as fall location since we are climbing straight down + +object oCreature = GetPCSpeaker(); +//creature calling the conversation + +effect eFall= EffectKnockdown(); +//knockdown effect in simple failure +//this effect keeps a player from simply spam clicking the placeable until they succeed or +//fall, and makes them vulnerable to attack by hostiles while they +//recover from failing the climb. This effect will work on creatures +//using the placeable as well + +//If the builder is using the climb system as a means to transition +//between areas, change the "oDestination=GetNearestObjectByTag" to +//"=GetObjectByTag" below. The tag given to the waypoint will need to be +//unique, and should be substituted for the "ClimbDestination" type tags +//See the notes at the bottom of this script about falling and +//special conditions arising from falling damage applied to players +//during a transition between areas. + +//assign the location to jump the creature to if they succeed. +//lDestination=GetLocation(oDestination);//stores the location to move the player if they succeed +int nClimb=ClimbCheck(oCreature, 5); //perform the check +object oHostileFollow;//hostile creature that might follow the player +int nNth=1;//counter to get the next nearest creature until no more are found +object OClimbable=OBJECT_SELF;//assign to variable to use within an +//AssignAction command which would return the creature instead of the +//placeable as OBJECT_SELF. This is the climbing placeable now being +//used. + +switch(nClimb) + { + case 0: //fail, apply knockdown for 6 seconds + //FloatingTextStringOnCreature("*You could not make the climb."*, oCreature, FALSE); + AssignCommand(oCreature, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eFall, oCreature, 6.0)); + + break; + case 1: //succeed, move to appropriate waypoint, move associates + // to the waypoint, find the nearest hostile creatures and + // have them use the placeable to try to follow. + // The script will make a random check, giving more chance + // for the creature to try the climb the more they are capable + FloatingTextStringOnCreature("*You manage to climb down the rope*", oCreature); + AssignCommand(oCreature, JumpToLocation(lDestination));//move the creature using the placeable to the climb location + JumpAllAssociatesToLocation (oCreature, lDestination);//move all associates to the same location +//This next block handles the ability of hostile creatures to follow the player using the Climbable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the first Non-pc creature to the placeable + //does not return PC's so it will not force them to use the placeable. + while (GetIsObjectValid(oHostileFollow))//break condition, when all the creatures in the area have been checked this will break + { + if (!GetIsFriend(oHostileFollow, oCreature))//checks if hostile to the creature using the placeable. + { + if (GetObjectSeen(oCreature, oHostileFollow))//checks if the hostile can see the creature that just used the placeable + { +//compare the creature's climb skill modifier to the DC +//the greater the chance for the creature to succeed, the more +//likely it is to follow + int nChance=d20(); +//finds the difference between the climb DC and the class modifier of the hostile creature + int nFollow=5-GetClimbClassMod(oHostileFollow); +//5% chance to try to follow even if the creauture can't make the +//climb. To remove this behaviour comment out this if statement and the following three lines. + if (nFollow>19) + { + nFollow=19; + } +//add the d20 roll to the difference between the DC and the creatures climb modifier. +//If the creature's climb modifier is greater than the DC it will always follow. +//If it is less than 20 (no chance) it will only follow on a roll of 20. The better the +//chance the creature has to make the climb, the more likely it will try. + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE));//clear all actions in cue, including combat + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable));//use the climbable to try to follow (running this script for the hostile as well) + } + + + } + } + nNth++;//advance the counter to the next nearest creature to the placeable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the next nearest non-pc creature and test While condition(above) + } + break; + case 2: //Critical Failure + AssignCommand(oCreature, JumpToLocation(lFall));//fall location from the waypoint ClimbDestinationFall placed manually by the builder + AssignCommand(oCreature, ActionPlayAnimation (ANIMATION_LOOPING_DEAD_BACK, 6.0));//fall animation, no actual knockdown effect. + SetLocalInt (oCreature, "bFall", TRUE);//The FallTrigger painted at the location of the fall will read this local variable on the creature. + //only if it is true (through this part of the script) will it fire the OnEnter commands. + SetLocalInt (oCreature, "nFallDistance", 20);//sets the fall distance statically +//controls hostile creatures climbing down to follow a creature who falls, same conditions as above + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + while (GetIsObjectValid(oHostileFollow)) + { + if (!GetIsFriend(oHostileFollow, oCreature)) + { + if (GetObjectSeen(oCreature, oHostileFollow)) + { + int nChance=d20(); + int nFollow=5-GetClimbClassMod(oHostileFollow); + if (nFollow>19) + { + nFollow=19; + } + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE)); + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable)); + } + + + } + } + nNth++; + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + } + break; + } + + + +} +//The use of the fall Trigger is so that this script can be altered to act as +//a transition between areas. Originally this system was set up to apply the damage +//by this script, however in cases where the player was moved to a new area because of a fall +//and that fall killed the player, the player would die at the placeable instead of at the fall location. +//In order to move a player into another area they cannot die when they enter the area. Even using +//delay commands could get around this. In order to cause creatures to fall into other map areas +//you will need to paint the fall trigger surrounding the fall location in a ring so that the player +//does not enter the trigger until after they have loaded the area and move themselves. Once the players move +//they will enter the trigger, make a tumble check and have damage assigned to them. This is not normally +//a problem unless the player dies as a result of the fall. +//The Fall Trigger is used to standardize everything, and make it easier to modify this script +//for using climbs as transitions to other areas. + + diff --git a/nwnds_module/ar_climbuprope01.ncs b/nwnds_module/ar_climbuprope01.ncs new file mode 100644 index 000000000..edd7a8b45 Binary files /dev/null and b/nwnds_module/ar_climbuprope01.ncs differ diff --git a/nwnds_module/ar_climbuprope01.nss b/nwnds_module/ar_climbuprope01.nss new file mode 100644 index 000000000..6f0b157bf --- /dev/null +++ b/nwnds_module/ar_climbuprope01.nss @@ -0,0 +1,190 @@ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +//:: +//:: AR_ClimbUpRope01 +//:: +//:: Abandoned Mines to Western Dunes +//:: +//:: +//:: +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +////////////////////////////////////////// +//ari_climb_ou written by JJRittenhouse// +// +//This script is placed on the OnUsed event of any useable +//placeable. It will calculate a climb check, adding a +1 +//modifier for each level the creature has in a class that +//normally gets Climb as a class skill in the PnP version. +//This check will take armor class check into account. On +//a failure by ten or more the script will move the player +//to the ClimbDestinationFall waypoint. +//It is also set to add +20 to any creature with the Spider +//climb effect item in their inventory, and a +10 to anyone +//marked as using a Climbing Rope. +//This script requires #include "ari_climbing_inc" and the +//ClimbCheck(), GetClimbClassMod(), and the +//JumpAllAssociatesToLocation() functions + +#include "ari_climbing_inc" + +void main() +{ +string sDirection=GetLocalString (OBJECT_SELF, "sDirection");//local variable set manually on the climbing placeable +int nDC=GetLocalInt(OBJECT_SELF, "nDC");//Local variable set manually on the placeable +object oDestination;//later assings one of two waypoints to this variable + +//For Builders using the climbing system to transition between areas +//if the fall location is in a different area than the climbing placeable +//change the "GetNearestObjectByTag" function below to "GetObjectByTag" +//The tag of the ClimbDestinationFall waypoint used will need to be +//changed to a unique tag and substitued for "ClimbDestinationFall". +//See notes at the bottom of this script for more information regarding +//applying falling damage to characters during a transition between areas + +object oFall=GetNearestObjectByTag ("wp_oldwell");//the object that stores the fall location, set manually by the builder +location lFall = GetLocation (oFall);//location of the above waypoint +location lDestination;//the location of oDestination, assinged later +object oCreature = GetLastUsedBy();//creature using the placeable +effect eFall= EffectKnockdown(); //knockdown effect in simple failure +//this effect keeps a player from simply spam clicking the placeable until they succeed or +//fall, and makes them vulnerable to attack by hostiles while they +//recover from failing the climb. This effect will work on creatures +//using the placeable as well + + + +//get which waypoint to move the player to if the climb succeeds +//by retrieving the direction local string set on the placeable +//this allows the same script to be used for all the placeables + +//If the builder is using the climb system as a means to transition +//between areas, change the "oDestination=GetNearestObjectByTag" to +//"=GetObjectByTag" below. The tag given to the waypoint will need to be +//unique, and should be substituted for the "ClimbDestination" type tags +//See the notes at the bottom of this script about falling and +//special conditions arising from falling damage applied to players +//during a transition between areas. + if (sDirection == "UP")//If the placeable is a climb UP placeable + { + oDestination=GetObjectByTag ("WP_aboveoldwell");//get the climb up waypoint + } + else if (sDirection == "DOWN")//if the placeable is a climb DOWN placeable + { + oDestination=GetObjectByTag ("wp_oldwell");//Get the climb down waypoint + } + +//assign the location to jump the creature to if they succeed. +lDestination=GetLocation(oDestination);//stores the location to move the player if they succeed +int nClimb=ClimbCheck(oCreature, nDC); //perform the check +object oHostileFollow;//hostile creature that might follow the player +int nNth=1;//counter to get the next nearest creature until no more are found +object OClimbable=OBJECT_SELF;//assign to variable to use within an +//AssignAction command which would return the creature instead of the +//placeable as OBJECT_SELF. This is the climbing placeable now being +//used. + +switch(nClimb) + { + case 0: //fail, apply knockdown for 6 seconds + AssignCommand(oCreature, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eFall, oCreature, 6.0)); + FloatingTextStringOnCreature("*You could not make the climb.*", oCreature); + break; + case 1: //succeed, move to appropriate waypoint, move associates + // to the waypoint, find the nearest hostile creatures and + // have them use the placeable to try to follow. + // The script will make a random check, giving more chance + // for the creature to try the climb the more they are capable + AssignCommand(oCreature, JumpToLocation(lDestination));//move the creature using the placeable to the climb location + FloatingTextStringOnCreature("*You have successfully made the climb.*", oCreature); + JumpAllAssociatesToLocation (oCreature, lDestination);//move all associates to the same location +//This next block handles the ability of hostile creatures to follow the player using the Climbable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the first Non-pc creature to the placeable + //does not return PC's so it will not force them to use the placeable. + while (GetIsObjectValid(oHostileFollow))//break condition, when all the creatures in the area have been checked this will break + { + if (!GetIsFriend(oHostileFollow, oCreature))//checks if hostile to the creature using the placeable. + { + if (GetObjectSeen(oCreature, oHostileFollow))//checks if the hostile can see the creature that just used the placeable + { +//compare the creature's climb skill modifier to the DC +//the greater the chance for the creature to succeed, the more +//likely it is to follow + int nChance=d20(); +//finds the difference between the climb DC and the class modifier of the hostile creature + int nFollow=nDC-GetClimbClassMod(oHostileFollow); +//5% chance to try to follow even if the creauture can't make the +//climb. To remove this behaviour comment out this if statement and the following three lines. + if (nFollow>19) + { + nFollow=19; + } +//add the d20 roll to the difference between the DC and the creatures climb modifier. +//If the creature's climb modifier is greater than the DC it will always follow. +//If it is less than 20 (no chance) it will only follow on a roll of 20. The better the +//chance the creature has to make the climb, the more likely it will try. + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE));//clear all actions in cue, including combat + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable));//use the climbable to try to follow (running this script for the hostile as well) + } + + + } + } + nNth++;//advance the counter to the next nearest creature to the placeable. + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth);//get the next nearest non-pc creature and test While condition(above) + } + break; + case 2: //Critical Failure + AssignCommand(oCreature, JumpToLocation(lFall));//fall location from the waypoint ClimbDestinationFall placed manually by the builder + AssignCommand(oCreature, ActionPlayAnimation (ANIMATION_LOOPING_DEAD_BACK, 6.0));//fall animation, no actual knockdown effect. + FloatingTextStringOnCreature("*You could not make the climb & have injured yourself in the fall*", oCreature); + SetLocalInt (oCreature, "bFall", TRUE);//The FallTrigger painted at the location of the fall will read this local variable on the creature. + //only if it is true (through this part of the script) will it fire the OnEnter commands. + SetLocalInt (oCreature, "nFallDistance", GetLocalInt (OBJECT_SELF, "nClimbDistance"));//sets the fall distance as a local variable on the creature to be read by the Fall Trigger +//controls hostile creatures climbing down to follow a creature who falls, same conditions as above + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + while (GetIsObjectValid(oHostileFollow)) + { + if (!GetIsFriend(oHostileFollow, oCreature)) + { + if (GetObjectSeen(oCreature, oHostileFollow)) + { + int nChance=d20(); + int nFollow=nDC-GetClimbClassMod(oHostileFollow); + if (nFollow>19) + { + nFollow=19; + } + if (!(nFollow+nChance>20)) + { + AssignCommand (oHostileFollow, ClearAllActions(TRUE)); + AssignCommand(oHostileFollow, ActionInteractObject (OClimbable)); + } + + + } + } + nNth++; + oHostileFollow=GetNearestCreature (CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, OBJECT_SELF,nNth); + } + break; + } + + + +} +//The use of the fall Trigger is so that this script can be altered to act as +//a transition between areas. Originally this system was set up to apply the damage +//by this script, however in cases where the player was moved to a new area because of a fall +//and that fall killed the player, the player would die at the placeable instead of at the fall location. +//In order to move a player into another area they cannot die when they enter the area. Even using +//delay commands could get around this. In order to cause creatures to fall into other map areas +//you will need to paint the fall trigger surrounding the fall location in a ring so that the player +//does not enter the trigger until after they have loaded the area and move themselves. Once the players move +//they will enter the trigger, make a tumble check and have damage assigned to them. This is not normally +//a problem unless the player dies as a result of the fall. +//The Fall Trigger is used to standardize everything, and make it easier to modify this script +//for using climbs as transitions to other areas. + + diff --git a/nwnds_module/ar_cloaks.utm b/nwnds_module/ar_cloaks.utm new file mode 100644 index 000000000..e145178b1 Binary files /dev/null and b/nwnds_module/ar_cloaks.utm differ diff --git a/nwnds_module/ar_clothing.utm b/nwnds_module/ar_clothing.utm new file mode 100644 index 000000000..d006147b6 Binary files /dev/null and b/nwnds_module/ar_clothing.utm differ diff --git a/nwnds_module/ar_clubs.utm b/nwnds_module/ar_clubs.utm new file mode 100644 index 000000000..467123935 Binary files /dev/null and b/nwnds_module/ar_clubs.utm differ diff --git a/nwnds_module/ar_cockatrice001.utc b/nwnds_module/ar_cockatrice001.utc new file mode 100644 index 000000000..86084f249 Binary files /dev/null and b/nwnds_module/ar_cockatrice001.utc differ diff --git a/nwnds_module/ar_containers.utm b/nwnds_module/ar_containers.utm new file mode 100644 index 000000000..d867c8de5 Binary files /dev/null and b/nwnds_module/ar_containers.utm differ diff --git a/nwnds_module/ar_crafting.utm b/nwnds_module/ar_crafting.utm new file mode 100644 index 000000000..99b8cc17f Binary files /dev/null and b/nwnds_module/ar_crafting.utm differ diff --git a/nwnds_module/ar_crate_001.utp b/nwnds_module/ar_crate_001.utp new file mode 100644 index 000000000..ae168e406 Binary files /dev/null and b/nwnds_module/ar_crate_001.utp differ diff --git a/nwnds_module/ar_crate_002.utp b/nwnds_module/ar_crate_002.utp new file mode 100644 index 000000000..3ac74f881 Binary files /dev/null and b/nwnds_module/ar_crate_002.utp differ diff --git a/nwnds_module/ar_crate_003.utp b/nwnds_module/ar_crate_003.utp new file mode 100644 index 000000000..9115e807c Binary files /dev/null and b/nwnds_module/ar_crate_003.utp differ diff --git a/nwnds_module/ar_crate_004.utp b/nwnds_module/ar_crate_004.utp new file mode 100644 index 000000000..7733b29a5 Binary files /dev/null and b/nwnds_module/ar_crate_004.utp differ diff --git a/nwnds_module/ar_cre_dviperl.uti b/nwnds_module/ar_cre_dviperl.uti new file mode 100644 index 000000000..03c4f2266 Binary files /dev/null and b/nwnds_module/ar_cre_dviperl.uti differ diff --git a/nwnds_module/ar_cre_dvipers.uti b/nwnds_module/ar_cre_dvipers.uti new file mode 100644 index 000000000..14c6766cc Binary files /dev/null and b/nwnds_module/ar_cre_dvipers.uti differ diff --git a/nwnds_module/ar_cre_flamebro.uti b/nwnds_module/ar_cre_flamebro.uti new file mode 100644 index 000000000..cfed0cb9e Binary files /dev/null and b/nwnds_module/ar_cre_flamebro.uti differ diff --git a/nwnds_module/ar_cre_snake.uti b/nwnds_module/ar_cre_snake.uti new file mode 100644 index 000000000..6fed5b34b Binary files /dev/null and b/nwnds_module/ar_cre_snake.uti differ diff --git a/nwnds_module/ar_cre_viperhs.uti b/nwnds_module/ar_cre_viperhs.uti new file mode 100644 index 000000000..ff587effe Binary files /dev/null and b/nwnds_module/ar_cre_viperhs.uti differ diff --git a/nwnds_module/ar_crimguard001.utc b/nwnds_module/ar_crimguard001.utc new file mode 100644 index 000000000..ddf164e59 Binary files /dev/null and b/nwnds_module/ar_crimguard001.utc differ diff --git a/nwnds_module/ar_d0_firsthead.ncs b/nwnds_module/ar_d0_firsthead.ncs new file mode 100644 index 000000000..4ac43cfc9 Binary files /dev/null and b/nwnds_module/ar_d0_firsthead.ncs differ diff --git a/nwnds_module/ar_d0_firsthead.nss b/nwnds_module/ar_d0_firsthead.nss new file mode 100644 index 000000000..a96ae9e52 --- /dev/null +++ b/nwnds_module/ar_d0_firsthead.nss @@ -0,0 +1,10 @@ +void main() +{ + // Find current Head model + int nModel = GetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD"); + // Reset to 1 + nModel = 1; + SetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD", nModel); + SetCreatureBodyPart(CREATURE_PART_HEAD,nModel,OBJECT_SELF); +} + diff --git a/nwnds_module/ar_d0_headchngr.ncs b/nwnds_module/ar_d0_headchngr.ncs new file mode 100644 index 000000000..97da3f77e Binary files /dev/null and b/nwnds_module/ar_d0_headchngr.ncs differ diff --git a/nwnds_module/ar_d0_headchngr.nss b/nwnds_module/ar_d0_headchngr.nss new file mode 100644 index 000000000..a353cae17 --- /dev/null +++ b/nwnds_module/ar_d0_headchngr.nss @@ -0,0 +1,9 @@ +void main() +{ +object oModel = OBJECT_SELF; +object oPC = GetPCSpeaker(); +int nModelNumber = GetLocalInt(oModel,"AR_CURRENT_HEAD"); + +SetCreatureBodyPart(CREATURE_PART_HEAD, nModelNumber, oPC); + +} diff --git a/nwnds_module/ar_d0_headsetup.ncs b/nwnds_module/ar_d0_headsetup.ncs new file mode 100644 index 000000000..d3f8fcc44 Binary files /dev/null and b/nwnds_module/ar_d0_headsetup.ncs differ diff --git a/nwnds_module/ar_d0_headsetup.nss b/nwnds_module/ar_d0_headsetup.nss new file mode 100644 index 000000000..f743eb973 --- /dev/null +++ b/nwnds_module/ar_d0_headsetup.nss @@ -0,0 +1,21 @@ +void main() +{ +object oModel = OBJECT_SELF; +object oPC = GetPCSpeaker(); +int nPCAppearance = GetAppearanceType(oPC); +int nPCSex= GetGender(oPC); +int nModelSex =GetGender(OBJECT_SELF); + + if(nPCSex != nModelSex) + { + string sErrorText = "Please speak with the other visage."; + FloatingTextStringOnCreature(sErrorText, oModel); + FloatingTextStringOnCreature(sErrorText, oModel); + SendMessageToPC(oPC,sErrorText); + return; + + } + + SetCreatureAppearanceType(oModel,nPCAppearance); + +} diff --git a/nwnds_module/ar_d0_nexthead.ncs b/nwnds_module/ar_d0_nexthead.ncs new file mode 100644 index 000000000..fe11ff358 Binary files /dev/null and b/nwnds_module/ar_d0_nexthead.ncs differ diff --git a/nwnds_module/ar_d0_nexthead.nss b/nwnds_module/ar_d0_nexthead.nss new file mode 100644 index 000000000..cf9352027 --- /dev/null +++ b/nwnds_module/ar_d0_nexthead.nss @@ -0,0 +1,14 @@ +// Set this to the max #Of Heads. +const int AR_MAX_HEAD_MODELS = 181; + +void main() +{ + // Find current Head model and increment by 1 + int nModel = GetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD"); + nModel = nModel + 1; + // Reset to 1 if past max + if(nModel > AR_MAX_HEAD_MODELS) nModel = 1; + SetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD", nModel); + SetCreatureBodyPart(CREATURE_PART_HEAD,nModel,OBJECT_SELF); + +} diff --git a/nwnds_module/ar_d0_prevthead.ncs b/nwnds_module/ar_d0_prevthead.ncs new file mode 100644 index 000000000..b247a6fee Binary files /dev/null and b/nwnds_module/ar_d0_prevthead.ncs differ diff --git a/nwnds_module/ar_d0_prevthead.nss b/nwnds_module/ar_d0_prevthead.nss new file mode 100644 index 000000000..0e6b73c40 --- /dev/null +++ b/nwnds_module/ar_d0_prevthead.nss @@ -0,0 +1,14 @@ +// Set this to the max #Of Heads. +const int AR_MAX_HEAD_MODELS = 181; + +void main() +{ + // Find current Head model and increment by 1 + int nModel = GetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD"); + nModel = nModel - 1; + // Reset to 1 if zero or less + if(nModel < 0) nModel = 1; + SetLocalInt(OBJECT_SELF, "AR_CURRENT_HEAD", nModel); + SetCreatureBodyPart(CREATURE_PART_HEAD,nModel,OBJECT_SELF); + +} diff --git a/nwnds_module/ar_daggers.utm b/nwnds_module/ar_daggers.utm new file mode 100644 index 000000000..ae378eea3 Binary files /dev/null and b/nwnds_module/ar_daggers.utm differ diff --git a/nwnds_module/ar_daggoran_001.utc b/nwnds_module/ar_daggoran_001.utc new file mode 100644 index 000000000..818f72c82 Binary files /dev/null and b/nwnds_module/ar_daggoran_001.utc differ diff --git a/nwnds_module/ar_dagslime_001.utc b/nwnds_module/ar_dagslime_001.utc new file mode 100644 index 000000000..9743e7640 Binary files /dev/null and b/nwnds_module/ar_dagslime_001.utc differ diff --git a/nwnds_module/ar_dagslime_002.utc b/nwnds_module/ar_dagslime_002.utc new file mode 100644 index 000000000..184210a5c Binary files /dev/null and b/nwnds_module/ar_dagslime_002.utc differ diff --git a/nwnds_module/ar_dagslime_003.utc b/nwnds_module/ar_dagslime_003.utc new file mode 100644 index 000000000..555a5642c Binary files /dev/null and b/nwnds_module/ar_dagslime_003.utc differ diff --git a/nwnds_module/ar_db_const.ncs b/nwnds_module/ar_db_const.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ar_db_const.ncs differ diff --git a/nwnds_module/ar_db_const.nss b/nwnds_module/ar_db_const.nss new file mode 100644 index 000000000..df5e9a922 --- /dev/null +++ b/nwnds_module/ar_db_const.nss @@ -0,0 +1,114 @@ +//:://///////////////////////////////////////////// +//:: Athas reborn Database access constants +//:: ar_db_const +//:: Copyright (c) 2007 Athas Reborn PW. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: NiteCap +//:: Created On: 7-9-07 +//::////////////////////////////////////////////// + +//Table names of the storage table in mysql + +const string ARSX_CONLOG="ar_connection_log"; +const string ARSX_AREA_INDEX="ar_area_index"; +const string ARSX_ARENA_KILLS_INDEX="ar_arena_kills_index"; +const string ARSX_CREATURE_INDEX="ar_creature_index"; +const string ARSX_PC_BOUNTY="ar_pc_bounty"; +const string ARSX_CREATURE_DEATHS="ar_creature_deaths"; +const string ARSX_PC_DEATH_INDEX="ar_pc_death_index"; +const string ARSX_PC_INDEX="ar_pc_index"; +const string ARSX_PC_QUESTS="ar_pc_quests"; +const string ARSX_PLAYER_INDEX="ar_player_index"; +const string ARSX_PLAYER_STORAGE="ar_player_storage"; +const string ARSX_QUEST_INDEX="ar_quest_index"; +const string ARSX_RACE_INDEX="ar_race_index"; +const string ARSX_ITEM_INDEX="ar_item_index"; +const string ARSX_ITEMPROP_INDEX="ar_itemprops_index"; + +//Process index +//used for ARSX_ProcessClient(); +const int ARSX_PROCID_CONLOG=1; +const int ARSX_PROCID_AREA_INDEX=2; +const int ARSX_PROCID_ARENA_KILLS_INDEX=3; +const int ARSX_PROCID_CREATURE_INDEX=4; +const int ARSX_PROCID_PC_BOUNTY=5; +const int ARSX_PROCID_PC_CREATURE_KILLS=6; +const int ARSX_PROCID_PC_DEATH_INDEX=7; +const int ARSX_PROCID_PC_INDEX=8; +const int ARSX_PROCID_PC_QUESTS=9; +const int ARSX_PROCID_PLAYER_INDEX=10; +const int ARSX_PROCID_PLAYER_STORAGE=11; +const int ARSX_PROCID_QUEST_INDEX=12; +const int ARSX_PROCID_RACE_INDEX=13; + + + +//sql Function constants +//MySQL 5+ +const string SQL_NULL="NULL"; +const string SQL_NOW="NOW()"; +const string SQL_ISNULL=" IS NULL"; + + +//constants pertaining to debugging +//set to false to turn off all debugging +const int ARSX_DEBUG_OUTPUT=TRUE; +//set to -1 to suppres debugging for select data set +const int ARSX_DEBUG_MAIN=1; +const int ARSX_DEBUG_CONNECTION_LOG=2; // ar_connection_log Debuging +const int ARSX_DEBUG_AREA_INDEX=3; // ar_area_index Debuging +const int ARSX_DEBUG_ARENA_INDEX=4; // ar_arena_kills_index Debuging +const int ARSX_DEBUG_CREATURE_INDEX=5; // ar_creature_index Debuging +const int ARSX_DEBUG_BOUNTY=6; // ar_pc_bounty Debuging +const int ARSX_DEBUG_CREATURE_KILLS=7; // ar_pc_creature_kills Debuging +const int ARSX_DEBUG_PC_DEATH_INDEX=8; // ar_pc_death_index Debuging +const int ARSX_DEBUG_PC_INDEX=9; // ar_pc_index Debuging +const int ARSX_DEBUG_PC_QUESTS=10; // ar_pc_quests Debuging +const int ARSX_DEBUG_PLAYER_INDEX=11; // ar_player_index Debuging +const int ARSX_DEBUG_PLAYER_STORAGE=12; // ar_player_storage Debuging +const int ARSX_DEBUG_QUEST_INDEX=13; // ar_quest_index Debuging +const int ARSX_DEBUG_RACE_INDEX=14; // ar_race_index Debuging + +// error codes +const int ARSX_USER_NOT_CONNECTED = -101; +const int ARSX_USER_NOT_FOUND =-102; +const int ARSX_USER_CREATE_ERROR =-103; +const int ARSX_PC_CREATE_ERROR = -104; +const int ARSX_PC_NOT_FOUND = -105; +const int ARSX_RACE_OBJECT_NOT_VALID = -106; +const int ARSX_RACE_CREATE_ERROR = -107; +const int ARSX_RACE_NOT_FOUND = -108; +const int ARSX_AREA_NOT_FOUND= -109; +const int ARSX_CREATURE_CREATE_ERROR=-110; +const int ARSX_LOG_ERROR_PCDEATH=-111; +const int ARSX_LOG_ERROR_PCKILL=-112; +const int ARSX_LOG_ERROR_CRDEATH=-113; +const int ARSX_LOG_PCDEATH=-114; +const int ARSX_LOG_CRDEATH=-115; +const int ARSX_ITEM_CREATE_ERROR=-116; +const int ARSX_LOCATION_STORED = -109; + +//const for var pointers for temp PC data storage +const string ARSX_VAR_TOTAL_KILLS = "ARSX_TOTAL_KILLS"; +const string ARSX_VAR_KILLS = "ARSX_CONTAINER_KILLS"; + +//const for local Main data storage +const string ARSX_L_PLAYER = "ARSX_PL_"; +const string ARSX_L_PC = "ARSX_PC_"; +const string ARSX_L_CONNECTION = "ARSX_CN_"; +const string ARSX_L_LASTLOCATION = "ARSX_LOC_"; +const string ARSX_CREATUREID = "ARSX_CRID"; +const string ARSX_CREATURE_SPAWNED_AREA= "ARSX_CR_SPAWN_AREA"; + +const string ARSX_MSG_NEWPLAYER = "AthasReborn";// Please Take your time and ask any questions you may have."; +const int ARSX_LOCAL_USE_MODULE=TRUE; +const int ARSX_LOCAL_USE_ITEM = FALSE; +const string ARSX_LOCAL_USE_ITEM_TAG = ""; +// const int RACIAL_TYPE_PLANT = 62; // MOVED +const int MAXIMUM_PLAYER_LEVEL = 40; + +//void main(){} diff --git a/nwnds_module/ar_db_main.ncs b/nwnds_module/ar_db_main.ncs new file mode 100644 index 000000000..5bf4aef34 Binary files /dev/null and b/nwnds_module/ar_db_main.ncs differ diff --git a/nwnds_module/ar_db_main.nss b/nwnds_module/ar_db_main.nss new file mode 100644 index 000000000..c91464611 --- /dev/null +++ b/nwnds_module/ar_db_main.nss @@ -0,0 +1,981 @@ +//:://///////////////////////////////////////////// +//:: Athas reborn Database connection functions +//:: ar_db_main +//:: Copyright (c) 2007 Athas Reborn PW. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: NiteCap +//:: Created On: 7-9-07 +//::////////////////////////////////////////////// +#include "aps_include" +#include "ar_inc_pcspawn" +#include "ar_db_const" +#include "ar_db_struct" +//#include "nwnx_functions" + + + +//::////////////////////////////////////////////// +//:: Prototypes +//::////////////////////////////////////////////// +//Inititalizes the database and grooms the log table +void ARSX_INIT(); + + +//prosscesses the oncliententer db information +void ARSX_OnClientEnter(object oPC); + +// client onrest event handler +// stores db info for oPC +// includeing +// last location +void ARSX_OnRest(object oPC); + +// returns the main storage object +// can be set to item or module +// if set to item ARSX_LOCAL_USE_ITEM_RESREF will need to be supplied +object ARSX_LOCAL(); + +//set/returns the race of oObject +int ARSX_GetRace(object oObject); + +//returns the player id from the database +int ARSX_GetPlayer(object oPC); + +//returns the pc id from the database +int ARSX_GetPC(object oPC, int nPlayer); + +// updates the connection log useing sDatastruct +// returns the row index in the table of the connection +int ARSX_LogConnection(struct ar_connection_log sData); + +//returns the Database id for oObject +int ARSX_GetDBID(object oObject, int nObjectType); + + + +// returns the last known location of oPC +// if nolocation is found or nIsNewPC is set to true +// will return the PC's race adjusted start point +location ARSX_GetLastLocation(object oPC, int nIsNewPC=FALSE); + +//logs the pc death and returns the entry # for use. +int ARSX_LogPCDeath(object oPC, object oKiller); + +//logs the pc kil and returns the entry # for use. +int ARSX_LogPCKill(object oPC, object oKiller); + + +//returns the Database id for oObject +int ARSX_GetDBID(object oObject, int nObjectType); + + +// updates the ar_area_index +// return on error is ARSX_AREA_NOT_FOUND +int ARSX_IndexArea(object oArea); + +// //logs the creature and returns the entry # for use. +int ARSX_IndexCreature(object oCreature); + +//gets the xp value of a creature +int ARSX_GetXP(object oPlayer,object oCreature); + +//logs the item and returns the entry # for use. +int ARSX_IndexItem(object oItem); + +//logs the item Property and returns the entry # for use. +int ARSX_IndexItemProperty(object oItem, int nItem); + + +//gets the ecl value of a pc +int AR_GetECL(object oPC); + +//gets the gold value of a creature +int ARSX_GetGoldValue(object oPlayer,object oCreature); + + +//::////////////////////////////////////////////// +//:: Implements +//::////////////////////////////////////////////// + + + +// updates the connection log useing sDatastruct +// returns the row index in the table of the connection +// returns -1 on updates +int ARSX_LogConnection(struct ar_connection_log sData) +{ + string sSQL=""; + object oModule=GetModule(); + + + if(sData.nID == ARSX_USER_NOT_CONNECTED) + { + + sSQL = "INSERT INTO " + sData.sTable + + " (nPlayer,nPC,sInboundConnection,bDM,sIP) VALUES" + + "(" + IntToString(sData.nPlayer) + + "," + IntToString( sData.nPC) + + "," + sData.sInboundConnection + + "," + IntToString(sData.bDM ) + + ",'" + sData.sIP + + "');"; + + SQLExecDirect(sSQL); + + //Retrive our index for later + sSQL = "SELECT nIndex FROM " + sData.sTable + " WHERE nPlayer=" + + IntToString(sData.nPlayer) + + " AND sOutboundConnection " + SQL_ISNULL + + " AND sIP='" + sData.sIP + "';"; + + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + return StringToInt(SQLGetData(1)); + } + else + { + return SQLFetch(); + } + } + else + { + sSQL = "UPDATE " + sData.sTable + " SET sOutBoundConnection=" + sData.sOutboundConnection + + ",sLocation='" + sData.sLastLocation + + "' WHERE nIndex=" + IntToString(sData.nID) + + ";"; + SQLExecDirect(sSQL); + return ARSX_LOCATION_STORED; + } +} + + + +//returns the player id from the database +int ARSX_GetPlayer(object oPC) +{ + + struct ar_player_index sData; + sData.sName = SQLEncodeSpecialChars(GetPCPlayerName(oPC)); + sData.sIP = GetPCIPAddress(oPC); + sData.sCDKEY = GetPCPublicCDKey(oPC); + sData.sLastIP = SQL_NULL; + sData.bDM = GetIsDM(oPC); + + + + string sSQL = "SELECT nIndex FROM " + ARSX_PLAYER_INDEX + + " WHERE sName='" + sData.sName +"'"; + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + return StringToInt(SQLGetData(1)); + } + else + { + SendMessageToAllDMs("New Player: " + sData.sName); + SendMessageToPC(oPC,ARSX_MSG_NEWPLAYER); + sSQL = "INSERT INTO " + ARSX_PLAYER_INDEX + + " (sName,sIP,sCDKEY,sLastIP,bDM) VALUES (" + + "'" + sData.sName + + "','" + sData.sIP + + "','" + sData.sCDKEY + + "','" + sData.sLastIP + + "'," + IntToString( sData.bDM) + ");"; + + SQLExecDirect(sSQL); + + sSQL = "SELECT nIndex FROM " + ARSX_PLAYER_INDEX + + " WHERE sName='" + sData.sName +"'"; + + + SQLExecDirect(sSQL); + + if(SQLFetch() == SQL_SUCCESS) + { + + return StringToInt(SQLGetData(1)); + } + + return ARSX_USER_CREATE_ERROR; + } + +return ARSX_USER_NOT_FOUND; +} + + +//returns the pc id from the database +int ARSX_GetPC(object oPC, int nPlayer) +{ + + struct ar_pc_index sData; + sData.sName = SQLEncodeSpecialChars(GetName(oPC)); + sData.nPlayer = nPlayer; + sData.bDM = GetIsDM(oPC); + sData.nRace = ARSX_GetRace(oPC); + + + + string sSQL = "SELECT nIndex FROM " + ARSX_PC_INDEX + + " WHERE sName='" + sData.sName +"' AND nPlayer=" + + IntToString(sData.nPlayer) + ";"; + + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + + return StringToInt(SQLGetData(1)); + } + else + { + + sSQL = "INSERT INTO " + ARSX_PC_INDEX + + " (sName,nPlayer,bDM,nRace) VALUES (" + + "'" + sData.sName + + "'," + IntToString( sData.nPlayer ) + + "," + IntToString(sData.bDM) + + "," + IntToString(sData.nRace) + ");"; + + SQLExecDirect(sSQL); + + sSQL = "SELECT nIndex FROM " + ARSX_PC_INDEX + + " WHERE sName='" + sData.sName +"' AND nPlayer=" + + IntToString(sData.nPlayer) + ";"; + + SQLExecDirect(sSQL); + + if(SQLFetch() == SQL_SUCCESS) + { + + return StringToInt(SQLGetData(1)); + } + + return ARSX_PC_CREATE_ERROR; + } + +return ARSX_PC_NOT_FOUND; +} + + +//set/returns the race index of oObject +int ARSX_GetRace(object oObject) +{ + + if(GetObjectType(oObject)!=OBJECT_TYPE_CREATURE) + { + return ARSX_RACE_OBJECT_NOT_VALID; + } + + struct ar_race_index sData; + + if(GetIsPC(oObject)) + { + sData.sName = GetSubRace(oObject) == "" ? + Get2DAString("racialtypes","Lable",GetRacialType(oObject)) : + GetSubRace(oObject); + + sData.sStartLocation=GetSubRaceAdjustedStartPoint(oObject); + sData.sRespawnLocation = GetSubRaceAdjustedRespawnPoint(oObject); + } + else + { + int nRow = GetRacialType(oObject); + sData.sName=Get2DAString ("racialtypes","Lable",nRow); + sData.sStartLocation="~CREATURE_SPAWN_POINT~"; + sData.sRespawnLocation = "~CREATURE_SPAWN_POINT~"; + } + + string sSQL = "SELECT nIndex FROM " + ARSX_RACE_INDEX + + " WHERE sName='" + sData.sName + "';"; + + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + return StringToInt(SQLGetData(1)); + } + else + { + + sSQL = "INSERT INTO " + ARSX_RACE_INDEX + + " (sName,sStartLocation,sRespawnLocation) VALUES (" + + "'" + sData.sName + + "','" + sData.sStartLocation + + "','" + sData.sRespawnLocation + + "');"; + + SQLExecDirect(sSQL); + + sSQL = "SELECT nIndex FROM " + ARSX_RACE_INDEX + + " WHERE sName='" + sData.sName +"';"; + + SQLExecDirect(sSQL); + + if(SQLFetch() == SQL_SUCCESS) + { + return StringToInt(SQLGetData(1)); + } + return ARSX_RACE_CREATE_ERROR; + } +return ARSX_RACE_NOT_FOUND; +} + + +// returns the main Local storage object +// can be set to item or module see ar_db_const +// for details +// if set to item ARSX_LOCAL_USE_ITEM_TAG will need to be supplied +object ARSX_LOCAL() +{ + if(ARSX_LOCAL_USE_ITEM) + { + return GetObjectByTag(ARSX_LOCAL_USE_ITEM_TAG); + } + return GetModule(); +} + +// returns the last known location of oPC +location ARSX_GetLastLocation(object oPC, int nIsNewPC=FALSE) +{ + int nPlayer = ARSX_GetPlayer(oPC); + int nPC = ARSX_GetPC(oPC, nPlayer); + + string sSQL; + location lLoc; + + sSQL= "SELECT sLocation, nIndex FROM "+ ARSX_CONLOG + + " WHERE nPlayer=" + IntToString(nPlayer) + + " AND nPC=" + IntToString(nPC) + + " AND sLocation IS NOT NULL " + + " ORDER BY nIndex DESC"; + + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + string sLoc = SQLGetData(1); + if(sLoc != "")lLoc = APSStringToLocation(sLoc); + } + else + { + sSQL = "SELECT sStartLocation FROM " + ARSX_RACE_INDEX + + " WHERE nIndex=" + IntToString(ARSX_GetRace(oPC)); + + SQLExecDirect(sSQL); + + if (SQLFetch() == SQL_SUCCESS) + { + lLoc = GetLocation(GetObjectByTag(SQLGetData(1))); + } + } + + + if(nIsNewPC) + { + sSQL = "SELECT sStartLocation FROM " + ARSX_RACE_INDEX + + " WHERE nIndex=" + IntToString(ARSX_GetRace(oPC)); + SQLExecDirect(sSQL); + if (SQLFetch() == SQL_SUCCESS) + { + lLoc = GetLocation(GetObjectByTag(SQLGetData(1))); + } + } +return lLoc; +} + + +void ARSX_OnClientEnter(object oPC) +{ + struct ar_connection_log sData; + object oStorer = ARSX_LOCAL(); + string sConn = ARSX_L_CONNECTION + GetPCPlayerName(oPC) + "_" + GetName(oPC); + int nConn = GetLocalInt(oStorer,sConn); + int nIsNewPC = GetHitDice(oPC)<=1?TRUE:FALSE; + + if(!nConn) + { + sData.nID = ARSX_USER_NOT_CONNECTED; + sData.nPlayer = ARSX_GetPlayer(oPC); + sData.nPC = ARSX_GetPC(oPC, sData.nPlayer); + sData.sInboundConnection = SQL_NOW; + sData.sOutboundConnection = SQL_NULL; + //location lLastLoc =ARSX_GetLastLocation(oPC,sData.nPlayer ,sData.nPC,nIsNewPC); + sData.bDM = GetIsDM(oPC); + sData.sIP = GetPCIPAddress(oPC); + sData.sTable = ARSX_CONLOG; + nConn = ARSX_LogConnection(sData); + SetLocalInt(oStorer,sConn,nConn); + SetLocalInt(oPC,sConn,nConn); + SetLocalInt(oPC,ARSX_L_PLAYER,sData.nPlayer ); + SetLocalInt(oPC,ARSX_L_PC,sData.nPC); + } +} + + +void ARSX_OnRest(object oPC) +{ + + + struct ar_connection_log sData; // create our connection data structure + + object oStorer = ARSX_LOCAL(); + + int nPC = GetLocalInt(oStorer,ARSX_L_PC + GetName(oPC)); // local stored pc index + int nPlayer = GetLocalInt(oStorer,ARSX_L_PLAYER + GetPCPlayerName(oPC)); // local Player index + string sUID = GetPCPlayerName(oPC) + "_" + GetName(oPC); + + string sConn = ARSX_L_CONNECTION + sUID; + int nConn = GetLocalInt(oStorer, sConn); // get the local stored connection index + string sLoc = APSLocationToString(GetLocation(oPC)); + + if(sLoc=="")sLoc = "#ERROR##ERROR##ERROR##ERROR##ERROR#"; + + sData.nID = nConn; + sData.nPlayer = nPlayer; + sData.nPC =nPC; + sData.sInboundConnection = SQL_NULL; + sData.sOutboundConnection = SQL_NOW; + sData.sLastLocation = sLoc; + sData.bDM = GetIsDM(oPC); + sData.sIP = GetPCIPAddress(oPC); + sData.sTable = ARSX_CONLOG; + int nUpdated = ARSX_LogConnection(sData); + + if(nUpdated == ARSX_LOCATION_STORED){ + FloatingTextStringOnCreature("Location Saved",oPC);} + +} + +//Inititalizes the database and grooms the log table +void ARSX_INIT() +{ + string sCleanConnectionLog = "DELETE FROM ar_connection_log WHERE sLocation IS NULL " + + " AND sOutboundConnection IS NULL AND " + + "sInboundConnection < CURRENT_DATE;"; + +SendMessageToAllDMs("ARSX-Loading..........."); +SQLExecDirect(sCleanConnectionLog); +SendMessageToAllDMs("............ARSX-Loaded"); + +} + + +// updates the ar_area_index +// return on error is ARSX_AREA_NOT_FOUND +int ARSX_IndexArea(object oArea) +{ + string sSelect; + string sInsert; + int nReturn=ARSX_AREA_NOT_FOUND; + string sResRef=GetResRef(oArea); + string sDescription=SQLEncodeSpecialChars(GetName(oArea)); + + sSelect = "SELECT nIndex FROM " + ARSX_AREA_INDEX + + " WHERE sResRef='" + sResRef + + "';"; + + sInsert = "INSERT INTO " + ARSX_AREA_INDEX + + "(sResRef,sDescription) VALUES (" + + "'" + sResRef + + "','" + sDescription + + "');"; + + SQLExecDirect(sSelect); + // If existing + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + } + // not There so we add it + else + { + SQLExecDirect(sInsert); + SQLExecDirect(sSelect); + + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + } + } + + return nReturn; + } + +// updates the ar_creature_index useing sData +int ARSX_IndexCreature(object oCreature) +{ + struct ar_creature_index sData; + + sData.sResRef=GetResRef(oCreature); + sData.sDescription=SQLEncodeSpecialChars(GetName(oCreature)); + sData.sCommonName=SQLEncodeSpecialChars(GetName(oCreature)); + sData.nCRValue=FloatToInt(GetChallengeRating(oCreature)); + sData.nRace= ARSX_GetRace(oCreature); + sData.bPlotFlag=GetPlotFlag(oCreature); + + int nReturn=ARSX_CREATURE_CREATE_ERROR; + + string sSelect = "SELECT nIndex FROM " + ARSX_CREATURE_INDEX + + " WHERE sResRef='" + sData.sResRef + "';"; + + string sInsert = "INSERT INTO " + ARSX_CREATURE_INDEX + + "(sResRef,sDescription,sCommonName,nCRValue,nRace,bPlotFlag) VALUES('" + + sData.sResRef + "','" + + sData.sDescription + "','" + + sData.sCommonName + "'," + + IntToString(sData.nCRValue) + "," + + IntToString(sData.nRace) + "," + + IntToString(sData.bPlotFlag) + ");"; + SQLExecDirect(sSelect); + // If existing + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + } + // not There so we add it + else + { + SQLExecDirect(sInsert); + SQLExecDirect(sSelect); + + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + } + } + + return nReturn; + +} + +//logs the pc death. +int ARSX_LogPCDeath(object oPC, object oKiller) +{ + int nReturn=ARSX_LOG_ERROR_PCDEATH; + string sSelect,sInsert; + int nPC,bKilledByPC,bKilledByCreature,nArea,nKiller,nItem; + string sTimeOfDeath = SQL_NOW; + + nPC = ARSX_GetPC(oPC,ARSX_GetPlayer(oPC)); + nArea = ARSX_IndexArea(GetArea(oPC)); + object oItem = GetLastWeaponUsed(oKiller); + nItem =ARSX_IndexItem(oItem); + + if(!GetIsPC(oKiller)) + { + nKiller = ARSX_IndexCreature(oKiller); + bKilledByCreature=TRUE; + } + + if(GetIsPC(oKiller)) + { + bKilledByPC = TRUE; + nKiller = ARSX_GetPC(oKiller,ARSX_GetPlayer(oKiller)); + bKilledByCreature=FALSE; + } + + sInsert = "INSERT INTO " + ARSX_PC_DEATH_INDEX + + "(nPC,nKiller,bPCKill,bCreatureKill,nArea,nItem,sTimeStamp) VALUES(" + + IntToString(nPC) + "," + + IntToString(nKiller) + "," + + IntToString(bKilledByPC) + "," + + IntToString(bKilledByCreature) + "," + + IntToString(nArea) + "," + + IntToString(nItem) + "," + + sTimeOfDeath + ");"; + + SQLExecDirect(sInsert); + + return ARSX_LOG_PCDEATH; +} + +//logs the kill and returns the entry # for use. +// +int ARSX_LogCreatureDeath(object oDead, object oKiller) +{ + int nReturn=ARSX_LOG_ERROR_CRDEATH; + string sInsert; + int nPC,nCreature,nArea,nXpValue,nGoldValue,nItem; + string sTimeOfDeath = SQL_NOW; + + nPC = ARSX_GetPC(oKiller,ARSX_GetPlayer(oKiller)); + nCreature = ARSX_IndexCreature(oDead); + nArea = ARSX_IndexArea(GetArea(oKiller)); + nXpValue = ARSX_GetXP(oKiller, oDead); + nGoldValue = ARSX_GetGoldValue(oKiller,oDead); + //limited need upgrades here + object oItem = GetLastWeaponUsed(oKiller); + nItem =ARSX_IndexItem(oItem); + + sInsert = "INSERT INTO " + ARSX_CREATURE_DEATHS + + "(nPC,nCreature,nArea,nXpValue,nGoldValue,nItem,sTimeStamp) VALUES(" + + IntToString(nPC) + "," + + IntToString(nCreature) + "," + + IntToString(nArea) + "," + + IntToString(nXpValue) + "," + + IntToString(nGoldValue) + "," + + IntToString(nItem) + "," + + sTimeOfDeath + ");"; + SQLExecDirect(sInsert); + + return ARSX_LOG_CRDEATH; +} + + + +//logs the kill and returns the status response +// +int ARSX_LogKill(object oDead, object oKiller) +{ + int nReturn=ARSX_LOG_ERROR_PCKILL; + string sSelect,sInsert; + int nDeadPC,nDeadCR,nPCKiller,nCRKiller; + + //Killer is acually the master of oKiller in case of summon or familiars + if(GetIsObjectValid(GetMaster(oKiller)))oKiller = GetMaster(oKiller); + + //pc was killed + if(GetIsPC(oDead))nDeadPC = TRUE; + //creature killed + if(GetObjectType(oDead)==OBJECT_TYPE_CREATURE)nDeadCR = TRUE; + if(GetIsPC(oKiller))nPCKiller=TRUE; + if(GetObjectType(oKiller)==OBJECT_TYPE_CREATURE)nCRKiller=TRUE; + + if(nDeadPC) + { + nReturn= ARSX_LogPCDeath(oDead,oKiller); + } + else if(nDeadCR) + { + nReturn= ARSX_LogCreatureDeath(oDead,oKiller); + } + + + return nReturn; +} + + +int ARSX_GetXP(object oPlayer,object oCreature) +{ + //Get the area the kill was made in + object oArea = GetArea(oCreature); + //Initialize the amount of players in a party + int nMembers = 0; + //Determine how many members of the party are in that area + object oPartyMember = GetFirstFactionMember(oPlayer); + int AwardXP=0; + + if(GetIsObjectValid(oPartyMember)) + { + while(GetIsObjectValid(oPartyMember)) + { + if((GetArea(oPartyMember) == oArea) && (GetIsPC(oPartyMember))) + nMembers++; + oPartyMember = GetNextFactionMember(oPlayer); + } + + //Get the hit dice of the monster + int nMRating = GetHitDice(oCreature); + //Get the hit dice of the killer + int nPRating = AR_GetECL(oPlayer);//GetHitDice(oPlayer); + + if(nPRating == 0) + { + nMRating = 0; + nPRating = 1; + } + + + //Initialize a default amount of experience + int nXP = (100 + (nMRating * 5)); + if((nMRating - nPRating) < -6) + { + nXP = 0; + } + + //Modify the experience + nXP = ((nXP * nMRating) / nPRating); + AwardXP = nXP; + + //Start exp loop + oPartyMember = GetFirstFactionMember(oPlayer); + if(GetIsObjectValid(oPartyMember)) + { + //Initialize a variable for the loop to determine the party members challenge rating + int nPartyRating; + int nXPTemp = 0; + //Loop baby + while (GetIsObjectValid(oPartyMember)) + { + if((GetArea(oPartyMember) == oArea) && (GetIsPC(oPartyMember))) + { + /// AREA if + nPartyRating = AR_GetECL(oPartyMember); + if(nPRating >= nPartyRating) + { + if((nPRating - nPartyRating) > 6) + nXPTemp = 0; + else + nXPTemp = ((nXP * nPartyRating) / nPRating); + } + else + { + if((nPartyRating - nPRating) > 6) + nXPTemp = 0; + else + { + if(nPartyRating == 0) + { + nPartyRating = 1; + nXP = 0; + } + nXPTemp = ((nXP * nPRating) / nPartyRating); + } + } + //if(nPRating >= nPartyRating) + + if((nMRating - nPartyRating) < -6) + { + nXPTemp = 0; + } + + if(nXPTemp > AwardXP) + { + AwardXP = nXPTemp; + } + } + oPartyMember = GetNextFactionMember(oPlayer); + } + + } + } + return AwardXP; +} + +int ARSX_GetGoldValue(object oPlayer,object oCreature) +{ +//Get the area the kill was made in + object oArea = GetArea(oCreature); + //Initialize the amount of players in a party + int nMembers = 0; + //Determine how many members of the party are in that area + object oPartyMember = GetFirstFactionMember(oPlayer); + int nGold; + + if(GetIsObjectValid(oPartyMember)) + { + while(GetIsObjectValid(oPartyMember)) + { + if((GetArea(oPartyMember) == oArea) && (GetIsPC(oPartyMember))) + nMembers++; + oPartyMember = GetNextFactionMember(oPlayer); + } + + //Get the hit dice of the monster + int nMRating = GetHitDice(OBJECT_SELF); + //Get the hit dice of the killer + int nPRating = AR_GetECL(oPlayer);//GetHitDice(oPlayer); + if(nPRating == 0) + { + nMRating = 0; + nPRating = 1; + } + + //Get an amount of gold in relation to the challenge rating of the monster + nGold = d4(nMRating); + //These monster types don't have gold + if(GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ANIMAL || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_BEAST || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_CONSTRUCT || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ELEMENTAL || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ABERRATION || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_MAGICAL_BEAST || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_OUTSIDER || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_PLANT || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_OOZE || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_VERMIN) + { + nGold = 0; + } + else + { + //Split the gold among the party members in the area + if (nMembers == 0) + nGold /= 1; + else + nGold /= nMembers; + } + } + +return nGold; +} + +int AR_GetECL(object oPC) +{ + int iLevel = GetHitDice(oPC); + + if(iLevel > MAXIMUM_PLAYER_LEVEL) + { + iLevel = MAXIMUM_PLAYER_LEVEL; + } + + if(iLevel < 0) + { + iLevel = 0; + } + return iLevel; +} + + +int ARSX_IndexItem(object oItem) +{ + struct ar_item_index sData; + + sData.sResRef =GetResRef(oItem); + sData.sDescription="NOT_IMPLEMETED_YET";//GetDescription_(oItem); + sData.nGoldValue=GetGoldPieceValue(oItem); + sData.nType=GetBaseItemType(oItem); + sData.sName = SQLEncodeSpecialChars(GetName(oItem)); + + int nReturn=ARSX_ITEM_CREATE_ERROR; + + string sSelect = "SELECT nIndex FROM " + ARSX_ITEM_INDEX + + " WHERE sResRef='" + sData.sResRef + "';"; + + string sInsert = "INSERT INTO " + ARSX_ITEM_INDEX + + "(sResRef,sDescription,sName,nGoldValue,nType) VALUES('" + + sData.sResRef + "','" + + sData.sDescription + "','" + + sData.sName + "'," + + IntToString(sData.nGoldValue) + "," + + IntToString(sData.nType) + ");"; + + SQLExecDirect(sSelect); + // If existing + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + } + // not There so we add it + else + { + SQLExecDirect(sInsert); + SQLExecDirect(sSelect); + + if (SQLFetch() == SQL_SUCCESS) + { + nReturn = StringToInt(SQLGetData(1)); + ARSX_IndexItemProperty(oItem, nReturn); + } + } + + return nReturn; +} + +//logs the item Property of nItem +int ARSX_IndexItemProperty(object oItem, int nItem) +{ +itemproperty ip; +int nSubType,nType,nParam1,nParam1Value,nCostTable,nCostTableValue; +string sSQL; + + // lay our hands on the first prop + ip = GetFirstItemProperty(oItem); + + +// start the recurse + while (GetIsItemPropertyValid(ip)) + { + // get our values + nType = GetItemPropertyType(ip); + nSubType = GetItemPropertySubType(ip); + nParam1 = GetItemPropertyParam1(ip); + nParam1Value = GetItemPropertyParam1Value(ip); + nCostTable = GetItemPropertyCostTable(ip); + nCostTableValue = GetItemPropertyCostTableValue(ip); + + //SQL ;) + sSQL= "INSERT INTO " + ARSX_ITEMPROP_INDEX + + "(nItem,nType,nSubType,nParam1,nParam1Value,nCostTable,nCostTableValue) VALUES(" + + IntToString(nItem) + "," + + IntToString(nType) + "," + + IntToString(nSubType) + "," + + IntToString(nParam1) + "," + + IntToString(nParam1Value) + "," + + IntToString(nCostTable) + "," + + IntToString(nCostTableValue) + ");"; + + // cast the data + SQLExecDirect(sSQL); + + //try the next Prop if any + ip = GetNextItemProperty(oItem); + } + //done + return nItem; +} + + + +/* +// updates the ar_arena_kills_index useing sData +void ARSX_IndexArenaKill(struct ar_arena_kills_index sData) +{ + string sSql; + string sTable = sData.sTable; + + +} + + + +// updates the ar_pc_bounty useing sData +void ARSX_IndexBounty(struct ar_pc_bounty sData) +{ + string sSql; + string sTable = sData.sTable; + + +} + + +// updates the ar_pc_quests useing sData +void ARSX_IndexPCQuest(struct ar_pc_quests sData) +{ + string sSql; + string sTable = sData.sTable; + + +} + + + +// updates the ar_player_storage useing sData +void ARSX_IndexPCStorage(struct ar_player_storage sData) +{ + string sSql; + string sTable = sData.sTable; + + +} + +// updates the ar_quest_index useing sData +void ARSX_IndexQuest(struct ar_quest_index sData) +{ + string sSql; + string sTable = sData.sTable; + + +} +*/ +//------------------------------------------------------------------------------ +// void main(){} + diff --git a/nwnds_module/ar_db_onrest.ncs b/nwnds_module/ar_db_onrest.ncs new file mode 100644 index 000000000..8829e3a29 Binary files /dev/null and b/nwnds_module/ar_db_onrest.ncs differ diff --git a/nwnds_module/ar_db_onrest.nss b/nwnds_module/ar_db_onrest.nss new file mode 100644 index 000000000..f66467a5a --- /dev/null +++ b/nwnds_module/ar_db_onrest.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: Athas reborn Databaseonrest +//:: ar_db_onrest +//:: Copyright (c) 2007 Athas Reborn PW. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: NiteCap +//:: Created On: 7-9-07 +//::////////////////////////////////////////////// +#include "ar_db_main" + +void main() +{ + ARSX_OnRest(OBJECT_SELF); +} + + diff --git a/nwnds_module/ar_db_struct.nss b/nwnds_module/ar_db_struct.nss new file mode 100644 index 000000000..49aebdc45 --- /dev/null +++ b/nwnds_module/ar_db_struct.nss @@ -0,0 +1,180 @@ +//:://///////////////////////////////////////////// +//:: Athas reborn Database Data Structures +//:: ar_db_struct +//:: Copyright (c) 2007 Athas Reborn PW. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: NiteCap +//:: Created On: 7-9-07 +//::////////////////////////////////////////////// + +#include "ar_db_const" + +// Connection log data +// nPlayerID: Player id pointer +// nPC: PC id pointer +// sInboundConnection: inbound time stamp +// sOutboundConnection: outbound time stamp +// sLastLocation: last Location +// isDM: is player a DM +// sIP: IP at login +struct ar_connection_log +{ + int nID; + int nPlayer; + int nPC; + string sInboundConnection; + string sOutboundConnection; + string sLastLocation; + int bDM; + string sIP; + string sTable; +}; + +// Area data +// sResref: Area reseref +// sCommonName: Area Common Name +// +struct ar_area_index +{ +string sResRef; +string sDescription; +string sCommonName; +string sTable; +}; + + + + + +// Arena Kills Data +// nloser: pc referance of the losing pc +// nwinner: pc referance of the winning pc +// nPCWin: did a pc win this match +// nCreatureWin: did a creature win this match +// nLoserHD +// nWinnerHD +struct ar_arena_kills_index +{ +int nloser; +int nwinner; +int bPCWin; +int bCreatureWin; +int nLoserHD; +int nWinnerHD; +string sTable; +}; + + +struct ar_creature_index +{ +string sResRef; +string sDescription; +string sCommonName; +int nCRValue; +int nRace; +int bPlotFlag; +string sTable; +}; + +struct ar_pc_bounty +{ +int nWantedPC;//pc id pointer +int nCollectionAmmount;//amount to collect on colection +int nBountyOrigin;//id pointer of the pc killed for the bounty +string sInception;//date bounty was placed +int nCollector;//id pointer to the collector +string sCollectionDate;//Date bounty was collected +string sTable; +}; + +struct ar_pc_creature_kills +{ +int nPC; +int nCreature; +int nArea; +int nXpValue; +int nGoldValue; +string sTimeStamp; +string sTable; +}; + +struct ar_pc_death_index +{ +int nPC; +int nKiller; +int bPCKill; +int bCreatureKill; +string sTimeStamp; +string sTable; +}; + +struct ar_pc_index +{ +string sName; +int nPlayer; +int bDM; +int nRace; +string sTable; +}; + +struct ar_pc_quests +{ +int nQuest; +int bCStatus; +int nPC; +string sCompleted; //completetion time stamp +string sTable; +}; + + +struct ar_player_index +{ +string sName; +string sIP; +string sCDKEY; +string sLastIP; +int bDM; +string sTable; +}; + +struct ar_player_storage +{ +string sResRef; +int nStackSize; +int nInventorySize; +int nPlayer; +string sTable; +}; + +struct ar_quest_index +{ +string sName; +int nXPValue; +int nGoldValue; +int nNPC; +string sTable; +}; + +struct ar_race_index +{ +string sName; +string sStartLocation; +string sRespawnLocation; +string sTable; +}; + +struct ar_item_index +{ +string sResRef; +string sDescription; +int nGoldValue; +int nType; +string sName; +}; + + +//void main(){} diff --git a/nwnds_module/ar_def_spawnbuff.ncs b/nwnds_module/ar_def_spawnbuff.ncs new file mode 100644 index 000000000..54d5229a3 Binary files /dev/null and b/nwnds_module/ar_def_spawnbuff.ncs differ diff --git a/nwnds_module/ar_def_spawnbuff.nss b/nwnds_module/ar_def_spawnbuff.nss new file mode 100644 index 000000000..c0fe0a6ef --- /dev/null +++ b/nwnds_module/ar_def_spawnbuff.nss @@ -0,0 +1,310 @@ +//:://///////////////////////////////////////////// +//:: Name ar_def_spawnbuff +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Auto-Buff On Spawn script + + + 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// +//:: Modified By: DM Heatstroke +//:: Modified On: 1-24-11 +//::////////////////////////////////////////////// + +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" + +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + 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); + } + +//:: 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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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 nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR"); + if (nGlow == 1) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + //modify to try fix on Various Aura effects. + //NC:EDIT +/* int nAtropal = GetTag(OBJECT_SELF)=="ATROPAL001" ? TRUE : FALSE; + if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF); + int nNWalker = GetTag(OBJECT_SELF)=="Nightwalker" ? TRUE : FALSE; + if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nNCrawler = GetTag(OBJECT_SELF)=="Nightcrawler" ? TRUE : FALSE; + if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nVoidWraith = GetTag(OBJECT_SELF)=="Voidwraith" ? TRUE : FALSE; + if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF); + int AtropalScion = GetTag(OBJECT_SELF)=="AtropalScion" ? TRUE : FALSE; + if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF); + int nGhast = GetTag(OBJECT_SELF)=="GHAST001" ? TRUE : FALSE; + if(nGhast)ExecuteScript("ghast_stench",OBJECT_SELF); */ + + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + ms_Nomenclature(OBJECT_SELF); + +} diff --git a/nwnds_module/ar_defiler_001.utc b/nwnds_module/ar_defiler_001.utc new file mode 100644 index 000000000..2a61d4227 Binary files /dev/null and b/nwnds_module/ar_defiler_001.utc differ diff --git a/nwnds_module/ar_defiler_002.utc b/nwnds_module/ar_defiler_002.utc new file mode 100644 index 000000000..cd0eeb5a1 Binary files /dev/null and b/nwnds_module/ar_defiler_002.utc differ diff --git a/nwnds_module/ar_defiler_003.utc b/nwnds_module/ar_defiler_003.utc new file mode 100644 index 000000000..353428be5 Binary files /dev/null and b/nwnds_module/ar_defiler_003.utc differ diff --git a/nwnds_module/ar_defiler_prc.utc b/nwnds_module/ar_defiler_prc.utc new file mode 100644 index 000000000..689975ff1 Binary files /dev/null and b/nwnds_module/ar_defiler_prc.utc differ diff --git a/nwnds_module/ar_desmast_001.utc b/nwnds_module/ar_desmast_001.utc new file mode 100644 index 000000000..ddd89195d Binary files /dev/null and b/nwnds_module/ar_desmast_001.utc differ diff --git a/nwnds_module/ar_dg_jump2bcave.ncs b/nwnds_module/ar_dg_jump2bcave.ncs new file mode 100644 index 000000000..81f654931 Binary files /dev/null and b/nwnds_module/ar_dg_jump2bcave.ncs differ diff --git a/nwnds_module/ar_dg_jump2bcave.nss b/nwnds_module/ar_dg_jump2bcave.nss new file mode 100644 index 000000000..957cc3399 --- /dev/null +++ b/nwnds_module/ar_dg_jump2bcave.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2bcave +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_BELGOISTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2gcave.ncs b/nwnds_module/ar_dg_jump2gcave.ncs new file mode 100644 index 000000000..4da738be0 Binary files /dev/null and b/nwnds_module/ar_dg_jump2gcave.ncs differ diff --git a/nwnds_module/ar_dg_jump2gcave.nss b/nwnds_module/ar_dg_jump2gcave.nss new file mode 100644 index 000000000..e06adc48a --- /dev/null +++ b/nwnds_module/ar_dg_jump2gcave.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2gcave +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_GITHSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2icell.ncs b/nwnds_module/ar_dg_jump2icell.ncs new file mode 100644 index 000000000..fb522da97 Binary files /dev/null and b/nwnds_module/ar_dg_jump2icell.ncs differ diff --git a/nwnds_module/ar_dg_jump2icell.nss b/nwnds_module/ar_dg_jump2icell.nss new file mode 100644 index 000000000..97e3c6aa2 --- /dev/null +++ b/nwnds_module/ar_dg_jump2icell.nss @@ -0,0 +1,50 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2icell +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_ILLITHIDSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); +AdjustReputation(oPC, GetObjectByTag("FACTION_ATHAS_ILLITHID"), 99); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2maso.ncs b/nwnds_module/ar_dg_jump2maso.ncs new file mode 100644 index 000000000..1a87e1784 Binary files /dev/null and b/nwnds_module/ar_dg_jump2maso.ncs differ diff --git a/nwnds_module/ar_dg_jump2maso.nss b/nwnds_module/ar_dg_jump2maso.nss new file mode 100644 index 000000000..0f3a4ef1c --- /dev/null +++ b/nwnds_module/ar_dg_jump2maso.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2maso +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_UNDEADSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2tari.ncs b/nwnds_module/ar_dg_jump2tari.ncs new file mode 100644 index 000000000..ec1937bfd Binary files /dev/null and b/nwnds_module/ar_dg_jump2tari.ncs differ diff --git a/nwnds_module/ar_dg_jump2tari.nss b/nwnds_module/ar_dg_jump2tari.nss new file mode 100644 index 000000000..c6d525729 --- /dev/null +++ b/nwnds_module/ar_dg_jump2tari.nss @@ -0,0 +1,59 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2tari +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(DS_START_WP_TARISTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +// Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + +// Abort if the PC has the item "Language - Tari". + if ( GetItemPossessedBy(oPC, "hlslang_2") != OBJECT_INVALID ) + return; + +// Give "Language - Tari" to the PC. + CreateItemOnObject("hlslang_2", oPC); +} + diff --git a/nwnds_module/ar_dg_jump2thrax.ncs b/nwnds_module/ar_dg_jump2thrax.ncs new file mode 100644 index 000000000..17295ca8c Binary files /dev/null and b/nwnds_module/ar_dg_jump2thrax.ncs differ diff --git a/nwnds_module/ar_dg_jump2thrax.nss b/nwnds_module/ar_dg_jump2thrax.nss new file mode 100644 index 000000000..d5c44bff4 --- /dev/null +++ b/nwnds_module/ar_dg_jump2thrax.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2thrax +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_THRAXSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2wdune.ncs b/nwnds_module/ar_dg_jump2wdune.ncs new file mode 100644 index 000000000..7fce58bf9 Binary files /dev/null and b/nwnds_module/ar_dg_jump2wdune.ncs differ diff --git a/nwnds_module/ar_dg_jump2wdune.nss b/nwnds_module/ar_dg_jump2wdune.nss new file mode 100644 index 000000000..c3db26728 --- /dev/null +++ b/nwnds_module/ar_dg_jump2wdune.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2wdune +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_REGGELIDSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jump2yden.ncs b/nwnds_module/ar_dg_jump2yden.ncs new file mode 100644 index 000000000..823186e8c Binary files /dev/null and b/nwnds_module/ar_dg_jump2yden.ncs differ diff --git a/nwnds_module/ar_dg_jump2yden.nss b/nwnds_module/ar_dg_jump2yden.nss new file mode 100644 index 000000000..d56ae737f --- /dev/null +++ b/nwnds_module/ar_dg_jump2yden.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jump2yden +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_YUANTISTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jumptokled.ncs b/nwnds_module/ar_dg_jumptokled.ncs new file mode 100644 index 000000000..2e215cb13 Binary files /dev/null and b/nwnds_module/ar_dg_jumptokled.ncs differ diff --git a/nwnds_module/ar_dg_jumptokled.nss b/nwnds_module/ar_dg_jumptokled.nss new file mode 100644 index 000000000..ea8171d9c --- /dev/null +++ b/nwnds_module/ar_dg_jumptokled.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jumptokled +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_KLEDSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jumptotyr.ncs b/nwnds_module/ar_dg_jumptotyr.ncs new file mode 100644 index 000000000..7ec4bf1e1 Binary files /dev/null and b/nwnds_module/ar_dg_jumptotyr.ncs differ diff --git a/nwnds_module/ar_dg_jumptotyr.nss b/nwnds_module/ar_dg_jumptotyr.nss new file mode 100644 index 000000000..ee148d98a --- /dev/null +++ b/nwnds_module/ar_dg_jumptotyr.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jumptotyr +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_TYRSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_dg_jumptourik.ncs b/nwnds_module/ar_dg_jumptourik.ncs new file mode 100644 index 000000000..dbdb9ac2a Binary files /dev/null and b/nwnds_module/ar_dg_jumptourik.ncs differ diff --git a/nwnds_module/ar_dg_jumptourik.nss b/nwnds_module/ar_dg_jumptourik.nss new file mode 100644 index 000000000..d8268261d --- /dev/null +++ b/nwnds_module/ar_dg_jumptourik.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: FileName ar_dlg_jumptourik +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 6/11/2007 8:05:26 PM +//::///////////////////////////////////////////// +//Put this on action taken in the conversation editor +#include "ar_inc_pcspawn" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; + +//set location of start point here + +oTarget = GetWaypointByTag(AR_START_WP_URIKSTART); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/ar_diremaces.utm b/nwnds_module/ar_diremaces.utm new file mode 100644 index 000000000..975e1db00 Binary files /dev/null and b/nwnds_module/ar_diremaces.utm differ diff --git a/nwnds_module/ar_door_001.utd b/nwnds_module/ar_door_001.utd new file mode 100644 index 000000000..6e357f350 Binary files /dev/null and b/nwnds_module/ar_door_001.utd differ diff --git a/nwnds_module/ar_door_002.utd b/nwnds_module/ar_door_002.utd new file mode 100644 index 000000000..52e9add04 Binary files /dev/null and b/nwnds_module/ar_door_002.utd differ diff --git a/nwnds_module/ar_door_003.utd b/nwnds_module/ar_door_003.utd new file mode 100644 index 000000000..612b92ed9 Binary files /dev/null and b/nwnds_module/ar_door_003.utd differ diff --git a/nwnds_module/ar_door_004.utd b/nwnds_module/ar_door_004.utd new file mode 100644 index 000000000..700d09243 Binary files /dev/null and b/nwnds_module/ar_door_004.utd differ diff --git a/nwnds_module/ar_door_005.utd b/nwnds_module/ar_door_005.utd new file mode 100644 index 000000000..831bc1a4e Binary files /dev/null and b/nwnds_module/ar_door_005.utd differ diff --git a/nwnds_module/ar_dragonne001.utc b/nwnds_module/ar_dragonne001.utc new file mode 100644 index 000000000..bfde09c7f Binary files /dev/null and b/nwnds_module/ar_dragonne001.utc differ diff --git a/nwnds_module/ar_dragonne002.utc b/nwnds_module/ar_dragonne002.utc new file mode 100644 index 000000000..12e6d31be Binary files /dev/null and b/nwnds_module/ar_dragonne002.utc differ diff --git a/nwnds_module/ar_dragonspaws.utm b/nwnds_module/ar_dragonspaws.utm new file mode 100644 index 000000000..44798bf0d Binary files /dev/null and b/nwnds_module/ar_dragonspaws.utm differ diff --git a/nwnds_module/ar_drakehide.utm b/nwnds_module/ar_drakehide.utm new file mode 100644 index 000000000..b98df46a7 Binary files /dev/null and b/nwnds_module/ar_drakehide.utm differ diff --git a/nwnds_module/ar_eagle001.utc b/nwnds_module/ar_eagle001.utc new file mode 100644 index 000000000..1f5f3faba Binary files /dev/null and b/nwnds_module/ar_eagle001.utc differ diff --git a/nwnds_module/ar_ebonsent001.utc b/nwnds_module/ar_ebonsent001.utc new file mode 100644 index 000000000..b5d1877ac Binary files /dev/null and b/nwnds_module/ar_ebonsent001.utc differ diff --git a/nwnds_module/ar_elinik.utc b/nwnds_module/ar_elinik.utc new file mode 100644 index 000000000..5adff2cae Binary files /dev/null and b/nwnds_module/ar_elinik.utc differ diff --git a/nwnds_module/ar_elvawen_001.utc b/nwnds_module/ar_elvawen_001.utc new file mode 100644 index 000000000..1f74c95f6 Binary files /dev/null and b/nwnds_module/ar_elvawen_001.utc differ diff --git a/nwnds_module/ar_ethfilcher001.utc b/nwnds_module/ar_ethfilcher001.utc new file mode 100644 index 000000000..5ab1b613f Binary files /dev/null and b/nwnds_module/ar_ethfilcher001.utc differ diff --git a/nwnds_module/ar_ethfilcher002.utc b/nwnds_module/ar_ethfilcher002.utc new file mode 100644 index 000000000..6298022a4 Binary files /dev/null and b/nwnds_module/ar_ethfilcher002.utc differ diff --git a/nwnds_module/ar_ettercap001.utc b/nwnds_module/ar_ettercap001.utc new file mode 100644 index 000000000..bddb6f7fb Binary files /dev/null and b/nwnds_module/ar_ettercap001.utc differ diff --git a/nwnds_module/ar_ettin001.utc b/nwnds_module/ar_ettin001.utc new file mode 100644 index 000000000..5142b0027 Binary files /dev/null and b/nwnds_module/ar_ettin001.utc differ diff --git a/nwnds_module/ar_farrauk.utc b/nwnds_module/ar_farrauk.utc new file mode 100644 index 000000000..b7f87efaa Binary files /dev/null and b/nwnds_module/ar_farrauk.utc differ diff --git a/nwnds_module/ar_fashion.utm b/nwnds_module/ar_fashion.utm new file mode 100644 index 000000000..b84ffd65b Binary files /dev/null and b/nwnds_module/ar_fashion.utm differ diff --git a/nwnds_module/ar_firebat001.utc b/nwnds_module/ar_firebat001.utc new file mode 100644 index 000000000..b3a6f0e51 Binary files /dev/null and b/nwnds_module/ar_firebat001.utc differ diff --git a/nwnds_module/ar_firenymph001.utc b/nwnds_module/ar_firenymph001.utc new file mode 100644 index 000000000..310783576 Binary files /dev/null and b/nwnds_module/ar_firenymph001.utc differ diff --git a/nwnds_module/ar_flamsnake_001.utc b/nwnds_module/ar_flamsnake_001.utc new file mode 100644 index 000000000..431a86cce Binary files /dev/null and b/nwnds_module/ar_flamsnake_001.utc differ diff --git a/nwnds_module/ar_flamsnake_002.utc b/nwnds_module/ar_flamsnake_002.utc new file mode 100644 index 000000000..6dca93c52 Binary files /dev/null and b/nwnds_module/ar_flamsnake_002.utc differ diff --git a/nwnds_module/ar_flamsnake_003.utc b/nwnds_module/ar_flamsnake_003.utc new file mode 100644 index 000000000..5aee5e86a Binary files /dev/null and b/nwnds_module/ar_flamsnake_003.utc differ diff --git a/nwnds_module/ar_gangleader001.utc b/nwnds_module/ar_gangleader001.utc new file mode 100644 index 000000000..3bcc3f61b Binary files /dev/null and b/nwnds_module/ar_gangleader001.utc differ diff --git a/nwnds_module/ar_gems.utm b/nwnds_module/ar_gems.utm new file mode 100644 index 000000000..7b7a906ce Binary files /dev/null and b/nwnds_module/ar_gems.utm differ diff --git a/nwnds_module/ar_gianttick001.utc b/nwnds_module/ar_gianttick001.utc new file mode 100644 index 000000000..0ae33465b Binary files /dev/null and b/nwnds_module/ar_gianttick001.utc differ diff --git a/nwnds_module/ar_gith_001.utc b/nwnds_module/ar_gith_001.utc new file mode 100644 index 000000000..a6cb44583 Binary files /dev/null and b/nwnds_module/ar_gith_001.utc differ diff --git a/nwnds_module/ar_gith_002.utc b/nwnds_module/ar_gith_002.utc new file mode 100644 index 000000000..78305bacb Binary files /dev/null and b/nwnds_module/ar_gith_002.utc differ diff --git a/nwnds_module/ar_gith_003.utc b/nwnds_module/ar_gith_003.utc new file mode 100644 index 000000000..62924a89d Binary files /dev/null and b/nwnds_module/ar_gith_003.utc differ diff --git a/nwnds_module/ar_gith_004.utc b/nwnds_module/ar_gith_004.utc new file mode 100644 index 000000000..faf6066ed Binary files /dev/null and b/nwnds_module/ar_gith_004.utc differ diff --git a/nwnds_module/ar_gith_005.utc b/nwnds_module/ar_gith_005.utc new file mode 100644 index 000000000..965910af3 Binary files /dev/null and b/nwnds_module/ar_gith_005.utc differ diff --git a/nwnds_module/ar_gith_006.utc b/nwnds_module/ar_gith_006.utc new file mode 100644 index 000000000..96dcf5096 Binary files /dev/null and b/nwnds_module/ar_gith_006.utc differ diff --git a/nwnds_module/ar_gith_007.utc b/nwnds_module/ar_gith_007.utc new file mode 100644 index 000000000..6fb9cb75a Binary files /dev/null and b/nwnds_module/ar_gith_007.utc differ diff --git a/nwnds_module/ar_gith_008.utc b/nwnds_module/ar_gith_008.utc new file mode 100644 index 000000000..36a1ad4af Binary files /dev/null and b/nwnds_module/ar_gith_008.utc differ diff --git a/nwnds_module/ar_gloves.utm b/nwnds_module/ar_gloves.utm new file mode 100644 index 000000000..abb32d709 Binary files /dev/null and b/nwnds_module/ar_gloves.utm differ diff --git a/nwnds_module/ar_goodtari_001.utc b/nwnds_module/ar_goodtari_001.utc new file mode 100644 index 000000000..25aa15795 Binary files /dev/null and b/nwnds_module/ar_goodtari_001.utc differ diff --git a/nwnds_module/ar_goodtari_002.utc b/nwnds_module/ar_goodtari_002.utc new file mode 100644 index 000000000..cf872aae9 Binary files /dev/null and b/nwnds_module/ar_goodtari_002.utc differ diff --git a/nwnds_module/ar_goodtari_003.utc b/nwnds_module/ar_goodtari_003.utc new file mode 100644 index 000000000..4f3b0ea5a Binary files /dev/null and b/nwnds_module/ar_goodtari_003.utc differ diff --git a/nwnds_module/ar_goodtari_004.utc b/nwnds_module/ar_goodtari_004.utc new file mode 100644 index 000000000..acfe18a6f Binary files /dev/null and b/nwnds_module/ar_goodtari_004.utc differ diff --git a/nwnds_module/ar_goodtari_005.utc b/nwnds_module/ar_goodtari_005.utc new file mode 100644 index 000000000..9ad24d826 Binary files /dev/null and b/nwnds_module/ar_goodtari_005.utc differ diff --git a/nwnds_module/ar_goodtari_006.utc b/nwnds_module/ar_goodtari_006.utc new file mode 100644 index 000000000..5715d8388 Binary files /dev/null and b/nwnds_module/ar_goodtari_006.utc differ diff --git a/nwnds_module/ar_goodtari_007.utc b/nwnds_module/ar_goodtari_007.utc new file mode 100644 index 000000000..a8cc523d6 Binary files /dev/null and b/nwnds_module/ar_goodtari_007.utc differ diff --git a/nwnds_module/ar_greataxes.utm b/nwnds_module/ar_greataxes.utm new file mode 100644 index 000000000..6a9a9896f Binary files /dev/null and b/nwnds_module/ar_greataxes.utm differ diff --git a/nwnds_module/ar_greatswords.utm b/nwnds_module/ar_greatswords.utm new file mode 100644 index 000000000..2193d6cd9 Binary files /dev/null and b/nwnds_module/ar_greatswords.utm differ diff --git a/nwnds_module/ar_grignar.utc b/nwnds_module/ar_grignar.utc new file mode 100644 index 000000000..cdb21b5b9 Binary files /dev/null and b/nwnds_module/ar_grignar.utc differ diff --git a/nwnds_module/ar_guardspawn.ncs b/nwnds_module/ar_guardspawn.ncs new file mode 100644 index 000000000..3030bef75 Binary files /dev/null and b/nwnds_module/ar_guardspawn.ncs differ diff --git a/nwnds_module/ar_guardspawn.nss b/nwnds_module/ar_guardspawn.nss new file mode 100644 index 000000000..3749e1419 --- /dev/null +++ b/nwnds_module/ar_guardspawn.nss @@ -0,0 +1,113 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 2003-07-28: Georg Zoeller: + + If you set a integer 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "ms_name_inc" +#include "x2_inc_switches" +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + /* 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 nSkinColor; + nSkinColor = Random(20); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + int nHeadchance; + nHeadchance = Random(2); + nHeadNumber = Random(5)+166; + if ( + (nKeephead != 1) && (nHeadchance != 1) + ) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + DelayCommand(1.0f, ms_Nomenclature(OBJECT_SELF)); +} diff --git a/nwnds_module/ar_gulgslaver002.utc b/nwnds_module/ar_gulgslaver002.utc new file mode 100644 index 000000000..d601200a3 Binary files /dev/null and b/nwnds_module/ar_gulgslaver002.utc differ diff --git a/nwnds_module/ar_gulgslaver003.utc b/nwnds_module/ar_gulgslaver003.utc new file mode 100644 index 000000000..c574c79ce Binary files /dev/null and b/nwnds_module/ar_gulgslaver003.utc differ diff --git a/nwnds_module/ar_gulgslaver004.utc b/nwnds_module/ar_gulgslaver004.utc new file mode 100644 index 000000000..3c089eb5d Binary files /dev/null and b/nwnds_module/ar_gulgslaver004.utc differ diff --git a/nwnds_module/ar_half_wtr_hide.uti b/nwnds_module/ar_half_wtr_hide.uti new file mode 100644 index 000000000..f99cd09bd Binary files /dev/null and b/nwnds_module/ar_half_wtr_hide.uti differ diff --git a/nwnds_module/ar_handaxes.utm b/nwnds_module/ar_handaxes.utm new file mode 100644 index 000000000..8ac1ff26c Binary files /dev/null and b/nwnds_module/ar_handaxes.utm differ diff --git a/nwnds_module/ar_hawk001.utc b/nwnds_module/ar_hawk001.utc new file mode 100644 index 000000000..ecd416a92 Binary files /dev/null and b/nwnds_module/ar_hawk001.utc differ diff --git a/nwnds_module/ar_hawk002.utc b/nwnds_module/ar_hawk002.utc new file mode 100644 index 000000000..c3b55bcac Binary files /dev/null and b/nwnds_module/ar_hawk002.utc differ diff --git a/nwnds_module/ar_haybale_001.utp b/nwnds_module/ar_haybale_001.utp new file mode 100644 index 000000000..e135c9aa2 Binary files /dev/null and b/nwnds_module/ar_haybale_001.utp differ diff --git a/nwnds_module/ar_heavyarmor.utm b/nwnds_module/ar_heavyarmor.utm new file mode 100644 index 000000000..a06e0114e Binary files /dev/null and b/nwnds_module/ar_heavyarmor.utm differ diff --git a/nwnds_module/ar_heavyflails.utm b/nwnds_module/ar_heavyflails.utm new file mode 100644 index 000000000..633577c3e Binary files /dev/null and b/nwnds_module/ar_heavyflails.utm differ diff --git a/nwnds_module/ar_heavypicks.utm b/nwnds_module/ar_heavypicks.utm new file mode 100644 index 000000000..a3400ba05 Binary files /dev/null and b/nwnds_module/ar_heavypicks.utm differ diff --git a/nwnds_module/ar_heavyxbows.utm b/nwnds_module/ar_heavyxbows.utm new file mode 100644 index 000000000..92aca7605 Binary files /dev/null and b/nwnds_module/ar_heavyxbows.utm differ diff --git a/nwnds_module/ar_hellhound001.utc b/nwnds_module/ar_hellhound001.utc new file mode 100644 index 000000000..c3f4a1ceb Binary files /dev/null and b/nwnds_module/ar_hellhound001.utc differ diff --git a/nwnds_module/ar_helm_acid01.uti b/nwnds_module/ar_helm_acid01.uti new file mode 100644 index 000000000..225973a94 Binary files /dev/null and b/nwnds_module/ar_helm_acid01.uti differ diff --git a/nwnds_module/ar_helm_alloy.uti b/nwnds_module/ar_helm_alloy.uti new file mode 100644 index 000000000..ed7cf978b Binary files /dev/null and b/nwnds_module/ar_helm_alloy.uti differ diff --git a/nwnds_module/ar_helm_allsoul0.uti b/nwnds_module/ar_helm_allsoul0.uti new file mode 100644 index 000000000..b00fc597e Binary files /dev/null and b/nwnds_module/ar_helm_allsoul0.uti differ diff --git a/nwnds_module/ar_helm_allsoul1.uti b/nwnds_module/ar_helm_allsoul1.uti new file mode 100644 index 000000000..173acfbde Binary files /dev/null and b/nwnds_module/ar_helm_allsoul1.uti differ diff --git a/nwnds_module/ar_helm_allsoul2.uti b/nwnds_module/ar_helm_allsoul2.uti new file mode 100644 index 000000000..bc2dd1c37 Binary files /dev/null and b/nwnds_module/ar_helm_allsoul2.uti differ diff --git a/nwnds_module/ar_helm_allsoul3.uti b/nwnds_module/ar_helm_allsoul3.uti new file mode 100644 index 000000000..c7d0360fa Binary files /dev/null and b/nwnds_module/ar_helm_allsoul3.uti differ diff --git a/nwnds_module/ar_helm_allsoul4.uti b/nwnds_module/ar_helm_allsoul4.uti new file mode 100644 index 000000000..3a908f1ab Binary files /dev/null and b/nwnds_module/ar_helm_allsoul4.uti differ diff --git a/nwnds_module/ar_helm_allsoul5.uti b/nwnds_module/ar_helm_allsoul5.uti new file mode 100644 index 000000000..a1c1719ae Binary files /dev/null and b/nwnds_module/ar_helm_allsoul5.uti differ diff --git a/nwnds_module/ar_helm_allsoul6.uti b/nwnds_module/ar_helm_allsoul6.uti new file mode 100644 index 000000000..de7a6c758 Binary files /dev/null and b/nwnds_module/ar_helm_allsoul6.uti differ diff --git a/nwnds_module/ar_helm_allsoul7.uti b/nwnds_module/ar_helm_allsoul7.uti new file mode 100644 index 000000000..1b1c9c967 Binary files /dev/null and b/nwnds_module/ar_helm_allsoul7.uti differ diff --git a/nwnds_module/ar_helm_allsoul8.uti b/nwnds_module/ar_helm_allsoul8.uti new file mode 100644 index 000000000..6cb791f88 Binary files /dev/null and b/nwnds_module/ar_helm_allsoul8.uti differ diff --git a/nwnds_module/ar_helm_allsoul9.uti b/nwnds_module/ar_helm_allsoul9.uti new file mode 100644 index 000000000..80e4c2291 Binary files /dev/null and b/nwnds_module/ar_helm_allsoul9.uti differ diff --git a/nwnds_module/ar_helm_allsoula.uti b/nwnds_module/ar_helm_allsoula.uti new file mode 100644 index 000000000..3f511d73a Binary files /dev/null and b/nwnds_module/ar_helm_allsoula.uti differ diff --git a/nwnds_module/ar_helm_allsoulb.uti b/nwnds_module/ar_helm_allsoulb.uti new file mode 100644 index 000000000..e5cb71710 Binary files /dev/null and b/nwnds_module/ar_helm_allsoulb.uti differ diff --git a/nwnds_module/ar_helm_antique.uti b/nwnds_module/ar_helm_antique.uti new file mode 100644 index 000000000..30371e65d Binary files /dev/null and b/nwnds_module/ar_helm_antique.uti differ diff --git a/nwnds_module/ar_helm_black.uti b/nwnds_module/ar_helm_black.uti new file mode 100644 index 000000000..6247706c7 Binary files /dev/null and b/nwnds_module/ar_helm_black.uti differ diff --git a/nwnds_module/ar_helm_blkcrwn.uti b/nwnds_module/ar_helm_blkcrwn.uti new file mode 100644 index 000000000..f7d11e931 Binary files /dev/null and b/nwnds_module/ar_helm_blkcrwn.uti differ diff --git a/nwnds_module/ar_helm_blkhrns.uti b/nwnds_module/ar_helm_blkhrns.uti new file mode 100644 index 000000000..51e632d13 Binary files /dev/null and b/nwnds_module/ar_helm_blkhrns.uti differ diff --git a/nwnds_module/ar_helm_bone01.uti b/nwnds_module/ar_helm_bone01.uti new file mode 100644 index 000000000..0cd6ef566 Binary files /dev/null and b/nwnds_module/ar_helm_bone01.uti differ diff --git a/nwnds_module/ar_helm_ceramic.uti b/nwnds_module/ar_helm_ceramic.uti new file mode 100644 index 000000000..ce3f3d904 Binary files /dev/null and b/nwnds_module/ar_helm_ceramic.uti differ diff --git a/nwnds_module/ar_helm_darksilk.uti b/nwnds_module/ar_helm_darksilk.uti new file mode 100644 index 000000000..a8550020b Binary files /dev/null and b/nwnds_module/ar_helm_darksilk.uti differ diff --git a/nwnds_module/ar_helm_defguise.uti b/nwnds_module/ar_helm_defguise.uti new file mode 100644 index 000000000..5cc7439f8 Binary files /dev/null and b/nwnds_module/ar_helm_defguise.uti differ diff --git a/nwnds_module/ar_helm_divcasq.uti b/nwnds_module/ar_helm_divcasq.uti new file mode 100644 index 000000000..54a67c6a1 Binary files /dev/null and b/nwnds_module/ar_helm_divcasq.uti differ diff --git a/nwnds_module/ar_helm_dr_air.uti b/nwnds_module/ar_helm_dr_air.uti new file mode 100644 index 000000000..d9699527b Binary files /dev/null and b/nwnds_module/ar_helm_dr_air.uti differ diff --git a/nwnds_module/ar_helm_dr_earth.uti b/nwnds_module/ar_helm_dr_earth.uti new file mode 100644 index 000000000..10b3896ae Binary files /dev/null and b/nwnds_module/ar_helm_dr_earth.uti differ diff --git a/nwnds_module/ar_helm_dr_fire.uti b/nwnds_module/ar_helm_dr_fire.uti new file mode 100644 index 000000000..a8a7b9e4b Binary files /dev/null and b/nwnds_module/ar_helm_dr_fire.uti differ diff --git a/nwnds_module/ar_helm_dr_magma.uti b/nwnds_module/ar_helm_dr_magma.uti new file mode 100644 index 000000000..507308500 Binary files /dev/null and b/nwnds_module/ar_helm_dr_magma.uti differ diff --git a/nwnds_module/ar_helm_dr_rain.uti b/nwnds_module/ar_helm_dr_rain.uti new file mode 100644 index 000000000..e1267053f Binary files /dev/null and b/nwnds_module/ar_helm_dr_rain.uti differ diff --git a/nwnds_module/ar_helm_dr_silt.uti b/nwnds_module/ar_helm_dr_silt.uti new file mode 100644 index 000000000..6a0ea624c Binary files /dev/null and b/nwnds_module/ar_helm_dr_silt.uti differ diff --git a/nwnds_module/ar_helm_dr_sun.uti b/nwnds_module/ar_helm_dr_sun.uti new file mode 100644 index 000000000..2265c0b67 Binary files /dev/null and b/nwnds_module/ar_helm_dr_sun.uti differ diff --git a/nwnds_module/ar_helm_dr_water.uti b/nwnds_module/ar_helm_dr_water.uti new file mode 100644 index 000000000..8bb49fe46 Binary files /dev/null and b/nwnds_module/ar_helm_dr_water.uti differ diff --git a/nwnds_module/ar_helm_drakef.uti b/nwnds_module/ar_helm_drakef.uti new file mode 100644 index 000000000..e18822788 Binary files /dev/null and b/nwnds_module/ar_helm_drakef.uti differ diff --git a/nwnds_module/ar_helm_eagles.uti b/nwnds_module/ar_helm_eagles.uti new file mode 100644 index 000000000..c03f5aee4 Binary files /dev/null and b/nwnds_module/ar_helm_eagles.uti differ diff --git a/nwnds_module/ar_helm_elec01.uti b/nwnds_module/ar_helm_elec01.uti new file mode 100644 index 000000000..5d4e56698 Binary files /dev/null and b/nwnds_module/ar_helm_elec01.uti differ diff --git a/nwnds_module/ar_helm_eyes.uti b/nwnds_module/ar_helm_eyes.uti new file mode 100644 index 000000000..8f424d852 Binary files /dev/null and b/nwnds_module/ar_helm_eyes.uti differ diff --git a/nwnds_module/ar_helm_fire01.uti b/nwnds_module/ar_helm_fire01.uti new file mode 100644 index 000000000..434301542 Binary files /dev/null and b/nwnds_module/ar_helm_fire01.uti differ diff --git a/nwnds_module/ar_helm_forsee.uti b/nwnds_module/ar_helm_forsee.uti new file mode 100644 index 000000000..e5281e9af Binary files /dev/null and b/nwnds_module/ar_helm_forsee.uti differ diff --git a/nwnds_module/ar_helm_fortific.uti b/nwnds_module/ar_helm_fortific.uti new file mode 100644 index 000000000..a348870c0 Binary files /dev/null and b/nwnds_module/ar_helm_fortific.uti differ diff --git a/nwnds_module/ar_helm_golas.uti b/nwnds_module/ar_helm_golas.uti new file mode 100644 index 000000000..74229ca21 Binary files /dev/null and b/nwnds_module/ar_helm_golas.uti differ diff --git a/nwnds_module/ar_helm_gorgoth.ncs b/nwnds_module/ar_helm_gorgoth.ncs new file mode 100644 index 000000000..dce837cc6 Binary files /dev/null and b/nwnds_module/ar_helm_gorgoth.ncs differ diff --git a/nwnds_module/ar_helm_gorgoth.nss b/nwnds_module/ar_helm_gorgoth.nss new file mode 100644 index 000000000..c532527af --- /dev/null +++ b/nwnds_module/ar_helm_gorgoth.nss @@ -0,0 +1,26 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a Fighter or are a Druid or a Villichi, unequip the item + if((GetLevelByClass(CLASS_TYPE_FIGHTER, oPC) <= 0) || + (GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 1) || + (GetStringLowerCase(GetSubRace(oPC)) == "villichi")) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_helm_gorgoth.uti b/nwnds_module/ar_helm_gorgoth.uti new file mode 100644 index 000000000..2357e1ade Binary files /dev/null and b/nwnds_module/ar_helm_gorgoth.uti differ diff --git a/nwnds_module/ar_helm_husil.uti b/nwnds_module/ar_helm_husil.uti new file mode 100644 index 000000000..38d04e486 Binary files /dev/null and b/nwnds_module/ar_helm_husil.uti differ diff --git a/nwnds_module/ar_helm_ice01.uti b/nwnds_module/ar_helm_ice01.uti new file mode 100644 index 000000000..388f13a6a Binary files /dev/null and b/nwnds_module/ar_helm_ice01.uti differ diff --git a/nwnds_module/ar_helm_imbued.uti b/nwnds_module/ar_helm_imbued.uti new file mode 100644 index 000000000..ccbebb9dd Binary files /dev/null and b/nwnds_module/ar_helm_imbued.uti differ diff --git a/nwnds_module/ar_helm_iron01.uti b/nwnds_module/ar_helm_iron01.uti new file mode 100644 index 000000000..5909b5c65 Binary files /dev/null and b/nwnds_module/ar_helm_iron01.uti differ diff --git a/nwnds_module/ar_helm_ivory.uti b/nwnds_module/ar_helm_ivory.uti new file mode 100644 index 000000000..991be555c Binary files /dev/null and b/nwnds_module/ar_helm_ivory.uti differ diff --git a/nwnds_module/ar_helm_jandora.uti b/nwnds_module/ar_helm_jandora.uti new file mode 100644 index 000000000..59a58cda2 Binary files /dev/null and b/nwnds_module/ar_helm_jandora.uti differ diff --git a/nwnds_module/ar_helm_kankshll.uti b/nwnds_module/ar_helm_kankshll.uti new file mode 100644 index 000000000..0b80ad3e7 Binary files /dev/null and b/nwnds_module/ar_helm_kankshll.uti differ diff --git a/nwnds_module/ar_helm_kirtak.ncs b/nwnds_module/ar_helm_kirtak.ncs new file mode 100644 index 000000000..5c03f841b Binary files /dev/null and b/nwnds_module/ar_helm_kirtak.ncs differ diff --git a/nwnds_module/ar_helm_kirtak.nss b/nwnds_module/ar_helm_kirtak.nss new file mode 100644 index 000000000..750ebcf4b --- /dev/null +++ b/nwnds_module/ar_helm_kirtak.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 20th level druid, unequip the item + if(GetLevelByClass(CLASS_TYPE_DRUID, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_helm_kirtak.uti b/nwnds_module/ar_helm_kirtak.uti new file mode 100644 index 000000000..fcd274e30 Binary files /dev/null and b/nwnds_module/ar_helm_kirtak.uti differ diff --git a/nwnds_module/ar_helm_lestons.uti b/nwnds_module/ar_helm_lestons.uti new file mode 100644 index 000000000..0651cd4ec Binary files /dev/null and b/nwnds_module/ar_helm_lestons.uti differ diff --git a/nwnds_module/ar_helm_maglens.uti b/nwnds_module/ar_helm_maglens.uti new file mode 100644 index 000000000..af2e589cf Binary files /dev/null and b/nwnds_module/ar_helm_maglens.uti differ diff --git a/nwnds_module/ar_helm_maskpain.uti b/nwnds_module/ar_helm_maskpain.uti new file mode 100644 index 000000000..57b850290 Binary files /dev/null and b/nwnds_module/ar_helm_maskpain.uti differ diff --git a/nwnds_module/ar_helm_mekillot.uti b/nwnds_module/ar_helm_mekillot.uti new file mode 100644 index 000000000..f9935f9d0 Binary files /dev/null and b/nwnds_module/ar_helm_mekillot.uti differ diff --git a/nwnds_module/ar_helm_meteorfg.uti b/nwnds_module/ar_helm_meteorfg.uti new file mode 100644 index 000000000..e1e7a315b Binary files /dev/null and b/nwnds_module/ar_helm_meteorfg.uti differ diff --git a/nwnds_module/ar_helm_mind.uti b/nwnds_module/ar_helm_mind.uti new file mode 100644 index 000000000..2c47e483f Binary files /dev/null and b/nwnds_module/ar_helm_mind.uti differ diff --git a/nwnds_module/ar_helm_nature.uti b/nwnds_module/ar_helm_nature.uti new file mode 100644 index 000000000..23773637c Binary files /dev/null and b/nwnds_module/ar_helm_nature.uti differ diff --git a/nwnds_module/ar_helm_nevas.uti b/nwnds_module/ar_helm_nevas.uti new file mode 100644 index 000000000..c382e436c Binary files /dev/null and b/nwnds_module/ar_helm_nevas.uti differ diff --git a/nwnds_module/ar_helm_obsflame.uti b/nwnds_module/ar_helm_obsflame.uti new file mode 100644 index 000000000..5c081ce4b Binary files /dev/null and b/nwnds_module/ar_helm_obsflame.uti differ diff --git a/nwnds_module/ar_helm_onyxsent.uti b/nwnds_module/ar_helm_onyxsent.uti new file mode 100644 index 000000000..f2830a663 Binary files /dev/null and b/nwnds_module/ar_helm_onyxsent.uti differ diff --git a/nwnds_module/ar_helm_phandara.uti b/nwnds_module/ar_helm_phandara.uti new file mode 100644 index 000000000..5c5aa9af1 Binary files /dev/null and b/nwnds_module/ar_helm_phandara.uti differ diff --git a/nwnds_module/ar_helm_sanshir.uti b/nwnds_module/ar_helm_sanshir.uti new file mode 100644 index 000000000..617861bb4 Binary files /dev/null and b/nwnds_module/ar_helm_sanshir.uti differ diff --git a/nwnds_module/ar_helm_scholar.uti b/nwnds_module/ar_helm_scholar.uti new file mode 100644 index 000000000..56e82741d Binary files /dev/null and b/nwnds_module/ar_helm_scholar.uti differ diff --git a/nwnds_module/ar_helm_skyros.uti b/nwnds_module/ar_helm_skyros.uti new file mode 100644 index 000000000..5eac24478 Binary files /dev/null and b/nwnds_module/ar_helm_skyros.uti differ diff --git a/nwnds_module/ar_helm_spelunk.uti b/nwnds_module/ar_helm_spelunk.uti new file mode 100644 index 000000000..844ab04b8 Binary files /dev/null and b/nwnds_module/ar_helm_spelunk.uti differ diff --git a/nwnds_module/ar_helm_urikhg.uti b/nwnds_module/ar_helm_urikhg.uti new file mode 100644 index 000000000..aad06ffa7 Binary files /dev/null and b/nwnds_module/ar_helm_urikhg.uti differ diff --git a/nwnds_module/ar_helm_urikhg2.uti b/nwnds_module/ar_helm_urikhg2.uti new file mode 100644 index 000000000..d110e6ea5 Binary files /dev/null and b/nwnds_module/ar_helm_urikhg2.uti differ diff --git a/nwnds_module/ar_helms.utm b/nwnds_module/ar_helms.utm new file mode 100644 index 000000000..bf56c76be Binary files /dev/null and b/nwnds_module/ar_helms.utm differ diff --git a/nwnds_module/ar_i0_startport.ncs b/nwnds_module/ar_i0_startport.ncs new file mode 100644 index 000000000..7078fb506 Binary files /dev/null and b/nwnds_module/ar_i0_startport.ncs differ diff --git a/nwnds_module/ar_i0_startport.nss b/nwnds_module/ar_i0_startport.nss new file mode 100644 index 000000000..bab6be084 --- /dev/null +++ b/nwnds_module/ar_i0_startport.nss @@ -0,0 +1,13 @@ +#include "nw_i0_tool" + +void main() +{ + object oUser = GetLastUsedBy(); + if (GetHitDice(oUser) <= 2) + { + RewardPartyXP(3000, oUser, FALSE); + } + + else if (GetHitDice(oUser) >= 3) + AssignCommand(OBJECT_SELF, ActionStartConversation(oUser)); +} diff --git a/nwnds_module/ar_inc_clearvar.ncs b/nwnds_module/ar_inc_clearvar.ncs new file mode 100644 index 000000000..996c6d6e3 Binary files /dev/null and b/nwnds_module/ar_inc_clearvar.ncs differ diff --git a/nwnds_module/ar_inc_clearvar.nss b/nwnds_module/ar_inc_clearvar.nss new file mode 100644 index 000000000..94e8800d7 --- /dev/null +++ b/nwnds_module/ar_inc_clearvar.nss @@ -0,0 +1,13 @@ +void main() +{ +object oPC = OBJECT_SELF; + +DeleteLocalObject(oPC, "BackLashAOE"); +DeleteLocalObject(oPC,"AR_CONSERVE_CASTER"); +DeleteLocalInt(oPC, "BackLash"); +DeleteLocalInt(oPC, "BackLashDice"); +DeleteLocalInt(oPC,"AR_CONSERVE"); +DeleteLocalInt(oPC,"AR_CONSERVE_DC"); +DeleteLocalInt(oPC,"TaintedAuraActive"); + +} diff --git a/nwnds_module/ar_inc_colortxt.nss b/nwnds_module/ar_inc_colortxt.nss new file mode 100644 index 000000000..88508575f --- /dev/null +++ b/nwnds_module/ar_inc_colortxt.nss @@ -0,0 +1,137 @@ +// Sends a message to all PCs and DMs +// colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white" +// You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToAll(string color, string message); +// Sends a message to all players and dms +void ToAll(string message); +// oArea is the area you want the message to go to +// SendDMs TRUE if you want all DMS to receive this message +// FALSE if you just want players +// Sends a message to all players in area +// colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white" +// You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToAllInArea(string color, object oArea, int SendDMs, string message); +// oArea is the area you want the message to go to +// SendDMs TRUE if you want all DMS to receive this message +// FALSE if you just want players +// Sends a message to all players in area +void ToAllInArea(object oArea, int SendDMs, string message); +// Sends a message to a PC in color +// colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white" +// You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToOne(string color, string message, object oPC); +// Wraps a rainbow string, no visable output +// alone, needs to be used with other functions +// ToAll, SendMessageToPC, etc. Do not use with a color +// function, it will conflict +string Rainbow(string s); +// returns a three digit string usable by other textblitz functions +string RandomColor(); +void ColorToAll(string color, string message) +{ + if (GetStringLength(color) == 3) + { + ToAll("" + message + ""); + return; + } + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + ToAll("" + message + ""); +} +void ToAll(string message) +{ + SendMessageToAllDMs(message); + object oPC = GetFirstPC(); + while(oPC != OBJECT_INVALID) + { + SendMessageToPC(oPC, message); + oPC = GetNextPC(); + } +} +void ToAllInArea(object oArea, int SendDMs, string message) +{ + object oPC = GetFirstObjectInArea(oArea); + while(oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC)) SendMessageToPC(oPC, message); + if (GetIsDM(oPC) && SendDMs) SendMessageToPC(oPC, message); + oPC = GetNextObjectInArea(oArea); + } +} +void ColorToAllInArea(string color, object oArea, int SendDMs, string message) +{ + if (GetStringLength(color) == 3) + { + ToAllInArea(oArea, SendDMs, "" + message + ""); + return; + } + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + ToAllInArea(oArea, SendDMs, "" + message + ""); +} +void ColorToOne(string color, string message, object oPC) +{ + if (GetStringLength(color) == 3) + { + SendMessageToPC(oPC, "" + message + ""); + return; + } + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + SendMessageToPC(oPC, "" + message + ""); +} +// returns a three digit string usable by other textblitz functions +string RandomColor() +{ + string x = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ"; + string c1 = ""; + string c2 = ""; + string c3 = ""; + while (c1 == "") c1 = GetSubString(x, Random(251), 1); + while (c2 == "") c2 = GetSubString(x, Random(251), 1); + while (c3 == "") c3 = GetSubString(x, Random(251), 1); + return c1 + c2 + c3; +} +string Rainbow(string s) +{ + int max = GetStringLength(s); + int i = 0; + string final = ""; + while(i < max) + { + final += "" + GetSubString(s, i, 1) + ""; + i += 1; + } + return final; +} + diff --git a/nwnds_module/ar_inc_defraze.ncs b/nwnds_module/ar_inc_defraze.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ar_inc_defraze.ncs differ diff --git a/nwnds_module/ar_inc_defraze.nss b/nwnds_module/ar_inc_defraze.nss new file mode 100644 index 000000000..0986c43f3 --- /dev/null +++ b/nwnds_module/ar_inc_defraze.nss @@ -0,0 +1,304 @@ + //::2-15-07 +//::BUG FIX +//:: Radius was giving 10m +5m per level, fixed to give 10' + 5' per level. +//:: added checks for bigbys spells to exit if one is cast to stop. + +//change this const to the index in spells.2da of the main defiliing aura spell +const int SPELL_EFFECT_DEFAURA=99999; +const int SPELL_EFFECT_TAINTAURA=99998; +// For plant creature type +const int RACIAL_TYPE_PLANT=30; +//new visuals +const int VFX_DUR_FLAMING_SPHERE=821; +const int VFX_FNF_VAMPIRIC_DRAIN_PRC=822; +const int VFX_FNF_BLASPHEMY=823; +const int VFX_DUR_SHIELD_OF_LAW=824; +const int VFX_DUR_UNHOLY_AURA_SMP=825; +const int VFX_DUR_HOLY_AURA_SMP=826; +const int VFX_DUR_PROT_IRON_SKIN=827; +const int VFX_FNF_EARTHQUAKE_FISSURE=828; +const int VFX_FNF_ORDERS_WRATH=829; + + +//FEATS +const int DEFILING_AURA =4999; +const int PAINFUL_RAZE =5030; +const int AGONIZING_RAZE =5031; +const int EXTERMINATING_RAZE =5029; +const int DESTRUCTIVE_RAZE =5032; +const int EFFICIENT_RAZE =5033; +const int CONTROLLED_RAZE =5034; +const int DISTANCE_RAZE =5035; +const int TAINTED_AURA =5036; + + +//Determines if nSpell is an evocation spell +//nSpell: pointer to entry in spells.2da +int ARGetIsEvocation(int nSpell); + +//Returns true if oTarget is of racial type plant. +int ARGetIsPlant(object oTarget); + +//Returns true if oTarget is a member +//of any of the following racial types: +//Beast, Magical beast, animal, vermine +int ARGetIsBeast(object oTarget); + +//Returns true if oTarget is a Associate of oCaster +int ARGetIsAssociate(object oTarget,object oCaster); + +//Returns the level of the spell from the spells.2da index of nSpellID +int ARGetSpellLevel(int nSpellID); + +//Preforms the defiler rasie effect +//nSpellID: is refferance of the casted spell in the spells.2da +//lTargetLocation: is the location of the center of the radius +//oCaster: object refereance to the caster +//nAffectParty: bollean TRUE, party memebers are effected by the raise effects +void DoRaze(int nSpellID, location lCenterRadius, object oCaster); + +// Returns the linked effects to apply for the raise effect +// nPlantDamge: the int ammount of damage to apply to plants +// nNegate: the int ammount to negate saves, skills, and attack bonus +effect ARGetRaiseEffects(int nPlantDamage, int nNegate); + +//Tainted Aura, caster Effects. +effect TaintedAuraCasterEffects(object oPC); + + +//DESTRUCTIVE_RAZE + + +int ARGetIsPlant(object oTarget) +{ + if(GetRacialType(oTarget) == RACIAL_TYPE_PLANT) + { + return TRUE; + } + return FALSE; + +} + +int ARGetIsBeast(object oTarget) + { + if(GetRacialType(oTarget) == RACIAL_TYPE_ANIMAL || + GetRacialType(oTarget) == RACIAL_TYPE_BEAST || + GetRacialType(oTarget) == RACIAL_TYPE_MAGICAL_BEAST || + GetRacialType(oTarget) == RACIAL_TYPE_VERMIN) + { + return TRUE; + } + return FALSE; + } + + +int ARGetIsAssociate(object oTarget,object oCaster) +{ + if(GetAssociate(ASSOCIATE_TYPE_FAMILIAR,oCaster) == oTarget)return TRUE; + if(GetAssociate(ASSOCIATE_TYPE_SUMMONED,oCaster) == oTarget)return TRUE; + if(GetAssociate(ASSOCIATE_TYPE_DOMINATED,oCaster) == oTarget)return TRUE; + if(GetAssociate(ASSOCIATE_TYPE_HENCHMAN,oCaster) == oTarget)return TRUE; + + //ar_debug("Is Not Associate" + IntToString(GetAssociateType(oTarget)), oCaster); + return FALSE; +} + + +int ARGetSpellLevel(int nSpellID) +{ + int nSpellLevel = StringToInt(Get2DAString("spells", "Innate",nSpellID)); + return nSpellLevel; +} + + + +int ARGetIsEvocation(int nSpell) +{ +string s2DA = "spells"; +string sColumn = "School"; +int nRow = nSpell; + + if(GetStringLowerCase(Get2DAString(s2DA,sColumn,nRow))=="v") + { + return TRUE; + } + else + { + return FALSE; + } + +} + + +void DoRaze(int nSpellID, location lCenterRadius, object oCaster) +{ + //ar_debug("starting Raze",oCaster); + int nCasterLevel=GetCasterLevel(oCaster); + int nSpellLevel=ARGetSpellLevel(nSpellID); + int nDC= nCasterLevel + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + //bugFIX: 10' = 3.0479m, 5' = 1.5239m + //radius in meters 1 meter = 3.2808399 foot + float fRadius = 3.0479f + (1.5239f*IntToFloat(nSpellLevel)); + int nDuration = nSpellLevel; + int nPlantDamage = nSpellLevel*2; + int nNegate=1; + float fDelay=0.25f;//IntToFloat(Random(1)); + location lCenter = lCenterRadius; + int nAffectParty=TRUE; + + //ar_debug("linking visuals",oCaster); + + effect eVis = EffectVisualEffect(VFX_IMP_SLOW); + effect eRazeInstantEffects; + eRazeInstantEffects = EffectLinkEffects(eRazeInstantEffects,eVis); + + object oTarget; + + //ar_debug("Raze AoE",oCaster); + + effect eRaise = EffectVisualEffect(VFX_DUR_SHIELD_OF_LAW); + DelayCommand(fDelay,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eRaise,lCenter,1.5f)); + + //ar_debug("Checking Feats",oCaster); + if(GetHasFeat(TAINTED_AURA , oCaster)) + { + SignalEvent(oCaster, EventSpellCastAt(oCaster,SPELL_EFFECT_TAINTAURA,FALSE)); + + //ar_debug("Has Tainted Aura", oCaster); + if(GetLocalInt(oCaster,"TaintedAuraActive")==0) + { + int nCasterLevel = GetLevelByClass(CLASS_TYPE_SORCERER,oCaster); + int nNeg = nCasterLevel / 5; + if(nNeg < 1)nNeg=1; + if(nNeg > 8)nNeg = 8; + int nPos = nNeg; + + effect ePersuade = EffectSkillDecrease(SKILL_PERSUADE,nNeg); + effect ePerform = EffectSkillDecrease(SKILL_PERFORM,nNeg); + effect eAppraise = EffectSkillDecrease(SKILL_APPRAISE,nNeg); + effect eBluff = EffectSkillDecrease(SKILL_BLUFF,nNeg); + effect eTaunt = EffectSkillDecrease(SKILL_TAUNT,nNeg); + effect eIntemedate=EffectSkillIncrease(SKILL_INTIMIDATE,nPos); + + effect eLinkAura = EffectLinkEffects(ePersuade,ePerform); + eLinkAura = EffectLinkEffects(eLinkAura,eAppraise); + eLinkAura = EffectLinkEffects(eLinkAura,eBluff); + eLinkAura = EffectLinkEffects(eLinkAura,eTaunt); + eLinkAura = EffectLinkEffects(eLinkAura,eIntemedate); + + effect eAOE = EffectAreaOfEffect(AOE_MOB_MENACE,"ar_s3_taintede","ar_s3_taintedh","ar_s3_taintedx"); + //Create the AOE object at the selected location + eLinkAura = EffectLinkEffects(eLinkAura,eAOE); + eLinkAura = ExtraordinaryEffect(eLinkAura); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLinkAura, OBJECT_SELF, HoursToSeconds(24)); + SetLocalInt(oCaster,"TaintedAuraActive",1); + } + // Tainted aura is active + } + + + if(GetHasFeat(DEFILING_AURA , oCaster)) nPlantDamage = nSpellLevel*2; + //ar_debug("has Defiling aura, damaging plants for " + IntToString(nPlantDamage), oCaster); + + if(GetHasFeat(EXTERMINATING_RAZE , oCaster))nPlantDamage = nSpellLevel*4; + //ar_debug("Has Exterminating Raze, damaging Plants For:" + IntToString(nPlantDamage), oCaster); + + if(GetHasFeat(PAINFUL_RAZE , oCaster))nNegate=2; + //ar_debug("has painful Raze, Negetive effects are at: " + IntToString(nNegate), oCaster); + + if(GetHasFeat(AGONIZING_RAZE , oCaster))nNegate=5; + //ar_debug("has AgonizingRaze, Negitive Effects are at:" + IntToString(nNegate), oCaster); + + if(GetHasFeat(EFFICIENT_RAZE , oCaster))nDC = nDC + 4; + //ar_debug("Has Effecient Raze, DC is at:" + IntToString(nDC), oCaster); + + if(GetHasFeat(CONTROLLED_RAZE , oCaster))nAffectParty=FALSE; + //ar_debug("has Controlled Raze:",oCaster); + + if(GetHasFeat(DISTANCE_RAZE , oCaster))lCenter = GetLocation(GetAttemptedSpellTarget()); + //ar_debug("Has Distance Raze, centering Raze on target:", oCaster); + + if(GetHasFeat(DESTRUCTIVE_RAZE , oCaster)) + { + //ar_debug("Has Destructive Raze", oCaster); + if(ARGetIsEvocation(nSpellID) == TRUE) + { + //ar_debug("Is Evocation Spell",oCaster); + int nEvocationDamage = nSpellLevel; + effect eDamageToAll = EffectDamage(nEvocationDamage); + eRazeInstantEffects = EffectLinkEffects(eRazeInstantEffects, eDamageToAll); + } + } + + + effect eNegateAttack = EffectAttackDecrease(nNegate); + effect eNegateSave = EffectSavingThrowDecrease(SAVING_THROW_ALL, nNegate,SAVING_THROW_TYPE_ALL); + effect eNegateSkills = EffectSkillDecrease(SKILL_ALL_SKILLS,nNegate); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLinkNegate = EffectLinkEffects(eDur,eNegateAttack); + eLinkNegate = EffectLinkEffects(eLinkNegate,eNegateSave); + eLinkNegate = EffectLinkEffects(eLinkNegate, eNegateSkills); + + effect ePlantDmamge = EffectDamage(nPlantDamage); + effect eRaisePlantEffects = EffectLinkEffects(ePlantDmamge,eVis); + //ar_debug("Aquiring First Target",oCaster); + + oTarget= GetFirstObjectInShape(SHAPE_SPHERE,fRadius,lCenter,TRUE,OBJECT_TYPE_CREATURE); + + while(GetIsObjectValid(oTarget)) + { + if (oTarget != oCaster) + { + if(ARGetIsAssociate(oTarget, oCaster)== FALSE) + { + //ar_debug("Not Effecting Caster",oCaster) ; + SignalEvent(oTarget,EventSpellCastAt(oCaster,SPELL_EFFECT_DEFAURA,TRUE)); + + if(ARGetIsPlant(oTarget) == TRUE) + { + //ar_debug("plant Damage", oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eRaisePlantEffects,oTarget); + } + + //Stop Stacking + // max -5 + string sHasRazeEffects="AR_HAS_RAZE_EFFECTS"; + + if(!GetHasSpellEffect(SPELL_EFFECT_DEFAURA,oTarget) || GetLocalInt(oTarget,sHasRazeEffects) == 0) + { + if(nAffectParty==TRUE) + { + SetLocalInt(oTarget,sHasRazeEffects,1); + //ar_debug("Effecting Party is on",oCaster); + if(FortitudeSave(oTarget,nDC,SAVING_THROW_TYPE_NONE,oCaster))nDuration/=2; + if(nDuration < 1)nDuration = 1; + ApplyEffectToObject(DURATION_TYPE_INSTANT,eRazeInstantEffects,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLinkNegate,oTarget,RoundsToSeconds(nDuration)); + DelayCommand(RoundsToSeconds(nDuration),DeleteLocalInt(oTarget,sHasRazeEffects)); + } + } + else + { + if(!GetFactionEqual(oCaster, oTarget)) + { + //ar_debug("effecting Party is Off",oCaster); + SetLocalInt(oTarget,sHasRazeEffects,1); + if(FortitudeSave(oTarget,nDC,SAVING_THROW_TYPE_NONE,oCaster))nDuration = nDuration/2; + if(nDuration < 1)nDuration = 1; + ApplyEffectToObject(DURATION_TYPE_INSTANT,eRazeInstantEffects,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLinkNegate,oTarget,RoundsToSeconds(nDuration)); + DelayCommand(RoundsToSeconds(nDuration), DeleteLocalInt(oTarget,sHasRazeEffects)); + } + } + } + } + //ar_debug("Aquiring Next Target in sphere",oCaster); + oTarget = GetNextObjectInShape(SHAPE_SPHERE,fRadius,lCenter,TRUE,OBJECT_TYPE_CREATURE); + } + //ar_debug("Exiting aura",oCaster) ; + +} + + +//void main(){} + diff --git a/nwnds_module/ar_inc_massbuff.nss b/nwnds_module/ar_inc_massbuff.nss new file mode 100644 index 000000000..70cdae637 --- /dev/null +++ b/nwnds_module/ar_inc_massbuff.nss @@ -0,0 +1,618 @@ +/////////////////////////////////////////////////////// +// Mass Buff and debuff Effects +// Created: 03-12-06 +// LastEdited: NiteCap-04-14-06 +// Ability adjustments for mass buff spells +// added debuff effects +// added select PRC functions +// added color textblitz +// +/////////////////////////////////////////////////////// + + +#include "X2_I0_SPELLS" +#include "x0_i0_spells" +#include "x2_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_toollib" + +//increase pc Dexterity +effect CreateBadSunEffectsLink(); +void AddMassEffectDex(float fDuration,object oTarget,int nModify); +//increase pc Constitution +void AddMassEffectCon(float fDuration,object oTarget,int nModify); +//increase pc Charisma +void AddMassEffectCha(float fDuration,object oTarget,int nModify); + //increase pc Intelegence +void AddMassEffectInt(float fDuration,object oTarget,int nModify); +//increase pc Strength +void AddMassEffectStr(float fDuration,object oTarget,int nModify); +//adds the ultravision effect to pc +void AddMassEffectUVis(float fDuration, object oTarget); +//increase pc wizdom +void AddMassEffectWiz(float fDuration,object oTarget,int nModify); +//adds the shield of faith effect to pc +void AddMassEffectSoF(float fDuration,object oTarget,int nModify); + +// Curse_of_Impending_Blades effect ac +void AddMassEffectCpb(float fDuration,object oTarget,int nModify); + +// Curse_of_Petty_Failing effect ac +void AddMassEffectCpf(float fDuration,object oTarget,int nModify); + +float TenMinutesToSeconds(int tenMinutes); + +effect SPEffectTemporaryHitpoints(int nHitPoints); + +float MinutesToSeconds(int minutes); + +int SPResistSpell(object oCaster, object oTarget,int nCasterLevel = 0, float fDelay = 0.0 ); + + // This function gets the meta magic int value +int SPGetMetaMagic(); + +// This function applies metamagic to a spell's duration, returning the new duration. +// fDuration - the spell's normal duration. +// nMetaMagic - metamagic constant, if -1 GetMetaMagic() is called. +float SPGetMetaMagicDuration(float fDuration, int nMetaMagic = -1); + +void SPRaiseSpellCastAt(object oTarget, int bHostile = TRUE, int nSpellID = -1, object oCaster = OBJECT_SELF); + +// Function to return a damage effect. +// nDamageAmount - Amount of damage to apply. +// nDamageType - DAMAGE_TYPE_xxx for the type of damage. +// nDamagePower - DAMAGE_POWER_xxx power rating for the damage. +effect SPEffectDamage(int nDamageAmount, int nDamageType = DAMAGE_TYPE_MAGICAL, + int nDamagePower = DAMAGE_POWER_NORMAL); + +// Function to return damage shield effect +// nDamageAmount - Amount of damage to apply. +// nRandomAmount - DAMAGE_BONUS_xxx for amount of random bonus damage to apply. +// nDamageType - DAMAGE_TYPE_xxx for the type of damage. +effect SPEffectDamageShield(int nDamageAmount, int nRandomAmount, int nDamageType); + +//Function to return healing effect +// nAmountToHeal - Amount of damage to heal. +effect SPEffectHeal(int nAmountToHeal); +// This function rolls damage and applies metamagic feats to the damage. +// nDamageType - The DAMAGE_TYPE_xxx constant for the damage, or -1 for no +// a non-damaging effect. +// nDice - number of dice to roll. +// nDieSize - size of dice, i.e. d4, d6, d8, etc. +// nBonusPerDie - Amount of bonus damage per die. +// nBonus - Amount of overall bonus damage. +// nMetaMagic - metamagic constant, if -1 GetMetaMagic() is called. +// returns - the damage rolled with metamagic applied. +int SPGetMetaMagicDamage(int nDamageType, int nDice, int nDieSize, + int nBonusPerDie = 0, int nBonus = 0, int nMetaMagic = -1); + +//Wrapper for The MaximizeOrEmpower function that checks for metamagic feats +//in channeled spells as well +int PRCMaximizeOrEmpower(int nDice, int nNumberOfDice, int nMeta, int nBonus = 0); + + +//Calculates the efective caster level for dispell checks. +//using the foci for abjuration +// also subtracts levels if the target has arcane defense +int ARDispellsAtLevel(object oPC,object oTarget); + + +//increase pc Dexterity +effect CreateBadSunEffectsLink() +{ + //Declare major variables + effect eAttack = EffectAttackDecrease(1); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + //Link the effects + effect eLink = EffectLinkEffects(eAttack, eDur); + return eLink; +} + +void AddMassEffectDex(float fDuration,object oTarget,int nModify) +{ + effect eDex; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eDex = EffectAbilityIncrease(ABILITY_DEXTERITY,nModify); + effect eLink = EffectLinkEffects(eDex, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + +} + +//increase pc Constitution +void AddMassEffectCon(float fDuration,object oTarget,int nModify) +{ + effect eCon; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + // + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eCon = EffectAbilityIncrease(ABILITY_CONSTITUTION, nModify); + effect eLink = EffectLinkEffects(eCon, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + // + +} +//increase pc Charisma +void AddMassEffectCha(float fDuration,object oTarget,int nModify) +{ + effect eCha; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + // + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eCha = EffectAbilityIncrease(ABILITY_CHARISMA, nModify); + effect eLink = EffectLinkEffects(eCha, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + // + +} + + //increase pc Intelegence +void AddMassEffectInt(float fDuration,object oTarget,int nModify) +{ + effect eInt; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + // + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eInt = EffectAbilityIncrease(ABILITY_INTELLIGENCE,nModify); + effect eLink = EffectLinkEffects(eInt, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + // + +} + +//increase pc Strength +void AddMassEffectStr(float fDuration,object oTarget,int nModify) +{ + effect eStr; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eStr = EffectAbilityIncrease(ABILITY_STRENGTH, nModify); + effect eLink = EffectLinkEffects(eStr, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + + +} + +//increase pc wizdom +void AddMassEffectWiz(float fDuration,object oTarget,int nModify) +{ + effect eWiz; + effect eVis = EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + eWiz = EffectAbilityIncrease(ABILITY_WISDOM, nModify); + effect eLink = EffectLinkEffects(eWiz, eDur); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + + +} + +//adds the ultravision effect to pc +void AddMassEffectUVis(float fDuration, object oTarget) +{ + effect eVis = EffectVisualEffect(VFX_DUR_ULTRAVISION); + effect eVis2 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + effect eUltra = EffectUltravision(); + effect eLink = EffectLinkEffects(eVis, eDur); + eLink = EffectLinkEffects(eLink, eVis2); + eLink = EffectLinkEffects(eLink, eUltra); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + +} + +//adds the shield of faith effect to pc +void AddMassEffectSoF(float fDuration,object oTarget,int nModify) +{ + + effect eVis = EffectVisualEffect(VFX_IMP_AC_BONUS); + effect eAC = EffectACIncrease(nModify, AC_DEFLECTION_BONUS); + effect eDur = EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR); + effect eLink = EffectLinkEffects(eAC, eDur); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + + +} + +// Curse_of_Impending_Blades effect ac +void AddMassEffectCpb(float fDuration,object oTarget,int nModify) +{ + + effect eVis = EffectVisualEffect(VFX_IMP_AC_BONUS); + effect eAC = EffectACDecrease(nModify); + effect eDur = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + effect eLink = EffectLinkEffects(eAC, eDur); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + + +} + + +// Curse_of_Petty_Failing effect ac +void AddMassEffectCpf(float fDuration,object oTarget,int nModify) +{ + + effect eVis = EffectVisualEffect(VFX_IMP_AC_BONUS); + effect eAtt = EffectAttackDecrease(nModify,ATTACK_BONUS_MISC); + effect eDur = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + effect eLink = EffectLinkEffects(eAtt, eDur); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration); + + +} + +/* +ADDED THIS SECTION TO GET THE SOME PRC SPELLS TO FUNCTION CORRECTLY +//NC:EDIT +*/ +float MinutesToSeconds(int minutes) +{ + return TurnsToSeconds(minutes); +/* + // Use HoursToSeconds to figure out how long a scaled minute + // is and then calculate the number of real seconds based + // on that. + float scaledMinute = HoursToSeconds(1) / 60.0; + float totalMinutes = minutes * scaledMinute; + + // Return our scaled duration, but before doing so check to make sure + // that it is at least as long as a round / level (time scale is in + // the module properties, it's possible a minute / level could last less + // time than a round / level !, so make sure they get at least as much + // time as a round / level. + float totalRounds = RoundsToSeconds(minutes); + float result = totalMinutes > totalRounds ? totalMinutes : totalRounds; + return result; +*/ +} + +float TenMinutesToSeconds(int tenMinutes) +{ + return TurnsToSeconds(tenMinutes) * 10; +/* + // Use HoursToSeconds to figure out how long a scaled 10 minute + // duration is and then calculate the number of real seconds based + // on that. + float scaledMinute = HoursToSeconds(1) / 6.0; + float totalMinutes = tenMinutes * scaledMinute; + + // Return our scaled duration, but before doing so check to make sure + // that it is at least as long as a round / level (time scale is in + // the module properties, it's possible a 10 minute / level could last less + // time than a round / level !, so make sure they get at least as much + // time as a round / level. + float totalRounds = RoundsToSeconds(tenMinutes); + float result = totalMinutes > totalRounds ? totalMinutes : totalRounds; + return result; +*/ +} + + +// Function to return temporary hit points effect +// nHitPoints - Number of temp. hit points. +effect SPEffectTemporaryHitpoints(int nHitPoints) +{ + return EffectTemporaryHitpoints(nHitPoints); + // PRC pack does not use version 2.0 of Bumpkin's PRC script package, so there is no + // EffectPRCTemporaryHitpoints() method. So just call the bioware default. + //return EffectPRCTemporaryHitpoints(nHitPoints); +} + + +int SPResistSpell(object oCaster, object oTarget,int nCasterLevel = 0, float fDelay = 0.0 ) +{ +// return MyResistSpell(oCaster, oTarget, fDelay); + int result = MyResistSpell(oCaster, oTarget, fDelay); + return result; +} + + // This function gets the meta magic int value +int SPGetMetaMagic() +{ + // Get the meta magic value from the engine then let the PRC code override. + int nMetaMagic = GetMetaMagicFeat(); + // PRC pack does not use version 2.0 of Bumpkin's PRC script package, so there is no + // PRCGetMetamagic() method. So just call the bioware default. + //nMetaMagic = PRCGetMetamagic(nMetaMagic); + return nMetaMagic; +} + + +// This function applies metamagic to a spell's duration, returning the new duration. +// fDuration - the spell's normal duration. +// nMetaMagic - metamagic constant, if -1 GetMetaMagic() is called. +float SPGetMetaMagicDuration(float fDuration, int nMetaMagic = -1) +{ + // If the metamagic argument wasn't given get it. + if (-1 == nMetaMagic) nMetaMagic = SPGetMetaMagic(); + + // Apply extend metamagic. + if (nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2.0; + return fDuration; +} + +void SPRaiseSpellCastAt(object oTarget, int bHostile = TRUE, int nSpellID = -1, object oCaster = OBJECT_SELF) +{ + if (-1 == nSpellID) nSpellID = GetSpellId(); + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellID, bHostile)); +} +// Function to return a damage effect. +// nDamageAmount - Amount of damage to apply. +// nDamageType - DAMAGE_TYPE_xxx for the type of damage. +// nDamagePower - DAMAGE_POWER_xxx power rating for the damage. +effect SPEffectDamage(int nDamageAmount, int nDamageType = DAMAGE_TYPE_MAGICAL, + int nDamagePower = DAMAGE_POWER_NORMAL) +{ + return EffectDamage(nDamageAmount, nDamageType, nDamagePower); + // PRC pack does not use version 2.0 of Bumpkin's PRC script package, so there is no + // EffectPRCDamage() method. So just call the bioware default. + //return EffectPRCDamage(nDamageAmount, nDamageType, nDamagePower); +} +// Function to return damage shield effect +// nDamageAmount - Amount of damage to apply. +// nRandomAmount - DAMAGE_BONUS_xxx for amount of random bonus damage to apply. +// nDamageType - DAMAGE_TYPE_xxx for the type of damage. +effect SPEffectDamageShield(int nDamageAmount, int nRandomAmount, int nDamageType) +{ + return EffectDamageShield(nDamageAmount, nRandomAmount, nDamageType); + // PRC pack does not use version 2.0 of Bumpkin's PRC script package, so there is no + // EffectPRCDamageShield() method. So just call the bioware default. + //return EffectPRCDamageShield(nDamageAmount, nRandomAmount, nDamageType); +} +//Function to return healing effect +// nAmountToHeal - Amount of damage to heal. +effect SPEffectHeal(int nAmountToHeal) +{ + return EffectHeal(nAmountToHeal); + // PRC pack does not use version 2.0 of Bumpkin's PRC script package, so there is no + // EffectPRCHeal() method. So just call the bioware default. + //return EffectPRCHeal(nAmountToHeal); +} + +// This function rolls damage and applies metamagic feats to the damage. +// nDamageType - The DAMAGE_TYPE_xxx constant for the damage, or -1 for no +// a non-damaging effect. +// nDice - number of dice to roll. +// nDieSize - size of dice, i.e. d4, d6, d8, etc. +// nBonusPerDie - Amount of bonus damage per die. +// nBonus - Amount of overall bonus damage. +// nMetaMagic - metamagic constant, if -1 GetMetaMagic() is called. +// returns - the damage rolled with metamagic applied. +int SPGetMetaMagicDamage(int nDamageType, int nDice, int nDieSize, + int nBonusPerDie = 0, int nBonus = 0, int nMetaMagic = -1) +{ + // If the metamagic argument wasn't given get it. + if (-1 == nMetaMagic) nMetaMagic = SPGetMetaMagic(); + + // Roll the damage, applying metamagic. + int nDamage = PRCMaximizeOrEmpower(nDieSize, nDice, nMetaMagic, (nBonusPerDie * nDice) + nBonus); + return nDamage; +} + + +//Wrapper for The MaximizeOrEmpower function that checks for metamagic feats +//in channeled spells as well +int PRCMaximizeOrEmpower(int nDice, int nNumberOfDice, int nMeta, int nBonus = 0) +{ + int i = 0; + int nDamage = 0; + int nChannel = GetLocalInt(OBJECT_SELF,"spellswd_aoe"); + int nFeat = GetLocalInt(OBJECT_SELF,"spell_metamagic"); + int nDiceDamage; + for (i=1; i<=nNumberOfDice; i++) + { + nDiceDamage = nDiceDamage + Random(nDice) + 1; + } + nDamage = nDiceDamage; + //Resolve metamagic + if (nMeta & METAMAGIC_MAXIMIZE || nFeat & METAMAGIC_MAXIMIZE) +// if ((nMeta & METAMAGIC_MAXIMIZE)) + { + nDamage = nDice * nNumberOfDice; + } + if (nMeta & METAMAGIC_EMPOWER || nFeat & METAMAGIC_EMPOWER) +// else if ((nMeta & METAMAGIC_EMPOWER)) + { + nDamage = nDamage + nDamage / 2; + } + return nDamage + nBonus; +} + + +// Sends a message to all PCs and DMs +// * colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white", "random" +// * If you don't choose a color, it will be randomly picked +// * You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToAll(string message, string color="random"); + +// Sends a message to all players and dms +void ToAll(string message); + +// Sends a message to all players in area +// * oArea is the area you want the message to go to +// * colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white", "random" +// * You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToAllInArea(string message, object oArea, string color="random"); + +// Sends a message to all players in area +// * oArea is the area you want the message to go to +void ToAllInArea(string message, object oArea); + +// Sends a message to a PC in color +// * colors are: "darkred", "darkblue", "darkgreen", +// "lightred", "lightblue", "lightgreen", +// "white", "random" +// * You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +void ColorToOne(object oPC, string message, string color="random"); + +// Wraps a rainbow string, no visable output +// alone, needs to be used with other functions +// ToAll, SendMessageToPC, etc. Do not use with a color +// function, it will conflict +string Rainbow(string s); + +// returns a three digit string usable by other textblitz functions +string RandomColor(); + +// Sends a message to a PC in color with floaty text +// * colors are: "darkblue", "darkgreen", +// "lightblue", "lightgreen", +// "white", "random" +// * bBroadcast is TRUE if you want other party members to see it. +// * You can also send a 3 digit RGB color code instead +// example: "þ " would create light red +// 0-255: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ +// (please note that 0 is actualy a space) +// Red doesnt work, i dont know why +void FloatyColorToOne(string message, object oPC, int bBroadcast=TRUE, string color="random"); + +void ColorToAll(string message, string color="random") +{ + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + if (color == "random") color = RandomColor(); + ToAll("" + message + ""); +} + +void ToAll(string message) +{ + SendMessageToAllDMs(message); + object oPC = GetFirstPC(); + while(oPC != OBJECT_INVALID) + { + SendMessageToPC(oPC, message); + oPC = GetNextPC(); + } +} + +void ToAllInArea(string message, object oArea) +{ + object oPC = GetFirstObjectInArea(oArea); + while(oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC)) SendMessageToPC(oPC, message); + oPC = GetNextObjectInArea(oArea); + } +} + +void ColorToAllInArea(string message, object oArea, string color="random") +{ + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + if (color == "random") color = RandomColor(); + ToAllInArea("" + message + "", oArea); +} + + +void ColorToOne(object oPC, string message, string color="random") +{ + if (color == "darkred") color = "~ "; + if (color == "lightred") color = "þ "; + if (color == "darkblue") color = " ~"; + if (color == "lightblue") color = " þ"; + if (color == "darkgreen") color = " ~ "; + if (color == "lightgreen") color = " þ "; + if (color == "white") color = "þþþ"; + if (color == "random") color = RandomColor(); + SendMessageToPC(oPC, "" + message + ""); +} + +// returns a three digit string usable by other textblitz functions +string RandomColor() +{ + string x = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥§¨©ª«¬­®¯°±²³´µ¶·¸¸º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïñòóôõö÷øùúûüýþ"; + string c1 = ""; + string c2 = ""; + string c3 = ""; + while (c1 == "") c1 = GetSubString(x, Random(251), 1); + while (c2 == "") c2 = GetSubString(x, Random(251), 1); + while (c3 == "") c3 = GetSubString(x, Random(251), 1); + return c1 + c2 + c3; +} + +string Rainbow(string s) +{ + int max = GetStringLength(s); + int i = 0; + string final = ""; + while(i < max) + { + final += "" + GetSubString(s, i, 1) + ""; + i += 1; + } + return final; +} + +void FloatyColorToOne(string message, object oPC, int bBroadcast=TRUE, string color="random") +{ + if (color == "darkblue") color = "!!z"; + if (color == "lightblue") color = "!!þ"; + if (color == "darkgreen") color = "!z!"; + if (color == "lightgreen") color = "!þ!"; + if (color == "white") color = "þþþ"; + if (color == "random") color = RandomColor(); + FloatingTextStringOnCreature("" + message + "", oPC, bBroadcast); +} + +//Calculates the efective caster level for dispell checks. +//using the foci for abjuration +int ARDispellsAtLevel(object oPC,object oTarget) +{ + int nLevel = GetCasterLevel(oPC); + int nLevelAddition=0; + + if(GetHasFeat(FEAT_SPELL_FOCUS_ABJURATION,oPC))nLevelAddition+=2; + if(GetHasFeat(FEAT_GREATER_SPELL_FOCUS_ABJURATION,oPC))nLevelAddition+=2; + if(GetHasFeat(FEAT_EPIC_SPELL_FOCUS_ABJURATION,oPC))nLevelAddition+=2; + if(GetHasFeat(FEAT_ARCANE_DEFENSE_ABJURATION,oTarget))nLevelAddition-=2; + + return nLevelAddition; + +} + +//void main(){} diff --git a/nwnds_module/ar_inc_pcspawn.ncs b/nwnds_module/ar_inc_pcspawn.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ar_inc_pcspawn.ncs differ diff --git a/nwnds_module/ar_inc_pcspawn.nss b/nwnds_module/ar_inc_pcspawn.nss new file mode 100644 index 000000000..ebc8f587c --- /dev/null +++ b/nwnds_module/ar_inc_pcspawn.nss @@ -0,0 +1,482 @@ +/* + ar_inc_pcspawn.nss + Constants for various spawn waypoints +*/ + +#include "prc_racial_const" + +//void main(){} + +//start locations +const string AR_START_WP_BELGOISTART="WP_BelgoiStart"; +const string AR_START_WP_GITHSTART="WP_GithStart"; +const string AR_START_WP_ILLITHIDSTART="WP_IllithidStart"; +const string AR_START_WP_KLEDSTART="WP_KledStart"; +const string AR_START_WP_REGGELIDSTART="WP_ReggelidStart"; +const string AR_START_WP_THRAXSTART="WP_ThraxStart"; +const string AR_START_WP_TYRSTART="WP_TyrStart"; +const string AR_START_WP_UNDEADSTART="WP_UndeadStart"; +const string AR_START_WP_URIKSTART="WP_UrikStart"; +const string AR_START_WP_YUANTISTART="WP_YuantiStart"; +const string DS_START_WP_TARISTART="WP_TariStart"; +const string DS_START_WP_SILVERSTART="WP_SilverStart"; + + +//Respawn Locations +const string AR_RESPAWN_WP_TYRRESPAWN="WP_TyrRespawn"; +const string AR_RESPAWN_WP_URIKRESPAWN="WP_UrikRespawn"; +const string AR_RESPAWN_WP_KLEDRESPAWN="WP_KledRespawn"; +const string AR_RESPAWN_WP_ALTARUKRESPAWN="WP_AltarukRespawn"; +const string AR_RESPAWN_WP_BELGOIRESPAWN="WP_BelgoiRespawn"; +const string AR_RESPAWN_WP_GITHRESPAWN="WP_GithRespawn"; +const string AR_RESPAWN_WP_ILLITHIDRESPAWN="WP_IllithidRespawn"; +const string AR_RESPAWN_WP_REGGELIDRESPAWN="WP_ReggelidRespawn"; +const string AR_RESPAWN_WP_THRAXRESPAWN="WP_ThraxRespawn"; +const string AR_RESPAWN_WP_UNDEADRESPAWN="WP_UndeadRespawn"; +const string AR_RESPAWN_WP_YUANTIRESPAWN="WP_YauntiRespawn"; +const string AR_RESPAWN_WP_FIRERESPAWN="WP_FireRespawn"; +const string AR_RESPAWN_WP_WATERRESPAWN="WP_WaterRespawn"; +const string AR_RESPAWN_WP_EARTHRESPAWN="WP_EarthRespawn"; +const string AR_RESPAWN_WP_AIRRESPAWN="WP_AirRespawn"; +const string AR_RESPAWN_WP_MAGMARESPAWN="WP_MagmaRespawn"; +const string AR_RESPAWN_WP_SILTRESPAWN="WP_SiltRespawn"; +const string AR_RESPAWN_WP_SUNRESPAWN="WP_SunRespawn"; +const string AR_RESPAWN_WP_RAINRESPAWN="WP_RainRespawn"; +const string DS_RESPAWN_WP_SILVERRESPAWN="WP_SilverRespawn"; +const string DS_RESPAWN_WP_TARIRESPAWN="WP_TariRespawn"; + +//SubRace Const +const string AR_SUBRACE_AARAKOCRA="aarakocra"; +const string AR_SUBRACE_AASIMAR="aasimar"; +const string AR_SUBRACE_AIR_GENASI="air-genasi"; +const string AR_SUBRACE_BELGOI="belgoi"; +const string AR_SUBRACE_DWARF="dwarf"; +const string AR_SUBRACE_EARTH_GENASI="earth-genasi"; +const string AR_SUBRACE_ELF="elf"; +const string AR_SUBRACE_FIRE_GENASI="fire-genasi"; +const string AR_SUBRACE_GITH="gith"; +const string AR_SUBRACE_GITHYANKI="githyanki"; +const string AR_SUBRACE_GITHZERI="githzeri"; +const string AR_SUBRACE_HALF_ELF="half-elf"; +const string AR_SUBRACE_HALF_GIANT="half-giant"; +const string AR_SUBRACE_HALFLING="halfling"; +const string AR_SUBRACE_ILLITHID="illithid"; +const string AR_SUBRACE_KIRRE="kirre"; +const string AR_SUBRACE_MAGMA_GENASI="magma-genasi"; +const string AR_SUBRACE_MUL="mul"; +const string AR_SUBRACE_PTERRAN="pterran"; +const string AR_SUBRACE_RAIN_GENASI="rain-genasi"; +const string AR_SUBRACE_REGGELID="reggelid"; +const string AR_SUBRACE_SILT_GENASI="silt-genasi"; +const string AR_SUBRACE_SUN_GENASI="sun-genasi"; +const string AR_SUBRACE_TARI="tari"; +const string AR_SUBRACE_THRAX="thrax"; +const string AR_SUBRACE_THRI_KREEN="thri-kreen"; +const string AR_SUBRACE_TIEFLING="tiefling"; +const string AR_SUBRACE_UNDEAD="undead"; +const string AR_SUBRACE_VILLICHI="villichi"; +const string AR_SUBRACE_WATER_GENASI="water-genasi"; +const string AR_SUBRACE_YUAN_TI="yuan-ti"; + +const string AR_SKIP_ONENTER_JUMP="AR_SKIP_NEXT_JUMP"; + +//change this tag to match the waypoint of the start location int he Gray. +const string AR_STARTLOC_THEGRAY="WP_GrayStart"; + + + +// Returns the respawn waypoint of oPC based on Subrace +string GetSubRaceAdjustedRespawnPoint(object oPC); + +// Returns the correct Start location using oPC's +// race and xp +string GetSubRaceAdjustedStartPoint(object oPC); + +//Set Local var to skip the jump on re-entry +void SkipNextJump(object oPC); + +// Spawns oPC in a safe area +// Set bGoToGray to true oPC will automaticaly go to the gray. +// Set bRespawn to True to send oPC to the respected respawn points by SubRace. +void ARSpawnPC(object oPC,int bRespawn=FALSE, int bGoToGray = FALSE); + + +//Set Local var to skip the jump on re-entry +void SkipNextJump(object oPC) +{ + int nVal = TRUE; + SetLocalInt(oPC,AR_SKIP_ONENTER_JUMP,nVal); + +} + +// Returns the correct Start location using oPC's +// race and xp +string GetSubRaceAdjustedStartPoint(object oPC) +{ +string sSubRace = GetSubRace(oPC); +sSubRace = GetStringLowerCase(sSubRace); +string sTag=AR_START_WP_TYRSTART; + +int nRoll; +if(GetRacialType(oPC) == RACIAL_TYPE_AARAKOCRA) + { + nRoll=d2(); + if(nRoll==1)sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_BELGOI) + { + sTag = AR_START_WP_BELGOISTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_DWARF) + { + nRoll=d3(); + if(nRoll==1)sTag = AR_START_WP_URIKSTART; + if(nRoll==2)sTag = AR_START_WP_TYRSTART; + if(nRoll==3)sTag = AR_START_WP_KLEDSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_ELF) + { + nRoll=d3(); + if(nRoll==1)sTag = AR_START_WP_URIKSTART; + if(nRoll==2)sTag = AR_START_WP_TYRSTART; + if(nRoll==3)sTag = DS_START_WP_SILVERSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITH) + { + sTag = AR_START_WP_GITHSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITHYANKI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITHZERAI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFELF) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFGIANT) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFLING) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_ILLITHID) + { + sTag=AR_START_WP_ILLITHIDSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_MUL) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_PTERRAN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_REGGELID) + { + sTag=AR_START_WP_REGGELIDSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_TARI) + { + sTag = DS_START_WP_TARISTART; + } +/*if(GetRacialType(oPC) == RACIAL_TYPE_THRAX) + { + sTag= AR_START_WP_THRAXSTART; + }*/ +if(GetRacialType(oPC) == RACIAL_TYPE_JERAL || + GetRacialType(oPC) == RACIAL_TYPE_JHOL || + GetRacialType(oPC) == RACIAL_TYPE_JEZ || + GetRacialType(oPC) == RACIAL_TYPE_THRIKREEN || + GetRacialType(oPC) == RACIAL_TYPE_TKEECH || + GetRacialType(oPC) == RACIAL_TYPE_TOKSA || + GetRacialType(oPC) == RACIAL_TYPE_TONDI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +/*if(GetRacialType(oPC) == RACIAL_TYPE_UNDEAD) + { + sTag = AR_START_WP_UNDEADSTART; + } +if(GetRacialType(oPC) == RACIAL_TYPE_VILLICHI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + }*/ +if(GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_START_WP_URIKSTART; + sTag = AR_START_WP_TYRSTART; + } +if( GetRacialType(oPC) == RACIAL_TYPE_ABOM_YUAN || // Yuan-Ti Abomination + GetRacialType(oPC) == RACIAL_TYPE_PURE_YUAN ) // Yuan-Ti Pureblood + { + sTag=AR_START_WP_YUANTISTART; + } +return(sTag); + +} + +// Spawns oPC in a safe area +// Set bGoToGray to true oPC will automaticaly go to the gray. +// Set bRespawn to True to send oPC to the respected respawn points by SubRace. +void ARSpawnPC(object oPC,int bRespawn=FALSE, int bGoToGray = FALSE) +{ + object oWayPoint= GetObjectByTag(GetSubRaceAdjustedStartPoint(oPC)); + + if(bGoToGray) + { + oWayPoint = GetObjectByTag(AR_STARTLOC_THEGRAY); + } + else if(bRespawn) + { + oWayPoint = GetObjectByTag(GetSubRaceAdjustedRespawnPoint(oPC)); + } + ClearAllActions(); + AssignCommand(oPC,ActionJumpToObject(oWayPoint)); + +} + +// Returns the respawn waypoint of oPC based on Subrace +string GetSubRaceAdjustedRespawnPoint(object oPC) +{ +string sSubRace = GetSubRace(oPC); +sSubRace = GetStringLowerCase(sSubRace); +string sTag=AR_RESPAWN_WP_TYRRESPAWN; + +int nRoll; +if(GetRacialType(oPC) == RACIAL_TYPE_AARAKOCRA) + { + nRoll=d2(); + if(nRoll==1)sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_BELGOI) + { + sTag = AR_RESPAWN_WP_BELGOIRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_DWARF) + { + nRoll=d3(); + if(nRoll==1)sTag = AR_RESPAWN_WP_KLEDRESPAWN; + if(nRoll==2)sTag = AR_RESPAWN_WP_TYRRESPAWN; + if(nRoll==3)sTag = AR_RESPAWN_WP_URIKRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_ELF) + { + nRoll=d3(); + if(nRoll==1)sTag = AR_RESPAWN_WP_URIKRESPAWN; + if(nRoll==2)sTag = AR_RESPAWN_WP_TYRRESPAWN; + if(nRoll==3)sTag = DS_RESPAWN_WP_SILVERRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITH) + { + sTag = AR_RESPAWN_WP_GITHRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITHYANKI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_GITHZERAI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFELF) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFGIANT) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_DS_HALFLING) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_ILLITHID) + { + sTag=AR_RESPAWN_WP_ILLITHIDRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_MAGMA_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_MUL) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_PTERRAN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_RAIN_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_REGGELID) + { + sTag=AR_RESPAWN_WP_REGGELIDRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_SILT_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_SUN_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_TARI) + { + nRoll=d3(); + if(nRoll==1)sTag = AR_RESPAWN_WP_URIKRESPAWN; + if(nRoll==2)sTag = AR_RESPAWN_WP_TYRRESPAWN; + if(nRoll==3)sTag = DS_RESPAWN_WP_TARIRESPAWN; + } +/*if(GetRacialType(oPC) == RACIAL_TYPE_THRAX) + { + sTag= AR_RESPAWN_WP_THRAXRESPAWN; + }*/ +if(GetRacialType(oPC) == RACIAL_TYPE_JERAL || + GetRacialType(oPC) == RACIAL_TYPE_JHOL || + GetRacialType(oPC) == RACIAL_TYPE_JEZ || + GetRacialType(oPC) == RACIAL_TYPE_THRIKREEN || + GetRacialType(oPC) == RACIAL_TYPE_TKEECH || + GetRacialType(oPC) == RACIAL_TYPE_TOKSA || + GetRacialType(oPC) == RACIAL_TYPE_TONDI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +/*if(GetRacialType(oPC) == RACIAL_TYPE_UNDEAD) + { + sTag = AR_RESPAWN_WP_UNDEADRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_VILLICHI) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + }*/ +if(GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN) + { + nRoll=d2(); + if(nRoll==1) sTag = AR_RESPAWN_WP_URIKRESPAWN; + sTag = AR_RESPAWN_WP_TYRRESPAWN; + } +if(GetRacialType(oPC) == RACIAL_TYPE_ABOM_YUAN || // Yuan-Ti Abomination + GetRacialType(oPC) == RACIAL_TYPE_PURE_YUAN ) // Yuan-Ti Pureblood + { + sTag=AR_RESPAWN_WP_YUANTIRESPAWN; + } +return (sTag); + +} + + diff --git a/nwnds_module/ar_inc_spellhook.ncs b/nwnds_module/ar_inc_spellhook.ncs new file mode 100644 index 000000000..49b66a559 Binary files /dev/null and b/nwnds_module/ar_inc_spellhook.ncs differ diff --git a/nwnds_module/ar_inc_spellhook.nss b/nwnds_module/ar_inc_spellhook.nss new file mode 100644 index 000000000..5beac603c --- /dev/null +++ b/nwnds_module/ar_inc_spellhook.nss @@ -0,0 +1,264 @@ +#include "nw_i0_spells" +#include "x2_i0_spells" +#include "x2_inc_switches" +#include "ar_inc_defraze" +#include "divinetenser_inc" +//#include "ar_debug" + + + +const int CONCENTRATION_DIFFICULTY = 10; +const float DISTANCE_TO_HOSTILE = 5.0; +const int SPELL_BACKLASH = 2020; +const int SPELL_CONSERVATION = 2018; +const int SPELL_STEALENERGY=2021; +const int SPELL_OBSIDIANDEATH=2022; +const int SPELL_CREATE_MAGIC_TATTOO=2243; + +const string CONSERVE_SPELL_FAIL_TEXT = "Spell Failed: The land has been protected from defiling."; +const string AR_SPELL_CLASS_TEXT = "You are not of the required class to cast this spell"; + +// exits spell hook if nSpellID is in list +int NC_ExitIfSpell(int nSpellID); + +//returns true if oPC has any levels in NClass, CLASS_TYPE_* +int NC_GetHasClass(int nCLASS, object oPC); + +//Dose the preservers backlash effect on a subject defiler +// oPC: creature to effect +void DoBacklashEffect(object oPC); + +//Conservation Spell Fail +//Target must make a will save in order to cast spell +void DoConservationEffect(object oPC); + +//Spell Restrictions for Defiler and Preserver +int NCSpellCheck(int nSpellID, int nCasterClass); + + + +void main() +{ + object oMagicItem = GetSpellCastItem(); + object oPC = OBJECT_SELF; + if(GetLocalInt(OBJECT_SELF,"tensers_transformation") && + (GetIsObjectValid(oMagicItem) && + GetBaseItemType(oMagicItem) == BASE_ITEM_SPELLSCROLL || + GetBaseItemType(oMagicItem) == BASE_ITEM_RING || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCWIDE || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCTHIN || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCTALL || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCSMALL || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCMEDIUM || + GetBaseItemType(oMagicItem) == BASE_ITEM_MISCLARGE || + GetBaseItemType(oMagicItem) == BASE_ITEM_MAGICWAND || + GetBaseItemType(oMagicItem) == BASE_ITEM_MAGICSTAFF || + GetBaseItemType(oMagicItem) == BASE_ITEM_MAGICROD || + GetBaseItemType(oMagicItem) == BASE_ITEM_ENCHANTED_WAND || + GetBaseItemType(oMagicItem) == BASE_ITEM_ENCHANTED_SCROLL || + GetBaseItemType(oMagicItem) == BASE_ITEM_CLOAK || + GetBaseItemType(oMagicItem) == BASE_ITEM_BOOTS || + GetBaseItemType(oMagicItem) == BASE_ITEM_BOOK || + GetBaseItemType(oMagicItem) == BASE_ITEM_AMULET || + GetBaseItemType(oMagicItem) == BASE_ITEM_BELT || + GetBaseItemType(oMagicItem) == BASE_ITEM_BRACER || + GetBaseItemType(oMagicItem) == BASE_ITEM_GEM || + GetBaseItemType(oMagicItem) == BASE_ITEM_TORCH || + GetBaseItemType(oMagicItem) == BASE_ITEM_GLOVES)) + { + DelayCommand(0.2, CheckHasTensersEffects(oPC)); + DelayCommand(0.3, CheckDivinePowerEffects(oPC)); + SendMessageToPC(OBJECT_SELF,"You cannot use magic or magical items while "+ + "under the effects of Tenser's Transformation."); + ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect + (VFX_IMP_MAGIC_RESISTANCE_USE),OBJECT_SELF); + SetModuleOverrideSpellScriptFinished(); + } + //ar_debug("starting SpellHook", OBJECT_SELF); + location lCasterLocation=GetLocation(OBJECT_SELF); + int nCasterClass = GetLastSpellCastClass(); + int bCanCastSpell = NCSpellCheck(GetLastSpell(),nCasterClass); + //---------------------------------------------------------------------- + // Add Defiling Aura Effect, Backlash, Conservation + // For athas reborn PW + // Created By NiteCap@gmail.com + //---------------------------------------------------------------------- + + //if Spell was cast by pc or creature + //then we do Aura, Backlash, and conservation effects + // if Spell is cast from an item, exit + int nSpellID = GetSpellId (); + + if (GetIsObjectValid(GetSpellCastItem())) + { + + if(GetIsPC(oPC)) + { + // firstly check that the spell is being cast from a scroll + object oScroll = GetSpellCastItem(); + if(GetIsObjectValid(oScroll) && GetBaseItemType(oScroll) == BASE_ITEM_SPELLSCROLL) + { + // now check are we in combat + if(GetIsInCombat(oPC)) + { + // now find the nearest hostile + object oHostile = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oPC); + if(GetIsObjectValid(oHostile)) + { + // check the distance to the nearest hostile + if(GetDistanceBetween(oPC, oHostile) <= DISTANCE_TO_HOSTILE) + { + // take in to account the innate spell level of the scroll + // I am using des_crft_spells.2da Innate Level column here, not (as would be correct) + // the IPPR_Spells.2da InnateLvl column, because some of the scrolls in + // the game ( i.e. light) would not be useable (DC 30+) + int nInnateLevel = StringToInt(Get2DAString("des_crft_spells", "Level", nSpellID)); + // do a concentration check + if (!GetIsSkillSuccessful(oPC, SKILL_CONCENTRATION, CONCENTRATION_DIFFICULTY + nInnateLevel)) + { + SetModuleOverrideSpellScriptFinished(); + } + } + } + } + } + } + return; + } + + // exits spellhook if nSpellID is in list + // or if we have effects of nSpellID. + if(NC_ExitIfSpell(nSpellID)){return;} + + + int nSpellLevel= StringToInt(Get2DAString("spells", "Innate",nSpellID)); + + + //NC:EDIT + //Spell Restrictions for Defiler and Preserver + if(!bCanCastSpell) + { + FloatingTextStringOnCreature(AR_SPELL_CLASS_TEXT,OBJECT_SELF,TRUE); + SetModuleOverrideSpellScriptFinished(); + return; + } + //NC:EDIT + + if (nCasterClass == CLASS_TYPE_SORCERER || + nCasterClass == 43 ) + { + //ar_debug("starting Aura effects", OBJECT_SELF); + //Add conservation Check + DoConservationEffect(oPC); + DoRaze(nSpellID, lCasterLocation, OBJECT_SELF); + //add check for Backlash + DoBacklashEffect(OBJECT_SELF); + } + //--------------------------------------------------------------------------------------- + +} + +void DoBacklashEffect(object oTarget) +{ + int nHasBackLash = GetLocalInt(oTarget,"BackLash"); + int nDice = GetLocalInt(oTarget,"BackLashDice"); + + if(!NC_GetHasClass(CLASS_TYPE_SORCERER,oTarget)) + { + return; + } + + if(nHasBackLash==1) + { + effect eDamage = EffectDamage(d6(nDice)); + effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); + effect eLink = EffectLinkEffects(eDamage, eVis); + object oAOE = GetLocalObject(oTarget, "BackLashAOE"); + + if(GetIsObjectValid(oAOE)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oTarget); + DeleteLocalInt(oTarget, "BackLash"); + DeleteLocalInt(oTarget, "BackLashDice"); + DeleteLocalObject(oTarget, "BackLashAOE"); + DestroyObject(oAOE); + } + else + { + DeleteLocalInt(oTarget, "BackLash"); + DeleteLocalInt(oTarget, "BackLashDice"); + DeleteLocalObject(oTarget, "BackLashAOE"); + } + return; + } + } + + +void DoConservationEffect(object oPC) +{ + object oCaster = GetLocalObject(oPC,"AR_CONSERVE_CASTER"); + int nDC = GetLocalInt(oPC,"AR_CONSERVE"); + + if(GetIsObjectValid(oCaster)) + { + if(WillSave(oPC, nDC,SAVING_THROW_TYPE_SPELL, oCaster)==0) + { + FloatingTextStringOnCreature(CONSERVE_SPELL_FAIL_TEXT,oPC,FALSE); + SetModuleOverrideSpellScriptFinished(); + return; + } + + } + +} + +int NCSpellCheck(int nSpellID, int nCasterClass) +{ + int nReturn=TRUE; + switch(nCasterClass) + { + case CLASS_TYPE_WIZARD: + { + if(nSpellID == SPELL_OBSIDIANDEATH)nReturn==FALSE; + if(nSpellID == SPELL_STEALENERGY)nReturn==FALSE; + } + case CLASS_TYPE_SORCERER: + { + if(nSpellID == SPELL_CONSERVATION)nReturn==FALSE; + if(nSpellID == SPELL_BACKLASH)nReturn==FALSE; + } + default: {nReturn==TRUE;} + } + return nReturn; + +} + +int NC_GetHasClass(int nCLASS, object oPC) + { + + if (GetLevelByClass(nCLASS, oPC)>=1) + { + return TRUE; + } + else + { + return FALSE; + } + } + +// exits spell hook if nSpellID is in list +int NC_ExitIfSpell(int nSpellID) +{ + if((nSpellID == SPELL_BIGBYS_INTERPOSING_HAND) || + (nSpellID == SPELL_BIGBYS_GRASPING_HAND) || + (nSpellID == SPELL_BIGBYS_FORCEFUL_HAND) || + (nSpellID == SPELL_BIGBYS_CRUSHING_HAND) || + (nSpellID == SPELL_ETHEREALNESS) || + (nSpellID == SPELL_SHADOW_CONJURATION_INIVSIBILITY) || + (nSpellID == SPELL_INVISIBILITY) || + (nSpellID == SPELL_CREATE_MAGIC_TATTOO) || + (nSpellID == SPELL_INVISIBILITY_SPHERE) || + (nSpellID == SPELL_SANCTUARY) || + (nSpellID == SPELL_IMPROVED_INVISIBILITY))return TRUE; + return FALSE; +} diff --git a/nwnds_module/ar_inc_stealeng.nss b/nwnds_module/ar_inc_stealeng.nss new file mode 100644 index 000000000..f716394b7 --- /dev/null +++ b/nwnds_module/ar_inc_stealeng.nss @@ -0,0 +1,5112 @@ +#include "x2_inc_spellhook" +#include "nw_i0_spells" + + +//Spell const + + +//9th level +const int AR_SPELL_DOMINATE_MONSTER=44; +const int AR_SPELL_ELEMENTAL_SWARM=48; +const int AR_SPELL_ENERGY_DRAIN=51; +const int AR_SPELL_GATE=63; +const int AR_SPELL_GREATER_SPELL_MANTLE=73; +const int AR_SPELL_IMPLOSION=87; +const int AR_SPELL_MASS_DOMINATION=112; +const int AR_SPELL_METEOR_SWARM=116; +const int AR_SPELL_MORDENKAINENS_DISJUNCTION=122; +const int AR_SPELL_POWER_WORD_KILL=131; +const int AR_SPELL_SHAPECHANGE=161; +const int AR_SPELL_STORM_OF_VENGEANCE=173; +const int AR_SPELL_SUMMON_CREATURE_IX=178; +const int AR_SPELL_TIME_STOP=185; +const int AR_SPELL_WAIL_OF_THE_BANSHEE=190; +const int AR_SPELL_WEIRD=193; +const int AR_SPELL_UNDEATHS_ETERNAL_FOE=444; +const int AR_SPELL_BIGBYS_CRUSHING_HAND=463; +const int AR_SPELL_BLACK_BLADE_OF_DISASTER=533; +const int AR_SPELL_TIDE_OF_BATTLE=565; +const int AR_SPELL_DEHYDRATE=2004; +const int AR_SPELL_SILTSTORM=2009; +const int AR_SPELL_CALLOFTHEKING=2103; +const int AR_SPELL_MASS_DROWN=2244; +const int AR_SPELL_NATURE_AVATAR=2252; +const int AR_SPELL_UNYIELDING_ROOTS=2253; +//8th level +const int AR_SPELL_CREATE_GREATER_UNDEAD=29; +const int AR_SPELL_GREATER_PLANAR_BINDING=69; +const int AR_SPELL_INCENDIARY_CLOUD=89; +const int AR_SPELL_MASS_BLINDNESS_AND_DEAFNESS=110; +const int AR_SPELL_MASS_CHARM=111; +const int AR_SPELL_MASS_HEAL=114; +const int AR_SPELL_MIND_BLANK=117; +const int AR_SPELL_NATURES_BALANCE=124; +const int AR_SPELL_PREMONITION=134; +const int AR_SPELL_SUMMON_CREATURE_VIII=182; +const int AR_SPELL_AURA_VERSUS_ALIGNMENT = 323; +const int AR_SPELL_HORRID_WILTING= 367; +const int AR_SPELL_BOMBARDMENT= 423; +const int AR_SPELL_EARTHQUAKE= 426; +const int AR_SPELL_SUNBURST= 427; +const int AR_SPELL_BIGBYS_CLENCHED_FIST= 462; +const int AR_SPELL_BLACKSTAFF= 541; +const int AR_SPELL_OBSIDIANDEATH_DEF= 2022; +const int AR_SPELL_MASS_HOLD_MONSTER= 2249; +const int AR_SPELL_GREATER_WALL_OF_DISPEL_MAGIC= 2251; +//7th level +const int AR_SPELL_CONTROL_UNDEAD= 28; +const int AR_SPELL_DELAYED_BLAST_FIREBALL= 39; +const int AR_SPELL_FINGER_OF_DEATH= 56; +const int AR_SPELL_FIRE_STORM= 57; +const int AR_SPELL_GREATER_RESTORATION= 70; +const int AR_SPELL_MORDENKAINENS_SWORD= 123; +const int AR_SPELL_POWER_WORD_STUN= 132; +const int AR_SPELL_PRISMATIC_SPRAY= 135; +const int AR_SPELL_PROTECTION_FROM_SPELLS= 141; +const int AR_SPELL_RESURRECTION= 153; +const int AR_SPELL_SHADOW_SHIELD= 160; +const int AR_SPELL_SPELL_MANTLE= 169; +const int AR_SPELL_SUMMON_CREATURE_VII= 181; +const int AR_SPELL_SUNBEAM=183; +const int AR_SPELL_WORD_OF_FAITH= 194; +const int AR_SPELL_CREEPING_DOOM=364; +const int AR_SPELL_DESTRUCTION= 366; +const int AR_SPELL_AURA_OF_VITALITY= 372; +const int AR_SPELL_REGENERATE=374; +const int AR_SPELL_ETHEREALNESS=443; +const int AR_SPELL_BIGBYS_GRASPING_HAND=461; +const int AR_SPELL_GREAT_THUNDERCLAP=515; +const int AR_SPELL_ETHEREALNESS2=724; +const int AR_SPELL_BANEOFDEFILERS= 2017; +const int AR_SPELL_WORD_OF_BALANCE= 2246; +const int AR_SPELL_MASS_HOLD_PERSON= 2248; +//6th level +const int AR_SPELL_ACID_FOG= 0; +const int AR_SPELL_BLADE_BARRIER= 5; +const int AR_SPELL_CHAIN_LIGHTNING= 14; +const int AR_SPELL_CIRCLE_OF_DEATH= 18; +const int AR_SPELL_CREATE_UNDEAD= 30; +const int AR_SPELL_GLOBE_OF_INVULNERABILITY= 65; +const int AR_SPELL_GREATER_SPELL_BREACH= 72; +const int AR_SPELL_GREATER_STONESKIN= 74; +const int AR_SPELL_HARM= 77; +const int AR_SPELL_HEAL= 79; +const int AR_SPELL_MASS_HASTE= 113; +const int AR_SPELL_PLANAR_BINDING= 128; +const int AR_SPELL_SUMMON_CREATURE_VI= 180; +const int AR_SPELL_TENSERS_TRANSFORMATION= 184; +const int AR_SPELL_BANISHMENT= 430; +const int AR_SPELL_DROWN= 437; +const int AR_SPELL_DIRGE= 445; +const int AR_SPELL_ISAACS_GREATER_MISSILE_STORM= 448; +const int AR_SPELL_PLANAR_ALLY= 451; +const int AR_SPELL_BIGBYS_FORCEFUL_HAND= 460; +const int AR_SPELL_FLESH_TO_STONE= 485; +const int AR_SPELL_STONE_TO_FLESH= 486; +const int AR_SPELL_CRUMBLE= 512; +const int AR_SPELL_UNDEATH_TO_DEATH= 528; +const int AR_SPELL_STONEHOLD= 547; +const int AR_SPELL_SUMMON_SHADOW_X2= 564; +const int AR_SPELL_SUNSTROKE= 2003; +const int AR_SPELL_HEARTSEEKER= 2016; +const int AR_SPELL_MASS_BULLS_STRENGTH= 2225; +const int AR_SPELL_MASS_CATS_GRACE= 2226; +const int AR_SPELL_MASS_EAGLE_SPLENDOR= 2227; +const int AR_SPELL_MASS_ENDURANCE= 2228; +const int AR_SPELL_MASS_FOXS_CUNNING= 2229; +const int AR_SPELL_MASS_OWLS_WISDOM= 2230; +const int AR_SPELL_ACID_STORM= 2256; +const int AR_SPELL_DISINTEGRATE= 2263; +//5th level +const int AR_SPELL_CIRCLE_OF_DOOM= 19; +const int AR_SPELL_CLOUDKILL= 23; +const int AR_SPELL_CONE_OF_COLD= 25; +const int AR_SPELL_FEEBLEMIND= 55; +const int AR_SPELL_GREATER_DISPELLING= 67; +const int AR_SPELL_HEALING_CIRCLE= 80; +const int AR_SPELL_LESSER_MIND_BLANK= 95; +const int AR_SPELL_LESSER_PLANAR_BINDING= 96; +const int AR_SPELL_LESSER_SPELL_MANTLE= 99; +const int AR_SPELL_MIND_FOG= 118; +const int AR_SPELL_ETHEREAL_VISAGE= 121; +const int AR_SPELL_RAISE_DEAD= 142; +const int AR_SPELL_SLAY_LIVING= 164; +const int AR_SPELL_SPELL_RESISTANCE= 168; +const int AR_SPELL_SPHERE_OF_CHAOS= 170; +const int AR_SPELL_SUMMON_CREATURE_V= 179; +const int AR_SPELL_TRUE_SEEING= 186; +const int AR_SPELL_AURA_BLINDING= 195; +const int AR_SPELL_AURA_STUN= 202; +const int AR_SPELL_CONE_ACID= 229; +const int AR_SPELL_CONE_COLD= 230; +const int AR_SPELL_AWAKEN= 363; +const int AR_SPELL_ENERGY_BUFFER= 369; +const int AR_SPELL_LEGEND_LORE= 376; +const int AR_SPELL_SUMMON_MEPHIT= 378; +const int AR_SPELL_SUMMON_CELESTIAL= 379; +const int AR_SPELL_OWLS_INSIGHT= 438; +const int AR_SPELL_FIREBRAND= 440; +const int AR_SPELL_INFERNO= 446; +const int AR_SPELL_BIGBYS_INTERPOSING_HAND= 459; +const int AR_SPELL_TRAP_ARROW= 487; +const int AR_SPELL_TRAP_BOLT= 488; +const int AR_SPELL_TRAP_DART= 493; +const int AR_SPELL_TRAP_SHURIKEN= 494; +const int AR_SPELL_BREATH_PETRIFY= 495; +const int AR_SPELL_TOUCH_PETRIFY= 496; +const int AR_SPELL_BALL_LIGHTNING= 516; +const int AR_SPELL_BATTLETIDE= 517; +const int AR_SPELL_MESTILS_ACID_SHEATH= 524; +const int AR_SPELL_MONSTROUS_REGENERATION= 525; +const int AR_SPELL_VINE_MINE= 529; +const int AR_SPELL_EVIL_BLIGHT= 566; +const int AR_SPELL_STEALENERGY_DEF= 2021; +const int AR_SPELL_WISDOMOFSORCKING= 2102; +const int AR_SPELL_GREATER_HEROISM= 2234; +const int AR_SPELL_LEGIONS_CURSE_OF_PETTY_FAILING= 2241; +//4th level +const int AR_SPELL_CURE_CRITICAL_WOUNDS= 31; +const int AR_SPELL_DEATH_WARD= 38; +const int AR_SPELL_DISMISSAL= 40; +const int AR_SPELL_DIVINE_POWER= 42; +const int AR_SPELL_DOMINATE_PERSON= 45; +const int AR_SPELL_ELEMENTAL_SHIELD= 47; +const int AR_SPELL_ENERVATION= 52; +const int AR_SPELL_FLAME_STRIKE= 61; +const int AR_SPELL_FREEDOM_OF_MOVEMENT= 62; +const int AR_SPELL_HAMMER_OF_THE_GODS= 76; +const int AR_SPELL_HOLD_MONSTER= 82; +const int AR_SPELL_HOLY_SWORD= 85; +const int AR_SPELL_IMPROVED_INVISIBILITY= 88; +const int AR_SPELL_LESSER_SPELL_BREACH= 98; +const int AR_SPELL_MINOR_GLOBE_OF_INVULNERABILITY= 119; +const int AR_SPELL_PHANTASMAL_KILLER= 127; +const int AR_SPELL_RESTORATION= 152; +const int AR_SPELL_SHADOW_CONJURATION= 159; +const int AR_SPELL_STONESKIN= 172; +const int AR_SPELL_SUMMON_CREATURE_IV= 177; +const int AR_SPELL_WALL_OF_FIRE= 191; +const int AR_SPELL_AURA_COLD= 196; +const int AR_SPELL_AURA_ELECTRICITY= 197; +const int AR_SPELL_AURA_FEAR= 198; +const int AR_SPELL_AURA_FIRE= 199; +const int AR_SPELL_ICE_STORM= 368; +const int AR_SPELL_EVARDS_BLACK_TENTACLES= 375; +const int AR_SPELL_INFLICT_CRITICAL_WOUNDS= 435; +const int AR_SPELL_ISAACS_LESSER_MISSILE_STORM= 447; +const int AR_SPELL_MASS_CAMOFLAGE= 455; +const int AR_SPELL_HOLY_SWORD2=538; +const int AR_SPELL_HEATEXHAUSTION= 2002; +const int AR_SPELL_MAGMABLADE= 2007; +const int AR_SPELL_SILTSPRAY= 2008; +const int AR_SPELL_ACIDRAIN= 2011; +const int AR_SPELL_BACKLASH_PRES= 2020; +const int AR_SPELL_MASS_ULTRAVISION= 2231; +const int AR_SPELL_LOWER_SPELL_RESISTANCE= 2232; +const int AR_SPELL_LEGIONS_SHIELD_OF_FAITH= 2242; +const int AR_SPELL_SONIC_ORB= 2254; +//3rd level +const int AR_SPELL_ANIMATE_DEAD= 2; +const int AR_SPELL_BESTOW_CURSE= 4; +const int AR_SPELL_CALL_LIGHTNING= 11; +const int AR_SPELL_CHARM_MONSTER= 15; +const int AR_SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE= 20; +const int AR_SPELL_CONFUSION= 26; +const int AR_SPELL_CONTAGION= 27; +const int AR_SPELL_CURE_SERIOUS_WOUNDS= 35; +const int AR_SPELL_DISPEL_MAGIC= 41; +const int AR_SPELL_DOMINATE_ANIMAL= 43; +const int AR_SPELL_FEAR= 54; +const int AR_SPELL_FIREBALL= 58; +const int AR_SPELL_FLAME_ARROW= 59; +const int AR_SPELL_GREATER_MAGIC_WEAPON= 68; +const int AR_SPELL_GUST_OF_WIND= 75; +const int AR_SPELL_HASTE= 78; +const int AR_SPELL_INVISIBILITY_PURGE= 91; +const int AR_SPELL_INVISIBILITY_SPHERE= 92; +const int AR_SPELL_LIGHTNING_BOLT= 101; +const int AR_SPELL_MAGIC_VESTMENT= 108; +const int AR_SPELL_NEGATIVE_ENERGY_PROTECTION= 125; +const int AR_SPELL_NEUTRALIZE_POISON= 126; +const int AR_SPELL_POISON= 129; +const int AR_SPELL_PRAYER= 133; +const int AR_SPELL_PROTECTION_FROM_ELEMENTS= 137; +const int AR_SPELL_REMOVE_BLINDNESS_AND_DEAFNESS= 145; +const int AR_SPELL_REMOVE_CURSE= 146; +const int AR_SPELL_REMOVE_DISEASE= 147; +const int AR_SPELL_SEARING_LIGHT= 156; +const int AR_SPELL_SLOW= 166; +const int AR_SPELL_STINKING_CLOUD= 171; +const int AR_SPELL_SUMMON_CREATURE_III= 176; +const int AR_SPELL_VAMPIRIC_TOUCH= 188; +const int AR_SPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT= 322; +const int AR_SPELL_NEGATIVE_ENERGY_BURST= 370; +const int AR_SPELL_WAR_CRY= 373; +const int AR_SPELL_FIND_TRAPS= 377; +const int AR_SPELL_QUILLFIRE= 425; +const int AR_SPELL_INFLICT_SERIOUS_WOUNDS= 434; +const int AR_SPELL_WOUNDING_WHISPERS= 441; +const int AR_SPELL_GREATER_MAGIC_FANG= 453; +const int AR_SPELL_SPIKE_GROWTH= 454; +const int AR_SPELL_DISPLACEMENT= 458; +const int AR_SPELL_CLAIRAUDIENCE=480; +const int AR_SPELL_INFESTATION_OF_MAGGOTS= 513; +const int AR_SPELL_HEALING_STING= 514; +const int AR_SPELL_MESTILS_ACID_BREATH= 523; +const int AR_SPELL_SCINTILLATING_SPHERE= 526; +const int AR_SPELL_BLADE_THIRST= 535; +const int AR_SPELL_KEEN_EDGE = 539; +const int AR_SPELL_GREATERMAGICWEAPON=545; +const int AR_SPELLMAGICVESTMENT= 546; +const int AR_SPELL_DARKFIRE= 548; +const int AR_SPELL_GLYPH_OF_WARDING=549; +const int AR_SPELL_SUNBLADE=2001; +const int AR_SPELL_SOOTHE=2010; +const int AR_SPELL_ELEMENTALIMBUEMENT=2012; +const int AR_SPELL_WATERBREATHING= 2013; +const int AR_SPELL_BRAMBLEWOOD= 2015; +const int AR_SPELL_CONSEVATION_PRES= 2018; +const int AR_SPELL_TOUCHTHEBLACK= 2019; +const int AR_SPELL_ONHITBANEOFDEFILERS= 2023; +const int AR_SPELL_FORCEBLAST= 2235; +const int AR_SPELL_LEGIONS_CURSE_OF_IMPENDING_BLADES= 2239; +const int AR_SPELL_CURSE_OF_PETTY_FAILING= 2240; +const int AR_SPELL_SPIDERSKIN= 2245; +const int AR_SPELL_GREENFIRE= 2247; +const int AR_SPELL_SERPENTS_SIGH= 2257; +//2nd level +const int AR_SPELL_AID= 1; +const int AR_SPELL_BARKSKIN= 3; +const int AR_SPELL_BLINDNESS_AND_DEAFNESS= 8; +const int AR_SPELL_BULLS_STRENGTH= 9; +const int AR_SPELL_CATS_GRACE= 13; +const int AR_SPELL_CHARM_PERSON_OR_ANIMAL= 17; +const int AR_SPELL_CLARITY= 21; +const int AR_SPELL_CURE_MODERATE_WOUNDS= 34; +const int AR_SPELL_DARKNESS= 36; +const int AR_SPELL_ENDURANCE= 49; +const int AR_SPELL_FLAME_LASH= 60; +const int AR_SPELL_GHOUL_TOUCH= 64; +const int AR_SPELL_HOLD_ANIMAL= 81; +const int AR_SPELL_HOLD_PERSON= 83; +const int AR_SPELL_IDENTIFY= 86; +const int AR_SPELL_INVISIBILITY= 90; +const int AR_SPELL_KNOCK= 93; +const int AR_SPELL_LESSER_DISPEL= 94; +const int AR_SPELL_LESSER_RESTORATION= 97; +const int AR_SPELL_MELFS_ACID_ARROW= 115; +const int AR_SPELL_GHOSTLY_VISAGE= 120; +const int AR_SPELL_REMOVE_PARALYSIS= 149; +const int AR_SPELL_RESIST_ELEMENTS= 150; +const int AR_SPELL_SEE_INVISIBILITY= 157; +const int AR_SPELL_SILENCE= 163; +const int AR_SPELL_SOUND_BURST= 167; +const int AR_SPELL_SUMMON_CREATURE_II= 175; +const int AR_SPELL_WEB= 192; +const int AR_SPELL_LESSER_BODY_ADJUSTMENT= 277; +const int AR_SPELL_EAGLE_SPLENDOR= 354; +const int AR_SPELL_OWLS_WISDOM= 355; +const int AR_SPELL_FOXS_CUNNING= 356; +const int AR_SPELL_ULTRAVISION= 365; +const int AR_SPELL_CONTINUAL_FLAME= 419; +const int AR_SPELL_ONE_WITH_THE_LAND= 420; +const int AR_SPELL_BLOOD_FRENZY= 422; +const int AR_SPELL_AURAOFGLORY= 429; +const int AR_SPELL_INFLICT_MODERATE_WOUNDS= 433; +const int AR_SPELL_BALAGARNSIRONHORN= 436; +const int AR_SPELL_TASHAS_HIDEOUS_LAUGHTER= 457; +const int AR_SPELLCATSGRACE=481; +const int AR_SPELLEAGLESPLENDOR= 482; +const int AR_SPELL_INVISIBILITY2= 483; +const int AR_SPELL_COMBUST= 518; +const int AR_SPELL_DEATH_ARMOR= 519; +const int AR_SPELL_GEDLEES_ELECTRIC_LOOP= 520; +const int AR_SPELL_STONE_BONES= 527; +const int AR_SPELL_FLAME_WEAPON= 542; +const int AR_SPELL_AURAOFGLORY_X2= 562; +const int AR_SPELL_CLOUD_OF_BEWILDERMENT= 569; +const int AR_SPELL_GLYPHOFWARDINGDEFAULT= 764; +const int AR_SPELL_MAGMAJET= 2006; +const int AR_SPELL_MIGHTOFSORCKING= 2101; +const int AR_SPELL_HEROISM= 2233; +const int AR_SPELL_BALEFUL_TRANSPOSITION= 2236; +const int AR_SPELL_CURSE_OF_IMPENDING_BLADES= 2238; +const int AR_SPELL_CREATE_MAGIC_TATOO= 2243; +const int AR_SPELL_GLITTERDUST= 2250; +//1st level +const int AR_SPELL_BLESS= 6; +const int AR_SPELL_BLESS_WEAPON= 7; +const int AR_SPELL_BURNING_HANDS= 10; +const int AR_SPELL_CALM_EMOTIONS= 12; +const int AR_SPELL_CHARM_PERSON= 16; +const int AR_SPELL_COLOR_SPRAY= 24; +const int AR_SPELL_CURE_LIGHT_WOUNDS= 32; +const int AR_SPELL_DOOM= 46; +const int AR_SPELL_ENDURE_ELEMENTS= 50; +const int AR_SPELL_ENTANGLE= 53; +const int AR_SPELL_GREASE= 66; +const int AR_SPELL_MAGE_ARMOR= 102; +const int AR_SPELL_MAGIC_MISSILE= 107; +const int AR_SPELL_MAGIC_WEAPON= 109; +const int AR_SPELL_RAY_OF_ENFEEBLEMENT= 143; +const int AR_SPELL_REMOVE_FEAR= 148; +const int AR_SPELL_RESISTANCE= 151; +const int AR_SPELL_SANCTUARY= 154; +const int AR_SPELL_SCARE= 155; +const int AR_SPELL_SLEEP= 165; +const int AR_SPELL_SUMMON_CREATURE_I= 174; +const int AR_SPELL_REMOVEDISEASE= 316; +const int AR_SPELL_PROTECTION_FROM_ALIGNMENT= 321; +const int AR_SPELL_NEGATIVE_ENERGY_RAY= 371; +const int AR_SPELL_DIVINE_FAVOR= 414; +const int AR_SPELL_TRUE_STRIKE= 415; +const int AR_SPELL_SHIELD= 417; +const int AR_SPELL_ENTROPIC_SHIELD= 418; +const int AR_SPELL_CAMOFLAGE= 421; +const int AR_SPELL_INFLICT_LIGHT_WOUNDS= 432; +const int AR_SPELL_AMPLIFY= 442; +const int AR_SPELL_BANE= 449; +const int AR_SPELL_SHIELD_OF_FAITH= 450; +const int AR_SPELL_MAGIC_FANG= 452; +const int AR_SPELL_EXPEDITIOUS_RETREAT= 456; +const int AR_SPELL_HORIZIKAULS_BOOM= 521; +const int AR_SPELL_IRONGUTS= 522; +const int AR_SPELL_SHELGARNS_PERSISTENT_BLADE= 534; +const int AR_SPELL_DEAFENING_CLANG= 536; +const int AR_SPELL_BLESSWEAPON= 537; +const int AR_SPELL_ICE_DAGGER= 543; +const int AR_SPELL_MAGICWEAPON= 544; +const int AR_SPELL_WHIRLWIND= 561; +const int AR_SPELL_CREATEWATER= 2005; +const int AR_SPELL_HANDOFSORCKING= 2100; +const int AR_SPELL_BENIGN_TRANSPOSITION= 2237; +const int AR_SPELL_LESSER_SONIC_ORB= 2255; + +//Set to false to suppress debug messages. +const int nStealSpellDebug = FALSE; + + +const int nSpellLevel1 = 1; +const int nSpellLevel2 = 2; +const int nSpellLevel3 = 3; +const int nSpellLevel4 = 4; +const int nSpellLevel5 = 5; +const int nSpellLevel6 = 6; +const int nSpellLevel7 = 7; +const int nSpellLevel8 = 8; +const int nSpellLevel9 = 9; + + +//Status response text for the target +const string RESPONSE_TARGET_SPELL_STOLEN = "You have lost a spell of Level: "; +const string RESPONSE_TARGET_SPELL_NOT_STOLEN = "You have sucsesfully stopped the Defiler's atempt to drain you."; +//status response text for the caster. +const string RESPONSE_CASTER_SPELL_STOLEN = "You have sucsesfully stolen energy from the target."; +const string RESPONSE_CASTER_SPELL_NOT_STOLEN = "Target Passed save."; + +// Main function to steal a spell +// oTarget = Target to steal from +// nDC = Caster DC +// nTargetSave = Target Save DC +// nSaveVs = SAVE_VS_* +//nSpellLevel = Level Of spell To Steal. +int ARStealSpell(object oCaster,object oTarget,int nSpellLevel,int nMETA); + +// Returns true if oTarget Has Spell of level nSpellLevel. +int ARHasSpellLevel(object oTarget,int nSpellLevel); + +// Returns true if oTarget Has Spell Casting Abilities. +int ARGetIsCaster(object oTarget); + +//Returns true if oPC has taken levels in nClas : CLASS_TYPE_* +int ARGetHasClass(int nCLASS, object oPC); + +//debug +void ARdebug( string sMessage ); + +// Returns true if oTarget Has Spell Casting Abilities. +int ARGetIsCaster(object oTarget) +{ +/* + if(nStealSpellDebug) + { + ARdebug("Checking Target for caster levels..."); + } + */ + int nReturn=0; + + if(ARGetHasClass(CLASS_TYPE_CLERIC,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_BARD,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_DRUID,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_RANGER,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_PALADIN,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_SORCERER,oTarget))nReturn++; + if(ARGetHasClass(CLASS_TYPE_WIZARD,oTarget))nReturn++; + /* + + if(nStealSpellDebug) + { + if(nReturn >= 1) + ARdebug("Target has caster levels..."); + } + else + { + ARdebug("Target no caster levels..."); + }*/ + + + if(nReturn >=1)return TRUE; + return FALSE; + + +} + + +int ARGetHasClass(int nCLASS, object oPC) + { + + if (GetLevelByClass(nCLASS, oPC)>=1) + { + return TRUE; + } + else + { + return FALSE; + } + } + + +//Main function to atempt steal +int ARStealSpell(object oCaster,object oTarget,int nSpellLevel,int nMETA) +{ + int nModCHA = GetAbilityModifier(ABILITY_CHARISMA,oCaster); + //roll heal points + int nHpLevel1 = d2(1) + nModCHA; + int nHpLevel2 = d2(1) + nModCHA; + int nHpLevel3 = d4(1) + nModCHA; + int nHpLevel4 = d4(1) + nModCHA; + int nHpLevel5 = d6(1) + nModCHA; + int nHpLevel6 = d8(1) + nModCHA; + int nHpLevel7 = d10(1) + nModCHA; + int nHpLevel8 = d12(1) + nModCHA; + int nHpLevel9 = d20(1) + nModCHA; + + if(nMETA==METAMAGIC_EMPOWER) + { + nHpLevel1 = nHpLevel1+(nHpLevel1/2); + nHpLevel2 = nHpLevel2+(nHpLevel2/2); + nHpLevel3 = nHpLevel3+(nHpLevel3/2); + nHpLevel4 = nHpLevel4+(nHpLevel4/2); + nHpLevel5 = nHpLevel5+(nHpLevel5/2); + nHpLevel6 = nHpLevel6+(nHpLevel6/2); + nHpLevel7 = nHpLevel7+(nHpLevel7/2); + nHpLevel8 = nHpLevel8+(nHpLevel8/2); + nHpLevel9 = nHpLevel9+(nHpLevel9/2); + } + if(nMETA==METAMAGIC_MAXIMIZE) + { + nHpLevel1 = 2+nModCHA; + nHpLevel2 = 2+nModCHA; + nHpLevel3 = 4+nModCHA; + nHpLevel4 = 4+nModCHA; + nHpLevel5 = 6+nModCHA; + nHpLevel6 = 8+nModCHA; + nHpLevel7 = 10+nModCHA; + nHpLevel8 = 12+nModCHA; + nHpLevel9 = 20+nModCHA; + } + + + effect eVis9 =EffectVisualEffect(VFX_IMP_EVIL_HELP); + effect eVis8 =EffectVisualEffect(VFX_IMP_HEALING_G); + effect eVis67 =EffectVisualEffect(VFX_IMP_HEALING_L); + effect eVis45 =EffectVisualEffect(VFX_IMP_HEALING_M); + effect eVis13 =EffectVisualEffect(VFX_IMP_HEALING_S); + effect eNeg = EffectVisualEffect(VFX_IMP_DESTRUCTION); + effect eHeal; + effect eLink; + + switch(nSpellLevel) + { + case nSpellLevel9: + { + eHeal = EffectHeal(nHpLevel9); + eLink = EffectLinkEffects(eVis9,eHeal); + eLink = EffectLinkEffects(EffectVisualEffect(VFX_IMP_HARM),eVis9); + + if(GetHasSpell(AR_SPELL_DOMINATE_MONSTER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DOMINATE_MONSTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ELEMENTAL_SWARM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ELEMENTAL_SWARM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + if(GetHasSpell(AR_SPELL_ENERGY_DRAIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENERGY_DRAIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + + return FALSE; + } + if(GetHasSpell(AR_SPELL_GATE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GATE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_SPELL_MANTLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_SPELL_MANTLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_IMPLOSION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_IMPLOSION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_DOMINATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_DOMINATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_METEOR_SWARM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_METEOR_SWARM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MORDENKAINENS_DISJUNCTION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MORDENKAINENS_DISJUNCTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_POWER_WORD_KILL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_POWER_WORD_KILL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHAPECHANGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHAPECHANGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STORM_OF_VENGEANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STORM_OF_VENGEANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_IX,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_IX); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TIME_STOP,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TIME_STOP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WAIL_OF_THE_BANSHEE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WAIL_OF_THE_BANSHEE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WEIRD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WEIRD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_UNDEATHS_ETERNAL_FOE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_UNDEATHS_ETERNAL_FOE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BIGBYS_CRUSHING_HAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BIGBYS_CRUSHING_HAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLACK_BLADE_OF_DISASTER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLACK_BLADE_OF_DISASTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TIDE_OF_BATTLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TIDE_OF_BATTLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DEHYDRATE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DEHYDRATE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SILTSTORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SILTSTORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CALLOFTHEKING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CALLOFTHEKING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_DROWN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_DROWN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NATURE_AVATAR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NATURE_AVATAR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_UNYIELDING_ROOTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_UNYIELDING_ROOTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + return FALSE; + + } + + case nSpellLevel8: + { + eHeal = EffectHeal(nHpLevel8); + eLink = EffectLinkEffects(eVis8,eHeal); + + if(GetHasSpell(AR_SPELL_CREATE_GREATER_UNDEAD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CREATE_GREATER_UNDEAD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + if(GetHasSpell(AR_SPELL_GREATER_PLANAR_BINDING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_PLANAR_BINDING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INCENDIARY_CLOUD,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INCENDIARY_CLOUD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_BLINDNESS_AND_DEAFNESS,oTarget)>1){} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_BLINDNESS_AND_DEAFNESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_CHARM,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_CHARM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_HEAL,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_HEAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MIND_BLANK,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MIND_BLANK); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NATURES_BALANCE,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NATURES_BALANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PREMONITION,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PREMONITION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VIII,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_VIII); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_VERSUS_ALIGNMENT ,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_VERSUS_ALIGNMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HORRID_WILTING,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HORRID_WILTING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BOMBARDMENT,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BOMBARDMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_EARTHQUAKE,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_EARTHQUAKE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUNBURST,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUNBURST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BIGBYS_CLENCHED_FIST,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BIGBYS_CLENCHED_FIST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLACKSTAFF,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLACKSTAFF); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_OBSIDIANDEATH_DEF,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_OBSIDIANDEATH_DEF); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_HOLD_MONSTER,oTarget)>1) {} + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_HOLD_MONSTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_WALL_OF_DISPEL_MAGIC,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_WALL_OF_DISPEL_MAGIC); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + } + + + case nSpellLevel7: + { + eHeal = EffectHeal(nHpLevel7); + eLink = EffectLinkEffects(eVis67,eHeal); + + if(GetHasSpell(AR_SPELL_CONTROL_UNDEAD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONTROL_UNDEAD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DELAYED_BLAST_FIREBALL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DELAYED_BLAST_FIREBALL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FINGER_OF_DEATH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FINGER_OF_DEATH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FIRE_STORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FIRE_STORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_RESTORATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_RESTORATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MORDENKAINENS_SWORD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MORDENKAINENS_SWORD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_POWER_WORD_STUN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_POWER_WORD_STUN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PRISMATIC_SPRAY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PRISMATIC_SPRAY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_SPELLS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PROTECTION_FROM_SPELLS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RESURRECTION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RESURRECTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHADOW_SHIELD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHADOW_SHIELD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SPELL_MANTLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SPELL_MANTLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VII,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_VII); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUNBEAM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUNBEAM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WORD_OF_FAITH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WORD_OF_FAITH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CREEPING_DOOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CREEPING_DOOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DESTRUCTION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DESTRUCTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_OF_VITALITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_OF_VITALITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REGENERATE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REGENERATE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ETHEREALNESS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ETHEREALNESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BIGBYS_GRASPING_HAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BIGBYS_GRASPING_HAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREAT_THUNDERCLAP,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREAT_THUNDERCLAP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ETHEREALNESS2,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ETHEREALNESS2); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BANEOFDEFILERS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BANEOFDEFILERS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WORD_OF_BALANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WORD_OF_BALANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_HOLD_PERSON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_HOLD_PERSON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + } + + case nSpellLevel6: + { + eHeal = EffectHeal(nHpLevel6); + eLink = EffectLinkEffects(eVis67,eHeal); + + if(GetHasSpell(AR_SPELL_ACID_FOG,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ACID_FOG); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLADE_BARRIER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLADE_BARRIER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CHAIN_LIGHTNING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CHAIN_LIGHTNING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CIRCLE_OF_DEATH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CIRCLE_OF_DEATH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CREATE_UNDEAD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CREATE_UNDEAD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GLOBE_OF_INVULNERABILITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GLOBE_OF_INVULNERABILITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_SPELL_BREACH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_SPELL_BREACH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_STONESKIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_STONESKIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HARM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HARM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_HASTE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_HASTE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PLANAR_BINDING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PLANAR_BINDING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VI,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_VI); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TENSERS_TRANSFORMATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TENSERS_TRANSFORMATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BANISHMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BANISHMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DROWN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DROWN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DIRGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DIRGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ISAACS_GREATER_MISSILE_STORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ISAACS_GREATER_MISSILE_STORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PLANAR_ALLY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PLANAR_ALLY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BIGBYS_FORCEFUL_HAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BIGBYS_FORCEFUL_HAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FLESH_TO_STONE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FLESH_TO_STONE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STONE_TO_FLESH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STONE_TO_FLESH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CRUMBLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CRUMBLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_UNDEATH_TO_DEATH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_UNDEATH_TO_DEATH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STONEHOLD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STONEHOLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_SHADOW_X2,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_SHADOW_X2); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUNSTROKE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUNSTROKE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEARTSEEKER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEARTSEEKER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_BULLS_STRENGTH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_BULLS_STRENGTH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_CATS_GRACE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_CATS_GRACE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_EAGLE_SPLENDOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_EAGLE_SPLENDOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_ENDURANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_ENDURANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_FOXS_CUNNING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_FOXS_CUNNING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_OWLS_WISDOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_OWLS_WISDOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ACID_STORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ACID_STORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DISINTEGRATE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DISINTEGRATE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + } + + case nSpellLevel5: + { + eHeal = EffectHeal(nHpLevel5); + eLink = EffectLinkEffects(eVis45,eHeal); + + if(GetHasSpell(AR_SPELL_CIRCLE_OF_DOOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CIRCLE_OF_DOOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CLOUDKILL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CLOUDKILL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONE_OF_COLD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONE_OF_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FEEBLEMIND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FEEBLEMIND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_DISPELLING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_DISPELLING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEALING_CIRCLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEALING_CIRCLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_MIND_BLANK,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_MIND_BLANK); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_PLANAR_BINDING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_PLANAR_BINDING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_SPELL_MANTLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_SPELL_MANTLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MIND_FOG,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MIND_FOG); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ETHEREAL_VISAGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ETHEREAL_VISAGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RAISE_DEAD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RAISE_DEAD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SLAY_LIVING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SLAY_LIVING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SPELL_RESISTANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SPELL_RESISTANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SPHERE_OF_CHAOS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SPHERE_OF_CHAOS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_V,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_V); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRUE_SEEING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRUE_SEEING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_BLINDING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_BLINDING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_STUN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_STUN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONE_ACID,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONE_ACID); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONE_COLD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONE_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AWAKEN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AWAKEN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENERGY_BUFFER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENERGY_BUFFER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LEGEND_LORE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LEGEND_LORE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_MEPHIT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_MEPHIT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CELESTIAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CELESTIAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_OWLS_INSIGHT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_OWLS_INSIGHT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FIREBRAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FIREBRAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFERNO,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFERNO); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BIGBYS_INTERPOSING_HAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BIGBYS_INTERPOSING_HAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRAP_ARROW,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRAP_ARROW); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRAP_BOLT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRAP_BOLT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRAP_DART,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRAP_DART); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRAP_SHURIKEN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRAP_SHURIKEN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BREATH_PETRIFY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BREATH_PETRIFY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TOUCH_PETRIFY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TOUCH_PETRIFY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BALL_LIGHTNING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BALL_LIGHTNING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BATTLETIDE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BATTLETIDE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MESTILS_ACID_SHEATH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MESTILS_ACID_SHEATH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MONSTROUS_REGENERATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MONSTROUS_REGENERATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_VINE_MINE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_VINE_MINE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_EVIL_BLIGHT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_EVIL_BLIGHT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STEALENERGY_DEF,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STEALENERGY_DEF); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WISDOMOFSORCKING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WISDOMOFSORCKING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_HEROISM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_HEROISM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LEGIONS_CURSE_OF_PETTY_FAILING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LEGIONS_CURSE_OF_PETTY_FAILING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + } + + case nSpellLevel4: + { + eHeal = EffectHeal(nHpLevel4); + eLink = EffectLinkEffects(eVis45,eHeal); + + if(GetHasSpell(AR_SPELL_CURE_CRITICAL_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURE_CRITICAL_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DEATH_WARD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DEATH_WARD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DISMISSAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DISMISSAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DIVINE_POWER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DIVINE_POWER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DOMINATE_PERSON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DOMINATE_PERSON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ELEMENTAL_SHIELD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ELEMENTAL_SHIELD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENERVATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENERVATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FLAME_STRIKE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FLAME_STRIKE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FREEDOM_OF_MOVEMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FREEDOM_OF_MOVEMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HAMMER_OF_THE_GODS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HAMMER_OF_THE_GODS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HOLD_MONSTER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HOLD_MONSTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HOLY_SWORD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HOLY_SWORD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_IMPROVED_INVISIBILITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_IMPROVED_INVISIBILITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_SPELL_BREACH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_SPELL_BREACH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MINOR_GLOBE_OF_INVULNERABILITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PHANTASMAL_KILLER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PHANTASMAL_KILLER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RESTORATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RESTORATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHADOW_CONJURATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHADOW_CONJURATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STONESKIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STONESKIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_IV,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_IV); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WALL_OF_FIRE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WALL_OF_FIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_COLD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_ELECTRICITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_ELECTRICITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_FEAR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_FEAR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURA_FIRE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURA_FIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ICE_STORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ICE_STORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_EVARDS_BLACK_TENTACLES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_EVARDS_BLACK_TENTACLES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFLICT_CRITICAL_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFLICT_CRITICAL_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ISAACS_LESSER_MISSILE_STORM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ISAACS_LESSER_MISSILE_STORM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_CAMOFLAGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_CAMOFLAGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HOLY_SWORD2,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HOLY_SWORD2); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEATEXHAUSTION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEATEXHAUSTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGMABLADE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGMABLADE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SILTSPRAY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SILTSPRAY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ACIDRAIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ACIDRAIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BACKLASH_PRES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BACKLASH_PRES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MASS_ULTRAVISION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MASS_ULTRAVISION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LOWER_SPELL_RESISTANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LOWER_SPELL_RESISTANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LEGIONS_SHIELD_OF_FAITH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LEGIONS_SHIELD_OF_FAITH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SONIC_ORB,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SONIC_ORB); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + + } + + case nSpellLevel3: + { + eHeal = EffectHeal(nHpLevel3); + eLink = EffectLinkEffects(eVis13,eHeal); + + if(GetHasSpell(AR_SPELL_ANIMATE_DEAD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ANIMATE_DEAD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BESTOW_CURSE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BESTOW_CURSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CALL_LIGHTNING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CALL_LIGHTNING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CHARM_MONSTER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CHARM_MONSTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONFUSION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONFUSION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONTAGION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONTAGION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CURE_SERIOUS_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURE_SERIOUS_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DISPEL_MAGIC,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DISPEL_MAGIC); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DOMINATE_ANIMAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DOMINATE_ANIMAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FEAR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FEAR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FIREBALL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FIREBALL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + + return FALSE; + } + if(GetHasSpell(AR_SPELL_FLAME_ARROW,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FLAME_ARROW); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_MAGIC_WEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_MAGIC_WEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GUST_OF_WIND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GUST_OF_WIND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HASTE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HASTE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INVISIBILITY_PURGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INVISIBILITY_PURGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INVISIBILITY_SPHERE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INVISIBILITY_SPHERE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LIGHTNING_BOLT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LIGHTNING_BOLT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGIC_VESTMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGIC_VESTMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_PROTECTION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NEGATIVE_ENERGY_PROTECTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NEUTRALIZE_POISON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NEUTRALIZE_POISON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_POISON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_POISON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PRAYER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PRAYER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_ELEMENTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PROTECTION_FROM_ELEMENTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVE_BLINDNESS_AND_DEAFNESS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVE_BLINDNESS_AND_DEAFNESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVE_CURSE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVE_CURSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVE_DISEASE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVE_DISEASE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SEARING_LIGHT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SEARING_LIGHT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SLOW,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SLOW); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STINKING_CLOUD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STINKING_CLOUD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_III,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_III); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_VAMPIRIC_TOUCH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_VAMPIRIC_TOUCH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_BURST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NEGATIVE_ENERGY_BURST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WAR_CRY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WAR_CRY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FIND_TRAPS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FIND_TRAPS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_QUILLFIRE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_QUILLFIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFLICT_SERIOUS_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFLICT_SERIOUS_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WOUNDING_WHISPERS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WOUNDING_WHISPERS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATER_MAGIC_FANG,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATER_MAGIC_FANG); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SPIKE_GROWTH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SPIKE_GROWTH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DISPLACEMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DISPLACEMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CLAIRAUDIENCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CLAIRAUDIENCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFESTATION_OF_MAGGOTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFESTATION_OF_MAGGOTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEALING_STING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEALING_STING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MESTILS_ACID_BREATH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MESTILS_ACID_BREATH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SCINTILLATING_SPHERE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SCINTILLATING_SPHERE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLADE_THIRST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLADE_THIRST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_KEEN_EDGE ,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_KEEN_EDGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREATERMAGICWEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREATERMAGICWEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELLMAGICVESTMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELLMAGICVESTMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DARKFIRE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DARKFIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GLYPH_OF_WARDING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GLYPH_OF_WARDING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUNBLADE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUNBLADE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SOOTHE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SOOTHE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ELEMENTALIMBUEMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ELEMENTALIMBUEMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WATERBREATHING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WATERBREATHING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BRAMBLEWOOD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BRAMBLEWOOD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONSEVATION_PRES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONSEVATION_PRES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TOUCHTHEBLACK,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TOUCHTHEBLACK); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + if(GetHasSpell(AR_SPELL_FORCEBLAST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FORCEBLAST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LEGIONS_CURSE_OF_IMPENDING_BLADES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LEGIONS_CURSE_OF_IMPENDING_BLADES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CURSE_OF_PETTY_FAILING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURSE_OF_PETTY_FAILING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SPIDERSKIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SPIDERSKIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREENFIRE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREENFIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SERPENTS_SIGH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SERPENTS_SIGH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + + } + + case nSpellLevel2: + { + eHeal = EffectHeal(nHpLevel2); + eLink = EffectLinkEffects(eVis13,eHeal); + + + if(GetHasSpell(AR_SPELL_AID,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AID); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BARKSKIN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BARKSKIN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLINDNESS_AND_DEAFNESS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLINDNESS_AND_DEAFNESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + if(GetHasSpell(AR_SPELL_BULLS_STRENGTH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BULLS_STRENGTH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CATS_GRACE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CATS_GRACE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CHARM_PERSON_OR_ANIMAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CLARITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CLARITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CURE_MODERATE_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURE_MODERATE_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DARKNESS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DARKNESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENDURANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENDURANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FLAME_LASH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FLAME_LASH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GHOUL_TOUCH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GHOUL_TOUCH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HOLD_ANIMAL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HOLD_ANIMAL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HOLD_PERSON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HOLD_PERSON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_IDENTIFY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_IDENTIFY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INVISIBILITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INVISIBILITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_KNOCK,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_KNOCK); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_DISPEL,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_DISPEL); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_RESTORATION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_RESTORATION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MELFS_ACID_ARROW,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MELFS_ACID_ARROW); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GHOSTLY_VISAGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GHOSTLY_VISAGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVE_PARALYSIS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVE_PARALYSIS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RESIST_ELEMENTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RESIST_ELEMENTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SEE_INVISIBILITY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SEE_INVISIBILITY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SILENCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SILENCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SOUND_BURST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SOUND_BURST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_II,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_II); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WEB,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WEB); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_BODY_ADJUSTMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_BODY_ADJUSTMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_EAGLE_SPLENDOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_EAGLE_SPLENDOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_OWLS_WISDOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_OWLS_WISDOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FOXS_CUNNING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FOXS_CUNNING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ULTRAVISION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ULTRAVISION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CONTINUAL_FLAME,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CONTINUAL_FLAME); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ONE_WITH_THE_LAND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ONE_WITH_THE_LAND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLOOD_FRENZY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLOOD_FRENZY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURAOFGLORY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURAOFGLORY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFLICT_MODERATE_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFLICT_MODERATE_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BALAGARNSIRONHORN,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BALAGARNSIRONHORN); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TASHAS_HIDEOUS_LAUGHTER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TASHAS_HIDEOUS_LAUGHTER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELLCATSGRACE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELLCATSGRACE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELLEAGLESPLENDOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELLEAGLESPLENDOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INVISIBILITY2,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INVISIBILITY2); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_COMBUST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_COMBUST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DEATH_ARMOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DEATH_ARMOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GEDLEES_ELECTRIC_LOOP,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GEDLEES_ELECTRIC_LOOP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_STONE_BONES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_STONE_BONES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_FLAME_WEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_FLAME_WEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AURAOFGLORY_X2,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AURAOFGLORY_X2); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CLOUD_OF_BEWILDERMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CLOUD_OF_BEWILDERMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GLYPHOFWARDINGDEFAULT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GLYPHOFWARDINGDEFAULT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGMAJET,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGMAJET); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MIGHTOFSORCKING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MIGHTOFSORCKING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HEROISM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HEROISM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BALEFUL_TRANSPOSITION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BALEFUL_TRANSPOSITION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CURSE_OF_IMPENDING_BLADES,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURSE_OF_IMPENDING_BLADES); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CREATE_MAGIC_TATOO,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CREATE_MAGIC_TATOO); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GLITTERDUST,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GLITTERDUST); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + + } + + case nSpellLevel1: + { + + eHeal = EffectHeal(nHpLevel1); + eLink = EffectLinkEffects(eVis13,eHeal); + + if(GetHasSpell(AR_SPELL_BLESS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLESS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLESS_WEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLESS_WEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BURNING_HANDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BURNING_HANDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CALM_EMOTIONS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CALM_EMOTIONS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CHARM_PERSON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CHARM_PERSON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_COLOR_SPRAY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_COLOR_SPRAY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CURE_LIGHT_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CURE_LIGHT_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DOOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DOOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENDURE_ELEMENTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENDURE_ELEMENTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENTANGLE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENTANGLE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_GREASE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_GREASE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGE_ARMOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGE_ARMOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGIC_MISSILE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGIC_MISSILE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGIC_WEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGIC_WEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RAY_OF_ENFEEBLEMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RAY_OF_ENFEEBLEMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVE_FEAR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVE_FEAR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_RESISTANCE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_RESISTANCE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SANCTUARY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SANCTUARY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SCARE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SCARE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SLEEP,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SLEEP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_I,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SUMMON_CREATURE_I); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_REMOVEDISEASE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_REMOVEDISEASE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_ALIGNMENT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_PROTECTION_FROM_ALIGNMENT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_RAY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_NEGATIVE_ENERGY_RAY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DIVINE_FAVOR,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DIVINE_FAVOR); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_TRUE_STRIKE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_TRUE_STRIKE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHIELD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHIELD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ENTROPIC_SHIELD,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ENTROPIC_SHIELD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CAMOFLAGE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CAMOFLAGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_INFLICT_LIGHT_WOUNDS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_INFLICT_LIGHT_WOUNDS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_AMPLIFY,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_AMPLIFY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BANE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BANE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHIELD_OF_FAITH,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHIELD_OF_FAITH); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGIC_FANG,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGIC_FANG); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_EXPEDITIOUS_RETREAT,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_EXPEDITIOUS_RETREAT); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HORIZIKAULS_BOOM,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HORIZIKAULS_BOOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_IRONGUTS,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_IRONGUTS); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_SHELGARNS_PERSISTENT_BLADE,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_SHELGARNS_PERSISTENT_BLADE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_DEAFENING_CLANG,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_DEAFENING_CLANG); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BLESSWEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BLESSWEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_ICE_DAGGER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_ICE_DAGGER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_MAGICWEAPON,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_MAGICWEAPON); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_WHIRLWIND,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_WHIRLWIND); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_CREATEWATER,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_CREATEWATER); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_HANDOFSORCKING,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_HANDOFSORCKING); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_BENIGN_TRANSPOSITION,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_BENIGN_TRANSPOSITION); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + if(GetHasSpell(AR_SPELL_LESSER_SONIC_ORB,oTarget)>1) + { + if(MySavingThrow(SAVING_THROW_FORT,oTarget,GetSpellSaveDC(),SAVING_THROW_TYPE_NEGATIVE,oCaster)==0) + { + DecrementRemainingSpellUses(oTarget,AR_SPELL_LESSER_SONIC_ORB); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eLink,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNeg,oTarget); + return TRUE; + } + return FALSE; + } + } + + } + SendMessageToPC(oCaster,"Target has no energy left to consume..."); + return FALSE; + + +} + + + + + // Returns true if oTarget Has Spell of level nSpellLevel. +int ARHasSpellLevel(object oTarget,int nSpellLevel) +{ + int nReturn; + + switch(nSpellLevel) + { + case nSpellLevel9: + { + if(GetHasSpell(AR_SPELL_DOMINATE_MONSTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ELEMENTAL_SWARM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENERGY_DRAIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GATE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_SPELL_MANTLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_IMPLOSION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_DOMINATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_METEOR_SWARM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MORDENKAINENS_DISJUNCTION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_POWER_WORD_KILL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHAPECHANGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STORM_OF_VENGEANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_IX,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TIME_STOP,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WAIL_OF_THE_BANSHEE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WEIRD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_UNDEATHS_ETERNAL_FOE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BIGBYS_CRUSHING_HAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLACK_BLADE_OF_DISASTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TIDE_OF_BATTLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DEHYDRATE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SILTSTORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CALLOFTHEKING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_DROWN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NATURE_AVATAR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_UNYIELDING_ROOTS,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + } + + case nSpellLevel8: + { + if(GetHasSpell(AR_SPELL_CREATE_GREATER_UNDEAD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_PLANAR_BINDING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INCENDIARY_CLOUD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_BLINDNESS_AND_DEAFNESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_CHARM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_HEAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MIND_BLANK,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NATURES_BALANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PREMONITION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VIII,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_VERSUS_ALIGNMENT ,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HORRID_WILTING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BOMBARDMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_EARTHQUAKE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUNBURST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BIGBYS_CLENCHED_FIST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLACKSTAFF,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_OBSIDIANDEATH_DEF,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_HOLD_MONSTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_WALL_OF_DISPEL_MAGIC,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + + } + + + case nSpellLevel7: + { + if(GetHasSpell(AR_SPELL_CONTROL_UNDEAD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DELAYED_BLAST_FIREBALL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FINGER_OF_DEATH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FIRE_STORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_RESTORATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MORDENKAINENS_SWORD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_POWER_WORD_STUN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PRISMATIC_SPRAY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_SPELLS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RESURRECTION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHADOW_SHIELD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SPELL_MANTLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VII,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUNBEAM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WORD_OF_FAITH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CREEPING_DOOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DESTRUCTION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_OF_VITALITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REGENERATE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ETHEREALNESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BIGBYS_GRASPING_HAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREAT_THUNDERCLAP,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ETHEREALNESS2,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BANEOFDEFILERS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WORD_OF_BALANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_HOLD_PERSON,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + } + + case nSpellLevel6: + { + if(GetHasSpell(AR_SPELL_ACID_FOG,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLADE_BARRIER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CHAIN_LIGHTNING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CIRCLE_OF_DEATH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CREATE_UNDEAD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GLOBE_OF_INVULNERABILITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_SPELL_BREACH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_STONESKIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HARM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_HASTE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PLANAR_BINDING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_VI,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TENSERS_TRANSFORMATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BANISHMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DROWN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DIRGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ISAACS_GREATER_MISSILE_STORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PLANAR_ALLY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BIGBYS_FORCEFUL_HAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FLESH_TO_STONE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STONE_TO_FLESH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CRUMBLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_UNDEATH_TO_DEATH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STONEHOLD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_SHADOW_X2,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUNSTROKE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEARTSEEKER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_BULLS_STRENGTH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_CATS_GRACE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_EAGLE_SPLENDOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_ENDURANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_FOXS_CUNNING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_OWLS_WISDOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ACID_STORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DISINTEGRATE,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + } + + case nSpellLevel5: + { + if(GetHasSpell(AR_SPELL_CIRCLE_OF_DOOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CLOUDKILL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONE_OF_COLD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FEEBLEMIND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_DISPELLING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEALING_CIRCLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_MIND_BLANK,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_PLANAR_BINDING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_SPELL_MANTLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MIND_FOG,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ETHEREAL_VISAGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RAISE_DEAD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SLAY_LIVING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SPELL_RESISTANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SPHERE_OF_CHAOS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_V,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRUE_SEEING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_BLINDING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_STUN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONE_ACID,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONE_COLD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AWAKEN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENERGY_BUFFER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LEGEND_LORE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_MEPHIT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CELESTIAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_OWLS_INSIGHT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FIREBRAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFERNO,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BIGBYS_INTERPOSING_HAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRAP_ARROW,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRAP_BOLT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRAP_DART,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRAP_SHURIKEN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BREATH_PETRIFY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TOUCH_PETRIFY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BALL_LIGHTNING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BATTLETIDE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MESTILS_ACID_SHEATH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MONSTROUS_REGENERATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_VINE_MINE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_EVIL_BLIGHT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STEALENERGY_DEF,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WISDOMOFSORCKING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_HEROISM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LEGIONS_CURSE_OF_PETTY_FAILING,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + } + + case nSpellLevel4: + { + if(GetHasSpell(AR_SPELL_CURE_CRITICAL_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DEATH_WARD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DISMISSAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DIVINE_POWER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DOMINATE_PERSON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ELEMENTAL_SHIELD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENERVATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FLAME_STRIKE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FREEDOM_OF_MOVEMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HAMMER_OF_THE_GODS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HOLD_MONSTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HOLY_SWORD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_IMPROVED_INVISIBILITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_SPELL_BREACH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PHANTASMAL_KILLER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RESTORATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHADOW_CONJURATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STONESKIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_IV,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WALL_OF_FIRE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_COLD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_ELECTRICITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_FEAR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURA_FIRE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ICE_STORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_EVARDS_BLACK_TENTACLES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFLICT_CRITICAL_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ISAACS_LESSER_MISSILE_STORM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_CAMOFLAGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HOLY_SWORD2,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEATEXHAUSTION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGMABLADE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SILTSPRAY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ACIDRAIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BACKLASH_PRES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MASS_ULTRAVISION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LOWER_SPELL_RESISTANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LEGIONS_SHIELD_OF_FAITH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SONIC_ORB,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + + } + + case nSpellLevel3: + { + if(GetHasSpell(AR_SPELL_ANIMATE_DEAD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BESTOW_CURSE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CALL_LIGHTNING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CHARM_MONSTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONFUSION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONTAGION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CURE_SERIOUS_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DISPEL_MAGIC,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DOMINATE_ANIMAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FEAR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FIREBALL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FLAME_ARROW,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_MAGIC_WEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GUST_OF_WIND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HASTE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INVISIBILITY_PURGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INVISIBILITY_SPHERE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LIGHTNING_BOLT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGIC_VESTMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_PROTECTION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NEUTRALIZE_POISON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_POISON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PRAYER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_ELEMENTS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVE_BLINDNESS_AND_DEAFNESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVE_CURSE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVE_DISEASE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SEARING_LIGHT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SLOW,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STINKING_CLOUD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_III,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_VAMPIRIC_TOUCH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGIC_CIRCLE_AGAINST_ALIGNMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_BURST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WAR_CRY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FIND_TRAPS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_QUILLFIRE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFLICT_SERIOUS_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WOUNDING_WHISPERS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATER_MAGIC_FANG,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SPIKE_GROWTH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DISPLACEMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CLAIRAUDIENCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFESTATION_OF_MAGGOTS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEALING_STING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MESTILS_ACID_BREATH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SCINTILLATING_SPHERE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLADE_THIRST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_KEEN_EDGE ,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREATERMAGICWEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELLMAGICVESTMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DARKFIRE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GLYPH_OF_WARDING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUNBLADE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SOOTHE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ELEMENTALIMBUEMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WATERBREATHING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BRAMBLEWOOD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONSEVATION_PRES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TOUCHTHEBLACK,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ONHITBANEOFDEFILERS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FORCEBLAST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LEGIONS_CURSE_OF_IMPENDING_BLADES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CURSE_OF_PETTY_FAILING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SPIDERSKIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREENFIRE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SERPENTS_SIGH,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + + } + + case nSpellLevel2: + { + if(GetHasSpell(AR_SPELL_AID,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BARKSKIN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLINDNESS_AND_DEAFNESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BULLS_STRENGTH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CATS_GRACE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CLARITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CURE_MODERATE_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DARKNESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENDURANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FLAME_LASH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GHOUL_TOUCH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HOLD_ANIMAL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HOLD_PERSON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_IDENTIFY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INVISIBILITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_KNOCK,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_DISPEL,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_RESTORATION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MELFS_ACID_ARROW,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GHOSTLY_VISAGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVE_PARALYSIS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RESIST_ELEMENTS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SEE_INVISIBILITY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SILENCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SOUND_BURST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_II,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WEB,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_BODY_ADJUSTMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_EAGLE_SPLENDOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_OWLS_WISDOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FOXS_CUNNING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ULTRAVISION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CONTINUAL_FLAME,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ONE_WITH_THE_LAND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLOOD_FRENZY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURAOFGLORY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFLICT_MODERATE_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BALAGARNSIRONHORN,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TASHAS_HIDEOUS_LAUGHTER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELLCATSGRACE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELLEAGLESPLENDOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INVISIBILITY2,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_COMBUST,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DEATH_ARMOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GEDLEES_ELECTRIC_LOOP,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_STONE_BONES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_FLAME_WEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AURAOFGLORY_X2,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CLOUD_OF_BEWILDERMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GLYPHOFWARDINGDEFAULT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGMAJET,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MIGHTOFSORCKING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HEROISM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BALEFUL_TRANSPOSITION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CURSE_OF_IMPENDING_BLADES,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CREATE_MAGIC_TATOO,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GLITTERDUST,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + } + + case nSpellLevel1: + { + if(GetHasSpell(AR_SPELL_BLESS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLESS_WEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BURNING_HANDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CALM_EMOTIONS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CHARM_PERSON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_COLOR_SPRAY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CURE_LIGHT_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DOOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENDURE_ELEMENTS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENTANGLE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_GREASE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGE_ARMOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGIC_MISSILE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGIC_WEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RAY_OF_ENFEEBLEMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVE_FEAR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_RESISTANCE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SANCTUARY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SCARE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SLEEP,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SUMMON_CREATURE_I,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_REMOVEDISEASE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_PROTECTION_FROM_ALIGNMENT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_NEGATIVE_ENERGY_RAY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DIVINE_FAVOR,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_TRUE_STRIKE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHIELD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ENTROPIC_SHIELD,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CAMOFLAGE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_INFLICT_LIGHT_WOUNDS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_AMPLIFY,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BANE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHIELD_OF_FAITH,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGIC_FANG,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_EXPEDITIOUS_RETREAT,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HORIZIKAULS_BOOM,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_IRONGUTS,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_SHELGARNS_PERSISTENT_BLADE,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_DEAFENING_CLANG,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BLESSWEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_ICE_DAGGER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_MAGICWEAPON,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_WHIRLWIND,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_CREATEWATER,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_HANDOFSORCKING,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_BENIGN_TRANSPOSITION,oTarget)>1) nReturn+=1; + if(GetHasSpell(AR_SPELL_LESSER_SONIC_ORB,oTarget)>1) nReturn+=1; + + if(nReturn >=1)return TRUE; + return FALSE; + + } + } + + +return FALSE; + + +} + + +void ARdebug( string sMessage ) { + SendMessageToPC( GetFirstPC(), sMessage ); + SendMessageToAllDMs( sMessage ); + PrintString( sMessage ); +} +//void main(){} + + + diff --git a/nwnds_module/ar_inc_wow.ncs b/nwnds_module/ar_inc_wow.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ar_inc_wow.ncs differ diff --git a/nwnds_module/ar_inc_wow.nss b/nwnds_module/ar_inc_wow.nss new file mode 100644 index 000000000..3a7a295e3 --- /dev/null +++ b/nwnds_module/ar_inc_wow.nss @@ -0,0 +1,273 @@ +// If you want NPCs to lose the temporary item properties also change this to TRUE +const int DISPEL_NPCS_ALSO = FALSE; + +// Used to help check the clerics domains +const int AIR = 1; +const int EARTH = 2; +const int FIRE = 4; +const int WATER = 8; + +// Returns TRUE if the cleric should only pull down one (or more) specific elementals +int CheckClericSummon(int nSpellID); + +// The effect for the cleric summoning the elementals +effect ClericSummon(int nSpellID); + +// The resref of the elemental to summon +string ClericCreature(int nDomains, int nSpellID); + +// This will scan the items of the PC entering the module for properties not +// allowed and for duplicate items. This is called in the OnClientEnter script. +// Change nEnter to TRUE for entering scripts, otherwise this will be called in +// spell scripts with FALSE and it will not check for duplicate items then. +void ScanItems(object oPC, int nEnter = FALSE); + +// This checks to see if the item is a crafting duplicate or not. +int CheckForDupe(object oItem); + +// This checks the item for properties to strip. +void CheckProperties(object oItem); + + + + +// This will scan the items of the PC entering the module for properties not +// allowed and for duplicate items. This is called in the OnClientEnter script. +// Change nEnter to TRUE for entering scripts, otherwise this will be called in +// spell scripts with FALSE and it will not check for duplicate items then. +void ScanItems(object oPC, int nEnter = FALSE) +{ + if(GetIsDM(oPC) || (!GetIsPC(oPC) && DISPEL_NPCS_ALSO == FALSE)) return; + + object oItem; + int nNth; + + if(nEnter) + { + + for(nNth = 0; nNth <= 13; nNth++) + { + oItem = GetItemInSlot(nNth, oPC); + if(CheckForDupe(oItem)) + { + // This message will be sent to the player + SendMessageToPC(oPC, "You have been found with a duplicate item. It will be removed."); + DestroyObject(oItem, 0.1); + // This message will be sent to all DMS + SendMessageToAllDMs(GetName(oPC)+" has been found with a duplicate item, it has been destroyed."); + // This will log the message + WriteTimestampedLogEntry(GetName(oPC)+" has been found with a duplicate item, "+GetName(oItem)+", and it was destroyed."); + } + else + { + CheckProperties(oItem); + } + } + oItem = GetFirstItemInInventory(oPC); + while(GetIsObjectValid(oItem)) + { + if(CheckForDupe(oItem)) + { + // This message will be sent to the player + SendMessageToPC(oPC, "You have been found with a duplicate item. It will be removed."); + DestroyObject(oItem, 0.1); + // This message will be sent to all DMS + SendMessageToAllDMs(GetName(oPC)+" has been found with a duplicate item, it has been destroyed."); + // This will log the message + WriteTimestampedLogEntry(GetName(oPC)+" has been found with a duplicate item, "+GetName(oItem)+", and it was destroyed."); + } + else + { + CheckProperties(oItem); + } + oItem = GetNextItemInInventory(oPC); + } + } + else + { + for(nNth = 0; nNth <= 13; nNth++) + { + oItem = GetItemInSlot(nNth, oPC); + if(GetIsObjectValid(oItem)) CheckProperties(oItem); + } + oItem = GetFirstItemInInventory(oPC); + while(GetIsObjectValid(oItem)) + { + CheckProperties(oItem); + oItem = GetNextItemInInventory(oPC); + } + } +} + +// This checks to see if the item is a crafting duplicate or not. +int CheckForDupe(object oItem) +{ + return GetLocalInt(oItem, "ZEP_CR_TEMPITEM"); +} + +// This checks the item for properties to strip. +void CheckProperties(object oItem) +{ + itemproperty ipIP = GetFirstItemProperty(oItem); + int nDuration; + + while(GetIsItemPropertyValid(ipIP)) + { + nDuration = GetItemPropertyDurationType(ipIP); + + if(nDuration == DURATION_TYPE_TEMPORARY) + { + RemoveItemProperty(oItem, ipIP); + } + ipIP = GetNextItemProperty(oItem); + } +} + +string ClericCreature(int nDomains, int nSpellID) +{ + string sReturn; + int nCount; + if(nDomains & AIR) + { + nCount++; + } + if(nDomains & EARTH) + { + nCount++; + } + if(nDomains & FIRE) + { + nCount++; + } + if(nDomains & WATER) + { + nCount++; + } + + int nRoll = Random(nCount) + 1; + + switch(nRoll) + { + case 1: + { + if(nDomains & AIR) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_AIRHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_AIRGREAT"; + else sReturn = "NW_S_AIRELDER"; + } + else if(nDomains & EARTH) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_EARTHHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_EARTHGREAT"; + else sReturn = "NW_S_EARTHELDER"; + } + else if(nDomains & FIRE) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_FIREHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_FIREGREAT"; + else sReturn = "NW_S_FIREELDER"; + } + else + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_WATERHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_WATERGREAT"; + else sReturn = "NW_S_WATERELDER"; + } + break; + } + case 2: + { + if(nDomains & EARTH) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_EARTHHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_EARTHGREAT"; + else sReturn = "NW_S_EARTHELDER"; + } + else if(nDomains & FIRE) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_FIREHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_FIREGREAT"; + else sReturn = "NW_S_FIREELDER"; + } + else + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_WATERHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_WATERGREAT"; + else sReturn = "NW_S_WATERELDER"; + } + break; + } + case 3: + { + if(nDomains & FIRE) + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_FIREHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_FIREGREAT"; + else sReturn = "NW_S_FIREELDER"; + } + else + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_WATERHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_WATERGREAT"; + else sReturn = "NW_S_WATERELDER"; + } + break; + } + case 4: + { + if(nSpellID == SPELL_SUMMON_CREATURE_VII) sReturn = "NW_S_WATERHUGE"; + else if(nSpellID == SPELL_SUMMON_CREATURE_VIII) sReturn = "NW_S_WATERGREAT"; + else sReturn = "NW_S_WATERELDER"; + } + break; + } + return sReturn; +} + +int CheckClericSummon(int nSpellID) +{ + int nReturn = FALSE; + if(GetLevelByClass(CLASS_TYPE_CLERIC) > 0 && (nSpellID == SPELL_SUMMON_CREATURE_VII || nSpellID == SPELL_SUMMON_CREATURE_VIII || nSpellID == SPELL_SUMMON_CREATURE_IX) && (GetHasFeat(FEAT_AIR_DOMAIN_POWER) || GetHasFeat(FEAT_EARTH_DOMAIN_POWER) || GetHasFeat(FEAT_FIRE_DOMAIN_POWER) || GetHasFeat(FEAT_WATER_DOMAIN_POWER))) nReturn = TRUE; + return nReturn; +} + +effect ClericSummon(int nSpellID) +{ + int nPowers; + int nCount; + string sSummon; + + if(GetHasFeat(FEAT_AIR_DOMAIN_POWER)) + { + nPowers |= AIR; + } + if(GetHasFeat(FEAT_EARTH_DOMAIN_POWER)) + { + nPowers |= EARTH; + } + if(GetHasFeat(FEAT_FIRE_DOMAIN_POWER)) + { + nPowers |= FIRE; + } + if(GetHasFeat(FEAT_WATER_DOMAIN_POWER)) + { + nPowers |= WATER; + } + + sSummon = ClericCreature(nPowers, nSpellID); + effect eSummonedMonster = EffectSummonCreature(sSummon, VFX_FNF_SUMMON_MONSTER_3); + return eSummonedMonster; +} + +//void main () {} + + + + + + + + + + diff --git a/nwnds_module/ar_invstalk001.utc b/nwnds_module/ar_invstalk001.utc new file mode 100644 index 000000000..a9d7a61f8 Binary files /dev/null and b/nwnds_module/ar_invstalk001.utc differ diff --git a/nwnds_module/ar_is_blue01.uti b/nwnds_module/ar_is_blue01.uti new file mode 100644 index 000000000..6e64f172d Binary files /dev/null and b/nwnds_module/ar_is_blue01.uti differ diff --git a/nwnds_module/ar_is_deepred01.uti b/nwnds_module/ar_is_deepred01.uti new file mode 100644 index 000000000..df7627325 Binary files /dev/null and b/nwnds_module/ar_is_deepred01.uti differ diff --git a/nwnds_module/ar_is_drose01.uti b/nwnds_module/ar_is_drose01.uti new file mode 100644 index 000000000..016a863b2 Binary files /dev/null and b/nwnds_module/ar_is_drose01.uti differ diff --git a/nwnds_module/ar_is_paleblue01.uti b/nwnds_module/ar_is_paleblue01.uti new file mode 100644 index 000000000..66c17d4c3 Binary files /dev/null and b/nwnds_module/ar_is_paleblue01.uti differ diff --git a/nwnds_module/ar_is_pink01.uti b/nwnds_module/ar_is_pink01.uti new file mode 100644 index 000000000..69e5b78d1 Binary files /dev/null and b/nwnds_module/ar_is_pink01.uti differ diff --git a/nwnds_module/ar_is_pnkgrn01.uti b/nwnds_module/ar_is_pnkgrn01.uti new file mode 100644 index 000000000..1608cd3db Binary files /dev/null and b/nwnds_module/ar_is_pnkgrn01.uti differ diff --git a/nwnds_module/ar_is_scarblue01.uti b/nwnds_module/ar_is_scarblue01.uti new file mode 100644 index 000000000..9ee3ffd0b Binary files /dev/null and b/nwnds_module/ar_is_scarblue01.uti differ diff --git a/nwnds_module/ar_it_baby01.uti b/nwnds_module/ar_it_baby01.uti new file mode 100644 index 000000000..b64342bd3 Binary files /dev/null and b/nwnds_module/ar_it_baby01.uti differ diff --git a/nwnds_module/ar_it_blackfan.uti b/nwnds_module/ar_it_blackfan.uti new file mode 100644 index 000000000..1c6166140 Binary files /dev/null and b/nwnds_module/ar_it_blackfan.uti differ diff --git a/nwnds_module/ar_it_blackjack.uti b/nwnds_module/ar_it_blackjack.uti new file mode 100644 index 000000000..91305bf5c Binary files /dev/null and b/nwnds_module/ar_it_blackjack.uti differ diff --git a/nwnds_module/ar_it_contain000.uti b/nwnds_module/ar_it_contain000.uti new file mode 100644 index 000000000..e4deee39c Binary files /dev/null and b/nwnds_module/ar_it_contain000.uti differ diff --git a/nwnds_module/ar_it_contain001.uti b/nwnds_module/ar_it_contain001.uti new file mode 100644 index 000000000..1eaa3b9ef Binary files /dev/null and b/nwnds_module/ar_it_contain001.uti differ diff --git a/nwnds_module/ar_it_contain002.uti b/nwnds_module/ar_it_contain002.uti new file mode 100644 index 000000000..008fd3ec8 Binary files /dev/null and b/nwnds_module/ar_it_contain002.uti differ diff --git a/nwnds_module/ar_it_contain003.uti b/nwnds_module/ar_it_contain003.uti new file mode 100644 index 000000000..8d53840d4 Binary files /dev/null and b/nwnds_module/ar_it_contain003.uti differ diff --git a/nwnds_module/ar_it_contain004.uti b/nwnds_module/ar_it_contain004.uti new file mode 100644 index 000000000..43914aaf7 Binary files /dev/null and b/nwnds_module/ar_it_contain004.uti differ diff --git a/nwnds_module/ar_it_crowbar.uti b/nwnds_module/ar_it_crowbar.uti new file mode 100644 index 000000000..1aa433066 Binary files /dev/null and b/nwnds_module/ar_it_crowbar.uti differ diff --git a/nwnds_module/ar_it_crystlball.uti b/nwnds_module/ar_it_crystlball.uti new file mode 100644 index 000000000..15ced2715 Binary files /dev/null and b/nwnds_module/ar_it_crystlball.uti differ diff --git a/nwnds_module/ar_it_discord.uti b/nwnds_module/ar_it_discord.uti new file mode 100644 index 000000000..b394a130c Binary files /dev/null and b/nwnds_module/ar_it_discord.uti differ diff --git a/nwnds_module/ar_it_elixirsun.uti b/nwnds_module/ar_it_elixirsun.uti new file mode 100644 index 000000000..a7bc523bd Binary files /dev/null and b/nwnds_module/ar_it_elixirsun.uti differ diff --git a/nwnds_module/ar_it_gemidans.uti b/nwnds_module/ar_it_gemidans.uti new file mode 100644 index 000000000..1134d9e19 Binary files /dev/null and b/nwnds_module/ar_it_gemidans.uti differ diff --git a/nwnds_module/ar_it_gemsee.uti b/nwnds_module/ar_it_gemsee.uti new file mode 100644 index 000000000..9d7aa7261 Binary files /dev/null and b/nwnds_module/ar_it_gemsee.uti differ diff --git a/nwnds_module/ar_it_giantrope.uti b/nwnds_module/ar_it_giantrope.uti new file mode 100644 index 000000000..4b01c442c Binary files /dev/null and b/nwnds_module/ar_it_giantrope.uti differ diff --git a/nwnds_module/ar_it_guitar01.uti b/nwnds_module/ar_it_guitar01.uti new file mode 100644 index 000000000..6ba8e2830 Binary files /dev/null and b/nwnds_module/ar_it_guitar01.uti differ diff --git a/nwnds_module/ar_it_harp.uti b/nwnds_module/ar_it_harp.uti new file mode 100644 index 000000000..be5c7f540 Binary files /dev/null and b/nwnds_module/ar_it_harp.uti differ diff --git a/nwnds_module/ar_it_inspirer.uti b/nwnds_module/ar_it_inspirer.uti new file mode 100644 index 000000000..2088f24e3 Binary files /dev/null and b/nwnds_module/ar_it_inspirer.uti differ diff --git a/nwnds_module/ar_it_lantern01.uti b/nwnds_module/ar_it_lantern01.uti new file mode 100644 index 000000000..f16b127c8 Binary files /dev/null and b/nwnds_module/ar_it_lantern01.uti differ diff --git a/nwnds_module/ar_it_lute.uti b/nwnds_module/ar_it_lute.uti new file mode 100644 index 000000000..9fa783722 Binary files /dev/null and b/nwnds_module/ar_it_lute.uti differ diff --git a/nwnds_module/ar_it_pipes.uti b/nwnds_module/ar_it_pipes.uti new file mode 100644 index 000000000..1dd026454 Binary files /dev/null and b/nwnds_module/ar_it_pipes.uti differ diff --git a/nwnds_module/ar_it_prismatic.uti b/nwnds_module/ar_it_prismatic.uti new file mode 100644 index 000000000..6da73646e Binary files /dev/null and b/nwnds_module/ar_it_prismatic.uti differ diff --git a/nwnds_module/ar_it_screamer.uti b/nwnds_module/ar_it_screamer.uti new file mode 100644 index 000000000..a2a55d553 Binary files /dev/null and b/nwnds_module/ar_it_screamer.uti differ diff --git a/nwnds_module/ar_it_shovel.uti b/nwnds_module/ar_it_shovel.uti new file mode 100644 index 000000000..39ca989f3 Binary files /dev/null and b/nwnds_module/ar_it_shovel.uti differ diff --git a/nwnds_module/ar_it_silkfan.uti b/nwnds_module/ar_it_silkfan.uti new file mode 100644 index 000000000..35b2e451b Binary files /dev/null and b/nwnds_module/ar_it_silkfan.uti differ diff --git a/nwnds_module/ar_it_strgscroll.uti b/nwnds_module/ar_it_strgscroll.uti new file mode 100644 index 000000000..7d74e1918 Binary files /dev/null and b/nwnds_module/ar_it_strgscroll.uti differ diff --git a/nwnds_module/ar_it_tambourine.uti b/nwnds_module/ar_it_tambourine.uti new file mode 100644 index 000000000..a9003fdd5 Binary files /dev/null and b/nwnds_module/ar_it_tambourine.uti differ diff --git a/nwnds_module/ar_it_timesplit.uti b/nwnds_module/ar_it_timesplit.uti new file mode 100644 index 000000000..783dbaf66 Binary files /dev/null and b/nwnds_module/ar_it_timesplit.uti differ diff --git a/nwnds_module/ar_it_trader01.uti b/nwnds_module/ar_it_trader01.uti new file mode 100644 index 000000000..f6067656c Binary files /dev/null and b/nwnds_module/ar_it_trader01.uti differ diff --git a/nwnds_module/ar_it_trader02.uti b/nwnds_module/ar_it_trader02.uti new file mode 100644 index 000000000..6c2a5dfd3 Binary files /dev/null and b/nwnds_module/ar_it_trader02.uti differ diff --git a/nwnds_module/ar_it_violin_f01.uti b/nwnds_module/ar_it_violin_f01.uti new file mode 100644 index 000000000..e7c87e2e4 Binary files /dev/null and b/nwnds_module/ar_it_violin_f01.uti differ diff --git a/nwnds_module/ar_it_violin_m01.uti b/nwnds_module/ar_it_violin_m01.uti new file mode 100644 index 000000000..5a8178341 Binary files /dev/null and b/nwnds_module/ar_it_violin_m01.uti differ diff --git a/nwnds_module/ar_it_violinbow.uti b/nwnds_module/ar_it_violinbow.uti new file mode 100644 index 000000000..6d651edbe Binary files /dev/null and b/nwnds_module/ar_it_violinbow.uti differ diff --git a/nwnds_module/ar_it_voidessenc.uti b/nwnds_module/ar_it_voidessenc.uti new file mode 100644 index 000000000..189c6e447 Binary files /dev/null and b/nwnds_module/ar_it_voidessenc.uti differ diff --git a/nwnds_module/ar_it_water001.uti b/nwnds_module/ar_it_water001.uti new file mode 100644 index 000000000..526ebab47 Binary files /dev/null and b/nwnds_module/ar_it_water001.uti differ diff --git a/nwnds_module/ar_it_water002.uti b/nwnds_module/ar_it_water002.uti new file mode 100644 index 000000000..9bead026c Binary files /dev/null and b/nwnds_module/ar_it_water002.uti differ diff --git a/nwnds_module/ar_it_witchsball.uti b/nwnds_module/ar_it_witchsball.uti new file mode 100644 index 000000000..5ae5c6850 Binary files /dev/null and b/nwnds_module/ar_it_witchsball.uti differ diff --git a/nwnds_module/ar_it_zephyr.uti b/nwnds_module/ar_it_zephyr.uti new file mode 100644 index 000000000..7ff8d866e Binary files /dev/null and b/nwnds_module/ar_it_zephyr.uti differ diff --git a/nwnds_module/ar_itbcr_alloy.uti b/nwnds_module/ar_itbcr_alloy.uti new file mode 100644 index 000000000..b8b8e8e84 Binary files /dev/null and b/nwnds_module/ar_itbcr_alloy.uti differ diff --git a/nwnds_module/ar_itbcr_kank.uti b/nwnds_module/ar_itbcr_kank.uti new file mode 100644 index 000000000..9cbff0456 Binary files /dev/null and b/nwnds_module/ar_itbcr_kank.uti differ diff --git a/nwnds_module/ar_itbk_alchem01.uti b/nwnds_module/ar_itbk_alchem01.uti new file mode 100644 index 000000000..e1ee47bc1 Binary files /dev/null and b/nwnds_module/ar_itbk_alchem01.uti differ diff --git a/nwnds_module/ar_itbk_alchem02.uti b/nwnds_module/ar_itbk_alchem02.uti new file mode 100644 index 000000000..fa16f4c3e Binary files /dev/null and b/nwnds_module/ar_itbk_alchem02.uti differ diff --git a/nwnds_module/ar_itbk_alchem03.uti b/nwnds_module/ar_itbk_alchem03.uti new file mode 100644 index 000000000..931e2d2a5 Binary files /dev/null and b/nwnds_module/ar_itbk_alchem03.uti differ diff --git a/nwnds_module/ar_itbk_alchem04.uti b/nwnds_module/ar_itbk_alchem04.uti new file mode 100644 index 000000000..ab7b44785 Binary files /dev/null and b/nwnds_module/ar_itbk_alchem04.uti differ diff --git a/nwnds_module/ar_itbk_alchem05.uti b/nwnds_module/ar_itbk_alchem05.uti new file mode 100644 index 000000000..fb4d16433 Binary files /dev/null and b/nwnds_module/ar_itbk_alchem05.uti differ diff --git a/nwnds_module/ar_itbk_arkhold.uti b/nwnds_module/ar_itbk_arkhold.uti new file mode 100644 index 000000000..3262a3e86 Binary files /dev/null and b/nwnds_module/ar_itbk_arkhold.uti differ diff --git a/nwnds_module/ar_itbk_brochamp.uti b/nwnds_module/ar_itbk_brochamp.uti new file mode 100644 index 000000000..619ec97b8 Binary files /dev/null and b/nwnds_module/ar_itbk_brochamp.uti differ diff --git a/nwnds_module/ar_itbk_crimord.uti b/nwnds_module/ar_itbk_crimord.uti new file mode 100644 index 000000000..757f3936d Binary files /dev/null and b/nwnds_module/ar_itbk_crimord.uti differ diff --git a/nwnds_module/ar_itbk_crimsun.uti b/nwnds_module/ar_itbk_crimsun.uti new file mode 100644 index 000000000..692d83ff9 Binary files /dev/null and b/nwnds_module/ar_itbk_crimsun.uti differ diff --git a/nwnds_module/ar_itbk_drmadien.uti b/nwnds_module/ar_itbk_drmadien.uti new file mode 100644 index 000000000..a848c7fd3 Binary files /dev/null and b/nwnds_module/ar_itbk_drmadien.uti differ diff --git a/nwnds_module/ar_itbk_drunkhg.uti b/nwnds_module/ar_itbk_drunkhg.uti new file mode 100644 index 000000000..a47fd3b00 Binary files /dev/null and b/nwnds_module/ar_itbk_drunkhg.uti differ diff --git a/nwnds_module/ar_itbk_elearmor.uti b/nwnds_module/ar_itbk_elearmor.uti new file mode 100644 index 000000000..cf6b8285e Binary files /dev/null and b/nwnds_module/ar_itbk_elearmor.uti differ diff --git a/nwnds_module/ar_itbk_elemammo.uti b/nwnds_module/ar_itbk_elemammo.uti new file mode 100644 index 000000000..08c8f7237 Binary files /dev/null and b/nwnds_module/ar_itbk_elemammo.uti differ diff --git a/nwnds_module/ar_itbk_eleweap1.uti b/nwnds_module/ar_itbk_eleweap1.uti new file mode 100644 index 000000000..81ae078c1 Binary files /dev/null and b/nwnds_module/ar_itbk_eleweap1.uti differ diff --git a/nwnds_module/ar_itbk_eleweap2.uti b/nwnds_module/ar_itbk_eleweap2.uti new file mode 100644 index 000000000..ba87b1c8a Binary files /dev/null and b/nwnds_module/ar_itbk_eleweap2.uti differ diff --git a/nwnds_module/ar_itbk_hamhunt.uti b/nwnds_module/ar_itbk_hamhunt.uti new file mode 100644 index 000000000..b650c1570 Binary files /dev/null and b/nwnds_module/ar_itbk_hamhunt.uti differ diff --git a/nwnds_module/ar_itbk_lastsea.uti b/nwnds_module/ar_itbk_lastsea.uti new file mode 100644 index 000000000..8cae8ea14 Binary files /dev/null and b/nwnds_module/ar_itbk_lastsea.uti differ diff --git a/nwnds_module/ar_itbk_laws.uti b/nwnds_module/ar_itbk_laws.uti new file mode 100644 index 000000000..3fae0463b Binary files /dev/null and b/nwnds_module/ar_itbk_laws.uti differ diff --git a/nwnds_module/ar_itbk_magic.uti b/nwnds_module/ar_itbk_magic.uti new file mode 100644 index 000000000..35b7cb705 Binary files /dev/null and b/nwnds_module/ar_itbk_magic.uti differ diff --git a/nwnds_module/ar_itbk_prestale.uti b/nwnds_module/ar_itbk_prestale.uti new file mode 100644 index 000000000..9eae1b79b Binary files /dev/null and b/nwnds_module/ar_itbk_prestale.uti differ diff --git a/nwnds_module/ar_itbk_stel01.uti b/nwnds_module/ar_itbk_stel01.uti new file mode 100644 index 000000000..4148ed794 Binary files /dev/null and b/nwnds_module/ar_itbk_stel01.uti differ diff --git a/nwnds_module/ar_itbk_stel02.uti b/nwnds_module/ar_itbk_stel02.uti new file mode 100644 index 000000000..b3e262af1 Binary files /dev/null and b/nwnds_module/ar_itbk_stel02.uti differ diff --git a/nwnds_module/ar_itbk_taril01.uti b/nwnds_module/ar_itbk_taril01.uti new file mode 100644 index 000000000..170039e31 Binary files /dev/null and b/nwnds_module/ar_itbk_taril01.uti differ diff --git a/nwnds_module/ar_itbk_taril02.uti b/nwnds_module/ar_itbk_taril02.uti new file mode 100644 index 000000000..630ecba6b Binary files /dev/null and b/nwnds_module/ar_itbk_taril02.uti differ diff --git a/nwnds_module/ar_itbk_throkat.uti b/nwnds_module/ar_itbk_throkat.uti new file mode 100644 index 000000000..136c8a065 Binary files /dev/null and b/nwnds_module/ar_itbk_throkat.uti differ diff --git a/nwnds_module/ar_itbk_tontor.uti b/nwnds_module/ar_itbk_tontor.uti new file mode 100644 index 000000000..ed2daef3f Binary files /dev/null and b/nwnds_module/ar_itbk_tontor.uti differ diff --git a/nwnds_module/ar_itbk_trader01.uti b/nwnds_module/ar_itbk_trader01.uti new file mode 100644 index 000000000..62c883723 Binary files /dev/null and b/nwnds_module/ar_itbk_trader01.uti differ diff --git a/nwnds_module/ar_itbk_woaking.uti b/nwnds_module/ar_itbk_woaking.uti new file mode 100644 index 000000000..f03a4e2ee Binary files /dev/null and b/nwnds_module/ar_itbk_woaking.uti differ diff --git a/nwnds_module/ar_itblt_balstr.uti b/nwnds_module/ar_itblt_balstr.uti new file mode 100644 index 000000000..0e08dafb3 Binary files /dev/null and b/nwnds_module/ar_itblt_balstr.uti differ diff --git a/nwnds_module/ar_itblt_critcar.uti b/nwnds_module/ar_itblt_critcar.uti new file mode 100644 index 000000000..fd708dc3a Binary files /dev/null and b/nwnds_module/ar_itblt_critcar.uti differ diff --git a/nwnds_module/ar_itblt_leather.uti b/nwnds_module/ar_itblt_leather.uti new file mode 100644 index 000000000..bfe3670af Binary files /dev/null and b/nwnds_module/ar_itblt_leather.uti differ diff --git a/nwnds_module/ar_itblt_livsash.uti b/nwnds_module/ar_itblt_livsash.uti new file mode 100644 index 000000000..e26440252 Binary files /dev/null and b/nwnds_module/ar_itblt_livsash.uti differ diff --git a/nwnds_module/ar_itblt_medical.uti b/nwnds_module/ar_itblt_medical.uti new file mode 100644 index 000000000..18b28756e Binary files /dev/null and b/nwnds_module/ar_itblt_medical.uti differ diff --git a/nwnds_module/ar_itblt_miracle.uti b/nwnds_module/ar_itblt_miracle.uti new file mode 100644 index 000000000..ad82ea6ae Binary files /dev/null and b/nwnds_module/ar_itblt_miracle.uti differ diff --git a/nwnds_module/ar_itblt_power.uti b/nwnds_module/ar_itblt_power.uti new file mode 100644 index 000000000..ab4f2b451 Binary files /dev/null and b/nwnds_module/ar_itblt_power.uti differ diff --git a/nwnds_module/ar_itblt_resili.uti b/nwnds_module/ar_itblt_resili.uti new file mode 100644 index 000000000..4e709afe4 Binary files /dev/null and b/nwnds_module/ar_itblt_resili.uti differ diff --git a/nwnds_module/ar_itblt_toolblt.uti b/nwnds_module/ar_itblt_toolblt.uti new file mode 100644 index 000000000..c2abe55af Binary files /dev/null and b/nwnds_module/ar_itblt_toolblt.uti differ diff --git a/nwnds_module/ar_itbts_drksilk.uti b/nwnds_module/ar_itbts_drksilk.uti new file mode 100644 index 000000000..bf3513cf1 Binary files /dev/null and b/nwnds_module/ar_itbts_drksilk.uti differ diff --git a/nwnds_module/ar_itbts_elven.uti b/nwnds_module/ar_itbts_elven.uti new file mode 100644 index 000000000..8ed18f9d8 Binary files /dev/null and b/nwnds_module/ar_itbts_elven.uti differ diff --git a/nwnds_module/ar_itbts_expert.uti b/nwnds_module/ar_itbts_expert.uti new file mode 100644 index 000000000..a88accbe0 Binary files /dev/null and b/nwnds_module/ar_itbts_expert.uti differ diff --git a/nwnds_module/ar_itbts_greased.uti b/nwnds_module/ar_itbts_greased.uti new file mode 100644 index 000000000..a77b83ee8 Binary files /dev/null and b/nwnds_module/ar_itbts_greased.uti differ diff --git a/nwnds_module/ar_itbts_ground.uti b/nwnds_module/ar_itbts_ground.uti new file mode 100644 index 000000000..bd2d61128 Binary files /dev/null and b/nwnds_module/ar_itbts_ground.uti differ diff --git a/nwnds_module/ar_itbts_heavy.uti b/nwnds_module/ar_itbts_heavy.uti new file mode 100644 index 000000000..274df78ab Binary files /dev/null and b/nwnds_module/ar_itbts_heavy.uti differ diff --git a/nwnds_module/ar_itbts_leather.uti b/nwnds_module/ar_itbts_leather.uti new file mode 100644 index 000000000..40287abc2 Binary files /dev/null and b/nwnds_module/ar_itbts_leather.uti differ diff --git a/nwnds_module/ar_itbts_sneaky.uti b/nwnds_module/ar_itbts_sneaky.uti new file mode 100644 index 000000000..8934e1193 Binary files /dev/null and b/nwnds_module/ar_itbts_sneaky.uti differ diff --git a/nwnds_module/ar_itclk_camo.uti b/nwnds_module/ar_itclk_camo.uti new file mode 100644 index 000000000..55586f7f6 Binary files /dev/null and b/nwnds_module/ar_itclk_camo.uti differ diff --git a/nwnds_module/ar_itclk_leather.uti b/nwnds_module/ar_itclk_leather.uti new file mode 100644 index 000000000..14f78cb90 Binary files /dev/null and b/nwnds_module/ar_itclk_leather.uti differ diff --git a/nwnds_module/ar_itclk_radiana.uti b/nwnds_module/ar_itclk_radiana.uti new file mode 100644 index 000000000..607eb83a1 Binary files /dev/null and b/nwnds_module/ar_itclk_radiana.uti differ diff --git a/nwnds_module/ar_itclk_slick.uti b/nwnds_module/ar_itclk_slick.uti new file mode 100644 index 000000000..e4c37adc5 Binary files /dev/null and b/nwnds_module/ar_itclk_slick.uti differ diff --git a/nwnds_module/ar_itclk_stiff.uti b/nwnds_module/ar_itclk_stiff.uti new file mode 100644 index 000000000..db43db6b3 Binary files /dev/null and b/nwnds_module/ar_itclk_stiff.uti differ diff --git a/nwnds_module/ar_itemglv_drake.uti b/nwnds_module/ar_itemglv_drake.uti new file mode 100644 index 000000000..17f1a2dbd Binary files /dev/null and b/nwnds_module/ar_itemglv_drake.uti differ diff --git a/nwnds_module/ar_itglv_alloy.uti b/nwnds_module/ar_itglv_alloy.uti new file mode 100644 index 000000000..b183c3c04 Binary files /dev/null and b/nwnds_module/ar_itglv_alloy.uti differ diff --git a/nwnds_module/ar_itglv_forearm.uti b/nwnds_module/ar_itglv_forearm.uti new file mode 100644 index 000000000..c69a58608 Binary files /dev/null and b/nwnds_module/ar_itglv_forearm.uti differ diff --git a/nwnds_module/ar_itglv_iron01.uti b/nwnds_module/ar_itglv_iron01.uti new file mode 100644 index 000000000..b9db51975 Binary files /dev/null and b/nwnds_module/ar_itglv_iron01.uti differ diff --git a/nwnds_module/ar_itglv_iron02.uti b/nwnds_module/ar_itglv_iron02.uti new file mode 100644 index 000000000..f88c56172 Binary files /dev/null and b/nwnds_module/ar_itglv_iron02.uti differ diff --git a/nwnds_module/ar_itglv_ivory1.uti b/nwnds_module/ar_itglv_ivory1.uti new file mode 100644 index 000000000..ee45a003d Binary files /dev/null and b/nwnds_module/ar_itglv_ivory1.uti differ diff --git a/nwnds_module/ar_itglv_ivory2.uti b/nwnds_module/ar_itglv_ivory2.uti new file mode 100644 index 000000000..697379554 Binary files /dev/null and b/nwnds_module/ar_itglv_ivory2.uti differ diff --git a/nwnds_module/ar_itglv_leather.uti b/nwnds_module/ar_itglv_leather.uti new file mode 100644 index 000000000..06e93829d Binary files /dev/null and b/nwnds_module/ar_itglv_leather.uti differ diff --git a/nwnds_module/ar_itglv_obs02.uti b/nwnds_module/ar_itglv_obs02.uti new file mode 100644 index 000000000..58b2ea8b6 Binary files /dev/null and b/nwnds_module/ar_itglv_obs02.uti differ diff --git a/nwnds_module/ar_itglv_wrazors.uti b/nwnds_module/ar_itglv_wrazors.uti new file mode 100644 index 000000000..04b24cdea Binary files /dev/null and b/nwnds_module/ar_itglv_wrazors.uti differ diff --git a/nwnds_module/ar_itm_ashelgora.uti b/nwnds_module/ar_itm_ashelgora.uti new file mode 100644 index 000000000..9088c1ca5 Binary files /dev/null and b/nwnds_module/ar_itm_ashelgora.uti differ diff --git a/nwnds_module/ar_itm_battlbrew.uti b/nwnds_module/ar_itm_battlbrew.uti new file mode 100644 index 000000000..94b042560 Binary files /dev/null and b/nwnds_module/ar_itm_battlbrew.uti differ diff --git a/nwnds_module/ar_itm_clilyre.uti b/nwnds_module/ar_itm_clilyre.uti new file mode 100644 index 000000000..0f3369a97 Binary files /dev/null and b/nwnds_module/ar_itm_clilyre.uti differ diff --git a/nwnds_module/ar_itm_elvenchrm.uti b/nwnds_module/ar_itm_elvenchrm.uti new file mode 100644 index 000000000..265c5b993 Binary files /dev/null and b/nwnds_module/ar_itm_elvenchrm.uti differ diff --git a/nwnds_module/ar_itm_eyetiger.uti b/nwnds_module/ar_itm_eyetiger.uti new file mode 100644 index 000000000..ae630e1e3 Binary files /dev/null and b/nwnds_module/ar_itm_eyetiger.uti differ diff --git a/nwnds_module/ar_itm_hearthstn.uti b/nwnds_module/ar_itm_hearthstn.uti new file mode 100644 index 000000000..f7b3b279a Binary files /dev/null and b/nwnds_module/ar_itm_hearthstn.uti differ diff --git a/nwnds_module/ar_itm_hornaknar.uti b/nwnds_module/ar_itm_hornaknar.uti new file mode 100644 index 000000000..8508ea074 Binary files /dev/null and b/nwnds_module/ar_itm_hornaknar.uti differ diff --git a/nwnds_module/ar_itm_lemlisale.uti b/nwnds_module/ar_itm_lemlisale.uti new file mode 100644 index 000000000..51ea1f287 Binary files /dev/null and b/nwnds_module/ar_itm_lemlisale.uti differ diff --git a/nwnds_module/ar_itm_lensdetec.uti b/nwnds_module/ar_itm_lensdetec.uti new file mode 100644 index 000000000..a53c31b45 Binary files /dev/null and b/nwnds_module/ar_itm_lensdetec.uti differ diff --git a/nwnds_module/ar_itm_mystapple.uti b/nwnds_module/ar_itm_mystapple.uti new file mode 100644 index 000000000..e4759e94d Binary files /dev/null and b/nwnds_module/ar_itm_mystapple.uti differ diff --git a/nwnds_module/ar_itm_orbfire.uti b/nwnds_module/ar_itm_orbfire.uti new file mode 100644 index 000000000..ea76b6eec Binary files /dev/null and b/nwnds_module/ar_itm_orbfire.uti differ diff --git a/nwnds_module/ar_itm_orbice.uti b/nwnds_module/ar_itm_orbice.uti new file mode 100644 index 000000000..421983954 Binary files /dev/null and b/nwnds_module/ar_itm_orbice.uti differ diff --git a/nwnds_module/ar_itm_orbshock.uti b/nwnds_module/ar_itm_orbshock.uti new file mode 100644 index 000000000..8f4580542 Binary files /dev/null and b/nwnds_module/ar_itm_orbshock.uti differ diff --git a/nwnds_module/ar_itm_protect.uti b/nwnds_module/ar_itm_protect.uti new file mode 100644 index 000000000..7b5bd65ba Binary files /dev/null and b/nwnds_module/ar_itm_protect.uti differ diff --git a/nwnds_module/ar_itm_sharpscab.uti b/nwnds_module/ar_itm_sharpscab.uti new file mode 100644 index 000000000..5f706cef6 Binary files /dev/null and b/nwnds_module/ar_itm_sharpscab.uti differ diff --git a/nwnds_module/ar_itm_shielding.uti b/nwnds_module/ar_itm_shielding.uti new file mode 100644 index 000000000..432ca4f96 Binary files /dev/null and b/nwnds_module/ar_itm_shielding.uti differ diff --git a/nwnds_module/ar_itm_skydance.uti b/nwnds_module/ar_itm_skydance.uti new file mode 100644 index 000000000..5aa3bda1d Binary files /dev/null and b/nwnds_module/ar_itm_skydance.uti differ diff --git a/nwnds_module/ar_itmbcr_coral.uti b/nwnds_module/ar_itmbcr_coral.uti new file mode 100644 index 000000000..344721d22 Binary files /dev/null and b/nwnds_module/ar_itmbcr_coral.uti differ diff --git a/nwnds_module/ar_itmbcr_dfence.uti b/nwnds_module/ar_itmbcr_dfence.uti new file mode 100644 index 000000000..b4d805026 Binary files /dev/null and b/nwnds_module/ar_itmbcr_dfence.uti differ diff --git a/nwnds_module/ar_itmbcr_escape.uti b/nwnds_module/ar_itmbcr_escape.uti new file mode 100644 index 000000000..a03629355 Binary files /dev/null and b/nwnds_module/ar_itmbcr_escape.uti differ diff --git a/nwnds_module/ar_itmbcr_jandor.uti b/nwnds_module/ar_itmbcr_jandor.uti new file mode 100644 index 000000000..aeddf71ef Binary files /dev/null and b/nwnds_module/ar_itmbcr_jandor.uti differ diff --git a/nwnds_module/ar_itmbcr_magamp.uti b/nwnds_module/ar_itmbcr_magamp.uti new file mode 100644 index 000000000..3683119bd Binary files /dev/null and b/nwnds_module/ar_itmbcr_magamp.uti differ diff --git a/nwnds_module/ar_itmbcr_mrunes.uti b/nwnds_module/ar_itmbcr_mrunes.uti new file mode 100644 index 000000000..f603214b0 Binary files /dev/null and b/nwnds_module/ar_itmbcr_mrunes.uti differ diff --git a/nwnds_module/ar_itmbcr_prtect.uti b/nwnds_module/ar_itmbcr_prtect.uti new file mode 100644 index 000000000..d893f7c75 Binary files /dev/null and b/nwnds_module/ar_itmbcr_prtect.uti differ diff --git a/nwnds_module/ar_itmbcr_wardng.uti b/nwnds_module/ar_itmbcr_wardng.uti new file mode 100644 index 000000000..05804c6a7 Binary files /dev/null and b/nwnds_module/ar_itmbcr_wardng.uti differ diff --git a/nwnds_module/ar_itmbk_healing.uti b/nwnds_module/ar_itmbk_healing.uti new file mode 100644 index 000000000..157cd3ca0 Binary files /dev/null and b/nwnds_module/ar_itmbk_healing.uti differ diff --git a/nwnds_module/ar_itmbk_knflame.uti b/nwnds_module/ar_itmbk_knflame.uti new file mode 100644 index 000000000..1159d90b2 Binary files /dev/null and b/nwnds_module/ar_itmbk_knflame.uti differ diff --git a/nwnds_module/ar_itmbk_lore.uti b/nwnds_module/ar_itmbk_lore.uti new file mode 100644 index 000000000..efe825ac0 Binary files /dev/null and b/nwnds_module/ar_itmbk_lore.uti differ diff --git a/nwnds_module/ar_itmbk_mistres.uti b/nwnds_module/ar_itmbk_mistres.uti new file mode 100644 index 000000000..fee344292 Binary files /dev/null and b/nwnds_module/ar_itmbk_mistres.uti differ diff --git a/nwnds_module/ar_itmbk_prophec.uti b/nwnds_module/ar_itmbk_prophec.uti new file mode 100644 index 000000000..fdb0c62a0 Binary files /dev/null and b/nwnds_module/ar_itmbk_prophec.uti differ diff --git a/nwnds_module/ar_itmbk_strengt.uti b/nwnds_module/ar_itmbk_strengt.uti new file mode 100644 index 000000000..5c4425c07 Binary files /dev/null and b/nwnds_module/ar_itmbk_strengt.uti differ diff --git a/nwnds_module/ar_itmblt_ankor.uti b/nwnds_module/ar_itmblt_ankor.uti new file mode 100644 index 000000000..77387d2e5 Binary files /dev/null and b/nwnds_module/ar_itmblt_ankor.uti differ diff --git a/nwnds_module/ar_itmblt_champ.uti b/nwnds_module/ar_itmblt_champ.uti new file mode 100644 index 000000000..d6dc02f28 Binary files /dev/null and b/nwnds_module/ar_itmblt_champ.uti differ diff --git a/nwnds_module/ar_itmblt_dair.uti b/nwnds_module/ar_itmblt_dair.uti new file mode 100644 index 000000000..981688bcf Binary files /dev/null and b/nwnds_module/ar_itmblt_dair.uti differ diff --git a/nwnds_module/ar_itmblt_dearth.uti b/nwnds_module/ar_itmblt_dearth.uti new file mode 100644 index 000000000..d38ffd961 Binary files /dev/null and b/nwnds_module/ar_itmblt_dearth.uti differ diff --git a/nwnds_module/ar_itmblt_dfire.uti b/nwnds_module/ar_itmblt_dfire.uti new file mode 100644 index 000000000..86dba3660 Binary files /dev/null and b/nwnds_module/ar_itmblt_dfire.uti differ diff --git a/nwnds_module/ar_itmblt_dmagma.uti b/nwnds_module/ar_itmblt_dmagma.uti new file mode 100644 index 000000000..8e3408a5d Binary files /dev/null and b/nwnds_module/ar_itmblt_dmagma.uti differ diff --git a/nwnds_module/ar_itmblt_drain.uti b/nwnds_module/ar_itmblt_drain.uti new file mode 100644 index 000000000..a56b245b2 Binary files /dev/null and b/nwnds_module/ar_itmblt_drain.uti differ diff --git a/nwnds_module/ar_itmblt_dsilt.uti b/nwnds_module/ar_itmblt_dsilt.uti new file mode 100644 index 000000000..cec93d3ef Binary files /dev/null and b/nwnds_module/ar_itmblt_dsilt.uti differ diff --git a/nwnds_module/ar_itmblt_dsun.uti b/nwnds_module/ar_itmblt_dsun.uti new file mode 100644 index 000000000..8a853074d Binary files /dev/null and b/nwnds_module/ar_itmblt_dsun.uti differ diff --git a/nwnds_module/ar_itmblt_dviper.uti b/nwnds_module/ar_itmblt_dviper.uti new file mode 100644 index 000000000..dc7dcda14 Binary files /dev/null and b/nwnds_module/ar_itmblt_dviper.uti differ diff --git a/nwnds_module/ar_itmblt_dwater.uti b/nwnds_module/ar_itmblt_dwater.uti new file mode 100644 index 000000000..f321dbad2 Binary files /dev/null and b/nwnds_module/ar_itmblt_dwater.uti differ diff --git a/nwnds_module/ar_itmblt_magamp.uti b/nwnds_module/ar_itmblt_magamp.uti new file mode 100644 index 000000000..9e3fb4444 Binary files /dev/null and b/nwnds_module/ar_itmblt_magamp.uti differ diff --git a/nwnds_module/ar_itmblt_mystic.uti b/nwnds_module/ar_itmblt_mystic.uti new file mode 100644 index 000000000..b3f20ad66 Binary files /dev/null and b/nwnds_module/ar_itmblt_mystic.uti differ diff --git a/nwnds_module/ar_itmblt_ranger.uti b/nwnds_module/ar_itmblt_ranger.uti new file mode 100644 index 000000000..284da9e3c Binary files /dev/null and b/nwnds_module/ar_itmblt_ranger.uti differ diff --git a/nwnds_module/ar_itmblt_undyin.uti b/nwnds_module/ar_itmblt_undyin.uti new file mode 100644 index 000000000..3bb3f26b4 Binary files /dev/null and b/nwnds_module/ar_itmblt_undyin.uti differ diff --git a/nwnds_module/ar_itmbts_arena.ncs b/nwnds_module/ar_itmbts_arena.ncs new file mode 100644 index 000000000..1b964f53b Binary files /dev/null and b/nwnds_module/ar_itmbts_arena.ncs differ diff --git a/nwnds_module/ar_itmbts_arena.nss b/nwnds_module/ar_itmbts_arena.nss new file mode 100644 index 000000000..093dbd6ee --- /dev/null +++ b/nwnds_module/ar_itmbts_arena.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a 40th level fighter, unequip the item + if(GetLevelByClass(CLASS_TYPE_FIGHTER, oPC) <= 39) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_itmbts_arena.uti b/nwnds_module/ar_itmbts_arena.uti new file mode 100644 index 000000000..66a443406 Binary files /dev/null and b/nwnds_module/ar_itmbts_arena.uti differ diff --git a/nwnds_module/ar_itmbts_dair.uti b/nwnds_module/ar_itmbts_dair.uti new file mode 100644 index 000000000..2e461b714 Binary files /dev/null and b/nwnds_module/ar_itmbts_dair.uti differ diff --git a/nwnds_module/ar_itmbts_dearth.uti b/nwnds_module/ar_itmbts_dearth.uti new file mode 100644 index 000000000..ba113861c Binary files /dev/null and b/nwnds_module/ar_itmbts_dearth.uti differ diff --git a/nwnds_module/ar_itmbts_dfire.uti b/nwnds_module/ar_itmbts_dfire.uti new file mode 100644 index 000000000..94dfd19f8 Binary files /dev/null and b/nwnds_module/ar_itmbts_dfire.uti differ diff --git a/nwnds_module/ar_itmbts_dmagma.uti b/nwnds_module/ar_itmbts_dmagma.uti new file mode 100644 index 000000000..6973b78c5 Binary files /dev/null and b/nwnds_module/ar_itmbts_dmagma.uti differ diff --git a/nwnds_module/ar_itmbts_drain.uti b/nwnds_module/ar_itmbts_drain.uti new file mode 100644 index 000000000..44f93c947 Binary files /dev/null and b/nwnds_module/ar_itmbts_drain.uti differ diff --git a/nwnds_module/ar_itmbts_drake.uti b/nwnds_module/ar_itmbts_drake.uti new file mode 100644 index 000000000..efb712e81 Binary files /dev/null and b/nwnds_module/ar_itmbts_drake.uti differ diff --git a/nwnds_module/ar_itmbts_draqo.uti b/nwnds_module/ar_itmbts_draqo.uti new file mode 100644 index 000000000..6b73d88fd Binary files /dev/null and b/nwnds_module/ar_itmbts_draqo.uti differ diff --git a/nwnds_module/ar_itmbts_dsilt.uti b/nwnds_module/ar_itmbts_dsilt.uti new file mode 100644 index 000000000..aa565a888 Binary files /dev/null and b/nwnds_module/ar_itmbts_dsilt.uti differ diff --git a/nwnds_module/ar_itmbts_dsun.uti b/nwnds_module/ar_itmbts_dsun.uti new file mode 100644 index 000000000..382662eef Binary files /dev/null and b/nwnds_module/ar_itmbts_dsun.uti differ diff --git a/nwnds_module/ar_itmbts_dwarf.uti b/nwnds_module/ar_itmbts_dwarf.uti new file mode 100644 index 000000000..c9b6afaf5 Binary files /dev/null and b/nwnds_module/ar_itmbts_dwarf.uti differ diff --git a/nwnds_module/ar_itmbts_dwater.uti b/nwnds_module/ar_itmbts_dwater.uti new file mode 100644 index 000000000..6fbcc990a Binary files /dev/null and b/nwnds_module/ar_itmbts_dwater.uti differ diff --git a/nwnds_module/ar_itmbts_earth.uti b/nwnds_module/ar_itmbts_earth.uti new file mode 100644 index 000000000..b9696756a Binary files /dev/null and b/nwnds_module/ar_itmbts_earth.uti differ diff --git a/nwnds_module/ar_itmbts_elf.uti b/nwnds_module/ar_itmbts_elf.uti new file mode 100644 index 000000000..bacb193ea Binary files /dev/null and b/nwnds_module/ar_itmbts_elf.uti differ diff --git a/nwnds_module/ar_itmbts_evade.uti b/nwnds_module/ar_itmbts_evade.uti new file mode 100644 index 000000000..217b168aa Binary files /dev/null and b/nwnds_module/ar_itmbts_evade.uti differ diff --git a/nwnds_module/ar_itmbts_ifrit.uti b/nwnds_module/ar_itmbts_ifrit.uti new file mode 100644 index 000000000..9934e0ccc Binary files /dev/null and b/nwnds_module/ar_itmbts_ifrit.uti differ diff --git a/nwnds_module/ar_itmbts_jingle.uti b/nwnds_module/ar_itmbts_jingle.uti new file mode 100644 index 000000000..bc26719e5 Binary files /dev/null and b/nwnds_module/ar_itmbts_jingle.uti differ diff --git a/nwnds_module/ar_itmbts_kyles.uti b/nwnds_module/ar_itmbts_kyles.uti new file mode 100644 index 000000000..f485cc4b1 Binary files /dev/null and b/nwnds_module/ar_itmbts_kyles.uti differ diff --git a/nwnds_module/ar_itmbts_light.uti b/nwnds_module/ar_itmbts_light.uti new file mode 100644 index 000000000..60f8d3b66 Binary files /dev/null and b/nwnds_module/ar_itmbts_light.uti differ diff --git a/nwnds_module/ar_itmbts_nimble.uti b/nwnds_module/ar_itmbts_nimble.uti new file mode 100644 index 000000000..f97156201 Binary files /dev/null and b/nwnds_module/ar_itmbts_nimble.uti differ diff --git a/nwnds_module/ar_itmbts_regen.uti b/nwnds_module/ar_itmbts_regen.uti new file mode 100644 index 000000000..ff9df2efa Binary files /dev/null and b/nwnds_module/ar_itmbts_regen.uti differ diff --git a/nwnds_module/ar_itmbts_shadow.uti b/nwnds_module/ar_itmbts_shadow.uti new file mode 100644 index 000000000..614432438 Binary files /dev/null and b/nwnds_module/ar_itmbts_shadow.uti differ diff --git a/nwnds_module/ar_itmbts_speed.uti b/nwnds_module/ar_itmbts_speed.uti new file mode 100644 index 000000000..371bc946b Binary files /dev/null and b/nwnds_module/ar_itmbts_speed.uti differ diff --git a/nwnds_module/ar_itmclk_barren.uti b/nwnds_module/ar_itmclk_barren.uti new file mode 100644 index 000000000..eb63035b0 Binary files /dev/null and b/nwnds_module/ar_itmclk_barren.uti differ diff --git a/nwnds_module/ar_itmclk_dair.uti b/nwnds_module/ar_itmclk_dair.uti new file mode 100644 index 000000000..b5bc0f10e Binary files /dev/null and b/nwnds_module/ar_itmclk_dair.uti differ diff --git a/nwnds_module/ar_itmclk_dearth.uti b/nwnds_module/ar_itmclk_dearth.uti new file mode 100644 index 000000000..c80902189 Binary files /dev/null and b/nwnds_module/ar_itmclk_dearth.uti differ diff --git a/nwnds_module/ar_itmclk_dfire.uti b/nwnds_module/ar_itmclk_dfire.uti new file mode 100644 index 000000000..4bbddd7b9 Binary files /dev/null and b/nwnds_module/ar_itmclk_dfire.uti differ diff --git a/nwnds_module/ar_itmclk_dmagma.uti b/nwnds_module/ar_itmclk_dmagma.uti new file mode 100644 index 000000000..b193deda1 Binary files /dev/null and b/nwnds_module/ar_itmclk_dmagma.uti differ diff --git a/nwnds_module/ar_itmclk_drain.uti b/nwnds_module/ar_itmclk_drain.uti new file mode 100644 index 000000000..603b5c0a3 Binary files /dev/null and b/nwnds_module/ar_itmclk_drain.uti differ diff --git a/nwnds_module/ar_itmclk_dsilt.uti b/nwnds_module/ar_itmclk_dsilt.uti new file mode 100644 index 000000000..d65d099cc Binary files /dev/null and b/nwnds_module/ar_itmclk_dsilt.uti differ diff --git a/nwnds_module/ar_itmclk_dsun.uti b/nwnds_module/ar_itmclk_dsun.uti new file mode 100644 index 000000000..21e365e29 Binary files /dev/null and b/nwnds_module/ar_itmclk_dsun.uti differ diff --git a/nwnds_module/ar_itmclk_dwater.uti b/nwnds_module/ar_itmclk_dwater.uti new file mode 100644 index 000000000..e6871e574 Binary files /dev/null and b/nwnds_module/ar_itmclk_dwater.uti differ diff --git a/nwnds_module/ar_itmclk_earth.uti b/nwnds_module/ar_itmclk_earth.uti new file mode 100644 index 000000000..faf775e29 Binary files /dev/null and b/nwnds_module/ar_itmclk_earth.uti differ diff --git a/nwnds_module/ar_itmclk_flame.uti b/nwnds_module/ar_itmclk_flame.uti new file mode 100644 index 000000000..6eee300f9 Binary files /dev/null and b/nwnds_module/ar_itmclk_flame.uti differ diff --git a/nwnds_module/ar_itmclk_forest.uti b/nwnds_module/ar_itmclk_forest.uti new file mode 100644 index 000000000..dbf91fe31 Binary files /dev/null and b/nwnds_module/ar_itmclk_forest.uti differ diff --git a/nwnds_module/ar_itmclk_githsk.uti b/nwnds_module/ar_itmclk_githsk.uti new file mode 100644 index 000000000..5b4687d80 Binary files /dev/null and b/nwnds_module/ar_itmclk_githsk.uti differ diff --git a/nwnds_module/ar_itmclk_heart.uti b/nwnds_module/ar_itmclk_heart.uti new file mode 100644 index 000000000..5c117a350 Binary files /dev/null and b/nwnds_module/ar_itmclk_heart.uti differ diff --git a/nwnds_module/ar_itmclk_kaisha.uti b/nwnds_module/ar_itmclk_kaisha.uti new file mode 100644 index 000000000..00db77e25 Binary files /dev/null and b/nwnds_module/ar_itmclk_kaisha.uti differ diff --git a/nwnds_module/ar_itmclk_lust.uti b/nwnds_module/ar_itmclk_lust.uti new file mode 100644 index 000000000..426035afb Binary files /dev/null and b/nwnds_module/ar_itmclk_lust.uti differ diff --git a/nwnds_module/ar_itmclk_necro.uti b/nwnds_module/ar_itmclk_necro.uti new file mode 100644 index 000000000..179ff912a Binary files /dev/null and b/nwnds_module/ar_itmclk_necro.uti differ diff --git a/nwnds_module/ar_itmclk_spectr.uti b/nwnds_module/ar_itmclk_spectr.uti new file mode 100644 index 000000000..87de2453a Binary files /dev/null and b/nwnds_module/ar_itmclk_spectr.uti differ diff --git a/nwnds_module/ar_itmclk_torak.uti b/nwnds_module/ar_itmclk_torak.uti new file mode 100644 index 000000000..42711080e Binary files /dev/null and b/nwnds_module/ar_itmclk_torak.uti differ diff --git a/nwnds_module/ar_itmclk_travis.uti b/nwnds_module/ar_itmclk_travis.uti new file mode 100644 index 000000000..3f3b98fb4 Binary files /dev/null and b/nwnds_module/ar_itmclk_travis.uti differ diff --git a/nwnds_module/ar_itmclk_tyrgd.uti b/nwnds_module/ar_itmclk_tyrgd.uti new file mode 100644 index 000000000..c8b2c2719 Binary files /dev/null and b/nwnds_module/ar_itmclk_tyrgd.uti differ diff --git a/nwnds_module/ar_itmclk_urikgd.uti b/nwnds_module/ar_itmclk_urikgd.uti new file mode 100644 index 000000000..060ac9f2f Binary files /dev/null and b/nwnds_module/ar_itmclk_urikgd.uti differ diff --git a/nwnds_module/ar_itmclk_wastes.uti b/nwnds_module/ar_itmclk_wastes.uti new file mode 100644 index 000000000..d4468d7fd Binary files /dev/null and b/nwnds_module/ar_itmclk_wastes.uti differ diff --git a/nwnds_module/ar_itmclk_water.uti b/nwnds_module/ar_itmclk_water.uti new file mode 100644 index 000000000..d2da32610 Binary files /dev/null and b/nwnds_module/ar_itmclk_water.uti differ diff --git a/nwnds_module/ar_itmclk_windm.uti b/nwnds_module/ar_itmclk_windm.uti new file mode 100644 index 000000000..9c0837c9a Binary files /dev/null and b/nwnds_module/ar_itmclk_windm.uti differ diff --git a/nwnds_module/ar_itmglv_bard.uti b/nwnds_module/ar_itmglv_bard.uti new file mode 100644 index 000000000..c2586e94a Binary files /dev/null and b/nwnds_module/ar_itmglv_bard.uti differ diff --git a/nwnds_module/ar_itmglv_bledge.uti b/nwnds_module/ar_itmglv_bledge.uti new file mode 100644 index 000000000..def7efadb Binary files /dev/null and b/nwnds_module/ar_itmglv_bledge.uti differ diff --git a/nwnds_module/ar_itmglv_dair.uti b/nwnds_module/ar_itmglv_dair.uti new file mode 100644 index 000000000..8be2b4de5 Binary files /dev/null and b/nwnds_module/ar_itmglv_dair.uti differ diff --git a/nwnds_module/ar_itmglv_dearth.uti b/nwnds_module/ar_itmglv_dearth.uti new file mode 100644 index 000000000..b69d9d781 Binary files /dev/null and b/nwnds_module/ar_itmglv_dearth.uti differ diff --git a/nwnds_module/ar_itmglv_defile.uti b/nwnds_module/ar_itmglv_defile.uti new file mode 100644 index 000000000..320e07787 Binary files /dev/null and b/nwnds_module/ar_itmglv_defile.uti differ diff --git a/nwnds_module/ar_itmglv_dfire.uti b/nwnds_module/ar_itmglv_dfire.uti new file mode 100644 index 000000000..50470c97e Binary files /dev/null and b/nwnds_module/ar_itmglv_dfire.uti differ diff --git a/nwnds_module/ar_itmglv_dmagma.uti b/nwnds_module/ar_itmglv_dmagma.uti new file mode 100644 index 000000000..ae6a42ff4 Binary files /dev/null and b/nwnds_module/ar_itmglv_dmagma.uti differ diff --git a/nwnds_module/ar_itmglv_drain.uti b/nwnds_module/ar_itmglv_drain.uti new file mode 100644 index 000000000..7a918bf5c Binary files /dev/null and b/nwnds_module/ar_itmglv_drain.uti differ diff --git a/nwnds_module/ar_itmglv_dsilt.uti b/nwnds_module/ar_itmglv_dsilt.uti new file mode 100644 index 000000000..0c337e09e Binary files /dev/null and b/nwnds_module/ar_itmglv_dsilt.uti differ diff --git a/nwnds_module/ar_itmglv_dsun.uti b/nwnds_module/ar_itmglv_dsun.uti new file mode 100644 index 000000000..8e905f8fd Binary files /dev/null and b/nwnds_module/ar_itmglv_dsun.uti differ diff --git a/nwnds_module/ar_itmglv_dwater.uti b/nwnds_module/ar_itmglv_dwater.uti new file mode 100644 index 000000000..db61c8d0c Binary files /dev/null and b/nwnds_module/ar_itmglv_dwater.uti differ diff --git a/nwnds_module/ar_itmglv_elemnt.uti b/nwnds_module/ar_itmglv_elemnt.uti new file mode 100644 index 000000000..896640f37 Binary files /dev/null and b/nwnds_module/ar_itmglv_elemnt.uti differ diff --git a/nwnds_module/ar_itmglv_etrade.uti b/nwnds_module/ar_itmglv_etrade.uti new file mode 100644 index 000000000..f649276ac Binary files /dev/null and b/nwnds_module/ar_itmglv_etrade.uti differ diff --git a/nwnds_module/ar_itmglv_faith.uti b/nwnds_module/ar_itmglv_faith.uti new file mode 100644 index 000000000..bd320d67d Binary files /dev/null and b/nwnds_module/ar_itmglv_faith.uti differ diff --git a/nwnds_module/ar_itmglv_fstone.uti b/nwnds_module/ar_itmglv_fstone.uti new file mode 100644 index 000000000..dd9f3a64c Binary files /dev/null and b/nwnds_module/ar_itmglv_fstone.uti differ diff --git a/nwnds_module/ar_itmglv_gladtr.uti b/nwnds_module/ar_itmglv_gladtr.uti new file mode 100644 index 000000000..e009eb824 Binary files /dev/null and b/nwnds_module/ar_itmglv_gladtr.uti differ diff --git a/nwnds_module/ar_itmglv_grids.uti b/nwnds_module/ar_itmglv_grids.uti new file mode 100644 index 000000000..6705f10cd Binary files /dev/null and b/nwnds_module/ar_itmglv_grids.uti differ diff --git a/nwnds_module/ar_itmglv_gtouch.uti b/nwnds_module/ar_itmglv_gtouch.uti new file mode 100644 index 000000000..ced39f3cb Binary files /dev/null and b/nwnds_module/ar_itmglv_gtouch.uti differ diff --git a/nwnds_module/ar_itmglv_kelas.uti b/nwnds_module/ar_itmglv_kelas.uti new file mode 100644 index 000000000..061973144 Binary files /dev/null and b/nwnds_module/ar_itmglv_kelas.uti differ diff --git a/nwnds_module/ar_itmglv_sister.uti b/nwnds_module/ar_itmglv_sister.uti new file mode 100644 index 000000000..933bc6fac Binary files /dev/null and b/nwnds_module/ar_itmglv_sister.uti differ diff --git a/nwnds_module/ar_itmglv_sr.uti b/nwnds_module/ar_itmglv_sr.uti new file mode 100644 index 000000000..b28eb84c2 Binary files /dev/null and b/nwnds_module/ar_itmglv_sr.uti differ diff --git a/nwnds_module/ar_itmglv_wizard.uti b/nwnds_module/ar_itmglv_wizard.uti new file mode 100644 index 000000000..3b9b36ed6 Binary files /dev/null and b/nwnds_module/ar_itmglv_wizard.uti differ diff --git a/nwnds_module/ar_itmglv_zephry.uti b/nwnds_module/ar_itmglv_zephry.uti new file mode 100644 index 000000000..3c7a4f63a Binary files /dev/null and b/nwnds_module/ar_itmglv_zephry.uti differ diff --git a/nwnds_module/ar_itmnck_advent.uti b/nwnds_module/ar_itmnck_advent.uti new file mode 100644 index 000000000..f604df90b Binary files /dev/null and b/nwnds_module/ar_itmnck_advent.uti differ diff --git a/nwnds_module/ar_itmnck_airdh.uti b/nwnds_module/ar_itmnck_airdh.uti new file mode 100644 index 000000000..dc1b0d87a Binary files /dev/null and b/nwnds_module/ar_itmnck_airdh.uti differ diff --git a/nwnds_module/ar_itmnck_alhope.uti b/nwnds_module/ar_itmnck_alhope.uti new file mode 100644 index 000000000..6ada7faa0 Binary files /dev/null and b/nwnds_module/ar_itmnck_alhope.uti differ diff --git a/nwnds_module/ar_itmnck_cha00.uti b/nwnds_module/ar_itmnck_cha00.uti new file mode 100644 index 000000000..f77b26e58 Binary files /dev/null and b/nwnds_module/ar_itmnck_cha00.uti differ diff --git a/nwnds_module/ar_itmnck_cha01.uti b/nwnds_module/ar_itmnck_cha01.uti new file mode 100644 index 000000000..0d20f3edf Binary files /dev/null and b/nwnds_module/ar_itmnck_cha01.uti differ diff --git a/nwnds_module/ar_itmnck_cha02.uti b/nwnds_module/ar_itmnck_cha02.uti new file mode 100644 index 000000000..6df2a6ee6 Binary files /dev/null and b/nwnds_module/ar_itmnck_cha02.uti differ diff --git a/nwnds_module/ar_itmnck_cha03.uti b/nwnds_module/ar_itmnck_cha03.uti new file mode 100644 index 000000000..4aa8a4d22 Binary files /dev/null and b/nwnds_module/ar_itmnck_cha03.uti differ diff --git a/nwnds_module/ar_itmnck_cha04.uti b/nwnds_module/ar_itmnck_cha04.uti new file mode 100644 index 000000000..c6eed1169 Binary files /dev/null and b/nwnds_module/ar_itmnck_cha04.uti differ diff --git a/nwnds_module/ar_itmnck_con00.uti b/nwnds_module/ar_itmnck_con00.uti new file mode 100644 index 000000000..91e76bed5 Binary files /dev/null and b/nwnds_module/ar_itmnck_con00.uti differ diff --git a/nwnds_module/ar_itmnck_con01.uti b/nwnds_module/ar_itmnck_con01.uti new file mode 100644 index 000000000..62dc0f414 Binary files /dev/null and b/nwnds_module/ar_itmnck_con01.uti differ diff --git a/nwnds_module/ar_itmnck_con02.uti b/nwnds_module/ar_itmnck_con02.uti new file mode 100644 index 000000000..fecedb79f Binary files /dev/null and b/nwnds_module/ar_itmnck_con02.uti differ diff --git a/nwnds_module/ar_itmnck_con03.uti b/nwnds_module/ar_itmnck_con03.uti new file mode 100644 index 000000000..be6e93d5d Binary files /dev/null and b/nwnds_module/ar_itmnck_con03.uti differ diff --git a/nwnds_module/ar_itmnck_con04.uti b/nwnds_module/ar_itmnck_con04.uti new file mode 100644 index 000000000..156bd233a Binary files /dev/null and b/nwnds_module/ar_itmnck_con04.uti differ diff --git a/nwnds_module/ar_itmnck_dex00.uti b/nwnds_module/ar_itmnck_dex00.uti new file mode 100644 index 000000000..a923069b1 Binary files /dev/null and b/nwnds_module/ar_itmnck_dex00.uti differ diff --git a/nwnds_module/ar_itmnck_dex01.uti b/nwnds_module/ar_itmnck_dex01.uti new file mode 100644 index 000000000..3aa5c06c4 Binary files /dev/null and b/nwnds_module/ar_itmnck_dex01.uti differ diff --git a/nwnds_module/ar_itmnck_dex02.uti b/nwnds_module/ar_itmnck_dex02.uti new file mode 100644 index 000000000..a5e429ce9 Binary files /dev/null and b/nwnds_module/ar_itmnck_dex02.uti differ diff --git a/nwnds_module/ar_itmnck_dex03.uti b/nwnds_module/ar_itmnck_dex03.uti new file mode 100644 index 000000000..5b032d5c7 Binary files /dev/null and b/nwnds_module/ar_itmnck_dex03.uti differ diff --git a/nwnds_module/ar_itmnck_dex04.uti b/nwnds_module/ar_itmnck_dex04.uti new file mode 100644 index 000000000..e6c52c820 Binary files /dev/null and b/nwnds_module/ar_itmnck_dex04.uti differ diff --git a/nwnds_module/ar_itmnck_drkvis.uti b/nwnds_module/ar_itmnck_drkvis.uti new file mode 100644 index 000000000..50617944f Binary files /dev/null and b/nwnds_module/ar_itmnck_drkvis.uti differ diff --git a/nwnds_module/ar_itmnck_earthd.uti b/nwnds_module/ar_itmnck_earthd.uti new file mode 100644 index 000000000..343f29ba0 Binary files /dev/null and b/nwnds_module/ar_itmnck_earthd.uti differ diff --git a/nwnds_module/ar_itmnck_elemnt.uti b/nwnds_module/ar_itmnck_elemnt.uti new file mode 100644 index 000000000..391f08b15 Binary files /dev/null and b/nwnds_module/ar_itmnck_elemnt.uti differ diff --git a/nwnds_module/ar_itmnck_fired.uti b/nwnds_module/ar_itmnck_fired.uti new file mode 100644 index 000000000..03927a182 Binary files /dev/null and b/nwnds_module/ar_itmnck_fired.uti differ diff --git a/nwnds_module/ar_itmnck_galian.uti b/nwnds_module/ar_itmnck_galian.uti new file mode 100644 index 000000000..1ef844c20 Binary files /dev/null and b/nwnds_module/ar_itmnck_galian.uti differ diff --git a/nwnds_module/ar_itmnck_int00.uti b/nwnds_module/ar_itmnck_int00.uti new file mode 100644 index 000000000..00862a336 Binary files /dev/null and b/nwnds_module/ar_itmnck_int00.uti differ diff --git a/nwnds_module/ar_itmnck_int01.uti b/nwnds_module/ar_itmnck_int01.uti new file mode 100644 index 000000000..3c8c27513 Binary files /dev/null and b/nwnds_module/ar_itmnck_int01.uti differ diff --git a/nwnds_module/ar_itmnck_int02.uti b/nwnds_module/ar_itmnck_int02.uti new file mode 100644 index 000000000..c3f7019d6 Binary files /dev/null and b/nwnds_module/ar_itmnck_int02.uti differ diff --git a/nwnds_module/ar_itmnck_int03.uti b/nwnds_module/ar_itmnck_int03.uti new file mode 100644 index 000000000..b5ef386e4 Binary files /dev/null and b/nwnds_module/ar_itmnck_int03.uti differ diff --git a/nwnds_module/ar_itmnck_int04.uti b/nwnds_module/ar_itmnck_int04.uti new file mode 100644 index 000000000..d530e13f7 Binary files /dev/null and b/nwnds_module/ar_itmnck_int04.uti differ diff --git a/nwnds_module/ar_itmnck_sand01.uti b/nwnds_module/ar_itmnck_sand01.uti new file mode 100644 index 000000000..1fc633c1a Binary files /dev/null and b/nwnds_module/ar_itmnck_sand01.uti differ diff --git a/nwnds_module/ar_itmnck_sand02.uti b/nwnds_module/ar_itmnck_sand02.uti new file mode 100644 index 000000000..38685ba86 Binary files /dev/null and b/nwnds_module/ar_itmnck_sand02.uti differ diff --git a/nwnds_module/ar_itmnck_stlth.uti b/nwnds_module/ar_itmnck_stlth.uti new file mode 100644 index 000000000..df4460977 Binary files /dev/null and b/nwnds_module/ar_itmnck_stlth.uti differ diff --git a/nwnds_module/ar_itmnck_str00.uti b/nwnds_module/ar_itmnck_str00.uti new file mode 100644 index 000000000..e4a470dd6 Binary files /dev/null and b/nwnds_module/ar_itmnck_str00.uti differ diff --git a/nwnds_module/ar_itmnck_str01.uti b/nwnds_module/ar_itmnck_str01.uti new file mode 100644 index 000000000..473e98138 Binary files /dev/null and b/nwnds_module/ar_itmnck_str01.uti differ diff --git a/nwnds_module/ar_itmnck_str02.uti b/nwnds_module/ar_itmnck_str02.uti new file mode 100644 index 000000000..fd9ccb1f0 Binary files /dev/null and b/nwnds_module/ar_itmnck_str02.uti differ diff --git a/nwnds_module/ar_itmnck_str03.uti b/nwnds_module/ar_itmnck_str03.uti new file mode 100644 index 000000000..968c24f46 Binary files /dev/null and b/nwnds_module/ar_itmnck_str03.uti differ diff --git a/nwnds_module/ar_itmnck_str04.uti b/nwnds_module/ar_itmnck_str04.uti new file mode 100644 index 000000000..0ad029610 Binary files /dev/null and b/nwnds_module/ar_itmnck_str04.uti differ diff --git a/nwnds_module/ar_itmnck_vital.uti b/nwnds_module/ar_itmnck_vital.uti new file mode 100644 index 000000000..77adeb6c4 Binary files /dev/null and b/nwnds_module/ar_itmnck_vital.uti differ diff --git a/nwnds_module/ar_itmnck_waterd.uti b/nwnds_module/ar_itmnck_waterd.uti new file mode 100644 index 000000000..a2fab731a Binary files /dev/null and b/nwnds_module/ar_itmnck_waterd.uti differ diff --git a/nwnds_module/ar_itmnck_wis00.uti b/nwnds_module/ar_itmnck_wis00.uti new file mode 100644 index 000000000..a2ece3a4c Binary files /dev/null and b/nwnds_module/ar_itmnck_wis00.uti differ diff --git a/nwnds_module/ar_itmnck_wis01.uti b/nwnds_module/ar_itmnck_wis01.uti new file mode 100644 index 000000000..2b1e956e6 Binary files /dev/null and b/nwnds_module/ar_itmnck_wis01.uti differ diff --git a/nwnds_module/ar_itmnck_wis02.uti b/nwnds_module/ar_itmnck_wis02.uti new file mode 100644 index 000000000..5f1840669 Binary files /dev/null and b/nwnds_module/ar_itmnck_wis02.uti differ diff --git a/nwnds_module/ar_itmnck_wis03.uti b/nwnds_module/ar_itmnck_wis03.uti new file mode 100644 index 000000000..b6a83a502 Binary files /dev/null and b/nwnds_module/ar_itmnck_wis03.uti differ diff --git a/nwnds_module/ar_itmnck_wis04.uti b/nwnds_module/ar_itmnck_wis04.uti new file mode 100644 index 000000000..ca46b04f9 Binary files /dev/null and b/nwnds_module/ar_itmnck_wis04.uti differ diff --git a/nwnds_module/ar_itmrng_age01.uti b/nwnds_module/ar_itmrng_age01.uti new file mode 100644 index 000000000..8686a8e90 Binary files /dev/null and b/nwnds_module/ar_itmrng_age01.uti differ diff --git a/nwnds_module/ar_itmrng_breach.uti b/nwnds_module/ar_itmrng_breach.uti new file mode 100644 index 000000000..4ad5aa1b8 Binary files /dev/null and b/nwnds_module/ar_itmrng_breach.uti differ diff --git a/nwnds_module/ar_itmrng_cha00.uti b/nwnds_module/ar_itmrng_cha00.uti new file mode 100644 index 000000000..b07f03707 Binary files /dev/null and b/nwnds_module/ar_itmrng_cha00.uti differ diff --git a/nwnds_module/ar_itmrng_cha01.uti b/nwnds_module/ar_itmrng_cha01.uti new file mode 100644 index 000000000..943a8d577 Binary files /dev/null and b/nwnds_module/ar_itmrng_cha01.uti differ diff --git a/nwnds_module/ar_itmrng_cha02.uti b/nwnds_module/ar_itmrng_cha02.uti new file mode 100644 index 000000000..9436f8065 Binary files /dev/null and b/nwnds_module/ar_itmrng_cha02.uti differ diff --git a/nwnds_module/ar_itmrng_cha03.uti b/nwnds_module/ar_itmrng_cha03.uti new file mode 100644 index 000000000..1a30266cb Binary files /dev/null and b/nwnds_module/ar_itmrng_cha03.uti differ diff --git a/nwnds_module/ar_itmrng_cha04.uti b/nwnds_module/ar_itmrng_cha04.uti new file mode 100644 index 000000000..b82674914 Binary files /dev/null and b/nwnds_module/ar_itmrng_cha04.uti differ diff --git a/nwnds_module/ar_itmrng_change.uti b/nwnds_module/ar_itmrng_change.uti new file mode 100644 index 000000000..bb16b1716 Binary files /dev/null and b/nwnds_module/ar_itmrng_change.uti differ diff --git a/nwnds_module/ar_itmrng_con00.uti b/nwnds_module/ar_itmrng_con00.uti new file mode 100644 index 000000000..158c21a73 Binary files /dev/null and b/nwnds_module/ar_itmrng_con00.uti differ diff --git a/nwnds_module/ar_itmrng_con01.uti b/nwnds_module/ar_itmrng_con01.uti new file mode 100644 index 000000000..9f6018a5b Binary files /dev/null and b/nwnds_module/ar_itmrng_con01.uti differ diff --git a/nwnds_module/ar_itmrng_con02.uti b/nwnds_module/ar_itmrng_con02.uti new file mode 100644 index 000000000..559026fb4 Binary files /dev/null and b/nwnds_module/ar_itmrng_con02.uti differ diff --git a/nwnds_module/ar_itmrng_con03.uti b/nwnds_module/ar_itmrng_con03.uti new file mode 100644 index 000000000..f40fb9d20 Binary files /dev/null and b/nwnds_module/ar_itmrng_con03.uti differ diff --git a/nwnds_module/ar_itmrng_con04.uti b/nwnds_module/ar_itmrng_con04.uti new file mode 100644 index 000000000..69f17742f Binary files /dev/null and b/nwnds_module/ar_itmrng_con04.uti differ diff --git a/nwnds_module/ar_itmrng_dex00.uti b/nwnds_module/ar_itmrng_dex00.uti new file mode 100644 index 000000000..75aaa1636 Binary files /dev/null and b/nwnds_module/ar_itmrng_dex00.uti differ diff --git a/nwnds_module/ar_itmrng_dex01.uti b/nwnds_module/ar_itmrng_dex01.uti new file mode 100644 index 000000000..2b9153bd2 Binary files /dev/null and b/nwnds_module/ar_itmrng_dex01.uti differ diff --git a/nwnds_module/ar_itmrng_dex02.uti b/nwnds_module/ar_itmrng_dex02.uti new file mode 100644 index 000000000..9e5b421b1 Binary files /dev/null and b/nwnds_module/ar_itmrng_dex02.uti differ diff --git a/nwnds_module/ar_itmrng_dex03.uti b/nwnds_module/ar_itmrng_dex03.uti new file mode 100644 index 000000000..67a1b44c6 Binary files /dev/null and b/nwnds_module/ar_itmrng_dex03.uti differ diff --git a/nwnds_module/ar_itmrng_dex04.uti b/nwnds_module/ar_itmrng_dex04.uti new file mode 100644 index 000000000..348869d20 Binary files /dev/null and b/nwnds_module/ar_itmrng_dex04.uti differ diff --git a/nwnds_module/ar_itmrng_dgreed.uti b/nwnds_module/ar_itmrng_dgreed.uti new file mode 100644 index 000000000..5a395570e Binary files /dev/null and b/nwnds_module/ar_itmrng_dgreed.uti differ diff --git a/nwnds_module/ar_itmrng_dispel.uti b/nwnds_module/ar_itmrng_dispel.uti new file mode 100644 index 000000000..6ca6d03fc Binary files /dev/null and b/nwnds_module/ar_itmrng_dispel.uti differ diff --git a/nwnds_module/ar_itmrng_elem01.uti b/nwnds_module/ar_itmrng_elem01.uti new file mode 100644 index 000000000..ec127f6a6 Binary files /dev/null and b/nwnds_module/ar_itmrng_elem01.uti differ diff --git a/nwnds_module/ar_itmrng_elem02.uti b/nwnds_module/ar_itmrng_elem02.uti new file mode 100644 index 000000000..8df619ea2 Binary files /dev/null and b/nwnds_module/ar_itmrng_elem02.uti differ diff --git a/nwnds_module/ar_itmrng_endir.uti b/nwnds_module/ar_itmrng_endir.uti new file mode 100644 index 000000000..8acfff060 Binary files /dev/null and b/nwnds_module/ar_itmrng_endir.uti differ diff --git a/nwnds_module/ar_itmrng_hate.uti b/nwnds_module/ar_itmrng_hate.uti new file mode 100644 index 000000000..4ff72d3c0 Binary files /dev/null and b/nwnds_module/ar_itmrng_hate.uti differ diff --git a/nwnds_module/ar_itmrng_heartw.uti b/nwnds_module/ar_itmrng_heartw.uti new file mode 100644 index 000000000..1a7c45afc Binary files /dev/null and b/nwnds_module/ar_itmrng_heartw.uti differ diff --git a/nwnds_module/ar_itmrng_int00.uti b/nwnds_module/ar_itmrng_int00.uti new file mode 100644 index 000000000..6dbd25637 Binary files /dev/null and b/nwnds_module/ar_itmrng_int00.uti differ diff --git a/nwnds_module/ar_itmrng_int01.uti b/nwnds_module/ar_itmrng_int01.uti new file mode 100644 index 000000000..0ed6003da Binary files /dev/null and b/nwnds_module/ar_itmrng_int01.uti differ diff --git a/nwnds_module/ar_itmrng_int02.uti b/nwnds_module/ar_itmrng_int02.uti new file mode 100644 index 000000000..73ebdda0f Binary files /dev/null and b/nwnds_module/ar_itmrng_int02.uti differ diff --git a/nwnds_module/ar_itmrng_int03.uti b/nwnds_module/ar_itmrng_int03.uti new file mode 100644 index 000000000..b05e9e1d3 Binary files /dev/null and b/nwnds_module/ar_itmrng_int03.uti differ diff --git a/nwnds_module/ar_itmrng_int04.uti b/nwnds_module/ar_itmrng_int04.uti new file mode 100644 index 000000000..9c9679cc7 Binary files /dev/null and b/nwnds_module/ar_itmrng_int04.uti differ diff --git a/nwnds_module/ar_itmrng_karlen.uti b/nwnds_module/ar_itmrng_karlen.uti new file mode 100644 index 000000000..8b8317a7a Binary files /dev/null and b/nwnds_module/ar_itmrng_karlen.uti differ diff --git a/nwnds_module/ar_itmrng_life.uti b/nwnds_module/ar_itmrng_life.uti new file mode 100644 index 000000000..15c5aa817 Binary files /dev/null and b/nwnds_module/ar_itmrng_life.uti differ diff --git a/nwnds_module/ar_itmrng_nature.uti b/nwnds_module/ar_itmrng_nature.uti new file mode 100644 index 000000000..795ef15ee Binary files /dev/null and b/nwnds_module/ar_itmrng_nature.uti differ diff --git a/nwnds_module/ar_itmrng_nightf.uti b/nwnds_module/ar_itmrng_nightf.uti new file mode 100644 index 000000000..eca580ac1 Binary files /dev/null and b/nwnds_module/ar_itmrng_nightf.uti differ diff --git a/nwnds_module/ar_itmrng_polym.uti b/nwnds_module/ar_itmrng_polym.uti new file mode 100644 index 000000000..b1fac830d Binary files /dev/null and b/nwnds_module/ar_itmrng_polym.uti differ diff --git a/nwnds_module/ar_itmrng_porius.uti b/nwnds_module/ar_itmrng_porius.uti new file mode 100644 index 000000000..cbfdc5649 Binary files /dev/null and b/nwnds_module/ar_itmrng_porius.uti differ diff --git a/nwnds_module/ar_itmrng_sage.uti b/nwnds_module/ar_itmrng_sage.uti new file mode 100644 index 000000000..63f2940cf Binary files /dev/null and b/nwnds_module/ar_itmrng_sage.uti differ diff --git a/nwnds_module/ar_itmrng_sr01.uti b/nwnds_module/ar_itmrng_sr01.uti new file mode 100644 index 000000000..5ad55a0b9 Binary files /dev/null and b/nwnds_module/ar_itmrng_sr01.uti differ diff --git a/nwnds_module/ar_itmrng_str00.uti b/nwnds_module/ar_itmrng_str00.uti new file mode 100644 index 000000000..8458450c5 Binary files /dev/null and b/nwnds_module/ar_itmrng_str00.uti differ diff --git a/nwnds_module/ar_itmrng_str01.uti b/nwnds_module/ar_itmrng_str01.uti new file mode 100644 index 000000000..b1db52577 Binary files /dev/null and b/nwnds_module/ar_itmrng_str01.uti differ diff --git a/nwnds_module/ar_itmrng_str02.uti b/nwnds_module/ar_itmrng_str02.uti new file mode 100644 index 000000000..fa505a61b Binary files /dev/null and b/nwnds_module/ar_itmrng_str02.uti differ diff --git a/nwnds_module/ar_itmrng_str03.uti b/nwnds_module/ar_itmrng_str03.uti new file mode 100644 index 000000000..3caeb0913 Binary files /dev/null and b/nwnds_module/ar_itmrng_str03.uti differ diff --git a/nwnds_module/ar_itmrng_str04.uti b/nwnds_module/ar_itmrng_str04.uti new file mode 100644 index 000000000..ecfd1cfce Binary files /dev/null and b/nwnds_module/ar_itmrng_str04.uti differ diff --git a/nwnds_module/ar_itmrng_sunrun.uti b/nwnds_module/ar_itmrng_sunrun.uti new file mode 100644 index 000000000..90b9e0a21 Binary files /dev/null and b/nwnds_module/ar_itmrng_sunrun.uti differ diff --git a/nwnds_module/ar_itmrng_thrax.uti b/nwnds_module/ar_itmrng_thrax.uti new file mode 100644 index 000000000..57b9dcb63 Binary files /dev/null and b/nwnds_module/ar_itmrng_thrax.uti differ diff --git a/nwnds_module/ar_itmrng_va01.uti b/nwnds_module/ar_itmrng_va01.uti new file mode 100644 index 000000000..85c0919a7 Binary files /dev/null and b/nwnds_module/ar_itmrng_va01.uti differ diff --git a/nwnds_module/ar_itmrng_wis00.uti b/nwnds_module/ar_itmrng_wis00.uti new file mode 100644 index 000000000..0614e0618 Binary files /dev/null and b/nwnds_module/ar_itmrng_wis00.uti differ diff --git a/nwnds_module/ar_itmrng_wis01.uti b/nwnds_module/ar_itmrng_wis01.uti new file mode 100644 index 000000000..159f476c8 Binary files /dev/null and b/nwnds_module/ar_itmrng_wis01.uti differ diff --git a/nwnds_module/ar_itmrng_wis02.uti b/nwnds_module/ar_itmrng_wis02.uti new file mode 100644 index 000000000..581389f9e Binary files /dev/null and b/nwnds_module/ar_itmrng_wis02.uti differ diff --git a/nwnds_module/ar_itmrng_wis03.uti b/nwnds_module/ar_itmrng_wis03.uti new file mode 100644 index 000000000..c8abab7af Binary files /dev/null and b/nwnds_module/ar_itmrng_wis03.uti differ diff --git a/nwnds_module/ar_itmrng_wis04.uti b/nwnds_module/ar_itmrng_wis04.uti new file mode 100644 index 000000000..e5d4b2f56 Binary files /dev/null and b/nwnds_module/ar_itmrng_wis04.uti differ diff --git a/nwnds_module/ar_itmrng_witch.uti b/nwnds_module/ar_itmrng_witch.uti new file mode 100644 index 000000000..ccbffab6d Binary files /dev/null and b/nwnds_module/ar_itmrng_witch.uti differ diff --git a/nwnds_module/ar_itnck_antidot.uti b/nwnds_module/ar_itnck_antidot.uti new file mode 100644 index 000000000..652a68fb0 Binary files /dev/null and b/nwnds_module/ar_itnck_antidot.uti differ diff --git a/nwnds_module/ar_itnck_health.uti b/nwnds_module/ar_itnck_health.uti new file mode 100644 index 000000000..62ac2a9ff Binary files /dev/null and b/nwnds_module/ar_itnck_health.uti differ diff --git a/nwnds_module/ar_itnck_hl_aura.uti b/nwnds_module/ar_itnck_hl_aura.uti new file mode 100644 index 000000000..45a4b1507 Binary files /dev/null and b/nwnds_module/ar_itnck_hl_aura.uti differ diff --git a/nwnds_module/ar_itnck_insight.uti b/nwnds_module/ar_itnck_insight.uti new file mode 100644 index 000000000..6883497ae Binary files /dev/null and b/nwnds_module/ar_itnck_insight.uti differ diff --git a/nwnds_module/ar_itnck_invigor.uti b/nwnds_module/ar_itnck_invigor.uti new file mode 100644 index 000000000..c875760a8 Binary files /dev/null and b/nwnds_module/ar_itnck_invigor.uti differ diff --git a/nwnds_module/ar_itnck_spider.uti b/nwnds_module/ar_itnck_spider.uti new file mode 100644 index 000000000..e89ad0306 Binary files /dev/null and b/nwnds_module/ar_itnck_spider.uti differ diff --git a/nwnds_module/ar_itpbcr_battle.uti b/nwnds_module/ar_itpbcr_battle.uti new file mode 100644 index 000000000..a333aed40 Binary files /dev/null and b/nwnds_module/ar_itpbcr_battle.uti differ diff --git a/nwnds_module/ar_itpbk_ctgrace.uti b/nwnds_module/ar_itpbk_ctgrace.uti new file mode 100644 index 000000000..5b8eff29a Binary files /dev/null and b/nwnds_module/ar_itpbk_ctgrace.uti differ diff --git a/nwnds_module/ar_itpblt_brawl.uti b/nwnds_module/ar_itpblt_brawl.uti new file mode 100644 index 000000000..300a6fee1 Binary files /dev/null and b/nwnds_module/ar_itpblt_brawl.uti differ diff --git a/nwnds_module/ar_itpblt_inbarr.uti b/nwnds_module/ar_itpblt_inbarr.uti new file mode 100644 index 000000000..e0cd72a7b Binary files /dev/null and b/nwnds_module/ar_itpblt_inbarr.uti differ diff --git a/nwnds_module/ar_itpblt_psypho.uti b/nwnds_module/ar_itpblt_psypho.uti new file mode 100644 index 000000000..126518a15 Binary files /dev/null and b/nwnds_module/ar_itpblt_psypho.uti differ diff --git a/nwnds_module/ar_itpblt_recove.uti b/nwnds_module/ar_itpblt_recove.uti new file mode 100644 index 000000000..6311a2fb9 Binary files /dev/null and b/nwnds_module/ar_itpblt_recove.uti differ diff --git a/nwnds_module/ar_itpbts_black.ncs b/nwnds_module/ar_itpbts_black.ncs new file mode 100644 index 000000000..cb8d52711 Binary files /dev/null and b/nwnds_module/ar_itpbts_black.ncs differ diff --git a/nwnds_module/ar_itpbts_black.nss b/nwnds_module/ar_itpbts_black.nss new file mode 100644 index 000000000..7d0508f2b --- /dev/null +++ b/nwnds_module/ar_itpbts_black.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a shadowdancer, unequip the item + if(GetLevelByClass(CLASS_TYPE_SHADOWDANCER, oPC) <= 0) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/ar_itpbts_black.uti b/nwnds_module/ar_itpbts_black.uti new file mode 100644 index 000000000..6868a36dd Binary files /dev/null and b/nwnds_module/ar_itpbts_black.uti differ diff --git a/nwnds_module/ar_itpbts_coward.uti b/nwnds_module/ar_itpbts_coward.uti new file mode 100644 index 000000000..eeef3c35f Binary files /dev/null and b/nwnds_module/ar_itpbts_coward.uti differ diff --git a/nwnds_module/ar_itpbts_imbued.uti b/nwnds_module/ar_itpbts_imbued.uti new file mode 100644 index 000000000..673194622 Binary files /dev/null and b/nwnds_module/ar_itpbts_imbued.uti differ diff --git a/nwnds_module/ar_itpbts_jazsts.uti b/nwnds_module/ar_itpbts_jazsts.uti new file mode 100644 index 000000000..072b46a12 Binary files /dev/null and b/nwnds_module/ar_itpbts_jazsts.uti differ diff --git a/nwnds_module/ar_itpclk_repel1.uti b/nwnds_module/ar_itpclk_repel1.uti new file mode 100644 index 000000000..76549c46d Binary files /dev/null and b/nwnds_module/ar_itpclk_repel1.uti differ diff --git a/nwnds_module/ar_itpclk_repel2.uti b/nwnds_module/ar_itpclk_repel2.uti new file mode 100644 index 000000000..518d48cbe Binary files /dev/null and b/nwnds_module/ar_itpclk_repel2.uti differ diff --git a/nwnds_module/ar_itpclk_ruby.uti b/nwnds_module/ar_itpclk_ruby.uti new file mode 100644 index 000000000..e45558e41 Binary files /dev/null and b/nwnds_module/ar_itpclk_ruby.uti differ diff --git a/nwnds_module/ar_itpglv_deftns.uti b/nwnds_module/ar_itpglv_deftns.uti new file mode 100644 index 000000000..c00410bc7 Binary files /dev/null and b/nwnds_module/ar_itpglv_deftns.uti differ diff --git a/nwnds_module/ar_itpglv_focus.uti b/nwnds_module/ar_itpglv_focus.uti new file mode 100644 index 000000000..7a7495b4a Binary files /dev/null and b/nwnds_module/ar_itpglv_focus.uti differ diff --git a/nwnds_module/ar_itpglv_italid.uti b/nwnds_module/ar_itpglv_italid.uti new file mode 100644 index 000000000..bf306258b Binary files /dev/null and b/nwnds_module/ar_itpglv_italid.uti differ diff --git a/nwnds_module/ar_itpglv_master.uti b/nwnds_module/ar_itpglv_master.uti new file mode 100644 index 000000000..77e17857e Binary files /dev/null and b/nwnds_module/ar_itpglv_master.uti differ diff --git a/nwnds_module/ar_itpglv_obs03.ncs b/nwnds_module/ar_itpglv_obs03.ncs new file mode 100644 index 000000000..2540fd480 Binary files /dev/null and b/nwnds_module/ar_itpglv_obs03.ncs differ diff --git a/nwnds_module/ar_itpglv_obs03.nss b/nwnds_module/ar_itpglv_obs03.nss new file mode 100644 index 000000000..807d2405f --- /dev/null +++ b/nwnds_module/ar_itpglv_obs03.nss @@ -0,0 +1,30 @@ + + // Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +//#include "prc_class_const" + +const int CLASS_TYPE_GLADIATOR=45; + +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they aren't a lvl 21 gladiator, unequip the item + if(GetLevelByClass(45, oPC) <= 20) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} + diff --git a/nwnds_module/ar_itpglv_obs03.uti b/nwnds_module/ar_itpglv_obs03.uti new file mode 100644 index 000000000..f67d7183a Binary files /dev/null and b/nwnds_module/ar_itpglv_obs03.uti differ diff --git a/nwnds_module/ar_itpglv_pilfer.uti b/nwnds_module/ar_itpglv_pilfer.uti new file mode 100644 index 000000000..88a6b71a5 Binary files /dev/null and b/nwnds_module/ar_itpglv_pilfer.uti differ diff --git a/nwnds_module/ar_itpglv_repell.uti b/nwnds_module/ar_itpglv_repell.uti new file mode 100644 index 000000000..892994423 Binary files /dev/null and b/nwnds_module/ar_itpglv_repell.uti differ diff --git a/nwnds_module/ar_itpglv_tame.uti b/nwnds_module/ar_itpglv_tame.uti new file mode 100644 index 000000000..77123963f Binary files /dev/null and b/nwnds_module/ar_itpglv_tame.uti differ diff --git a/nwnds_module/ar_itpglv_virann.uti b/nwnds_module/ar_itpglv_virann.uti new file mode 100644 index 000000000..7bae70867 Binary files /dev/null and b/nwnds_module/ar_itpglv_virann.uti differ diff --git a/nwnds_module/ar_itpglv_warrr.uti b/nwnds_module/ar_itpglv_warrr.uti new file mode 100644 index 000000000..9dde8fd15 Binary files /dev/null and b/nwnds_module/ar_itpglv_warrr.uti differ diff --git a/nwnds_module/ar_itpnck_clrsee.uti b/nwnds_module/ar_itpnck_clrsee.uti new file mode 100644 index 000000000..21048630c Binary files /dev/null and b/nwnds_module/ar_itpnck_clrsee.uti differ diff --git a/nwnds_module/ar_itpnck_hocean.uti b/nwnds_module/ar_itpnck_hocean.uti new file mode 100644 index 000000000..772c136f5 Binary files /dev/null and b/nwnds_module/ar_itpnck_hocean.uti differ diff --git a/nwnds_module/ar_itpnck_irnwll.uti b/nwnds_module/ar_itpnck_irnwll.uti new file mode 100644 index 000000000..2c09e835c Binary files /dev/null and b/nwnds_module/ar_itpnck_irnwll.uti differ diff --git a/nwnds_module/ar_itpnck_proba.uti b/nwnds_module/ar_itpnck_proba.uti new file mode 100644 index 000000000..d30b0e4a3 Binary files /dev/null and b/nwnds_module/ar_itpnck_proba.uti differ diff --git a/nwnds_module/ar_itprng_adre01.uti b/nwnds_module/ar_itprng_adre01.uti new file mode 100644 index 000000000..e4d1c6d02 Binary files /dev/null and b/nwnds_module/ar_itprng_adre01.uti differ diff --git a/nwnds_module/ar_itprng_adre02.uti b/nwnds_module/ar_itprng_adre02.uti new file mode 100644 index 000000000..158a12c12 Binary files /dev/null and b/nwnds_module/ar_itprng_adre02.uti differ diff --git a/nwnds_module/ar_itprng_medita.uti b/nwnds_module/ar_itprng_medita.uti new file mode 100644 index 000000000..0f72ac759 Binary files /dev/null and b/nwnds_module/ar_itprng_medita.uti differ diff --git a/nwnds_module/ar_itprng_pyro.uti b/nwnds_module/ar_itprng_pyro.uti new file mode 100644 index 000000000..4e61fe7cc Binary files /dev/null and b/nwnds_module/ar_itprng_pyro.uti differ diff --git a/nwnds_module/ar_itprng_rage.uti b/nwnds_module/ar_itprng_rage.uti new file mode 100644 index 000000000..ded904236 Binary files /dev/null and b/nwnds_module/ar_itprng_rage.uti differ diff --git a/nwnds_module/ar_itprng_sense.uti b/nwnds_module/ar_itprng_sense.uti new file mode 100644 index 000000000..f214da3e8 Binary files /dev/null and b/nwnds_module/ar_itprng_sense.uti differ diff --git a/nwnds_module/ar_itrng_asticle.uti b/nwnds_module/ar_itrng_asticle.uti new file mode 100644 index 000000000..acc2dec3f Binary files /dev/null and b/nwnds_module/ar_itrng_asticle.uti differ diff --git a/nwnds_module/ar_jewelry.utm b/nwnds_module/ar_jewelry.utm new file mode 100644 index 000000000..94699561f Binary files /dev/null and b/nwnds_module/ar_jewelry.utm differ diff --git a/nwnds_module/ar_jumptourik.ncs b/nwnds_module/ar_jumptourik.ncs new file mode 100644 index 000000000..33064af3c Binary files /dev/null and b/nwnds_module/ar_jumptourik.ncs differ diff --git a/nwnds_module/ar_jumptourik.nss b/nwnds_module/ar_jumptourik.nss new file mode 100644 index 000000000..c7ea90712 --- /dev/null +++ b/nwnds_module/ar_jumptourik.nss @@ -0,0 +1,6 @@ +void main() +{ +TakeGoldFromCreature(150, GetPCSpeaker(), TRUE); +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_URIK")))); +} + diff --git a/nwnds_module/ar_key_air.uti b/nwnds_module/ar_key_air.uti new file mode 100644 index 000000000..713b88f74 Binary files /dev/null and b/nwnds_module/ar_key_air.uti differ diff --git a/nwnds_module/ar_key_barrel.uti b/nwnds_module/ar_key_barrel.uti new file mode 100644 index 000000000..80f2064de Binary files /dev/null and b/nwnds_module/ar_key_barrel.uti differ diff --git a/nwnds_module/ar_key_blue.uti b/nwnds_module/ar_key_blue.uti new file mode 100644 index 000000000..419810fd5 Binary files /dev/null and b/nwnds_module/ar_key_blue.uti differ diff --git a/nwnds_module/ar_key_chaos.uti b/nwnds_module/ar_key_chaos.uti new file mode 100644 index 000000000..927d07cc9 Binary files /dev/null and b/nwnds_module/ar_key_chaos.uti differ diff --git a/nwnds_module/ar_key_charred.uti b/nwnds_module/ar_key_charred.uti new file mode 100644 index 000000000..94a942250 Binary files /dev/null and b/nwnds_module/ar_key_charred.uti differ diff --git a/nwnds_module/ar_key_crimson.uti b/nwnds_module/ar_key_crimson.uti new file mode 100644 index 000000000..42fafc563 Binary files /dev/null and b/nwnds_module/ar_key_crimson.uti differ diff --git a/nwnds_module/ar_key_doom.uti b/nwnds_module/ar_key_doom.uti new file mode 100644 index 000000000..3f0aaed01 Binary files /dev/null and b/nwnds_module/ar_key_doom.uti differ diff --git a/nwnds_module/ar_key_earth.uti b/nwnds_module/ar_key_earth.uti new file mode 100644 index 000000000..394793ad3 Binary files /dev/null and b/nwnds_module/ar_key_earth.uti differ diff --git a/nwnds_module/ar_key_elemental.uti b/nwnds_module/ar_key_elemental.uti new file mode 100644 index 000000000..ca22ba9a6 Binary files /dev/null and b/nwnds_module/ar_key_elemental.uti differ diff --git a/nwnds_module/ar_key_fire.uti b/nwnds_module/ar_key_fire.uti new file mode 100644 index 000000000..4ab4773e7 Binary files /dev/null and b/nwnds_module/ar_key_fire.uti differ diff --git a/nwnds_module/ar_key_gith.uti b/nwnds_module/ar_key_gith.uti new file mode 100644 index 000000000..3824ef535 Binary files /dev/null and b/nwnds_module/ar_key_gith.uti differ diff --git a/nwnds_module/ar_key_houseshom.uti b/nwnds_module/ar_key_houseshom.uti new file mode 100644 index 000000000..8639c5ef1 Binary files /dev/null and b/nwnds_module/ar_key_houseshom.uti differ diff --git a/nwnds_module/ar_key_ice.uti b/nwnds_module/ar_key_ice.uti new file mode 100644 index 000000000..0467d2dcb Binary files /dev/null and b/nwnds_module/ar_key_ice.uti differ diff --git a/nwnds_module/ar_key_kronos.uti b/nwnds_module/ar_key_kronos.uti new file mode 100644 index 000000000..8a8d8e895 Binary files /dev/null and b/nwnds_module/ar_key_kronos.uti differ diff --git a/nwnds_module/ar_key_magdas.uti b/nwnds_module/ar_key_magdas.uti new file mode 100644 index 000000000..9ef70c9ff Binary files /dev/null and b/nwnds_module/ar_key_magdas.uti differ diff --git a/nwnds_module/ar_key_mind.uti b/nwnds_module/ar_key_mind.uti new file mode 100644 index 000000000..aaf128e3a Binary files /dev/null and b/nwnds_module/ar_key_mind.uti differ diff --git a/nwnds_module/ar_key_moldcover.uti b/nwnds_module/ar_key_moldcover.uti new file mode 100644 index 000000000..813316f01 Binary files /dev/null and b/nwnds_module/ar_key_moldcover.uti differ diff --git a/nwnds_module/ar_key_path.uti b/nwnds_module/ar_key_path.uti new file mode 100644 index 000000000..a0ae4a1ea Binary files /dev/null and b/nwnds_module/ar_key_path.uti differ diff --git a/nwnds_module/ar_key_pink.uti b/nwnds_module/ar_key_pink.uti new file mode 100644 index 000000000..b9ffac44c Binary files /dev/null and b/nwnds_module/ar_key_pink.uti differ diff --git a/nwnds_module/ar_key_revenant.uti b/nwnds_module/ar_key_revenant.uti new file mode 100644 index 000000000..6c2accafc Binary files /dev/null and b/nwnds_module/ar_key_revenant.uti differ diff --git a/nwnds_module/ar_key_soul.uti b/nwnds_module/ar_key_soul.uti new file mode 100644 index 000000000..b8748fcfb Binary files /dev/null and b/nwnds_module/ar_key_soul.uti differ diff --git a/nwnds_module/ar_key_spyre.uti b/nwnds_module/ar_key_spyre.uti new file mode 100644 index 000000000..b8d3031e4 Binary files /dev/null and b/nwnds_module/ar_key_spyre.uti differ diff --git a/nwnds_module/ar_key_storeroom.uti b/nwnds_module/ar_key_storeroom.uti new file mode 100644 index 000000000..073078bf0 Binary files /dev/null and b/nwnds_module/ar_key_storeroom.uti differ diff --git a/nwnds_module/ar_key_strngbone.uti b/nwnds_module/ar_key_strngbone.uti new file mode 100644 index 000000000..3a6172a8d Binary files /dev/null and b/nwnds_module/ar_key_strngbone.uti differ diff --git a/nwnds_module/ar_key_toramund.uti b/nwnds_module/ar_key_toramund.uti new file mode 100644 index 000000000..f3b58d0d3 Binary files /dev/null and b/nwnds_module/ar_key_toramund.uti differ diff --git a/nwnds_module/ar_key_tricis.uti b/nwnds_module/ar_key_tricis.uti new file mode 100644 index 000000000..450b58494 Binary files /dev/null and b/nwnds_module/ar_key_tricis.uti differ diff --git a/nwnds_module/ar_key_zombie.uti b/nwnds_module/ar_key_zombie.uti new file mode 100644 index 000000000..52c636707 Binary files /dev/null and b/nwnds_module/ar_key_zombie.uti differ diff --git a/nwnds_module/ar_keys.utm b/nwnds_module/ar_keys.utm new file mode 100644 index 000000000..8164fdf87 Binary files /dev/null and b/nwnds_module/ar_keys.utm differ diff --git a/nwnds_module/ar_kimzahn.utc b/nwnds_module/ar_kimzahn.utc new file mode 100644 index 000000000..53a6510d7 Binary files /dev/null and b/nwnds_module/ar_kimzahn.utc differ diff --git a/nwnds_module/ar_kreen_001.utc b/nwnds_module/ar_kreen_001.utc new file mode 100644 index 000000000..b34214e3a Binary files /dev/null and b/nwnds_module/ar_kreen_001.utc differ diff --git a/nwnds_module/ar_kreen_002.utc b/nwnds_module/ar_kreen_002.utc new file mode 100644 index 000000000..26db646d4 Binary files /dev/null and b/nwnds_module/ar_kreen_002.utc differ diff --git a/nwnds_module/ar_kreen_003.utc b/nwnds_module/ar_kreen_003.utc new file mode 100644 index 000000000..a28a17b3f Binary files /dev/null and b/nwnds_module/ar_kreen_003.utc differ diff --git a/nwnds_module/ar_krenshar001.utc b/nwnds_module/ar_krenshar001.utc new file mode 100644 index 000000000..926e5634c Binary files /dev/null and b/nwnds_module/ar_krenshar001.utc differ diff --git a/nwnds_module/ar_kukris.utm b/nwnds_module/ar_kukris.utm new file mode 100644 index 000000000..985b68a50 Binary files /dev/null and b/nwnds_module/ar_kukris.utm differ diff --git a/nwnds_module/ar_languages.utm b/nwnds_module/ar_languages.utm new file mode 100644 index 000000000..c78488868 Binary files /dev/null and b/nwnds_module/ar_languages.utm differ diff --git a/nwnds_module/ar_lask001.utc b/nwnds_module/ar_lask001.utc new file mode 100644 index 000000000..bc5d44e28 Binary files /dev/null and b/nwnds_module/ar_lask001.utc differ diff --git a/nwnds_module/ar_lask002.utc b/nwnds_module/ar_lask002.utc new file mode 100644 index 000000000..204a568bd Binary files /dev/null and b/nwnds_module/ar_lask002.utc differ diff --git a/nwnds_module/ar_lask003.utc b/nwnds_module/ar_lask003.utc new file mode 100644 index 000000000..cf0480a52 Binary files /dev/null and b/nwnds_module/ar_lask003.utc differ diff --git a/nwnds_module/ar_lask004.utc b/nwnds_module/ar_lask004.utc new file mode 100644 index 000000000..64985905c Binary files /dev/null and b/nwnds_module/ar_lask004.utc differ diff --git a/nwnds_module/ar_leechgiant.utc b/nwnds_module/ar_leechgiant.utc new file mode 100644 index 000000000..9d4790c4b Binary files /dev/null and b/nwnds_module/ar_leechgiant.utc differ diff --git a/nwnds_module/ar_leopard001.utc b/nwnds_module/ar_leopard001.utc new file mode 100644 index 000000000..36f4df05a Binary files /dev/null and b/nwnds_module/ar_leopard001.utc differ diff --git a/nwnds_module/ar_lg_elem_hide.uti b/nwnds_module/ar_lg_elem_hide.uti new file mode 100644 index 000000000..5a40b530d Binary files /dev/null and b/nwnds_module/ar_lg_elem_hide.uti differ diff --git a/nwnds_module/ar_lightarmor.utm b/nwnds_module/ar_lightarmor.utm new file mode 100644 index 000000000..9f2248b19 Binary files /dev/null and b/nwnds_module/ar_lightarmor.utm differ diff --git a/nwnds_module/ar_lightflails.utm b/nwnds_module/ar_lightflails.utm new file mode 100644 index 000000000..c1499a69a Binary files /dev/null and b/nwnds_module/ar_lightflails.utm differ diff --git a/nwnds_module/ar_lighthammers.utm b/nwnds_module/ar_lighthammers.utm new file mode 100644 index 000000000..6f479a9fe Binary files /dev/null and b/nwnds_module/ar_lighthammers.utm differ diff --git a/nwnds_module/ar_lightxbows.utm b/nwnds_module/ar_lightxbows.utm new file mode 100644 index 000000000..83b1e9032 Binary files /dev/null and b/nwnds_module/ar_lightxbows.utm differ diff --git a/nwnds_module/ar_lion001.utc b/nwnds_module/ar_lion001.utc new file mode 100644 index 000000000..15bb9ac8d Binary files /dev/null and b/nwnds_module/ar_lion001.utc differ diff --git a/nwnds_module/ar_lion002.utc b/nwnds_module/ar_lion002.utc new file mode 100644 index 000000000..ad0f55c20 Binary files /dev/null and b/nwnds_module/ar_lion002.utc differ diff --git a/nwnds_module/ar_longbows.utm b/nwnds_module/ar_longbows.utm new file mode 100644 index 000000000..60363e25f Binary files /dev/null and b/nwnds_module/ar_longbows.utm differ diff --git a/nwnds_module/ar_longswords.utm b/nwnds_module/ar_longswords.utm new file mode 100644 index 000000000..9b9e5ebe0 Binary files /dev/null and b/nwnds_module/ar_longswords.utm differ diff --git a/nwnds_module/ar_lotulis.utm b/nwnds_module/ar_lotulis.utm new file mode 100644 index 000000000..c18ed50b9 Binary files /dev/null and b/nwnds_module/ar_lotulis.utm differ diff --git a/nwnds_module/ar_maces.utm b/nwnds_module/ar_maces.utm new file mode 100644 index 000000000..01782a716 Binary files /dev/null and b/nwnds_module/ar_maces.utm differ diff --git a/nwnds_module/ar_magicstaves.utm b/nwnds_module/ar_magicstaves.utm new file mode 100644 index 000000000..f1a3c2714 Binary files /dev/null and b/nwnds_module/ar_magicstaves.utm differ diff --git a/nwnds_module/ar_magmin001.utc b/nwnds_module/ar_magmin001.utc new file mode 100644 index 000000000..2d3145fb9 Binary files /dev/null and b/nwnds_module/ar_magmin001.utc differ diff --git a/nwnds_module/ar_magmin002.utc b/nwnds_module/ar_magmin002.utc new file mode 100644 index 000000000..51892f544 Binary files /dev/null and b/nwnds_module/ar_magmin002.utc differ diff --git a/nwnds_module/ar_mandragora001.utc b/nwnds_module/ar_mandragora001.utc new file mode 100644 index 000000000..826f0c898 Binary files /dev/null and b/nwnds_module/ar_mandragora001.utc differ diff --git a/nwnds_module/ar_mediumarmor.utm b/nwnds_module/ar_mediumarmor.utm new file mode 100644 index 000000000..d1645a2cb Binary files /dev/null and b/nwnds_module/ar_mediumarmor.utm differ diff --git a/nwnds_module/ar_meorty001.utc b/nwnds_module/ar_meorty001.utc new file mode 100644 index 000000000..5d4218751 Binary files /dev/null and b/nwnds_module/ar_meorty001.utc differ diff --git a/nwnds_module/ar_meorty002.utc b/nwnds_module/ar_meorty002.utc new file mode 100644 index 000000000..1bc27fef3 Binary files /dev/null and b/nwnds_module/ar_meorty002.utc differ diff --git a/nwnds_module/ar_mepair001.utc b/nwnds_module/ar_mepair001.utc new file mode 100644 index 000000000..9aff58792 Binary files /dev/null and b/nwnds_module/ar_mepair001.utc differ diff --git a/nwnds_module/ar_mepdust001.utc b/nwnds_module/ar_mepdust001.utc new file mode 100644 index 000000000..35f8ed54a Binary files /dev/null and b/nwnds_module/ar_mepdust001.utc differ diff --git a/nwnds_module/ar_mepearth001.utc b/nwnds_module/ar_mepearth001.utc new file mode 100644 index 000000000..d1787de1a Binary files /dev/null and b/nwnds_module/ar_mepearth001.utc differ diff --git a/nwnds_module/ar_mepfire001.utc b/nwnds_module/ar_mepfire001.utc new file mode 100644 index 000000000..c6c7279b8 Binary files /dev/null and b/nwnds_module/ar_mepfire001.utc differ diff --git a/nwnds_module/ar_mepmagma001.utc b/nwnds_module/ar_mepmagma001.utc new file mode 100644 index 000000000..edf64edaa Binary files /dev/null and b/nwnds_module/ar_mepmagma001.utc differ diff --git a/nwnds_module/ar_mepooze001.utc b/nwnds_module/ar_mepooze001.utc new file mode 100644 index 000000000..6522c70a2 Binary files /dev/null and b/nwnds_module/ar_mepooze001.utc differ diff --git a/nwnds_module/ar_mepsalt001.utc b/nwnds_module/ar_mepsalt001.utc new file mode 100644 index 000000000..eca1bb4a5 Binary files /dev/null and b/nwnds_module/ar_mepsalt001.utc differ diff --git a/nwnds_module/ar_mepsteam001.utc b/nwnds_module/ar_mepsteam001.utc new file mode 100644 index 000000000..e58f33deb Binary files /dev/null and b/nwnds_module/ar_mepsteam001.utc differ diff --git a/nwnds_module/ar_mepwater001.utc b/nwnds_module/ar_mepwater001.utc new file mode 100644 index 000000000..1ccca746b Binary files /dev/null and b/nwnds_module/ar_mepwater001.utc differ diff --git a/nwnds_module/ar_mf_healer.utc b/nwnds_module/ar_mf_healer.utc new file mode 100644 index 000000000..0e27cd4af Binary files /dev/null and b/nwnds_module/ar_mf_healer.utc differ diff --git a/nwnds_module/ar_miscellaneous.utm b/nwnds_module/ar_miscellaneous.utm new file mode 100644 index 000000000..f86e4a0ee Binary files /dev/null and b/nwnds_module/ar_miscellaneous.utm differ diff --git a/nwnds_module/ar_misclarge.utm b/nwnds_module/ar_misclarge.utm new file mode 100644 index 000000000..0f135887a Binary files /dev/null and b/nwnds_module/ar_misclarge.utm differ diff --git a/nwnds_module/ar_mod_cutabort.ncs b/nwnds_module/ar_mod_cutabort.ncs new file mode 100644 index 000000000..f869d4669 Binary files /dev/null and b/nwnds_module/ar_mod_cutabort.ncs differ diff --git a/nwnds_module/ar_mod_cutabort.nss b/nwnds_module/ar_mod_cutabort.nss new file mode 100644 index 000000000..757e93d2c --- /dev/null +++ b/nwnds_module/ar_mod_cutabort.nss @@ -0,0 +1,4 @@ +void main() +{ + return; +} diff --git a/nwnds_module/ar_mod_onactiv.ncs b/nwnds_module/ar_mod_onactiv.ncs new file mode 100644 index 000000000..4494c1cd7 Binary files /dev/null and b/nwnds_module/ar_mod_onactiv.ncs differ diff --git a/nwnds_module/ar_mod_onactiv.nss b/nwnds_module/ar_mod_onactiv.nss new file mode 100644 index 000000000..243401fd4 --- /dev/null +++ b/nwnds_module/ar_mod_onactiv.nss @@ -0,0 +1,579 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnActivate Script Script +//:: x2_mod_def_act +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnItemActivate Event + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// + +//#include "wow_inc_scouting" +#include "x2_inc_switches" +#include "x2_inc_itemprop" +int wow_CheckTag(); + +void main() +{ + object oItem = GetItemActivated(); + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE); + // if(wow_CheckModuleEventForScoutingSystem()) return; + if(wow_CheckTag()) return; + + //declaration of variables used almost everywhere + object oActivator = GetItemActivator(); + object oTarget = GetItemActivatedTarget(); + location lTargetLoc = GetItemActivatedTargetLocation(); + string sTag = GetTag(oItem); + + //For all bioware-standard special abilities target area of effect + if (TestStringAgainstPattern("**_pra**", sTag)) + { + int iSpellSs = FindSubString(sTag, "_pra"); + string sSpellbyTag = GetSubString(sTag, iSpellSs, 8); + int iSpellNum = StringToInt(GetStringRight(sSpellbyTag,4)); + AssignCommand(oActivator,ActionCastSpellAtLocation(iSpellNum, lTargetLoc ,METAMAGIC_ANY,TRUE,PROJECTILE_PATH_TYPE_DEFAULT,1)); + return; + } + + //For all bioware-standard special abilities on non-self target object + if (TestStringAgainstPattern("**_prb**", sTag)) + { + int iSpellSs = FindSubString(sTag, "_prb"); + string sSpellbyTag = GetSubString(sTag, iSpellSs, 8); + int iSpellNum = StringToInt(GetStringRight(sSpellbyTag,4)); + AssignCommand(oActivator,ActionCastSpellAtObject(iSpellNum, oTarget ,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT,1)); + return; + } + + //For all bioware-standard special abilities target is the caster + if (TestStringAgainstPattern("**_prc**", sTag)) + { + int iSpellSs = FindSubString(sTag, "_prc"); + string sSpellbyTag = GetSubString(sTag, iSpellSs, 8); + int iSpellNum = StringToInt(GetStringRight(sSpellbyTag,4)); + AssignCommand(oActivator,ActionCastSpellAtObject(iSpellNum, oActivator ,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT,1)); + return; + } + + //BESIE Widget + if(GetTag(GetItemActivated()) == "BESIEWidget") + { + AssignCommand(GetItemActivator(), ActionStartConversation(GetItemActivator(), "re_widget", TRUE)); + } + + // * Generic Item Script Execution Code + // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module, + // * it will execute a script that has the same name as the item's tag + // * inside this script you can manage scripts for all events by checking against + // * GetUserDefinedItemEventNumber(). See x2_it_example.nss + if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE); + int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF); + if (nRet == X2_EXECUTE_SCRIPT_END) + { + return; + } + + } + +} + +void ActionXpWand() +{ + object oPC = GetItemActivator(); + object oTarget = GetItemActivatedTarget(); + if(GetIsObjectValid(oTarget) && (oTarget != oPC)) + { + AssignCommand(oPC,SpeakString("I grant thee knowledge.")); + GiveXPToCreature(oTarget, 1000); + } + return; +} + +void ActionJailWand() +{ + object oPC = GetItemActivator(); + object oTarget = GetItemActivatedTarget(); + string sArea = GetTag(GetArea(oTarget)); + if(GetIsObjectValid(oTarget) && (oTarget != oPC) && (sArea == "CaravanWayREBUILD") && (GetIsPC(oTarget))) + { + AssignCommand(oPC,SpeakString("Guards! Take this one away!")); + DelayCommand(1.0,AssignCommand(oTarget,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Jail"))))); + DelayCommand(4.0,FloatingTextStringOnCreature(GetName(oTarget)+" has been arrested.",oTarget,FALSE)); + DelayCommand(5.0,SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oTarget)); + } + return; +} + + +void UseDMWand() +{ + object oItem=GetItemActivated(); + object oActivator=GetItemActivator(); + + if(GetTag(oItem)=="DMsHelper") + { + // Test to make sure the activator is a DM, or is a DM + // controlling a creature. + if(GetIsDM(oActivator) != TRUE) + { + object oTest = GetFirstPC(); + string sTestName = GetPCPlayerName(oActivator); + int nFound = FALSE; + while (GetIsObjectValid(oTest) && (! nFound)) + { + if (GetPCPlayerName(oTest) == sTestName) + { + if(GetIsDM(oTest)) + { + nFound = TRUE; + } + else + { + DestroyObject(oItem); + SendMessageToPC(oActivator,"You are mortal and this is not yours!"); + return; + } + } + oTest=GetNextPC(); + } + } + // get the wand's activator and target, put target info into local vars on activator + object oMyActivator = GetItemActivator(); + object oMyTarget = GetItemActivatedTarget(); + SetLocalObject(oMyActivator, "dmwandtarget", oMyTarget); + location lMyLoc = GetItemActivatedTargetLocation(); + SetLocalLocation(oMyActivator, "dmwandloc", lMyLoc); + + //Make the activator start a conversation with itself + AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "dmwand", TRUE)); + return; + } + + if(GetTag(oItem)=="AutoFollow") + { + object oTarget = GetItemActivatedTarget(); + + if(GetIsObjectValid(oTarget)) + { + AssignCommand ( oActivator, ActionForceFollowObject(oTarget)); + } + return; + } + + if(GetTag(oItem)=="WandOfFX") + { + + // get the wand's activator and target, put target info into local vars on activator + object oDM = GetItemActivator(); + object oMyTarget = GetItemActivatedTarget(); + SetLocalObject(oDM, "FXWandTarget", oMyTarget); + location lTargetLoc = GetItemActivatedTargetLocation(); + SetLocalLocation(oDM, "FXWandLoc", lTargetLoc); + + object oTest=GetFirstPC(); + string sTestName = GetPCPlayerName(oDM); + // Test to make sure the activator is a DM, or is a DM + // controlling a creature. + + if(GetIsDM(oDM) != TRUE) + { + object oTest = GetFirstPC(); + string sTestName = GetPCPlayerName(oDM); + int nFound = FALSE; + while (GetIsObjectValid(oTest) && (! nFound)) + { + if (GetPCPlayerName(oTest) == sTestName) + { + if(GetIsDM(oTest)) + { + nFound = TRUE; + } + else + { + DestroyObject(oItem); + SendMessageToPC(oDM,"You are mortal and this is not yours!"); + return; + } + } + oTest=GetNextPC(); + } + } + + //Make the activator start a conversation with itself + AssignCommand(oDM, ActionStartConversation(oDM, "fxwand", TRUE)); + return; + + } + if(GetTag(oItem)=="EmoteWand") + { + AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE)); + return; + } +} + + +void ActionDig() +{ + object oPC = GetItemActivator(); + object oFishingRod = GetObjectByTag("AR_IT_SHOVEL"); + object oPoss = GetItemPossessedBy(oPC, "AR_IT_SHOVEL"); + object oBearspawn = GetWaypointByTag("WP_Dig"); + location lBear = GetLocation(oBearspawn); + location lLoc = GetLocation(oPC); + int nDexMod = GetAbilityModifier (ABILITY_DEXTERITY, oPC); + int nWisMod = GetAbilityModifier (ABILITY_WISDOM, oPC); + int nRoll = d20(); //The roll + float fDist = GetDistanceBetween(oPC,oBearspawn); + int nTotal = nRoll + nDexMod + nWisMod; //Total roll + SendMessageToPC(oPC, "You try to dig."); + //int nFishLong = d20() + 9; //The longer of the fish + //string sFish = IntToString(nFishLong); + if ( fDist <= 30.0 ) + { + if (oPoss != OBJECT_INVALID) //Checks if the PC has a fishing rod! + { + //PlaySound("as_na_splash2"); + if (nTotal >= 18) //DC check to catch a fish, it's not that easy! + { + int nCatch= d100(); //ok, what did the PC caught? + if (nCatch == 100) //PC gets a loot bag! + { + CreateObject(OBJECT_TYPE_PLACEABLE, "plc_lootbag2", lLoc, TRUE); + SendMessageToPC(oPC, "You found a bag"); + } + if ( (nCatch >= 50) && (nCatch <= 99) ) //PC gets a fish + { + //CreateObject(OBJECT_TYPE_ITEM, "OrboftheAncients", lLoc, TRUE); + SendMessageToPC(oPC, "You found a lot of sand."); + } + if ( (nCatch >= 30) && (nCatch <=49) ) //PC gets a bottle + { + CreateObject(OBJECT_TYPE_ITEM, "nw_it_thnmisc001", lLoc, TRUE); + SendMessageToPC(oPC, "You found an empty bottle!!!!"); + } + if ( (nCatch >= 25) && (nCatch <=29) ) //PC gets a skeleton and fight + { + CreateObject(OBJECT_TYPE_PLACEABLE, "nw_pl_skeleton", lLoc, TRUE); + SendMessageToPC(oPC, "You found a skeleton"); + } + if ( (nCatch >= 20) && (nCatch <=24) ) //PC gets a corpse + { + CreateObject(OBJECT_TYPE_PLACEABLE, "plc_corpse1", lLoc, TRUE); + SendMessageToPC(oPC, "You found a corpse"); + } + if ( (nCatch >= 10) && (nCatch <=19) ) //PC gets rags + { + CreateObject(OBJECT_TYPE_ITEM, "nw_it_msmlmisc21", lLoc, TRUE); + SendMessageToPC(oPC, "You found some smelly rags"); + } + if ( (nCatch >= 05) && (nCatch <=09) ) //PC gets a gargoyle skull + { + CreateObject(OBJECT_TYPE_ITEM, "nw_it_msmlmisc14", lLoc, TRUE); + SendMessageToPC(oPC, "You found a skull"); + } + if ( (nCatch >= 01) && (nCatch <=04) ) //PC gets stein + { + CreateObject(OBJECT_TYPE_ITEM, "QST_ORBANCIENTS", lLoc, TRUE); + SendMessageToPC(oPC, "You found an orb"); + } + } + if (nTotal <= 17) //Too bad! + { + SendMessageToPC(oPC, "You found nothing, better luck next time!"); + AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED , 1.0, 2.0)); + } + int nBreak = d100(); //that's to check if the rod will break! + if (nBreak >= 95) + { + SendMessageToPC(oPC, "You broke your shovel."); + DestroyObject(oPoss, 0.0); + //PlaySound("as_na_branchsnp3"); + //AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS , 1.0, 2.0)); + } + } + else + { + SendMessageToPC(oPC, "You don't have a shovel."); + //AssignCommand(oPC, + //ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD , 1.0, 2.0)); + } + } + else + { + SendMessageToPC(oPC, "You can't dig here."); + } +} + +void ActionForeHelm() +{ + object oPC; + oPC = GetItemActivator(); + object oTarget; + object oItem; + oTarget = oPC; + oItem = GetItemInSlot(INVENTORY_SLOT_HEAD, oTarget); + + itemproperty ipAdd; + ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB); + IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + oTarget = GetItemActivator(); + + //Visual effects can't be applied to waypoints, so if it is a WP + //apply to the WP's location instead + int nInt; + nInt = GetObjectType(oTarget); + + if (nInt != OBJECT_TYPE_WAYPOINT) + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GLOBE_USE), oTarget); + + else + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), GetLocation(oTarget)); +} + +void ActionMagicBook() +{ + object oMyActivator = OBJECT_SELF; + object oMyTarget; + SetLocalObject(oMyActivator, "magicbook", oMyTarget); + location lMyLoc; + SetLocalLocation(oMyActivator, "magicbookloc", lMyLoc); + + //Make the activator start a conversation with itself + AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "ka_magicbook", TRUE)); + return; +} +void ActionLawBook() +{ + object oMyActivator = OBJECT_SELF; + object oMyTarget; + SetLocalObject(oMyActivator, "lawbook", oMyTarget); + location lMyLoc; + SetLocalLocation(oMyActivator, "lawbookloc", lMyLoc); + + //Make the activator start a conversation with itself + AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "ka_lawbook", TRUE)); + return; +} +void ActionBloodBone() +{ + object oPC; + +object oTarget; +oTarget = GetItemActivator(); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +int nEvent =GetUserDefinedItemEventNumber(); +nInt = GetObjectType(oTarget); +if (nEvent == X2_ITEM_EVENT_ACTIVATE) +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oTarget)); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), GetLocation(oTarget)); + +oPC = GetItemActivator(); + +object oItem; +oTarget = oPC; + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +itemproperty ipAdd; +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DEATH_MAGIC); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DISEASE); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_FEAR); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_MINDSPELLS); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); +} +void ActionBootsEvasion() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + object oTarget; + oTarget = oPC; + + if (nEvent == X2_ITEM_EVENT_ACTIVATE) + { + oItem = GetItemActivated(); + IPSafeAddItemProperty(oItem, ItemPropertyImprovedEvasion(), RoundsToSeconds(10)); + } +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), GetLocation(oTarget)); +} +void ActionStaffTime() +{ +object oPC; + +object oTarget; +oTarget = GetItemActivator(); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +int nEvent =GetUserDefinedItemEventNumber(); +nInt = GetObjectType(oTarget); +if (nEvent == X2_ITEM_EVENT_ACTIVATE) +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_TIME_STOP), GetLocation(oTarget)); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +oPC = GetItemActivator(); + + +object oItem; +oTarget = oPC; + +oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + +itemproperty ipAdd; +ipAdd = ItemPropertyHaste(); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + +ipAdd = ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + +ipAdd = ItemPropertyImprovedEvasion(); + +IPSafeAddItemProperty(oItem, ipAdd, 120.0f); + +} + + +int wow_CheckTag() +{ + object oItem = GetItemActivated(); + string sTag = GetTag(oItem); + int nReturn; + + if(sTag == "AR_IT_SHOVEL") + { + nReturn = TRUE; + ActionDig(); + } + else if(sTag == "AR_HELM_FORSEE") + { + nReturn = TRUE; + ActionForeHelm(); + } + else if(sTag == "XpWand") + { + nReturn = TRUE; + ActionXpWand(); + } + else if(sTag == "JailWand") + { + nReturn = TRUE; + ActionJailWand(); + } + else if(sTag == "staffoftime") + { + nReturn = TRUE; + ActionStaffTime(); + } + else if(sTag == "bloodbonearmor") + { + nReturn = TRUE; + ActionBloodBone(); + } + else if(sTag == "AR_ITMBTS_EVADE") + { + nReturn = TRUE; + ActionBootsEvasion(); + } + else if(sTag == "bookofmagical") + { + nReturn = TRUE; + ActionMagicBook(); + } + else if(sTag == "bookoflaws") + { + nReturn = TRUE; + ActionLawBook(); + } + else if(sTag == "DMsHelper" || sTag == "AutoFollow" || sTag == "WandOfFX" || sTag == "EmoteWand") + { + nReturn = TRUE; + UseDMWand(); + } + return nReturn; +} + diff --git a/nwnds_module/ar_mod_onaquire.ncs b/nwnds_module/ar_mod_onaquire.ncs new file mode 100644 index 000000000..86996a141 Binary files /dev/null and b/nwnds_module/ar_mod_onaquire.ncs differ diff --git a/nwnds_module/ar_mod_onaquire.nss b/nwnds_module/ar_mod_onaquire.nss new file mode 100644 index 000000000..1f9bfaad0 --- /dev/null +++ b/nwnds_module/ar_mod_onaquire.nss @@ -0,0 +1,169 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnItemAcquireScript +//:: x2_mod_def_aqu +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnItemAcquire Event + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// + +#include "nw_i0_plot" +#include "yr_inc_effects" +#include "nw_i0_plotwizard" +#include "x2_inc_switches" +//#include "ar_db_main" + +float fDelay = 300.0; // Stay either in full minutes or less than a minute +void wow_PickPocket(); +void wow_CheckPP(object oPP, string sName, int nPPTimes, int nRan = 0, int nTimesToRun = 0); +void PickPocketing(); + +void main() +{ + object oItem = GetModuleItemAcquired(); + // * Generic Item Script Execution Code + // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module, + // * it will execute a script that has the same name as the item's tag + // * inside this script you can manage scripts for all events by checking against + // * GetUserDefinedItemEventNumber(). See x2_it_example.nss + if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACQUIRE); + int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF); + if (nRet == X2_EXECUTE_SCRIPT_END) + { + return; + } + + } + +} + +void wow_CheckPP(object oPP, string sName, int nPPTimes, int nRan = 0, int nTimesToRun = 0) +{ + if(nRan == 0) + { + if(fDelay > 60.0) + { + nTimesToRun = FloatToInt(fDelay / 60.0) + 1; + nRan++; + DelayCommand(60.0, wow_CheckPP(oPP, sName, nPPTimes, nRan, nTimesToRun)); + } + else + { + nTimesToRun = 1; + nRan++; + DelayCommand(fDelay, wow_CheckPP(oPP, sName, nPPTimes, nRan, nTimesToRun)); + } + } + else + { + nRan++; + if(GetLocalInt(oPP, sName+"_PICKPOCKETED") == nPPTimes) + { + if(nRan <= nTimesToRun) DelayCommand(60.0, wow_CheckPP(oPP, sName, nPPTimes, nRan, nTimesToRun)); + else + { + DeleteLocalInt(oPP, sName+"_PICKPOCKETED"); + if(GetLocalInt(oPP, sName+"_AFFECTED")) + { + RemoveLocalEffect(oPP, sName+"_PP_EFFECT_"+IntToString(nPPTimes)); + DeleteLocalInt(oPP, sName+"_AFFECTED"); + } + } + } + } +} + +void wow_PickPocket() +{ + object oItem = GetModuleItemAcquired(); + object oLoser = GetModuleItemAcquiredFrom(); + + if(GetIsPC(oLoser) && GetStolenFlag(oItem)) + { + object oTaker = GetModuleItemAcquiredBy(); + + if(GetHasSkill(SKILL_PICK_POCKET, oTaker)) + { + string sLoser = GetName(oLoser); + int nPP = GetLocalInt(oTaker, sLoser+"_PICKPOCKETED"); + + if(nPP > 1 && CheckLocalEffect(oTaker, sLoser+"_PP_EFFECT_"+IntToString(nPP))) RemoveLocalEffect(oTaker, sLoser+"PP_EFFECT_"+IntToString(nPP)); + + nPP++; + SetLocalInt(oTaker, sLoser+"_PICKPOCKETED", nPP); + + if(nPP > 1) + { + effect eSkill = EffectSkillDecrease(SKILL_PICK_POCKET, (nPP - 1) * 5); + eSkill = ExtraordinaryEffect(eSkill); + SetLocalEffect(oTaker, eSkill, sLoser+"_PP_EFFECT_"+IntToString(nPP)); + SetLocalInt(oTaker, sLoser+"_AFFECTED", TRUE); + } + wow_CheckPP(oTaker, sLoser, nPP); + } + } +} + + +void PickPocketing() +{ + //Get the object that lost the item + object oTarget = GetModuleItemAcquiredFrom(); + //Get the object that was acquired + object oItem = GetModuleItemAcquired(); + //Get the thief + object oThief = GetItemPossessor(oItem); + + if(GetIsPC(oThief) && GetIsPC(oTarget)) + { + //If it's stolen, do this + if(GetStolenFlag(oItem)) + { + //If it's not plot they can take it + if(!GetPlotFlag(oItem)) + { + //If the item is too heavy then limit what the thief can do + SetIdentified(oItem, FALSE); + if(!(GetWeight(oItem) <= 30)) + { + //The thief gets 10% of the targets gold + int nStolenGold = FloatToInt(GetGold(oTarget) * 0.1); + + //Give the thief his gold + AssignCommand(oThief, GiveGoldToCreature(oThief, nStolenGold)); + //Take the stolen gold amount from the target + TakeGold(nStolenGold, oTarget); + + //Tell the target what happened + SendMessageToPC(oTarget, "You notice a thief attempting to steal from you!"); + //Tell the thief what happened + SendMessageToPC(oThief, "You attempted to take an item that was too heavy. You were able to grab some gold, but you were noticed."); + //Give it back to the target + CreateItemOnObject(GetTag(oItem), oTarget, GetNumStackedItems(oItem)); + //Destroy the stolen item + DestroyObject(oItem); + } + SetIdentified(oItem, TRUE); + } + //Plot items are protected + else + { + //Tell the target what happened + SendMessageToPC(oTarget, "You notice a thief attempting to steal from you!"); + //Tell the thief what happened + SendMessageToPC(oThief, "You attempted to take an item that was plot protected. You were noticed."); + //Give it back to the target + CreateItemOnObject(GetTag(oItem), oTarget, GetNumStackedItems(oItem)); + //Destroy the stolen item + DestroyObject(oItem); + } + } + } +} diff --git a/nwnds_module/ar_mod_ondeath.ncs b/nwnds_module/ar_mod_ondeath.ncs new file mode 100644 index 000000000..a7472caf3 Binary files /dev/null and b/nwnds_module/ar_mod_ondeath.ncs differ diff --git a/nwnds_module/ar_mod_ondeath.nss b/nwnds_module/ar_mod_ondeath.nss new file mode 100644 index 000000000..9971450c7 --- /dev/null +++ b/nwnds_module/ar_mod_ondeath.nss @@ -0,0 +1,984 @@ +//:://///////////////////////////////////////////// +//:: Death Script +//:: AR_MOD_ONDEATH.NSS +//:: Copyright (c) 2008 Bioware Corp. +//::////////////////////////////////////////////// +/* + This script handles the default behavior + that occurs when a player or creature dies. + + BK: October 8 2002: Overriden for Expansion + + Deva Winblood: April 21th, 2008: Modified to + handle dismounts when PC dies while mounted. + + DM Heatstroke: 09/01/09 + Added AR additions + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: November 6, 2001 +//::////////////////////////////////////////////// + +#include "dante_db" +#include "aps_include" +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//#include "ar_db_main" +//#include "wow_inc_scouting" + +void AdjustPlayerStats(object oDied, object oKiller); +void ApplyPenalty(object oDied); +void ClearAllFactionMembers(object oPlayer); +void ItemLossUponDeath(object oPlayer); +location RadiusAroundLocation(object oPlayer); +void BoardChange(object oPlayer, string sBoard); +//void UndeadCheck(object oMyKiller); + +//Updates the arena kill board +void ArenaKillsUpdate(); + +void main() +{ + object oPlayer = GetLastPlayerDied(); + object oKiller = GetLastHostileActor(oPlayer); + + //log the death to arsx + //SetLocalInt(oPlayer,"arsx_Last_kill",ARSX_LogKill(oPlayer,oKiller)); + + // Necromancy 101/ + DoDeathCry(); + ////////////////// + // * Destroy some items xp and gold. + + if (GetTag(GetArea(oPlayer)) != "TYR_GS_ARENA") + { + //If was killed by a player and that player was 4 or less levels higher + if (((GetIsPC(oKiller)) || (GetIsPC(GetMaster(oKiller))))) + { + if ((GetHitDice(oKiller) <= (GetHitDice(oPlayer) + 8))) + { + //Set correct stats for the PvP boards + AdjustPlayerStats(oPlayer, oKiller); + ItemLossUponDeath(oPlayer); + //If was killed by a player 17% chance that a ghost will spawn + if (d6() > 5) + { + AssignCommand(oPlayer,SpeakString("My ghost will haunt you!", TALKVOLUME_TALK)); + CreateObject(OBJECT_TYPE_CREATURE, "shfiend001", GetLocation(oPlayer)); + } + } + } + //Wasn't killed by a player + else + { + if ((GetTag(oKiller) == "npc_tyrguard001") || // Tyr Guard + (GetTag(oKiller) == "npc_tyrguardcapt") || // Tyr Guard Capt + (GetTag(oKiller) == "npc_tyrtowncrier") || // Tyr Town Crier + (GetTag(oKiller) == "UrikiteGuard") || + (GetTag(oKiller) == "UrikiteTemplar") || + (GetTag(oKiller) == "MrHelpful")) + { + SetLocalInt(oPlayer, "DefenderKill", TRUE); + SetLocalString(oPlayer,"DefenderTag",GetTag(oKiller)); + SpeakString("You fought the law, & the law won."); + } + ItemLossUponDeath(oPlayer); + ApplyPenalty(oPlayer); + } + //Player died so here's a death variable + SetLocalInt(oPlayer, "bDeath", TRUE); + } + else + { + AdjustPlayerStats(oPlayer, oKiller); + } + //Remove NPC hostilities + ClearAllFactionMembers(oPlayer); + //Pop up the Respawn GUI + DelayCommand(2.5, PopUpGUIPanel(oPlayer, GUI_PANEL_PLAYER_DEATH)); +} + +void AdjustPlayerStats(object oDied, object oKiller) +{ + string sDied = GetName(oDied); + int nDied; + + //Ok, someone pked? + if(GetIsPC(oKiller) || GetIsPC(GetMaster(oKiller)) || GetIsPC(GetAreaOfEffectCreator(oKiller))) + { + if (!GetIsDM(oKiller) && !GetIsDMPossessed(oKiller) && !GetIsDM(GetMaster(oKiller))) + { + // Let everyone know of PK kill. + string sWhere = GetName(GetArea(oDied)); + string sKiller = GetName(oKiller); + string sVarDead = GetCampaignVariableName(oDied); + //Make sure if it's a pet their master gets the credit + if(GetIsPC(GetMaster(oKiller))) + { + oKiller = GetMaster(oKiller); + sKiller = GetName(oKiller); + } + else if(GetIsPC(GetAreaOfEffectCreator(oKiller))) + { + oKiller = GetAreaOfEffectCreator(oKiller); + sKiller = GetName(oKiller); + } + string sVarKiller = GetCampaignVariableName(oKiller); + + string sMsg; + switch(d8()) + { + case 1: sMsg = " has been slain by "; break; + case 2: sMsg = " fell before the might of "; break; + case 3: sMsg = " was put down by "; break; + case 4: sMsg = " felt the cold wrath of "; break; + case 5: sMsg = " suffered a humiliating defeat at the hands of "; break; + case 6: sMsg = " was destroyed by "; break; + case 7: sMsg = " has been destroyed by "; break; + case 8: sMsg = " was crushed by "; break; + } + string sPKKillMsg = sDied + sMsg + sKiller + " in " + sWhere + "!"; + string sBounty = ""; + + if(oKiller == oDied) + { + if(GetGender(oDied)) + sPKKillMsg = sDied + " killed herself!"; + else + sPKKillMsg = sDied + " killed himself!"; + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + } + //Was the kill in the arena? + else if(GetTag(GetArea(oKiller)) == "TyrSSArena") + { + //Increment kill variable + int nKills = GetLocalInt(oKiller, "Arena"); + SetLocalInt(oKiller, "Arena", ++nKills); + //SetCampaignInt("DSOSTATS", "Arena" + sVarKiller, nKills, oKiller); + SetPersistentInt(oKiller, "Arena" + sVarKiller, nKills,0,"ar_dsostats"); + //ARSX_ArenaKill(oKiller); + + BoardChange(oKiller, "Arena"); + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + //Updates the arena kill board + ArenaKillsUpdate(); + } + else //Kill was made outside of the arena + { + //Increment the kill variable + int nKills = GetLocalInt(oKiller, "Player"); + SetLocalInt(oKiller, "Player", ++nKills); + //SetCampaignInt("DSOStats", "Player" + sVarKiller, nKills, oKiller); + nKills = GetPersistentInt(oKiller, "Player" + sVarKiller, "ar_dsostats"); + SetPersistentInt(oKiller, "Player" + sVarKiller, nKills++,0,"ar_dsostats"); + + BoardChange(oKiller, "Player"); + + int nGoldToTake = FloatToInt(0.15 * GetGold(oDied)); + int nBounty = FloatToInt(nGoldToTake * 0.30f); + nGoldToTake -= nBounty; + //AssignCommand(oDied, GiveGoldToCreature(oKiller, nGoldToTake)); + AssignCommand(oDied, TakeGoldFromCreature((nBounty+nGoldToTake), oDied, TRUE)); + //int nDiedBounty = GetLocalInt(oDied, "Bounty"); + int nDiedBounty = GetPersistentInt(oDied, "Bounty" + sVarDead, "ar_dsostats"); + //SetLocalInt(oDied, "Bounty", 0); + //SetCampaignInt("DSOStats", "Bounty" + sVarDead, 0, oDied); + + if(nDiedBounty > 0) + { + AssignCommand(oDied, GiveGoldToCreature(oKiller, nDiedBounty+nGoldToTake)); + SetPersistentInt(oDied, "Bounty" + sVarDead, 0,0,"ar_dsostats"); + SetLocalInt(oDied, "nBounty", 0); + string sBounty = GetName(oKiller) + " received " + IntToString(nDiedBounty) + " ceramic pieces from the bounty on " + GetName(oDied) + "'s head!"; + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + SendMessageToPC(oPl, sBounty); + oPl = GetNextPC(); + } + } + else + { + SendMessageToPC(oDied, "The dead players bounty is not greater than 0"); + int nOldBounty = GetPersistentInt(oKiller, "Bounty" + sVarKiller, "ar_dsostats"); + SetPersistentInt(oKiller, "Bounty" + sVarKiller, (nOldBounty+nBounty),0,"ar_dsostats"); + SetLocalInt(oDied, "nBounty", (nOldBounty+nBounty)); + AssignCommand(oDied, GiveGoldToCreature(oKiller, nGoldToTake)); + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + } + //int nCampBounty = GetLocalInt(oKiller, "Bounty"); + //SetLocalInt(oKiller, "Bounty", (nCampBounty+nBounty)); + //SetCampaignInt("DSOStats", "Bounty" + sVarKiller, (nCampBounty+nBounty), oKiller); + //SetPersistentInt(oKiller, "Bounty" + sVarKiller, (nCampBounty+nBounty),0,"ar_dsostats"); + } + } + } + else //Died from monsters or something other than players + { + int nGoldToTake = FloatToInt(0.10 * GetGold(oDied)); + // * a cap of 10 000gp taken from you + if (nGoldToTake > 10000) + nGoldToTake = 10000; + TakeGoldFromCreature(nGoldToTake, oDied, TRUE); + } +} + +void ApplyPenalty(object oDied) +{ + int nXP = GetXP(oDied); + int nPenalty = 50 * GetHitDice(oDied); + int nHD = GetHitDice(oDied); + // * You can not lose a level with this respawning + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + + int nNewXP = nXP - nPenalty; + if (nNewXP < nMin) + nNewXP = nMin; + if (nXP != nNewXP) + SetXP(oDied, nNewXP); +} + +void ClearAllFactionMembers(object oPlayer) +{ + if( GetRacialType(oPlayer) == 225 ) // Illithid + { + AdjustReputation(oPlayer, GetObjectByTag("ATHAS_FACTION_ILLITHID"), 90); // Adjust faction reputation + } + // * make friendly to Each of the 3 common factions + AssignCommand(oPlayer, ClearAllActions()); + // * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation + if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer); + } + if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer); + } + if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer); + } +} + +void ItemLossUponDeath(object oPlayer) +{ + // Loop thru the backpack and have + object oItem = GetFirstItemInInventory(oPlayer); + while(GetIsObjectValid(oItem)) + { + //If the item is stolen it is dropped + if(GetStolenFlag(oItem)) + { + if(!GetPlotFlag(oItem)) + { + //Every item lost has a 20% chance to be destroyed + if(Random(100) < 20) + { + //Destroy original item + DestroyObject(oItem); + } + else + { + //'Drop' the item in a 1 meter radius around where the player fell + CopyObject(oItem, RadiusAroundLocation(oPlayer)); + //Destroy original item + DestroyObject(oItem); + } + } + } + else + { + //Every item has a 4% chance to be lost + if(Random(100) < 4) + { + //Make sure the item is not a plot item + if (!GetPlotFlag(oItem)) + { + //Every item lost has a 20% chance to be destroyed + if(Random(100) < 20) + { + //Destroy original item + DestroyObject(oItem); + } + else + { + //'Drop' the item in a 1 meter radius around where the player fell + CopyObject(oItem, RadiusAroundLocation(oPlayer)); + //Destroy original item + DestroyObject(oItem); + } + } + } + } + oItem = GetNextItemInInventory(oPlayer); + } +} + +location RadiusAroundLocation(object oPlayer) +{ + object oArea = GetArea(oPlayer); + vector vPosition = (GetPosition(oPlayer) + Vector(((((Random(100) + 1) * 0.01f) * 2) - 1.0f), ((((Random(100) + 1) * 0.01f) * 2) - 1.0f), 0.0f)); + float fOrientation = IntToFloat(Random(360) + 1); + location lLocation = Location(oArea, vPosition, fOrientation); + + return lLocation; +} + +void BoardChange(object oPlayer, string sBoard) +{ + object oModule = GetModule(); + int nTemp = GetLocalInt(oPlayer, sBoard); + string sTemp = GetName(oPlayer); + string sPlayerName = sTemp; + string sAccountTemp = GetStringUpperCase(GetPCPlayerName(oPlayer)); + string sPlayerAccount = sAccountTemp; + int nTemp2; + string sTemp2; + string sAccountTemp2; + int x; + + for (x = 1; x <= 10; x++) + { + if ((sPlayerAccount == GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x))) && (sPlayerName == GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)))) + { + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), 0); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), ""); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), ""); + } + + if (sAccountTemp == sPlayerAccount) + { + if (nTemp > GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x))) + { + nTemp2 = GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x)); + sTemp2 = GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)); + sAccountTemp2 = GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x)); + + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + // SetCampaignInt("DSOStats", "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetPersistentInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp,0,"ar_dsostats"); + + //SetCampaignString("DSOStats", "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetPersistentString(oModule,"s" + sBoard + "Kills" + IntToString(x), sTemp,0,"ar_dsostats"); + //SetCampaignString("DSOStats", "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + SetPersistentString(oModule,"s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp,0,"ar_dsostats"); + + nTemp = nTemp2; + sTemp = sTemp2; + sAccountTemp = sAccountTemp2; + } + } + else + { + if (nTemp >= GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x))) + { + nTemp2 = GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x)); + sTemp2 = GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)); + sAccountTemp2 = GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x)); + + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + // SetCampaignInt("DSOStats", "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetPersistentInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp,0,"ar_dsostats"); + + //SetCampaignString("DSOStats", "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetPersistentString(oModule,"s" + sBoard + "Kills" + IntToString(x), sTemp,0,"ar_dsostats"); + //SetCampaignString("DSOStats", "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + SetPersistentString(oModule,"s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp,0,"ar_dsostats"); + + nTemp = nTemp2; + sTemp = sTemp2; + sAccountTemp = sAccountTemp2; + } + } + } +} + +void ArenaKillsUpdate() +{ + string sFetchString = "SELECT * FROM athaspw.ar_dsostats WHERE name LIKE'Arena%' ORDER BY val desc"; + SQLExecDirect(sFetchString); + object oModule = GetModule(); + string sName; + int x; + + for (x = 1; x <= 10; x++) + { + SQLFetch(); + sName = SQLGetData(2); + SetLocalString(oModule, "sArenaKills" + IntToString(x), sName); + } +} + + + + + + + + + + + + + + + + + + + + + +/* +#include "x3_inc_horse" +#include "dante_db" +//#include "aps_include" +#include "ar_db_main" //- Waiting on Nitecap -DMH + +void AdjustPlayerStats(object oDied, object oKiller); +void ApplyPenalty(object oDead); +void ClearAllFactionMembers(object oPlayer); +void ItemLossUponDeath(object oPlayer); +void BoardChange(object oPlayer, string sBoard); +location RadiusAroundLocation(object oPlayer); + +void Raise(object oPlayer) +{ + effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION); + + effect eBad = GetFirstEffect(oPlayer); + ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer); + ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer); + + //Search for negative effects + while(GetIsEffectValid(eBad)) + { + if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE || + GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS || + GetEffectType(eBad) == EFFECT_TYPE_DEAF || + GetEffectType(eBad) == EFFECT_TYPE_PARALYZE || + GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL) + { + //Remove effect if it is negative. + RemoveEffect(oPlayer, eBad); + } + eBad = GetNextEffect(oPlayer); + } + //Fire cast spell at event for the specified target + SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer); +} + + +///////////////////////////////////////////////////////////////[ MAIN ]///////// +void main() +{ + object oPlayer = GetLastPlayerDied(); + object oKiller = GetLastHostileActor(oPlayer); + object oHorse; + object oInventory; + string sID; + int nC; + string sT; + string sR; + int nCH; + int nST; + object oItem; + effect eEffect; + string sDB="X3SADDLEBAG"+GetTag(GetModule()); + if (GetStringLength(GetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE"))>0) sDB=GetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE"); + if (HorseGetIsMounted(oPlayer)) + { // Dismount and then die + //SetCommandable(FALSE,oPlayer); + //ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer); + DelayCommand(0.3,HORSE_SupportResetUnmountedAppearance(oPlayer)); + DelayCommand(3.0,HORSE_SupportCleanVariables(oPlayer)); + DelayCommand(1.0,HORSE_SupportRemoveACBonus(oPlayer)); + DelayCommand(1.0,HORSE_SupportRemoveHPBonus(oPlayer)); + DelayCommand(1.1,HORSE_SupportRemoveMountedSkillDecreases(oPlayer)); + DelayCommand(1.1,HORSE_SupportAdjustMountedArcheryPenalty(oPlayer)); + DelayCommand(1.2,HORSE_SupportOriginalSpeed(oPlayer)); + if (!GetLocalInt(GetModule(),"X3_HORSE_NO_CORPSES")) + { // okay to create lootable horse corpses + sR=GetSkinString(oPlayer,"sX3_HorseResRef"); + sT=GetSkinString(oPlayer,"sX3_HorseMountTag"); + nCH=GetSkinInt(oPlayer,"nX3_HorseAppearance"); + nST=GetSkinInt(oPlayer,"nX3_HorseTail"); + nC=GetLocalInt(oPlayer,"nX3_HorsePortrait"); + if (GetStringLength(sR)>0&&GetStringLeft(sR,GetStringLength(HORSE_PALADIN_PREFIX))!=HORSE_PALADIN_PREFIX) + { // create horse + oHorse=HorseCreateHorse(sR,GetLocation(oPlayer),oPlayer,sT,nCH,nST); + SetLootable(oHorse,TRUE); + SetPortraitId(oHorse,nC); + SetLocalInt(oHorse,"bDie",TRUE); + AssignCommand(oHorse,SetIsDestroyable(FALSE,TRUE,TRUE)); + } // create horse + } // okay to create lootable horse corpses + oInventory=GetLocalObject(oPlayer,"oX3_Saddlebags"); + sID=GetLocalString(oPlayer,"sDB_Inv"); + if (GetIsObjectValid(oInventory)) + { // drop horse saddlebags + if (!GetIsObjectValid(oHorse)) + { // no horse created + HORSE_SupportTransferInventory(oInventory,OBJECT_INVALID,GetLocation(oPlayer),TRUE); + } // no horse created + else + { // transfer to horse + HORSE_SupportTransferInventory(oInventory,oHorse,GetLocation(oHorse),TRUE); + //DelayCommand(2.0,PurgeSkinObject(oHorse)); + //DelayCommand(3.0,KillTheHorse(oHorse)); + //DelayCommand(1.8,PurgeSkinObject(oHorse)); + } // transfer to horse + } // drop horse saddlebags + else if (GetStringLength(sID)>0) + { // database based inventory + nC=GetCampaignInt(sDB,"nCO_"+sID); + while(nC>0) + { // restore inventory + sR=GetCampaignString(sDB,"sR"+sID+IntToString(nC)); + sT=GetCampaignString(sDB,"sT"+sID+IntToString(nC)); + nST=GetCampaignInt(sDB,"nS"+sID+IntToString(nC)); + nCH=GetCampaignInt(sDB,"nC"+sID+IntToString(nC)); + DeleteCampaignVariable(sDB,"sR"+sID+IntToString(nC)); + DeleteCampaignVariable(sDB,"sT"+sID+IntToString(nC)); + DeleteCampaignVariable(sDB,"nS"+sID+IntToString(nC)); + DeleteCampaignVariable(sDB,"nC"+sID+IntToString(nC)); + if (!GetIsObjectValid(oHorse)) + { // no lootable corpse + oItem=CreateObject(OBJECT_TYPE_ITEM,sR,GetLocation(oPlayer),FALSE,sT); + } // no lootable corpse + else + { // lootable corpse + oItem=CreateItemOnObject(sR,oHorse,nST,sT); + } // lootable corpse + if (GetItemStackSize(oItem)!=nST) SetItemStackSize(oItem,nST); + if (nCH>0) SetItemCharges(oItem,nCH); + nC--; + } // restore inventory + DeleteCampaignVariable(sDB,"nCO_"+sID); + //DelayCommand(2.0,PurgeSkinObject(oHorse)); + if (GetIsObjectValid(oHorse)&&GetLocalInt(oHorse,"bDie")) DelayCommand(3.0,KillTheHorse(oHorse)); + //DelayCommand(2.5,PurgeSkinObject(oHorse)); + } // database based inventory + else if (GetIsObjectValid(oHorse)) + { // no inventory + //DelayCommand(1.0,PurgeSkinObject(oHorse)); + DelayCommand(2.0,KillTheHorse(oHorse)); + //DelayCommand(1.8,PurgeSkinObject(oHorse)); + } // no inventory + //eEffect=EffectDeath(); + //DelayCommand(1.6,ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oPlayer)); + //DelayCommand(1.7,SetCommandable(TRUE,oPlayer)); + //return; + } // Dismount and then die + + // * increment global tracking number of times that I died + SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1); + + // * BK: Automation Control. Autopcs ignore death + if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10) + { + Raise(oPlayer); + DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF)); + return; // Raise and return + } + + //log the death to arsx - Waiting on Nitecap -DMH + //SetLocalInt(oPlayer,"arsx_Last_kill",ARSX_LogKill(oPlayer,oKiller)); + + // * Destroy some items xp and gold. + //DoDeathCry(); + if (GetTag(GetArea(oPlayer)) != "TYR_GS_ARENA") + { + //If was killed by a player and that player was 4 or less levels higher + if (((GetIsPC(oKiller)) || (GetIsPC(GetMaster(oKiller))))) + { + if ((GetHitDice(oKiller) <= (GetHitDice(oPlayer) + 8))) + { + //Set correct stats for the PvP boards + AdjustPlayerStats(oPlayer, oKiller); + ItemLossUponDeath(oPlayer); + //If was killed by a player 17% chance that a ghost will spawn + if (d6() > 5) + { + AssignCommand(oPlayer,SpeakString("My ghost will haunt you!", TALKVOLUME_TALK)); + CreateObject(OBJECT_TYPE_CREATURE, "shfiend001", GetLocation(oPlayer)); + } + } + } + //Wasn't killed by a player + else + { + if ((GetTag(oKiller) == "TyrGuard") || + (GetTag(oKiller) == "TyrGuardCaptain") || + (GetTag(oKiller) == "MrsHelpful") || + (GetTag(oKiller) == "UrikiteGuard") || + (GetTag(oKiller) == "UrikiteTemplar") || + (GetTag(oKiller) == "MrHelpful")) + { + SetLocalInt(oPlayer, "DefenderKill", TRUE); + SetLocalString(oPlayer,"DefenderTag",GetTag(oKiller)); + SpeakString("You fought the law, & the law won."); + } + ItemLossUponDeath(oPlayer); + ApplyPenalty(oPlayer); + } + //Player died so here's a death variable + SetLocalInt(oPlayer, "bDeath", TRUE); + } + else + { + AdjustPlayerStats(oPlayer, oKiller); + } + //Remove NPC hostilities + ClearAllFactionMembers(oPlayer); + + //Pop up the Respawn GUI + DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH)); + +} +///////////////////////////////////////////////////////////////[ MAIN ]///////// +void AdjustPlayerStats(object oDied, object oKiller) +{ + string sDied = GetName(oDied); + int nDied; + + //Ok, someone pked? + if(GetIsPC(oKiller) || GetIsPC(GetMaster(oKiller)) || GetIsPC(GetAreaOfEffectCreator(oKiller))) + { + if (!GetIsDM(oKiller) && !GetIsDMPossessed(oKiller) && !GetIsDM(GetMaster(oKiller))) + { + // Let everyone know of PK kill. + string sWhere = GetName(GetArea(oDied)); + string sKiller = GetName(oKiller); + string sVarDead = GetCampaignVariableName(oDied); + //Make sure if it's a pet their master gets the credit + if(GetIsPC(GetMaster(oKiller))) + { + oKiller = GetMaster(oKiller); + sKiller = GetName(oKiller); + } + else if(GetIsPC(GetAreaOfEffectCreator(oKiller))) + { + oKiller = GetAreaOfEffectCreator(oKiller); + sKiller = GetName(oKiller); + } + string sVarKiller = GetCampaignVariableName(oKiller); + + string sMsg; + switch(d8()) + { + case 1: sMsg = " has been slain by "; break; + case 2: sMsg = " fell before the might of "; break; + case 3: sMsg = " was put down by "; break; + case 4: sMsg = " felt the cold wrath of "; break; + case 5: sMsg = " suffered a humiliating defeat at the hands of "; break; + case 6: sMsg = " was destroyed by "; break; + case 7: sMsg = " has been destroyed by "; break; + case 8: sMsg = " was crushed by "; break; + } + string sPKKillMsg = sDied + sMsg + sKiller + " in " + sWhere + "!"; + string sBounty = ""; + + if(oKiller == oDied) + { + if(GetGender(oDied)) + sPKKillMsg = sDied + " killed herself!"; + else + sPKKillMsg = sDied + " killed himself!"; + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + } + //Was the kill in the arena? + else if(GetTag(GetArea(oKiller)) == "TyrSSArena") + { + //Increment kill variable + int nKills = GetLocalInt(oKiller, "Arena"); + SetLocalInt(oKiller, "Arena", ++nKills); + //SetCampaignInt("DSOSTATS", "Arena" + sVarKiller, nKills, oKiller); + SetPersistentInt(oKiller, "Arena" + sVarKiller, nKills,0,"ar_dsostats"); + //ARSX_ArenaKill(oKiller); + + BoardChange(oKiller, "Arena"); + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + } + else //Kill was made outside of the arena + { + //Increment the kill variable + int nKills = GetLocalInt(oKiller, "Player"); + SetLocalInt(oKiller, "Player", ++nKills); + //SetCampaignInt("DSOStats", "Player" + sVarKiller, nKills, oKiller); + SetPersistentInt(oKiller, "Player" + sVarKiller, nKills,0,"ar_dsostats"); + + BoardChange(oKiller, "Player"); + + int nGoldToTake = FloatToInt(0.15 * GetGold(oDied)); + int nBounty = FloatToInt(nGoldToTake * 0.30f); + nGoldToTake -= nBounty; + AssignCommand(oDied, GiveGoldToCreature(oKiller, nGoldToTake)); + AssignCommand(oDied, TakeGoldFromCreature((nBounty+nGoldToTake), oDied, TRUE)); + int nDiedBounty = GetLocalInt(oDied, "Bounty"); + SetLocalInt(oDied, "Bounty", 0); + //SetCampaignInt("DSOStats", "Bounty" + sVarDead, 0, oDied); + SetPersistentInt(oKiller, "Bounty" + sVarDead, 0,0,"ar_dsostats"); + + if(nDiedBounty > 0) + { + AssignCommand(oDied, GiveGoldToCreature(oKiller, nDiedBounty)); + string sBounty = GetName(oKiller) + " received " + IntToString(nDiedBounty) + " ceramic pieces from the bounty on " + GetName(oDied) + "'s head!"; + + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + SendMessageToPC(oPl, sBounty); + oPl = GetNextPC(); + } + } + else + { + object oPl = GetFirstPC(); + while(GetIsObjectValid(oPl)) + { + SendMessageToPC(oPl, sPKKillMsg); + oPl = GetNextPC(); + } + } + int nCampBounty = GetLocalInt(oKiller, "Bounty"); + SetLocalInt(oKiller, "Bounty", (nCampBounty+nBounty)); + //SetCampaignInt("DSOStats", "Bounty" + sVarKiller, (nCampBounty+nBounty), oKiller); + SetPersistentInt(oKiller, "Bounty" + sVarKiller, (nCampBounty+nBounty),0,"ar_dsostats"); + } + } + } + else //Died from monsters or something other than players + { + int nGoldToTake = FloatToInt(0.10 * GetGold(oDied)); + // * a cap of 10 000gp taken from you + if (nGoldToTake > 10000) + nGoldToTake = 10000; + TakeGoldFromCreature(nGoldToTake, oDied, TRUE); + } +} + +void ApplyPenalty(object oDead) +{ + int nXP = GetXP(oDead); + int nPenalty = 50 * GetHitDice(oDead); + int nHD = GetHitDice(oDead); + // * You can not lose a level with this respawning + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + + int nNewXP = nXP - nPenalty; + if (nNewXP < nMin) + nNewXP = nMin; + if (nXP != nNewXP) + SetXP(oDead, nNewXP); +} + +void ItemLossUponDeath(object oPlayer) +{ + // Loop thru the backpack and have + object oItem = GetFirstItemInInventory(oPlayer); + while(GetIsObjectValid(oItem)) + { + //If the item is stolen it is dropped + if(GetStolenFlag(oItem)) + { + if(!GetPlotFlag(oItem)) + { + //Every item lost has a 20% chance to be destroyed + if(Random(100) < 20) + { + //Destroy original item + DestroyObject(oItem); + } + else + { + //'Drop' the item in a 1 meter radius around where the player fell + CopyObject(oItem, RadiusAroundLocation(oPlayer)); + //Destroy original item + DestroyObject(oItem); + } + } + } + else + { + //Every item has a 4% chance to be lost + if(Random(100) < 4) + { + //Make sure the item is not a plot item + if (!GetPlotFlag(oItem)) + { + //Every item lost has a 20% chance to be destroyed + if(Random(100) < 20) + { + //Destroy original item + DestroyObject(oItem); + } + else + { + //'Drop' the item in a 1 meter radius around where the player fell + CopyObject(oItem, RadiusAroundLocation(oPlayer)); + //Destroy original item + DestroyObject(oItem); + } + } + } + } + oItem = GetNextItemInInventory(oPlayer); + } +} + +location RadiusAroundLocation(object oPlayer) +{ + object oArea = GetArea(oPlayer); + vector vPosition = (GetPosition(oPlayer) + Vector(((((Random(100) + 1) * 0.01f) * 2) - 1.0f), ((((Random(100) + 1) * 0.01f) * 2) - 1.0f), 0.0f)); + float fOrientation = IntToFloat(Random(360) + 1); + location lLocation = Location(oArea, vPosition, fOrientation); + + return lLocation; +} + +void BoardChange(object oPlayer, string sBoard) +{ + object oModule = GetModule(); + int nTemp = GetLocalInt(oPlayer, sBoard); + string sTemp = GetName(oPlayer); + string sPlayerName = sTemp; + string sAccountTemp = GetStringUpperCase(GetPCPlayerName(oPlayer)); + string sPlayerAccount = sAccountTemp; + int nTemp2; + string sTemp2; + string sAccountTemp2; + int x; + + for (x = 1; x <= 10; x++) + { + if ((sPlayerAccount == GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x))) && (sPlayerName == GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)))) + { + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), 0); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), ""); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), ""); + } + + if (sAccountTemp == sPlayerAccount) + { + if (nTemp > GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x))) + { + nTemp2 = GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x)); + sTemp2 = GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)); + sAccountTemp2 = GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x)); + + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + // SetCampaignInt("DSOStats", "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetPersistentInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp,0,"ar_dsostats"); + + //SetCampaignString("DSOStats", "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetPersistentString(oModule,"s" + sBoard + "Kills" + IntToString(x), sTemp,0,"ar_dsostats"); + //SetCampaignString("DSOStats", "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + SetPersistentString(oModule,"s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp,0,"ar_dsostats"); + + nTemp = nTemp2; + sTemp = sTemp2; + sAccountTemp = sAccountTemp2; + } + } + else + { + if (nTemp >= GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x))) + { + nTemp2 = GetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x)); + sTemp2 = GetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x)); + sAccountTemp2 = GetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x)); + + SetLocalInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetLocalString(oModule, "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetLocalString(oModule, "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + // SetCampaignInt("DSOStats", "n" + sBoard + "Kills" + IntToString(x), nTemp); + SetPersistentInt(oModule, "n" + sBoard + "Kills" + IntToString(x), nTemp,0,"ar_dsostats"); + + //SetCampaignString("DSOStats", "s" + sBoard + "Kills" + IntToString(x), sTemp); + SetPersistentString(oModule,"s" + sBoard + "Kills" + IntToString(x), sTemp,0,"ar_dsostats"); + //SetCampaignString("DSOStats", "s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp); + SetPersistentString(oModule,"s" + sBoard + "KillsAccount" + IntToString(x), sAccountTemp,0,"ar_dsostats"); + + nTemp = nTemp2; + sTemp = sTemp2; + sAccountTemp = sAccountTemp2; + } + } + } +} + +void ClearAllFactionMembers(object oPlayer) +{ + // * make friendly to Each of the 3 common factions + AssignCommand(oPlayer, ClearAllActions()); + // * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation + if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oPlayer); + } + if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 50, oPlayer); + } + if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10) + { + SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 50, oPlayer); + } +} */ + diff --git a/nwnds_module/ar_mod_ondying.ncs b/nwnds_module/ar_mod_ondying.ncs new file mode 100644 index 000000000..ee1d5415d Binary files /dev/null and b/nwnds_module/ar_mod_ondying.ncs differ diff --git a/nwnds_module/ar_mod_ondying.nss b/nwnds_module/ar_mod_ondying.nss new file mode 100644 index 000000000..f32a0493d --- /dev/null +++ b/nwnds_module/ar_mod_ondying.nss @@ -0,0 +1,42 @@ +//:://///////////////////////////////////////////// +//:: Dying Script +//:: NW_O0_DEATH.NSS +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This script handles the default behavior + that occurs when a player is dying. + DEFAULT CAMPAIGN: player dies automatically +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent Knowles +//:: Created On: November 6, 2001 +//::////////////////////////////////////////////// + + +void main() +{ + object oPlayer = GetLastPlayerDying(); + string sMessage; + switch (d10()) + { + case 1: sMessage = "I am gravely wounded."; break; + case 2: sMessage = "Need assistance."; break; + case 3: sMessage = "Water..."; break; + case 4: sMessage = "Ugh...Ahhh...Gah..."; break; + case 5: sMessage = "Help."; break; + case 6: sMessage = "Medic."; break; + case 7: sMessage = "Wow I suck!"; break; + case 8: sMessage = "Mmm... this sand is delicious."; break; + case 9: sMessage = "I always wanted to spend more time on my back."; break; + case 10: sMessage = "Wait... I lagged!"; break; + } + + AssignCommand(oPlayer, ClearAllActions()); + AssignCommand(oPlayer, SpeakString(sMessage)); + + if (GetTag(GetArea(oPlayer)) != "TyrSSArena") + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHitPointChangeWhenDying(-1.0), oPlayer, 0.0f); + else + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(FALSE, FALSE), oPlayer); +} diff --git a/nwnds_module/ar_mod_onenter.ncs b/nwnds_module/ar_mod_onenter.ncs new file mode 100644 index 000000000..7cc740444 Binary files /dev/null and b/nwnds_module/ar_mod_onenter.ncs differ diff --git a/nwnds_module/ar_mod_onenter.nss b/nwnds_module/ar_mod_onenter.nss new file mode 100644 index 000000000..101e44d04 --- /dev/null +++ b/nwnds_module/ar_mod_onenter.nss @@ -0,0 +1,595 @@ +//:://///////////////////////////////////////////// +//:: Default On Enter for Module +//:: x3_mod_def_enter +//:: Copyright (c) 2008 Bioware Corp. +//::////////////////////////////////////////////// +/* + This script adds the horse menus to the PCs. +*/ +//::////////////////////////////////////////////// +//:: Created By: Deva B. Winblood +//:: Created On: Dec 30th, 2007 +//:: Last Update: April 21th, 2008 +//::////////////////////////////////////////////// + +#include "x3_inc_horse" +//#include "wow_polyinclude" +#include "dante_db" +// Wanye begin +#include "ar_inc_wow" +//#include "wow_inc_scouting" +// Wayne end +//#include "ar_db_main" +#include "dmfi_init_inc" +#include "ar_inc_pcspawn" + +void ARCleanVars(object oPC); +void ApplyExitPenalty(object oPlayer); +int DetermineDeath(object oPlayer); +void DetermineExitPenalty(object oPlayer, string sPlayerName); +void GreetArenaChampion(string sPlayerName); +void MessageOfTheDay(object oPlayer, string sPlayerName); +//void SetStats(object oPlayer); +void StripNewChars(object oPlayer); +void GivePCWands(object oPlayer); + +//void ArenaKillsUpdate(); + + +/*void ArenaKillsUpdate() +{ + string sFetchString = "SELECT * FROM ar_dsostats WHERE name LIKE'Arena%' ORDER BY val desc"; + SQLExecDirect(sFetchString); + object oModule = GetModule(); + string sName; + int x; + + for (x = 1; x <= 10; x++) + { + SQLFetch(); + sName = SQLGetData(2); + object oPC = GetFirstPC(); + DelayCommand(10.0, SendMessageToPC(oPC, sName)); + SetLocalString(oModule, "sArenaKills" + IntToString(x), sName); + } +}*/ + +void main() +{ + //Populates the arena board + //ArenaKillsUpdate(); + + object oPC = GetEnteringObject(); + // ARSX_OnClientEnter(oPC); //- Waiting on Nitecap -DMH + // Begin BESIE Spawn System + int bBESIEWidget; + if(GetIsDM(oPC)) + { + SetLocalInt(GetModule(), "re_" + GetPCPlayerName(oPC), TRUE); + object oItem = GetFirstItemInInventory(oPC); + while(GetIsObjectValid(oItem)) + { + if(GetTag(oItem) == "BESIEWidget") bBESIEWidget = TRUE; + oItem = GetNextItemInInventory(oPC); + } + if(!bBESIEWidget) CreateItemOnObject("besiewidget", oPC); + } + else DeleteLocalInt(GetModule(), "re_" + GetName(oPC)); + // End BESIE Spawn System +/* ExecuteScript("x3_mod_pre_enter",OBJECT_SELF); // Override for other skin systems + if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC)) + { // add horse menu + HorseAddHorseMenu(oPC); + if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")) + { // restore PC horse status from database + DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE)); + } // restore PC horse status from database + } // add horse menu + if (GetIsPC(oPC)) + { // more details + // restore appearance in case you export your character in mounted form, etc. + if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC); + // pre-cache horse animations for player as attaching a tail to the model + HorsePreloadAnimations(oPC); + DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC)); + } // more details */ + + + if (GetIsPC(oPC)) + { + string sPlayerName = GetName(oPC); + MessageOfTheDay(oPC, sPlayerName); + + if (!GetIsDM(oPC)) + { + //SetStats(oPC); + //NC:EDIT + ARCleanVars(oPC); + ScanItems(oPC,TRUE); + if (GetXP(oPC) == 0) + { + StripNewChars(oPC); + } + else + { + GreetArenaChampion(sPlayerName); + //Kinda hard to read - Determine whether the player is marked + //for death; if true don't check for the exit penalty + if (!DetermineDeath(oPC)) + DetermineExitPenalty(oPC, sPlayerName); + SetLocalInt(oPC, "nEnter", TRUE); + } + + AdjustReputation(oPC, GetObjectByTag("kank"), 50); + //AdjustReputation(oPC, GetObjectByTag("ds_kank001"), 50); + + } +} + +// Give language tokens. +if (!GetIsDM(oPC)) +{ + if( GetLevelByClass(CLASS_TYPE_DRUID, oPC) >= 2 ) + { + if ( GetItemPossessedBy(oPC, "hlslang_108") == OBJECT_INVALID ) // Druidic + { + DelayCommand(1.0, FloatingTextStringOnCreature("Druidic language token acquired.", oPC)); + CreateItemOnObject("hlslang_108", oPC); + } + } + if( GetLevelByClass(CLASS_TYPE_ROGUE, oPC) >= 2 ) + { + if ( GetItemPossessedBy(oPC, "hlslang_9") == OBJECT_INVALID ) // Thieve's Cant + { + DelayCommand(1.0, FloatingTextStringOnCreature("Thieve's Cant token acquired.", oPC)); + CreateItemOnObject("hlslang_9", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_TARI ) + { + DelayCommand(0.5, AdjustReputation(oPC, GetObjectByTag("FACTION_ATHAS_TARI"), 90)); // Adjust faction reputation + + if ( GetItemPossessedBy(oPC, "hlslang_2") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Tari language token acquired.", oPC)); + CreateItemOnObject("hlslang_2", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_AARAKOCRA ) + { + if ( GetItemPossessedBy(oPC, "hlslang_106") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Aarakocran language token acquired.", oPC)); + CreateItemOnObject("hlslang_106", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_DS_ELF ) + { + DelayCommand(0.5, AdjustReputation(oPC, GetObjectByTag("FACTION_ATHAS_SILVERHAND"), 90)); // Adjust faction reputation + + if ( GetItemPossessedBy(oPC, "hlslang_1") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Elven language token acquired.", oPC)); + CreateItemOnObject("hlslang_1", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_DS_HALFELF ) + { + if ( GetItemPossessedBy(oPC, "hlslang_1") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Elven language token acquired.", oPC)); + CreateItemOnObject("hlslang_1", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_DS_DWARF ) + { + DelayCommand(0.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_KLED"), 90)); // Adjust faction reputation + + if ( GetItemPossessedBy(oPC, "hlslang_4") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Dwarven language token acquired.", oPC)); + CreateItemOnObject("hlslang_4", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_DS_HALFLING ) + { + if ( GetItemPossessedBy(oPC, "hlslang_3") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Halfling language token acquired.", oPC)); + CreateItemOnObject("hlslang_3", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_GITH ) + { + SendMessageToPC(GetFirstPC(), "Gith Found"); + DelayCommand(3.5, FloatingTextStringOnCreature("Setting Faction: Gith", oPC)); + DelayCommand(4.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ANVILCRACKER"), -100)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_BELGOI"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_CRIMSON"), -100)); + DelayCommand(6.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DEFENDER"), -100)); + DelayCommand(6.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DRAQOMAN"), -100)); + DelayCommand(7.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_GITH"), 90)); + DelayCommand(7.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ILLITHID"), -100)); + DelayCommand(8.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_IRONCLAW"), -100)); + DelayCommand(8.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_KLED"), -100)); + DelayCommand(9.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_LOWLIFE"), -100)); + DelayCommand(9.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_MINDLESS"), -100)); + DelayCommand(10.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_PIRATE"), -100)); + DelayCommand(10.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_RAIDER"), -100)); + DelayCommand(11.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_SILVERHAND"), -100)); + DelayCommand(11.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TARI"), -100)); + DelayCommand(12.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_THRAX"), -100)); + DelayCommand(12.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(13.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_UNDEAD"), -100)); + DelayCommand(13.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), -100)); + DelayCommand(14.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(14.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_YUANTI"), -100)); + + DelayCommand(15.0, SetLocalInt(oPC, "IsGith", 1)); + DelayCommand(15.5, FloatingTextStringOnCreature("Finished Setting Faction Reputation.", oPC)); + + if ( GetItemPossessedBy(oPC, "hlslang_13") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Gith language token acquired.", oPC)); + CreateItemOnObject("hlslang_13", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_AIR_GEN ) // Air Genasi + { + SetColor ( oPC, COLOR_CHANNEL_SKIN, 020); + + if ( GetItemPossessedBy(oPC, "hlslang_101") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Auran language token acquired.", oPC)); + CreateItemOnObject("hlslang_101", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_EARTH_GEN ) // Earth Genasi + { + SetColor ( oPC, COLOR_CHANNEL_SKIN, 118); + + if ( GetItemPossessedBy(oPC, "hlslang_102") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Terran language token acquired.", oPC)); + CreateItemOnObject("hlslang_102", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_FIRE_GEN ) // Fire Genasi + { + SetColor ( oPC, COLOR_CHANNEL_SKIN, 103); + + if ( GetItemPossessedBy(oPC, "hlslang_104") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Ignan language token acquired.", oPC)); + CreateItemOnObject("hlslang_104", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_WATER_GEN ) // Water Genasi + { + SetColor ( oPC, COLOR_CHANNEL_SKIN, 141); + + if ( GetItemPossessedBy(oPC, "hlslang_103") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Aquan language token acquired.", oPC)); + CreateItemOnObject("hlslang_103", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_PTERRAN ) // Pterran + { + if ( GetItemPossessedBy(oPC, "hlslang_105") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Pterran language token acquired.", oPC)); + CreateItemOnObject("hlslang_105", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_ILLITHID ) // Illithid + { + if ( GetItemPossessedBy(oPC, "hlslang_11") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Illithid language token acquired.", oPC)); + CreateItemOnObject("hlslang_11", oPC); + } + + SendMessageToPC(GetFirstPC(), "Illithid Found"); + DelayCommand(3.5, FloatingTextStringOnCreature("Setting Faction: Illithid", oPC)); + DelayCommand(4.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ANVILCRACKER"), -100)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_BELGOI"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_CRIMSON"), -100)); + DelayCommand(6.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DEFENDER"), -100)); + DelayCommand(6.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DRAQOMAN"), -100)); + DelayCommand(7.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_GITH"), -100)); + DelayCommand(7.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ILLITHID"), 90)); + DelayCommand(8.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_IRONCLAW"), -100)); + DelayCommand(8.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_KLED"), -100)); + DelayCommand(9.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_LOWLIFE"), -100)); + DelayCommand(9.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_MINDLESS"), -100)); + DelayCommand(10.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_PIRATE"), -100)); + DelayCommand(10.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_RAIDER"), -100)); + DelayCommand(11.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_SILVERHAND"), -100)); + DelayCommand(11.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TARI"), -100)); + DelayCommand(12.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_THRAX"), -100)); + DelayCommand(12.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(13.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_UNDEAD"), -100)); + DelayCommand(13.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), -100)); + DelayCommand(14.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(14.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_YUANTI"), -100)); + + DelayCommand(15.0, SetLocalInt(oPC, "IsIllithid", 1)); + DelayCommand(15.5, FloatingTextStringOnCreature("Finished Setting Faction Reputation.", oPC)); + } + if( GetRacialType(oPC) == RACIAL_TYPE_JERAL || + GetRacialType(oPC) == RACIAL_TYPE_JHOL || + GetRacialType(oPC) == RACIAL_TYPE_JEZ || + GetRacialType(oPC) == RACIAL_TYPE_THRIKREEN || + GetRacialType(oPC) == RACIAL_TYPE_TKEECH || + GetRacialType(oPC) == RACIAL_TYPE_TOKSA || + GetRacialType(oPC) == RACIAL_TYPE_TONDI ) + { + if ( GetItemPossessedBy(oPC, "hlslang_7") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Kreen language token acquired.", oPC)); + CreateItemOnObject("hlslang_7", oPC); + } + } + if( GetRacialType(oPC) == RACIAL_TYPE_ABOM_YUAN || // Yuan-Ti Abomination + GetRacialType(oPC) == RACIAL_TYPE_PURE_YUAN ) // Yuan-Ti Pureblood + { + + if ( GetItemPossessedBy(oPC, "hlslang_5") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Yuan-Ti language token acquired.", oPC)); + CreateItemOnObject("hlslang_5", oPC); + } + + SendMessageToPC(GetFirstPC(), "Yuan-Ti Found"); + DelayCommand(3.5, FloatingTextStringOnCreature("Setting Faction: Yuan-Ti", oPC)); + DelayCommand(4.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ANVILCRACKER"), -100)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_BELGOI"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_CRIMSON"), -100)); + DelayCommand(6.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DEFENDER"), -100)); + DelayCommand(6.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DRAQOMAN"), -100)); + DelayCommand(7.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_GITH"), -100)); + DelayCommand(7.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ILLITHID"), -100)); + DelayCommand(8.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_IRONCLAW"), -100)); + DelayCommand(8.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_KLED"), -100)); + DelayCommand(9.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_LOWLIFE"), -100)); + DelayCommand(9.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_MINDLESS"), -100)); + DelayCommand(10.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_PIRATE"), -100)); + DelayCommand(10.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_RAIDER"), -100)); + DelayCommand(11.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_SILVERHAND"), -100)); + DelayCommand(11.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TARI"), -100)); + DelayCommand(12.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_THRAX"), -100)); + DelayCommand(12.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(13.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_UNDEAD"), -100)); + DelayCommand(13.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), -100)); + DelayCommand(14.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(14.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_YUANTI"), 90)); + + DelayCommand(15.0, SetLocalInt(oPC, "IsYuanTi", 1)); + DelayCommand(15.5, FloatingTextStringOnCreature("Finished Setting Faction Reputation.", oPC)); + } + if( GetRacialType(oPC) == RACIAL_TYPE_BELGOI ) + { + if ( GetItemPossessedBy(oPC, "hlslang_110") == OBJECT_INVALID ) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Belgoi language token acquired.", oPC)); + CreateItemOnObject("hlslang_110", oPC); + } + + SendMessageToPC(GetFirstPC(), "Belgoi Found"); + DelayCommand(3.5, FloatingTextStringOnCreature("Setting Faction: Belgoi", oPC)); + DelayCommand(4.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ANVILCRACKER"), -100)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_BELGOI"), 90)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_CRIMSON"), -100)); + DelayCommand(6.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DEFENDER"), -100)); + DelayCommand(6.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_DRAQOMAN"), -100)); + DelayCommand(7.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_GITH"), -100)); + DelayCommand(7.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_ILLITHID"), -100)); + DelayCommand(8.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_IRONCLAW"), -100)); + DelayCommand(8.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_KLED"), -100)); + DelayCommand(9.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_LOWLIFE"), -100)); + DelayCommand(9.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_MINDLESS"), -100)); + DelayCommand(10.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_PIRATE"), -100)); + DelayCommand(10.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_RAIDER"), -100)); + DelayCommand(11.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_SILVERHAND"), -100)); + DelayCommand(11.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TARI"), -100)); + DelayCommand(12.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_THRAX"), -100)); + DelayCommand(12.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(13.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_UNDEAD"), -100)); + DelayCommand(13.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), -100)); + DelayCommand(14.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(14.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_YUANTI"), -100)); + + DelayCommand(15.0, SetLocalInt(oPC, "IsBelgoi", 1)); + DelayCommand(15.5, FloatingTextStringOnCreature("Finished Setting Faction Reputation.", oPC)); + } + + } + + // To be set later. Need to figure out what feat Hamannu Domain is now + /*if (!GetIsDM(oPC)) + { + if (GetHasFeat(5024, oPC)) + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + if (GetStringLowerCase(GetName(oPC)) == "tallik the blade") + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + if (GetStringLowerCase(GetName(oPC)) == "evanti") + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + if (GetStringLowerCase(GetName(oPC)) == "actavia the aggressive") + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + if (GetStringLowerCase(GetName(oPC)) == "myrkhan") + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + if (GetStringLowerCase(GetName(oPC)) == "raphale") + { + DelayCommand(4.0, FloatingTextStringOnCreature("Setting Faction: Urikite", oPC)); + DelayCommand(4.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_TYR"), -100)); + DelayCommand(5.0, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100)); + DelayCommand(5.5, AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_URIK"), 90)); + DelayCommand(6.0, SetLocalInt(oPC, "IsUrikite", 1)); + DelayCommand(6.5, FloatingTextStringOnCreature("Finished Setting Faction", oPC)); + } + } */ + + SetPlotFlag(oPC, FALSE); + + // initialize DMFI + dmfiInitialize(oPC); +} + +void ApplyExitPenalty(object oPC) +{ + int nXP = GetXP(oPC); + int nPenalty = 10 * GetHitDice(oPC); + int nHD = GetHitDice(oPC); + // * You can not lose a level with this respawning + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + + int nNewXP = nXP - nPenalty; + if ((nNewXP < nMin)) + nNewXP = nMin; + SetXP(oPC, nNewXP); + int nGoldToTake = FloatToInt(0.05 * GetGold(oPC)); + // * a cap of 1000gp taken from you + if (nGoldToTake > 1000) + { + nGoldToTake = 1000; + } + AssignCommand(oPC, TakeGoldFromCreature(nGoldToTake, oPC, TRUE)); + +} + +int DetermineDeath(object oPC) +{ + int bDead = FALSE; + + if (GetLocalInt(oPC, "bDeath")) + { + bDead = TRUE; + SetLocalInt(oPC, "bDeath", FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(FALSE, FALSE), oPC, 0.0f); + } + + return bDead; +} + +void DetermineExitPenalty(object oPC, string sPlayerName) +{ + if (GetLocalInt(oPC, "bExitPenalty") == TRUE) + { + ApplyExitPenalty(oPC); + string sRobbedText = sPlayerName + " has been beaten and robbed by bandits! Next time log out while resting."; + FloatingTextStringOnCreature(sRobbedText, oPC, FALSE); + } + else + SetLocalInt(oPC, "bExitPenalty", TRUE); +} + +void GreetArenaChampion(string sPlayerName) +{ + string sArenaChampion = GetLocalString(GetModule(), "sArenaKills1"); + + if (sPlayerName == sArenaChampion) + { + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + string sMsg = "The champion of the arena has arrived in Tyr. All hail " + sPlayerName + "!"; + SendMessageToPC(oPC, sMsg); + oPC = GetNextPC(); + } + } +} + +void MessageOfTheDay(object oPC, string sPlayerName) +{ + string sWelcome = "Welcome to the NWN Dark Sun Demo Server!, "; + sWelcome += sPlayerName; + sWelcome += "!"; + SendMessageToPC(oPC, sWelcome); + + string sMessageOfTheDay = "MESSAGES OF THE DAY: New players should talk to the Guard Captain."; + sMessageOfTheDay += "\nReport all bugs to: NWN Dark Sun Discord."; + SendMessageToPC(oPC, sMessageOfTheDay); +} + +/*void SetStats(object oPC) +{ + string sVarName = GetCampaignVariableName(oPC); + SetLocalInt(oPC, "Arena", GetPersistentInt(oPC, "Arena" + sVarName, "ar_dsostats")); + SetLocalInt(oPC, "Player", GetPersistentInt(oPC, "Player" + sVarName, "ar_dsostats")); + SetLocalInt(oPC, "Bounty", GetPersistentInt(oPC, "Bounty" + sVarName, "ar_dsostats")); +}*/ + +void StripNewChars(object oPC) +{ + + AssignCommand(oPC, TakeGoldFromCreature(GetGold(oPC), oPC, TRUE)); + // Function Below Removed for PRC compatibility -DMH + + /*object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); */ + + object oItem = GetFirstItemInInventory(oPC); + while (GetIsObjectValid(oItem)) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(oPC); + } + oItem = CreateItemOnObject("cloth024", oPC); + AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)); + GivePCWands(oPC); +} + +void GivePCWands(object oPC) +{ + //to change the wands change the resrefs + //here + string sWndPCFollow = "dmfi_pc_follow";//PC Autofollow Widget + string sWndPCDice = "dmfi_pc_dicebag";//PC Dicebag + string sWndPCEmote = "dmfi_pc_emote";//PC Emote Wand + + CreateItemOnObject(sWndPCFollow, oPC); + CreateItemOnObject(sWndPCDice, oPC); + CreateItemOnObject(sWndPCEmote, oPC); +} + +void ARCleanVars(object oPC) +{ + ExecuteScript("ar_inc_clearvar", oPC); +} \ No newline at end of file diff --git a/nwnds_module/ar_mod_onequip.ncs b/nwnds_module/ar_mod_onequip.ncs new file mode 100644 index 000000000..7285b5215 Binary files /dev/null and b/nwnds_module/ar_mod_onequip.ncs differ diff --git a/nwnds_module/ar_mod_onequip.nss b/nwnds_module/ar_mod_onequip.nss new file mode 100644 index 000000000..93cf36888 --- /dev/null +++ b/nwnds_module/ar_mod_onequip.nss @@ -0,0 +1,80 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnItemEquipped +//:: x2_mod_def_equ +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnEquip Event +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// +//:: Modified By: Deva Winblood +//:: Modified On: April 15th, 2008 +//:: Added Support for Mounted Archery Feat penalties +//::////////////////////////////////////////////// + +#include "x2_inc_switches" +#include "x2_inc_intweapon" +#include "x3_inc_horse" + +void main() +{ + + object oItem = GetPCItemLastEquipped(); + object oPC = GetPCItemLastEquippedBy(); + // ------------------------------------------------------------------------- + // Intelligent Weapon System + // ------------------------------------------------------------------------- + if (IPGetIsIntelligentWeapon(oItem)) + { + IWSetIntelligentWeaponEquipped(oPC,oItem); + // prevent players from reequipping their weapon in + if (IWGetIsInIntelligentWeaponConversation(oPC)) + { + object oConv = GetLocalObject(oPC,"X2_O_INTWEAPON_SPIRIT"); + IWEndIntelligentWeaponConversation(oConv, oPC); + } + else + { + //------------------------------------------------------------------ + // Trigger Drain Health Event + //------------------------------------------------------------------ + if (GetLocalInt(oPC,"X2_L_ENSERRIC_ASKED_Q3")==1) + { + ExecuteScript ("x2_ens_dodrain",oPC); + } + else + { + IWPlayRandomEquipComment(oPC,oItem); + } + } + } + + // ------------------------------------------------------------------------- + // Mounted benefits control + // ------------------------------------------------------------------------- + if (GetWeaponRanged(oItem)) + { + SetLocalInt(oPC,"bX3_M_ARCHERY",TRUE); + HORSE_SupportAdjustMountedArcheryPenalty(oPC); + } + + // ------------------------------------------------------------------------- + // Generic Item Script Execution Code + // If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module, + // it will execute a script that has the same name as the item's tag + // inside this script you can manage scripts for all events by checking against + // GetUserDefinedItemEventNumber(). See x2_it_example.nss + // ------------------------------------------------------------------------- + if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_EQUIP); + int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF); + if (nRet == X2_EXECUTE_SCRIPT_END) + { + return; + } + } +} diff --git a/nwnds_module/ar_mod_onhb.ncs b/nwnds_module/ar_mod_onhb.ncs new file mode 100644 index 000000000..6c74a479e Binary files /dev/null and b/nwnds_module/ar_mod_onhb.ncs differ diff --git a/nwnds_module/ar_mod_onhb.nss b/nwnds_module/ar_mod_onhb.nss new file mode 100644 index 000000000..bb1a8434f --- /dev/null +++ b/nwnds_module/ar_mod_onhb.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: Name re_modheartbeat.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +This script is part of the BESIE Random Encounter +System by Ray Miller. It is meant to be placed in +the Module OnHeartbeat Handler. It is used to run +the CleanHouse() function on all areas in which PCs +currently reside. +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 1-6-03 +//::////////////////////////////////////////////// +#include "re_rndenc" +void main() +{ +object oArea; +object oPC = GetFirstPC(); +while(GetIsObjectValid(oPC)) + { + oArea = GetArea(oPC); + if(!GetIsObjectValid(GetLocalObject(oArea, "re_oHouseCleaner"))) + { + CleanHouse(FALSE, oArea); + } + oPC = GetNextPC(); + } +} diff --git a/nwnds_module/ar_mod_onleave.ncs b/nwnds_module/ar_mod_onleave.ncs new file mode 100644 index 000000000..9deb222fb Binary files /dev/null and b/nwnds_module/ar_mod_onleave.ncs differ diff --git a/nwnds_module/ar_mod_onleave.nss b/nwnds_module/ar_mod_onleave.nss new file mode 100644 index 000000000..f7fe621cd --- /dev/null +++ b/nwnds_module/ar_mod_onleave.nss @@ -0,0 +1,24 @@ + +void DeleteStats(object oPlayer); + +void main() +{ + object oPC = GetExitingObject(); + if (GetIsDM(oPC)) return; + // Disabled to use the PRC HP Tacking functions + /*string sVarName = "HP" + GetLocalString(oPC, "ID"); + int nHP = GetCurrentHitPoints(oPC); + if (nHP == 0) nHP = -1; + SetLocalInt(OBJECT_SELF, sVarName, nHP); */ + // Spell Tracking + ExecuteScript("ar_inc_clearvar", oPC); + +} + + +void DeleteStats(object oPlayer) +{ + DeleteLocalInt(oPlayer, "Arena"); + DeleteLocalInt(oPlayer, "Player"); + DeleteLocalInt(oPlayer, "Bounty"); +} diff --git a/nwnds_module/ar_mod_onlevelup.ncs b/nwnds_module/ar_mod_onlevelup.ncs new file mode 100644 index 000000000..75f8e37a6 Binary files /dev/null and b/nwnds_module/ar_mod_onlevelup.ncs differ diff --git a/nwnds_module/ar_mod_onlevelup.nss b/nwnds_module/ar_mod_onlevelup.nss new file mode 100644 index 000000000..cd0a123b1 --- /dev/null +++ b/nwnds_module/ar_mod_onlevelup.nss @@ -0,0 +1,69 @@ +#include "nc_inc_levelup" + +void main() +{ + object oLeveling = GetPCLevellingUp(); + int nHD = GetHitDice(oLeveling); + if (nHD <= 3) + { + int nStr = GetAbilityScore(oLeveling, ABILITY_STRENGTH, TRUE); + int nDex = GetAbilityScore(oLeveling, ABILITY_DEXTERITY, TRUE); + int nCon = GetAbilityScore(oLeveling, ABILITY_CONSTITUTION, TRUE); + int nWis = GetAbilityScore(oLeveling, ABILITY_WISDOM, TRUE); + int nInt = GetAbilityScore(oLeveling, ABILITY_INTELLIGENCE, TRUE); + int nCha = GetAbilityScore(oLeveling, ABILITY_CHARISMA, TRUE); + + if ((nStr <= 3) || + (nDex <= 3) || + (nCon <= 3) || + (nWis <= 3) || + (nInt <= 3) || + (nCha <= 3)) + { + FloatingTextStringOnCreature("Invalid PC Ability Scores: All ability scores must be 3 or higher.", oLeveling, TRUE); + DelayCommand(2.0f, FloatingTextStringOnCreature("You will have to delete this character & create another one with valid scores.", oLeveling, TRUE)); + NC_RelevelPC(oLeveling); + } + } + + int nClericLevel = GetLevelByClass(CLASS_TYPE_CLERIC, oLeveling); + + if (NC_GetHasClass(CLASS_TYPE_CLERIC, oLeveling)==TRUE) + { + NC_SendMessage(oLeveling, NC_RESPONSE_FOUND_CLERIC); + NC_SendMessage(oLeveling, NC_RESPONSE_CHECK_CLERIC); + if (NC_GetIsTemplar(oLeveling)) + { + if (NC_TemplarCheck(oLeveling)==TRUE) + { + NC_RelevelPC(oLeveling); + } + } + else if (!NC_CheckClericElementalDomains(oLeveling) || !NC_CheckClericBasicDomains(oLeveling)) + { + NC_SendMessage(oLeveling,NC_RESPONSE_RELEVEL_DOMAIN); + NC_RelevelPC(oLeveling); + } + else if (NC_CheckClassRestrictions(oLeveling)) + { + NC_RelevelPC(oLeveling); + } + if (nHD > 2) + { + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + SetXP(oLeveling, nMin); + } + NC_GiveClericSymbol(oLeveling); + } + + else if (NC_CheckClassRestrictions(oLeveling)) + { + NC_RelevelPC(oLeveling); + } + //Set total xp cap after 2nd level. + else if (nHD > 2) + { + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + SetXP(oLeveling, nMin); + } +} diff --git a/nwnds_module/ar_mod_onmodload.ncs b/nwnds_module/ar_mod_onmodload.ncs new file mode 100644 index 000000000..f3fb8039d Binary files /dev/null and b/nwnds_module/ar_mod_onmodload.ncs differ diff --git a/nwnds_module/ar_mod_onmodload.nss b/nwnds_module/ar_mod_onmodload.nss new file mode 100644 index 000000000..d463a15e6 --- /dev/null +++ b/nwnds_module/ar_mod_onmodload.nss @@ -0,0 +1,149 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnLoad Script +//:: x2_mod_def_load +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnModuleLoad Event + + This example script demonstrates how to tweak the + behavior of several subsystems in your module. + + For more information, please check x2_inc_switches + which holds definitions for several variables that + can be set on modules, creatures, doors or waypoints + to change the default behavior of Bioware scripts. + + Warning: + Using some of these switches may change your games + balancing and may introduce bugs or instabilities. We + recommend that you only use these switches if you + know what you are doing. Consider these features + unsupported! + + Please do NOT report any bugs you experience while + these switches have been changed from their default + positions. + + Make sure you visit the forums at nwn.bioware.com + to find out more about these scripts. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// + +#include "x2_inc_switches" +#include "x2_inc_restsys" +#include "ka_inc_loothomes" +#include "ar_db_main" +#include"re_rndenc" + +void main() +{ + //Ignore this... this is for NWNX/SQL database functionality - Waiting on Nitecap -DMH + //Initialize NWNX DB support + SQLInit(); + //Initalize ARSX-DB + ARSX_INIT(); + + + //Not sure if below function is needed -DMH + SetLocalString(GetModule(), "X2_S_UD_SPELLSCRIPT", "ar_inc_spellhook"); // Spell hooking script should it ever be needed + wow_Setup(); + + if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT) + { + // * Setting the switch below will enable a seperate Use Magic Device Skillcheck for + // * rogues when playing on Hardcore+ difficulty. This only applies to scrolls + SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE); + + // * Activating the switch below will make AOE spells hurt neutral NPCS by default + SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE); + } + + // * AI: Activating the switch below will make the creaures using the WalkWaypoint function + // * able to walk across areas + SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE); + + // * Spells: Activating the switch below will make the Glyph of Warding spell behave differently: + // * The visual glyph will disappear after 6 seconds, making them impossible to spot + SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE); + + // * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing, + // * but since it is described this way in the book, here is the switch to get it back... + SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE); + + // * Craft Feats: Use this to disable Item Creation Feats if you do not want + // * them in your module + // SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE); + + // * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size. + // * We do not support this check for balancing reasons, but you can still activate it... + SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE); + + // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this + // * did not fit into NWNs spell system and was confusing, so we took it out... + // SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE); + + // * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this + // * did not fit into NWNs spell system and was confusing, so we took it out... + // SetModuleSwitch (MODULE_SWITCH_RESTRICT_USE_POISON_TO_FEAT, TRUE); + + // * Spellcasting: Some people don't like caster's abusing expertise to raise their AC + // * Uncommenting this line will drop expertise mode whenever a spell is cast by a player + SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE); + + // * Item Event Scripts: The game's default event scripts allow routing of all item related events + // * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a + // * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...) + // * is triggered. Check "x2_it_example.nss" for an example. + // * This feature is disabled by default. + SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE); + + if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + // * If Tagbased scripts are enabled, and you are running a Local Vault Server + // * you should use the line below to add a layer of security to your server, preventing + // * people to execute script you don't want them to. If you use the feature below, + // * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a + // * maximum of 16 chars, instead of the pure tag of the object. + // * i.e. without the line below a user activating an item with the tag "test", + // * will result in the execution of a script called "test". If you uncomment the line below + // * the script called will be "1_test.nss" + // SetUserDefinedItemEventPrefix("1_"); + + } + + // * This initializes Bioware's wandering monster system as used in Hordes of the Underdark + // * You can deactivate it, making your module load faster if you do not use it. + // * If you want to use it, make sure you set "x2_mod_def_rest" as your module's OnRest Script + // SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE); + + if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE) + { + + // * This allows you to specify a different 2da for the wandering monster system. + // SetWanderingMonster2DAFile("des_restsystem"); + + //* Do not change this line. + WMBuild2DACache(); + } + + // Necromancy 101 ///// + SetMaxHenchmen(5); + //////////////////////// + + // Start BESIE Spawn System + //Notice that everything here matches the default settings of the SetRndEncProperties function except + //the iChanceOnRest parameter, which is set to 0. The purpose of this statement is to make every area + //of this module, that is not explicitley set, safe for resting. + SetRndEncProperties(GetModule(), 4, TRUE, "re_ceghimpubt0", 180, 2, 4, FALSE, 0); + //This sets the chance of a resting encounter in the area to 20 percent. Remember that when players + //are resting it is because they are wounded and/or are low on resources. It is important not to set + //the random encounter difficulty too high, especially in areas that are not safe for resting. + // Repeat the following function call for each area that needs specific properties set. + //SetRndEncProperties(GetObjectByTag(""), 4, TRUE, "re_ceghimpubt0", 180, 2, 4, FALSE, 20); + //End BESIE Spawn System +} diff --git a/nwnds_module/ar_mod_onrespawn.ncs b/nwnds_module/ar_mod_onrespawn.ncs new file mode 100644 index 000000000..8ff7fe457 Binary files /dev/null and b/nwnds_module/ar_mod_onrespawn.ncs differ diff --git a/nwnds_module/ar_mod_onrespawn.nss b/nwnds_module/ar_mod_onrespawn.nss new file mode 100644 index 000000000..77d227706 --- /dev/null +++ b/nwnds_module/ar_mod_onrespawn.nss @@ -0,0 +1,127 @@ +//:://///////////////////////////////////////////// +//:: Generic On Pressed Respawn Button +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +// * June 1: moved RestoreEffects into plot include +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: November +//::////////////////////////////////////////////// +//NC:EDIT +//ADD The Grey Respawn In This Script +//NC:EDIT +#include "nw_i0_plot" +#include "ar_inc_pcspawn" + + +const string TYR_JAIL = "WP_Jail"; +const string URIK_JAIL = "WP_UrikJail"; + +string ChooseJail(string sDefenderTag); +void ApplyPenalty(object oDead); +void InformPlayer(string sMessage, object oCreature); + +void main() +{ + object oRespawner = GetLastRespawnButtonPresser(); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oRespawner); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); + RemoveEffects(oRespawner); + + DeleteLocalInt(oRespawner, "bDeath"); + + if ((GetLocalInt(oRespawner, "DefenderKill")) && (GetLocalInt(oRespawner, "IsUrikite"))) + { + DeleteLocalInt(oRespawner, "DefenderKill"); + string sDefenderTag = GetLocalString(oRespawner,"DefenderTag"); + DeleteLocalInt(oRespawner, "DefenderTag"); + ApplyPenalty(oRespawner); + InformPlayer("Your corpse has been carted back to Urik.", oRespawner); + AssignCommand(oRespawner, ActionJumpToObject(GetWaypointByTag("WP_UrikRespawn"))); + + } + else { + if ((GetLocalInt(oRespawner, "DefenderKill")) && (!GetLocalInt(oRespawner, "IsUrikite"))) + { + DeleteLocalInt(oRespawner, "DefenderKill"); + string sDefenderTag = GetLocalString(oRespawner,"DefenderTag"); + DeleteLocalInt(oRespawner, "DefenderTag"); + ApplyPenalty(oRespawner); + InformPlayer("You have woken up in jail!", oRespawner); + AssignCommand(oRespawner,ActionJumpToLocation(GetLocation(GetWaypointByTag(ChooseJail(sDefenderTag))))); + + } + else + { + //If not in the arena respawn at the Hospital + if (GetTag(GetArea(oRespawner)) != "TYR_GS_ARENA") + { + ApplyPenalty(oRespawner); + //NC:EDIT + //go to the black will be added here + //for furture referance. + //AssignCommand(oRespawner,ActionJumpToLocation(GetLocation(GetWaypointByTag("WP_RESPAWN")))); + //InformPlayer("You have passed on to the Grey", oRespawner); + //NC:EDIT + if (GetLocalInt(oRespawner, "IsUrikite")) + { + InformPlayer("Your badly beaten body has been dragged back to Urik.", oRespawner); + AssignCommand(oRespawner, ActionJumpToObject(GetWaypointByTag("WP_UrikRespawn"))); + } + else + { + InformPlayer("Your badly beaten body has been dragged back to civilization.", oRespawner); + AssignCommand(oRespawner, ARSpawnPC(oRespawner,TRUE)); + } + //ARSpawnPC(oRespawner,TRUE); + //AssignCommand(oRespawner,ActionJumpToLocation(GetLocation(GetWaypointByTag("WP_RESPAWN")))); + } + //We're in the arena so respawn by the cots + else + { + InformPlayer("The arena medics have healed you.", oRespawner); + AssignCommand(oRespawner, ActionJumpToObject(GetWaypointByTag("WP_ARENASPAWN"))); + } + } +} +} + +// * Applies an XP penalty to the player respawning +void ApplyPenalty(object oDead) +{ + int nXP = GetXP(oDead); + int nPenalty = 50 * GetHitDice(oDead); + int nHD = GetHitDice(oDead); + // * You can not lose a level with this respawning + int nMin = ((nHD * (nHD - 1)) / 2) * 1000; + + int nNewXP = nXP - nPenalty; + if (nNewXP < nMin) + nNewXP = nMin; + if (nXP != nNewXP) + SetXP(oDead, nNewXP); +} + +void InformPlayer(string sMessage, object oCreature) +{ + DelayCommand(3.0f, FloatingTextStringOnCreature(sMessage, oCreature, FALSE)); +} + + +string ChooseJail(string sDefenderTag) +{ + if ((sDefenderTag == "npc_tyrguard001") || // Tyr Guard + (sDefenderTag == "npc_tyrguardcapt") || // Tyr Guard Capt. + (sDefenderTag == "npc_tyrtowncrier")) // Tyr Town Crier + return TYR_JAIL; + + if((sDefenderTag == "UrikiteGuard") || + (sDefenderTag == "UrikiteTemplar") || + (sDefenderTag == "MrHelpful")) + return URIK_JAIL; + + return "WP_Jail"; + +} diff --git a/nwnds_module/ar_mod_onrest.ncs b/nwnds_module/ar_mod_onrest.ncs new file mode 100644 index 000000000..b2fbfb6c6 Binary files /dev/null and b/nwnds_module/ar_mod_onrest.ncs differ diff --git a/nwnds_module/ar_mod_onrest.nss b/nwnds_module/ar_mod_onrest.nss new file mode 100644 index 000000000..e3b72b1d4 --- /dev/null +++ b/nwnds_module/ar_mod_onrest.nss @@ -0,0 +1,81 @@ +#include "ar_inc_wow" + + +void ARCleanPCLocalVar(object oPC); +void main() +{ + //Get the player that is resting/rested + object oPlayer = GetLastPCRested(); + //Get that players name + string sPlayerName = GetName(oPlayer); + //determine whether they are done resting or just starting resting + int nLastRestType = GetLastRestEventType(); + //Determine if they are resting at a bed or campsite + int bBedOrCamp = GetIsObjectValid(GetLocalObject(oPlayer, "inbed")); + + //They are just now trying to rest + if(nLastRestType == REST_EVENTTYPE_REST_STARTED) + { + //If they are trying to sleep at a bed or campsite + if(bBedOrCamp) + { + // Restore 2e Psionic PSPs + ExecuteScript("lib_psionrest", GetLastPCRested()); + // Run Database script + ExecuteScript("ar_db_onrest",oPlayer); + //Create a snoring effect + effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP); + //Apply this to the player + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPlayer, 7.0); + ScanItems(oPlayer,FALSE); + //Apply a delayed snore???? + DelayCommand(7.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSnore, oPlayer, 7.0)); + //Set a variable to FALSE so they aren't beaten and robbed when they come back + SetLocalInt(oPlayer, "bExitPenalty", FALSE); + //Tell the player it's safe to log out + FloatingTextStringOnCreature("It is now safe for " + sPlayerName + " to log out.", oPlayer, FALSE); + ExportSingleCharacter(oPlayer); + + + + } + else //They are trying to sleep without a bed or campsite + { + //Clear all the players actions + AssignCommand(oPlayer, ClearAllActions()); + //Tell them they connot sleep without a bed or campsite + FloatingTextStringOnCreature(sPlayerName + " cannot rest here. You must find a bed or a campsite.", oPlayer, FALSE); + } + } + //They just got done resting or they canceled it + else if(nLastRestType == REST_EVENTTYPE_REST_FINISHED || nLastRestType == REST_EVENTTYPE_REST_CANCELLED) + { + if(bBedOrCamp) + { + //Delete the varible that they are in bed + DeleteLocalObject(oPlayer, "inbed"); + //Tell them they can no longer log out and be safe + DelayCommand(25.0, FloatingTextStringOnCreature("It is no longer safe for "+ sPlayerName + " to log out.", oPlayer, FALSE)); + //Set the varible so they will be beaten and robbed if they leave + DelayCommand(30.0, SetLocalInt(oPlayer, "bExitPenalty", TRUE)); + } + } +if(GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED) + { + ARCleanPCLocalVar(GetLastPCRested()); + ScanItems(GetLastPCRested(),FALSE); + } +} + +void ARCleanPCLocalVar(object oPC) +{ + DeleteLocalObject(oPC, "BackLashAOE"); + DeleteLocalObject(oPC,"AR_CONSERVE_CASTER"); + DeleteLocalInt(oPC, "BackLash"); + DeleteLocalInt(oPC, "BackLashDice"); + DeleteLocalInt(oPC,"AR_CONSERVE"); + DeleteLocalInt(oPC,"AR_CONSERVE_DC"); + SetLocalInt(oPC,"TaintedAuraActive",0); + DelayCommand(90.0f, SetLocalInt(oPC, "TSTimer", 0)); + +} diff --git a/nwnds_module/ar_mod_onunaqui.ncs b/nwnds_module/ar_mod_onunaqui.ncs new file mode 100644 index 000000000..70c81c703 Binary files /dev/null and b/nwnds_module/ar_mod_onunaqui.ncs differ diff --git a/nwnds_module/ar_mod_onunaqui.nss b/nwnds_module/ar_mod_onunaqui.nss new file mode 100644 index 000000000..aa5c907e5 --- /dev/null +++ b/nwnds_module/ar_mod_onunaqui.nss @@ -0,0 +1,60 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnItemUnAcquireScript +//:: x2_mod_def_unaqu +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnItemUnAcquire Event + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// + +#include "x2_inc_switches" + +void main() +{ + object oItem = GetModuleItemLost(); + object oPC = GetModuleItemLostBy(); + if(!GetIsPC(oPC)) return; + + // * Generic Item Script Execution Code + // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module, + // * it will execute a script that has the same name as the item's tag + // * inside this script you can manage scripts for all events by checking against + // * GetUserDefinedItemEventNumber(). See x2_it_example.nss + if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNACQUIRE); + int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF); + if (nRet == X2_EXECUTE_SCRIPT_END) + { + return; + } + + } + //Start BESIE Spawn System + int iMph; + if(!GetLocalInt(GetModule(), "re_iMph")) + { + iMph = 2; + } + else + { + iMph = GetLocalInt(GetModule(), "re_iMph"); + } + int iMin = 60; + int iHr = iMin * iMph; + int iDay = iHr * 24; + int iMth = iDay * 28; + int iYr = iMth * 12; + object oAmIDroppedLoot = GetModuleItemLost(); + if(GetIsObjectValid(oAmIDroppedLoot)) + { + SetLocalInt(oAmIDroppedLoot, "re_bDroppedItem", TRUE); + SetLocalInt(oAmIDroppedLoot, "re_iDropTime", (GetCalendarYear() * iYr) + (GetCalendarMonth() * iMth) + (GetCalendarDay()* iDay) + (GetTimeHour()* iHr) + (GetTimeMinute() * iMin) + GetTimeSecond()); + } + //End BESIE Spawn System +} \ No newline at end of file diff --git a/nwnds_module/ar_mod_unequip.ncs b/nwnds_module/ar_mod_unequip.ncs new file mode 100644 index 000000000..ba52c3367 Binary files /dev/null and b/nwnds_module/ar_mod_unequip.ncs differ diff --git a/nwnds_module/ar_mod_unequip.nss b/nwnds_module/ar_mod_unequip.nss new file mode 100644 index 000000000..85f6e878f --- /dev/null +++ b/nwnds_module/ar_mod_unequip.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: Example XP2 OnItemEquipped +//:: ar_mod_unequip +//:: (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Put into: OnUnEquip Event +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-07-16 +//::////////////////////////////////////////////// +//:: Modified By: Deva Winblood +//:: Modified On: April 15th, 2008 +//:: Added Support for Mounted Archery Feat penalties +//::////////////////////////////////////////////// + +#include "x2_inc_switches" +#include "x2_inc_intweapon" +#include "x3_inc_horse" + + +void main() +{ + object oItem = GetPCItemLastUnequipped(); + object oPC = GetPCItemLastUnequippedBy(); + + // ------------------------------------------------------------------------- + // Intelligent Weapon System + // ------------------------------------------------------------------------- + if (IPGetIsIntelligentWeapon(oItem)) + { + IWSetIntelligentWeaponEquipped(oPC,OBJECT_INVALID); + IWPlayRandomUnequipComment(oPC,oItem); + } + + // ------------------------------------------------------------------------- + // Mounted benefits control + // ------------------------------------------------------------------------- + if (GetWeaponRanged(oItem)) + { + DeleteLocalInt(oPC,"bX3_M_ARCHERY"); + HORSE_SupportAdjustMountedArcheryPenalty(oPC); + } + + // ------------------------------------------------------------------------- + // Generic Item Script Execution Code + // If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module, + // it will execute a script that has the same name as the item's tag + // inside this script you can manage scripts for all events by checking against + // GetUserDefinedItemEventNumber(). See x2_it_example.nss + // ------------------------------------------------------------------------- + if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE) + { + SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNEQUIP); + int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF); + if (nRet == X2_EXECUTE_SCRIPT_END) + { + return; + } + } +} diff --git a/nwnds_module/ar_morningstars.utm b/nwnds_module/ar_morningstars.utm new file mode 100644 index 000000000..19bbc76eb Binary files /dev/null and b/nwnds_module/ar_morningstars.utm differ diff --git a/nwnds_module/ar_namech003.utc b/nwnds_module/ar_namech003.utc new file mode 100644 index 000000000..828a69101 Binary files /dev/null and b/nwnds_module/ar_namech003.utc differ diff --git a/nwnds_module/ar_obsmino001.utc b/nwnds_module/ar_obsmino001.utc new file mode 100644 index 000000000..f42c68d24 Binary files /dev/null and b/nwnds_module/ar_obsmino001.utc differ diff --git a/nwnds_module/ar_onspawn_herbi.ncs b/nwnds_module/ar_onspawn_herbi.ncs new file mode 100644 index 000000000..899818cab Binary files /dev/null and b/nwnds_module/ar_onspawn_herbi.ncs differ diff --git a/nwnds_module/ar_onspawn_herbi.nss b/nwnds_module/ar_onspawn_herbi.nss new file mode 100644 index 000000000..dda1046fc --- /dev/null +++ b/nwnds_module/ar_onspawn_herbi.nss @@ -0,0 +1,257 @@ +//:://///////////////////////////////////////////// +//:: Name ar_onspawn_herbi +//:: Copyright (c) 2001 Bioware Corp. +//:: +//:: Modified by: DM Heatstroke +//:: +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "ms_name_inc" +#include "x2_inc_switches" +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + /* 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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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 nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR"); + if (nGlow == 1) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + ms_Nomenclature(OBJECT_SELF); + +} diff --git a/nwnds_module/ar_onyxsent001.utc b/nwnds_module/ar_onyxsent001.utc new file mode 100644 index 000000000..beef94251 Binary files /dev/null and b/nwnds_module/ar_onyxsent001.utc differ diff --git a/nwnds_module/ar_ooze_hide.uti b/nwnds_module/ar_ooze_hide.uti new file mode 100644 index 000000000..ed192d870 Binary files /dev/null and b/nwnds_module/ar_ooze_hide.uti differ diff --git a/nwnds_module/ar_otyugh_001.utc b/nwnds_module/ar_otyugh_001.utc new file mode 100644 index 000000000..2cf662d37 Binary files /dev/null and b/nwnds_module/ar_otyugh_001.utc differ diff --git a/nwnds_module/ar_otyugh_002.utc b/nwnds_module/ar_otyugh_002.utc new file mode 100644 index 000000000..e0d2c7dee Binary files /dev/null and b/nwnds_module/ar_otyugh_002.utc differ diff --git a/nwnds_module/ar_otyugh_003.utc b/nwnds_module/ar_otyugh_003.utc new file mode 100644 index 000000000..f727dc55b Binary files /dev/null and b/nwnds_module/ar_otyugh_003.utc differ diff --git a/nwnds_module/ar_owlbear_001.utc b/nwnds_module/ar_owlbear_001.utc new file mode 100644 index 000000000..a87da4f50 Binary files /dev/null and b/nwnds_module/ar_owlbear_001.utc differ diff --git a/nwnds_module/ar_pakubrazi_001.utc b/nwnds_module/ar_pakubrazi_001.utc new file mode 100644 index 000000000..f4fd95df7 Binary files /dev/null and b/nwnds_module/ar_pakubrazi_001.utc differ diff --git a/nwnds_module/ar_para_1_minute.ncs b/nwnds_module/ar_para_1_minute.ncs new file mode 100644 index 000000000..44e446747 Binary files /dev/null and b/nwnds_module/ar_para_1_minute.ncs differ diff --git a/nwnds_module/ar_para_1_minute.nss b/nwnds_module/ar_para_1_minute.nss new file mode 100644 index 000000000..4934b576f --- /dev/null +++ b/nwnds_module/ar_para_1_minute.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: Paralyse 1 Minute +//:: AR_Para_1_Minute +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for one minute +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10)); +} diff --git a/nwnds_module/ar_para_1d4_days.ncs b/nwnds_module/ar_para_1d4_days.ncs new file mode 100644 index 000000000..93d7db0c7 Binary files /dev/null and b/nwnds_module/ar_para_1d4_days.ncs differ diff --git a/nwnds_module/ar_para_1d4_days.nss b/nwnds_module/ar_para_1d4_days.nss new file mode 100644 index 000000000..1f07f4f78 --- /dev/null +++ b/nwnds_module/ar_para_1d4_days.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 1d4 Days +//:: AR_Para_1d4_Days +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 1d4 days! +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d4(1)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(iTime*24)); +} diff --git a/nwnds_module/ar_para_1d4p2_rd.ncs b/nwnds_module/ar_para_1d4p2_rd.ncs new file mode 100644 index 000000000..d3296c1e5 Binary files /dev/null and b/nwnds_module/ar_para_1d4p2_rd.ncs differ diff --git a/nwnds_module/ar_para_1d4p2_rd.nss b/nwnds_module/ar_para_1d4p2_rd.nss new file mode 100644 index 000000000..e4c3a8dd6 --- /dev/null +++ b/nwnds_module/ar_para_1d4p2_rd.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 1d4+2 Rounds +//:: AR_Para_1d4p2_Rd +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 1d4+2 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d4(1)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime+2)); +} diff --git a/nwnds_module/ar_para_1d6_rds.ncs b/nwnds_module/ar_para_1d6_rds.ncs new file mode 100644 index 000000000..32e4f2b16 Binary files /dev/null and b/nwnds_module/ar_para_1d6_rds.ncs differ diff --git a/nwnds_module/ar_para_1d6_rds.nss b/nwnds_module/ar_para_1d6_rds.nss new file mode 100644 index 000000000..0b984073e --- /dev/null +++ b/nwnds_module/ar_para_1d6_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 1d6 Rounds +//:: AR_Para_1d6_Rds +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 1d6 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d6(1)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_2d12_min.ncs b/nwnds_module/ar_para_2d12_min.ncs new file mode 100644 index 000000000..80cae34fa Binary files /dev/null and b/nwnds_module/ar_para_2d12_min.ncs differ diff --git a/nwnds_module/ar_para_2d12_min.nss b/nwnds_module/ar_para_2d12_min.nss new file mode 100644 index 000000000..2f3736149 --- /dev/null +++ b/nwnds_module/ar_para_2d12_min.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 2d12 Minutes (Turns) +//:: AR_Para_2d12_Min +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 2d12 minutes (turns). +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + int iTime = d12(2); + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_2d4_rds.ncs b/nwnds_module/ar_para_2d4_rds.ncs new file mode 100644 index 000000000..f36cefb1d Binary files /dev/null and b/nwnds_module/ar_para_2d4_rds.ncs differ diff --git a/nwnds_module/ar_para_2d4_rds.nss b/nwnds_module/ar_para_2d4_rds.nss new file mode 100644 index 000000000..f7b171092 --- /dev/null +++ b/nwnds_module/ar_para_2d4_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 2d4 Rounds +//:: AR_Para_2d4_Rds +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 2d4 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 11, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d4(2)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_2d6_min.ncs b/nwnds_module/ar_para_2d6_min.ncs new file mode 100644 index 000000000..c2d64b811 Binary files /dev/null and b/nwnds_module/ar_para_2d6_min.ncs differ diff --git a/nwnds_module/ar_para_2d6_min.nss b/nwnds_module/ar_para_2d6_min.nss new file mode 100644 index 000000000..56ac4acbd --- /dev/null +++ b/nwnds_module/ar_para_2d6_min.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 2d6 Minutes (Turns) +//:: AR_Para_2d6_Min +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 2d6 minutes (turns). +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + int iTime = d6(2); + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_2d6_rds.ncs b/nwnds_module/ar_para_2d6_rds.ncs new file mode 100644 index 000000000..553cd4ac6 Binary files /dev/null and b/nwnds_module/ar_para_2d6_rds.ncs differ diff --git a/nwnds_module/ar_para_2d6_rds.nss b/nwnds_module/ar_para_2d6_rds.nss new file mode 100644 index 000000000..7545b041f --- /dev/null +++ b/nwnds_module/ar_para_2d6_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 2d6 Rounds +//:: AR_Para_2d6_Rds +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 2d6 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d6(2)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_3d6_rds.ncs b/nwnds_module/ar_para_3d6_rds.ncs new file mode 100644 index 000000000..ba353cfa2 Binary files /dev/null and b/nwnds_module/ar_para_3d6_rds.ncs differ diff --git a/nwnds_module/ar_para_3d6_rds.nss b/nwnds_module/ar_para_3d6_rds.nss new file mode 100644 index 000000000..ce9664b95 --- /dev/null +++ b/nwnds_module/ar_para_3d6_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 3d6 Rounds +//:: AR_Para_3d6_Rds +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 3d6 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (d6(3)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_para_4_rds.ncs b/nwnds_module/ar_para_4_rds.ncs new file mode 100644 index 000000000..5f69e7bb8 Binary files /dev/null and b/nwnds_module/ar_para_4_rds.ncs differ diff --git a/nwnds_module/ar_para_4_rds.nss b/nwnds_module/ar_para_4_rds.nss new file mode 100644 index 000000000..54f3f8052 --- /dev/null +++ b/nwnds_module/ar_para_4_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Paralyze 4 Rounds +//:: AR_Para_4_Rds +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Induces Paralysis for 4 rounds +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eParal = EffectParalyze(); + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + effect eLink = EffectLinkEffects(eParal, eLink); + int iTime = (4); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_plotitems.utm b/nwnds_module/ar_plotitems.utm new file mode 100644 index 000000000..fe749aed5 Binary files /dev/null and b/nwnds_module/ar_plotitems.utm differ diff --git a/nwnds_module/ar_portek.utc b/nwnds_module/ar_portek.utc new file mode 100644 index 000000000..d8967e11a Binary files /dev/null and b/nwnds_module/ar_portek.utc differ diff --git a/nwnds_module/ar_potions_merch.utm b/nwnds_module/ar_potions_merch.utm new file mode 100644 index 000000000..ebe9c0cd2 Binary files /dev/null and b/nwnds_module/ar_potions_merch.utm differ diff --git a/nwnds_module/ar_pseudo_hide.uti b/nwnds_module/ar_pseudo_hide.uti new file mode 100644 index 000000000..353df94cf Binary files /dev/null and b/nwnds_module/ar_pseudo_hide.uti differ diff --git a/nwnds_module/ar_pseudodrag001.utc b/nwnds_module/ar_pseudodrag001.utc new file mode 100644 index 000000000..ce3b722a3 Binary files /dev/null and b/nwnds_module/ar_pseudodrag001.utc differ diff --git a/nwnds_module/ar_quarterstaves.utm b/nwnds_module/ar_quarterstaves.utm new file mode 100644 index 000000000..1e9938202 Binary files /dev/null and b/nwnds_module/ar_quarterstaves.utm differ diff --git a/nwnds_module/ar_rapiers.utm b/nwnds_module/ar_rapiers.utm new file mode 100644 index 000000000..1572e97df Binary files /dev/null and b/nwnds_module/ar_rapiers.utm differ diff --git a/nwnds_module/ar_rat001.utc b/nwnds_module/ar_rat001.utc new file mode 100644 index 000000000..d36ed3d8a Binary files /dev/null and b/nwnds_module/ar_rat001.utc differ diff --git a/nwnds_module/ar_raven001.utc b/nwnds_module/ar_raven001.utc new file mode 100644 index 000000000..670194480 Binary files /dev/null and b/nwnds_module/ar_raven001.utc differ diff --git a/nwnds_module/ar_rings.utm b/nwnds_module/ar_rings.utm new file mode 100644 index 000000000..69e9adb69 Binary files /dev/null and b/nwnds_module/ar_rings.utm differ diff --git a/nwnds_module/ar_rocklizard001.utc b/nwnds_module/ar_rocklizard001.utc new file mode 100644 index 000000000..4d70904a2 Binary files /dev/null and b/nwnds_module/ar_rocklizard001.utc differ diff --git a/nwnds_module/ar_rods.utm b/nwnds_module/ar_rods.utm new file mode 100644 index 000000000..a88d736ee Binary files /dev/null and b/nwnds_module/ar_rods.utm differ diff --git a/nwnds_module/ar_rumagon.utc b/nwnds_module/ar_rumagon.utc new file mode 100644 index 000000000..bb1602524 Binary files /dev/null and b/nwnds_module/ar_rumagon.utc differ diff --git a/nwnds_module/ar_s3_armorop.ncs b/nwnds_module/ar_s3_armorop.ncs new file mode 100644 index 000000000..f6b86309c Binary files /dev/null and b/nwnds_module/ar_s3_armorop.ncs differ diff --git a/nwnds_module/ar_s3_armorop.nss b/nwnds_module/ar_s3_armorop.nss new file mode 100644 index 000000000..17bf9cd04 --- /dev/null +++ b/nwnds_module/ar_s3_armorop.nss @@ -0,0 +1,67 @@ + +const int CLASS_TYPE_GLADIATOR = 45; + + +#include "nw_i0_spells" + +void main() +{ + + //Declare major variables + object oTarget = OBJECT_SELF; + int nDuration = GetHitDice(OBJECT_SELF); + int nLevel = GetLevelByClass(CLASS_TYPE_GLADIATOR, oTarget); + int nBonus; + + if (nLevel >= 40) + { + nBonus = 8; + } + else if (nLevel >= 35) + { + nBonus = 7; + } + else if (nLevel >= 30) + { + nBonus = 6; + } + else if (nLevel >= 25) + { + nBonus = 5; + } + else if (nLevel >= 20) + { + nBonus = 4; + } + else if (nLevel >= 15) + { + nBonus = 3; + } + else if (nLevel >= 10) + { + nBonus = 2; + } + else if (nLevel >= 5) + { + nBonus =1; + } + //Set unique armor bonus + effect eAC; + eAC = EffectACIncrease(nBonus, AC_NATURAL_BONUS); + effect eVis = EffectVisualEffect(VFX_IMP_AC_BONUS); + + + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE)); + + effect eLink = EffectLinkEffects(eAC, eVis); + eLink = ExtraordinaryEffect(eLink); + + + RemoveEffectsFromSpell(oTarget, GetSpellId()); + + //Apply the armor bonus and the VFX impact + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration)); +} + + diff --git a/nwnds_module/ar_s3_cushion.ncs b/nwnds_module/ar_s3_cushion.ncs new file mode 100644 index 000000000..3c16c0336 Binary files /dev/null and b/nwnds_module/ar_s3_cushion.ncs differ diff --git a/nwnds_module/ar_s3_cushion.nss b/nwnds_module/ar_s3_cushion.nss new file mode 100644 index 000000000..d5526ba79 --- /dev/null +++ b/nwnds_module/ar_s3_cushion.nss @@ -0,0 +1,13 @@ +// the following script will allow the PC to sit in a chair +void main() +{ + object oPlayer = GetLastUsedBy(); + object oChair = OBJECT_SELF; + if (GetIsPC(oPlayer)) + { + if (GetIsObjectValid(oChair) && !GetIsObjectValid (GetSittingCreature(oChair))) + { + AssignCommand(oPlayer, ActionSit(oChair)); + } + } +} diff --git a/nwnds_module/ar_salamander001.utc b/nwnds_module/ar_salamander001.utc new file mode 100644 index 000000000..1d496f79a Binary files /dev/null and b/nwnds_module/ar_salamander001.utc differ diff --git a/nwnds_module/ar_salamander002.utc b/nwnds_module/ar_salamander002.utc new file mode 100644 index 000000000..144d0b42b Binary files /dev/null and b/nwnds_module/ar_salamander002.utc differ diff --git a/nwnds_module/ar_saltdrake001.utc b/nwnds_module/ar_saltdrake001.utc new file mode 100644 index 000000000..e2cf9bb24 Binary files /dev/null and b/nwnds_module/ar_saltdrake001.utc differ diff --git a/nwnds_module/ar_saltdrake002.utc b/nwnds_module/ar_saltdrake002.utc new file mode 100644 index 000000000..53d43382d Binary files /dev/null and b/nwnds_module/ar_saltdrake002.utc differ diff --git a/nwnds_module/ar_scimitars.utm b/nwnds_module/ar_scimitars.utm new file mode 100644 index 000000000..322acebcf Binary files /dev/null and b/nwnds_module/ar_scimitars.utm differ diff --git a/nwnds_module/ar_scrbeetle_001.utc b/nwnds_module/ar_scrbeetle_001.utc new file mode 100644 index 000000000..b80158bff Binary files /dev/null and b/nwnds_module/ar_scrbeetle_001.utc differ diff --git a/nwnds_module/ar_scythes.utm b/nwnds_module/ar_scythes.utm new file mode 100644 index 000000000..989ebce17 Binary files /dev/null and b/nwnds_module/ar_scythes.utm differ diff --git a/nwnds_module/ar_shadowasp_001.utc b/nwnds_module/ar_shadowasp_001.utc new file mode 100644 index 000000000..a75421db2 Binary files /dev/null and b/nwnds_module/ar_shadowasp_001.utc differ diff --git a/nwnds_module/ar_shadowrat001.utc b/nwnds_module/ar_shadowrat001.utc new file mode 100644 index 000000000..23e9747c2 Binary files /dev/null and b/nwnds_module/ar_shadowrat001.utc differ diff --git a/nwnds_module/ar_shadowrat002.utc b/nwnds_module/ar_shadowrat002.utc new file mode 100644 index 000000000..ffb189776 Binary files /dev/null and b/nwnds_module/ar_shadowrat002.utc differ diff --git a/nwnds_module/ar_shields.utm b/nwnds_module/ar_shields.utm new file mode 100644 index 000000000..35d2399eb Binary files /dev/null and b/nwnds_module/ar_shields.utm differ diff --git a/nwnds_module/ar_shortbows.utm b/nwnds_module/ar_shortbows.utm new file mode 100644 index 000000000..213b0f3cb Binary files /dev/null and b/nwnds_module/ar_shortbows.utm differ diff --git a/nwnds_module/ar_shortswords.utm b/nwnds_module/ar_shortswords.utm new file mode 100644 index 000000000..53ceff372 Binary files /dev/null and b/nwnds_module/ar_shortswords.utm differ diff --git a/nwnds_module/ar_shrub001.utp b/nwnds_module/ar_shrub001.utp new file mode 100644 index 000000000..cd2b82241 Binary files /dev/null and b/nwnds_module/ar_shrub001.utp differ diff --git a/nwnds_module/ar_sickles.utm b/nwnds_module/ar_sickles.utm new file mode 100644 index 000000000..d78728352 Binary files /dev/null and b/nwnds_module/ar_sickles.utm differ diff --git a/nwnds_module/ar_skyrossent001.utc b/nwnds_module/ar_skyrossent001.utc new file mode 100644 index 000000000..faa33ed53 Binary files /dev/null and b/nwnds_module/ar_skyrossent001.utc differ diff --git a/nwnds_module/ar_slings.utm b/nwnds_module/ar_slings.utm new file mode 100644 index 000000000..f517aa95b Binary files /dev/null and b/nwnds_module/ar_slings.utm differ diff --git a/nwnds_module/ar_slp_1_minute.ncs b/nwnds_module/ar_slp_1_minute.ncs new file mode 100644 index 000000000..52bffe50a Binary files /dev/null and b/nwnds_module/ar_slp_1_minute.ncs differ diff --git a/nwnds_module/ar_slp_1_minute.nss b/nwnds_module/ar_slp_1_minute.nss new file mode 100644 index 000000000..c74e59a12 --- /dev/null +++ b/nwnds_module/ar_slp_1_minute.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: Sleep 1 Minute (turn) +//:: AR_Slp_1_Minute +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Character is rendered unconscious for + 1 minute (turn). +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +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(10)); +} diff --git a/nwnds_module/ar_slp_2d10_min.ncs b/nwnds_module/ar_slp_2d10_min.ncs new file mode 100644 index 000000000..cf9aeac90 Binary files /dev/null and b/nwnds_module/ar_slp_2d10_min.ncs differ diff --git a/nwnds_module/ar_slp_2d10_min.nss b/nwnds_module/ar_slp_2d10_min.nss new file mode 100644 index 000000000..18b181d4a --- /dev/null +++ b/nwnds_module/ar_slp_2d10_min.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Sleep 2d10 Minutes (turns) +//:: AR_Slp_2d10_Min +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Character is rendered unconscious for + 2-20 minutes (turns). +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eSleep = EffectSleep(); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eSleep, eVis); + int iTime = (d10(2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_slp_2d4_days.ncs b/nwnds_module/ar_slp_2d4_days.ncs new file mode 100644 index 000000000..182774acd Binary files /dev/null and b/nwnds_module/ar_slp_2d4_days.ncs differ diff --git a/nwnds_module/ar_slp_2d4_days.nss b/nwnds_module/ar_slp_2d4_days.nss new file mode 100644 index 000000000..df086f5a3 --- /dev/null +++ b/nwnds_module/ar_slp_2d4_days.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Sleep 2d4 Days +//:: AR_Slp_2d4_Days +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Character is rendered unconscious for + 2d4 days!. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eSleep = EffectSleep(); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eSleep, eVis); + int iTime = (d4(2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(iTime*24)); +} diff --git a/nwnds_module/ar_slp_2d6_min.ncs b/nwnds_module/ar_slp_2d6_min.ncs new file mode 100644 index 000000000..bfd1627ea Binary files /dev/null and b/nwnds_module/ar_slp_2d6_min.ncs differ diff --git a/nwnds_module/ar_slp_2d6_min.nss b/nwnds_module/ar_slp_2d6_min.nss new file mode 100644 index 000000000..4a1861044 --- /dev/null +++ b/nwnds_module/ar_slp_2d6_min.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Sleep 2d6 Minutes (Turns) +//:: AR_Slp_2d6_Min +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Character is rendered unconscious for + 2d6 minutes (turns). +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eSleep = EffectSleep(); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eSleep, eVis); + int iTime = (d6(2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_slp_2d6_rds.ncs b/nwnds_module/ar_slp_2d6_rds.ncs new file mode 100644 index 000000000..6c8d6afa0 Binary files /dev/null and b/nwnds_module/ar_slp_2d6_rds.ncs differ diff --git a/nwnds_module/ar_slp_2d6_rds.nss b/nwnds_module/ar_slp_2d6_rds.nss new file mode 100644 index 000000000..af063fd59 --- /dev/null +++ b/nwnds_module/ar_slp_2d6_rds.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Sleep 2d6 Rounds +//:: AR_Slp_2d6_Min +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Character is rendered unconscious for + 2d6 rounds. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 12, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + effect eSleep = EffectSleep(); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eSleep, eVis); + int iTime = (d6(2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(iTime)); +} diff --git a/nwnds_module/ar_sout_001.utc b/nwnds_module/ar_sout_001.utc new file mode 100644 index 000000000..a39002f9c Binary files /dev/null and b/nwnds_module/ar_sout_001.utc differ diff --git a/nwnds_module/ar_spears.utm b/nwnds_module/ar_spears.utm new file mode 100644 index 000000000..767e6c29d Binary files /dev/null and b/nwnds_module/ar_spears.utm differ diff --git a/nwnds_module/ar_ssurran_001.utc b/nwnds_module/ar_ssurran_001.utc new file mode 100644 index 000000000..b7b48e8dc Binary files /dev/null and b/nwnds_module/ar_ssurran_001.utc differ diff --git a/nwnds_module/ar_ssurran_002.utc b/nwnds_module/ar_ssurran_002.utc new file mode 100644 index 000000000..c3c7bcdfd Binary files /dev/null and b/nwnds_module/ar_ssurran_002.utc differ diff --git a/nwnds_module/ar_st_clerics.ncs b/nwnds_module/ar_st_clerics.ncs new file mode 100644 index 000000000..34015a57f Binary files /dev/null and b/nwnds_module/ar_st_clerics.ncs differ diff --git a/nwnds_module/ar_st_clerics.nss b/nwnds_module/ar_st_clerics.nss new file mode 100644 index 000000000..aed1115e7 --- /dev/null +++ b/nwnds_module/ar_st_clerics.nss @@ -0,0 +1,286 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 6; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 5; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 85; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 35; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} + diff --git a/nwnds_module/ar_st_crimson.ncs b/nwnds_module/ar_st_crimson.ncs new file mode 100644 index 000000000..57b10acfb Binary files /dev/null and b/nwnds_module/ar_st_crimson.ncs differ diff --git a/nwnds_module/ar_st_crimson.nss b/nwnds_module/ar_st_crimson.nss new file mode 100644 index 000000000..785998401 --- /dev/null +++ b/nwnds_module/ar_st_crimson.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 2; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 5; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 25; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 2.0; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_flin.ncs b/nwnds_module/ar_st_flin.ncs new file mode 100644 index 000000000..fd44b67d7 Binary files /dev/null and b/nwnds_module/ar_st_flin.ncs differ diff --git a/nwnds_module/ar_st_flin.nss b/nwnds_module/ar_st_flin.nss new file mode 100644 index 000000000..136fc3c87 --- /dev/null +++ b/nwnds_module/ar_st_flin.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 3; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 50; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.50; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_fortarmor.ncs b/nwnds_module/ar_st_fortarmor.ncs new file mode 100644 index 000000000..172f83443 Binary files /dev/null and b/nwnds_module/ar_st_fortarmor.ncs differ diff --git a/nwnds_module/ar_st_fortarmor.nss b/nwnds_module/ar_st_fortarmor.nss new file mode 100644 index 000000000..081a35f2b --- /dev/null +++ b/nwnds_module/ar_st_fortarmor.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 5; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 45; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.30; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_generic.ncs b/nwnds_module/ar_st_generic.ncs new file mode 100644 index 000000000..245db15b9 Binary files /dev/null and b/nwnds_module/ar_st_generic.ncs differ diff --git a/nwnds_module/ar_st_generic.nss b/nwnds_module/ar_st_generic.nss new file mode 100644 index 000000000..74a957406 --- /dev/null +++ b/nwnds_module/ar_st_generic.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 3; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 55; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 33; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_guild.ncs b/nwnds_module/ar_st_guild.ncs new file mode 100644 index 000000000..c9f109d3a Binary files /dev/null and b/nwnds_module/ar_st_guild.ncs differ diff --git a/nwnds_module/ar_st_guild.nss b/nwnds_module/ar_st_guild.nss new file mode 100644 index 000000000..914f97104 --- /dev/null +++ b/nwnds_module/ar_st_guild.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 6; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 1; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 95; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 5; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 2.0; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_healer.ncs b/nwnds_module/ar_st_healer.ncs new file mode 100644 index 000000000..abe841e87 Binary files /dev/null and b/nwnds_module/ar_st_healer.ncs differ diff --git a/nwnds_module/ar_st_healer.nss b/nwnds_module/ar_st_healer.nss new file mode 100644 index 000000000..ac4ca8cf1 --- /dev/null +++ b/nwnds_module/ar_st_healer.nss @@ -0,0 +1,283 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 2; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 60; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 80; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 33; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_ingredient.ncs b/nwnds_module/ar_st_ingredient.ncs new file mode 100644 index 000000000..1c98b8e96 Binary files /dev/null and b/nwnds_module/ar_st_ingredient.ncs differ diff --git a/nwnds_module/ar_st_ingredient.nss b/nwnds_module/ar_st_ingredient.nss new file mode 100644 index 000000000..8802a5ce6 --- /dev/null +++ b/nwnds_module/ar_st_ingredient.nss @@ -0,0 +1,285 @@ +//:://////////////////////////////////////////////////////////////////////////// +//:: Store Open Script +//:: ar_st_ingredient +//:: For slightly faster store restocking +//:: -DM Heatstroke +//:://////////////////////////////////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//:://////////////////////////////////////////////////////////////////////////// +//:://////////////////////////////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +//:://////////////////////////////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +//:://////////////////////////////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +//:://////////////////////////////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 1; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 1; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 15; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_justl.ncs b/nwnds_module/ar_st_justl.ncs new file mode 100644 index 000000000..e86b07beb Binary files /dev/null and b/nwnds_module/ar_st_justl.ncs differ diff --git a/nwnds_module/ar_st_justl.nss b/nwnds_module/ar_st_justl.nss new file mode 100644 index 000000000..d3e94f417 --- /dev/null +++ b/nwnds_module/ar_st_justl.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 6; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 60; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 95; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 50; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_lich.ncs b/nwnds_module/ar_st_lich.ncs new file mode 100644 index 000000000..f07691998 Binary files /dev/null and b/nwnds_module/ar_st_lich.ncs differ diff --git a/nwnds_module/ar_st_lich.nss b/nwnds_module/ar_st_lich.nss new file mode 100644 index 000000000..fdf5ba87d --- /dev/null +++ b/nwnds_module/ar_st_lich.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 3; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 60; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 50; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 25; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.50; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_lostvendor.ncs b/nwnds_module/ar_st_lostvendor.ncs new file mode 100644 index 000000000..be11a5d4e Binary files /dev/null and b/nwnds_module/ar_st_lostvendor.ncs differ diff --git a/nwnds_module/ar_st_lostvendor.nss b/nwnds_module/ar_st_lostvendor.nss new file mode 100644 index 000000000..dd6c09752 --- /dev/null +++ b/nwnds_module/ar_st_lostvendor.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 12; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 50; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 75; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 2.0; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_oasiselves.ncs b/nwnds_module/ar_st_oasiselves.ncs new file mode 100644 index 000000000..81030523b Binary files /dev/null and b/nwnds_module/ar_st_oasiselves.ncs differ diff --git a/nwnds_module/ar_st_oasiselves.nss b/nwnds_module/ar_st_oasiselves.nss new file mode 100644 index 000000000..883afc77a --- /dev/null +++ b/nwnds_module/ar_st_oasiselves.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 6; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 1; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 25; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_pawn.ncs b/nwnds_module/ar_st_pawn.ncs new file mode 100644 index 000000000..630522ade Binary files /dev/null and b/nwnds_module/ar_st_pawn.ncs differ diff --git a/nwnds_module/ar_st_pawn.nss b/nwnds_module/ar_st_pawn.nss new file mode 100644 index 000000000..d47225468 --- /dev/null +++ b/nwnds_module/ar_st_pawn.nss @@ -0,0 +1,285 @@ +//:://////////////////////////////////////////////////////////////////////////// +//:: Store Open Script +//:: ar_st_ingredient +//:: For slightly faster store restocking +//:: -DM Heatstroke +//:://////////////////////////////////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//:://////////////////////////////////////////////////////////////////////////// +//:://////////////////////////////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +//:://////////////////////////////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +//:://////////////////////////////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +//:://////////////////////////////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 2; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 75; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 5; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 2.20; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_silverhand.ncs b/nwnds_module/ar_st_silverhand.ncs new file mode 100644 index 000000000..13a1e9937 Binary files /dev/null and b/nwnds_module/ar_st_silverhand.ncs differ diff --git a/nwnds_module/ar_st_silverhand.nss b/nwnds_module/ar_st_silverhand.nss new file mode 100644 index 000000000..5339576bd --- /dev/null +++ b/nwnds_module/ar_st_silverhand.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 5; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 5; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 85; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 33; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.50; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_st_va.ncs b/nwnds_module/ar_st_va.ncs new file mode 100644 index 000000000..d297d1283 Binary files /dev/null and b/nwnds_module/ar_st_va.ncs differ diff --git a/nwnds_module/ar_st_va.nss b/nwnds_module/ar_st_va.nss new file mode 100644 index 000000000..bb208b2bc --- /dev/null +++ b/nwnds_module/ar_st_va.nss @@ -0,0 +1,284 @@ +//:://///////////////////////////////////////////// +//:: Store Open Script +//:: nw_d1_startstore +//::////////////////////////////////////////////// +/* + This script will allow stores to partially reset + themselves to their original state after some + time has passed. + + Intended for persistent worlds. +*/ +//::////////////////////////////////////////////// +//:: Created By: The Krit +//:: Created On: 3/2/07 +//:: Replaces the "do-nothing" BioWare script. +//::////////////////////////////////////////////// + +////////////////////////////////////////////////// +// +// This script will cause a store's finite inventory +// and limited gold to be (partially) replenished +// after a certain amount of time passes. It will also +// clean out new items and excess gold. I call this +// restocking. +// +// The timer starts when the store is first opened +// after server rest or the last restock. The time +// is random, but will be at least RESTOCK_TIME_FIXED +// real-time hours. The random component of the time +// is added to this minimum, and will range from 0 +// to RESTOCK_TIME_VARIABLE minutes. +// +// Items are only replaced if all of that type have +// been sold (and not bought back). The chance for an +// item to be replaced is RESTOCK_CHANCE. +// +// Items not in the store's original inventory have a +// chance to be removed (sold to unspecified NPC's, if +// you will) when the store restocks. This chance is +// UNSTOCK_CHANCE. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no more than GOLD_MAX_FRACTION times +// its starting value. +// +// After the store restocks, the store's gold supply -- if +// limited -- will be no less than GOLD_MIN_FRACTION times +// its starting value. +// +// If you try to mess with things and make GOLD_MAX_FRACTION +// less than GOLD_MIN_FRACTION, you deserve whatever happens. +// You may also smack yourself for making trouble. :) +// +////////////////////////////////////////////////// +// +// The variables mentioned above are set globally below. +// In addition, you can change the value for a particular +// store by setting a local variable of the same name +// (and type) on the store. +// NOTE: These variables must be set on the *store*, not +// the merchant. +// +////////////////////////////////////////////////// +// +// This script will (likely) break if you switch a +// store from unlimited gold to limited gold through +// scripting. Don't do that. There would be no +// original gold level to refer to when restocking. +// +////////////////////////////////////////////////// + + +// The following is the minimum number of real-time (not +// game-time) hours that elapse before a store gets +// restocked. +const int RESTOCK_TIME_FIXED = 3; + +// The following is the maximum number of minutes (not +// hours) that a restock might be delayed beyond the +// above minimum number of hours. +const int RESTOCK_TIME_VARIABLE = 30; + +// The following is the chance (percentage) that a depleted +// item will be replaced when the restocking occurs. Each +// item rolls this percentage individually. +const int RESTOCK_CHANCE = 85; + +// The following is the chance (percentage) that an item +// not in the store's original inventory will be removed +// when a restocking occurs. +const int UNSTOCK_CHANCE = 35; + +// The following is the fraction (floating point) of the +// stores original gold that is the most a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MAX_FRACTION = 1.70; + +// The following is the fraction (floating point) of the +// stores original gold that is the least a store can have +// after restocking. +// (No effect on stores with unlimited gold.) +const float GOLD_MIN_FRACTION = 0.80; + + +// The following are names of local variables used by +// this script. +const string STORE_GOLD = "TK_STORE_STARTING_GOLD"; +const string ORIG_INVENTORY = "TK_STORE_STARTING_INVENTORY_"; +const string CUR_INVENTORY = "TK_STORE_CURRENT_INVENTORY_"; +const string INVENTORY_STACK = "TK_STORE_INVENTORY_STACK_LIST_"; +const string INVENTORY_LIST = "TK_STORE_INVENTORY_LIST_"; +const string INVENTORY_SIZE = "TK_STORE_INVENTORY_SIZE"; +const string INVENTORIED = "TK_STORE_DID_INVENTORY"; +const string RESTOCK_ORDERED = "TK_STORE_DID_DELAY"; + + +// Records the store's current (starting) inventory. +void DoInventory(); + +// Restocks the store. +void Restock(); + + +////////////////////////////////////////////////// +// main() +// +// Intended for a store's OnOpenStore event, replacing the BioWare default. +// +void main() +{ + // See if the store's original inventory has been recorded. + if ( !GetLocalInt(OBJECT_SELF, INVENTORIED) ) + { + // Record the current inventory. + DoInventory(); + SetLocalInt(OBJECT_SELF, INVENTORIED, TRUE); + } + + // See if a restock is currently on delay. + if ( !GetLocalInt(OBJECT_SELF, RESTOCK_ORDERED) ) + { + // Determine the restock times (possibly stored locally). + int nRestockHours = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_FIXED"); + if ( nRestockHours == 0 ) + nRestockHours = RESTOCK_TIME_FIXED; + int nRestockMinutes = GetLocalInt(OBJECT_SELF, "RESTOCK_TIME_VARIABLE"); + if ( nRestockMinutes == 0 ) + nRestockMinutes = RESTOCK_TIME_VARIABLE; + + // Order (delay) a restock. + DelayCommand( TurnsToSeconds(60*nRestockHours + Random(nRestockMinutes+1)), + Restock()); + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, TRUE); + } +} + + +////////////////////////////////////////////////// +// DoInventory() +// +// Records the store's current (starting) inventory. +// +void DoInventory() +{ + // Record the store's current gold. + SetLocalInt(OBJECT_SELF, STORE_GOLD, GetStoreGold(OBJECT_SELF)); + + // Record the store's current inventory. + int nCount = 0; + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + // Set a boolean flag based on the blueprint name. + SetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef, TRUE); + // Add sResRef to the list of blueprints. + SetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount), sResRef); + // Record the stack size. + SetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount), GetItemStackSize(oItem)); + // Update the count. + nCount++; + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Record the length of the list of blueprints. + SetLocalInt(OBJECT_SELF, INVENTORY_SIZE, nCount); +} + + +////////////////////////////////////////////////// +// Restock() +// +// Restocks the store. +// +void Restock() +{ + // Check the store's gold. + int nCurGold = GetStoreGold(OBJECT_SELF); + + // We are only concerned if the store has limited gold. + if ( nCurGold > -1 ) + { + // Determine the min and max gold fractions (possibly stored locally). + float fGoldMin = GetLocalFloat(OBJECT_SELF, "GOLD_MIN_FRACTION"); + if ( fGoldMin == 0.0 ) + fGoldMin = GOLD_MIN_FRACTION; + float fGoldMax = GetLocalFloat(OBJECT_SELF, "GOLD_MAX_FRACTION"); + if ( fGoldMax == 0.0 ) + fGoldMax = GOLD_MAX_FRACTION; + + // Calculate the minimum and maximum gold levels. + int nOrigGold = GetLocalInt(OBJECT_SELF, STORE_GOLD); + int nMinGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMin); + int nMaxGold = FloatToInt(IntToFloat(nOrigGold) * fGoldMax); + + // Check for too little gold. + if ( nCurGold < nMinGold ) + SetStoreGold(OBJECT_SELF, nMinGold); + // Check for too much gold. + else if ( nCurGold > nMaxGold ) + SetStoreGold(OBJECT_SELF, nMaxGold); + } + + // Determine the unstock chance (possibly stored locally). + int nUnstockChance = GetLocalInt(OBJECT_SELF, "UNSTOCK_CHANCE"); + if ( nUnstockChance == 0 ) + nUnstockChance = UNSTOCK_CHANCE; + + // Scan the store's current inventory. + // Record which original items are still around. + // Possibly remove non-original items. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + // We are only concerned with items in finite supply. + if ( !GetInfiniteFlag(oItem) ) + { + string sResRef = GetResRef(oItem); + + // See if this item is an original item. + if ( GetLocalInt(OBJECT_SELF, ORIG_INVENTORY + sResRef) ) + { + // Set a boolean flag (temporarily) based on the blueprint name. + SetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef, TRUE); + DelayCommand(0.0, DeleteLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef)); + } + // See if this (not original) item should be removed. + else if ( d100() <= nUnstockChance ) + // Delete this item. + DestroyObject(oItem); + } + // Next item. + oItem = GetNextItemInInventory(); + } + + // Determine the restock chance (possibly stored locally). + int nRestockChance = GetLocalInt(OBJECT_SELF, "RESTOCK_CHANCE"); + if ( nRestockChance == 0 ) + nRestockChance = RESTOCK_CHANCE; + + // Loop through the list of items that might be restored. + int nCount = GetLocalInt(OBJECT_SELF, INVENTORY_SIZE); + while ( nCount-- > 0 ) + { + string sResRef = GetLocalString(OBJECT_SELF, INVENTORY_LIST + IntToString(nCount)); + + // Make sure no items of this type are in the store's inventory (before this loop). + if ( !GetLocalInt(OBJECT_SELF, CUR_INVENTORY + sResRef) ) + // See if this item should be restocked. + if ( d100() <= nRestockChance ) + // Add this item to the store. + CreateItemOnObject(sResRef, OBJECT_SELF, + GetLocalInt(OBJECT_SELF, INVENTORY_STACK + IntToString(nCount))); + } + + // Restocking is no longer in progress. + SetLocalInt(OBJECT_SELF, RESTOCK_ORDERED, FALSE); +} diff --git a/nwnds_module/ar_t0_pcspawn.ncs b/nwnds_module/ar_t0_pcspawn.ncs new file mode 100644 index 000000000..863471d14 Binary files /dev/null and b/nwnds_module/ar_t0_pcspawn.ncs differ diff --git a/nwnds_module/ar_t0_pcspawn.nss b/nwnds_module/ar_t0_pcspawn.nss new file mode 100644 index 000000000..30deaf095 --- /dev/null +++ b/nwnds_module/ar_t0_pcspawn.nss @@ -0,0 +1,66 @@ +#include "ar_inc_pcspawn" +#include "ar_db_main" + +void CreateEnterEffect(object oPlayer); + + +void main(){ + + +//add this afer the SubRaceOnenter Call + object oPC = GetEnteringObject(); + if(GetIsDM(oPC)) + { + // object oFirst = GetFirstPC(); + // if(GetIsObjectValid(oFirst)) + // { + // ClearAllActions(); + // AssignCommand(oPC,ActionJumpToObject(oFirst)); + // return; + // } + return; + } + + + //if(GetXP(oPC) == 0)GiveXPToCreature(oPC,3500); + + int bSkipJump = GetLocalInt(oPC,AR_SKIP_ONENTER_JUMP)== 1 ? TRUE: FALSE; + + if(!bSkipJump) // server has reset + { + //Server has reset + DelayCommand(2.0f,CreateEnterEffect(oPC)); + + SkipNextJump(oPC); + int bGoToGray = GetHitDice(oPC) < 3 ? TRUE: FALSE; + if(GetIsPC(oPC) && !GetIsDM(oPC)){ + if (!bGoToGray){ + location lLast = ARSX_GetLastLocation(oPC); + AssignCommand(oPC,ActionJumpToLocation(lLast)); + }} + + }//Server has not reset... + +} + + +void CreateEnterEffect(object oPlayer) +{ + float fDelay = 3.0f; + + int nAlign = GetAlignmentGoodEvil(oPlayer); + if (nAlign == ALIGNMENT_GOOD) + DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), GetLocation(oPlayer))); + else if (nAlign == ALIGNMENT_EVIL) + DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_GATE), GetLocation(oPlayer))); + else + { + switch (d2()) + { + case 1: DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), GetLocation(oPlayer))); + break; + case 2: DelayCommand(fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_GATE), GetLocation(oPlayer))); + break; + } + } +} diff --git a/nwnds_module/ar_table_001.utp b/nwnds_module/ar_table_001.utp new file mode 100644 index 000000000..7c57ea28b Binary files /dev/null and b/nwnds_module/ar_table_001.utp differ diff --git a/nwnds_module/ar_thesentinel.utc b/nwnds_module/ar_thesentinel.utc new file mode 100644 index 000000000..1712d5abe Binary files /dev/null and b/nwnds_module/ar_thesentinel.utc differ diff --git a/nwnds_module/ar_thrown.utm b/nwnds_module/ar_thrown.utm new file mode 100644 index 000000000..48f3e44dd Binary files /dev/null and b/nwnds_module/ar_thrown.utm differ diff --git a/nwnds_module/ar_tiger001.utc b/nwnds_module/ar_tiger001.utc new file mode 100644 index 000000000..2ba1135a7 Binary files /dev/null and b/nwnds_module/ar_tiger001.utc differ diff --git a/nwnds_module/ar_tiger002.utc b/nwnds_module/ar_tiger002.utc new file mode 100644 index 000000000..7ed509985 Binary files /dev/null and b/nwnds_module/ar_tiger002.utc differ diff --git a/nwnds_module/ar_tiger003.utc b/nwnds_module/ar_tiger003.utc new file mode 100644 index 000000000..1f8ed2528 Binary files /dev/null and b/nwnds_module/ar_tiger003.utc differ diff --git a/nwnds_module/ar_tree_001.utp b/nwnds_module/ar_tree_001.utp new file mode 100644 index 000000000..1710cbb23 Binary files /dev/null and b/nwnds_module/ar_tree_001.utp differ diff --git a/nwnds_module/ar_trident_obs01.uti b/nwnds_module/ar_trident_obs01.uti new file mode 100644 index 000000000..a826d5e4f Binary files /dev/null and b/nwnds_module/ar_trident_obs01.uti differ diff --git a/nwnds_module/ar_trident_obs02.uti b/nwnds_module/ar_trident_obs02.uti new file mode 100644 index 000000000..8a18df8c7 Binary files /dev/null and b/nwnds_module/ar_trident_obs02.uti differ diff --git a/nwnds_module/ar_tridents.utm b/nwnds_module/ar_tridents.utm new file mode 100644 index 000000000..61e077cff Binary files /dev/null and b/nwnds_module/ar_tridents.utm differ diff --git a/nwnds_module/ar_trikals.utm b/nwnds_module/ar_trikals.utm new file mode 100644 index 000000000..83d55e23c Binary files /dev/null and b/nwnds_module/ar_trikals.utm differ diff --git a/nwnds_module/ar_tyrslime_001.utc b/nwnds_module/ar_tyrslime_001.utc new file mode 100644 index 000000000..8007ffd2c Binary files /dev/null and b/nwnds_module/ar_tyrslime_001.utc differ diff --git a/nwnds_module/ar_tyrslime_002.utc b/nwnds_module/ar_tyrslime_002.utc new file mode 100644 index 000000000..129a4913c Binary files /dev/null and b/nwnds_module/ar_tyrslime_002.utc differ diff --git a/nwnds_module/ar_tyrslime_003.utc b/nwnds_module/ar_tyrslime_003.utc new file mode 100644 index 000000000..ccfde8a5c Binary files /dev/null and b/nwnds_module/ar_tyrslime_003.utc differ diff --git a/nwnds_module/ar_umberhulk001.utc b/nwnds_module/ar_umberhulk001.utc new file mode 100644 index 000000000..2ff1fb4c3 Binary files /dev/null and b/nwnds_module/ar_umberhulk001.utc differ diff --git a/nwnds_module/ar_umberhulk002.utc b/nwnds_module/ar_umberhulk002.utc new file mode 100644 index 000000000..6e7de1057 Binary files /dev/null and b/nwnds_module/ar_umberhulk002.utc differ diff --git a/nwnds_module/ar_umberhulk003.utc b/nwnds_module/ar_umberhulk003.utc new file mode 100644 index 000000000..d6683c370 Binary files /dev/null and b/nwnds_module/ar_umberhulk003.utc differ diff --git a/nwnds_module/ar_und_onspawn.ncs b/nwnds_module/ar_und_onspawn.ncs new file mode 100644 index 000000000..634e20675 Binary files /dev/null and b/nwnds_module/ar_und_onspawn.ncs differ diff --git a/nwnds_module/ar_und_onspawn.nss b/nwnds_module/ar_und_onspawn.nss new file mode 100644 index 000000000..d5e233dc7 --- /dev/null +++ b/nwnds_module/ar_und_onspawn.nss @@ -0,0 +1,113 @@ +//:://///////////////////////////////////////////// +//:: Undead Spawn: On Spawn In +//:: AR_UND_ONSPAWN +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + + 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 19, 2001 +//::////////////////////////////////////////////// + +#include "prc_alterations" +#include "X0_INC_HENAI" +#include "ms_name_inc" + +void main() +{ + string sTag; + object oNPC; + SetAssociateListenPatterns();//Sets up the special henchmen listening patterns + + bkSetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + + SetAssociateState(NW_ASC_POWER_CASTING); + SetAssociateState(NW_ASC_HEAL_AT_50); + SetAssociateState(NW_ASC_RETRY_OPEN_LOCKS); + SetAssociateState(NW_ASC_DISARM_TRAPS); + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE); + SetAssociateState(NW_ASC_USE_RANGED_WEAPON, FALSE); //User ranged weapons by default if true. + SetAssociateState(NW_ASC_DISTANCE_2_METERS); + + // April 2002: Summoned monsters, associates and familiars need to stay + // further back due to their size. + int nType = GetAssociateType(OBJECT_SELF); + switch (nType) + { + case ASSOCIATE_TYPE_ANIMALCOMPANION: + case ASSOCIATE_TYPE_DOMINATED: + case ASSOCIATE_TYPE_FAMILIAR: + case ASSOCIATE_TYPE_SUMMONED: + SetAssociateState(NW_ASC_DISTANCE_4_METERS); + break; + + } + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master +/* if (GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, GetMaster()) == OBJECT_SELF || + GetAssociate(ASSOCIATE_TYPE_DOMINATED, GetMaster()) == OBJECT_SELF || + GetAssociate(ASSOCIATE_TYPE_FAMILIAR, GetMaster()) == OBJECT_SELF || + GetAssociate(ASSOCIATE_TYPE_SUMMONED, GetMaster()) == OBJECT_SELF) + { + SetAssociateState(NW_ASC_DISTANCE_4_METERS); + } +*/ + // * Feb 2003: Set official campaign henchmen to have no inventory + SetLocalInt(OBJECT_SELF, "X0_L_NOTALLOWEDTOHAVEINVENTORY", 10) ; + + //SetAssociateState(NW_ASC_MODE_DEFEND_MASTER); + SetAssociateStartLocation(); + // SPECIAL CONVERSATION SETTTINGS + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + + ms_Nomenclature(OBJECT_SELF); +} + + diff --git a/nwnds_module/ar_upladder001.ncs b/nwnds_module/ar_upladder001.ncs new file mode 100644 index 000000000..afa414771 Binary files /dev/null and b/nwnds_module/ar_upladder001.ncs differ diff --git a/nwnds_module/ar_upladder001.nss b/nwnds_module/ar_upladder001.nss new file mode 100644 index 000000000..735ebecfc --- /dev/null +++ b/nwnds_module/ar_upladder001.nss @@ -0,0 +1,36 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this script OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +FloatingTextStringOnCreature("'You climb up the ladder'", oPC); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("fromtg"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/ar_visage003.utc b/nwnds_module/ar_visage003.utc new file mode 100644 index 000000000..7da498a38 Binary files /dev/null and b/nwnds_module/ar_visage003.utc differ diff --git a/nwnds_module/ar_wamar_alloy.uti b/nwnds_module/ar_wamar_alloy.uti new file mode 100644 index 000000000..3aaa59c3f Binary files /dev/null and b/nwnds_module/ar_wamar_alloy.uti differ diff --git a/nwnds_module/ar_wamar_bgrass.uti b/nwnds_module/ar_wamar_bgrass.uti new file mode 100644 index 000000000..fa37e9d94 Binary files /dev/null and b/nwnds_module/ar_wamar_bgrass.uti differ diff --git a/nwnds_module/ar_wamar_hamstr.uti b/nwnds_module/ar_wamar_hamstr.uti new file mode 100644 index 000000000..ad29cb74c Binary files /dev/null and b/nwnds_module/ar_wamar_hamstr.uti differ diff --git a/nwnds_module/ar_wamar_hrtskr.uti b/nwnds_module/ar_wamar_hrtskr.uti new file mode 100644 index 000000000..8e72b974d Binary files /dev/null and b/nwnds_module/ar_wamar_hrtskr.uti differ diff --git a/nwnds_module/ar_wamar_iron01.uti b/nwnds_module/ar_wamar_iron01.uti new file mode 100644 index 000000000..23b2de776 Binary files /dev/null and b/nwnds_module/ar_wamar_iron01.uti differ diff --git a/nwnds_module/ar_wamar_ivory.uti b/nwnds_module/ar_wamar_ivory.uti new file mode 100644 index 000000000..2d77b6877 Binary files /dev/null and b/nwnds_module/ar_wamar_ivory.uti differ diff --git a/nwnds_module/ar_wamar_wood.uti b/nwnds_module/ar_wamar_wood.uti new file mode 100644 index 000000000..16e2136d1 Binary files /dev/null and b/nwnds_module/ar_wamar_wood.uti differ diff --git a/nwnds_module/ar_wambo_alloy.uti b/nwnds_module/ar_wambo_alloy.uti new file mode 100644 index 000000000..fd4fdfa3b Binary files /dev/null and b/nwnds_module/ar_wambo_alloy.uti differ diff --git a/nwnds_module/ar_wambo_bgrass.uti b/nwnds_module/ar_wambo_bgrass.uti new file mode 100644 index 000000000..0d16d1be0 Binary files /dev/null and b/nwnds_module/ar_wambo_bgrass.uti differ diff --git a/nwnds_module/ar_wambo_iron01.uti b/nwnds_module/ar_wambo_iron01.uti new file mode 100644 index 000000000..74b4ae46b Binary files /dev/null and b/nwnds_module/ar_wambo_iron01.uti differ diff --git a/nwnds_module/ar_wambo_ivory.uti b/nwnds_module/ar_wambo_ivory.uti new file mode 100644 index 000000000..3e3eb8488 Binary files /dev/null and b/nwnds_module/ar_wambo_ivory.uti differ diff --git a/nwnds_module/ar_wambo_wood.uti b/nwnds_module/ar_wambo_wood.uti new file mode 100644 index 000000000..03b6c84d5 Binary files /dev/null and b/nwnds_module/ar_wambo_wood.uti differ diff --git a/nwnds_module/ar_wambu_alloy.uti b/nwnds_module/ar_wambu_alloy.uti new file mode 100644 index 000000000..375777438 Binary files /dev/null and b/nwnds_module/ar_wambu_alloy.uti differ diff --git a/nwnds_module/ar_wambu_fire02.uti b/nwnds_module/ar_wambu_fire02.uti new file mode 100644 index 000000000..6731299b2 Binary files /dev/null and b/nwnds_module/ar_wambu_fire02.uti differ diff --git a/nwnds_module/ar_wambu_iron01.uti b/nwnds_module/ar_wambu_iron01.uti new file mode 100644 index 000000000..ebf52b1b7 Binary files /dev/null and b/nwnds_module/ar_wambu_iron01.uti differ diff --git a/nwnds_module/ar_wambu_ivory.uti b/nwnds_module/ar_wambu_ivory.uti new file mode 100644 index 000000000..3069bf789 Binary files /dev/null and b/nwnds_module/ar_wambu_ivory.uti differ diff --git a/nwnds_module/ar_wambu_stone.uti b/nwnds_module/ar_wambu_stone.uti new file mode 100644 index 000000000..8a8eadb20 Binary files /dev/null and b/nwnds_module/ar_wambu_stone.uti differ diff --git a/nwnds_module/ar_wambu_zombie.uti b/nwnds_module/ar_wambu_zombie.uti new file mode 100644 index 000000000..4f2d61da8 Binary files /dev/null and b/nwnds_module/ar_wambu_zombie.uti differ diff --git a/nwnds_module/ar_wammar_mystic.uti b/nwnds_module/ar_wammar_mystic.uti new file mode 100644 index 000000000..10efea2bc Binary files /dev/null and b/nwnds_module/ar_wammar_mystic.uti differ diff --git a/nwnds_module/ar_wammar_shadow.uti b/nwnds_module/ar_wammar_shadow.uti new file mode 100644 index 000000000..f2ac07045 Binary files /dev/null and b/nwnds_module/ar_wammar_shadow.uti differ diff --git a/nwnds_module/ar_wammbo_mystic.uti b/nwnds_module/ar_wammbo_mystic.uti new file mode 100644 index 000000000..4238162c6 Binary files /dev/null and b/nwnds_module/ar_wammbo_mystic.uti differ diff --git a/nwnds_module/ar_wammbo_scream.uti b/nwnds_module/ar_wammbo_scream.uti new file mode 100644 index 000000000..fccb6c76e Binary files /dev/null and b/nwnds_module/ar_wammbo_scream.uti differ diff --git a/nwnds_module/ar_wammbo_shadow.uti b/nwnds_module/ar_wammbo_shadow.uti new file mode 100644 index 000000000..2fdf7cdb5 Binary files /dev/null and b/nwnds_module/ar_wammbo_shadow.uti differ diff --git a/nwnds_module/ar_wammbu_giant.uti b/nwnds_module/ar_wammbu_giant.uti new file mode 100644 index 000000000..49398277c Binary files /dev/null and b/nwnds_module/ar_wammbu_giant.uti differ diff --git a/nwnds_module/ar_wammbu_kapow.uti b/nwnds_module/ar_wammbu_kapow.uti new file mode 100644 index 000000000..4b1f428b0 Binary files /dev/null and b/nwnds_module/ar_wammbu_kapow.uti differ diff --git a/nwnds_module/ar_wammbu_shadow.uti b/nwnds_module/ar_wammbu_shadow.uti new file mode 100644 index 000000000..0c08a31e6 Binary files /dev/null and b/nwnds_module/ar_wammbu_shadow.uti differ diff --git a/nwnds_module/ar_wampar_acid01.uti b/nwnds_module/ar_wampar_acid01.uti new file mode 100644 index 000000000..1be3d75f0 Binary files /dev/null and b/nwnds_module/ar_wampar_acid01.uti differ diff --git a/nwnds_module/ar_wampar_elec01.uti b/nwnds_module/ar_wampar_elec01.uti new file mode 100644 index 000000000..fdaa8de39 Binary files /dev/null and b/nwnds_module/ar_wampar_elec01.uti differ diff --git a/nwnds_module/ar_wampar_fire01.uti b/nwnds_module/ar_wampar_fire01.uti new file mode 100644 index 000000000..038ad0362 Binary files /dev/null and b/nwnds_module/ar_wampar_fire01.uti differ diff --git a/nwnds_module/ar_wampar_ice01.uti b/nwnds_module/ar_wampar_ice01.uti new file mode 100644 index 000000000..1267c4371 Binary files /dev/null and b/nwnds_module/ar_wampar_ice01.uti differ diff --git a/nwnds_module/ar_wampbo_acid01.uti b/nwnds_module/ar_wampbo_acid01.uti new file mode 100644 index 000000000..b1f9282f4 Binary files /dev/null and b/nwnds_module/ar_wampbo_acid01.uti differ diff --git a/nwnds_module/ar_wampbo_acid02.uti b/nwnds_module/ar_wampbo_acid02.uti new file mode 100644 index 000000000..02ce99879 Binary files /dev/null and b/nwnds_module/ar_wampbo_acid02.uti differ diff --git a/nwnds_module/ar_wampbo_elec01.uti b/nwnds_module/ar_wampbo_elec01.uti new file mode 100644 index 000000000..5139f08c9 Binary files /dev/null and b/nwnds_module/ar_wampbo_elec01.uti differ diff --git a/nwnds_module/ar_wampbo_fire01.uti b/nwnds_module/ar_wampbo_fire01.uti new file mode 100644 index 000000000..507040d4e Binary files /dev/null and b/nwnds_module/ar_wampbo_fire01.uti differ diff --git a/nwnds_module/ar_wampbo_ice01.uti b/nwnds_module/ar_wampbo_ice01.uti new file mode 100644 index 000000000..f56e4e68e Binary files /dev/null and b/nwnds_module/ar_wampbo_ice01.uti differ diff --git a/nwnds_module/ar_wampbu_acid01.uti b/nwnds_module/ar_wampbu_acid01.uti new file mode 100644 index 000000000..a42b6f402 Binary files /dev/null and b/nwnds_module/ar_wampbu_acid01.uti differ diff --git a/nwnds_module/ar_wampbu_elec01.uti b/nwnds_module/ar_wampbu_elec01.uti new file mode 100644 index 000000000..81657c8f2 Binary files /dev/null and b/nwnds_module/ar_wampbu_elec01.uti differ diff --git a/nwnds_module/ar_wampbu_fire01.uti b/nwnds_module/ar_wampbu_fire01.uti new file mode 100644 index 000000000..2bfc5a3e8 Binary files /dev/null and b/nwnds_module/ar_wampbu_fire01.uti differ diff --git a/nwnds_module/ar_wampbu_ice01.uti b/nwnds_module/ar_wampbu_ice01.uti new file mode 100644 index 000000000..1d0d40c33 Binary files /dev/null and b/nwnds_module/ar_wampbu_ice01.uti differ diff --git a/nwnds_module/ar_wands.utm b/nwnds_module/ar_wands.utm new file mode 100644 index 000000000..4e9de7bfb Binary files /dev/null and b/nwnds_module/ar_wands.utm differ diff --git a/nwnds_module/ar_waraxes.utm b/nwnds_module/ar_waraxes.utm new file mode 100644 index 000000000..7a69c4623 Binary files /dev/null and b/nwnds_module/ar_waraxes.utm differ diff --git a/nwnds_module/ar_warhammers.utm b/nwnds_module/ar_warhammers.utm new file mode 100644 index 000000000..282a0aca7 Binary files /dev/null and b/nwnds_module/ar_warhammers.utm differ diff --git a/nwnds_module/ar_warwr_obs01.uti b/nwnds_module/ar_warwr_obs01.uti new file mode 100644 index 000000000..a5d40c45b Binary files /dev/null and b/nwnds_module/ar_warwr_obs01.uti differ diff --git a/nwnds_module/ar_warwr_obs02.uti b/nwnds_module/ar_warwr_obs02.uti new file mode 100644 index 000000000..2bc2e19d2 Binary files /dev/null and b/nwnds_module/ar_warwr_obs02.uti differ diff --git a/nwnds_module/ar_waxbt_alloy.uti b/nwnds_module/ar_waxbt_alloy.uti new file mode 100644 index 000000000..bb6a87826 Binary files /dev/null and b/nwnds_module/ar_waxbt_alloy.uti differ diff --git a/nwnds_module/ar_waxbt_iron01.uti b/nwnds_module/ar_waxbt_iron01.uti new file mode 100644 index 000000000..56e261003 Binary files /dev/null and b/nwnds_module/ar_waxbt_iron01.uti differ diff --git a/nwnds_module/ar_waxbt_ivory.uti b/nwnds_module/ar_waxbt_ivory.uti new file mode 100644 index 000000000..ae7b45efa Binary files /dev/null and b/nwnds_module/ar_waxbt_ivory.uti differ diff --git a/nwnds_module/ar_waxbt_obs01.uti b/nwnds_module/ar_waxbt_obs01.uti new file mode 100644 index 000000000..455490b4f Binary files /dev/null and b/nwnds_module/ar_waxbt_obs01.uti differ diff --git a/nwnds_module/ar_waxbt_obs02.uti b/nwnds_module/ar_waxbt_obs02.uti new file mode 100644 index 000000000..343b4c53b Binary files /dev/null and b/nwnds_module/ar_waxbt_obs02.uti differ diff --git a/nwnds_module/ar_waxbt_rckstem.uti b/nwnds_module/ar_waxbt_rckstem.uti new file mode 100644 index 000000000..448103f12 Binary files /dev/null and b/nwnds_module/ar_waxbt_rckstem.uti differ diff --git a/nwnds_module/ar_waxgr_alloy.uti b/nwnds_module/ar_waxgr_alloy.uti new file mode 100644 index 000000000..02b0af894 Binary files /dev/null and b/nwnds_module/ar_waxgr_alloy.uti differ diff --git a/nwnds_module/ar_waxgr_iron01.uti b/nwnds_module/ar_waxgr_iron01.uti new file mode 100644 index 000000000..2ad9354b1 Binary files /dev/null and b/nwnds_module/ar_waxgr_iron01.uti differ diff --git a/nwnds_module/ar_waxgr_ivory.uti b/nwnds_module/ar_waxgr_ivory.uti new file mode 100644 index 000000000..13bed8e9c Binary files /dev/null and b/nwnds_module/ar_waxgr_ivory.uti differ diff --git a/nwnds_module/ar_waxgr_obs01.uti b/nwnds_module/ar_waxgr_obs01.uti new file mode 100644 index 000000000..7787171a1 Binary files /dev/null and b/nwnds_module/ar_waxgr_obs01.uti differ diff --git a/nwnds_module/ar_waxgr_obs02.uti b/nwnds_module/ar_waxgr_obs02.uti new file mode 100644 index 000000000..25c3913bb Binary files /dev/null and b/nwnds_module/ar_waxgr_obs02.uti differ diff --git a/nwnds_module/ar_waxgr_rckstm.uti b/nwnds_module/ar_waxgr_rckstm.uti new file mode 100644 index 000000000..b47772d49 Binary files /dev/null and b/nwnds_module/ar_waxgr_rckstm.uti differ diff --git a/nwnds_module/ar_waxhn_alloy.uti b/nwnds_module/ar_waxhn_alloy.uti new file mode 100644 index 000000000..0cbafc23a Binary files /dev/null and b/nwnds_module/ar_waxhn_alloy.uti differ diff --git a/nwnds_module/ar_waxhn_iron01.uti b/nwnds_module/ar_waxhn_iron01.uti new file mode 100644 index 000000000..44eec2b2e Binary files /dev/null and b/nwnds_module/ar_waxhn_iron01.uti differ diff --git a/nwnds_module/ar_waxhn_ivory.uti b/nwnds_module/ar_waxhn_ivory.uti new file mode 100644 index 000000000..161a2b601 Binary files /dev/null and b/nwnds_module/ar_waxhn_ivory.uti differ diff --git a/nwnds_module/ar_waxhn_obs01.uti b/nwnds_module/ar_waxhn_obs01.uti new file mode 100644 index 000000000..b26401cb4 Binary files /dev/null and b/nwnds_module/ar_waxhn_obs01.uti differ diff --git a/nwnds_module/ar_waxhn_obs02.uti b/nwnds_module/ar_waxhn_obs02.uti new file mode 100644 index 000000000..97b18aa64 Binary files /dev/null and b/nwnds_module/ar_waxhn_obs02.uti differ diff --git a/nwnds_module/ar_waxhn_rckstem.uti b/nwnds_module/ar_waxhn_rckstem.uti new file mode 100644 index 000000000..386c0e3bd Binary files /dev/null and b/nwnds_module/ar_waxhn_rckstem.uti differ diff --git a/nwnds_module/ar_waxmbt_baals.uti b/nwnds_module/ar_waxmbt_baals.uti new file mode 100644 index 000000000..f0ac39aad Binary files /dev/null and b/nwnds_module/ar_waxmbt_baals.uti differ diff --git a/nwnds_module/ar_waxmbt_crygar.uti b/nwnds_module/ar_waxmbt_crygar.uti new file mode 100644 index 000000000..e23eeb301 Binary files /dev/null and b/nwnds_module/ar_waxmbt_crygar.uti differ diff --git a/nwnds_module/ar_waxmbt_defile.uti b/nwnds_module/ar_waxmbt_defile.uti new file mode 100644 index 000000000..2d123785a Binary files /dev/null and b/nwnds_module/ar_waxmbt_defile.uti differ diff --git a/nwnds_module/ar_waxmbt_forgot.uti b/nwnds_module/ar_waxmbt_forgot.uti new file mode 100644 index 000000000..3d84cedc6 Binary files /dev/null and b/nwnds_module/ar_waxmbt_forgot.uti differ diff --git a/nwnds_module/ar_waxmbt_hades.uti b/nwnds_module/ar_waxmbt_hades.uti new file mode 100644 index 000000000..05ee77486 Binary files /dev/null and b/nwnds_module/ar_waxmbt_hades.uti differ diff --git a/nwnds_module/ar_waxmbt_hells.uti b/nwnds_module/ar_waxmbt_hells.uti new file mode 100644 index 000000000..89e4e3934 Binary files /dev/null and b/nwnds_module/ar_waxmbt_hells.uti differ diff --git a/nwnds_module/ar_waxmgr_atheat.uti b/nwnds_module/ar_waxmgr_atheat.uti new file mode 100644 index 000000000..4c2c27cc4 Binary files /dev/null and b/nwnds_module/ar_waxmgr_atheat.uti differ diff --git a/nwnds_module/ar_waxmgr_atrocl.uti b/nwnds_module/ar_waxmgr_atrocl.uti new file mode 100644 index 000000000..751447d56 Binary files /dev/null and b/nwnds_module/ar_waxmgr_atrocl.uti differ diff --git a/nwnds_module/ar_waxmgr_banshe.uti b/nwnds_module/ar_waxmgr_banshe.uti new file mode 100644 index 000000000..9eec42324 Binary files /dev/null and b/nwnds_module/ar_waxmgr_banshe.uti differ diff --git a/nwnds_module/ar_waxmgr_demon.uti b/nwnds_module/ar_waxmgr_demon.uti new file mode 100644 index 000000000..8c15434c7 Binary files /dev/null and b/nwnds_module/ar_waxmgr_demon.uti differ diff --git a/nwnds_module/ar_waxmgr_ekairs.uti b/nwnds_module/ar_waxmgr_ekairs.uti new file mode 100644 index 000000000..6bfef73b7 Binary files /dev/null and b/nwnds_module/ar_waxmgr_ekairs.uti differ diff --git a/nwnds_module/ar_waxmgr_forwin.uti b/nwnds_module/ar_waxmgr_forwin.uti new file mode 100644 index 000000000..518592642 Binary files /dev/null and b/nwnds_module/ar_waxmgr_forwin.uti differ diff --git a/nwnds_module/ar_waxmgr_kguard.uti b/nwnds_module/ar_waxmgr_kguard.uti new file mode 100644 index 000000000..a92160344 Binary files /dev/null and b/nwnds_module/ar_waxmgr_kguard.uti differ diff --git a/nwnds_module/ar_waxmgr_nightm.uti b/nwnds_module/ar_waxmgr_nightm.uti new file mode 100644 index 000000000..18215ad76 Binary files /dev/null and b/nwnds_module/ar_waxmgr_nightm.uti differ diff --git a/nwnds_module/ar_waxmgr_raal.uti b/nwnds_module/ar_waxmgr_raal.uti new file mode 100644 index 000000000..200847ee1 Binary files /dev/null and b/nwnds_module/ar_waxmgr_raal.uti differ diff --git a/nwnds_module/ar_waxmgr_theft.uti b/nwnds_module/ar_waxmgr_theft.uti new file mode 100644 index 000000000..3a1214ebc Binary files /dev/null and b/nwnds_module/ar_waxmgr_theft.uti differ diff --git a/nwnds_module/ar_waxmgr_tootha.uti b/nwnds_module/ar_waxmgr_tootha.uti new file mode 100644 index 000000000..198d645e2 Binary files /dev/null and b/nwnds_module/ar_waxmgr_tootha.uti differ diff --git a/nwnds_module/ar_waxmgr_toothe.uti b/nwnds_module/ar_waxmgr_toothe.uti new file mode 100644 index 000000000..634c527d9 Binary files /dev/null and b/nwnds_module/ar_waxmgr_toothe.uti differ diff --git a/nwnds_module/ar_waxmgr_toothf.uti b/nwnds_module/ar_waxmgr_toothf.uti new file mode 100644 index 000000000..01123b92f Binary files /dev/null and b/nwnds_module/ar_waxmgr_toothf.uti differ diff --git a/nwnds_module/ar_waxmgr_toothw.uti b/nwnds_module/ar_waxmgr_toothw.uti new file mode 100644 index 000000000..ebcd5908f Binary files /dev/null and b/nwnds_module/ar_waxmgr_toothw.uti differ diff --git a/nwnds_module/ar_waxmgr_winpre.uti b/nwnds_module/ar_waxmgr_winpre.uti new file mode 100644 index 000000000..180789625 Binary files /dev/null and b/nwnds_module/ar_waxmgr_winpre.uti differ diff --git a/nwnds_module/ar_waxmhn_faro.uti b/nwnds_module/ar_waxmhn_faro.uti new file mode 100644 index 000000000..0b865fae7 Binary files /dev/null and b/nwnds_module/ar_waxmhn_faro.uti differ diff --git a/nwnds_module/ar_waxmhn_thax.uti b/nwnds_module/ar_waxmhn_thax.uti new file mode 100644 index 000000000..7abc3c058 Binary files /dev/null and b/nwnds_module/ar_waxmhn_thax.uti differ diff --git a/nwnds_module/ar_waxmhn_toxic.uti b/nwnds_module/ar_waxmhn_toxic.uti new file mode 100644 index 000000000..6ff25b922 Binary files /dev/null and b/nwnds_module/ar_waxmhn_toxic.uti differ diff --git a/nwnds_module/ar_waxmwk_pestil.uti b/nwnds_module/ar_waxmwk_pestil.uti new file mode 100644 index 000000000..2a02aa2ce Binary files /dev/null and b/nwnds_module/ar_waxmwk_pestil.uti differ diff --git a/nwnds_module/ar_waxmwk_shival.uti b/nwnds_module/ar_waxmwk_shival.uti new file mode 100644 index 000000000..3c9e3a184 Binary files /dev/null and b/nwnds_module/ar_waxmwk_shival.uti differ diff --git a/nwnds_module/ar_waxmwr_frozen.uti b/nwnds_module/ar_waxmwr_frozen.uti new file mode 100644 index 000000000..ada18c881 Binary files /dev/null and b/nwnds_module/ar_waxmwr_frozen.uti differ diff --git a/nwnds_module/ar_waxmwr_giftel.uti b/nwnds_module/ar_waxmwr_giftel.uti new file mode 100644 index 000000000..127fc4bf7 Binary files /dev/null and b/nwnds_module/ar_waxmwr_giftel.uti differ diff --git a/nwnds_module/ar_waxmwr_helmg.uti b/nwnds_module/ar_waxmwr_helmg.uti new file mode 100644 index 000000000..8f5f5f904 Binary files /dev/null and b/nwnds_module/ar_waxmwr_helmg.uti differ diff --git a/nwnds_module/ar_waxmwr_justls.uti b/nwnds_module/ar_waxmwr_justls.uti new file mode 100644 index 000000000..28a9d4c7f Binary files /dev/null and b/nwnds_module/ar_waxmwr_justls.uti differ diff --git a/nwnds_module/ar_waxmwr_kaels.uti b/nwnds_module/ar_waxmwr_kaels.uti new file mode 100644 index 000000000..5a3c49c23 Binary files /dev/null and b/nwnds_module/ar_waxmwr_kaels.uti differ diff --git a/nwnds_module/ar_waxmwr_kingsv.uti b/nwnds_module/ar_waxmwr_kingsv.uti new file mode 100644 index 000000000..48bbb7deb Binary files /dev/null and b/nwnds_module/ar_waxmwr_kingsv.uti differ diff --git a/nwnds_module/ar_waxmwr_kled.uti b/nwnds_module/ar_waxmwr_kled.uti new file mode 100644 index 000000000..ebe595375 Binary files /dev/null and b/nwnds_module/ar_waxmwr_kled.uti differ diff --git a/nwnds_module/ar_waxmwr_sunslh.uti b/nwnds_module/ar_waxmwr_sunslh.uti new file mode 100644 index 000000000..0fe825e20 Binary files /dev/null and b/nwnds_module/ar_waxmwr_sunslh.uti differ diff --git a/nwnds_module/ar_waxmwr_urham.uti b/nwnds_module/ar_waxmwr_urham.uti new file mode 100644 index 000000000..9ea1e2f04 Binary files /dev/null and b/nwnds_module/ar_waxmwr_urham.uti differ diff --git a/nwnds_module/ar_waxpbt_acid01.uti b/nwnds_module/ar_waxpbt_acid01.uti new file mode 100644 index 000000000..f4a31d28b Binary files /dev/null and b/nwnds_module/ar_waxpbt_acid01.uti differ diff --git a/nwnds_module/ar_waxpbt_acid02.uti b/nwnds_module/ar_waxpbt_acid02.uti new file mode 100644 index 000000000..52328fc99 Binary files /dev/null and b/nwnds_module/ar_waxpbt_acid02.uti differ diff --git a/nwnds_module/ar_waxpbt_elec01.uti b/nwnds_module/ar_waxpbt_elec01.uti new file mode 100644 index 000000000..ca13ef159 Binary files /dev/null and b/nwnds_module/ar_waxpbt_elec01.uti differ diff --git a/nwnds_module/ar_waxpbt_elec02.uti b/nwnds_module/ar_waxpbt_elec02.uti new file mode 100644 index 000000000..96ba912fc Binary files /dev/null and b/nwnds_module/ar_waxpbt_elec02.uti differ diff --git a/nwnds_module/ar_waxpbt_fire01.uti b/nwnds_module/ar_waxpbt_fire01.uti new file mode 100644 index 000000000..5b2b5d5ec Binary files /dev/null and b/nwnds_module/ar_waxpbt_fire01.uti differ diff --git a/nwnds_module/ar_waxpbt_fire02.uti b/nwnds_module/ar_waxpbt_fire02.uti new file mode 100644 index 000000000..d229e8b18 Binary files /dev/null and b/nwnds_module/ar_waxpbt_fire02.uti differ diff --git a/nwnds_module/ar_waxpbt_ice01.uti b/nwnds_module/ar_waxpbt_ice01.uti new file mode 100644 index 000000000..a6c8a0f18 Binary files /dev/null and b/nwnds_module/ar_waxpbt_ice01.uti differ diff --git a/nwnds_module/ar_waxpbt_ice02.uti b/nwnds_module/ar_waxpbt_ice02.uti new file mode 100644 index 000000000..521e8a202 Binary files /dev/null and b/nwnds_module/ar_waxpbt_ice02.uti differ diff --git a/nwnds_module/ar_waxpbt_norkum.uti b/nwnds_module/ar_waxpbt_norkum.uti new file mode 100644 index 000000000..18b6acc4d Binary files /dev/null and b/nwnds_module/ar_waxpbt_norkum.uti differ diff --git a/nwnds_module/ar_waxpbt_urikhg.uti b/nwnds_module/ar_waxpbt_urikhg.uti new file mode 100644 index 000000000..3b81c19e5 Binary files /dev/null and b/nwnds_module/ar_waxpbt_urikhg.uti differ diff --git a/nwnds_module/ar_waxpgr_acid01.uti b/nwnds_module/ar_waxpgr_acid01.uti new file mode 100644 index 000000000..20888e538 Binary files /dev/null and b/nwnds_module/ar_waxpgr_acid01.uti differ diff --git a/nwnds_module/ar_waxpgr_acid02.uti b/nwnds_module/ar_waxpgr_acid02.uti new file mode 100644 index 000000000..ce7dd07c2 Binary files /dev/null and b/nwnds_module/ar_waxpgr_acid02.uti differ diff --git a/nwnds_module/ar_waxpgr_denar.uti b/nwnds_module/ar_waxpgr_denar.uti new file mode 100644 index 000000000..ffac2d8cb Binary files /dev/null and b/nwnds_module/ar_waxpgr_denar.uti differ diff --git a/nwnds_module/ar_waxpgr_elec01.uti b/nwnds_module/ar_waxpgr_elec01.uti new file mode 100644 index 000000000..fc53075d0 Binary files /dev/null and b/nwnds_module/ar_waxpgr_elec01.uti differ diff --git a/nwnds_module/ar_waxpgr_elec02.uti b/nwnds_module/ar_waxpgr_elec02.uti new file mode 100644 index 000000000..d97fe3f73 Binary files /dev/null and b/nwnds_module/ar_waxpgr_elec02.uti differ diff --git a/nwnds_module/ar_waxpgr_fire01.uti b/nwnds_module/ar_waxpgr_fire01.uti new file mode 100644 index 000000000..bc571dbe9 Binary files /dev/null and b/nwnds_module/ar_waxpgr_fire01.uti differ diff --git a/nwnds_module/ar_waxpgr_fire02.uti b/nwnds_module/ar_waxpgr_fire02.uti new file mode 100644 index 000000000..69a22c7a7 Binary files /dev/null and b/nwnds_module/ar_waxpgr_fire02.uti differ diff --git a/nwnds_module/ar_waxpgr_fire03.uti b/nwnds_module/ar_waxpgr_fire03.uti new file mode 100644 index 000000000..db01a3928 Binary files /dev/null and b/nwnds_module/ar_waxpgr_fire03.uti differ diff --git a/nwnds_module/ar_waxpgr_ice01.uti b/nwnds_module/ar_waxpgr_ice01.uti new file mode 100644 index 000000000..80fc602d5 Binary files /dev/null and b/nwnds_module/ar_waxpgr_ice01.uti differ diff --git a/nwnds_module/ar_waxpgr_ice02.uti b/nwnds_module/ar_waxpgr_ice02.uti new file mode 100644 index 000000000..7f6754c98 Binary files /dev/null and b/nwnds_module/ar_waxpgr_ice02.uti differ diff --git a/nwnds_module/ar_waxphn_acid01.uti b/nwnds_module/ar_waxphn_acid01.uti new file mode 100644 index 000000000..cdfd4cb41 Binary files /dev/null and b/nwnds_module/ar_waxphn_acid01.uti differ diff --git a/nwnds_module/ar_waxphn_acid02.uti b/nwnds_module/ar_waxphn_acid02.uti new file mode 100644 index 000000000..5ec5edbf6 Binary files /dev/null and b/nwnds_module/ar_waxphn_acid02.uti differ diff --git a/nwnds_module/ar_waxphn_elec01.uti b/nwnds_module/ar_waxphn_elec01.uti new file mode 100644 index 000000000..4faffdca2 Binary files /dev/null and b/nwnds_module/ar_waxphn_elec01.uti differ diff --git a/nwnds_module/ar_waxphn_elec02.uti b/nwnds_module/ar_waxphn_elec02.uti new file mode 100644 index 000000000..10f4b1fc4 Binary files /dev/null and b/nwnds_module/ar_waxphn_elec02.uti differ diff --git a/nwnds_module/ar_waxphn_fire01.uti b/nwnds_module/ar_waxphn_fire01.uti new file mode 100644 index 000000000..6bba4cfe4 Binary files /dev/null and b/nwnds_module/ar_waxphn_fire01.uti differ diff --git a/nwnds_module/ar_waxphn_fire02.uti b/nwnds_module/ar_waxphn_fire02.uti new file mode 100644 index 000000000..f0ef49858 Binary files /dev/null and b/nwnds_module/ar_waxphn_fire02.uti differ diff --git a/nwnds_module/ar_waxphn_ice01.uti b/nwnds_module/ar_waxphn_ice01.uti new file mode 100644 index 000000000..a4e8d3703 Binary files /dev/null and b/nwnds_module/ar_waxphn_ice01.uti differ diff --git a/nwnds_module/ar_waxphn_ice02.uti b/nwnds_module/ar_waxphn_ice02.uti new file mode 100644 index 000000000..15cdd8882 Binary files /dev/null and b/nwnds_module/ar_waxphn_ice02.uti differ diff --git a/nwnds_module/ar_waxpwk_acid01.uti b/nwnds_module/ar_waxpwk_acid01.uti new file mode 100644 index 000000000..aed29dfd3 Binary files /dev/null and b/nwnds_module/ar_waxpwk_acid01.uti differ diff --git a/nwnds_module/ar_waxpwk_acid02.uti b/nwnds_module/ar_waxpwk_acid02.uti new file mode 100644 index 000000000..c2fc0e5d2 Binary files /dev/null and b/nwnds_module/ar_waxpwk_acid02.uti differ diff --git a/nwnds_module/ar_waxpwk_elec01.uti b/nwnds_module/ar_waxpwk_elec01.uti new file mode 100644 index 000000000..e02de1caf Binary files /dev/null and b/nwnds_module/ar_waxpwk_elec01.uti differ diff --git a/nwnds_module/ar_waxpwk_elec02.uti b/nwnds_module/ar_waxpwk_elec02.uti new file mode 100644 index 000000000..41f859d27 Binary files /dev/null and b/nwnds_module/ar_waxpwk_elec02.uti differ diff --git a/nwnds_module/ar_waxpwk_fire01.uti b/nwnds_module/ar_waxpwk_fire01.uti new file mode 100644 index 000000000..ed2ecb232 Binary files /dev/null and b/nwnds_module/ar_waxpwk_fire01.uti differ diff --git a/nwnds_module/ar_waxpwk_fire02.uti b/nwnds_module/ar_waxpwk_fire02.uti new file mode 100644 index 000000000..6c86a6179 Binary files /dev/null and b/nwnds_module/ar_waxpwk_fire02.uti differ diff --git a/nwnds_module/ar_waxpwk_ice01.uti b/nwnds_module/ar_waxpwk_ice01.uti new file mode 100644 index 000000000..00fc2e526 Binary files /dev/null and b/nwnds_module/ar_waxpwk_ice01.uti differ diff --git a/nwnds_module/ar_waxpwk_ice02.uti b/nwnds_module/ar_waxpwk_ice02.uti new file mode 100644 index 000000000..77ca5cd37 Binary files /dev/null and b/nwnds_module/ar_waxpwk_ice02.uti differ diff --git a/nwnds_module/ar_waxpwk_imbued.uti b/nwnds_module/ar_waxpwk_imbued.uti new file mode 100644 index 000000000..9d0c0d16d Binary files /dev/null and b/nwnds_module/ar_waxpwk_imbued.uti differ diff --git a/nwnds_module/ar_waxpwr_acid01.uti b/nwnds_module/ar_waxpwr_acid01.uti new file mode 100644 index 000000000..fbbcdc0ac Binary files /dev/null and b/nwnds_module/ar_waxpwr_acid01.uti differ diff --git a/nwnds_module/ar_waxpwr_acid02.uti b/nwnds_module/ar_waxpwr_acid02.uti new file mode 100644 index 000000000..ac050f405 Binary files /dev/null and b/nwnds_module/ar_waxpwr_acid02.uti differ diff --git a/nwnds_module/ar_waxpwr_elec01.uti b/nwnds_module/ar_waxpwr_elec01.uti new file mode 100644 index 000000000..d98156957 Binary files /dev/null and b/nwnds_module/ar_waxpwr_elec01.uti differ diff --git a/nwnds_module/ar_waxpwr_elec02.uti b/nwnds_module/ar_waxpwr_elec02.uti new file mode 100644 index 000000000..f352f390b Binary files /dev/null and b/nwnds_module/ar_waxpwr_elec02.uti differ diff --git a/nwnds_module/ar_waxpwr_fire01.uti b/nwnds_module/ar_waxpwr_fire01.uti new file mode 100644 index 000000000..8dad0fcdd Binary files /dev/null and b/nwnds_module/ar_waxpwr_fire01.uti differ diff --git a/nwnds_module/ar_waxpwr_fire02.uti b/nwnds_module/ar_waxpwr_fire02.uti new file mode 100644 index 000000000..f5f3b2ac4 Binary files /dev/null and b/nwnds_module/ar_waxpwr_fire02.uti differ diff --git a/nwnds_module/ar_waxpwr_ice01.uti b/nwnds_module/ar_waxpwr_ice01.uti new file mode 100644 index 000000000..508eddc3a Binary files /dev/null and b/nwnds_module/ar_waxpwr_ice01.uti differ diff --git a/nwnds_module/ar_waxpwr_ice02.uti b/nwnds_module/ar_waxpwr_ice02.uti new file mode 100644 index 000000000..60620a04c Binary files /dev/null and b/nwnds_module/ar_waxpwr_ice02.uti differ diff --git a/nwnds_module/ar_waxwk_ivory.uti b/nwnds_module/ar_waxwk_ivory.uti new file mode 100644 index 000000000..62dafa2f5 Binary files /dev/null and b/nwnds_module/ar_waxwk_ivory.uti differ diff --git a/nwnds_module/ar_waxwk_obs01.uti b/nwnds_module/ar_waxwk_obs01.uti new file mode 100644 index 000000000..27ce1f90c Binary files /dev/null and b/nwnds_module/ar_waxwk_obs01.uti differ diff --git a/nwnds_module/ar_waxwk_obs02.uti b/nwnds_module/ar_waxwk_obs02.uti new file mode 100644 index 000000000..c93d58c85 Binary files /dev/null and b/nwnds_module/ar_waxwk_obs02.uti differ diff --git a/nwnds_module/ar_waxwr_alloy.uti b/nwnds_module/ar_waxwr_alloy.uti new file mode 100644 index 000000000..b2428f41e Binary files /dev/null and b/nwnds_module/ar_waxwr_alloy.uti differ diff --git a/nwnds_module/ar_waxwr_dew.uti b/nwnds_module/ar_waxwr_dew.uti new file mode 100644 index 000000000..369c0adf8 Binary files /dev/null and b/nwnds_module/ar_waxwr_dew.uti differ diff --git a/nwnds_module/ar_waxwr_iron01.uti b/nwnds_module/ar_waxwr_iron01.uti new file mode 100644 index 000000000..5f35e0778 Binary files /dev/null and b/nwnds_module/ar_waxwr_iron01.uti differ diff --git a/nwnds_module/ar_waxwr_ivory.uti b/nwnds_module/ar_waxwr_ivory.uti new file mode 100644 index 000000000..750321a62 Binary files /dev/null and b/nwnds_module/ar_waxwr_ivory.uti differ diff --git a/nwnds_module/ar_waxwr_rckstm.uti b/nwnds_module/ar_waxwr_rckstm.uti new file mode 100644 index 000000000..45aa9f538 Binary files /dev/null and b/nwnds_module/ar_waxwr_rckstm.uti differ diff --git a/nwnds_module/ar_wbcl_braxat.uti b/nwnds_module/ar_wbcl_braxat.uti new file mode 100644 index 000000000..c0e3d43cd Binary files /dev/null and b/nwnds_module/ar_wbcl_braxat.uti differ diff --git a/nwnds_module/ar_wbcl_giant001.uti b/nwnds_module/ar_wbcl_giant001.uti new file mode 100644 index 000000000..944191397 Binary files /dev/null and b/nwnds_module/ar_wbcl_giant001.uti differ diff --git a/nwnds_module/ar_wblak_bone01.uti b/nwnds_module/ar_wblak_bone01.uti new file mode 100644 index 000000000..f85ebe7b6 Binary files /dev/null and b/nwnds_module/ar_wblak_bone01.uti differ diff --git a/nwnds_module/ar_wblal_bone01.uti b/nwnds_module/ar_wblal_bone01.uti new file mode 100644 index 000000000..55d8ab7a2 Binary files /dev/null and b/nwnds_module/ar_wblal_bone01.uti differ diff --git a/nwnds_module/ar_wblcl_alloy.uti b/nwnds_module/ar_wblcl_alloy.uti new file mode 100644 index 000000000..422f0ba27 Binary files /dev/null and b/nwnds_module/ar_wblcl_alloy.uti differ diff --git a/nwnds_module/ar_wblcl_iron01.uti b/nwnds_module/ar_wblcl_iron01.uti new file mode 100644 index 000000000..5344685ea Binary files /dev/null and b/nwnds_module/ar_wblcl_iron01.uti differ diff --git a/nwnds_module/ar_wblcl_ivory.uti b/nwnds_module/ar_wblcl_ivory.uti new file mode 100644 index 000000000..2a9c94d0e Binary files /dev/null and b/nwnds_module/ar_wblcl_ivory.uti differ diff --git a/nwnds_module/ar_wblcl_pgiant.uti b/nwnds_module/ar_wblcl_pgiant.uti new file mode 100644 index 000000000..e437753dd Binary files /dev/null and b/nwnds_module/ar_wblcl_pgiant.uti differ diff --git a/nwnds_module/ar_wblcl_sing01.uti b/nwnds_module/ar_wblcl_sing01.uti new file mode 100644 index 000000000..24096cb6a Binary files /dev/null and b/nwnds_module/ar_wblcl_sing01.uti differ diff --git a/nwnds_module/ar_wblcl_sing02.uti b/nwnds_module/ar_wblcl_sing02.uti new file mode 100644 index 000000000..653516b46 Binary files /dev/null and b/nwnds_module/ar_wblcl_sing02.uti differ diff --git a/nwnds_module/ar_wblcl_tulk001.uti b/nwnds_module/ar_wblcl_tulk001.uti new file mode 100644 index 000000000..723073ce3 Binary files /dev/null and b/nwnds_module/ar_wblcl_tulk001.uti differ diff --git a/nwnds_module/ar_wblcl_wood.uti b/nwnds_module/ar_wblcl_wood.uti new file mode 100644 index 000000000..14132e3d4 Binary files /dev/null and b/nwnds_module/ar_wblcl_wood.uti differ diff --git a/nwnds_module/ar_wblfh_alloy.uti b/nwnds_module/ar_wblfh_alloy.uti new file mode 100644 index 000000000..ea6a3929e Binary files /dev/null and b/nwnds_module/ar_wblfh_alloy.uti differ diff --git a/nwnds_module/ar_wblfh_bone01.uti b/nwnds_module/ar_wblfh_bone01.uti new file mode 100644 index 000000000..32b121d45 Binary files /dev/null and b/nwnds_module/ar_wblfh_bone01.uti differ diff --git a/nwnds_module/ar_wblfh_iron01.uti b/nwnds_module/ar_wblfh_iron01.uti new file mode 100644 index 000000000..997e208e3 Binary files /dev/null and b/nwnds_module/ar_wblfh_iron01.uti differ diff --git a/nwnds_module/ar_wblfh_ivory.uti b/nwnds_module/ar_wblfh_ivory.uti new file mode 100644 index 000000000..ac94332c4 Binary files /dev/null and b/nwnds_module/ar_wblfh_ivory.uti differ diff --git a/nwnds_module/ar_wblfh_obs01.uti b/nwnds_module/ar_wblfh_obs01.uti new file mode 100644 index 000000000..3e9a3c0f0 Binary files /dev/null and b/nwnds_module/ar_wblfh_obs01.uti differ diff --git a/nwnds_module/ar_wblfh_obs02.uti b/nwnds_module/ar_wblfh_obs02.uti new file mode 100644 index 000000000..39e1345f9 Binary files /dev/null and b/nwnds_module/ar_wblfh_obs02.uti differ diff --git a/nwnds_module/ar_wblfl_alloy.uti b/nwnds_module/ar_wblfl_alloy.uti new file mode 100644 index 000000000..89443726c Binary files /dev/null and b/nwnds_module/ar_wblfl_alloy.uti differ diff --git a/nwnds_module/ar_wblfl_bone01.uti b/nwnds_module/ar_wblfl_bone01.uti new file mode 100644 index 000000000..3a76de750 Binary files /dev/null and b/nwnds_module/ar_wblfl_bone01.uti differ diff --git a/nwnds_module/ar_wblfl_iron01.uti b/nwnds_module/ar_wblfl_iron01.uti new file mode 100644 index 000000000..4223c2c69 Binary files /dev/null and b/nwnds_module/ar_wblfl_iron01.uti differ diff --git a/nwnds_module/ar_wblfl_ivory.uti b/nwnds_module/ar_wblfl_ivory.uti new file mode 100644 index 000000000..78d0eed03 Binary files /dev/null and b/nwnds_module/ar_wblfl_ivory.uti differ diff --git a/nwnds_module/ar_wblfl_obs01.uti b/nwnds_module/ar_wblfl_obs01.uti new file mode 100644 index 000000000..561288193 Binary files /dev/null and b/nwnds_module/ar_wblfl_obs01.uti differ diff --git a/nwnds_module/ar_wblfl_obs02.uti b/nwnds_module/ar_wblfl_obs02.uti new file mode 100644 index 000000000..b94c56e7a Binary files /dev/null and b/nwnds_module/ar_wblfl_obs02.uti differ diff --git a/nwnds_module/ar_wblhl_alloy.uti b/nwnds_module/ar_wblhl_alloy.uti new file mode 100644 index 000000000..8c90daf7a Binary files /dev/null and b/nwnds_module/ar_wblhl_alloy.uti differ diff --git a/nwnds_module/ar_wblhl_iron01.uti b/nwnds_module/ar_wblhl_iron01.uti new file mode 100644 index 000000000..61f7d7ed2 Binary files /dev/null and b/nwnds_module/ar_wblhl_iron01.uti differ diff --git a/nwnds_module/ar_wblhl_ivory.uti b/nwnds_module/ar_wblhl_ivory.uti new file mode 100644 index 000000000..37d43d211 Binary files /dev/null and b/nwnds_module/ar_wblhl_ivory.uti differ diff --git a/nwnds_module/ar_wblhl_obs01.uti b/nwnds_module/ar_wblhl_obs01.uti new file mode 100644 index 000000000..bc771624f Binary files /dev/null and b/nwnds_module/ar_wblhl_obs01.uti differ diff --git a/nwnds_module/ar_wblhl_obs02.uti b/nwnds_module/ar_wblhl_obs02.uti new file mode 100644 index 000000000..c86e2a8bc Binary files /dev/null and b/nwnds_module/ar_wblhl_obs02.uti differ diff --git a/nwnds_module/ar_wblhl_stone01.uti b/nwnds_module/ar_wblhl_stone01.uti new file mode 100644 index 000000000..e7976619d Binary files /dev/null and b/nwnds_module/ar_wblhl_stone01.uti differ diff --git a/nwnds_module/ar_wblhw_agiant.uti b/nwnds_module/ar_wblhw_agiant.uti new file mode 100644 index 000000000..2b991e82e Binary files /dev/null and b/nwnds_module/ar_wblhw_agiant.uti differ diff --git a/nwnds_module/ar_wblhw_alloy.uti b/nwnds_module/ar_wblhw_alloy.uti new file mode 100644 index 000000000..d3df51eb9 Binary files /dev/null and b/nwnds_module/ar_wblhw_alloy.uti differ diff --git a/nwnds_module/ar_wblhw_iron01.uti b/nwnds_module/ar_wblhw_iron01.uti new file mode 100644 index 000000000..9ea916cf8 Binary files /dev/null and b/nwnds_module/ar_wblhw_iron01.uti differ diff --git a/nwnds_module/ar_wblhw_ivory.uti b/nwnds_module/ar_wblhw_ivory.uti new file mode 100644 index 000000000..a61e0a72e Binary files /dev/null and b/nwnds_module/ar_wblhw_ivory.uti differ diff --git a/nwnds_module/ar_wblhw_obs01.uti b/nwnds_module/ar_wblhw_obs01.uti new file mode 100644 index 000000000..d7a0bb0bf Binary files /dev/null and b/nwnds_module/ar_wblhw_obs01.uti differ diff --git a/nwnds_module/ar_wblhw_obs02.uti b/nwnds_module/ar_wblhw_obs02.uti new file mode 100644 index 000000000..781035b0c Binary files /dev/null and b/nwnds_module/ar_wblhw_obs02.uti differ diff --git a/nwnds_module/ar_wblhw_stone.uti b/nwnds_module/ar_wblhw_stone.uti new file mode 100644 index 000000000..a9df72760 Binary files /dev/null and b/nwnds_module/ar_wblhw_stone.uti differ diff --git a/nwnds_module/ar_wblmal_gash.uti b/nwnds_module/ar_wblmal_gash.uti new file mode 100644 index 000000000..411e485b9 Binary files /dev/null and b/nwnds_module/ar_wblmal_gash.uti differ diff --git a/nwnds_module/ar_wblmcl_chittr.uti b/nwnds_module/ar_wblmcl_chittr.uti new file mode 100644 index 000000000..62a905c8d Binary files /dev/null and b/nwnds_module/ar_wblmcl_chittr.uti differ diff --git a/nwnds_module/ar_wblmcl_drikl1.uti b/nwnds_module/ar_wblmcl_drikl1.uti new file mode 100644 index 000000000..addf4aa07 Binary files /dev/null and b/nwnds_module/ar_wblmcl_drikl1.uti differ diff --git a/nwnds_module/ar_wblmcl_drikl2.uti b/nwnds_module/ar_wblmcl_drikl2.uti new file mode 100644 index 000000000..1e9464ffc Binary files /dev/null and b/nwnds_module/ar_wblmcl_drikl2.uti differ diff --git a/nwnds_module/ar_wblmcl_giant.uti b/nwnds_module/ar_wblmcl_giant.uti new file mode 100644 index 000000000..4b5f64fa0 Binary files /dev/null and b/nwnds_module/ar_wblmcl_giant.uti differ diff --git a/nwnds_module/ar_wblmcl_water.uti b/nwnds_module/ar_wblmcl_water.uti new file mode 100644 index 000000000..28f61f1bd Binary files /dev/null and b/nwnds_module/ar_wblmcl_water.uti differ diff --git a/nwnds_module/ar_wblmcl_wfbtr.uti b/nwnds_module/ar_wblmcl_wfbtr.uti new file mode 100644 index 000000000..fdb05f1fe Binary files /dev/null and b/nwnds_module/ar_wblmcl_wfbtr.uti differ diff --git a/nwnds_module/ar_wblmcl_whackr.uti b/nwnds_module/ar_wblmcl_whackr.uti new file mode 100644 index 000000000..4b864da4f Binary files /dev/null and b/nwnds_module/ar_wblmcl_whackr.uti differ diff --git a/nwnds_module/ar_wblmfh_9lives.uti b/nwnds_module/ar_wblmfh_9lives.uti new file mode 100644 index 000000000..f842ce69a Binary files /dev/null and b/nwnds_module/ar_wblmfh_9lives.uti differ diff --git a/nwnds_module/ar_wblmfh_dragon.uti b/nwnds_module/ar_wblmfh_dragon.uti new file mode 100644 index 000000000..7fc3364a0 Binary files /dev/null and b/nwnds_module/ar_wblmfh_dragon.uti differ diff --git a/nwnds_module/ar_wblmfh_earth.uti b/nwnds_module/ar_wblmfh_earth.uti new file mode 100644 index 000000000..9675de334 Binary files /dev/null and b/nwnds_module/ar_wblmfh_earth.uti differ diff --git a/nwnds_module/ar_wblmfh_flame.uti b/nwnds_module/ar_wblmfh_flame.uti new file mode 100644 index 000000000..8fdf2d608 Binary files /dev/null and b/nwnds_module/ar_wblmfh_flame.uti differ diff --git a/nwnds_module/ar_wblmfh_gorkan.uti b/nwnds_module/ar_wblmfh_gorkan.uti new file mode 100644 index 000000000..1089db49d Binary files /dev/null and b/nwnds_module/ar_wblmfh_gorkan.uti differ diff --git a/nwnds_module/ar_wblmfh_htstrk.uti b/nwnds_module/ar_wblmfh_htstrk.uti new file mode 100644 index 000000000..0ce1e8f9f Binary files /dev/null and b/nwnds_module/ar_wblmfh_htstrk.uti differ diff --git a/nwnds_module/ar_wblmfh_insan.uti b/nwnds_module/ar_wblmfh_insan.uti new file mode 100644 index 000000000..86d0b6dea Binary files /dev/null and b/nwnds_module/ar_wblmfh_insan.uti differ diff --git a/nwnds_module/ar_wblmfh_sngift.uti b/nwnds_module/ar_wblmfh_sngift.uti new file mode 100644 index 000000000..c9bdf55d5 Binary files /dev/null and b/nwnds_module/ar_wblmfh_sngift.uti differ diff --git a/nwnds_module/ar_wblmfh_tempst.uti b/nwnds_module/ar_wblmfh_tempst.uti new file mode 100644 index 000000000..3b178fec3 Binary files /dev/null and b/nwnds_module/ar_wblmfh_tempst.uti differ diff --git a/nwnds_module/ar_wblmfl_caps.uti b/nwnds_module/ar_wblmfl_caps.uti new file mode 100644 index 000000000..d7428af51 Binary files /dev/null and b/nwnds_module/ar_wblmfl_caps.uti differ diff --git a/nwnds_module/ar_wblmfl_earth.uti b/nwnds_module/ar_wblmfl_earth.uti new file mode 100644 index 000000000..24f0d0240 Binary files /dev/null and b/nwnds_module/ar_wblmfl_earth.uti differ diff --git a/nwnds_module/ar_wblmfl_elhand.uti b/nwnds_module/ar_wblmfl_elhand.uti new file mode 100644 index 000000000..140d04234 Binary files /dev/null and b/nwnds_module/ar_wblmfl_elhand.uti differ diff --git a/nwnds_module/ar_wblmfl_flame.uti b/nwnds_module/ar_wblmfl_flame.uti new file mode 100644 index 000000000..f482d7977 Binary files /dev/null and b/nwnds_module/ar_wblmfl_flame.uti differ diff --git a/nwnds_module/ar_wblmfl_gunt.uti b/nwnds_module/ar_wblmfl_gunt.uti new file mode 100644 index 000000000..455d90582 Binary files /dev/null and b/nwnds_module/ar_wblmfl_gunt.uti differ diff --git a/nwnds_module/ar_wblmfl_tempst.uti b/nwnds_module/ar_wblmfl_tempst.uti new file mode 100644 index 000000000..4691dae1a Binary files /dev/null and b/nwnds_module/ar_wblmfl_tempst.uti differ diff --git a/nwnds_module/ar_wblmfl_wind.uti b/nwnds_module/ar_wblmfl_wind.uti new file mode 100644 index 000000000..78be75bc9 Binary files /dev/null and b/nwnds_module/ar_wblmfl_wind.uti differ diff --git a/nwnds_module/ar_wblmhl_gunash.uti b/nwnds_module/ar_wblmhl_gunash.uti new file mode 100644 index 000000000..2a14b5e76 Binary files /dev/null and b/nwnds_module/ar_wblmhl_gunash.uti differ diff --git a/nwnds_module/ar_wblmhl_hearth.uti b/nwnds_module/ar_wblmhl_hearth.uti new file mode 100644 index 000000000..867e9bc91 Binary files /dev/null and b/nwnds_module/ar_wblmhl_hearth.uti differ diff --git a/nwnds_module/ar_wblmhl_kutuka.uti b/nwnds_module/ar_wblmhl_kutuka.uti new file mode 100644 index 000000000..d2210d453 Binary files /dev/null and b/nwnds_module/ar_wblmhl_kutuka.uti differ diff --git a/nwnds_module/ar_wblmhw_bane.uti b/nwnds_module/ar_wblmhw_bane.uti new file mode 100644 index 000000000..93e0054bf Binary files /dev/null and b/nwnds_module/ar_wblmhw_bane.uti differ diff --git a/nwnds_module/ar_wblmhw_bonesm.uti b/nwnds_module/ar_wblmhw_bonesm.uti new file mode 100644 index 000000000..58bc9ac5b Binary files /dev/null and b/nwnds_module/ar_wblmhw_bonesm.uti differ diff --git a/nwnds_module/ar_wblmhw_elec01.uti b/nwnds_module/ar_wblmhw_elec01.uti new file mode 100644 index 000000000..6d8c205b4 Binary files /dev/null and b/nwnds_module/ar_wblmhw_elec01.uti differ diff --git a/nwnds_module/ar_wblmhw_hearth.uti b/nwnds_module/ar_wblmhw_hearth.uti new file mode 100644 index 000000000..11d153c9e Binary files /dev/null and b/nwnds_module/ar_wblmhw_hearth.uti differ diff --git a/nwnds_module/ar_wblmhw_helmgr.uti b/nwnds_module/ar_wblmhw_helmgr.uti new file mode 100644 index 000000000..310b5f38e Binary files /dev/null and b/nwnds_module/ar_wblmhw_helmgr.uti differ diff --git a/nwnds_module/ar_wblmhw_justls.uti b/nwnds_module/ar_wblmhw_justls.uti new file mode 100644 index 000000000..18154d520 Binary files /dev/null and b/nwnds_module/ar_wblmhw_justls.uti differ diff --git a/nwnds_module/ar_wblmhw_magma.uti b/nwnds_module/ar_wblmhw_magma.uti new file mode 100644 index 000000000..27ed19d01 Binary files /dev/null and b/nwnds_module/ar_wblmhw_magma.uti differ diff --git a/nwnds_module/ar_wblmhw_numbsk.uti b/nwnds_module/ar_wblmhw_numbsk.uti new file mode 100644 index 000000000..35c2d5b5b Binary files /dev/null and b/nwnds_module/ar_wblmhw_numbsk.uti differ diff --git a/nwnds_module/ar_wblmhw_urikhg.uti b/nwnds_module/ar_wblmhw_urikhg.uti new file mode 100644 index 000000000..1551deed9 Binary files /dev/null and b/nwnds_module/ar_wblmhw_urikhg.uti differ diff --git a/nwnds_module/ar_wblml_alloy.uti b/nwnds_module/ar_wblml_alloy.uti new file mode 100644 index 000000000..3ce4e8b21 Binary files /dev/null and b/nwnds_module/ar_wblml_alloy.uti differ diff --git a/nwnds_module/ar_wblml_bone01.uti b/nwnds_module/ar_wblml_bone01.uti new file mode 100644 index 000000000..b59012780 Binary files /dev/null and b/nwnds_module/ar_wblml_bone01.uti differ diff --git a/nwnds_module/ar_wblml_iron01.uti b/nwnds_module/ar_wblml_iron01.uti new file mode 100644 index 000000000..dc8a52ecf Binary files /dev/null and b/nwnds_module/ar_wblml_iron01.uti differ diff --git a/nwnds_module/ar_wblml_ivory.uti b/nwnds_module/ar_wblml_ivory.uti new file mode 100644 index 000000000..8df0afcfd Binary files /dev/null and b/nwnds_module/ar_wblml_ivory.uti differ diff --git a/nwnds_module/ar_wblml_obs01.uti b/nwnds_module/ar_wblml_obs01.uti new file mode 100644 index 000000000..0603585e6 Binary files /dev/null and b/nwnds_module/ar_wblml_obs01.uti differ diff --git a/nwnds_module/ar_wblml_obs02.uti b/nwnds_module/ar_wblml_obs02.uti new file mode 100644 index 000000000..faf8494db Binary files /dev/null and b/nwnds_module/ar_wblml_obs02.uti differ diff --git a/nwnds_module/ar_wblmml_antiqu.uti b/nwnds_module/ar_wblmml_antiqu.uti new file mode 100644 index 000000000..a27ecac11 Binary files /dev/null and b/nwnds_module/ar_wblmml_antiqu.uti differ diff --git a/nwnds_module/ar_wblmml_bsplit.uti b/nwnds_module/ar_wblmml_bsplit.uti new file mode 100644 index 000000000..7f3389bbd Binary files /dev/null and b/nwnds_module/ar_wblmml_bsplit.uti differ diff --git a/nwnds_module/ar_wblmml_dytest.uti b/nwnds_module/ar_wblmml_dytest.uti new file mode 100644 index 000000000..1d6e63c80 Binary files /dev/null and b/nwnds_module/ar_wblmml_dytest.uti differ diff --git a/nwnds_module/ar_wblmml_earth.uti b/nwnds_module/ar_wblmml_earth.uti new file mode 100644 index 000000000..27d51f6fe Binary files /dev/null and b/nwnds_module/ar_wblmml_earth.uti differ diff --git a/nwnds_module/ar_wblmml_flame.uti b/nwnds_module/ar_wblmml_flame.uti new file mode 100644 index 000000000..0cd77e360 Binary files /dev/null and b/nwnds_module/ar_wblmml_flame.uti differ diff --git a/nwnds_module/ar_wblmml_hamanu.uti b/nwnds_module/ar_wblmml_hamanu.uti new file mode 100644 index 000000000..231d8f470 Binary files /dev/null and b/nwnds_module/ar_wblmml_hamanu.uti differ diff --git a/nwnds_module/ar_wblmml_hsilt.uti b/nwnds_module/ar_wblmml_hsilt.uti new file mode 100644 index 000000000..c4b4627d5 Binary files /dev/null and b/nwnds_module/ar_wblmml_hsilt.uti differ diff --git a/nwnds_module/ar_wblmml_ianos.uti b/nwnds_module/ar_wblmml_ianos.uti new file mode 100644 index 000000000..eef96c0d0 Binary files /dev/null and b/nwnds_module/ar_wblmml_ianos.uti differ diff --git a/nwnds_module/ar_wblmml_midnig.uti b/nwnds_module/ar_wblmml_midnig.uti new file mode 100644 index 000000000..fdef66e77 Binary files /dev/null and b/nwnds_module/ar_wblmml_midnig.uti differ diff --git a/nwnds_module/ar_wblmml_morg.uti b/nwnds_module/ar_wblmml_morg.uti new file mode 100644 index 000000000..64cabe324 Binary files /dev/null and b/nwnds_module/ar_wblmml_morg.uti differ diff --git a/nwnds_module/ar_wblmml_smash.uti b/nwnds_module/ar_wblmml_smash.uti new file mode 100644 index 000000000..b65cc68d7 Binary files /dev/null and b/nwnds_module/ar_wblmml_smash.uti differ diff --git a/nwnds_module/ar_wblmml_stormy.uti b/nwnds_module/ar_wblmml_stormy.uti new file mode 100644 index 000000000..82b6be3a3 Binary files /dev/null and b/nwnds_module/ar_wblmml_stormy.uti differ diff --git a/nwnds_module/ar_wblmml_teeth.uti b/nwnds_module/ar_wblmml_teeth.uti new file mode 100644 index 000000000..19b2cdc7c Binary files /dev/null and b/nwnds_module/ar_wblmml_teeth.uti differ diff --git a/nwnds_module/ar_wblmml_tempst.uti b/nwnds_module/ar_wblmml_tempst.uti new file mode 100644 index 000000000..ce8715df8 Binary files /dev/null and b/nwnds_module/ar_wblmml_tempst.uti differ diff --git a/nwnds_module/ar_wblmms_bodach.uti b/nwnds_module/ar_wblmms_bodach.uti new file mode 100644 index 000000000..7b6aceab1 Binary files /dev/null and b/nwnds_module/ar_wblmms_bodach.uti differ diff --git a/nwnds_module/ar_wblmms_deadma.uti b/nwnds_module/ar_wblmms_deadma.uti new file mode 100644 index 000000000..4dc44d6c9 Binary files /dev/null and b/nwnds_module/ar_wblmms_deadma.uti differ diff --git a/nwnds_module/ar_wblmms_earth.uti b/nwnds_module/ar_wblmms_earth.uti new file mode 100644 index 000000000..37fe92ae5 Binary files /dev/null and b/nwnds_module/ar_wblmms_earth.uti differ diff --git a/nwnds_module/ar_wblmms_eclips.uti b/nwnds_module/ar_wblmms_eclips.uti new file mode 100644 index 000000000..43c90ebb2 Binary files /dev/null and b/nwnds_module/ar_wblmms_eclips.uti differ diff --git a/nwnds_module/ar_wblmms_fallin.uti b/nwnds_module/ar_wblmms_fallin.uti new file mode 100644 index 000000000..2813af89f Binary files /dev/null and b/nwnds_module/ar_wblmms_fallin.uti differ diff --git a/nwnds_module/ar_wblmms_flame.uti b/nwnds_module/ar_wblmms_flame.uti new file mode 100644 index 000000000..8edca86ec Binary files /dev/null and b/nwnds_module/ar_wblmms_flame.uti differ diff --git a/nwnds_module/ar_wblmms_ghalad.uti b/nwnds_module/ar_wblmms_ghalad.uti new file mode 100644 index 000000000..d5374dfb1 Binary files /dev/null and b/nwnds_module/ar_wblmms_ghalad.uti differ diff --git a/nwnds_module/ar_wblmms_homewr.uti b/nwnds_module/ar_wblmms_homewr.uti new file mode 100644 index 000000000..3d4059354 Binary files /dev/null and b/nwnds_module/ar_wblmms_homewr.uti differ diff --git a/nwnds_module/ar_wblmms_mglory.uti b/nwnds_module/ar_wblmms_mglory.uti new file mode 100644 index 000000000..5473c5156 Binary files /dev/null and b/nwnds_module/ar_wblmms_mglory.uti differ diff --git a/nwnds_module/ar_wblmms_midnig.uti b/nwnds_module/ar_wblmms_midnig.uti new file mode 100644 index 000000000..7d4d40e78 Binary files /dev/null and b/nwnds_module/ar_wblmms_midnig.uti differ diff --git a/nwnds_module/ar_wblmms_mornin.uti b/nwnds_module/ar_wblmms_mornin.uti new file mode 100644 index 000000000..d4188bbae Binary files /dev/null and b/nwnds_module/ar_wblmms_mornin.uti differ diff --git a/nwnds_module/ar_wblmms_sun.uti b/nwnds_module/ar_wblmms_sun.uti new file mode 100644 index 000000000..398479edb Binary files /dev/null and b/nwnds_module/ar_wblmms_sun.uti differ diff --git a/nwnds_module/ar_wblmms_tempst.uti b/nwnds_module/ar_wblmms_tempst.uti new file mode 100644 index 000000000..fa8694351 Binary files /dev/null and b/nwnds_module/ar_wblmms_tempst.uti differ diff --git a/nwnds_module/ar_wblms_alloy.uti b/nwnds_module/ar_wblms_alloy.uti new file mode 100644 index 000000000..135fe0367 Binary files /dev/null and b/nwnds_module/ar_wblms_alloy.uti differ diff --git a/nwnds_module/ar_wblms_bone01.uti b/nwnds_module/ar_wblms_bone01.uti new file mode 100644 index 000000000..5fe9daf2f Binary files /dev/null and b/nwnds_module/ar_wblms_bone01.uti differ diff --git a/nwnds_module/ar_wblms_iron.uti b/nwnds_module/ar_wblms_iron.uti new file mode 100644 index 000000000..5ead028c0 Binary files /dev/null and b/nwnds_module/ar_wblms_iron.uti differ diff --git a/nwnds_module/ar_wblms_ivory.uti b/nwnds_module/ar_wblms_ivory.uti new file mode 100644 index 000000000..52a391965 Binary files /dev/null and b/nwnds_module/ar_wblms_ivory.uti differ diff --git a/nwnds_module/ar_wblms_obs01.uti b/nwnds_module/ar_wblms_obs01.uti new file mode 100644 index 000000000..f233cdd58 Binary files /dev/null and b/nwnds_module/ar_wblms_obs01.uti differ diff --git a/nwnds_module/ar_wblms_obs02.uti b/nwnds_module/ar_wblms_obs02.uti new file mode 100644 index 000000000..50e011be1 Binary files /dev/null and b/nwnds_module/ar_wblms_obs02.uti differ diff --git a/nwnds_module/ar_wblpal_acid01.uti b/nwnds_module/ar_wblpal_acid01.uti new file mode 100644 index 000000000..18cd1c1ab Binary files /dev/null and b/nwnds_module/ar_wblpal_acid01.uti differ diff --git a/nwnds_module/ar_wblpal_acid02.uti b/nwnds_module/ar_wblpal_acid02.uti new file mode 100644 index 000000000..992d3048f Binary files /dev/null and b/nwnds_module/ar_wblpal_acid02.uti differ diff --git a/nwnds_module/ar_wblpal_elec01.uti b/nwnds_module/ar_wblpal_elec01.uti new file mode 100644 index 000000000..4fba1f269 Binary files /dev/null and b/nwnds_module/ar_wblpal_elec01.uti differ diff --git a/nwnds_module/ar_wblpal_elec02.uti b/nwnds_module/ar_wblpal_elec02.uti new file mode 100644 index 000000000..c7091e660 Binary files /dev/null and b/nwnds_module/ar_wblpal_elec02.uti differ diff --git a/nwnds_module/ar_wblpal_fire01.uti b/nwnds_module/ar_wblpal_fire01.uti new file mode 100644 index 000000000..738939861 Binary files /dev/null and b/nwnds_module/ar_wblpal_fire01.uti differ diff --git a/nwnds_module/ar_wblpal_fire02.uti b/nwnds_module/ar_wblpal_fire02.uti new file mode 100644 index 000000000..cd1f0d88a Binary files /dev/null and b/nwnds_module/ar_wblpal_fire02.uti differ diff --git a/nwnds_module/ar_wblpal_ice01.uti b/nwnds_module/ar_wblpal_ice01.uti new file mode 100644 index 000000000..a2ccfc449 Binary files /dev/null and b/nwnds_module/ar_wblpal_ice01.uti differ diff --git a/nwnds_module/ar_wblpal_ice02.uti b/nwnds_module/ar_wblpal_ice02.uti new file mode 100644 index 000000000..aee87451d Binary files /dev/null and b/nwnds_module/ar_wblpal_ice02.uti differ diff --git a/nwnds_module/ar_wblpcl_acid01.uti b/nwnds_module/ar_wblpcl_acid01.uti new file mode 100644 index 000000000..0aa38957f Binary files /dev/null and b/nwnds_module/ar_wblpcl_acid01.uti differ diff --git a/nwnds_module/ar_wblpcl_acid02.uti b/nwnds_module/ar_wblpcl_acid02.uti new file mode 100644 index 000000000..967da242d Binary files /dev/null and b/nwnds_module/ar_wblpcl_acid02.uti differ diff --git a/nwnds_module/ar_wblpcl_elec01.uti b/nwnds_module/ar_wblpcl_elec01.uti new file mode 100644 index 000000000..0eb6ff026 Binary files /dev/null and b/nwnds_module/ar_wblpcl_elec01.uti differ diff --git a/nwnds_module/ar_wblpcl_elec02.uti b/nwnds_module/ar_wblpcl_elec02.uti new file mode 100644 index 000000000..935f64851 Binary files /dev/null and b/nwnds_module/ar_wblpcl_elec02.uti differ diff --git a/nwnds_module/ar_wblpcl_fire01.uti b/nwnds_module/ar_wblpcl_fire01.uti new file mode 100644 index 000000000..12da565c5 Binary files /dev/null and b/nwnds_module/ar_wblpcl_fire01.uti differ diff --git a/nwnds_module/ar_wblpcl_fire02.uti b/nwnds_module/ar_wblpcl_fire02.uti new file mode 100644 index 000000000..e51c00fd5 Binary files /dev/null and b/nwnds_module/ar_wblpcl_fire02.uti differ diff --git a/nwnds_module/ar_wblpcl_ice01.uti b/nwnds_module/ar_wblpcl_ice01.uti new file mode 100644 index 000000000..3bc17a81a Binary files /dev/null and b/nwnds_module/ar_wblpcl_ice01.uti differ diff --git a/nwnds_module/ar_wblpcl_ice02.uti b/nwnds_module/ar_wblpcl_ice02.uti new file mode 100644 index 000000000..047074fa6 Binary files /dev/null and b/nwnds_module/ar_wblpcl_ice02.uti differ diff --git a/nwnds_module/ar_wblpfh_acid01.uti b/nwnds_module/ar_wblpfh_acid01.uti new file mode 100644 index 000000000..be6b053ff Binary files /dev/null and b/nwnds_module/ar_wblpfh_acid01.uti differ diff --git a/nwnds_module/ar_wblpfh_acid02.uti b/nwnds_module/ar_wblpfh_acid02.uti new file mode 100644 index 000000000..867b283cf Binary files /dev/null and b/nwnds_module/ar_wblpfh_acid02.uti differ diff --git a/nwnds_module/ar_wblpfh_bbreak.uti b/nwnds_module/ar_wblpfh_bbreak.uti new file mode 100644 index 000000000..b83141500 Binary files /dev/null and b/nwnds_module/ar_wblpfh_bbreak.uti differ diff --git a/nwnds_module/ar_wblpfh_bradas.uti b/nwnds_module/ar_wblpfh_bradas.uti new file mode 100644 index 000000000..7f5235fd2 Binary files /dev/null and b/nwnds_module/ar_wblpfh_bradas.uti differ diff --git a/nwnds_module/ar_wblpfh_elec01.uti b/nwnds_module/ar_wblpfh_elec01.uti new file mode 100644 index 000000000..0d3a20184 Binary files /dev/null and b/nwnds_module/ar_wblpfh_elec01.uti differ diff --git a/nwnds_module/ar_wblpfh_elec02.uti b/nwnds_module/ar_wblpfh_elec02.uti new file mode 100644 index 000000000..d013c9e0d Binary files /dev/null and b/nwnds_module/ar_wblpfh_elec02.uti differ diff --git a/nwnds_module/ar_wblpfh_fire01.uti b/nwnds_module/ar_wblpfh_fire01.uti new file mode 100644 index 000000000..9b2453ba7 Binary files /dev/null and b/nwnds_module/ar_wblpfh_fire01.uti differ diff --git a/nwnds_module/ar_wblpfh_fire02.uti b/nwnds_module/ar_wblpfh_fire02.uti new file mode 100644 index 000000000..c992af8f2 Binary files /dev/null and b/nwnds_module/ar_wblpfh_fire02.uti differ diff --git a/nwnds_module/ar_wblpfh_ice01.uti b/nwnds_module/ar_wblpfh_ice01.uti new file mode 100644 index 000000000..8fadc682a Binary files /dev/null and b/nwnds_module/ar_wblpfh_ice01.uti differ diff --git a/nwnds_module/ar_wblpfh_ice02.uti b/nwnds_module/ar_wblpfh_ice02.uti new file mode 100644 index 000000000..2aef5afb0 Binary files /dev/null and b/nwnds_module/ar_wblpfh_ice02.uti differ diff --git a/nwnds_module/ar_wblpfl_acid01.uti b/nwnds_module/ar_wblpfl_acid01.uti new file mode 100644 index 000000000..07cef585a Binary files /dev/null and b/nwnds_module/ar_wblpfl_acid01.uti differ diff --git a/nwnds_module/ar_wblpfl_acid02.uti b/nwnds_module/ar_wblpfl_acid02.uti new file mode 100644 index 000000000..66419d172 Binary files /dev/null and b/nwnds_module/ar_wblpfl_acid02.uti differ diff --git a/nwnds_module/ar_wblpfl_elec01.uti b/nwnds_module/ar_wblpfl_elec01.uti new file mode 100644 index 000000000..c6178019a Binary files /dev/null and b/nwnds_module/ar_wblpfl_elec01.uti differ diff --git a/nwnds_module/ar_wblpfl_elec02.uti b/nwnds_module/ar_wblpfl_elec02.uti new file mode 100644 index 000000000..ebf4087d9 Binary files /dev/null and b/nwnds_module/ar_wblpfl_elec02.uti differ diff --git a/nwnds_module/ar_wblpfl_fire01.uti b/nwnds_module/ar_wblpfl_fire01.uti new file mode 100644 index 000000000..b91e39d33 Binary files /dev/null and b/nwnds_module/ar_wblpfl_fire01.uti differ diff --git a/nwnds_module/ar_wblpfl_fire02.uti b/nwnds_module/ar_wblpfl_fire02.uti new file mode 100644 index 000000000..da082d2fd Binary files /dev/null and b/nwnds_module/ar_wblpfl_fire02.uti differ diff --git a/nwnds_module/ar_wblpfl_ice01.uti b/nwnds_module/ar_wblpfl_ice01.uti new file mode 100644 index 000000000..9c9a3be88 Binary files /dev/null and b/nwnds_module/ar_wblpfl_ice01.uti differ diff --git a/nwnds_module/ar_wblpfl_ice02.uti b/nwnds_module/ar_wblpfl_ice02.uti new file mode 100644 index 000000000..34ceafb5b Binary files /dev/null and b/nwnds_module/ar_wblpfl_ice02.uti differ diff --git a/nwnds_module/ar_wblphl_acid01.uti b/nwnds_module/ar_wblphl_acid01.uti new file mode 100644 index 000000000..cd79ae394 Binary files /dev/null and b/nwnds_module/ar_wblphl_acid01.uti differ diff --git a/nwnds_module/ar_wblphl_acid02.uti b/nwnds_module/ar_wblphl_acid02.uti new file mode 100644 index 000000000..5e9abf3dd Binary files /dev/null and b/nwnds_module/ar_wblphl_acid02.uti differ diff --git a/nwnds_module/ar_wblphl_elec01.uti b/nwnds_module/ar_wblphl_elec01.uti new file mode 100644 index 000000000..7d6b7309d Binary files /dev/null and b/nwnds_module/ar_wblphl_elec01.uti differ diff --git a/nwnds_module/ar_wblphl_elec02.uti b/nwnds_module/ar_wblphl_elec02.uti new file mode 100644 index 000000000..d9a092b18 Binary files /dev/null and b/nwnds_module/ar_wblphl_elec02.uti differ diff --git a/nwnds_module/ar_wblphl_fire01.uti b/nwnds_module/ar_wblphl_fire01.uti new file mode 100644 index 000000000..23a5a9732 Binary files /dev/null and b/nwnds_module/ar_wblphl_fire01.uti differ diff --git a/nwnds_module/ar_wblphl_fire02.uti b/nwnds_module/ar_wblphl_fire02.uti new file mode 100644 index 000000000..da26eb5ea Binary files /dev/null and b/nwnds_module/ar_wblphl_fire02.uti differ diff --git a/nwnds_module/ar_wblphl_hirduk.uti b/nwnds_module/ar_wblphl_hirduk.uti new file mode 100644 index 000000000..d7cfbe681 Binary files /dev/null and b/nwnds_module/ar_wblphl_hirduk.uti differ diff --git a/nwnds_module/ar_wblphl_ice01.uti b/nwnds_module/ar_wblphl_ice01.uti new file mode 100644 index 000000000..3d1e0e7b7 Binary files /dev/null and b/nwnds_module/ar_wblphl_ice01.uti differ diff --git a/nwnds_module/ar_wblphl_ice02.uti b/nwnds_module/ar_wblphl_ice02.uti new file mode 100644 index 000000000..2a8591def Binary files /dev/null and b/nwnds_module/ar_wblphl_ice02.uti differ diff --git a/nwnds_module/ar_wblphw_acid01.uti b/nwnds_module/ar_wblphw_acid01.uti new file mode 100644 index 000000000..9f45dcec4 Binary files /dev/null and b/nwnds_module/ar_wblphw_acid01.uti differ diff --git a/nwnds_module/ar_wblphw_acid02.uti b/nwnds_module/ar_wblphw_acid02.uti new file mode 100644 index 000000000..b41a8307d Binary files /dev/null and b/nwnds_module/ar_wblphw_acid02.uti differ diff --git a/nwnds_module/ar_wblphw_crush.uti b/nwnds_module/ar_wblphw_crush.uti new file mode 100644 index 000000000..5e037b83b Binary files /dev/null and b/nwnds_module/ar_wblphw_crush.uti differ diff --git a/nwnds_module/ar_wblphw_elec01.uti b/nwnds_module/ar_wblphw_elec01.uti new file mode 100644 index 000000000..36cb8bf6d Binary files /dev/null and b/nwnds_module/ar_wblphw_elec01.uti differ diff --git a/nwnds_module/ar_wblphw_elec02.uti b/nwnds_module/ar_wblphw_elec02.uti new file mode 100644 index 000000000..da11b7057 Binary files /dev/null and b/nwnds_module/ar_wblphw_elec02.uti differ diff --git a/nwnds_module/ar_wblphw_fire01.uti b/nwnds_module/ar_wblphw_fire01.uti new file mode 100644 index 000000000..de4fb323e Binary files /dev/null and b/nwnds_module/ar_wblphw_fire01.uti differ diff --git a/nwnds_module/ar_wblphw_fire02.uti b/nwnds_module/ar_wblphw_fire02.uti new file mode 100644 index 000000000..4f1f7a440 Binary files /dev/null and b/nwnds_module/ar_wblphw_fire02.uti differ diff --git a/nwnds_module/ar_wblphw_flagis.uti b/nwnds_module/ar_wblphw_flagis.uti new file mode 100644 index 000000000..ec02886e0 Binary files /dev/null and b/nwnds_module/ar_wblphw_flagis.uti differ diff --git a/nwnds_module/ar_wblphw_ice01.uti b/nwnds_module/ar_wblphw_ice01.uti new file mode 100644 index 000000000..6be6ed74c Binary files /dev/null and b/nwnds_module/ar_wblphw_ice01.uti differ diff --git a/nwnds_module/ar_wblphw_ice02.uti b/nwnds_module/ar_wblphw_ice02.uti new file mode 100644 index 000000000..2aab8f5bc Binary files /dev/null and b/nwnds_module/ar_wblphw_ice02.uti differ diff --git a/nwnds_module/ar_wblpml_acid01.uti b/nwnds_module/ar_wblpml_acid01.uti new file mode 100644 index 000000000..ce461e3e2 Binary files /dev/null and b/nwnds_module/ar_wblpml_acid01.uti differ diff --git a/nwnds_module/ar_wblpml_acid02.uti b/nwnds_module/ar_wblpml_acid02.uti new file mode 100644 index 000000000..e22184d5e Binary files /dev/null and b/nwnds_module/ar_wblpml_acid02.uti differ diff --git a/nwnds_module/ar_wblpml_elec01.uti b/nwnds_module/ar_wblpml_elec01.uti new file mode 100644 index 000000000..68a1fc687 Binary files /dev/null and b/nwnds_module/ar_wblpml_elec01.uti differ diff --git a/nwnds_module/ar_wblpml_elec02.uti b/nwnds_module/ar_wblpml_elec02.uti new file mode 100644 index 000000000..9c1c58cb9 Binary files /dev/null and b/nwnds_module/ar_wblpml_elec02.uti differ diff --git a/nwnds_module/ar_wblpml_fire01.uti b/nwnds_module/ar_wblpml_fire01.uti new file mode 100644 index 000000000..1b213434a Binary files /dev/null and b/nwnds_module/ar_wblpml_fire01.uti differ diff --git a/nwnds_module/ar_wblpml_fire02.uti b/nwnds_module/ar_wblpml_fire02.uti new file mode 100644 index 000000000..6a6657ba0 Binary files /dev/null and b/nwnds_module/ar_wblpml_fire02.uti differ diff --git a/nwnds_module/ar_wblpml_ice01.uti b/nwnds_module/ar_wblpml_ice01.uti new file mode 100644 index 000000000..8a7067247 Binary files /dev/null and b/nwnds_module/ar_wblpml_ice01.uti differ diff --git a/nwnds_module/ar_wblpml_ice02.uti b/nwnds_module/ar_wblpml_ice02.uti new file mode 100644 index 000000000..9cd46db09 Binary files /dev/null and b/nwnds_module/ar_wblpml_ice02.uti differ diff --git a/nwnds_module/ar_wblpms_acid01.uti b/nwnds_module/ar_wblpms_acid01.uti new file mode 100644 index 000000000..3f4725b96 Binary files /dev/null and b/nwnds_module/ar_wblpms_acid01.uti differ diff --git a/nwnds_module/ar_wblpms_acid02.uti b/nwnds_module/ar_wblpms_acid02.uti new file mode 100644 index 000000000..717f6151a Binary files /dev/null and b/nwnds_module/ar_wblpms_acid02.uti differ diff --git a/nwnds_module/ar_wblpms_elec01.uti b/nwnds_module/ar_wblpms_elec01.uti new file mode 100644 index 000000000..b18473d4c Binary files /dev/null and b/nwnds_module/ar_wblpms_elec01.uti differ diff --git a/nwnds_module/ar_wblpms_elec02.uti b/nwnds_module/ar_wblpms_elec02.uti new file mode 100644 index 000000000..aab5e3cc6 Binary files /dev/null and b/nwnds_module/ar_wblpms_elec02.uti differ diff --git a/nwnds_module/ar_wblpms_fire01.uti b/nwnds_module/ar_wblpms_fire01.uti new file mode 100644 index 000000000..c7e6843d7 Binary files /dev/null and b/nwnds_module/ar_wblpms_fire01.uti differ diff --git a/nwnds_module/ar_wblpms_fire02.uti b/nwnds_module/ar_wblpms_fire02.uti new file mode 100644 index 000000000..b33c8c35a Binary files /dev/null and b/nwnds_module/ar_wblpms_fire02.uti differ diff --git a/nwnds_module/ar_wblpms_ice01.uti b/nwnds_module/ar_wblpms_ice01.uti new file mode 100644 index 000000000..31522602f Binary files /dev/null and b/nwnds_module/ar_wblpms_ice01.uti differ diff --git a/nwnds_module/ar_wblpms_ice02.uti b/nwnds_module/ar_wblpms_ice02.uti new file mode 100644 index 000000000..adfc3e3dd Binary files /dev/null and b/nwnds_module/ar_wblpms_ice02.uti differ diff --git a/nwnds_module/ar_wbmcl_wrscptr.uti b/nwnds_module/ar_wbmcl_wrscptr.uti new file mode 100644 index 000000000..77ca0a45b Binary files /dev/null and b/nwnds_module/ar_wbmcl_wrscptr.uti differ diff --git a/nwnds_module/ar_wbmhw_corros.uti b/nwnds_module/ar_wbmhw_corros.uti new file mode 100644 index 000000000..1c1a7089f Binary files /dev/null and b/nwnds_module/ar_wbmhw_corros.uti differ diff --git a/nwnds_module/ar_wbwln_agafari.uti b/nwnds_module/ar_wbwln_agafari.uti new file mode 100644 index 000000000..b1e2aeadb Binary files /dev/null and b/nwnds_module/ar_wbwln_agafari.uti differ diff --git a/nwnds_module/ar_wbwln_alloy.uti b/nwnds_module/ar_wbwln_alloy.uti new file mode 100644 index 000000000..6725ac2db Binary files /dev/null and b/nwnds_module/ar_wbwln_alloy.uti differ diff --git a/nwnds_module/ar_wbwln_ashen.uti b/nwnds_module/ar_wbwln_ashen.uti new file mode 100644 index 000000000..2a4dbb093 Binary files /dev/null and b/nwnds_module/ar_wbwln_ashen.uti differ diff --git a/nwnds_module/ar_wbwln_mwklbw.uti b/nwnds_module/ar_wbwln_mwklbw.uti new file mode 100644 index 000000000..5cd463124 Binary files /dev/null and b/nwnds_module/ar_wbwln_mwklbw.uti differ diff --git a/nwnds_module/ar_wbwln_yew01.uti b/nwnds_module/ar_wbwln_yew01.uti new file mode 100644 index 000000000..f27e07744 Binary files /dev/null and b/nwnds_module/ar_wbwln_yew01.uti differ diff --git a/nwnds_module/ar_wbwmln_drajan.uti b/nwnds_module/ar_wbwmln_drajan.uti new file mode 100644 index 000000000..6ba2d3dde Binary files /dev/null and b/nwnds_module/ar_wbwmln_drajan.uti differ diff --git a/nwnds_module/ar_wbwmln_fossil.uti b/nwnds_module/ar_wbwmln_fossil.uti new file mode 100644 index 000000000..172bd7ec0 Binary files /dev/null and b/nwnds_module/ar_wbwmln_fossil.uti differ diff --git a/nwnds_module/ar_wbwmln_giant.uti b/nwnds_module/ar_wbwmln_giant.uti new file mode 100644 index 000000000..084c81693 Binary files /dev/null and b/nwnds_module/ar_wbwmln_giant.uti differ diff --git a/nwnds_module/ar_wbwmln_pandor.uti b/nwnds_module/ar_wbwmln_pandor.uti new file mode 100644 index 000000000..e39718357 Binary files /dev/null and b/nwnds_module/ar_wbwmln_pandor.uti differ diff --git a/nwnds_module/ar_wbwmln_skydnc.uti b/nwnds_module/ar_wbwmln_skydnc.uti new file mode 100644 index 000000000..a41570901 Binary files /dev/null and b/nwnds_module/ar_wbwmln_skydnc.uti differ diff --git a/nwnds_module/ar_wbwmln_suresh.uti b/nwnds_module/ar_wbwmln_suresh.uti new file mode 100644 index 000000000..adedef756 Binary files /dev/null and b/nwnds_module/ar_wbwmln_suresh.uti differ diff --git a/nwnds_module/ar_wbwmln_tempes.uti b/nwnds_module/ar_wbwmln_tempes.uti new file mode 100644 index 000000000..59142085b Binary files /dev/null and b/nwnds_module/ar_wbwmln_tempes.uti differ diff --git a/nwnds_module/ar_wbwmln_wonder.uti b/nwnds_module/ar_wbwmln_wonder.uti new file mode 100644 index 000000000..d9c403a7d Binary files /dev/null and b/nwnds_module/ar_wbwmln_wonder.uti differ diff --git a/nwnds_module/ar_wbwmln_wraith.uti b/nwnds_module/ar_wbwmln_wraith.uti new file mode 100644 index 000000000..1230d2c02 Binary files /dev/null and b/nwnds_module/ar_wbwmln_wraith.uti differ diff --git a/nwnds_module/ar_wbwmsh_akveng.uti b/nwnds_module/ar_wbwmsh_akveng.uti new file mode 100644 index 000000000..7b9130c01 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_akveng.uti differ diff --git a/nwnds_module/ar_wbwmsh_guard.uti b/nwnds_module/ar_wbwmsh_guard.uti new file mode 100644 index 000000000..862a789f5 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_guard.uti differ diff --git a/nwnds_module/ar_wbwmsh_hearts.uti b/nwnds_module/ar_wbwmsh_hearts.uti new file mode 100644 index 000000000..c91a3db41 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_hearts.uti differ diff --git a/nwnds_module/ar_wbwmsh_lifest.uti b/nwnds_module/ar_wbwmsh_lifest.uti new file mode 100644 index 000000000..7692b6fc2 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_lifest.uti differ diff --git a/nwnds_module/ar_wbwmsh_posess.uti b/nwnds_module/ar_wbwmsh_posess.uti new file mode 100644 index 000000000..216ff7410 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_posess.uti differ diff --git a/nwnds_module/ar_wbwmsh_shadow.uti b/nwnds_module/ar_wbwmsh_shadow.uti new file mode 100644 index 000000000..245af90d8 Binary files /dev/null and b/nwnds_module/ar_wbwmsh_shadow.uti differ diff --git a/nwnds_module/ar_wbwmsh_skydnc.uti b/nwnds_module/ar_wbwmsh_skydnc.uti new file mode 100644 index 000000000..dacb0903a Binary files /dev/null and b/nwnds_module/ar_wbwmsh_skydnc.uti differ diff --git a/nwnds_module/ar_wbwmsh_storm.uti b/nwnds_module/ar_wbwmsh_storm.uti new file mode 100644 index 000000000..60b8f1f9d Binary files /dev/null and b/nwnds_module/ar_wbwmsh_storm.uti differ diff --git a/nwnds_module/ar_wbwmsh_winter.uti b/nwnds_module/ar_wbwmsh_winter.uti new file mode 100644 index 000000000..81adf9dcb Binary files /dev/null and b/nwnds_module/ar_wbwmsh_winter.uti differ diff --git a/nwnds_module/ar_wbwmsh_wrens.uti b/nwnds_module/ar_wbwmsh_wrens.uti new file mode 100644 index 000000000..9385b21de Binary files /dev/null and b/nwnds_module/ar_wbwmsh_wrens.uti differ diff --git a/nwnds_module/ar_wbwmsl_giant.uti b/nwnds_module/ar_wbwmsl_giant.uti new file mode 100644 index 000000000..df9a1ccdd Binary files /dev/null and b/nwnds_module/ar_wbwmsl_giant.uti differ diff --git a/nwnds_module/ar_wbwmsl_grabs.uti b/nwnds_module/ar_wbwmsl_grabs.uti new file mode 100644 index 000000000..994e69bec Binary files /dev/null and b/nwnds_module/ar_wbwmsl_grabs.uti differ diff --git a/nwnds_module/ar_wbwmsl_mekill.uti b/nwnds_module/ar_wbwmsl_mekill.uti new file mode 100644 index 000000000..07b67ee55 Binary files /dev/null and b/nwnds_module/ar_wbwmsl_mekill.uti differ diff --git a/nwnds_module/ar_wbwmsl_rocky.uti b/nwnds_module/ar_wbwmsl_rocky.uti new file mode 100644 index 000000000..0e92031c0 Binary files /dev/null and b/nwnds_module/ar_wbwmsl_rocky.uti differ diff --git a/nwnds_module/ar_wbwmsl_water.uti b/nwnds_module/ar_wbwmsl_water.uti new file mode 100644 index 000000000..67f7e0ed1 Binary files /dev/null and b/nwnds_module/ar_wbwmsl_water.uti differ diff --git a/nwnds_module/ar_wbwmxh_bdeath.uti b/nwnds_module/ar_wbwmxh_bdeath.uti new file mode 100644 index 000000000..0f90b0e3a Binary files /dev/null and b/nwnds_module/ar_wbwmxh_bdeath.uti differ diff --git a/nwnds_module/ar_wbwmxh_elhur.uti b/nwnds_module/ar_wbwmxh_elhur.uti new file mode 100644 index 000000000..fb13083fb Binary files /dev/null and b/nwnds_module/ar_wbwmxh_elhur.uti differ diff --git a/nwnds_module/ar_wbwmxh_hrtrip.uti b/nwnds_module/ar_wbwmxh_hrtrip.uti new file mode 100644 index 000000000..2f82a73cb Binary files /dev/null and b/nwnds_module/ar_wbwmxh_hrtrip.uti differ diff --git a/nwnds_module/ar_wbwmxh_igouge.uti b/nwnds_module/ar_wbwmxh_igouge.uti new file mode 100644 index 000000000..c5353337d Binary files /dev/null and b/nwnds_module/ar_wbwmxh_igouge.uti differ diff --git a/nwnds_module/ar_wbwmxh_ltpath.uti b/nwnds_module/ar_wbwmxh_ltpath.uti new file mode 100644 index 000000000..9508c037c Binary files /dev/null and b/nwnds_module/ar_wbwmxh_ltpath.uti differ diff --git a/nwnds_module/ar_wbwmxh_skydnc.uti b/nwnds_module/ar_wbwmxh_skydnc.uti new file mode 100644 index 000000000..9bc6757d9 Binary files /dev/null and b/nwnds_module/ar_wbwmxh_skydnc.uti differ diff --git a/nwnds_module/ar_wbwmxh_ultra.uti b/nwnds_module/ar_wbwmxh_ultra.uti new file mode 100644 index 000000000..6faec22df Binary files /dev/null and b/nwnds_module/ar_wbwmxh_ultra.uti differ diff --git a/nwnds_module/ar_wbwmxl_ahpote.uti b/nwnds_module/ar_wbwmxl_ahpote.uti new file mode 100644 index 000000000..e3be8fe46 Binary files /dev/null and b/nwnds_module/ar_wbwmxl_ahpote.uti differ diff --git a/nwnds_module/ar_wbwmxl_dedaim.uti b/nwnds_module/ar_wbwmxl_dedaim.uti new file mode 100644 index 000000000..1af81c11a Binary files /dev/null and b/nwnds_module/ar_wbwmxl_dedaim.uti differ diff --git a/nwnds_module/ar_wbwmxl_elhur.uti b/nwnds_module/ar_wbwmxl_elhur.uti new file mode 100644 index 000000000..27a1a7306 Binary files /dev/null and b/nwnds_module/ar_wbwmxl_elhur.uti differ diff --git a/nwnds_module/ar_wbwmxl_skydnc.uti b/nwnds_module/ar_wbwmxl_skydnc.uti new file mode 100644 index 000000000..9f977302a Binary files /dev/null and b/nwnds_module/ar_wbwmxl_skydnc.uti differ diff --git a/nwnds_module/ar_wbwmxl_vhala.uti b/nwnds_module/ar_wbwmxl_vhala.uti new file mode 100644 index 000000000..a6a426d2d Binary files /dev/null and b/nwnds_module/ar_wbwmxl_vhala.uti differ diff --git a/nwnds_module/ar_wbwmxl_widow.uti b/nwnds_module/ar_wbwmxl_widow.uti new file mode 100644 index 000000000..28db0aaac Binary files /dev/null and b/nwnds_module/ar_wbwmxl_widow.uti differ diff --git a/nwnds_module/ar_wbwpsh_phrins.uti b/nwnds_module/ar_wbwpsh_phrins.uti new file mode 100644 index 000000000..1982239cf Binary files /dev/null and b/nwnds_module/ar_wbwpsh_phrins.uti differ diff --git a/nwnds_module/ar_wbwpsl_whoop.uti b/nwnds_module/ar_wbwpsl_whoop.uti new file mode 100644 index 000000000..b6fddf72e Binary files /dev/null and b/nwnds_module/ar_wbwpsl_whoop.uti differ diff --git a/nwnds_module/ar_wbwpsl_woshot.uti b/nwnds_module/ar_wbwpsl_woshot.uti new file mode 100644 index 000000000..49cf5b0fb Binary files /dev/null and b/nwnds_module/ar_wbwpsl_woshot.uti differ diff --git a/nwnds_module/ar_wbwsh_agafari.uti b/nwnds_module/ar_wbwsh_agafari.uti new file mode 100644 index 000000000..121773c31 Binary files /dev/null and b/nwnds_module/ar_wbwsh_agafari.uti differ diff --git a/nwnds_module/ar_wbwsh_alloy.uti b/nwnds_module/ar_wbwsh_alloy.uti new file mode 100644 index 000000000..026336a69 Binary files /dev/null and b/nwnds_module/ar_wbwsh_alloy.uti differ diff --git a/nwnds_module/ar_wbwsh_ashen.uti b/nwnds_module/ar_wbwsh_ashen.uti new file mode 100644 index 000000000..037fd6c9a Binary files /dev/null and b/nwnds_module/ar_wbwsh_ashen.uti differ diff --git a/nwnds_module/ar_wbwsh_yew01.uti b/nwnds_module/ar_wbwsh_yew01.uti new file mode 100644 index 000000000..f40bbe30d Binary files /dev/null and b/nwnds_module/ar_wbwsh_yew01.uti differ diff --git a/nwnds_module/ar_wbwsl_alloy.uti b/nwnds_module/ar_wbwsl_alloy.uti new file mode 100644 index 000000000..6c8d09aa5 Binary files /dev/null and b/nwnds_module/ar_wbwsl_alloy.uti differ diff --git a/nwnds_module/ar_wbwsl_leath.uti b/nwnds_module/ar_wbwsl_leath.uti new file mode 100644 index 000000000..e16f9058e Binary files /dev/null and b/nwnds_module/ar_wbwsl_leath.uti differ diff --git a/nwnds_module/ar_wbwsl_salaman.uti b/nwnds_module/ar_wbwsl_salaman.uti new file mode 100644 index 000000000..e8c15d90f Binary files /dev/null and b/nwnds_module/ar_wbwsl_salaman.uti differ diff --git a/nwnds_module/ar_wbwsl_wyvern.uti b/nwnds_module/ar_wbwsl_wyvern.uti new file mode 100644 index 000000000..62a163545 Binary files /dev/null and b/nwnds_module/ar_wbwsl_wyvern.uti differ diff --git a/nwnds_module/ar_wbwxh_agafari.uti b/nwnds_module/ar_wbwxh_agafari.uti new file mode 100644 index 000000000..835703da3 Binary files /dev/null and b/nwnds_module/ar_wbwxh_agafari.uti differ diff --git a/nwnds_module/ar_wbwxh_alloy.uti b/nwnds_module/ar_wbwxh_alloy.uti new file mode 100644 index 000000000..49c8d72f8 Binary files /dev/null and b/nwnds_module/ar_wbwxh_alloy.uti differ diff --git a/nwnds_module/ar_wbwxh_ashen.uti b/nwnds_module/ar_wbwxh_ashen.uti new file mode 100644 index 000000000..f9fbfe19e Binary files /dev/null and b/nwnds_module/ar_wbwxh_ashen.uti differ diff --git a/nwnds_module/ar_wbwxh_dedaim.uti b/nwnds_module/ar_wbwxh_dedaim.uti new file mode 100644 index 000000000..f44fb8a7a Binary files /dev/null and b/nwnds_module/ar_wbwxh_dedaim.uti differ diff --git a/nwnds_module/ar_wbwxh_yew01.uti b/nwnds_module/ar_wbwxh_yew01.uti new file mode 100644 index 000000000..27e83012b Binary files /dev/null and b/nwnds_module/ar_wbwxh_yew01.uti differ diff --git a/nwnds_module/ar_wbwxl_agafari.uti b/nwnds_module/ar_wbwxl_agafari.uti new file mode 100644 index 000000000..cb7ed8205 Binary files /dev/null and b/nwnds_module/ar_wbwxl_agafari.uti differ diff --git a/nwnds_module/ar_wbwxl_alloy.uti b/nwnds_module/ar_wbwxl_alloy.uti new file mode 100644 index 000000000..fa95054d4 Binary files /dev/null and b/nwnds_module/ar_wbwxl_alloy.uti differ diff --git a/nwnds_module/ar_wbwxl_ashen.uti b/nwnds_module/ar_wbwxl_ashen.uti new file mode 100644 index 000000000..4b6c4957a Binary files /dev/null and b/nwnds_module/ar_wbwxl_ashen.uti differ diff --git a/nwnds_module/ar_wbwxl_yew01.uti b/nwnds_module/ar_wbwxl_yew01.uti new file mode 100644 index 000000000..a205e1f14 Binary files /dev/null and b/nwnds_module/ar_wbwxl_yew01.uti differ diff --git a/nwnds_module/ar_wdbax_alloy.uti b/nwnds_module/ar_wdbax_alloy.uti new file mode 100644 index 000000000..77b017660 Binary files /dev/null and b/nwnds_module/ar_wdbax_alloy.uti differ diff --git a/nwnds_module/ar_wdbax_iron01.uti b/nwnds_module/ar_wdbax_iron01.uti new file mode 100644 index 000000000..08c63bd1e Binary files /dev/null and b/nwnds_module/ar_wdbax_iron01.uti differ diff --git a/nwnds_module/ar_wdbax_ivory.uti b/nwnds_module/ar_wdbax_ivory.uti new file mode 100644 index 000000000..127d4fdbe Binary files /dev/null and b/nwnds_module/ar_wdbax_ivory.uti differ diff --git a/nwnds_module/ar_wdbax_obs01.uti b/nwnds_module/ar_wdbax_obs01.uti new file mode 100644 index 000000000..cf0ba0ac8 Binary files /dev/null and b/nwnds_module/ar_wdbax_obs01.uti differ diff --git a/nwnds_module/ar_wdbax_obs2.uti b/nwnds_module/ar_wdbax_obs2.uti new file mode 100644 index 000000000..05eab7f3e Binary files /dev/null and b/nwnds_module/ar_wdbax_obs2.uti differ diff --git a/nwnds_module/ar_wdbma_alloy.uti b/nwnds_module/ar_wdbma_alloy.uti new file mode 100644 index 000000000..8e8058e8c Binary files /dev/null and b/nwnds_module/ar_wdbma_alloy.uti differ diff --git a/nwnds_module/ar_wdbma_iron01.uti b/nwnds_module/ar_wdbma_iron01.uti new file mode 100644 index 000000000..2fb407c31 Binary files /dev/null and b/nwnds_module/ar_wdbma_iron01.uti differ diff --git a/nwnds_module/ar_wdbma_ivory.uti b/nwnds_module/ar_wdbma_ivory.uti new file mode 100644 index 000000000..841fe8230 Binary files /dev/null and b/nwnds_module/ar_wdbma_ivory.uti differ diff --git a/nwnds_module/ar_wdbma_obs01.uti b/nwnds_module/ar_wdbma_obs01.uti new file mode 100644 index 000000000..ec4857c1e Binary files /dev/null and b/nwnds_module/ar_wdbma_obs01.uti differ diff --git a/nwnds_module/ar_wdbma_obs02.uti b/nwnds_module/ar_wdbma_obs02.uti new file mode 100644 index 000000000..2d443959b Binary files /dev/null and b/nwnds_module/ar_wdbma_obs02.uti differ diff --git a/nwnds_module/ar_wdbma_stone01.uti b/nwnds_module/ar_wdbma_stone01.uti new file mode 100644 index 000000000..5a7616a49 Binary files /dev/null and b/nwnds_module/ar_wdbma_stone01.uti differ diff --git a/nwnds_module/ar_wdbmax_cerule.uti b/nwnds_module/ar_wdbmax_cerule.uti new file mode 100644 index 000000000..5dbe8ea18 Binary files /dev/null and b/nwnds_module/ar_wdbmax_cerule.uti differ diff --git a/nwnds_module/ar_wdbmax_destin.uti b/nwnds_module/ar_wdbmax_destin.uti new file mode 100644 index 000000000..bbb5ed5e7 Binary files /dev/null and b/nwnds_module/ar_wdbmax_destin.uti differ diff --git a/nwnds_module/ar_wdbmax_dfence.uti b/nwnds_module/ar_wdbmax_dfence.uti new file mode 100644 index 000000000..a4288eb30 Binary files /dev/null and b/nwnds_module/ar_wdbmax_dfence.uti differ diff --git a/nwnds_module/ar_wdbmax_ebon.uti b/nwnds_module/ar_wdbmax_ebon.uti new file mode 100644 index 000000000..27a79bc37 Binary files /dev/null and b/nwnds_module/ar_wdbmax_ebon.uti differ diff --git a/nwnds_module/ar_wdbmax_fassho.uti b/nwnds_module/ar_wdbmax_fassho.uti new file mode 100644 index 000000000..258f34dbc Binary files /dev/null and b/nwnds_module/ar_wdbmax_fassho.uti differ diff --git a/nwnds_module/ar_wdbmax_garrao.uti b/nwnds_module/ar_wdbmax_garrao.uti new file mode 100644 index 000000000..d87051239 Binary files /dev/null and b/nwnds_module/ar_wdbmax_garrao.uti differ diff --git a/nwnds_module/ar_wdbmax_nightf.uti b/nwnds_module/ar_wdbmax_nightf.uti new file mode 100644 index 000000000..0f6169d94 Binary files /dev/null and b/nwnds_module/ar_wdbmax_nightf.uti differ diff --git a/nwnds_module/ar_wdbmax_power.uti b/nwnds_module/ar_wdbmax_power.uti new file mode 100644 index 000000000..eea9d7695 Binary files /dev/null and b/nwnds_module/ar_wdbmax_power.uti differ diff --git a/nwnds_module/ar_wdbmax_whirl.uti b/nwnds_module/ar_wdbmax_whirl.uti new file mode 100644 index 000000000..28160371c Binary files /dev/null and b/nwnds_module/ar_wdbmax_whirl.uti differ diff --git a/nwnds_module/ar_wdbmma_chaos.uti b/nwnds_module/ar_wdbmma_chaos.uti new file mode 100644 index 000000000..bcfc30841 Binary files /dev/null and b/nwnds_module/ar_wdbmma_chaos.uti differ diff --git a/nwnds_module/ar_wdbmma_defend.uti b/nwnds_module/ar_wdbmma_defend.uti new file mode 100644 index 000000000..1ef5b2f54 Binary files /dev/null and b/nwnds_module/ar_wdbmma_defend.uti differ diff --git a/nwnds_module/ar_wdbmma_orms.uti b/nwnds_module/ar_wdbmma_orms.uti new file mode 100644 index 000000000..3f56db6d3 Binary files /dev/null and b/nwnds_module/ar_wdbmma_orms.uti differ diff --git a/nwnds_module/ar_wdbmma_saliks.uti b/nwnds_module/ar_wdbmma_saliks.uti new file mode 100644 index 000000000..f8e0b9129 Binary files /dev/null and b/nwnds_module/ar_wdbmma_saliks.uti differ diff --git a/nwnds_module/ar_wdbmma_stnstk.uti b/nwnds_module/ar_wdbmma_stnstk.uti new file mode 100644 index 000000000..d37f4821c Binary files /dev/null and b/nwnds_module/ar_wdbmma_stnstk.uti differ diff --git a/nwnds_module/ar_wdbmma_sunbsh.uti b/nwnds_module/ar_wdbmma_sunbsh.uti new file mode 100644 index 000000000..fbbc38bb1 Binary files /dev/null and b/nwnds_module/ar_wdbmma_sunbsh.uti differ diff --git a/nwnds_module/ar_wdbmma_thundr.uti b/nwnds_module/ar_wdbmma_thundr.uti new file mode 100644 index 000000000..9eb2d5132 Binary files /dev/null and b/nwnds_module/ar_wdbmma_thundr.uti differ diff --git a/nwnds_module/ar_wdbmqs_antic.uti b/nwnds_module/ar_wdbmqs_antic.uti new file mode 100644 index 000000000..f339dd621 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_antic.uti differ diff --git a/nwnds_module/ar_wdbmqs_brambl.uti b/nwnds_module/ar_wdbmqs_brambl.uti new file mode 100644 index 000000000..afe74d124 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_brambl.uti differ diff --git a/nwnds_module/ar_wdbmqs_briarw.uti b/nwnds_module/ar_wdbmqs_briarw.uti new file mode 100644 index 000000000..6ce9a1550 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_briarw.uti differ diff --git a/nwnds_module/ar_wdbmqs_dfense.uti b/nwnds_module/ar_wdbmqs_dfense.uti new file mode 100644 index 000000000..20b325abc Binary files /dev/null and b/nwnds_module/ar_wdbmqs_dfense.uti differ diff --git a/nwnds_module/ar_wdbmqs_humble.uti b/nwnds_module/ar_wdbmqs_humble.uti new file mode 100644 index 000000000..0184a0037 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_humble.uti differ diff --git a/nwnds_module/ar_wdbmqs_oasis.uti b/nwnds_module/ar_wdbmqs_oasis.uti new file mode 100644 index 000000000..01686a981 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_oasis.uti differ diff --git a/nwnds_module/ar_wdbmqs_shadow.uti b/nwnds_module/ar_wdbmqs_shadow.uti new file mode 100644 index 000000000..dd8376356 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_shadow.uti differ diff --git a/nwnds_module/ar_wdbmqs_souls.uti b/nwnds_module/ar_wdbmqs_souls.uti new file mode 100644 index 000000000..4f6c5848c Binary files /dev/null and b/nwnds_module/ar_wdbmqs_souls.uti differ diff --git a/nwnds_module/ar_wdbmqs_sun.uti b/nwnds_module/ar_wdbmqs_sun.uti new file mode 100644 index 000000000..5147fc6a3 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_sun.uti differ diff --git a/nwnds_module/ar_wdbmqs_tyrant.uti b/nwnds_module/ar_wdbmqs_tyrant.uti new file mode 100644 index 000000000..4deaaeec6 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_tyrant.uti differ diff --git a/nwnds_module/ar_wdbmqs_virran.uti b/nwnds_module/ar_wdbmqs_virran.uti new file mode 100644 index 000000000..9de047f46 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_virran.uti differ diff --git a/nwnds_module/ar_wdbmqs_water.uti b/nwnds_module/ar_wdbmqs_water.uti new file mode 100644 index 000000000..312ba38f2 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_water.uti differ diff --git a/nwnds_module/ar_wdbmqs_woodmn.uti b/nwnds_module/ar_wdbmqs_woodmn.uti new file mode 100644 index 000000000..64fb418e3 Binary files /dev/null and b/nwnds_module/ar_wdbmqs_woodmn.uti differ diff --git a/nwnds_module/ar_wdbmsw_crippl.uti b/nwnds_module/ar_wdbmsw_crippl.uti new file mode 100644 index 000000000..0bce4f103 Binary files /dev/null and b/nwnds_module/ar_wdbmsw_crippl.uti differ diff --git a/nwnds_module/ar_wdbmsw_dichot.uti b/nwnds_module/ar_wdbmsw_dichot.uti new file mode 100644 index 000000000..4531f4fe8 Binary files /dev/null and b/nwnds_module/ar_wdbmsw_dichot.uti differ diff --git a/nwnds_module/ar_wdbmsw_helves.uti b/nwnds_module/ar_wdbmsw_helves.uti new file mode 100644 index 000000000..ec30554c2 Binary files /dev/null and b/nwnds_module/ar_wdbmsw_helves.uti differ diff --git a/nwnds_module/ar_wdbmsw_icyhrt.uti b/nwnds_module/ar_wdbmsw_icyhrt.uti new file mode 100644 index 000000000..c759b68ac Binary files /dev/null and b/nwnds_module/ar_wdbmsw_icyhrt.uti differ diff --git a/nwnds_module/ar_wdbmsw_shock.uti b/nwnds_module/ar_wdbmsw_shock.uti new file mode 100644 index 000000000..e335a0f86 Binary files /dev/null and b/nwnds_module/ar_wdbmsw_shock.uti differ diff --git a/nwnds_module/ar_wdbmsw_viciou.uti b/nwnds_module/ar_wdbmsw_viciou.uti new file mode 100644 index 000000000..35c081d5f Binary files /dev/null and b/nwnds_module/ar_wdbmsw_viciou.uti differ diff --git a/nwnds_module/ar_wdbmsw_viper.uti b/nwnds_module/ar_wdbmsw_viper.uti new file mode 100644 index 000000000..7f7e97578 Binary files /dev/null and b/nwnds_module/ar_wdbmsw_viper.uti differ diff --git a/nwnds_module/ar_wdbpax_acid01.uti b/nwnds_module/ar_wdbpax_acid01.uti new file mode 100644 index 000000000..cc3627247 Binary files /dev/null and b/nwnds_module/ar_wdbpax_acid01.uti differ diff --git a/nwnds_module/ar_wdbpax_acid02.uti b/nwnds_module/ar_wdbpax_acid02.uti new file mode 100644 index 000000000..e8e2844a2 Binary files /dev/null and b/nwnds_module/ar_wdbpax_acid02.uti differ diff --git a/nwnds_module/ar_wdbpax_elec01.uti b/nwnds_module/ar_wdbpax_elec01.uti new file mode 100644 index 000000000..acbe6a098 Binary files /dev/null and b/nwnds_module/ar_wdbpax_elec01.uti differ diff --git a/nwnds_module/ar_wdbpax_elec02.uti b/nwnds_module/ar_wdbpax_elec02.uti new file mode 100644 index 000000000..2c404fa5d Binary files /dev/null and b/nwnds_module/ar_wdbpax_elec02.uti differ diff --git a/nwnds_module/ar_wdbpax_fire01.uti b/nwnds_module/ar_wdbpax_fire01.uti new file mode 100644 index 000000000..0b8fda724 Binary files /dev/null and b/nwnds_module/ar_wdbpax_fire01.uti differ diff --git a/nwnds_module/ar_wdbpax_fire02.uti b/nwnds_module/ar_wdbpax_fire02.uti new file mode 100644 index 000000000..ba14e2acf Binary files /dev/null and b/nwnds_module/ar_wdbpax_fire02.uti differ diff --git a/nwnds_module/ar_wdbpax_ice01.uti b/nwnds_module/ar_wdbpax_ice01.uti new file mode 100644 index 000000000..b71620dd3 Binary files /dev/null and b/nwnds_module/ar_wdbpax_ice01.uti differ diff --git a/nwnds_module/ar_wdbpax_ice02.uti b/nwnds_module/ar_wdbpax_ice02.uti new file mode 100644 index 000000000..da842c074 Binary files /dev/null and b/nwnds_module/ar_wdbpax_ice02.uti differ diff --git a/nwnds_module/ar_wdbpma_acid01.uti b/nwnds_module/ar_wdbpma_acid01.uti new file mode 100644 index 000000000..3c1a0fabd Binary files /dev/null and b/nwnds_module/ar_wdbpma_acid01.uti differ diff --git a/nwnds_module/ar_wdbpma_acid02.uti b/nwnds_module/ar_wdbpma_acid02.uti new file mode 100644 index 000000000..b42dd2b6c Binary files /dev/null and b/nwnds_module/ar_wdbpma_acid02.uti differ diff --git a/nwnds_module/ar_wdbpma_elec01.uti b/nwnds_module/ar_wdbpma_elec01.uti new file mode 100644 index 000000000..8e5226eda Binary files /dev/null and b/nwnds_module/ar_wdbpma_elec01.uti differ diff --git a/nwnds_module/ar_wdbpma_elec02.uti b/nwnds_module/ar_wdbpma_elec02.uti new file mode 100644 index 000000000..ca1847665 Binary files /dev/null and b/nwnds_module/ar_wdbpma_elec02.uti differ diff --git a/nwnds_module/ar_wdbpma_fire01.uti b/nwnds_module/ar_wdbpma_fire01.uti new file mode 100644 index 000000000..b5c758ba9 Binary files /dev/null and b/nwnds_module/ar_wdbpma_fire01.uti differ diff --git a/nwnds_module/ar_wdbpma_fire02.uti b/nwnds_module/ar_wdbpma_fire02.uti new file mode 100644 index 000000000..e95754e6f Binary files /dev/null and b/nwnds_module/ar_wdbpma_fire02.uti differ diff --git a/nwnds_module/ar_wdbpma_ice01.uti b/nwnds_module/ar_wdbpma_ice01.uti new file mode 100644 index 000000000..663b62536 Binary files /dev/null and b/nwnds_module/ar_wdbpma_ice01.uti differ diff --git a/nwnds_module/ar_wdbpma_ice02.uti b/nwnds_module/ar_wdbpma_ice02.uti new file mode 100644 index 000000000..0499908a3 Binary files /dev/null and b/nwnds_module/ar_wdbpma_ice02.uti differ diff --git a/nwnds_module/ar_wdbpqs_acid01.uti b/nwnds_module/ar_wdbpqs_acid01.uti new file mode 100644 index 000000000..2e5fd0ae8 Binary files /dev/null and b/nwnds_module/ar_wdbpqs_acid01.uti differ diff --git a/nwnds_module/ar_wdbpqs_acid02.uti b/nwnds_module/ar_wdbpqs_acid02.uti new file mode 100644 index 000000000..e155d6f8b Binary files /dev/null and b/nwnds_module/ar_wdbpqs_acid02.uti differ diff --git a/nwnds_module/ar_wdbpqs_elec01.uti b/nwnds_module/ar_wdbpqs_elec01.uti new file mode 100644 index 000000000..a5911da1a Binary files /dev/null and b/nwnds_module/ar_wdbpqs_elec01.uti differ diff --git a/nwnds_module/ar_wdbpqs_elec02.uti b/nwnds_module/ar_wdbpqs_elec02.uti new file mode 100644 index 000000000..7d2291bad Binary files /dev/null and b/nwnds_module/ar_wdbpqs_elec02.uti differ diff --git a/nwnds_module/ar_wdbpqs_fire01.uti b/nwnds_module/ar_wdbpqs_fire01.uti new file mode 100644 index 000000000..4210f01b5 Binary files /dev/null and b/nwnds_module/ar_wdbpqs_fire01.uti differ diff --git a/nwnds_module/ar_wdbpqs_fire02.uti b/nwnds_module/ar_wdbpqs_fire02.uti new file mode 100644 index 000000000..8fd36bc79 Binary files /dev/null and b/nwnds_module/ar_wdbpqs_fire02.uti differ diff --git a/nwnds_module/ar_wdbpqs_ice01.uti b/nwnds_module/ar_wdbpqs_ice01.uti new file mode 100644 index 000000000..259f0fe1f Binary files /dev/null and b/nwnds_module/ar_wdbpqs_ice01.uti differ diff --git a/nwnds_module/ar_wdbpqs_ice02.uti b/nwnds_module/ar_wdbpqs_ice02.uti new file mode 100644 index 000000000..983140fa8 Binary files /dev/null and b/nwnds_module/ar_wdbpqs_ice02.uti differ diff --git a/nwnds_module/ar_wdbpsw_acid01.uti b/nwnds_module/ar_wdbpsw_acid01.uti new file mode 100644 index 000000000..408ef303d Binary files /dev/null and b/nwnds_module/ar_wdbpsw_acid01.uti differ diff --git a/nwnds_module/ar_wdbpsw_acid02.uti b/nwnds_module/ar_wdbpsw_acid02.uti new file mode 100644 index 000000000..c5f7b80e1 Binary files /dev/null and b/nwnds_module/ar_wdbpsw_acid02.uti differ diff --git a/nwnds_module/ar_wdbpsw_elec01.uti b/nwnds_module/ar_wdbpsw_elec01.uti new file mode 100644 index 000000000..ce5da1a96 Binary files /dev/null and b/nwnds_module/ar_wdbpsw_elec01.uti differ diff --git a/nwnds_module/ar_wdbpsw_elec02.uti b/nwnds_module/ar_wdbpsw_elec02.uti new file mode 100644 index 000000000..048111800 Binary files /dev/null and b/nwnds_module/ar_wdbpsw_elec02.uti differ diff --git a/nwnds_module/ar_wdbpsw_fire01.uti b/nwnds_module/ar_wdbpsw_fire01.uti new file mode 100644 index 000000000..982150a0e Binary files /dev/null and b/nwnds_module/ar_wdbpsw_fire01.uti differ diff --git a/nwnds_module/ar_wdbpsw_fire02.uti b/nwnds_module/ar_wdbpsw_fire02.uti new file mode 100644 index 000000000..576889bee Binary files /dev/null and b/nwnds_module/ar_wdbpsw_fire02.uti differ diff --git a/nwnds_module/ar_wdbpsw_ice01.uti b/nwnds_module/ar_wdbpsw_ice01.uti new file mode 100644 index 000000000..dc3342068 Binary files /dev/null and b/nwnds_module/ar_wdbpsw_ice01.uti differ diff --git a/nwnds_module/ar_wdbpsw_ice02.uti b/nwnds_module/ar_wdbpsw_ice02.uti new file mode 100644 index 000000000..6967da689 Binary files /dev/null and b/nwnds_module/ar_wdbpsw_ice02.uti differ diff --git a/nwnds_module/ar_wdbqs_allloy.uti b/nwnds_module/ar_wdbqs_allloy.uti new file mode 100644 index 000000000..217a80033 Binary files /dev/null and b/nwnds_module/ar_wdbqs_allloy.uti differ diff --git a/nwnds_module/ar_wdbqs_emboss.uti b/nwnds_module/ar_wdbqs_emboss.uti new file mode 100644 index 000000000..d129835e7 Binary files /dev/null and b/nwnds_module/ar_wdbqs_emboss.uti differ diff --git a/nwnds_module/ar_wdbqs_iron01.uti b/nwnds_module/ar_wdbqs_iron01.uti new file mode 100644 index 000000000..a2fe14702 Binary files /dev/null and b/nwnds_module/ar_wdbqs_iron01.uti differ diff --git a/nwnds_module/ar_wdbqs_ivory.uti b/nwnds_module/ar_wdbqs_ivory.uti new file mode 100644 index 000000000..f13b6b7f0 Binary files /dev/null and b/nwnds_module/ar_wdbqs_ivory.uti differ diff --git a/nwnds_module/ar_wdbqs_yew01.uti b/nwnds_module/ar_wdbqs_yew01.uti new file mode 100644 index 000000000..55ae7a288 Binary files /dev/null and b/nwnds_module/ar_wdbqs_yew01.uti differ diff --git a/nwnds_module/ar_wdbsw_alloy.uti b/nwnds_module/ar_wdbsw_alloy.uti new file mode 100644 index 000000000..25e1d9f73 Binary files /dev/null and b/nwnds_module/ar_wdbsw_alloy.uti differ diff --git a/nwnds_module/ar_wdbsw_iron01.uti b/nwnds_module/ar_wdbsw_iron01.uti new file mode 100644 index 000000000..e36533620 Binary files /dev/null and b/nwnds_module/ar_wdbsw_iron01.uti differ diff --git a/nwnds_module/ar_wdbsw_ivory.uti b/nwnds_module/ar_wdbsw_ivory.uti new file mode 100644 index 000000000..5aabd925c Binary files /dev/null and b/nwnds_module/ar_wdbsw_ivory.uti differ diff --git a/nwnds_module/ar_wdbsw_obs01.uti b/nwnds_module/ar_wdbsw_obs01.uti new file mode 100644 index 000000000..eef4fe08f Binary files /dev/null and b/nwnds_module/ar_wdbsw_obs01.uti differ diff --git a/nwnds_module/ar_wdbsw_obs02.uti b/nwnds_module/ar_wdbsw_obs02.uti new file mode 100644 index 000000000..783262a79 Binary files /dev/null and b/nwnds_module/ar_wdbsw_obs02.uti differ diff --git a/nwnds_module/ar_wdvwn_power.uti b/nwnds_module/ar_wdvwn_power.uti new file mode 100644 index 000000000..a448b8837 Binary files /dev/null and b/nwnds_module/ar_wdvwn_power.uti differ diff --git a/nwnds_module/ar_wdvwn_restore.uti b/nwnds_module/ar_wdvwn_restore.uti new file mode 100644 index 000000000..8d0b94daa Binary files /dev/null and b/nwnds_module/ar_wdvwn_restore.uti differ diff --git a/nwnds_module/ar_wdvwn_retrib.uti b/nwnds_module/ar_wdvwn_retrib.uti new file mode 100644 index 000000000..1f41d9e72 Binary files /dev/null and b/nwnds_module/ar_wdvwn_retrib.uti differ diff --git a/nwnds_module/ar_wdvwn_sanctua.uti b/nwnds_module/ar_wdvwn_sanctua.uti new file mode 100644 index 000000000..8a49fe4be Binary files /dev/null and b/nwnds_module/ar_wdvwn_sanctua.uti differ diff --git a/nwnds_module/ar_whips.utm b/nwnds_module/ar_whips.utm new file mode 100644 index 000000000..8ae1510d1 Binary files /dev/null and b/nwnds_module/ar_whips.utm differ diff --git a/nwnds_module/ar_widowsknives.utm b/nwnds_module/ar_widowsknives.utm new file mode 100644 index 000000000..3ee7aa435 Binary files /dev/null and b/nwnds_module/ar_widowsknives.utm differ diff --git a/nwnds_module/ar_wmgrd_bandit.uti b/nwnds_module/ar_wmgrd_bandit.uti new file mode 100644 index 000000000..026192c83 Binary files /dev/null and b/nwnds_module/ar_wmgrd_bandit.uti differ diff --git a/nwnds_module/ar_wmgrd_elem01.uti b/nwnds_module/ar_wmgrd_elem01.uti new file mode 100644 index 000000000..40df11115 Binary files /dev/null and b/nwnds_module/ar_wmgrd_elem01.uti differ diff --git a/nwnds_module/ar_wmgrd_elem02.uti b/nwnds_module/ar_wmgrd_elem02.uti new file mode 100644 index 000000000..5a0deaff5 Binary files /dev/null and b/nwnds_module/ar_wmgrd_elem02.uti differ diff --git a/nwnds_module/ar_wmgrd_elem03.uti b/nwnds_module/ar_wmgrd_elem03.uti new file mode 100644 index 000000000..3f7024885 Binary files /dev/null and b/nwnds_module/ar_wmgrd_elem03.uti differ diff --git a/nwnds_module/ar_wmgrd_flamet.uti b/nwnds_module/ar_wmgrd_flamet.uti new file mode 100644 index 000000000..8d49c30f4 Binary files /dev/null and b/nwnds_module/ar_wmgrd_flamet.uti differ diff --git a/nwnds_module/ar_wmgrd_healing.uti b/nwnds_module/ar_wmgrd_healing.uti new file mode 100644 index 000000000..fc0d4dc4c Binary files /dev/null and b/nwnds_module/ar_wmgrd_healing.uti differ diff --git a/nwnds_module/ar_wmgrd_witch.uti b/nwnds_module/ar_wmgrd_witch.uti new file mode 100644 index 000000000..4cd02616d Binary files /dev/null and b/nwnds_module/ar_wmgrd_witch.uti differ diff --git a/nwnds_module/ar_wmgst_black.uti b/nwnds_module/ar_wmgst_black.uti new file mode 100644 index 000000000..7a98f5bdf Binary files /dev/null and b/nwnds_module/ar_wmgst_black.uti differ diff --git a/nwnds_module/ar_wmgst_boon.uti b/nwnds_module/ar_wmgst_boon.uti new file mode 100644 index 000000000..bbdc78e47 Binary files /dev/null and b/nwnds_module/ar_wmgst_boon.uti differ diff --git a/nwnds_module/ar_wmgst_decepti.uti b/nwnds_module/ar_wmgst_decepti.uti new file mode 100644 index 000000000..af5f7d17f Binary files /dev/null and b/nwnds_module/ar_wmgst_decepti.uti differ diff --git a/nwnds_module/ar_wmgst_devour.uti b/nwnds_module/ar_wmgst_devour.uti new file mode 100644 index 000000000..a29964962 Binary files /dev/null and b/nwnds_module/ar_wmgst_devour.uti differ diff --git a/nwnds_module/ar_wmgst_elemend.uti b/nwnds_module/ar_wmgst_elemend.uti new file mode 100644 index 000000000..b54f4b726 Binary files /dev/null and b/nwnds_module/ar_wmgst_elemend.uti differ diff --git a/nwnds_module/ar_wmgst_frdrake.uti b/nwnds_module/ar_wmgst_frdrake.uti new file mode 100644 index 000000000..4ddb17fa6 Binary files /dev/null and b/nwnds_module/ar_wmgst_frdrake.uti differ diff --git a/nwnds_module/ar_wmgst_gflame.uti b/nwnds_module/ar_wmgst_gflame.uti new file mode 100644 index 000000000..9d7e1dabf Binary files /dev/null and b/nwnds_module/ar_wmgst_gflame.uti differ diff --git a/nwnds_module/ar_wmgst_gray.uti b/nwnds_module/ar_wmgst_gray.uti new file mode 100644 index 000000000..a6f562059 Binary files /dev/null and b/nwnds_module/ar_wmgst_gray.uti differ diff --git a/nwnds_module/ar_wmgst_grystem.uti b/nwnds_module/ar_wmgst_grystem.uti new file mode 100644 index 000000000..de0730c24 Binary files /dev/null and b/nwnds_module/ar_wmgst_grystem.uti differ diff --git a/nwnds_module/ar_wmgst_guthal.uti b/nwnds_module/ar_wmgst_guthal.uti new file mode 100644 index 000000000..38d49140b Binary files /dev/null and b/nwnds_module/ar_wmgst_guthal.uti differ diff --git a/nwnds_module/ar_wmgst_herald.uti b/nwnds_module/ar_wmgst_herald.uti new file mode 100644 index 000000000..7c8c223ee Binary files /dev/null and b/nwnds_module/ar_wmgst_herald.uti differ diff --git a/nwnds_module/ar_wmgst_hope.uti b/nwnds_module/ar_wmgst_hope.uti new file mode 100644 index 000000000..9e289d9ef Binary files /dev/null and b/nwnds_module/ar_wmgst_hope.uti differ diff --git a/nwnds_module/ar_wmgst_lalors.uti b/nwnds_module/ar_wmgst_lalors.uti new file mode 100644 index 000000000..201ffde68 Binary files /dev/null and b/nwnds_module/ar_wmgst_lalors.uti differ diff --git a/nwnds_module/ar_wmgst_lshwstk.uti b/nwnds_module/ar_wmgst_lshwstk.uti new file mode 100644 index 000000000..997d1f2af Binary files /dev/null and b/nwnds_module/ar_wmgst_lshwstk.uti differ diff --git a/nwnds_module/ar_wmgst_nature.uti b/nwnds_module/ar_wmgst_nature.uti new file mode 100644 index 000000000..c51581275 Binary files /dev/null and b/nwnds_module/ar_wmgst_nature.uti differ diff --git a/nwnds_module/ar_wmgst_oasis.uti b/nwnds_module/ar_wmgst_oasis.uti new file mode 100644 index 000000000..a082b8977 Binary files /dev/null and b/nwnds_module/ar_wmgst_oasis.uti differ diff --git a/nwnds_module/ar_wmgst_omega.uti b/nwnds_module/ar_wmgst_omega.uti new file mode 100644 index 000000000..7b6538766 Binary files /dev/null and b/nwnds_module/ar_wmgst_omega.uti differ diff --git a/nwnds_module/ar_wmgst_prize.uti b/nwnds_module/ar_wmgst_prize.uti new file mode 100644 index 000000000..c9445c66a Binary files /dev/null and b/nwnds_module/ar_wmgst_prize.uti differ diff --git a/nwnds_module/ar_wmgst_protect.uti b/nwnds_module/ar_wmgst_protect.uti new file mode 100644 index 000000000..bb4abe195 Binary files /dev/null and b/nwnds_module/ar_wmgst_protect.uti differ diff --git a/nwnds_module/ar_wmgst_radian.uti b/nwnds_module/ar_wmgst_radian.uti new file mode 100644 index 000000000..fe9e4ca65 Binary files /dev/null and b/nwnds_module/ar_wmgst_radian.uti differ diff --git a/nwnds_module/ar_wmgst_sage.uti b/nwnds_module/ar_wmgst_sage.uti new file mode 100644 index 000000000..9a42519b8 Binary files /dev/null and b/nwnds_module/ar_wmgst_sage.uti differ diff --git a/nwnds_module/ar_wmgst_storms.uti b/nwnds_module/ar_wmgst_storms.uti new file mode 100644 index 000000000..be9c533d7 Binary files /dev/null and b/nwnds_module/ar_wmgst_storms.uti differ diff --git a/nwnds_module/ar_wmgst_troubad.uti b/nwnds_module/ar_wmgst_troubad.uti new file mode 100644 index 000000000..79b5a5549 Binary files /dev/null and b/nwnds_module/ar_wmgst_troubad.uti differ diff --git a/nwnds_module/ar_wmgwn_acid01.uti b/nwnds_module/ar_wmgwn_acid01.uti new file mode 100644 index 000000000..e78c3fdbb Binary files /dev/null and b/nwnds_module/ar_wmgwn_acid01.uti differ diff --git a/nwnds_module/ar_wmgwn_acid02.uti b/nwnds_module/ar_wmgwn_acid02.uti new file mode 100644 index 000000000..f9119bcd3 Binary files /dev/null and b/nwnds_module/ar_wmgwn_acid02.uti differ diff --git a/nwnds_module/ar_wmgwn_elec01.uti b/nwnds_module/ar_wmgwn_elec01.uti new file mode 100644 index 000000000..4b5064581 Binary files /dev/null and b/nwnds_module/ar_wmgwn_elec01.uti differ diff --git a/nwnds_module/ar_wmgwn_elec02.uti b/nwnds_module/ar_wmgwn_elec02.uti new file mode 100644 index 000000000..428c35810 Binary files /dev/null and b/nwnds_module/ar_wmgwn_elec02.uti differ diff --git a/nwnds_module/ar_wmgwn_entropy.uti b/nwnds_module/ar_wmgwn_entropy.uti new file mode 100644 index 000000000..8833fa542 Binary files /dev/null and b/nwnds_module/ar_wmgwn_entropy.uti differ diff --git a/nwnds_module/ar_wmgwn_fire01.uti b/nwnds_module/ar_wmgwn_fire01.uti new file mode 100644 index 000000000..01cc0d92c Binary files /dev/null and b/nwnds_module/ar_wmgwn_fire01.uti differ diff --git a/nwnds_module/ar_wmgwn_fire02.uti b/nwnds_module/ar_wmgwn_fire02.uti new file mode 100644 index 000000000..befd71831 Binary files /dev/null and b/nwnds_module/ar_wmgwn_fire02.uti differ diff --git a/nwnds_module/ar_wmgwn_force01.uti b/nwnds_module/ar_wmgwn_force01.uti new file mode 100644 index 000000000..3500e8d0f Binary files /dev/null and b/nwnds_module/ar_wmgwn_force01.uti differ diff --git a/nwnds_module/ar_wmgwn_ice02.uti b/nwnds_module/ar_wmgwn_ice02.uti new file mode 100644 index 000000000..2624f572d Binary files /dev/null and b/nwnds_module/ar_wmgwn_ice02.uti differ diff --git a/nwnds_module/ar_wmgwn_jail.uti b/nwnds_module/ar_wmgwn_jail.uti new file mode 100644 index 000000000..a4c0a2550 Binary files /dev/null and b/nwnds_module/ar_wmgwn_jail.uti differ diff --git a/nwnds_module/ar_wmgwn_negnrg.uti b/nwnds_module/ar_wmgwn_negnrg.uti new file mode 100644 index 000000000..d6de43e2b Binary files /dev/null and b/nwnds_module/ar_wmgwn_negnrg.uti differ diff --git a/nwnds_module/ar_wmgwn_xp.uti b/nwnds_module/ar_wmgwn_xp.uti new file mode 100644 index 000000000..6cd631aca Binary files /dev/null and b/nwnds_module/ar_wmgwn_xp.uti differ diff --git a/nwnds_module/ar_wolfspider001.utc b/nwnds_module/ar_wolfspider001.utc new file mode 100644 index 000000000..956fa1eb3 Binary files /dev/null and b/nwnds_module/ar_wolfspider001.utc differ diff --git a/nwnds_module/ar_wplhb_alloy.uti b/nwnds_module/ar_wplhb_alloy.uti new file mode 100644 index 000000000..ff293c465 Binary files /dev/null and b/nwnds_module/ar_wplhb_alloy.uti differ diff --git a/nwnds_module/ar_wplhb_bone01.uti b/nwnds_module/ar_wplhb_bone01.uti new file mode 100644 index 000000000..34aef8307 Binary files /dev/null and b/nwnds_module/ar_wplhb_bone01.uti differ diff --git a/nwnds_module/ar_wplhb_iron01.uti b/nwnds_module/ar_wplhb_iron01.uti new file mode 100644 index 000000000..fe2150d0b Binary files /dev/null and b/nwnds_module/ar_wplhb_iron01.uti differ diff --git a/nwnds_module/ar_wplhb_ivory.uti b/nwnds_module/ar_wplhb_ivory.uti new file mode 100644 index 000000000..8b8c001bc Binary files /dev/null and b/nwnds_module/ar_wplhb_ivory.uti differ diff --git a/nwnds_module/ar_wplhb_obs01.uti b/nwnds_module/ar_wplhb_obs01.uti new file mode 100644 index 000000000..bb00d2255 Binary files /dev/null and b/nwnds_module/ar_wplhb_obs01.uti differ diff --git a/nwnds_module/ar_wplhb_obs02.uti b/nwnds_module/ar_wplhb_obs02.uti new file mode 100644 index 000000000..30e2378df Binary files /dev/null and b/nwnds_module/ar_wplhb_obs02.uti differ diff --git a/nwnds_module/ar_wplmhb_bgbang.uti b/nwnds_module/ar_wplmhb_bgbang.uti new file mode 100644 index 000000000..57bb8e967 Binary files /dev/null and b/nwnds_module/ar_wplmhb_bgbang.uti differ diff --git a/nwnds_module/ar_wplmhb_guard.uti b/nwnds_module/ar_wplmhb_guard.uti new file mode 100644 index 000000000..281b1b1d4 Binary files /dev/null and b/nwnds_module/ar_wplmhb_guard.uti differ diff --git a/nwnds_module/ar_wplmhb_lightn.uti b/nwnds_module/ar_wplmhb_lightn.uti new file mode 100644 index 000000000..dfbe7508f Binary files /dev/null and b/nwnds_module/ar_wplmhb_lightn.uti differ diff --git a/nwnds_module/ar_wplmhb_lslash.uti b/nwnds_module/ar_wplmhb_lslash.uti new file mode 100644 index 000000000..18d020b43 Binary files /dev/null and b/nwnds_module/ar_wplmhb_lslash.uti differ diff --git a/nwnds_module/ar_wplmhb_obas.uti b/nwnds_module/ar_wplmhb_obas.uti new file mode 100644 index 000000000..f7e5ffa50 Binary files /dev/null and b/nwnds_module/ar_wplmhb_obas.uti differ diff --git a/nwnds_module/ar_wplmhb_oearth.uti b/nwnds_module/ar_wplmhb_oearth.uti new file mode 100644 index 000000000..4d238b16b Binary files /dev/null and b/nwnds_module/ar_wplmhb_oearth.uti differ diff --git a/nwnds_module/ar_wplmsc_babau.uti b/nwnds_module/ar_wplmsc_babau.uti new file mode 100644 index 000000000..79f2ca6fd Binary files /dev/null and b/nwnds_module/ar_wplmsc_babau.uti differ diff --git a/nwnds_module/ar_wplmsc_bastio.uti b/nwnds_module/ar_wplmsc_bastio.uti new file mode 100644 index 000000000..0f304edf5 Binary files /dev/null and b/nwnds_module/ar_wplmsc_bastio.uti differ diff --git a/nwnds_module/ar_wplmsc_bleed.uti b/nwnds_module/ar_wplmsc_bleed.uti new file mode 100644 index 000000000..6d3cd7f76 Binary files /dev/null and b/nwnds_module/ar_wplmsc_bleed.uti differ diff --git a/nwnds_module/ar_wplmsc_moon.uti b/nwnds_module/ar_wplmsc_moon.uti new file mode 100644 index 000000000..b4c592787 Binary files /dev/null and b/nwnds_module/ar_wplmsc_moon.uti differ diff --git a/nwnds_module/ar_wplmsc_raaig.uti b/nwnds_module/ar_wplmsc_raaig.uti new file mode 100644 index 000000000..bec15131c Binary files /dev/null and b/nwnds_module/ar_wplmsc_raaig.uti differ diff --git a/nwnds_module/ar_wplmsc_silenc.uti b/nwnds_module/ar_wplmsc_silenc.uti new file mode 100644 index 000000000..68f46e916 Binary files /dev/null and b/nwnds_module/ar_wplmsc_silenc.uti differ diff --git a/nwnds_module/ar_wplmsc_solar.uti b/nwnds_module/ar_wplmsc_solar.uti new file mode 100644 index 000000000..18a40ef59 Binary files /dev/null and b/nwnds_module/ar_wplmsc_solar.uti differ diff --git a/nwnds_module/ar_wplmsc_wullum.uti b/nwnds_module/ar_wplmsc_wullum.uti new file mode 100644 index 000000000..138476d9f Binary files /dev/null and b/nwnds_module/ar_wplmsc_wullum.uti differ diff --git a/nwnds_module/ar_wplmss_ghulk.uti b/nwnds_module/ar_wplmss_ghulk.uti new file mode 100644 index 000000000..a30feba78 Binary files /dev/null and b/nwnds_module/ar_wplmss_ghulk.uti differ diff --git a/nwnds_module/ar_wplmss_kikck.uti b/nwnds_module/ar_wplmss_kikck.uti new file mode 100644 index 000000000..34590d4c4 Binary files /dev/null and b/nwnds_module/ar_wplmss_kikck.uti differ diff --git a/nwnds_module/ar_wplmss_light.uti b/nwnds_module/ar_wplmss_light.uti new file mode 100644 index 000000000..d1501fb58 Binary files /dev/null and b/nwnds_module/ar_wplmss_light.uti differ diff --git a/nwnds_module/ar_wplmss_proud2.uti b/nwnds_module/ar_wplmss_proud2.uti new file mode 100644 index 000000000..3a0786f4c Binary files /dev/null and b/nwnds_module/ar_wplmss_proud2.uti differ diff --git a/nwnds_module/ar_wplmss_rankin.uti b/nwnds_module/ar_wplmss_rankin.uti new file mode 100644 index 000000000..65836830d Binary files /dev/null and b/nwnds_module/ar_wplmss_rankin.uti differ diff --git a/nwnds_module/ar_wplmss_shinin.uti b/nwnds_module/ar_wplmss_shinin.uti new file mode 100644 index 000000000..127a00a94 Binary files /dev/null and b/nwnds_module/ar_wplmss_shinin.uti differ diff --git a/nwnds_module/ar_wplmss_urikhg.uti b/nwnds_module/ar_wplmss_urikhg.uti new file mode 100644 index 000000000..7984ec9d2 Binary files /dev/null and b/nwnds_module/ar_wplmss_urikhg.uti differ diff --git a/nwnds_module/ar_wplmss_water.uti b/nwnds_module/ar_wplmss_water.uti new file mode 100644 index 000000000..aa8b60a43 Binary files /dev/null and b/nwnds_module/ar_wplmss_water.uti differ diff --git a/nwnds_module/ar_wplphb_acid01.uti b/nwnds_module/ar_wplphb_acid01.uti new file mode 100644 index 000000000..bd34b5246 Binary files /dev/null and b/nwnds_module/ar_wplphb_acid01.uti differ diff --git a/nwnds_module/ar_wplphb_acid02.uti b/nwnds_module/ar_wplphb_acid02.uti new file mode 100644 index 000000000..e9ebefd6b Binary files /dev/null and b/nwnds_module/ar_wplphb_acid02.uti differ diff --git a/nwnds_module/ar_wplphb_earsh.uti b/nwnds_module/ar_wplphb_earsh.uti new file mode 100644 index 000000000..a1a9c738d Binary files /dev/null and b/nwnds_module/ar_wplphb_earsh.uti differ diff --git a/nwnds_module/ar_wplphb_elec01.uti b/nwnds_module/ar_wplphb_elec01.uti new file mode 100644 index 000000000..7e3a29f07 Binary files /dev/null and b/nwnds_module/ar_wplphb_elec01.uti differ diff --git a/nwnds_module/ar_wplphb_elec02.uti b/nwnds_module/ar_wplphb_elec02.uti new file mode 100644 index 000000000..32f94d3ce Binary files /dev/null and b/nwnds_module/ar_wplphb_elec02.uti differ diff --git a/nwnds_module/ar_wplphb_fire01.uti b/nwnds_module/ar_wplphb_fire01.uti new file mode 100644 index 000000000..b0fb15037 Binary files /dev/null and b/nwnds_module/ar_wplphb_fire01.uti differ diff --git a/nwnds_module/ar_wplphb_fire02.uti b/nwnds_module/ar_wplphb_fire02.uti new file mode 100644 index 000000000..5518f3150 Binary files /dev/null and b/nwnds_module/ar_wplphb_fire02.uti differ diff --git a/nwnds_module/ar_wplphb_ice01.uti b/nwnds_module/ar_wplphb_ice01.uti new file mode 100644 index 000000000..259789618 Binary files /dev/null and b/nwnds_module/ar_wplphb_ice01.uti differ diff --git a/nwnds_module/ar_wplphb_ice02.uti b/nwnds_module/ar_wplphb_ice02.uti new file mode 100644 index 000000000..153304492 Binary files /dev/null and b/nwnds_module/ar_wplphb_ice02.uti differ diff --git a/nwnds_module/ar_wplphp_sever.uti b/nwnds_module/ar_wplphp_sever.uti new file mode 100644 index 000000000..0b62f1fee Binary files /dev/null and b/nwnds_module/ar_wplphp_sever.uti differ diff --git a/nwnds_module/ar_wplpsc_acid01.uti b/nwnds_module/ar_wplpsc_acid01.uti new file mode 100644 index 000000000..3505bf009 Binary files /dev/null and b/nwnds_module/ar_wplpsc_acid01.uti differ diff --git a/nwnds_module/ar_wplpsc_acid02.uti b/nwnds_module/ar_wplpsc_acid02.uti new file mode 100644 index 000000000..b4d459484 Binary files /dev/null and b/nwnds_module/ar_wplpsc_acid02.uti differ diff --git a/nwnds_module/ar_wplpsc_elec01.uti b/nwnds_module/ar_wplpsc_elec01.uti new file mode 100644 index 000000000..6665130dc Binary files /dev/null and b/nwnds_module/ar_wplpsc_elec01.uti differ diff --git a/nwnds_module/ar_wplpsc_elec02.uti b/nwnds_module/ar_wplpsc_elec02.uti new file mode 100644 index 000000000..3b5049da5 Binary files /dev/null and b/nwnds_module/ar_wplpsc_elec02.uti differ diff --git a/nwnds_module/ar_wplpsc_fire01.uti b/nwnds_module/ar_wplpsc_fire01.uti new file mode 100644 index 000000000..e95b8eece Binary files /dev/null and b/nwnds_module/ar_wplpsc_fire01.uti differ diff --git a/nwnds_module/ar_wplpsc_fire02.uti b/nwnds_module/ar_wplpsc_fire02.uti new file mode 100644 index 000000000..6753c012f Binary files /dev/null and b/nwnds_module/ar_wplpsc_fire02.uti differ diff --git a/nwnds_module/ar_wplpsc_ice01.uti b/nwnds_module/ar_wplpsc_ice01.uti new file mode 100644 index 000000000..3f2446705 Binary files /dev/null and b/nwnds_module/ar_wplpsc_ice01.uti differ diff --git a/nwnds_module/ar_wplpsc_ice02.uti b/nwnds_module/ar_wplpsc_ice02.uti new file mode 100644 index 000000000..0308b46ee Binary files /dev/null and b/nwnds_module/ar_wplpsc_ice02.uti differ diff --git a/nwnds_module/ar_wplpss_acid01.uti b/nwnds_module/ar_wplpss_acid01.uti new file mode 100644 index 000000000..abd4a166f Binary files /dev/null and b/nwnds_module/ar_wplpss_acid01.uti differ diff --git a/nwnds_module/ar_wplpss_acid02.uti b/nwnds_module/ar_wplpss_acid02.uti new file mode 100644 index 000000000..3ed6fca40 Binary files /dev/null and b/nwnds_module/ar_wplpss_acid02.uti differ diff --git a/nwnds_module/ar_wplpss_drake.uti b/nwnds_module/ar_wplpss_drake.uti new file mode 100644 index 000000000..a451faf96 Binary files /dev/null and b/nwnds_module/ar_wplpss_drake.uti differ diff --git a/nwnds_module/ar_wplpss_elec01.uti b/nwnds_module/ar_wplpss_elec01.uti new file mode 100644 index 000000000..05b02b94b Binary files /dev/null and b/nwnds_module/ar_wplpss_elec01.uti differ diff --git a/nwnds_module/ar_wplpss_elec02.uti b/nwnds_module/ar_wplpss_elec02.uti new file mode 100644 index 000000000..64c93ef4a Binary files /dev/null and b/nwnds_module/ar_wplpss_elec02.uti differ diff --git a/nwnds_module/ar_wplpss_fire01.uti b/nwnds_module/ar_wplpss_fire01.uti new file mode 100644 index 000000000..d37525a4c Binary files /dev/null and b/nwnds_module/ar_wplpss_fire01.uti differ diff --git a/nwnds_module/ar_wplpss_fire02.uti b/nwnds_module/ar_wplpss_fire02.uti new file mode 100644 index 000000000..8d5b9bf7e Binary files /dev/null and b/nwnds_module/ar_wplpss_fire02.uti differ diff --git a/nwnds_module/ar_wplpss_hunt.uti b/nwnds_module/ar_wplpss_hunt.uti new file mode 100644 index 000000000..4bd438194 Binary files /dev/null and b/nwnds_module/ar_wplpss_hunt.uti differ diff --git a/nwnds_module/ar_wplpss_ice01.uti b/nwnds_module/ar_wplpss_ice01.uti new file mode 100644 index 000000000..6ade183ba Binary files /dev/null and b/nwnds_module/ar_wplpss_ice01.uti differ diff --git a/nwnds_module/ar_wplpss_ice02.uti b/nwnds_module/ar_wplpss_ice02.uti new file mode 100644 index 000000000..8b20ca4fc Binary files /dev/null and b/nwnds_module/ar_wplpss_ice02.uti differ diff --git a/nwnds_module/ar_wplptr_acid01.uti b/nwnds_module/ar_wplptr_acid01.uti new file mode 100644 index 000000000..2751451c7 Binary files /dev/null and b/nwnds_module/ar_wplptr_acid01.uti differ diff --git a/nwnds_module/ar_wplptr_acid02.uti b/nwnds_module/ar_wplptr_acid02.uti new file mode 100644 index 000000000..cb1c423cf Binary files /dev/null and b/nwnds_module/ar_wplptr_acid02.uti differ diff --git a/nwnds_module/ar_wplptr_elec01.uti b/nwnds_module/ar_wplptr_elec01.uti new file mode 100644 index 000000000..af50e9e92 Binary files /dev/null and b/nwnds_module/ar_wplptr_elec01.uti differ diff --git a/nwnds_module/ar_wplptr_elec02.uti b/nwnds_module/ar_wplptr_elec02.uti new file mode 100644 index 000000000..e39b556a3 Binary files /dev/null and b/nwnds_module/ar_wplptr_elec02.uti differ diff --git a/nwnds_module/ar_wplptr_fire01.uti b/nwnds_module/ar_wplptr_fire01.uti new file mode 100644 index 000000000..c04a0da84 Binary files /dev/null and b/nwnds_module/ar_wplptr_fire01.uti differ diff --git a/nwnds_module/ar_wplptr_fire02.uti b/nwnds_module/ar_wplptr_fire02.uti new file mode 100644 index 000000000..f32b76229 Binary files /dev/null and b/nwnds_module/ar_wplptr_fire02.uti differ diff --git a/nwnds_module/ar_wplptr_ice01.uti b/nwnds_module/ar_wplptr_ice01.uti new file mode 100644 index 000000000..09eca11f5 Binary files /dev/null and b/nwnds_module/ar_wplptr_ice01.uti differ diff --git a/nwnds_module/ar_wplptr_ice02.uti b/nwnds_module/ar_wplptr_ice02.uti new file mode 100644 index 000000000..bb9b535aa Binary files /dev/null and b/nwnds_module/ar_wplptr_ice02.uti differ diff --git a/nwnds_module/ar_wplsc_alloy.uti b/nwnds_module/ar_wplsc_alloy.uti new file mode 100644 index 000000000..eee3f0b9f Binary files /dev/null and b/nwnds_module/ar_wplsc_alloy.uti differ diff --git a/nwnds_module/ar_wplsc_iron01.uti b/nwnds_module/ar_wplsc_iron01.uti new file mode 100644 index 000000000..9edd25015 Binary files /dev/null and b/nwnds_module/ar_wplsc_iron01.uti differ diff --git a/nwnds_module/ar_wplsc_ivory.uti b/nwnds_module/ar_wplsc_ivory.uti new file mode 100644 index 000000000..867bf4170 Binary files /dev/null and b/nwnds_module/ar_wplsc_ivory.uti differ diff --git a/nwnds_module/ar_wplsc_obs01.uti b/nwnds_module/ar_wplsc_obs01.uti new file mode 100644 index 000000000..4d50baa88 Binary files /dev/null and b/nwnds_module/ar_wplsc_obs01.uti differ diff --git a/nwnds_module/ar_wplsc_obs02.uti b/nwnds_module/ar_wplsc_obs02.uti new file mode 100644 index 000000000..1d3905052 Binary files /dev/null and b/nwnds_module/ar_wplsc_obs02.uti differ diff --git a/nwnds_module/ar_wplss_alloy.uti b/nwnds_module/ar_wplss_alloy.uti new file mode 100644 index 000000000..0f00df1b0 Binary files /dev/null and b/nwnds_module/ar_wplss_alloy.uti differ diff --git a/nwnds_module/ar_wplss_beast01.uti b/nwnds_module/ar_wplss_beast01.uti new file mode 100644 index 000000000..ac1445a08 Binary files /dev/null and b/nwnds_module/ar_wplss_beast01.uti differ diff --git a/nwnds_module/ar_wplss_blight.uti b/nwnds_module/ar_wplss_blight.uti new file mode 100644 index 000000000..b3b72a6eb Binary files /dev/null and b/nwnds_module/ar_wplss_blight.uti differ diff --git a/nwnds_module/ar_wplss_iron01.uti b/nwnds_module/ar_wplss_iron01.uti new file mode 100644 index 000000000..f2a2876ce Binary files /dev/null and b/nwnds_module/ar_wplss_iron01.uti differ diff --git a/nwnds_module/ar_wplss_ivory.uti b/nwnds_module/ar_wplss_ivory.uti new file mode 100644 index 000000000..dfd04623b Binary files /dev/null and b/nwnds_module/ar_wplss_ivory.uti differ diff --git a/nwnds_module/ar_wplss_lngfang.uti b/nwnds_module/ar_wplss_lngfang.uti new file mode 100644 index 000000000..c835598ef Binary files /dev/null and b/nwnds_module/ar_wplss_lngfang.uti differ diff --git a/nwnds_module/ar_wplss_obs01.uti b/nwnds_module/ar_wplss_obs01.uti new file mode 100644 index 000000000..063cf2bdb Binary files /dev/null and b/nwnds_module/ar_wplss_obs01.uti differ diff --git a/nwnds_module/ar_wplss_obs02.uti b/nwnds_module/ar_wplss_obs02.uti new file mode 100644 index 000000000..4790e13e3 Binary files /dev/null and b/nwnds_module/ar_wplss_obs02.uti differ diff --git a/nwnds_module/ar_wplss_salaman.uti b/nwnds_module/ar_wplss_salaman.uti new file mode 100644 index 000000000..9c59af8ac Binary files /dev/null and b/nwnds_module/ar_wplss_salaman.uti differ diff --git a/nwnds_module/ar_wpltr_alloy.uti b/nwnds_module/ar_wpltr_alloy.uti new file mode 100644 index 000000000..4d20cb566 Binary files /dev/null and b/nwnds_module/ar_wpltr_alloy.uti differ diff --git a/nwnds_module/ar_wpltr_iron01.uti b/nwnds_module/ar_wpltr_iron01.uti new file mode 100644 index 000000000..053359d9a Binary files /dev/null and b/nwnds_module/ar_wpltr_iron01.uti differ diff --git a/nwnds_module/ar_wpltr_ivory.uti b/nwnds_module/ar_wpltr_ivory.uti new file mode 100644 index 000000000..bbb3e01ed Binary files /dev/null and b/nwnds_module/ar_wpltr_ivory.uti differ diff --git a/nwnds_module/ar_wpsst_avi.uti b/nwnds_module/ar_wpsst_avi.uti new file mode 100644 index 000000000..2489e693c Binary files /dev/null and b/nwnds_module/ar_wpsst_avi.uti differ diff --git a/nwnds_module/ar_wpsst_belgoi.uti b/nwnds_module/ar_wpsst_belgoi.uti new file mode 100644 index 000000000..ae12eccfd Binary files /dev/null and b/nwnds_module/ar_wpsst_belgoi.uti differ diff --git a/nwnds_module/ar_wpsst_feylaar.uti b/nwnds_module/ar_wpsst_feylaar.uti new file mode 100644 index 000000000..05d8cd43c Binary files /dev/null and b/nwnds_module/ar_wpsst_feylaar.uti differ diff --git a/nwnds_module/ar_wpsst_gaj.uti b/nwnds_module/ar_wpsst_gaj.uti new file mode 100644 index 000000000..7c69460c6 Binary files /dev/null and b/nwnds_module/ar_wpsst_gaj.uti differ diff --git a/nwnds_module/ar_wpsst_klar.uti b/nwnds_module/ar_wpsst_klar.uti new file mode 100644 index 000000000..b24d35ebd Binary files /dev/null and b/nwnds_module/ar_wpsst_klar.uti differ diff --git a/nwnds_module/ar_wpsst_psurlon.uti b/nwnds_module/ar_wpsst_psurlon.uti new file mode 100644 index 000000000..36394922b Binary files /dev/null and b/nwnds_module/ar_wpsst_psurlon.uti differ diff --git a/nwnds_module/ar_wraith001.utc b/nwnds_module/ar_wraith001.utc new file mode 100644 index 000000000..2aefed47c Binary files /dev/null and b/nwnds_module/ar_wraith001.utc differ diff --git a/nwnds_module/ar_wraith002.utc b/nwnds_module/ar_wraith002.utc new file mode 100644 index 000000000..ff7e79824 Binary files /dev/null and b/nwnds_module/ar_wraith002.utc differ diff --git a/nwnds_module/ar_wraith003.utc b/nwnds_module/ar_wraith003.utc new file mode 100644 index 000000000..7ed6ccff4 Binary files /dev/null and b/nwnds_module/ar_wraith003.utc differ diff --git a/nwnds_module/ar_wsphp_copper.uti b/nwnds_module/ar_wsphp_copper.uti new file mode 100644 index 000000000..5c18f0cfa Binary files /dev/null and b/nwnds_module/ar_wsphp_copper.uti differ diff --git a/nwnds_module/ar_wsphp_heart01.uti b/nwnds_module/ar_wsphp_heart01.uti new file mode 100644 index 000000000..a29936811 Binary files /dev/null and b/nwnds_module/ar_wsphp_heart01.uti differ diff --git a/nwnds_module/ar_wsphp_iron01.uti b/nwnds_module/ar_wsphp_iron01.uti new file mode 100644 index 000000000..426c4ba67 Binary files /dev/null and b/nwnds_module/ar_wsphp_iron01.uti differ diff --git a/nwnds_module/ar_wspku_alloy.uti b/nwnds_module/ar_wspku_alloy.uti new file mode 100644 index 000000000..54bfc3596 Binary files /dev/null and b/nwnds_module/ar_wspku_alloy.uti differ diff --git a/nwnds_module/ar_wspku_iron01.uti b/nwnds_module/ar_wspku_iron01.uti new file mode 100644 index 000000000..91f81f71d Binary files /dev/null and b/nwnds_module/ar_wspku_iron01.uti differ diff --git a/nwnds_module/ar_wspku_ivory.uti b/nwnds_module/ar_wspku_ivory.uti new file mode 100644 index 000000000..0e48afa79 Binary files /dev/null and b/nwnds_module/ar_wspku_ivory.uti differ diff --git a/nwnds_module/ar_wspku_obs01.uti b/nwnds_module/ar_wspku_obs01.uti new file mode 100644 index 000000000..74ecff031 Binary files /dev/null and b/nwnds_module/ar_wspku_obs01.uti differ diff --git a/nwnds_module/ar_wspku_obs02.uti b/nwnds_module/ar_wspku_obs02.uti new file mode 100644 index 000000000..b3b94f7a0 Binary files /dev/null and b/nwnds_module/ar_wspku_obs02.uti differ diff --git a/nwnds_module/ar_wsplp_iron01.uti b/nwnds_module/ar_wsplp_iron01.uti new file mode 100644 index 000000000..4c71e2742 Binary files /dev/null and b/nwnds_module/ar_wsplp_iron01.uti differ diff --git a/nwnds_module/ar_wspmku_lali.uti b/nwnds_module/ar_wspmku_lali.uti new file mode 100644 index 000000000..bef1a413c Binary files /dev/null and b/nwnds_module/ar_wspmku_lali.uti differ diff --git a/nwnds_module/ar_wspmku_rajaat.uti b/nwnds_module/ar_wspmku_rajaat.uti new file mode 100644 index 000000000..b66d53ff3 Binary files /dev/null and b/nwnds_module/ar_wspmku_rajaat.uti differ diff --git a/nwnds_module/ar_wspmku_retts.uti b/nwnds_module/ar_wspmku_retts.uti new file mode 100644 index 000000000..c54139692 Binary files /dev/null and b/nwnds_module/ar_wspmku_retts.uti differ diff --git a/nwnds_module/ar_wspmku_sharp.uti b/nwnds_module/ar_wspmku_sharp.uti new file mode 100644 index 000000000..1a98721ad Binary files /dev/null and b/nwnds_module/ar_wspmku_sharp.uti differ diff --git a/nwnds_module/ar_wspmku_silent.uti b/nwnds_module/ar_wspmku_silent.uti new file mode 100644 index 000000000..8fbf05728 Binary files /dev/null and b/nwnds_module/ar_wspmku_silent.uti differ diff --git a/nwnds_module/ar_wspmku_unreqi.uti b/nwnds_module/ar_wspmku_unreqi.uti new file mode 100644 index 000000000..b5df545d1 Binary files /dev/null and b/nwnds_module/ar_wspmku_unreqi.uti differ diff --git a/nwnds_module/ar_wspmsc_blsoul.uti b/nwnds_module/ar_wspmsc_blsoul.uti new file mode 100644 index 000000000..4ffcf7505 Binary files /dev/null and b/nwnds_module/ar_wspmsc_blsoul.uti differ diff --git a/nwnds_module/ar_wspmsc_cinder.uti b/nwnds_module/ar_wspmsc_cinder.uti new file mode 100644 index 000000000..c513ebd2d Binary files /dev/null and b/nwnds_module/ar_wspmsc_cinder.uti differ diff --git a/nwnds_module/ar_wspmsc_gutrip.uti b/nwnds_module/ar_wspmsc_gutrip.uti new file mode 100644 index 000000000..ccadc5a36 Binary files /dev/null and b/nwnds_module/ar_wspmsc_gutrip.uti differ diff --git a/nwnds_module/ar_wspmsc_harves.uti b/nwnds_module/ar_wspmsc_harves.uti new file mode 100644 index 000000000..f7d18eeae Binary files /dev/null and b/nwnds_module/ar_wspmsc_harves.uti differ diff --git a/nwnds_module/ar_wspmsc_rhlor.uti b/nwnds_module/ar_wspmsc_rhlor.uti new file mode 100644 index 000000000..7bc961a48 Binary files /dev/null and b/nwnds_module/ar_wspmsc_rhlor.uti differ diff --git a/nwnds_module/ar_wspmsc_soulhv.uti b/nwnds_module/ar_wspmsc_soulhv.uti new file mode 100644 index 000000000..508348aab Binary files /dev/null and b/nwnds_module/ar_wspmsc_soulhv.uti differ diff --git a/nwnds_module/ar_wspmsc_verdan.uti b/nwnds_module/ar_wspmsc_verdan.uti new file mode 100644 index 000000000..59ee7d949 Binary files /dev/null and b/nwnds_module/ar_wspmsc_verdan.uti differ diff --git a/nwnds_module/ar_wspmwp_biting.uti b/nwnds_module/ar_wspmwp_biting.uti new file mode 100644 index 000000000..0d53848ff Binary files /dev/null and b/nwnds_module/ar_wspmwp_biting.uti differ diff --git a/nwnds_module/ar_wspmwp_bklash.uti b/nwnds_module/ar_wspmwp_bklash.uti new file mode 100644 index 000000000..8c1f1b54c Binary files /dev/null and b/nwnds_module/ar_wspmwp_bklash.uti differ diff --git a/nwnds_module/ar_wspmwp_black.uti b/nwnds_module/ar_wspmwp_black.uti new file mode 100644 index 000000000..27503b7b2 Binary files /dev/null and b/nwnds_module/ar_wspmwp_black.uti differ diff --git a/nwnds_module/ar_wspmwp_domina.uti b/nwnds_module/ar_wspmwp_domina.uti new file mode 100644 index 000000000..f231f784a Binary files /dev/null and b/nwnds_module/ar_wspmwp_domina.uti differ diff --git a/nwnds_module/ar_wspmwp_hells.uti b/nwnds_module/ar_wspmwp_hells.uti new file mode 100644 index 000000000..64ef2c5a7 Binary files /dev/null and b/nwnds_module/ar_wspmwp_hells.uti differ diff --git a/nwnds_module/ar_wspmwp_sachem.uti b/nwnds_module/ar_wspmwp_sachem.uti new file mode 100644 index 000000000..9d308ff87 Binary files /dev/null and b/nwnds_module/ar_wspmwp_sachem.uti differ diff --git a/nwnds_module/ar_wspmwp_sorcha.uti b/nwnds_module/ar_wspmwp_sorcha.uti new file mode 100644 index 000000000..6f3d3be81 Binary files /dev/null and b/nwnds_module/ar_wspmwp_sorcha.uti differ diff --git a/nwnds_module/ar_wspmwp_sting.uti b/nwnds_module/ar_wspmwp_sting.uti new file mode 100644 index 000000000..4b0132f4d Binary files /dev/null and b/nwnds_module/ar_wspmwp_sting.uti differ diff --git a/nwnds_module/ar_wspmwp_zans.uti b/nwnds_module/ar_wspmwp_zans.uti new file mode 100644 index 000000000..171988ffc Binary files /dev/null and b/nwnds_module/ar_wspmwp_zans.uti differ diff --git a/nwnds_module/ar_wsppk_bone01.uti b/nwnds_module/ar_wsppk_bone01.uti new file mode 100644 index 000000000..ac3616767 Binary files /dev/null and b/nwnds_module/ar_wsppk_bone01.uti differ diff --git a/nwnds_module/ar_wsppku_acid01.uti b/nwnds_module/ar_wsppku_acid01.uti new file mode 100644 index 000000000..3e97efd8b Binary files /dev/null and b/nwnds_module/ar_wsppku_acid01.uti differ diff --git a/nwnds_module/ar_wsppku_acid02.uti b/nwnds_module/ar_wsppku_acid02.uti new file mode 100644 index 000000000..0314716eb Binary files /dev/null and b/nwnds_module/ar_wsppku_acid02.uti differ diff --git a/nwnds_module/ar_wsppku_elec01.uti b/nwnds_module/ar_wsppku_elec01.uti new file mode 100644 index 000000000..030a3794e Binary files /dev/null and b/nwnds_module/ar_wsppku_elec01.uti differ diff --git a/nwnds_module/ar_wsppku_elec02.uti b/nwnds_module/ar_wsppku_elec02.uti new file mode 100644 index 000000000..fce890603 Binary files /dev/null and b/nwnds_module/ar_wsppku_elec02.uti differ diff --git a/nwnds_module/ar_wsppku_fire01.uti b/nwnds_module/ar_wsppku_fire01.uti new file mode 100644 index 000000000..ac00d46fa Binary files /dev/null and b/nwnds_module/ar_wsppku_fire01.uti differ diff --git a/nwnds_module/ar_wsppku_fire02.uti b/nwnds_module/ar_wsppku_fire02.uti new file mode 100644 index 000000000..c7f32dc0f Binary files /dev/null and b/nwnds_module/ar_wsppku_fire02.uti differ diff --git a/nwnds_module/ar_wsppku_ice01.uti b/nwnds_module/ar_wsppku_ice01.uti new file mode 100644 index 000000000..2ebc305a6 Binary files /dev/null and b/nwnds_module/ar_wsppku_ice01.uti differ diff --git a/nwnds_module/ar_wsppku_ice02.uti b/nwnds_module/ar_wsppku_ice02.uti new file mode 100644 index 000000000..ee5af71f7 Binary files /dev/null and b/nwnds_module/ar_wsppku_ice02.uti differ diff --git a/nwnds_module/ar_wsppsc_acid01.uti b/nwnds_module/ar_wsppsc_acid01.uti new file mode 100644 index 000000000..be6a7b8e8 Binary files /dev/null and b/nwnds_module/ar_wsppsc_acid01.uti differ diff --git a/nwnds_module/ar_wsppsc_acid02.uti b/nwnds_module/ar_wsppsc_acid02.uti new file mode 100644 index 000000000..c55ecee10 Binary files /dev/null and b/nwnds_module/ar_wsppsc_acid02.uti differ diff --git a/nwnds_module/ar_wsppsc_elec01.uti b/nwnds_module/ar_wsppsc_elec01.uti new file mode 100644 index 000000000..525272451 Binary files /dev/null and b/nwnds_module/ar_wsppsc_elec01.uti differ diff --git a/nwnds_module/ar_wsppsc_elec02.uti b/nwnds_module/ar_wsppsc_elec02.uti new file mode 100644 index 000000000..dbf745014 Binary files /dev/null and b/nwnds_module/ar_wsppsc_elec02.uti differ diff --git a/nwnds_module/ar_wsppsc_fire01.uti b/nwnds_module/ar_wsppsc_fire01.uti new file mode 100644 index 000000000..e17ff31dc Binary files /dev/null and b/nwnds_module/ar_wsppsc_fire01.uti differ diff --git a/nwnds_module/ar_wsppsc_fire02.uti b/nwnds_module/ar_wsppsc_fire02.uti new file mode 100644 index 000000000..9fe6bc7d4 Binary files /dev/null and b/nwnds_module/ar_wsppsc_fire02.uti differ diff --git a/nwnds_module/ar_wsppsc_ice01.uti b/nwnds_module/ar_wsppsc_ice01.uti new file mode 100644 index 000000000..5bd3521db Binary files /dev/null and b/nwnds_module/ar_wsppsc_ice01.uti differ diff --git a/nwnds_module/ar_wsppsc_ice02.uti b/nwnds_module/ar_wsppsc_ice02.uti new file mode 100644 index 000000000..becaf4b6d Binary files /dev/null and b/nwnds_module/ar_wsppsc_ice02.uti differ diff --git a/nwnds_module/ar_wsppsc_lhlor.uti b/nwnds_module/ar_wsppsc_lhlor.uti new file mode 100644 index 000000000..cf77cb5f1 Binary files /dev/null and b/nwnds_module/ar_wsppsc_lhlor.uti differ diff --git a/nwnds_module/ar_wsppwp_acid01.uti b/nwnds_module/ar_wsppwp_acid01.uti new file mode 100644 index 000000000..19c8145ef Binary files /dev/null and b/nwnds_module/ar_wsppwp_acid01.uti differ diff --git a/nwnds_module/ar_wsppwp_acid02.uti b/nwnds_module/ar_wsppwp_acid02.uti new file mode 100644 index 000000000..a2ea90da4 Binary files /dev/null and b/nwnds_module/ar_wsppwp_acid02.uti differ diff --git a/nwnds_module/ar_wsppwp_bchain.uti b/nwnds_module/ar_wsppwp_bchain.uti new file mode 100644 index 000000000..4dff4dc3e Binary files /dev/null and b/nwnds_module/ar_wsppwp_bchain.uti differ diff --git a/nwnds_module/ar_wsppwp_elec01.uti b/nwnds_module/ar_wsppwp_elec01.uti new file mode 100644 index 000000000..885c398a1 Binary files /dev/null and b/nwnds_module/ar_wsppwp_elec01.uti differ diff --git a/nwnds_module/ar_wsppwp_elec02.uti b/nwnds_module/ar_wsppwp_elec02.uti new file mode 100644 index 000000000..f8de7a1a0 Binary files /dev/null and b/nwnds_module/ar_wsppwp_elec02.uti differ diff --git a/nwnds_module/ar_wsppwp_fire01.uti b/nwnds_module/ar_wsppwp_fire01.uti new file mode 100644 index 000000000..ada164a3d Binary files /dev/null and b/nwnds_module/ar_wsppwp_fire01.uti differ diff --git a/nwnds_module/ar_wsppwp_fire02.uti b/nwnds_module/ar_wsppwp_fire02.uti new file mode 100644 index 000000000..c83862b1a Binary files /dev/null and b/nwnds_module/ar_wsppwp_fire02.uti differ diff --git a/nwnds_module/ar_wsppwp_ice01.uti b/nwnds_module/ar_wsppwp_ice01.uti new file mode 100644 index 000000000..e3ad72d29 Binary files /dev/null and b/nwnds_module/ar_wsppwp_ice01.uti differ diff --git a/nwnds_module/ar_wsppwp_ice02.uti b/nwnds_module/ar_wsppwp_ice02.uti new file mode 100644 index 000000000..bc33058e4 Binary files /dev/null and b/nwnds_module/ar_wsppwp_ice02.uti differ diff --git a/nwnds_module/ar_wspsc_alloy.uti b/nwnds_module/ar_wspsc_alloy.uti new file mode 100644 index 000000000..4979cfe42 Binary files /dev/null and b/nwnds_module/ar_wspsc_alloy.uti differ diff --git a/nwnds_module/ar_wspsc_bone01.uti b/nwnds_module/ar_wspsc_bone01.uti new file mode 100644 index 000000000..1244d9256 Binary files /dev/null and b/nwnds_module/ar_wspsc_bone01.uti differ diff --git a/nwnds_module/ar_wspsc_iron01.uti b/nwnds_module/ar_wspsc_iron01.uti new file mode 100644 index 000000000..29b1e0547 Binary files /dev/null and b/nwnds_module/ar_wspsc_iron01.uti differ diff --git a/nwnds_module/ar_wspsc_ivory.uti b/nwnds_module/ar_wspsc_ivory.uti new file mode 100644 index 000000000..ed09f6d5d Binary files /dev/null and b/nwnds_module/ar_wspsc_ivory.uti differ diff --git a/nwnds_module/ar_wspsc_obs01.uti b/nwnds_module/ar_wspsc_obs01.uti new file mode 100644 index 000000000..9ece4778b Binary files /dev/null and b/nwnds_module/ar_wspsc_obs01.uti differ diff --git a/nwnds_module/ar_wspsc_obs02.uti b/nwnds_module/ar_wspsc_obs02.uti new file mode 100644 index 000000000..586d9e7fe Binary files /dev/null and b/nwnds_module/ar_wspsc_obs02.uti differ diff --git a/nwnds_module/ar_wspwp_alloy.uti b/nwnds_module/ar_wspwp_alloy.uti new file mode 100644 index 000000000..154c79041 Binary files /dev/null and b/nwnds_module/ar_wspwp_alloy.uti differ diff --git a/nwnds_module/ar_wspwp_dewlash.uti b/nwnds_module/ar_wspwp_dewlash.uti new file mode 100644 index 000000000..9eacea9fc Binary files /dev/null and b/nwnds_module/ar_wspwp_dewlash.uti differ diff --git a/nwnds_module/ar_wspwp_iron01.uti b/nwnds_module/ar_wspwp_iron01.uti new file mode 100644 index 000000000..56da07eed Binary files /dev/null and b/nwnds_module/ar_wspwp_iron01.uti differ diff --git a/nwnds_module/ar_wspwp_ivory.uti b/nwnds_module/ar_wspwp_ivory.uti new file mode 100644 index 000000000..428692050 Binary files /dev/null and b/nwnds_module/ar_wspwp_ivory.uti differ diff --git a/nwnds_module/ar_wspwp_leather.uti b/nwnds_module/ar_wspwp_leather.uti new file mode 100644 index 000000000..7d9a28ed2 Binary files /dev/null and b/nwnds_module/ar_wspwp_leather.uti differ diff --git a/nwnds_module/ar_wswbf_bone01.uti b/nwnds_module/ar_wswbf_bone01.uti new file mode 100644 index 000000000..dade21114 Binary files /dev/null and b/nwnds_module/ar_wswbf_bone01.uti differ diff --git a/nwnds_module/ar_wswbs_alloy.uti b/nwnds_module/ar_wswbs_alloy.uti new file mode 100644 index 000000000..ab0c8ad2f Binary files /dev/null and b/nwnds_module/ar_wswbs_alloy.uti differ diff --git a/nwnds_module/ar_wswbs_iron01.uti b/nwnds_module/ar_wswbs_iron01.uti new file mode 100644 index 000000000..9cb683528 Binary files /dev/null and b/nwnds_module/ar_wswbs_iron01.uti differ diff --git a/nwnds_module/ar_wswbs_ivory.uti b/nwnds_module/ar_wswbs_ivory.uti new file mode 100644 index 000000000..338f5448a Binary files /dev/null and b/nwnds_module/ar_wswbs_ivory.uti differ diff --git a/nwnds_module/ar_wswbs_obs01.uti b/nwnds_module/ar_wswbs_obs01.uti new file mode 100644 index 000000000..9182f5a21 Binary files /dev/null and b/nwnds_module/ar_wswbs_obs01.uti differ diff --git a/nwnds_module/ar_wswbs_obs02.uti b/nwnds_module/ar_wswbs_obs02.uti new file mode 100644 index 000000000..e8eed034b Binary files /dev/null and b/nwnds_module/ar_wswbs_obs02.uti differ diff --git a/nwnds_module/ar_wswdg_alloy.uti b/nwnds_module/ar_wswdg_alloy.uti new file mode 100644 index 000000000..99447ca4b Binary files /dev/null and b/nwnds_module/ar_wswdg_alloy.uti differ diff --git a/nwnds_module/ar_wswdg_dew.uti b/nwnds_module/ar_wswdg_dew.uti new file mode 100644 index 000000000..b684cd2af Binary files /dev/null and b/nwnds_module/ar_wswdg_dew.uti differ diff --git a/nwnds_module/ar_wswdg_dullsur.uti b/nwnds_module/ar_wswdg_dullsur.uti new file mode 100644 index 000000000..07efa2685 Binary files /dev/null and b/nwnds_module/ar_wswdg_dullsur.uti differ diff --git a/nwnds_module/ar_wswdg_elven.uti b/nwnds_module/ar_wswdg_elven.uti new file mode 100644 index 000000000..f1adc7ad8 Binary files /dev/null and b/nwnds_module/ar_wswdg_elven.uti differ diff --git a/nwnds_module/ar_wswdg_iron01.uti b/nwnds_module/ar_wswdg_iron01.uti new file mode 100644 index 000000000..6dfb3aa4c Binary files /dev/null and b/nwnds_module/ar_wswdg_iron01.uti differ diff --git a/nwnds_module/ar_wswdg_ivory.uti b/nwnds_module/ar_wswdg_ivory.uti new file mode 100644 index 000000000..9d33064a1 Binary files /dev/null and b/nwnds_module/ar_wswdg_ivory.uti differ diff --git a/nwnds_module/ar_wswdg_obs01.uti b/nwnds_module/ar_wswdg_obs01.uti new file mode 100644 index 000000000..ddb8090f7 Binary files /dev/null and b/nwnds_module/ar_wswdg_obs01.uti differ diff --git a/nwnds_module/ar_wswdg_obs02.uti b/nwnds_module/ar_wswdg_obs02.uti new file mode 100644 index 000000000..e792cbe3b Binary files /dev/null and b/nwnds_module/ar_wswdg_obs02.uti differ diff --git a/nwnds_module/ar_wswdg_parry.uti b/nwnds_module/ar_wswdg_parry.uti new file mode 100644 index 000000000..d05c49cd5 Binary files /dev/null and b/nwnds_module/ar_wswdg_parry.uti differ diff --git a/nwnds_module/ar_wswdg_poison.uti b/nwnds_module/ar_wswdg_poison.uti new file mode 100644 index 000000000..63695b1c8 Binary files /dev/null and b/nwnds_module/ar_wswdg_poison.uti differ diff --git a/nwnds_module/ar_wswdg_serrate.uti b/nwnds_module/ar_wswdg_serrate.uti new file mode 100644 index 000000000..943d20373 Binary files /dev/null and b/nwnds_module/ar_wswdg_serrate.uti differ diff --git a/nwnds_module/ar_wswdg_surgicl.uti b/nwnds_module/ar_wswdg_surgicl.uti new file mode 100644 index 000000000..6faa3f1f5 Binary files /dev/null and b/nwnds_module/ar_wswdg_surgicl.uti differ diff --git a/nwnds_module/ar_wswgs_alloy.uti b/nwnds_module/ar_wswgs_alloy.uti new file mode 100644 index 000000000..616db74d8 Binary files /dev/null and b/nwnds_module/ar_wswgs_alloy.uti differ diff --git a/nwnds_module/ar_wswgs_dew.uti b/nwnds_module/ar_wswgs_dew.uti new file mode 100644 index 000000000..06dc2c55e Binary files /dev/null and b/nwnds_module/ar_wswgs_dew.uti differ diff --git a/nwnds_module/ar_wswgs_elven.uti b/nwnds_module/ar_wswgs_elven.uti new file mode 100644 index 000000000..b1b694745 Binary files /dev/null and b/nwnds_module/ar_wswgs_elven.uti differ diff --git a/nwnds_module/ar_wswgs_iron01.uti b/nwnds_module/ar_wswgs_iron01.uti new file mode 100644 index 000000000..b03656238 Binary files /dev/null and b/nwnds_module/ar_wswgs_iron01.uti differ diff --git a/nwnds_module/ar_wswgs_ivory.uti b/nwnds_module/ar_wswgs_ivory.uti new file mode 100644 index 000000000..c9c15b9ae Binary files /dev/null and b/nwnds_module/ar_wswgs_ivory.uti differ diff --git a/nwnds_module/ar_wswgs_obs01.uti b/nwnds_module/ar_wswgs_obs01.uti new file mode 100644 index 000000000..87c64d3d8 Binary files /dev/null and b/nwnds_module/ar_wswgs_obs01.uti differ diff --git a/nwnds_module/ar_wswgs_obs02.uti b/nwnds_module/ar_wswgs_obs02.uti new file mode 100644 index 000000000..02968d09a Binary files /dev/null and b/nwnds_module/ar_wswgs_obs02.uti differ diff --git a/nwnds_module/ar_wswka_alloy.uti b/nwnds_module/ar_wswka_alloy.uti new file mode 100644 index 000000000..eec08fe01 Binary files /dev/null and b/nwnds_module/ar_wswka_alloy.uti differ diff --git a/nwnds_module/ar_wswka_ivory.uti b/nwnds_module/ar_wswka_ivory.uti new file mode 100644 index 000000000..63a22ae29 Binary files /dev/null and b/nwnds_module/ar_wswka_ivory.uti differ diff --git a/nwnds_module/ar_wswka_obs01.uti b/nwnds_module/ar_wswka_obs01.uti new file mode 100644 index 000000000..0d72decfa Binary files /dev/null and b/nwnds_module/ar_wswka_obs01.uti differ diff --git a/nwnds_module/ar_wswls_alloy.uti b/nwnds_module/ar_wswls_alloy.uti new file mode 100644 index 000000000..7254af2a7 Binary files /dev/null and b/nwnds_module/ar_wswls_alloy.uti differ diff --git a/nwnds_module/ar_wswls_bone01.uti b/nwnds_module/ar_wswls_bone01.uti new file mode 100644 index 000000000..7a2f31359 Binary files /dev/null and b/nwnds_module/ar_wswls_bone01.uti differ diff --git a/nwnds_module/ar_wswls_dew.uti b/nwnds_module/ar_wswls_dew.uti new file mode 100644 index 000000000..8bf55acec Binary files /dev/null and b/nwnds_module/ar_wswls_dew.uti differ diff --git a/nwnds_module/ar_wswls_elven.uti b/nwnds_module/ar_wswls_elven.uti new file mode 100644 index 000000000..f7a04827e Binary files /dev/null and b/nwnds_module/ar_wswls_elven.uti differ diff --git a/nwnds_module/ar_wswls_gstone.uti b/nwnds_module/ar_wswls_gstone.uti new file mode 100644 index 000000000..b59576611 Binary files /dev/null and b/nwnds_module/ar_wswls_gstone.uti differ diff --git a/nwnds_module/ar_wswls_iron01.uti b/nwnds_module/ar_wswls_iron01.uti new file mode 100644 index 000000000..4ed7dcaa0 Binary files /dev/null and b/nwnds_module/ar_wswls_iron01.uti differ diff --git a/nwnds_module/ar_wswls_ivory.uti b/nwnds_module/ar_wswls_ivory.uti new file mode 100644 index 000000000..5cb449771 Binary files /dev/null and b/nwnds_module/ar_wswls_ivory.uti differ diff --git a/nwnds_module/ar_wswls_obs01.uti b/nwnds_module/ar_wswls_obs01.uti new file mode 100644 index 000000000..f814b3518 Binary files /dev/null and b/nwnds_module/ar_wswls_obs01.uti differ diff --git a/nwnds_module/ar_wswls_obs02.uti b/nwnds_module/ar_wswls_obs02.uti new file mode 100644 index 000000000..dc0d57902 Binary files /dev/null and b/nwnds_module/ar_wswls_obs02.uti differ diff --git a/nwnds_module/ar_wswmbf_zarrah.uti b/nwnds_module/ar_wswmbf_zarrah.uti new file mode 100644 index 000000000..6a278692b Binary files /dev/null and b/nwnds_module/ar_wswmbf_zarrah.uti differ diff --git a/nwnds_module/ar_wswmbs_cister.uti b/nwnds_module/ar_wswmbs_cister.uti new file mode 100644 index 000000000..497daea1e Binary files /dev/null and b/nwnds_module/ar_wswmbs_cister.uti differ diff --git a/nwnds_module/ar_wswmbs_dis01.uti b/nwnds_module/ar_wswmbs_dis01.uti new file mode 100644 index 000000000..6cb03e70b Binary files /dev/null and b/nwnds_module/ar_wswmbs_dis01.uti differ diff --git a/nwnds_module/ar_wswmbs_dreg01.uti b/nwnds_module/ar_wswmbs_dreg01.uti new file mode 100644 index 000000000..26364ecef Binary files /dev/null and b/nwnds_module/ar_wswmbs_dreg01.uti differ diff --git a/nwnds_module/ar_wswmbs_heart.uti b/nwnds_module/ar_wswmbs_heart.uti new file mode 100644 index 000000000..ba1d0d385 Binary files /dev/null and b/nwnds_module/ar_wswmbs_heart.uti differ diff --git a/nwnds_module/ar_wswmbs_ragna.uti b/nwnds_module/ar_wswmbs_ragna.uti new file mode 100644 index 000000000..5ce244ec0 Binary files /dev/null and b/nwnds_module/ar_wswmbs_ragna.uti differ diff --git a/nwnds_module/ar_wswmbs_sandst.uti b/nwnds_module/ar_wswmbs_sandst.uti new file mode 100644 index 000000000..6f5441af6 Binary files /dev/null and b/nwnds_module/ar_wswmbs_sandst.uti differ diff --git a/nwnds_module/ar_wswmbs_sanshi.uti b/nwnds_module/ar_wswmbs_sanshi.uti new file mode 100644 index 000000000..b0d966de5 Binary files /dev/null and b/nwnds_module/ar_wswmbs_sanshi.uti differ diff --git a/nwnds_module/ar_wswmbs_scorch.uti b/nwnds_module/ar_wswmbs_scorch.uti new file mode 100644 index 000000000..940aebf08 Binary files /dev/null and b/nwnds_module/ar_wswmbs_scorch.uti differ diff --git a/nwnds_module/ar_wswmbs_shadow.uti b/nwnds_module/ar_wswmbs_shadow.uti new file mode 100644 index 000000000..4a4568656 Binary files /dev/null and b/nwnds_module/ar_wswmbs_shadow.uti differ diff --git a/nwnds_module/ar_wswmbs_trubld.uti b/nwnds_module/ar_wswmbs_trubld.uti new file mode 100644 index 000000000..db87cd0bb Binary files /dev/null and b/nwnds_module/ar_wswmbs_trubld.uti differ diff --git a/nwnds_module/ar_wswmbs_urikhg.uti b/nwnds_module/ar_wswmbs_urikhg.uti new file mode 100644 index 000000000..94c093c96 Binary files /dev/null and b/nwnds_module/ar_wswmbs_urikhg.uti differ diff --git a/nwnds_module/ar_wswmdg_ginos.uti b/nwnds_module/ar_wswmdg_ginos.uti new file mode 100644 index 000000000..435ae7856 Binary files /dev/null and b/nwnds_module/ar_wswmdg_ginos.uti differ diff --git a/nwnds_module/ar_wswmdg_gloom.uti b/nwnds_module/ar_wswmdg_gloom.uti new file mode 100644 index 000000000..649b45d6e Binary files /dev/null and b/nwnds_module/ar_wswmdg_gloom.uti differ diff --git a/nwnds_module/ar_wswmdg_infern.uti b/nwnds_module/ar_wswmdg_infern.uti new file mode 100644 index 000000000..8f34aaedb Binary files /dev/null and b/nwnds_module/ar_wswmdg_infern.uti differ diff --git a/nwnds_module/ar_wswmdg_jannas.uti b/nwnds_module/ar_wswmdg_jannas.uti new file mode 100644 index 000000000..d2e95d8a5 Binary files /dev/null and b/nwnds_module/ar_wswmdg_jannas.uti differ diff --git a/nwnds_module/ar_wswmdg_jazsts.uti b/nwnds_module/ar_wswmdg_jazsts.uti new file mode 100644 index 000000000..aa9d47bd4 Binary files /dev/null and b/nwnds_module/ar_wswmdg_jazsts.uti differ diff --git a/nwnds_module/ar_wswmdg_minute.uti b/nwnds_module/ar_wswmdg_minute.uti new file mode 100644 index 000000000..6bdd9fd2e Binary files /dev/null and b/nwnds_module/ar_wswmdg_minute.uti differ diff --git a/nwnds_module/ar_wswmdg_nightm.uti b/nwnds_module/ar_wswmdg_nightm.uti new file mode 100644 index 000000000..84e3722cf Binary files /dev/null and b/nwnds_module/ar_wswmdg_nightm.uti differ diff --git a/nwnds_module/ar_wswmdg_second.uti b/nwnds_module/ar_wswmdg_second.uti new file mode 100644 index 000000000..be224c8fc Binary files /dev/null and b/nwnds_module/ar_wswmdg_second.uti differ diff --git a/nwnds_module/ar_wswmdg_smdeth.uti b/nwnds_module/ar_wswmdg_smdeth.uti new file mode 100644 index 000000000..63427e6c2 Binary files /dev/null and b/nwnds_module/ar_wswmdg_smdeth.uti differ diff --git a/nwnds_module/ar_wswmdg_time.uti b/nwnds_module/ar_wswmdg_time.uti new file mode 100644 index 000000000..9e1ce42bb Binary files /dev/null and b/nwnds_module/ar_wswmdg_time.uti differ diff --git a/nwnds_module/ar_wswmgs_astral.uti b/nwnds_module/ar_wswmgs_astral.uti new file mode 100644 index 000000000..e453264a6 Binary files /dev/null and b/nwnds_module/ar_wswmgs_astral.uti differ diff --git a/nwnds_module/ar_wswmgs_doom.uti b/nwnds_module/ar_wswmgs_doom.uti new file mode 100644 index 000000000..9ab87fd19 Binary files /dev/null and b/nwnds_module/ar_wswmgs_doom.uti differ diff --git a/nwnds_module/ar_wswmgs_enforc.uti b/nwnds_module/ar_wswmgs_enforc.uti new file mode 100644 index 000000000..656aaed48 Binary files /dev/null and b/nwnds_module/ar_wswmgs_enforc.uti differ diff --git a/nwnds_module/ar_wswmgs_severa.uti b/nwnds_module/ar_wswmgs_severa.uti new file mode 100644 index 000000000..998c3d72e Binary files /dev/null and b/nwnds_module/ar_wswmgs_severa.uti differ diff --git a/nwnds_module/ar_wswmgs_shimmr.uti b/nwnds_module/ar_wswmgs_shimmr.uti new file mode 100644 index 000000000..65d83fdd3 Binary files /dev/null and b/nwnds_module/ar_wswmgs_shimmr.uti differ diff --git a/nwnds_module/ar_wswmgs_shiver.uti b/nwnds_module/ar_wswmgs_shiver.uti new file mode 100644 index 000000000..cef1b3838 Binary files /dev/null and b/nwnds_module/ar_wswmgs_shiver.uti differ diff --git a/nwnds_module/ar_wswmgs_siltfg.uti b/nwnds_module/ar_wswmgs_siltfg.uti new file mode 100644 index 000000000..e03e45f43 Binary files /dev/null and b/nwnds_module/ar_wswmgs_siltfg.uti differ diff --git a/nwnds_module/ar_wswmgs_urikhg.uti b/nwnds_module/ar_wswmgs_urikhg.uti new file mode 100644 index 000000000..7780da492 Binary files /dev/null and b/nwnds_module/ar_wswmgs_urikhg.uti differ diff --git a/nwnds_module/ar_wswmgs_vile.uti b/nwnds_module/ar_wswmgs_vile.uti new file mode 100644 index 000000000..cb67bbce4 Binary files /dev/null and b/nwnds_module/ar_wswmgs_vile.uti differ diff --git a/nwnds_module/ar_wswmls_bcbone.uti b/nwnds_module/ar_wswmls_bcbone.uti new file mode 100644 index 000000000..f8f3037ec Binary files /dev/null and b/nwnds_module/ar_wswmls_bcbone.uti differ diff --git a/nwnds_module/ar_wswmls_blood.uti b/nwnds_module/ar_wswmls_blood.uti new file mode 100644 index 000000000..3c7fe8f22 Binary files /dev/null and b/nwnds_module/ar_wswmls_blood.uti differ diff --git a/nwnds_module/ar_wswmls_bloodt.uti b/nwnds_module/ar_wswmls_bloodt.uti new file mode 100644 index 000000000..c8639b988 Binary files /dev/null and b/nwnds_module/ar_wswmls_bloodt.uti differ diff --git a/nwnds_module/ar_wswmls_calder.uti b/nwnds_module/ar_wswmls_calder.uti new file mode 100644 index 000000000..eefba8d83 Binary files /dev/null and b/nwnds_module/ar_wswmls_calder.uti differ diff --git a/nwnds_module/ar_wswmls_cldirn.uti b/nwnds_module/ar_wswmls_cldirn.uti new file mode 100644 index 000000000..57d2449d6 Binary files /dev/null and b/nwnds_module/ar_wswmls_cldirn.uti differ diff --git a/nwnds_module/ar_wswmls_cleave.uti b/nwnds_module/ar_wswmls_cleave.uti new file mode 100644 index 000000000..bb8b59eaf Binary files /dev/null and b/nwnds_module/ar_wswmls_cleave.uti differ diff --git a/nwnds_module/ar_wswmls_dervis.uti b/nwnds_module/ar_wswmls_dervis.uti new file mode 100644 index 000000000..1cd71aa46 Binary files /dev/null and b/nwnds_module/ar_wswmls_dervis.uti differ diff --git a/nwnds_module/ar_wswmls_dksoul.uti b/nwnds_module/ar_wswmls_dksoul.uti new file mode 100644 index 000000000..e657e79eb Binary files /dev/null and b/nwnds_module/ar_wswmls_dksoul.uti differ diff --git a/nwnds_module/ar_wswmls_dregot.uti b/nwnds_module/ar_wswmls_dregot.uti new file mode 100644 index 000000000..4442fef19 Binary files /dev/null and b/nwnds_module/ar_wswmls_dregot.uti differ diff --git a/nwnds_module/ar_wswmls_keeper.uti b/nwnds_module/ar_wswmls_keeper.uti new file mode 100644 index 000000000..434f7e4f9 Binary files /dev/null and b/nwnds_module/ar_wswmls_keeper.uti differ diff --git a/nwnds_module/ar_wswmls_sekdo.uti b/nwnds_module/ar_wswmls_sekdo.uti new file mode 100644 index 000000000..134369181 Binary files /dev/null and b/nwnds_module/ar_wswmls_sekdo.uti differ diff --git a/nwnds_module/ar_wswmls_star.uti b/nwnds_module/ar_wswmls_star.uti new file mode 100644 index 000000000..0341783a2 Binary files /dev/null and b/nwnds_module/ar_wswmls_star.uti differ diff --git a/nwnds_module/ar_wswmrp_asticl.uti b/nwnds_module/ar_wswmrp_asticl.uti new file mode 100644 index 000000000..537ea578d Binary files /dev/null and b/nwnds_module/ar_wswmrp_asticl.uti differ diff --git a/nwnds_module/ar_wswmrp_dlands.uti b/nwnds_module/ar_wswmrp_dlands.uti new file mode 100644 index 000000000..b00995910 Binary files /dev/null and b/nwnds_module/ar_wswmrp_dlands.uti differ diff --git a/nwnds_module/ar_wswmrp_dmflat.uti b/nwnds_module/ar_wswmrp_dmflat.uti new file mode 100644 index 000000000..9fc761d72 Binary files /dev/null and b/nwnds_module/ar_wswmrp_dmflat.uti differ diff --git a/nwnds_module/ar_wswmrp_echobl.uti b/nwnds_module/ar_wswmrp_echobl.uti new file mode 100644 index 000000000..93c7460a0 Binary files /dev/null and b/nwnds_module/ar_wswmrp_echobl.uti differ diff --git a/nwnds_module/ar_wswmrp_elves.uti b/nwnds_module/ar_wswmrp_elves.uti new file mode 100644 index 000000000..b89c89875 Binary files /dev/null and b/nwnds_module/ar_wswmrp_elves.uti differ diff --git a/nwnds_module/ar_wswmrp_felsik.uti b/nwnds_module/ar_wswmrp_felsik.uti new file mode 100644 index 000000000..265c16de3 Binary files /dev/null and b/nwnds_module/ar_wswmrp_felsik.uti differ diff --git a/nwnds_module/ar_wswmrp_hrazor.uti b/nwnds_module/ar_wswmrp_hrazor.uti new file mode 100644 index 000000000..3d789897b Binary files /dev/null and b/nwnds_module/ar_wswmrp_hrazor.uti differ diff --git a/nwnds_module/ar_wswmrp_liars.uti b/nwnds_module/ar_wswmrp_liars.uti new file mode 100644 index 000000000..0b88fd94b Binary files /dev/null and b/nwnds_module/ar_wswmrp_liars.uti differ diff --git a/nwnds_module/ar_wswmrp_lifesa.uti b/nwnds_module/ar_wswmrp_lifesa.uti new file mode 100644 index 000000000..d03a7ec40 Binary files /dev/null and b/nwnds_module/ar_wswmrp_lifesa.uti differ diff --git a/nwnds_module/ar_wswmrp_urikhg.uti b/nwnds_module/ar_wswmrp_urikhg.uti new file mode 100644 index 000000000..3108fce63 Binary files /dev/null and b/nwnds_module/ar_wswmrp_urikhg.uti differ diff --git a/nwnds_module/ar_wswmsc_frost.uti b/nwnds_module/ar_wswmsc_frost.uti new file mode 100644 index 000000000..5c5a0eb71 Binary files /dev/null and b/nwnds_module/ar_wswmsc_frost.uti differ diff --git a/nwnds_module/ar_wswmsc_kurn.uti b/nwnds_module/ar_wswmsc_kurn.uti new file mode 100644 index 000000000..3b480be24 Binary files /dev/null and b/nwnds_module/ar_wswmsc_kurn.uti differ diff --git a/nwnds_module/ar_wswmsc_lgtstr.uti b/nwnds_module/ar_wswmsc_lgtstr.uti new file mode 100644 index 000000000..308ef3fa6 Binary files /dev/null and b/nwnds_module/ar_wswmsc_lgtstr.uti differ diff --git a/nwnds_module/ar_wswmsc_nightm.uti b/nwnds_module/ar_wswmsc_nightm.uti new file mode 100644 index 000000000..e92cfd40f Binary files /dev/null and b/nwnds_module/ar_wswmsc_nightm.uti differ diff --git a/nwnds_module/ar_wswmsc_scour.uti b/nwnds_module/ar_wswmsc_scour.uti new file mode 100644 index 000000000..155fb07d7 Binary files /dev/null and b/nwnds_module/ar_wswmsc_scour.uti differ diff --git a/nwnds_module/ar_wswmsc_scream.uti b/nwnds_module/ar_wswmsc_scream.uti new file mode 100644 index 000000000..ebe7bcb53 Binary files /dev/null and b/nwnds_module/ar_wswmsc_scream.uti differ diff --git a/nwnds_module/ar_wswmsc_shadow.uti b/nwnds_module/ar_wswmsc_shadow.uti new file mode 100644 index 000000000..c81385d0e Binary files /dev/null and b/nwnds_module/ar_wswmsc_shadow.uti differ diff --git a/nwnds_module/ar_wswmss_barbed.uti b/nwnds_module/ar_wswmss_barbed.uti new file mode 100644 index 000000000..e41637309 Binary files /dev/null and b/nwnds_module/ar_wswmss_barbed.uti differ diff --git a/nwnds_module/ar_wswmss_cerule.uti b/nwnds_module/ar_wswmss_cerule.uti new file mode 100644 index 000000000..f747dd204 Binary files /dev/null and b/nwnds_module/ar_wswmss_cerule.uti differ diff --git a/nwnds_module/ar_wswmss_hrtprc.uti b/nwnds_module/ar_wswmss_hrtprc.uti new file mode 100644 index 000000000..1488e505c Binary files /dev/null and b/nwnds_module/ar_wswmss_hrtprc.uti differ diff --git a/nwnds_module/ar_wswmss_leshay.uti b/nwnds_module/ar_wswmss_leshay.uti new file mode 100644 index 000000000..8cc7c8086 Binary files /dev/null and b/nwnds_module/ar_wswmss_leshay.uti differ diff --git a/nwnds_module/ar_wswmss_meorty.uti b/nwnds_module/ar_wswmss_meorty.uti new file mode 100644 index 000000000..153aa50c6 Binary files /dev/null and b/nwnds_module/ar_wswmss_meorty.uti differ diff --git a/nwnds_module/ar_wswmss_ngtstk.uti b/nwnds_module/ar_wswmss_ngtstk.uti new file mode 100644 index 000000000..cdc1b90a6 Binary files /dev/null and b/nwnds_module/ar_wswmss_ngtstk.uti differ diff --git a/nwnds_module/ar_wswmss_sndshk.uti b/nwnds_module/ar_wswmss_sndshk.uti new file mode 100644 index 000000000..5ce4bf7a9 Binary files /dev/null and b/nwnds_module/ar_wswmss_sndshk.uti differ diff --git a/nwnds_module/ar_wswmss_sun.uti b/nwnds_module/ar_wswmss_sun.uti new file mode 100644 index 000000000..12d81645d Binary files /dev/null and b/nwnds_module/ar_wswmss_sun.uti differ diff --git a/nwnds_module/ar_wswmss_touchb.uti b/nwnds_module/ar_wswmss_touchb.uti new file mode 100644 index 000000000..5196a5402 Binary files /dev/null and b/nwnds_module/ar_wswmss_touchb.uti differ diff --git a/nwnds_module/ar_wswpbf_acid01.uti b/nwnds_module/ar_wswpbf_acid01.uti new file mode 100644 index 000000000..e1d9dc2e4 Binary files /dev/null and b/nwnds_module/ar_wswpbf_acid01.uti differ diff --git a/nwnds_module/ar_wswpbf_acid02.uti b/nwnds_module/ar_wswpbf_acid02.uti new file mode 100644 index 000000000..1e0667bda Binary files /dev/null and b/nwnds_module/ar_wswpbf_acid02.uti differ diff --git a/nwnds_module/ar_wswpbf_draqo.uti b/nwnds_module/ar_wswpbf_draqo.uti new file mode 100644 index 000000000..3eee1f0f7 Binary files /dev/null and b/nwnds_module/ar_wswpbf_draqo.uti differ diff --git a/nwnds_module/ar_wswpbf_elec01.uti b/nwnds_module/ar_wswpbf_elec01.uti new file mode 100644 index 000000000..03b791792 Binary files /dev/null and b/nwnds_module/ar_wswpbf_elec01.uti differ diff --git a/nwnds_module/ar_wswpbf_elec02.uti b/nwnds_module/ar_wswpbf_elec02.uti new file mode 100644 index 000000000..9e8f15678 Binary files /dev/null and b/nwnds_module/ar_wswpbf_elec02.uti differ diff --git a/nwnds_module/ar_wswpbf_fire01.uti b/nwnds_module/ar_wswpbf_fire01.uti new file mode 100644 index 000000000..9620c63c6 Binary files /dev/null and b/nwnds_module/ar_wswpbf_fire01.uti differ diff --git a/nwnds_module/ar_wswpbf_fire02.uti b/nwnds_module/ar_wswpbf_fire02.uti new file mode 100644 index 000000000..654c7de67 Binary files /dev/null and b/nwnds_module/ar_wswpbf_fire02.uti differ diff --git a/nwnds_module/ar_wswpbf_ice01.uti b/nwnds_module/ar_wswpbf_ice01.uti new file mode 100644 index 000000000..8ce023ee3 Binary files /dev/null and b/nwnds_module/ar_wswpbf_ice01.uti differ diff --git a/nwnds_module/ar_wswpbf_ice02.uti b/nwnds_module/ar_wswpbf_ice02.uti new file mode 100644 index 000000000..ad054c87f Binary files /dev/null and b/nwnds_module/ar_wswpbf_ice02.uti differ diff --git a/nwnds_module/ar_wswpbf_imbued.uti b/nwnds_module/ar_wswpbf_imbued.uti new file mode 100644 index 000000000..285d151c1 Binary files /dev/null and b/nwnds_module/ar_wswpbf_imbued.uti differ diff --git a/nwnds_module/ar_wswpbf_koshi.uti b/nwnds_module/ar_wswpbf_koshi.uti new file mode 100644 index 000000000..842bd2822 Binary files /dev/null and b/nwnds_module/ar_wswpbf_koshi.uti differ diff --git a/nwnds_module/ar_wswpbs_acid01.uti b/nwnds_module/ar_wswpbs_acid01.uti new file mode 100644 index 000000000..3ce6af713 Binary files /dev/null and b/nwnds_module/ar_wswpbs_acid01.uti differ diff --git a/nwnds_module/ar_wswpbs_acid02.uti b/nwnds_module/ar_wswpbs_acid02.uti new file mode 100644 index 000000000..01a2b57d1 Binary files /dev/null and b/nwnds_module/ar_wswpbs_acid02.uti differ diff --git a/nwnds_module/ar_wswpbs_elec01.uti b/nwnds_module/ar_wswpbs_elec01.uti new file mode 100644 index 000000000..0bacd0c18 Binary files /dev/null and b/nwnds_module/ar_wswpbs_elec01.uti differ diff --git a/nwnds_module/ar_wswpbs_elec02.uti b/nwnds_module/ar_wswpbs_elec02.uti new file mode 100644 index 000000000..498a56d89 Binary files /dev/null and b/nwnds_module/ar_wswpbs_elec02.uti differ diff --git a/nwnds_module/ar_wswpbs_fire01.uti b/nwnds_module/ar_wswpbs_fire01.uti new file mode 100644 index 000000000..fb32c0a54 Binary files /dev/null and b/nwnds_module/ar_wswpbs_fire01.uti differ diff --git a/nwnds_module/ar_wswpbs_fire02.uti b/nwnds_module/ar_wswpbs_fire02.uti new file mode 100644 index 000000000..794a5f7cc Binary files /dev/null and b/nwnds_module/ar_wswpbs_fire02.uti differ diff --git a/nwnds_module/ar_wswpbs_ice01.uti b/nwnds_module/ar_wswpbs_ice01.uti new file mode 100644 index 000000000..c767473fa Binary files /dev/null and b/nwnds_module/ar_wswpbs_ice01.uti differ diff --git a/nwnds_module/ar_wswpbs_ice02.uti b/nwnds_module/ar_wswpbs_ice02.uti new file mode 100644 index 000000000..680700601 Binary files /dev/null and b/nwnds_module/ar_wswpbs_ice02.uti differ diff --git a/nwnds_module/ar_wswpdg_acid01.uti b/nwnds_module/ar_wswpdg_acid01.uti new file mode 100644 index 000000000..55a64394e Binary files /dev/null and b/nwnds_module/ar_wswpdg_acid01.uti differ diff --git a/nwnds_module/ar_wswpdg_acid02.uti b/nwnds_module/ar_wswpdg_acid02.uti new file mode 100644 index 000000000..57fe52a8d Binary files /dev/null and b/nwnds_module/ar_wswpdg_acid02.uti differ diff --git a/nwnds_module/ar_wswpdg_elec01.uti b/nwnds_module/ar_wswpdg_elec01.uti new file mode 100644 index 000000000..cb8b9588b Binary files /dev/null and b/nwnds_module/ar_wswpdg_elec01.uti differ diff --git a/nwnds_module/ar_wswpdg_elec02.uti b/nwnds_module/ar_wswpdg_elec02.uti new file mode 100644 index 000000000..9afd348be Binary files /dev/null and b/nwnds_module/ar_wswpdg_elec02.uti differ diff --git a/nwnds_module/ar_wswpdg_fire01.uti b/nwnds_module/ar_wswpdg_fire01.uti new file mode 100644 index 000000000..176d55574 Binary files /dev/null and b/nwnds_module/ar_wswpdg_fire01.uti differ diff --git a/nwnds_module/ar_wswpdg_fire02.uti b/nwnds_module/ar_wswpdg_fire02.uti new file mode 100644 index 000000000..cfca87626 Binary files /dev/null and b/nwnds_module/ar_wswpdg_fire02.uti differ diff --git a/nwnds_module/ar_wswpdg_ice01.uti b/nwnds_module/ar_wswpdg_ice01.uti new file mode 100644 index 000000000..c403ec566 Binary files /dev/null and b/nwnds_module/ar_wswpdg_ice01.uti differ diff --git a/nwnds_module/ar_wswpdg_ice02.uti b/nwnds_module/ar_wswpdg_ice02.uti new file mode 100644 index 000000000..1386b4ddb Binary files /dev/null and b/nwnds_module/ar_wswpdg_ice02.uti differ diff --git a/nwnds_module/ar_wswpdg_steak.uti b/nwnds_module/ar_wswpdg_steak.uti new file mode 100644 index 000000000..58168b26e Binary files /dev/null and b/nwnds_module/ar_wswpdg_steak.uti differ diff --git a/nwnds_module/ar_wswpgs_acid01.uti b/nwnds_module/ar_wswpgs_acid01.uti new file mode 100644 index 000000000..2dd574f80 Binary files /dev/null and b/nwnds_module/ar_wswpgs_acid01.uti differ diff --git a/nwnds_module/ar_wswpgs_acid02.uti b/nwnds_module/ar_wswpgs_acid02.uti new file mode 100644 index 000000000..7c2cda6a7 Binary files /dev/null and b/nwnds_module/ar_wswpgs_acid02.uti differ diff --git a/nwnds_module/ar_wswpgs_elec01.uti b/nwnds_module/ar_wswpgs_elec01.uti new file mode 100644 index 000000000..0c2e153bc Binary files /dev/null and b/nwnds_module/ar_wswpgs_elec01.uti differ diff --git a/nwnds_module/ar_wswpgs_elec02.uti b/nwnds_module/ar_wswpgs_elec02.uti new file mode 100644 index 000000000..378adb9bc Binary files /dev/null and b/nwnds_module/ar_wswpgs_elec02.uti differ diff --git a/nwnds_module/ar_wswpgs_fire01.uti b/nwnds_module/ar_wswpgs_fire01.uti new file mode 100644 index 000000000..b778031d1 Binary files /dev/null and b/nwnds_module/ar_wswpgs_fire01.uti differ diff --git a/nwnds_module/ar_wswpgs_fire02.uti b/nwnds_module/ar_wswpgs_fire02.uti new file mode 100644 index 000000000..c9070528b Binary files /dev/null and b/nwnds_module/ar_wswpgs_fire02.uti differ diff --git a/nwnds_module/ar_wswpgs_fire03.uti b/nwnds_module/ar_wswpgs_fire03.uti new file mode 100644 index 000000000..9245fa40a Binary files /dev/null and b/nwnds_module/ar_wswpgs_fire03.uti differ diff --git a/nwnds_module/ar_wswpgs_ice01.uti b/nwnds_module/ar_wswpgs_ice01.uti new file mode 100644 index 000000000..2644a2e56 Binary files /dev/null and b/nwnds_module/ar_wswpgs_ice01.uti differ diff --git a/nwnds_module/ar_wswpgs_ice02.uti b/nwnds_module/ar_wswpgs_ice02.uti new file mode 100644 index 000000000..47106c0ac Binary files /dev/null and b/nwnds_module/ar_wswpgs_ice02.uti differ diff --git a/nwnds_module/ar_wswpka_acid01.uti b/nwnds_module/ar_wswpka_acid01.uti new file mode 100644 index 000000000..2affb1fd9 Binary files /dev/null and b/nwnds_module/ar_wswpka_acid01.uti differ diff --git a/nwnds_module/ar_wswpka_acid02.uti b/nwnds_module/ar_wswpka_acid02.uti new file mode 100644 index 000000000..acfbea102 Binary files /dev/null and b/nwnds_module/ar_wswpka_acid02.uti differ diff --git a/nwnds_module/ar_wswpka_elec01.uti b/nwnds_module/ar_wswpka_elec01.uti new file mode 100644 index 000000000..7a52ce912 Binary files /dev/null and b/nwnds_module/ar_wswpka_elec01.uti differ diff --git a/nwnds_module/ar_wswpka_elec02.uti b/nwnds_module/ar_wswpka_elec02.uti new file mode 100644 index 000000000..b8d871d4b Binary files /dev/null and b/nwnds_module/ar_wswpka_elec02.uti differ diff --git a/nwnds_module/ar_wswpka_fire01.uti b/nwnds_module/ar_wswpka_fire01.uti new file mode 100644 index 000000000..27e57cc83 Binary files /dev/null and b/nwnds_module/ar_wswpka_fire01.uti differ diff --git a/nwnds_module/ar_wswpka_fire02.uti b/nwnds_module/ar_wswpka_fire02.uti new file mode 100644 index 000000000..d87faed23 Binary files /dev/null and b/nwnds_module/ar_wswpka_fire02.uti differ diff --git a/nwnds_module/ar_wswpka_ice01.uti b/nwnds_module/ar_wswpka_ice01.uti new file mode 100644 index 000000000..42763a086 Binary files /dev/null and b/nwnds_module/ar_wswpka_ice01.uti differ diff --git a/nwnds_module/ar_wswpka_ice02.uti b/nwnds_module/ar_wswpka_ice02.uti new file mode 100644 index 000000000..266268f44 Binary files /dev/null and b/nwnds_module/ar_wswpka_ice02.uti differ diff --git a/nwnds_module/ar_wswpls_acid01.uti b/nwnds_module/ar_wswpls_acid01.uti new file mode 100644 index 000000000..42c4696b1 Binary files /dev/null and b/nwnds_module/ar_wswpls_acid01.uti differ diff --git a/nwnds_module/ar_wswpls_acid02.uti b/nwnds_module/ar_wswpls_acid02.uti new file mode 100644 index 000000000..2911a26e7 Binary files /dev/null and b/nwnds_module/ar_wswpls_acid02.uti differ diff --git a/nwnds_module/ar_wswpls_astral.uti b/nwnds_module/ar_wswpls_astral.uti new file mode 100644 index 000000000..0df7f4a9c Binary files /dev/null and b/nwnds_module/ar_wswpls_astral.uti differ diff --git a/nwnds_module/ar_wswpls_dimens.uti b/nwnds_module/ar_wswpls_dimens.uti new file mode 100644 index 000000000..e1dd3d528 Binary files /dev/null and b/nwnds_module/ar_wswpls_dimens.uti differ diff --git a/nwnds_module/ar_wswpls_elec01.uti b/nwnds_module/ar_wswpls_elec01.uti new file mode 100644 index 000000000..23e78aa75 Binary files /dev/null and b/nwnds_module/ar_wswpls_elec01.uti differ diff --git a/nwnds_module/ar_wswpls_elec02.uti b/nwnds_module/ar_wswpls_elec02.uti new file mode 100644 index 000000000..6f74ade47 Binary files /dev/null and b/nwnds_module/ar_wswpls_elec02.uti differ diff --git a/nwnds_module/ar_wswpls_fire01.uti b/nwnds_module/ar_wswpls_fire01.uti new file mode 100644 index 000000000..61b9e265b Binary files /dev/null and b/nwnds_module/ar_wswpls_fire01.uti differ diff --git a/nwnds_module/ar_wswpls_fire02.uti b/nwnds_module/ar_wswpls_fire02.uti new file mode 100644 index 000000000..c6115248c Binary files /dev/null and b/nwnds_module/ar_wswpls_fire02.uti differ diff --git a/nwnds_module/ar_wswpls_ice01.uti b/nwnds_module/ar_wswpls_ice01.uti new file mode 100644 index 000000000..c01832818 Binary files /dev/null and b/nwnds_module/ar_wswpls_ice01.uti differ diff --git a/nwnds_module/ar_wswpls_ice02.uti b/nwnds_module/ar_wswpls_ice02.uti new file mode 100644 index 000000000..77da017e0 Binary files /dev/null and b/nwnds_module/ar_wswpls_ice02.uti differ diff --git a/nwnds_module/ar_wswprp_acid01.uti b/nwnds_module/ar_wswprp_acid01.uti new file mode 100644 index 000000000..ff15875a2 Binary files /dev/null and b/nwnds_module/ar_wswprp_acid01.uti differ diff --git a/nwnds_module/ar_wswprp_acid02.uti b/nwnds_module/ar_wswprp_acid02.uti new file mode 100644 index 000000000..464340ba3 Binary files /dev/null and b/nwnds_module/ar_wswprp_acid02.uti differ diff --git a/nwnds_module/ar_wswprp_demonl.uti b/nwnds_module/ar_wswprp_demonl.uti new file mode 100644 index 000000000..633efd77d Binary files /dev/null and b/nwnds_module/ar_wswprp_demonl.uti differ diff --git a/nwnds_module/ar_wswprp_elec01.uti b/nwnds_module/ar_wswprp_elec01.uti new file mode 100644 index 000000000..1b8128acd Binary files /dev/null and b/nwnds_module/ar_wswprp_elec01.uti differ diff --git a/nwnds_module/ar_wswprp_elec02.uti b/nwnds_module/ar_wswprp_elec02.uti new file mode 100644 index 000000000..80bc85d7b Binary files /dev/null and b/nwnds_module/ar_wswprp_elec02.uti differ diff --git a/nwnds_module/ar_wswprp_fire01.uti b/nwnds_module/ar_wswprp_fire01.uti new file mode 100644 index 000000000..984315fa4 Binary files /dev/null and b/nwnds_module/ar_wswprp_fire01.uti differ diff --git a/nwnds_module/ar_wswprp_fire02.uti b/nwnds_module/ar_wswprp_fire02.uti new file mode 100644 index 000000000..206476feb Binary files /dev/null and b/nwnds_module/ar_wswprp_fire02.uti differ diff --git a/nwnds_module/ar_wswprp_ice01.uti b/nwnds_module/ar_wswprp_ice01.uti new file mode 100644 index 000000000..ac518bf6e Binary files /dev/null and b/nwnds_module/ar_wswprp_ice01.uti differ diff --git a/nwnds_module/ar_wswprp_ice02.uti b/nwnds_module/ar_wswprp_ice02.uti new file mode 100644 index 000000000..19acd8ebc Binary files /dev/null and b/nwnds_module/ar_wswprp_ice02.uti differ diff --git a/nwnds_module/ar_wswprp_jankx.uti b/nwnds_module/ar_wswprp_jankx.uti new file mode 100644 index 000000000..9eb4a59e2 Binary files /dev/null and b/nwnds_module/ar_wswprp_jankx.uti differ diff --git a/nwnds_module/ar_wswprp_junard.uti b/nwnds_module/ar_wswprp_junard.uti new file mode 100644 index 000000000..4ef50eef6 Binary files /dev/null and b/nwnds_module/ar_wswprp_junard.uti differ diff --git a/nwnds_module/ar_wswpsc_acid01.uti b/nwnds_module/ar_wswpsc_acid01.uti new file mode 100644 index 000000000..0c02f17b8 Binary files /dev/null and b/nwnds_module/ar_wswpsc_acid01.uti differ diff --git a/nwnds_module/ar_wswpsc_acid02.uti b/nwnds_module/ar_wswpsc_acid02.uti new file mode 100644 index 000000000..1f6b73974 Binary files /dev/null and b/nwnds_module/ar_wswpsc_acid02.uti differ diff --git a/nwnds_module/ar_wswpsc_acidba.uti b/nwnds_module/ar_wswpsc_acidba.uti new file mode 100644 index 000000000..e338f583a Binary files /dev/null and b/nwnds_module/ar_wswpsc_acidba.uti differ diff --git a/nwnds_module/ar_wswpsc_bugban.uti b/nwnds_module/ar_wswpsc_bugban.uti new file mode 100644 index 000000000..41c8c7159 Binary files /dev/null and b/nwnds_module/ar_wswpsc_bugban.uti differ diff --git a/nwnds_module/ar_wswpsc_chaka.uti b/nwnds_module/ar_wswpsc_chaka.uti new file mode 100644 index 000000000..4afe07454 Binary files /dev/null and b/nwnds_module/ar_wswpsc_chaka.uti differ diff --git a/nwnds_module/ar_wswpsc_elec01.uti b/nwnds_module/ar_wswpsc_elec01.uti new file mode 100644 index 000000000..f1601f8a7 Binary files /dev/null and b/nwnds_module/ar_wswpsc_elec01.uti differ diff --git a/nwnds_module/ar_wswpsc_elec02.uti b/nwnds_module/ar_wswpsc_elec02.uti new file mode 100644 index 000000000..4fb202f0f Binary files /dev/null and b/nwnds_module/ar_wswpsc_elec02.uti differ diff --git a/nwnds_module/ar_wswpsc_fire01.uti b/nwnds_module/ar_wswpsc_fire01.uti new file mode 100644 index 000000000..910540b9b Binary files /dev/null and b/nwnds_module/ar_wswpsc_fire01.uti differ diff --git a/nwnds_module/ar_wswpsc_fire02.uti b/nwnds_module/ar_wswpsc_fire02.uti new file mode 100644 index 000000000..cb8f33583 Binary files /dev/null and b/nwnds_module/ar_wswpsc_fire02.uti differ diff --git a/nwnds_module/ar_wswpsc_ice01.uti b/nwnds_module/ar_wswpsc_ice01.uti new file mode 100644 index 000000000..c630632ef Binary files /dev/null and b/nwnds_module/ar_wswpsc_ice01.uti differ diff --git a/nwnds_module/ar_wswpsc_ice02.uti b/nwnds_module/ar_wswpsc_ice02.uti new file mode 100644 index 000000000..4070e689d Binary files /dev/null and b/nwnds_module/ar_wswpsc_ice02.uti differ diff --git a/nwnds_module/ar_wswpsc_psimat.uti b/nwnds_module/ar_wswpsc_psimat.uti new file mode 100644 index 000000000..3ea517ad4 Binary files /dev/null and b/nwnds_module/ar_wswpsc_psimat.uti differ diff --git a/nwnds_module/ar_wswpsc_shaks.uti b/nwnds_module/ar_wswpsc_shaks.uti new file mode 100644 index 000000000..2b8cc139f Binary files /dev/null and b/nwnds_module/ar_wswpsc_shaks.uti differ diff --git a/nwnds_module/ar_wswpss_acid01.uti b/nwnds_module/ar_wswpss_acid01.uti new file mode 100644 index 000000000..5ba8061fd Binary files /dev/null and b/nwnds_module/ar_wswpss_acid01.uti differ diff --git a/nwnds_module/ar_wswpss_acid02.uti b/nwnds_module/ar_wswpss_acid02.uti new file mode 100644 index 000000000..eac90a448 Binary files /dev/null and b/nwnds_module/ar_wswpss_acid02.uti differ diff --git a/nwnds_module/ar_wswpss_astral.uti b/nwnds_module/ar_wswpss_astral.uti new file mode 100644 index 000000000..d55e14b87 Binary files /dev/null and b/nwnds_module/ar_wswpss_astral.uti differ diff --git a/nwnds_module/ar_wswpss_beastm.uti b/nwnds_module/ar_wswpss_beastm.uti new file mode 100644 index 000000000..2259bb488 Binary files /dev/null and b/nwnds_module/ar_wswpss_beastm.uti differ diff --git a/nwnds_module/ar_wswpss_elec01.uti b/nwnds_module/ar_wswpss_elec01.uti new file mode 100644 index 000000000..cd3988a47 Binary files /dev/null and b/nwnds_module/ar_wswpss_elec01.uti differ diff --git a/nwnds_module/ar_wswpss_elec02.uti b/nwnds_module/ar_wswpss_elec02.uti new file mode 100644 index 000000000..4cbb08c3f Binary files /dev/null and b/nwnds_module/ar_wswpss_elec02.uti differ diff --git a/nwnds_module/ar_wswpss_fire01.uti b/nwnds_module/ar_wswpss_fire01.uti new file mode 100644 index 000000000..efedf1590 Binary files /dev/null and b/nwnds_module/ar_wswpss_fire01.uti differ diff --git a/nwnds_module/ar_wswpss_fire02.uti b/nwnds_module/ar_wswpss_fire02.uti new file mode 100644 index 000000000..19b9acd4b Binary files /dev/null and b/nwnds_module/ar_wswpss_fire02.uti differ diff --git a/nwnds_module/ar_wswpss_ice01.uti b/nwnds_module/ar_wswpss_ice01.uti new file mode 100644 index 000000000..82225cd38 Binary files /dev/null and b/nwnds_module/ar_wswpss_ice01.uti differ diff --git a/nwnds_module/ar_wswpss_ice02.uti b/nwnds_module/ar_wswpss_ice02.uti new file mode 100644 index 000000000..bbec10e98 Binary files /dev/null and b/nwnds_module/ar_wswpss_ice02.uti differ diff --git a/nwnds_module/ar_wswrp_alloy.uti b/nwnds_module/ar_wswrp_alloy.uti new file mode 100644 index 000000000..38c7dc692 Binary files /dev/null and b/nwnds_module/ar_wswrp_alloy.uti differ diff --git a/nwnds_module/ar_wswrp_elven.uti b/nwnds_module/ar_wswrp_elven.uti new file mode 100644 index 000000000..cfba358a7 Binary files /dev/null and b/nwnds_module/ar_wswrp_elven.uti differ diff --git a/nwnds_module/ar_wswrp_iron01.uti b/nwnds_module/ar_wswrp_iron01.uti new file mode 100644 index 000000000..501739021 Binary files /dev/null and b/nwnds_module/ar_wswrp_iron01.uti differ diff --git a/nwnds_module/ar_wswrp_ivory.uti b/nwnds_module/ar_wswrp_ivory.uti new file mode 100644 index 000000000..4f59b6022 Binary files /dev/null and b/nwnds_module/ar_wswrp_ivory.uti differ diff --git a/nwnds_module/ar_wswrp_obs01.uti b/nwnds_module/ar_wswrp_obs01.uti new file mode 100644 index 000000000..3b0ac1573 Binary files /dev/null and b/nwnds_module/ar_wswrp_obs01.uti differ diff --git a/nwnds_module/ar_wswrp_obs02.uti b/nwnds_module/ar_wswrp_obs02.uti new file mode 100644 index 000000000..f69903bd9 Binary files /dev/null and b/nwnds_module/ar_wswrp_obs02.uti differ diff --git a/nwnds_module/ar_wswsc_alloy.uti b/nwnds_module/ar_wswsc_alloy.uti new file mode 100644 index 000000000..845dbdd16 Binary files /dev/null and b/nwnds_module/ar_wswsc_alloy.uti differ diff --git a/nwnds_module/ar_wswsc_elven.uti b/nwnds_module/ar_wswsc_elven.uti new file mode 100644 index 000000000..615c742f1 Binary files /dev/null and b/nwnds_module/ar_wswsc_elven.uti differ diff --git a/nwnds_module/ar_wswsc_iron01.uti b/nwnds_module/ar_wswsc_iron01.uti new file mode 100644 index 000000000..dbb0d2a06 Binary files /dev/null and b/nwnds_module/ar_wswsc_iron01.uti differ diff --git a/nwnds_module/ar_wswsc_ivory.uti b/nwnds_module/ar_wswsc_ivory.uti new file mode 100644 index 000000000..535a47af0 Binary files /dev/null and b/nwnds_module/ar_wswsc_ivory.uti differ diff --git a/nwnds_module/ar_wswsc_obs01.uti b/nwnds_module/ar_wswsc_obs01.uti new file mode 100644 index 000000000..b43d5a678 Binary files /dev/null and b/nwnds_module/ar_wswsc_obs01.uti differ diff --git a/nwnds_module/ar_wswsc_obs02.uti b/nwnds_module/ar_wswsc_obs02.uti new file mode 100644 index 000000000..616db4498 Binary files /dev/null and b/nwnds_module/ar_wswsc_obs02.uti differ diff --git a/nwnds_module/ar_wswss_alloy.uti b/nwnds_module/ar_wswss_alloy.uti new file mode 100644 index 000000000..ff1dd9b47 Binary files /dev/null and b/nwnds_module/ar_wswss_alloy.uti differ diff --git a/nwnds_module/ar_wswss_bone01.uti b/nwnds_module/ar_wswss_bone01.uti new file mode 100644 index 000000000..8e72c4c7b Binary files /dev/null and b/nwnds_module/ar_wswss_bone01.uti differ diff --git a/nwnds_module/ar_wswss_dew.uti b/nwnds_module/ar_wswss_dew.uti new file mode 100644 index 000000000..a7b5f50d1 Binary files /dev/null and b/nwnds_module/ar_wswss_dew.uti differ diff --git a/nwnds_module/ar_wswss_elven.uti b/nwnds_module/ar_wswss_elven.uti new file mode 100644 index 000000000..818b8e78e Binary files /dev/null and b/nwnds_module/ar_wswss_elven.uti differ diff --git a/nwnds_module/ar_wswss_gash.uti b/nwnds_module/ar_wswss_gash.uti new file mode 100644 index 000000000..34ca3bde1 Binary files /dev/null and b/nwnds_module/ar_wswss_gash.uti differ diff --git a/nwnds_module/ar_wswss_iron01.uti b/nwnds_module/ar_wswss_iron01.uti new file mode 100644 index 000000000..27990f71e Binary files /dev/null and b/nwnds_module/ar_wswss_iron01.uti differ diff --git a/nwnds_module/ar_wswss_ivory.uti b/nwnds_module/ar_wswss_ivory.uti new file mode 100644 index 000000000..c08c930b7 Binary files /dev/null and b/nwnds_module/ar_wswss_ivory.uti differ diff --git a/nwnds_module/ar_wswss_obs01.uti b/nwnds_module/ar_wswss_obs01.uti new file mode 100644 index 000000000..7a7790ab2 Binary files /dev/null and b/nwnds_module/ar_wswss_obs01.uti differ diff --git a/nwnds_module/ar_wswss_obs02.uti b/nwnds_module/ar_wswss_obs02.uti new file mode 100644 index 000000000..3714ba565 Binary files /dev/null and b/nwnds_module/ar_wswss_obs02.uti differ diff --git a/nwnds_module/ar_wthax_alloy.uti b/nwnds_module/ar_wthax_alloy.uti new file mode 100644 index 000000000..386cd5143 Binary files /dev/null and b/nwnds_module/ar_wthax_alloy.uti differ diff --git a/nwnds_module/ar_wthax_iron01.uti b/nwnds_module/ar_wthax_iron01.uti new file mode 100644 index 000000000..aa0ffa158 Binary files /dev/null and b/nwnds_module/ar_wthax_iron01.uti differ diff --git a/nwnds_module/ar_wthax_ivory.uti b/nwnds_module/ar_wthax_ivory.uti new file mode 100644 index 000000000..424e4151c Binary files /dev/null and b/nwnds_module/ar_wthax_ivory.uti differ diff --git a/nwnds_module/ar_wthax_stone01.uti b/nwnds_module/ar_wthax_stone01.uti new file mode 100644 index 000000000..b7c5b4daf Binary files /dev/null and b/nwnds_module/ar_wthax_stone01.uti differ diff --git a/nwnds_module/ar_wthch_iron01.uti b/nwnds_module/ar_wthch_iron01.uti new file mode 100644 index 000000000..26a7d9b24 Binary files /dev/null and b/nwnds_module/ar_wthch_iron01.uti differ diff --git a/nwnds_module/ar_wthch_ivory.uti b/nwnds_module/ar_wthch_ivory.uti new file mode 100644 index 000000000..8cdb9c087 Binary files /dev/null and b/nwnds_module/ar_wthch_ivory.uti differ diff --git a/nwnds_module/ar_wthdt_alloy.uti b/nwnds_module/ar_wthdt_alloy.uti new file mode 100644 index 000000000..40ac65418 Binary files /dev/null and b/nwnds_module/ar_wthdt_alloy.uti differ diff --git a/nwnds_module/ar_wthdt_bkiller.uti b/nwnds_module/ar_wthdt_bkiller.uti new file mode 100644 index 000000000..d34769327 Binary files /dev/null and b/nwnds_module/ar_wthdt_bkiller.uti differ diff --git a/nwnds_module/ar_wthdt_iron01.uti b/nwnds_module/ar_wthdt_iron01.uti new file mode 100644 index 000000000..3a97ae388 Binary files /dev/null and b/nwnds_module/ar_wthdt_iron01.uti differ diff --git a/nwnds_module/ar_wthdt_ivory.uti b/nwnds_module/ar_wthdt_ivory.uti new file mode 100644 index 000000000..ad9422deb Binary files /dev/null and b/nwnds_module/ar_wthdt_ivory.uti differ diff --git a/nwnds_module/ar_wthdt_strine.uti b/nwnds_module/ar_wthdt_strine.uti new file mode 100644 index 000000000..25f39141f Binary files /dev/null and b/nwnds_module/ar_wthdt_strine.uti differ diff --git a/nwnds_module/ar_wthdt_timiris.uti b/nwnds_module/ar_wthdt_timiris.uti new file mode 100644 index 000000000..fd533ac0b Binary files /dev/null and b/nwnds_module/ar_wthdt_timiris.uti differ diff --git a/nwnds_module/ar_wthdt_wood01.uti b/nwnds_module/ar_wthdt_wood01.uti new file mode 100644 index 000000000..f62a4ed02 Binary files /dev/null and b/nwnds_module/ar_wthdt_wood01.uti differ diff --git a/nwnds_module/ar_wthmax_citygd.uti b/nwnds_module/ar_wthmax_citygd.uti new file mode 100644 index 000000000..e8cb9f472 Binary files /dev/null and b/nwnds_module/ar_wthmax_citygd.uti differ diff --git a/nwnds_module/ar_wthmax_nikhi.uti b/nwnds_module/ar_wthmax_nikhi.uti new file mode 100644 index 000000000..f675aefe1 Binary files /dev/null and b/nwnds_module/ar_wthmax_nikhi.uti differ diff --git a/nwnds_module/ar_wthmax_shadow.uti b/nwnds_module/ar_wthmax_shadow.uti new file mode 100644 index 000000000..5fa776b7b Binary files /dev/null and b/nwnds_module/ar_wthmax_shadow.uti differ diff --git a/nwnds_module/ar_wthmax_urikhg.uti b/nwnds_module/ar_wthmax_urikhg.uti new file mode 100644 index 000000000..9f1ab6442 Binary files /dev/null and b/nwnds_module/ar_wthmax_urikhg.uti differ diff --git a/nwnds_module/ar_wthmdt_shadow.uti b/nwnds_module/ar_wthmdt_shadow.uti new file mode 100644 index 000000000..8d23b0328 Binary files /dev/null and b/nwnds_module/ar_wthmdt_shadow.uti differ diff --git a/nwnds_module/ar_wthmsh_glitte.uti b/nwnds_module/ar_wthmsh_glitte.uti new file mode 100644 index 000000000..4ad4821f7 Binary files /dev/null and b/nwnds_module/ar_wthmsh_glitte.uti differ diff --git a/nwnds_module/ar_wthmsh_shadow.uti b/nwnds_module/ar_wthmsh_shadow.uti new file mode 100644 index 000000000..a7ccd324b Binary files /dev/null and b/nwnds_module/ar_wthmsh_shadow.uti differ diff --git a/nwnds_module/ar_wthpax_acid01.uti b/nwnds_module/ar_wthpax_acid01.uti new file mode 100644 index 000000000..92816c517 Binary files /dev/null and b/nwnds_module/ar_wthpax_acid01.uti differ diff --git a/nwnds_module/ar_wthpax_cleave.uti b/nwnds_module/ar_wthpax_cleave.uti new file mode 100644 index 000000000..75f87f23c Binary files /dev/null and b/nwnds_module/ar_wthpax_cleave.uti differ diff --git a/nwnds_module/ar_wthpax_elec01.uti b/nwnds_module/ar_wthpax_elec01.uti new file mode 100644 index 000000000..256d49ba0 Binary files /dev/null and b/nwnds_module/ar_wthpax_elec01.uti differ diff --git a/nwnds_module/ar_wthpax_fire01.uti b/nwnds_module/ar_wthpax_fire01.uti new file mode 100644 index 000000000..9c07ba552 Binary files /dev/null and b/nwnds_module/ar_wthpax_fire01.uti differ diff --git a/nwnds_module/ar_wthpax_ice01.uti b/nwnds_module/ar_wthpax_ice01.uti new file mode 100644 index 000000000..dd7694eaa Binary files /dev/null and b/nwnds_module/ar_wthpax_ice01.uti differ diff --git a/nwnds_module/ar_wthpdt_acid01.uti b/nwnds_module/ar_wthpdt_acid01.uti new file mode 100644 index 000000000..04a901f6f Binary files /dev/null and b/nwnds_module/ar_wthpdt_acid01.uti differ diff --git a/nwnds_module/ar_wthpdt_elec01.uti b/nwnds_module/ar_wthpdt_elec01.uti new file mode 100644 index 000000000..17021a47a Binary files /dev/null and b/nwnds_module/ar_wthpdt_elec01.uti differ diff --git a/nwnds_module/ar_wthpdt_fire01.uti b/nwnds_module/ar_wthpdt_fire01.uti new file mode 100644 index 000000000..28347b822 Binary files /dev/null and b/nwnds_module/ar_wthpdt_fire01.uti differ diff --git a/nwnds_module/ar_wthpdt_ice01.uti b/nwnds_module/ar_wthpdt_ice01.uti new file mode 100644 index 000000000..828c6feab Binary files /dev/null and b/nwnds_module/ar_wthpdt_ice01.uti differ diff --git a/nwnds_module/ar_wthpsh_acid01.uti b/nwnds_module/ar_wthpsh_acid01.uti new file mode 100644 index 000000000..0fa3083d7 Binary files /dev/null and b/nwnds_module/ar_wthpsh_acid01.uti differ diff --git a/nwnds_module/ar_wthpsh_elec01.uti b/nwnds_module/ar_wthpsh_elec01.uti new file mode 100644 index 000000000..664019acc Binary files /dev/null and b/nwnds_module/ar_wthpsh_elec01.uti differ diff --git a/nwnds_module/ar_wthpsh_fire01.uti b/nwnds_module/ar_wthpsh_fire01.uti new file mode 100644 index 000000000..fbc4c1d2c Binary files /dev/null and b/nwnds_module/ar_wthpsh_fire01.uti differ diff --git a/nwnds_module/ar_wthpsh_ice01.uti b/nwnds_module/ar_wthpsh_ice01.uti new file mode 100644 index 000000000..841709561 Binary files /dev/null and b/nwnds_module/ar_wthpsh_ice01.uti differ diff --git a/nwnds_module/ar_wthsh_alloy.uti b/nwnds_module/ar_wthsh_alloy.uti new file mode 100644 index 000000000..73bd27e96 Binary files /dev/null and b/nwnds_module/ar_wthsh_alloy.uti differ diff --git a/nwnds_module/ar_wthsh_iron01.uti b/nwnds_module/ar_wthsh_iron01.uti new file mode 100644 index 000000000..12facc7d6 Binary files /dev/null and b/nwnds_module/ar_wthsh_iron01.uti differ diff --git a/nwnds_module/ar_wthsh_ivory.uti b/nwnds_module/ar_wthsh_ivory.uti new file mode 100644 index 000000000..19ea3010a Binary files /dev/null and b/nwnds_module/ar_wthsh_ivory.uti differ diff --git a/nwnds_module/ar_wthsh_ivory_5.uti b/nwnds_module/ar_wthsh_ivory_5.uti new file mode 100644 index 000000000..bee055ede Binary files /dev/null and b/nwnds_module/ar_wthsh_ivory_5.uti differ diff --git a/nwnds_module/ar_wthsh_obs01.uti b/nwnds_module/ar_wthsh_obs01.uti new file mode 100644 index 000000000..6f4868c9a Binary files /dev/null and b/nwnds_module/ar_wthsh_obs01.uti differ diff --git a/nwnds_module/ar_wyvern_001.utc b/nwnds_module/ar_wyvern_001.utc new file mode 100644 index 000000000..7571c16f4 Binary files /dev/null and b/nwnds_module/ar_wyvern_001.utc differ diff --git a/nwnds_module/ar_xswfa_alloy.uti b/nwnds_module/ar_xswfa_alloy.uti new file mode 100644 index 000000000..6ee4c407d Binary files /dev/null and b/nwnds_module/ar_xswfa_alloy.uti differ diff --git a/nwnds_module/ar_xswfa_iron01.uti b/nwnds_module/ar_xswfa_iron01.uti new file mode 100644 index 000000000..3737cf5ed Binary files /dev/null and b/nwnds_module/ar_xswfa_iron01.uti differ diff --git a/nwnds_module/ar_xswfa_ivory.uti b/nwnds_module/ar_xswfa_ivory.uti new file mode 100644 index 000000000..e1e9d23ca Binary files /dev/null and b/nwnds_module/ar_xswfa_ivory.uti differ diff --git a/nwnds_module/area034.are b/nwnds_module/area034.are new file mode 100644 index 000000000..614ca8019 Binary files /dev/null and b/nwnds_module/area034.are differ diff --git a/nwnds_module/area034.gic b/nwnds_module/area034.gic new file mode 100644 index 000000000..1cb797ac1 Binary files /dev/null and b/nwnds_module/area034.gic differ diff --git a/nwnds_module/area034.git b/nwnds_module/area034.git new file mode 100644 index 000000000..b35572dec Binary files /dev/null and b/nwnds_module/area034.git differ diff --git a/nwnds_module/area056.are b/nwnds_module/area056.are new file mode 100644 index 000000000..cfba61ab4 Binary files /dev/null and b/nwnds_module/area056.are differ diff --git a/nwnds_module/area056.gic b/nwnds_module/area056.gic new file mode 100644 index 000000000..e28041fd7 Binary files /dev/null and b/nwnds_module/area056.gic differ diff --git a/nwnds_module/area056.git b/nwnds_module/area056.git new file mode 100644 index 000000000..770433426 Binary files /dev/null and b/nwnds_module/area056.git differ diff --git a/nwnds_module/area_trans.ncs b/nwnds_module/area_trans.ncs new file mode 100644 index 000000000..14d05dd0a Binary files /dev/null and b/nwnds_module/area_trans.ncs differ diff --git a/nwnds_module/area_trans.nss b/nwnds_module/area_trans.nss new file mode 100644 index 000000000..c525001c3 --- /dev/null +++ b/nwnds_module/area_trans.nss @@ -0,0 +1,660 @@ +//:://///////////////////////////////////////////// +//:: area_trans +//::////////////////////////////////////////////// +/* + SEAMLESS AREA TRANSITIONS v1.1 + + Version 1: + - areas can be different sizes + - a module can have more than one grid ("Region") + + Version 1.1: + - SetLocalInt(oPC, "AREATRANS_DIRECTION_BACKUP", nDir) + new local integer used in diagonal transitions + if the diagonal direction fails, the nearest cardinal direction (N, S, E, or W) + is used in its place to find a transition area + - int AREATRANS_SQUARES_PER_GRID_UNIT + new global used to correct math error in FindAreaContainingGridTag() + - string GetDirectionName(int nDir) + new function to encapsulate code for generating name from direction integer + + Otherwise this script shares functionality with and is compatible with Jaga's Seamless Area Transitioner. + http://nwvault.ign.com/View.php?view=scripts.Detail&id=89 + by Jaga Te'lesin (jaga-nwn@earthlink.net) + + Jaga's work was the inspiration for this rewrite. + + + For instructions please see the Read Me. + +*/ +//::////////////////////////////////////////////// +//:: Created: The Magus (2013 mar 9) +//:: Modified: The Magus (2013 mar 12) v1.1 +//::////////////////////////////////////////////// + + +// GLOBALS --------------------------------------------------------------------- + +// USER CONFIGURABLE +object AREATRANS_DATA = GetModule(); // Data Object holding area tags for each grid coord + +const int AREATRANS_DEBUG = FALSE; // TRUE turns debugging feedback on +const int AREATRANS_GRID_CARTESIAN = FALSE; // use FALSE If this script is replacing Jaga's AreaTrans in an existing module + // The original Area Trans Grid was NOT cartesian + // TRUE will expect Grid coordinates to be cartesian +const float AREATRANS_DIAGONAL_OFFSET = 3.5f; // Distance out from any corner to sense diagonal movement (8 to 15 recommended) +const float AREATRANS_LANDING_OFFSET = 4.0f; // Distance out from edge in destination Area that PC will land (8 to 10 recommended) +const float AREATRANS_DELAY = 0.0f; // Delay before zoning +const float AREATRANS_REFACTORY_PERIOD = 9.0f; // delay to prevent zoning on arrival in new area +const int AREATRANS_FLEXIBLE_GRID = TRUE; // TRUE - each area regardless of size occupies only one grid coordinate + // FALSE - an area depending on size, may occupy more than one grid coordinate. See below. +const float AREATRANS_GRID_UNIT = 40.0; // INFLEXIBLE GRIDS: + // default area dimension in meters for each grid. + // This becomes the smallest size you can use for a dimension of an area + // The dimensions of larger areas must be a multiple of this figure. + // FLEXIBLE GRID: + // Unused + +int AREATRANS_SQUARES_PER_GRID_UNIT = FloatToInt(AREATRANS_GRID_UNIT/10.0); + +// DO NOT ADJUST THESE Directional constants +const int ERROR = -1; +const int NORTH = 1; // bit 1 +const int SOUTH = 2; // bit 2 +const int EAST = 4; // bit 3 +const int WEST = 8; // bit 4 + +const int NORTHEAST = 5; // north + east +const int SOUTHEAST = 6; // south + east +const int NORTHWEST = 9; // north + west +const int SOUTHWEST = 10; // south + west + + + +// OTHER DATA ------------------------------------------------------------------ +struct GRIDCOORD +{ + string prefix; + string Xtag; + string Ytag; + string Ztag; + int Xpos; + int Ypos; + int Zpos; +}; + +// FUNCTION DECLARATIONS ------------------------------------------------------- + +// leftover from Jaga's Seamless Area Transitioner. To be modified someday with unique VFX. - [FILE: area_trans] +void TransportEffect( object oTarget , float fDuration ); +// Converts an integer to a string for use in the grid coord tag - [FILE: area_trans] +string GetCoordString(int nCoord); +// Returns the first prefix of a tag, without the underscore - [FILE: area_trans] +string GetTagPrefix(string sTag); +// Takes a Grid Tag and breaks it down into its components - [FILE: area_trans] +struct GRIDCOORD ParseGridTag(string sGridTag); +// Returns a tag representing coordinates on grid - [FILE: area_trans] +string GetGridTagAtPositionInArea(struct GRIDCOORD GridCoord, vector vPosition); +// Returns a tag representing coordinates on grid - [FILE: area_trans] +string GetGridTagAtDirection(struct GRIDCOORD GridCoord, int nDir, int nDist=1); +// Called by GetTransitionArea. - [FILE: area_trans] +// Looks for the area origin, by crawling from one grid node to the next FROM the grid node that the PC is transitioning to +object FindAreaContainingGridTag(string sDestGridTag, int nDir, object oPC); +// Returns an integer representing the direction that the PC is transitioning from the area - [FILE: area_trans] +// returns -1 on Error +int GetTransitionDirection(vector vPCVector, float fAreaThisHeight, float fAreaThisWidth, object oPC); +// Returns the name of the direction - [FILE: area_trans] +string GetDirectionName(int nDir); +// Returns an area object in nDir direction from the grid coords sPCGridTag - [FILE: area_trans] +object GetTransitionArea(string sDestGridTag, int nDir, object oPC); + + +// FUNCTION IMPLEMENTATIONS ---------------------------------------------------- + +void TransportEffect (object oTarget, float fDuration) +{ + effect eZoneEffect1 = EffectVisualEffect(VFX_DUR_INVISIBILITY); + //effect eZoneEffect2 = EffectVisualEffect(VFX_IMP_ACID_L); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eZoneEffect1,oTarget,(fDuration*2.0f)); + //ApplyEffectToObject(DURATION_TYPE_INSTANT,eZoneEffect2,oTarget); +} + +string GetCoordString(int nCoord) +{ + string sCoord = IntToString(abs(nCoord)); + if ((nCoord < 10) && (nCoord > -1)) return ("p0"+sCoord); + else if ((nCoord > 9) && (nCoord < 100)) return ("p"+sCoord); + else if ((nCoord > -10) && (nCoord < 0)) return ("n0"+sCoord); + else if ((nCoord > -100) && (nCoord < -9)) return ("n"+sCoord); + + return ""; +} + +string GetTagPrefix(string sTag) +{ + string sTagPrefix = ""; + int iPos1 = FindSubString(sTag, "_"); + int iPos2; + int iLastPos = GetStringLength(sTag)-1; + + if (iPos1 > 0) + { + sTagPrefix = GetStringLeft(sTag, iPos1); // returns prefix without underscores + } + else if (iPos1 == 0) + { + // we have a leading underscore + iPos2 = FindSubString(sTag, "_", ++iPos1);// look for a second underscore + if (iPos2 != -1 && iPos2 != 1 && iPos2 != iLastPos) // ignore: _XXXXX , __XXXX , _XXXX_ + { + sTagPrefix = GetSubString(sTag, iPos1, iPos2 - iPos1); + } + } + + return sTagPrefix; +} + +struct GRIDCOORD ParseGridTag(string sGridTag) +{ + struct GRIDCOORD GridCoord; + + GridCoord.prefix = GetStringLeft(sGridTag, (GetStringLength(sGridTag)-9) ); + string sAreaTagCoord = GetStringRight(sGridTag, 9); + GridCoord.Xtag = GetStringLeft(sAreaTagCoord,3); // X-coordinate of current area (from Tag) + GridCoord.Ytag = GetSubString(sAreaTagCoord,3,3); // Y-coordinate of current area (from Tag) + GridCoord.Ztag = GetStringRight(sAreaTagCoord,3); // Z-coordinate of current area (from Tag) + + GridCoord.Xpos = StringToInt(GetStringRight(GridCoord.Xtag,2)); + if(!(GetStringLeft(GridCoord.Xtag,1)=="p")) + GridCoord.Xpos *= -1; + + GridCoord.Ypos = StringToInt(GetStringRight(GridCoord.Ytag,2)); + if(!(GetStringLeft(GridCoord.Ytag,1)=="p")) + GridCoord.Ypos *= -1; + + GridCoord.Zpos = StringToInt(GetStringRight(GridCoord.Ztag,2)); + if(!(GetStringLeft(GridCoord.Ztag,1)=="p")) + GridCoord.Zpos *= -1; + + return GridCoord; +} + +string GetGridTagAtPositionInArea(struct GRIDCOORD GridCoord, vector vPosition) +{ + int nPosX = GridCoord.Xpos + FloatToInt( (vPosition.x/AREATRANS_GRID_UNIT) ); + int nPosY; + // This bit of code is required to make this code compatible with the original seamless area trans grid coordinates + // the original seamless area transitions used a non-cartesian grid in which numbers increased going south and east + // On a cartesian grid numbers increase going north and east + if(!AREATRANS_GRID_CARTESIAN) + nPosY = GridCoord.Ypos - FloatToInt( (vPosition.y/AREATRANS_GRID_UNIT) ); + else + nPosY = GridCoord.Ypos + FloatToInt( (vPosition.y/AREATRANS_GRID_UNIT) ); + + // construct grid tag in same manner as area tag + return( GridCoord.prefix + GetCoordString(nPosX) + GetCoordString(nPosY) + GridCoord.Ztag ); +} + +string GetGridTagAtDirection(struct GRIDCOORD GridCoord, int nDir, int nDist=1) +{ + int nPosX = GridCoord.Xpos; + int nPosY = GridCoord.Ypos; + if(AREATRANS_GRID_CARTESIAN) + { + //if(nDir==NORTH || nDir==NORTHEAST || nDir==NORTHWEST) + if(nDir&NORTH) + nPosY += nDist; + //else if(nDir==SOUTH || nDir==SOUTHEAST || nDir==SOUTHWEST) + else if(nDir&SOUTH) + nPosY -= nDist; + } + else + { + //if(nDir==NORTH || nDir==NORTHEAST || nDir==NORTHWEST) + if(nDir&NORTH) + nPosY -= nDist; + //else if(nDir==SOUTH || nDir==SOUTHEAST || nDir==SOUTHWEST) + else if(nDir&SOUTH) + nPosY += nDist; + } + //if(nDir==EAST || nDir==NORTHEAST || nDir==SOUTHEAST) + if(nDir&EAST) + nPosX += nDist; + //else if(nDir==WEST || nDir==NORTHWEST || nDir==SOUTHWEST) + else if(nDir&WEST) + nPosX -= nDist; + + // construct grid tag in same manner as area tag + return( GridCoord.prefix + GetCoordString(nPosX) + GetCoordString(nPosY) + GridCoord.Ztag ); +} + +object FindAreaContainingGridTag(string sDestGridTag, int nDir, object oPC) +{ + // if nothing is found look for the valid area tag by cycling through nearby grid coordinates + string sAreaGridTag; + int nMax = FloatToInt(320.0/AREATRANS_GRID_UNIT)-1; + int nMaxSouth, nMaxWest, nDist; + int nSouth, nWest; + if(nDir!=NORTH) + nMaxSouth = nMax; + if(nDir!=EAST) + nMaxWest = nMax; + struct GRIDCOORD SearchCoord = ParseGridTag(sDestGridTag); + object oArea = OBJECT_INVALID; + while(oArea==OBJECT_INVALID) + { + if(nSouth (fAreaThisHeight-10.0)); + if(!bNorth) + bSouth = (vPCVector.y <= 10.0); + bEast = (vPCVector.x > (fAreaThisWidth-10.0)); + if(!bEast) + bWest = (vPCVector.x <= 10.0); + + // On Northern edge tile (area) + if(bNorth) + { + // On North-Eastern corner tile + if(bEast) + { + float fNorthDist = fAreaThisHeight - vPCVector.y; // Distance from North edge + float fEastDist = fAreaThisWidth - vPCVector.x; // Distance from East edge + + if(fNorthDist<=AREATRANS_DIAGONAL_OFFSET && fEastDist<=AREATRANS_DIAGONAL_OFFSET) + { + nDir = NORTHEAST; + if(fEastDist((10.0*nAreaDestWidth)-AREATRANS_LANDING_OFFSET)) + fX = ((10.0*nAreaDestWidth)-AREATRANS_LANDING_OFFSET); + fY = AREATRANS_LANDING_OFFSET; + } + else if(nDir==SOUTH) + { + int nAreaDestWidth = GetAreaSize(AREA_WIDTH, oAreaDest); + fX = vPCVector.x * (nAreaDestWidth/IntToFloat(nAreaThisWidth)); + if(fX((10.0*nAreaDestWidth)-AREATRANS_LANDING_OFFSET)) + fX = ((10.0*nAreaDestWidth)-AREATRANS_LANDING_OFFSET); + + fY = (10.0*GetAreaSize(AREA_HEIGHT, oAreaDest)) - AREATRANS_LANDING_OFFSET; + } + else if(nDir==EAST) + { + int nAreaDestHeight = GetAreaSize(AREA_HEIGHT, oAreaDest); + fX = AREATRANS_LANDING_OFFSET; + fY = vPCVector.y * (nAreaDestHeight/IntToFloat(nAreaThisHeight)); + if(fY((10.0*nAreaDestHeight)-AREATRANS_LANDING_OFFSET)) + fY = ((10.0*nAreaDestHeight)-AREATRANS_LANDING_OFFSET); + } + else if(nDir==WEST) + { + int nAreaDestHeight = GetAreaSize(AREA_HEIGHT, oAreaDest); + fX = (10.0*GetAreaSize(AREA_WIDTH, oAreaDest)) - AREATRANS_LANDING_OFFSET; + fY = vPCVector.y * (nAreaDestHeight/IntToFloat(nAreaThisHeight)); + if(fY((10.0*nAreaDestHeight)-AREATRANS_LANDING_OFFSET)) + fY = ((10.0*nAreaDestHeight)-AREATRANS_LANDING_OFFSET); + } + else if(nDir==NORTHEAST) + { + fX = AREATRANS_LANDING_OFFSET; + fY = AREATRANS_LANDING_OFFSET; + } + else if(nDir==SOUTHEAST) + { + fX = AREATRANS_LANDING_OFFSET; + fY = (10.0*GetAreaSize(AREA_HEIGHT, oAreaDest)) - AREATRANS_LANDING_OFFSET; + } + else if(nDir==SOUTHWEST) + { + fX = (10.0*GetAreaSize(AREA_WIDTH, oAreaDest)) - AREATRANS_LANDING_OFFSET; + fY = (10.0*GetAreaSize(AREA_HEIGHT, oAreaDest)) - AREATRANS_LANDING_OFFSET; + } + else if(nDir==NORTHWEST) + { + fX = (10.0*GetAreaSize(AREA_WIDTH, oAreaDest)) - AREATRANS_LANDING_OFFSET; + fY = AREATRANS_LANDING_OFFSET; + } + + } + + if(AREATRANS_DEBUG) + { + SendMessageToPC(oPC,"AREA FROM ("+GetTag(oAreaThis)+") TO ("+GetTag(oAreaDest)+")"); + SendMessageToPC(oPC,"GRID FROM ("+GetGridTagAtPositionInArea(AreaThis,vPCVector)+") TO ("+sDestGridTag+")"); + SendMessageToPC(oPC,"POSITION FROM ("+FloatToString(vPCVector.x,6)+", "+FloatToString(vPCVector.y,6)+") TO ("+FloatToString(fX,6)+", "+FloatToString(fY,6)+")"); + } + + if(oAreaDest!=OBJECT_INVALID) + { + //if(!GetIsPC(oPC)) + // SetCommandable(TRUE, oPC); + + // Enable pursuit - by providing transition to go to + //SetLocalObject(oPC, "TRANSITION_LAST", OBJECT_SELF); + //SetLocalLocation(oPC,"TRANSITION_LAST", lLocPC); + + //effect eZoneEffect3 = EffectVisualEffect(VFX_IMP_ACID_L); // ZoneIn effect for end-of-transition + location lDestination = Location(oAreaDest, Vector(fX, fY), GetFacingFromLocation(lLocPC)); + + SetLocalInt(oPC,"m_nZoning",TRUE); + TransportEffect(oPC,AREATRANS_DELAY); + string sDir = GetDirectionName(nDir); + SendMessageToPC(oPC, "... heading "+GetStringUpperCase(GetStringLeft(sDir,1))+GetStringRight(sDir,GetStringLength(sDir)-1)+" ..."); + DelayCommand( AREATRANS_DELAY, + AssignCommand(oPC, JumpToLocation(lDestination) ) + ); + DelayCommand( AREATRANS_DELAY+AREATRANS_REFACTORY_PERIOD, + DeleteLocalInt(oPC,"m_nZoning") + ); + /* + DelayCommand( AREATRANS_DELAY, + ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eZoneEffect3,lDestination) + ); + */ + } + else if(AREATRANS_DEBUG) + SendMessageToPC(oPC,"Movement to an invalid area attempted. Area was not found with specified TAG."); +} diff --git a/nwnds_module/areacleanup.ncs b/nwnds_module/areacleanup.ncs new file mode 100644 index 000000000..854b2ee0f Binary files /dev/null and b/nwnds_module/areacleanup.ncs differ diff --git a/nwnds_module/areacleanup.nss b/nwnds_module/areacleanup.nss new file mode 100644 index 000000000..ffa7241ff --- /dev/null +++ b/nwnds_module/areacleanup.nss @@ -0,0 +1,60 @@ +/* areacleanup script +checks the area that it was called for for the presence of pc's, +if there aren't any then it systematically cleans up the area +of extra encounters and loot +*/ +void debug(string dstring) +{ + int isdebug = 0; + if (isdebug == 1) + SendMessageToPC(GetFirstPC(), dstring); +} + + + +void TrashObject(object oObject) +{ + debug(GetTag(oObject) + " is in trashobject"); + if (GetObjectType(oObject) == OBJECT_TYPE_PLACEABLE) { + object oItem = GetFirstItemInInventory(oObject); + while (GetIsObjectValid(oItem)) + { + debug(GetTag(oItem) + " is in trashobject"); + TrashObject(oItem); + oItem = GetNextItemInInventory(oObject); + } + } + else + debug(GetTag(oObject) + " failed to pass as inventory type placeable is getting destroyed"); + AssignCommand(oObject, SetIsDestroyable(TRUE, FALSE, FALSE)); + DestroyObject(oObject); +} + +void main() +{ + object oPC; + oPC = GetFirstPC(); + object tPC = oPC; + debug("We're starting area cleanup"); + while (oPC != OBJECT_INVALID) + { + if (OBJECT_SELF == GetArea(oPC)) + return; + else oPC = GetNextPC(); + } + object oObject = GetFirstObjectInArea(OBJECT_SELF); + while (oObject != OBJECT_INVALID) + { + debug(GetTag(oObject)); + if (GetIsEncounterCreature(oObject) && FindSubString(GetTag(oObject), "_BOSS") > -1) + DestroyObject(oObject); + int iObjectType = GetObjectType(oObject); + switch (iObjectType) { + case OBJECT_TYPE_PLACEABLE: + if (GetTag(oObject) != "BodyBag") { + break; } + case OBJECT_TYPE_ITEM: + TrashObject(oObject); } + oObject = GetNextObjectInArea(OBJECT_SELF); + } +} diff --git a/nwnds_module/areatrans_despaw.ncs b/nwnds_module/areatrans_despaw.ncs new file mode 100644 index 000000000..50a9f8b42 Binary files /dev/null and b/nwnds_module/areatrans_despaw.ncs differ diff --git a/nwnds_module/areatrans_despaw.nss b/nwnds_module/areatrans_despaw.nss new file mode 100644 index 000000000..5882b1461 --- /dev/null +++ b/nwnds_module/areatrans_despaw.nss @@ -0,0 +1,14 @@ +void main() +{ + object oClicker = GetClickingObject(); + + if (!GetIsPC(oClicker)) + DestroyObject(oClicker); + + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + + + AssignCommand(oClicker,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/arelementalhide.uti b/nwnds_module/arelementalhide.uti new file mode 100644 index 000000000..9d33d4f02 Binary files /dev/null and b/nwnds_module/arelementalhide.uti differ diff --git a/nwnds_module/argianthide.uti b/nwnds_module/argianthide.uti new file mode 100644 index 000000000..beae42d90 Binary files /dev/null and b/nwnds_module/argianthide.uti differ diff --git a/nwnds_module/ari_climbing_inc.nss b/nwnds_module/ari_climbing_inc.nss new file mode 100644 index 000000000..d7b773838 --- /dev/null +++ b/nwnds_module/ari_climbing_inc.nss @@ -0,0 +1,313 @@ +#include "nw_i0_plot" + + +//////////////////////////////////////////////////////////////// +//Climbing Include Function Libarary written by JJRittenhouse/// +//GetArmorCheckMod modified from example script found in the /// +//GetItemACValue(object) entry of the Lexicon. /// +//(author: Jason Harris, editor: Jasperre, additional /// +//contributor(s): Kristian Markon, Jasperre) /// +//////////////////////////////////////////////////////////////// + +//Functions in this Library + +//GetArmorCheckMod(): Returns the Armor Check modifier of oItem +//Will return a 0 value to any non-armor passed to this function + +//GetShieldArmorCheckMod(): Returns the Armor Check modifier of oItem +//Will Return a 0 Value to any non-sheild item passed + +//ClimbCheck(): Calculates a climb modifer subtracting Armor check +//penalties and adding a +1 modifier for each level in a class +//that normally possesses Climb as a class skill. +//Performs the Climb roll and compares it to the DC passed to the +//function (nDC). +//Returns 0 if failed, 1 if Passed and 2 if failed by more than 10 +//Sends combat message to the player telling them that a climb +//check was made, the DC of the climb check, the Armor check modifier +//applied as well as the class modifier applied. Indicates success +//or Failure to the Player. Adds 10 for the use of Climbing Rope +//and adds 20 if the player is under the spell effect Spider Climb + + +//JumpAllAssociatesToLocation() +//Gets familiar, animal companion, summon, up to four henchmen, and dominated +//creature, any 1 summon of a creature the PC summoned, and any 1 +//summon of a creature the PC dominates and jumps them to a location + +// GetArmorCheckMod () +// Returns the Armor check modifier of the item passed +// 0 if invalid, or not armor, or just plain not found. +// 0 to -8 as the value of AC got from the armor - 0 for none, -8 for Full plate. +int GetArmorCheckMod(object oItem) +{ + // Make sure the item is valid and is an armor. + if (!(GetIsObjectValid(oItem))) + return 0; + if (GetBaseItemType(oItem) != BASE_ITEM_ARMOR) + return 0; + + // Get the identified flag for safe keeping. + int bIdentified = GetIdentified(oItem); + SetIdentified(oItem,FALSE); + + int nType = 0; + switch (GetGoldPieceValue(oItem)) + { + case 1: nType = 0; break; // None + case 5: nType = 0; break; // Padded + case 10: nType = 0; break; // Leather + case 15: nType = -1; break; // Studded Leather / Hide + case 100: nType = -2; break; // Chain Shirt / Scale Mail + case 150: nType = -5; break; // Chainmail / Breastplate + case 200: nType = -7; break; // Splint Mail / Banded Mail + case 600: nType = -7; break; // Half-Plate + case 1500: nType = -8; break; // Full Plate + } + // Restore the identified flag, and return armor check modifier. + SetIdentified(oItem,bIdentified); + return nType; +} + +// GetClimbClassMod () +//calculate the class modifier by adding one for each level in a +//class that normally gets climb as a skill. +//While 4 ranks might be normally taken at first level, it might +//not have been raised one rank every level. This only represents +//a reasonable climb skill by class of the character. +//adds 10 if climbing rope is used, and adds 20 if the player is under +//the spell effect "Spider Climb Effect". +//This script is not adapted for the PRC hak. +int GetClimbClassMod (object oPC) +{ + +object oRope; +string sRope; +int bUseRope=GetLocalInt (oPC, "bUseRope"); +int nPCClassMod; +int nCreatureClimbMod=GetLocalInt (oPC, "nClimbMod");//local integer set on a creature to give them a climb bonus + +nPCClassMod=nPCClassMod+nCreatureClimbMod;//add that bonus + + if (GetLevelByClass (CLASS_TYPE_ASSASSIN, oPC)>0) + { + nPCClassMod=nPCClassMod+(GetLevelByClass (CLASS_TYPE_ASSASSIN, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_BARBARIAN, oPC)>0) + { + nPCClassMod=nPCClassMod+(GetLevelByClass (CLASS_TYPE_BARBARIAN, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_BARD, oPC)>0) + { + nPCClassMod=nPCClassMod+(GetLevelByClass (CLASS_TYPE_BARD, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_FIGHTER, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_FIGHTER, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_HARPER, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_HARPER, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_MONK, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_MONK, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_RANGER, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_RANGER, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_ROGUE, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_ROGUE, oPC)); + } + if (GetLevelByClass (CLASS_TYPE_SHADOWDANCER, oPC)>0) + { + nPCClassMod=nPCClassMod+ (GetLevelByClass (CLASS_TYPE_SHADOWDANCER, oPC)); + } + +//Checks for the item "Spider Climb Effect" created by the Arcane +//Knowledge "Spider Climb" item to give a +20. Does not stack with +//Rope bonus. + if (HasItem (oPC, "SpiderClimbEffect")) + { + nPCClassMod=nPCClassMod+20; + } +//checks for Climbing rope, and if the rope is marked as used. + else if (HasItem(oPC, "ClimbingRope")) + { + if (bUseRope==TRUE) + { + nPCClassMod=nPCClassMod+10;//gives +10 bonus + } + } + + + return nPCClassMod; +} + +// GetShieldArmorCheckMod () +//Find the Armor check modifier of the item in the shield hand +//of the creature. If the object is not a shield return 0. +int GetShieldArmorCheckMod (object oItem) +{ +int nMod=0; +// Make sure the item is valid, if not return 0 value + if (!GetIsObjectValid(oItem)) + nMod=0; +//if the object is a largeshield return -2 + if (GetBaseItemType(oItem) == BASE_ITEM_LARGESHIELD) + nMod= -2; +//If the object is a smallshield return -1 + if (GetBaseItemType (oItem) == BASE_ITEM_SMALLSHIELD) + nMod= -1; +//If the object is a TowerShield return -10 + if (GetBaseItemType (oItem) == BASE_ITEM_TOWERSHIELD) + nMod= -10; + return nMod; +} + +// ClimbCheck () +//Returns whether a climb check was passed +//Returns 0 if failed, 1 if Passed and 2 if failed by 10 or more +//If the player has Climbing Rope and they are marked as using it +//Check to see if the rope is still useable + +int ClimbCheck (object oCreature, int nDC) + { + string sPassFail;//string value for messaging to player result + int nFray;//fray roll + int nBreak; //break roll + int nRoll; //climb check roll + int nStrMod=GetAbilityModifier (ABILITY_STRENGTH, oCreature);//get str modifier + object oArmorSlot= GetItemInSlot(INVENTORY_SLOT_CHEST,oCreature);//get object worn on chest + object oLeftHandSlot= GetItemInSlot (INVENTORY_SLOT_LEFTHAND, oCreature);//get object in left hand +//The total climb modifier is the armor check penalty, plus class modifier, plus str modifier + int nClimbMod=GetArmorCheckMod(oArmorSlot)+GetShieldArmorCheckMod(oLeftHandSlot) + +GetClimbClassMod(oCreature)+nStrMod; + int bUseRope=GetLocalInt (oCreature, "bUseRope");//pass local integer that stores whether rope is being used + + nRoll=d20();//d20 skill roll + int nClimbTotal=nRoll+nClimbMod;//add total modifier + + if (nClimbTotal>=nDC)//if total exceeds or meets the DC + { + sPassFail=" Success! "; //indicate success, this variable +//is used both to determine what value to return as well as to pass in +//a message to the player the result. + } + else if (nClimbTotal<(nDC-9))//fails by 10 or more + { + sPassFail=" CRITICAL FAILURE! ";//indicate critical failure + } + else + { + sPassFail=" Failed. ";//any other result is a failure + } +//Sends Feedback to the Player for the details of the climb check, breaking down each modifier +//(except Spider Climb and Rope modifiers, which are added to the class modifier) + SendMessageToPC (oCreature, "*Climb Check* DC: "+IntToString(nDC));//it's a climb check, this is the difficulty + SendMessageToPC (oCreature, "| Rolled: "+IntToString(nRoll)+"| Armor Check Modifier: "+ + IntToString(GetArmorCheckMod(oArmorSlot)+GetShieldArmorCheckMod(oLeftHandSlot))+ + "| Modifiers Due to Class: "+IntToString(GetClimbClassMod(oCreature))+"| Strength Modifier: "+IntToString(nStrMod));//this is what you rolled, these are your modifiers to the roll + SendMessageToPC (oCreature, "| Total: "+IntToString(nClimbTotal)+sPassFail);//this was your total, and your result. + +//If the player has and is marked as using rope test if it has becom unusuable + if (HasItem(oCreature, "ClimbingRope")) + { + object oRope; + string sRope; + nFray=d10();//fray chance + nBreak=d10();//break chance + + + + if (bUseRope==TRUE) + { + oRope=GetLocalObject (oCreature, "oRope");//get the exact rope marked as being used, which is stored on the player when they activate the rope + sRope=GetName(oRope);//get the name of the rope. This allows one tag to add the rope modifier to the class modifier, while separating out +//what factors may make it break. This can be used to add climbing kits, climbing claws and all sorts of items, but additional +//scripting will be needed. The script is written with easy expansion in mind. + if (sRope=="Climbing Rope")//regular old rope + { + + if (nFray>8)//roll of 9 or 10 + { + FloatingTextStringOnCreature ("Your rope shows signs of wear", oCreature);//indicate wear and test if the rope is still useable + if (nBreak>7)//roll of 8-10 + { + DestroyObject(oRope, 0.0f); //destroy the rope marked as used + DeleteLocalObject (oCreature, "oRope");//clear the object variable on the player + DeleteLocalInt (oCreature, "bUseRope");//clear the int variable on the player + FloatingTextStringOnCreature ("Your rope has become unusable", oCreature);//indicate the rope is no longer functional. + } + } + } + else if (sRope == "Silk Rope")//nice silk rope + { + if (nFray>9)//roll of 10 + { + FloatingTextStringOnCreature ("Your silk rope shows signs of wear", oCreature);//indicate wear + if (nBreak>8) //roll of 9 or 10 + { + DestroyObject(oRope, 0.0f);//same as above + DeleteLocalObject (oCreature, "oRope"); + DeleteLocalInt (oCreature, "bUseRope"); + FloatingTextStringOnCreature ("Your silk rope has become unusable", oCreature);//indicates the type of rope that has become unuseable too! + } + } + } + } + } + //return result 1 success, 0 failure, 2 critical failure, returns 3 for error checking + //if you are unsure if this function is working correctly (after modifying it) simply provide + //some feedback to tell you if the function returned an 3 value. You can use this as well + //as error control in case something other than a creature is passed to this function + //as a side note, I'm not even sure if this is needed. + if (sPassFail== " Success! ") + return 1; + if (sPassFail== " CRITICAL FAILURE! ") + return 2; + if (sPassFail== " Failed. ") + return 0; + + else + return 3; +} +// JumpAllAssociatesToLocation +//Gets familiar, animal companion, summon, up to four henchmen, and dominated +//creature, any 1 summon of a creature the PC summoned, and any 1 +//summon of a creature the PC dominates and jumps them to a location +void JumpAllAssociatesToLocation (object oPC, location lLocation) +{ + +object oPCCompanion= GetAssociate (ASSOCIATE_TYPE_ANIMALCOMPANION, oPC); +object oPCDominated= GetAssociate (ASSOCIATE_TYPE_DOMINATED, oPC); +object oPCFamiliar= GetAssociate (ASSOCIATE_TYPE_FAMILIAR, oPC); +object oPCHenchman= GetAssociate (ASSOCIATE_TYPE_HENCHMAN, oPC, 1); +object oPCHenchman2= GetAssociate (ASSOCIATE_TYPE_HENCHMAN, oPC, 2);//more than one henchman, up to four +object oPCHenchman3= GetAssociate (ASSOCIATE_TYPE_HENCHMAN, oPC, 3); +object oPCHenchman4= GetAssociate (ASSOCIATE_TYPE_HENCHMAN, oPC, 4); +object oPCSummon= GetAssociate (ASSOCIATE_TYPE_SUMMONED, oPC); +object oPCSummon2= GetAssociate (ASSOCIATE_TYPE_SUMMONED, oPCSummon); //summon of a summoned creature +object oPCSummon3= GetAssociate (ASSOCIATE_TYPE_SUMMONED, oPCDominated);//summon of a dominated creature + if (GetIsObjectValid(oPCCompanion)) + AssignCommand (oPCCompanion, JumpToLocation(lLocation)); + if (GetIsObjectValid (oPCDominated)) + AssignCommand (oPCDominated, JumpToLocation(lLocation)); + if (GetIsObjectValid (oPCFamiliar)) + AssignCommand (oPCFamiliar, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCHenchman)) + AssignCommand (oPCHenchman, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCHenchman2)) + AssignCommand (oPCHenchman2, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCHenchman3)) + AssignCommand (oPCHenchman3, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCSummon)) + AssignCommand (oPCSummon, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCSummon2)) + AssignCommand (oPCSummon2, JumpToLocation (lLocation)); + if (GetIsObjectValid (oPCSummon3)) + AssignCommand (oPCSummon3, JumpToLocation (lLocation)); +} +//void main () {} diff --git a/nwnds_module/array_example.ncs b/nwnds_module/array_example.ncs new file mode 100644 index 000000000..62f9eab42 Binary files /dev/null and b/nwnds_module/array_example.ncs differ diff --git a/nwnds_module/arshadowclaw.uti b/nwnds_module/arshadowclaw.uti new file mode 100644 index 000000000..9514b6c7f Binary files /dev/null and b/nwnds_module/arshadowclaw.uti differ diff --git a/nwnds_module/arshadowproper.uti b/nwnds_module/arshadowproper.uti new file mode 100644 index 000000000..b49f8e16a Binary files /dev/null and b/nwnds_module/arshadowproper.uti differ diff --git a/nwnds_module/arundeadproper.uti b/nwnds_module/arundeadproper.uti new file mode 100644 index 000000000..1b140b5d4 Binary files /dev/null and b/nwnds_module/arundeadproper.uti differ diff --git a/nwnds_module/asg_a_onenter.ncs b/nwnds_module/asg_a_onenter.ncs new file mode 100644 index 000000000..bc8c69497 Binary files /dev/null and b/nwnds_module/asg_a_onenter.ncs differ diff --git a/nwnds_module/asg_a_onenter.nss b/nwnds_module/asg_a_onenter.nss new file mode 100644 index 000000000..8fe9bbac0 --- /dev/null +++ b/nwnds_module/asg_a_onenter.nss @@ -0,0 +1,136 @@ +//:://///////////////////////////////////////////// +//:: Name ASG SpawnKit On Enter +//:: FileName asg_a_onenter +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Place this script on you area's on enter event +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 9/8/03 +//::////////////////////////////////////////////// + +#include "asg_i_spawnkit" +// #include "asg_i_dbplayer" // For the GetLocalKey + +void main() +{ + object oPC = GetEnteringObject(); + object oSpawnPoint; + + int iPCFlying = GetLocalInt(oPC,"ASG_SPAWNKIT_PCFLYING"); + int iVersion; + int iASGQInit = GetLocalInt(GetModule(),"ASG_QUESTENGINE_INT"); + + string sAreaN = GetName(OBJECT_SELF); + string sAreaT = GetTag(OBJECT_SELF); + string sBase = "oSpawnPoint_"; + string sComp; + + if (GetIsPC(oPC) || GetIsDM(oPC) && iPCFlying == FALSE) + { + // ************************** + // * Check to see if Config Has been ran + // ************************** + int iASG_SKIT = GetLocalInt(GetModule(),"ASG_SKIT"); + if (iASG_SKIT == FALSE) + { + SetLocalInt(GetModule(),"ASG_SKIT",TRUE); + ExecuteScript("asg_cfg_spawnkit",GetModule()); + } + object oArea = GetArea(oPC); + // ************* + // ** + // ** Send Area Message To PC or DM (vr 1.3) + // ** + int iASG_SKIT_ADISCR = GetLocalInt(GetModule(),"ASG_SKIT_ADISCR"); + if (iASG_SKIT_ADISCR==TRUE) + { + EntryMessage(GetTag(oArea),oPC); + } + // ************* + // ** + // ** Check Automap Feature (vr 1.3) + // ** + int iMap = GetLocalInt(GetModule(),"ASG_SPAWKIT_AUTOMAPPER"); + if (iMap == TRUE) + { + // Check to see if a No Auto Map Placeable Present + if (GetIsObjectValid(GetNearestObjectByTag("ASG_NOAUTOMAP",oPC))!=TRUE) + { + ExploreAreaForPlayer(oArea, oPC); + } + } + // ************************************ + // ** + // ** Quest Engine Addon 1.4 + // ** + if (iASGQInit==TRUE) + { + int iASG_QE = GetLocalInt(oPC,"ASG_QUESTENGINE"); + if (iASG_QE == TRUE) + { + ExecuteScript("asg_scr_questeng",oPC); + } + } + // ************* + // ** + // ** Check Area Setup - Recored SpawnPoints + // ** + int iDoneOnce = GetLocalInt(oArea,"ASG_AREA_DONEONCE"); + if (iDoneOnce == FALSE) + { + SetLocalInt(oArea,"ASG_AREA_DONEONCE",TRUE); + asg_SetUpArray(oArea); + } + // ************* + // ** + // ** Look For Monsters & Spawn Monsters + // ** + int iWorking = GetLocalInt(oArea,"ASG_A_SPAWNWORKING"); + // ** Single Spawn in Addon Routine 1.5.03 + int iSingleSpawnIn = 0; + int iIndex = GetLocalInt(oArea,"ASG_AREA_SPAWNPOINT_INDEX"); + int iK; + for (iK=1;iK<=iIndex;iK++) + { + //sComp = sBase + IntToString(iK); + // + // * Check for Legacy + // + //oSpawnPoint = GetLocalObject(oArea,sComp); + //if (GetIsObjectValid(oSpawnPoint)) + //{ + // iVersion = GetLocalInt(oSpawnPoint,"ASG_Version"); + // if (iVersion == 14) asg_SpawnCreature14(oArea); + asg_SpawnCreature(oArea); + //} + } + SendMessageToPC(oPC,"* Standard Spawnin Script Execuited."); + SendMessageToPC(oPC,"(@) You have entered "+sAreaN); + } + // Exicute Custom Scripts Here + // + if (GetIsPC(oPC) || GetIsDM(oPC)) + { + // Local Kit - Found on Config Placeable + object oASG_SPKit = GetNearestObjectByTag("ASG_SPAWNKIT_XAREAINFO",oPC); + string sScript_OnEnter = GetLocalString(oASG_SPKit,"SPK_Script_OnEnter"); + if (sScript_OnEnter != "SCRIPT_INVALID") + { + ExecuteScript(sScript_OnEnter,OBJECT_SELF); + } + // Check for Global + sScript_OnEnter = GetLocalString(GetModule(),"ASG_SPKIT_ONENTER"); + if (sScript_OnEnter != "SCRIPT_INVALID") + { + ExecuteScript(sScript_OnEnter,OBJECT_SELF); + } + + } + + + + +} diff --git a/nwnds_module/asg_a_onexit.ncs b/nwnds_module/asg_a_onexit.ncs new file mode 100644 index 000000000..bf45ccf14 Binary files /dev/null and b/nwnds_module/asg_a_onexit.ncs differ diff --git a/nwnds_module/asg_a_onexit.nss b/nwnds_module/asg_a_onexit.nss new file mode 100644 index 000000000..0fe0e2543 --- /dev/null +++ b/nwnds_module/asg_a_onexit.nss @@ -0,0 +1,97 @@ +//:://///////////////////////////////////////////// +//:: Name ASG Spawn Kit - OnAreaExit +//:: FileName asg_a_onexit +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + part of the ASG Spawn Kit. Handles Mob Cleanup + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 05/13/03 +//::////////////////////////////////////////////// + + +#include "asg_i_spawnkit" + +int OAX_DEBUG = FALSE; +void main() +{ + object oPC = GetExitingObject(); + if (GetIsPC(oPC)) + { + object oArea = GetArea(OBJECT_SELF); + object o1stO = GetFirstObjectInArea(oArea); + string sATag = GetTag(oArea); + string sPTag; + + // Check to see if ANY PC's other than DM's are in area. + // object oPlayers = GetFirstPC(); - Testing Fix + object oPCArea; + int iCount = 0; + // OverRide + // Found that when I was flying out with my new wings It's considered leaving + // the area. Here's a overide + int iPCFlying = GetLocalInt(oPC,"ASG_SPAWNKIT_PCFLYING"); + object oPlayers = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,o1stO); + if (GetIsPC(oPlayers)==TRUE || GetIsDM(oPlayers)==TRUE) + { + iCount=1000; + } + /* + while(GetIsObjectValid(oPlayers)) + { + oPCArea = GetArea(oPC); + sPTag = GetTag(oPC); + if (sPTag == sATag) iCount++; + oPlayers = GetNextPC(); + } + */ + if (iCount==0 && GetIsObjectValid(o1stO)==TRUE && GetIsObjectValid(oPlayers)!=TRUE && iPCFlying==FALSE) + { + // > * DEBUG + if (OAX_DEBUG==TRUE) + { + PrintString("(~) No Other Players Found in Area "+GetName(oArea)+", Starting Clean Up."); + PrintString("(>) ... Center Object: "+GetName(o1stO)); + PrintString("(>) ... oPlayer: "+GetName(oPlayers)); + } + // Check to see if ANY PC's other than DM's are in are + asg_CleanArea(oArea); + + } + else + { + // > * DEBUG + if (OAX_DEBUG==TRUE) + { + PrintString("(!) Players Found in Area "+GetName(oArea)+", Not Cleaning Area Up."); + } + // Check to see if ANY PC's other than DM's are in are + } + } + // + // Execute Local Custom Scripts Here + // + if (GetIsPC(oPC) || GetIsDM(oPC)) + { + object oASG_SPKit = GetNearestObjectByTag("ASG_SPAWNKIT_XAREAINFO",oPC); + string sScript_OnEnter = GetLocalString(oASG_SPKit,"SPK_Script_OnExit"); + if (sScript_OnEnter != "SCRIPT_INVALID") + { + ExecuteScript(sScript_OnEnter,OBJECT_SELF); + } + // Check for Global + sScript_OnEnter = GetLocalString(GetModule(),"ASG_SPKIT_ONEXIT"); + if (sScript_OnEnter != "SCRIPT_INVALID") + { + ExecuteScript(sScript_OnEnter,OBJECT_SELF); + } + } + + + + + +} diff --git a/nwnds_module/asg_are_onenter.ncs b/nwnds_module/asg_are_onenter.ncs new file mode 100644 index 000000000..c529ce8df Binary files /dev/null and b/nwnds_module/asg_are_onenter.ncs differ diff --git a/nwnds_module/asg_are_onenter.nss b/nwnds_module/asg_are_onenter.nss new file mode 100644 index 000000000..e2b368409 --- /dev/null +++ b/nwnds_module/asg_are_onenter.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: Name Spawn Kit On Area Enter +//:: FileName +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The idea here is create a *wrapper* place all of your Area On Enter + scripts here. This makes it a bit more effecient when attempting to + update the individual scripts (as I found out trying to update the ACME + module. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 09/17/04 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("asg_a_onenter",OBJECT_SELF); +} + diff --git a/nwnds_module/asg_are_onexit.ncs b/nwnds_module/asg_are_onexit.ncs new file mode 100644 index 000000000..9b37aa514 Binary files /dev/null and b/nwnds_module/asg_are_onexit.ncs differ diff --git a/nwnds_module/asg_are_onexit.nss b/nwnds_module/asg_are_onexit.nss new file mode 100644 index 000000000..89af46dea --- /dev/null +++ b/nwnds_module/asg_are_onexit.nss @@ -0,0 +1,51 @@ +//:://///////////////////////////////////////////// +//:: Name Spawn Kit On Area Exit +//:: FileName +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The idea here is create a *wrapper* place all of your Area On Exit + scripts here. This makes it a bit more effecient when attempting to + update the individual scripts (as I found out trying to update the ACME + module. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 09/17/04 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("asg_a_onexit",OBJECT_SELF); + { + float cleanupdelay = 30.0; //if you change this it alters how long before + // the area cleans up, if you do change it INCLUDE THE DECIMAL, or it won't + // work + if(!GetIsPC(GetExitingObject()) ) { + return; } + object oPC = GetExitingObject(); + if (!GetIsPC(oPC)) + return; + oPC = GetFirstPC(); + while (oPC != OBJECT_INVALID) + { + if (OBJECT_SELF == GetArea(oPC)) + return; + else oPC = GetNextPC(); + } + DelayCommand(cleanupdelay, ExecuteScript("areacleanup", OBJECT_SELF)); + + { + // Get the creature who triggered this event. + object oPC = GetExitingObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Destroy an object (not fully effective until this script ends). + DestroyObject(GetObjectByTag("SilverSpringKey")); + } + } +} diff --git a/nwnds_module/asg_cfg_spawnkit.ncs b/nwnds_module/asg_cfg_spawnkit.ncs new file mode 100644 index 000000000..cbbe60d77 Binary files /dev/null and b/nwnds_module/asg_cfg_spawnkit.ncs differ diff --git a/nwnds_module/asg_cfg_spawnkit.nss b/nwnds_module/asg_cfg_spawnkit.nss new file mode 100644 index 000000000..2b70362b2 --- /dev/null +++ b/nwnds_module/asg_cfg_spawnkit.nss @@ -0,0 +1,50 @@ +//:://///////////////////////////////////////////// +//:: Name ASG Spawnkit User Config File. +//:: FileName asg_cfg_spawkit +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Version 1.3 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny L. Wilbanks +//:: Created On: 8/11/03 +//::////////////////////////////////////////////// + +void main() +{ + // *************************** + // * + // * Automapper + // * + // * Automapping can be turned on or off, changing the TRUE or FALSE. + // * Defualt is TRUE; + int iAutomapper = TRUE; + // *************************** + // * + // * Area Discription + // * + // * This will give a short area discription when the player enters the area + // * Default is FALSE; + int iASG_SKIT_ADISCR = FALSE; + // *************************** + // * + // * Global Script Related + // * + // * This string is a good place to place scripts that you may wish to have + // * fire off on OnEnter and OnExit events. by Defualt these have the words + // * SCRIPT_INVALID, wich tells the spawn kit not to exicute a custom script + // * replace with your own script name for custom script event. The script + // * event will exicute at the end of the Spawn Scripts. + string sOnExit = "SCRIPT_INVALID"; + string sOnEnter = "SCRIPT_INVALID"; + // ******************************* + // * + // * Save Info + // * + SetLocalInt(GetModule(),"ASG_SKIT_ADISCR",iASG_SKIT_ADISCR); + SetLocalInt(GetModule(),"ASG_SPAWKIT_AUTOMAPPER",iAutomapper); + SetLocalString(GetModule(),"ASG_SPKIT_ONENTER",sOnEnter); + SetLocalString(GetModule(),"ASG_SPKIT_ONEXIT",sOnExit); +} diff --git a/nwnds_module/asg_i_skcusttext.nss b/nwnds_module/asg_i_skcusttext.nss new file mode 100644 index 000000000..32d9958da --- /dev/null +++ b/nwnds_module/asg_i_skcusttext.nss @@ -0,0 +1,67 @@ +//:://///////////////////////////////////////////// +//:: Name Area Entery Message +//:: FileName asg_i_skcusttext +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Some DM's whish to add flavor to there modules areas by + adding in text discriptions. Here's a place you could + add some in + + Usage: + + Just mach the Text Discription with a area tag + it will display to the entering player. + place your "If then ID's for the Area Tags" + use sText as the return string. + + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 9/7/03 +//::////////////////////////////////////////////// + +string ASG_CallAreaText(string sAreaTag) +{ + string sText = "No Area Details"; + object oPC = GetEnteringObject(); + object oMOD = GetModule(); + string sPDB = GetPCPlayerName(oPC); // Individule Player Database Name; + string sName = GetName(oPC); + string CDKey = GetPCPublicCDKey(oPC); + string sID = GetStringLeft(sName,20); // Indivudual Character Used inside the + string sHID = sName+CDKey; // Hcr Style; + + string sDawn = "/\-O-/\: It is Dawn, the sun is rising. "; + string sDay = "->O<-: It is Day. "; + string sDusk = ".-0-.: It is Dusk, the sun is setting. "; + string sNight = ".....: It is Night. "; + + string sReturnText; + string sTime; + + if (GetIsDawn()) sTime = sDawn; + if (GetIsDay()) sTime = sDay; + if (GetIsDusk()) sTime = sDusk; + if (GetIsNight()) sTime = sNight; + + // **** Example of Area Discription + if (sAreaTag=="AREATAGHERE") + { + sText = "You are in a cavern, water falls into a yellow flame lit chasim in the center. There is a piller of fire stretching from the dark abyss bellow that climbs into a shaft in the ceiling."; + sText += " In the center of the piller of flame is a yellow glowing crystal."; + } + // ************************************************************************* + // ** Demo Addon + if (sAreaTag=="TheOldRoad") + { + sText = "You have been following the old road for some time. During the day the woods are inhabitied by lions, Tigers and Bears. Who often hunt forest animals. At night the forest is comes alive with wolves and other dangerous caines."; + } + sReturnText = sTime+sText; + return sReturnText; + // Send Messages +} + + + diff --git a/nwnds_module/asg_i_spawnkit.nss b/nwnds_module/asg_i_spawnkit.nss new file mode 100644 index 000000000..d8d14d5a0 --- /dev/null +++ b/nwnds_module/asg_i_spawnkit.nss @@ -0,0 +1,819 @@ +/////////////////////////////////////////////// +//:: Name ASG Area Include +//:: FileName asg_i_spawnkit +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + version 1.3 + + This is the Area Inlcude File for the ASG Spawn Kit + + updated features + + new varible list + + added spawn radious so Mobs don't spawn in ontop of PC's. + + // List of Addon Varibles + + ASG_SpawnLeader - Place a TAG of the creature that this spawn is access to. + if this creature is not Valid, then the Mob will not spawn. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 5/13/03 +//::////////////////////////////////////////////// +void asg_SpawnCreature(object oArea); +void asg_CleanArea(object oArea); +void asg_SetUpArray(object oArea); // Used on the First Enter +int DEBUG_SPK = FALSE; + +#include "NW_I0_GENERIC" +#include "asg_i_skcusttext" + +// Module Based Flagsd +float fDestroyTime = GetLocalFloat(GetModule(),"ASG_SPAWNKIT_DESPAWNTIME"); + +void BiowareClean(object oArea) +{ + // Handle Regular Bioware On Spawn + /* Added to the ASG Spawn Kit for extra Clean Up adds Standard Clean up + so that The Spawn Kit can make use of the Bioware Standard Spawn also. + This just takes the Legacy Section of Mr. Guile's scripts. + Thanks. + */ + object oObject = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oObject) == TRUE) + // makes sure it actually has an object + { + if (GetIsEncounterCreature(oObject) == TRUE) + // if the object is a creature from an encounter + { + DestroyObject(oObject); + // it gets detroyed + } + oObject=GetNextObjectInArea(oArea); + // gets the next object and sends it through the loop + } +} +// ** Message Kit +void EntryMessage(string sAreaTag,object oPlayer) +{ + string sText = "No Area Details"; + // Get Custom Text + sText = "** Area Discription: "+ASG_CallAreaText(sAreaTag); + // Send Messages + SendMessageToPC(oPlayer,sText); + SendMessageToPC(oPlayer,"*************************"); +} +int iRespawntime = GetLocalInt(GetModule(),"ASG_SPAWKIT_RESPAWNT"); +// int iNow = (GetCalendarYear()*10000)+(GetCalendarMonth()*1000)+(GetCalendarDay()*100)+GetTimeHour(); +// Hold on just a bit for this one +void asg_SpawnCreature(object oArea) +{ + // * > DEBUG_SPK + if (DEBUG_SPK == TRUE) + { + PrintString("*******************************"); + PrintString("Starting Creature OnEnterArea Script for "+GetName(oArea)); + PrintString("*******************************"); + } + // ********* + // ** Set as Busy + SetLocalInt(oArea,"ASG_A_SPAWNWORKING",TRUE); + int iIndex = GetLocalInt(oArea,"ASG_AREA_SPAWNPOINT_INDEX"); + + int iK; + int iN; + int iZ; // New ones for the Single Spawn in Routine + + int iSubIndex; + + string sTag; + string sRight; + string sRight5; + + string sLeft; + string sLeft5; + string sNewTag; + + string sMasterIndex; + string sSubIndex; + string sCreature; + string sCreatureTag; + + string sBase; // Base for String + string sComp; // Assbembolded String + int iLen; + int iWander = FALSE; + int iCopyObject = FALSE; + int iPass = TRUE; + + object oCreature; + object oNewCreature; + object oSpawnPoint; + location lLoc; + string sSpawnTag; + // Spawn Time Varibles + int iDawnTime = 0; + int iDayTime = 0; + int iDuskTime = 0; + int iNightTime = 0; + int iDawnPass = FALSE; + int iDawnSpawn = FALSE; + int iDayPass = FALSE; + int iDaySpawn = FALSE; + int iDuskPass = FALSE; + int iDuskSpawn = FALSE; + int iNightPass = FALSE; + int iNightSpawn = FALSE; + int iRoll; + int iChance; + int iNeedToRoll = FALSE; + int iDeleteTime = GetLocalInt(GetModule(),"ASG_SKIT_DELETETIME"); + + + iZ = 1; + // Now Check and receive Individual Spawn information + iZ = GetLocalInt(oArea,"Monster_Cur")+1; + if (iZ > iIndex) iZ = 1; + SetLocalInt(oArea,"Monster_Cur",iZ); + // + //for (iK=iZ;iK=nLevelMax && nLevelMax!=0) return; + // if PC > nLevelMax (0 will allow it to just spawn in then + // exit and return + if (nPCLevel * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(?) Validating Creature Target "+sCreature+"."); + } + + if (GetIsObjectValid(oCreature)==FALSE) + { + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(!) Creature does not Exsist."); + } + // Finding Spawn Point Set up Correct sBase + // find Spawn Point + + lLoc = GetLocation(oSpawnPoint); + // Tear Apart Tag Info to create creature + // ********************************************************** + // * Legacy Code + // ********************************************************** + sTag = GetTag(oSpawnPoint); + iLen = GetStringLength(sTag); + sRight = GetStringRight(sTag,iLen-6); + // Center out the last 5 places from right edge + sRight5 = GetStringRight(sTag,10); + sLeft5 = GetStringLeft(sRight5,1); + // ********************************************************** + sCreatureTag = sRight; + // > Check for Advance Legacy Properties + if (sLeft5=="_") + { + sRight5 = GetStringRight(sTag,9); + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Advanced Properties Found."); + } + sCreatureTag = GetStringLeft(sRight,GetStringLength(sRight)-10); + // Check for Advanced Properties + // ******************** + // * + // * Spawn Time + // * + sSpawnTag = GetStringLeft(sRight5,4); + sLeft = sSpawnTag; + // > * DEBUG_SPK + if (sLeft!="XXXX") + { + iDawnTime = 0; + iDayTime = 0; + iDuskTime = 0; + iNightTime = 0; + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(~) AP: Restricted Spawn Time Found."); + } + sLeft5 = GetStringLeft(sSpawnTag,1); + // Dawn + if (sLeft5=="X") + { + iDawnTime = 100; + } + sLeft5 = GetStringRight(sSpawnTag,3); + sLeft = GetStringLeft(sLeft5,1); + if (sLeft=="X") + { + iDayTime = 100; + } + sLeft5 = GetStringRight(sSpawnTag,2); + sLeft =GetStringLeft(sLeft5,1); + if (sLeft=="X") + { + iDuskTime = 100; + } + sLeft5 = GetStringRight(sSpawnTag,1); + sLeft = sLeft5; + if (sLeft=="X") + { + iNightTime = 100; + } + } + else + { + iDawnTime = 100; + iDayTime = 100; + iDuskTime = 100; + iNightTime = 100; + } + // ******************** + // * + // * Wandering or WayPoint + // * + // * "_XXXX_W_XX" If this Tag is Set to "W" then he will "WalkRandom" + // * otherwise he will attempt to "WalkWaypoints". + sLeft = GetStringRight(sRight5,4); + sLeft5= GetStringLeft(sLeft,1); + if (sLeft5=="W") + { + iWander=FALSE; + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(~) AP: WalkWaypoints applied."); + } + } + // ******************** + // * + // * Copy or Change Tag + // * + // * "_XXXX_X_01" if left to "XX" will create use standard BluePrint + // * If a Number is found then it will create a new Tag with the number added on + // * At the end. Such as "NW_SKELETON" becomes "NW_SKELETON_01". + sLeft = GetStringRight(sRight5,3); + if (sLeft!="XXX") + { + sNewTag=sLeft; + iCopyObject = TRUE; + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(~) AP: CopyObject applied."); + } + } + } + // *********************************************************** + // * End Legacy Code + // *********************************************************** + + // **************************************** + // * Nwn 1.61 Tag Over Ride(s) + // **************************************** + /* + Varible Notes: + + ASG_ NewTag Type: String - This allows you to give + your spanwed in creature a truely + unique Tag. + ASG_Creature_Table Type: Int- This responds to the Tag + being "RANDOM". The list is kept on + the Placeable itself. Thus you can edit + it outside of the scripting enviropemt. + ASG_Creature_X Type: String - This is where you hold + the ResRefs for the creatures. You can + often have the TAG or the ResRef here. + The "X" needs to be replaced by a number + and that number should not exceed the + number you have entered in the + ASG_Creature_Table varible. + ASG_SpawnLeader Spawn Leader. + ASG_WalkWayPoints if this set to "0" then the spawned + monster will just wander around. Otherwise + it setting this to "1" will have the + creature "WalkWaypoints"; + ASG_NoDestroy If this is Set to "1" then the Object + will not be destroyed when all players + exit. Nor will the Delayed Destroy + will be assigend out of the module. + ASG_Spawn_ClearArea Setting this Int to "1" will not have + the creature respawn untill all players + have left the area. + */ + string sNewCreatureTag = sCreatureTag; + string sHotUNewTag = GetLocalString(oSpawnPoint,"ASG_NewTag"); + if (sHotUNewTag!="") + { + sNewCreatureTag = sHotUNewTag; + } + // Find if I should Even Spawn + // Random Monster Off of List + // If the Tag on the Spawn Point Reads RANDOM instead of a regular + // creature Tag, then it will look for inforamtion on the varible + // often used by me to create a Random list of mobs. + int iTable = GetLocalInt(oSpawnPoint,"ASG_Creature_Table"); + if (sCreatureTag == "RANDOM" || iTable > 0) + { + // Call Random Monster List from SpawnPoint + + int iTableRoll = Random(iTable)+1; + sCreatureTag = GetLocalString(oSpawnPoint,"ASG_Creature_"+IntToString(iTableRoll)); + if (sCreatureTag == "") + { + sCreatureTag = "nw_badger";// Badger,Default for Errors + } + } + // Check for Leader Spawn + // The Spawn Leader is the Mob boss. if the Boss is alive keep + // spawinging in the monster else no spawn. + string sSpawnLeaderTag = GetLocalString(oSpawnPoint,"ASG_SpawnLeader"); + if (sSpawnLeaderTag !="") + { + iPass = FALSE; + object oSpawnLeader = GetObjectByTag(sSpawnLeaderTag); + if (GetIsObjectValid(oSpawnLeader)) iPass = TRUE; + } + int iASG_WalkWayPoints = GetLocalInt(oSpawnPoint,"ASG_WalkWayPoints"); + if (iASG_WalkWayPoints == 1) + { + iWander = FALSE; + } + // ******************************************************** + // * Dawn to Night Spawn Time ins + // ******************************************************** + if (iPass == TRUE) + { + // **************************************************** + // Legacy Overides + // **************************************************** + + // Passed Leader Information Get Day Night Info + iPass = FALSE; + if (iDawnTime>0 && GetIsDawn() == TRUE) + { + iNeedToRoll = TRUE; iChance = iDawnTime; + } + if (iDayTime>0 && GetIsDay() == TRUE) + { + iNeedToRoll = TRUE; iChance = iDayTime; + } + if (iDuskTime>0 && GetIsDusk() == TRUE) + { + iNeedToRoll = TRUE; iChance = iDuskTime; + } + if (iNightTime>0 && GetIsNight() == TRUE) + { + iNeedToRoll = TRUE; iChance = iNightTime; + } + // ** Check and Roll times + if(iNeedToRoll == TRUE) + { + iRoll = d100(); + if (iRoll<=iChance) iPass = TRUE; + } + } + // ********************************************************** + // No Destroy? + // ********************************************************** + + int iASG_NoDestroy = GetLocalInt(oSpawnPoint,"ASG_NoDestroy"); + // ************************************* + // * End of most Overides. + // ************************************** + // > * DEBUG_SPK + + if (DEBUG_SPK==TRUE) + { + PrintString("(~) Attempting to Create Creature "+sCreatureTag+" in Area "+GetName(oArea)); + } + if (iPass != FALSE) + { + // ************* + // * added so Creature does not spawn OnTop of Character + // ************* + object oNearestPC = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC,lLoc); + iPass = TRUE; + if (GetIsObjectValid(oNearestPC)) + { + location lNPC = GetLocation(oNearestPC); + float fDistance = GetDistanceBetweenLocations(lNPC,lLoc); + // Current Problem ID freindlies SOo.. .Disabled + if (fDistance>15.0)iPass = TRUE; + } + // ** Nearest PC far enough away + // ************** + // * Added Clear Area Varible + // *********** + int iClearArea = GetLocalInt(oSpawnPoint,"ASG_Spawn_ClearArea"); + if (iClearArea == 1) + { + // Check to See if Spawn Point has Already Spawned a Creature. + if (GetLocalInt(oSpawnPoint,"SPK_Respawn")==TRUE) iPass= FALSE; + } + // *** ALL PASED LETS SPAWN IN! + if (iPass == TRUE) + { + oCreature = CreateObject(OBJECT_TYPE_CREATURE,GetStringLowerCase(sCreatureTag),lLoc,FALSE,sNewCreatureTag); + // **************** + // * Scripting Hook + // **************** + if (GetIsObjectValid(oCreature)) + { // ASG_Script_On_Spawn + string sASG_Script_On_Spawn = GetLocalString(oSpawnPoint,"ASG_Script_On_Spawn"); + if (sASG_Script_On_Spawn!="SCRIPT_INVALID" || sASG_Script_On_Spawn!="") + { + // This Script Exicutes on the newly formed Mob + ExecuteScript(sASG_Script_On_Spawn,oCreature); + } + if (iASG_NoDestroy==1) + { + SetLocalInt(oCreature,"iASG_NoDestroy",TRUE); + + } + SetLocalObject(oCreature,"SpawnPoint",oSpawnPoint); + SetLocalString(oCreature,"AreaLock",sCreature); + SetLocalInt(oSpawnPoint,"SPK_Respawn",TRUE); + // 0---------------------------------------- + // New Auto Delete Code Added + // o---------------------------------------- + if (iDeleteTime>0) DestroyObject(oCreature, RoundsToSeconds(iDeleteTime)); + + } + // end valid + } + } + else + { + oCreature = OBJECT_INVALID; + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Creature Not Spawn, not proper time yet to Spawn."); + } + } + // **************** + // * + // * Advanced Flag : CopyObject + // * + if (iCopyObject == TRUE) + { + oNewCreature = CopyObject(oCreature,GetLocation(oCreature),OBJECT_INVALID,GetTag(oCreature)+"_"+sNewTag); + DestroyObject(oCreature); + oCreature = oNewCreature; + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Attempting to Copy Creature."); + } + + } + // * Succesful. + if (GetIsObjectValid(oCreature)) + { + + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Created {"+GetName(oCreature)+"} Creature Succesful!"); + } + // ******************* + // * + // * Faction Change + // * + string sFactionS = GetLocalString(oSpawnPoint,"ASG_Spawn_Faction"); + if (sFactionS!="") + { + if (sFactionS!="DEFAULT") + { + int iNewFaction = STANDARD_FACTION_HOSTILE; + if (sFactionS!="LEADER") + { + if (sFactionS == "COMMONER") + iNewFaction = STANDARD_FACTION_COMMONER; + if (sFactionS == "DEFENDER") + iNewFaction = STANDARD_FACTION_DEFENDER; + if (sFactionS == "HOSTILE") + iNewFaction = STANDARD_FACTION_HOSTILE; + if (sFactionS == "MERCHANT") + iNewFaction = STANDARD_FACTION_MERCHANT; + ChangeToStandardFaction(oCreature,iNewFaction); + } + else + { + object oSpawnLeader = GetObjectByTag(sSpawnLeaderTag); + if (GetIsObjectValid(oSpawnLeader)) + { + ChangeFaction(oCreature,oSpawnLeader); + } + } + } + } + // **************** + // * + // * Wandering or WayPoint + // * + if (iWander==FALSE) AssignCommand(oCreature,WalkWayPoints(FALSE,1.0)); + else + { + AssignCommand(oCreature,ActionRandomWalk()); + } + // ***************** + // * + // * Set Object To Area + // * + SetLocalObject(oSpawnPoint,"oSpawnPoint_Creature",oCreature); + // ******************** + // * + // * Set to Plot + // * + int iPlot = GetLocalInt(oSpawnPoint,"ASG_Spawn_Trait_Plot"); + if (iPlot==1) SetPlotFlag(oCreature,TRUE); + // ******************** + // * + // * Set to Immortal + // * + iPlot = 0;iPlot = GetLocalInt(oSpawnPoint,"ASG_Spawn_Trait_Immortal"); + if (iPlot==1) SetImmortal(oCreature,TRUE); + } + else + { + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(!) Error Could not Create Creature "+sCreatureTag+" in Area "+GetName(oArea)); + } + } + } + else + { + // * > DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Creature Already Exsists."); + } + } + // } - Use of iN + // } - // Use of K + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("*******************************"); + PrintString("* End OnEnterArea Script"); + PrintString("*******************************"); + } + SetLocalInt(oArea,"ASG_A_SPAWNWORKING",FALSE); +} +// ** +void asg_CleanArea(object oArea) +{ + int iDeleteTime = GetLocalInt(GetModule(),"ASG_SKIT_DELETETIME"); + // * > DEBUG_SPK + if (DEBUG_SPK == TRUE) + { + PrintString("*******************************"); + PrintString("Starting Creature - OnExitArea Script for "+GetName(oArea)); + PrintString("*******************************"); + } + BiowareClean(oArea); + if (iDeleteTime>0) + { + if (DEBUG_SPK == TRUE) + { + PrintString("(!) Found DeleteTime Timer, aborting regular code."); + } + return; + } + // ********* + // ** Set as Busy + SetLocalInt(oArea,"ASG_A_SPAWNWORKING",TRUE); + int iIndex = GetLocalInt(oArea,"ASG_AREA_SPAWNPOINT_INDEX"); + + int iK; + int iN; + string sBase; + string sComp; + string sCreature; + int iLen; + + object oCreature; + object oSpawnPoint; + object oPlayer; // This one is thrown in For Redundacy, + location lLoc; + + int iCurHp; + + // Ovride Varibles + int iASG_NoDestroy; + + + for (iK=1;iK<=iIndex;iK++) + { + sBase = "oSpawnPoint_"; + sComp = sBase + IntToString(iK); + // Orignal Spawn Point Locked to Area. + oSpawnPoint = GetLocalObject(oArea,sComp); + + if (GetIsObjectValid(oSpawnPoint)) + { + // Now this is where you would Assign Multiple Creatures + // to the Spawn Point It could have it's own Index + + // Reset Respawn + SetLocalInt(oSpawnPoint,"SPK_Respawn",FALSE); + sCreature = "oSpawnPoint_Creature"; + // Now check to see if Creature is Alive + oCreature = GetLocalObject(oSpawnPoint,sCreature); + if (GetIsObjectValid(oCreature)) + { + // Check to see if it needs Vaporising + iASG_NoDestroy = GetLocalInt(oCreature,"iASG_NoDestroy"); + oPlayer = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC,oCreature); + + if (GetIsObjectValid(oPlayer)!=TRUE && iASG_NoDestroy==FALSE) + { + // Check for Overides in player + // Found and Destroy) + if (DEBUG_SPK==TRUE) + { + PrintString("(!) Creature Found alive, destroying."); + } + DestroyObject(oCreature); + } + else + { + if (DEBUG_SPK==TRUE) + { + PrintString("(!) Other Despawn Paramitors Used."); + } + } + } + else + { + // * > DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("(*) Creature does not Exsits, Doing Nothing"); + } + + } + } + } + // > * DEBUG_SPK + if (DEBUG_SPK==TRUE) + { + PrintString("*******************************"); + PrintString("* End OnExitArea Script"); + PrintString("*******************************"); + } + SetLocalInt(oArea,"ASG_A_SPAWNWORKING",FALSE); +} +// ** +void asg_SetUpArray(object oArea) +{ + // * > DEBUG_SPK + + if (DEBUG_SPK == TRUE) + { + PrintString("*******************************"); + PrintString("Starting Spawn Point Index for Area "+GetName(oArea)); + PrintString("*******************************"); + } + // ********* + int iIndex; + // ** LOOK FOR SPAWN POINTS and store to memory + // * Tag information: "SPAWN_"+Creature Tag. + // * For this to work correctly the Creature Tag Must be ID to the ResRes. + object oTarget = GetFirstObjectInArea(oArea); + string sBase = "oSpawnPoint_"; + string sComp; + string sTag; + string sTagLeft; + int iSpawnPoint; + int iTotalSP; + int iOType; + + // ** Search for Zombies + while (GetIsObjectValid(oTarget)) + { + iOType = GetObjectType(oTarget); + sTag = GetTag(oTarget); + sTagLeft = GetStringLeft(sTag,5); + if (sTagLeft=="SPAWN") + { + iSpawnPoint++; + sComp = sBase+IntToString(iSpawnPoint); + // * Points to Spawn Location + // oSpawnPoint_X - Object Spawn Point + SetLocalObject(oArea,sComp,oTarget); + // * > DEBUG_SPK + } + oTarget = GetNextObjectInArea(oArea); + } + SetLocalInt(oArea,"ASG_AREA_SPAWNPOINT_INDEX",iSpawnPoint); + + // * > DEBUG_SPK + if (DEBUG_SPK == TRUE) + { + PrintString("*******************************"); + PrintString("End Area "+GetName(oArea)+" Spawn Point Index, Found "+IntToString(iTotalSP)+" Spawn Points, for a Total of "+IntToString(iIndex)+" differant Creatures."); + PrintString("*******************************"); + } + // ********* +} + + diff --git a/nwnds_module/asg_scr_spkithbs.ncs b/nwnds_module/asg_scr_spkithbs.ncs new file mode 100644 index 000000000..50196ffbb Binary files /dev/null and b/nwnds_module/asg_scr_spkithbs.ncs differ diff --git a/nwnds_module/asg_scr_spkithbs.nss b/nwnds_module/asg_scr_spkithbs.nss new file mode 100644 index 000000000..b99de164d --- /dev/null +++ b/nwnds_module/asg_scr_spkithbs.nss @@ -0,0 +1,44 @@ +//:://///////////////////////////////////////////// +//:: Name Spawn Kit Heartbeat Maniger +//:: FileName asg_scr_spkithbs +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This file runs the area heartbeat in releation ship with the SpawnKit + it is only found and to be used on the placeable. ONLY one placeable + per area. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Donny Wilbanks +//:: Created On: 5/13/04 +//::////////////////////////////////////////////// + +#include "asg_i_spawnkit" + +void main() +{ + + object oSelf; + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC,oSelf); + int iSingleSpawnIn = GetLocalInt(oSelf,"SPK_SLOWSPAWNIN"); + if (GetIsObjectValid(oPC) && iSingleSpawnIn == TRUE) + { + // do a quick check since we found PC in area + while (GetIsObjectValid(oPC)) + { + + // *********************************************************** + // * ASG SPAWN KIT 1.3 - Slow Spawn Code + // *********************************************************** + // Designed for the ASG Spawn Kit - needed for the Slow Spawn + // set up. + object oArea = GetArea(oPC); + if (GetIsObjectValid(oArea)) + { + asg_SpawnCreature(oArea); + } + } + } + +} diff --git a/nwnds_module/ashen001.utc b/nwnds_module/ashen001.utc new file mode 100644 index 000000000..59f40a894 Binary files /dev/null and b/nwnds_module/ashen001.utc differ diff --git a/nwnds_module/ashen002.utc b/nwnds_module/ashen002.utc new file mode 100644 index 000000000..60cc19b9d Binary files /dev/null and b/nwnds_module/ashen002.utc differ diff --git a/nwnds_module/ashendrakeclaw.uti b/nwnds_module/ashendrakeclaw.uti new file mode 100644 index 000000000..8a67b4c9d Binary files /dev/null and b/nwnds_module/ashendrakeclaw.uti differ diff --git a/nwnds_module/ashengianthide.uti b/nwnds_module/ashengianthide.uti new file mode 100644 index 000000000..038712f7e Binary files /dev/null and b/nwnds_module/ashengianthide.uti differ diff --git a/nwnds_module/ashengiantslam.uti b/nwnds_module/ashengiantslam.uti new file mode 100644 index 000000000..8f5aa8b71 Binary files /dev/null and b/nwnds_module/ashengiantslam.uti differ diff --git a/nwnds_module/ashgolemrags.uti b/nwnds_module/ashgolemrags.uti new file mode 100644 index 000000000..0ae37ae59 Binary files /dev/null and b/nwnds_module/ashgolemrags.uti differ diff --git a/nwnds_module/assassinvine001.utc b/nwnds_module/assassinvine001.utc new file mode 100644 index 000000000..afe8df849 Binary files /dev/null and b/nwnds_module/assassinvine001.utc differ diff --git a/nwnds_module/assassinvine002.utc b/nwnds_module/assassinvine002.utc new file mode 100644 index 000000000..4bab55612 Binary files /dev/null and b/nwnds_module/assassinvine002.utc differ diff --git a/nwnds_module/assvinehide.uti b/nwnds_module/assvinehide.uti new file mode 100644 index 000000000..e99b0b005 Binary files /dev/null and b/nwnds_module/assvinehide.uti differ diff --git a/nwnds_module/assvineslam.uti b/nwnds_module/assvineslam.uti new file mode 100644 index 000000000..e18224a32 Binary files /dev/null and b/nwnds_module/assvineslam.uti differ diff --git a/nwnds_module/at_001.ncs b/nwnds_module/at_001.ncs new file mode 100644 index 000000000..7e8b2c673 Binary files /dev/null and b/nwnds_module/at_001.ncs differ diff --git a/nwnds_module/at_001.nss b/nwnds_module/at_001.nss new file mode 100644 index 000000000..cbfb3e461 --- /dev/null +++ b/nwnds_module/at_001.nss @@ -0,0 +1,15 @@ +//:://///////////////////////////////////////////// +//:: FileName at_001 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 4:45:17 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("QST_OFFICIALDOCS", GetPCSpeaker(), 1); + + SetLocalInt(GetPCSpeaker(), "nIbodQuest", 1); + +} diff --git a/nwnds_module/at_003.ncs b/nwnds_module/at_003.ncs new file mode 100644 index 000000000..1519e1d65 Binary files /dev/null and b/nwnds_module/at_003.ncs differ diff --git a/nwnds_module/at_003.nss b/nwnds_module/at_003.nss new file mode 100644 index 000000000..20d1f2c38 --- /dev/null +++ b/nwnds_module/at_003.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_003 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 7:17:47 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 20); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(),"CRFT_SPIDERSAC"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_004.ncs b/nwnds_module/at_004.ncs new file mode 100644 index 000000000..e23bed6c9 Binary files /dev/null and b/nwnds_module/at_004.ncs differ diff --git a/nwnds_module/at_004.nss b/nwnds_module/at_004.nss new file mode 100644 index 000000000..a5cf0543e --- /dev/null +++ b/nwnds_module/at_004.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_004 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 7:20:59 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "CRFT_SPIDERSAC"); + + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_005.ncs b/nwnds_module/at_005.ncs new file mode 100644 index 000000000..9534e025b Binary files /dev/null and b/nwnds_module/at_005.ncs differ diff --git a/nwnds_module/at_005.nss b/nwnds_module/at_005.nss new file mode 100644 index 000000000..4c543b36e --- /dev/null +++ b/nwnds_module/at_005.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_005 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 7:28:29 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("AR_KEY_MAGDAS", GetPCSpeaker(), 1); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "CRFT_SPIDERSAC"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_006.ncs b/nwnds_module/at_006.ncs new file mode 100644 index 000000000..bae1545a4 Binary files /dev/null and b/nwnds_module/at_006.ncs differ diff --git a/nwnds_module/at_006.nss b/nwnds_module/at_006.nss new file mode 100644 index 000000000..3759fc52a --- /dev/null +++ b/nwnds_module/at_006.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_006 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:56:51 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_007.ncs b/nwnds_module/at_007.ncs new file mode 100644 index 000000000..86a02c49c Binary files /dev/null and b/nwnds_module/at_007.ncs differ diff --git a/nwnds_module/at_007.nss b/nwnds_module/at_007.nss new file mode 100644 index 000000000..3e772871c --- /dev/null +++ b/nwnds_module/at_007.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_007 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 2:01:57 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("AR_KEY_BARREL", GetPCSpeaker(), 1); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "AR_KEY_BLUE"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_020.ncs b/nwnds_module/at_020.ncs new file mode 100644 index 000000000..ae746ef3e Binary files /dev/null and b/nwnds_module/at_020.ncs differ diff --git a/nwnds_module/at_020.nss b/nwnds_module/at_020.nss new file mode 100644 index 000000000..3a9560ca4 --- /dev/null +++ b/nwnds_module/at_020.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_020 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:34:36 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("crft_giantskull", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFirstTimeTalked", 4); + +} diff --git a/nwnds_module/at_022.ncs b/nwnds_module/at_022.ncs new file mode 100644 index 000000000..54aa2cea2 Binary files /dev/null and b/nwnds_module/at_022.ncs differ diff --git a/nwnds_module/at_022.nss b/nwnds_module/at_022.nss new file mode 100644 index 000000000..0458e3478 --- /dev/null +++ b/nwnds_module/at_022.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: FileName at_022 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:23:25 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 30); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 250); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "qst_arrowcrate"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGrikQuest", 2); + +} diff --git a/nwnds_module/at_10000gp5000xp.ncs b/nwnds_module/at_10000gp5000xp.ncs new file mode 100644 index 000000000..439d9b708 Binary files /dev/null and b/nwnds_module/at_10000gp5000xp.ncs differ diff --git a/nwnds_module/at_10000gp5000xp.nss b/nwnds_module/at_10000gp5000xp.nss new file mode 100644 index 000000000..523dab786 --- /dev/null +++ b/nwnds_module/at_10000gp5000xp.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_100gp500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(7000, GetPCSpeaker()); + + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 15000); + +} + diff --git a/nwnds_module/at_1000gp700xp.ncs b/nwnds_module/at_1000gp700xp.ncs new file mode 100644 index 000000000..0fdf8734c Binary files /dev/null and b/nwnds_module/at_1000gp700xp.ncs differ diff --git a/nwnds_module/at_1000gp700xp.nss b/nwnds_module/at_1000gp700xp.nss new file mode 100644 index 000000000..63bc06b57 --- /dev/null +++ b/nwnds_module/at_1000gp700xp.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_100gp500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 1000); + +} + diff --git a/nwnds_module/at_1000xp.ncs b/nwnds_module/at_1000xp.ncs new file mode 100644 index 000000000..3b3b90efa Binary files /dev/null and b/nwnds_module/at_1000xp.ncs differ diff --git a/nwnds_module/at_1000xp.nss b/nwnds_module/at_1000xp.nss new file mode 100644 index 000000000..5e9e052f8 --- /dev/null +++ b/nwnds_module/at_1000xp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_100gp500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1000, GetPCSpeaker()); + +} + diff --git a/nwnds_module/at_200gp500xp.ncs b/nwnds_module/at_200gp500xp.ncs new file mode 100644 index 000000000..053bf3203 Binary files /dev/null and b/nwnds_module/at_200gp500xp.ncs differ diff --git a/nwnds_module/at_200gp500xp.nss b/nwnds_module/at_200gp500xp.nss new file mode 100644 index 000000000..2c1f7d98a --- /dev/null +++ b/nwnds_module/at_200gp500xp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_100gp500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 200); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 500); + +} diff --git a/nwnds_module/at_300gp300xp.ncs b/nwnds_module/at_300gp300xp.ncs new file mode 100644 index 000000000..f451baa31 Binary files /dev/null and b/nwnds_module/at_300gp300xp.ncs differ diff --git a/nwnds_module/at_300gp300xp.nss b/nwnds_module/at_300gp300xp.nss new file mode 100644 index 000000000..921fe2741 --- /dev/null +++ b/nwnds_module/at_300gp300xp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_100gp500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 300); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 300); + +} diff --git a/nwnds_module/at_aligntochao3.ncs b/nwnds_module/at_aligntochao3.ncs new file mode 100644 index 000000000..cab63d8ea Binary files /dev/null and b/nwnds_module/at_aligntochao3.ncs differ diff --git a/nwnds_module/at_aligntochao3.nss b/nwnds_module/at_aligntochao3.nss new file mode 100644 index 000000000..fba444791 --- /dev/null +++ b/nwnds_module/at_aligntochao3.nss @@ -0,0 +1,5 @@ +void main() +{ +object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_CHAOTIC,3); +} diff --git a/nwnds_module/at_aligntoevil3.ncs b/nwnds_module/at_aligntoevil3.ncs new file mode 100644 index 000000000..ad9f1bbb5 Binary files /dev/null and b/nwnds_module/at_aligntoevil3.ncs differ diff --git a/nwnds_module/at_aligntoevil3.nss b/nwnds_module/at_aligntoevil3.nss new file mode 100644 index 000000000..b2858a3cf --- /dev/null +++ b/nwnds_module/at_aligntoevil3.nss @@ -0,0 +1,5 @@ +void main() +{ +object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_EVIL,3); +} diff --git a/nwnds_module/at_aligntogood3.ncs b/nwnds_module/at_aligntogood3.ncs new file mode 100644 index 000000000..82ae28111 Binary files /dev/null and b/nwnds_module/at_aligntogood3.ncs differ diff --git a/nwnds_module/at_aligntogood3.nss b/nwnds_module/at_aligntogood3.nss new file mode 100644 index 000000000..72fbfd3cf --- /dev/null +++ b/nwnds_module/at_aligntogood3.nss @@ -0,0 +1,5 @@ +void main() +{ +object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,3); +} diff --git a/nwnds_module/at_aligntolaw3.ncs b/nwnds_module/at_aligntolaw3.ncs new file mode 100644 index 000000000..f5f13186f Binary files /dev/null and b/nwnds_module/at_aligntolaw3.ncs differ diff --git a/nwnds_module/at_aligntolaw3.nss b/nwnds_module/at_aligntolaw3.nss new file mode 100644 index 000000000..6ccf2eed2 --- /dev/null +++ b/nwnds_module/at_aligntolaw3.nss @@ -0,0 +1,5 @@ +void main() +{ +object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_LAWFUL,5); +} diff --git a/nwnds_module/at_altinnroom.ncs b/nwnds_module/at_altinnroom.ncs new file mode 100644 index 000000000..dd3e11d11 Binary files /dev/null and b/nwnds_module/at_altinnroom.ncs differ diff --git a/nwnds_module/at_altinnroom.nss b/nwnds_module/at_altinnroom.nss new file mode 100644 index 000000000..93512a2af --- /dev/null +++ b/nwnds_module/at_altinnroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_ALTINNROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_altinnroompay.ncs b/nwnds_module/at_altinnroompay.ncs new file mode 100644 index 000000000..dda8e7149 Binary files /dev/null and b/nwnds_module/at_altinnroompay.ncs differ diff --git a/nwnds_module/at_altinnroompay.nss b/nwnds_module/at_altinnroompay.nss new file mode 100644 index 000000000..c10b55ad7 --- /dev/null +++ b/nwnds_module/at_altinnroompay.nss @@ -0,0 +1,9 @@ +void main() +{ +TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); + +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_ALTINNROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_arenamer2.ncs b/nwnds_module/at_arenamer2.ncs new file mode 100644 index 000000000..4e5ac701e Binary files /dev/null and b/nwnds_module/at_arenamer2.ncs differ diff --git a/nwnds_module/at_arenamer2.nss b/nwnds_module/at_arenamer2.nss new file mode 100644 index 000000000..177b4cca5 --- /dev/null +++ b/nwnds_module/at_arenamer2.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arenamer2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/22/2002 12:40:59 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("ArenaMerchant2"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/at_arenamer22.ncs b/nwnds_module/at_arenamer22.ncs new file mode 100644 index 000000000..c4785083c Binary files /dev/null and b/nwnds_module/at_arenamer22.ncs differ diff --git a/nwnds_module/at_arenamer22.nss b/nwnds_module/at_arenamer22.nss new file mode 100644 index 000000000..5b35fb20b --- /dev/null +++ b/nwnds_module/at_arenamer22.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arenamer22 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/22/2002 12:50:47 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("ArenaMerchant22"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/at_arenamerchant.ncs b/nwnds_module/at_arenamerchant.ncs new file mode 100644 index 000000000..46817a521 Binary files /dev/null and b/nwnds_module/at_arenamerchant.ncs differ diff --git a/nwnds_module/at_arenamerchant.nss b/nwnds_module/at_arenamerchant.nss new file mode 100644 index 000000000..6eb2cc443 --- /dev/null +++ b/nwnds_module/at_arenamerchant.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arenamerchant +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 3:47:25 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("ArenaMerchant"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/at_arisrew1.ncs b/nwnds_module/at_arisrew1.ncs new file mode 100644 index 000000000..5f19eeb8f Binary files /dev/null and b/nwnds_module/at_arisrew1.ncs differ diff --git a/nwnds_module/at_arisrew1.nss b/nwnds_module/at_arisrew1.nss new file mode 100644 index 000000000..27a6b8626 --- /dev/null +++ b/nwnds_module/at_arisrew1.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arisrew1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 11:25:57 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "AristiphanalesNecklace"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_arisrew2.ncs b/nwnds_module/at_arisrew2.ncs new file mode 100644 index 000000000..d75700712 Binary files /dev/null and b/nwnds_module/at_arisrew2.ncs differ diff --git a/nwnds_module/at_arisrew2.nss b/nwnds_module/at_arisrew2.nss new file mode 100644 index 000000000..b2ff9b57a --- /dev/null +++ b/nwnds_module/at_arisrew2.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arisrew2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:19:12 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("necklaceofhealth", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_arisrew3.ncs b/nwnds_module/at_arisrew3.ncs new file mode 100644 index 000000000..285f6810d Binary files /dev/null and b/nwnds_module/at_arisrew3.ncs differ diff --git a/nwnds_module/at_arisrew3.nss b/nwnds_module/at_arisrew3.nss new file mode 100644 index 000000000..08932f380 --- /dev/null +++ b/nwnds_module/at_arisrew3.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arisrew3 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:19:59 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("ironfightinggaun", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_arisrew4.ncs b/nwnds_module/at_arisrew4.ncs new file mode 100644 index 000000000..9b270dfb2 Binary files /dev/null and b/nwnds_module/at_arisrew4.ncs differ diff --git a/nwnds_module/at_arisrew4.nss b/nwnds_module/at_arisrew4.nss new file mode 100644 index 000000000..117a972ee --- /dev/null +++ b/nwnds_module/at_arisrew4.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arisrew4 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:20:30 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("groundingboots", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_arisrew5.ncs b/nwnds_module/at_arisrew5.ncs new file mode 100644 index 000000000..1526b8d33 Binary files /dev/null and b/nwnds_module/at_arisrew5.ncs differ diff --git a/nwnds_module/at_arisrew5.nss b/nwnds_module/at_arisrew5.nss new file mode 100644 index 000000000..a21901c3b --- /dev/null +++ b/nwnds_module/at_arisrew5.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_arisrew5 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:20:54 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("throwingaxeofcle", GetPCSpeaker(), 50); + +} diff --git a/nwnds_module/at_atcromisludg.ncs b/nwnds_module/at_atcromisludg.ncs new file mode 100644 index 000000000..268db78b1 Binary files /dev/null and b/nwnds_module/at_atcromisludg.ncs differ diff --git a/nwnds_module/at_atcromisludg.nss b/nwnds_module/at_atcromisludg.nss new file mode 100644 index 000000000..4a2fef6f0 --- /dev/null +++ b/nwnds_module/at_atcromisludg.nss @@ -0,0 +1,11 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_thecircle") == 6) + { + object oPC = GetEnteringObject(); + object oWayPoint = GetWaypointByTag("WP_CROMISLUDG"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); + } +} diff --git a/nwnds_module/at_atemushroom.ncs b/nwnds_module/at_atemushroom.ncs new file mode 100644 index 000000000..f2a93f108 Binary files /dev/null and b/nwnds_module/at_atemushroom.ncs differ diff --git a/nwnds_module/at_atemushroom.nss b/nwnds_module/at_atemushroom.nss new file mode 100644 index 000000000..2c55ea1c5 --- /dev/null +++ b/nwnds_module/at_atemushroom.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_atemushroom +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 12:07:46 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nAteMushroom", 1); + +} diff --git a/nwnds_module/at_atfullfroom.ncs b/nwnds_module/at_atfullfroom.ncs new file mode 100644 index 000000000..2cbc73a04 Binary files /dev/null and b/nwnds_module/at_atfullfroom.ncs differ diff --git a/nwnds_module/at_atfullfroom.nss b/nwnds_module/at_atfullfroom.nss new file mode 100644 index 000000000..518b3de1a --- /dev/null +++ b/nwnds_module/at_atfullfroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_FULLFROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_attocromsmisl.ncs b/nwnds_module/at_attocromsmisl.ncs new file mode 100644 index 000000000..e923e969e Binary files /dev/null and b/nwnds_module/at_attocromsmisl.ncs differ diff --git a/nwnds_module/at_attocromsmisl.nss b/nwnds_module/at_attocromsmisl.nss new file mode 100644 index 000000000..7e902daae --- /dev/null +++ b/nwnds_module/at_attocromsmisl.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_CROMSMISLAND"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_attopcdocks.ncs b/nwnds_module/at_attopcdocks.ncs new file mode 100644 index 000000000..b859f96be Binary files /dev/null and b/nwnds_module/at_attopcdocks.ncs differ diff --git a/nwnds_module/at_attopcdocks.nss b/nwnds_module/at_attopcdocks.nss new file mode 100644 index 000000000..49f871c25 --- /dev/null +++ b/nwnds_module/at_attopcdocks.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_attopcdocks +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 5:12:08 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(500, GetPCSpeaker(), TRUE); + +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_PCDOCKS"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_belekcharrewb.ncs b/nwnds_module/at_belekcharrewb.ncs new file mode 100644 index 000000000..36a66a46b Binary files /dev/null and b/nwnds_module/at_belekcharrewb.ncs differ diff --git a/nwnds_module/at_belekcharrewb.nss b/nwnds_module/at_belekcharrewb.nss new file mode 100644 index 000000000..ab21ff912 --- /dev/null +++ b/nwnds_module/at_belekcharrewb.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_belekcharrewb +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 2:14:45 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("lesserwarhammero", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_belet2rew.ncs b/nwnds_module/at_belet2rew.ncs new file mode 100644 index 000000000..7aa0ca1ac Binary files /dev/null and b/nwnds_module/at_belet2rew.ncs differ diff --git a/nwnds_module/at_belet2rew.nss b/nwnds_module/at_belet2rew.nss new file mode 100644 index 000000000..4bc0696fb --- /dev/null +++ b/nwnds_module/at_belet2rew.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: FileName at_belet2rew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/18/2002 12:28:04 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("nw_it_gem010", GetPCSpeaker(), 1); + CreateItemOnObject("nw_it_gem002", GetPCSpeaker(), 1); + CreateItemOnObject("nw_it_gem006", GetPCSpeaker(), 1); + CreateItemOnObject("nw_it_gem005", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_beletqset1.ncs b/nwnds_module/at_beletqset1.ncs new file mode 100644 index 000000000..a9eb1c4a4 Binary files /dev/null and b/nwnds_module/at_beletqset1.ncs differ diff --git a/nwnds_module/at_beletqset1.nss b/nwnds_module/at_beletqset1.nss new file mode 100644 index 000000000..6ebcff147 --- /dev/null +++ b/nwnds_module/at_beletqset1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_beletqset2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 1:37:34 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nBeletQuest", 1); + +} diff --git a/nwnds_module/at_beletrew.ncs b/nwnds_module/at_beletrew.ncs new file mode 100644 index 000000000..efba3055a Binary files /dev/null and b/nwnds_module/at_beletrew.ncs differ diff --git a/nwnds_module/at_beletrew.nss b/nwnds_module/at_beletrew.nss new file mode 100644 index 000000000..5931e1417 --- /dev/null +++ b/nwnds_module/at_beletrew.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: FileName at_beletrew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/12/2002 11:19:05 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("nw_it_gem012", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nBeletQuest", 2); + +} diff --git a/nwnds_module/at_beletrewbon.ncs b/nwnds_module/at_beletrewbon.ncs new file mode 100644 index 000000000..516bf0148 Binary files /dev/null and b/nwnds_module/at_beletrewbon.ncs differ diff --git a/nwnds_module/at_beletrewbon.nss b/nwnds_module/at_beletrewbon.nss new file mode 100644 index 000000000..b30853bb9 --- /dev/null +++ b/nwnds_module/at_beletrewbon.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_beletrewbon +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 10:11:01 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("smallshieldofpro", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_bluehelm.ncs b/nwnds_module/at_bluehelm.ncs new file mode 100644 index 000000000..11817e875 Binary files /dev/null and b/nwnds_module/at_bluehelm.ncs differ diff --git a/nwnds_module/at_bluehelm.nss b/nwnds_module/at_bluehelm.nss new file mode 100644 index 000000000..e17ea3694 --- /dev/null +++ b/nwnds_module/at_bluehelm.nss @@ -0,0 +1,31 @@ +//:://///////////////////////////////////////////// +//:: FileName at_bluehelm +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/25/02 8:40:55 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("helmtemp", GetPCSpeaker(), 1); + SetLocalInt(GetPCSpeaker(),"nDidROB",1); + + + // Modify the player's reputation + AdjustReputation(GetPCSpeaker(), GetObjectByTag("tyriansoldier"), 100); + AdjustReputation(GetPCSpeaker(), GetObjectByTag("halflingelite001"), -100); + +object oItem; +object oPC = GetPCSpeaker(); +object oPlayer = GetFirstPC(); +while ( GetIsPC (oPlayer) == TRUE) +{ +oItem = GetItemPossessedBy(oPlayer, "helmva"); +if(GetIsObjectValid(oItem) != 0) +SetPCDislike(oPC,oPlayer); +oPlayer = GetNextPC(); +} + + +} diff --git a/nwnds_module/at_bluerobrew2.ncs b/nwnds_module/at_bluerobrew2.ncs new file mode 100644 index 000000000..2e7c74ca4 Binary files /dev/null and b/nwnds_module/at_bluerobrew2.ncs differ diff --git a/nwnds_module/at_bluerobrew2.nss b/nwnds_module/at_bluerobrew2.nss new file mode 100644 index 000000000..5aba0a001 --- /dev/null +++ b/nwnds_module/at_bluerobrew2.nss @@ -0,0 +1,36 @@ +//:://///////////////////////////////////////////// +//:: FileName at_bluerobrew2 +//::////////////////////////////////////////////// +//:://///////////////////////////////////////////// +//:: Takes the Halfling Leader's Ear from the PC +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/25/02 8:39:07 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); +object oItem; + +if (GetItemPossessedBy(oPC, "di_RedEar")!= OBJECT_INVALID) + { + oItem = GetItemPossessedBy(oPC, "di_RedEar"); + + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + + RewardPartyGP(1000, oPC, FALSE); + RewardPartyXP(2000, GetPCSpeaker()); + + } +else + { + AssignCommand(GetObjectByTag("TemplarMaddox"), ActionSpeakString("I must have the ear as proof")); + + } + +} + diff --git a/nwnds_module/at_boozemerch.ncs b/nwnds_module/at_boozemerch.ncs new file mode 100644 index 000000000..e007b1d04 Binary files /dev/null and b/nwnds_module/at_boozemerch.ncs differ diff --git a/nwnds_module/at_boozemerch.nss b/nwnds_module/at_boozemerch.nss new file mode 100644 index 000000000..cf9cb87a0 --- /dev/null +++ b/nwnds_module/at_boozemerch.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_boozemerch +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/24/02 1:56:17 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("STORE_BOOZE"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/at_brill02.ncs b/nwnds_module/at_brill02.ncs new file mode 100644 index 000000000..65cd71b8a Binary files /dev/null and b/nwnds_module/at_brill02.ncs differ diff --git a/nwnds_module/at_brill02.nss b/nwnds_module/at_brill02.nss new file mode 100644 index 000000000..ebb05f268 --- /dev/null +++ b/nwnds_module/at_brill02.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_brill02 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 8:43:20 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("qst_smithhammer", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nBrillQuest", 1); + +} diff --git a/nwnds_module/at_brill04.ncs b/nwnds_module/at_brill04.ncs new file mode 100644 index 000000000..6b1aa874a Binary files /dev/null and b/nwnds_module/at_brill04.ncs differ diff --git a/nwnds_module/at_brill04.nss b/nwnds_module/at_brill04.nss new file mode 100644 index 000000000..c92900b9a --- /dev/null +++ b/nwnds_module/at_brill04.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: FileName at_brill04 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:21:15 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 25); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 250); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_SMITHHAMMER"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + // Set the variables + SetLocalInt(GetPCSpeaker(), "nBrillQuest", 2); + +} diff --git a/nwnds_module/at_brillsarmor.ncs b/nwnds_module/at_brillsarmor.ncs new file mode 100644 index 000000000..9f302def4 Binary files /dev/null and b/nwnds_module/at_brillsarmor.ncs differ diff --git a/nwnds_module/at_brillsarmor.nss b/nwnds_module/at_brillsarmor.nss new file mode 100644 index 000000000..befe994a5 --- /dev/null +++ b/nwnds_module/at_brillsarmor.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("STORE_BRILL"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_caplvlup.ncs b/nwnds_module/at_caplvlup.ncs new file mode 100644 index 000000000..7c1c396d5 Binary files /dev/null and b/nwnds_module/at_caplvlup.ncs differ diff --git a/nwnds_module/at_caplvlup.nss b/nwnds_module/at_caplvlup.nss new file mode 100644 index 000000000..ee138b1b2 --- /dev/null +++ b/nwnds_module/at_caplvlup.nss @@ -0,0 +1,19 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetHitDice(oPC) <= 2) + { + RewardPartyXP(3000, oPC, FALSE); + + } +} diff --git a/nwnds_module/at_charkandcir.ncs b/nwnds_module/at_charkandcir.ncs new file mode 100644 index 000000000..62dd0ddd9 Binary files /dev/null and b/nwnds_module/at_charkandcir.ncs differ diff --git a/nwnds_module/at_charkandcir.nss b/nwnds_module/at_charkandcir.nss new file mode 100644 index 000000000..c2261925a --- /dev/null +++ b/nwnds_module/at_charkandcir.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_charkandcir +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/18/2002 12:58:33 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("charredkey", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_chesiavaset1.ncs b/nwnds_module/at_chesiavaset1.ncs new file mode 100644 index 000000000..fbaa209a0 Binary files /dev/null and b/nwnds_module/at_chesiavaset1.ncs differ diff --git a/nwnds_module/at_chesiavaset1.nss b/nwnds_module/at_chesiavaset1.nss new file mode 100644 index 000000000..acc5ff222 --- /dev/null +++ b/nwnds_module/at_chesiavaset1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_chesiavaset1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 11:17:09 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nChesiaVA", 1); + +} diff --git a/nwnds_module/at_chk10000coins.ncs b/nwnds_module/at_chk10000coins.ncs new file mode 100644 index 000000000..8fc224d60 Binary files /dev/null and b/nwnds_module/at_chk10000coins.ncs differ diff --git a/nwnds_module/at_chk10000coins.nss b/nwnds_module/at_chk10000coins.nss new file mode 100644 index 000000000..12485c7d1 --- /dev/null +++ b/nwnds_module/at_chk10000coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 10000) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk1000coins.ncs b/nwnds_module/at_chk1000coins.ncs new file mode 100644 index 000000000..b430c8634 Binary files /dev/null and b/nwnds_module/at_chk1000coins.ncs differ diff --git a/nwnds_module/at_chk1000coins.nss b/nwnds_module/at_chk1000coins.nss new file mode 100644 index 000000000..3b60bf6a7 --- /dev/null +++ b/nwnds_module/at_chk1000coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 1000) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk100coins.ncs b/nwnds_module/at_chk100coins.ncs new file mode 100644 index 000000000..d166d27c7 Binary files /dev/null and b/nwnds_module/at_chk100coins.ncs differ diff --git a/nwnds_module/at_chk100coins.nss b/nwnds_module/at_chk100coins.nss new file mode 100644 index 000000000..ee27d51d2 --- /dev/null +++ b/nwnds_module/at_chk100coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 100) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk10coins.ncs b/nwnds_module/at_chk10coins.ncs new file mode 100644 index 000000000..30141cdfa Binary files /dev/null and b/nwnds_module/at_chk10coins.ncs differ diff --git a/nwnds_module/at_chk10coins.nss b/nwnds_module/at_chk10coins.nss new file mode 100644 index 000000000..43916e48b --- /dev/null +++ b/nwnds_module/at_chk10coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 10) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk200coins.ncs b/nwnds_module/at_chk200coins.ncs new file mode 100644 index 000000000..6ea1bd5a9 Binary files /dev/null and b/nwnds_module/at_chk200coins.ncs differ diff --git a/nwnds_module/at_chk200coins.nss b/nwnds_module/at_chk200coins.nss new file mode 100644 index 000000000..ef4ba63a4 --- /dev/null +++ b/nwnds_module/at_chk200coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 200) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk20coins.ncs b/nwnds_module/at_chk20coins.ncs new file mode 100644 index 000000000..87f05d86c Binary files /dev/null and b/nwnds_module/at_chk20coins.ncs differ diff --git a/nwnds_module/at_chk20coins.nss b/nwnds_module/at_chk20coins.nss new file mode 100644 index 000000000..fef461146 --- /dev/null +++ b/nwnds_module/at_chk20coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 20) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk25coins.ncs b/nwnds_module/at_chk25coins.ncs new file mode 100644 index 000000000..ac1e32f7c Binary files /dev/null and b/nwnds_module/at_chk25coins.ncs differ diff --git a/nwnds_module/at_chk25coins.nss b/nwnds_module/at_chk25coins.nss new file mode 100644 index 000000000..52569904e --- /dev/null +++ b/nwnds_module/at_chk25coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 25) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk300coins.ncs b/nwnds_module/at_chk300coins.ncs new file mode 100644 index 000000000..1348de898 Binary files /dev/null and b/nwnds_module/at_chk300coins.ncs differ diff --git a/nwnds_module/at_chk300coins.nss b/nwnds_module/at_chk300coins.nss new file mode 100644 index 000000000..4f929d0e8 --- /dev/null +++ b/nwnds_module/at_chk300coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 300) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk500coins.ncs b/nwnds_module/at_chk500coins.ncs new file mode 100644 index 000000000..855965c1b Binary files /dev/null and b/nwnds_module/at_chk500coins.ncs differ diff --git a/nwnds_module/at_chk500coins.nss b/nwnds_module/at_chk500coins.nss new file mode 100644 index 000000000..6941a614d --- /dev/null +++ b/nwnds_module/at_chk500coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 500) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_chk50coins.ncs b/nwnds_module/at_chk50coins.ncs new file mode 100644 index 000000000..e0a136a93 Binary files /dev/null and b/nwnds_module/at_chk50coins.ncs differ diff --git a/nwnds_module/at_chk50coins.nss b/nwnds_module/at_chk50coins.nss new file mode 100644 index 000000000..d022d085c --- /dev/null +++ b/nwnds_module/at_chk50coins.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 50) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/at_coindrop.ncs b/nwnds_module/at_coindrop.ncs new file mode 100644 index 000000000..e4c03f3b7 Binary files /dev/null and b/nwnds_module/at_coindrop.ncs differ diff --git a/nwnds_module/at_coindrop.nss b/nwnds_module/at_coindrop.nss new file mode 100644 index 000000000..667ce1fbe --- /dev/null +++ b/nwnds_module/at_coindrop.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_coindrop +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/11/2002 11:26:49 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(1, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_coininfountai.ncs b/nwnds_module/at_coininfountai.ncs new file mode 100644 index 000000000..7c58a6765 Binary files /dev/null and b/nwnds_module/at_coininfountai.ncs differ diff --git a/nwnds_module/at_coininfountai.nss b/nwnds_module/at_coininfountai.nss new file mode 100644 index 000000000..6f6742bcb --- /dev/null +++ b/nwnds_module/at_coininfountai.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_coininfountai +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 2:52:53 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(1, GetPCSpeaker(), FALSE); +} diff --git a/nwnds_module/at_cromislchesto.ncs b/nwnds_module/at_cromislchesto.ncs new file mode 100644 index 000000000..c209e95bc Binary files /dev/null and b/nwnds_module/at_cromislchesto.ncs differ diff --git a/nwnds_module/at_cromislchesto.nss b/nwnds_module/at_cromislchesto.nss new file mode 100644 index 000000000..363f52f10 --- /dev/null +++ b/nwnds_module/at_cromislchesto.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: FileName at_cromislchesto +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/30/2002 2:04:00 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 200); + + // Give the speaker some XP + RewardPartyXP(50, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("bansheebolts", GetPCSpeaker(), 99); + +} diff --git a/nwnds_module/at_cromrubloot.ncs b/nwnds_module/at_cromrubloot.ncs new file mode 100644 index 000000000..4ad18f9e0 Binary files /dev/null and b/nwnds_module/at_cromrubloot.ncs differ diff --git a/nwnds_module/at_cromrubloot.nss b/nwnds_module/at_cromrubloot.nss new file mode 100644 index 000000000..ec4c74928 --- /dev/null +++ b/nwnds_module/at_cromrubloot.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_cromrubloot +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 10:37:45 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 500); + + // Give the speaker the items + CreateItemOnObject("bookofdarkprophe", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_cromwindblow.ncs b/nwnds_module/at_cromwindblow.ncs new file mode 100644 index 000000000..b86696b0a Binary files /dev/null and b/nwnds_module/at_cromwindblow.ncs differ diff --git a/nwnds_module/at_cromwindblow.nss b/nwnds_module/at_cromwindblow.nss new file mode 100644 index 000000000..af32344df --- /dev/null +++ b/nwnds_module/at_cromwindblow.nss @@ -0,0 +1,12 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_thecircle") == 6) + { + object oPC = GetEnteringObject(); + object oWayPoint = GetWaypointByTag("WP_CROMWINDBLOW"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); + AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_cromwindblow")); + } +} diff --git a/nwnds_module/at_cyclopsattack.ncs b/nwnds_module/at_cyclopsattack.ncs new file mode 100644 index 000000000..1c36432d1 Binary files /dev/null and b/nwnds_module/at_cyclopsattack.ncs differ diff --git a/nwnds_module/at_cyclopsattack.nss b/nwnds_module/at_cyclopsattack.nss new file mode 100644 index 000000000..fba4e6d87 --- /dev/null +++ b/nwnds_module/at_cyclopsattack.nss @@ -0,0 +1,7 @@ +#include "nw_i0_generic" +void main() +{ + // Set the faction to hate the player, then attack the player + AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -100); + DelayCommand (1.5, DetermineCombatRound (GetPCSpeaker())); +} diff --git a/nwnds_module/at_dariyarew.ncs b/nwnds_module/at_dariyarew.ncs new file mode 100644 index 000000000..f1607fe83 Binary files /dev/null and b/nwnds_module/at_dariyarew.ncs differ diff --git a/nwnds_module/at_dariyarew.nss b/nwnds_module/at_dariyarew.nss new file mode 100644 index 000000000..d8c92030b --- /dev/null +++ b/nwnds_module/at_dariyarew.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_dariyarew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 10:45:54 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some gold + RewardPartyGP(200, GetPCSpeaker()); + + // Give the speaker some XP + RewardPartyXP(500, GetPCSpeaker()); + +} diff --git a/nwnds_module/at_dariyatak25.ncs b/nwnds_module/at_dariyatak25.ncs new file mode 100644 index 000000000..0c7caf673 Binary files /dev/null and b/nwnds_module/at_dariyatak25.ncs differ diff --git a/nwnds_module/at_dariyatak25.nss b/nwnds_module/at_dariyatak25.nss new file mode 100644 index 000000000..30037fdd8 --- /dev/null +++ b/nwnds_module/at_dariyatak25.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_dariyatak40 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 12:13:02 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(25, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_dariyatak40.ncs b/nwnds_module/at_dariyatak40.ncs new file mode 100644 index 000000000..c2b45e42e Binary files /dev/null and b/nwnds_module/at_dariyatak40.ncs differ diff --git a/nwnds_module/at_dariyatak40.nss b/nwnds_module/at_dariyatak40.nss new file mode 100644 index 000000000..1a58bf146 --- /dev/null +++ b/nwnds_module/at_dariyatak40.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_dariyatak40 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 12:13:02 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(40, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_despawnself.ncs b/nwnds_module/at_despawnself.ncs new file mode 100644 index 000000000..d37d61dec Binary files /dev/null and b/nwnds_module/at_despawnself.ncs differ diff --git a/nwnds_module/at_despawnself.nss b/nwnds_module/at_despawnself.nss new file mode 100644 index 000000000..bf0984cb8 --- /dev/null +++ b/nwnds_module/at_despawnself.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +oTarget = OBJECT_SELF; + +DestroyObject(oTarget, 0.0); + +} diff --git a/nwnds_module/at_dgtoss_003.ncs b/nwnds_module/at_dgtoss_003.ncs new file mode 100644 index 000000000..26854961b Binary files /dev/null and b/nwnds_module/at_dgtoss_003.ncs differ diff --git a/nwnds_module/at_dgtoss_003.nss b/nwnds_module/at_dgtoss_003.nss new file mode 100644 index 000000000..6cbb8a8fa --- /dev/null +++ b/nwnds_module/at_dgtoss_003.nss @@ -0,0 +1,16 @@ +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + AssignCommand(oClicker,JumpToLocation(lLoc)); + + GetLocalInt(oClicker, "goldamount"); + + if(GetGold(oClicker) > GetLocalInt(oClicker, "goldamount")) + SetLocalInt(oClicker,"thievesquests",3); + AddJournalQuestEntry ("thievesquests", 4, oClicker); + + +} diff --git a/nwnds_module/at_donate100.ncs b/nwnds_module/at_donate100.ncs new file mode 100644 index 000000000..e63a0ffc7 Binary files /dev/null and b/nwnds_module/at_donate100.ncs differ diff --git a/nwnds_module/at_donate100.nss b/nwnds_module/at_donate100.nss new file mode 100644 index 000000000..342e596a1 --- /dev/null +++ b/nwnds_module/at_donate100.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_donate100 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:01:51 AM +//::////////////////////////////////////////////// +void main() +{ + object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,5); +} diff --git a/nwnds_module/at_donate1000.ncs b/nwnds_module/at_donate1000.ncs new file mode 100644 index 000000000..95d1e2ca5 Binary files /dev/null and b/nwnds_module/at_donate1000.ncs differ diff --git a/nwnds_module/at_donate1000.nss b/nwnds_module/at_donate1000.nss new file mode 100644 index 000000000..dba91a075 --- /dev/null +++ b/nwnds_module/at_donate1000.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_donate1000 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:11:25 AM +//::////////////////////////////////////////////// +void main() +{ +object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,15); +} diff --git a/nwnds_module/at_donate10000.ncs b/nwnds_module/at_donate10000.ncs new file mode 100644 index 000000000..b5af0df7d Binary files /dev/null and b/nwnds_module/at_donate10000.ncs differ diff --git a/nwnds_module/at_donate10000.nss b/nwnds_module/at_donate10000.nss new file mode 100644 index 000000000..2c64c1b0c --- /dev/null +++ b/nwnds_module/at_donate10000.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_donate10000 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:12:19 AM +//::////////////////////////////////////////////// +void main() +{ + object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,20); +} diff --git a/nwnds_module/at_donate50.ncs b/nwnds_module/at_donate50.ncs new file mode 100644 index 000000000..82ae28111 Binary files /dev/null and b/nwnds_module/at_donate50.ncs differ diff --git a/nwnds_module/at_donate50.nss b/nwnds_module/at_donate50.nss new file mode 100644 index 000000000..976a1b4e1 --- /dev/null +++ b/nwnds_module/at_donate50.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_donate50 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:00:00 AM +//::////////////////////////////////////////////// +void main() +{ + object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,3); +} diff --git a/nwnds_module/at_donate500.ncs b/nwnds_module/at_donate500.ncs new file mode 100644 index 000000000..c9acda091 Binary files /dev/null and b/nwnds_module/at_donate500.ncs differ diff --git a/nwnds_module/at_donate500.nss b/nwnds_module/at_donate500.nss new file mode 100644 index 000000000..c9dfc0677 --- /dev/null +++ b/nwnds_module/at_donate500.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_donate500 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:10:26 AM +//::////////////////////////////////////////////// +void main() +{ + object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_GOOD,10); +} diff --git a/nwnds_module/at_drunkpay.ncs b/nwnds_module/at_drunkpay.ncs new file mode 100644 index 000000000..f165d18aa Binary files /dev/null and b/nwnds_module/at_drunkpay.ncs differ diff --git a/nwnds_module/at_drunkpay.nss b/nwnds_module/at_drunkpay.nss new file mode 100644 index 000000000..2c4737f59 --- /dev/null +++ b/nwnds_module/at_drunkpay.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_drunkpay +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/8/2002 11:40:13 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 100); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nDrunkPay", 1); + +} diff --git a/nwnds_module/at_elinikbonus.ncs b/nwnds_module/at_elinikbonus.ncs new file mode 100644 index 000000000..c72d47086 Binary files /dev/null and b/nwnds_module/at_elinikbonus.ncs differ diff --git a/nwnds_module/at_elinikbonus.nss b/nwnds_module/at_elinikbonus.nss new file mode 100644 index 000000000..5d5af80c5 --- /dev/null +++ b/nwnds_module/at_elinikbonus.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_elinikbonus +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/15/2002 11:21:40 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("ringofpolymorph", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_elinikgivenom.ncs b/nwnds_module/at_elinikgivenom.ncs new file mode 100644 index 000000000..d94da6dd7 Binary files /dev/null and b/nwnds_module/at_elinikgivenom.ncs differ diff --git a/nwnds_module/at_elinikgivenom.nss b/nwnds_module/at_elinikgivenom.nss new file mode 100644 index 000000000..be3ea2d9c --- /dev/null +++ b/nwnds_module/at_elinikgivenom.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_elinikgivenom +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 10:40:49 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("queensvenom", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_elinikqset1.ncs b/nwnds_module/at_elinikqset1.ncs new file mode 100644 index 000000000..f23224bba Binary files /dev/null and b/nwnds_module/at_elinikqset1.ncs differ diff --git a/nwnds_module/at_elinikqset1.nss b/nwnds_module/at_elinikqset1.nss new file mode 100644 index 000000000..7dc123eaa --- /dev/null +++ b/nwnds_module/at_elinikqset1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_elinikqset1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:35:21 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nElinikQuest", 1); + +} diff --git a/nwnds_module/at_elinikreward.ncs b/nwnds_module/at_elinikreward.ncs new file mode 100644 index 000000000..bb69da6b7 Binary files /dev/null and b/nwnds_module/at_elinikreward.ncs differ diff --git a/nwnds_module/at_elinikreward.nss b/nwnds_module/at_elinikreward.nss new file mode 100644 index 000000000..6229734cf --- /dev/null +++ b/nwnds_module/at_elinikreward.nss @@ -0,0 +1,15 @@ +//:://///////////////////////////////////////////// +//:: FileName at_elinikreward +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/15/2002 11:09:42 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(750, GetPCSpeaker()); + +} diff --git a/nwnds_module/at_expforsecdoor.ncs b/nwnds_module/at_expforsecdoor.ncs new file mode 100644 index 000000000..787ced9d6 Binary files /dev/null and b/nwnds_module/at_expforsecdoor.ncs differ diff --git a/nwnds_module/at_expforsecdoor.nss b/nwnds_module/at_expforsecdoor.nss new file mode 100644 index 000000000..57aa32554 --- /dev/null +++ b/nwnds_module/at_expforsecdoor.nss @@ -0,0 +1,6 @@ +void main() +{ + + DelayCommand(15.0,ActionCloseDoor(GetObjectByTag("ToFoyer"))); + DelayCommand(15.0,SetLocked(GetObjectByTag("ToFoyer"),TRUE)); +} diff --git a/nwnds_module/at_findbscroll.ncs b/nwnds_module/at_findbscroll.ncs new file mode 100644 index 000000000..62631c6e5 Binary files /dev/null and b/nwnds_module/at_findbscroll.ncs differ diff --git a/nwnds_module/at_findbscroll.nss b/nwnds_module/at_findbscroll.nss new file mode 100644 index 000000000..731455791 --- /dev/null +++ b/nwnds_module/at_findbscroll.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName at_findbscroll +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 12:27:06 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(50, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("scrollofbinding", GetPCSpeaker(), 1); + { +SetLocalInt(GetPCSpeaker(), "Hendel", 4); +} +} diff --git a/nwnds_module/at_findcoin1.ncs b/nwnds_module/at_findcoin1.ncs new file mode 100644 index 000000000..ec0c828c3 Binary files /dev/null and b/nwnds_module/at_findcoin1.ncs differ diff --git a/nwnds_module/at_findcoin1.nss b/nwnds_module/at_findcoin1.nss new file mode 100644 index 000000000..4e28e51f0 --- /dev/null +++ b/nwnds_module/at_findcoin1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_findcoin1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 2:58:05 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_freedignus.ncs b/nwnds_module/at_freedignus.ncs new file mode 100644 index 000000000..3e0f09eb4 Binary files /dev/null and b/nwnds_module/at_freedignus.ncs differ diff --git a/nwnds_module/at_freedignus.nss b/nwnds_module/at_freedignus.nss new file mode 100644 index 000000000..2a27ad232 --- /dev/null +++ b/nwnds_module/at_freedignus.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "ignus", 1); + +} + diff --git a/nwnds_module/at_gearytoss_001.ncs b/nwnds_module/at_gearytoss_001.ncs new file mode 100644 index 000000000..e14c996dc Binary files /dev/null and b/nwnds_module/at_gearytoss_001.ncs differ diff --git a/nwnds_module/at_gearytoss_001.nss b/nwnds_module/at_gearytoss_001.nss new file mode 100644 index 000000000..8f78c0782 --- /dev/null +++ b/nwnds_module/at_gearytoss_001.nss @@ -0,0 +1,8 @@ +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + AssignCommand(oClicker,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_gearytoss_003.ncs b/nwnds_module/at_gearytoss_003.ncs new file mode 100644 index 000000000..a14d496f8 Binary files /dev/null and b/nwnds_module/at_gearytoss_003.ncs differ diff --git a/nwnds_module/at_gearytoss_003.nss b/nwnds_module/at_gearytoss_003.nss new file mode 100644 index 000000000..db097c7d4 --- /dev/null +++ b/nwnds_module/at_gearytoss_003.nss @@ -0,0 +1,16 @@ +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + AssignCommand(oClicker,JumpToLocation(lLoc)); + + object oBracelet = GetItemPossessedBy(oClicker,"QST_GEARYSBRACE"); + if(GetIsObjectValid(oBracelet) != 0) + { + SetLocalInt(oClicker,"thievesquests",2); + SetLocalInt(oClicker,"pickpocket",1); + AddJournalQuestEntry ("thievesquests", 2, oClicker); + } +} diff --git a/nwnds_module/at_gerrofbow.ncs b/nwnds_module/at_gerrofbow.ncs new file mode 100644 index 000000000..7abd55678 Binary files /dev/null and b/nwnds_module/at_gerrofbow.ncs differ diff --git a/nwnds_module/at_gerrofbow.nss b/nwnds_module/at_gerrofbow.nss new file mode 100644 index 000000000..f9065ed60 --- /dev/null +++ b/nwnds_module/at_gerrofbow.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_gerrofbow +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 5:24:21 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("AR_WBWLN_AGAFARI", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_gerrofreward.ncs b/nwnds_module/at_gerrofreward.ncs new file mode 100644 index 000000000..67e50cb3e Binary files /dev/null and b/nwnds_module/at_gerrofreward.ncs differ diff --git a/nwnds_module/at_gerrofreward.nss b/nwnds_module/at_gerrofreward.nss new file mode 100644 index 000000000..f6cf6fe32 --- /dev/null +++ b/nwnds_module/at_gerrofreward.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: FileName at_gerrofreward +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 11:49:03 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 500); + + // Give the speaker some XP + RewardPartyXP(600, GetPCSpeaker()); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_BANDITHEART"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_gerrofspoken1.ncs b/nwnds_module/at_gerrofspoken1.ncs new file mode 100644 index 000000000..a074db18c Binary files /dev/null and b/nwnds_module/at_gerrofspoken1.ncs differ diff --git a/nwnds_module/at_gerrofspoken1.nss b/nwnds_module/at_gerrofspoken1.nss new file mode 100644 index 000000000..bd4f94071 --- /dev/null +++ b/nwnds_module/at_gerrofspoken1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_gerrofspoken1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 1:25:54 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGerrofSpokenTo", 1); + +} diff --git a/nwnds_module/at_getcloie.ncs b/nwnds_module/at_getcloie.ncs new file mode 100644 index 000000000..5f219c2cb Binary files /dev/null and b/nwnds_module/at_getcloie.ncs differ diff --git a/nwnds_module/at_getcloie.nss b/nwnds_module/at_getcloie.nss new file mode 100644 index 000000000..ee2381d87 --- /dev/null +++ b/nwnds_module/at_getcloie.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_getcloie +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:39:27 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + + CreateItemOnObject("cloie", GetPCSpeaker(), 1); + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "KankLeash"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + DestroyObject(GetObjectByTag("KankCloie"), 1.0); +} diff --git a/nwnds_module/at_getftomb.ncs b/nwnds_module/at_getftomb.ncs new file mode 100644 index 000000000..493c0b1dc Binary files /dev/null and b/nwnds_module/at_getftomb.ncs differ diff --git a/nwnds_module/at_getftomb.nss b/nwnds_module/at_getftomb.nss new file mode 100644 index 000000000..e6cb38ee1 --- /dev/null +++ b/nwnds_module/at_getftomb.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName at_getftomb +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 1:05:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(50, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("QST_ITBK_FORTOME", GetPCSpeaker(), 1); +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 2); +} +} diff --git a/nwnds_module/at_getkankleash.ncs b/nwnds_module/at_getkankleash.ncs new file mode 100644 index 000000000..f721d4401 Binary files /dev/null and b/nwnds_module/at_getkankleash.ncs differ diff --git a/nwnds_module/at_getkankleash.nss b/nwnds_module/at_getkankleash.nss new file mode 100644 index 000000000..bf19f9a42 --- /dev/null +++ b/nwnds_module/at_getkankleash.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_getkankleash +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:35:21 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("kankleash", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_give100xp.ncs b/nwnds_module/at_give100xp.ncs new file mode 100644 index 000000000..d15252aad Binary files /dev/null and b/nwnds_module/at_give100xp.ncs differ diff --git a/nwnds_module/at_give100xp.nss b/nwnds_module/at_give100xp.nss new file mode 100644 index 000000000..06279c909 --- /dev/null +++ b/nwnds_module/at_give100xp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_give500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 2:12:38 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(100, oPC, TRUE); + +} diff --git a/nwnds_module/at_give200xp.ncs b/nwnds_module/at_give200xp.ncs new file mode 100644 index 000000000..fa8a2713d Binary files /dev/null and b/nwnds_module/at_give200xp.ncs differ diff --git a/nwnds_module/at_give200xp.nss b/nwnds_module/at_give200xp.nss new file mode 100644 index 000000000..a403e34a5 --- /dev/null +++ b/nwnds_module/at_give200xp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_give500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 2:12:38 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(200, oPC, TRUE); + +} diff --git a/nwnds_module/at_give5000coins.ncs b/nwnds_module/at_give5000coins.ncs new file mode 100644 index 000000000..038813f8e Binary files /dev/null and b/nwnds_module/at_give5000coins.ncs differ diff --git a/nwnds_module/at_give5000coins.nss b/nwnds_module/at_give5000coins.nss new file mode 100644 index 000000000..9835f92aa --- /dev/null +++ b/nwnds_module/at_give5000coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_give5000coins +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 3:58:11 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 5000); + +} diff --git a/nwnds_module/at_give500coins.ncs b/nwnds_module/at_give500coins.ncs new file mode 100644 index 000000000..e83d71ad4 Binary files /dev/null and b/nwnds_module/at_give500coins.ncs differ diff --git a/nwnds_module/at_give500coins.nss b/nwnds_module/at_give500coins.nss new file mode 100644 index 000000000..66ebd1847 --- /dev/null +++ b/nwnds_module/at_give500coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_give100coins +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 12:16:35 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 500); + +} diff --git a/nwnds_module/at_give500xp.ncs b/nwnds_module/at_give500xp.ncs new file mode 100644 index 000000000..685b25b32 Binary files /dev/null and b/nwnds_module/at_give500xp.ncs differ diff --git a/nwnds_module/at_give500xp.nss b/nwnds_module/at_give500xp.nss new file mode 100644 index 000000000..f576d271f --- /dev/null +++ b/nwnds_module/at_give500xp.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_give500xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 2:12:38 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 500); + +} diff --git a/nwnds_module/at_giveale.ncs b/nwnds_module/at_giveale.ncs new file mode 100644 index 000000000..bacb00ce1 Binary files /dev/null and b/nwnds_module/at_giveale.ncs differ diff --git a/nwnds_module/at_giveale.nss b/nwnds_module/at_giveale.nss new file mode 100644 index 000000000..338a23801 --- /dev/null +++ b/nwnds_module/at_giveale.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName at_giveale +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 2:06:30 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("nw_it_mpotion021", GetPCSpeaker(), 1); + // Remove some gold from the player +TakeGoldFromCreature(10, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_giveall500xp.ncs b/nwnds_module/at_giveall500xp.ncs new file mode 100644 index 000000000..2d9b0236c Binary files /dev/null and b/nwnds_module/at_giveall500xp.ncs differ diff --git a/nwnds_module/at_giveall500xp.nss b/nwnds_module/at_giveall500xp.nss new file mode 100644 index 000000000..fd8085db7 --- /dev/null +++ b/nwnds_module/at_giveall500xp.nss @@ -0,0 +1,17 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(500, oPC, TRUE); + +} + diff --git a/nwnds_module/at_givebalictick.ncs b/nwnds_module/at_givebalictick.ncs new file mode 100644 index 000000000..b78caeb60 Binary files /dev/null and b/nwnds_module/at_givebalictick.ncs differ diff --git a/nwnds_module/at_givebalictick.nss b/nwnds_module/at_givebalictick.nss new file mode 100644 index 000000000..fb97a0817 --- /dev/null +++ b/nwnds_module/at_givebalictick.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givebalictick +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 11:45:21 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("balicislandticke", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givebookoheal.ncs b/nwnds_module/at_givebookoheal.ncs new file mode 100644 index 000000000..acf89f197 Binary files /dev/null and b/nwnds_module/at_givebookoheal.ncs differ diff --git a/nwnds_module/at_givebookoheal.nss b/nwnds_module/at_givebookoheal.nss new file mode 100644 index 000000000..cde357968 --- /dev/null +++ b/nwnds_module/at_givebookoheal.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givebookoheal +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:07:22 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker a Book of Healing + CreateItemOnObject("ar_itmbk_healing", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givebottlewat.ncs b/nwnds_module/at_givebottlewat.ncs new file mode 100644 index 000000000..ef13dd85a Binary files /dev/null and b/nwnds_module/at_givebottlewat.ncs differ diff --git a/nwnds_module/at_givebottlewat.nss b/nwnds_module/at_givebottlewat.nss new file mode 100644 index 000000000..6bdd65397 --- /dev/null +++ b/nwnds_module/at_givebottlewat.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givebottlewat +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 2:03:18 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("water001", GetPCSpeaker(), 1); + // Remove some gold from the player +TakeGoldFromCreature(500, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_givecromticke.ncs b/nwnds_module/at_givecromticke.ncs new file mode 100644 index 000000000..c1b4944b3 Binary files /dev/null and b/nwnds_module/at_givecromticke.ncs differ diff --git a/nwnds_module/at_givecromticke.nss b/nwnds_module/at_givecromticke.nss new file mode 100644 index 000000000..9c44bd1a9 --- /dev/null +++ b/nwnds_module/at_givecromticke.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givecromticke +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 11:42:19 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("cromlinislandtic", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givedonafirst.ncs b/nwnds_module/at_givedonafirst.ncs new file mode 100644 index 000000000..63a870b0a Binary files /dev/null and b/nwnds_module/at_givedonafirst.ncs differ diff --git a/nwnds_module/at_givedonafirst.nss b/nwnds_module/at_givedonafirst.nss new file mode 100644 index 000000000..00e0cefe9 --- /dev/null +++ b/nwnds_module/at_givedonafirst.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_gotmirbelt +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 12:45:37 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGaveDonationFirst", 1); +} diff --git a/nwnds_module/at_givejingleboo.ncs b/nwnds_module/at_givejingleboo.ncs new file mode 100644 index 000000000..712831c57 Binary files /dev/null and b/nwnds_module/at_givejingleboo.ncs differ diff --git a/nwnds_module/at_givejingleboo.nss b/nwnds_module/at_givejingleboo.nss new file mode 100644 index 000000000..2dbf79a46 --- /dev/null +++ b/nwnds_module/at_givejingleboo.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givejingleboo +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 1:53:41 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("jingleboots", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givemacosmash.ncs b/nwnds_module/at_givemacosmash.ncs new file mode 100644 index 000000000..24b588e65 Binary files /dev/null and b/nwnds_module/at_givemacosmash.ncs differ diff --git a/nwnds_module/at_givemacosmash.nss b/nwnds_module/at_givemacosmash.nss new file mode 100644 index 000000000..1b689c1ee --- /dev/null +++ b/nwnds_module/at_givemacosmash.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givemacosmash +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:06:56 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker a Mace of Smashing + CreateItemOnObject("ar_wblmml_smash", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_giveorboffire.ncs b/nwnds_module/at_giveorboffire.ncs new file mode 100644 index 000000000..26cfc327b Binary files /dev/null and b/nwnds_module/at_giveorboffire.ncs differ diff --git a/nwnds_module/at_giveorboffire.nss b/nwnds_module/at_giveorboffire.nss new file mode 100644 index 000000000..e9e0c7bf7 --- /dev/null +++ b/nwnds_module/at_giveorboffire.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_giveorboffire +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/17/2002 8:32:38 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker an orb of Fire + CreateItemOnObject("ar_itm_orbfire", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_giveorbofice.ncs b/nwnds_module/at_giveorbofice.ncs new file mode 100644 index 000000000..0137dfd48 Binary files /dev/null and b/nwnds_module/at_giveorbofice.ncs differ diff --git a/nwnds_module/at_giveorbofice.nss b/nwnds_module/at_giveorbofice.nss new file mode 100644 index 000000000..1740704be --- /dev/null +++ b/nwnds_module/at_giveorbofice.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_giveorbofice +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/17/2002 8:31:43 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker an Orb of Ice + CreateItemOnObject("ar_itm_orbice", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_giveorbofligh.ncs b/nwnds_module/at_giveorbofligh.ncs new file mode 100644 index 000000000..b3cd86f18 Binary files /dev/null and b/nwnds_module/at_giveorbofligh.ncs differ diff --git a/nwnds_module/at_giveorbofligh.nss b/nwnds_module/at_giveorbofligh.nss new file mode 100644 index 000000000..2e99a1e2d --- /dev/null +++ b/nwnds_module/at_giveorbofligh.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_giveorbofligh +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/17/2002 8:32:13 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker an Orb of Lightining + CreateItemOnObject("ar_itm_orbshock", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givespirits.ncs b/nwnds_module/at_givespirits.ncs new file mode 100644 index 000000000..78b223402 Binary files /dev/null and b/nwnds_module/at_givespirits.ncs differ diff --git a/nwnds_module/at_givespirits.nss b/nwnds_module/at_givespirits.nss new file mode 100644 index 000000000..ccd7c0742 --- /dev/null +++ b/nwnds_module/at_givespirits.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givespirits +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 2:32:37 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("nw_it_mpotion022", GetPCSpeaker(), 1); + + + // Remove some gold from the player + TakeGoldFromCreature(25, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_givestaffodev.ncs b/nwnds_module/at_givestaffodev.ncs new file mode 100644 index 000000000..3dce9c5eb Binary files /dev/null and b/nwnds_module/at_givestaffodev.ncs differ diff --git a/nwnds_module/at_givestaffodev.nss b/nwnds_module/at_givestaffodev.nss new file mode 100644 index 000000000..a22172e5b --- /dev/null +++ b/nwnds_module/at_givestaffodev.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givestaffodev +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:08:02 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker a Staff of Devouring + CreateItemOnObject("ar_wmgst_devour", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_givewine.ncs b/nwnds_module/at_givewine.ncs new file mode 100644 index 000000000..e9e7fea84 Binary files /dev/null and b/nwnds_module/at_givewine.ncs differ diff --git a/nwnds_module/at_givewine.nss b/nwnds_module/at_givewine.nss new file mode 100644 index 000000000..1f5f0cec5 --- /dev/null +++ b/nwnds_module/at_givewine.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName at_givewine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 2:29:02 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("nw_it_mpotion023", GetPCSpeaker(), 1); + // Remove some gold from the player +TakeGoldFromCreature(20, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_goldinixroom.ncs b/nwnds_module/at_goldinixroom.ncs new file mode 100644 index 000000000..2de23400a Binary files /dev/null and b/nwnds_module/at_goldinixroom.ncs differ diff --git a/nwnds_module/at_goldinixroom.nss b/nwnds_module/at_goldinixroom.nss new file mode 100644 index 000000000..dfcb7dca2 --- /dev/null +++ b/nwnds_module/at_goldinixroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_GOLDENINIXROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_gongring.ncs b/nwnds_module/at_gongring.ncs new file mode 100644 index 000000000..6404f3468 Binary files /dev/null and b/nwnds_module/at_gongring.ncs differ diff --git a/nwnds_module/at_gongring.nss b/nwnds_module/at_gongring.nss new file mode 100644 index 000000000..c644350da --- /dev/null +++ b/nwnds_module/at_gongring.nss @@ -0,0 +1,5 @@ +#include "NW_I0_GENERIC" +void main() +{ + SoundObjectPlay(GetObjectByTag("ArenaGong")); +} diff --git a/nwnds_module/at_gotmirbelt.ncs b/nwnds_module/at_gotmirbelt.ncs new file mode 100644 index 000000000..42006c841 Binary files /dev/null and b/nwnds_module/at_gotmirbelt.ncs differ diff --git a/nwnds_module/at_gotmirbelt.nss b/nwnds_module/at_gotmirbelt.nss new file mode 100644 index 000000000..69d04fa3c --- /dev/null +++ b/nwnds_module/at_gotmirbelt.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName at_gotmirbelt +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 12:45:37 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("miraclebelt", GetPCSpeaker(), 1); +} diff --git a/nwnds_module/at_grik.ncs b/nwnds_module/at_grik.ncs new file mode 100644 index 000000000..169cce1a1 Binary files /dev/null and b/nwnds_module/at_grik.ncs differ diff --git a/nwnds_module/at_grik.nss b/nwnds_module/at_grik.nss new file mode 100644 index 000000000..91c270bee --- /dev/null +++ b/nwnds_module/at_grik.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("STORE_GRIKS"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_grik2.ncs b/nwnds_module/at_grik2.ncs new file mode 100644 index 000000000..9a96e4e90 Binary files /dev/null and b/nwnds_module/at_grik2.ncs differ diff --git a/nwnds_module/at_grik2.nss b/nwnds_module/at_grik2.nss new file mode 100644 index 000000000..daab51c17 --- /dev/null +++ b/nwnds_module/at_grik2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_grik2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:14:51 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("qst_arrowcrate", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGrikQuest", 1); + +} diff --git a/nwnds_module/at_healingkits.ncs b/nwnds_module/at_healingkits.ncs new file mode 100644 index 000000000..2888a0b79 Binary files /dev/null and b/nwnds_module/at_healingkits.ncs differ diff --git a/nwnds_module/at_healingkits.nss b/nwnds_module/at_healingkits.nss new file mode 100644 index 000000000..ea932bff3 --- /dev/null +++ b/nwnds_module/at_healingkits.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("STORE_HEALER01"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_helm_thieves.uti b/nwnds_module/at_helm_thieves.uti new file mode 100644 index 000000000..9ca234c46 Binary files /dev/null and b/nwnds_module/at_helm_thieves.uti differ diff --git a/nwnds_module/at_hendelcbon.ncs b/nwnds_module/at_hendelcbon.ncs new file mode 100644 index 000000000..0a957e7d4 Binary files /dev/null and b/nwnds_module/at_hendelcbon.ncs differ diff --git a/nwnds_module/at_hendelcbon.nss b/nwnds_module/at_hendelcbon.nss new file mode 100644 index 000000000..caf47aac7 --- /dev/null +++ b/nwnds_module/at_hendelcbon.nss @@ -0,0 +1,26 @@ +//:://///////////////////////////////////////////// +//:: FileName at_hendelcbon +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 1:54:47 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("AR_ITMRNG_PORIUS", GetPCSpeaker(), 1); + object oPC=GetPCSpeaker(); +AdjustAlignment(oPC,ALIGNMENT_CHAOTIC, 3); + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_SCRLBINDING"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_ITBK_FORTOME"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 7); +} +} diff --git a/nwnds_module/at_hendelcnb.ncs b/nwnds_module/at_hendelcnb.ncs new file mode 100644 index 000000000..7d7e23692 Binary files /dev/null and b/nwnds_module/at_hendelcnb.ncs differ diff --git a/nwnds_module/at_hendelcnb.nss b/nwnds_module/at_hendelcnb.nss new file mode 100644 index 000000000..4d4f3bf37 --- /dev/null +++ b/nwnds_module/at_hendelcnb.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: FileName at_hendelcnb +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 1:38:59 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(600, GetPCSpeaker()); + + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 500); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_ITBK_FORTOME"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_SCRLBINDING"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 7); +} +} diff --git a/nwnds_module/at_hermitrew1.ncs b/nwnds_module/at_hermitrew1.ncs new file mode 100644 index 000000000..e6bd847e8 Binary files /dev/null and b/nwnds_module/at_hermitrew1.ncs differ diff --git a/nwnds_module/at_hermitrew1.nss b/nwnds_module/at_hermitrew1.nss new file mode 100644 index 000000000..f6472d12d --- /dev/null +++ b/nwnds_module/at_hermitrew1.nss @@ -0,0 +1,32 @@ +//:://///////////////////////////////////////////// +//:: FileName AT_HermitRew1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + int nVeggie = d6(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("AR_ITMRNG_INT03", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("AR_ITMRNG_WIS03", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("AR_ITMRNG_CON03", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 3) && (nVeggie <= 4)) + CreateItemOnObject("AR_ITMRNG_DEX03", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 5)) + CreateItemOnObject("AR_ITMRNG_STR03", GetPCSpeaker(), 1); + //% chance + else if (nVeggie > 5) + CreateItemOnObject("AR_ITMRNG_CHA03", GetPCSpeaker(), 1); + } diff --git a/nwnds_module/at_hermitrew2.ncs b/nwnds_module/at_hermitrew2.ncs new file mode 100644 index 000000000..1bc5bacd1 Binary files /dev/null and b/nwnds_module/at_hermitrew2.ncs differ diff --git a/nwnds_module/at_hermitrew2.nss b/nwnds_module/at_hermitrew2.nss new file mode 100644 index 000000000..202d3ad62 --- /dev/null +++ b/nwnds_module/at_hermitrew2.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName AT_HermitRew2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + int nVeggie = d2(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("AR_WMGST_OASIS", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("AR_WMGST_GFLAME", GetPCSpeaker(), 1); +} diff --git a/nwnds_module/at_hermitrew3.ncs b/nwnds_module/at_hermitrew3.ncs new file mode 100644 index 000000000..88cb7ec49 Binary files /dev/null and b/nwnds_module/at_hermitrew3.ncs differ diff --git a/nwnds_module/at_hermitrew3.nss b/nwnds_module/at_hermitrew3.nss new file mode 100644 index 000000000..76fc2e533 --- /dev/null +++ b/nwnds_module/at_hermitrew3.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName AT_HermitRew3 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + CreateItemOnObject("AR_ITMCLK_BARREN", GetPCSpeaker(), 1); + } diff --git a/nwnds_module/at_insultjogo.ncs b/nwnds_module/at_insultjogo.ncs new file mode 100644 index 000000000..bf33cffef Binary files /dev/null and b/nwnds_module/at_insultjogo.ncs differ diff --git a/nwnds_module/at_insultjogo.nss b/nwnds_module/at_insultjogo.nss new file mode 100644 index 000000000..5cb784a06 --- /dev/null +++ b/nwnds_module/at_insultjogo.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_insultjogo +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 10:00:47 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nInsultJogodin", 1); + +} diff --git a/nwnds_module/at_insultjogofin.ncs b/nwnds_module/at_insultjogofin.ncs new file mode 100644 index 000000000..685639d87 Binary files /dev/null and b/nwnds_module/at_insultjogofin.ncs differ diff --git a/nwnds_module/at_insultjogofin.nss b/nwnds_module/at_insultjogofin.nss new file mode 100644 index 000000000..e2e019756 --- /dev/null +++ b/nwnds_module/at_insultjogofin.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_insultjogofin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 10:14:05 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nInsultJogoFinal", 1); + +} diff --git a/nwnds_module/at_jumptocromisl.ncs b/nwnds_module/at_jumptocromisl.ncs new file mode 100644 index 000000000..a0b53ff7d Binary files /dev/null and b/nwnds_module/at_jumptocromisl.ncs differ diff --git a/nwnds_module/at_jumptocromisl.nss b/nwnds_module/at_jumptocromisl.nss new file mode 100644 index 000000000..88e105c06 --- /dev/null +++ b/nwnds_module/at_jumptocromisl.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_CROMISLESHIP"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_jumptodeprave.ncs b/nwnds_module/at_jumptodeprave.ncs new file mode 100644 index 000000000..8e6501bc5 Binary files /dev/null and b/nwnds_module/at_jumptodeprave.ncs differ diff --git a/nwnds_module/at_jumptodeprave.nss b/nwnds_module/at_jumptodeprave.nss new file mode 100644 index 000000000..28b9b075e --- /dev/null +++ b/nwnds_module/at_jumptodeprave.nss @@ -0,0 +1,42 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("DEPRAVED"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} diff --git a/nwnds_module/at_jumptokyri.ncs b/nwnds_module/at_jumptokyri.ncs new file mode 100644 index 000000000..eb94b57af Binary files /dev/null and b/nwnds_module/at_jumptokyri.ncs differ diff --git a/nwnds_module/at_jumptokyri.nss b/nwnds_module/at_jumptokyri.nss new file mode 100644 index 000000000..af87425d7 --- /dev/null +++ b/nwnds_module/at_jumptokyri.nss @@ -0,0 +1,42 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("KYRIHOUSE"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} diff --git a/nwnds_module/at_jumptoleader.ncs b/nwnds_module/at_jumptoleader.ncs new file mode 100644 index 000000000..2539e8dd2 Binary files /dev/null and b/nwnds_module/at_jumptoleader.ncs differ diff --git a/nwnds_module/at_jumptoleader.nss b/nwnds_module/at_jumptoleader.nss new file mode 100644 index 000000000..405ffadc4 --- /dev/null +++ b/nwnds_module/at_jumptoleader.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetFactionLeader(oPC); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_junli.ncs b/nwnds_module/at_junli.ncs new file mode 100644 index 000000000..85ab3fdae Binary files /dev/null and b/nwnds_module/at_junli.ncs differ diff --git a/nwnds_module/at_junli.nss b/nwnds_module/at_junli.nss new file mode 100644 index 000000000..776bc167a --- /dev/null +++ b/nwnds_module/at_junli.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("CrafterStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_justltalk.ncs b/nwnds_module/at_justltalk.ncs new file mode 100644 index 000000000..1b4404794 Binary files /dev/null and b/nwnds_module/at_justltalk.ncs differ diff --git a/nwnds_module/at_justltalk.nss b/nwnds_module/at_justltalk.nss new file mode 100644 index 000000000..f18ba6616 --- /dev/null +++ b/nwnds_module/at_justltalk.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "justltalk", 1); + +} + diff --git a/nwnds_module/at_justlvari.ncs b/nwnds_module/at_justlvari.ncs new file mode 100644 index 000000000..734361b8f Binary files /dev/null and b/nwnds_module/at_justlvari.ncs differ diff --git a/nwnds_module/at_justlvari.nss b/nwnds_module/at_justlvari.nss new file mode 100644 index 000000000..a71037df8 --- /dev/null +++ b/nwnds_module/at_justlvari.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_justlvari +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/13/2004 4:56:27 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "justlhead", 1); + +} diff --git a/nwnds_module/at_karenrewbonus.ncs b/nwnds_module/at_karenrewbonus.ncs new file mode 100644 index 000000000..7dcce882e Binary files /dev/null and b/nwnds_module/at_karenrewbonus.ncs differ diff --git a/nwnds_module/at_karenrewbonus.nss b/nwnds_module/at_karenrewbonus.nss new file mode 100644 index 000000000..d19b827ae --- /dev/null +++ b/nwnds_module/at_karenrewbonus.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_karenrewbonus +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:50:31 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(),500); + + // Give the speaker the items + CreateItemOnObject("AR_HELM_LESTONS", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_karenrewnor.ncs b/nwnds_module/at_karenrewnor.ncs new file mode 100644 index 000000000..af9dfd321 Binary files /dev/null and b/nwnds_module/at_karenrewnor.ncs differ diff --git a/nwnds_module/at_karenrewnor.nss b/nwnds_module/at_karenrewnor.nss new file mode 100644 index 000000000..a0803d46b --- /dev/null +++ b/nwnds_module/at_karenrewnor.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_karenrewnor +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/26/2002 2:12:14 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(),500); + + // Give the speaker the items + CreateItemOnObject("AR_ITMRNG_KARLEN", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_kilgrastashop.ncs b/nwnds_module/at_kilgrastashop.ncs new file mode 100644 index 000000000..54626e1ac Binary files /dev/null and b/nwnds_module/at_kilgrastashop.ncs differ diff --git a/nwnds_module/at_kilgrastashop.nss b/nwnds_module/at_kilgrastashop.nss new file mode 100644 index 000000000..4fee0e325 --- /dev/null +++ b/nwnds_module/at_kilgrastashop.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("KilgrastasStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_killinnocent.ncs b/nwnds_module/at_killinnocent.ncs new file mode 100644 index 000000000..ebd9c8c4c Binary files /dev/null and b/nwnds_module/at_killinnocent.ncs differ diff --git a/nwnds_module/at_killinnocent.nss b/nwnds_module/at_killinnocent.nss new file mode 100644 index 000000000..54825c350 --- /dev/null +++ b/nwnds_module/at_killinnocent.nss @@ -0,0 +1,218 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ + +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +AdjustAlignment (oPC, ALIGNMENT_EVIL, 7); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/at_killspyreboy.ncs b/nwnds_module/at_killspyreboy.ncs new file mode 100644 index 000000000..88d740c25 Binary files /dev/null and b/nwnds_module/at_killspyreboy.ncs differ diff --git a/nwnds_module/at_killspyreboy.nss b/nwnds_module/at_killspyreboy.nss new file mode 100644 index 000000000..58d8e91ee --- /dev/null +++ b/nwnds_module/at_killspyreboy.nss @@ -0,0 +1,36 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +oTarget = OBJECT_SELF; + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), GetLocation(oTarget)); + +oTarget = OBJECT_SELF; + +DestroyObject(oTarget, 3.0); + +AdjustAlignment(oPC, ALIGNMENT_EVIL, 5); + +AdjustAlignment(oPC, ALIGNMENT_CHAOTIC, 5); + +RewardPartyXP(100, oPC, FALSE); + +} diff --git a/nwnds_module/at_kjaghi.ncs b/nwnds_module/at_kjaghi.ncs new file mode 100644 index 000000000..c393430cb Binary files /dev/null and b/nwnds_module/at_kjaghi.ncs differ diff --git a/nwnds_module/at_kjaghi.nss b/nwnds_module/at_kjaghi.nss new file mode 100644 index 000000000..f61689d8d --- /dev/null +++ b/nwnds_module/at_kjaghi.nss @@ -0,0 +1,4 @@ +void main() +{ +ActionCastSpellAtObject(SPELL_GREATER_RESTORATION, GetPCSpeaker(), METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, FALSE); +} diff --git a/nwnds_module/at_kledinnroompa.ncs b/nwnds_module/at_kledinnroompa.ncs new file mode 100644 index 000000000..3e949b6e4 Binary files /dev/null and b/nwnds_module/at_kledinnroompa.ncs differ diff --git a/nwnds_module/at_kledinnroompa.nss b/nwnds_module/at_kledinnroompa.nss new file mode 100644 index 000000000..4fd39de5f --- /dev/null +++ b/nwnds_module/at_kledinnroompa.nss @@ -0,0 +1,9 @@ +void main() +{ +TakeGoldFromCreature(100, GetPCSpeaker(), TRUE); + +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_KLEDINNROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_lestonspoken1.ncs b/nwnds_module/at_lestonspoken1.ncs new file mode 100644 index 000000000..f5ce419aa Binary files /dev/null and b/nwnds_module/at_lestonspoken1.ncs differ diff --git a/nwnds_module/at_lestonspoken1.nss b/nwnds_module/at_lestonspoken1.nss new file mode 100644 index 000000000..e75932317 --- /dev/null +++ b/nwnds_module/at_lestonspoken1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_lestonspoken1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 1:29:08 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nLestonSpokenTo", 1); + +} diff --git a/nwnds_module/at_lestonwifset.ncs b/nwnds_module/at_lestonwifset.ncs new file mode 100644 index 000000000..38f125164 Binary files /dev/null and b/nwnds_module/at_lestonwifset.ncs differ diff --git a/nwnds_module/at_lestonwifset.nss b/nwnds_module/at_lestonwifset.nss new file mode 100644 index 000000000..4590e8305 --- /dev/null +++ b/nwnds_module/at_lestonwifset.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_lestonwifset +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:40:04 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nLestonWife", 1); + +} diff --git a/nwnds_module/at_lootchthstkey.ncs b/nwnds_module/at_lootchthstkey.ncs new file mode 100644 index 000000000..6efaadb13 Binary files /dev/null and b/nwnds_module/at_lootchthstkey.ncs differ diff --git a/nwnds_module/at_lootchthstkey.nss b/nwnds_module/at_lootchthstkey.nss new file mode 100644 index 000000000..e29bb488d --- /dev/null +++ b/nwnds_module/at_lootchthstkey.nss @@ -0,0 +1,11 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nLootedCromChest") == 1)) + return FALSE; + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/at_lootcromchest.ncs b/nwnds_module/at_lootcromchest.ncs new file mode 100644 index 000000000..038e58351 Binary files /dev/null and b/nwnds_module/at_lootcromchest.ncs differ diff --git a/nwnds_module/at_lootcromchest.nss b/nwnds_module/at_lootcromchest.nss new file mode 100644 index 000000000..736303d79 --- /dev/null +++ b/nwnds_module/at_lootcromchest.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_lootcromchest +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 12:32:17 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 200); + + // Give the speaker the items + CreateItemOnObject("bansheebolts", GetPCSpeaker(), 99); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nLootedCromChest", 1); + +} diff --git a/nwnds_module/at_losecloie.ncs b/nwnds_module/at_losecloie.ncs new file mode 100644 index 000000000..11cfb403d Binary files /dev/null and b/nwnds_module/at_losecloie.ncs differ diff --git a/nwnds_module/at_losecloie.nss b/nwnds_module/at_losecloie.nss new file mode 100644 index 000000000..b76034abb --- /dev/null +++ b/nwnds_module/at_losecloie.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_losecloie +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 12:23:16 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "Cloie"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + SetLocalInt(GetPCSpeaker(),"DydrinaFirstTimeTalked",2); +} diff --git a/nwnds_module/at_meditate1.ncs b/nwnds_module/at_meditate1.ncs new file mode 100644 index 000000000..7f2908b25 Binary files /dev/null and b/nwnds_module/at_meditate1.ncs differ diff --git a/nwnds_module/at_meditate1.nss b/nwnds_module/at_meditate1.nss new file mode 100644 index 000000000..38c8e8652 --- /dev/null +++ b/nwnds_module/at_meditate1.nss @@ -0,0 +1,6 @@ +void main() +{ +object oPC = GetPCSpeaker(); +AssignCommand ( oPC, ActionPlayAnimation (ANIMATION_LOOPING_SIT_CROSS, 1.0, 4000.0)); +AdjustAlignment(oPC,ALIGNMENT_LAWFUL,5); +} diff --git a/nwnds_module/at_mushroomjail.ncs b/nwnds_module/at_mushroomjail.ncs new file mode 100644 index 000000000..51613e2ba Binary files /dev/null and b/nwnds_module/at_mushroomjail.ncs differ diff --git a/nwnds_module/at_mushroomjail.nss b/nwnds_module/at_mushroomjail.nss new file mode 100644 index 000000000..d06299d0d --- /dev/null +++ b/nwnds_module/at_mushroomjail.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); +DelayCommand(2.0,AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Jail"))))); +DelayCommand(6.0,FloatingTextStringOnCreature(GetName(oPC)+" has been arrested for eating an illegal substance.",oPC,FALSE)); +DelayCommand(7.0,SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oPC)); +} diff --git a/nwnds_module/at_nadiefinish.ncs b/nwnds_module/at_nadiefinish.ncs new file mode 100644 index 000000000..952b0299d Binary files /dev/null and b/nwnds_module/at_nadiefinish.ncs differ diff --git a/nwnds_module/at_nadiefinish.nss b/nwnds_module/at_nadiefinish.nss new file mode 100644 index 000000000..eeaa2d3e3 --- /dev/null +++ b/nwnds_module/at_nadiefinish.nss @@ -0,0 +1,22 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(700, oPC, TRUE); + +object oItem; +oItem = GetItemPossessedBy(oPC, "qst_earthrelic"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/at_nadiereward.ncs b/nwnds_module/at_nadiereward.ncs new file mode 100644 index 000000000..96cdd74da Binary files /dev/null and b/nwnds_module/at_nadiereward.ncs differ diff --git a/nwnds_module/at_nadiereward.nss b/nwnds_module/at_nadiereward.nss new file mode 100644 index 000000000..8298856a1 --- /dev/null +++ b/nwnds_module/at_nadiereward.nss @@ -0,0 +1,24 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyGP(500, oPC, FALSE); + +CreateItemOnObject("ar_itmnck_sand01", oPC); + +object oItem; +oItem = GetItemPossessedBy(oPC, "qst_nadiewardstn"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/at_nadieswardsto.ncs b/nwnds_module/at_nadieswardsto.ncs new file mode 100644 index 000000000..10098c91a Binary files /dev/null and b/nwnds_module/at_nadieswardsto.ncs differ diff --git a/nwnds_module/at_nadieswardsto.nss b/nwnds_module/at_nadieswardsto.nss new file mode 100644 index 000000000..1d5de30e7 --- /dev/null +++ b/nwnds_module/at_nadieswardsto.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("qst_nadiewardstn", oPC); + +} + diff --git a/nwnds_module/at_oldwellattob.ncs b/nwnds_module/at_oldwellattob.ncs new file mode 100644 index 000000000..87a45b1b4 Binary files /dev/null and b/nwnds_module/at_oldwellattob.ncs differ diff --git a/nwnds_module/at_oldwellattob.nss b/nwnds_module/at_oldwellattob.nss new file mode 100644 index 000000000..7b71bfc4f --- /dev/null +++ b/nwnds_module/at_oldwellattob.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("wp_aboveoldwell"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_olinarew.ncs b/nwnds_module/at_olinarew.ncs new file mode 100644 index 000000000..79509c35f Binary files /dev/null and b/nwnds_module/at_olinarew.ncs differ diff --git a/nwnds_module/at_olinarew.nss b/nwnds_module/at_olinarew.nss new file mode 100644 index 000000000..faee6af66 --- /dev/null +++ b/nwnds_module/at_olinarew.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: +//:: FileName: at_olinarew +//:: Rewards 700xp, a Critical Care Medical Belt +//:: & some Advanced Healing Kits +//:: +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITBLT_CRITCARE", GetPCSpeaker(), 1); + CreateItemOnObject("KIT_HEAL_3_002", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_olinarew2.ncs b/nwnds_module/at_olinarew2.ncs new file mode 100644 index 000000000..02f116552 Binary files /dev/null and b/nwnds_module/at_olinarew2.ncs differ diff --git a/nwnds_module/at_olinarew2.nss b/nwnds_module/at_olinarew2.nss new file mode 100644 index 000000000..598b7922e --- /dev/null +++ b/nwnds_module/at_olinarew2.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: +//:: FileName at_olinarew2 +//:: Rewards 700xp, and a Surgical Blade +//:: +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 12:20:38 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_WSWDG_SURGICL", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_olinarew3.ncs b/nwnds_module/at_olinarew3.ncs new file mode 100644 index 000000000..9f77770b1 Binary files /dev/null and b/nwnds_module/at_olinarew3.ncs differ diff --git a/nwnds_module/at_olinarew3.nss b/nwnds_module/at_olinarew3.nss new file mode 100644 index 000000000..ec54cbb3e --- /dev/null +++ b/nwnds_module/at_olinarew3.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: +//:: FileName at_olinarew3 +//:: Rewards 700xp & 5000 Ceramic +//:: +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 12:21:14 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 5000); + + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + +} diff --git a/nwnds_module/at_opennualshop.ncs b/nwnds_module/at_opennualshop.ncs new file mode 100644 index 000000000..cd6ea6b5c Binary files /dev/null and b/nwnds_module/at_opennualshop.ncs differ diff --git a/nwnds_module/at_opennualshop.nss b/nwnds_module/at_opennualshop.nss new file mode 100644 index 000000000..8b8c012d6 --- /dev/null +++ b/nwnds_module/at_opennualshop.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_opennualshop +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/18/2002 2:37:05 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("NualsWeapons"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/at_pickblotus.ncs b/nwnds_module/at_pickblotus.ncs new file mode 100644 index 000000000..a2e810df7 Binary files /dev/null and b/nwnds_module/at_pickblotus.ncs differ diff --git a/nwnds_module/at_pickblotus.nss b/nwnds_module/at_pickblotus.nss new file mode 100644 index 000000000..0a542f949 --- /dev/null +++ b/nwnds_module/at_pickblotus.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName at_pickblotus +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 1:05:03 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(50, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("bluelotus", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_poisonudath.ncs b/nwnds_module/at_poisonudath.ncs new file mode 100644 index 000000000..1762f4704 Binary files /dev/null and b/nwnds_module/at_poisonudath.ncs differ diff --git a/nwnds_module/at_poisonudath.nss b/nwnds_module/at_poisonudath.nss new file mode 100644 index 000000000..8be75f870 --- /dev/null +++ b/nwnds_module/at_poisonudath.nss @@ -0,0 +1,9 @@ +#include "nw_i0_generic" +void main() +{ + object oUdath = GetObjectByTag("cyclopsudath"); + // Set the faction to hate the player, then attack the player + AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -100); + DetermineCombatRound(GetPCSpeaker()); +DestroyObject(GetObjectByTag("cyclopsudath"), 1.0); +} diff --git a/nwnds_module/at_pratasshop.ncs b/nwnds_module/at_pratasshop.ncs new file mode 100644 index 000000000..7affc4e14 Binary files /dev/null and b/nwnds_module/at_pratasshop.ncs differ diff --git a/nwnds_module/at_pratasshop.nss b/nwnds_module/at_pratasshop.nss new file mode 100644 index 000000000..0d4311591 --- /dev/null +++ b/nwnds_module/at_pratasshop.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("PratasShop"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_respawnob120.ncs b/nwnds_module/at_respawnob120.ncs new file mode 100644 index 000000000..7ea0a8913 Binary files /dev/null and b/nwnds_module/at_respawnob120.ncs differ diff --git a/nwnds_module/at_respawnob120.nss b/nwnds_module/at_respawnob120.nss new file mode 100644 index 000000000..b5ab0b753 --- /dev/null +++ b/nwnds_module/at_respawnob120.nss @@ -0,0 +1,25 @@ +void RespawnObject(string sTag, int iType, location lLoc) { + +// ResRef must be derivable from Tag +string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16)); + +CreateObject(iType, sResRef, lLoc); + +} + + + +void main() +{ +string sTag = GetTag(OBJECT_SELF); +int iType = GetObjectType(OBJECT_SELF); + +// For creatures, save the location at spawn-time as a local location and +// use it instead. Otherwise, the creature will respawn where it died. +location lLoc = GetLocation(OBJECT_SELF); + +float fDelay = 120.0; // 2 minute delay + +AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc))); +} + diff --git a/nwnds_module/at_respawnob60se.ncs b/nwnds_module/at_respawnob60se.ncs new file mode 100644 index 000000000..d3a305533 Binary files /dev/null and b/nwnds_module/at_respawnob60se.ncs differ diff --git a/nwnds_module/at_respawnob60se.nss b/nwnds_module/at_respawnob60se.nss new file mode 100644 index 000000000..2221c4e98 --- /dev/null +++ b/nwnds_module/at_respawnob60se.nss @@ -0,0 +1,25 @@ +void RespawnObject(string sTag, int iType, location lLoc) { + +// ResRef must be derivable from Tag +string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16)); + +CreateObject(iType, sResRef, lLoc); + +} + + + +void main() +{ +string sTag = GetTag(OBJECT_SELF); +int iType = GetObjectType(OBJECT_SELF); + +// For creatures, save the location at spawn-time as a local location and +// use it instead. Otherwise, the creature will respawn where it died. +location lLoc = GetLocation(OBJECT_SELF); + +float fDelay = 60.0; // 1 minute delay + +AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc))); +} + diff --git a/nwnds_module/at_respawnobject.ncs b/nwnds_module/at_respawnobject.ncs new file mode 100644 index 000000000..27c774c2e Binary files /dev/null and b/nwnds_module/at_respawnobject.ncs differ diff --git a/nwnds_module/at_respawnobject.nss b/nwnds_module/at_respawnobject.nss new file mode 100644 index 000000000..22cc3d2de --- /dev/null +++ b/nwnds_module/at_respawnobject.nss @@ -0,0 +1,25 @@ +void RespawnObject(string sTag, int iType, location lLoc) { + +// ResRef must be derivable from Tag +string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16)); + +CreateObject(iType, sResRef, lLoc); + +} + + + +void main() +{ +string sTag = GetTag(OBJECT_SELF); +int iType = GetObjectType(OBJECT_SELF); + +// For creatures, save the location at spawn-time as a local location and +// use it instead. Otherwise, the creature will respawn where it died. +location lLoc = GetLocation(OBJECT_SELF); + +float fDelay = 2.0; // 1 minute delay + +AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc))); +} + diff --git a/nwnds_module/at_rope2abanhome.ncs b/nwnds_module/at_rope2abanhome.ncs new file mode 100644 index 000000000..aea28a380 Binary files /dev/null and b/nwnds_module/at_rope2abanhome.ncs differ diff --git a/nwnds_module/at_rope2abanhome.nss b/nwnds_module/at_rope2abanhome.nss new file mode 100644 index 000000000..2eed4a8f2 --- /dev/null +++ b/nwnds_module/at_rope2abanhome.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_FromPassage3"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_ropeuptabmine.ncs b/nwnds_module/at_ropeuptabmine.ncs new file mode 100644 index 000000000..b62e95fd4 Binary files /dev/null and b/nwnds_module/at_ropeuptabmine.ncs differ diff --git a/nwnds_module/at_ropeuptabmine.nss b/nwnds_module/at_ropeuptabmine.nss new file mode 100644 index 000000000..29860f294 --- /dev/null +++ b/nwnds_module/at_ropeuptabmine.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_abandonedm02"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_saltmillt_001.ncs b/nwnds_module/at_saltmillt_001.ncs new file mode 100644 index 000000000..bd1e3d476 Binary files /dev/null and b/nwnds_module/at_saltmillt_001.ncs differ diff --git a/nwnds_module/at_saltmillt_001.nss b/nwnds_module/at_saltmillt_001.nss new file mode 100644 index 000000000..d7615ceed --- /dev/null +++ b/nwnds_module/at_saltmillt_001.nss @@ -0,0 +1,31 @@ +//:://///////////////////////////////////////////// +//:: Name: AT_SaltMill_001 +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Detects if the PC has an Elven Rapier in + their inventory. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 18 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + object oRapier = GetItemPossessedBy(oClicker,"AR_WSWRP_ELVEN"); + + if(GetIsObjectValid(oRapier) != 0) + { + SetLocalInt(oClicker,"thievesquests",4); + SetLocalInt(oClicker,"pickpocket",1); + AddJournalQuestEntry ("thievesquests", 6, oClicker); + } + + AssignCommand(oClicker,JumpToLocation(lLoc)); + +} diff --git a/nwnds_module/at_setchoosenone.ncs b/nwnds_module/at_setchoosenone.ncs new file mode 100644 index 000000000..89e87c524 Binary files /dev/null and b/nwnds_module/at_setchoosenone.ncs differ diff --git a/nwnds_module/at_setchoosenone.nss b/nwnds_module/at_setchoosenone.nss new file mode 100644 index 000000000..c898cf8e6 --- /dev/null +++ b/nwnds_module/at_setchoosenone.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setchoosenone +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:34:38 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nChoosenOne", 1); + +} diff --git a/nwnds_module/at_setcromisle.ncs b/nwnds_module/at_setcromisle.ncs new file mode 100644 index 000000000..2cc9ca175 Binary files /dev/null and b/nwnds_module/at_setcromisle.ncs differ diff --git a/nwnds_module/at_setcromisle.nss b/nwnds_module/at_setcromisle.nss new file mode 100644 index 000000000..a8c2d8d3f --- /dev/null +++ b/nwnds_module/at_setcromisle.nss @@ -0,0 +1,6 @@ +#include "nw_j_assassin" + +void main() +{ + aSetPLocalInt(GetPCSpeaker(), "nCromlinIsle", 1); +} diff --git a/nwnds_module/at_setfaildarlie.ncs b/nwnds_module/at_setfaildarlie.ncs new file mode 100644 index 000000000..43cd9af95 Binary files /dev/null and b/nwnds_module/at_setfaildarlie.ncs differ diff --git a/nwnds_module/at_setfaildarlie.nss b/nwnds_module/at_setfaildarlie.nss new file mode 100644 index 000000000..910f1d37b --- /dev/null +++ b/nwnds_module/at_setfaildarlie.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setfaildarlie +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/18/2002 1:15:01 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFailDariyaLie", 1); + +} diff --git a/nwnds_module/at_setgerrofst1.ncs b/nwnds_module/at_setgerrofst1.ncs new file mode 100644 index 000000000..078b2042e Binary files /dev/null and b/nwnds_module/at_setgerrofst1.ncs differ diff --git a/nwnds_module/at_setgerrofst1.nss b/nwnds_module/at_setgerrofst1.nss new file mode 100644 index 000000000..a98624c4e --- /dev/null +++ b/nwnds_module/at_setgerrofst1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setgerrofst1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:10:41 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGerrofStory", 1); + +} diff --git a/nwnds_module/at_setgotrugxp.ncs b/nwnds_module/at_setgotrugxp.ncs new file mode 100644 index 000000000..d8dbe24a0 Binary files /dev/null and b/nwnds_module/at_setgotrugxp.ncs differ diff --git a/nwnds_module/at_setgotrugxp.nss b/nwnds_module/at_setgotrugxp.nss new file mode 100644 index 000000000..3034b2845 --- /dev/null +++ b/nwnds_module/at_setgotrugxp.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setgotrugxp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/24/2002 10:57:15 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nGotRugXP", 1); + +} diff --git a/nwnds_module/at_sethelpjariel.ncs b/nwnds_module/at_sethelpjariel.ncs new file mode 100644 index 000000000..ab4af0951 Binary files /dev/null and b/nwnds_module/at_sethelpjariel.ncs differ diff --git a/nwnds_module/at_sethelpjariel.nss b/nwnds_module/at_sethelpjariel.nss new file mode 100644 index 000000000..bcbbb4f8c --- /dev/null +++ b/nwnds_module/at_sethelpjariel.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_sethelpjariel +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/12/2002 1:39:19 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nHelpJariel", 1); + +} diff --git a/nwnds_module/at_sethendelst1.ncs b/nwnds_module/at_sethendelst1.ncs new file mode 100644 index 000000000..8991b9b7a Binary files /dev/null and b/nwnds_module/at_sethendelst1.ncs differ diff --git a/nwnds_module/at_sethendelst1.nss b/nwnds_module/at_sethendelst1.nss new file mode 100644 index 000000000..5895043f9 --- /dev/null +++ b/nwnds_module/at_sethendelst1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_sethendelst1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:09:31 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nHendelStory", 1); + +} diff --git a/nwnds_module/at_setjacobst1.ncs b/nwnds_module/at_setjacobst1.ncs new file mode 100644 index 000000000..61290e25e Binary files /dev/null and b/nwnds_module/at_setjacobst1.ncs differ diff --git a/nwnds_module/at_setjacobst1.nss b/nwnds_module/at_setjacobst1.nss new file mode 100644 index 000000000..b7e6d9254 --- /dev/null +++ b/nwnds_module/at_setjacobst1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setjacobst1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:06:29 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nJacobStory", 1); + +} diff --git a/nwnds_module/at_setkarq1.ncs b/nwnds_module/at_setkarq1.ncs new file mode 100644 index 000000000..4e8738281 Binary files /dev/null and b/nwnds_module/at_setkarq1.ncs differ diff --git a/nwnds_module/at_setkarq1.nss b/nwnds_module/at_setkarq1.nss new file mode 100644 index 000000000..7f6ef082f --- /dev/null +++ b/nwnds_module/at_setkarq1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setkarq2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:14:27 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nKarlen", 1); + +} diff --git a/nwnds_module/at_setkarq2.ncs b/nwnds_module/at_setkarq2.ncs new file mode 100644 index 000000000..970e04590 Binary files /dev/null and b/nwnds_module/at_setkarq2.ncs differ diff --git a/nwnds_module/at_setkarq2.nss b/nwnds_module/at_setkarq2.nss new file mode 100644 index 000000000..df8fe3f4a --- /dev/null +++ b/nwnds_module/at_setkarq2.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setkarq2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:14:27 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nKarlen", 2); + +} diff --git a/nwnds_module/at_setkarq3.ncs b/nwnds_module/at_setkarq3.ncs new file mode 100644 index 000000000..d6d19a8d9 Binary files /dev/null and b/nwnds_module/at_setkarq3.ncs differ diff --git a/nwnds_module/at_setkarq3.nss b/nwnds_module/at_setkarq3.nss new file mode 100644 index 000000000..01c520d31 --- /dev/null +++ b/nwnds_module/at_setkarq3.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setkarq2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:14:27 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nKarlen", 3); + +} diff --git a/nwnds_module/at_setmer2threat.ncs b/nwnds_module/at_setmer2threat.ncs new file mode 100644 index 000000000..3e8d3c4a9 Binary files /dev/null and b/nwnds_module/at_setmer2threat.ncs differ diff --git a/nwnds_module/at_setmer2threat.nss b/nwnds_module/at_setmer2threat.nss new file mode 100644 index 000000000..579bc73f2 --- /dev/null +++ b/nwnds_module/at_setmer2threat.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setmer2threat +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 11:40:07 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nArenaMerch2Threat", 1); + +} diff --git a/nwnds_module/at_setnualweap.ncs b/nwnds_module/at_setnualweap.ncs new file mode 100644 index 000000000..6654723a3 Binary files /dev/null and b/nwnds_module/at_setnualweap.ncs differ diff --git a/nwnds_module/at_setnualweap.nss b/nwnds_module/at_setnualweap.nss new file mode 100644 index 000000000..ed77702fd --- /dev/null +++ b/nwnds_module/at_setnualweap.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setnualweap +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/18/2002 2:32:33 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nNualWeapons", 1); + +} diff --git a/nwnds_module/at_setpcloc.ncs b/nwnds_module/at_setpcloc.ncs new file mode 100644 index 000000000..5eb51293e Binary files /dev/null and b/nwnds_module/at_setpcloc.ncs differ diff --git a/nwnds_module/at_setpcloc.nss b/nwnds_module/at_setpcloc.nss new file mode 100644 index 000000000..42f786ec4 --- /dev/null +++ b/nwnds_module/at_setpcloc.nss @@ -0,0 +1,6 @@ +#include "nw_j_assassin" + +void main() +{ + aSetPLocalInt(GetPCSpeaker(), "nPiratesCoveLoc", 1); +} diff --git a/nwnds_module/at_setpcovepass.ncs b/nwnds_module/at_setpcovepass.ncs new file mode 100644 index 000000000..fc2be2737 Binary files /dev/null and b/nwnds_module/at_setpcovepass.ncs differ diff --git a/nwnds_module/at_setpcovepass.nss b/nwnds_module/at_setpcovepass.nss new file mode 100644 index 000000000..ba2975180 --- /dev/null +++ b/nwnds_module/at_setpcovepass.nss @@ -0,0 +1,6 @@ +#include "nw_j_assassin" + +void main() +{ + aSetPLocalInt(GetPCSpeaker(), "nPirateCovePass", 1); +} diff --git a/nwnds_module/at_setqueenven.ncs b/nwnds_module/at_setqueenven.ncs new file mode 100644 index 000000000..47c630386 Binary files /dev/null and b/nwnds_module/at_setqueenven.ncs differ diff --git a/nwnds_module/at_setqueenven.nss b/nwnds_module/at_setqueenven.nss new file mode 100644 index 000000000..4d979b4b1 --- /dev/null +++ b/nwnds_module/at_setqueenven.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setqueenven +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 2:29:33 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nQueenVenom", 1); + +} diff --git a/nwnds_module/at_setsewstew.ncs b/nwnds_module/at_setsewstew.ncs new file mode 100644 index 000000000..f74c3594f Binary files /dev/null and b/nwnds_module/at_setsewstew.ncs differ diff --git a/nwnds_module/at_setsewstew.nss b/nwnds_module/at_setsewstew.nss new file mode 100644 index 000000000..ccba39567 --- /dev/null +++ b/nwnds_module/at_setsewstew.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setsewstew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:08:04 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nSeenWoodStew", 1); + +} diff --git a/nwnds_module/at_setspidmad.ncs b/nwnds_module/at_setspidmad.ncs new file mode 100644 index 000000000..c5ecc148d Binary files /dev/null and b/nwnds_module/at_setspidmad.ncs differ diff --git a/nwnds_module/at_setspidmad.nss b/nwnds_module/at_setspidmad.nss new file mode 100644 index 000000000..c5f489c6a --- /dev/null +++ b/nwnds_module/at_setspidmad.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setspidmad +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/17/2002 10:32:28 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nSpiderMadness", 1); + +} diff --git a/nwnds_module/at_settakedonati.ncs b/nwnds_module/at_settakedonati.ncs new file mode 100644 index 000000000..71c317407 Binary files /dev/null and b/nwnds_module/at_settakedonati.ncs differ diff --git a/nwnds_module/at_settakedonati.nss b/nwnds_module/at_settakedonati.nss new file mode 100644 index 000000000..75da0c5ba --- /dev/null +++ b/nwnds_module/at_settakedonati.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_settakedonati +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:17:11 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nTakeDonations", 1); + +} diff --git a/nwnds_module/at_settalked.ncs b/nwnds_module/at_settalked.ncs new file mode 100644 index 000000000..f008ab438 Binary files /dev/null and b/nwnds_module/at_settalked.ncs differ diff --git a/nwnds_module/at_settalked.nss b/nwnds_module/at_settalked.nss new file mode 100644 index 000000000..da61c30cb --- /dev/null +++ b/nwnds_module/at_settalked.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_settalked +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:24:12 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "DydrinaFirstTimeTalked", 1); + +} diff --git a/nwnds_module/at_settrywstew.ncs b/nwnds_module/at_settrywstew.ncs new file mode 100644 index 000000000..107d8c6bc Binary files /dev/null and b/nwnds_module/at_settrywstew.ncs differ diff --git a/nwnds_module/at_settrywstew.nss b/nwnds_module/at_settrywstew.nss new file mode 100644 index 000000000..2871b4225 --- /dev/null +++ b/nwnds_module/at_settrywstew.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_settrywstew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 10:10:06 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nTriedWoodStew", 1); + +} diff --git a/nwnds_module/at_setunearport1.ncs b/nwnds_module/at_setunearport1.ncs new file mode 100644 index 000000000..7f83c6ffc Binary files /dev/null and b/nwnds_module/at_setunearport1.ncs differ diff --git a/nwnds_module/at_setunearport1.nss b/nwnds_module/at_setunearport1.nss new file mode 100644 index 000000000..aa95bfe2b --- /dev/null +++ b/nwnds_module/at_setunearport1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setunearport1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/4/2002 1:33:23 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nUnearthedPortal", 1); + +} diff --git a/nwnds_module/at_setwestmshop1.ncs b/nwnds_module/at_setwestmshop1.ncs new file mode 100644 index 000000000..77264dddb Binary files /dev/null and b/nwnds_module/at_setwestmshop1.ncs differ diff --git a/nwnds_module/at_setwestmshop1.nss b/nwnds_module/at_setwestmshop1.nss new file mode 100644 index 000000000..8e967e10f --- /dev/null +++ b/nwnds_module/at_setwestmshop1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_setwestmshop1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/24/2002 1:52:16 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nWestmorreShop", 1); + +} diff --git a/nwnds_module/at_sstodg_001.ncs b/nwnds_module/at_sstodg_001.ncs new file mode 100644 index 000000000..54d283720 Binary files /dev/null and b/nwnds_module/at_sstodg_001.ncs differ diff --git a/nwnds_module/at_sstodg_001.nss b/nwnds_module/at_sstodg_001.nss new file mode 100644 index 000000000..9b9d7a91e --- /dev/null +++ b/nwnds_module/at_sstodg_001.nss @@ -0,0 +1,26 @@ +//:://///////////////////////////////////////////// +//:: Name: AT_SStoDG_001 +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Set's PC ceramic amount as a local INT VAR & + them moves the PC to the location defined in + the Door's destination. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 18 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + int iCeramic = GetGold(oClicker); + + SetLocalInt(oClicker, "goldamount", iCeramic); + + AssignCommand(oClicker,JumpToLocation(lLoc)); + +} diff --git a/nwnds_module/at_sstogeary_002.ncs b/nwnds_module/at_sstogeary_002.ncs new file mode 100644 index 000000000..237ac235b Binary files /dev/null and b/nwnds_module/at_sstogeary_002.ncs differ diff --git a/nwnds_module/at_sstogeary_002.nss b/nwnds_module/at_sstogeary_002.nss new file mode 100644 index 000000000..20122c863 --- /dev/null +++ b/nwnds_module/at_sstogeary_002.nss @@ -0,0 +1,15 @@ +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + +if(GetLocalInt(oClicker,"pickpocket") == 2) + AssignCommand(oClicker,ActionJumpToLocation(GetLocation(GetObjectByTag("DST_Geary02")))); + + AssignCommand(oClicker,JumpToLocation(lLoc)); +} + + +// (GetLocation(GetObjectByTag("WP_CWTOFIELDS"))) + // SetLocalInt(GetPCSpeaker(), "pickpocket",1); diff --git a/nwnds_module/at_sstosm_002.ncs b/nwnds_module/at_sstosm_002.ncs new file mode 100644 index 000000000..ad4b46e75 Binary files /dev/null and b/nwnds_module/at_sstosm_002.ncs differ diff --git a/nwnds_module/at_sstosm_002.nss b/nwnds_module/at_sstosm_002.nss new file mode 100644 index 000000000..ed964bb5c --- /dev/null +++ b/nwnds_module/at_sstosm_002.nss @@ -0,0 +1,12 @@ +void main() +{ + object oClicker = GetClickingObject(); + object oTarget = GetTransitionTarget(OBJECT_SELF); + location lLoc = GetLocation(oTarget); + + +if(GetLocalInt(oClicker,"pickpocket") == 3) + AssignCommand(oClicker,ActionJumpToLocation(GetLocation(GetObjectByTag("SaltMill2")))); + + AssignCommand(oClicker,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/at_take10000coin.ncs b/nwnds_module/at_take10000coin.ncs new file mode 100644 index 000000000..f01e6f65b Binary files /dev/null and b/nwnds_module/at_take10000coin.ncs differ diff --git a/nwnds_module/at_take10000coin.nss b/nwnds_module/at_take10000coin.nss new file mode 100644 index 000000000..ab2288949 --- /dev/null +++ b/nwnds_module/at_take10000coin.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(10000, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take1000coins.ncs b/nwnds_module/at_take1000coins.ncs new file mode 100644 index 000000000..840efe39b Binary files /dev/null and b/nwnds_module/at_take1000coins.ncs differ diff --git a/nwnds_module/at_take1000coins.nss b/nwnds_module/at_take1000coins.nss new file mode 100644 index 000000000..771797778 --- /dev/null +++ b/nwnds_module/at_take1000coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(1000, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take100coins.ncs b/nwnds_module/at_take100coins.ncs new file mode 100644 index 000000000..57267bdfe Binary files /dev/null and b/nwnds_module/at_take100coins.ncs differ diff --git a/nwnds_module/at_take100coins.nss b/nwnds_module/at_take100coins.nss new file mode 100644 index 000000000..0f5dddd18 --- /dev/null +++ b/nwnds_module/at_take100coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(100, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take10coins.ncs b/nwnds_module/at_take10coins.ncs new file mode 100644 index 000000000..ace16b898 Binary files /dev/null and b/nwnds_module/at_take10coins.ncs differ diff --git a/nwnds_module/at_take10coins.nss b/nwnds_module/at_take10coins.nss new file mode 100644 index 000000000..0244e576e --- /dev/null +++ b/nwnds_module/at_take10coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(10, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take200coins.ncs b/nwnds_module/at_take200coins.ncs new file mode 100644 index 000000000..1465031ac Binary files /dev/null and b/nwnds_module/at_take200coins.ncs differ diff --git a/nwnds_module/at_take200coins.nss b/nwnds_module/at_take200coins.nss new file mode 100644 index 000000000..8a31a3667 --- /dev/null +++ b/nwnds_module/at_take200coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take200coins +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:22:23 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(200, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take25coins.ncs b/nwnds_module/at_take25coins.ncs new file mode 100644 index 000000000..0c7caf673 Binary files /dev/null and b/nwnds_module/at_take25coins.ncs differ diff --git a/nwnds_module/at_take25coins.nss b/nwnds_module/at_take25coins.nss new file mode 100644 index 000000000..8c9503fe6 --- /dev/null +++ b/nwnds_module/at_take25coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take25coins +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(25, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take300coins.ncs b/nwnds_module/at_take300coins.ncs new file mode 100644 index 000000000..9e54f0aa1 Binary files /dev/null and b/nwnds_module/at_take300coins.ncs differ diff --git a/nwnds_module/at_take300coins.nss b/nwnds_module/at_take300coins.nss new file mode 100644 index 000000000..f63c7e630 --- /dev/null +++ b/nwnds_module/at_take300coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(300, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take500coins.ncs b/nwnds_module/at_take500coins.ncs new file mode 100644 index 000000000..dbcb4fc24 Binary files /dev/null and b/nwnds_module/at_take500coins.ncs differ diff --git a/nwnds_module/at_take500coins.nss b/nwnds_module/at_take500coins.nss new file mode 100644 index 000000000..ddfa8d088 --- /dev/null +++ b/nwnds_module/at_take500coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(500, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_take50coins.ncs b/nwnds_module/at_take50coins.ncs new file mode 100644 index 000000000..bae1545a4 Binary files /dev/null and b/nwnds_module/at_take50coins.ncs differ diff --git a/nwnds_module/at_take50coins.nss b/nwnds_module/at_take50coins.nss new file mode 100644 index 000000000..bcd604011 --- /dev/null +++ b/nwnds_module/at_take50coins.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_take10000coin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:53:32 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/at_takeale.ncs b/nwnds_module/at_takeale.ncs new file mode 100644 index 000000000..a5b656436 Binary files /dev/null and b/nwnds_module/at_takeale.ncs differ diff --git a/nwnds_module/at_takeale.nss b/nwnds_module/at_takeale.nss new file mode 100644 index 000000000..efad95264 --- /dev/null +++ b/nwnds_module/at_takeale.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takeale +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:45:59 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "NW_IT_MPOTION021"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takeblotus.ncs b/nwnds_module/at_takeblotus.ncs new file mode 100644 index 000000000..a729301b2 Binary files /dev/null and b/nwnds_module/at_takeblotus.ncs differ diff --git a/nwnds_module/at_takeblotus.nss b/nwnds_module/at_takeblotus.nss new file mode 100644 index 000000000..b43c3b0a9 --- /dev/null +++ b/nwnds_module/at_takeblotus.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takeblotus +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/30/2002 3:06:11 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "bluelotus"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takebroy.ncs b/nwnds_module/at_takebroy.ncs new file mode 100644 index 000000000..1607d261e Binary files /dev/null and b/nwnds_module/at_takebroy.ncs differ diff --git a/nwnds_module/at_takebroy.nss b/nwnds_module/at_takebroy.nss new file mode 100644 index 000000000..369d5ca81 --- /dev/null +++ b/nwnds_module/at_takebroy.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takebroy +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:46:30 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "POT_BROY"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takejavo.ncs b/nwnds_module/at_takejavo.ncs new file mode 100644 index 000000000..3687d627e Binary files /dev/null and b/nwnds_module/at_takejavo.ncs differ diff --git a/nwnds_module/at_takejavo.nss b/nwnds_module/at_takejavo.nss new file mode 100644 index 000000000..52e6423ad --- /dev/null +++ b/nwnds_module/at_takejavo.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takejavo +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:46:51 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "POT_JAVONECTAR"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takelongbow.ncs b/nwnds_module/at_takelongbow.ncs new file mode 100644 index 000000000..4d26d5a60 Binary files /dev/null and b/nwnds_module/at_takelongbow.ncs differ diff --git a/nwnds_module/at_takelongbow.nss b/nwnds_module/at_takelongbow.nss new file mode 100644 index 000000000..ff696f468 --- /dev/null +++ b/nwnds_module/at_takelongbow.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takelongbow +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/1/02 2:43:26 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 200); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 150); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "NW_WBWLN001"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takemilkwine.ncs b/nwnds_module/at_takemilkwine.ncs new file mode 100644 index 000000000..20ea8ceb4 Binary files /dev/null and b/nwnds_module/at_takemilkwine.ncs differ diff --git a/nwnds_module/at_takemilkwine.nss b/nwnds_module/at_takemilkwine.nss new file mode 100644 index 000000000..106e9b489 --- /dev/null +++ b/nwnds_module/at_takemilkwine.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takemilkwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:46:30 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "POT_MILKWINE"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takeorbofant.ncs b/nwnds_module/at_takeorbofant.ncs new file mode 100644 index 000000000..52d51c9fa Binary files /dev/null and b/nwnds_module/at_takeorbofant.ncs differ diff --git a/nwnds_module/at_takeorbofant.nss b/nwnds_module/at_takeorbofant.nss new file mode 100644 index 000000000..bd0f9b679 --- /dev/null +++ b/nwnds_module/at_takeorbofant.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takeorbofant +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/5/2002 1:03:57 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "OrboftheAncients"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takepalmwine.ncs b/nwnds_module/at_takepalmwine.ncs new file mode 100644 index 000000000..463c9ef8b Binary files /dev/null and b/nwnds_module/at_takepalmwine.ncs differ diff --git a/nwnds_module/at_takepalmwine.nss b/nwnds_module/at_takepalmwine.nss new file mode 100644 index 000000000..c0c4247d6 --- /dev/null +++ b/nwnds_module/at_takepalmwine.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takepalmwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:46:30 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "POT_PALMWINE"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takesapwine.ncs b/nwnds_module/at_takesapwine.ncs new file mode 100644 index 000000000..9a332761a Binary files /dev/null and b/nwnds_module/at_takesapwine.ncs differ diff --git a/nwnds_module/at_takesapwine.nss b/nwnds_module/at_takesapwine.nss new file mode 100644 index 000000000..f6a8e2c70 --- /dev/null +++ b/nwnds_module/at_takesapwine.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takesapwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:46:30 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "POT_SAPWINE"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_takevenom.ncs b/nwnds_module/at_takevenom.ncs new file mode 100644 index 000000000..1c6ddc230 Binary files /dev/null and b/nwnds_module/at_takevenom.ncs differ diff --git a/nwnds_module/at_takevenom.nss b/nwnds_module/at_takevenom.nss new file mode 100644 index 000000000..9c2ec6814 --- /dev/null +++ b/nwnds_module/at_takevenom.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_takevenom +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 2:24:28 AM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QueensVenom"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QueensPoisonSack"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_tarillsshop.ncs b/nwnds_module/at_tarillsshop.ncs new file mode 100644 index 000000000..aaf204adb Binary files /dev/null and b/nwnds_module/at_tarillsshop.ncs differ diff --git a/nwnds_module/at_tarillsshop.nss b/nwnds_module/at_tarillsshop.nss new file mode 100644 index 000000000..9e7c8358f --- /dev/null +++ b/nwnds_module/at_tarillsshop.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("TarillsGemshop"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_thrane5.ncs b/nwnds_module/at_thrane5.ncs new file mode 100644 index 000000000..789ee6d40 Binary files /dev/null and b/nwnds_module/at_thrane5.ncs differ diff --git a/nwnds_module/at_thrane5.nss b/nwnds_module/at_thrane5.nss new file mode 100644 index 000000000..560e81293 --- /dev/null +++ b/nwnds_module/at_thrane5.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_thrane5 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 6:35:07 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFirstTimeTalked", 5); + +} diff --git a/nwnds_module/at_tookcharkey.ncs b/nwnds_module/at_tookcharkey.ncs new file mode 100644 index 000000000..8d887a277 Binary files /dev/null and b/nwnds_module/at_tookcharkey.ncs differ diff --git a/nwnds_module/at_tookcharkey.nss b/nwnds_module/at_tookcharkey.nss new file mode 100644 index 000000000..9761dcb77 --- /dev/null +++ b/nwnds_module/at_tookcharkey.nss @@ -0,0 +1,15 @@ +//:://///////////////////////////////////////////// +//:: FileName at_tookcharkey +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 5:52:58 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("charredkey", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nTookCharKey", 1); +} diff --git a/nwnds_module/at_traabirew.ncs b/nwnds_module/at_traabirew.ncs new file mode 100644 index 000000000..f00c72f4a Binary files /dev/null and b/nwnds_module/at_traabirew.ncs differ diff --git a/nwnds_module/at_traabirew.nss b/nwnds_module/at_traabirew.nss new file mode 100644 index 000000000..08fc06a5a --- /dev/null +++ b/nwnds_module/at_traabirew.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: FileName at_traabirew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/30/2002 3:32:16 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 2500); + + // Give the speaker some XP + RewardPartyXP(700, GetPCSpeaker()); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "bluelotus"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/at_trakrewbelt.ncs b/nwnds_module/at_trakrewbelt.ncs new file mode 100644 index 000000000..15bdcc0cd Binary files /dev/null and b/nwnds_module/at_trakrewbelt.ncs differ diff --git a/nwnds_module/at_trakrewbelt.nss b/nwnds_module/at_trakrewbelt.nss new file mode 100644 index 000000000..64b76d388 --- /dev/null +++ b/nwnds_module/at_trakrewbelt.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewbelt +//:: Gives a Psyphon Belt as a reward +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(250, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_IRPBLT_PSYPHO", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_trakrewboots.ncs b/nwnds_module/at_trakrewboots.ncs new file mode 100644 index 000000000..86340ee5e Binary files /dev/null and b/nwnds_module/at_trakrewboots.ncs differ diff --git a/nwnds_module/at_trakrewboots.nss b/nwnds_module/at_trakrewboots.nss new file mode 100644 index 000000000..622702036 --- /dev/null +++ b/nwnds_module/at_trakrewboots.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewboots +//: Gives Light Boots as a reward. +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(250, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMBTS_LIGHT", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_trakrewcloak.ncs b/nwnds_module/at_trakrewcloak.ncs new file mode 100644 index 000000000..cff050e29 Binary files /dev/null and b/nwnds_module/at_trakrewcloak.ncs differ diff --git a/nwnds_module/at_trakrewcloak.nss b/nwnds_module/at_trakrewcloak.nss new file mode 100644 index 000000000..da51da5ad --- /dev/null +++ b/nwnds_module/at_trakrewcloak.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewcloak +//:: Gives a Slick Cloak as a reward. +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:50:12 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(250, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITCLK_SLICK", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_trakrewglove.ncs b/nwnds_module/at_trakrewglove.ncs new file mode 100644 index 000000000..76a130f37 Binary files /dev/null and b/nwnds_module/at_trakrewglove.ncs differ diff --git a/nwnds_module/at_trakrewglove.nss b/nwnds_module/at_trakrewglove.nss new file mode 100644 index 000000000..0ad9b739e --- /dev/null +++ b/nwnds_module/at_trakrewglove.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewglove +//: Gives Elven Trader Gloves as a reward. +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(250, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMGLV_ETRADE", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_trakrewring.ncs b/nwnds_module/at_trakrewring.ncs new file mode 100644 index 000000000..26fcf4a63 Binary files /dev/null and b/nwnds_module/at_trakrewring.ncs differ diff --git a/nwnds_module/at_trakrewring.nss b/nwnds_module/at_trakrewring.nss new file mode 100644 index 000000000..a3f9c1010 --- /dev/null +++ b/nwnds_module/at_trakrewring.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewring +//:: Gives the Amulet of Iron Will as a reward. +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:49:10 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(250, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITPNCK_IRNWILL", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/at_trici02.ncs b/nwnds_module/at_trici02.ncs new file mode 100644 index 000000000..0af6bfa48 Binary files /dev/null and b/nwnds_module/at_trici02.ncs differ diff --git a/nwnds_module/at_trici02.nss b/nwnds_module/at_trici02.nss new file mode 100644 index 000000000..42c38b5f8 --- /dev/null +++ b/nwnds_module/at_trici02.nss @@ -0,0 +1,29 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trici02 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 8:50:29 PM +//::////////////////////////////////////////////// +void main() +{ + + + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 30); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 250); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_DRIEDFISH"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + // Set the variables + SetLocalInt(GetPCSpeaker(), "nTriciQuest", 2); + + + +} diff --git a/nwnds_module/at_tsarla.ncs b/nwnds_module/at_tsarla.ncs new file mode 100644 index 000000000..619290038 Binary files /dev/null and b/nwnds_module/at_tsarla.ncs differ diff --git a/nwnds_module/at_tsarla.nss b/nwnds_module/at_tsarla.nss new file mode 100644 index 000000000..bfb67b271 --- /dev/null +++ b/nwnds_module/at_tsarla.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("STORE_CLOTHING"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/at_vareward1.ncs b/nwnds_module/at_vareward1.ncs new file mode 100644 index 000000000..6cd19ee1d Binary files /dev/null and b/nwnds_module/at_vareward1.ncs differ diff --git a/nwnds_module/at_vareward1.nss b/nwnds_module/at_vareward1.nss new file mode 100644 index 000000000..3e770b2e3 --- /dev/null +++ b/nwnds_module/at_vareward1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_vareward1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 11:24:28 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 100); + +} diff --git a/nwnds_module/at_worship.ncs b/nwnds_module/at_worship.ncs new file mode 100644 index 000000000..04b022cce Binary files /dev/null and b/nwnds_module/at_worship.ncs differ diff --git a/nwnds_module/at_worship.nss b/nwnds_module/at_worship.nss new file mode 100644 index 000000000..69914415a --- /dev/null +++ b/nwnds_module/at_worship.nss @@ -0,0 +1,6 @@ +void main() +{ +object oPC = GetPCSpeaker(); +AssignCommand ( oPC, ActionPlayAnimation (ANIMATION_LOOPING_WORSHIP, 1.0, 4000.0)); +AdjustAlignment(oPC,ALIGNMENT_LAWFUL,5); +} diff --git a/nwnds_module/athasianbear001.utc b/nwnds_module/athasianbear001.utc new file mode 100644 index 000000000..02781a57e Binary files /dev/null and b/nwnds_module/athasianbear001.utc differ diff --git a/nwnds_module/athasianbear002.utc b/nwnds_module/athasianbear002.utc new file mode 100644 index 000000000..df705dcf7 Binary files /dev/null and b/nwnds_module/athasianbear002.utc differ diff --git a/nwnds_module/athasianvisagepr.uti b/nwnds_module/athasianvisagepr.uti new file mode 100644 index 000000000..15d0e2894 Binary files /dev/null and b/nwnds_module/athasianvisagepr.uti differ diff --git a/nwnds_module/athyena001.utc b/nwnds_module/athyena001.utc new file mode 100644 index 000000000..e1ed56b1d Binary files /dev/null and b/nwnds_module/athyena001.utc differ diff --git a/nwnds_module/atropal001.utc b/nwnds_module/atropal001.utc new file mode 100644 index 000000000..0f1f1294b Binary files /dev/null and b/nwnds_module/atropal001.utc differ diff --git a/nwnds_module/atropal_ai.ncs b/nwnds_module/atropal_ai.ncs new file mode 100644 index 000000000..94afb2f10 Binary files /dev/null and b/nwnds_module/atropal_ai.ncs differ diff --git a/nwnds_module/atropal_ai.nss b/nwnds_module/atropal_ai.nss new file mode 100644 index 000000000..eba451058 --- /dev/null +++ b/nwnds_module/atropal_ai.nss @@ -0,0 +1,255 @@ + +#include "nw_i0_generic" +#include "x2_inc_switches" +#include "inc_AI" +#include "nw_i0_spells" +#include "_inc_battlecry_" + +const int FEAT_ZONE_OF_ANIMATION = 2895; + +void DoTouchAttack(object oTarget, object oCaster ) +{ + ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,2.0); + + int nDam = 5; + int nHeal = 20; + int nRoll = TouchAttackMelee(oTarget,TRUE); + + if ( nRoll == 0 ) + return; + + // improved critical gives 19-20 + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_CRITICAL_HIT) && ( nRoll == 2 || ( nRoll == 1 && d20() == 20 )) ) + { + effect eNegative = EffectDamage(d6(),DAMAGE_TYPE_NEGATIVE); + + // crit hit, overwhelming critical + nDam *= 2; + nHeal *= 2; + int nDC = 10 + GetHitDice(oCaster) / 2 + GetAbilityModifier(ABILITY_STRENGTH,oCaster); + FloatingTextStringOnCreature("Devastating Critical!",oTarget); + if ( !MySavingThrow(SAVING_THROW_FORT,oTarget,nDC,SAVING_THROW_TYPE_NONE,oCaster) ) + { + effect eHP = EffectDamage(GetMaxHitPoints(oTarget)); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + ApplyEffectToObject(DURATION_TYPE_INSTANT,eNegative,oTarget); + } + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + return; + + effect eHeal = EffectHeal(nHeal); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + eCon = SupernaturalEffect(eCon); + eCon = ExtraordinaryEffect(eCon); + + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + if ( !MySavingThrow(SAVING_THROW_FORT,oTarget,59,SAVING_THROW_TYPE_NONE,oCaster) ) + { + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCaster); + } + + + +} + + void DoEnergyDrainRay(object oTarget, object oCaster ) +{ + int nRoll = TouchAttackRanged(oTarget,TRUE); + + effect eBeam; + if ( nRoll == 0 ) + { // miss + eBeam = EffectBeam(VFX_BEAM_EVIL,oCaster,BODY_NODE_CHEST,TRUE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.5); + return; + } + + int nDrain = 4; + int nHeal = 40; + + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_CRITICAL_HIT) && ( nRoll == 2 || ( nRoll == 1 && d20() == 20 )) ) + { + nDrain *= 2; + nHeal *= 2; + } + + eBeam = EffectBeam(VFX_BEAM_EVIL,oCaster,BODY_NODE_CHEST); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.5); + + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eDrain = EffectNegativeLevel(nDrain); + eDrain = SupernaturalEffect(eDrain); + eDrain = ExtraordinaryEffect(eDrain); + + + effect eHeal = EffectHeal(nHeal); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget); + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCaster); + } + +} + +/*void DoEnergyDrainRay( object oTarget, object oCaster ) +{ + ActionCastSpellAtObject(SPELLABILITY_BOLT_LEVEL_DRAIN,oTarget,METAMAGIC_ANY,TRUE); +} */ +void DoPhysical( object oTarget, object oCaster ) +{ + if ( !GetIsObjectValid(oTarget) || !GetIsEnemy(oTarget) ) + { + oTarget = GetNearestEnemy(); + if ( !GetIsObjectValid(oTarget) ) + return; + } + if ( GetDistanceToObject(oTarget) > FeetToMeters(20.0) ) + { +// SetLocalInt(OBJECT_SELF,"Acting",1); + DoEnergyDrainRay(oTarget,oCaster); +// DelayCommand(6.0,SetLocalInt(OBJECT_SELF,"Acting",0)); +// DelayCommand(6.1,DetermineCombatRound()); + } + else + { + ActionMoveToObject(oTarget,TRUE); + SetLocalInt(OBJECT_SELF,"Acting",1); + DelayCommand(0.1,DoTouchAttack(oTarget,oCaster)); + DelayCommand(3.0,DoTouchAttack(oTarget,oCaster)); + DelayCommand(6.0,SetLocalInt(OBJECT_SELF,"Acting",0)); + DelayCommand(6.1,DetermineCombatRound()); + } + SetCreatureOverrideAIScriptFinished(); + +} + +void main() +{ + // The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + int bAura = GetLocalInt(OBJECT_SELF,"aura"); + if (!bAura==1) + { + string sScript = GetLocalString(OBJECT_SELF,"Aura_Script"); + ExecuteScript(sScript,OBJECT_SELF); + SetLocalInt(OBJECT_SELF,"aura",1); + } + + if ( !GetCanAct(OBJECT_SELF) ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + if ( GetLocalInt(OBJECT_SELF,"Acting") == 1 ) + { +// SpeakString("I am acting! rawr!"); + SetCreatureOverrideAIScriptFinished(); + return; + } +/* if ( d6() == 1 ) // in case they get busy-stuck, also to add randomness + { + SetLocalInt(OBJECT_SELF,"busy",FALSE); + return; + } */ + // Don't inturupt actions in progress + + + if ( GetCurrentAction() == ACTION_CASTSPELL ) + { +// SpeakString("I am casting! Rawr!"); + SetCreatureOverrideAIScriptFinished(); + return; + } + + if ( GetLocalInt(OBJECT_SELF,"physical") ) + { +// SpeakString("Time to die!"); + ClearAllActions(); + DoPhysical(oIntruder,OBJECT_SELF); + return; + } + // Haste = Super awesome; + // Get those summons in there! + int nSummonCount = GetLocalInt(OBJECT_SELF,"SummonCount"); + if ( !GetIsObjectValid(GetAssociate(ASSOCIATE_TYPE_SUMMONED)) && nSummonCount < 5 ) + { + nSummonCount++; + SetLocalInt(OBJECT_SELF,"SummonCount",nSummonCount); + SpeakString(COLOR_RED+"Rise my children!!"); + ClearAllActions(); + ActionUseFeat(FEAT_ZONE_OF_ANIMATION, OBJECT_SELF); //PRC Addition -DMH + ActionCastFakeSpellAtLocation(SPELL_SUMMON_CREATURE_IX,GetLocation(OBJECT_SELF)); + effect eSummon = EffectSummonCreature("nightwalker001",VFX_FNF_SUMMON_MONSTER_3,1.0); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eSummon,GetLocation(OBJECT_SELF),HoursToSeconds(24)); + SetCreatureOverrideAIScriptFinished(); + return; + } + + + // Hostile targeting actions + if ( !GetIsObjectValid(oIntruder) || !GetIsReactionTypeHostile(oIntruder) ) + { + oIntruder = GetNearestPerceivedEnemy(); + if ( !GetIsObjectValid(oIntruder) ) + return; + } + + + // Melee up sometimes! + + if ( d6() == 6 ) + { + switch ( d4() ) + { + case 1: + PlayVoiceChat(VOICE_CHAT_BATTLECRY1); + break; + case 2: + PlayVoiceChat(VOICE_CHAT_ATTACK); + break; + case 3: + PlayVoiceChat(VOICE_CHAT_BATTLECRY2); + break; + case 4: + PlayVoiceChat(VOICE_CHAT_BATTLECRY3); + break; + } + +// SpeakString("DIEDIEIDE"); + SetLocalInt(OBJECT_SELF,"physical",1); + DelayCommand(24.0,SetLocalInt(OBJECT_SELF,"physical",0)); + ClearAllActions(); + DoPhysical(oIntruder,OBJECT_SELF); + return; + } +} + + + diff --git a/nwnds_module/atropal_aura.ncs b/nwnds_module/atropal_aura.ncs new file mode 100644 index 000000000..fe681e178 Binary files /dev/null and b/nwnds_module/atropal_aura.ncs differ diff --git a/nwnds_module/atropal_aura.nss b/nwnds_module/atropal_aura.nss new file mode 100644 index 000000000..fcc84483e --- /dev/null +++ b/nwnds_module/atropal_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_CIRCGOOD,"atropal_aura1","atropal_aura2","atropal_aura3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/atropal_aura1.ncs b/nwnds_module/atropal_aura1.ncs new file mode 100644 index 000000000..3281f314b Binary files /dev/null and b/nwnds_module/atropal_aura1.ncs differ diff --git a/nwnds_module/atropal_aura1.nss b/nwnds_module/atropal_aura1.nss new file mode 100644 index 000000000..99ece71fa --- /dev/null +++ b/nwnds_module/atropal_aura1.nss @@ -0,0 +1,39 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eDrain = EffectNegativeLevel(10); + effect eDeath = EffectDeath(); + effect eBoost = EffectTurnResistanceIncrease(20); + eBoost = EffectLinkEffects(eBoost,EffectRegenerate(20,6.0)); + object oTarget = GetEnteringObject(); + int nRace = GetRacialType(oTarget); + if ( GetLocalInt(oTarget,"NEAura") ) + return; + if(GetIsEnemy(oTarget, oCaster)) + { + if ( nRace != RACIAL_TYPE_UNDEAD ) + { +// if ( GetHitDice(oTarget) <= 10 ) +// { +// location lWight = GetLocation(oTarget); +// ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); +// ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); +// CreateObject(OBJECT_TYPE_CREATURE,"nw_wight",lWight); +// return; +// } + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + } + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBoost,oTarget); + } + SetLocalInt(oTarget,"NEAura",1); +} diff --git a/nwnds_module/atropal_aura2.ncs b/nwnds_module/atropal_aura2.ncs new file mode 100644 index 000000000..7776d8ea5 Binary files /dev/null and b/nwnds_module/atropal_aura2.ncs differ diff --git a/nwnds_module/atropal_aura2.nss b/nwnds_module/atropal_aura2.nss new file mode 100644 index 000000000..23f88284d --- /dev/null +++ b/nwnds_module/atropal_aura2.nss @@ -0,0 +1,48 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eDrain = EffectNegativeLevel(10); + effect eDeath = EffectDeath(); + effect eBoost = EffectTurnResistanceIncrease(20); + eBoost = EffectLinkEffects(eBoost,EffectRegenerate(20,6.0)); + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if ( GetLocalInt(oTarget,"NEAura") ) + { + oTarget = GetNextInPersistentObject(); + break; + } + int nRace = GetRacialType(oTarget); + if(GetIsEnemy(oTarget, oCaster)) + { + if ( nRace != RACIAL_TYPE_UNDEAD ) + { +// if ( GetHitDice(oTarget) <= 10 ) +// { +// location lWight = GetLocation(oTarget); +// ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); +// ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); +// CreateObject(OBJECT_TYPE_CREATURE,"nw_wight",lWight); +// } +// else +// { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +// } + } + } + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBoost,oTarget); + } + SetLocalInt(oTarget,"NEAura",1); + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/atropal_aura3.ncs b/nwnds_module/atropal_aura3.ncs new file mode 100644 index 000000000..c8a7fa2ff Binary files /dev/null and b/nwnds_module/atropal_aura3.ncs differ diff --git a/nwnds_module/atropal_aura3.nss b/nwnds_module/atropal_aura3.nss new file mode 100644 index 000000000..25caaf6cd --- /dev/null +++ b/nwnds_module/atropal_aura3.nss @@ -0,0 +1,55 @@ +//#include "NW_I0_SPELLS" + +#include "x2_inc_spellhook" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + int bValid = FALSE; + int bRegen = FALSE; + int bTurn = FALSE; + effect eAOE; + int nEffectType; + object oPC = GetFirstPC(); +// SendMessageToPC(oPC,"neaura3: OBJECT_SELF = " + GetName(OBJECT_SELF) + +// " Creator = " + GetName(GetAreaOfEffectCreator(OBJECT_SELF)) ); + + if(GetLocalInt(oTarget,"NEAura")) + { + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { +// SendMessageToPC(oPC,"EffectCreator is "+ GetName(GetEffectCreator(eAOE))); + + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator(OBJECT_SELF)) + { + nEffectType = GetEffectType(eAOE); + if ( (nEffectType == EFFECT_TYPE_REGENERATE) || + (nEffectType == EFFECT_TYPE_TURN_RESISTANCE_INCREASE) || + (nEffectType == EFFECT_TYPE_NEGATIVELEVEL) ) + { + //If the effect was created by the Acid_Fog then remove it + if(GetEffectSpellId(eAOE) == -1) + { + RemoveEffect(oTarget, eAOE); + if ( nEffectType == EFFECT_TYPE_NEGATIVELEVEL ) + bValid = TRUE; + if ( nEffectType == EFFECT_TYPE_TURN_RESISTANCE_INCREASE ) + bTurn = TRUE; + if ( nEffectType == EFFECT_TYPE_REGENERATE ) + bRegen = TRUE; + if ( bTurn && bRegen ) + bValid = TRUE; + + } + } + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } + SetLocalInt(oTarget,"NEAura",0); + } +} diff --git a/nwnds_module/atropalhide001.uti b/nwnds_module/atropalhide001.uti new file mode 100644 index 000000000..8bd27ae2b Binary files /dev/null and b/nwnds_module/atropalhide001.uti differ diff --git a/nwnds_module/atropalscion.uti b/nwnds_module/atropalscion.uti new file mode 100644 index 000000000..98c95d2b4 Binary files /dev/null and b/nwnds_module/atropalscion.uti differ diff --git a/nwnds_module/atropalscion001.utc b/nwnds_module/atropalscion001.utc new file mode 100644 index 000000000..710a231da Binary files /dev/null and b/nwnds_module/atropalscion001.utc differ diff --git a/nwnds_module/atropaltouch.ncs b/nwnds_module/atropaltouch.ncs new file mode 100644 index 000000000..2e50ac2cc Binary files /dev/null and b/nwnds_module/atropaltouch.ncs differ diff --git a/nwnds_module/atropaltouch.nss b/nwnds_module/atropaltouch.nss new file mode 100644 index 000000000..fe2cc9241 --- /dev/null +++ b/nwnds_module/atropaltouch.nss @@ -0,0 +1,54 @@ +#include "NW_I0_SPELLS" + + +void DoConDamage(object oTarget, object oCaster) +{ + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + int nDam = 5; + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + + effect eHeal = EffectHeal(20); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + if ( !MySavingThrow(SAVING_THROW_FORT,oTarget,59,SAVING_THROW_TYPE_NONE,oCaster) ) + { + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCaster); + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoConDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/atropaltouch.uti b/nwnds_module/atropaltouch.uti new file mode 100644 index 000000000..6e05bde5b Binary files /dev/null and b/nwnds_module/atropaltouch.uti differ diff --git a/nwnds_module/aura_ai.ncs b/nwnds_module/aura_ai.ncs new file mode 100644 index 000000000..a52dfb702 Binary files /dev/null and b/nwnds_module/aura_ai.ncs differ diff --git a/nwnds_module/aura_ai.nss b/nwnds_module/aura_ai.nss new file mode 100644 index 000000000..61ff83668 --- /dev/null +++ b/nwnds_module/aura_ai.nss @@ -0,0 +1,46 @@ +#include "nw_i0_generic" +#include "x2_inc_switches" +#include "inc_AI" + +void main() +{ + // The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + + if ( !GetCanAct(OBJECT_SELF) ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + int bAura = GetLocalInt(OBJECT_SELF,"aura"); + if ( !bAura ) + { +// ActionCastFakeSpellAtLocation(SPELL_SUMMON_SHADOW,GetLocation(OBJECT_SELF)); + + + string sScript = GetLocalString(OBJECT_SELF,"Aura_Script"); +// SpeakString("Running script " + sScript,TALKVOLUME_SHOUT); + +// ClearAllActions(); + ExecuteScript(sScript,OBJECT_SELF); + +// SetCreatureOverrideAIScriptFinished(); + SetLocalInt(OBJECT_SELF,"aura",1); + return; + } + if ( TalentSummonAllies() ) + { +// SpeakString("Calling TalentSummonAllies!"); +// SpeakString("Summoned Monster = " + GetName(GetAssociate(ASSOCIATE_TYPE_SUMMONED)) ); + +// SpeakString("Come to my side! Battle awaits!"); + PlayVoiceChat(VOICE_CHAT_HELP); +// SetLocalInt(OBJECT_SELF,"busy",TRUE); +// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE)); + SetCreatureOverrideAIScriptFinished(); + return; + } + +} + diff --git a/nwnds_module/aviaragbite.uti b/nwnds_module/aviaragbite.uti new file mode 100644 index 000000000..7fc01ecd4 Binary files /dev/null and b/nwnds_module/aviaragbite.uti differ diff --git a/nwnds_module/aviaraghide.uti b/nwnds_module/aviaraghide.uti new file mode 100644 index 000000000..d261f0b4a Binary files /dev/null and b/nwnds_module/aviaraghide.uti differ diff --git a/nwnds_module/azerhide.uti b/nwnds_module/azerhide.uti new file mode 100644 index 000000000..b8830df54 Binary files /dev/null and b/nwnds_module/azerhide.uti differ diff --git a/nwnds_module/azerlighthammer.uti b/nwnds_module/azerlighthammer.uti new file mode 100644 index 000000000..b8f8379eb Binary files /dev/null and b/nwnds_module/azerlighthammer.uti differ diff --git a/nwnds_module/azerslam.uti b/nwnds_module/azerslam.uti new file mode 100644 index 000000000..96a8bfc1a Binary files /dev/null and b/nwnds_module/azerslam.uti differ diff --git a/nwnds_module/babyashendrake.utc b/nwnds_module/babyashendrake.utc new file mode 100644 index 000000000..62a6bb0c8 Binary files /dev/null and b/nwnds_module/babyashendrake.utc differ diff --git a/nwnds_module/bandage.uti b/nwnds_module/bandage.uti new file mode 100644 index 000000000..4b0c91307 Binary files /dev/null and b/nwnds_module/bandage.uti differ diff --git a/nwnds_module/banditarmor1.uti b/nwnds_module/banditarmor1.uti new file mode 100644 index 000000000..5eed53e52 Binary files /dev/null and b/nwnds_module/banditarmor1.uti differ diff --git a/nwnds_module/banditcamp_barn.are b/nwnds_module/banditcamp_barn.are new file mode 100644 index 000000000..0d9ea1fc0 Binary files /dev/null and b/nwnds_module/banditcamp_barn.are differ diff --git a/nwnds_module/banditcamp_barn.gic b/nwnds_module/banditcamp_barn.gic new file mode 100644 index 000000000..c5982ae41 Binary files /dev/null and b/nwnds_module/banditcamp_barn.gic differ diff --git a/nwnds_module/banditcamp_barn.git b/nwnds_module/banditcamp_barn.git new file mode 100644 index 000000000..92c009fc9 Binary files /dev/null and b/nwnds_module/banditcamp_barn.git differ diff --git a/nwnds_module/banditguard_001.utc b/nwnds_module/banditguard_001.utc new file mode 100644 index 000000000..f569c8537 Binary files /dev/null and b/nwnds_module/banditguard_001.utc differ diff --git a/nwnds_module/banditguard_002.utc b/nwnds_module/banditguard_002.utc new file mode 100644 index 000000000..98f21aeac Binary files /dev/null and b/nwnds_module/banditguard_002.utc differ diff --git a/nwnds_module/banditguard_003.utc b/nwnds_module/banditguard_003.utc new file mode 100644 index 000000000..8a589bd32 Binary files /dev/null and b/nwnds_module/banditguard_003.utc differ diff --git a/nwnds_module/banishment.are b/nwnds_module/banishment.are new file mode 100644 index 000000000..eac3ad10e Binary files /dev/null and b/nwnds_module/banishment.are differ diff --git a/nwnds_module/banishment.gic b/nwnds_module/banishment.gic new file mode 100644 index 000000000..86a711c5d Binary files /dev/null and b/nwnds_module/banishment.gic differ diff --git a/nwnds_module/banishment.git b/nwnds_module/banishment.git new file mode 100644 index 000000000..971c72c10 Binary files /dev/null and b/nwnds_module/banishment.git differ diff --git a/nwnds_module/bank_chest001.utp b/nwnds_module/bank_chest001.utp new file mode 100644 index 000000000..7754a939f Binary files /dev/null and b/nwnds_module/bank_chest001.utp differ diff --git a/nwnds_module/bank_chest002.utp b/nwnds_module/bank_chest002.utp new file mode 100644 index 000000000..a8af7de9d Binary files /dev/null and b/nwnds_module/bank_chest002.utp differ diff --git a/nwnds_module/bank_chest003.utp b/nwnds_module/bank_chest003.utp new file mode 100644 index 000000000..95ff467f0 Binary files /dev/null and b/nwnds_module/bank_chest003.utp differ diff --git a/nwnds_module/bank_inc.nss b/nwnds_module/bank_inc.nss new file mode 100644 index 000000000..c450ac880 --- /dev/null +++ b/nwnds_module/bank_inc.nss @@ -0,0 +1,724 @@ +//:://///////////////////////////////////////////// +//:: bank_inc.nss +//:: Bank Vault include file +//:: Version 1.9 +//::////////////////////////////////////////////// +/* + 1.0 Orginal Version + 1.1 Fixed problem with multiple opens where items from + First opener where assign to Second, third, etc PC. + OnDisturb checks to see if PC Adding/Removing items + is the orginal Opener. Returns items if not. + 1.2 Made workaround for Blank Template Problem. OnDistrub returns + any items or Containers that have or contain a blank Template + returned by GetResRef() function back to original PC. + Made workaround for Multiple PC problem. Any PC opening Chest + other then original PC will be teleported to the closest waypoint + (WP_BankLobby) and told to wait their turn. :) + 1.3 Fixed Blank Template Bug. Items that are split or bought from + Merchants can now be placed into the Bank Vault. + Fixed problem where item were being listed as unidentified even though + they were list as ID when placed into Bank Vault. + 1.4 Added a Storage Limit variable to limit items per PC that can be stored + into Bank Chest. Currently set to 20. Change the iStorageLimit variable + in the bank_inc.nss file to increase/decrease. + 1.5 Fixed problem where gold was duplicating or dissapearing when adding more + then 50000 gold pieces to the Bank Chest. Changed Bank Chest so that you + don't need a WayPoint to transport any additonal PC's trying to access chest + after the first. + 1.6 Added the ability to switch the Bank Chest(s) to be either Module wide Chests + (the same items appear no matter what Area you are in the Module), or Local + Chests (Items are stored in a Area can only be retrieved in that Area). These + options are controled by the "BankModule" variable in the Bank_inc.nss file. + Added a switch that will store all PC Bank Vault data into a single database, + (default "BankVault"), or create a seperate database for each Players's PC. + This should help in Persistent Worlds with cleaningup character data. + This is controlled with the "iSingleCamp" variable in the Bank_inc.nss file. + 1.7 Added ablility to store unique objects that are not in the Module Pallette (aka no ResRef). + PC's can now store items from other modules into the BankVault. Added a + Anti-spam fixed to prevent users from duplicating items in BankVault. + 1.8 Added Hash code for Database tag names to break 32 character barrier in both Bank Vault + and Personal Vault. NOTE: This makes version 1.8 uncompatible with any previous versions + of Bank Vault. NEW: Personal Storage Vaults with Access Control. You can now + assign a Vault to a indiviual owner. This owner can specify his own set of friends + that can access his/her Vault all in game and real time. See instructions. + 1.9 Added the ability to switch the Bank Chest(s) to either have a seperate Vault + for each Player's PC or to have a single Vault Space shared by every PC a Player + creates. This is controlled with the "iPCGlobal" variable in the Bank_inc.nss file. + Added the ability for the user to identify the Player by either his/her Player Name + or by his/her Public CD Key. This is controlled with the "iCDKey" variable in the + Bank_inc.nss file. This ability is only valid if you are using a single Vault Space. + Fixed a duping exploit. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Clayten Gillis (a.k.a DragonsWake) +//:: Created On: December 17, 2002 +//::////////////////////////////////////////////// + + + +// Variable Declarations + +// Print Debug Statements. Set to '1' to Print Debug statements to PC +int Debug = 0; + +// Set BanksModule = 1 for Module wide Bank. Set BankModule = 0 for Local Banks. +int BankModule = 1; + +// Set the Chest to being opened for the first time (Do Not Modify) +int iBankFirstTime = 0; +int iCurUse; +int iLastUse; + +// Storage Limit for Bank Chest. This limits how many items per PC that can be stored. +int iStorageLimit = 20; + +// Campaign Name for Bank Vault. Default is BankVault + +string sCampName = "BankVault"; +string sDataName = ""; + +// Single Campaign Database. If set to 1 it will open a single Database called +// "BankVault". If set to 0 it will open a database for each individual PC. + +int iSingleCamp = 1; + +// Set Value for Global Indentifier on Bank Chest. +// 0 = Uses PC Player Name and PC Name for ID. Most unique solution. Each PC created +// by player has his/her own Vault space +// 1 = Uses PC Player Name or PC Public CD Key only for ID. Each PC created by Player shares a single +// Vault space + +int iPCGlobal = 1; + +// Specify if you want to use 1 = Public CD Key or 0 = PC Player Name. + +int iCDKey = 1; + +// Internal Identifiers of storage variables. (Do Not Modify) +string sBankBP = "BankItemBP"; +string sBankUQ = "BankItemUQ"; +string sBankItemID = "BankItemID"; +string sBankGold = "BankGold"; +string sBankStack = "BankStkAmt"; +string sBankFirst = "BankFrist"; +int iHeaderCount = 0; +int iStackAmt = 0; +object oCurInvObj; +object oItemID; +string sBankKey = ""; +string sEventTime = "BankEvent"; +int iUnique = 0; +int iTotalLen; +int iAscii; +int iHashCount; +string sHashTable = " ! #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}"; +int iMasque = 1; + +int HashID(string sIDString) +{ + int iHash = 1299827; + iHashCount = 0; + iTotalLen = GetStringLength(sIDString); + while ( iHashCount != iTotalLen ) + { + iHashCount++; + iAscii = 31 + FindSubString(sHashTable, GetSubString(sIDString, iHashCount, 1)); + iHash += iAscii << (8 * ((iHashCount - 1) & iMasque)); + + } + return iHash; +} + +// GetKey() Taken from PWDB Include written by Valerio Santinelli - tanis@mediacom.it +// Determine an Object's key. +string GetKey(object oTarget, int iOpenTest) +{ + string sKey; + + if (GetIsPC(oTarget)) + { + if ( iPCGlobal == 0 ) + { + sKey = GetPCPlayerName(oTarget) + "_" + GetName(oTarget); + } + else + { + if ( iCDKey == 0 ) + { + sKey = GetPCPlayerName(oTarget); + SendMessageToPC(oTarget, "Key1: "+sKey); + } + else + { + if ( iCDKey == 1 ) + { + sKey = GetPCPublicCDKey(oTarget); + SendMessageToPC(oTarget, "Key2: "+sKey); + } + } + } + if (iOpenTest) + { + sKey = GetPCPlayerName(oTarget) + "_" + GetName(oTarget); + } + + } + else + { + //location lLoc = GetLocation(oTarget); + //vector vLoc = GetPositionFromLocation(lLoc); + //int iVec1 = FloatToInt(vLoc.x); + //int iVec2 = FloatToInt(vLoc.y); + //int iVec3 = FloatToInt(vLoc.z); + object oArea = GetArea(oTarget); + string sAreaName = GetName(oArea); + //string sLoc = IntToString(iVec1) + IntToString(iVec2) + IntToString(iVec3); + sKey = GetTag(oTarget) + sAreaName; +// + GetName(oTarget) + } + return sKey; +} + +int EncodeGold (object oPC, object oCurItem, int iItemCount, string sItemName, string sCampName, string sAreaKey) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + iStackAmt = GetNumStackedItems(oCurItem); + if (iStackAmt > 50000) + { + int i; + int iDivision = iStackAmt / 50000; + int iModulo = iStackAmt % 50000; + for (i = 0; i < iDivision; i++) + { + SetCampaignInt(sCampName, IntToString(HashID(sBankGold + IntToString(iItemCount) + sAreaKey)), 50000, oItemID); + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + iItemCount = iItemCount + 1; + + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This is Gold. StackSize "+IntToString(50000)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "----------"); + } + } + + SetCampaignInt(sCampName, IntToString(HashID(sBankGold + IntToString(iItemCount) + sAreaKey)), iModulo, oItemID); + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This is Gold. StackSize "+IntToString(iModulo)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "----------"); + } + + } + else + { + SetCampaignInt(sCampName, IntToString(HashID(sBankGold + IntToString(iItemCount) + sAreaKey)), iStackAmt, oItemID); + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + + // Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This is Gold. StackSize "+IntToString(iStackAmt)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "----------"); + } + } + return iItemCount; +} + +void EncodeItem (object oPC, object oCurItem, int iItemCount, string sItemName, string sCampName, string sAreaKey, int iItemUnq) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + + if ( GetIdentified(oCurItem) ) + { + SetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), 1, oItemID); + } + else + { + SetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), 0, oItemID); + } + + if (iItemUnq) + { + StoreCampaignObject(sCampName, IntToString(HashID(sBankUQ + IntToString(iItemCount) + sAreaKey)), oCurItem, oItemID); + } + //Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This is an Item."); + SendMessageToPC(oPC, "Valid Object: " + IntToString(GetIsObjectValid(oCurItem)) ); + if ( !iItemUnq ) + { + SendMessageToPC(oPC, "ResRef: "+sItemName); + } + else + { + SendMessageToPC(oPC, "ResRef: Unique"); + } + SendMessageToPC(oPC, "Identified?: " + IntToString(GetIdentified(oCurItem))); + SendMessageToPC(oPC, "----------"); + } + + return; +} + +int EncodeStackItem (object oPC, object oCurItem, int iItemCount, string sCampName, string sAreaKey, int iItemUnq) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + + string sItemName; + if (!iItemUnq) + { + iStackAmt = GetNumStackedItems(oCurItem); + + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), "STACK", oItemID); + iItemCount = iItemCount + 1; + SetCampaignInt(sCampName, IntToString(HashID(sBankStack + IntToString(iItemCount) + sAreaKey)), iStackAmt, oItemID); + + string sItemName = GetResRef(oCurItem); + + if ( sItemName == "" ) + { + sItemName = GetTag(oCurItem); + } + + + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + + + } + else + { + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), "STACKUNQ", oItemID); + iItemCount = iItemCount + 1; + sItemName = "UNIQUE"; + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), sItemName, oItemID); + StoreCampaignObject(sCampName, IntToString(HashID(sBankUQ + IntToString(iItemCount) + sAreaKey)), oCurItem, oItemID); + } + + if ( GetIdentified(oCurItem) ) + { + SetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), 1, oItemID); + } + else + { + SetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), 0, oItemID); + } + + //Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "Stack Item. StackSize: "+IntToString(iStackAmt)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+ sItemName ); + SendMessageToPC(oPC, "Identified?: " + IntToString(GetIdentified(oCurItem))); + SendMessageToPC(oPC, "----------"); + } + + return iItemCount; +} + +int EncodeContainer (object oPC, object oCurItem, int iItemCount, string sItemName, string sCampName, string sAreaKey, int iItemUnq) +{ + iHeaderCount = 0; + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Encode Container ROUTINE"); + } + + if (!iItemUnq) + { + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), "CONTAIN", oItemID); + } + else + { + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), "CONTAINUNQ", oItemID); + } + iHeaderCount = iHeaderCount + 1; + + iItemCount = iItemCount + 1; + + EncodeItem(oPC, oCurItem, iItemCount, sItemName, sCampName, sAreaKey, iItemUnq); + + oCurInvObj = GetFirstItemInInventory(oCurItem); + + while ( GetIsObjectValid(oCurInvObj) == TRUE || GetResRef(oCurInvObj) == "nw_it_gold001") //Begin Processing Item in Inventory + { + + iItemCount = iItemCount + 1; + + sItemName = GetResRef(oCurInvObj); + if ( sItemName == "" ) + { + //sItemName = GetTag(oCurInvObj); + //if (sItemName == "") + //{ + iUnique = 1; + sItemName = "UNIQUE"; + //} + //else + //{ + // iUnique = 0; + //} + } + else + { + iUnique = 0; + } + if ( sItemName == "nw_it_gold001") + { + EncodeGold(oPC, oCurInvObj, iItemCount, sItemName, sCampName, sAreaKey); + + } + else + { + //Debug + if (Debug) + { + SendMessageToPC(oPC, "----------"); + SendMessageToPC(oPC, "StackNum: "+IntToString(GetNumStackedItems(oCurInvObj))); + SendMessageToPC(oPC, "----------"); + } + + if (GetHasInventory(oCurInvObj) == TRUE ) + { + iItemCount = EncodeContainer(oPC, oCurInvObj, iItemCount, sItemName, sCampName, sAreaKey, iUnique); + } + else if (GetNumStackedItems(oCurInvObj) > 1) + { + iHeaderCount = iHeaderCount + 1; + iItemCount = EncodeStackItem( oPC, oCurInvObj, iItemCount, sCampName, sAreaKey, iUnique); + } + else + { + EncodeItem(oPC, oCurInvObj, iItemCount, sItemName, sCampName, sAreaKey, iUnique); + } + } + + + oCurInvObj = GetNextItemInInventory(oCurItem); + + + } + iItemCount = iItemCount + 1; + SetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), "END", oItemID); + iHeaderCount = iHeaderCount + 1; + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "END Encode Container ROUTINE"); + } + + + return iItemCount; +} + + +void DecodeGold (object oPC, object oCurContainer, int iItemCount, string sItemName, string sCampName, string sAreaKey) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + iStackAmt = GetCampaignInt(sCampName, IntToString(HashID(sBankGold + IntToString(iItemCount) + sAreaKey)), oItemID); + object oCurItem = CreateItemOnObject(sItemName, oCurContainer, iStackAmt); + + // Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This Gold. StackSize "+IntToString(iStackAmt)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "----------"); + } + + return; +} + +object DecodeItem (object oPC, object oCurContainer, int iItemCount, string sItemName, string sCampName, string sAreaKey, int iItemUnq) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + object oCurItem; + if (!iItemUnq) + { + oCurItem = CreateItemOnObject(sItemName, oCurContainer, 1); + + } + else + { + oCurItem = RetrieveCampaignObject(sCampName, IntToString(HashID(sBankUQ + IntToString(iItemCount) + sAreaKey)), GetLocation(OBJECT_SELF), OBJECT_SELF, oItemID); //, + } + if ( GetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), oItemID) ) + { + SetIdentified(oCurItem, TRUE); + } + else + { + SetIdentified(oCurItem, FALSE); + } + + //Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "This is an Item."); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "Identified?: " + IntToString(GetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), oItemID)) ); + SendMessageToPC(oPC, "----------"); + } + + //DeletePersistentInt(oPC, sBankItemID + IntToString(iItemCount) ); + + return oCurItem; +} + +int DecodeStackItem (object oPC, object oCurContainer, int iItemCount, string sItemName, string sCampName, string sAreaKey, int iItemUnq) +{ + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + object oCurItem; + //DeletePersistentString(oPC, sBankBP + IntToString(iItemCount) ); + iItemCount = iItemCount + 1; + if (!iItemUnq) + { + iStackAmt = GetCampaignInt(sCampName, IntToString(HashID(sBankStack + IntToString(iItemCount) + sAreaKey)), oItemID); + sItemName = GetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), oItemID); + oCurItem = CreateItemOnObject(sItemName, oCurContainer, iStackAmt); + + + } + else + { + oCurItem = RetrieveCampaignObject(sCampName, IntToString(HashID(sBankUQ + IntToString(iItemCount) + sAreaKey)), GetLocation(OBJECT_SELF), OBJECT_SELF, oItemID); //, + } + + if ( GetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount) + sAreaKey)), oItemID) ) + { + SetIdentified(oCurItem, TRUE); + } + else + { + SetIdentified(oCurItem, FALSE); + } + + //DeletePersistentInt(oPC, sBankStack + IntToString(iItemCount) ); + //DeletePersistentInt(oPC, sBankItemID + IntToString(iItemCount) ); + + //Debug Statements + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount)); + SendMessageToPC(oPC, "Stack Item. StackSize: "+IntToString(iStackAmt)); + SendMessageToPC(oPC, "Valid Object:" + IntToString(GetIsObjectValid(oCurItem)) ); + SendMessageToPC(oPC, "ResRef: "+sItemName); + SendMessageToPC(oPC, "Identified?: " + IntToString(GetCampaignInt(sCampName, IntToString(HashID(sBankItemID + IntToString(iItemCount)+ sAreaKey)), oItemID)) ); + SendMessageToPC(oPC, "----------"); + } + + return iItemCount; +} + +int DecodeContainer (object oPC, object oCurContainer, string sItemName, int iItemCount, string sCampName, string sAreaKey, int iItemUnq) +{ + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Decode Container ROUTINE"); + } + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + // DeletePersistentString(oPC, sBankBP + IntToString(iItemCount) ); + iItemCount = iItemCount +1; + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount) ); + } + + sItemName = GetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), oItemID ); + + oCurContainer = DecodeItem(oPC, OBJECT_SELF, iItemCount, sItemName, sCampName, sAreaKey, iItemUnq); + + sItemName = GetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount + 1) + sAreaKey)), oItemID ); + + while ( sItemName != "END") + { + iItemCount = iItemCount + 1; + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(iItemCount) ); + } + + sItemName = GetCampaignString(sCampName, IntToString(HashID(sBankBP + IntToString(iItemCount) + sAreaKey)), oItemID ); + + + if ( sItemName != "nw_it_gold001" ) + { + + if ( sItemName == "STACK") + { + iItemCount = DecodeStackItem(oPC, oCurContainer, iItemCount, sItemName, sCampName, sAreaKey, 0); + } + else + { + if ( sItemName == "STACKUNQ") + { + iItemCount = DecodeStackItem(oPC, oCurContainer, iItemCount, sItemName, sCampName, sAreaKey, 1); + } + else + { + if ( sItemName == "UNIQUE" ) + { + DecodeItem(oPC, oCurContainer, iItemCount, sItemName, sCampName, sAreaKey, 1); + } + else + { + DecodeItem(oPC, oCurContainer, iItemCount, sItemName, sCampName, sAreaKey, 0); + } + } + + } + + + } + else + { + + DecodeGold(oPC, oCurContainer, iItemCount, sItemName, sCampName, sAreaKey); + // DeletePersistentInt(oPC, sBankGold ); + + + } + // DeletePersistentString(oPC, sBankBP + IntToString(iItemCount) ); + + + } + + return iItemCount; +} + +void ResetBank (object oBank) +{ + DestroyObject(oBank); + CreateObject(GetObjectType(oBank),GetResRef(oBank),GetLocation(oBank)); + return; +} + +void ClearVault (object oChest) +{ + int iClearMaxCount = 10; + int iClearCount = 0; + float fMaxDistance = 5.0; + object oPCClear; + float fDistance; + string sUsingPC = GetLocalString(OBJECT_SELF, "PCUsingChest"); + string sCurPC; + + while ( iClearCount < iClearMaxCount ) + { + iClearCount++; + oPCClear = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC, oChest, iClearCount); + if ( GetIsPC(oPCClear) ) + { + sCurPC = GetKey(oPCClear, 1); + if (TestStringAgainstPattern(sUsingPC, sCurPC) == FALSE ) + { + fDistance = GetDistanceBetween(oChest, oPCClear); + if ( fDistance <= fMaxDistance ) + { + AssignCommand(oPCClear, ActionMoveAwayFromObject(oChest, TRUE, 5.0)); + } + } + } + else + { + iClearCount = iClearMaxCount; + } + + + } + return; + +} +//void main () {} diff --git a/nwnds_module/bank_on_close.ncs b/nwnds_module/bank_on_close.ncs new file mode 100644 index 000000000..6940cffbc Binary files /dev/null and b/nwnds_module/bank_on_close.ncs differ diff --git a/nwnds_module/bank_on_close.nss b/nwnds_module/bank_on_close.nss new file mode 100644 index 000000000..715e4e235 --- /dev/null +++ b/nwnds_module/bank_on_close.nss @@ -0,0 +1,245 @@ +//:://///////////////////////////////////////////// +//:: bank_on_close.nss +//:: Bank Vault on Close file +//:: Version 1.9 +//::////////////////////////////////////////////// +/* + 1.0 Orginal Version + 1.1 Fixed problem with multiple opens where items from + First opener where assign to Second, third, etc PC. + OnDisturb checks to see if PC Adding/Removing items + is the orginal Opener. Returns items if not. + 1.2 Made workaround for Blank Template Problem. OnDistrub returns + any items or Containers that have or contain a blank Template + returned by GetResRef() function back to original PC. + Made workaround for Multiple PC problem. Any PC opening Chest + other then original PC will be teleported to the closest waypoint + (WP_BankLobby) and told to wait their turn. :) + 1.3 Fixed Blank Template Bug. Items that are split or bought from + Merchants can now be placed into the Bank Vault. + Fixed problem where item were being listed as unidentified even though + they were list as ID when placed into Bank Vault. + 1.4 Added a Storage Limit variable to limit items per PC that can be stored + into Bank Chest. Currently set to 20. Change the iStorageLimit variable + in the bank_inc.nss file to increase/decrease. + 1.5 Fixed problem where gold was duplicating or dissapearing when adding more + then 50000 gold pieces to the Bank Chest. Changed Bank Chest so that you + don't need a WayPoint to transport any additonal PC's trying to access chest + after the first. + 1.6 Added the ability to switch the Bank Chest(s) to be either Module wide Chests + (the same items appear no matter what Area you are in the Module), or Local + Chests (Items are stored in a Area can only be retrieved in that Area). These + options are controled by the "BankModule" variable in the Bank_inc.nss file. + Added a switch that will store all PC Bank Vault data into a single database, + (default "BankVault"), or create a seperate database for each Players's PC. + This should help in Persistent Worlds with cleaningup character data. + This is controlled with the "iSingleCamp" variable in the Bank_inc.nss file. + 1.7 Added ablility to store unique objects that are not in the Module Pallette (aka no ResRef). + PC's can now store items from other modules into the BankVault. Added a + Anti-spam fixed to prevent users from duplicating items in BankVault. + 1.8 Added Hash code for Database tag names to break 32 character barrier in both Bank Vault + and Personal Vault. NOTE: This makes version 1.8 uncompatible with any previous versions + of Bank Vault. NEW: Personal Storage Vaults with Access Control. You can now + assign a Vault to a indiviual owner. This owner can specify his own set of friends + that can access his/her Vault all in game and real time. See instructions. + 1.9 Added the ability to switch the Bank Chest(s) to either have a seperate Vault + for each Player's PC or to have a single Vault Space shared by every PC a Player + creates. This is controlled with the "iPCGlobal" variable in the Bank_inc.nss file. + Added the ability for the user to identify the Player by either his/her Player Name + or by his/her Public CD Key. This is controlled with the "iCDKey" variable in the + Bank_inc.nss file. This ability is only valid if you are using a single Vault Space. + Fixed a duping exploit. +*/ +//::////////////////////////////////////////////// +//:: Created By: Clayten Gillis (a.k.a DragonsWake) +//:: Created On: December 17, 2002 +//::////////////////////////////////////////////// +#include "bank_inc" + +void main() +{ + int iNumInv = 0; + int iConCount = 0; + int I = 0; + float fTime = 0.0; + string sBPName; + object oPC = GetLastClosedBy(); + string PCKey = GetKey(oPC, 1); + + string sBPRef; + int iStackAmt = 0; + + if ( ! iSingleCamp ) + { + sDataName = PCKey; + } + else + { + sDataName = sCampName; + } + + if (! BankModule ) + { + sBankKey = GetKey(OBJECT_SELF, 0); + } + else + { + sBankKey = ""; + } + if ( iPCGlobal ) + { + sBankKey = sBankKey + GetKey(oPC, 0); + } + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + string UsingPC = GetLocalString(OBJECT_SELF, "PCUsingChest"); + iCurUse = GetTimeMillisecond(); + iLastUse = GetLocalInt(OBJECT_SELF, sEventTime); + SetLocalInt(OBJECT_SELF, sEventTime, iCurUse); + if ( (iCurUse == iLastUse)) + { + ResetBank(OBJECT_SELF); + return; + } + if ( TestStringAgainstPattern(UsingPC, PCKey) == FALSE ) + { + return; + } + + // Remove any other PC's that have opened chest except for the first PC so we can close + //ClearVault(OBJECT_SELF); + + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "On CLOSE ROUTINE"); + SendMessageToPC(oPC, sBankKey); + } + + oCurInvObj = GetFirstItemInInventory(OBJECT_SELF); + + while ( GetIsObjectValid(oCurInvObj) == TRUE || GetResRef(oCurInvObj) == "nw_it_gold001") //Begin Processing Item in Inventory + { + + iNumInv = iNumInv + 1; + + sBPName = GetResRef(oCurInvObj); + if ( sBPName == "" ) + { + //sBPName = GetTag(oCurInvObj); + //if ( sBPName == "") + //{ + iUnique = 1; + sBPName = "UNIQUE"; + //} + //else + //{ + // iUnique = 0; + // } + } + else + { + iUnique = 0; + } + if ( sBPName == "nw_it_gold001") + { + iNumInv = EncodeGold(oPC, oCurInvObj, iNumInv, sBPName, sDataName, sBankKey); + + } + else + { + //Debug + if (Debug) + { + SendMessageToPC(oPC, "----------"); + SendMessageToPC(oPC, "StackNum: "+IntToString(GetNumStackedItems(oCurInvObj))); + SendMessageToPC(oPC, "----------"); + } + + if (GetHasInventory(oCurInvObj) == TRUE ) + { + iConCount = EncodeContainer(oPC, oCurInvObj, iNumInv, sBPName, sDataName, sBankKey, iUnique); + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "iNumInv: "+IntToString(iNumInv)); + SendMessageToPC(oPC, "iConCount: "+IntToString(iConCount)); + } + + while ( iNumInv < (iConCount - iHeaderCount) ) + { + //Debug + if (Debug) + { + SendMessageToPC(oPC, "iNumInv: "+IntToString(iNumInv)); + } + + oCurInvObj = GetNextItemInInventory(OBJECT_SELF); + iNumInv = iNumInv + 1; + } + iNumInv = iConCount; + } + else + { + if (GetNumStackedItems(oCurInvObj) > 1) + { + iNumInv = EncodeStackItem( oPC, oCurInvObj, iNumInv, sDataName, sBankKey, iUnique); + } + else + { + if (sBPName != "chestdaemon") + { + EncodeItem(oPC, oCurInvObj, iNumInv, sBPName, sDataName, sBankKey, iUnique); + } + } + } + } + + + oCurInvObj = GetNextItemInInventory(OBJECT_SELF); + + + } + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "BankCount: "+IntToString(iNumInv) ); + } + + SetCampaignInt(sDataName, IntToString(HashID("BankCount" + sBankKey)), iNumInv, oItemID); + + //AssignCommand(oPC, ActionMoveAwayFromObject(OBJECT_SELF, FALSE, 5.0)); + // Clean UP Items in Bank Chest + + oCurInvObj = GetFirstItemInInventory(OBJECT_SELF); + + while ( GetIsObjectValid(oCurInvObj) == TRUE ) //Begin Processing Item in Inventory + { + DestroyObject(oCurInvObj, fTime); + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Item Destroyed" ); + } + + oCurInvObj = GetNextItemInInventory(OBJECT_SELF); + } + + SetLocalInt(OBJECT_SELF, "ChestNotOpen", 1); + //SetLocked(OBJECT_SELF, FALSE); + + //iBankChestNotOpen = 1; + //sPCUsingChest = ""; + +} diff --git a/nwnds_module/bank_on_dist.ncs b/nwnds_module/bank_on_dist.ncs new file mode 100644 index 000000000..04801f957 Binary files /dev/null and b/nwnds_module/bank_on_dist.ncs differ diff --git a/nwnds_module/bank_on_dist.nss b/nwnds_module/bank_on_dist.nss new file mode 100644 index 000000000..f99c7fc24 --- /dev/null +++ b/nwnds_module/bank_on_dist.nss @@ -0,0 +1,159 @@ +//:://///////////////////////////////////////////// +//:: bank_on_dist.nss +//:: Bank Vault on Disturb Inventory file +//:: Version 1.9 +//::////////////////////////////////////////////// +/* + 1.0 Orginal Version + 1.1 Fixed problem with multiple opens where items from + First opener where assign to Second, third, etc PC. + OnDisturb checks to see if PC Adding/Removing items + is the orginal Opener. Returns items if not. + 1.2 Made workaround for Blank Template Problem. OnDistrub returns + any items or Containers that have or contain a blank Template + returned by GetResRef() function back to original PC. + Made workaround for Multiple PC problem. Any PC opening Chest + other then original PC will be teleported to the closest waypoint + (WP_BankLobby) and told to wait their turn. :) + 1.3 Fixed Blank Template Bug. Items that are split or bought from + Merchants can now be placed into the Bank Vault. + Fixed problem where items were being listed as unidentified even though + they were list as ID when placed into Bank Vault. + 1.4 Added a Storage Limit variable to limit items per PC that can be stored + into Bank Chest. Currently set to 20. Change the iStorageLimit variable + in the bank_inc.nss file to increase/decrease. + 1.5 Fixed problem where gold was duplicating or dissapearing when adding more + then 50000 gold pieces to the Bank Chest. Changed Bank Chest so that you + don't need a WayPoint to transport any additonal PC's trying to access chest + after the first. + 1.6 Added the ability to switch the Bank Chest(s) to be either Module wide Chests + (the same items appear no matter what Area you are in the Module), or Local + Chests (Items are stored in a Area can only be retrieved in that Area). These + options are controled by the "BankModule" variable in the Bank_inc.nss file. + Added a switch that will store all PC Bank Vault data into a single database, + (default "BankVault"), or create a seperate database for each Players's PC. + This should help in Persistent Worlds with cleaningup character data. + This is controlled with the "iSingleCamp" variable in the Bank_inc.nss file. + 1.7 Added ablility to store unique objects that are not in the Module Pallette (aka no ResRef). + PC's can now store items from other modules into the BankVault. Added a + Anti-spam fixed to prevent users from duplicating items in BankVault. + 1.8 Added Hash code for Database tag names to break 32 character barrier in both Bank Vault + and Personal Vault. NOTE: This makes version 1.8 uncompatible with any previous versions + of Bank Vault. NEW: Personal Storage Vaults with Access Control. You can now + assign a Vault to a indiviual owner. This owner can specify his own set of friends + that can access his/her Vault all in game and real time. See instructions. + 1.9 Added the ability to switch the Bank Chest(s) to either have a seperate Vault + for each Player's PC or to have a single Vault Space shared by every PC a Player + creates. This is controlled with the "iPCGlobal" variable in the Bank_inc.nss file. + Added the ability for the user to identify the Player by either his/her Player Name + or by his/her Public CD Key. This is controlled with the "iCDKey" variable in the + Bank_inc.nss file. This ability is only valid if you are using a single Vault Space. + Fixed a duping exploit. +*/ +//::////////////////////////////////////////////// +//:: Created By: Clayten Gillis (a.k.a DragonsWake) +//:: Created On: December 21, 2002 +//::////////////////////////////////////////////// +#include "bank_inc" + +void main() +{ + + object oPC = GetLastDisturbed(); + object oItem = GetInventoryDisturbItem(); + string sPCKey = GetKey(oPC, 1); + string sBankKey = GetKey(OBJECT_SELF, 0); + string sUsingPC = GetLocalString(OBJECT_SELF, "PCUsingChest"); + int iDisturbType = 0; + string sBPName = GetResRef(oItem); + int iCount = 0; + object oSpawn; + + iDisturbType = GetInventoryDisturbType(); + + // This is now possible, so for the case. + if ( TestStringAgainstPattern(sUsingPC, sPCKey) == FALSE ) + { + //iDisturbType = GetInventoryDisturbType(); + if (iDisturbType == INVENTORY_DISTURB_TYPE_ADDED) + { + SendMessageToPC(oPC, "Someone is using this Chest. Please Wait."); + AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)); + } + if (iDisturbType == INVENTORY_DISTURB_TYPE_REMOVED) + { + SendMessageToPC(oPC, "Someone is using this Chest. You cannot take there items"); + AssignCommand(OBJECT_SELF, ActionTakeItem(oItem, oPC)); + } + return; + } + + + + + if (iDisturbType == INVENTORY_DISTURB_TYPE_REMOVED) + { + + sBPName = GetTag(oItem); + if ( sBPName == "StorageChestKey" ) + { + SendMessageToPC(oPC, "Spawning Chest Daemon"); + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ChestDaemon", GetLocation(OBJECT_SELF), TRUE); + } + + + } + if (iDisturbType == INVENTORY_DISTURB_TYPE_ADDED) + { + sBPName = GetTag(oItem); + if ( sBPName == "StorageChestKey" ) + { + SendMessageToPC(oPC, "Removing Chest Daemon"); + oSpawn = GetNearestObjectByTag("ChestDaemon", OBJECT_SELF, 1); + DestroyObject(oSpawn); + } + } + + if (iDisturbType == INVENTORY_DISTURB_TYPE_ADDED) + { + oCurInvObj = GetFirstItemInInventory(OBJECT_SELF); + while ( GetIsObjectValid(oCurInvObj) == TRUE || GetResRef(oCurInvObj) == "nw_it_gold001") //Begin Processing Item in Inventory + { + iCount = iCount + 1; + oCurInvObj = GetNextItemInInventory(OBJECT_SELF); + } + if ( iCount > iStorageLimit) + { + SendMessageToPC(oPC, "You have reached your Storage Limit."); + AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)); + } + } + + + + + // This shouldn't be possible but just in case. + if (iDisturbType == INVENTORY_DISTURB_TYPE_ADDED) + { + if (GetHasInventory(oItem) == TRUE) + { + oCurInvObj = GetFirstItemInInventory(oItem); + + while ( GetIsObjectValid(oCurInvObj) == TRUE || GetResRef(oCurInvObj) == "nw_it_gold001") //Begin Processing Item in Inventory + { + if ( GetHasInventory(oCurInvObj) == TRUE) + { + SendMessageToPC(oPC, "This Container has another Container within, please remove it."); + AssignCommand(OBJECT_SELF, ActionGiveItem(oCurInvObj, oPC)); + break; + } + + + oCurInvObj = GetNextItemInInventory(oItem); + } + + } + + } + +} diff --git a/nwnds_module/bank_on_open.ncs b/nwnds_module/bank_on_open.ncs new file mode 100644 index 000000000..a982318bb Binary files /dev/null and b/nwnds_module/bank_on_open.ncs differ diff --git a/nwnds_module/bank_on_open.nss b/nwnds_module/bank_on_open.nss new file mode 100644 index 000000000..d50f49cf0 --- /dev/null +++ b/nwnds_module/bank_on_open.nss @@ -0,0 +1,236 @@ +//:://///////////////////////////////////////////// +//:: bank_on_open.nss +//:: Bank Vault on Open file +//:: Version 1.9 +//::////////////////////////////////////////////// +/* + 1.0 Orginal Version + 1.1 Fixed problem with multiple opens where items from + First opener where assign to Second, third, etc PC. + OnDisturb checks to see if PC Adding/Removing items + is the orginal Opener. Returns items if not. + 1.2 Made workaround for Blank Template Problem. OnDistrub returns + any items or Containers that have or contain a blank Template + returned by GetResRef() function back to original PC. + Made workaround for Multiple PC problem. Any PC opening Chest + other then original PC will be teleported to the closest waypoint + (WP_BankLobby) and told to wait their turn. :) + 1.3 Fixed Blank Template Bug. Items that are split or bought from + Merchants can now be placed into the Bank Vault. + Fixed problem where item were being listed as unidentified even though + they were list as ID when placed into Bank Vault. + 1.4 Added a Storage Limit variable to limit items per PC that can be stored + into Bank Chest. Currently set to 20. Change the iStorageLimit variable + in the bank_inc.nss file to increase/decrease. + 1.5 Fixed problem where gold was duplicating or dissapearing when adding more + then 50000 gold pieces to the Bank Chest. Changed Bank Chest so that you + don't need a WayPoint to transport any additonal PC's trying to access chest + after the first. + 1.6 Added the ability to switch the Bank Chest(s) to be either Module wide Chests + (the same items appear no matter what Area you are in the Module), or Local + Chests (Items are stored in a Area can only be retrieved in that Area). These + options are controled by the "BankModule" variable in the Bank_inc.nss file. + Added a switch that will store all PC Bank Vault data into a single database, + (default "BankVault"), or create a seperate database for each Players's PC. + This should help in Persistent Worlds with cleaningup character data. + This is controlled with the "iSingleCamp" variable in the Bank_inc.nss file. + 1.7 Added ablility to store unique objects that are not in the Module Pallette (aka no ResRef). + PC's can now store items from other modules into the BankVault. Added a + Anti-spam fixed to prevent users from duplicating items in BankVault. + 1.8 Added Hash code for Database tag names to break 32 character barrier in both Bank Vault + and Personal Vault. NOTE: This makes version 1.8 uncompatible with any previous versions + of Bank Vault. NEW: Personal Storage Vaults with Access Control. You can now + assign a Vault to a indiviual owner. This owner can specify his own set of friends + that can access his/her Vault all in game and real time. See instructions. + 1.9 Added the ability to switch the Bank Chest(s) to either have a seperate Vault + for each Player's PC or to have a single Vault Space shared by every PC a Player + creates. This is controlled with the "iPCGlobal" variable in the Bank_inc.nss file. + Added the ability for the user to identify the Player by either his/her Player Name + or by his/her Public CD Key. This is controlled with the "iCDKey" variable in the + Bank_inc.nss file. This ability is only valid if you are using a single Vault Space. + Fixed a duping exploit. +*/ +//::////////////////////////////////////////////// +//:: Created By: Clayten Gillis (a.k.a. DragonsWake) +//:: Created On: December 17, 2002 +//::////////////////////////////////////////////// +#include "bank_inc" + +void main() +{ + int iInvCount = 0; + + string sBPRef; + int iID; + + int I = 0; + object oPC = GetLastOpenedBy(); // Get Last Opened by PC + string sPCName = GetKey(oPC, 1); + iCurUse = GetTimeMillisecond(); + iLastUse = GetLocalInt(OBJECT_SELF, sEventTime); + SetLocalInt(OBJECT_SELF, sEventTime, iCurUse); + + if ( ! iSingleCamp ) + { + sDataName = sPCName; + } + else + { + sDataName = sCampName; + } + if ( ! BankModule ) + { + sBankKey = GetKey(OBJECT_SELF, 0); + } + else + { + sBankKey = ""; + } + if ( iPCGlobal == 1 ) + { + sBankKey = sBankKey + GetKey(oPC, 0); + } + + if ( iPCGlobal ) + { + oItemID = OBJECT_SELF; + } + else + { + oItemID = oPC; + + } + + if ( (iCurUse == iLastUse) ) + { + ResetBank(OBJECT_SELF); + return; + } + + iBankFirstTime = GetLocalInt(OBJECT_SELF, sBankFirst); + SendMessageToPC(oPC, "FirstTime1: "+IntToString(iBankFirstTime)); + if ( iBankFirstTime == FALSE ) + { + //SetCampaignInt(sCampName, IntToString(HashID("ChestNotOpen"+sBankKey)), 1, OBJECT_SELF); + SetLocalInt(OBJECT_SELF, "ChestNotOpen", 1); + //SetLocked(OBJECT_SELF, FALSE); + SetLocalInt(OBJECT_SELF, sBankFirst, 1); + } + SendMessageToPC(oPC, "FirstTime2: "+IntToString(iBankFirstTime)); + + + //int iChestNotOpen = GetCampaignInt(sCampName, IntToString(HashID("ChestNotOpen"+sBankKey)), OBJECT_SELF); + int iChestNotOpen = GetLocalInt(OBJECT_SELF, "ChestNotOpen"); + SendMessageToPC(oPC, "ChestNotOpen: "+IntToString(iChestNotOpen)); + if ( iChestNotOpen == FALSE ) + { + object oPC = GetLastOpenedBy(); // Get Last Opened by PC + AssignCommand(oPC, ActionMoveAwayFromObject(OBJECT_SELF, FALSE, 5.0)); + //object oTransport = GetNearestObject(OBJECT_TYPE_WAYPOINT, OBJECT_SELF, 1); + //location lLoc = GetLocation(oTransport); + //AssignCommand(oPC,JumpToLocation(lLoc)); + SendMessageToPC(oPC, "This Bank Vault is in use. Please wait your turn."); + return; + } + + + //SetCampaignInt(sCampName, IntToString(HashID("ChestNotOpen"+sBankKey)), 0, OBJECT_SELF); + SetLocalInt(OBJECT_SELF, "ChestNotOpen", 0); + //SetLocked(OBJECT_SELF, TRUE); + //SetCampaignString(sCampName, IntToString(HashID("PCUsingChest"+sBankKey)), sPCName, OBJECT_SELF); + SetLocalString(OBJECT_SELF, "PCUsingChest", sPCName); + + //iBankChestNotOpen = 0; + //sPCUsingChest = GetKey(oPC); + + + + int iBankCount = GetCampaignInt(sDataName, IntToString(HashID("BankCount" + sBankKey)), oItemID); + + //Debug + if (Debug) + { + SendMessageToPC(oPC, "On OPEN ROUTINE"); + SendMessageToPC(oPC, "BankCount: "+ IntToString(iBankCount) ); + SendMessageToPC(oPC, "BankKey: "+sBankKey); + } + + //Warning Message + //SendMessageToPC(oPC,"WARNING!: Do NOT press the 'I' Key while this Chest is open."); + + if ( iBankCount != 0) + { + while ( I != iBankCount) + { + I++; + + + + sBPRef = GetCampaignString(sDataName, IntToString(HashID(sBankBP + IntToString(I)+ sBankKey)), oItemID ); + //Debug + if (Debug) + { + SendMessageToPC(oPC, "Item#: "+IntToString(I) ); + SendMessageToPC(oPC, "ResRef: "+sBPRef); + } + + + if ( sBPRef != "nw_it_gold001" ) + { + if (sBPRef == "CONTAIN") + { + I = DecodeContainer(oPC, OBJECT_SELF, sBPRef, I, sDataName, sBankKey, 0); + + } + else + { + if (sBPRef == "CONTAINUNQ") + { + I = DecodeContainer(oPC, OBJECT_SELF, sBPRef, I, sDataName, sBankKey, 1); + + } + else + { + if ( sBPRef == "STACK") + { + I = DecodeStackItem(oPC, OBJECT_SELF, I, sBPRef, sDataName, sBankKey, 0); + } + else + { + if ( sBPRef == "STACKUNQ") + { + I = DecodeStackItem(oPC, OBJECT_SELF, I, sBPRef, sDataName, sBankKey, 1); + } + else + { + if ( sBPRef == "UNIQUE") + { + oCurInvObj = DecodeItem(oPC, OBJECT_SELF, I, sBPRef, sDataName, sBankKey, 1); + } + else + { + oCurInvObj = DecodeItem(oPC, OBJECT_SELF, I, sBPRef, sDataName, sBankKey, 0); + } + } + } + } + } + + + } + else + { + + DecodeGold(oPC, OBJECT_SELF, I, sBPRef, sDataName, sBankKey); + // DeletePersistentInt(oPC, sBankGold ); + + + } + + // DeletePersistentString(oPC, sBankBP + IntToString(I) ); + + } + + } + +} diff --git a/nwnds_module/bank_on_used.ncs b/nwnds_module/bank_on_used.ncs new file mode 100644 index 000000000..03ab53fc3 Binary files /dev/null and b/nwnds_module/bank_on_used.ncs differ diff --git a/nwnds_module/bank_on_used.nss b/nwnds_module/bank_on_used.nss new file mode 100644 index 000000000..339c87209 --- /dev/null +++ b/nwnds_module/bank_on_used.nss @@ -0,0 +1,19 @@ +#include "bank_inc" +void main() +{ + object oLastPC = GetLastUsedBy(); + if (GetIsPC(oLastPC)) + { + string sUsingPC = GetLocalString(OBJECT_SELF, "PCUsingChest"); + string sCurPC = GetKey(oLastPC, 1); + if (TestStringAgainstPattern(sUsingPC, sCurPC) == FALSE ) + { + + if ( sUsingPC != "" ) + { + AssignCommand(oLastPC, ActionMoveAwayFromObject(OBJECT_SELF, TRUE, 5.0)); + SendMessageToPC(oLastPC, "This Bank Vault is in use. Please wait your turn."); + } + } + } +} diff --git a/nwnds_module/barbscorpclaw.uti b/nwnds_module/barbscorpclaw.uti new file mode 100644 index 000000000..d56901b4a Binary files /dev/null and b/nwnds_module/barbscorpclaw.uti differ diff --git a/nwnds_module/barbscorpion_001.utc b/nwnds_module/barbscorpion_001.utc new file mode 100644 index 000000000..3e3023528 Binary files /dev/null and b/nwnds_module/barbscorpion_001.utc differ diff --git a/nwnds_module/barbscorpstinger.uti b/nwnds_module/barbscorpstinger.uti new file mode 100644 index 000000000..c797a01c9 Binary files /dev/null and b/nwnds_module/barbscorpstinger.uti differ diff --git a/nwnds_module/barunus.utc b/nwnds_module/barunus.utc new file mode 100644 index 000000000..4e29df8d6 Binary files /dev/null and b/nwnds_module/barunus.utc differ diff --git a/nwnds_module/barunustunic001.uti b/nwnds_module/barunustunic001.uti new file mode 100644 index 000000000..6d64670e4 Binary files /dev/null and b/nwnds_module/barunustunic001.uti differ diff --git a/nwnds_module/bbs_board_bp.utp b/nwnds_module/bbs_board_bp.utp new file mode 100644 index 000000000..782970943 Binary files /dev/null and b/nwnds_module/bbs_board_bp.utp differ diff --git a/nwnds_module/bbs_can_delete.ncs b/nwnds_module/bbs_can_delete.ncs new file mode 100644 index 000000000..2e5e49277 Binary files /dev/null and b/nwnds_module/bbs_can_delete.ncs differ diff --git a/nwnds_module/bbs_can_delete.nss b/nwnds_module/bbs_can_delete.nss new file mode 100644 index 000000000..4076d8d75 --- /dev/null +++ b/nwnds_module/bbs_can_delete.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ +string sAuthor = GetLocalString(GetPCSpeaker(), "PostAuthor"); +string sName = GetName(GetPCSpeaker()) + " (" + GetPCPlayerName(GetPCSpeaker()) + ")"; +if(sName == sAuthor) + return TRUE; +else + return FALSE; +} diff --git a/nwnds_module/bbs_clothing_bp.uti b/nwnds_module/bbs_clothing_bp.uti new file mode 100644 index 000000000..19f91d163 Binary files /dev/null and b/nwnds_module/bbs_clothing_bp.uti differ diff --git a/nwnds_module/bbs_create_table.ncs b/nwnds_module/bbs_create_table.ncs new file mode 100644 index 000000000..226d8108c Binary files /dev/null and b/nwnds_module/bbs_create_table.ncs differ diff --git a/nwnds_module/bbs_create_table.nss b/nwnds_module/bbs_create_table.nss new file mode 100644 index 000000000..828479b3b --- /dev/null +++ b/nwnds_module/bbs_create_table.nss @@ -0,0 +1,24 @@ +#include "aps_include" + +void main() +{ +SQLExecDirect("DROP TABLE bbs"); +SQLExecDirect("DROP TABLE bbs_stats"); +SQLExecDirect("CREATE TABLE bbs (" + + "Tag varchar(64) NOT NULL default '',"+ + "ID tinyint(4) NOT NULL default '0',"+ + "Poster varchar(64) NOT NULL default '',"+ + "Date varchar(64) NOT NULL default '',"+ + "Title varchar(64) NOT NULL default '',"+ + "Message text,"+ + "PRIMARY KEY (Tag,ID)) TYPE=MyISAM;"); + + +SQLExecDirect("CREATE TABLE bbs_stats (" + + "Tag varchar(64) NOT NULL default '',"+ + "Total smallint(3) NOT NULL default '0'," + + "Latest smallint(3) NOT NULL default '0'," + + "Lowest smallint(3) NOT NULL default '0'," + + "PRIMARY KEY (Tag)) TYPE=MyISAM;"); + +} diff --git a/nwnds_module/bbs_delete_post.ncs b/nwnds_module/bbs_delete_post.ncs new file mode 100644 index 000000000..a9a99b657 Binary files /dev/null and b/nwnds_module/bbs_delete_post.ncs differ diff --git a/nwnds_module/bbs_delete_post.nss b/nwnds_module/bbs_delete_post.nss new file mode 100644 index 000000000..5efb335f6 --- /dev/null +++ b/nwnds_module/bbs_delete_post.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ +bbs_delete_entry(); +} diff --git a/nwnds_module/bbs_have_notice.ncs b/nwnds_module/bbs_have_notice.ncs new file mode 100644 index 000000000..bba3cbbf9 Binary files /dev/null and b/nwnds_module/bbs_have_notice.ncs differ diff --git a/nwnds_module/bbs_have_notice.nss b/nwnds_module/bbs_have_notice.nss new file mode 100644 index 000000000..436249cd3 --- /dev/null +++ b/nwnds_module/bbs_have_notice.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + if (GetItemPossessedBy(GetPCSpeaker(), "bbs_notice") != OBJECT_INVALID) { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/bbs_include.ncs b/nwnds_module/bbs_include.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/bbs_include.ncs differ diff --git a/nwnds_module/bbs_include.nss b/nwnds_module/bbs_include.nss new file mode 100644 index 000000000..39c23c13e --- /dev/null +++ b/nwnds_module/bbs_include.nss @@ -0,0 +1,250 @@ +//void main(){} +//BULLETIN BOARD SYSTEM VERSION 1.1 + +//This is an include file. Upon building your module you will get +//a compile error in this file. That is normal and does not +//affect the operation of the bulletin board. +#include "aps_include" + +void bbs_do_board_stats(); +void bbs_initiate(object oBBS); +int bbs_can_show(int WhichEntry); +void bbs_change_page(int PageChange); +void bbs_select_entry(int WhichEntry); +void bbs_add_notice(object oBBS, string sPoster, string sTitle, string sMessage, string sDate, string sBBStag = ""); +int bbs_drop_lowest(string sBBStag, int LowestItem); + +//Loads into tokens the stats for a board +void bbs_do_board_stats() { + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + int PageSize = GetLocalInt(oBBS, "PageSize"); + int TotalItems = 0; + string sSQL = "SELECT * FROM bbs_stats WHERE Tag='"+SQLEncodeSpecialChars(GetTag(oBBS))+"'"; + SQLExecDirect(sSQL); + if(SQLFirstRow()==SQL_SUCCESS) + TotalItems = StringToInt(SQLGetData(2)); + int PageIndex = GetLocalInt(GetPCSpeaker(), "PageIndex") + 1; + SetCustomToken(3671, IntToString(TotalItems)); + if (TotalItems == 0) {PageIndex = 0;} + SetCustomToken(3672, IntToString(PageIndex)); + SetCustomToken(3673, IntToString((TotalItems + PageSize - 1) / PageSize)); +} + +//Initiates a bulletin board's settings if neccessary +void bbs_initiate(object oBBS) { + string sBBS = "BBS_" + GetTag(oBBS); + object myBBS = GetLocalObject(GetModule(), sBBS); + if (!GetIsObjectValid(myBBS)) { + SetLocalObject(GetModule(), sBBS, oBBS); + myBBS = oBBS; + //MaxItems is the maximum number of messages + SetLocalInt(myBBS, "MaxItems", 50); + //PageSize is the number of entries per page, between 1 and 10 + SetLocalInt(myBBS, "PageSize", 5); + } +} + +//Determines whether a dialogue option is visible in conversation +int bbs_can_show(int WhichEntry) { + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + int PageSize = GetLocalInt(oBBS, "PageSize"); + int nSpot = GetLocalInt(GetPCSpeaker(), "PageIndex") * PageSize + WhichEntry; + int TotalItems = 0; + if(WhichEntry>PageSize) + return FALSE; + string sSQL = "SELECT * FROM bbs_stats WHERE Tag='"+SQLEncodeSpecialChars(GetTag(oBBS))+"'"; + SQLExecDirect(sSQL); + if(SQLFirstRow()==SQL_SUCCESS) + TotalItems = StringToInt(SQLGetData(2)); + if(nSpot <= TotalItems && WhichEntry <= PageSize) {return TRUE;} + return FALSE; +} + +//Moves the page by the required PageFlip: +//0 to reload page, -1 for previous page, 1 for next page +void bbs_change_page(int PageFlip) { + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + int PageSize = GetLocalInt(oBBS, "PageSize"); + int MaxItems = GetLocalInt(oBBS, "MaxItems"); + int TotalItems,LatestItem,LowestItem; + string sBBStag = SQLEncodeSpecialChars(GetTag(oBBS)); + string sSQL = "SELECT * FROM bbs_stats WHERE Tag='"+sBBStag+"'"; + SQLExecDirect(sSQL); + if(SQLFetch()){ + TotalItems = StringToInt(SQLGetData(2)); + LatestItem = StringToInt(SQLGetData(3)); + LowestItem = StringToInt(SQLGetData(4)); + } + int PageIndex = GetLocalInt(GetPCSpeaker(), "PageIndex") + 1 * PageFlip; + if (PageIndex < 0) {PageIndex = 0;} + SetLocalInt(GetPCSpeaker(), "PageIndex", PageIndex); + SetLocalString(GetPCSpeaker(),"PostAuthor",""); + int i; + for(i = 3680; i<=3700;i++) + SetCustomToken(i,""); + string sInfo; + int Page = PageIndex*PageSize; + int iOffset = 0; + int iLimitStart = PageIndex*PageSize; + int iLimitEnd = ((PageIndex+1)*PageSize); + sSQL = "SELECT * FROM bbs WHERE Tag='"+sBBStag+"' ORDER BY ID DESC LIMIT "+IntToString(iLimitStart)+","+IntToString(iLimitEnd); + SQLExecDirect(sSQL); + while(SQLFetch()!=SQL_ERROR){ + sInfo = SQLDecodeSpecialChars(SQLGetData(5)); + SetCustomToken((3680 + iOffset), sInfo); + sInfo = SQLDecodeSpecialChars(SQLGetData(3)); + SetCustomToken((3690 + iOffset), sInfo); + iOffset++; + } + SetCustomToken((3690 + (iOffset-1)),(sInfo+"\n\n")); + bbs_do_board_stats(); + SetCustomToken(3674, ""); + SetCustomToken(3675, ""); + SetCustomToken(3676, ""); + SetCustomToken(3677, ""); + SetCustomToken(3678, ""); +} + +//Displays the selected post +void bbs_select_entry(int WhichEntry) { + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + string sBBStag = SQLEncodeSpecialChars(GetTag(oBBS)); + int PageSize = GetLocalInt(oBBS, "PageSize"); + int MaxItems = GetLocalInt(oBBS, "MaxItems"); + int LatestItem = 0; + string sSQL = "SELECT * FROM bbs_stats WHERE Tag='"+sBBStag+"'"; + SQLExecDirect(sSQL); + if(SQLFirstRow()==SQL_SUCCESS) + LatestItem = StringToInt(SQLGetData(3)); + int PageIndex = GetLocalInt(GetPCSpeaker(), "PageIndex"); + string sPoster,sTitle,sDate,sMessage,sID; + int iLimit = PageIndex * PageSize + WhichEntry; + int iOffset = 1; + sSQL = "SELECT * FROM bbs WHERE Tag='"+sBBStag+"' ORDER BY ID DESC LIMIT "+IntToString(iLimit); + SQLExecDirect(sSQL); + while(SQLFetch()!=SQL_ERROR){ + if(iOffset == iLimit){ + sID = SQLGetData(2); + sPoster = SQLDecodeSpecialChars(SQLGetData(3)); + sDate = SQLDecodeSpecialChars(SQLGetData(4)); + sTitle = SQLDecodeSpecialChars(SQLGetData(5)); + sMessage = SQLDecodeSpecialChars(SQLGetData(6)); + } + iOffset++; + } + SetLocalString(GetPCSpeaker(),"PostAuthor",sPoster); + SetLocalInt(GetPCSpeaker(),"CurrentEntry",StringToInt(sID)); + bbs_do_board_stats(); + SetCustomToken(3674, "\n\n"+sTitle+"\nBy: "); + SetCustomToken(3675, sPoster); + SetCustomToken(3676, " On: "); + SetCustomToken(3677, sDate); + SetCustomToken(3678, "\n"+sMessage); +} + +//Adds a post to the bulletin board. This can be called at any time +//so you can insert your own notices. If you don't specify a sDate, +//it will use the current game time. The proper format for sDate is +//something like "6/30/1373 11:58". +void bbs_add_notice(object oBBS, string sPoster, string sTitle, string sMessage, string sDate, string sBBStag = "") +{ + if (sBBStag != "") {oBBS = GetObjectByTag(sBBStag);} + bbs_initiate(oBBS); + oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(oBBS)); + sBBStag = SQLEncodeSpecialChars(GetTag(oBBS)); + if (sDate == "") { + sDate = IntToString(GetTimeMinute()); + if (GetStringLength(sDate) == 1) {sDate = "0" + sDate;} + sDate = IntToString(GetCalendarMonth()) + "/" + IntToString(GetCalendarDay()) + "/" + IntToString(GetCalendarYear()) + " " + IntToString(GetTimeHour()) + ":" + sDate; + } + int MaxItems = GetLocalInt(oBBS,"MaxItems"); + int TotalItems,LatestItem,LowestItem; + sBBStag = SQLEncodeSpecialChars(sBBStag); + sPoster = SQLEncodeSpecialChars(sPoster); + sTitle = SQLEncodeSpecialChars(sTitle); + sDate = SQLEncodeSpecialChars(sDate); + sMessage = SQLEncodeSpecialChars(sMessage); + string sSQL; + sSQL = "SELECT * FROM bbs_stats WHERE Tag='" + sBBStag + "'"; + SQLExecDirect(sSQL); + if(SQLFetch()==SQL_SUCCESS){ + TotalItems = (StringToInt(SQLGetData(2))+1); + LatestItem = (StringToInt(SQLGetData(3))+1); + LowestItem = StringToInt(SQLGetData(4)); + if(TotalItems>MaxItems){ + LowestItem = bbs_drop_lowest(sBBStag,LowestItem); + TotalItems--; + } + //Update the Board Stats row + sSQL = "UPDATE bbs_stats SET Total="+IntToString(TotalItems)+", Latest="+IntToString(LatestItem)+", Lowest="+IntToString(LowestItem)+" WHERE Tag='" +sBBStag+"'"; + SQLExecDirect(sSQL); + } + else { + TotalItems = 1; + LatestItem = 1; + LowestItem = 1; + if(LowestItem == 0){LowestItem=LatestItem;} + //Create the Boards Stats row + sSQL = "INSERT INTO bbs_stats (Tag,Total,Latest,Lowest) VALUES ('"+sBBStag+"',"+IntToString(TotalItems)+","+IntToString(LatestItem)+","+IntToString(LowestItem)+")"; + SQLExecDirect(sSQL); + } + sSQL = "INSERT INTO bbs (Tag,ID,Poster,Date,Title,Message) VALUES "+ + "('"+sBBStag+"',"+IntToString(LatestItem)+",'"+sPoster+ + "','"+sDate+"','"+sTitle+"','"+sMessage+"')"; + SQLExecDirect(sSQL); + +} + +int bbs_drop_lowest(string sBBStag,int LowestItem) +{ +string sSQL; +int Lowest; +sSQL = "DELETE FROM bbs WHERE Tag='"+sBBStag+"' AND ID="+IntToString(LowestItem); +SQLExecDirect(sSQL); +sSQL = "SELECT * FROM bbs WHERE Tag='"+sBBStag+"' ORDER BY ID LIMIT 1"; +SQLExecDirect(sSQL); +if(SQLFirstRow()==SQL_SUCCESS) + Lowest = StringToInt(SQLGetData(2)); +else + Lowest = 0; +return Lowest; +} + +void bbs_delete_entry() { + int CurrentEntry = GetLocalInt(GetPCSpeaker(), "CurrentEntry"); + object oBBS = GetLocalObject(GetModule(), "BBS_"+GetTag(OBJECT_SELF)); + string sSQL; + string sBBStag = SQLEncodeSpecialChars(GetTag(oBBS)); + int TotalItems = 0; + int LatestItem = 0; + int LowestItem = 0 ; + sSQL = "SELECT * FROM bbs_stats WHERE Tag='" + sBBStag + "'"; + SQLExecDirect(sSQL); + if(SQLFetch()==SQL_SUCCESS){ + TotalItems = StringToInt(SQLGetData(2)); + LatestItem = StringToInt(SQLGetData(3)); + LowestItem = StringToInt(SQLGetData(4)); + } + sSQL = "DELETE FROM bbs WHERE Tag='"+sBBStag+"' AND ID="+IntToString(CurrentEntry); + SQLExecDirect(sSQL); + if(CurrentEntry==LowestItem){ + sSQL = "SELECT * FROM bbs WHERE Tag='"+sBBStag+"' ORDER BY ID LIMIT 1"; + SQLExecDirect(sSQL); + if(SQLFetch()==SQL_SUCCESS) + LowestItem = StringToInt(SQLGetData(2)); + else + LowestItem = 0; + } + if(CurrentEntry==LatestItem){ + sSQL = "SELECT * FROM bbs WHERE Tag='"+sBBStag+"' ORDER BY ID DESC LIMIT 1"; + SQLExecDirect(sSQL); + if(SQLFetch()==SQL_SUCCESS) + LatestItem = StringToInt(SQLGetData(2)); + else + LatestItem = 0; + } + TotalItems--; + sSQL = "UPDATE bbs_stats SET Total="+IntToString(TotalItems)+", Latest="+IntToString(LatestItem)+", Lowest="+IntToString(LowestItem)+" WHERE Tag='"+sBBStag+"'"; + SQLExecDirect(sSQL); + bbs_change_page(TotalItems * -1); +} diff --git a/nwnds_module/bbs_menu.dlg b/nwnds_module/bbs_menu.dlg new file mode 100644 index 000000000..dfc41c9f0 Binary files /dev/null and b/nwnds_module/bbs_menu.dlg differ diff --git a/nwnds_module/bbs_notice_bp.uti b/nwnds_module/bbs_notice_bp.uti new file mode 100644 index 000000000..27b181350 Binary files /dev/null and b/nwnds_module/bbs_notice_bp.uti differ diff --git a/nwnds_module/bbs_page_back.ncs b/nwnds_module/bbs_page_back.ncs new file mode 100644 index 000000000..6916669ba Binary files /dev/null and b/nwnds_module/bbs_page_back.ncs differ diff --git a/nwnds_module/bbs_page_back.nss b/nwnds_module/bbs_page_back.nss new file mode 100644 index 000000000..6486774a8 --- /dev/null +++ b/nwnds_module/bbs_page_back.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +void main() +{ + bbs_change_page(-1); +} diff --git a/nwnds_module/bbs_page_next.ncs b/nwnds_module/bbs_page_next.ncs new file mode 100644 index 000000000..5916ccf26 Binary files /dev/null and b/nwnds_module/bbs_page_next.ncs differ diff --git a/nwnds_module/bbs_page_next.nss b/nwnds_module/bbs_page_next.nss new file mode 100644 index 000000000..ef2c196f5 --- /dev/null +++ b/nwnds_module/bbs_page_next.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +void main() +{ + bbs_change_page(1); +} diff --git a/nwnds_module/bbs_post_notice.ncs b/nwnds_module/bbs_post_notice.ncs new file mode 100644 index 000000000..3dbd8adf9 Binary files /dev/null and b/nwnds_module/bbs_post_notice.ncs differ diff --git a/nwnds_module/bbs_post_notice.nss b/nwnds_module/bbs_post_notice.nss new file mode 100644 index 000000000..6e6089d61 --- /dev/null +++ b/nwnds_module/bbs_post_notice.nss @@ -0,0 +1,14 @@ +#include "bbs_include" +void main() +{ + object oPC = GetPCSpeaker(); + object oNotice = GetItemPossessedBy(oPC, "bbs_notice"); + if (GetIsObjectValid(oNotice)) { + string nPoster = GetName(oPC) + " (" + GetPCPlayerName(oPC) + ")"; + string nTitle = GetLocalString(oNotice,"#T"); + string nMessage = GetLocalString(oNotice,"#M"); + ActionTakeItem(oNotice, oPC); + bbs_add_notice(OBJECT_SELF, nPoster, nTitle, nMessage, ""); + bbs_change_page(-1000); + } +} diff --git a/nwnds_module/bbs_scribe.dlg b/nwnds_module/bbs_scribe.dlg new file mode 100644 index 000000000..0e7b9569f Binary files /dev/null and b/nwnds_module/bbs_scribe.dlg differ diff --git a/nwnds_module/bbs_scribe_bp.utc b/nwnds_module/bbs_scribe_bp.utc new file mode 100644 index 000000000..25db97118 Binary files /dev/null and b/nwnds_module/bbs_scribe_bp.utc differ diff --git a/nwnds_module/bbs_scribe_conv.ncs b/nwnds_module/bbs_scribe_conv.ncs new file mode 100644 index 000000000..dd3b36dac Binary files /dev/null and b/nwnds_module/bbs_scribe_conv.ncs differ diff --git a/nwnds_module/bbs_scribe_conv.nss b/nwnds_module/bbs_scribe_conv.nss new file mode 100644 index 000000000..131df49bb --- /dev/null +++ b/nwnds_module/bbs_scribe_conv.nss @@ -0,0 +1,38 @@ +//:://///////////////////////////////////////////// +//:: SetListeningPatterns +//:: NW_C2_DEFAULT4 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + by the generic script after dialogue or a + shout is initiated. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 24, 2001 +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" + +void main() +{ + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + object oIntruder; + + if (nMatch == -1 && GetCommandable(OBJECT_SELF)) + { + ClearAllActions(); + BeginConversation(); + } + else + if(nMatch == 777 && GetIsObjectValid(oShouter) && GetIsPC(oShouter)) + // && GetIsFriend(oShouter) + { + if (oShouter == GetLocalObject(OBJECT_SELF, "Customer")) { + string sSaid = GetMatchedSubstring(0); + SetLocalString(OBJECT_SELF, "Stack", sSaid); + } + } +} diff --git a/nwnds_module/bbs_scribe_give.ncs b/nwnds_module/bbs_scribe_give.ncs new file mode 100644 index 000000000..ba3271d4c Binary files /dev/null and b/nwnds_module/bbs_scribe_give.ncs differ diff --git a/nwnds_module/bbs_scribe_give.nss b/nwnds_module/bbs_scribe_give.nss new file mode 100644 index 000000000..7e9141fd3 --- /dev/null +++ b/nwnds_module/bbs_scribe_give.nss @@ -0,0 +1,8 @@ +void main() +{ + object Notice = CreateItemOnObject("bbs_notice_bp", GetPCSpeaker()); + if (Notice != OBJECT_INVALID) { + SetLocalString(Notice, "#T", GetLocalString(OBJECT_SELF, "#T")); + SetLocalString(Notice, "#M", GetLocalString(OBJECT_SELF, "#M")); + } +} diff --git a/nwnds_module/bbs_scribe_m_get.ncs b/nwnds_module/bbs_scribe_m_get.ncs new file mode 100644 index 000000000..3fb0c020b Binary files /dev/null and b/nwnds_module/bbs_scribe_m_get.ncs differ diff --git a/nwnds_module/bbs_scribe_m_get.nss b/nwnds_module/bbs_scribe_m_get.nss new file mode 100644 index 000000000..27b6b5237 --- /dev/null +++ b/nwnds_module/bbs_scribe_m_get.nss @@ -0,0 +1,9 @@ +void main() +{ + string sTalk = GetLocalString(OBJECT_SELF, "Stack"); + if (sTalk != "") { + if (GetStringLength(sTalk) > 200) {sTalk = GetStringLeft(sTalk, 200);} + SetLocalString(OBJECT_SELF, "#M", sTalk); + SetLocalString(OBJECT_SELF, "Stack", ""); + } +} diff --git a/nwnds_module/bbs_scribe_m_yes.ncs b/nwnds_module/bbs_scribe_m_yes.ncs new file mode 100644 index 000000000..63c34d818 Binary files /dev/null and b/nwnds_module/bbs_scribe_m_yes.ncs differ diff --git a/nwnds_module/bbs_scribe_m_yes.nss b/nwnds_module/bbs_scribe_m_yes.nss new file mode 100644 index 000000000..f836d5e26 --- /dev/null +++ b/nwnds_module/bbs_scribe_m_yes.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + if (GetLocalString(OBJECT_SELF, "#M") != "") { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/bbs_scribe_spawn.ncs b/nwnds_module/bbs_scribe_spawn.ncs new file mode 100644 index 000000000..6a5dd9b44 Binary files /dev/null and b/nwnds_module/bbs_scribe_spawn.ncs differ diff --git a/nwnds_module/bbs_scribe_spawn.nss b/nwnds_module/bbs_scribe_spawn.nss new file mode 100644 index 000000000..356cf05dc --- /dev/null +++ b/nwnds_module/bbs_scribe_spawn.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + SetListenPattern(OBJECT_SELF, "**", 777); //listen to all text + SetListening(OBJECT_SELF, TRUE); //be sure NPC is listening + + //SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature +} + + diff --git a/nwnds_module/bbs_scribe_start.ncs b/nwnds_module/bbs_scribe_start.ncs new file mode 100644 index 000000000..64c754faf Binary files /dev/null and b/nwnds_module/bbs_scribe_start.ncs differ diff --git a/nwnds_module/bbs_scribe_start.nss b/nwnds_module/bbs_scribe_start.nss new file mode 100644 index 000000000..2d422e8c6 --- /dev/null +++ b/nwnds_module/bbs_scribe_start.nss @@ -0,0 +1,7 @@ +void main() +{ + SetLocalObject(OBJECT_SELF, "Customer", GetPCSpeaker()); + SetLocalString(OBJECT_SELF, "Stack", ""); + SetLocalString(OBJECT_SELF, "#T", ""); + SetLocalString(OBJECT_SELF, "#M", ""); +} diff --git a/nwnds_module/bbs_scribe_stop.ncs b/nwnds_module/bbs_scribe_stop.ncs new file mode 100644 index 000000000..602eaa92d Binary files /dev/null and b/nwnds_module/bbs_scribe_stop.ncs differ diff --git a/nwnds_module/bbs_scribe_stop.nss b/nwnds_module/bbs_scribe_stop.nss new file mode 100644 index 000000000..ecb284083 --- /dev/null +++ b/nwnds_module/bbs_scribe_stop.nss @@ -0,0 +1,4 @@ +void main() +{ + SetLocalObject(OBJECT_SELF, "Customer", OBJECT_INVALID); +} diff --git a/nwnds_module/bbs_scribe_t_get.ncs b/nwnds_module/bbs_scribe_t_get.ncs new file mode 100644 index 000000000..fdfe65c43 Binary files /dev/null and b/nwnds_module/bbs_scribe_t_get.ncs differ diff --git a/nwnds_module/bbs_scribe_t_get.nss b/nwnds_module/bbs_scribe_t_get.nss new file mode 100644 index 000000000..eddab17bd --- /dev/null +++ b/nwnds_module/bbs_scribe_t_get.nss @@ -0,0 +1,9 @@ +void main() +{ + string sTalk = GetLocalString(OBJECT_SELF, "Stack"); + if (sTalk != "") { + if (GetStringLength(sTalk) > 30) {sTalk = GetStringLeft(sTalk, 30);} + SetLocalString(OBJECT_SELF, "#T", sTalk); + SetLocalString(OBJECT_SELF, "Stack", ""); + } +} diff --git a/nwnds_module/bbs_scribe_t_yes.ncs b/nwnds_module/bbs_scribe_t_yes.ncs new file mode 100644 index 000000000..c5388b51a Binary files /dev/null and b/nwnds_module/bbs_scribe_t_yes.ncs differ diff --git a/nwnds_module/bbs_scribe_t_yes.nss b/nwnds_module/bbs_scribe_t_yes.nss new file mode 100644 index 000000000..e659c5506 --- /dev/null +++ b/nwnds_module/bbs_scribe_t_yes.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + if (GetLocalString(OBJECT_SELF, "#T") != "") { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/bbs_select_01.ncs b/nwnds_module/bbs_select_01.ncs new file mode 100644 index 000000000..7e8a7032d Binary files /dev/null and b/nwnds_module/bbs_select_01.ncs differ diff --git a/nwnds_module/bbs_select_01.nss b/nwnds_module/bbs_select_01.nss new file mode 100644 index 000000000..04a311586 --- /dev/null +++ b/nwnds_module/bbs_select_01.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(1); +} diff --git a/nwnds_module/bbs_select_02.ncs b/nwnds_module/bbs_select_02.ncs new file mode 100644 index 000000000..05104be94 Binary files /dev/null and b/nwnds_module/bbs_select_02.ncs differ diff --git a/nwnds_module/bbs_select_02.nss b/nwnds_module/bbs_select_02.nss new file mode 100644 index 000000000..8d826240b --- /dev/null +++ b/nwnds_module/bbs_select_02.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(2); +} diff --git a/nwnds_module/bbs_select_03.ncs b/nwnds_module/bbs_select_03.ncs new file mode 100644 index 000000000..02147691d Binary files /dev/null and b/nwnds_module/bbs_select_03.ncs differ diff --git a/nwnds_module/bbs_select_03.nss b/nwnds_module/bbs_select_03.nss new file mode 100644 index 000000000..bb19cad6a --- /dev/null +++ b/nwnds_module/bbs_select_03.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(3); +} diff --git a/nwnds_module/bbs_select_04.ncs b/nwnds_module/bbs_select_04.ncs new file mode 100644 index 000000000..b154c575c Binary files /dev/null and b/nwnds_module/bbs_select_04.ncs differ diff --git a/nwnds_module/bbs_select_04.nss b/nwnds_module/bbs_select_04.nss new file mode 100644 index 000000000..47db8d3f9 --- /dev/null +++ b/nwnds_module/bbs_select_04.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(4); +} diff --git a/nwnds_module/bbs_select_05.ncs b/nwnds_module/bbs_select_05.ncs new file mode 100644 index 000000000..43e89d69a Binary files /dev/null and b/nwnds_module/bbs_select_05.ncs differ diff --git a/nwnds_module/bbs_select_05.nss b/nwnds_module/bbs_select_05.nss new file mode 100644 index 000000000..0372b2f2d --- /dev/null +++ b/nwnds_module/bbs_select_05.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(5); +} diff --git a/nwnds_module/bbs_select_06.ncs b/nwnds_module/bbs_select_06.ncs new file mode 100644 index 000000000..f63448fd7 Binary files /dev/null and b/nwnds_module/bbs_select_06.ncs differ diff --git a/nwnds_module/bbs_select_06.nss b/nwnds_module/bbs_select_06.nss new file mode 100644 index 000000000..597351f52 --- /dev/null +++ b/nwnds_module/bbs_select_06.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(6); +} diff --git a/nwnds_module/bbs_select_07.ncs b/nwnds_module/bbs_select_07.ncs new file mode 100644 index 000000000..0338058a7 Binary files /dev/null and b/nwnds_module/bbs_select_07.ncs differ diff --git a/nwnds_module/bbs_select_07.nss b/nwnds_module/bbs_select_07.nss new file mode 100644 index 000000000..c4a0dcfd1 --- /dev/null +++ b/nwnds_module/bbs_select_07.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(7); +} diff --git a/nwnds_module/bbs_select_08.ncs b/nwnds_module/bbs_select_08.ncs new file mode 100644 index 000000000..3c1c21572 Binary files /dev/null and b/nwnds_module/bbs_select_08.ncs differ diff --git a/nwnds_module/bbs_select_08.nss b/nwnds_module/bbs_select_08.nss new file mode 100644 index 000000000..e90b2281e --- /dev/null +++ b/nwnds_module/bbs_select_08.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(8); +} diff --git a/nwnds_module/bbs_select_09.ncs b/nwnds_module/bbs_select_09.ncs new file mode 100644 index 000000000..7445db59b Binary files /dev/null and b/nwnds_module/bbs_select_09.ncs differ diff --git a/nwnds_module/bbs_select_09.nss b/nwnds_module/bbs_select_09.nss new file mode 100644 index 000000000..c1071c97c --- /dev/null +++ b/nwnds_module/bbs_select_09.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(9); +} diff --git a/nwnds_module/bbs_select_10.ncs b/nwnds_module/bbs_select_10.ncs new file mode 100644 index 000000000..17f6e9083 Binary files /dev/null and b/nwnds_module/bbs_select_10.ncs differ diff --git a/nwnds_module/bbs_select_10.nss b/nwnds_module/bbs_select_10.nss new file mode 100644 index 000000000..113db4915 --- /dev/null +++ b/nwnds_module/bbs_select_10.nss @@ -0,0 +1,6 @@ +#include "bbs_include" + +void main() +{ + bbs_select_entry(10); +} diff --git a/nwnds_module/bbs_show_01.ncs b/nwnds_module/bbs_show_01.ncs new file mode 100644 index 000000000..019b3a699 Binary files /dev/null and b/nwnds_module/bbs_show_01.ncs differ diff --git a/nwnds_module/bbs_show_01.nss b/nwnds_module/bbs_show_01.nss new file mode 100644 index 000000000..7497db40d --- /dev/null +++ b/nwnds_module/bbs_show_01.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(1); +} diff --git a/nwnds_module/bbs_show_02.ncs b/nwnds_module/bbs_show_02.ncs new file mode 100644 index 000000000..8f5b3f206 Binary files /dev/null and b/nwnds_module/bbs_show_02.ncs differ diff --git a/nwnds_module/bbs_show_02.nss b/nwnds_module/bbs_show_02.nss new file mode 100644 index 000000000..0d0a90bd4 --- /dev/null +++ b/nwnds_module/bbs_show_02.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(2); +} diff --git a/nwnds_module/bbs_show_03.ncs b/nwnds_module/bbs_show_03.ncs new file mode 100644 index 000000000..15748f318 Binary files /dev/null and b/nwnds_module/bbs_show_03.ncs differ diff --git a/nwnds_module/bbs_show_03.nss b/nwnds_module/bbs_show_03.nss new file mode 100644 index 000000000..ba3c7dbcb --- /dev/null +++ b/nwnds_module/bbs_show_03.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(3); +} diff --git a/nwnds_module/bbs_show_04.ncs b/nwnds_module/bbs_show_04.ncs new file mode 100644 index 000000000..b582f5103 Binary files /dev/null and b/nwnds_module/bbs_show_04.ncs differ diff --git a/nwnds_module/bbs_show_04.nss b/nwnds_module/bbs_show_04.nss new file mode 100644 index 000000000..4ce1b7036 --- /dev/null +++ b/nwnds_module/bbs_show_04.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(4); +} diff --git a/nwnds_module/bbs_show_05.ncs b/nwnds_module/bbs_show_05.ncs new file mode 100644 index 000000000..692ee09a2 Binary files /dev/null and b/nwnds_module/bbs_show_05.ncs differ diff --git a/nwnds_module/bbs_show_05.nss b/nwnds_module/bbs_show_05.nss new file mode 100644 index 000000000..d7286de29 --- /dev/null +++ b/nwnds_module/bbs_show_05.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(5); +} diff --git a/nwnds_module/bbs_show_06.ncs b/nwnds_module/bbs_show_06.ncs new file mode 100644 index 000000000..6149fce95 Binary files /dev/null and b/nwnds_module/bbs_show_06.ncs differ diff --git a/nwnds_module/bbs_show_06.nss b/nwnds_module/bbs_show_06.nss new file mode 100644 index 000000000..e53ab0d52 --- /dev/null +++ b/nwnds_module/bbs_show_06.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(6); +} diff --git a/nwnds_module/bbs_show_07.ncs b/nwnds_module/bbs_show_07.ncs new file mode 100644 index 000000000..2b95f58c9 Binary files /dev/null and b/nwnds_module/bbs_show_07.ncs differ diff --git a/nwnds_module/bbs_show_07.nss b/nwnds_module/bbs_show_07.nss new file mode 100644 index 000000000..fede817ee --- /dev/null +++ b/nwnds_module/bbs_show_07.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(7); +} diff --git a/nwnds_module/bbs_show_08.ncs b/nwnds_module/bbs_show_08.ncs new file mode 100644 index 000000000..565183971 Binary files /dev/null and b/nwnds_module/bbs_show_08.ncs differ diff --git a/nwnds_module/bbs_show_08.nss b/nwnds_module/bbs_show_08.nss new file mode 100644 index 000000000..28607278b --- /dev/null +++ b/nwnds_module/bbs_show_08.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(8); +} diff --git a/nwnds_module/bbs_show_09.ncs b/nwnds_module/bbs_show_09.ncs new file mode 100644 index 000000000..1fe322ff7 Binary files /dev/null and b/nwnds_module/bbs_show_09.ncs differ diff --git a/nwnds_module/bbs_show_09.nss b/nwnds_module/bbs_show_09.nss new file mode 100644 index 000000000..5e899a38c --- /dev/null +++ b/nwnds_module/bbs_show_09.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(9); +} diff --git a/nwnds_module/bbs_show_10.ncs b/nwnds_module/bbs_show_10.ncs new file mode 100644 index 000000000..18a619dad Binary files /dev/null and b/nwnds_module/bbs_show_10.ncs differ diff --git a/nwnds_module/bbs_show_10.nss b/nwnds_module/bbs_show_10.nss new file mode 100644 index 000000000..83cfc5de3 --- /dev/null +++ b/nwnds_module/bbs_show_10.nss @@ -0,0 +1,5 @@ +#include "bbs_include" +int StartingConditional() +{ + return bbs_can_show(10); +} diff --git a/nwnds_module/bbs_show_back.ncs b/nwnds_module/bbs_show_back.ncs new file mode 100644 index 000000000..6caa8c9ef Binary files /dev/null and b/nwnds_module/bbs_show_back.ncs differ diff --git a/nwnds_module/bbs_show_back.nss b/nwnds_module/bbs_show_back.nss new file mode 100644 index 000000000..6706e9d14 --- /dev/null +++ b/nwnds_module/bbs_show_back.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + int PageIndex = GetLocalInt(GetPCSpeaker(), "PageIndex"); + if (PageIndex == 0) { + return FALSE; + } + return TRUE; +} diff --git a/nwnds_module/bbs_show_next.ncs b/nwnds_module/bbs_show_next.ncs new file mode 100644 index 000000000..87442743c Binary files /dev/null and b/nwnds_module/bbs_show_next.ncs differ diff --git a/nwnds_module/bbs_show_next.nss b/nwnds_module/bbs_show_next.nss new file mode 100644 index 000000000..2557e56f7 --- /dev/null +++ b/nwnds_module/bbs_show_next.nss @@ -0,0 +1,18 @@ +#include "aps_include" +int StartingConditional() +{ + object oBBS = GetLocalObject(GetModule(), "BBS_" + GetTag(OBJECT_SELF)); + int PageSize = GetLocalInt(oBBS, "PageSize"); + int PageIndex = GetLocalInt(GetPCSpeaker(), "PageIndex"); + int TotalItems; + string sSQL = "SELECT * FROM bbs_stats WHERE Tag='"+SQLEncodeSpecialChars(GetTag(oBBS))+"'"; + SQLExecDirect(sSQL); + if(SQLFetch()) + TotalItems = StringToInt(SQLGetData(2)); + else + TotalItems = 0; + if (TotalItems > (PageIndex + 1) * PageSize) { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/bbs_start.ncs b/nwnds_module/bbs_start.ncs new file mode 100644 index 000000000..f7dab2f94 Binary files /dev/null and b/nwnds_module/bbs_start.ncs differ diff --git a/nwnds_module/bbs_start.nss b/nwnds_module/bbs_start.nss new file mode 100644 index 000000000..2d4aacbcc --- /dev/null +++ b/nwnds_module/bbs_start.nss @@ -0,0 +1,13 @@ +#include "bbs_include" + +void main() +{ + object oPC = GetLastUsedBy(); + if (GetIsPC(oPC)) { + bbs_initiate(OBJECT_SELF); + SetLocalInt(oPC,"PageIndex",0); + bbs_change_page(-1000); + SetLocalString(oPC,"PostAuthor",""); + ActionStartConversation(oPC, "", TRUE); + } +} diff --git a/nwnds_module/bc_armor001.uti b/nwnds_module/bc_armor001.uti new file mode 100644 index 000000000..99e887ef6 Binary files /dev/null and b/nwnds_module/bc_armor001.uti differ diff --git a/nwnds_module/bc_armor002.uti b/nwnds_module/bc_armor002.uti new file mode 100644 index 000000000..f8a85df31 Binary files /dev/null and b/nwnds_module/bc_armor002.uti differ diff --git a/nwnds_module/beasthead001.utc b/nwnds_module/beasthead001.utc new file mode 100644 index 000000000..b99592da9 Binary files /dev/null and b/nwnds_module/beasthead001.utc differ diff --git a/nwnds_module/beasthead001.uti b/nwnds_module/beasthead001.uti new file mode 100644 index 000000000..9f384c11a Binary files /dev/null and b/nwnds_module/beasthead001.uti differ diff --git a/nwnds_module/beasthead002.utc b/nwnds_module/beasthead002.utc new file mode 100644 index 000000000..8d98f0d9c Binary files /dev/null and b/nwnds_module/beasthead002.utc differ diff --git a/nwnds_module/beasthead002.uti b/nwnds_module/beasthead002.uti new file mode 100644 index 000000000..73886b6b3 Binary files /dev/null and b/nwnds_module/beasthead002.uti differ diff --git a/nwnds_module/beasthead003.utc b/nwnds_module/beasthead003.utc new file mode 100644 index 000000000..e6ada2e2f Binary files /dev/null and b/nwnds_module/beasthead003.utc differ diff --git a/nwnds_module/beasthead003.uti b/nwnds_module/beasthead003.uti new file mode 100644 index 000000000..c83616f92 Binary files /dev/null and b/nwnds_module/beasthead003.uti differ diff --git a/nwnds_module/beasthead004.utc b/nwnds_module/beasthead004.utc new file mode 100644 index 000000000..f2c162b42 Binary files /dev/null and b/nwnds_module/beasthead004.utc differ diff --git a/nwnds_module/beasthead004.uti b/nwnds_module/beasthead004.uti new file mode 100644 index 000000000..25a9f0eec Binary files /dev/null and b/nwnds_module/beasthead004.uti differ diff --git a/nwnds_module/beastheadhide001.uti b/nwnds_module/beastheadhide001.uti new file mode 100644 index 000000000..33abfd19a Binary files /dev/null and b/nwnds_module/beastheadhide001.uti differ diff --git a/nwnds_module/bed.utp b/nwnds_module/bed.utp new file mode 100644 index 000000000..f2252d1c2 Binary files /dev/null and b/nwnds_module/bed.utp differ diff --git a/nwnds_module/belgoi001.utc b/nwnds_module/belgoi001.utc new file mode 100644 index 000000000..688fa9745 Binary files /dev/null and b/nwnds_module/belgoi001.utc differ diff --git a/nwnds_module/belgoi002.utc b/nwnds_module/belgoi002.utc new file mode 100644 index 000000000..7b4a4e892 Binary files /dev/null and b/nwnds_module/belgoi002.utc differ diff --git a/nwnds_module/belgoi003.utc b/nwnds_module/belgoi003.utc new file mode 100644 index 000000000..a8ba460eb Binary files /dev/null and b/nwnds_module/belgoi003.utc differ diff --git a/nwnds_module/belgoi004.utc b/nwnds_module/belgoi004.utc new file mode 100644 index 000000000..798d15a2f Binary files /dev/null and b/nwnds_module/belgoi004.utc differ diff --git a/nwnds_module/belgoi_claw.ncs b/nwnds_module/belgoi_claw.ncs new file mode 100644 index 000000000..bbbf46604 Binary files /dev/null and b/nwnds_module/belgoi_claw.ncs differ diff --git a/nwnds_module/belgoi_claw.nss b/nwnds_module/belgoi_claw.nss new file mode 100644 index 000000000..bb07f3c87 --- /dev/null +++ b/nwnds_module/belgoi_claw.nss @@ -0,0 +1,41 @@ +//:: +//:: A pnp version of the Belgoi's STR damaging slam. +//:: +//:: Modified by: DM Heatstroke 05-10-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoStrDamage(object oTarget, object oCaster) +{ + // Get Ability Damage + int nDam = Random(5)+1; + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH, nDam); + eStr = ExtraordinaryEffect(eStr); + + // Belgoi's slam has no save, but also won't kill it's victim. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStr, oTarget, 8640.0); // 24 "Athas Reborn" hours -DMH + +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoStrDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/belgoiclaw.uti b/nwnds_module/belgoiclaw.uti new file mode 100644 index 000000000..5456dfb8b Binary files /dev/null and b/nwnds_module/belgoiclaw.uti differ diff --git a/nwnds_module/belkerhide.uti b/nwnds_module/belkerhide.uti new file mode 100644 index 000000000..922382b64 Binary files /dev/null and b/nwnds_module/belkerhide.uti differ diff --git a/nwnds_module/berzwaspprops.uti b/nwnds_module/berzwaspprops.uti new file mode 100644 index 000000000..deab55672 Binary files /dev/null and b/nwnds_module/berzwaspprops.uti differ diff --git a/nwnds_module/berzwaspssting.uti b/nwnds_module/berzwaspssting.uti new file mode 100644 index 000000000..3b0aa4434 Binary files /dev/null and b/nwnds_module/berzwaspssting.uti differ diff --git a/nwnds_module/besiepwres.utp b/nwnds_module/besiepwres.utp new file mode 100644 index 000000000..0f387fe02 Binary files /dev/null and b/nwnds_module/besiepwres.utp differ diff --git a/nwnds_module/besiewidget.uti b/nwnds_module/besiewidget.uti new file mode 100644 index 000000000..1f8879edd Binary files /dev/null and b/nwnds_module/besiewidget.uti differ diff --git a/nwnds_module/bigswamp.are b/nwnds_module/bigswamp.are new file mode 100644 index 000000000..ffd673f73 Binary files /dev/null and b/nwnds_module/bigswamp.are differ diff --git a/nwnds_module/bigswamp.gic b/nwnds_module/bigswamp.gic new file mode 100644 index 000000000..31e93e62e Binary files /dev/null and b/nwnds_module/bigswamp.gic differ diff --git a/nwnds_module/bigswamp.git b/nwnds_module/bigswamp.git new file mode 100644 index 000000000..f5f8587c2 Binary files /dev/null and b/nwnds_module/bigswamp.git differ diff --git a/nwnds_module/bite1d63.uti b/nwnds_module/bite1d63.uti new file mode 100644 index 000000000..99d2338bc Binary files /dev/null and b/nwnds_module/bite1d63.uti differ diff --git a/nwnds_module/bite3d6.uti b/nwnds_module/bite3d6.uti new file mode 100644 index 000000000..be4fa5d0d Binary files /dev/null and b/nwnds_module/bite3d6.uti differ diff --git a/nwnds_module/bite3d8.uti b/nwnds_module/bite3d8.uti new file mode 100644 index 000000000..5cf0f7c43 Binary files /dev/null and b/nwnds_module/bite3d8.uti differ diff --git a/nwnds_module/bj_giverules.ncs b/nwnds_module/bj_giverules.ncs new file mode 100644 index 000000000..40470d6d2 Binary files /dev/null and b/nwnds_module/bj_giverules.ncs differ diff --git a/nwnds_module/bj_giverules.nss b/nwnds_module/bj_giverules.nss new file mode 100644 index 000000000..ceee50308 --- /dev/null +++ b/nwnds_module/bj_giverules.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_giverules +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/30/2002 10:50:40 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the pc speaker the rules for blackjack item + CreateItemOnObject("blackjackrules", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/bj_numplay1.ncs b/nwnds_module/bj_numplay1.ncs new file mode 100644 index 000000000..e5c5491d5 Binary files /dev/null and b/nwnds_module/bj_numplay1.ncs differ diff --git a/nwnds_module/bj_numplay1.nss b/nwnds_module/bj_numplay1.nss new file mode 100644 index 000000000..91e88552b --- /dev/null +++ b/nwnds_module/bj_numplay1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_numplay1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 9:14:46 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a one player game + SetLocalInt(OBJECT_SELF, "nMaxPlayers", 1); + SetLocalInt(OBJECT_SELF, "nNumPlayers", 0); +} diff --git a/nwnds_module/bj_numplay2.ncs b/nwnds_module/bj_numplay2.ncs new file mode 100644 index 000000000..84dffe20b Binary files /dev/null and b/nwnds_module/bj_numplay2.ncs differ diff --git a/nwnds_module/bj_numplay2.nss b/nwnds_module/bj_numplay2.nss new file mode 100644 index 000000000..9f1e12a6f --- /dev/null +++ b/nwnds_module/bj_numplay2.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_numplay2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 9:15:12 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a two player game + SetLocalInt(OBJECT_SELF, "nMaxPlayers", 2); + SetLocalInt(OBJECT_SELF, "nNumPlayers", 0); + +} diff --git a/nwnds_module/bj_numplay3.ncs b/nwnds_module/bj_numplay3.ncs new file mode 100644 index 000000000..09ab2e776 Binary files /dev/null and b/nwnds_module/bj_numplay3.ncs differ diff --git a/nwnds_module/bj_numplay3.nss b/nwnds_module/bj_numplay3.nss new file mode 100644 index 000000000..3d4d23274 --- /dev/null +++ b/nwnds_module/bj_numplay3.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_numplay3 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 9:15:38 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a three player game + SetLocalInt(OBJECT_SELF, "nMaxPlayers", 3); + SetLocalInt(OBJECT_SELF, "nNumPlayers", 0); + +} diff --git a/nwnds_module/bj_numplay4.ncs b/nwnds_module/bj_numplay4.ncs new file mode 100644 index 000000000..1da587f29 Binary files /dev/null and b/nwnds_module/bj_numplay4.ncs differ diff --git a/nwnds_module/bj_numplay4.nss b/nwnds_module/bj_numplay4.nss new file mode 100644 index 000000000..9a3959886 --- /dev/null +++ b/nwnds_module/bj_numplay4.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_numplay4 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 9:17:19 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a four person game + SetLocalInt(OBJECT_SELF, "nMaxPlayers", 4); + SetLocalInt(OBJECT_SELF, "nNumPlayers", 0); + +} diff --git a/nwnds_module/bj_playtest.ncs b/nwnds_module/bj_playtest.ncs new file mode 100644 index 000000000..e7828177f Binary files /dev/null and b/nwnds_module/bj_playtest.ncs differ diff --git a/nwnds_module/bj_playtest.nss b/nwnds_module/bj_playtest.nss new file mode 100644 index 000000000..69c7e15fb --- /dev/null +++ b/nwnds_module/bj_playtest.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_playtest +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 2:54:00 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables to see if the Dealer is playing black jack currently. + if(!(GetLocalInt(OBJECT_SELF, "nPlayingBlackJack") != 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/bj_playtest2.ncs b/nwnds_module/bj_playtest2.ncs new file mode 100644 index 000000000..ce2695cfc Binary files /dev/null and b/nwnds_module/bj_playtest2.ncs differ diff --git a/nwnds_module/bj_playtest2.nss b/nwnds_module/bj_playtest2.nss new file mode 100644 index 000000000..0b730331e --- /dev/null +++ b/nwnds_module/bj_playtest2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_playtest2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 2:55:42 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables to see if the dealer is playing a game currently + if(!(GetLocalInt(OBJECT_SELF, "nPlayingBlackJack") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/bj_playtest3.ncs b/nwnds_module/bj_playtest3.ncs new file mode 100644 index 000000000..936578552 Binary files /dev/null and b/nwnds_module/bj_playtest3.ncs differ diff --git a/nwnds_module/bj_playtest3.nss b/nwnds_module/bj_playtest3.nss new file mode 100644 index 000000000..26ba7dbd4 --- /dev/null +++ b/nwnds_module/bj_playtest3.nss @@ -0,0 +1,28 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_playtest3 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 2:59:22 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + //Clear the old variables in order to be able to start a new game + SetLocalInt(OBJECT_SELF, "nPlayingBlackJack", 0); + + SetLocalInt(OBJECT_SELF, "nMaxPlayers", 0); + SetLocalInt(OBJECT_SELF, "nNumPlayers", 0); + + //make sure all PCs have their game variable marked to off + object oPC = GetFirstPC(); + while (oPC != OBJECT_INVALID) + { + SetLocalInt(oPC,"nGameOn",0); + oPC = GetNextPC(); + } + + //Move dealer to stand and await the next PC who wants to play. + AssignCommand(OBJECT_SELF,ActionMoveToObject(GetWaypointByTag("WP_BlackJack"))); + +} diff --git a/nwnds_module/bj_wager1.ncs b/nwnds_module/bj_wager1.ncs new file mode 100644 index 000000000..3235ba917 Binary files /dev/null and b/nwnds_module/bj_wager1.ncs differ diff --git a/nwnds_module/bj_wager1.nss b/nwnds_module/bj_wager1.nss new file mode 100644 index 000000000..e08add60e --- /dev/null +++ b/nwnds_module/bj_wager1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_wager1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 1:35:57 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a 1gp wager + SetLocalInt(OBJECT_SELF, "nWager", 1); + +} diff --git a/nwnds_module/bj_wager10.ncs b/nwnds_module/bj_wager10.ncs new file mode 100644 index 000000000..57e2697ed Binary files /dev/null and b/nwnds_module/bj_wager10.ncs differ diff --git a/nwnds_module/bj_wager10.nss b/nwnds_module/bj_wager10.nss new file mode 100644 index 000000000..a565d7090 --- /dev/null +++ b/nwnds_module/bj_wager10.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_wager10 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 1:35:57 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a 10 gp wager + SetLocalInt(OBJECT_SELF, "nWager", 10); + +} diff --git a/nwnds_module/bj_wager100.ncs b/nwnds_module/bj_wager100.ncs new file mode 100644 index 000000000..9b9e58349 Binary files /dev/null and b/nwnds_module/bj_wager100.ncs differ diff --git a/nwnds_module/bj_wager100.nss b/nwnds_module/bj_wager100.nss new file mode 100644 index 000000000..52ef04213 --- /dev/null +++ b/nwnds_module/bj_wager100.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_wager100 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 1:35:57 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a 100 gp wager + SetLocalInt(OBJECT_SELF, "nWager", 100); + +} diff --git a/nwnds_module/bj_wager5.ncs b/nwnds_module/bj_wager5.ncs new file mode 100644 index 000000000..0a1dabfea Binary files /dev/null and b/nwnds_module/bj_wager5.ncs differ diff --git a/nwnds_module/bj_wager5.nss b/nwnds_module/bj_wager5.nss new file mode 100644 index 000000000..00415ba11 --- /dev/null +++ b/nwnds_module/bj_wager5.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_wager5 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 1:35:57 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a 5 gp wager + SetLocalInt(OBJECT_SELF, "nWager", 5); + +} diff --git a/nwnds_module/bj_wager50.ncs b/nwnds_module/bj_wager50.ncs new file mode 100644 index 000000000..747fb2d57 Binary files /dev/null and b/nwnds_module/bj_wager50.ncs differ diff --git a/nwnds_module/bj_wager50.nss b/nwnds_module/bj_wager50.nss new file mode 100644 index 000000000..f9dd3aa5e --- /dev/null +++ b/nwnds_module/bj_wager50.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName bj_wager50 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/2002 1:35:57 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables for a 50 gp wager + SetLocalInt(OBJECT_SELF, "nWager", 50); + +} diff --git a/nwnds_module/bl_mast_claw.uti b/nwnds_module/bl_mast_claw.uti new file mode 100644 index 000000000..4f6a3ee05 Binary files /dev/null and b/nwnds_module/bl_mast_claw.uti differ diff --git a/nwnds_module/bladehoodslash.uti b/nwnds_module/bladehoodslash.uti new file mode 100644 index 000000000..22ad7da55 Binary files /dev/null and b/nwnds_module/bladehoodslash.uti differ diff --git a/nwnds_module/blaspheme001.utc b/nwnds_module/blaspheme001.utc new file mode 100644 index 000000000..dbed4f5c7 Binary files /dev/null and b/nwnds_module/blaspheme001.utc differ diff --git a/nwnds_module/blaspheme_bite.ncs b/nwnds_module/blaspheme_bite.ncs new file mode 100644 index 000000000..65850e440 Binary files /dev/null and b/nwnds_module/blaspheme_bite.ncs differ diff --git a/nwnds_module/blaspheme_bite.nss b/nwnds_module/blaspheme_bite.nss new file mode 100644 index 000000000..78d1b1b8f --- /dev/null +++ b/nwnds_module/blaspheme_bite.nss @@ -0,0 +1,29 @@ +void DoStrDamage( object oTarget ) +{ + int nDam = d6(); + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH, nDam); + eStr = SupernaturalEffect(eStr); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStr,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +} + +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + int nAlign = GetAlignmentGoodEvil(oTarget); + if ( nAlign == ALIGNMENT_EVIL ) + return; + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eDaze = EffectDazed(); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDaze,eVis2); + eLink = EffectLinkEffects(eLink,eDur); + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +// ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStr,oTarget); + DelayCommand(0.1, DoStrDamage(oTarget)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,RoundsToSeconds(1)); +} diff --git a/nwnds_module/blasphemebite.uti b/nwnds_module/blasphemebite.uti new file mode 100644 index 000000000..3a274abe9 Binary files /dev/null and b/nwnds_module/blasphemebite.uti differ diff --git a/nwnds_module/blasphemehide.uti b/nwnds_module/blasphemehide.uti new file mode 100644 index 000000000..f5ca01ea7 Binary files /dev/null and b/nwnds_module/blasphemehide.uti differ diff --git a/nwnds_module/bleakaura.ncs b/nwnds_module/bleakaura.ncs new file mode 100644 index 000000000..bf87c92f7 Binary files /dev/null and b/nwnds_module/bleakaura.ncs differ diff --git a/nwnds_module/bleakaura.nss b/nwnds_module/bleakaura.nss new file mode 100644 index 000000000..026c151da --- /dev/null +++ b/nwnds_module/bleakaura.nss @@ -0,0 +1,12 @@ +void main() +{ + //Set and apply AOE object + effect eCold = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_COLD); + eCold = SupernaturalEffect(eCold); + eCold = ExtraordinaryEffect(eCold); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eCold, OBJECT_SELF); + effect eAOE = EffectAreaOfEffect(AOE_MOB_FROST,"bleakaura1","bleakaura2","rotaura2"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/bleakaura1.ncs b/nwnds_module/bleakaura1.ncs new file mode 100644 index 000000000..70634b6a6 Binary files /dev/null and b/nwnds_module/bleakaura1.ncs differ diff --git a/nwnds_module/bleakaura1.nss b/nwnds_module/bleakaura1.nss new file mode 100644 index 000000000..4565be8ab --- /dev/null +++ b/nwnds_module/bleakaura1.nss @@ -0,0 +1,33 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + effect eHeal = EffectHeal(10); + object oTarget = GetEnteringObject(); + + if(GetIsEnemy(oTarget, oCaster)) + { + int nDam; + + if ( MySavingThrow(SAVING_THROW_FORT, oTarget, 16, SAVING_THROW_TYPE_COLD, oCaster) ) + nDam = d6(); + else + nDam = d6(2); + if ( nDam > 0 ) + { + effect eDam = EffectDamage(nDam,DAMAGE_TYPE_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + int nFlag = GetLocalInt(oCaster,"AURA_STATE"); + if ( nFlag == 0 ) + { + SetLocalInt(oCaster,"AURA_STATE",1); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + } + } + } +} diff --git a/nwnds_module/bleakaura2.ncs b/nwnds_module/bleakaura2.ncs new file mode 100644 index 000000000..2573058d3 Binary files /dev/null and b/nwnds_module/bleakaura2.ncs differ diff --git a/nwnds_module/bleakaura2.nss b/nwnds_module/bleakaura2.nss new file mode 100644 index 000000000..15e8cb094 --- /dev/null +++ b/nwnds_module/bleakaura2.nss @@ -0,0 +1,37 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + int nDam; + effect eDam; + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + effect eHeal = EffectHeal(10); + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + + if ( MySavingThrow(SAVING_THROW_FORT, oTarget, 16, SAVING_THROW_TYPE_COLD, oCaster) ) + nDam = d6(); + else + nDam = d6(2); + if ( nDam > 0 ) + { + eDam = EffectDamage(nDam,DAMAGE_TYPE_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + int nFlag = GetLocalInt(oCaster,"AURA_STATE"); + if ( nFlag == 0 ) + { + SetLocalInt(oCaster,"AURA_STATE",1); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + } + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/bleakborn001.utc b/nwnds_module/bleakborn001.utc new file mode 100644 index 000000000..4d017d521 Binary files /dev/null and b/nwnds_module/bleakborn001.utc differ diff --git a/nwnds_module/bleakbornhide.uti b/nwnds_module/bleakbornhide.uti new file mode 100644 index 000000000..029b16851 Binary files /dev/null and b/nwnds_module/bleakbornhide.uti differ diff --git a/nwnds_module/bleakbornslam.uti b/nwnds_module/bleakbornslam.uti new file mode 100644 index 000000000..56a194313 Binary files /dev/null and b/nwnds_module/bleakbornslam.uti differ diff --git a/nwnds_module/blight001.utc b/nwnds_module/blight001.utc new file mode 100644 index 000000000..830597f14 Binary files /dev/null and b/nwnds_module/blight001.utc differ diff --git a/nwnds_module/blightbite.uti b/nwnds_module/blightbite.uti new file mode 100644 index 000000000..d8630d9dc Binary files /dev/null and b/nwnds_module/blightbite.uti differ diff --git a/nwnds_module/blkmastyrial_001.utc b/nwnds_module/blkmastyrial_001.utc new file mode 100644 index 000000000..7d2d2d3fd Binary files /dev/null and b/nwnds_module/blkmastyrial_001.utc differ diff --git a/nwnds_module/blkmastyrial_002.utc b/nwnds_module/blkmastyrial_002.utc new file mode 100644 index 000000000..772130573 Binary files /dev/null and b/nwnds_module/blkmastyrial_002.utc differ diff --git a/nwnds_module/blkmastyrialstin.uti b/nwnds_module/blkmastyrialstin.uti new file mode 100644 index 000000000..7a9836d40 Binary files /dev/null and b/nwnds_module/blkmastyrialstin.uti differ diff --git a/nwnds_module/blmast_constrict.ncs b/nwnds_module/blmast_constrict.ncs new file mode 100644 index 000000000..ca20d3562 Binary files /dev/null and b/nwnds_module/blmast_constrict.ncs differ diff --git a/nwnds_module/blmast_constrict.nss b/nwnds_module/blmast_constrict.nss new file mode 100644 index 000000000..716e8d18f --- /dev/null +++ b/nwnds_module/blmast_constrict.nss @@ -0,0 +1,68 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d4(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d4+STR Modifier bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Black Mastyrial TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The black mastyrial tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The black mastyrial is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Black +// Mastyrial entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/blood_cultist001.utc b/nwnds_module/blood_cultist001.utc new file mode 100644 index 000000000..8fa30f082 Binary files /dev/null and b/nwnds_module/blood_cultist001.utc differ diff --git a/nwnds_module/blood_cultist002.utc b/nwnds_module/blood_cultist002.utc new file mode 100644 index 000000000..1115c8b93 Binary files /dev/null and b/nwnds_module/blood_cultist002.utc differ diff --git a/nwnds_module/bloodamniote001.utc b/nwnds_module/bloodamniote001.utc new file mode 100644 index 000000000..0ba51d577 Binary files /dev/null and b/nwnds_module/bloodamniote001.utc differ diff --git a/nwnds_module/bloodamniotehi.uti b/nwnds_module/bloodamniotehi.uti new file mode 100644 index 000000000..fd22eb393 Binary files /dev/null and b/nwnds_module/bloodamniotehi.uti differ diff --git a/nwnds_module/bloodcall.ncs b/nwnds_module/bloodcall.ncs new file mode 100644 index 000000000..953cb60a8 Binary files /dev/null and b/nwnds_module/bloodcall.ncs differ diff --git a/nwnds_module/bloodcall.nss b/nwnds_module/bloodcall.nss new file mode 100644 index 000000000..6664f17e6 --- /dev/null +++ b/nwnds_module/bloodcall.nss @@ -0,0 +1,44 @@ +void DoConDamage(object oTarget, object oOrigin ) +{ + int nKillEm = 0; + if ( (!GetIsPC( oTarget ) ) || ( GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES ) ) + { + nKillEm = 1; + } + + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eBeam = EffectBeam(VFX_BEAM_SILENT_EVIL,oOrigin,BODY_NODE_CHEST); + int nDam = d4(); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam); + eCon = SupernaturalEffect(eCon); + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + return; + } + + if ( GetAbilityScore(oTarget,ABILITY_CONSTITUTION) - nDam < 3 && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,1.5); +} + +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + int nRace = GetRacialType(oTarget); + if ( nRace == RACIAL_TYPE_UNDEAD || nRace == RACIAL_TYPE_CONSTRUCT || + nRace == RACIAL_TYPE_OOZE || nRace == RACIAL_TYPE_ELEMENTAL ) + return; + + DelayCommand(0.1,DoConDamage(oTarget,oOrigin)); +} diff --git a/nwnds_module/bloodcall.uti b/nwnds_module/bloodcall.uti new file mode 100644 index 000000000..254e5f0d7 Binary files /dev/null and b/nwnds_module/bloodcall.uti differ diff --git a/nwnds_module/bloodsentarmor.uti b/nwnds_module/bloodsentarmor.uti new file mode 100644 index 000000000..2375dba2a Binary files /dev/null and b/nwnds_module/bloodsentarmor.uti differ diff --git a/nwnds_module/bloodsenthide.uti b/nwnds_module/bloodsenthide.uti new file mode 100644 index 000000000..aef526e75 Binary files /dev/null and b/nwnds_module/bloodsenthide.uti differ diff --git a/nwnds_module/bodach_arena.are b/nwnds_module/bodach_arena.are new file mode 100644 index 000000000..5dbf8f776 Binary files /dev/null and b/nwnds_module/bodach_arena.are differ diff --git a/nwnds_module/bodach_arena.gic b/nwnds_module/bodach_arena.gic new file mode 100644 index 000000000..dfb7442a5 Binary files /dev/null and b/nwnds_module/bodach_arena.gic differ diff --git a/nwnds_module/bodach_arena.git b/nwnds_module/bodach_arena.git new file mode 100644 index 000000000..d6302f4ef Binary files /dev/null and b/nwnds_module/bodach_arena.git differ diff --git a/nwnds_module/bodach_caravanwy.are b/nwnds_module/bodach_caravanwy.are new file mode 100644 index 000000000..49f6eec8d Binary files /dev/null and b/nwnds_module/bodach_caravanwy.are differ diff --git a/nwnds_module/bodach_caravanwy.gic b/nwnds_module/bodach_caravanwy.gic new file mode 100644 index 000000000..bc57b5c64 Binary files /dev/null and b/nwnds_module/bodach_caravanwy.gic differ diff --git a/nwnds_module/bodach_caravanwy.git b/nwnds_module/bodach_caravanwy.git new file mode 100644 index 000000000..daccfdcaa Binary files /dev/null and b/nwnds_module/bodach_caravanwy.git differ diff --git a/nwnds_module/bodach_merchant.are b/nwnds_module/bodach_merchant.are new file mode 100644 index 000000000..b31e0dc6e Binary files /dev/null and b/nwnds_module/bodach_merchant.are differ diff --git a/nwnds_module/bodach_merchant.gic b/nwnds_module/bodach_merchant.gic new file mode 100644 index 000000000..88f4b1df0 Binary files /dev/null and b/nwnds_module/bodach_merchant.gic differ diff --git a/nwnds_module/bodach_merchant.git b/nwnds_module/bodach_merchant.git new file mode 100644 index 000000000..40ee72fd0 Binary files /dev/null and b/nwnds_module/bodach_merchant.git differ diff --git a/nwnds_module/bonebat001.utc b/nwnds_module/bonebat001.utc new file mode 100644 index 000000000..1b50378e7 Binary files /dev/null and b/nwnds_module/bonebat001.utc differ diff --git a/nwnds_module/bonebatprop.uti b/nwnds_module/bonebatprop.uti new file mode 100644 index 000000000..5859e7793 Binary files /dev/null and b/nwnds_module/bonebatprop.uti differ diff --git a/nwnds_module/boneclaw001.utc b/nwnds_module/boneclaw001.utc new file mode 100644 index 000000000..eb4071c02 Binary files /dev/null and b/nwnds_module/boneclaw001.utc differ diff --git a/nwnds_module/boneclawhide.uti b/nwnds_module/boneclawhide.uti new file mode 100644 index 000000000..1835d7dd6 Binary files /dev/null and b/nwnds_module/boneclawhide.uti differ diff --git a/nwnds_module/bonegolemclaw.uti b/nwnds_module/bonegolemclaw.uti new file mode 100644 index 000000000..ce98d5059 Binary files /dev/null and b/nwnds_module/bonegolemclaw.uti differ diff --git a/nwnds_module/bonegolemhide.uti b/nwnds_module/bonegolemhide.uti new file mode 100644 index 000000000..8af80b9e1 Binary files /dev/null and b/nwnds_module/bonegolemhide.uti differ diff --git a/nwnds_module/boneshortsword.uti b/nwnds_module/boneshortsword.uti new file mode 100644 index 000000000..be552a5f7 Binary files /dev/null and b/nwnds_module/boneshortsword.uti differ diff --git a/nwnds_module/bonesubsumpti001.uti b/nwnds_module/bonesubsumpti001.uti new file mode 100644 index 000000000..afadeb302 Binary files /dev/null and b/nwnds_module/bonesubsumpti001.uti differ diff --git a/nwnds_module/bonesubsumption.ncs b/nwnds_module/bonesubsumption.ncs new file mode 100644 index 000000000..577f1d37f Binary files /dev/null and b/nwnds_module/bonesubsumption.ncs differ diff --git a/nwnds_module/bonesubsumption.nss b/nwnds_module/bonesubsumption.nss new file mode 100644 index 000000000..a25b43f59 --- /dev/null +++ b/nwnds_module/bonesubsumption.nss @@ -0,0 +1,84 @@ +#include "x0_i0_spells" + +void doSubmDamage(object oTarget) +{ +/* object oDebug = GetObjectByTag("LookHere"); + if ( oDebug != OBJECT_INVALID ) + { + effect eDeb = EffectVisualEffect(VFX_IMP_DOOM); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeb,oDebug); + } */ + int nKillEm = 0; + if ( (!GetIsPC( oTarget ) ) || ( GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES ) ) + { + nKillEm = 1; + } + int nRoll = d4(2); + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH,nRoll); + int nTargetAbility = GetAbilityScore(oTarget, ABILITY_STRENGTH); + if ( ( (nTargetAbility - nRoll) < 3) && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DESTRUCTION); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + + nRoll = d4(2); + effect eDex = EffectAbilityDecrease(ABILITY_DEXTERITY,nRoll); + + nRoll = d4(2); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nRoll); + eStr = ExtraordinaryEffect(eStr); + eDex = ExtraordinaryEffect(eDex); + eCon = ExtraordinaryEffect(eCon); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStr,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDex,oTarget); + int nType = GetRacialType(oTarget); + if ( nType != RACIAL_TYPE_UNDEAD ) + { + nTargetAbility = GetAbilityScore(oTarget, ABILITY_CONSTITUTION); + if ( ( (nTargetAbility - nRoll) < 3) && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + } +} + +void main() +{ + + +// object oSpellOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + // Must check to see if target has bones + int nRaceType = GetRacialType(oTarget); + if (( nRaceType == RACIAL_TYPE_ELEMENTAL ) || ( nRaceType == RACIAL_TYPE_CONSTRUCT ) + || ( nRaceType == RACIAL_TYPE_OOZE ) ) + return; + // Ghosts don't have bones :P + int nAppearType = GetAppearanceType(oTarget); + if (( nAppearType == APPEARANCE_TYPE_ALLIP ) || ( nAppearType == APPEARANCE_TYPE_LANTERN_ARCHON ) + || ( nAppearType == APPEARANCE_TYPE_SHADOW ) || ( nAppearType == APPEARANCE_TYPE_SHADOW_FIEND ) + || ( nAppearType == APPEARANCE_TYPE_SPECTRE ) || ( nAppearType == APPEARANCE_TYPE_WRAITH )) + return; + int nSave; + // Will save for undead, fort for everyone else + if ( nRaceType == RACIAL_TYPE_UNDEAD ) + nSave = WillSave( oTarget, 22 ); + else + nSave = FortitudeSave( oTarget, 22 ); + if ( nSave ) + return; + effect eVis = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + DelayCommand(0.1,doSubmDamage(oTarget)); + +} diff --git a/nwnds_module/boneyard001.utc b/nwnds_module/boneyard001.utc new file mode 100644 index 000000000..9e587de04 Binary files /dev/null and b/nwnds_module/boneyard001.utc differ diff --git a/nwnds_module/boneyard002.utc b/nwnds_module/boneyard002.utc new file mode 100644 index 000000000..31ea0099a Binary files /dev/null and b/nwnds_module/boneyard002.utc differ diff --git a/nwnds_module/boneyard_ai.ncs b/nwnds_module/boneyard_ai.ncs new file mode 100644 index 000000000..06106b69b Binary files /dev/null and b/nwnds_module/boneyard_ai.ncs differ diff --git a/nwnds_module/boneyard_ai.nss b/nwnds_module/boneyard_ai.nss new file mode 100644 index 000000000..8fb2ac317 --- /dev/null +++ b/nwnds_module/boneyard_ai.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: Custom AI Demo Template +//:: x2_ai_demo +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + This is a template for those who want to + override the standard combat AI NWN uses. + + The code in this file effectivly replaces + the DetermineCombatRound() function in + nw_i0_generic.nss, which is the core of the + NWN combat AI. + + To override the default AI with this or any + other AI script you created, you can either + call the SetCreatureOverrideAIScript from + x2_inc_switches + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-08-21 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" +#include "x2_inc_switches" +#include "inc_AI" + +void main() +{ + // The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + + if ( !GetCanAct(OBJECT_SELF) ) + { + SetCreatureOverrideAIScriptFinished(); + return; + } + int bSummoned = GetLocalInt(OBJECT_SELF,"bones"); + if ( !bSummoned ) + { +// ActionCastFakeSpellAtLocation(SPELL_SUMMON_SHADOW,GetLocation(OBJECT_SELF)); + + ExecuteScript("summon_skelies",OBJECT_SELF); + +// SetCreatureOverrideAIScriptFinished(); + SetLocalInt(OBJECT_SELF,"bones",1); + return; + } + +} diff --git a/nwnds_module/boneyard_ud.ncs b/nwnds_module/boneyard_ud.ncs new file mode 100644 index 000000000..f02a5f599 Binary files /dev/null and b/nwnds_module/boneyard_ud.ncs differ diff --git a/nwnds_module/boneyard_ud.nss b/nwnds_module/boneyard_ud.nss new file mode 100644 index 000000000..333afd3c4 --- /dev/null +++ b/nwnds_module/boneyard_ud.nss @@ -0,0 +1,66 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_userdef +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On User Defined Event script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; +void main() +{ + int nUser = GetUserDefinedEventNumber(); + + if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT + { + + } + else if(nUser == EVENT_PERCEIVE) // PERCEIVE + { + object oPC = GetFirstPC(); + FloatingTextStringOnCreature("Boneyard spotted you!",oPC); + location lTarget = GetLocation(OBJECT_SELF); + ActionCastSpellAtLocation(806,lTarget); + } + 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 + { + + } + 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) + { + + } + + +} + + diff --git a/nwnds_module/boneyardhide.uti b/nwnds_module/boneyardhide.uti new file mode 100644 index 000000000..a065aa4dd Binary files /dev/null and b/nwnds_module/boneyardhide.uti differ diff --git a/nwnds_module/boss_neo_otyugh.utc b/nwnds_module/boss_neo_otyugh.utc new file mode 100644 index 000000000..067749d49 Binary files /dev/null and b/nwnds_module/boss_neo_otyugh.utc differ diff --git a/nwnds_module/boss_salik.utc b/nwnds_module/boss_salik.utc new file mode 100644 index 000000000..0b64a57fc Binary files /dev/null and b/nwnds_module/boss_salik.utc differ diff --git a/nwnds_module/bp_t_randloc.ncs b/nwnds_module/bp_t_randloc.ncs new file mode 100644 index 000000000..67e9fa749 Binary files /dev/null and b/nwnds_module/bp_t_randloc.ncs differ diff --git a/nwnds_module/bp_t_randloc.nss b/nwnds_module/bp_t_randloc.nss new file mode 100644 index 000000000..405c197db --- /dev/null +++ b/nwnds_module/bp_t_randloc.nss @@ -0,0 +1,222 @@ +//:://///////////////////////////////////////////// +//:: script(file)name: _incl_rndloc +//:: Type: includefile +//::////////////////////////////////////////////// +/* +Generates random Locations v1.0 +Notes: To be refined and functions added. +*/ +//::////////////////////////////////////////////// +//:: Created By: Hikade (nick: agem) +//::////////////////////////////////////////////// +// * (CONSTANTS) VARIABLES > +// NOTE: Only Vars here because i think editing the +// nwscript.nss is pointless due to the PATCH issue. +// Sorry this makes Function Declaration(s) less +// transparent, but this is the it is... +/* values form the nwscript.nss +int SHAPE_SPELLCYLINDER = 0; +int SHAPE_CONE = 1; +int SHAPE_CUBE = 2; +int SHAPE_SPELLCONE = 3; +int SHAPE_SPHERE = 4; +*/ +int BASE_SHAPE_CONE = SHAPE_CONE; // :=1 +int BASE_SHAPE_BOX = SHAPE_CUBE; // :=2 +int BASE_SHAPE_CIRCLE = SHAPE_SPHERE; // :=4 +int BASE_SHAPE_STAR = SHAPE_SPELLCYLINDER; // :=3 +int DIMENSION_2D = 0; +int DIMENSION_HEMISPHERE = 1; +int DIMENSION_HEMISPHERE_PLUS = 2; +int DIMENSION_3D = 3; +int DIMENSION_3D_PLUS = 4; +// * (CONSTANTS) VARIABLES < + +// * Function Declaration(s) > + +// Creates an Random Location in BASE_SHAPE_* (see Variables) +// - lTarget: Starting location from where to generate random location +// - iMaxRange : Maximal distance allowed for generated location +// - iMinRange : Minimal distance allowed for generated location +// -> When iMinRange=0 generated location can be on startingpoint +// -> When iMinRange=iMaxRange then generated location is always at Maximal Distance e.g. a empty circle +// - Shape : BASE_SHAPE_BOX = SHAPE_CUBE :=2 is Default (others see var BASE_SHAPE_*) +// - fAngle: Only used for certain BASE_SHAPE_*(see following) +// -> BASE_SHAPE_CONE Sets the center angle off Cone (Half Cone) +// -> BASE_SHAPE_STAR Sets Staring angel for first Starpoint +// - fAngle: Only used for certain BASE_SHAPE_*(see following) +// -> BASE_SHAPE_CONE +- angel of Cone center angel +// -> BASE_SHAPE_STAR Set value for ammount of Starpoints e.g. 5.0f = FIVE STAR +// - nDimension: Set Dimesion Type (see var DIMENSION_*) +// -> DIMENSION_2D :normal 2D you will most commonly use e.g. full circle +// -> DIMENSION_HEMISPHERE :Top Part of halfsphere, special: location z-value are porportional distance +// -> DIMENSION_HEMISPHERE_PLUS : Top Part of halfsphere and z-values will always be visible +// -> DIMENSION_3D: Full Sphere, ideal for floating things, special: location z-value are porportional distance +// -> DIMENSION_3D_Plus : Full Sphere, ideal for floating things, and z-values will mostly be visible +// Handy special cases: +// -> BASE_SHAPE_STAR with only 1 Starpoint is a Line with one direction. +// -> BASE_SHAPE_STAR with 2 Starpoints is a Line with a middlepoint that has in an left/right property +location RndLoc(location lTarget,int iMaxRange,int iMinRange=0,int nShape_Type=2,float fAngle=0.0f, float fAngleWidth=90.0f,int nDimension=0); +/* +float SetFacingType(float fDirection,location lTarget,object oSource=OBJECT_SELF); +*/ +void FillArea(); +// Creates an Random Sign 1/-1 +int RndSign(); +// Creates an Random Float +float RndFloat(int nMaxFloat); +// Creates an Random Angle +float RndAngle(int iDeg=360); +// Creates an Random Unit Vector +vector RndUnitVector(); +// Create an Random z-value for an vector based on DIMENSION_* +float RndZCoor(float fZCoor,int iMaxRange,int iMinRange,int nDimension=0); + +// * Function Implementation > +// Creates an Random Sign 1/-1 +int RndSign() { + int iRndSign; + if(Random(2)) iRndSign = -1; else iRndSign =1; + return iRndSign; +} + +// Creates an Random Float +float RndFloat(int nMaxFloat) { + float fRandom; + int iPrefixPoint = Random(nMaxFloat);//+1; + int iSufixPoint = Random(10)+1; + return fRandom = IntToFloat(iPrefixPoint)+(IntToFloat(iSufixPoint)/10); +} + +// Creates an Random Angle +float RndAngle(int iDeg=360) { + float fAngle; + int iRndDeg = Random(iDeg)+1; + int iRndMinute = Random(10)+1; + return fAngle = IntToFloat(iRndDeg)+(IntToFloat(iRndMinute)/10); +} + +// Creates an Random Unit Vector +vector RndUnitVector() { + vector vRndUnitVector = AngleToVector(RndAngle()); + return vRndUnitVector; +} +/* +float SetFacingType(float fDirection,location lTarget,object oSource=OBJECT_SELF) +{ +vector vTarget = GetPositionFromLocation(lTarget); +vector vSource =GetPosition(oSource); +vector vDirection = AngleToVector(fDurection); +float fFacing = VectorToAngle(vTarget-vSource)+ fDirection; +return fFacing; +} +*/ + +// Create an Random z-value for an vector based on DIMENSION_* +float RndZCoor(float fZCoor,int iMaxRange,int iMinRange,int nDimension) { + float fRndZCoor; + switch (nDimension) { + //DIMENSION_HEMISPHERE + case 1 : + { + int zOffSet = Random(iMaxRange-iMinRange); + fZCoor = fZCoor + (zOffSet + iMinRange); + } + break; + // DIMENSION_HEMISPHERE_PLUS + case 2 : + { + int zOffSet = Random(12); + fZCoor = fZCoor + (zOffSet); + } + break; + // DIMENSION_3D + case 3 : + { + int zOffSet = Random(iMaxRange-iMinRange); + fZCoor =fZCoor + (zOffSet + iMinRange)*RndSign(); + } + break; + //DIMENSION_3D_PLUS + case 4 : + { + int zOffSet = Random(8); + fZCoor = fZCoor + (zOffSet)*RndSign(); + } + break; + default: break; + } + return fRndZCoor=fZCoor; +} + +// Creates an Random Location in BASE_SHAPE_* +location RndLoc(location lTarget,int iMaxRange,int iMinRange=0,int nShape_Type=2, float fAngle=0.0f, float fAngleWidth=90.0f,int nDimension=0) { + object oTargetArea = GetAreaFromLocation(lTarget); + vector vTarget = GetPositionFromLocation(lTarget); + float fTargetfacing = GetFacingFromLocation(lTarget); + switch (nShape_Type) { + case 2: // BASE_SHAPE_BOX = SHAPE_CUBE :=2 + { + if(Random(2)) { + int xOffSet = Random(iMaxRange-iMinRange); + int yOffSet = Random(iMaxRange); + // To enable Q2,Q3,Q4 positions of vector + vTarget.x = vTarget.x + (xOffSet + iMinRange)*RndSign(); + vTarget.y = vTarget.y + (yOffSet)* RndSign(); + } else { + int xOffSet = Random(iMaxRange); + int yOffSet = Random(iMaxRange-iMinRange); + // To enable Q2,Q3,Q4 positions of vector + vTarget.x = vTarget.x + (xOffSet) *RndSign(); + vTarget.y = vTarget.y + (yOffSet + iMinRange)*RndSign(); + } + // Adds according z-value if demanded + vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension); + } + break; + case 4: // BASE_SHAPE_CIRCLE = SHAPE_SPHERE :=4 + { + int iRndRange = Random((iMaxRange+1)-iMinRange); + vector vRandomUnitVector = RndUnitVector(); + vRandomUnitVector *= IntToFloat(iRndRange+iMinRange); + vTarget += vRandomUnitVector; + // Adds according z-value if demanded + vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension); + } + break; + case 1: // BASE_SHAPE_CONE = SHAPE_CONE :=1 + { + int iRndRange = Random((iMaxRange+1)-iMinRange); + float fRndAngle = RndAngle(FloatToInt(fAngleWidth)/2*RndSign()); + fRndAngle += fAngle; + vector vRndVector = AngleToVector(fRndAngle); + vRndVector *= IntToFloat(iRndRange+iMinRange); + vTarget += vRndVector; + // Adds according z-value if demanded + vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension); + } + break; + /* //difference to SHAPE_CONE unknown and a CYLINDER can be made by BASE_SHAPE_CIRCLE + case SHAPE_SPELLCONE: + { + }break; + */ + case 3: // BASE_SHAPE_STAR = SHAPE_SPELLCYLINDER :=3 + { + int iRndRange = Random((iMaxRange+1)-iMinRange); + float fStartingAngle = fAngle; + float fAngleStep = (360.0f/fAngleWidth); + float fRndAngel = Random(FloatToInt(fAngleWidth)+1)*fAngleStep; + vector vRandomVector = AngleToVector(fRndAngel)*IntToFloat(iRndRange+iMinRange); + vTarget += vRandomVector; + // Adds according z-value if demanded + vTarget.z =RndZCoor(vTarget.z,iMaxRange,iMinRange,nDimension); + } + break; + default : break; + } + // return Random Location of wished type + return lTarget= Location(oTargetArea,vTarget,fTargetfacing); +} + +//void main (){} diff --git a/nwnds_module/bp_ud_fiend.ncs b/nwnds_module/bp_ud_fiend.ncs new file mode 100644 index 000000000..d20ed5665 Binary files /dev/null and b/nwnds_module/bp_ud_fiend.ncs differ diff --git a/nwnds_module/bp_ud_fiend.nss b/nwnds_module/bp_ud_fiend.nss new file mode 100644 index 000000000..fb319a5f1 --- /dev/null +++ b/nwnds_module/bp_ud_fiend.nss @@ -0,0 +1,77 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_userdef +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On User Defined Event script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; +void main() +{ + int nUser = GetUserDefinedEventNumber(); + + if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT + { + + } + 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 + { + + } + 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) + { + // * Allow { Comments } in the name of a creature. + string sName = GetName(OBJECT_SELF); + int nLength = GetStringLength(sName); + int nStart = FindSubString(sName,"{"); + int nEnd = FindSubString(sName,"}"); + if((nStart != -1)&&(nEnd != -1)) { + string sLeft = GetStringLeft(sName,nStart-1); + string sRight = GetStringRight(sName,(nLength - nEnd)-1); + sName = sLeft + sRight; + SetName(OBJECT_SELF,sName); + } + if(GetResRef(OBJECT_SELF)=="bp_b_barbazu") { + effect eVis = EffectVisualEffect(VFX_EYES_RED_FLAME_DWARF_MALE); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + if(GetResRef(OBJECT_SELF)=="bp_t_dretch") { + if(d100()<=98) + DecrementRemainingSpellUses(OBJECT_SELF,SPELL_STINKING_CLOUD); + } + } + else if (nUser == EVENT_USER_DEFINED_POSTSPAWN) + { + + } +} diff --git a/nwnds_module/brainseed_aura.ncs b/nwnds_module/brainseed_aura.ncs new file mode 100644 index 000000000..c9d511ed2 Binary files /dev/null and b/nwnds_module/brainseed_aura.ncs differ diff --git a/nwnds_module/brainseed_aura.nss b/nwnds_module/brainseed_aura.nss new file mode 100644 index 000000000..5872c7dd9 --- /dev/null +++ b/nwnds_module/brainseed_aura.nss @@ -0,0 +1,11 @@ +void main() +{ + //Set and apply AOE object + effect eVis = EffectVisualEffect(VFX_DUR_INVISIBILITY); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, OBJECT_SELF); + + effect eAOE = EffectAreaOfEffect(AOE_MOB_DRAGON_FEAR,"brainseed_aura1","brainseed_aura2","brainseed_aura3"); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/brainseed_aura1.ncs b/nwnds_module/brainseed_aura1.ncs new file mode 100644 index 000000000..281bb06af Binary files /dev/null and b/nwnds_module/brainseed_aura1.ncs differ diff --git a/nwnds_module/brainseed_aura1.nss b/nwnds_module/brainseed_aura1.nss new file mode 100644 index 000000000..4f233579d --- /dev/null +++ b/nwnds_module/brainseed_aura1.nss @@ -0,0 +1,45 @@ +#include "NW_I0_SPELLS" +#include "NW_I0_GENERIC" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + int nDC = 11 + GetAbilityModifier(ABILITY_CONSTITUTION, oCaster); + effect eImp = EffectVisualEffect(VFX_IMP_DAZED_S); + +/* effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDaze = EffectDazed(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDaze,eVis); + eLink = EffectLinkEffects(eLink,eDur); */ + + effect eVis2 = EffectVisualEffect(VFX_IMP_POISON_S); + int nDrain = d8(); + effect eDrain = EffectDamage(nDrain); + effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink2 = EffectLinkEffects(eDrain,eDur2); + eLink2 = SupernaturalEffect(eLink2); + + effect eHealing = EffectHeal(nDrain); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + + if(GetIsEnemy(oTarget, oCaster)) + { + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealing,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + } + } + else + { + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink2,oTarget,RoundsToSeconds(10)); + } + } + } diff --git a/nwnds_module/brainseed_aura2.ncs b/nwnds_module/brainseed_aura2.ncs new file mode 100644 index 000000000..50bfdff2c Binary files /dev/null and b/nwnds_module/brainseed_aura2.ncs differ diff --git a/nwnds_module/brainseed_aura2.nss b/nwnds_module/brainseed_aura2.nss new file mode 100644 index 000000000..d361b9fe3 --- /dev/null +++ b/nwnds_module/brainseed_aura2.nss @@ -0,0 +1,57 @@ +#include "NW_I0_SPELLS" +#include "NW_I0_GENERIC" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + int nDC = 11 + GetAbilityModifier(ABILITY_CONSTITUTION, oCaster); + + effect eImp = EffectVisualEffect(VFX_IMP_DAZED_S); + +/* effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDaze = EffectDazed(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDaze,eVis); + eLink = EffectLinkEffects(eLink,eDur); */ + + effect eVis2 = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + int nDrain; + effect eDrain; + effect eLink2; + effect eHealing; + + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { + nDrain = d8(); + effect eDrain = EffectDamage(nDrain); + + eLink2 = EffectLinkEffects(eDrain,eDur2); + eLink2 = SupernaturalEffect(eLink2); + eHealing = EffectHeal(nDrain); + + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealing,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + + } + } + else + { + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oTarget, RoundsToSeconds(10)); + } + } + } + oTarget = GetNextInPersistentObject(); + } diff --git a/nwnds_module/brainseed_aura3.ncs b/nwnds_module/brainseed_aura3.ncs new file mode 100644 index 000000000..033f9b630 Binary files /dev/null and b/nwnds_module/brainseed_aura3.ncs differ diff --git a/nwnds_module/brainseed_aura3.nss b/nwnds_module/brainseed_aura3.nss new file mode 100644 index 000000000..5c2b75c3b --- /dev/null +++ b/nwnds_module/brainseed_aura3.nss @@ -0,0 +1,30 @@ +#include "NW_I0_SPELLS" +//#include "x2_inc_spellhook" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + effect eAOE; + int nEffectType; + + int bValid = FALSE; + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator(OBJECT_SELF)) + { + nEffectType = GetEffectType(eAOE); + if(GetEffectSpellId(eAOE) == -1) + { + RemoveEffect(oTarget, eAOE); + bValid = TRUE; + } + + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } +} diff --git a/nwnds_module/braxatprops.uti b/nwnds_module/braxatprops.uti new file mode 100644 index 000000000..0a4f0b836 Binary files /dev/null and b/nwnds_module/braxatprops.uti differ diff --git a/nwnds_module/bread.utp b/nwnds_module/bread.utp new file mode 100644 index 000000000..82f0511ce Binary files /dev/null and b/nwnds_module/bread.utp differ diff --git a/nwnds_module/breathdrinker.uti b/nwnds_module/breathdrinker.uti new file mode 100644 index 000000000..2045a0db1 Binary files /dev/null and b/nwnds_module/breathdrinker.uti differ diff --git a/nwnds_module/brownpuddinghide.uti b/nwnds_module/brownpuddinghide.uti new file mode 100644 index 000000000..27c5cc759 Binary files /dev/null and b/nwnds_module/brownpuddinghide.uti differ diff --git a/nwnds_module/brownpuddingslam.uti b/nwnds_module/brownpuddingslam.uti new file mode 100644 index 000000000..e9dbb3db3 Binary files /dev/null and b/nwnds_module/brownpuddingslam.uti differ diff --git a/nwnds_module/bt_vermin_props.uti b/nwnds_module/bt_vermin_props.uti new file mode 100644 index 000000000..e63fff349 Binary files /dev/null and b/nwnds_module/bt_vermin_props.uti differ diff --git a/nwnds_module/bulette.utc b/nwnds_module/bulette.utc new file mode 100644 index 000000000..9a96e5b6d Binary files /dev/null and b/nwnds_module/bulette.utc differ diff --git a/nwnds_module/bvannenhide.uti b/nwnds_module/bvannenhide.uti new file mode 100644 index 000000000..1fd6f5e10 Binary files /dev/null and b/nwnds_module/bvannenhide.uti differ diff --git a/nwnds_module/campfr001.utp b/nwnds_module/campfr001.utp new file mode 100644 index 000000000..5a7ea24ee Binary files /dev/null and b/nwnds_module/campfr001.utp differ diff --git a/nwnds_module/caravangold.ncs b/nwnds_module/caravangold.ncs new file mode 100644 index 000000000..c5c323df0 Binary files /dev/null and b/nwnds_module/caravangold.ncs differ diff --git a/nwnds_module/caravangold.nss b/nwnds_module/caravangold.nss new file mode 100644 index 000000000..1c5b45e8d --- /dev/null +++ b/nwnds_module/caravangold.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName goldforbrill +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/12/02 8:36:58 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(GetGold(GetPCSpeaker()) < 49) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/caravangold2.ncs b/nwnds_module/caravangold2.ncs new file mode 100644 index 000000000..2ce677ed7 Binary files /dev/null and b/nwnds_module/caravangold2.ncs differ diff --git a/nwnds_module/caravangold2.nss b/nwnds_module/caravangold2.nss new file mode 100644 index 000000000..250138507 --- /dev/null +++ b/nwnds_module/caravangold2.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName goldforbrill +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/12/02 8:36:58 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(GetGold(GetPCSpeaker()) < 149) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ccs_change_mdl2.ncs b/nwnds_module/ccs_change_mdl2.ncs new file mode 100644 index 000000000..de8249ece Binary files /dev/null and b/nwnds_module/ccs_change_mdl2.ncs differ diff --git a/nwnds_module/ccs_change_mdl2.nss b/nwnds_module/ccs_change_mdl2.nss new file mode 100644 index 000000000..5412405cb --- /dev/null +++ b/nwnds_module/ccs_change_mdl2.nss @@ -0,0 +1,20 @@ +// Set this to the max cloak models you have in your mod +//const int CCS_MAX_CLOAK_MODELS = 14; // Standard NWN Cloaks +const int CCS_MAX_CLOAK_MODELS = 79; // Standard + Lisa's + an invisible Cloak + +void main() +{ + // Find current cloak model and increment by 1 + int nModel = GetLocalInt(OBJECT_SELF, "current_cloak_model"); + nModel = nModel + 1; + // Reset to 1 if past max + if(nModel > CCS_MAX_CLOAK_MODELS) nModel = 60; + SetLocalInt(OBJECT_SELF, "current_cloak_model", nModel); + // Unequip current cloak + object oOldCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, OBJECT_SELF); + AssignCommand(OBJECT_SELF, ActionUnequipItem(oOldCloak)); + // Equip next cloak + object oNewCloak = GetItemPossessedBy(OBJECT_SELF, "cloak_model_" + IntToString(nModel)); + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewCloak, INVENTORY_SLOT_CLOAK)); + DelayCommand(1.0, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 5.0)); +} diff --git a/nwnds_module/ccs_change_model.ncs b/nwnds_module/ccs_change_model.ncs new file mode 100644 index 000000000..116295208 Binary files /dev/null and b/nwnds_module/ccs_change_model.ncs differ diff --git a/nwnds_module/ccs_change_model.nss b/nwnds_module/ccs_change_model.nss new file mode 100644 index 000000000..0346219ff --- /dev/null +++ b/nwnds_module/ccs_change_model.nss @@ -0,0 +1,20 @@ +// Set this to the max cloak models you have in your mod +//const int CCS_MAX_CLOAK_MODELS = 14; // Standard NWN Cloaks +const int CCS_MAX_CLOAK_MODELS = 59; // Standard + Lisa's + an invisible Cloak + +void main() +{ + // Find current cloak model and increment by 1 + int nModel = GetLocalInt(OBJECT_SELF, "current_cloak_model"); + nModel = nModel + 1; + // Reset to 1 if past max + if(nModel > CCS_MAX_CLOAK_MODELS) nModel = 1; + SetLocalInt(OBJECT_SELF, "current_cloak_model", nModel); + // Unequip current cloak + object oOldCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, OBJECT_SELF); + AssignCommand(OBJECT_SELF, ActionUnequipItem(oOldCloak)); + // Equip next cloak + object oNewCloak = GetItemPossessedBy(OBJECT_SELF, "cloak_model_" + IntToString(nModel)); + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewCloak, INVENTORY_SLOT_CLOAK)); + DelayCommand(1.0, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 5.0)); +} diff --git a/nwnds_module/ccs_cloak_ch2.dlg b/nwnds_module/ccs_cloak_ch2.dlg new file mode 100644 index 000000000..982302c35 Binary files /dev/null and b/nwnds_module/ccs_cloak_ch2.dlg differ diff --git a/nwnds_module/ccs_cloak_change.dlg b/nwnds_module/ccs_cloak_change.dlg new file mode 100644 index 000000000..76a7fcdc2 Binary files /dev/null and b/nwnds_module/ccs_cloak_change.dlg differ diff --git a/nwnds_module/ccs_copy_cloak.ncs b/nwnds_module/ccs_copy_cloak.ncs new file mode 100644 index 000000000..eb03f390f Binary files /dev/null and b/nwnds_module/ccs_copy_cloak.ncs differ diff --git a/nwnds_module/ccs_copy_cloak.nss b/nwnds_module/ccs_copy_cloak.nss new file mode 100644 index 000000000..2323d5946 --- /dev/null +++ b/nwnds_module/ccs_copy_cloak.nss @@ -0,0 +1,50 @@ +object MatchItem(object oItem, object oDonor, int nType, int nIndex) +{ + int nValue = GetItemAppearance(oDonor,nType,nIndex); + object oNew = CopyItemAndModify(oItem,nType,nIndex,nValue); + DestroyObject(oItem); + return oNew; +} + +object ModifyCloakModel(object oItem, int nNewValue) +{ + // Bodge for CopyItemAndModify not working on cloak appearance in NWN v1.68 + // Create a new cloak with the correct model + object oNewItem = CreateItemOnObject("cloak_model_" + IntToString(nNewValue),OBJECT_SELF); + // Copy across all the colours for it + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_CLOTH1); + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_CLOTH2); + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_LEATHER1); + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_LEATHER2); + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_METAL1); + oNewItem = MatchItem(oNewItem,oItem,ITEM_APPR_TYPE_ARMOR_COLOR,ITEM_APPR_ARMOR_COLOR_METAL2); + itemproperty iProp = GetFirstItemProperty(oItem); + while (GetIsItemPropertyValid(iProp)) + { + if (GetItemPropertyDurationType(iProp) == DURATION_TYPE_PERMANENT) + { + AddItemProperty(DURATION_TYPE_PERMANENT,iProp,oNewItem); + iProp = GetNextItemProperty(oItem); + } + } + SetName(oNewItem,GetName(oItem)); + return oNewItem; +} + +void main() +{ + object oPC = GetPCSpeaker(); + // Get the current cloak model shown on NPC + int nModel = GetLocalInt(OBJECT_SELF, "current_cloak_model"); + object oOldCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC); + // Unequip PCs cloak + AssignCommand(oPC, ActionUnequipItem(oOldCloak)); + // Modify the cloak + object oNewCloak = ModifyCloakModel(oOldCloak, nModel); + DestroyObject(oOldCloak); + // Copy the cloak from the NPC to the PC + object oCloak = CopyItem(oNewCloak, oPC, TRUE); + DestroyObject(oNewCloak, 1.0); + // Equip it for them + AssignCommand(oPC, ActionEquipItem(oCloak, INVENTORY_SLOT_CLOAK)); +} diff --git a/nwnds_module/ccs_has_cloak.ncs b/nwnds_module/ccs_has_cloak.ncs new file mode 100644 index 000000000..0064063fe Binary files /dev/null and b/nwnds_module/ccs_has_cloak.ncs differ diff --git a/nwnds_module/ccs_has_cloak.nss b/nwnds_module/ccs_has_cloak.nss new file mode 100644 index 000000000..a67448be7 --- /dev/null +++ b/nwnds_module/ccs_has_cloak.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + object oCloak = GetItemInSlot(INVENTORY_SLOT_CLOAK, GetPCSpeaker()); + if(oCloak == OBJECT_INVALID) + return TRUE; + return FALSE; +} diff --git a/nwnds_module/cfd_core.are b/nwnds_module/cfd_core.are new file mode 100644 index 000000000..ec5f21153 Binary files /dev/null and b/nwnds_module/cfd_core.are differ diff --git a/nwnds_module/cfd_core.gic b/nwnds_module/cfd_core.gic new file mode 100644 index 000000000..f9e222059 Binary files /dev/null and b/nwnds_module/cfd_core.gic differ diff --git a/nwnds_module/cfd_core.git b/nwnds_module/cfd_core.git new file mode 100644 index 000000000..a22ecc42e Binary files /dev/null and b/nwnds_module/cfd_core.git differ diff --git a/nwnds_module/cfd_crust.are b/nwnds_module/cfd_crust.are new file mode 100644 index 000000000..a4fe36ab5 Binary files /dev/null and b/nwnds_module/cfd_crust.are differ diff --git a/nwnds_module/cfd_crust.gic b/nwnds_module/cfd_crust.gic new file mode 100644 index 000000000..cb097e283 Binary files /dev/null and b/nwnds_module/cfd_crust.gic differ diff --git a/nwnds_module/cfd_crust.git b/nwnds_module/cfd_crust.git new file mode 100644 index 000000000..bf6d004fa Binary files /dev/null and b/nwnds_module/cfd_crust.git differ diff --git a/nwnds_module/cfd_innershell.are b/nwnds_module/cfd_innershell.are new file mode 100644 index 000000000..5bbee5f21 Binary files /dev/null and b/nwnds_module/cfd_innershell.are differ diff --git a/nwnds_module/cfd_innershell.gic b/nwnds_module/cfd_innershell.gic new file mode 100644 index 000000000..73bbb3e3a Binary files /dev/null and b/nwnds_module/cfd_innershell.gic differ diff --git a/nwnds_module/cfd_innershell.git b/nwnds_module/cfd_innershell.git new file mode 100644 index 000000000..a342075b7 Binary files /dev/null and b/nwnds_module/cfd_innershell.git differ diff --git a/nwnds_module/cha_drain.ncs b/nwnds_module/cha_drain.ncs new file mode 100644 index 000000000..c1ce1878e Binary files /dev/null and b/nwnds_module/cha_drain.ncs differ diff --git a/nwnds_module/cha_drain.nss b/nwnds_module/cha_drain.nss new file mode 100644 index 000000000..ed3860f7b --- /dev/null +++ b/nwnds_module/cha_drain.nss @@ -0,0 +1,51 @@ +#include "NW_I0_SPELLS" + + +void DoAbilityDamage(object oTarget, object oCaster) +{ + effect eImp = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + + // Cha Damage + int nDC = 10 + GetHitDice(oCaster) /2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + int nDam = 2; + int nHeal = 10; + + int nType = ABILITY_CHARISMA; + + if ( MySavingThrow(SAVING_THROW_FORT,oTarget,nDC,SAVING_THROW_TYPE_NONE,oCaster) ) + { + nDam = 1; + nHeal = 5; + } + effect eDam = EffectAbilityDecrease(nType,nDam); + eDam = SupernaturalEffect(eDam); + eDam = ExtraordinaryEffect(eDam); + + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDam,oTarget); + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + return; + + effect eHeal = EffectHeal(nHeal); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_S); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCaster); + + + + +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + DelayCommand(0.1,DoAbilityDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/charismadown.ncs b/nwnds_module/charismadown.ncs new file mode 100644 index 000000000..3b99a45c8 Binary files /dev/null and b/nwnds_module/charismadown.ncs differ diff --git a/nwnds_module/charismadown.nss b/nwnds_module/charismadown.nss new file mode 100644 index 000000000..41bd1ab01 --- /dev/null +++ b/nwnds_module/charismadown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_CHARISMA, -2); +} diff --git a/nwnds_module/charismaup.ncs b/nwnds_module/charismaup.ncs new file mode 100644 index 000000000..ddf485a19 Binary files /dev/null and b/nwnds_module/charismaup.ncs differ diff --git a/nwnds_module/charismaup.nss b/nwnds_module/charismaup.nss new file mode 100644 index 000000000..1001262b6 --- /dev/null +++ b/nwnds_module/charismaup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_CHARISMA, 2); +} diff --git a/nwnds_module/charm_aura.ncs b/nwnds_module/charm_aura.ncs new file mode 100644 index 000000000..6fb264c92 Binary files /dev/null and b/nwnds_module/charm_aura.ncs differ diff --git a/nwnds_module/charm_aura.nss b/nwnds_module/charm_aura.nss new file mode 100644 index 000000000..2042ddd3f --- /dev/null +++ b/nwnds_module/charm_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_UNNATURAL,"charm_aura1","charm_aura2","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/charm_aura1.ncs b/nwnds_module/charm_aura1.ncs new file mode 100644 index 000000000..2c7e8a8c6 Binary files /dev/null and b/nwnds_module/charm_aura1.ncs differ diff --git a/nwnds_module/charm_aura1.nss b/nwnds_module/charm_aura1.nss new file mode 100644 index 000000000..3286839ea --- /dev/null +++ b/nwnds_module/charm_aura1.nss @@ -0,0 +1,33 @@ +#include "NW_I0_SPELLS" + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + int nLevel = GetHitDice(oCaster); + int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + + if ( nLevel > 20 ) + nLevel = 20; + + float fDuration = HoursToSeconds(nLevel); + + if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster ) + return; + + effect eCharm = EffectCharmed(); + effect eImp = EffectVisualEffect(VFX_IMP_CHARM); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eCharm,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration); + } +} diff --git a/nwnds_module/charm_aura2.ncs b/nwnds_module/charm_aura2.ncs new file mode 100644 index 000000000..d7ef20ad3 Binary files /dev/null and b/nwnds_module/charm_aura2.ncs differ diff --git a/nwnds_module/charm_aura2.nss b/nwnds_module/charm_aura2.nss new file mode 100644 index 000000000..5f7244b9f --- /dev/null +++ b/nwnds_module/charm_aura2.nss @@ -0,0 +1,35 @@ +#include "NW_I0_SPELLS" + +void main() +{ + object oCaster = GetAreaOfEffectCreator(); + + int nLevel = GetHitDice(oCaster); + int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + if ( nLevel > 20 ) + nLevel = 20; + + float fDuration = HoursToSeconds(nLevel); + + effect eCharm = EffectCharmed(); + effect eImp = EffectVisualEffect(VFX_IMP_CHARM); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eCharm,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + object oTarget = GetFirstInPersistentObject(); + while ( GetIsObjectValid(oTarget) ) + { + if ( oTarget != oCaster && GetIsEnemy(oTarget,oCaster) ) + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration); + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/cheetahhide.uti b/nwnds_module/cheetahhide.uti new file mode 100644 index 000000000..72d95ec2e Binary files /dev/null and b/nwnds_module/cheetahhide.uti differ diff --git a/nwnds_module/chess_include.nss b/nwnds_module/chess_include.nss new file mode 100644 index 000000000..7a6bd2856 --- /dev/null +++ b/nwnds_module/chess_include.nss @@ -0,0 +1,495 @@ +// Chess Include + +float CHESS_STEP_SIZE = 2.54; +string WHITE = "White"; +string BLACK = "Black"; +string CHESS_ORIGIN_TAG = "ChessboardOrigin"; + +void SetupCustomChessTokens(string side); + +int X_CH_BASE_TOKEN = 300; + +// establishes all the tokens used in the dialog +void SetupCustomChessTokens(string side); + +// returns a vector pointing the the Position of the xy square. +vector GetChessboardLocation(int x, int y); + +// returns an object reference to the chesspiece with a tag side + id +object GetChessPiece(string side, int id, int Nth = 0); + +// returns the string name of a chess piece's location +string GetChessSquareNameFromPiece(object piece); + +// returns the string name of a square +string GetChessSquareName(int x, int y); + +// returns the string name for the piece +string GetChessPieceNameFromPiece(object piece); + +// returns the string name for the piece id # +string GetChessPieceName(int n); + +// returns the side-name extracted from the tag +string GetSideFromTag(string tag); + +// returns 1 if the location is a valid board location, 0 otherwise +int IsValidSquare(int x, int y); + +// returns 0 if no, 1 if occupied by friendly, 2 if occupied by enemy +int IsSquareOccupied(int x, int y, string sFriendly = "White"); + +object GetPieceAtSquare(int x, int y); + +// checks to see if the piece could be slid (spaces) times. Checks for +// intervening pieces of either color. The destination space causes a +// false return only when a friendly piece is there. +int TestSlideMove(string sSide, int iX, int iY, int dX, int dY, int spaces); + +int TestIsMyTurn(string sSide); + +void ToggleToMove(); + +int TestPieceExistance(string side, int piece_num); + +// returns the facing degrees for which way white is supposed to be facing +float GetSideFacing(string sSide); + +// returns the facing degrees for which way black is supposed to be facing. +float GetBlackFacing(); + +/* For some reason the compiler complains regularly about no StartingConditional.. this is here to uncomment + * and compile, then recomment, and recompile. Awkward, annoying, but it works. + */ +/* +int StartingConditional() +{ + return TRUE; +} +/**/ +int TestIsMyTurn(string sSide) +{ + string sToMove = GetLocalString(GetArea(OBJECT_SELF), "CurrentMove"); + + if (sToMove == sSide) + { + return TRUE; + } + + if (sToMove == "" && sSide == WHITE) + { + return TRUE; + } + return FALSE; +} + +void ToggleToMove() +{ + object oArea = GetArea(OBJECT_SELF); + string sToMove = GetLocalString(oArea, "CurrentMove"); + + if (sToMove == BLACK) + { + SetLocalString(oArea, "CurrentMove", WHITE); + } else { + SetLocalString(oArea, "CurrentMove", BLACK); + } +} + +object GetChessOrigin() +{ + int o_num = 0; + object oOrigin; + object oArea; + + oArea = GetArea(OBJECT_SELF); + oOrigin = GetObjectByTag(CHESS_ORIGIN_TAG); + + while (oOrigin != OBJECT_INVALID && oArea != GetArea(oOrigin)) + { + o_num = o_num + 1; + oOrigin = GetObjectByTag(CHESS_ORIGIN_TAG, o_num); + } + + return oOrigin; +} + +vector GetChessboardLocation(int x, int y) +{ + object oArea = GetArea(OBJECT_SELF); + + if (GetLocalInt(oArea, "HaveSetup") == 0) + { + object oOrigin = GetChessOrigin(); + if (oOrigin == OBJECT_INVALID) + { + SpeakString("Error: cannot find origin of chessboard."); + return Vector(0.0, 0.0, 0.0); + } + + //SpeakString("White facing is " + FloatToString(GetFacing(oOrigin))); + int iXbY; + int iXbX; + int iYbY; + int iYbX; + float facing = GetFacing(oOrigin); + if ((facing > -45.0 && facing < 45.0) || (facing > 315.0 && facing < 405.0)) + { + iXbX = 0; + iXbY = 1; + iYbX = -1; + iYbY = 0; + } else if (facing > 45.0 && facing < 135.0) { + iXbX = 1; + iXbY = 0; + iYbX = 0; + iYbY = 1; + } else if (facing > 135.0 && facing < 225.0) { + iXbX = 0; + iXbY = -1; + iYbX = 1; + iYbY = 0; + } else { + iXbX = -1; + iXbY = 0; + iYbX = 0; + iYbY = -1; + } + vector v = GetPosition(oOrigin); + + SetLocalFloat(oArea, "OriginX", v.x); + SetLocalFloat(oArea, "OriginY", v.y); + SetLocalFloat(oArea, "WhiteFacing", facing); + SetLocalFloat(oArea, "BlackFacing", facing + 180.0); + + SetLocalInt(oArea, "XbX", iXbX); + SetLocalInt(oArea, "XbY", iXbY); + SetLocalInt(oArea, "YbX", iYbX); + SetLocalInt(oArea, "YbY", iYbY); + + SetLocalInt(oArea, "HaveSetup", 1); + } + vector vVec = Vector(CHESS_STEP_SIZE * (y * GetLocalInt(oArea, "XbY") + x * GetLocalInt(oArea, "XbX")), + CHESS_STEP_SIZE * (y * GetLocalInt(oArea, "YbY") + x * GetLocalInt(oArea, "YbX"))); + vVec = vVec + Vector(GetLocalFloat(oArea, "OriginX"), GetLocalFloat(oArea, "OriginY")); + return vVec; +} + +object GetChessPiece(string side, int id, int Nth) +{ + string sTag = side + IntToString(id); + + int object_num = 0; + object oPiece = GetObjectByTag(sTag, object_num); + object oArea = GetArea(OBJECT_SELF); + + while (oPiece != OBJECT_INVALID && Nth >= 0) + { + if (oArea == GetArea(oPiece)) // correct board + { + if (Nth == 0) + { + return oPiece; + } else { + Nth = Nth - 1; + } + } + object_num = object_num + 1; + oPiece = GetObjectByTag(sTag, object_num); + } + + return oPiece; +} + +string GetChessSquareNameFromPiece(object piece) +{ + return GetChessSquareName(GetLocalInt(piece, "LocationX"), GetLocalInt(piece, "LocationY")); +} + +string GetChessSquareName(int x, int y) +{ + string sName; + + switch (x) + { + case 0: sName = "A"; break; + case 1: sName = "B"; break; + case 2: sName = "C"; break; + case 3: sName = "D"; break; + case 4: sName = "E"; break; + case 5: sName = "F"; break; + case 6: sName = "G"; break; + case 7: sName = "H"; break; + } + + sName = sName + IntToString(y + 1); + + return sName; +} + +string GetChessPieceNameFromPiece(object piece) +{ + int iID = StringToInt(GetSubString(GetTag(piece),5, 2)); + return GetChessPieceName(iID); +} + +string GetChessPieceName(int n) +{ + string sName; + + switch(n) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + sName = "Pawn"; + break; + case 8: case 9: + sName = "Rook"; + break; + case 10: case 11: + sName = "Knight"; + break; + case 12: case 13: + sName = "Bishop"; + break; + case 14: + sName = "Queen"; + break; + case 15: + sName = "King"; + break; + } + return sName; +} + +int IsValidSquare(int x, int y) +{ + if (x >= 0 && y >= 0) + { + if (x <= 7 && y <= 7) + { + return TRUE; + } + } + return FALSE; +} + +int IsSquareOccupied(int x, int y, string sFriendly = "White") +{ + string sEnemy; + if (sFriendly == WHITE) + { + sEnemy = BLACK; + } else { + sEnemy = WHITE; + } + + object oAtDestination = GetPieceAtSquare(x, y); + if (oAtDestination == OBJECT_INVALID) + return 0; + string sSide = GetSubString(GetTag(oAtDestination), 0, 5); + if (sSide == sFriendly) + { + return 1; + } + if (sSide == sEnemy) + { + return 2; + } + return 0; +} + +object GetPieceAtSquare(int x, int y) +{ + vector vDestination = GetChessboardLocation(x, y); + location lTarget = Location(GetArea(OBJECT_SELF), vDestination, GetSideFacing(WHITE)); + + // check for an object there. + object oAtDestination = GetFirstObjectInShape(SHAPE_CUBE, 1.0, lTarget); + + while (oAtDestination != OBJECT_INVALID) + { + string sSide = GetSubString(GetTag(oAtDestination), 0, 5); + if (sSide == WHITE || sSide == BLACK) + return oAtDestination; + oAtDestination = GetNextObjectInShape(SHAPE_CUBE, 1.0, lTarget); + } + return OBJECT_INVALID; +} + + +string GetSideFromTag(string tag) +{ + return GetSubString(tag,0, 5); +} + +int TestPieceExistance(string side, int piece_num) +{ + object o = GetChessPiece(GetSideFromTag(side), piece_num); + return GetIsObjectValid(o); +} + +int TestSlideMove(string sSide, int iX, int iY, int dX, int dY, int spaces) +{ + if (sSide == BLACK) + { + dX = -dX; + dY = -dY; + } + int iSumX = dX; + int iSumY = dY; + + int i = 1; + while (i < spaces) + { + if (IsValidSquare(iX + iSumX, iY + iSumY) == 0 || IsSquareOccupied(iX + iSumX, iY + iSumY) != 0) + return FALSE; + iSumX = iSumX + dX; + iSumY = iSumY + dY; + i = i + 1; + } + + if (IsValidSquare(iX + iSumX, iY + iSumY)) + { + if (IsSquareOccupied(iX + iSumX, iY + iSumY, sSide) != 1) + { + return TRUE; + } + } + return FALSE; +} + + +float GetSideFacing(string sSide) +{ + return GetLocalFloat(GetArea(OBJECT_SELF), sSide + "Facing"); +} + +void SetupCustomChessTokens(string side) +{ + object oP; + int i = 0; + while (i < 16) + { + oP = GetChessPiece(side, i); + SetCustomToken(X_CH_BASE_TOKEN + i, GetChessSquareNameFromPiece(oP)); + i = i + 1; + } + int j = 1; + while (j < 9 && oP != OBJECT_INVALID) + { + oP = GetChessPiece(side, 14, j); + SetCustomToken(X_CH_BASE_TOKEN + 15 + j, GetChessSquareNameFromPiece(oP)); + j = j + 1; + } +} + +int GetStartingX(int piece_num) +{ + if (piece_num < 8 && piece_num >= 0) + { + return piece_num; + } else { + if (piece_num % 2 == 0) + { + return (piece_num - 8)/2; + } else { + return 7 - (piece_num - 8)/2; + } + } +} + + +void SummonArmy(string sPrefix, string sSide) +{ + int iIsWhite; + + int iX, iY; + + if (sSide == WHITE) + { + iIsWhite = TRUE; + iY = 1; // the pawn row + } else { + iIsWhite = FALSE; + iY = 6; // the pawn row + } + + object oArea = GetArea(OBJECT_SELF); + + int iPiece = 0; + vector vLoc; + object oNewPiece; + + GetChessboardLocation(0, 0); // initialize the facings. + float fFacing = GetSideFacing(sSide); + + while (iPiece < 16) + { + iX = GetStartingX(iPiece); + oNewPiece = CreateObject(OBJECT_TYPE_CREATURE, sPrefix + "_" + sSide + IntToString(iPiece), + Location(oArea, GetChessboardLocation(iX, iY), fFacing), TRUE); + SetLocalInt(oNewPiece, "LocationX", iX); + SetLocalInt(oNewPiece, "LocationY", iY); + iPiece = iPiece + 1; + if (iPiece == 8) + { + if (iIsWhite) + { + iY = 0; + } else { + iY = 7; + } + } + } + SetLocalString(GetArea(OBJECT_SELF), "Summoned " + sSide, sPrefix); +} + +void SummonPawnArmy(string sPrefix, string sSide) +{ + int iX, iY; + + if (sSide == WHITE) + { + iY = 1; // the pawn row + } else { + iY = 6; // the pawn row + } + + object oArea = GetArea(OBJECT_SELF); + + int iPiece = 0; + vector vLoc; + object oNewPiece; + + GetChessboardLocation(0, 0); // initialize the facings. + float fFacing = GetSideFacing(sSide); + + /// Create the Pawns + while (iPiece < 8) + { + iX = GetStartingX(iPiece); + oNewPiece = CreateObject(OBJECT_TYPE_CREATURE, sPrefix + "_" + sSide + IntToString(iPiece), + Location(oArea, GetChessboardLocation(iX, iY), fFacing), TRUE); + SetLocalInt(oNewPiece, "LocationX", iX); + SetLocalInt(oNewPiece, "LocationY", iY); + iPiece = iPiece + 1; + } + + /// Create the King + iPiece = 15; + iX = GetStartingX(iPiece); + if (sSide == WHITE) + { + iY = 0; + } else { + iY = 7; + } + + oNewPiece = CreateObject(OBJECT_TYPE_CREATURE, sPrefix + "_" + sSide + IntToString(iPiece), + Location(oArea, GetChessboardLocation(iX, iY), fFacing), TRUE); + SetLocalInt(oNewPiece, "LocationX", iX); + SetLocalInt(oNewPiece, "LocationY", iY); + + SetLocalString(GetArea(OBJECT_SELF), "Summoned " + sSide, sPrefix); +} diff --git a/nwnds_module/cinderspawn001.utc b/nwnds_module/cinderspawn001.utc new file mode 100644 index 000000000..db695aadb Binary files /dev/null and b/nwnds_module/cinderspawn001.utc differ diff --git a/nwnds_module/cinderspawnslam.uti b/nwnds_module/cinderspawnslam.uti new file mode 100644 index 000000000..fe295b71e Binary files /dev/null and b/nwnds_module/cinderspawnslam.uti differ diff --git a/nwnds_module/cistfiendbite.uti b/nwnds_module/cistfiendbite.uti new file mode 100644 index 000000000..b88f04c7d Binary files /dev/null and b/nwnds_module/cistfiendbite.uti differ diff --git a/nwnds_module/cistfiendprops.uti b/nwnds_module/cistfiendprops.uti new file mode 100644 index 000000000..80306e320 Binary files /dev/null and b/nwnds_module/cistfiendprops.uti differ diff --git a/nwnds_module/cistfiendslam.uti b/nwnds_module/cistfiendslam.uti new file mode 100644 index 000000000..4ce925723 Binary files /dev/null and b/nwnds_module/cistfiendslam.uti differ diff --git a/nwnds_module/citadel_lv_01.are b/nwnds_module/citadel_lv_01.are new file mode 100644 index 000000000..ea15f7355 Binary files /dev/null and b/nwnds_module/citadel_lv_01.are differ diff --git a/nwnds_module/citadel_lv_01.gic b/nwnds_module/citadel_lv_01.gic new file mode 100644 index 000000000..d52632a1f Binary files /dev/null and b/nwnds_module/citadel_lv_01.gic differ diff --git a/nwnds_module/citadel_lv_01.git b/nwnds_module/citadel_lv_01.git new file mode 100644 index 000000000..c67f55672 Binary files /dev/null and b/nwnds_module/citadel_lv_01.git differ diff --git a/nwnds_module/citadel_sublv_01.are b/nwnds_module/citadel_sublv_01.are new file mode 100644 index 000000000..14ec04902 Binary files /dev/null and b/nwnds_module/citadel_sublv_01.are differ diff --git a/nwnds_module/citadel_sublv_01.gic b/nwnds_module/citadel_sublv_01.gic new file mode 100644 index 000000000..a1645fe5c Binary files /dev/null and b/nwnds_module/citadel_sublv_01.gic differ diff --git a/nwnds_module/citadel_sublv_01.git b/nwnds_module/citadel_sublv_01.git new file mode 100644 index 000000000..c837728ad Binary files /dev/null and b/nwnds_module/citadel_sublv_01.git differ diff --git a/nwnds_module/citadel_sublv_02.are b/nwnds_module/citadel_sublv_02.are new file mode 100644 index 000000000..55d033e64 Binary files /dev/null and b/nwnds_module/citadel_sublv_02.are differ diff --git a/nwnds_module/citadel_sublv_02.gic b/nwnds_module/citadel_sublv_02.gic new file mode 100644 index 000000000..965847e1d Binary files /dev/null and b/nwnds_module/citadel_sublv_02.gic differ diff --git a/nwnds_module/citadel_sublv_02.git b/nwnds_module/citadel_sublv_02.git new file mode 100644 index 000000000..bb24062ce Binary files /dev/null and b/nwnds_module/citadel_sublv_02.git differ diff --git a/nwnds_module/citadel_sublv_03.are b/nwnds_module/citadel_sublv_03.are new file mode 100644 index 000000000..7c0c9cf25 Binary files /dev/null and b/nwnds_module/citadel_sublv_03.are differ diff --git a/nwnds_module/citadel_sublv_03.gic b/nwnds_module/citadel_sublv_03.gic new file mode 100644 index 000000000..c1f6ed57f Binary files /dev/null and b/nwnds_module/citadel_sublv_03.gic differ diff --git a/nwnds_module/citadel_sublv_03.git b/nwnds_module/citadel_sublv_03.git new file mode 100644 index 000000000..c5227133a Binary files /dev/null and b/nwnds_module/citadel_sublv_03.git differ diff --git a/nwnds_module/cl_lockchest.ncs b/nwnds_module/cl_lockchest.ncs new file mode 100644 index 000000000..cd69599a0 Binary files /dev/null and b/nwnds_module/cl_lockchest.ncs differ diff --git a/nwnds_module/cl_lockchest.nss b/nwnds_module/cl_lockchest.nss new file mode 100644 index 000000000..84f6ffa6d --- /dev/null +++ b/nwnds_module/cl_lockchest.nss @@ -0,0 +1,4 @@ +void main() +{ +SetLocked(GetObjectByTag("CrimsonLegionWarChest"),TRUE); +} diff --git a/nwnds_module/claw3d4.uti b/nwnds_module/claw3d4.uti new file mode 100644 index 000000000..413a67f00 Binary files /dev/null and b/nwnds_module/claw3d4.uti differ diff --git a/nwnds_module/cloak_model_1.uti b/nwnds_module/cloak_model_1.uti new file mode 100644 index 000000000..8a7da9fed Binary files /dev/null and b/nwnds_module/cloak_model_1.uti differ diff --git a/nwnds_module/cloak_model_10.uti b/nwnds_module/cloak_model_10.uti new file mode 100644 index 000000000..f05cde572 Binary files /dev/null and b/nwnds_module/cloak_model_10.uti differ diff --git a/nwnds_module/cloak_model_11.uti b/nwnds_module/cloak_model_11.uti new file mode 100644 index 000000000..c4975a28b Binary files /dev/null and b/nwnds_module/cloak_model_11.uti differ diff --git a/nwnds_module/cloak_model_12.uti b/nwnds_module/cloak_model_12.uti new file mode 100644 index 000000000..51d565a56 Binary files /dev/null and b/nwnds_module/cloak_model_12.uti differ diff --git a/nwnds_module/cloak_model_13.uti b/nwnds_module/cloak_model_13.uti new file mode 100644 index 000000000..7b61b9c38 Binary files /dev/null and b/nwnds_module/cloak_model_13.uti differ diff --git a/nwnds_module/cloak_model_14.uti b/nwnds_module/cloak_model_14.uti new file mode 100644 index 000000000..4a37e1bf3 Binary files /dev/null and b/nwnds_module/cloak_model_14.uti differ diff --git a/nwnds_module/cloak_model_15.uti b/nwnds_module/cloak_model_15.uti new file mode 100644 index 000000000..15febba06 Binary files /dev/null and b/nwnds_module/cloak_model_15.uti differ diff --git a/nwnds_module/cloak_model_16.uti b/nwnds_module/cloak_model_16.uti new file mode 100644 index 000000000..7d082aec7 Binary files /dev/null and b/nwnds_module/cloak_model_16.uti differ diff --git a/nwnds_module/cloak_model_17.uti b/nwnds_module/cloak_model_17.uti new file mode 100644 index 000000000..ddb437562 Binary files /dev/null and b/nwnds_module/cloak_model_17.uti differ diff --git a/nwnds_module/cloak_model_18.uti b/nwnds_module/cloak_model_18.uti new file mode 100644 index 000000000..b0c03b2e9 Binary files /dev/null and b/nwnds_module/cloak_model_18.uti differ diff --git a/nwnds_module/cloak_model_19.uti b/nwnds_module/cloak_model_19.uti new file mode 100644 index 000000000..ea3fba621 Binary files /dev/null and b/nwnds_module/cloak_model_19.uti differ diff --git a/nwnds_module/cloak_model_2.uti b/nwnds_module/cloak_model_2.uti new file mode 100644 index 000000000..72e6b992f Binary files /dev/null and b/nwnds_module/cloak_model_2.uti differ diff --git a/nwnds_module/cloak_model_20.uti b/nwnds_module/cloak_model_20.uti new file mode 100644 index 000000000..280f67055 Binary files /dev/null and b/nwnds_module/cloak_model_20.uti differ diff --git a/nwnds_module/cloak_model_21.uti b/nwnds_module/cloak_model_21.uti new file mode 100644 index 000000000..0b3940560 Binary files /dev/null and b/nwnds_module/cloak_model_21.uti differ diff --git a/nwnds_module/cloak_model_22.uti b/nwnds_module/cloak_model_22.uti new file mode 100644 index 000000000..f78a51edc Binary files /dev/null and b/nwnds_module/cloak_model_22.uti differ diff --git a/nwnds_module/cloak_model_23.uti b/nwnds_module/cloak_model_23.uti new file mode 100644 index 000000000..a6b2f4953 Binary files /dev/null and b/nwnds_module/cloak_model_23.uti differ diff --git a/nwnds_module/cloak_model_24.uti b/nwnds_module/cloak_model_24.uti new file mode 100644 index 000000000..9958f1160 Binary files /dev/null and b/nwnds_module/cloak_model_24.uti differ diff --git a/nwnds_module/cloak_model_25.uti b/nwnds_module/cloak_model_25.uti new file mode 100644 index 000000000..c0a8c134e Binary files /dev/null and b/nwnds_module/cloak_model_25.uti differ diff --git a/nwnds_module/cloak_model_26.uti b/nwnds_module/cloak_model_26.uti new file mode 100644 index 000000000..0e92e9898 Binary files /dev/null and b/nwnds_module/cloak_model_26.uti differ diff --git a/nwnds_module/cloak_model_27.uti b/nwnds_module/cloak_model_27.uti new file mode 100644 index 000000000..37ac0ea84 Binary files /dev/null and b/nwnds_module/cloak_model_27.uti differ diff --git a/nwnds_module/cloak_model_28.uti b/nwnds_module/cloak_model_28.uti new file mode 100644 index 000000000..72b6dbdcd Binary files /dev/null and b/nwnds_module/cloak_model_28.uti differ diff --git a/nwnds_module/cloak_model_29.uti b/nwnds_module/cloak_model_29.uti new file mode 100644 index 000000000..2cdc78705 Binary files /dev/null and b/nwnds_module/cloak_model_29.uti differ diff --git a/nwnds_module/cloak_model_3.uti b/nwnds_module/cloak_model_3.uti new file mode 100644 index 000000000..a8157db9a Binary files /dev/null and b/nwnds_module/cloak_model_3.uti differ diff --git a/nwnds_module/cloak_model_30.uti b/nwnds_module/cloak_model_30.uti new file mode 100644 index 000000000..48f6903c5 Binary files /dev/null and b/nwnds_module/cloak_model_30.uti differ diff --git a/nwnds_module/cloak_model_31.uti b/nwnds_module/cloak_model_31.uti new file mode 100644 index 000000000..91b405e8c Binary files /dev/null and b/nwnds_module/cloak_model_31.uti differ diff --git a/nwnds_module/cloak_model_32.uti b/nwnds_module/cloak_model_32.uti new file mode 100644 index 000000000..ee37d6530 Binary files /dev/null and b/nwnds_module/cloak_model_32.uti differ diff --git a/nwnds_module/cloak_model_33.uti b/nwnds_module/cloak_model_33.uti new file mode 100644 index 000000000..fae1a2cdf Binary files /dev/null and b/nwnds_module/cloak_model_33.uti differ diff --git a/nwnds_module/cloak_model_34.uti b/nwnds_module/cloak_model_34.uti new file mode 100644 index 000000000..40bca54cb Binary files /dev/null and b/nwnds_module/cloak_model_34.uti differ diff --git a/nwnds_module/cloak_model_35.uti b/nwnds_module/cloak_model_35.uti new file mode 100644 index 000000000..0e5971448 Binary files /dev/null and b/nwnds_module/cloak_model_35.uti differ diff --git a/nwnds_module/cloak_model_36.uti b/nwnds_module/cloak_model_36.uti new file mode 100644 index 000000000..2a89c8a55 Binary files /dev/null and b/nwnds_module/cloak_model_36.uti differ diff --git a/nwnds_module/cloak_model_37.uti b/nwnds_module/cloak_model_37.uti new file mode 100644 index 000000000..3321bef9e Binary files /dev/null and b/nwnds_module/cloak_model_37.uti differ diff --git a/nwnds_module/cloak_model_38.uti b/nwnds_module/cloak_model_38.uti new file mode 100644 index 000000000..078c36410 Binary files /dev/null and b/nwnds_module/cloak_model_38.uti differ diff --git a/nwnds_module/cloak_model_39.uti b/nwnds_module/cloak_model_39.uti new file mode 100644 index 000000000..95a06a000 Binary files /dev/null and b/nwnds_module/cloak_model_39.uti differ diff --git a/nwnds_module/cloak_model_4.uti b/nwnds_module/cloak_model_4.uti new file mode 100644 index 000000000..06478bdd2 Binary files /dev/null and b/nwnds_module/cloak_model_4.uti differ diff --git a/nwnds_module/cloak_model_40.uti b/nwnds_module/cloak_model_40.uti new file mode 100644 index 000000000..35ef85ba3 Binary files /dev/null and b/nwnds_module/cloak_model_40.uti differ diff --git a/nwnds_module/cloak_model_41.uti b/nwnds_module/cloak_model_41.uti new file mode 100644 index 000000000..1bd1b4d4c Binary files /dev/null and b/nwnds_module/cloak_model_41.uti differ diff --git a/nwnds_module/cloak_model_42.uti b/nwnds_module/cloak_model_42.uti new file mode 100644 index 000000000..e13091038 Binary files /dev/null and b/nwnds_module/cloak_model_42.uti differ diff --git a/nwnds_module/cloak_model_43.uti b/nwnds_module/cloak_model_43.uti new file mode 100644 index 000000000..90395169e Binary files /dev/null and b/nwnds_module/cloak_model_43.uti differ diff --git a/nwnds_module/cloak_model_44.uti b/nwnds_module/cloak_model_44.uti new file mode 100644 index 000000000..0005fa5cd Binary files /dev/null and b/nwnds_module/cloak_model_44.uti differ diff --git a/nwnds_module/cloak_model_45.uti b/nwnds_module/cloak_model_45.uti new file mode 100644 index 000000000..ff3277306 Binary files /dev/null and b/nwnds_module/cloak_model_45.uti differ diff --git a/nwnds_module/cloak_model_46.uti b/nwnds_module/cloak_model_46.uti new file mode 100644 index 000000000..560585305 Binary files /dev/null and b/nwnds_module/cloak_model_46.uti differ diff --git a/nwnds_module/cloak_model_47.uti b/nwnds_module/cloak_model_47.uti new file mode 100644 index 000000000..16e90e8d6 Binary files /dev/null and b/nwnds_module/cloak_model_47.uti differ diff --git a/nwnds_module/cloak_model_48.uti b/nwnds_module/cloak_model_48.uti new file mode 100644 index 000000000..4e7fd9139 Binary files /dev/null and b/nwnds_module/cloak_model_48.uti differ diff --git a/nwnds_module/cloak_model_49.uti b/nwnds_module/cloak_model_49.uti new file mode 100644 index 000000000..d3f1959ab Binary files /dev/null and b/nwnds_module/cloak_model_49.uti differ diff --git a/nwnds_module/cloak_model_5.uti b/nwnds_module/cloak_model_5.uti new file mode 100644 index 000000000..bc6291913 Binary files /dev/null and b/nwnds_module/cloak_model_5.uti differ diff --git a/nwnds_module/cloak_model_50.uti b/nwnds_module/cloak_model_50.uti new file mode 100644 index 000000000..b84b9197a Binary files /dev/null and b/nwnds_module/cloak_model_50.uti differ diff --git a/nwnds_module/cloak_model_51.uti b/nwnds_module/cloak_model_51.uti new file mode 100644 index 000000000..09b701906 Binary files /dev/null and b/nwnds_module/cloak_model_51.uti differ diff --git a/nwnds_module/cloak_model_52.uti b/nwnds_module/cloak_model_52.uti new file mode 100644 index 000000000..599afe406 Binary files /dev/null and b/nwnds_module/cloak_model_52.uti differ diff --git a/nwnds_module/cloak_model_53.uti b/nwnds_module/cloak_model_53.uti new file mode 100644 index 000000000..8860c189c Binary files /dev/null and b/nwnds_module/cloak_model_53.uti differ diff --git a/nwnds_module/cloak_model_54.uti b/nwnds_module/cloak_model_54.uti new file mode 100644 index 000000000..fa5743a86 Binary files /dev/null and b/nwnds_module/cloak_model_54.uti differ diff --git a/nwnds_module/cloak_model_55.uti b/nwnds_module/cloak_model_55.uti new file mode 100644 index 000000000..7da206333 Binary files /dev/null and b/nwnds_module/cloak_model_55.uti differ diff --git a/nwnds_module/cloak_model_56.uti b/nwnds_module/cloak_model_56.uti new file mode 100644 index 000000000..615c9ea94 Binary files /dev/null and b/nwnds_module/cloak_model_56.uti differ diff --git a/nwnds_module/cloak_model_57.uti b/nwnds_module/cloak_model_57.uti new file mode 100644 index 000000000..4c104efb6 Binary files /dev/null and b/nwnds_module/cloak_model_57.uti differ diff --git a/nwnds_module/cloak_model_58.uti b/nwnds_module/cloak_model_58.uti new file mode 100644 index 000000000..baaf5d8b2 Binary files /dev/null and b/nwnds_module/cloak_model_58.uti differ diff --git a/nwnds_module/cloak_model_59.uti b/nwnds_module/cloak_model_59.uti new file mode 100644 index 000000000..ec1be7942 Binary files /dev/null and b/nwnds_module/cloak_model_59.uti differ diff --git a/nwnds_module/cloak_model_6.uti b/nwnds_module/cloak_model_6.uti new file mode 100644 index 000000000..19cf4fd8c Binary files /dev/null and b/nwnds_module/cloak_model_6.uti differ diff --git a/nwnds_module/cloak_model_60.uti b/nwnds_module/cloak_model_60.uti new file mode 100644 index 000000000..16aa226b4 Binary files /dev/null and b/nwnds_module/cloak_model_60.uti differ diff --git a/nwnds_module/cloak_model_61.uti b/nwnds_module/cloak_model_61.uti new file mode 100644 index 000000000..8ef395fed Binary files /dev/null and b/nwnds_module/cloak_model_61.uti differ diff --git a/nwnds_module/cloak_model_62.uti b/nwnds_module/cloak_model_62.uti new file mode 100644 index 000000000..913f33689 Binary files /dev/null and b/nwnds_module/cloak_model_62.uti differ diff --git a/nwnds_module/cloak_model_63.uti b/nwnds_module/cloak_model_63.uti new file mode 100644 index 000000000..4dca15b29 Binary files /dev/null and b/nwnds_module/cloak_model_63.uti differ diff --git a/nwnds_module/cloak_model_64.uti b/nwnds_module/cloak_model_64.uti new file mode 100644 index 000000000..550e43256 Binary files /dev/null and b/nwnds_module/cloak_model_64.uti differ diff --git a/nwnds_module/cloak_model_65.uti b/nwnds_module/cloak_model_65.uti new file mode 100644 index 000000000..1cf97b0e2 Binary files /dev/null and b/nwnds_module/cloak_model_65.uti differ diff --git a/nwnds_module/cloak_model_66.uti b/nwnds_module/cloak_model_66.uti new file mode 100644 index 000000000..eb5f38366 Binary files /dev/null and b/nwnds_module/cloak_model_66.uti differ diff --git a/nwnds_module/cloak_model_67.uti b/nwnds_module/cloak_model_67.uti new file mode 100644 index 000000000..199dd40f4 Binary files /dev/null and b/nwnds_module/cloak_model_67.uti differ diff --git a/nwnds_module/cloak_model_68.uti b/nwnds_module/cloak_model_68.uti new file mode 100644 index 000000000..6148a9750 Binary files /dev/null and b/nwnds_module/cloak_model_68.uti differ diff --git a/nwnds_module/cloak_model_69.uti b/nwnds_module/cloak_model_69.uti new file mode 100644 index 000000000..be9dafd17 Binary files /dev/null and b/nwnds_module/cloak_model_69.uti differ diff --git a/nwnds_module/cloak_model_7.uti b/nwnds_module/cloak_model_7.uti new file mode 100644 index 000000000..d57cb7a14 Binary files /dev/null and b/nwnds_module/cloak_model_7.uti differ diff --git a/nwnds_module/cloak_model_70.uti b/nwnds_module/cloak_model_70.uti new file mode 100644 index 000000000..37892d1eb Binary files /dev/null and b/nwnds_module/cloak_model_70.uti differ diff --git a/nwnds_module/cloak_model_71.uti b/nwnds_module/cloak_model_71.uti new file mode 100644 index 000000000..f241143ed Binary files /dev/null and b/nwnds_module/cloak_model_71.uti differ diff --git a/nwnds_module/cloak_model_72.uti b/nwnds_module/cloak_model_72.uti new file mode 100644 index 000000000..a1f05b543 Binary files /dev/null and b/nwnds_module/cloak_model_72.uti differ diff --git a/nwnds_module/cloak_model_73.uti b/nwnds_module/cloak_model_73.uti new file mode 100644 index 000000000..161441364 Binary files /dev/null and b/nwnds_module/cloak_model_73.uti differ diff --git a/nwnds_module/cloak_model_74.uti b/nwnds_module/cloak_model_74.uti new file mode 100644 index 000000000..3435ab306 Binary files /dev/null and b/nwnds_module/cloak_model_74.uti differ diff --git a/nwnds_module/cloak_model_75.uti b/nwnds_module/cloak_model_75.uti new file mode 100644 index 000000000..9bc107d3f Binary files /dev/null and b/nwnds_module/cloak_model_75.uti differ diff --git a/nwnds_module/cloak_model_76.uti b/nwnds_module/cloak_model_76.uti new file mode 100644 index 000000000..746809211 Binary files /dev/null and b/nwnds_module/cloak_model_76.uti differ diff --git a/nwnds_module/cloak_model_77.uti b/nwnds_module/cloak_model_77.uti new file mode 100644 index 000000000..2991f6896 Binary files /dev/null and b/nwnds_module/cloak_model_77.uti differ diff --git a/nwnds_module/cloak_model_78.uti b/nwnds_module/cloak_model_78.uti new file mode 100644 index 000000000..91c44146f Binary files /dev/null and b/nwnds_module/cloak_model_78.uti differ diff --git a/nwnds_module/cloak_model_79.uti b/nwnds_module/cloak_model_79.uti new file mode 100644 index 000000000..99be160c6 Binary files /dev/null and b/nwnds_module/cloak_model_79.uti differ diff --git a/nwnds_module/cloak_model_8.uti b/nwnds_module/cloak_model_8.uti new file mode 100644 index 000000000..98a711be3 Binary files /dev/null and b/nwnds_module/cloak_model_8.uti differ diff --git a/nwnds_module/cloak_model_9.uti b/nwnds_module/cloak_model_9.uti new file mode 100644 index 000000000..58b18df50 Binary files /dev/null and b/nwnds_module/cloak_model_9.uti differ diff --git a/nwnds_module/cloaker001.utc b/nwnds_module/cloaker001.utc new file mode 100644 index 000000000..3f0ba6937 Binary files /dev/null and b/nwnds_module/cloaker001.utc differ diff --git a/nwnds_module/cloakerhide.uti b/nwnds_module/cloakerhide.uti new file mode 100644 index 000000000..16a002398 Binary files /dev/null and b/nwnds_module/cloakerhide.uti differ diff --git a/nwnds_module/close_door.ncs b/nwnds_module/close_door.ncs new file mode 100644 index 000000000..7b49b1752 Binary files /dev/null and b/nwnds_module/close_door.ncs differ diff --git a/nwnds_module/close_door.nss b/nwnds_module/close_door.nss new file mode 100644 index 000000000..95c4291de --- /dev/null +++ b/nwnds_module/close_door.nss @@ -0,0 +1,12 @@ + +// Put this script OnOpen. + + void main() +{ + + + DelayCommand(10.0, ActionCloseDoor(OBJECT_SELF)); + + +} + diff --git a/nwnds_module/close_ssdoor.ncs b/nwnds_module/close_ssdoor.ncs new file mode 100644 index 000000000..ef941b981 Binary files /dev/null and b/nwnds_module/close_ssdoor.ncs differ diff --git a/nwnds_module/close_ssdoor.nss b/nwnds_module/close_ssdoor.nss new file mode 100644 index 000000000..0655ab42e --- /dev/null +++ b/nwnds_module/close_ssdoor.nss @@ -0,0 +1,12 @@ + +// Put this script OnOpen. + + void main() +{ + + + DelayCommand(10.0, ActionCloseDoor(OBJECT_SELF)); ; + DelayCommand(1.0, SetLocked(OBJECT_SELF, TRUE)); + +} + diff --git a/nwnds_module/close_ssdoor2.ncs b/nwnds_module/close_ssdoor2.ncs new file mode 100644 index 000000000..7b49b1752 Binary files /dev/null and b/nwnds_module/close_ssdoor2.ncs differ diff --git a/nwnds_module/close_ssdoor2.nss b/nwnds_module/close_ssdoor2.nss new file mode 100644 index 000000000..461170294 --- /dev/null +++ b/nwnds_module/close_ssdoor2.nss @@ -0,0 +1,12 @@ + +// Put this script OnOpen. + + void main() +{ + + + DelayCommand(10.0, ActionCloseDoor(OBJECT_SELF)); ; + + +} + diff --git a/nwnds_module/closedoors.ncs b/nwnds_module/closedoors.ncs new file mode 100644 index 000000000..4ada8c617 Binary files /dev/null and b/nwnds_module/closedoors.ncs differ diff --git a/nwnds_module/closedoors.nss b/nwnds_module/closedoors.nss new file mode 100644 index 000000000..f789d9450 --- /dev/null +++ b/nwnds_module/closedoors.nss @@ -0,0 +1,4 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +} diff --git a/nwnds_module/closekalak.ncs b/nwnds_module/closekalak.ncs new file mode 100644 index 000000000..f992c2cfa Binary files /dev/null and b/nwnds_module/closekalak.ncs differ diff --git a/nwnds_module/closekalak.nss b/nwnds_module/closekalak.nss new file mode 100644 index 000000000..2b995dd11 --- /dev/null +++ b/nwnds_module/closekalak.nss @@ -0,0 +1,8 @@ +void main() +{ +AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("THEWEB")))); +DelayCommand(10.0,SetLocked(GetObjectByTag("KalaksStatue"),TRUE)); +} + + + diff --git a/nwnds_module/closelockdoor500.ncs b/nwnds_module/closelockdoor500.ncs new file mode 100644 index 000000000..bb22402b5 Binary files /dev/null and b/nwnds_module/closelockdoor500.ncs differ diff --git a/nwnds_module/closelockdoor500.nss b/nwnds_module/closelockdoor500.nss new file mode 100644 index 000000000..b4a1e8aaf --- /dev/null +++ b/nwnds_module/closelockdoor500.nss @@ -0,0 +1,5 @@ +void main() +{ + DelayCommand(500.0,ActionCloseDoor(OBJECT_SELF)); + SetLocked(OBJECT_SELF,1); +} diff --git a/nwnds_module/closelockdoor60.ncs b/nwnds_module/closelockdoor60.ncs new file mode 100644 index 000000000..f50f8e394 Binary files /dev/null and b/nwnds_module/closelockdoor60.ncs differ diff --git a/nwnds_module/closelockdoor60.nss b/nwnds_module/closelockdoor60.nss new file mode 100644 index 000000000..22896f786 --- /dev/null +++ b/nwnds_module/closelockdoor60.nss @@ -0,0 +1,5 @@ +void main() +{ + DelayCommand(60.0,ActionCloseDoor(OBJECT_SELF)); + SetLocked(OBJECT_SELF,1); +} diff --git a/nwnds_module/closelockdoors.ncs b/nwnds_module/closelockdoors.ncs new file mode 100644 index 000000000..4da26a0ec Binary files /dev/null and b/nwnds_module/closelockdoors.ncs differ diff --git a/nwnds_module/closelockdoors.nss b/nwnds_module/closelockdoors.nss new file mode 100644 index 000000000..92cb6295d --- /dev/null +++ b/nwnds_module/closelockdoors.nss @@ -0,0 +1,5 @@ +void main() +{ + DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); + SetLocked(OBJECT_SELF,1); +} diff --git a/nwnds_module/co_justls.are b/nwnds_module/co_justls.are new file mode 100644 index 000000000..191a49eab Binary files /dev/null and b/nwnds_module/co_justls.are differ diff --git a/nwnds_module/co_justls.gic b/nwnds_module/co_justls.gic new file mode 100644 index 000000000..e351a7985 Binary files /dev/null and b/nwnds_module/co_justls.gic differ diff --git a/nwnds_module/co_justls.git b/nwnds_module/co_justls.git new file mode 100644 index 000000000..149386b4a Binary files /dev/null and b/nwnds_module/co_justls.git differ diff --git a/nwnds_module/co_mikhail.are b/nwnds_module/co_mikhail.are new file mode 100644 index 000000000..8d61f9042 Binary files /dev/null and b/nwnds_module/co_mikhail.are differ diff --git a/nwnds_module/co_mikhail.gic b/nwnds_module/co_mikhail.gic new file mode 100644 index 000000000..01fbc5660 Binary files /dev/null and b/nwnds_module/co_mikhail.gic differ diff --git a/nwnds_module/co_mikhail.git b/nwnds_module/co_mikhail.git new file mode 100644 index 000000000..bdc2c646c Binary files /dev/null and b/nwnds_module/co_mikhail.git differ diff --git a/nwnds_module/colors_inc.nss b/nwnds_module/colors_inc.nss new file mode 100644 index 000000000..5bf2ce1e9 --- /dev/null +++ b/nwnds_module/colors_inc.nss @@ -0,0 +1,566 @@ +/* + * colors_inc.nss + * + * Access to the color tokens provided by The Krit. + ************************************************************ + * Please use these judiciously to enhance the gaming + * experience. (Overuse of colors detracts from it.) + ************************************************************ + * Color tokens in a string will change the color from that + * point on when the string is displayed on the screen. + * Every color change should be ended by an end token, + * supplied by ColorTokenEnd(). + ************************************************************/ + + +/////////////////////////////////////////////////////////////////////////////// +// Constants +/////////////////////////////////////////////////////////////////////////////// + + +const string ColorArray = "  !##$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������"; + + + +/////////////////////////////////////////////////////////////////////////////// +// Prototypes +/////////////////////////////////////////////////////////////////////////////// + + +// Supplies a string that changes the text to the given RGB values. +// Valid parameter values are 0-255. +string ColorToken(int nRed, int nGreen, int nBlue); + +// Supplies a string that ends an earlier color change. +string ColorTokenEnd(); + +/////////////////////////////////////////////////////////////////////////////// + +// Supplies a string that changes the text to black. +string ColorTokenBlack(); + +// Supplies a string that changes the text to blue. +string ColorTokenBlue(); + +// Supplies a string that changes the text to gray. +string ColorTokenGray(); + +// Supplies a string that changes the text to green. +string ColorTokenGreen(); + +// Supplies a string that changes the text to light purple. +string ColorTokenLightPurple(); + +// Supplies a string that changes the text to orange. +string ColorTokenOrange(); + +// Supplies a string that changes the text to pink. +string ColorTokenPink(); + +// Supplies a string that changes the text to purple. +string ColorTokenPurple(); + +// Supplies a string that changes the text to red. +string ColorTokenRed(); + +// Supplies a string that changes the text to white. +string ColorTokenWhite(); + +// Supplies a string that changes the text to yellow. +string ColorTokenYellow(); + +/////////////////////////////////////////////////////////////////////////////// + +// Supplies a string that changes the text to the color of +// combat messages. +string ColorTokenCombat(); + +// Supplies a string that changes the text to the color of +// dialog. +string ColorTokenDialog(); + +// Supplies a string that changes the text to the color of +// dialog actions. +string ColorTokenDialogAction(); + +// Supplies a string that changes the text to the color of +// dialog checks. +string ColorTokenDialogCheck(); + +// Supplies a string that changes the text to the color of +// dialog highlighting. +string ColorTokenDialogHighlight(); + +// Supplies a string that changes the text to the color of +// replies in the dialog window. +string ColorTokenDialogReply(); + +// Supplies a string that changes the text to the color of +// the DM channel. +string ColorTokenDM(); + +// Supplies a string that changes the text to the color of +// many game engine messages. +string ColorTokenGameEngine(); + +// Supplies a string that changes the text to the color of +// saving throw messages. +string ColorTokenSavingThrow(); + +// Supplies a string that changes the text to the color of +// messages sent from scripts. +string ColorTokenScript(); + +// Supplies a string that changes the text to the color of +// server messages. +string ColorTokenServer(); + +// Supplies a string that changes the text to the color of +// shouts. +string ColorTokenShout(); + +// Supplies a string that changes the text to the color of +// skill check messages. +string ColorTokenSkillCheck(); + +// Supplies a string that changes the text to the color of +// the talk and party talk channels. +string ColorTokenTalk(); + +// Supplies a string that changes the text to the color of +// tells. +string ColorTokenTell(); + +// Supplies a string that changes the text to the color of +// whispers. +string ColorTokenWhisper(); + +/////////////////////////////////////////////////////////////////////////////// + +// Returns the name of oPC, surrounded by color tokens, so the color of +// the name is the lighter blue often used in NWN game engine messages. +string GetNamePCColor(object oPC); + +// Returns the name of oNPC, surrounded by color tokens, so the color of +// the name is the shade of purple often used in NWN game engine messages. +string GetNameNPCColor(object oNPC); + + + +/////////////////////////////////////////////////////////////////////////////// +// Basic Functions +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// ColorToken() +// +// Supplies a string that changes the text to the given RGB values. +// Valid parameter values are 0-255. +// +string ColorToken(int nRed, int nGreen, int nBlue) +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenEnd() +// +// Supplies a string that ends an earlier color change. +// +string ColorTokenEnd() +{ + return ""; +} + + + +/////////////////////////////////////////////////////////////////////////////// +// Functions by Color +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenBlack() +// +// Supplies a string that changes the text to black. +// +string ColorTokenBlack() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenBlue() +// +// Supplies a string that changes the text to blue. +// +string ColorTokenBlue() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenGray() +// +// Supplies a string that changes the text to gray. +// +string ColorTokenGray() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenGreen() +// +// Supplies a string that changes the text to green. +// +string ColorTokenGreen() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenLightPurple() +// +// Supplies a string that changes the text to light purple. +// +string ColorTokenLightPurple() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenOrange() +// +// Supplies a string that changes the text to orange. +// +string ColorTokenOrange() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenPink() +// +// Supplies a string that changes the text to pink. +// +string ColorTokenPink() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenPurple() +// +// Supplies a string that changes the text to purple. +// +string ColorTokenPurple() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenRed() +// +// Supplies a string that changes the text to red. +// +string ColorTokenRed() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenWhite() +// +// Supplies a string that changes the text to white. +// +string ColorTokenWhite() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenYellow() +// +// Supplies a string that changes the text to yellow. +// +string ColorTokenYellow() +{ + return ""; +} + + + +/////////////////////////////////////////////////////////////////////////////// +// Functions by Purpose +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenCombat() +// +// Supplies a string that changes the text to the color of +// combat messages. +// +string ColorTokenCombat() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDialog() +// +// Supplies a string that changes the text to the color of +// dialog. +// +string ColorTokenDialog() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDialogAction() +// +// Supplies a string that changes the text to the color of +// dialog actions. +// +string ColorTokenDialogAction() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDialogCheck() +// +// Supplies a string that changes the text to the color of +// dialog checks. +// +string ColorTokenDialogCheck() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDialogHighlight() +// +// Supplies a string that changes the text to the color of +// dialog highlighting. +// +string ColorTokenDialogHighlight() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDialogReply() +// +// Supplies a string that changes the text to the color of +// replies in the dialog window. +// +string ColorTokenDialogReply() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenDM() +// +// Supplies a string that changes the text to the color of +// the DM channel. +// +string ColorTokenDM() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenGameEngine() +// +// Supplies a string that changes the text to the color of +// many game engine messages. +// +string ColorTokenGameEngine() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenSavingThrow() +// +// Supplies a string that changes the text to the color of +// saving throw messages. +// +string ColorTokenSavingThrow() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenScript() +// +// Supplies a string that changes the text to the color of +// messages sent from scripts. +// +string ColorTokenScript() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenServer() +// +// Supplies a string that changes the text to the color of +// server messages. +// +string ColorTokenServer() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenShout() +// +// Supplies a string that changes the text to the color of +// shouts. +// +string ColorTokenShout() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenSkillCheck() +// +// Supplies a string that changes the text to the color of +// skill check messages. +// +string ColorTokenSkillCheck() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenTalk() +// +// Supplies a string that changes the text to the color of +// the talk and party talk channels. +// +string ColorTokenTalk() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenTell() +// +// Supplies a string that changes the text to the color of +// tells. +// +string ColorTokenTell() +{ + return ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// ColorTokenWhisper() +// +// Supplies a string that changes the text to the color of +// whispers. +// +string ColorTokenWhisper() +{ + return ""; +} + + + +/////////////////////////////////////////////////////////////////////////////// +// Colored Name Functions +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// GetNamePCColor() +// +// Returns the name of oPC, surrounded by color tokens, so the color of +// the name is the lighter blue often used in NWN game engine messages. +// +// +string GetNamePCColor(object oPC) +{ + return "" + + GetName(oPC) + ""; +} + +/////////////////////////////////////////////////////////////////////////////// +// GetNameNPCColor() +// +// Returns the name of oNPC, surrounded by color tokens, so the color of +// the name is the shade of purple often used in NWN game engine messages. +// +string GetNameNPCColor(object oNPC) +{ + return "" + + GetName(oNPC) + ""; +} diff --git a/nwnds_module/comclothes1.uti b/nwnds_module/comclothes1.uti new file mode 100644 index 000000000..ae2bbadc8 Binary files /dev/null and b/nwnds_module/comclothes1.uti differ diff --git a/nwnds_module/comclothes10.uti b/nwnds_module/comclothes10.uti new file mode 100644 index 000000000..865e3945e Binary files /dev/null and b/nwnds_module/comclothes10.uti differ diff --git a/nwnds_module/comclothes11.uti b/nwnds_module/comclothes11.uti new file mode 100644 index 000000000..a8ebc13cb Binary files /dev/null and b/nwnds_module/comclothes11.uti differ diff --git a/nwnds_module/comclothes12.uti b/nwnds_module/comclothes12.uti new file mode 100644 index 000000000..d67c516f0 Binary files /dev/null and b/nwnds_module/comclothes12.uti differ diff --git a/nwnds_module/comclothes2.uti b/nwnds_module/comclothes2.uti new file mode 100644 index 000000000..f91535057 Binary files /dev/null and b/nwnds_module/comclothes2.uti differ diff --git a/nwnds_module/comclothes3.uti b/nwnds_module/comclothes3.uti new file mode 100644 index 000000000..71c8ab793 Binary files /dev/null and b/nwnds_module/comclothes3.uti differ diff --git a/nwnds_module/comclothes4.uti b/nwnds_module/comclothes4.uti new file mode 100644 index 000000000..656835e14 Binary files /dev/null and b/nwnds_module/comclothes4.uti differ diff --git a/nwnds_module/comclothes5.uti b/nwnds_module/comclothes5.uti new file mode 100644 index 000000000..4f43601a2 Binary files /dev/null and b/nwnds_module/comclothes5.uti differ diff --git a/nwnds_module/comclothes6.uti b/nwnds_module/comclothes6.uti new file mode 100644 index 000000000..7b07bac1a Binary files /dev/null and b/nwnds_module/comclothes6.uti differ diff --git a/nwnds_module/comclothes7.uti b/nwnds_module/comclothes7.uti new file mode 100644 index 000000000..01c503bf3 Binary files /dev/null and b/nwnds_module/comclothes7.uti differ diff --git a/nwnds_module/comclothes8.uti b/nwnds_module/comclothes8.uti new file mode 100644 index 000000000..0bbfdcc60 Binary files /dev/null and b/nwnds_module/comclothes8.uti differ diff --git a/nwnds_module/comclothes9.uti b/nwnds_module/comclothes9.uti new file mode 100644 index 000000000..3a6ccfa5f Binary files /dev/null and b/nwnds_module/comclothes9.uti differ diff --git a/nwnds_module/commoner.utc b/nwnds_module/commoner.utc new file mode 100644 index 000000000..727c4ab3b Binary files /dev/null and b/nwnds_module/commoner.utc differ diff --git a/nwnds_module/commoner001.utc b/nwnds_module/commoner001.utc new file mode 100644 index 000000000..70488b41d Binary files /dev/null and b/nwnds_module/commoner001.utc differ diff --git a/nwnds_module/commoner002.utc b/nwnds_module/commoner002.utc new file mode 100644 index 000000000..13feb379b Binary files /dev/null and b/nwnds_module/commoner002.utc differ diff --git a/nwnds_module/commoner003.utc b/nwnds_module/commoner003.utc new file mode 100644 index 000000000..52e6540de Binary files /dev/null and b/nwnds_module/commoner003.utc differ diff --git a/nwnds_module/commoner004.utc b/nwnds_module/commoner004.utc new file mode 100644 index 000000000..bc7d2d604 Binary files /dev/null and b/nwnds_module/commoner004.utc differ diff --git a/nwnds_module/commonerspawner.utp b/nwnds_module/commonerspawner.utp new file mode 100644 index 000000000..84156fb64 Binary files /dev/null and b/nwnds_module/commonerspawner.utp differ diff --git a/nwnds_module/consorthide001.uti b/nwnds_module/consorthide001.uti new file mode 100644 index 000000000..a5d720910 Binary files /dev/null and b/nwnds_module/consorthide001.uti differ diff --git a/nwnds_module/constitutiondown.ncs b/nwnds_module/constitutiondown.ncs new file mode 100644 index 000000000..f359c00f9 Binary files /dev/null and b/nwnds_module/constitutiondown.ncs differ diff --git a/nwnds_module/constitutiondown.nss b/nwnds_module/constitutiondown.nss new file mode 100644 index 000000000..3e9e26c07 --- /dev/null +++ b/nwnds_module/constitutiondown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_CONSTITUTION, -2); +} diff --git a/nwnds_module/constitutionup.ncs b/nwnds_module/constitutionup.ncs new file mode 100644 index 000000000..a51f52efe Binary files /dev/null and b/nwnds_module/constitutionup.ncs differ diff --git a/nwnds_module/constitutionup.nss b/nwnds_module/constitutionup.nss new file mode 100644 index 000000000..a5d08cb6a --- /dev/null +++ b/nwnds_module/constitutionup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_CONSTITUTION, 2); +} diff --git a/nwnds_module/constrict.ncs b/nwnds_module/constrict.ncs new file mode 100644 index 000000000..f49ed8a35 Binary files /dev/null and b/nwnds_module/constrict.ncs differ diff --git a/nwnds_module/constrict.nss b/nwnds_module/constrict.nss new file mode 100644 index 000000000..0ce036a62 --- /dev/null +++ b/nwnds_module/constrict.nss @@ -0,0 +1,68 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(2)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d6+7 bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cont_ondeath.ncs b/nwnds_module/cont_ondeath.ncs new file mode 100644 index 000000000..4c003f532 Binary files /dev/null and b/nwnds_module/cont_ondeath.ncs differ diff --git a/nwnds_module/cont_ondeath.nss b/nwnds_module/cont_ondeath.nss new file mode 100644 index 000000000..1782c1883 --- /dev/null +++ b/nwnds_module/cont_ondeath.nss @@ -0,0 +1,16 @@ +#include "treasuresys_inc" + +void main() +{ + string sTemplate = GetResRef(OBJECT_SELF); + string sTag = GetTag(OBJECT_SELF); + location lChest = GetLocation(OBJECT_SELF); + + if ( !GetLocalInt( OBJECT_SELF, "NW_DO_ONCE" )) + { + ExecuteScript( sTreasureGenScript, OBJECT_SELF ); + } + float fSeconds = TREASURE_RESPAWN_TIME; + AssignCommand ( GetArea(OBJECT_SELF),DelayCommand(fSeconds, Create_Chest( sTemplate, sTag, lChest ) ) ); +} + diff --git a/nwnds_module/cont_onopen.ncs b/nwnds_module/cont_onopen.ncs new file mode 100644 index 000000000..f98a4f17b Binary files /dev/null and b/nwnds_module/cont_onopen.ncs differ diff --git a/nwnds_module/cont_onopen.nss b/nwnds_module/cont_onopen.nss new file mode 100644 index 000000000..506911eaf --- /dev/null +++ b/nwnds_module/cont_onopen.nss @@ -0,0 +1,8 @@ +#include "treasuresys_inc" + +void main() +{ +Handle_Open( OBJECT_SELF ); +ExecuteScript( sTreasureGenScript, OBJECT_SELF ); +SetLocalInt( OBJECT_SELF, "NW_DO_ONCE", 1 ); +} diff --git a/nwnds_module/cr_bite_3d6.uti b/nwnds_module/cr_bite_3d6.uti new file mode 100644 index 000000000..12ea41a2b Binary files /dev/null and b/nwnds_module/cr_bite_3d6.uti differ diff --git a/nwnds_module/cr_bite_bnclw001.ncs b/nwnds_module/cr_bite_bnclw001.ncs new file mode 100644 index 000000000..163fab66c Binary files /dev/null and b/nwnds_module/cr_bite_bnclw001.ncs differ diff --git a/nwnds_module/cr_bite_bnclw001.nss b/nwnds_module/cr_bite_bnclw001.nss new file mode 100644 index 000000000..f57764163 --- /dev/null +++ b/nwnds_module/cr_bite_bnclw001.nss @@ -0,0 +1,67 @@ +// Lesser Boneclaw's Improved Grab & Gnaw attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int oFort = GetFortitudeSavingThrow(oTarget); + int nDC = 10; + //int nConDrain = d4(1); + int nSTR_Target; + int nSTR_Creature; + //int nTickFull; + effect eGnawDmg = EffectDamage(d4(1)-2, DAMAGE_TYPE_PIERCING && DAMAGE_TYPE_BLUDGEONING); + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect ePoison = EffectPoison(61); + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + return; + } +// Do bite damage & see if the boneclaw's poison is resisted. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGnawDmg, oTarget); + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_POISON, oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); + } + +// Increase the boneclaw's speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the tick drains 8 CON worth of blood it will detach & run away. + /*if (nTickFull >= 8) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain;*/ + +FloatingTextStringOnCreature("The boneclaw is gnawing on you!", oTarget); + + } diff --git a/nwnds_module/cr_bite_bnclw001.uti b/nwnds_module/cr_bite_bnclw001.uti new file mode 100644 index 000000000..6a7d96f07 Binary files /dev/null and b/nwnds_module/cr_bite_bnclw001.uti differ diff --git a/nwnds_module/cr_bite_cilops01.uti b/nwnds_module/cr_bite_cilops01.uti new file mode 100644 index 000000000..a1bfd98d4 Binary files /dev/null and b/nwnds_module/cr_bite_cilops01.uti differ diff --git a/nwnds_module/cr_bite_dretch01.uti b/nwnds_module/cr_bite_dretch01.uti new file mode 100644 index 000000000..f3c745af0 Binary files /dev/null and b/nwnds_module/cr_bite_dretch01.uti differ diff --git a/nwnds_module/cr_bite_fireb001.uti b/nwnds_module/cr_bite_fireb001.uti new file mode 100644 index 000000000..3aca473bb Binary files /dev/null and b/nwnds_module/cr_bite_fireb001.uti differ diff --git a/nwnds_module/cr_bite_kank002.uti b/nwnds_module/cr_bite_kank002.uti new file mode 100644 index 000000000..ce5c22ee1 Binary files /dev/null and b/nwnds_module/cr_bite_kank002.uti differ diff --git a/nwnds_module/cr_bite_kluzd001.ncs b/nwnds_module/cr_bite_kluzd001.ncs new file mode 100644 index 000000000..7bc8dcb29 Binary files /dev/null and b/nwnds_module/cr_bite_kluzd001.ncs differ diff --git a/nwnds_module/cr_bite_kluzd001.nss b/nwnds_module/cr_bite_kluzd001.nss new file mode 100644 index 000000000..e60c96580 --- /dev/null +++ b/nwnds_module/cr_bite_kluzd001.nss @@ -0,0 +1,67 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d8(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d8+1 bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_bite_kluzd001.uti b/nwnds_module/cr_bite_kluzd001.uti new file mode 100644 index 000000000..559ddc33b Binary files /dev/null and b/nwnds_module/cr_bite_kluzd001.uti differ diff --git a/nwnds_module/cr_bite_psioncus.uti b/nwnds_module/cr_bite_psioncus.uti new file mode 100644 index 000000000..3cdce59e5 Binary files /dev/null and b/nwnds_module/cr_bite_psioncus.uti differ diff --git a/nwnds_module/cr_bite_shaqat01.ncs b/nwnds_module/cr_bite_shaqat01.ncs new file mode 100644 index 000000000..4b76129f0 Binary files /dev/null and b/nwnds_module/cr_bite_shaqat01.ncs differ diff --git a/nwnds_module/cr_bite_shaqat01.nss b/nwnds_module/cr_bite_shaqat01.nss new file mode 100644 index 000000000..4ae2495f2 --- /dev/null +++ b/nwnds_module/cr_bite_shaqat01.nss @@ -0,0 +1,75 @@ +// Shaqat beetle's Bloodsuck Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nConDrain = 1; + int nSTR_Target; + int nSTR_Creature; + int nTickFull; + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = 16 + GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); // Shaqat Beetle's get a +16 bonus to grapple checks. + } + while (nSTR_Target == nSTR_Creature); + +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You force the shaqat beetle to detach from your body.", oTarget); + return; + } + +// Drain 1 point of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodSuck, oTarget); + +// Increase the tick's speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the tick drains 8 CON worth of blood it will detach & run away. + if (nTickFull >= 8) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +FloatingTextStringOnCreature("The shaqat beetle is draining your blood!", oTarget); + + } diff --git a/nwnds_module/cr_bite_shaqat01.uti b/nwnds_module/cr_bite_shaqat01.uti new file mode 100644 index 000000000..8bed48615 Binary files /dev/null and b/nwnds_module/cr_bite_shaqat01.uti differ diff --git a/nwnds_module/cr_bite_spnwyrm.ncs b/nwnds_module/cr_bite_spnwyrm.ncs new file mode 100644 index 000000000..a17f8a76c Binary files /dev/null and b/nwnds_module/cr_bite_spnwyrm.ncs differ diff --git a/nwnds_module/cr_bite_spnwyrm.nss b/nwnds_module/cr_bite_spnwyrm.nss new file mode 100644 index 000000000..61a5b6637 --- /dev/null +++ b/nwnds_module/cr_bite_spnwyrm.nss @@ -0,0 +1,66 @@ +// Spinewyrm Improved Grab & Constrict - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eConstrictDmg = EffectDamage(d6(2)+10, DAMAGE_TYPE_PIERCING && DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Spinewyrm can't constrict colossal creatures. + if ( GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL ) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d6+10 piercing &/or crushing damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eConstrictDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the spinewyrm's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// creature TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The spinewyrm tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The spinewyrm is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_bite_spnwyrm.uti b/nwnds_module/cr_bite_spnwyrm.uti new file mode 100644 index 000000000..f678058de Binary files /dev/null and b/nwnds_module/cr_bite_spnwyrm.uti differ diff --git a/nwnds_module/cr_bite_trin001.uti b/nwnds_module/cr_bite_trin001.uti new file mode 100644 index 000000000..9de99ad4d Binary files /dev/null and b/nwnds_module/cr_bite_trin001.uti differ diff --git a/nwnds_module/cr_bite_zktrinak.uti b/nwnds_module/cr_bite_zktrinak.uti new file mode 100644 index 000000000..825f55215 Binary files /dev/null and b/nwnds_module/cr_bite_zktrinak.uti differ diff --git a/nwnds_module/cr_bite_zktrinta.uti b/nwnds_module/cr_bite_zktrinta.uti new file mode 100644 index 000000000..9aa3bc129 Binary files /dev/null and b/nwnds_module/cr_bite_zktrinta.uti differ diff --git a/nwnds_module/cr_claw_bogwdr01.ncs b/nwnds_module/cr_claw_bogwdr01.ncs new file mode 100644 index 000000000..79bcf52ce Binary files /dev/null and b/nwnds_module/cr_claw_bogwdr01.ncs differ diff --git a/nwnds_module/cr_claw_bogwdr01.nss b/nwnds_module/cr_claw_bogwdr01.nss new file mode 100644 index 000000000..422e516ed --- /dev/null +++ b/nwnds_module/cr_claw_bogwdr01.nss @@ -0,0 +1,68 @@ +// Bog Wader Improved Grab & Constrict - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg1 = EffectDamage(d4(1)+4, DAMAGE_TYPE_PIERCING && DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if ( GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL ) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d4+4 piercing &/or crushing damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg1, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the bog wader's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// creature TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The bog wader tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The bog wader is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_claw_bogwdr01.uti b/nwnds_module/cr_claw_bogwdr01.uti new file mode 100644 index 000000000..e2a7c3d0c Binary files /dev/null and b/nwnds_module/cr_claw_bogwdr01.uti differ diff --git a/nwnds_module/cr_claw_dretch01.uti b/nwnds_module/cr_claw_dretch01.uti new file mode 100644 index 000000000..06d302067 Binary files /dev/null and b/nwnds_module/cr_claw_dretch01.uti differ diff --git a/nwnds_module/cr_claw_fireb001.uti b/nwnds_module/cr_claw_fireb001.uti new file mode 100644 index 000000000..43072eee3 Binary files /dev/null and b/nwnds_module/cr_claw_fireb001.uti differ diff --git a/nwnds_module/cr_claw_obret.ncs b/nwnds_module/cr_claw_obret.ncs new file mode 100644 index 000000000..e74a24f11 Binary files /dev/null and b/nwnds_module/cr_claw_obret.ncs differ diff --git a/nwnds_module/cr_claw_obret.nss b/nwnds_module/cr_claw_obret.nss new file mode 100644 index 000000000..3b1c1435d --- /dev/null +++ b/nwnds_module/cr_claw_obret.nss @@ -0,0 +1,66 @@ +// Obsidian Retriever Improved Grab & Constrict - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg1 = EffectDamage(d6(2), DAMAGE_TYPE_PIERCING && DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// COLOSSAL & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d6 piercing &/or crushing damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg1, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the obsidian retriever's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// creature TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The obsidian retriever tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The obsidian retriever is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_claw_obret.uti b/nwnds_module/cr_claw_obret.uti new file mode 100644 index 000000000..87698bb72 Binary files /dev/null and b/nwnds_module/cr_claw_obret.uti differ diff --git a/nwnds_module/cr_claw_raakle01.ncs b/nwnds_module/cr_claw_raakle01.ncs new file mode 100644 index 000000000..f256c961e Binary files /dev/null and b/nwnds_module/cr_claw_raakle01.ncs differ diff --git a/nwnds_module/cr_claw_raakle01.nss b/nwnds_module/cr_claw_raakle01.nss new file mode 100644 index 000000000..a4b2ce927 --- /dev/null +++ b/nwnds_module/cr_claw_raakle01.nss @@ -0,0 +1,107 @@ +// Raakle's Improved Grab & Acid Spit attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nHD = GetHitDice(oPC); + int nDC = 10 + (nHD / 2) + GetAbilityModifier(ABILITY_CONSTITUTION, oPC); + int nAcidDamage = d4(6); + int nSTR_Target; + int nSTR_Creature; + int nAcidAttack = 0; + + effect eGrapple = EffectEntangle(); + effect eAcidSpray = EffectDamage(nAcidDamage, DAMAGE_TYPE_ACID); + effect eAcidSpray2 = EffectDamage(nAcidDamage/2, DAMAGE_TYPE_ACID); + effect eVis = EffectVisualEffect(VFX_IMP_ACID_L); + +// Can't grapple colossal creatures. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); + +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape from the raakle's claws.", oTarget); + return; + } + +// Check for immunity vs entangle. If the target is immune, tell him that the +// raakle TRIED to grapple him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The raakle tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The raakle is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the raakle's +// grapple attempt failed. Otherwise it simply gets entangled as intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eGrapple, oTarget, 6.0f); + + +// Acid attack - Reflex Save vs. CON-based DC + if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_ACID, oPC, 0.0f )) + { + // Failed Reflex save, apply acid damage + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcidSpray,oTarget); + FloatingTextStringOnCreature("The raakle sprays you with its digestive acids!", oTarget); + } + else + { + // Passed Relex save, apply 1/2 acid damage + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcidSpray2,oTarget); + FloatingTextStringOnCreature("The raakle sprays you with its digestive acids!", oTarget); + } + +// Raakles flee if two acid attacks aren't enough to kill their prey. + if (nAcidAttack >= 2) + { + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Acid attack counter + nAcidAttack = nAcidAttack + 1; + +FloatingTextStringOnCreature("The raakle has you grappled!", oTarget); + + } diff --git a/nwnds_module/cr_claw_raakle01.uti b/nwnds_module/cr_claw_raakle01.uti new file mode 100644 index 000000000..68739ffc6 Binary files /dev/null and b/nwnds_module/cr_claw_raakle01.uti differ diff --git a/nwnds_module/cr_dart_huntcac.ncs b/nwnds_module/cr_dart_huntcac.ncs new file mode 100644 index 000000000..50cb94d4f Binary files /dev/null and b/nwnds_module/cr_dart_huntcac.ncs differ diff --git a/nwnds_module/cr_dart_huntcac.nss b/nwnds_module/cr_dart_huntcac.nss new file mode 100644 index 000000000..a45ade9bf --- /dev/null +++ b/nwnds_module/cr_dart_huntcac.nss @@ -0,0 +1,33 @@ +// Hunting Cactus Ranged Spine & Poison - Item Unique OnHit Script +// +// Since you can't put a creature poison directly on a creature's ranged +// projectile. +// +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int oFort = GetFortitudeSavingThrow(oTarget); + int nDC = 14; + effect ePoison = EffectPoison(60); + effect ePoisonVis = EffectVisualEffect(VFX_IMP_POISON_S); + + +// See if the hunting cactus' poison is resisted. + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_POISON, oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, ePoisonVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); + } + + } diff --git a/nwnds_module/cr_dart_huntcac.uti b/nwnds_module/cr_dart_huntcac.uti new file mode 100644 index 000000000..a336266ec Binary files /dev/null and b/nwnds_module/cr_dart_huntcac.uti differ diff --git a/nwnds_module/cr_gore_1d4.uti b/nwnds_module/cr_gore_1d4.uti new file mode 100644 index 000000000..0030e490d Binary files /dev/null and b/nwnds_module/cr_gore_1d4.uti differ diff --git a/nwnds_module/cr_gore_cona001.uti b/nwnds_module/cr_gore_cona001.uti new file mode 100644 index 000000000..712df8de4 Binary files /dev/null and b/nwnds_module/cr_gore_cona001.uti differ diff --git a/nwnds_module/cr_gore_wezer01.uti b/nwnds_module/cr_gore_wezer01.uti new file mode 100644 index 000000000..cec066c63 Binary files /dev/null and b/nwnds_module/cr_gore_wezer01.uti differ diff --git a/nwnds_module/cr_headbutt_tulk.uti b/nwnds_module/cr_headbutt_tulk.uti new file mode 100644 index 000000000..86e085d0b Binary files /dev/null and b/nwnds_module/cr_headbutt_tulk.uti differ diff --git a/nwnds_module/cr_hejkin001.utc b/nwnds_module/cr_hejkin001.utc new file mode 100644 index 000000000..8eecf8a72 Binary files /dev/null and b/nwnds_module/cr_hejkin001.utc differ diff --git a/nwnds_module/cr_hide_airb001.uti b/nwnds_module/cr_hide_airb001.uti new file mode 100644 index 000000000..eb1b0c04c Binary files /dev/null and b/nwnds_module/cr_hide_airb001.uti differ diff --git a/nwnds_module/cr_hide_claygol.uti b/nwnds_module/cr_hide_claygol.uti new file mode 100644 index 000000000..78b139017 Binary files /dev/null and b/nwnds_module/cr_hide_claygol.uti differ diff --git a/nwnds_module/cr_hide_dretch01.uti b/nwnds_module/cr_hide_dretch01.uti new file mode 100644 index 000000000..4847f8eb5 Binary files /dev/null and b/nwnds_module/cr_hide_dretch01.uti differ diff --git a/nwnds_module/cr_hide_elfrope.uti b/nwnds_module/cr_hide_elfrope.uti new file mode 100644 index 000000000..4426b2353 Binary files /dev/null and b/nwnds_module/cr_hide_elfrope.uti differ diff --git a/nwnds_module/cr_hide_erthb001.uti b/nwnds_module/cr_hide_erthb001.uti new file mode 100644 index 000000000..2bcced2a6 Binary files /dev/null and b/nwnds_module/cr_hide_erthb001.uti differ diff --git a/nwnds_module/cr_hide_fireb001.uti b/nwnds_module/cr_hide_fireb001.uti new file mode 100644 index 000000000..0e05803d9 Binary files /dev/null and b/nwnds_module/cr_hide_fireb001.uti differ diff --git a/nwnds_module/cr_hide_hunt_cac.uti b/nwnds_module/cr_hide_hunt_cac.uti new file mode 100644 index 000000000..474281d13 Binary files /dev/null and b/nwnds_module/cr_hide_hunt_cac.uti differ diff --git a/nwnds_module/cr_hide_psishad1.uti b/nwnds_module/cr_hide_psishad1.uti new file mode 100644 index 000000000..821f7eec6 Binary files /dev/null and b/nwnds_module/cr_hide_psishad1.uti differ diff --git a/nwnds_module/cr_hide_sandgol.uti b/nwnds_module/cr_hide_sandgol.uti new file mode 100644 index 000000000..aad62484a Binary files /dev/null and b/nwnds_module/cr_hide_sandgol.uti differ diff --git a/nwnds_module/cr_hide_scrab002.uti b/nwnds_module/cr_hide_scrab002.uti new file mode 100644 index 000000000..34b0967b4 Binary files /dev/null and b/nwnds_module/cr_hide_scrab002.uti differ diff --git a/nwnds_module/cr_hide_silt_wrd.uti b/nwnds_module/cr_hide_silt_wrd.uti new file mode 100644 index 000000000..56efca676 Binary files /dev/null and b/nwnds_module/cr_hide_silt_wrd.uti differ diff --git a/nwnds_module/cr_hide_spnwyrm.uti b/nwnds_module/cr_hide_spnwyrm.uti new file mode 100644 index 000000000..efe5f8602 Binary files /dev/null and b/nwnds_module/cr_hide_spnwyrm.uti differ diff --git a/nwnds_module/cr_hide_stonegol.uti b/nwnds_module/cr_hide_stonegol.uti new file mode 100644 index 000000000..32b617908 Binary files /dev/null and b/nwnds_module/cr_hide_stonegol.uti differ diff --git a/nwnds_module/cr_hide_styr.uti b/nwnds_module/cr_hide_styr.uti new file mode 100644 index 000000000..b72803833 Binary files /dev/null and b/nwnds_module/cr_hide_styr.uti differ diff --git a/nwnds_module/cr_hide_zktrinak.uti b/nwnds_module/cr_hide_zktrinak.uti new file mode 100644 index 000000000..538e5979f Binary files /dev/null and b/nwnds_module/cr_hide_zktrinak.uti differ diff --git a/nwnds_module/cr_slam_ashgolem.ncs b/nwnds_module/cr_slam_ashgolem.ncs new file mode 100644 index 000000000..271a35c56 Binary files /dev/null and b/nwnds_module/cr_slam_ashgolem.ncs differ diff --git a/nwnds_module/cr_slam_ashgolem.nss b/nwnds_module/cr_slam_ashgolem.nss new file mode 100644 index 000000000..39b9056d1 --- /dev/null +++ b/nwnds_module/cr_slam_ashgolem.nss @@ -0,0 +1,66 @@ +// Ash Golem Burning Grasp - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg1 = EffectDamage(d10(1), DAMAGE_TYPE_FIRE); + int nSTR_Target; + int nSTR_Creature; + +// COLOSSAL & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d10 fire damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg1, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the ash golem's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The ash golem tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The ash golem is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_slam_ashgolem.uti b/nwnds_module/cr_slam_ashgolem.uti new file mode 100644 index 000000000..384dd7585 Binary files /dev/null and b/nwnds_module/cr_slam_ashgolem.uti differ diff --git a/nwnds_module/cr_slam_bkill001.ncs b/nwnds_module/cr_slam_bkill001.ncs new file mode 100644 index 000000000..cad71cd3e Binary files /dev/null and b/nwnds_module/cr_slam_bkill001.ncs differ diff --git a/nwnds_module/cr_slam_bkill001.nss b/nwnds_module/cr_slam_bkill001.nss new file mode 100644 index 000000000..96b5265fa --- /dev/null +++ b/nwnds_module/cr_slam_bkill001.nss @@ -0,0 +1,67 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d6+6 bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = 8 + GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); // Blossomkillers have a +8 to grapple checks. + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The blossomkiller tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The blossomkiller is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_slam_bkill001.uti b/nwnds_module/cr_slam_bkill001.uti new file mode 100644 index 000000000..1c9de63d2 Binary files /dev/null and b/nwnds_module/cr_slam_bkill001.uti differ diff --git a/nwnds_module/cr_slam_bldgrss1.uti b/nwnds_module/cr_slam_bldgrss1.uti new file mode 100644 index 000000000..3ec5837d1 Binary files /dev/null and b/nwnds_module/cr_slam_bldgrss1.uti differ diff --git a/nwnds_module/cr_slam_bldgrss2.uti b/nwnds_module/cr_slam_bldgrss2.uti new file mode 100644 index 000000000..8e1e453dc Binary files /dev/null and b/nwnds_module/cr_slam_bldgrss2.uti differ diff --git a/nwnds_module/cr_slam_bldgrssj.ncs b/nwnds_module/cr_slam_bldgrssj.ncs new file mode 100644 index 000000000..09c64968c Binary files /dev/null and b/nwnds_module/cr_slam_bldgrssj.ncs differ diff --git a/nwnds_module/cr_slam_bldgrssj.nss b/nwnds_module/cr_slam_bldgrssj.nss new file mode 100644 index 000000000..8663d8a4c --- /dev/null +++ b/nwnds_module/cr_slam_bldgrssj.nss @@ -0,0 +1,82 @@ +// Jungle Bloodvine Improved Grab & Blood Drain - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nSTR_Target; + int nSTR_Creature; + int nConDrain = 2; + + //effect eWebVis = EffectVisualEffect(VFX_DUR_WEB); + effect eCocoon = EffectEntangle(); + eCocoon = ExtraordinaryEffect(eCocoon); + //effect eLink = EffectLinkEffects(eWebVis, eCocoon); + + + effect eBloodVis = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); + effect eBloodsuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + eBloodsuck = ExtraordinaryEffect(eBloodsuck); + +// Colossal creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2 CON Damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodsuck, oTarget); + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the bloodvine's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// silk wyrm TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The bloodvine tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The bloodvine is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the elven +// rope's entangle attempt failed. Otherwise it simply gets entangled as +// intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCocoon, oTarget, 6.0f); + +} + + diff --git a/nwnds_module/cr_slam_bldgrssp.ncs b/nwnds_module/cr_slam_bldgrssp.ncs new file mode 100644 index 000000000..4293601c4 Binary files /dev/null and b/nwnds_module/cr_slam_bldgrssp.ncs differ diff --git a/nwnds_module/cr_slam_bldgrssp.nss b/nwnds_module/cr_slam_bldgrssp.nss new file mode 100644 index 000000000..de36cd09e --- /dev/null +++ b/nwnds_module/cr_slam_bldgrssp.nss @@ -0,0 +1,83 @@ +// Plains Bloodvine Improved Grab & Blood Drain - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nSTR_Target; + int nSTR_Creature; + int nConDrain = 1; + + //effect eWebVis = EffectVisualEffect(VFX_DUR_WEB); + effect eCocoon = EffectEntangle(); + eCocoon = ExtraordinaryEffect(eCocoon); + //effect eLink = EffectLinkEffects(eWebVis, eCocoon); + + + effect eBloodVis = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); + effect eBloodsuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + eBloodsuck = ExtraordinaryEffect(eBloodsuck); + +// Colossal & gargantuan creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1 CON Damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodsuck, oTarget); + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the bloodvine's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// silk wyrm TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The bloodvine tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The bloodvine is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the elven +// rope's entangle attempt failed. Otherwise it simply gets entangled as +// intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCocoon, oTarget, 6.0f); + +} + + diff --git a/nwnds_module/cr_slam_cilops01.uti b/nwnds_module/cr_slam_cilops01.uti new file mode 100644 index 000000000..0849fbc85 Binary files /dev/null and b/nwnds_module/cr_slam_cilops01.uti differ diff --git a/nwnds_module/cr_slam_claygol.uti b/nwnds_module/cr_slam_claygol.uti new file mode 100644 index 000000000..78fa928f3 Binary files /dev/null and b/nwnds_module/cr_slam_claygol.uti differ diff --git a/nwnds_module/cr_slam_feylaar1.ncs b/nwnds_module/cr_slam_feylaar1.ncs new file mode 100644 index 000000000..976863327 Binary files /dev/null and b/nwnds_module/cr_slam_feylaar1.ncs differ diff --git a/nwnds_module/cr_slam_feylaar1.nss b/nwnds_module/cr_slam_feylaar1.nss new file mode 100644 index 000000000..62bb40196 --- /dev/null +++ b/nwnds_module/cr_slam_feylaar1.nss @@ -0,0 +1,67 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d6+3 bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = 8 + GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); // Feylaars recieve a +8 racial bonus to Grapple checks. + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the feylaar's grasp.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The feylaar tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The feylaar is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cr_slam_feylaar1.uti b/nwnds_module/cr_slam_feylaar1.uti new file mode 100644 index 000000000..39f76e834 Binary files /dev/null and b/nwnds_module/cr_slam_feylaar1.uti differ diff --git a/nwnds_module/cr_slam_floater1.uti b/nwnds_module/cr_slam_floater1.uti new file mode 100644 index 000000000..6fdedfa31 Binary files /dev/null and b/nwnds_module/cr_slam_floater1.uti differ diff --git a/nwnds_module/cr_slam_pfish001.uti b/nwnds_module/cr_slam_pfish001.uti new file mode 100644 index 000000000..3a5649bb6 Binary files /dev/null and b/nwnds_module/cr_slam_pfish001.uti differ diff --git a/nwnds_module/cr_slam_psishad1.ncs b/nwnds_module/cr_slam_psishad1.ncs new file mode 100644 index 000000000..0e8710cc0 Binary files /dev/null and b/nwnds_module/cr_slam_psishad1.ncs differ diff --git a/nwnds_module/cr_slam_psishad1.nss b/nwnds_module/cr_slam_psishad1.nss new file mode 100644 index 000000000..0b43c5d37 --- /dev/null +++ b/nwnds_module/cr_slam_psishad1.nss @@ -0,0 +1,58 @@ +// Psi-Shadow CON Draining Touch - Item Unique OnHit Script +// + +#include "nw_i0_spells" + +void main() +{ + object oCaster = OBJECT_SELF ; // Originator + object oTarget = GetSpellTargetObject(); // Target + + int nCon = GetAbilityScore(oTarget, ABILITY_CONSTITUTION); + int nHD = GetHitDice(oCaster); + int nDC = 10 + (nHD / 2) + GetAbilityModifier(ABILITY_CHARISMA, oCaster); + + +// CON drain kills when playing under Core Rules or better. + int bKillEm = FALSE; + if ( + !GetIsPC(oTarget) || + GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || + GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT + ) + + bKillEm = TRUE; + +// Set up CON drain. + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + int nDam = 2; + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam); + eCon = SupernaturalEffect(eCon); + +// Return if target is dead or invalid. + if ( GetIsDead(oTarget) || !GetIsObjectValid(oTarget) ) + return; + +// Return if target is immune to energy drain. + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + return; + +// Fortitude Save vs. CHA-based DC + if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oCaster, 0.0f )) + { + // Die if CON dips below 3. + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHP, oTarget); + } + + // Drain 2 CON & fire VFX + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + } +} diff --git a/nwnds_module/cr_slam_psishad1.uti b/nwnds_module/cr_slam_psishad1.uti new file mode 100644 index 000000000..872f99672 Binary files /dev/null and b/nwnds_module/cr_slam_psishad1.uti differ diff --git a/nwnds_module/cr_slam_sand_gol.uti b/nwnds_module/cr_slam_sand_gol.uti new file mode 100644 index 000000000..3eca0b376 Binary files /dev/null and b/nwnds_module/cr_slam_sand_gol.uti differ diff --git a/nwnds_module/cr_slam_siltwrd.ncs b/nwnds_module/cr_slam_siltwrd.ncs new file mode 100644 index 000000000..99a504e63 Binary files /dev/null and b/nwnds_module/cr_slam_siltwrd.ncs differ diff --git a/nwnds_module/cr_slam_siltwrd.nss b/nwnds_module/cr_slam_siltwrd.nss new file mode 100644 index 000000000..a9d3a56e8 --- /dev/null +++ b/nwnds_module/cr_slam_siltwrd.nss @@ -0,0 +1,60 @@ +// Silt Weird Slam CON Drain - Item Unique OnHit Script +// + +#include "nw_i0_spells" + +void main() +{ + object oCaster = OBJECT_SELF ; // Originator + object oTarget = GetSpellTargetObject(); // Target + + int nCon = GetAbilityScore(oTarget, ABILITY_CONSTITUTION); + int nHD = GetHitDice(oCaster); + +// 11 instead of 10 due to Silt Weird's Ability Focus (constitution drain) + int nDC = 11 + (nHD / 2) + GetAbilityModifier(ABILITY_CHARISMA, oCaster); + + +// CON drain kills when playing under Core Rules or better. + int bKillEm = FALSE; + if ( + !GetIsPC(oTarget) || + GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || + GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT + ) + + bKillEm = TRUE; + +// Set up CON drain. + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + int nDam = 1; + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + eCon = SupernaturalEffect(eCon); + +// Return if target is dead or invalid. + if ( GetIsDead(oTarget) || !GetIsObjectValid(oTarget) ) + return; + +// Return if target is immune to energy drain. + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + return; + +// Fortitude Save vs. CHA-based DC + if(!MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE, oCaster, 0.0f )) + { + // Die if CON dips below 3. + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHP, oTarget); + } + + // Drain 1 CON & fire VFX + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + } +} diff --git a/nwnds_module/cr_slam_siltwrd.uti b/nwnds_module/cr_slam_siltwrd.uti new file mode 100644 index 000000000..3a28bdd59 Binary files /dev/null and b/nwnds_module/cr_slam_siltwrd.uti differ diff --git a/nwnds_module/cr_slam_stonegol.uti b/nwnds_module/cr_slam_stonegol.uti new file mode 100644 index 000000000..a7c279324 Binary files /dev/null and b/nwnds_module/cr_slam_stonegol.uti differ diff --git a/nwnds_module/cr_slap_elfrope.ncs b/nwnds_module/cr_slap_elfrope.ncs new file mode 100644 index 000000000..5c956498d Binary files /dev/null and b/nwnds_module/cr_slap_elfrope.ncs differ diff --git a/nwnds_module/cr_slap_elfrope.nss b/nwnds_module/cr_slap_elfrope.nss new file mode 100644 index 000000000..2fac17e21 --- /dev/null +++ b/nwnds_module/cr_slap_elfrope.nss @@ -0,0 +1,82 @@ +// Elven Rope Improved Grab & Blood Drain - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nSTR_Target; + int nSTR_Creature; + int nConDrain = d4(1); + + //effect eWebVis = EffectVisualEffect(VFX_DUR_WEB); + effect eCocoon = EffectEntangle(); + eCocoon = ExtraordinaryEffect(eCocoon); + //effect eLink = EffectLinkEffects(eWebVis, eCocoon); + + + effect eBloodVis = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); + effect eBloodsuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + eBloodsuck = ExtraordinaryEffect(eBloodsuck); + +// Colossal creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d4 CON Damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodsuck, oTarget); + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the elven rope's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// silk wyrm TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The elven rope tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The elven rope is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the elven +// rope's entangle attempt failed. Otherwise it simply gets entangled as +// intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCocoon, oTarget, 6.0f); + +} + + diff --git a/nwnds_module/cr_slap_elfrope.uti b/nwnds_module/cr_slap_elfrope.uti new file mode 100644 index 000000000..c0509fa10 Binary files /dev/null and b/nwnds_module/cr_slap_elfrope.uti differ diff --git a/nwnds_module/cr_slap_erthb001.uti b/nwnds_module/cr_slap_erthb001.uti new file mode 100644 index 000000000..56990c9de Binary files /dev/null and b/nwnds_module/cr_slap_erthb001.uti differ diff --git a/nwnds_module/cr_spine_huntcac.ncs b/nwnds_module/cr_spine_huntcac.ncs new file mode 100644 index 000000000..7000c0d5b Binary files /dev/null and b/nwnds_module/cr_spine_huntcac.ncs differ diff --git a/nwnds_module/cr_spine_huntcac.nss b/nwnds_module/cr_spine_huntcac.nss new file mode 100644 index 000000000..a4bd08c5e --- /dev/null +++ b/nwnds_module/cr_spine_huntcac.nss @@ -0,0 +1,48 @@ +// Hunting Cactus' Bloodsuck Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nConDrain = d2(1); + int nTickFull; + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } + +// Only feeds on paralyzed creatures + + +// Drain 1d2 points of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodSuck, oTarget); + +// When the hunting cactus drains 10 CON worth of blood it will leave. + if (nTickFull >= 10) + { + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +FloatingTextStringOnCreature("The hunting cactus is draining your blood!", oTarget); + + } diff --git a/nwnds_module/cr_spine_rockcac.ncs b/nwnds_module/cr_spine_rockcac.ncs new file mode 100644 index 000000000..74104983a Binary files /dev/null and b/nwnds_module/cr_spine_rockcac.ncs differ diff --git a/nwnds_module/cr_spine_rockcac.nss b/nwnds_module/cr_spine_rockcac.nss new file mode 100644 index 000000000..f769298c8 --- /dev/null +++ b/nwnds_module/cr_spine_rockcac.nss @@ -0,0 +1,85 @@ +// Rock Cactus' Bloodsuck Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() + { + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nThirst = GetLocalInt(oTarget,"nThirst"); + int nConDrain = d4(1); + int nWaterLoss = d10(5); + int nSTR_Target; + int nSTR_Creature; + int nTickFull; + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + + if (!nThirst) + { + SetLocalInt(oTarget, "nThirst", 0); + } + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = 8 + GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); // Rock Cactus have a +8 racial bonus to grapple checks. + } + + while (nSTR_Target == nSTR_Creature); + +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + FloatingTextStringOnCreature("You force the rock cactus to detach from your body.", oTarget); + return; + } + +// Drain 1d4 points of CON & run VFX. + effect eBloodVis = EffectVisualEffect(VFX_COM_SPECIAL_WHITE_BLUE); + effect eBloodsuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + eBloodsuck = ExtraordinaryEffect(eBloodsuck); + +// Increase the rock cactus' speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the rock cactus drains 12 CON worth of blood it will detach. + if (nTickFull >= 12) + { + FloatingTextStringOnCreature("Swollen with moisture, the rock cactus detaches.", oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +// Increase Thirst Counter + nThirst = nThirst + nWaterLoss; + + + FloatingTextStringOnCreature("The rock cactus is draining your moisture!", oTarget); + + } diff --git a/nwnds_module/cr_spine_rockcac.uti b/nwnds_module/cr_spine_rockcac.uti new file mode 100644 index 000000000..ce8cf42a8 Binary files /dev/null and b/nwnds_module/cr_spine_rockcac.uti differ diff --git a/nwnds_module/cr_stng_dglide01.uti b/nwnds_module/cr_stng_dglide01.uti new file mode 100644 index 000000000..1a19ae315 Binary files /dev/null and b/nwnds_module/cr_stng_dglide01.uti differ diff --git a/nwnds_module/crabmonstrous001.utc b/nwnds_module/crabmonstrous001.utc new file mode 100644 index 000000000..5e2535ae2 Binary files /dev/null and b/nwnds_module/crabmonstrous001.utc differ diff --git a/nwnds_module/cre_bite_babau.uti b/nwnds_module/cre_bite_babau.uti new file mode 100644 index 000000000..bfb3c5c30 Binary files /dev/null and b/nwnds_module/cre_bite_babau.uti differ diff --git a/nwnds_module/cre_bite_gaj.ncs b/nwnds_module/cre_bite_gaj.ncs new file mode 100644 index 000000000..538d9359a Binary files /dev/null and b/nwnds_module/cre_bite_gaj.ncs differ diff --git a/nwnds_module/cre_bite_gaj.nss b/nwnds_module/cre_bite_gaj.nss new file mode 100644 index 000000000..4f824906e --- /dev/null +++ b/nwnds_module/cre_bite_gaj.nss @@ -0,0 +1,69 @@ +// Gaj Improved Grab - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg1 = EffectDamage(d6(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + effect eGrabDmg2 = EffectDamage(d6(1)+nCreSTR, DAMAGE_TYPE_PIERCING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d6 bludgeoning damage + 1d6 piercing damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg1, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg2, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the gaj's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The gaj tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The gaj is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/cre_bite_gaj.uti b/nwnds_module/cre_bite_gaj.uti new file mode 100644 index 000000000..47f3349a9 Binary files /dev/null and b/nwnds_module/cre_bite_gaj.uti differ diff --git a/nwnds_module/cre_claw_babau.uti b/nwnds_module/cre_claw_babau.uti new file mode 100644 index 000000000..ba6def98e Binary files /dev/null and b/nwnds_module/cre_claw_babau.uti differ diff --git a/nwnds_module/cre_gaj_antenna.uti b/nwnds_module/cre_gaj_antenna.uti new file mode 100644 index 000000000..8ee981927 Binary files /dev/null and b/nwnds_module/cre_gaj_antenna.uti differ diff --git a/nwnds_module/createundead.uti b/nwnds_module/createundead.uti new file mode 100644 index 000000000..9d780f7da Binary files /dev/null and b/nwnds_module/createundead.uti differ diff --git a/nwnds_module/creaturepalcus.itp b/nwnds_module/creaturepalcus.itp new file mode 100644 index 000000000..eae405f3c Binary files /dev/null and b/nwnds_module/creaturepalcus.itp differ diff --git a/nwnds_module/crft_acidcrystal.uti b/nwnds_module/crft_acidcrystal.uti new file mode 100644 index 000000000..74bbe57e0 Binary files /dev/null and b/nwnds_module/crft_acidcrystal.uti differ diff --git a/nwnds_module/crft_air_dr_hd.uti b/nwnds_module/crft_air_dr_hd.uti new file mode 100644 index 000000000..1bf0208f7 Binary files /dev/null and b/nwnds_module/crft_air_dr_hd.uti differ diff --git a/nwnds_module/crft_bandages.uti b/nwnds_module/crft_bandages.uti new file mode 100644 index 000000000..650133af0 Binary files /dev/null and b/nwnds_module/crft_bandages.uti differ diff --git a/nwnds_module/crft_bnclw_glnd.uti b/nwnds_module/crft_bnclw_glnd.uti new file mode 100644 index 000000000..3579f1567 Binary files /dev/null and b/nwnds_module/crft_bnclw_glnd.uti differ diff --git a/nwnds_module/crft_brimstone.uti b/nwnds_module/crft_brimstone.uti new file mode 100644 index 000000000..cd3da6ad6 Binary files /dev/null and b/nwnds_module/crft_brimstone.uti differ diff --git a/nwnds_module/crft_celestelixr.uti b/nwnds_module/crft_celestelixr.uti new file mode 100644 index 000000000..e426fd3fa Binary files /dev/null and b/nwnds_module/crft_celestelixr.uti differ diff --git a/nwnds_module/crft_coldstone.uti b/nwnds_module/crft_coldstone.uti new file mode 100644 index 000000000..0f2d1d227 Binary files /dev/null and b/nwnds_module/crft_coldstone.uti differ diff --git a/nwnds_module/crft_dspidersilk.uti b/nwnds_module/crft_dspidersilk.uti new file mode 100644 index 000000000..a225aa8bd Binary files /dev/null and b/nwnds_module/crft_dspidersilk.uti differ diff --git a/nwnds_module/crft_dspidgland.uti b/nwnds_module/crft_dspidgland.uti new file mode 100644 index 000000000..4fa66de5c Binary files /dev/null and b/nwnds_module/crft_dspidgland.uti differ diff --git a/nwnds_module/crft_dspidthread.uti b/nwnds_module/crft_dspidthread.uti new file mode 100644 index 000000000..6a6b71f7d Binary files /dev/null and b/nwnds_module/crft_dspidthread.uti differ diff --git a/nwnds_module/crft_earth_dr_hd.uti b/nwnds_module/crft_earth_dr_hd.uti new file mode 100644 index 000000000..9632ed2f0 Binary files /dev/null and b/nwnds_module/crft_earth_dr_hd.uti differ diff --git a/nwnds_module/crft_elementesnc.uti b/nwnds_module/crft_elementesnc.uti new file mode 100644 index 000000000..351dc3927 Binary files /dev/null and b/nwnds_module/crft_elementesnc.uti differ diff --git a/nwnds_module/crft_erdlublood.uti b/nwnds_module/crft_erdlublood.uti new file mode 100644 index 000000000..d3118d81d Binary files /dev/null and b/nwnds_module/crft_erdlublood.uti differ diff --git a/nwnds_module/crft_fire_dr_hd.uti b/nwnds_module/crft_fire_dr_hd.uti new file mode 100644 index 000000000..8d87a2da7 Binary files /dev/null and b/nwnds_module/crft_fire_dr_hd.uti differ diff --git a/nwnds_module/crft_fordmusk001.uti b/nwnds_module/crft_fordmusk001.uti new file mode 100644 index 000000000..ca18f56e9 Binary files /dev/null and b/nwnds_module/crft_fordmusk001.uti differ diff --git a/nwnds_module/crft_gaj_bladder.uti b/nwnds_module/crft_gaj_bladder.uti new file mode 100644 index 000000000..3f7f28358 Binary files /dev/null and b/nwnds_module/crft_gaj_bladder.uti differ diff --git a/nwnds_module/crft_garlic.uti b/nwnds_module/crft_garlic.uti new file mode 100644 index 000000000..1dc314836 Binary files /dev/null and b/nwnds_module/crft_garlic.uti differ diff --git a/nwnds_module/crft_giantskull.uti b/nwnds_module/crft_giantskull.uti new file mode 100644 index 000000000..86bcd3b2e Binary files /dev/null and b/nwnds_module/crft_giantskull.uti differ diff --git a/nwnds_module/crft_giantstooth.uti b/nwnds_module/crft_giantstooth.uti new file mode 100644 index 000000000..36d2a674e Binary files /dev/null and b/nwnds_module/crft_giantstooth.uti differ diff --git a/nwnds_module/crft_ginseng.uti b/nwnds_module/crft_ginseng.uti new file mode 100644 index 000000000..c2a022a76 Binary files /dev/null and b/nwnds_module/crft_ginseng.uti differ diff --git a/nwnds_module/crft_ironneedle.uti b/nwnds_module/crft_ironneedle.uti new file mode 100644 index 000000000..2749ea7aa Binary files /dev/null and b/nwnds_module/crft_ironneedle.uti differ diff --git a/nwnds_module/crft_kartangegg.uti b/nwnds_module/crft_kartangegg.uti new file mode 100644 index 000000000..bce9c464f Binary files /dev/null and b/nwnds_module/crft_kartangegg.uti differ diff --git a/nwnds_module/crft_magma_dr_hd.uti b/nwnds_module/crft_magma_dr_hd.uti new file mode 100644 index 000000000..3c03fb0e3 Binary files /dev/null and b/nwnds_module/crft_magma_dr_hd.uti differ diff --git a/nwnds_module/crft_mandrake.uti b/nwnds_module/crft_mandrake.uti new file mode 100644 index 000000000..53cc360ad Binary files /dev/null and b/nwnds_module/crft_mandrake.uti differ diff --git a/nwnds_module/crft_mannequin.utp b/nwnds_module/crft_mannequin.utp new file mode 100644 index 000000000..c513d71ff Binary files /dev/null and b/nwnds_module/crft_mannequin.utp differ diff --git a/nwnds_module/crft_paper01.uti b/nwnds_module/crft_paper01.uti new file mode 100644 index 000000000..e4e898e11 Binary files /dev/null and b/nwnds_module/crft_paper01.uti differ diff --git a/nwnds_module/crft_projectrune.uti b/nwnds_module/crft_projectrune.uti new file mode 100644 index 000000000..4bab1b0e3 Binary files /dev/null and b/nwnds_module/crft_projectrune.uti differ diff --git a/nwnds_module/crft_rain_dr_hd.uti b/nwnds_module/crft_rain_dr_hd.uti new file mode 100644 index 000000000..b4c7f7a4e Binary files /dev/null and b/nwnds_module/crft_rain_dr_hd.uti differ diff --git a/nwnds_module/crft_rampagereye.uti b/nwnds_module/crft_rampagereye.uti new file mode 100644 index 000000000..8f09f7dba Binary files /dev/null and b/nwnds_module/crft_rampagereye.uti differ diff --git a/nwnds_module/crft_reapergland.uti b/nwnds_module/crft_reapergland.uti new file mode 100644 index 000000000..347d11dfc Binary files /dev/null and b/nwnds_module/crft_reapergland.uti differ diff --git a/nwnds_module/crft_sandhowler.uti b/nwnds_module/crft_sandhowler.uti new file mode 100644 index 000000000..bbc33d71d Binary files /dev/null and b/nwnds_module/crft_sandhowler.uti differ diff --git a/nwnds_module/crft_selfrune.uti b/nwnds_module/crft_selfrune.uti new file mode 100644 index 000000000..396f8dcb5 Binary files /dev/null and b/nwnds_module/crft_selfrune.uti differ diff --git a/nwnds_module/crft_shdwsphere.uti b/nwnds_module/crft_shdwsphere.uti new file mode 100644 index 000000000..72e593589 Binary files /dev/null and b/nwnds_module/crft_shdwsphere.uti differ diff --git a/nwnds_module/crft_shokcrystal.uti b/nwnds_module/crft_shokcrystal.uti new file mode 100644 index 000000000..7c779cc91 Binary files /dev/null and b/nwnds_module/crft_shokcrystal.uti differ diff --git a/nwnds_module/crft_silt_dr_hd.uti b/nwnds_module/crft_silt_dr_hd.uti new file mode 100644 index 000000000..63808f991 Binary files /dev/null and b/nwnds_module/crft_silt_dr_hd.uti differ diff --git a/nwnds_module/crft_sligtongue.uti b/nwnds_module/crft_sligtongue.uti new file mode 100644 index 000000000..fcaefa628 Binary files /dev/null and b/nwnds_module/crft_sligtongue.uti differ diff --git a/nwnds_module/crft_spidersac.uti b/nwnds_module/crft_spidersac.uti new file mode 100644 index 000000000..c9f719175 Binary files /dev/null and b/nwnds_module/crft_spidersac.uti differ diff --git a/nwnds_module/crft_spinach.uti b/nwnds_module/crft_spinach.uti new file mode 100644 index 000000000..a90e45530 Binary files /dev/null and b/nwnds_module/crft_spinach.uti differ diff --git a/nwnds_module/crft_sun_dr_hd.uti b/nwnds_module/crft_sun_dr_hd.uti new file mode 100644 index 000000000..0e8e444e1 Binary files /dev/null and b/nwnds_module/crft_sun_dr_hd.uti differ diff --git a/nwnds_module/crft_taripelt.uti b/nwnds_module/crft_taripelt.uti new file mode 100644 index 000000000..1f1bf8ca1 Binary files /dev/null and b/nwnds_module/crft_taripelt.uti differ diff --git a/nwnds_module/crft_touchrune.uti b/nwnds_module/crft_touchrune.uti new file mode 100644 index 000000000..e14246d45 Binary files /dev/null and b/nwnds_module/crft_touchrune.uti differ diff --git a/nwnds_module/crft_trin_glnd.uti b/nwnds_module/crft_trin_glnd.uti new file mode 100644 index 000000000..31bcceb25 Binary files /dev/null and b/nwnds_module/crft_trin_glnd.uti differ diff --git a/nwnds_module/crft_voidrune.uti b/nwnds_module/crft_voidrune.uti new file mode 100644 index 000000000..1dc43c121 Binary files /dev/null and b/nwnds_module/crft_voidrune.uti differ diff --git a/nwnds_module/crft_water_dr_hd.uti b/nwnds_module/crft_water_dr_hd.uti new file mode 100644 index 000000000..3028f7565 Binary files /dev/null and b/nwnds_module/crft_water_dr_hd.uti differ diff --git a/nwnds_module/crimsavanna_e.are b/nwnds_module/crimsavanna_e.are new file mode 100644 index 000000000..51b0d9c8d Binary files /dev/null and b/nwnds_module/crimsavanna_e.are differ diff --git a/nwnds_module/crimsavanna_e.gic b/nwnds_module/crimsavanna_e.gic new file mode 100644 index 000000000..6702a9af5 Binary files /dev/null and b/nwnds_module/crimsavanna_e.gic differ diff --git a/nwnds_module/crimsavanna_e.git b/nwnds_module/crimsavanna_e.git new file mode 100644 index 000000000..a1fc14de9 Binary files /dev/null and b/nwnds_module/crimsavanna_e.git differ diff --git a/nwnds_module/crimsavanna_n.are b/nwnds_module/crimsavanna_n.are new file mode 100644 index 000000000..ef956ccde Binary files /dev/null and b/nwnds_module/crimsavanna_n.are differ diff --git a/nwnds_module/crimsavanna_n.gic b/nwnds_module/crimsavanna_n.gic new file mode 100644 index 000000000..9d391f07d Binary files /dev/null and b/nwnds_module/crimsavanna_n.gic differ diff --git a/nwnds_module/crimsavanna_n.git b/nwnds_module/crimsavanna_n.git new file mode 100644 index 000000000..ec0d86498 Binary files /dev/null and b/nwnds_module/crimsavanna_n.git differ diff --git a/nwnds_module/crimsavanna_s.are b/nwnds_module/crimsavanna_s.are new file mode 100644 index 000000000..f5f5268ba Binary files /dev/null and b/nwnds_module/crimsavanna_s.are differ diff --git a/nwnds_module/crimsavanna_s.gic b/nwnds_module/crimsavanna_s.gic new file mode 100644 index 000000000..17e6966bd Binary files /dev/null and b/nwnds_module/crimsavanna_s.gic differ diff --git a/nwnds_module/crimsavanna_s.git b/nwnds_module/crimsavanna_s.git new file mode 100644 index 000000000..149cb2004 Binary files /dev/null and b/nwnds_module/crimsavanna_s.git differ diff --git a/nwnds_module/crimsavanna_w.are b/nwnds_module/crimsavanna_w.are new file mode 100644 index 000000000..ec2943f68 Binary files /dev/null and b/nwnds_module/crimsavanna_w.are differ diff --git a/nwnds_module/crimsavanna_w.gic b/nwnds_module/crimsavanna_w.gic new file mode 100644 index 000000000..a343d3dd4 Binary files /dev/null and b/nwnds_module/crimsavanna_w.gic differ diff --git a/nwnds_module/crimsavanna_w.git b/nwnds_module/crimsavanna_w.git new file mode 100644 index 000000000..5ba9345a6 Binary files /dev/null and b/nwnds_module/crimsavanna_w.git differ diff --git a/nwnds_module/crimscorpclaw001.uti b/nwnds_module/crimscorpclaw001.uti new file mode 100644 index 000000000..1383abe08 Binary files /dev/null and b/nwnds_module/crimscorpclaw001.uti differ diff --git a/nwnds_module/crimscorpclaw002.uti b/nwnds_module/crimscorpclaw002.uti new file mode 100644 index 000000000..32478abb5 Binary files /dev/null and b/nwnds_module/crimscorpclaw002.uti differ diff --git a/nwnds_module/crimscorpion_001.utc b/nwnds_module/crimscorpion_001.utc new file mode 100644 index 000000000..fc42e66e2 Binary files /dev/null and b/nwnds_module/crimscorpion_001.utc differ diff --git a/nwnds_module/crimscorpion_002.utc b/nwnds_module/crimscorpion_002.utc new file mode 100644 index 000000000..109fb1256 Binary files /dev/null and b/nwnds_module/crimscorpion_002.utc differ diff --git a/nwnds_module/crimscorpstin001.uti b/nwnds_module/crimscorpstin001.uti new file mode 100644 index 000000000..ab434cb76 Binary files /dev/null and b/nwnds_module/crimscorpstin001.uti differ diff --git a/nwnds_module/crimscorpstinger.uti b/nwnds_module/crimscorpstinger.uti new file mode 100644 index 000000000..d0072c3f0 Binary files /dev/null and b/nwnds_module/crimscorpstinger.uti differ diff --git a/nwnds_module/crimsondepths001.are b/nwnds_module/crimsondepths001.are new file mode 100644 index 000000000..8b960b144 Binary files /dev/null and b/nwnds_module/crimsondepths001.are differ diff --git a/nwnds_module/crimsondepths001.gic b/nwnds_module/crimsondepths001.gic new file mode 100644 index 000000000..1bb9c0aaf Binary files /dev/null and b/nwnds_module/crimsondepths001.gic differ diff --git a/nwnds_module/crimsondepths001.git b/nwnds_module/crimsondepths001.git new file mode 100644 index 000000000..741152cfc Binary files /dev/null and b/nwnds_module/crimsondepths001.git differ diff --git a/nwnds_module/crimsonoasis.are b/nwnds_module/crimsonoasis.are new file mode 100644 index 000000000..ee83d9f74 Binary files /dev/null and b/nwnds_module/crimsonoasis.are differ diff --git a/nwnds_module/crimsonoasis.gic b/nwnds_module/crimsonoasis.gic new file mode 100644 index 000000000..3557ddfd4 Binary files /dev/null and b/nwnds_module/crimsonoasis.gic differ diff --git a/nwnds_module/crimsonoasis.git b/nwnds_module/crimsonoasis.git new file mode 100644 index 000000000..9c0cf6119 Binary files /dev/null and b/nwnds_module/crimsonoasis.git differ diff --git a/nwnds_module/crimsonruins001.are b/nwnds_module/crimsonruins001.are new file mode 100644 index 000000000..93db85893 Binary files /dev/null and b/nwnds_module/crimsonruins001.are differ diff --git a/nwnds_module/crimsonruins001.gic b/nwnds_module/crimsonruins001.gic new file mode 100644 index 000000000..ef801329a Binary files /dev/null and b/nwnds_module/crimsonruins001.gic differ diff --git a/nwnds_module/crimsonruins001.git b/nwnds_module/crimsonruins001.git new file mode 100644 index 000000000..b7287cb05 Binary files /dev/null and b/nwnds_module/crimsonruins001.git differ diff --git a/nwnds_module/crimsonruins002.are b/nwnds_module/crimsonruins002.are new file mode 100644 index 000000000..9fdaccf89 Binary files /dev/null and b/nwnds_module/crimsonruins002.are differ diff --git a/nwnds_module/crimsonruins002.gic b/nwnds_module/crimsonruins002.gic new file mode 100644 index 000000000..55ff04fbf Binary files /dev/null and b/nwnds_module/crimsonruins002.gic differ diff --git a/nwnds_module/crimsonruins002.git b/nwnds_module/crimsonruins002.git new file mode 100644 index 000000000..6dadae397 Binary files /dev/null and b/nwnds_module/crimsonruins002.git differ diff --git a/nwnds_module/cromlinislandtic.uti b/nwnds_module/cromlinislandtic.uti new file mode 100644 index 000000000..fbd17df55 Binary files /dev/null and b/nwnds_module/cromlinislandtic.uti differ diff --git a/nwnds_module/crowbar001.uti b/nwnds_module/crowbar001.uti new file mode 100644 index 000000000..bae05789c Binary files /dev/null and b/nwnds_module/crowbar001.uti differ diff --git a/nwnds_module/crp_twigblight.utc b/nwnds_module/crp_twigblight.utc new file mode 100644 index 000000000..7222f56b1 Binary files /dev/null and b/nwnds_module/crp_twigblight.utc differ diff --git a/nwnds_module/crpp_chest_me001.utp b/nwnds_module/crpp_chest_me001.utp new file mode 100644 index 000000000..4082d6a53 Binary files /dev/null and b/nwnds_module/crpp_chest_me001.utp differ diff --git a/nwnds_module/crpp_strpdr_wood.utp b/nwnds_module/crpp_strpdr_wood.utp new file mode 100644 index 000000000..553861836 Binary files /dev/null and b/nwnds_module/crpp_strpdr_wood.utp differ diff --git a/nwnds_module/cryptchanter001.utc b/nwnds_module/cryptchanter001.utc new file mode 100644 index 000000000..5e3c7b720 Binary files /dev/null and b/nwnds_module/cryptchanter001.utc differ diff --git a/nwnds_module/cryptchanthide01.uti b/nwnds_module/cryptchanthide01.uti new file mode 100644 index 000000000..ea794fb56 Binary files /dev/null and b/nwnds_module/cryptchanthide01.uti differ diff --git a/nwnds_module/cryptchessboard.are b/nwnds_module/cryptchessboard.are new file mode 100644 index 000000000..bc933cde9 Binary files /dev/null and b/nwnds_module/cryptchessboard.are differ diff --git a/nwnds_module/cryptchessboard.gic b/nwnds_module/cryptchessboard.gic new file mode 100644 index 000000000..b773b87dc Binary files /dev/null and b/nwnds_module/cryptchessboard.gic differ diff --git a/nwnds_module/cryptchessboard.git b/nwnds_module/cryptchessboard.git new file mode 100644 index 000000000..48a07253f Binary files /dev/null and b/nwnds_module/cryptchessboard.git differ diff --git a/nwnds_module/crystaloozehide.uti b/nwnds_module/crystaloozehide.uti new file mode 100644 index 000000000..bbc40b91a Binary files /dev/null and b/nwnds_module/crystaloozehide.uti differ diff --git a/nwnds_module/crystaloozeslam.uti b/nwnds_module/crystaloozeslam.uti new file mode 100644 index 000000000..743f064a0 Binary files /dev/null and b/nwnds_module/crystaloozeslam.uti differ diff --git a/nwnds_module/crystalspider001.utc b/nwnds_module/crystalspider001.utc new file mode 100644 index 000000000..65b60235a Binary files /dev/null and b/nwnds_module/crystalspider001.utc differ diff --git a/nwnds_module/crystalspider002.utc b/nwnds_module/crystalspider002.utc new file mode 100644 index 000000000..b2da5f62c Binary files /dev/null and b/nwnds_module/crystalspider002.utc differ diff --git a/nwnds_module/crystalspiderbit.uti b/nwnds_module/crystalspiderbit.uti new file mode 100644 index 000000000..7d7b92d93 Binary files /dev/null and b/nwnds_module/crystalspiderbit.uti differ diff --git a/nwnds_module/crystalspiderh.uti b/nwnds_module/crystalspiderh.uti new file mode 100644 index 000000000..23e44183d Binary files /dev/null and b/nwnds_module/crystalspiderh.uti differ diff --git a/nwnds_module/cursed_dwarf001.utc b/nwnds_module/cursed_dwarf001.utc new file mode 100644 index 000000000..68ce3cc1f Binary files /dev/null and b/nwnds_module/cursed_dwarf001.utc differ diff --git a/nwnds_module/curseddwarfpro.uti b/nwnds_module/curseddwarfpro.uti new file mode 100644 index 000000000..b0ee215ce Binary files /dev/null and b/nwnds_module/curseddwarfpro.uti differ diff --git a/nwnds_module/cursedwarfhide.uti b/nwnds_module/cursedwarfhide.uti new file mode 100644 index 000000000..6ae37872e Binary files /dev/null and b/nwnds_module/cursedwarfhide.uti differ diff --git a/nwnds_module/cursedwarfslam.uti b/nwnds_module/cursedwarfslam.uti new file mode 100644 index 000000000..21b70c27a Binary files /dev/null and b/nwnds_module/cursedwarfslam.uti differ diff --git a/nwnds_module/curseofimpending.uti b/nwnds_module/curseofimpending.uti new file mode 100644 index 000000000..eb36dd763 Binary files /dev/null and b/nwnds_module/curseofimpending.uti differ diff --git a/nwnds_module/cv_altmushrooms.dlg b/nwnds_module/cv_altmushrooms.dlg new file mode 100644 index 000000000..727ca78e9 Binary files /dev/null and b/nwnds_module/cv_altmushrooms.dlg differ diff --git a/nwnds_module/cv_arenaguard.dlg b/nwnds_module/cv_arenaguard.dlg new file mode 100644 index 000000000..f2ce71760 Binary files /dev/null and b/nwnds_module/cv_arenaguard.dlg differ diff --git a/nwnds_module/cv_arenamerch2.dlg b/nwnds_module/cv_arenamerch2.dlg new file mode 100644 index 000000000..40b4dc4f5 Binary files /dev/null and b/nwnds_module/cv_arenamerch2.dlg differ diff --git a/nwnds_module/cv_arenamerchant.dlg b/nwnds_module/cv_arenamerchant.dlg new file mode 100644 index 000000000..135152537 Binary files /dev/null and b/nwnds_module/cv_arenamerchant.dlg differ diff --git a/nwnds_module/cv_aristiphanale.dlg b/nwnds_module/cv_aristiphanale.dlg new file mode 100644 index 000000000..d633cc3a4 Binary files /dev/null and b/nwnds_module/cv_aristiphanale.dlg differ diff --git a/nwnds_module/cv_banker.dlg b/nwnds_module/cv_banker.dlg new file mode 100644 index 000000000..46581ffb2 Binary files /dev/null and b/nwnds_module/cv_banker.dlg differ diff --git a/nwnds_module/cv_barley.dlg b/nwnds_module/cv_barley.dlg new file mode 100644 index 000000000..87395b63c Binary files /dev/null and b/nwnds_module/cv_barley.dlg differ diff --git a/nwnds_module/cv_barth.dlg b/nwnds_module/cv_barth.dlg new file mode 100644 index 000000000..64d27b844 Binary files /dev/null and b/nwnds_module/cv_barth.dlg differ diff --git a/nwnds_module/cv_basettu.dlg b/nwnds_module/cv_basettu.dlg new file mode 100644 index 000000000..b0792b1b5 Binary files /dev/null and b/nwnds_module/cv_basettu.dlg differ diff --git a/nwnds_module/cv_bedroll.dlg b/nwnds_module/cv_bedroll.dlg new file mode 100644 index 000000000..ff5d8ccde Binary files /dev/null and b/nwnds_module/cv_bedroll.dlg differ diff --git a/nwnds_module/cv_belet.dlg b/nwnds_module/cv_belet.dlg new file mode 100644 index 000000000..72f1e8ade Binary files /dev/null and b/nwnds_module/cv_belet.dlg differ diff --git a/nwnds_module/cv_bengali.dlg b/nwnds_module/cv_bengali.dlg new file mode 100644 index 000000000..6c6e872ae Binary files /dev/null and b/nwnds_module/cv_bengali.dlg differ diff --git a/nwnds_module/cv_berren_guard.dlg b/nwnds_module/cv_berren_guard.dlg new file mode 100644 index 000000000..e1e8d17fa Binary files /dev/null and b/nwnds_module/cv_berren_guard.dlg differ diff --git a/nwnds_module/cv_berren_sgt.dlg b/nwnds_module/cv_berren_sgt.dlg new file mode 100644 index 000000000..b9f45e3eb Binary files /dev/null and b/nwnds_module/cv_berren_sgt.dlg differ diff --git a/nwnds_module/cv_berren_sntry.dlg b/nwnds_module/cv_berren_sntry.dlg new file mode 100644 index 000000000..eeeb102cd Binary files /dev/null and b/nwnds_module/cv_berren_sntry.dlg differ diff --git a/nwnds_module/cv_bluelotus.dlg b/nwnds_module/cv_bluelotus.dlg new file mode 100644 index 000000000..84d9e3477 Binary files /dev/null and b/nwnds_module/cv_bluelotus.dlg differ diff --git a/nwnds_module/cv_bran.dlg b/nwnds_module/cv_bran.dlg new file mode 100644 index 000000000..2668433a1 Binary files /dev/null and b/nwnds_module/cv_bran.dlg differ diff --git a/nwnds_module/cv_brimly.dlg b/nwnds_module/cv_brimly.dlg new file mode 100644 index 000000000..aad1c19cc Binary files /dev/null and b/nwnds_module/cv_brimly.dlg differ diff --git a/nwnds_module/cv_chancrystal.dlg b/nwnds_module/cv_chancrystal.dlg new file mode 100644 index 000000000..c42ba41e9 Binary files /dev/null and b/nwnds_module/cv_chancrystal.dlg differ diff --git a/nwnds_module/cv_cobalte.dlg b/nwnds_module/cv_cobalte.dlg new file mode 100644 index 000000000..c87c565f1 Binary files /dev/null and b/nwnds_module/cv_cobalte.dlg differ diff --git a/nwnds_module/cv_coldyintakatt.dlg b/nwnds_module/cv_coldyintakatt.dlg new file mode 100644 index 000000000..125e85c48 Binary files /dev/null and b/nwnds_module/cv_coldyintakatt.dlg differ diff --git a/nwnds_module/cv_cromfirepit.dlg b/nwnds_module/cv_cromfirepit.dlg new file mode 100644 index 000000000..4cbabfdc4 Binary files /dev/null and b/nwnds_module/cv_cromfirepit.dlg differ diff --git a/nwnds_module/cv_cromudgrubble.dlg b/nwnds_module/cv_cromudgrubble.dlg new file mode 100644 index 000000000..a1c51265e Binary files /dev/null and b/nwnds_module/cv_cromudgrubble.dlg differ diff --git a/nwnds_module/cv_cromudgskel.dlg b/nwnds_module/cv_cromudgskel.dlg new file mode 100644 index 000000000..2041d8e16 Binary files /dev/null and b/nwnds_module/cv_cromudgskel.dlg differ diff --git a/nwnds_module/cv_cyclopsudath.dlg b/nwnds_module/cv_cyclopsudath.dlg new file mode 100644 index 000000000..27f3b278b Binary files /dev/null and b/nwnds_module/cv_cyclopsudath.dlg differ diff --git a/nwnds_module/cv_dimitri.dlg b/nwnds_module/cv_dimitri.dlg new file mode 100644 index 000000000..b97984e77 Binary files /dev/null and b/nwnds_module/cv_dimitri.dlg differ diff --git a/nwnds_module/cv_dond.dlg b/nwnds_module/cv_dond.dlg new file mode 100644 index 000000000..00b0f0731 Binary files /dev/null and b/nwnds_module/cv_dond.dlg differ diff --git a/nwnds_module/cv_drunkgiantinn.dlg b/nwnds_module/cv_drunkgiantinn.dlg new file mode 100644 index 000000000..4a0c2693d Binary files /dev/null and b/nwnds_module/cv_drunkgiantinn.dlg differ diff --git a/nwnds_module/cv_duneroadsign.dlg b/nwnds_module/cv_duneroadsign.dlg new file mode 100644 index 000000000..b370a8581 Binary files /dev/null and b/nwnds_module/cv_duneroadsign.dlg differ diff --git a/nwnds_module/cv_elinik.dlg b/nwnds_module/cv_elinik.dlg new file mode 100644 index 000000000..dc2d39a07 Binary files /dev/null and b/nwnds_module/cv_elinik.dlg differ diff --git a/nwnds_module/cv_esuta.dlg b/nwnds_module/cv_esuta.dlg new file mode 100644 index 000000000..80423cc5b Binary files /dev/null and b/nwnds_module/cv_esuta.dlg differ diff --git a/nwnds_module/cv_exmcromsmisl.dlg b/nwnds_module/cv_exmcromsmisl.dlg new file mode 100644 index 000000000..0f95511ee Binary files /dev/null and b/nwnds_module/cv_exmcromsmisl.dlg differ diff --git a/nwnds_module/cv_fireyintakatt.dlg b/nwnds_module/cv_fireyintakatt.dlg new file mode 100644 index 000000000..a9b907e5b Binary files /dev/null and b/nwnds_module/cv_fireyintakatt.dlg differ diff --git a/nwnds_module/cv_geary.dlg b/nwnds_module/cv_geary.dlg new file mode 100644 index 000000000..ff1a3d02a Binary files /dev/null and b/nwnds_module/cv_geary.dlg differ diff --git a/nwnds_module/cv_gerrof.dlg b/nwnds_module/cv_gerrof.dlg new file mode 100644 index 000000000..24a245961 Binary files /dev/null and b/nwnds_module/cv_gerrof.dlg differ diff --git a/nwnds_module/cv_grimsmislchst.dlg b/nwnds_module/cv_grimsmislchst.dlg new file mode 100644 index 000000000..6a9be524a Binary files /dev/null and b/nwnds_module/cv_grimsmislchst.dlg differ diff --git a/nwnds_module/cv_hamir.dlg b/nwnds_module/cv_hamir.dlg new file mode 100644 index 000000000..a30a23ebf Binary files /dev/null and b/nwnds_module/cv_hamir.dlg differ diff --git a/nwnds_module/cv_healerbody.dlg b/nwnds_module/cv_healerbody.dlg new file mode 100644 index 000000000..91f5c4c46 Binary files /dev/null and b/nwnds_module/cv_healerbody.dlg differ diff --git a/nwnds_module/cv_hs_dancer.dlg b/nwnds_module/cv_hs_dancer.dlg new file mode 100644 index 000000000..35c29cb6d Binary files /dev/null and b/nwnds_module/cv_hs_dancer.dlg differ diff --git a/nwnds_module/cv_hunar.dlg b/nwnds_module/cv_hunar.dlg new file mode 100644 index 000000000..11aa10246 Binary files /dev/null and b/nwnds_module/cv_hunar.dlg differ diff --git a/nwnds_module/cv_ignusspyre.dlg b/nwnds_module/cv_ignusspyre.dlg new file mode 100644 index 000000000..1be551276 Binary files /dev/null and b/nwnds_module/cv_ignusspyre.dlg differ diff --git a/nwnds_module/cv_jacob.dlg b/nwnds_module/cv_jacob.dlg new file mode 100644 index 000000000..cb80d86c5 Binary files /dev/null and b/nwnds_module/cv_jacob.dlg differ diff --git a/nwnds_module/cv_jagra.dlg b/nwnds_module/cv_jagra.dlg new file mode 100644 index 000000000..99683dba0 Binary files /dev/null and b/nwnds_module/cv_jagra.dlg differ diff --git a/nwnds_module/cv_jariel.dlg b/nwnds_module/cv_jariel.dlg new file mode 100644 index 000000000..82c41bb4f Binary files /dev/null and b/nwnds_module/cv_jariel.dlg differ diff --git a/nwnds_module/cv_jeeva.dlg b/nwnds_module/cv_jeeva.dlg new file mode 100644 index 000000000..7bfdc0295 Binary files /dev/null and b/nwnds_module/cv_jeeva.dlg differ diff --git a/nwnds_module/cv_justl.dlg b/nwnds_module/cv_justl.dlg new file mode 100644 index 000000000..cd5c49c9c Binary files /dev/null and b/nwnds_module/cv_justl.dlg differ diff --git a/nwnds_module/cv_justlexploit.dlg b/nwnds_module/cv_justlexploit.dlg new file mode 100644 index 000000000..a2311f274 Binary files /dev/null and b/nwnds_module/cv_justlexploit.dlg differ diff --git a/nwnds_module/cv_kaia.dlg b/nwnds_module/cv_kaia.dlg new file mode 100644 index 000000000..ecc326f1c Binary files /dev/null and b/nwnds_module/cv_kaia.dlg differ diff --git a/nwnds_module/cv_karlen.dlg b/nwnds_module/cv_karlen.dlg new file mode 100644 index 000000000..8ed27c698 Binary files /dev/null and b/nwnds_module/cv_karlen.dlg differ diff --git a/nwnds_module/cv_kell.dlg b/nwnds_module/cv_kell.dlg new file mode 100644 index 000000000..e1e8d17fa Binary files /dev/null and b/nwnds_module/cv_kell.dlg differ diff --git a/nwnds_module/cv_lemli.dlg b/nwnds_module/cv_lemli.dlg new file mode 100644 index 000000000..342e6623a Binary files /dev/null and b/nwnds_module/cv_lemli.dlg differ diff --git a/nwnds_module/cv_leston.dlg b/nwnds_module/cv_leston.dlg new file mode 100644 index 000000000..76c44ba53 Binary files /dev/null and b/nwnds_module/cv_leston.dlg differ diff --git a/nwnds_module/cv_lilara.dlg b/nwnds_module/cv_lilara.dlg new file mode 100644 index 000000000..4508cadd5 Binary files /dev/null and b/nwnds_module/cv_lilara.dlg differ diff --git a/nwnds_module/cv_marris.dlg b/nwnds_module/cv_marris.dlg new file mode 100644 index 000000000..0c9347df3 Binary files /dev/null and b/nwnds_module/cv_marris.dlg differ diff --git a/nwnds_module/cv_meatbarrel.dlg b/nwnds_module/cv_meatbarrel.dlg new file mode 100644 index 000000000..9ab339c57 Binary files /dev/null and b/nwnds_module/cv_meatbarrel.dlg differ diff --git a/nwnds_module/cv_metallicob.dlg b/nwnds_module/cv_metallicob.dlg new file mode 100644 index 000000000..256779493 Binary files /dev/null and b/nwnds_module/cv_metallicob.dlg differ diff --git a/nwnds_module/cv_minna.dlg b/nwnds_module/cv_minna.dlg new file mode 100644 index 000000000..c097bbfbe Binary files /dev/null and b/nwnds_module/cv_minna.dlg differ diff --git a/nwnds_module/cv_morian.dlg b/nwnds_module/cv_morian.dlg new file mode 100644 index 000000000..0416fd3c1 Binary files /dev/null and b/nwnds_module/cv_morian.dlg differ diff --git a/nwnds_module/cv_moric.dlg b/nwnds_module/cv_moric.dlg new file mode 100644 index 000000000..b87cdfa86 Binary files /dev/null and b/nwnds_module/cv_moric.dlg differ diff --git a/nwnds_module/cv_nadie.dlg b/nwnds_module/cv_nadie.dlg new file mode 100644 index 000000000..2c8db52dc Binary files /dev/null and b/nwnds_module/cv_nadie.dlg differ diff --git a/nwnds_module/cv_nual.dlg b/nwnds_module/cv_nual.dlg new file mode 100644 index 000000000..d0b7da171 Binary files /dev/null and b/nwnds_module/cv_nual.dlg differ diff --git a/nwnds_module/cv_oldwell.dlg b/nwnds_module/cv_oldwell.dlg new file mode 100644 index 000000000..96e7dcff5 Binary files /dev/null and b/nwnds_module/cv_oldwell.dlg differ diff --git a/nwnds_module/cv_oldwellrope.dlg b/nwnds_module/cv_oldwellrope.dlg new file mode 100644 index 000000000..2252ef16f Binary files /dev/null and b/nwnds_module/cv_oldwellrope.dlg differ diff --git a/nwnds_module/cv_pa.dlg b/nwnds_module/cv_pa.dlg new file mode 100644 index 000000000..48caca388 Binary files /dev/null and b/nwnds_module/cv_pa.dlg differ diff --git a/nwnds_module/cv_parik.dlg b/nwnds_module/cv_parik.dlg new file mode 100644 index 000000000..13b06e296 Binary files /dev/null and b/nwnds_module/cv_parik.dlg differ diff --git a/nwnds_module/cv_poriuspack.dlg b/nwnds_module/cv_poriuspack.dlg new file mode 100644 index 000000000..cbf3c6fbc Binary files /dev/null and b/nwnds_module/cv_poriuspack.dlg differ diff --git a/nwnds_module/cv_pwstore_01.ncs b/nwnds_module/cv_pwstore_01.ncs new file mode 100644 index 000000000..bea0ebcf5 Binary files /dev/null and b/nwnds_module/cv_pwstore_01.ncs differ diff --git a/nwnds_module/cv_pwstore_01.nss b/nwnds_module/cv_pwstore_01.nss new file mode 100644 index 000000000..e9af4624e --- /dev/null +++ b/nwnds_module/cv_pwstore_01.nss @@ -0,0 +1,86 @@ +//:://///////////////////////////////////////////// +//:: PW Merchant Spawn System +//:: CV_PWStore_01.nss +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Grabs a storename rezref from the calling NPC + (STORE_NAME string "STORE_NPCNAME"), checks + area INT VAR to see if store has been spawned. + + Yes: Opens existing store with rezref of + "STORE_NAME". + + No: Spawns store with rezref of "STORE_NAME" + & sets an area INT VAR so we aren't + constantly overwriting the existing store. + +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 23 2012 +//::////////////////////////////////////////////// + +#include "x0_i0_position" + +void main() +{ + object oMerchant = OBJECT_SELF; + object oBuyer = GetPCSpeaker(); + object oModule = GetModule(); + object oArea = GetArea(oMerchant); + + location lMerchant = GetLocation(oMerchant); + location lBuyer = GetLocation(oBuyer); + location lStore = GetAheadLocation(oMerchant); + + string sModule = GetModuleName(); + string sAreaName = GetName(oArea, FALSE); + string sAreaRezRef =GetStringLowerCase(GetResRef(oArea)); + string sBuyerName = GetName(oBuyer, FALSE); + string sMerchantName = GetName(oMerchant, FALSE); + string sMerchantRezRef = GetResRef(oMerchant); + string sStoreName = GetLocalString(oMerchant, "STORE_NAME"); + string sSpawn = "Spawned"; + string sAreaVar = InsertString(sSpawn, sStoreName, 0); + +//:: Debug Stuff +/* SpeakString("Script Fired"); + SpeakString("PC Name is: "+sBuyerName); + SpeakString("Module Name is: "+sModule); + SpeakString("Area Name is: "+sAreaName); + SpeakString("Area RezRef is: "+sAreaRezRef); + SpeakString("Area VAR name is: "+sAreaVar); + SpeakString("Merchant Name is: "+sMerchantName); + SpeakString("Merchant RezRef is: "+sMerchantRezRef); + SpeakString("Store RezRef is: "+sStoreName); +*/ + + if(!GetLocalInt(oArea, sAreaVar)) // See if the INT VAR is FALSE + { + //:: If not, create the store. + CreateObject(OBJECT_TYPE_STORE, sStoreName, lStore); + //:: Make INT VAR TRUE so we know the spawn has occured. + SetLocalInt(oArea, sAreaVar, TRUE); + //:: SpeakString("Shop has been spawned"); + } + + else + { + //:: SpeakString("Shop exists"); + } + + object oStore = GetNearestObjectByTag(sStoreName, OBJECT_SELF); + + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + //:: Open store for PC in conversation. + DelayCommand(1.0, OpenStore(oStore, oBuyer)); + } + + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } + +} diff --git a/nwnds_module/cv_pwstore_02.ncs b/nwnds_module/cv_pwstore_02.ncs new file mode 100644 index 000000000..3d8f8d20e Binary files /dev/null and b/nwnds_module/cv_pwstore_02.ncs differ diff --git a/nwnds_module/cv_pwstore_02.nss b/nwnds_module/cv_pwstore_02.nss new file mode 100644 index 000000000..ab9925f42 --- /dev/null +++ b/nwnds_module/cv_pwstore_02.nss @@ -0,0 +1,88 @@ +//:://///////////////////////////////////////////// +//:: PW Merchant Spawn System +//:: CV_PWStore_02.nss +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Grabs a storename rezref from the calling NPC + (STORE_NAME2 string "STORE_NPCNAME"), checks + area INT VAR to see if store has been spawned. + + Yes: Opens existing store with rezref of + "STORE_NAME2". + + No: Spawns store with rezref of "STORE_NAME2" + & sets an area INT VAR so we aren't + constantly overwriting the existing store. + + This script is used if a NPC has access to + more than one store + +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 23 2012 +//::////////////////////////////////////////////// + +#include "x0_i0_position" + +void main() +{ + object oMerchant = OBJECT_SELF; + object oBuyer = GetPCSpeaker(); + object oModule = GetModule(); + object oArea = GetArea(oMerchant); + + location lMerchant = GetLocation(oMerchant); + location lBuyer = GetLocation(oBuyer); + location lStore = GetAheadLocation(oMerchant); + + string sModule = GetModuleName(); + string sAreaName = GetName(oArea, FALSE); + string sAreaRezRef =GetStringLowerCase(GetResRef(oArea)); + string sBuyerName = GetName(oBuyer, FALSE); + string sMerchantName = GetName(oMerchant, FALSE); + string sMerchantRezRef = GetResRef(oMerchant); + string sStoreName = GetLocalString(oMerchant, "STORE_NAME2"); + string sSpawn = "Spawned"; + string sAreaVar = InsertString(sSpawn, sStoreName, 0); + +//:: Debug Stuff +/* SpeakString("Script Fired"); + SpeakString("PC Name is: "+sBuyerName); + SpeakString("Module Name is: "+sModule); + SpeakString("Area Name is: "+sAreaName); + SpeakString("Area RezRef is: "+sAreaRezRef); + SpeakString("Area VAR name is: "+sAreaVar); + SpeakString("Merchant Name is: "+sMerchantName); + SpeakString("Merchant RezRef is: "+sMerchantRezRef); + SpeakString("Store RezRef is: "+sStoreName); +*/ + if(!GetLocalInt(oArea, sAreaVar)) // See if the INT VAR is FALSE + { + //:: If not, create the store. + CreateObject(OBJECT_TYPE_STORE, sStoreName, lStore); + //:: Make INT VAR TRUE so we know the spawn has occured. + SetLocalInt(oArea, sAreaVar, TRUE); + //:: SpeakString("Shop has been spawned"); + } + + else + { + //:: SpeakString("Shop exists"); + } + + object oStore = GetNearestObjectByTag(sStoreName, OBJECT_SELF); + + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + //:: Open store for PC in conversation. + DelayCommand(1.0, OpenStore(oStore, oBuyer)); + } + + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } + +} diff --git a/nwnds_module/cv_rope2abanhome.dlg b/nwnds_module/cv_rope2abanhome.dlg new file mode 100644 index 000000000..44e7df5a8 Binary files /dev/null and b/nwnds_module/cv_rope2abanhome.dlg differ diff --git a/nwnds_module/cv_royalfountain.dlg b/nwnds_module/cv_royalfountain.dlg new file mode 100644 index 000000000..18d525019 Binary files /dev/null and b/nwnds_module/cv_royalfountain.dlg differ diff --git a/nwnds_module/cv_rumagon.dlg b/nwnds_module/cv_rumagon.dlg new file mode 100644 index 000000000..fbf62a3cd Binary files /dev/null and b/nwnds_module/cv_rumagon.dlg differ diff --git a/nwnds_module/cv_salikattack.dlg b/nwnds_module/cv_salikattack.dlg new file mode 100644 index 000000000..e2cb97c4b Binary files /dev/null and b/nwnds_module/cv_salikattack.dlg differ diff --git a/nwnds_module/cv_slave_hermit.dlg b/nwnds_module/cv_slave_hermit.dlg new file mode 100644 index 000000000..c5537dfc9 Binary files /dev/null and b/nwnds_module/cv_slave_hermit.dlg differ diff --git a/nwnds_module/cv_stagdrunk.dlg b/nwnds_module/cv_stagdrunk.dlg new file mode 100644 index 000000000..e6ffa7525 Binary files /dev/null and b/nwnds_module/cv_stagdrunk.dlg differ diff --git a/nwnds_module/cv_targ.dlg b/nwnds_module/cv_targ.dlg new file mode 100644 index 000000000..cbc93692d Binary files /dev/null and b/nwnds_module/cv_targ.dlg differ diff --git a/nwnds_module/cv_tigra.dlg b/nwnds_module/cv_tigra.dlg new file mode 100644 index 000000000..8b2929964 Binary files /dev/null and b/nwnds_module/cv_tigra.dlg differ diff --git a/nwnds_module/cv_traabi.dlg b/nwnds_module/cv_traabi.dlg new file mode 100644 index 000000000..0fca9b38c Binary files /dev/null and b/nwnds_module/cv_traabi.dlg differ diff --git a/nwnds_module/cv_trakkon.dlg b/nwnds_module/cv_trakkon.dlg new file mode 100644 index 000000000..3d34578c7 Binary files /dev/null and b/nwnds_module/cv_trakkon.dlg differ diff --git a/nwnds_module/cv_trigfireyintk.ncs b/nwnds_module/cv_trigfireyintk.ncs new file mode 100644 index 000000000..64cc8981d Binary files /dev/null and b/nwnds_module/cv_trigfireyintk.ncs differ diff --git a/nwnds_module/cv_trigfireyintk.nss b/nwnds_module/cv_trigfireyintk.nss new file mode 100644 index 000000000..a020d3375 --- /dev/null +++ b/nwnds_module/cv_trigfireyintk.nss @@ -0,0 +1,8 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_unearthed") == 1) + { + AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_fireyintakatt")); + } +} diff --git a/nwnds_module/cv_ula.dlg b/nwnds_module/cv_ula.dlg new file mode 100644 index 000000000..a445f0a77 Binary files /dev/null and b/nwnds_module/cv_ula.dlg differ diff --git a/nwnds_module/cv_unearthedport.dlg b/nwnds_module/cv_unearthedport.dlg new file mode 100644 index 000000000..eecd4223d Binary files /dev/null and b/nwnds_module/cv_unearthedport.dlg differ diff --git a/nwnds_module/cv_unearthropeup.dlg b/nwnds_module/cv_unearthropeup.dlg new file mode 100644 index 000000000..b1806d91b Binary files /dev/null and b/nwnds_module/cv_unearthropeup.dlg differ diff --git a/nwnds_module/cv_westmorre.dlg b/nwnds_module/cv_westmorre.dlg new file mode 100644 index 000000000..e3865dfac Binary files /dev/null and b/nwnds_module/cv_westmorre.dlg differ diff --git a/nwnds_module/cv_widhendel.dlg b/nwnds_module/cv_widhendel.dlg new file mode 100644 index 000000000..1a3a3c1a3 Binary files /dev/null and b/nwnds_module/cv_widhendel.dlg differ diff --git a/nwnds_module/cv_woodstew.dlg b/nwnds_module/cv_woodstew.dlg new file mode 100644 index 000000000..8cfd019e9 Binary files /dev/null and b/nwnds_module/cv_woodstew.dlg differ diff --git a/nwnds_module/cv_worshiprug.dlg b/nwnds_module/cv_worshiprug.dlg new file mode 100644 index 000000000..d10a4a846 Binary files /dev/null and b/nwnds_module/cv_worshiprug.dlg differ diff --git a/nwnds_module/cv_xia_hermit.dlg b/nwnds_module/cv_xia_hermit.dlg new file mode 100644 index 000000000..21b1f5a10 Binary files /dev/null and b/nwnds_module/cv_xia_hermit.dlg differ diff --git a/nwnds_module/cv_zul.dlg b/nwnds_module/cv_zul.dlg new file mode 100644 index 000000000..a8b27e99a Binary files /dev/null and b/nwnds_module/cv_zul.dlg differ diff --git a/nwnds_module/cvn_hs_ianto001.utc b/nwnds_module/cvn_hs_ianto001.utc new file mode 100644 index 000000000..3a1939e75 Binary files /dev/null and b/nwnds_module/cvn_hs_ianto001.utc differ diff --git a/nwnds_module/cvn_hs_inika001.utc b/nwnds_module/cvn_hs_inika001.utc new file mode 100644 index 000000000..02d5b32b8 Binary files /dev/null and b/nwnds_module/cvn_hs_inika001.utc differ diff --git a/nwnds_module/cw_shardspiderc.uti b/nwnds_module/cw_shardspiderc.uti new file mode 100644 index 000000000..3d1c465f0 Binary files /dev/null and b/nwnds_module/cw_shardspiderc.uti differ diff --git a/nwnds_module/cw_shdspiderbite.uti b/nwnds_module/cw_shdspiderbite.uti new file mode 100644 index 000000000..06bf1e40b Binary files /dev/null and b/nwnds_module/cw_shdspiderbite.uti differ diff --git a/nwnds_module/cyclops001.utc b/nwnds_module/cyclops001.utc new file mode 100644 index 000000000..4fd441e08 Binary files /dev/null and b/nwnds_module/cyclops001.utc differ diff --git a/nwnds_module/cyclops002.utc b/nwnds_module/cyclops002.utc new file mode 100644 index 000000000..4fd442530 Binary files /dev/null and b/nwnds_module/cyclops002.utc differ diff --git a/nwnds_module/dante_db.nss b/nwnds_module/dante_db.nss new file mode 100644 index 000000000..458d953b3 --- /dev/null +++ b/nwnds_module/dante_db.nss @@ -0,0 +1,15 @@ +string GetCampaignVariableName(object oPlayer) +{ + string sAccountName = GetPCPlayerName(oPlayer); + string sCDKey = GetPCPublicCDKey(oPlayer); + string sName = GetName(oPlayer); + string sVariable = sCDKey; + sVariable += IntToString(GetStringLength(sAccountName)); + sVariable += GetStringLeft(sAccountName, 6); + sVariable += IntToString(GetStringLength(sName)); + sVariable += GetStringLeft(sName, 6); + + return GetStringUpperCase(sVariable); +} + +//void main () {} diff --git a/nwnds_module/dante_letodel_at.ncs b/nwnds_module/dante_letodel_at.ncs new file mode 100644 index 000000000..e21c5a314 Binary files /dev/null and b/nwnds_module/dante_letodel_at.ncs differ diff --git a/nwnds_module/dante_letodel_at.nss b/nwnds_module/dante_letodel_at.nss new file mode 100644 index 000000000..bd1a313e6 --- /dev/null +++ b/nwnds_module/dante_letodel_at.nss @@ -0,0 +1,82 @@ +// This is the script dante_letodel_at +//#include "delchar_include" +//#include "aps_include" +//#include "sha_subr_consts" + +//void DeletePCSubRace(string sPlayer,string sCharName); + +/*void main() +{ + object oPlayer = GetPCSpeaker(); + string sName = GetName(oPlayer); + string sPlayer = GetPCPlayerName(oPlayer); + if(sName != "") + { + //DeletePCSubRace(sPlayer, sName); + BootPC(oPlayer); + DelayCommand(6.0f, deletechar(sPlayer, sName)); + } + else + { + SendMessageToPC(oPlayer, "You will need to see a DM about getting this character deleted."); + SendMessageToAllDMs("PC Player Name: "+sPlayer+" just tried to delete a character without a name."); + WriteTimestampedLogEntry("PC Player Name: "+sPlayer+" just tried to delete a character without a name."); + } +}*/ + + + +/* void DeletePCSubRace(string sPlayer,string sCharName) +{ + + sPlayer = SQLEncodeSpecialChars(sPlayer); + sCharName = SQLEncodeSpecialChars(sCharName); + + string sSelSQL = "SELECT val FROM "+ SUBRACE_DATABASE +" WHERE player='" + sPlayer + + "' AND tag='" + sCharName + "';"; + + SQLExecDirect(sSelSQL); + if (SQLFetch() == SQL_SUCCESS) // player/pc records found first try + { + string sDelSQL = "DELETE FROM " + SUBRACE_DATABASE + + " WHERE player='" + sPlayer + + "' AND tag='" + sCharName + "';"; + + // Delete stament + SQLExecDirect(sDelSQL); + // Reselect to see if we deleted the Records + SQLExecDirect(sSelSQL); + if (SQLFetch() == SQL_SUCCESS) // nothing deleted. try again + { + SendMessageToAllDMs("Player/PC: " + sPlayer + "/" + sCharName + + " has not been deleted from the subrace DB../n Sending second attempt.."); + // Delete stament + SQLExecDirect(sDelSQL); + // Reselect to see if we deleted the Records + SQLExecDirect(sSelSQL); + if (SQLFetch() == SQL_SUCCESS) + { + SendMessageToAllDMs("Error Deleting PC from Subrace DB: Second attempt failed: " + + sPlayer + "/" + sCharName); + return; + } + SendMessageToAllDMs("Player/PC: " + sPlayer + "/" + sCharName + + " has been deleted from the subrace DB: Second attempt worked.."); + } + else // PC was deleted.. + { + SendMessageToAllDMs("Player/PC: " + sPlayer + "/" + sCharName + + " has been deleted from the subrace DB.."); + + } + return; + } */ + /* // player not found in db.. may need manual delete + SendMessageToAllDMs("Error Deleting PC from Subrace DB: Player/PC not found: " + + sPlayer + "/" + sCharName + "May need manual delete "); +return;*/ + +//} + + + diff --git a/nwnds_module/darkspider001.utc b/nwnds_module/darkspider001.utc new file mode 100644 index 000000000..331bcb990 Binary files /dev/null and b/nwnds_module/darkspider001.utc differ diff --git a/nwnds_module/darkspider002.utc b/nwnds_module/darkspider002.utc new file mode 100644 index 000000000..21b1fd642 Binary files /dev/null and b/nwnds_module/darkspider002.utc differ diff --git a/nwnds_module/darkspider003.utc b/nwnds_module/darkspider003.utc new file mode 100644 index 000000000..7f41d1d2b Binary files /dev/null and b/nwnds_module/darkspider003.utc differ diff --git a/nwnds_module/darkspider004.utc b/nwnds_module/darkspider004.utc new file mode 100644 index 000000000..7a8f485ac Binary files /dev/null and b/nwnds_module/darkspider004.utc differ diff --git a/nwnds_module/darkspiderbite.uti b/nwnds_module/darkspiderbite.uti new file mode 100644 index 000000000..038ee1d56 Binary files /dev/null and b/nwnds_module/darkspiderbite.uti differ diff --git a/nwnds_module/darkspiderbiteb.uti b/nwnds_module/darkspiderbiteb.uti new file mode 100644 index 000000000..069d2c2f0 Binary files /dev/null and b/nwnds_module/darkspiderbiteb.uti differ diff --git a/nwnds_module/darkspiderbitec.uti b/nwnds_module/darkspiderbitec.uti new file mode 100644 index 000000000..a9c9b56f0 Binary files /dev/null and b/nwnds_module/darkspiderbitec.uti differ diff --git a/nwnds_module/darkspiderprop.uti b/nwnds_module/darkspiderprop.uti new file mode 100644 index 000000000..7aa8b96f7 Binary files /dev/null and b/nwnds_module/darkspiderprop.uti differ diff --git a/nwnds_module/darkspiderqbite.uti b/nwnds_module/darkspiderqbite.uti new file mode 100644 index 000000000..ca8649f14 Binary files /dev/null and b/nwnds_module/darkspiderqbite.uti differ diff --git a/nwnds_module/dbeetlebite.uti b/nwnds_module/dbeetlebite.uti new file mode 100644 index 000000000..279b3c8e3 Binary files /dev/null and b/nwnds_module/dbeetlebite.uti differ diff --git a/nwnds_module/dbeetlehide.uti b/nwnds_module/dbeetlehide.uti new file mode 100644 index 000000000..92f26e910 Binary files /dev/null and b/nwnds_module/dbeetlehide.uti differ diff --git a/nwnds_module/dc_alchemy.dlg b/nwnds_module/dc_alchemy.dlg new file mode 100644 index 000000000..f7608a4bd Binary files /dev/null and b/nwnds_module/dc_alchemy.dlg differ diff --git a/nwnds_module/dc_arenaposter.dlg b/nwnds_module/dc_arenaposter.dlg new file mode 100644 index 000000000..af4307542 Binary files /dev/null and b/nwnds_module/dc_arenaposter.dlg differ diff --git a/nwnds_module/dc_bags.dlg b/nwnds_module/dc_bags.dlg new file mode 100644 index 000000000..9f577f572 Binary files /dev/null and b/nwnds_module/dc_bags.dlg differ diff --git a/nwnds_module/dc_bartender.dlg b/nwnds_module/dc_bartender.dlg new file mode 100644 index 000000000..4720ddd73 Binary files /dev/null and b/nwnds_module/dc_bartender.dlg differ diff --git a/nwnds_module/dc_bartender2.dlg b/nwnds_module/dc_bartender2.dlg new file mode 100644 index 000000000..7cfd262b4 Binary files /dev/null and b/nwnds_module/dc_bartender2.dlg differ diff --git a/nwnds_module/dc_belgoitrader.dlg b/nwnds_module/dc_belgoitrader.dlg new file mode 100644 index 000000000..c1b5ce827 Binary files /dev/null and b/nwnds_module/dc_belgoitrader.dlg differ diff --git a/nwnds_module/dc_blackjack.dlg b/nwnds_module/dc_blackjack.dlg new file mode 100644 index 000000000..780020597 Binary files /dev/null and b/nwnds_module/dc_blackjack.dlg differ diff --git a/nwnds_module/dc_briela.dlg b/nwnds_module/dc_briela.dlg new file mode 100644 index 000000000..9752c77d9 Binary files /dev/null and b/nwnds_module/dc_briela.dlg differ diff --git a/nwnds_module/dc_brig.dlg b/nwnds_module/dc_brig.dlg new file mode 100644 index 000000000..d52dd057c Binary files /dev/null and b/nwnds_module/dc_brig.dlg differ diff --git a/nwnds_module/dc_brill.dlg b/nwnds_module/dc_brill.dlg new file mode 100644 index 000000000..08fcef199 Binary files /dev/null and b/nwnds_module/dc_brill.dlg differ diff --git a/nwnds_module/dc_brin.dlg b/nwnds_module/dc_brin.dlg new file mode 100644 index 000000000..2a20c982a Binary files /dev/null and b/nwnds_module/dc_brin.dlg differ diff --git a/nwnds_module/dc_brotherthief.dlg b/nwnds_module/dc_brotherthief.dlg new file mode 100644 index 000000000..99638a781 Binary files /dev/null and b/nwnds_module/dc_brotherthief.dlg differ diff --git a/nwnds_module/dc_carah.dlg b/nwnds_module/dc_carah.dlg new file mode 100644 index 000000000..e9fe19a38 Binary files /dev/null and b/nwnds_module/dc_carah.dlg differ diff --git a/nwnds_module/dc_caravaner.dlg b/nwnds_module/dc_caravaner.dlg new file mode 100644 index 000000000..b05d976be Binary files /dev/null and b/nwnds_module/dc_caravaner.dlg differ diff --git a/nwnds_module/dc_cloie.dlg b/nwnds_module/dc_cloie.dlg new file mode 100644 index 000000000..ee9bd6408 Binary files /dev/null and b/nwnds_module/dc_cloie.dlg differ diff --git a/nwnds_module/dc_daaku.dlg b/nwnds_module/dc_daaku.dlg new file mode 100644 index 000000000..1da7b973a Binary files /dev/null and b/nwnds_module/dc_daaku.dlg differ diff --git a/nwnds_module/dc_dariya.dlg b/nwnds_module/dc_dariya.dlg new file mode 100644 index 000000000..cc7e8a21e Binary files /dev/null and b/nwnds_module/dc_dariya.dlg differ diff --git a/nwnds_module/dc_djall.dlg b/nwnds_module/dc_djall.dlg new file mode 100644 index 000000000..b11eacc55 Binary files /dev/null and b/nwnds_module/dc_djall.dlg differ diff --git a/nwnds_module/dc_dukkaro.dlg b/nwnds_module/dc_dukkaro.dlg new file mode 100644 index 000000000..2911b6490 Binary files /dev/null and b/nwnds_module/dc_dukkaro.dlg differ diff --git a/nwnds_module/dc_dydrina.dlg b/nwnds_module/dc_dydrina.dlg new file mode 100644 index 000000000..e7612576f Binary files /dev/null and b/nwnds_module/dc_dydrina.dlg differ diff --git a/nwnds_module/dc_farreli.dlg b/nwnds_module/dc_farreli.dlg new file mode 100644 index 000000000..52fac9a16 Binary files /dev/null and b/nwnds_module/dc_farreli.dlg differ diff --git a/nwnds_module/dc_flayertrader.dlg b/nwnds_module/dc_flayertrader.dlg new file mode 100644 index 000000000..a3cc74671 Binary files /dev/null and b/nwnds_module/dc_flayertrader.dlg differ diff --git a/nwnds_module/dc_flin.dlg b/nwnds_module/dc_flin.dlg new file mode 100644 index 000000000..94fd97b96 Binary files /dev/null and b/nwnds_module/dc_flin.dlg differ diff --git a/nwnds_module/dc_friedla.dlg b/nwnds_module/dc_friedla.dlg new file mode 100644 index 000000000..f672ee20d Binary files /dev/null and b/nwnds_module/dc_friedla.dlg differ diff --git a/nwnds_module/dc_gaurd.dlg b/nwnds_module/dc_gaurd.dlg new file mode 100644 index 000000000..b3c4368f9 Binary files /dev/null and b/nwnds_module/dc_gaurd.dlg differ diff --git a/nwnds_module/dc_gelrade.dlg b/nwnds_module/dc_gelrade.dlg new file mode 100644 index 000000000..71f7e6c85 Binary files /dev/null and b/nwnds_module/dc_gelrade.dlg differ diff --git a/nwnds_module/dc_glikik.dlg b/nwnds_module/dc_glikik.dlg new file mode 100644 index 000000000..021e39215 Binary files /dev/null and b/nwnds_module/dc_glikik.dlg differ diff --git a/nwnds_module/dc_grik.dlg b/nwnds_module/dc_grik.dlg new file mode 100644 index 000000000..f66e6088b Binary files /dev/null and b/nwnds_module/dc_grik.dlg differ diff --git a/nwnds_module/dc_guard.dlg b/nwnds_module/dc_guard.dlg new file mode 100644 index 000000000..ff02c14a0 Binary files /dev/null and b/nwnds_module/dc_guard.dlg differ diff --git a/nwnds_module/dc_guildportal.dlg b/nwnds_module/dc_guildportal.dlg new file mode 100644 index 000000000..29d5481a1 Binary files /dev/null and b/nwnds_module/dc_guildportal.dlg differ diff --git a/nwnds_module/dc_guute.dlg b/nwnds_module/dc_guute.dlg new file mode 100644 index 000000000..cce3eba99 Binary files /dev/null and b/nwnds_module/dc_guute.dlg differ diff --git a/nwnds_module/dc_hakkimo.dlg b/nwnds_module/dc_hakkimo.dlg new file mode 100644 index 000000000..3d4cb780f Binary files /dev/null and b/nwnds_module/dc_hakkimo.dlg differ diff --git a/nwnds_module/dc_healer.dlg b/nwnds_module/dc_healer.dlg new file mode 100644 index 000000000..27ba19fc3 Binary files /dev/null and b/nwnds_module/dc_healer.dlg differ diff --git a/nwnds_module/dc_ibod.dlg b/nwnds_module/dc_ibod.dlg new file mode 100644 index 000000000..179257936 Binary files /dev/null and b/nwnds_module/dc_ibod.dlg differ diff --git a/nwnds_module/dc_ikka.dlg b/nwnds_module/dc_ikka.dlg new file mode 100644 index 000000000..be3d4a068 Binary files /dev/null and b/nwnds_module/dc_ikka.dlg differ diff --git a/nwnds_module/dc_jailer.dlg b/nwnds_module/dc_jailer.dlg new file mode 100644 index 000000000..26704af43 Binary files /dev/null and b/nwnds_module/dc_jailer.dlg differ diff --git a/nwnds_module/dc_jaryx.dlg b/nwnds_module/dc_jaryx.dlg new file mode 100644 index 000000000..c66bfe8b0 Binary files /dev/null and b/nwnds_module/dc_jaryx.dlg differ diff --git a/nwnds_module/dc_jogodin.dlg b/nwnds_module/dc_jogodin.dlg new file mode 100644 index 000000000..20c7e7d1f Binary files /dev/null and b/nwnds_module/dc_jogodin.dlg differ diff --git a/nwnds_module/dc_junli.dlg b/nwnds_module/dc_junli.dlg new file mode 100644 index 000000000..ae2c3db3d Binary files /dev/null and b/nwnds_module/dc_junli.dlg differ diff --git a/nwnds_module/dc_jurgan.dlg b/nwnds_module/dc_jurgan.dlg new file mode 100644 index 000000000..22a0ed2c2 Binary files /dev/null and b/nwnds_module/dc_jurgan.dlg differ diff --git a/nwnds_module/dc_kaima.dlg b/nwnds_module/dc_kaima.dlg new file mode 100644 index 000000000..0ce23fe25 Binary files /dev/null and b/nwnds_module/dc_kaima.dlg differ diff --git a/nwnds_module/dc_kalka.dlg b/nwnds_module/dc_kalka.dlg new file mode 100644 index 000000000..91a7b490d Binary files /dev/null and b/nwnds_module/dc_kalka.dlg differ diff --git a/nwnds_module/dc_kank.dlg b/nwnds_module/dc_kank.dlg new file mode 100644 index 000000000..e8d617ed4 Binary files /dev/null and b/nwnds_module/dc_kank.dlg differ diff --git a/nwnds_module/dc_kilgrasta.dlg b/nwnds_module/dc_kilgrasta.dlg new file mode 100644 index 000000000..b584b831f Binary files /dev/null and b/nwnds_module/dc_kilgrasta.dlg differ diff --git a/nwnds_module/dc_kjaghi.dlg b/nwnds_module/dc_kjaghi.dlg new file mode 100644 index 000000000..70c1de184 Binary files /dev/null and b/nwnds_module/dc_kjaghi.dlg differ diff --git a/nwnds_module/dc_klarg.dlg b/nwnds_module/dc_klarg.dlg new file mode 100644 index 000000000..9e5ba8a27 Binary files /dev/null and b/nwnds_module/dc_klarg.dlg differ diff --git a/nwnds_module/dc_larak.dlg b/nwnds_module/dc_larak.dlg new file mode 100644 index 000000000..66c49f4ca Binary files /dev/null and b/nwnds_module/dc_larak.dlg differ diff --git a/nwnds_module/dc_laus.dlg b/nwnds_module/dc_laus.dlg new file mode 100644 index 000000000..ff5b87304 Binary files /dev/null and b/nwnds_module/dc_laus.dlg differ diff --git a/nwnds_module/dc_maddox.dlg b/nwnds_module/dc_maddox.dlg new file mode 100644 index 000000000..a65ee6d0d Binary files /dev/null and b/nwnds_module/dc_maddox.dlg differ diff --git a/nwnds_module/dc_magda.dlg b/nwnds_module/dc_magda.dlg new file mode 100644 index 000000000..989e5f3db Binary files /dev/null and b/nwnds_module/dc_magda.dlg differ diff --git a/nwnds_module/dc_mayorsbed.dlg b/nwnds_module/dc_mayorsbed.dlg new file mode 100644 index 000000000..ffa8d3ef6 Binary files /dev/null and b/nwnds_module/dc_mayorsbed.dlg differ diff --git a/nwnds_module/dc_mila.dlg b/nwnds_module/dc_mila.dlg new file mode 100644 index 000000000..860df7ce4 Binary files /dev/null and b/nwnds_module/dc_mila.dlg differ diff --git a/nwnds_module/dc_minerva.dlg b/nwnds_module/dc_minerva.dlg new file mode 100644 index 000000000..334fb87f2 Binary files /dev/null and b/nwnds_module/dc_minerva.dlg differ diff --git a/nwnds_module/dc_naamo.dlg b/nwnds_module/dc_naamo.dlg new file mode 100644 index 000000000..9730f55ae Binary files /dev/null and b/nwnds_module/dc_naamo.dlg differ diff --git a/nwnds_module/dc_nather.dlg b/nwnds_module/dc_nather.dlg new file mode 100644 index 000000000..9e5ba8a27 Binary files /dev/null and b/nwnds_module/dc_nather.dlg differ diff --git a/nwnds_module/dc_nestcorpse.dlg b/nwnds_module/dc_nestcorpse.dlg new file mode 100644 index 000000000..f49c3c726 Binary files /dev/null and b/nwnds_module/dc_nestcorpse.dlg differ diff --git a/nwnds_module/dc_news.dlg b/nwnds_module/dc_news.dlg new file mode 100644 index 000000000..719bcbc22 Binary files /dev/null and b/nwnds_module/dc_news.dlg differ diff --git a/nwnds_module/dc_nicha.dlg b/nwnds_module/dc_nicha.dlg new file mode 100644 index 000000000..812f26900 Binary files /dev/null and b/nwnds_module/dc_nicha.dlg differ diff --git a/nwnds_module/dc_nils.dlg b/nwnds_module/dc_nils.dlg new file mode 100644 index 000000000..5ec4c8513 Binary files /dev/null and b/nwnds_module/dc_nils.dlg differ diff --git a/nwnds_module/dc_notuka.dlg b/nwnds_module/dc_notuka.dlg new file mode 100644 index 000000000..afa260a25 Binary files /dev/null and b/nwnds_module/dc_notuka.dlg differ diff --git a/nwnds_module/dc_oddshrub.dlg b/nwnds_module/dc_oddshrub.dlg new file mode 100644 index 000000000..1e2cf53a8 Binary files /dev/null and b/nwnds_module/dc_oddshrub.dlg differ diff --git a/nwnds_module/dc_olina.dlg b/nwnds_module/dc_olina.dlg new file mode 100644 index 000000000..e3a0166d8 Binary files /dev/null and b/nwnds_module/dc_olina.dlg differ diff --git a/nwnds_module/dc_periam.dlg b/nwnds_module/dc_periam.dlg new file mode 100644 index 000000000..54c1a6382 Binary files /dev/null and b/nwnds_module/dc_periam.dlg differ diff --git a/nwnds_module/dc_prata.dlg b/nwnds_module/dc_prata.dlg new file mode 100644 index 000000000..d83eafd46 Binary files /dev/null and b/nwnds_module/dc_prata.dlg differ diff --git a/nwnds_module/dc_rainkin.dlg b/nwnds_module/dc_rainkin.dlg new file mode 100644 index 000000000..15cfaef7a Binary files /dev/null and b/nwnds_module/dc_rainkin.dlg differ diff --git a/nwnds_module/dc_rolin.dlg b/nwnds_module/dc_rolin.dlg new file mode 100644 index 000000000..ab4247d6e Binary files /dev/null and b/nwnds_module/dc_rolin.dlg differ diff --git a/nwnds_module/dc_shanista.dlg b/nwnds_module/dc_shanista.dlg new file mode 100644 index 000000000..8f51ba520 Binary files /dev/null and b/nwnds_module/dc_shanista.dlg differ diff --git a/nwnds_module/dc_sinifa.dlg b/nwnds_module/dc_sinifa.dlg new file mode 100644 index 000000000..1db8b2ecf Binary files /dev/null and b/nwnds_module/dc_sinifa.dlg differ diff --git a/nwnds_module/dc_skum.dlg b/nwnds_module/dc_skum.dlg new file mode 100644 index 000000000..04b4d4bbd Binary files /dev/null and b/nwnds_module/dc_skum.dlg differ diff --git a/nwnds_module/dc_sligkeyhold.dlg b/nwnds_module/dc_sligkeyhold.dlg new file mode 100644 index 000000000..828532d09 Binary files /dev/null and b/nwnds_module/dc_sligkeyhold.dlg differ diff --git a/nwnds_module/dc_stack.dlg b/nwnds_module/dc_stack.dlg new file mode 100644 index 000000000..4e8fed5e4 Binary files /dev/null and b/nwnds_module/dc_stack.dlg differ diff --git a/nwnds_module/dc_start.dlg b/nwnds_module/dc_start.dlg new file mode 100644 index 000000000..faf9289e0 Binary files /dev/null and b/nwnds_module/dc_start.dlg differ diff --git a/nwnds_module/dc_tarill.dlg b/nwnds_module/dc_tarill.dlg new file mode 100644 index 000000000..b55557e8f Binary files /dev/null and b/nwnds_module/dc_tarill.dlg differ diff --git a/nwnds_module/dc_thrane.dlg b/nwnds_module/dc_thrane.dlg new file mode 100644 index 000000000..1dfe62f53 Binary files /dev/null and b/nwnds_module/dc_thrane.dlg differ diff --git a/nwnds_module/dc_toman.dlg b/nwnds_module/dc_toman.dlg new file mode 100644 index 000000000..645075df5 Binary files /dev/null and b/nwnds_module/dc_toman.dlg differ diff --git a/nwnds_module/dc_trici.dlg b/nwnds_module/dc_trici.dlg new file mode 100644 index 000000000..878e9b769 Binary files /dev/null and b/nwnds_module/dc_trici.dlg differ diff --git a/nwnds_module/dc_tsarla.dlg b/nwnds_module/dc_tsarla.dlg new file mode 100644 index 000000000..d6f8e5ea1 Binary files /dev/null and b/nwnds_module/dc_tsarla.dlg differ diff --git a/nwnds_module/dc_tyrfountain.dlg b/nwnds_module/dc_tyrfountain.dlg new file mode 100644 index 000000000..b47efd4b4 Binary files /dev/null and b/nwnds_module/dc_tyrfountain.dlg differ diff --git a/nwnds_module/dc_umiautus.dlg b/nwnds_module/dc_umiautus.dlg new file mode 100644 index 000000000..3c7b2c4d1 Binary files /dev/null and b/nwnds_module/dc_umiautus.dlg differ diff --git a/nwnds_module/dc_undeadtrader.dlg b/nwnds_module/dc_undeadtrader.dlg new file mode 100644 index 000000000..42cfd1331 Binary files /dev/null and b/nwnds_module/dc_undeadtrader.dlg differ diff --git a/nwnds_module/dc_undertaker.dlg b/nwnds_module/dc_undertaker.dlg new file mode 100644 index 000000000..459bb88af Binary files /dev/null and b/nwnds_module/dc_undertaker.dlg differ diff --git a/nwnds_module/dc_vaoperative.dlg b/nwnds_module/dc_vaoperative.dlg new file mode 100644 index 000000000..1ed946c70 Binary files /dev/null and b/nwnds_module/dc_vaoperative.dlg differ diff --git a/nwnds_module/dc_webtrash.dlg b/nwnds_module/dc_webtrash.dlg new file mode 100644 index 000000000..29ef624a2 Binary files /dev/null and b/nwnds_module/dc_webtrash.dlg differ diff --git a/nwnds_module/dc_yuantitrader.dlg b/nwnds_module/dc_yuantitrader.dlg new file mode 100644 index 000000000..c9b0a1b65 Binary files /dev/null and b/nwnds_module/dc_yuantitrader.dlg differ diff --git a/nwnds_module/dealer_listenon.ncs b/nwnds_module/dealer_listenon.ncs new file mode 100644 index 000000000..6f7133328 Binary files /dev/null and b/nwnds_module/dealer_listenon.ncs differ diff --git a/nwnds_module/dealer_listenon.nss b/nwnds_module/dealer_listenon.nss new file mode 100644 index 000000000..dc7515ee1 --- /dev/null +++ b/nwnds_module/dealer_listenon.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set the Dealer to listen for Black Jack commands + SetListening(OBJECT_SELF, TRUE); + //Change variables so that PC and Dealer show as currently playing a game. + SetLocalInt(GetPCSpeaker(),"nPlayingBlackJack",1); + SetLocalInt(OBJECT_SELF,"nPlayingBlackJack",1); +} diff --git a/nwnds_module/dealer_sit.ncs b/nwnds_module/dealer_sit.ncs new file mode 100644 index 000000000..366f6ac31 Binary files /dev/null and b/nwnds_module/dealer_sit.ncs differ diff --git a/nwnds_module/dealer_sit.nss b/nwnds_module/dealer_sit.nss new file mode 100644 index 000000000..81633dd3b --- /dev/null +++ b/nwnds_module/dealer_sit.nss @@ -0,0 +1,5 @@ +void main() +{ + //Move dealer to chair object with the tag 'CHAIR_NPC_BLACKJACK' and sit in it. + AssignCommand(OBJECT_SELF,ActionSit(GetObjectByTag("CHAIR_NPC_BLACKJACK"))); +} diff --git a/nwnds_module/dealer_spawn.ncs b/nwnds_module/dealer_spawn.ncs new file mode 100644 index 000000000..f2cf47540 Binary files /dev/null and b/nwnds_module/dealer_spawn.ncs differ diff --git a/nwnds_module/dealer_spawn.nss b/nwnds_module/dealer_spawn.nss new file mode 100644 index 000000000..538285128 --- /dev/null +++ b/nwnds_module/dealer_spawn.nss @@ -0,0 +1,81 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + + //Move dealer to chair object with the tag 'CHAIR_NPC_BLACKJACK' and sit in it. + AssignCommand(OBJECT_SELF,ActionSit(GetObjectByTag("CHAIR_NPC_BLACKJACK"))); + + SignalEvent(OBJECT_SELF, EventUserDefined(5000)); +} + + diff --git a/nwnds_module/dealer_ud.ncs b/nwnds_module/dealer_ud.ncs new file mode 100644 index 000000000..9e46e8f4b Binary files /dev/null and b/nwnds_module/dealer_ud.ncs differ diff --git a/nwnds_module/dealer_ud.nss b/nwnds_module/dealer_ud.nss new file mode 100644 index 000000000..8d88c7cee --- /dev/null +++ b/nwnds_module/dealer_ud.nss @@ -0,0 +1,512 @@ +//:://///////////////////////////////////////////// +//:: Default: BLACK JACK USER DEFINED +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + by the Black Jack dealer during the course of a game +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: July 15, 2002 +//::////////////////////////////////////////////// +void CardCheck(); +void AceCheck(int nCard, object oPC); +void InitialDeal(object oPC); +void DealerDrawRemainingCards(); + +void main() +{ + // on Spawn in - this should run + // Set the words that the dealer is 'listening' for and give each an event number + if (GetUserDefinedEventNumber() == 5000) + { + SetListenPattern(OBJECT_SELF, "Start", 500); + SetListenPattern(OBJECT_SELF, "Hit", 1000); + //SetListenPattern(OBJECT_SELF, "Hit Me", 1000); + SetListenPattern(OBJECT_SELF, "Stand", 2000); + SetListenPattern(OBJECT_SELF, "Total", 3000); + SetListenPattern(OBJECT_SELF, "Quit", 4000); //NOT IMPLEMENTED YET + SetListenPattern(OBJECT_SELF, "Join", 5000); //NOT IMPLEMENTED YET + SetListening(OBJECT_SELF,FALSE); + } + // on Dialog event - this should fire + if (GetUserDefinedEventNumber() == 1004) + { + //First off - Check to make sure that the Dealer has been told to start listening. + if (GetIsListening(OBJECT_SELF)) + { + //Get the object that the Dealer heard + object oPC = GetLastSpeaker(); + //If that object is a PC + if (GetIsPC(oPC)) + { + // Get what the Dealer heard + int nPattern = GetListenPatternNumber(); + //***************************************************************************************** + //When someone says 'Start' + if (nPattern == 500) + { + //Make sure that the game is not already in progress for this player + if(GetLocalInt(oPC,"nGameOn") == 1) + { + SpeakString("What are you trying to pull, " + GetName(oPC) + ", you've already started!"); + } + else + { + //Make sure the PC has enough money - if not - end the game + if (GetGold(oPC) >= GetLocalInt(OBJECT_SELF,"nWager")) + { + //Add one to the number of players variable on the Dealer + SetLocalInt(OBJECT_SELF,"nNumPlayers",GetLocalInt(OBJECT_SELF,"nNumPlayers") + 1); + + // Zero out the nAceCount variable - used to track how many aces a player has in his current hand + SetLocalInt(oPC,"nAceCount",0); + SetLocalInt(oPC,"nGameOn",1); + + //If the number of players playing is currently less than the maximum number of players + //set in the conversation with the dealer then the game is not full so just deal the + //one players hand + if (GetLocalInt(OBJECT_SELF,"nNumPlayers") < GetLocalInt(OBJECT_SELF,"nMaxPlayers")) + { + InitialDeal(oPC); + DelayCommand(6.0f,SpeakString(GetName(oPC) + ", you are in. Who else? Please say 'Start'.")); + } + // else the game is full so you can deal the Dealer's first card as well + else + { + //Zero out the Dealer's Ace count + SetLocalInt(OBJECT_SELF,"nAceCount",0); + //Draw Dealer's card + SetLocalInt(OBJECT_SELF,"nDealerTotal",Random(10)+1); + //Draw PCs initial hand + InitialDeal(oPC); + + //If Dealer has an Ace - say so and record it + if (GetLocalInt(OBJECT_SELF,"nDealerTotal") == 1) + { + DelayCommand(6.0f,SpeakString("Dealer is showing an Ace")); + SetLocalInt(OBJECT_SELF,"nAceCount",1); + } + //else just say what the dealer has + else + { + DelayCommand(6.0f,SpeakString("Dealer is showing a " + IntToString(GetLocalInt(OBJECT_SELF,"nDealerTotal")))); + } + + //Make the Player Counter point to the first player - only he will be able to speak to the Dealer + //ask the first player what he wants to do + DelayCommand(7.5f,SpeakString("What do you want to do, " + GetLocalString(OBJECT_SELF,"Player1Tag"))); + SetLocalString(OBJECT_SELF,"szCurrentPlayer","1"); + } + } + else + { + //End the Game because someone is out of gold + SpeakString(GetName(oPC) + ", you don't have enough gold to play this game! Get Lost! Game Over!!"); + SetListening(OBJECT_SELF,FALSE); + SetLocalInt(OBJECT_SELF, "nPlayingBlackJack", 0); + } + } + } +//***************************************************************************************** + // When someone says 'Hit' - Make sure all players are in the game, then go through them + // one at a time till they say 'Stand' + else if (nPattern == 1000) + { + //check to make sure that everyone has entered the game (up to MaxPlayers), if not, say so + if (GetLocalInt(OBJECT_SELF,"nNumPlayers") < GetLocalInt(OBJECT_SELF,"nMaxPlayers")) + { + SpeakString("Hold your horses! Not everyone is in yet."); + } + //else everyone is in so continue + else + { + //Check that only the current player is speaking, if not - tell him its not his turn + if (GetName(oPC) != GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag")) + { + SpeakString("Hold up, " + GetName(oPC) + ", its not your turn. Its " + GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag") + "'s turn"); + } + // else continue + else + { + // make sure that the current player has started the game and if he has, deal him a card + if (GetLocalInt(oPC,"nGameOn") == 1) + { + //Draw a card + SetLocalInt(oPC,"nBlackJackNextCard", Random(10)+1); + //Check if its an ace + AceCheck(GetLocalInt(oPC,"nBlackJackNextCard"),oPC); + //Add to the Total for that PC + SetLocalInt(oPC,"nBlackJackTotal", GetLocalInt(oPC,"nBlackJackTotal") + GetLocalInt(oPC,"nBlackJackNextCard")); + //Say something different if PC has an Ace + if (GetLocalInt(oPC,"nBlackJackNextCard")==1) + { + SpeakString(GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag")+". You've been dealt an Ace"); + } + //Otherwise just say the total + else + { + SpeakString(GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag")+". You've been dealt a " + IntToString(GetLocalInt(oPC,"nBlackJackNextCard"))); + } + //If the PC has any Aces - we may have to give him the option of adding ten to his total + if (GetLocalInt(oPC,"nAceCount") > 0) + { + int nTempTotal = GetLocalInt(oPC,"nBlackJackTotal")+ 10; + //If adding 10 would make it greater than 21 - then he can't use his ace + if(nTempTotal > 21) + { + DelayCommand(2.0f, SpeakString("That gives you a total of " + IntToString(GetLocalInt(oPC,"nBlackJackTotal")))); + } + //otherwise, he may have two totals since aces can be 1 or 11 + else + { + DelayCommand(2.0f, SpeakString("That gives you a total of " + IntToString(GetLocalInt(oPC,"nBlackJackTotal")) + " or " + IntToString(nTempTotal))); + } + } + else + { + DelayCommand(2.0f, SpeakString("That gives you a total of " + IntToString(GetLocalInt(oPC,"nBlackJackTotal")))); + } + //If the PCs true total is greater than 21 then they busted + if (GetLocalInt(oPC,"nBlackJackTotal") > 21) + { + DelayCommand(1.0f,SpeakString("YOU BUSTED " + GetName(oPC) +"! HAHAHAHHAAH!")); + //Set a Busted variable that we can check on later + SetLocalInt(oPC,"nBusted",1); + DelayCommand(1.0f,AssignCommand(oPC,PlaySound("as_pl_laughingm2"))); + AssignCommand(OBJECT_SELF,PlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING,1.0,1.0)); + AssignCommand(OBJECT_SELF,ActionSit(GetObjectByTag("CHAIR_NPC_BLACKJACK"))); + //Check to see if this is the last PC and call CardCheck() if it is + if(StringToInt(GetLocalString(OBJECT_SELF,"szCurrentPlayer")) == GetLocalInt(OBJECT_SELF,"nMaxPlayers")) + { + DealerDrawRemainingCards(); + CardCheck(); + } + else//If its not - advance to the next player + { + SetLocalString(OBJECT_SELF,"szCurrentPlayer",IntToString(StringToInt(GetLocalString(OBJECT_SELF,"szCurrentPlayer"))+ 1)); + DelayCommand(4.0f,SpeakString("What do you want to do, " + GetLocalString(OBJECT_SELF,"Player" + GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag") + "?")); + } + } + else + { + DelayCommand(4.0f,SpeakString("What do you want to do, " + GetLocalString(OBJECT_SELF,"Player" + GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag") + "?")); + } + } + else + { + SpeakString("What are you trying to pull, " + GetName(oPC) + ", you're not even in the game!"); + } + } + } + } +//***************************************************************************************** + //When someone says 'Stand', end that players turn and if all players have 'Stood' then deal the + //dealer's cards and see who wins. + else if (nPattern == 2000) + { + + + //Check that only the current player is speaking + if (GetName(oPC) != GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag")) + { + if (GetLocalInt(oPC,"nGameOn") != 1) + { + SpeakString("What are you trying to pull, " + GetName(oPC) + "! We haven't even started yet!"); + } + else + { + SpeakString("Hold up, its not your turn, " + GetName(oPC) + "! Its your turn, " + GetLocalString(OBJECT_SELF,"Player" + GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag")); + } + } + else + { + if (GetLocalInt(oPC,"nGameOn") != 1) + { + SpeakString("What are you trying to pull, " + GetName(oPC) + "! We haven't even started yet!"); + } + else + { + //Confirm the player's 'Stand' + SpeakString(GetName(oPC) + " stands."); + + //Calculate the Players true total (using Aces) and save it as his total + if (GetLocalInt(oPC,"nAceCount") > 0) + { + int nTempTotal = GetLocalInt(oPC,"nBlackJackTotal")+ 10; + if (nTempTotal < 22) + { + SetLocalInt(oPC,"nBlackJackTotal",nTempTotal); + } + } + //Set the CurrentPlayer to the Next Player + SetLocalString(OBJECT_SELF,"szCurrentPlayer",IntToString(StringToInt(GetLocalString(OBJECT_SELF,"szCurrentPlayer"))+ 1)); + + //Check to see if all PCs have their cards, if so then the dealer can take his + if (StringToInt(GetLocalString(OBJECT_SELF,"szCurrentPlayer")) > GetLocalInt(OBJECT_SELF,"nMaxPlayers")) + { + //Loop for the dealer to get his remaining cards + DealerDrawRemainingCards(); + CardCheck(); + } + //if not all players have their cards - tell the next player that its their turn + else + { + DelayCommand(1.0f,SpeakString("Ok, "+ GetLocalString(OBJECT_SELF,"Player"+ GetLocalString(OBJECT_SELF,"szCurrentPlayer")+"Tag") + ", its your turn")); + } + } + } + } +//***************************************************************************************** + //If somebody shouts 'total + else if (nPattern == 3000) + { + if (GetLocalInt(oPC,"nGameOn") != 1) + { + SpeakString("What are you trying to pull, " + GetName(oPC) + "! We haven't even started yet!"); + } + else + { + if (GetLocalInt(oPC,"nAceCount") > 0) + { + int nTempTotal = GetLocalInt(oPC,"nBlackJackTotal") + 10; + if (nTempTotal < 22) + { + SpeakString(GetName(oPC) + ", your total is " + IntToString(GetLocalInt(oPC,"nBlackJackTotal")) + " or " + IntToString(nTempTotal)); + } + else + { + SpeakString(GetName(oPC) + ", your total is " + IntToString(GetLocalInt(oPC,"nBlackJackTotal"))); + } + + } + else + { + SpeakString(GetName(oPC) + ", your total is " + IntToString(GetLocalInt(oPC,"nBlackJackTotal"))); + } + + } + } +//***************************************************************************************** + //If somebody shouts 'Quit' NOT IMPLEMENTED YET + else if (nPattern == 4000) + { + + } +//***************************************************************************************** + //If somebody shouts 'Join' NOT IMPLEMENTED YET + else if (nPattern == 5000) + { + + } + + } + } + } +} + +//***************************************************************************************** +void CardCheck() +{ +//Now check the dealers total against each total. + int nMax = GetLocalInt(OBJECT_SELF,"nMaxPlayers"); + int nCount; + for (nCount = 1;nCount < nMax+1; nCount++) + { + + //Get the PCs Name we are looking for + string szName = GetLocalString(OBJECT_SELF,"Player"+ IntToString(nCount)+"Tag"); + int nFound = FALSE; + object oPC = GetFirstPC(); + while (nFound == FALSE) + { + if (szName == GetName(oPC)) + { + nFound = TRUE; + } + else + { + oPC = GetNextPC(); + } + } + //Set that PCs GameOn variable to off so that he will have to shout Start to begin the next round + SetLocalInt(oPC,"nGameOn",0); + + //if the Player Busted, they automatically lose + if (GetLocalInt(oPC,"nBusted") == 1) + { + DelayCommand(3.75f,SpeakString(szName + ", you busted, so you lose!!!!")); + //take gold + DelayCommand(5.5f,TakeGoldFromCreature(GetLocalInt(OBJECT_SELF,"nWager"),oPC)); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_CUSS,oPC)); + // reset busted variable + SetLocalInt(oPC,"nBusted",0); + } + //if the Player got BlackJack - they win 3/2 on their wager + else if(GetLocalInt(oPC,"nBlackJack") == 1) + { + DelayCommand(3.25f,SpeakString("BlackJack for, " + szName + "!!!!")); + // give gold + DelayCommand(5.5f, GiveGoldToCreature(oPC,(GetLocalInt(OBJECT_SELF,"nWager")*3)/2)); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_CHEER,oPC)); + AssignCommand(oPC,PlaySound("as_mg_telepin1")); + SetLocalInt(oPC,"nBlackJack",0); + } + else + { + // if the Dealer Busted and the Player is still in - they win + if (GetLocalInt(OBJECT_SELF,"nBusted") == 1) + { + DelayCommand(4.25f,SpeakString("I busted, so you win, " + szName + "!!!!")); + // give gold + DelayCommand(5.5f, GiveGoldToCreature(oPC,GetLocalInt(OBJECT_SELF,"nWager"))); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_CHEER,oPC)); + AssignCommand(oPC,PlaySound("as_mg_telepin1")); + } + else + { + //Check each PCs total vs the Dealer's total. + if (GetLocalInt(OBJECT_SELF,"nDealerTotal") > GetLocalInt(oPC,"nBlackJackTotal")) + { + DelayCommand(5.0f,SpeakString(szName + ", you lose!!!!")); + //TakeGold + DelayCommand(5.5f,TakeGoldFromCreature(GetLocalInt(OBJECT_SELF,"nWager"),oPC)); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_CUSS,oPC)); + AssignCommand(oPC, PlaySound("as_mg_telepout1")); + } + else if (GetLocalInt(OBJECT_SELF,"nDealerTotal") < GetLocalInt(oPC,"nBlackJackTotal")) + { + DelayCommand(5.75f,SpeakString(szName + ", you win!!!!")); + //Give Gold + DelayCommand(5.5f, GiveGoldToCreature(oPC,GetLocalInt(OBJECT_SELF,"nWager"))); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_CHEER,oPC)); + AssignCommand(oPC,PlaySound("as_mg_telepin1")); + } + else + { + DelayCommand(6.5f,SpeakString(szName + ", we push!!!!")); + DelayCommand(5.5f,PlayVoiceChat(VOICE_CHAT_TAUNT,oPC)); + } + } + } + } + //Set the number of current players back to 0 and 0 out the Dealers Busted variable + SetLocalInt(OBJECT_SELF,"nNumPlayers",0); + SetLocalInt(OBJECT_SELF,"nBusted",0); + +} +// check to see if the card passed in is an Ace, if so - set a variable on that PC +void AceCheck(int nCard, object oPC) +{ + if (nCard == 1) + { + SetLocalInt(oPC,"nAceCount",GetLocalInt(oPC,"nAceCount") + 1); + } +} + +void InitialDeal(object oPC) +{ + //Deal a random card to the PC + SetLocalInt(oPC,"nBlackJackCard1",Random(10)+1); + //Check if it was an Ace (so either 1 or 11) + AceCheck(GetLocalInt(oPC,"nBlackJackCard1"), oPC); + //Deal a second card to the PC + SetLocalInt(oPC,"nBlackJackCard2",Random(10)+1); + //Check if it was an ace too + AceCheck(GetLocalInt(oPC,"nBlackJackCard2"), oPC); + SetLocalInt(oPC,"nBlackJackTotal", GetLocalInt(oPC,"nBlackJackCard1") + GetLocalInt(oPC,"nBlackJackCard2")); + //Set a variable for each player so the dealer knows the Tags of everyone playing + SetLocalString(OBJECT_SELF,"Player"+IntToString(GetLocalInt(OBJECT_SELF,"nNumPlayers"))+"Tag",GetName(oPC)); + + if(GetLocalInt(oPC,"nBlackJackCard1") == 1) + { + + if(GetLocalInt(oPC,"nBlackJackCard2") == 1) + { + DelayCommand(2.0f,SpeakString(GetName(oPC) + ", you've been dealt an Ace and another Ace")); + } + else + { + DelayCommand(2.0f,SpeakString(GetName(oPC) + ", you've been dealt an Ace and a " + IntToString(GetLocalInt(oPC,"nBlackJackCard2")))); + } + } + else + { + if(GetLocalInt(oPC,"nBlackJackCard2") == 1) + { + DelayCommand(2.0f,SpeakString(GetName(oPC) + ", you've been dealt a " + IntToString(GetLocalInt(oPC,"nBlackJackCard1")) + " and an Ace.")); + } + else + { + DelayCommand(2.0f,SpeakString(GetName(oPC) + ", you've been dealt a " + IntToString(GetLocalInt(oPC,"nBlackJackCard1")) + " and a " + IntToString(GetLocalInt(oPC,"nBlackJackCard2")))); + } + } + string szTempString = "."; + int nTempTotal = GetLocalInt(oPC,"nBlackJackTotal"); + if (GetLocalInt(oPC,"nAceCount") > 0) + { + int nCount; + nTempTotal = nTempTotal + 10; + if (nTempTotal < 22) + { + szTempString = " or " + IntToString(nTempTotal); + } + + } + + DelayCommand(4.0f,SpeakString("This gives you a total of " + IntToString(GetLocalInt(oPC,"nBlackJackTotal")) + szTempString)); + //Check for BlackJack + if (nTempTotal == 21) + { + DelayCommand(5.0f,SpeakString("BlackJack!!")); + SetLocalInt(oPC,"nBlackJack",1); + AssignCommand(oPC,PlaySound("as_cv_bell2")); + } + +} + +void DealerDrawRemainingCards() +{ + string szTempString = ""; + //Draw cards for the dealer as long as the dealers total is less than 17 - Dealer stands on 17 + do + { + SetLocalInt(OBJECT_SELF,"nDealerCard2", Random(10)+1); + AceCheck(GetLocalInt(OBJECT_SELF,"nDealerCard2"),OBJECT_SELF); + SetLocalInt(OBJECT_SELF,"nDealerTotal", GetLocalInt(OBJECT_SELF,"nDealerTotal") + GetLocalInt(OBJECT_SELF,"nDealerCard2")); + //If dealer drew an Ace - say so - calculate the total with any aces the Dealer may have + if (GetLocalInt(OBJECT_SELF,"nDealerCard2") == 1) + { + int nTempTotal = GetLocalInt(OBJECT_SELF,"nDealerTotal") + 10; + if (nTempTotal > 21) + { + szTempString = szTempString + "Dealer draws an Ace for a total of " + IntToString(GetLocalInt(OBJECT_SELF,"nDealerTotal")) + ". "; + } + else if (nTempTotal > 16) + { + SetLocalInt(OBJECT_SELF,"nDealerTotal",nTempTotal); + szTempString = szTempString + "Dealer draws an Ace for a total of " + IntToString(nTempTotal)+ ". "; + } + else + { + szTempString = szTempString + "Dealer draws an Ace for a total of " + IntToString(nTempTotal)+ ". "; + } + } + else + { + szTempString = szTempString + "Dealer draws a " + IntToString(GetLocalInt(OBJECT_SELF,"nDealerCard2")) + " for a total of " + IntToString(GetLocalInt(OBJECT_SELF,"nDealerTotal")) + ". "; + } + } + while (GetLocalInt(OBJECT_SELF,"nDealerTotal") < 17); + SetLocalString(OBJECT_SELF,"szDealerDraw",szTempString); + //Check to see if the Dealer has gone over 21 and Busted + if (GetLocalInt(OBJECT_SELF,"nDealerTotal") > 21) + { + + DelayCommand(3.0f,PlayVoiceChat(VOICE_CHAT_CUSS,OBJECT_SELF)); + SetLocalInt(OBJECT_SELF,"nBusted",1); + } + //Display what the dealer has drawn - Best timing seemed to be to say everything at once rather + //than speaking each time the dealer drew a card. + DelayCommand(2.0f,SpeakString(GetLocalString(OBJECT_SELF,"szDealerDraw"))); +} diff --git a/nwnds_module/death_neootyugh.ncs b/nwnds_module/death_neootyugh.ncs new file mode 100644 index 000000000..71a1846ad Binary files /dev/null and b/nwnds_module/death_neootyugh.ncs differ diff --git a/nwnds_module/death_neootyugh.nss b/nwnds_module/death_neootyugh.nss new file mode 100644 index 000000000..6cf276081 --- /dev/null +++ b/nwnds_module/death_neootyugh.nss @@ -0,0 +1,225 @@ +/************************ [On Death] ******************************************* + Filename: death_neootyugh.nss +************************* [On Death] ******************************************* + For Clockwork Isle mini-boss. + +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" +#include "nw_j_assassin" +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "Clockwork") == 7) + { + AddJournalQuestEntry ("Clockwork", 8, oPC); + } +} +SetLocalInt(GetLastKiller(), "nKilledOtyugh", 1); + SpeakString("Hisss!", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/deathlock001.utc b/nwnds_module/deathlock001.utc new file mode 100644 index 000000000..5b87fa390 Binary files /dev/null and b/nwnds_module/deathlock001.utc differ diff --git a/nwnds_module/dehydrate.ncs b/nwnds_module/dehydrate.ncs new file mode 100644 index 000000000..cbdb161d0 Binary files /dev/null and b/nwnds_module/dehydrate.ncs differ diff --git a/nwnds_module/dehydrate.nss b/nwnds_module/dehydrate.nss new file mode 100644 index 000000000..392f581c9 --- /dev/null +++ b/nwnds_module/dehydrate.nss @@ -0,0 +1,95 @@ +// Dehydration Grapple Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + string sCreName = GetName(oPC); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(3), DAMAGE_TYPE_BLUDGEONING); + effect eSaltDmg = EffectDamage(d6(3), DAMAGE_TYPE_FIRE); + int nSTR_Target; + int nSTR_Creature; + + int nCreCONMod = GetAbilityModifier(ABILITY_CONSTITUTION, oPC); + int nCreHD = GetHitDice (oPC); + int nNauseateDC = (10 + (nCreHD/2) + nCreCONMod); + float fNauseateDur = RoundsToSeconds(d4(1)); + int nBAB = GetBaseAttackBonus(oTarget); + + effect eVis1 = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE); + effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + effect eNausea1 = EffectSpellFailure(100); + effect eNausea2 = EffectAttackDecrease(nBAB); + effect eNausea = EffectLinkEffects(eNausea1, eNausea2); + eNausea = EffectLinkEffects(eNausea, eVis2); + eNausea = ExtraordinaryEffect(eNausea); + + if (!MySavingThrow(SAVING_THROW_FORT, oTarget, nNauseateDC, SAVING_THROW_TYPE_ALL, oPC) && + !GetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT && + !GetRacialType(oTarget) == RACIAL_TYPE_ELEMENTAL && + !GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oTarget); + FloatingTextStringOnCreature("** You are nauseated **.", oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNausea, oTarget, fNauseateDur); + } + + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal dehydration & constriction damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eSaltDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the "+sCreName+"'s grapple attack.", oTarget, FALSE); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The "+sCreName+" tries to grapple you!", oTarget, FALSE); + } + else + { + FloatingTextStringOnCreature("The "+sCreName+" is grappling you!", oTarget, FALSE); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } diff --git a/nwnds_module/delchar_include.nss b/nwnds_module/delchar_include.nss new file mode 100644 index 000000000..68f8452be --- /dev/null +++ b/nwnds_module/delchar_include.nss @@ -0,0 +1,25 @@ +// Name : DeleteChar include +// Purpose : Delete character file from the server vault +// Authors : Sean Anaya +// Modified : January, 19, 2005 + +// This file is licensed under the terms of the +// GNU GENERAL PUBLIC LICENSE (GPL) Version 2 + +/************************************/ +/* Function prototypes */ +/************************************/ + +// Delete character file from the server vault +// void deletechar(string sPlayerName, string sCharName); + + +/************************************/ +/* Implementation */ +/************************************/ + +/*void deletechar(string sPlayerName, string sCharName) +{ + object oModule = GetModule(); + SetLocalString(oModule, "NWNX!DELETECHAR!DELETE", sPlayerName + "?" + sCharName); +} */ \ No newline at end of file diff --git a/nwnds_module/dem_color_text.utp b/nwnds_module/dem_color_text.utp new file mode 100644 index 000000000..b2e2de72f Binary files /dev/null and b/nwnds_module/dem_color_text.utp differ diff --git a/nwnds_module/desecrating_aur1.ncs b/nwnds_module/desecrating_aur1.ncs new file mode 100644 index 000000000..f53bbe1d4 Binary files /dev/null and b/nwnds_module/desecrating_aur1.ncs differ diff --git a/nwnds_module/desecrating_aur1.nss b/nwnds_module/desecrating_aur1.nss new file mode 100644 index 000000000..77c81e6ec --- /dev/null +++ b/nwnds_module/desecrating_aur1.nss @@ -0,0 +1,52 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + + int nDC = 10 + GetHitDice(oCaster) /2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + int nHP = GetHitDice(oTarget) * 2; + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis = EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR); + effect eAttack = EffectAttackIncrease(2); + effect eDamage = EffectDamageIncrease(2); + effect eSaves = EffectSavingThrowIncrease(SAVING_THROW_ALL,2); + effect eHP = EffectTemporaryHitpoints(nHP); + effect eLink = EffectLinkEffects(eAttack,eDamage); + eLink = EffectLinkEffects(eLink,eSaves); + eLink = EffectLinkEffects(eLink,eVis); + + effect eFear = EffectParalyze(); + effect eFearVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink2 = EffectLinkEffects(eFear,eFearVis); + eLink2 = EffectLinkEffects(eLink2,eDur); + + + // Fear Aura + if ( GetIsEnemy(oTarget,oCaster) && GetLocalInt(oCaster,"FEAR_AURA") ) + { + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR) ) + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_FEAR,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink2,oTarget,RoundsToSeconds(d8())); + } + } + } + + + // Descecrating Aura + if (GetLocalInt(oTarget,"DEAura")>=0 ) + return; + int nRace = GetRacialType(oTarget); + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eHP,oTarget); + SetLocalInt(oTarget,"DEAura",1); + } +} diff --git a/nwnds_module/desecrating_aur2.ncs b/nwnds_module/desecrating_aur2.ncs new file mode 100644 index 000000000..eebe37f8d Binary files /dev/null and b/nwnds_module/desecrating_aur2.ncs differ diff --git a/nwnds_module/desecrating_aur2.nss b/nwnds_module/desecrating_aur2.nss new file mode 100644 index 000000000..884852fba --- /dev/null +++ b/nwnds_module/desecrating_aur2.nss @@ -0,0 +1,37 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + + int nHP; + effect eHP; + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis = EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MINOR); + effect eAttack = EffectAttackIncrease(2); + effect eDamage = EffectDamageIncrease(2); + effect eSaves = EffectSavingThrowIncrease(SAVING_THROW_ALL,2); + + effect eLink = EffectLinkEffects(eAttack,eDamage); + eLink = EffectLinkEffects(eLink,eSaves); + eLink = EffectLinkEffects(eLink,eVis); + + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if (GetLocalInt(oTarget,"DEAura")<=0 ) + { + int nRace = GetRacialType(oTarget); + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + nHP = GetHitDice(oTarget) * 2; + eHP = EffectTemporaryHitpoints(nHP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eHP,oTarget); + SetLocalInt(oTarget,"DEAura",1); + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/desecrating_aur3.ncs b/nwnds_module/desecrating_aur3.ncs new file mode 100644 index 000000000..d751d6ae7 Binary files /dev/null and b/nwnds_module/desecrating_aur3.ncs differ diff --git a/nwnds_module/desecrating_aur3.nss b/nwnds_module/desecrating_aur3.nss new file mode 100644 index 000000000..30116d922 --- /dev/null +++ b/nwnds_module/desecrating_aur3.nss @@ -0,0 +1,62 @@ + +#include "NW_I0_SPELLS" +//#include "x2_inc_spellhook" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + int bValid = FALSE; + int bAttack = FALSE; + int bDamage = FALSE; + int bHP = FALSE; + int bSaves = FALSE; + int bVis = FALSE; + + effect eAOE; + int nEffectType; + + if(GetLocalInt(oTarget,"DEAura")>=1) + { + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { +// SendMessageToPC(oPC,"EffectCreator is "+ GetName(GetEffectCreator(eAOE))); + + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator(OBJECT_SELF)) + { + nEffectType = GetEffectType(eAOE); + if ( (nEffectType == EFFECT_TYPE_ATTACK_INCREASE) || + (nEffectType == EFFECT_TYPE_DAMAGE_INCREASE) || + (nEffectType == EFFECT_TYPE_SAVING_THROW_INCREASE) || + (nEffectType == EFFECT_TYPE_VISUALEFFECT) || + (nEffectType == EFFECT_TYPE_TEMPORARY_HITPOINTS) ) + { + //If the effect was created by the Acid_Fog then remove it + if(GetEffectSpellId(eAOE) == -1) + { + RemoveEffect(oTarget, eAOE); + if ( nEffectType == EFFECT_TYPE_ATTACK_INCREASE ) + bAttack = TRUE; + if ( nEffectType == EFFECT_TYPE_DAMAGE_INCREASE ) + bDamage = TRUE; + if ( nEffectType == EFFECT_TYPE_SAVING_THROW_INCREASE ) + bSaves = TRUE; + if ( nEffectType == EFFECT_TYPE_TEMPORARY_HITPOINTS ) + bHP = TRUE; + if ( nEffectType == EFFECT_TYPE_VISUALEFFECT ) + bVis = TRUE; + + if ( bAttack && bDamage && bSaves && bHP && bVis ) + bValid = TRUE; + } + } + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } + SetLocalInt(oTarget,"DEAura",0); + } +} diff --git a/nwnds_module/desecrating_aura.ncs b/nwnds_module/desecrating_aura.ncs new file mode 100644 index 000000000..df9ee8bb5 Binary files /dev/null and b/nwnds_module/desecrating_aura.ncs differ diff --git a/nwnds_module/desecrating_aura.nss b/nwnds_module/desecrating_aura.nss new file mode 100644 index 000000000..b9d1ca4b5 --- /dev/null +++ b/nwnds_module/desecrating_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_CIRCGOOD,"desecrating_aur1","desecrating_aur2","desecrating_aur3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/desertviper_001.utc b/nwnds_module/desertviper_001.utc new file mode 100644 index 000000000..466d54498 Binary files /dev/null and b/nwnds_module/desertviper_001.utc differ diff --git a/nwnds_module/desertviper_002.utc b/nwnds_module/desertviper_002.utc new file mode 100644 index 000000000..8b01f705e Binary files /dev/null and b/nwnds_module/desertviper_002.utc differ diff --git a/nwnds_module/desertviper_003.utc b/nwnds_module/desertviper_003.utc new file mode 100644 index 000000000..b05f9d479 Binary files /dev/null and b/nwnds_module/desertviper_003.utc differ diff --git a/nwnds_module/desmasthide.uti b/nwnds_module/desmasthide.uti new file mode 100644 index 000000000..677d46da1 Binary files /dev/null and b/nwnds_module/desmasthide.uti differ diff --git a/nwnds_module/desmaststing.uti b/nwnds_module/desmaststing.uti new file mode 100644 index 000000000..d1324d876 Binary files /dev/null and b/nwnds_module/desmaststing.uti differ diff --git a/nwnds_module/desolateanddespa.are b/nwnds_module/desolateanddespa.are new file mode 100644 index 000000000..0c65e4da1 Binary files /dev/null and b/nwnds_module/desolateanddespa.are differ diff --git a/nwnds_module/desolateanddespa.gic b/nwnds_module/desolateanddespa.gic new file mode 100644 index 000000000..c18839599 Binary files /dev/null and b/nwnds_module/desolateanddespa.gic differ diff --git a/nwnds_module/desolateanddespa.git b/nwnds_module/desolateanddespa.git new file mode 100644 index 000000000..6b2a96570 Binary files /dev/null and b/nwnds_module/desolateanddespa.git differ diff --git a/nwnds_module/detectportal.ncs b/nwnds_module/detectportal.ncs new file mode 100644 index 000000000..f41b090d7 Binary files /dev/null and b/nwnds_module/detectportal.ncs differ diff --git a/nwnds_module/detectportal.nss b/nwnds_module/detectportal.nss new file mode 100644 index 000000000..1f85b9901 --- /dev/null +++ b/nwnds_module/detectportal.nss @@ -0,0 +1,141 @@ +//:://///////////////////////////////////////////// +//:: Secret Door invis object +//:: V 1.6 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This Invisable object will do a check and see + if any pc comes within a radius of this object. + + If the PC has the search skill or is a elf then + a search check will be made. + + It will create a trap door that will have its + Destination set to a waypoint that has + a tag of DST_ + + The radius is determined by the reflex saving + throw of the invisible object + + The DC of the search stored by the willpower + saving throw. + +*/ +//::////////////////////////////////////////////// +//:: Created By : Robert Babiak +//:: Created On : June 25, 2002 +//::--------------------------------------------- +//:: Modifyed By : Robert Babiak +//:: Modifyed On : July 24, 2002 +//:: Modification: Changed the name of the blueprint +//:: used to create a wall door instead, and also +//:: incorporated a optimization to reduce CPU usage. +//::--------------------------------------------- +//:: Modifyed By : Robert Babiak +//:: Modifyed On : July 25, 2002 +//:: fixed problem with the aborting of the search +//:: for PC that where in the search radius. +//:: it was aborting when it got found a PC that +//:: outside the search distance, but this also +//:: canceled the search check. +//:: +//:: This will teach me to trust code mailed in +//:: from users...:) +//::--------------------------------------------- +//::////////////////////////////////////////////// + +void main() +{ + // get the radius and DC of the secret door. + float fSearchDist = IntToFloat( GetReflexSavingThrow ( OBJECT_SELF ) ); + int nDiffaculty = GetWillSavingThrow ( OBJECT_SELF ); + + // what is the tag of this object used in setting the destination + string sTag = GetTag(OBJECT_SELF); + + // has it been found? + int nDone = GetLocalInt(OBJECT_SELF,"D_"+sTag); + int nReset = GetLocalInt(OBJECT_SELF,"Reset"); + + // ok reset the door is destroyed, and the done and reset flas are made 0 again + if (nReset == 1) + { + nDone = 0; + nReset = 0; + + SetLocalInt(OBJECT_SELF,"D_"+sTag,nDone); + SetLocalInt(OBJECT_SELF,"Reset",nReset); + + object oidDoor= GetLocalObject(OBJECT_SELF,"Door"); + if (oidDoor != OBJECT_INVALID) + { + SetPlotFlag(oidDoor,0); + DestroyObject(oidDoor,GetLocalFloat(OBJECT_SELF,"ResetDelay")); + } + + } + + + int nBestSkill = -50; + object oidBestSearcher = OBJECT_INVALID; + int nCount = 1; + + // Find the best searcher within the search radius. + object oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + int nDoneSearch = 0; + int nFoundPCs = 0; + + while ( ( nDone == 0 ) && + ( nDoneSearch == 0 ) && + ( oidNearestCreature != OBJECT_INVALID ) + ) + { + // what is the distance of the PC to the door location + float fDist = GetDistanceBetween(OBJECT_SELF,oidNearestCreature); + + if ( fDist <= fSearchDist ) + { + int nSkill = GetSkillRank(SKILL_SEARCH,oidNearestCreature); + + if (nSkill > nBestSkill) + { + nBestSkill = nSkill; + oidBestSearcher = oidNearestCreature; + } + nFoundPCs = nFoundPCs +1; + } + else + { + // If there is no one in the search radius, don't continue to search + // for the best skill. + nDoneSearch = 1; + } + nCount = nCount +1; + oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF ,nCount); + } + + if ( ( nDone == 0 ) && + ( nFoundPCs != 0 ) && + ( GetIsObjectValid( oidBestSearcher ) ) + ) + { + int nMod = d20(); + + // did we find it. + if ((nBestSkill +nMod > nDiffaculty)) + { + location locLoc = GetLocation (OBJECT_SELF); + object oidDoor; + // yes we found it, now create a trap door for us to use. it. + oidDoor = CreateObject(OBJECT_TYPE_PLACEABLE,"hidden_portal",locLoc,TRUE); + + SetLocalString( oidDoor, "Destination" , "DST_"+sTag ); + // make this door as found. + SetLocalInt(OBJECT_SELF,"D_"+sTag,1); + SetPlotFlag(oidDoor,1); + SetLocalObject(OBJECT_SELF,"Door",oidDoor); + + } // if skill search found + } // if Object is valid +} + diff --git a/nwnds_module/detectsecret.ncs b/nwnds_module/detectsecret.ncs new file mode 100644 index 000000000..be7a9c8a9 Binary files /dev/null and b/nwnds_module/detectsecret.ncs differ diff --git a/nwnds_module/detectsecret.nss b/nwnds_module/detectsecret.nss new file mode 100644 index 000000000..179ba561f --- /dev/null +++ b/nwnds_module/detectsecret.nss @@ -0,0 +1,113 @@ +//:://///////////////////////////////////////////// +//:: Secret Door invis object +//:: V 1.2 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This Invisable object will do a check and see + if any pc comes within a radius of this object. + + If the PC has the search skill or is a elf then + a search check will be made. + + It will create a trap door that will have its + Destination set to a waypoint that has + a tag of DST_ + + The radius is determined by the reflex saving + throw of the invisible object + + The DC of the search stored by the willpower + saving throw. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Robert Babiak +//:: Created On: June 25, 2002 +//::////////////////////////////////////////////// + +void main() +{ + // get the radius and DC of the secret door. + float fSearchDist = IntToFloat( GetReflexSavingThrow ( OBJECT_SELF ) ); + int nDiffaculty = GetWillSavingThrow ( OBJECT_SELF ); + + // what is the tag of this object used in setting the destination + string sTag = GetTag(OBJECT_SELF); + + // has it been found? + int nDone = GetLocalInt(OBJECT_SELF,"D_"+sTag); + int nReset = GetLocalInt(OBJECT_SELF,"Reset"); + + // ok reset the door is destroyed, and the done and reset flas are made 0 again + if (nReset == 1) + { + nDone = 0; + nReset = 0; + + SetLocalInt(OBJECT_SELF,"D_"+sTag,nDone); + SetLocalInt(OBJECT_SELF,"Reset",nReset); + + object oidDoor= GetLocalObject(OBJECT_SELF,"Door"); + if (oidDoor != OBJECT_INVALID) + { + SetPlotFlag(oidDoor,0); + DestroyObject(oidDoor,GetLocalFloat(OBJECT_SELF,"ResetDelay")); + } + + } + + + int nBestSkill = -50; + object oidBestSearcher = OBJECT_INVALID; + int nCount = 1; + + // Find the best searcher within the search radius. + object oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + + while ( ( nDone == 0 ) && + ( oidNearestCreature != OBJECT_INVALID ) + ) + { + // what is the distance of the PC to the door location + float fDist = GetDistanceBetween(OBJECT_SELF,oidNearestCreature); + + if ( fDist <= fSearchDist ) + { + int nSkill = GetSkillRank(SKILL_SEARCH,oidNearestCreature); + + if (nSkill > nBestSkill) + { + nBestSkill = nSkill; + oidBestSearcher = oidNearestCreature; + } + } + nCount = nCount +1; + oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF ,nCount); + } + + if ( ( nDone == 0 ) && + ( GetIsObjectValid( oidBestSearcher ) ) + ) + { + int nMod = d20(); + + // did we find it. + if ((nBestSkill +nMod > nDiffaculty) && (GetLevelByClass(CLASS_TYPE_ROGUE,oidBestSearcher) > 2)) + { + location locLoc = GetLocation (OBJECT_SELF); + object oidDoor; + // yes we found it, now create a trap door for us to use. it. + oidDoor = CreateObject(OBJECT_TYPE_PLACEABLE,"trapdoor",locLoc,TRUE); + + SetLocalString( oidDoor, "Destination" , "DST_"+sTag ); + // make this door as found. + SetLocalInt(OBJECT_SELF,"D_"+sTag,1); + SetPlotFlag(oidDoor,1); + SetLocalObject(OBJECT_SELF,"Door",oidDoor); + DelayCommand(20.0,SetLocalInt(OBJECT_SELF,"Reset",1)); + + } // if skill search found + } // if Object is valid +} + diff --git a/nwnds_module/detectwalldoor.ncs b/nwnds_module/detectwalldoor.ncs new file mode 100644 index 000000000..aab222aa4 Binary files /dev/null and b/nwnds_module/detectwalldoor.ncs differ diff --git a/nwnds_module/detectwalldoor.nss b/nwnds_module/detectwalldoor.nss new file mode 100644 index 000000000..fb382013e --- /dev/null +++ b/nwnds_module/detectwalldoor.nss @@ -0,0 +1,141 @@ +//:://///////////////////////////////////////////// +//:: Secret Door invis object +//:: V 1.6 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This Invisable object will do a check and see + if any pc comes within a radius of this object. + + If the PC has the search skill or is a elf then + a search check will be made. + + It will create a trap door that will have its + Destination set to a waypoint that has + a tag of DST_ + + The radius is determined by the reflex saving + throw of the invisible object + + The DC of the search stored by the willpower + saving throw. + +*/ +//::////////////////////////////////////////////// +//:: Created By : Robert Babiak +//:: Created On : June 25, 2002 +//::--------------------------------------------- +//:: Modifyed By : Robert Babiak +//:: Modifyed On : July 24, 2002 +//:: Modification: Changed the name of the blueprint +//:: used to create a wall door instead, and also +//:: incorporated a optimization to reduce CPU usage. +//::--------------------------------------------- +//:: Modifyed By : Robert Babiak +//:: Modifyed On : July 25, 2002 +//:: fixed problem with the aborting of the search +//:: for PC that where in the search radius. +//:: it was aborting when it got found a PC that +//:: outside the search distance, but this also +//:: canceled the search check. +//:: +//:: This will teach me to trust code mailed in +//:: from users...:) +//::--------------------------------------------- +//::////////////////////////////////////////////// + +void main() +{ + // get the radius and DC of the secret door. + float fSearchDist = IntToFloat( GetReflexSavingThrow ( OBJECT_SELF ) ); + int nDiffaculty = GetWillSavingThrow ( OBJECT_SELF ); + + // what is the tag of this object used in setting the destination + string sTag = GetTag(OBJECT_SELF); + + // has it been found? + int nDone = GetLocalInt(OBJECT_SELF,"D_"+sTag); + int nReset = GetLocalInt(OBJECT_SELF,"Reset"); + + // ok reset the door is destroyed, and the done and reset flas are made 0 again + if (nReset == 1) + { + nDone = 0; + nReset = 0; + + SetLocalInt(OBJECT_SELF,"D_"+sTag,nDone); + SetLocalInt(OBJECT_SELF,"Reset",nReset); + + object oidDoor= GetLocalObject(OBJECT_SELF,"Door"); + if (oidDoor != OBJECT_INVALID) + { + SetPlotFlag(oidDoor,0); + DestroyObject(oidDoor,GetLocalFloat(OBJECT_SELF,"ResetDelay")); + } + + } + + + int nBestSkill = -50; + object oidBestSearcher = OBJECT_INVALID; + int nCount = 1; + + // Find the best searcher within the search radius. + object oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + int nDoneSearch = 0; + int nFoundPCs = 0; + + while ( ( nDone == 0 ) && + ( nDoneSearch == 0 ) && + ( oidNearestCreature != OBJECT_INVALID ) + ) + { + // what is the distance of the PC to the door location + float fDist = GetDistanceBetween(OBJECT_SELF,oidNearestCreature); + + if ( fDist <= fSearchDist ) + { + int nSkill = GetSkillRank(SKILL_SEARCH,oidNearestCreature); + + if (nSkill > nBestSkill) + { + nBestSkill = nSkill; + oidBestSearcher = oidNearestCreature; + } + nFoundPCs = nFoundPCs +1; + } + else + { + // If there is no one in the search radius, don't continue to search + // for the best skill. + nDoneSearch = 1; + } + nCount = nCount +1; + oidNearestCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF ,nCount); + } + + if ( ( nDone == 0 ) && + ( nFoundPCs != 0 ) && + ( GetIsObjectValid( oidBestSearcher ) ) + ) + { + int nMod = d20(); + + // did we find it. + if ((nBestSkill +nMod > nDiffaculty)) + { + location locLoc = GetLocation (OBJECT_SELF); + object oidDoor; + // yes we found it, now create a trap door for us to use. it. + oidDoor = CreateObject(OBJECT_TYPE_PLACEABLE,"hidden_wall_door",locLoc,TRUE); + + SetLocalString( oidDoor, "Destination" , "DST_"+sTag ); + // make this door as found. + SetLocalInt(OBJECT_SELF,"D_"+sTag,1); + SetPlotFlag(oidDoor,1); + SetLocalObject(OBJECT_SELF,"Door",oidDoor); + + } // if skill search found + } // if Object is valid +} + diff --git a/nwnds_module/devamace.uti b/nwnds_module/devamace.uti new file mode 100644 index 000000000..3c824eba9 Binary files /dev/null and b/nwnds_module/devamace.uti differ diff --git a/nwnds_module/devbeetle001.utc b/nwnds_module/devbeetle001.utc new file mode 100644 index 000000000..0d76221d7 Binary files /dev/null and b/nwnds_module/devbeetle001.utc differ diff --git a/nwnds_module/devscorpclaw.uti b/nwnds_module/devscorpclaw.uti new file mode 100644 index 000000000..99d89cfeb Binary files /dev/null and b/nwnds_module/devscorpclaw.uti differ diff --git a/nwnds_module/devscorphide.uti b/nwnds_module/devscorphide.uti new file mode 100644 index 000000000..ca0a9b47f Binary files /dev/null and b/nwnds_module/devscorphide.uti differ diff --git a/nwnds_module/devscorpion001.utc b/nwnds_module/devscorpion001.utc new file mode 100644 index 000000000..fd0566b92 Binary files /dev/null and b/nwnds_module/devscorpion001.utc differ diff --git a/nwnds_module/devscorpsting.uti b/nwnds_module/devscorpsting.uti new file mode 100644 index 000000000..12123dfe2 Binary files /dev/null and b/nwnds_module/devscorpsting.uti differ diff --git a/nwnds_module/devspider001.utc b/nwnds_module/devspider001.utc new file mode 100644 index 000000000..d8bed7320 Binary files /dev/null and b/nwnds_module/devspider001.utc differ diff --git a/nwnds_module/dexteritydown.ncs b/nwnds_module/dexteritydown.ncs new file mode 100644 index 000000000..30b819447 Binary files /dev/null and b/nwnds_module/dexteritydown.ncs differ diff --git a/nwnds_module/dexteritydown.nss b/nwnds_module/dexteritydown.nss new file mode 100644 index 000000000..ede213d82 --- /dev/null +++ b/nwnds_module/dexteritydown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_DEXTERITY, -2); +} diff --git a/nwnds_module/dexterityup.ncs b/nwnds_module/dexterityup.ncs new file mode 100644 index 000000000..1901cde22 Binary files /dev/null and b/nwnds_module/dexterityup.ncs differ diff --git a/nwnds_module/dexterityup.nss b/nwnds_module/dexterityup.nss new file mode 100644 index 000000000..d12664ba3 --- /dev/null +++ b/nwnds_module/dexterityup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_DEXTERITY, 2); +} diff --git a/nwnds_module/dhd_close.ncs b/nwnds_module/dhd_close.ncs new file mode 100644 index 000000000..bc4100e4a Binary files /dev/null and b/nwnds_module/dhd_close.ncs differ diff --git a/nwnds_module/dhd_close.nss b/nwnds_module/dhd_close.nss new file mode 100644 index 000000000..3ad5be13e --- /dev/null +++ b/nwnds_module/dhd_close.nss @@ -0,0 +1,22 @@ +//****************************************************************************** +//* stargatish portal script put on_close for dhd +//* written by BWW aka Lord Nikon +//* 12/05/04 +//* clears runes out of inventory and gets ready for next use +//****************************************************************************** + +void main() +{ + object oItem = GetFirstItemInInventory(OBJECT_SELF); + object oSelf = OBJECT_SELF; + + if (oItem == OBJECT_INVALID) return; + while (oItem != OBJECT_INVALID) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(OBJECT_SELF); + if (oItem == OBJECT_INVALID) break; + } + //SendMessageToPC(GetFirstPC(),"DONE WITH CLOSE SCRIPT"); + +} diff --git a/nwnds_module/dhd_setport.ncs b/nwnds_module/dhd_setport.ncs new file mode 100644 index 000000000..af3ccfd81 Binary files /dev/null and b/nwnds_module/dhd_setport.ncs differ diff --git a/nwnds_module/dhd_setport.nss b/nwnds_module/dhd_setport.nss new file mode 100644 index 000000000..3120e8950 --- /dev/null +++ b/nwnds_module/dhd_setport.nss @@ -0,0 +1,197 @@ +#include "nw_i0_plot" +//****************************************************************************** +//* stargatish portal script put on_disturbed for dhd +//* written by BWW aka Lord Nikon +//* 12/05/04 +//* builds code for portal address then ports when player chooses the motis rune +//****************************************************************************** +void main() +{ + object oPC = GetLastDisturbed(); + object oSelf = OBJECT_SELF; + object oItem = GetInventoryDisturbItem(); + string sItemTag = GetTag(oItem); + string sTagSelf = GetTag(oSelf); + string sItemResRef; + object oA = GetObjectByTag("A_Rune"); + object oB = GetObjectByTag("B_Rune"); + object oC = GetObjectByTag("C_Rune"); + object oD = GetObjectByTag("D_Rune"); + object oE = GetObjectByTag("E_Rune"); + object oF = GetObjectByTag("F_Rune"); + object oG = GetObjectByTag("G_Rune"); + object oM = GetObjectByTag("M_Rune"); + string sCode = ""; + //oOFF gets the local gate, oON gets the target gate + object oOFF = GetNearestObjectByTag("stargate_off"); + location lOFF = GetLocation(oOFF); + object oON; + location lON; +// locations of gates to add just add a location line and the appropriate waypoint tag + location oGATE1 = GetLocation(GetWaypointByTag("GATE1")); + location oGATE2 = GetLocation(GetWaypointByTag("GATE2")); + location oGATE3 = GetLocation(GetWaypointByTag("GATE3")); + location oGATE4 = GetLocation(GetWaypointByTag("GATE4")); + location oGATE5 = GetLocation(GetWaypointByTag("GATE5")); + location oGATE6 = GetLocation(GetWaypointByTag("GATE6")); + location oGATE7 = GetLocation(GetWaypointByTag("GATE7")); + location oGATE8 = GetLocation(GetWaypointByTag("GATE8")); + + //code for interpreting the address uses base code from UO_Abagails crafting system modified for use here + if (GetInventoryDisturbType()== INVENTORY_DISTURB_TYPE_ADDED) + { + // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. + // You can replace them with whatever 'no-drop' code you have or comment them out. + string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); + if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") + return; + if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) + { + DestroyObject(oItem); + SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed."); + return; + } + // End of compatability portion. + CopyItem(oItem,oPC,TRUE); + DestroyObject(oItem); + FloatingTextStringOnCreature("You can only Activate by selecting runes.",oPC,FALSE); return; + } + +//uses campaign string to save the code change the campaign name to whatever campaign database you want to use +sCode = GetCampaignString("SPENCER","sCode",oPC); //gets global portal code + + + if (oItem == oA) + {sCode = sCode + "A"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + if (oItem == oB) + {sCode = sCode + "B"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + + if (oItem == oC) + {sCode = sCode + "C"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + + if (oItem == oD) + {sCode = sCode + "D"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + if (oItem == oE) + {sCode = sCode + "E"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + + if (oItem == oF) + {sCode = sCode + "F"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + + if (oItem == oG) + {sCode = sCode + "G"; + SetCampaignString("SPENCER","sCode",sCode,oPC); + } + + CopyObject(oItem,GetLocation(oSelf),oSelf,GetTag(oItem)); + DestroyObject(oItem); + +FloatingTextStringOnCreature(sCode,oPC,FALSE); //debug scode viewer + +// if the trigger rune is pulled check code, if code valid open gate + +if (oItem == oM) +{ +//checks scode for valid entry, change this to whatever code/length you desire +//examples are 7 letter codes, make the code length whatever you want + +if (sCode == "BADBABE") +{ + //set variables for destination + SetLocalLocation(oPC,"GATEADDY",oGATE1); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE1")); + //turns on gate + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + //turns on gate on other side at target + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE1"),1); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); + +} +if (sCode == "GABEDFC") +{ + SetLocalLocation(oPC,"GATEADDY",oGATE2); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE2")); + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE2")); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); +} +//example of a 3 letter code, codes can be any length as long as it will fit in +//a string variable +if (sCode == "ACABADE") +{ + SetLocalLocation(oPC,"GATEADDY",oGATE3); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE3")); + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + + + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE3")); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); +} +//Example of a gate address greater than 7 characters +if (sCode == "FEDABGC") +{ + SetLocalLocation(oPC,"GATEADDY",oGATE4); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE4")); + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + + + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE4")); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); +} +if (sCode == "BADBEEFEGAD") +{ + SetLocalLocation(oPC,"GATEADDY",oGATE5); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE5")); + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + + + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE5")); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); +} +if (sCode == "DEADCABGEF") +{ + SetLocalLocation(oPC,"GATEADDY",oGATE6); + SetLocalObject(oPC,"GATETARGET",GetWaypointByTag("GATE6")); + DestroyObject(oOFF); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lOFF); + + + oON = GetNearestObjectByTag("stargate_off",GetWaypointByTag("GATE6")); + lON = GetLocation(oON); + DestroyObject(oON); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_on",lON); +} + +SetCampaignString("SPENCER","sCode",sCode); +} + + +} //main + diff --git a/nwnds_module/dhd_use.ncs b/nwnds_module/dhd_use.ncs new file mode 100644 index 000000000..131b8dd5b Binary files /dev/null and b/nwnds_module/dhd_use.ncs differ diff --git a/nwnds_module/dhd_use.nss b/nwnds_module/dhd_use.nss new file mode 100644 index 000000000..a747bb1e5 --- /dev/null +++ b/nwnds_module/dhd_use.nss @@ -0,0 +1,28 @@ +//****************************************************************************** +//* stargatish portal script put on_open for dhd +//* written by BWW aka Lord Nikon +//* 12/05/04 +//* Places the Dialup Runes into the inventory and resets the code +//****************************************************************************** + +void main() +{ + object oPC = GetLastOpenedBy(); + object oSelf = OBJECT_SELF; + string sTagSelf = GetTag(oSelf); + string sCode = ""; + + SetCampaignString("SPENCER","sCode",sCode,oPC); // initialize portal code to null + + CreateItemOnObject("a_rune",OBJECT_SELF,1); //A rune + CreateItemOnObject("a_rune001",OBJECT_SELF,1); //B rune + CreateItemOnObject("a_rune002",OBJECT_SELF,1); //C rune + CreateItemOnObject("a_rune003",OBJECT_SELF,1); //D rune + CreateItemOnObject("a_rune004",OBJECT_SELF,1); //E rune + CreateItemOnObject("a_rune005",OBJECT_SELF,1); //F rune + CreateItemOnObject("a_rune006",OBJECT_SELF,1); //G rune + CreateItemOnObject("a_rune007",OBJECT_SELF,1); //Motis trigger + +} + + diff --git a/nwnds_module/direbearclaw.uti b/nwnds_module/direbearclaw.uti new file mode 100644 index 000000000..d4e16e38e Binary files /dev/null and b/nwnds_module/direbearclaw.uti differ diff --git a/nwnds_module/direrat_001.utc b/nwnds_module/direrat_001.utc new file mode 100644 index 000000000..c50c83733 Binary files /dev/null and b/nwnds_module/direrat_001.utc differ diff --git a/nwnds_module/direrat_002.utc b/nwnds_module/direrat_002.utc new file mode 100644 index 000000000..ce7c6083b Binary files /dev/null and b/nwnds_module/direrat_002.utc differ diff --git a/nwnds_module/direrat_003.utc b/nwnds_module/direrat_003.utc new file mode 100644 index 000000000..a9240ac62 Binary files /dev/null and b/nwnds_module/direrat_003.utc differ diff --git a/nwnds_module/direratbite.uti b/nwnds_module/direratbite.uti new file mode 100644 index 000000000..bdf0b403a Binary files /dev/null and b/nwnds_module/direratbite.uti differ diff --git a/nwnds_module/diretigerbite.uti b/nwnds_module/diretigerbite.uti new file mode 100644 index 000000000..e92ce0f83 Binary files /dev/null and b/nwnds_module/diretigerbite.uti differ diff --git a/nwnds_module/divinetenser_inc.ncs b/nwnds_module/divinetenser_inc.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/divinetenser_inc.ncs differ diff --git a/nwnds_module/divinetenser_inc.nss b/nwnds_module/divinetenser_inc.nss new file mode 100644 index 000000000..f66ade8de --- /dev/null +++ b/nwnds_module/divinetenser_inc.nss @@ -0,0 +1,256 @@ +#include "x2_inc_itemprop" + +//*Checks to see if the EFFECT_TYPE_DAMAGE_IMMUNITY_INCREASE is still +//*there. if not, the spell has expired or was dispelled +void CheckHasTensersEffects(object oTarget = OBJECT_SELF); + +//*Checks to see if the EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE is still +//*there. if not, the spell has expired or was dispelled +void CheckDivinePowerEffects(object oTarget); + +//custom function so as not to conflict with nw_i0_spells (duplicate +//function implementation). Also ensures a normal magical effect, +//in case a custom race or PrC has this effect generated as Supernatural +int VulcGetHasNormalEffect(int nEffectType, object oTarget = OBJECT_SELF) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + if(GetEffectType(eCheck) == nEffectType && + GetEffectSubType(eCheck) == SUBTYPE_MAGICAL) + { + return TRUE; + } + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + +//returns true if the weapon is an exotic weapon +int GetIsExoticWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_DIREMACE) || + (nItem == BASE_ITEM_DOUBLEAXE) || + (nItem == BASE_ITEM_DWARVENWARAXE) || + (nItem == BASE_ITEM_KATANA) || + (nItem == BASE_ITEM_KUKRI) || + (nItem == BASE_ITEM_SCYTHE) || + (nItem == BASE_ITEM_KAMA) || + (nItem == BASE_ITEM_SHURIKEN) || + (nItem == BASE_ITEM_SICKLE) || + (nItem == BASE_ITEM_TWOBLADEDSWORD) || + (nItem == BASE_ITEM_WHIP)) + { + return TRUE; + } + return FALSE; +} +//returns true if the weapon is a martial weapon +int GetIsMartialWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_BATTLEAXE) || + (nItem == BASE_ITEM_GREATAXE) || + (nItem == BASE_ITEM_GREATSWORD) || + (nItem == BASE_ITEM_HALBERD) || + (nItem == BASE_ITEM_HANDAXE) || + (nItem == BASE_ITEM_LONGSWORD) || + (nItem == BASE_ITEM_SCIMITAR) || + (nItem == BASE_ITEM_HEAVYFLAIL) || + (nItem == BASE_ITEM_LIGHTFLAIL) || + (nItem == BASE_ITEM_LIGHTHAMMER) || + (nItem == BASE_ITEM_RAPIER) || + (nItem == BASE_ITEM_WARHAMMER) || + (nItem == BASE_ITEM_THROWINGAXE) || + (nItem == BASE_ITEM_LONGBOW) || + (nItem == BASE_ITEM_TRIDENT) || + (nItem == BASE_ITEM_SHORTBOW)) + { + return TRUE; + } + return FALSE; +} +//returns true if the weapon is a simple weapon that wizards normally +//can't use +int GetIsSimpleWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_CLUB) || + (nItem == BASE_ITEM_DAGGER) || + (nItem == BASE_ITEM_HEAVYCROSSBOW) || + (nItem == BASE_ITEM_LIGHTCROSSBOW) || + (nItem == BASE_ITEM_QUARTERSTAFF) || + (nItem == BASE_ITEM_LIGHTMACE) || + (nItem == BASE_ITEM_SICKLE) || + (nItem == BASE_ITEM_SHORTSPEAR) || + (nItem == BASE_ITEM_MORNINGSTAR) || + (nItem == BASE_ITEM_DART) || + (nItem == BASE_ITEM_SLING)) + { + return TRUE; + } + return FALSE; +} +int GetIsElfWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_LONGBOW) || + (nItem == BASE_ITEM_LONGSWORD) || + (nItem == BASE_ITEM_RAPIER) || + (nItem == BASE_ITEM_SHORTBOW)) + { + return TRUE; + } + return FALSE; +} +int GetIsRogueWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_CLUB) || + (nItem == BASE_ITEM_DAGGER) || + (nItem == BASE_ITEM_DART) || + (nItem == BASE_ITEM_HANDAXE) || + (nItem == BASE_ITEM_HEAVYCROSSBOW) || + (nItem == BASE_ITEM_LIGHTCROSSBOW) || + (nItem == BASE_ITEM_QUARTERSTAFF) || + (nItem == BASE_ITEM_LIGHTMACE) || + (nItem == BASE_ITEM_SHORTSWORD) || + (nItem == BASE_ITEM_RAPIER) || + (nItem == BASE_ITEM_MORNINGSTAR) || + (nItem == BASE_ITEM_SLING) || + (nItem == BASE_ITEM_SHORTBOW)) + { + return TRUE; + } + return FALSE; +} +int GetIsMonkWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_CLUB) || + (nItem == BASE_ITEM_DAGGER) || + (nItem == BASE_ITEM_HANDAXE) || + (nItem == BASE_ITEM_LIGHTCROSSBOW) || + (nItem == BASE_ITEM_HEAVYCROSSBOW) || + (nItem == BASE_ITEM_QUARTERSTAFF) || + (nItem == BASE_ITEM_SHURIKEN) || + (nItem == BASE_ITEM_KAMA) || + (nItem == BASE_ITEM_SLING)) + { + return TRUE; + } + return FALSE; +} +int GetIsDruidWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_LONGBOW) || + (nItem == BASE_ITEM_LONGSWORD) || + (nItem == BASE_ITEM_RAPIER) || + (nItem == BASE_ITEM_SHORTBOW)) + { + return TRUE; + } + return FALSE; +} +int GetIsWizardWeapon(object oItem) +{ + //Declare major variables + int nItem = GetBaseItemType(oItem); + + if((nItem == BASE_ITEM_CLUB) || + (nItem == BASE_ITEM_DAGGER) || + (nItem == BASE_ITEM_HEAVYCROSSBOW) || + (nItem == BASE_ITEM_LIGHTCROSSBOW) || + (nItem == BASE_ITEM_MAGICROD) || + (nItem == BASE_ITEM_MAGICSTAFF) || + (nItem == BASE_ITEM_MAGICWAND) || + (nItem == BASE_ITEM_QUARTERSTAFF)) + { + return TRUE; + } + return FALSE; +} +int GetIsProficientWithWeapon(object oItem) +{ + int iReturn; + if((GetIsMartialWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL)) || + (GetIsSimpleWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_SIMPLE)) || + (GetIsElfWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_ELF)) || + (GetIsRogueWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_ROGUE)) || + (GetIsMonkWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_MONK)) || + (GetIsDruidWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_DRUID)) || + (GetIsWizardWeapon(oItem) && GetHasFeat(FEAT_WEAPON_PROFICIENCY_WIZARD)) || + (GetIsExoticWeapon(oItem) && GetHasFeat(IP_CONST_FEAT_WEAPON_PROF_EXOTIC)) || + (GetBaseItemType(oItem) == BASE_ITEM_MAGICSTAFF) || + (GetBaseItemType(oItem) == BASE_ITEM_SMALLSHIELD) || + (GetBaseItemType(oItem) == BASE_ITEM_LARGESHIELD) || + (GetBaseItemType(oItem) == BASE_ITEM_TOWERSHIELD) || + (GetBaseItemType(oItem) == BASE_ITEM_TORCH) || + (GetBaseItemType(oItem) == BASE_ITEM_MAGICROD) || + (GetBaseItemType(oItem) == BASE_ITEM_MAGICWAND)) + { + return TRUE; + } + return FALSE; +} +void CheckHasTensersEffects(object oTarget = OBJECT_SELF) +{ + int nTenser = GetLocalInt(oTarget,"tensers_transformation"); + object oRight, oLeft, oArmor; + if(nTenser) + { + //check for turn resistance. if gone, the spell was + //dispelled/expired. + if(VulcGetHasNormalEffect(EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE,oTarget)) + { + return; + } + else + { + DeleteLocalInt(oTarget,"tensers_transformation"); + RestoreBaseAttackBonus(oTarget); + oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget); + oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget); + oArmor = GetLocalObject(oTarget,"tensers_armor"); + SetItemCursedFlag(oArmor,FALSE); + if(!GetIsProficientWithWeapon(oLeft)) + { + AssignCommand(oTarget,ClearAllActions()); + AssignCommand(oTarget,ActionUnequipItem(oLeft)); + } + if(!GetIsProficientWithWeapon(oRight)) + { + AssignCommand(oTarget,ClearAllActions()); + AssignCommand(oTarget,ActionUnequipItem(oRight)); + } + } + } +} +void CheckDivinePowerEffects(object oTarget) +{ + if(VulcGetHasNormalEffect(EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE,oTarget)) + { + return; + } + else + { + RestoreBaseAttackBonus(oTarget); + } +} +//void main () {} diff --git a/nwnds_module/dm_rebuilder.are b/nwnds_module/dm_rebuilder.are new file mode 100644 index 000000000..c6c091018 Binary files /dev/null and b/nwnds_module/dm_rebuilder.are differ diff --git a/nwnds_module/dm_rebuilder.gic b/nwnds_module/dm_rebuilder.gic new file mode 100644 index 000000000..74713bb4f Binary files /dev/null and b/nwnds_module/dm_rebuilder.gic differ diff --git a/nwnds_module/dm_rebuilder.git b/nwnds_module/dm_rebuilder.git new file mode 100644 index 000000000..d14f24c00 Binary files /dev/null and b/nwnds_module/dm_rebuilder.git differ diff --git a/nwnds_module/dm_shadowlounge.are b/nwnds_module/dm_shadowlounge.are new file mode 100644 index 000000000..b87e16fd1 Binary files /dev/null and b/nwnds_module/dm_shadowlounge.are differ diff --git a/nwnds_module/dm_shadowlounge.gic b/nwnds_module/dm_shadowlounge.gic new file mode 100644 index 000000000..33704ccb7 Binary files /dev/null and b/nwnds_module/dm_shadowlounge.gic differ diff --git a/nwnds_module/dm_shadowlounge.git b/nwnds_module/dm_shadowlounge.git new file mode 100644 index 000000000..f4a18fac8 Binary files /dev/null and b/nwnds_module/dm_shadowlounge.git differ diff --git a/nwnds_module/dm_shadowroom.are b/nwnds_module/dm_shadowroom.are new file mode 100644 index 000000000..acbcefe8c Binary files /dev/null and b/nwnds_module/dm_shadowroom.are differ diff --git a/nwnds_module/dm_shadowroom.gic b/nwnds_module/dm_shadowroom.gic new file mode 100644 index 000000000..80f3fd4fb Binary files /dev/null and b/nwnds_module/dm_shadowroom.gic differ diff --git a/nwnds_module/dm_shadowroom.git b/nwnds_module/dm_shadowroom.git new file mode 100644 index 000000000..b243ee193 Binary files /dev/null and b/nwnds_module/dm_shadowroom.git differ diff --git a/nwnds_module/dmfi_500xp.uti b/nwnds_module/dmfi_500xp.uti new file mode 100644 index 000000000..f90d0c91d Binary files /dev/null and b/nwnds_module/dmfi_500xp.uti differ diff --git a/nwnds_module/dmfi_activate.ncs b/nwnds_module/dmfi_activate.ncs new file mode 100644 index 000000000..bf7595bee Binary files /dev/null and b/nwnds_module/dmfi_activate.ncs differ diff --git a/nwnds_module/dmfi_activate.nss b/nwnds_module/dmfi_activate.nss new file mode 100644 index 000000000..24687f6c6 --- /dev/null +++ b/nwnds_module/dmfi_activate.nss @@ -0,0 +1,345 @@ +//:://///////////////////////////////////////////// +//:: DMFI - widget activation processor +//:: dmfi_activate +//::////////////////////////////////////////////// +/* + Functions to respond and process DMFI item activations. +*/ +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2008.05.25 tsunami282 - changes to invisible listeners to work with +//:: OnPlayerChat methods. +//:: 2008.07.10 tsunami282 - add Naming Wand to the exploder. +//:: 2008.08.15 tsunami282 - move init logic to new include. + +#include "dmfi_init_inc" + +//////////////////////////////////////////////////////////////////////// +void dmw_CleanUp(object oMySpeaker) +{ + int nCount; + int nCache; + DeleteLocalObject(oMySpeaker, "dmfi_univ_target"); + DeleteLocalLocation(oMySpeaker, "dmfi_univ_location"); + DeleteLocalObject(oMySpeaker, "dmw_item"); + DeleteLocalString(oMySpeaker, "dmw_repamt"); + DeleteLocalString(oMySpeaker, "dmw_repargs"); + nCache = GetLocalInt(oMySpeaker, "dmw_playercache"); + for(nCount = 1; nCount <= nCache; nCount++) + { + DeleteLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCount)); + } + DeleteLocalInt(oMySpeaker, "dmw_playercache"); + nCache = GetLocalInt(oMySpeaker, "dmw_itemcache"); + for(nCount = 1; nCount <= nCache; nCount++) + { + DeleteLocalObject(oMySpeaker, "dmw_itemcache" + IntToString(nCount)); + } + DeleteLocalInt(oMySpeaker, "dmw_itemcache"); + for(nCount = 1; nCount <= 10; nCount++) + { + DeleteLocalString(oMySpeaker, "dmw_dialog" + IntToString(nCount)); + DeleteLocalString(oMySpeaker, "dmw_function" + IntToString(nCount)); + DeleteLocalString(oMySpeaker, "dmw_params" + IntToString(nCount)); + } + DeleteLocalString(oMySpeaker, "dmw_playerfunc"); + DeleteLocalInt(oMySpeaker, "dmw_started"); +} + +//////////////////////////////////////////////////////////////////////// +void main() +{ + object oUser = OBJECT_SELF; + object oItem = GetLocalObject(oUser, "dmfi_item"); + object oOther = GetLocalObject(oUser, "dmfi_target"); + location lLocation = GetLocalLocation(oUser, "dmfi_location"); + string sItemTag = GetTag(oItem); + + // listening system initialization moved to new function + dmfiInitialize(oUser); + + dmw_CleanUp(oUser); + + if (GetStringLeft(sItemTag,8) == "hlslang_") + { + // Remove voice stuff + string ssLanguage = GetStringRight(sItemTag, GetStringLength(sItemTag) - 8); + SetLocalInt(oUser, "hls_MyLanguage", StringToInt(ssLanguage)); + SetLocalString(oUser, "hls_MyLanguageName", GetName(oItem)); + DelayCommand(1.0f, FloatingTextStringOnCreature("You are speaking " + GetName(oItem) + ". Type [(what you want to say in brackets)]", oUser, FALSE)); + return; + } + + if (GetStringLeft(sItemTag, 8) == "dmfi_pc_") + { + if (GetStringLeft(sItemTag, 12) == "dmfi_pc_rest") + { + CreateObject(OBJECT_TYPE_PLACEABLE, "dmfi_rest" + GetStringRight(sItemTag, 3), GetLocation(oUser)); + return; + } + if (sItemTag == "dmfi_pc_follow") + { + if (GetIsObjectValid(oOther)) + { + FloatingTextStringOnCreature("Now following "+ GetName(oOther),oUser, FALSE); + DelayCommand(2.0f, AssignCommand(oUser, ActionForceFollowObject(oOther, 2.0f))); + } + return; + } + SetLocalObject(oUser, "dmfi_univ_target", oUser); + SetLocalLocation(oUser, "dmfi_univ_location", lLocation); + SetLocalString(oUser, "dmfi_univ_conv", GetStringRight(sItemTag, GetStringLength(sItemTag) - 5)); + AssignCommand(oUser, ClearAllActions()); + AssignCommand(oUser, ActionStartConversation(OBJECT_SELF, "dmfi_universal", TRUE)); + return; + } + + if (GetStringLeft(sItemTag, 5) == "dmfi_") + { + int iPass = FALSE; + + if (GetIsDM(oUser) || GetIsDMPossessed(oUser)) + iPass = TRUE; + + if (!GetIsPC(oUser)) + iPass = TRUE; + + if (!iPass) + { + FloatingTextStringOnCreature("You cannot use this item." ,oUser, FALSE); + SendMessageToAllDMs(GetName(oUser)+ " is attempting to use a DM item."); + return; + } + + if (sItemTag == "dmfi_exploder") + { + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_afflict"))) CreateItemOnObject("dmfi_afflict", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_dicebag"))) CreateItemOnObject("dmfi_dicebag", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_pc_dicebag"))) CreateItemOnObject("dmfi_pc_dicebag", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_pc_follow"))) CreateItemOnObject("dmfi_pc_follow", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_pc_emote"))) CreateItemOnObject("dmfi_pc_emote", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_server"))) CreateItemOnObject("dmfi_server", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_emote"))) CreateItemOnObject("dmfi_emote", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_encounter"))) CreateItemOnObject("dmfi_encounte", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_faction"))) CreateItemOnObject("dmfi_faction", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_fx"))) CreateItemOnObject("dmfi_fx", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_music"))) CreateItemOnObject("dmfi_music", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_sound"))) CreateItemOnObject("dmfi_sound", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_voice"))) CreateItemOnObject("dmfi_voice", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_xp"))) CreateItemOnObject("dmfi_xp", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_500xp"))) CreateItemOnObject("dmfi_500xp", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_en_ditto"))) CreateItemOnObject("dmfi_en_ditto", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_mute"))) CreateItemOnObject("dmfi_mute", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_peace"))) CreateItemOnObject("dmfi_peace", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_voicewidget"))) CreateItemOnObject("dmfi_voicewidget", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_remove"))) CreateItemOnObject("dmfi_remove", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_dmw"))) CreateItemOnObject("dmfi_dmw", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_target"))) CreateItemOnObject("dmfi_target", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_buff"))) CreateItemOnObject("dmfi_buff", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_dmbook"))) CreateItemOnObject("dmfi_dmbook", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_playerbook"))) CreateItemOnObject("dmfi_playerbook", oOther); + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_jail_widget"))) CreateItemOnObject("dmfi_jail_widget", oOther); + // 2008.07.10 tsunami282 - add naming wand to the exploder + if(!GetIsObjectValid(GetItemPossessedBy(oOther, "dmfi_naming"))) CreateItemOnObject("dmfi_naming", oOther); + return; + } + if (sItemTag == "dmfi_peace") + { //This widget sets all creatures in the area to a neutral stance and clears combat. + object oArea = GetFirstObjectInArea(GetArea(oUser)); + object oP; + while (GetIsObjectValid(oArea)) + { + if (GetObjectType(oArea) == OBJECT_TYPE_CREATURE && !GetIsPC(oArea)) + { + AssignCommand(oArea, ClearAllActions()); + oP = GetFirstPC(); + while (GetIsObjectValid(oP)) + { + if (GetArea(oP) == GetArea(oUser)) + { + ClearPersonalReputation(oArea, oP); + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 25, oP); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 91, oP); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 91, oP); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 91, oP); + } + oP = GetNextPC(); + } + AssignCommand(oArea, ClearAllActions()); + } + oArea = GetNextObjectInArea(GetArea(oUser)); + } + } + + // update / remove invisible listeners as needed for onplayerchat + if (sItemTag == "dmfi_voicewidget") + { + object oVoice; + if (GetIsObjectValid(oOther)) // do we have a valid target creature? + { + // 2008.05.29 tsunami282 - we don't use creature listen stuff anymore + SetLocalObject(oUser, "dmfi_VoiceTarget", oOther); + + FloatingTextStringOnCreature("You have targeted " + GetName(oOther) + " with the Voice Widget", oUser, FALSE); + + if (GetLocalInt(GetModule(), "dmfi_voice_initial")!=1) + { + SetLocalInt(GetModule(), "dmfi_voice_initial", 1); + SendMessageToAllDMs("Listening Initialized: .commands, .skill checks, and much more now available."); + DelayCommand(4.0, FloatingTextStringOnCreature("Listening Initialized: .commands, .skill checks, and more available", oUser)); + } + return; + } + else // no valid target of voice wand + { + //Jump any existing Voice attached to the user + if (GetIsObjectValid(GetLocalObject(oUser, "dmfi_StaticVoice"))) + { + DestroyObject(GetLocalObject(oUser, "dmfi_StaticVoice")); + } + //Create the StationaryVoice + object oStaticVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", GetLocation(oUser)); + //Set Ownership of the Voice to the User + SetLocalObject(oUser, "dmfi_StaticVoice", oVoice); + SetLocalObject(oUser, "dmfi_VoiceTarget", oStaticVoice); + DelayCommand(1.0f, FloatingTextStringOnCreature("A Stationary Voice has been created.", oUser, FALSE)); + return; + } + return; + } + if (sItemTag == "dmfi_mute") + { + SetLocalObject(oUser, "dmfi_univ_target", oUser); + SetLocalString(oUser, "dmfi_univ_conv", "voice"); + SetLocalInt(oUser, "dmfi_univ_int", 8); + ExecuteScript("dmfi_execute", oUser); + return; + } + //encounter ditto widget + if (sItemTag == "dmfi_en_ditto") + { + SetLocalObject(oUser, "dmfi_univ_target", oOther); + SetLocalLocation(oUser, "dmfi_univ_location", lLocation); + SetLocalString(oUser, "dmfi_univ_conv", "encounter"); + SetLocalInt(oUser, "dmfi_univ_int", GetLocalInt(oUser, "EncounterType")); + ExecuteScript("dmfi_execute", oUser); + return; + } + //Change target widget + if (sItemTag == "dmfi_target") + { + SetLocalObject(oUser, "dmfi_univ_target", oOther); + FloatingTextStringOnCreature("DMFI Target set to " + GetName(oOther),oUser); + } + //Destroy object widget + if (sItemTag == "dmfi_remove") + { + object oKillMe; + //Targeting Self + if (oUser == oOther) + { + oKillMe = GetNearestObject(OBJECT_TYPE_PLACEABLE, oUser); + FloatingTextStringOnCreature("Destroyed " + GetName(oKillMe) + "(" + GetTag(oKillMe) + ")", oUser, FALSE); + DelayCommand(0.1f, DestroyObject(oKillMe)); + } + else if (GetIsObjectValid(oOther)) //Targeting something else + { + FloatingTextStringOnCreature("Destroyed " + GetName(oOther) + "(" + GetTag(oOther) + ")", oUser, FALSE); + DelayCommand(0.1f, DestroyObject(oOther)); + } + else //Targeting the ground + { + int iReport = 0; + oKillMe = GetFirstObjectInShape(SHAPE_SPHERE, 2.0f, lLocation, FALSE, OBJECT_TYPE_ALL); + while (GetIsObjectValid(oKillMe)) + { + iReport++; + DestroyObject(oKillMe); + oKillMe = GetNextObjectInShape(SHAPE_SPHERE, 2.0f, lLocation, FALSE, OBJECT_TYPE_ALL); + } + FloatingTextStringOnCreature("Destroyed " + IntToString(iReport) + " objects.", oUser, FALSE); + } + return; + } + if (sItemTag == "dmfi_500xp") + { + SetLocalObject(oUser, "dmfi_univ_target", oOther); + SetLocalLocation(oUser, "dmfi_univ_location", lLocation); + SetLocalString(oUser, "dmfi_univ_conv", "xp"); + SetLocalInt(oUser, "dmfi_univ_int", 53); + ExecuteScript("dmfi_execute", oUser); + return; + } + if (sItemTag == "dmfi_jail_widget") + { + if (GetIsObjectValid(oOther) && !GetIsDM(oOther) && oOther != oUser) + { + object oJail = GetObjectByTag("dmfi_jail"); + if (!GetIsObjectValid(oJail)) + oJail = GetObjectByTag("dmfi_jail_default"); + AssignCommand(oOther, ClearAllActions()); + AssignCommand(oOther, JumpToObject(oJail)); + SendMessageToPC(oUser, GetName(oOther) + " (" + GetPCPublicCDKey(oOther) + ")/IP: " + GetPCIPAddress(oOther) + " - has been sent to Jail."); + } + return; + } + + if (sItemTag == "dmfi_encounter") + { + + if (GetIsObjectValid(GetWaypointByTag("DMFI_E1"))) + SetCustomToken(20771, GetName(GetWaypointByTag("DMFI_E1"))); + else + SetCustomToken(20771, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E2"))) + SetCustomToken(20772, GetName(GetWaypointByTag("DMFI_E2"))); + else + SetCustomToken(20772, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E3"))) + SetCustomToken(20773, GetName(GetWaypointByTag("DMFI_E3"))); + else + SetCustomToken(20773, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E4"))) + SetCustomToken(20774, GetName(GetWaypointByTag("DMFI_E4"))); + else + SetCustomToken(20774, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E5"))) + SetCustomToken(20775, GetName(GetWaypointByTag("DMFI_E5"))); + else + SetCustomToken(20775, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E6"))) + SetCustomToken(20776, GetName(GetWaypointByTag("DMFI_E6"))); + else + SetCustomToken(20776, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E7"))) + SetCustomToken(20777, GetName(GetWaypointByTag("DMFI_E7"))); + else + SetCustomToken(20777, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E8"))) + SetCustomToken(20778, GetName(GetWaypointByTag("DMFI_E8"))); + else + SetCustomToken(20778, "Encounter Invalid"); + if (GetIsObjectValid(GetWaypointByTag("DMFI_E9"))) + SetCustomToken(20779, GetName(GetWaypointByTag("DMFI_E9"))); + else + SetCustomToken(20779, "Encounter Invalid"); + } + if (sItemTag == "dmfi_afflict") + { + int nDNum; + + nDNum = GetLocalInt(oUser, "dmfi_damagemodifier"); + SetCustomToken(20780, IntToString(nDNum)); + } + + + SetLocalObject(oUser, "dmfi_univ_target", oOther); + SetLocalLocation(oUser, "dmfi_univ_location", lLocation); + SetLocalString(oUser, "dmfi_univ_conv", GetStringRight(sItemTag, GetStringLength(sItemTag) - 5)); + AssignCommand(oUser, ClearAllActions()); + AssignCommand(oUser, ActionStartConversation(OBJECT_SELF, "dmfi_universal", TRUE, FALSE)); + } +} + diff --git a/nwnds_module/dmfi_afflict.uti b/nwnds_module/dmfi_afflict.uti new file mode 100644 index 000000000..6313c9e5a Binary files /dev/null and b/nwnds_module/dmfi_afflict.uti differ diff --git a/nwnds_module/dmfi_arrays_inc.nss b/nwnds_module/dmfi_arrays_inc.nss new file mode 100644 index 000000000..b777fcc8e --- /dev/null +++ b/nwnds_module/dmfi_arrays_inc.nss @@ -0,0 +1,177 @@ +//:://///////////////////////////////////////////// +//:: DMFI - array functions include +//:: dmfi_arrays_inc +//::////////////////////////////////////////////// +/* + Functions to use object-attached local variables as arrays. +*/ +//::////////////////////////////////////////////// +//:: Created By: Noel +//:: Created On: November 17, 2001 +//::////////////////////////////////////////////// +//:: 2007.12.24 tsunami282 - yanked most of these routines from Bioware's +//:: nw_o0_itemmaker, then expanded for bounds management. + +int GetLocalArrayLowerBound(object oidObject, string sVarName); +int GetLocalArrayUpperBound(object oidObject, string sVarName); +void SetLocalArrayLowerBound(object oidObject, string sVarName, int nMin); +void SetLocalArrayUpperBound(object oidObject, string sVarName, int nMax); + +//////////////////////////////////////////////////////////////////////// +int GetLocalArrayInitialized(object oidObject, string sVarName) +{ + string sFullVarName = sVarName + "_INIT"; + return GetLocalInt(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void InitializeLocalArray(object oidObject, string sVarName) +{ + int i, iBegin, iEnd; + string sFullVarName; + + if (GetLocalArrayInitialized(oidObject, sVarName)) + { + // wipe current contents + iBegin = GetLocalArrayLowerBound(oidObject, sVarName); + iEnd = GetLocalArrayUpperBound(oidObject, sVarName); + for (i = iEnd; i >= iBegin; i--) + { + sFullVarName = sVarName + IntToString(i); + DeleteLocalInt(oidObject, sFullVarName); + DeleteLocalFloat(oidObject, sFullVarName); + DeleteLocalString(oidObject, sFullVarName); + DeleteLocalObject(oidObject, sFullVarName); + DeleteLocalLocation(oidObject, sFullVarName); + } + } + + SetLocalArrayLowerBound(oidObject, sVarName, 0); + SetLocalArrayUpperBound(oidObject, sVarName, -1); + sFullVarName = sVarName + "_INIT"; + SetLocalInt(oidObject, sFullVarName, TRUE); +} + +//////////////////////////////////////////////////////////////////////// +int GetLocalArrayLowerBound(object oidObject, string sVarName) +{ + string sFullVarName = sVarName + "_MIN"; + return GetLocalInt(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +int GetLocalArrayUpperBound(object oidObject, string sVarName) +{ + string sFullVarName = sVarName + "_MAX"; + return GetLocalInt(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayLowerBound(object oidObject, string sVarName, int nMin) +{ + string sFullVarName = sVarName + "_MIN"; + SetLocalInt(oidObject, sFullVarName, nMin); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayUpperBound(object oidObject, string sVarName, int nMax) +{ + string sFullVarName = sVarName + "_MAX"; + SetLocalInt(oidObject, sFullVarName, nMax); +} + +//////////////////////////////////////////////////////////////////////// +int GetLocalArrayInt(object oidObject, string sVarName, int nVarNum) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + return GetLocalInt(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayInt(object oidObject, string sVarName, int nVarNum, int nValue) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + SetLocalInt(oidObject, sFullVarName, nValue); + // update bounds + if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName)) + SetLocalArrayLowerBound(oidObject, sVarName, nVarNum); + if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName)) + SetLocalArrayUpperBound(oidObject, sVarName, nVarNum); +} + +//////////////////////////////////////////////////////////////////////// +float GetLocalArrayFloat(object oidObject, string sVarName, int nVarNum) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + return GetLocalFloat(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayFloat(object oidObject, string sVarName, int nVarNum, float fValue) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + SetLocalFloat(oidObject, sFullVarName, fValue); + // update bounds + if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName)) + SetLocalArrayLowerBound(oidObject, sVarName, nVarNum); + if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName)) + SetLocalArrayUpperBound(oidObject, sVarName, nVarNum); +} + +//////////////////////////////////////////////////////////////////////// +string GetLocalArrayString(object oidObject, string sVarName, int nVarNum) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + return GetLocalString(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayString(object oidObject, string sVarName, int nVarNum, string nValue) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + SetLocalString(oidObject, sFullVarName, nValue); + // update bounds + if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName)) + SetLocalArrayLowerBound(oidObject, sVarName, nVarNum); + if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName)) + SetLocalArrayUpperBound(oidObject, sVarName, nVarNum); +} + +//////////////////////////////////////////////////////////////////////// +object GetLocalArrayObject(object oidObject, string sVarName, int nVarNum) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + return GetLocalObject(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayObject(object oidObject, string sVarName, int nVarNum, object oidValue) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + SetLocalObject(oidObject, sFullVarName, oidValue); + // update bounds + if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName)) + SetLocalArrayLowerBound(oidObject, sVarName, nVarNum); + if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName)) + SetLocalArrayUpperBound(oidObject, sVarName, nVarNum); +} + +//////////////////////////////////////////////////////////////////////// +location GetLocalArrayLocation(object oidObject, string sVarName, int nVarNum) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + return GetLocalLocation(oidObject, sFullVarName); +} + +//////////////////////////////////////////////////////////////////////// +void SetLocalArrayLocation(object oidObject, string sVarName, int nVarNum, location locValue) +{ + string sFullVarName = sVarName + IntToString(nVarNum) ; + SetLocalLocation(oidObject, sFullVarName, locValue); + // update bounds + if (nVarNum < GetLocalArrayLowerBound(oidObject, sVarName)) + SetLocalArrayLowerBound(oidObject, sVarName, nVarNum); + if (nVarNum > GetLocalArrayUpperBound(oidObject, sVarName)) + SetLocalArrayUpperBound(oidObject, sVarName, nVarNum); +} + diff --git a/nwnds_module/dmfi_buff.uti b/nwnds_module/dmfi_buff.uti new file mode 100644 index 000000000..8e0bde420 Binary files /dev/null and b/nwnds_module/dmfi_buff.uti differ diff --git a/nwnds_module/dmfi_cond_dmw.ncs b/nwnds_module/dmfi_cond_dmw.ncs new file mode 100644 index 000000000..6d0aedd57 Binary files /dev/null and b/nwnds_module/dmfi_cond_dmw.ncs differ diff --git a/nwnds_module/dmfi_cond_dmw.nss b/nwnds_module/dmfi_cond_dmw.nss new file mode 100644 index 000000000..7008bacd8 --- /dev/null +++ b/nwnds_module/dmfi_cond_dmw.nss @@ -0,0 +1,22 @@ + +int StartingConditional() +{ + int nMyNum = GetLocalInt(OBJECT_SELF, "dmfi_dmwOffset"); + SetLocalInt(OBJECT_SELF, "dmfi_dmwOffset", nMyNum+1); + + object oMySpeaker = GetPCSpeaker(); + object oMyTarget = GetLocalObject(oMySpeaker, "dmfi_univ_target"); + location lMyLoc = GetLocalLocation(oMySpeaker, "dmfi_univ_location"); + + string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum)); + + if(sMyString == "") + { + return FALSE; + } + else + { + SetCustomToken(8000 + nMyNum, sMyString); + return TRUE; + } +} diff --git a/nwnds_module/dmfi_custom_enc.are b/nwnds_module/dmfi_custom_enc.are new file mode 100644 index 000000000..20e865a50 Binary files /dev/null and b/nwnds_module/dmfi_custom_enc.are differ diff --git a/nwnds_module/dmfi_custom_enc.gic b/nwnds_module/dmfi_custom_enc.gic new file mode 100644 index 000000000..646985aea Binary files /dev/null and b/nwnds_module/dmfi_custom_enc.gic differ diff --git a/nwnds_module/dmfi_custom_enc.git b/nwnds_module/dmfi_custom_enc.git new file mode 100644 index 000000000..2d3fbb74b Binary files /dev/null and b/nwnds_module/dmfi_custom_enc.git differ diff --git a/nwnds_module/dmfi_db_biow_inc.nss b/nwnds_module/dmfi_db_biow_inc.nss new file mode 100644 index 000000000..d098de8b9 --- /dev/null +++ b/nwnds_module/dmfi_db_biow_inc.nss @@ -0,0 +1,64 @@ +//DMFI Persistence wrapper functions +//This include file contains the wrapper functions for the +//persistent settings of the DMFI Wand and Widget package +//Advanced users can adapt this to the database system that +//they want to use for NWN. +// +//These functions use the Bioware database by default and use a primitive form +//of "caching" to avoid lots of database R/W + +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2008.07.10 tsunami282 - implemented alternate database support, initially +//:: for Knat's NBDE + + +const int DMFI_DB_TYPE =DMFI_DB_TYPE_BIOWARE; + +void FlushDMFIPersistentData(string sDBName) +{ + // no flushing required for Bioware database +} + +int IsDMFIPersistentDataDirty(string sDBName) +{ + return FALSE; // bioware database system has no cache, so is never dirty +} + +//Int functions +int GetDMFIPersistentInt(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + int iReturn = GetCampaignInt(sDBName, sDBSetting, oPlayer); + return iReturn; +} + +void SetDMFIPersistentInt(string sDBName, string sDBSetting, int iDBValue, object oPlayer = OBJECT_INVALID) +{ + SetCampaignInt(sDBName, sDBSetting, iDBValue, oPlayer); +} + +//Float functions +float GetDMFIPersistentFloat(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + float fReturn = GetCampaignFloat(sDBName, sDBSetting, oPlayer); + return fReturn; +} + +void SetDMFIPersistentFloat(string sDBName, string sDBSetting, float fDBValue, object oPlayer = OBJECT_INVALID) +{ + SetCampaignFloat(sDBName, sDBSetting, fDBValue, oPlayer); +} + +//String functions +string GetDMFIPersistentString(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + string sReturn = GetCampaignString(sDBName, sDBSetting, oPlayer); + return sReturn; +} + +void SetDMFIPersistentString(string sDBName, string sDBSetting, string sDBValue, object oPlayer = OBJECT_INVALID) +{ + SetCampaignString(sDBName, sDBSetting, sDBValue, oPlayer); +} diff --git a/nwnds_module/dmfi_db_inc.nss b/nwnds_module/dmfi_db_inc.nss new file mode 100644 index 000000000..696299909 --- /dev/null +++ b/nwnds_module/dmfi_db_inc.nss @@ -0,0 +1,39 @@ +//DMFI Persistence wrapper functions +//This include file contains the wrapper functions for the +//persistent settings of the DMFI Wand and Widget package +//Advanced users can adapt this to the database system that +//they want to use for NWN. + +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2008.07.10 tsunami282 - implemented alternate database support, initially +//:: for Knat's NBDE + +//Listen Pattern ** variable +//Change this to 0 to make the DMFI W&W more compatible with Jasperre's AI +const int LISTEN_PATTERN = 20600; + +const int DMFI_DB_TYPE_BIOWARE = 1; +const int DMFI_DB_TYPE_NBDE = 2; +const int DMFI_DB_TYPE_RESERVED_3 = 3; +const int DMFI_DB_TYPE_RESERVED_4 = 4; +const int DMFI_DB_TYPE_RESERVED_5 = 5; +const int DMFI_DB_TYPE_RESERVED_6 = 6; +const int DMFI_DB_TYPE_RESERVED_7 = 7; +const int DMFI_DB_TYPE_RESERVED_8 = 8; +const int DMFI_DB_TYPE_RESERVED_9 = 9; +const int DMFI_DB_TYPE_RESERVED_10 = 10; + +// *** DATABASE SELECTION *** +// Only choose one of the following #include lines. Comment out all the others! + +// Standard version uses the default Bioware database +#include "dmfi_db_biow_inc" + +// Alternate version: using Knat's NBDE +// This provides greatly increased speed, but necessitates occasional flushing to disk. +// Flushing requires you to add code to Your module OnHeartbeat event. +// #include "dmfi_db_nbde_inc" + diff --git a/nwnds_module/dmfi_db_nbde_inc.nss b/nwnds_module/dmfi_db_nbde_inc.nss new file mode 100644 index 000000000..938ab7d50 --- /dev/null +++ b/nwnds_module/dmfi_db_nbde_inc.nss @@ -0,0 +1,65 @@ +//DMFI Persistence wrapper functions +// modified version for Knat's NBDE support + +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2008.07.10 tsunami282 - implemented alternate database support, initially +//:: for Knat's NBDE + + +const int DMFI_DB_TYPE = DMFI_DB_TYPE_NBDE; + +#include "nbde_inc" + +void FlushDMFIPersistentData(string sDBName) +{ + NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", FALSE); + NBDE_FlushCampaignDatabase(sDBName); +} + +int IsDMFIPersistentDataDirty(string sDBName) +{ + return NBDE_GetCampaignInt(sDBName, "DMFI_DB_DIRTY"); +} + +//Int functions +int GetDMFIPersistentInt(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + int iReturn = NBDE_GetCampaignInt(sDBName, sDBSetting, oPlayer); + return iReturn; +} + +void SetDMFIPersistentInt(string sDBName, string sDBSetting, int iDBValue, object oPlayer = OBJECT_INVALID) +{ + NBDE_SetCampaignInt(sDBName, sDBSetting, iDBValue, oPlayer); + NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE); +} + +//Float functions +float GetDMFIPersistentFloat(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + float fReturn = NBDE_GetCampaignFloat(sDBName, sDBSetting, oPlayer); + return fReturn; +} + +void SetDMFIPersistentFloat(string sDBName, string sDBSetting, float fDBValue, object oPlayer = OBJECT_INVALID) +{ + NBDE_SetCampaignFloat(sDBName, sDBSetting, fDBValue, oPlayer); + NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE); +} + +//String functions +string GetDMFIPersistentString(string sDBName, string sDBSetting, object oPlayer = OBJECT_INVALID) +{ + string sReturn = NBDE_GetCampaignString(sDBName, sDBSetting, oPlayer); + return sReturn; +} + +void SetDMFIPersistentString(string sDBName, string sDBSetting, string sDBValue, object oPlayer = OBJECT_INVALID) +{ + NBDE_SetCampaignString(sDBName, sDBSetting, sDBValue, oPlayer); + NBDE_SetCampaignInt(sDBName, "DMFI_DB_DIRTY", TRUE); +} + diff --git a/nwnds_module/dmfi_dicebag.uti b/nwnds_module/dmfi_dicebag.uti new file mode 100644 index 000000000..a26caa7c8 Binary files /dev/null and b/nwnds_module/dmfi_dicebag.uti differ diff --git a/nwnds_module/dmfi_dmbook.uti b/nwnds_module/dmfi_dmbook.uti new file mode 100644 index 000000000..52002e59a Binary files /dev/null and b/nwnds_module/dmfi_dmbook.uti differ diff --git a/nwnds_module/dmfi_dmw.uti b/nwnds_module/dmfi_dmw.uti new file mode 100644 index 000000000..95ea76232 Binary files /dev/null and b/nwnds_module/dmfi_dmw.uti differ diff --git a/nwnds_module/dmfi_dmw_inc.nss b/nwnds_module/dmfi_dmw_inc.nss new file mode 100644 index 000000000..4c1179264 --- /dev/null +++ b/nwnds_module/dmfi_dmw_inc.nss @@ -0,0 +1,1198 @@ +// VOICE CONFIGURATION - NEW IN 1.07 and UP + +// Set this to 0 if you want to DISABLE listening by NPCs for performance reasons. +// See readme for additional information regarding possible issues and effects. +const int DMFI_LISTENING_GLOBAL = 1; + + +// NOTE: OMW_COLORS is an invisible object that must be present in your module. +// It has high ascii characters in the name and is used to get the color codes. +// This was ripped wholeheartedly by an example posted by Richterm on the bioboards. + +string DST_COLOR_TAGS = GetName(GetObjectByTag("dem_color_text")); +string DST_COLOR_WHITE = GetSubString(DST_COLOR_TAGS, 0, 6); +string DST_COLOR_YELLOW = GetSubString(DST_COLOR_TAGS, 6, 6); +string DST_COLOR_MAGENTA = GetSubString(DST_COLOR_TAGS, 12, 6); +string DST_COLOR_CYAN = GetSubString(DST_COLOR_TAGS, 18, 6); +string DST_COLOR_RED = GetSubString(DST_COLOR_TAGS, 24, 6); +string DST_COLOR_GREEN = GetSubString(DST_COLOR_TAGS, 30, 6); +string DST_COLOR_BLUE = GetSubString(DST_COLOR_TAGS, 36, 6); + +// Colors for each type of roll. Change the colors if you like. +string DMFI_ROLL_COLOR = DST_COLOR_CYAN; +string DST_COLOR_NORMAL = DST_COLOR_WHITE; + +int DMW_START_CUSTOM_TOKEN = 8000; + +//Retrieve targetting information +object oMySpeaker = GetLastSpeaker(); +object oMyTarget = GetLocalObject(oMySpeaker, "dmfi_univ_target"); +location lMyLoc = GetLocalLocation(oMySpeaker, "dmfi_univ_location"); + +// checks if a nearby object is destroyable +int dmwand_isnearbydestroyable(); +// Check if the target can be created with CreateObject +int dmwand_istargetcreateable(); +//Check if target is a destroyable object +int dmwand_istargetdestroyable(); +// checks if the wand was NOT clicked on an object +int dmwand_istargetinvalid(); +// check if the target has an inventory +int dmwand_istargetinventory(); +//Check if the target is not the wand's user +int dmwand_istargetnotme(); +//Check if target is an NPC or monster +int dmwand_istargetnpc(); +//Check if the target is a PC +int dmwand_istargetpc(); +//Check if the target is a PC and not me +int dmwand_istargetpcnme(); +// Check if the target is a PC or NPC +// uses the CON score currently +int dmwand_istargetpcornpc(); +//Check if the target is a PC or an npc and not me +int dmwand_istargetpcornpcnme(); +// Check if target is a placeable +int dmwand_istargetplaceable(); +//bulds the conversion +int dmwand_BuildConversationDialog(int nCurrent, int nChoice, string sConversation, string sParams); +int dmw_conv_ListPlayers(int nCurrent, int nChoice, string sParams = ""); +int dmw_conv_Start(int nCurrent, int nChoice, string sParams = ""); +void dmwand_BuildConversation(string sConversation, string sParams); +void dmwand_StartConversation(); + +// DMFI Color Text function. It returns a colored string. +// sText is the string that will be colored and sColor is the color +// options: yellow, magenta, cyan, red, green, blue - truncated at first letter +// Ex: sMsg = ColorText(sMsg, "y"); //Add the include file - yields yellow colored msg. +string ColorText(string sText, string sColor); +string ColorText(string sText, string sColor) +{ + string sApply = DST_COLOR_NORMAL; + string sTest = GetStringLowerCase(GetStringLeft(sColor, 1)); + if (sTest=="y") sApply = DST_COLOR_YELLOW; + else if (sTest == "m") sApply = DST_COLOR_MAGENTA; + else if (sTest == "c") sApply = DST_COLOR_CYAN; + else if (sTest == "r") sApply = DST_COLOR_RED; + else if (sTest == "g") sApply = DST_COLOR_GREEN; + else if (sTest == "b") sApply = DST_COLOR_BLUE; + + string sFinal = sApply + sText + DST_COLOR_NORMAL; + return sFinal; +} + + +int dmwand_isnearbydestroyable() +{ + object oMyTest = GetFirstObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL); + int nTargetType = GetObjectType(oMyTest); + return (GetIsObjectValid(oMyTest) && (! GetIsPC(oMyTest)) && ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE))); +} + +int dmwand_istargetcreateable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + return ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE)); +} + +int dmwand_istargetdestroyable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + if(! GetIsPC(oMyTarget)) + { + return ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE)); + } + return FALSE; +} + +int dmwand_istargetinvalid() +{ + return !GetIsObjectValid(oMyTarget); +} + +int dmwand_istargetinventory() +{ + return (GetIsObjectValid(oMyTarget) && GetHasInventory(oMyTarget)); +} + +int dmwand_istargetnotme() +{ + return (GetIsObjectValid(oMyTarget) && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetpc() +{ + return (GetIsObjectValid(oMyTarget) && GetIsPC(oMyTarget)); +} + +int dmwand_istargetpcnme() +{ + return (GetIsObjectValid(oMyTarget) && GetIsPC(oMyTarget) && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetpcornpc() +{ + return (GetIsObjectValid(oMyTarget) && GetAbilityScore(oMyTarget, ABILITY_CONSTITUTION)); +} + +int dmwand_istargetnpc() +{ + return (dmwand_istargetpcornpc() && (!GetIsPC(oMyTarget))); +} + +int dmwand_istargetpcornpcnme() +{ + return (dmwand_istargetpcornpc() && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetplaceable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + return (nTargetType == OBJECT_TYPE_PLACEABLE); +} + +int dmw_conv_Start(int nCurrent, int nChoice, string sParams = "") +{ + string sText = ""; + string sCall = ""; + string sCallParams = ""; + + switch(nCurrent) + { + case 0: + nCurrent = 0; + sText = "Hello there, DM. What can I do for you?"; + sCall = ""; + sCallParams = ""; + break; + + case 1: + nCurrent = 1; + if(dmwand_istargetpcnme()) + { + sText = "Penguin this player."; + sCall = "func_Toad"; + sCallParams = ""; + break; + } + case 2: + nCurrent = 2; + if(dmwand_istargetpcnme()) + { + sText = "Unpenguin this player."; + sCall = "func_Untoad"; + sCallParams = ""; + break; + } + case 3: + nCurrent = 3; + if(dmwand_istargetpcnme()) + { + sText = "Boot this player."; + sCall = "func_KickPC"; + sCallParams = ""; + break; + } + case 4: + nCurrent = 4; + if(dmwand_istargetinvalid()) + { + sText = "List all players..."; + sCall = "conv_ListPlayers"; + sCallParams = "func_PlayerListConv"; + break; + } + + case 5: + nCurrent = 5; + if(dmwand_istargetpcnme()) + { + sText = "Jump this player to my location."; + sCall = "func_JumpPlayerHere"; + sCallParams = ""; + break; + } + case 6: + nCurrent = 6; + if(dmwand_istargetpcnme()) + { + sText = "Jump me to this player's location."; + sCall = "func_JumpToPlayer"; + sCallParams = ""; + break; + } + case 7: + nCurrent = 7; + if(dmwand_istargetpcnme()) + { + sText = "Jump this player's party to my location."; + sCall = "func_JumpPartyHere"; + sCallParams = ""; + break; + } + default: + nCurrent = 0; + sText = ""; + sCall = ""; + sCallParams = ""; + break; + } + + SetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nChoice), sText); + SetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice), sCall); + SetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice), sCallParams); + + return nCurrent; +} + +void DMFI_untoad(object oTarget, object oUser) +{ + if (GetLocalInt(oTarget, "toaded")==1) + { + effect eMyEffect = GetFirstEffect(oTarget); + while(GetIsEffectValid(eMyEffect)) + { + if(GetEffectType(eMyEffect) == EFFECT_TYPE_POLYMORPH || GetEffectType(eMyEffect) == EFFECT_TYPE_CUTSCENE_PARALYZE) + RemoveEffect(oTarget, eMyEffect); + + eMyEffect = GetNextEffect(oTarget); + } + } + else + { + FloatingTextStringOnCreature("Dude, he is no toad!", oUser); + } +} + +void DMFI_toad(object oTarget, object oUser) +{ + //This function now toggles the toad status hahnsoo: DMFI 1.08 + if (GetLocalInt(oTarget, "toaded") == 1) + { + effect eMyEffect = GetFirstEffect(oTarget); + while(GetIsEffectValid(eMyEffect)) + { + if(GetEffectType(eMyEffect) == EFFECT_TYPE_POLYMORPH || GetEffectType(eMyEffect) == EFFECT_TYPE_CUTSCENE_PARALYZE) + RemoveEffect(oTarget, eMyEffect); + + eMyEffect = GetNextEffect(oTarget); + } + FloatingTextStringOnCreature("Removed Penguin status from " + GetName(oTarget), oUser, FALSE); + SetLocalInt(oTarget, "toaded", 0); + } + else + { + effect ePenguin = EffectPolymorph(POLYMORPH_TYPE_PENGUIN); + effect eParalyze = EffectCutsceneParalyze(); + AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePenguin, oTarget)); + AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eParalyze, oTarget)); + SetLocalInt(oTarget, "toaded", 1); + FloatingTextStringOnCreature("Added Penguin status to " + GetName(oTarget), oUser, FALSE); + } +} + +void DMFI_jail(object oOther, object oUser) +{ + if (GetIsObjectValid(oOther) && !GetIsDM(oOther) && oOther != oUser) + { + object oJail = GetObjectByTag("dmfi_jail"); + if (!GetIsObjectValid(oJail)) + oJail = GetObjectByTag("dmfi_jail_default"); + AssignCommand(oOther, ClearAllActions()); + AssignCommand(oOther, JumpToObject(oJail)); + SendMessageToPC(oUser, GetName(oOther) + " (" + GetPCPublicCDKey(oOther) + ")/IP: " + GetPCIPAddress(oOther) + " - has been sent to Jail."); + } +} + +void dmwand_KickPC(object oTarget, object oUser) +{ + // Create a lightning strike, thunder, scorch mark, and random small + // lightnings at target's location + location lMyLoc = GetLocation (oTarget); + AssignCommand( oUser, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), lMyLoc)); + AssignCommand ( oUser, PlaySound ("as_wt_thundercl3")); + object oScorch = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_weathmark", lMyLoc, FALSE); + object oTargetArea = GetArea(oUser); + int nXPos, nYPos, nCount; + for(nCount = 0; nCount < 5; nCount++) + { + nXPos = Random(10) - 5; + nYPos = Random(10) - 5; + + vector vNewVector = GetPositionFromLocation(lMyLoc); + vNewVector.x += nXPos; + vNewVector.y += nYPos; + + location lNewLoc = Location(oTargetArea, vNewVector, 0.0); + AssignCommand( oUser, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_S), lNewLoc)); + } + DelayCommand ( 20.0, DestroyObject ( oScorch)); + + SendMessageToAllDMs (GetName(oTarget) + " was booted from the game. PC CD KEY: " + GetPCPublicCDKey(oTarget) + " PC IP ADDRESS: " + GetPCIPAddress(oTarget)); + PrintString(GetName(oTarget) + " was booted from the game. PC CD KEY: " + GetPCPublicCDKey(oTarget) + " PC IP ADDRESS: " + GetPCIPAddress(oTarget)); + + // Kick the target out of the game + BootPC(oTarget); +} + +void dmwand_JumpPlayerHere() +{ + location lJumpLoc = GetLocation(oMySpeaker); + AssignCommand(oMyTarget, ClearAllActions()); + AssignCommand(oMyTarget, ActionJumpToLocation(lJumpLoc)); +} + +//Added by hahnsoo, jumps a party to the DM +void dmwand_JumpPartyHere() +{ + location lJumpLoc = GetLocation(oMySpeaker); + object oParty = GetFirstFactionMember(oMyTarget); + while (GetIsObjectValid(oParty)) + { + AssignCommand(oParty, ClearAllActions()); + AssignCommand(oParty, ActionJumpToLocation(lJumpLoc)); + oParty = GetNextFactionMember(oMyTarget); + } +} + +void dmwand_JumpToPlayer() +{ + location lJumpLoc = GetLocation(oMyTarget); + AssignCommand(oMySpeaker, ActionJumpToLocation(lJumpLoc)); +} + +void dmwand_PlayerListConv(string sParams) +{ + int nPlayer = StringToInt(sParams); + int nCache; + int nCount; + + object oPlayer = GetLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nPlayer)); + oMyTarget = oPlayer; + SetLocalObject(oMySpeaker, "dmfi_univ_target", oMyTarget); + + //Go back to the first conversation level + dmwand_BuildConversation("Start", ""); +} + +//:://///////////////////////////////////////////// +//:: File: dmw_conv_inc +//:: +//:: Conversation functions for the DM's Helper +//::////////////////////////////////////////////// + +int dmwand_BuildConversationDialog(int nCurrent, int nChoice, string sConversation, string sParams) +{ + + if(TestStringAgainstPattern(sConversation, "ListPlayers")) + { + return dmw_conv_ListPlayers(nCurrent, nChoice, sParams); + } + + if(TestStringAgainstPattern(sConversation, "Start")) + { + return dmw_conv_Start(nCurrent, nChoice, sParams); + } + + return FALSE; +} + +void dmwand_BuildConversation(string sConversation, string sParams) +{ + int nLast; + int nTemp; + int nChoice = 1; + int nCurrent = 1; + int nMatch; + + if(TestStringAgainstPattern(sParams, "prev")) + { + //Get the number choice to start with + nCurrent = GetLocalInt(oMySpeaker, "dmw_dialogprev"); + + //Since we're going to the previous page, there will be a next + SetLocalString(oMySpeaker, "dmw_dialog9", "Next ->"); + SetLocalString(oMySpeaker, "dmw_function9", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params9", "next"); + SetLocalInt(oMySpeaker, "dmw_dialognext", nCurrent); + + nChoice = 8; + for(;nChoice >= 0; nChoice--) + { + int nTemp1 = nCurrent; + int nTemp2 = nCurrent; + nMatch = nTemp2; + while((nCurrent == nMatch) && (nTemp2 > 0)) + { + nTemp2--; + nMatch = dmwand_BuildConversationDialog(nTemp2, nChoice, sConversation, sParams); + } + + if(nTemp2 <= 0) + { + //we went back too far for some reason, so make this choice blank + SetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nChoice), ""); + SetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice), ""); + SetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice), ""); + } + nLast = nTemp; + nTemp = nTemp1; + nTemp1 = nMatch; + nCurrent = nMatch; + } + + if(nMatch > 0) + { + SetLocalString(oMySpeaker, "dmw_dialog1", "<- previous"); + SetLocalString(oMySpeaker, "dmw_function1", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params1", "prev"); + SetLocalInt(oMySpeaker, "dmw_dialogprev", nLast); + } + + //fill the NPC's dialog spot + //(saved for last because the build process tromps on it) + dmwand_BuildConversationDialog(0, 0, sConversation, sParams); + } + else + { + //fill the NPC's dialog spot + dmwand_BuildConversationDialog(0, 0, sConversation, sParams); + + //No parameters specified, start at the top of the conversation + if(sParams == "") + { + nChoice = 1; + nCurrent = 1; + } + + //A "next->" choice was selected + if(TestStringAgainstPattern(sParams, "next")) + { + //get the number choice to start with + nCurrent = GetLocalInt(oMySpeaker, "dmw_dialognext"); + + //set this as the number for the "previous" choice to use + SetLocalInt(oMySpeaker, "dmw_dialogprev", nCurrent); + + //Set the first dialog choice to be "previous" + nChoice = 2; + SetLocalString(oMySpeaker, "dmw_dialog1", "<- Previous"); + SetLocalString(oMySpeaker, "dmw_function1", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params1", "prev"); + } + + //Loop through to build the dialog list + for(;nChoice <= 10; nChoice++) + { + nMatch = dmwand_BuildConversationDialog(nCurrent, nChoice, sConversation, sParams); + //nLast will be the value of the choice before the last one + nLast = nTemp; + nTemp = nMatch; + if(nMatch > 0) { nCurrent = nMatch; } + if(nMatch == 0) { nLast = 0; } + nCurrent++; + } + + //If there were enough choices to fill 10 spots, make spot 9 a "next" + if(nLast > 0) + { + SetLocalString(oMySpeaker, "dmw_dialog9", "Next ->"); + SetLocalString(oMySpeaker, "dmw_function9", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params9", "next"); + SetLocalInt(oMySpeaker, "dmw_dialognext", nLast); + } + } +} + +int dmw_conv_ListPlayers(int nCurrent, int nChoice, string sParams = "") +{ + string sText = ""; + string sCall = ""; + string sCallParams = ""; + object oPlayer; + int nCache; + + if((! TestStringAgainstPattern(sParams, "next")) && (! TestStringAgainstPattern(sParams, "prev"))) + { + //This is the first time running this function, so cache the objects + // of all players... we don't want our list swapping itself around every + // time you change a page + SetLocalString(oMySpeaker, "dmw_playerfunc", sParams); + int nCount = 1; + oPlayer = GetFirstPC(); + while(GetIsObjectValid(oPlayer)) + { + SetLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCount), oPlayer); + oPlayer = GetNextPC(); + nCount++; + } + nCount--; + SetLocalInt(oMySpeaker, "dmw_playercache", nCount); + } + + string sFunc = GetLocalString(oMySpeaker, "dmw_playerfunc"); + nCache = GetLocalInt(oMySpeaker, "dmw_playercache"); + + switch(nCurrent) + { + case 0: + nCurrent = 0; + sText = "Who would you like to work on?"; + sCall = ""; + sCallParams = ""; + break; + default: + //Find the next player in the cache who is valid + oPlayer = GetLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCurrent)); + while((! GetIsObjectValid(oPlayer)) && (nCurrent <= nCache)) + { + nCurrent++; + oPlayer = GetLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCurrent)); + } + + if(nCurrent > nCache) + { + //We've run out of cache, any other spots in this list should be + //skipped + nCurrent = 0; + sText = ""; + sCall = ""; + sCallParams = ""; + } + else + { + //We found a player, set up the list entry + sText = GetName(oPlayer) + " (" + GetPCPlayerName(oPlayer) + ")"; + sCall = sFunc; + sCallParams = IntToString(nCurrent); + } + break; + } + + SetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nChoice), sText); + SetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice), sCall); + SetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice), sCallParams); + + return nCurrent; +} + +void dmwand_DoDialogChoice(int nChoice) +{ + string sCallFunction = GetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice)); + string sCallParams = GetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice)); + string sNav = ""; + + string sStart = GetStringLeft(sCallFunction, 5); + int nLen = GetStringLength(sCallFunction) - 5; + string sCall = GetSubString(sCallFunction, 5, nLen); + + if(TestStringAgainstPattern("conv_", sStart)) + { + dmwand_BuildConversation(sCall, sCallParams); + } + else + { + + if(TestStringAgainstPattern("PlayerListConv", sCall)) + { + dmwand_PlayerListConv(sCallParams); + return; + } + + if(TestStringAgainstPattern("Toad", sCall)) + { + DMFI_toad(oMyTarget, oMySpeaker); + return; + } + if(TestStringAgainstPattern("Untoad", sCall)) + { + DMFI_untoad(oMyTarget, oMySpeaker); + return; + } + if(TestStringAgainstPattern("KickPC", sCall)) + { + dmwand_KickPC(oMyTarget, oMySpeaker); + return; + } + + if(TestStringAgainstPattern("JumpPlayerHere", sCall)) + { + dmwand_JumpPlayerHere(); + return; + } + if(TestStringAgainstPattern("JumpToPlayer", sCall)) + { + dmwand_JumpToPlayer(); + return; + } + if(TestStringAgainstPattern("JumpPartyHere", sCall)) + { + dmwand_JumpPartyHere(); + return; + } + } +} + +//Smoking Function by Jason Robinson +location GetLocationAboveAndInFrontOf(object oPC, float fDist, float fHeight) +{ + float fDistance = -fDist; + object oTarget = (oPC); + object oArea = GetArea(oTarget); + vector vPosition = GetPosition(oTarget); + vPosition.z += fHeight; + float fOrientation = GetFacing(oTarget); + vector vNewPos = AngleToVector(fOrientation); + float vZ = vPosition.z; + float vX = vPosition.x - fDistance * vNewPos.x; + float vY = vPosition.y - fDistance * vNewPos.y; + fOrientation = GetFacing(oTarget); + vX = vPosition.x - fDistance * vNewPos.x; + vY = vPosition.y - fDistance * vNewPos.y; + vNewPos = AngleToVector(fOrientation); + vZ = vPosition.z; + vNewPos = Vector(vX, vY, vZ); + return Location(oArea, vNewPos, fOrientation); +} + +//Smoking Function by Jason Robinson +void SmokePipe(object oActivator) +{ + string sEmote1 = "*puffs on a pipe*"; + string sEmote2 = "*inhales from a pipe*"; + string sEmote3 = "*pulls a mouthful of smoke from a pipe*"; + float fHeight = 1.7; + float fDistance = 0.1; + // Set height based on race and gender + if (GetGender(oActivator) == GENDER_MALE) + { + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.7; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.55; fDistance = 0.08; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.15; fDistance = 0.12; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.12; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.9; fDistance = 0.2; break; + } + } + else + { + // FEMALES + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.6; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.45; fDistance = 0.12; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.1; fDistance = 0.075; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.1; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.8; fDistance = 0.13; break; + } + } + location lAboveHead = GetLocationAboveAndInFrontOf(oActivator, fDistance, fHeight); + // emotes + switch (d3()) + { + case 1: AssignCommand(oActivator, ActionSpeakString(sEmote1)); break; + case 2: AssignCommand(oActivator, ActionSpeakString(sEmote2)); break; + case 3: AssignCommand(oActivator, ActionSpeakString(sEmote3));break; + } + // glow red + AssignCommand(oActivator, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_5), oActivator, 0.15))); + // wait a moment + AssignCommand(oActivator, ActionWait(3.0)); + // puff of smoke above and in front of head + AssignCommand(oActivator, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), lAboveHead))); + // if female, turn head to left + if ((GetGender(oActivator) == GENDER_FEMALE) && (GetRacialType(oActivator) != RACIAL_TYPE_DWARF)) + AssignCommand(oActivator, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 5.0)); +} + +void EmoteDance(object oPC) +{ + object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC); + object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC); + + AssignCommand(oPC,ActionUnequipItem(oRightHand)); + AssignCommand(oPC,ActionUnequipItem(oLeftHand)); + + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_FORCEFUL,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + + AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oLeftHand,INVENTORY_SLOT_LEFTHAND))); + AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oRightHand,INVENTORY_SLOT_RIGHTHAND))); +} + +void SitInNearestChair(object oPC) +{ + object oSit,oRightHand,oLeftHand,oChair,oCouch,oBenchPew,oStool; + float fDistSit;int nth; + // get the closest chair, couch bench or stool + nth = 1;oChair = GetNearestObjectByTag("Chair", oPC,nth); + while(oChair != OBJECT_INVALID && GetSittingCreature(oChair) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("Chair", oPC,nth);} + + nth = 1;oCouch = GetNearestObjectByTag("Couch", oPC,nth); + while(oCouch != OBJECT_INVALID && GetSittingCreature(oCouch) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("Couch", oPC,nth);} + + nth = 1;oBenchPew = GetNearestObjectByTag("BenchPew", oPC,nth); + while(oBenchPew != OBJECT_INVALID && GetSittingCreature(oBenchPew) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("BenchPew", oPC,nth);} + /* 1.27 bug + nth = 1;oStool = GetNearestObjectByTag("Stool", oPC,nth); + while(oStool != OBJECT_INVALID && GetSittingCreature(oStool) != OBJECT_INVALID) + {nth++;oStool = GetNearestObjectByTag("Stool", oPC,nth);} + */ + // get the distance between the user and each object (-1.0 is the result if no + // object is found + float fDistanceChair = GetDistanceToObject(oChair); + float fDistanceBench = GetDistanceToObject(oBenchPew); + float fDistanceCouch = GetDistanceToObject(oCouch); + float fDistanceStool = GetDistanceToObject(oStool); + + // if any of the objects are invalid (not there), change the return value + // to a high number so the distance math can work + if (fDistanceChair == -1.0) + {fDistanceChair =1000.0;} + + if (fDistanceBench == -1.0) + {fDistanceBench = 1000.0;} + + if (fDistanceCouch == -1.0) + {fDistanceCouch = 1000.0;} + + if (fDistanceStool == -1.0) + {fDistanceStool = 1000.0;} + + // find out which object is closest to the PC + if (fDistanceChair 0) + { + sReturnString =sReturnString + "/" + sClassTwo + "(" + IntToString(nLevelTwo) + ")"; + } + + //If third class exists append to return string + if(nLevelThree > 0) + { + sReturnString =sReturnString + "/" + sClassThree + "(" + IntToString(nLevelThree) + ")"; + } + + return sReturnString; +} + +string dmwand_Gender(object oEntity) +{ + switch (GetGender(oEntity)) + { + case GENDER_MALE: return "Male"; break; + case GENDER_FEMALE: return "Female"; break; + case GENDER_BOTH: return "Both"; break; + case GENDER_NONE: return "None"; break; + case GENDER_OTHER: return "Other"; break; + } + + return "Weirdo"; +} + +string dmwand_ItemInfo(object oItem, int iInt) +{ + string sReturnString = ""; + string sBaseType = ""; + string sStacked = ""; + string sIdentified = ""; + string sGPValue = ""; + string sACValue = ""; + string sProperties = ""; + + switch(GetBaseItemType(oItem)) + { + case BASE_ITEM_AMULET: sBaseType ="Amulet";break; + case BASE_ITEM_ARMOR: sBaseType ="Armor";break; + case BASE_ITEM_ARROW: sBaseType ="Arrow";break; + case BASE_ITEM_BASTARDSWORD: sBaseType ="Bastard Sword";break; + case BASE_ITEM_BATTLEAXE: sBaseType ="Battle Axe";break; + case BASE_ITEM_BELT: sBaseType ="Belt";break; + case BASE_ITEM_BLANK_POTION : sBaseType ="Blank Potion";break; + case BASE_ITEM_BLANK_SCROLL : sBaseType ="Blank Scroll";break; + case BASE_ITEM_BLANK_WAND : sBaseType ="Blank Wand";break; + case BASE_ITEM_BOLT : sBaseType ="Bolt";break; + case BASE_ITEM_BOOK: sBaseType ="Book";break; + case BASE_ITEM_BOOTS: sBaseType ="Boots";break; + case BASE_ITEM_BRACER: sBaseType ="Bracer";break; + case BASE_ITEM_BULLET: sBaseType ="Bullet";break; + case BASE_ITEM_CBLUDGWEAPON: sBaseType ="Bludgeoning Weap.";break; + case BASE_ITEM_CLOAK: sBaseType ="Cloak";break; + case BASE_ITEM_CLUB: sBaseType ="Club";break; + case BASE_ITEM_CPIERCWEAPON: sBaseType ="Pierceing Weap.";break; + case BASE_ITEM_CREATUREITEM: sBaseType ="Creature Item";break; + case BASE_ITEM_CSLASHWEAPON: sBaseType ="Slash Weap.";break; + case BASE_ITEM_CSLSHPRCWEAP: sBaseType ="Slash/Pierce Weap.";break; + case BASE_ITEM_DAGGER: sBaseType ="Dagger";break; + case BASE_ITEM_DART: sBaseType ="Dart";break; + case BASE_ITEM_DIREMACE: sBaseType ="Mace";break; + case BASE_ITEM_DOUBLEAXE: sBaseType ="Double Axe";break; + case BASE_ITEM_DWARVENWARAXE : sBaseType ="Dwarven War Axe";break; + case BASE_ITEM_ENCHANTED_POTION : sBaseType ="Enchanted Potion";break; + case BASE_ITEM_ENCHANTED_SCROLL : sBaseType ="Enchanted Scroll";break; + case BASE_ITEM_ENCHANTED_WAND : sBaseType ="Enchanted Wand";break; + case BASE_ITEM_GEM: sBaseType ="Gem";break; + case BASE_ITEM_GLOVES: sBaseType ="Gloves";break; + case BASE_ITEM_GOLD: sBaseType ="Gold";break; + case BASE_ITEM_GREATAXE: sBaseType ="Great Axe";break; + case BASE_ITEM_GREATSWORD: sBaseType ="Great Sword";break; + case BASE_ITEM_GRENADE : sBaseType ="Grenade";break; + case BASE_ITEM_HALBERD: sBaseType ="Halberd";break; + case BASE_ITEM_HANDAXE: sBaseType ="Hand Axe";break; + case BASE_ITEM_HEALERSKIT: sBaseType ="Healers Kit";break; + case BASE_ITEM_HEAVYCROSSBOW: sBaseType ="Heavy Xbow";break; + case BASE_ITEM_HEAVYFLAIL: sBaseType ="Heavy Flail";break; + case BASE_ITEM_HELMET: sBaseType ="Helmet";break; + case BASE_ITEM_INVALID: sBaseType ="";break; + case BASE_ITEM_KAMA: sBaseType ="Kama";break; + case BASE_ITEM_KATANA: sBaseType ="Katana";break; + case BASE_ITEM_KEY: sBaseType ="Key";break; + case BASE_ITEM_KUKRI: sBaseType ="Kukri";break; + case BASE_ITEM_LARGEBOX: sBaseType ="Large Box";break; + case BASE_ITEM_LARGESHIELD: sBaseType ="Large Shield";break; + case BASE_ITEM_LIGHTCROSSBOW: sBaseType ="Light Xbow";break; + case BASE_ITEM_LIGHTFLAIL: sBaseType ="Light Flail";break; + case BASE_ITEM_LIGHTHAMMER: sBaseType ="Light Hammer";break; + case BASE_ITEM_LIGHTMACE: sBaseType ="Light Mace";break; + case BASE_ITEM_LONGBOW: sBaseType ="Long Bow";break; + case BASE_ITEM_LONGSWORD: sBaseType ="Long Sword";break; + case BASE_ITEM_MAGICROD: sBaseType ="Magic Rod";break; + case BASE_ITEM_MAGICSTAFF: sBaseType ="Magic Staff";break; + case BASE_ITEM_MAGICWAND: sBaseType ="Magic Wand";break; + case BASE_ITEM_MISCLARGE: sBaseType ="Misc. Large";break; + case BASE_ITEM_MISCMEDIUM: sBaseType ="Misc. Medium";break; + case BASE_ITEM_MISCSMALL: sBaseType ="Misc. Small";break; + case BASE_ITEM_MISCTALL: sBaseType ="Misc. Small";break; + case BASE_ITEM_MISCTHIN: sBaseType ="Misc. Thin";break; + case BASE_ITEM_MISCWIDE: sBaseType ="Misc. Wide";break; + case BASE_ITEM_MORNINGSTAR: sBaseType ="Morningstar";break; + case BASE_ITEM_POTIONS: sBaseType ="Potion";break; + case BASE_ITEM_QUARTERSTAFF: sBaseType ="Quarterstaff";break; + case BASE_ITEM_RAPIER: sBaseType ="Rapier";break; + case BASE_ITEM_RING: sBaseType ="Ring";break; + case BASE_ITEM_SCIMITAR: sBaseType ="Scimitar";break; + case BASE_ITEM_SCROLL: sBaseType ="Scroll";break; + case BASE_ITEM_SCYTHE: sBaseType ="Scythe";break; + case BASE_ITEM_SHORTBOW: sBaseType ="Shortbow";break; + case BASE_ITEM_SHORTSPEAR: sBaseType ="Short Spear";break; + case BASE_ITEM_SHORTSWORD: sBaseType ="Short Sword";break; + case BASE_ITEM_SHURIKEN: sBaseType ="Shuriken";break; + case BASE_ITEM_SICKLE: sBaseType ="Sickle";break; + case BASE_ITEM_SLING: sBaseType ="Sling";break; + case BASE_ITEM_SMALLSHIELD: sBaseType ="Small Shield";break; + case BASE_ITEM_SPELLSCROLL: sBaseType ="Spell Scroll";break; + case BASE_ITEM_THIEVESTOOLS: sBaseType ="Thieves Tools";break; + case BASE_ITEM_THROWINGAXE: sBaseType ="Throwing Axe";break; + case BASE_ITEM_TORCH: sBaseType ="Torch";break; + case BASE_ITEM_TOWERSHIELD: sBaseType ="Tower Shield";break; + case BASE_ITEM_TRAPKIT: sBaseType ="Trap Kit";break; + case BASE_ITEM_TRIDENT: sBaseType ="Trident";break; + case BASE_ITEM_TWOBLADEDSWORD: sBaseType ="2 Bladed Sword";break; + case BASE_ITEM_WARHAMMER: sBaseType ="Warhammer";break; + case BASE_ITEM_WHIP : sBaseType ="Whip";break; + } + + sReturnString = sStacked + GetName(oItem) + " (" + sBaseType + ")"; + return sReturnString; +} + +string dmwand_Inventory(object oEntity) +{ + + string sBaseType; + string sReturnString; + + sReturnString = sReturnString + "\nEquipped:\n"; + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_ARMS, oMyTarget))){ sReturnString = sReturnString + "Arms: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_ARMS, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BELT, oMyTarget))){ sReturnString = sReturnString + "Belt: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_BELT, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BOOTS, oMyTarget))){ sReturnString = sReturnString + "Boots: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_BOOTS, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CHEST, oMyTarget))){ sReturnString = sReturnString + "Chest: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CHEST, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CLOAK, oMyTarget))){ sReturnString = sReturnString + "Cloak: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CLOAK, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_HEAD, oMyTarget))){ sReturnString = sReturnString + "Head: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_HEAD, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oMyTarget))){ sReturnString = sReturnString + "Left Hand: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oMyTarget))){ sReturnString = sReturnString + "Left Ring: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_NECK, oMyTarget))){ sReturnString = sReturnString + "Neck: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_NECK, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oMyTarget))){ sReturnString = sReturnString + "Right Hand: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oMyTarget))){ sReturnString = sReturnString + "Right Ring: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_ARROWS, oMyTarget))){ sReturnString = sReturnString + "Arrows: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_ARROWS, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BOLTS, oMyTarget))){ sReturnString = sReturnString + "Bolts: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_BOLTS, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BULLETS, oMyTarget))){ sReturnString = sReturnString + "Bullets: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_BULLETS, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CARMOUR, oMyTarget))){ sReturnString = sReturnString + "Creature Armor: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CARMOUR, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oMyTarget))){ sReturnString = sReturnString + "Creature Bite: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oMyTarget))){ sReturnString = sReturnString + "Creature Left: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oMyTarget),0) + "\n"; } + if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oMyTarget))){ sReturnString = sReturnString + "Creature Right: " + dmwand_ItemInfo(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oMyTarget),0) + "\n"; } + + object oItem = GetFirstItemInInventory(oEntity); + + while(oItem != OBJECT_INVALID) + { + sReturnString = sReturnString + "\n" + dmwand_ItemInfo(oItem, 0); + oItem = GetNextItemInInventory(oEntity); + }; + + return sReturnString; +} + +string dmwand_Race(object oEntity) +{ + switch (GetRacialType(oEntity)) + { + case RACIAL_TYPE_ABERRATION: return "Aberration"; break; + case RACIAL_TYPE_ALL: return "All"; break; + case RACIAL_TYPE_ANIMAL: return "Animal"; break; + case RACIAL_TYPE_BEAST: return "Beast"; break; + case RACIAL_TYPE_CONSTRUCT: return "Construct"; break; + case RACIAL_TYPE_DRAGON: return "Dragon"; break; + case RACIAL_TYPE_DWARF: return "Dwarf"; break; + case RACIAL_TYPE_ELEMENTAL: return "Elemental"; break; + case RACIAL_TYPE_ELF: return "Elf"; break; + case RACIAL_TYPE_FEY: return "Fey"; break; + case RACIAL_TYPE_GIANT: return "Giant"; break; + case RACIAL_TYPE_GNOME: return "Gnome"; break; + case RACIAL_TYPE_HALFELF: return "Half Elf"; break; + case RACIAL_TYPE_HALFLING: return "Halfling"; break; + case RACIAL_TYPE_HALFORC: return "Half Orc"; break; + case RACIAL_TYPE_HUMAN: return "Human"; break; + case RACIAL_TYPE_HUMANOID_GOBLINOID: return "Goblinoid"; break; + case RACIAL_TYPE_HUMANOID_MONSTROUS: return "Monstrous"; break; + case RACIAL_TYPE_HUMANOID_ORC: return "Orc"; break; + case RACIAL_TYPE_HUMANOID_REPTILIAN: return "Reptillian"; break; + case RACIAL_TYPE_MAGICAL_BEAST: return "Magical Beast"; break; + case RACIAL_TYPE_OOZE: return "Ooze"; break; + case RACIAL_TYPE_OUTSIDER: return "Outsider"; break; + case RACIAL_TYPE_SHAPECHANGER: return "Shapechanger"; break; + case RACIAL_TYPE_UNDEAD: return "Undead"; break; + case RACIAL_TYPE_VERMIN: return "Vermin"; break; + } + + return "Unknown"; +} +int DMFI_GetNetWorth(object oTarget) +{ + int n; + object oItem = GetFirstItemInInventory(oTarget); + while(GetIsObjectValid(oItem)) + { + n= n + GetGoldPieceValue(oItem); + oItem = GetNextItemInInventory(oTarget); + } + + + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_ARMS, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_ARROWS, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_BELT, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_BOLTS, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_BOOTS, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_BULLETS, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CARMOUR, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CHEST, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CLOAK, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_HEAD, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_NECK, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget)); + n = n + GetGoldPieceValue(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oTarget)); + return n; +} + +void DMFI_report(object oTarget, object oUser) +{ + string sSTR = IntToString(GetAbilityScore(oMyTarget,ABILITY_STRENGTH)); + string sINT = IntToString(GetAbilityScore(oMyTarget,ABILITY_INTELLIGENCE)); + string sDEX = IntToString(GetAbilityScore(oMyTarget,ABILITY_DEXTERITY)); + string sWIS = IntToString(GetAbilityScore(oMyTarget,ABILITY_WISDOM)); + string sCON = IntToString(GetAbilityScore(oMyTarget,ABILITY_CONSTITUTION)); + string sCHA = IntToString(GetAbilityScore(oMyTarget,ABILITY_CHARISMA)); + string sReport = "\n-------------------------------------------" + + "\nReported: " + IntToString(GetTimeHour()) + ":" + IntToString(GetTimeMinute()) + + "\nPlayer Name: " + GetPCPlayerName(oMyTarget) + + "\nPublic CDKey: " + GetPCPublicCDKey(oMyTarget) + + "\nChar Name: " + GetName(oMyTarget) + + "\n-------------------------------------------" + + "\nRace: " + dmwand_Race(oMyTarget) + + "\nClass: " + dmwand_ClassLevel(oMyTarget) + + "\nXP: " + IntToString(GetXP(oMyTarget)) + + "\nGender: " + dmwand_Gender(oMyTarget) + + "\nAlign: " + dmwand_Alignment(oMyTarget) + + "\nDeity: " + GetDeity(oMyTarget) + + "\n" + + "\nSTR: " + sSTR + + "\nINT: " + sINT + + "\nWIS: " + sWIS + + "\nDEX: " + sDEX + + "\nCON: " + sCON + + "\nCHA: " + sCHA + + "\n" + + "\nHP: " + IntToString(GetCurrentHitPoints(oMyTarget)) + + " of " + IntToString(GetMaxHitPoints(oMyTarget)) + + "\nAC: " + IntToString(GetAC(oMyTarget)) + + "\nGold: " + IntToString(GetGold(oMyTarget)) + + "\nNet Worth: " + IntToString(DMFI_GetNetWorth(oMyTarget) + GetGold(oMyTarget)) + + "\nInventory:\n " + dmwand_Inventory(oMyTarget) + + "\n-------------------------------------------"; + + SendMessageToPC(oUser, sReport); + SendMessageToAllDMs(sReport); +} diff --git a/nwnds_module/dmfi_emote.uti b/nwnds_module/dmfi_emote.uti new file mode 100644 index 000000000..2281bd3f7 Binary files /dev/null and b/nwnds_module/dmfi_emote.uti differ diff --git a/nwnds_module/dmfi_en_ditto.uti b/nwnds_module/dmfi_en_ditto.uti new file mode 100644 index 000000000..e46bdd4bc Binary files /dev/null and b/nwnds_module/dmfi_en_ditto.uti differ diff --git a/nwnds_module/dmfi_encounte.uti b/nwnds_module/dmfi_encounte.uti new file mode 100644 index 000000000..e05bdc564 Binary files /dev/null and b/nwnds_module/dmfi_encounte.uti differ diff --git a/nwnds_module/dmfi_execute.ncs b/nwnds_module/dmfi_execute.ncs new file mode 100644 index 000000000..c203fe267 Binary files /dev/null and b/nwnds_module/dmfi_execute.ncs differ diff --git a/nwnds_module/dmfi_execute.nss b/nwnds_module/dmfi_execute.nss new file mode 100644 index 000000000..5e6dc26ea --- /dev/null +++ b/nwnds_module/dmfi_execute.nss @@ -0,0 +1,4193 @@ +//:://///////////////////////////////////////////// +//:: DMFI - Universal Wand executable +//:: dmfi_execute +//::////////////////////////////////////////////// +/* + Processing for all DMFI wands & widgets universal conversation choices. + + Credits: + Bioware - Dicebag + Arawen - Skill Check Wand (implemented with the Dicebag) + Jhenne (tallonzek@hotmail.com) \ Authors of the original FX Wand, + Doppleganger / DM Wand and Emote Wand + Demetrious - XP wand + Dezran (dezran@roguepenguin.com) - Rod of Affliction + Lurker - Music Wand + Oddbod - FX wand improvements + Ty Worsham (volition) - Sound Creator Beta + OldManWhistler - NPC corpse functions + + hahnsoo (hahns_shin@hotmail.com) - Final Improved FX wand, Universal wand scripts, + Encounter wand, DM Voice scripts, Faction wand, + Spirelands Resting system + J.R.R.Tolkien - References to the One Ring. +*/ +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2007.04.12 hahnsoo and Demetrious - version 1.08a +//:: 2007.12.12 Merle - fixes to DMFI rest system +//:: 2008.05.25 tsunami282 - updated for NWN 1.69 (DMFI OnPlayerChat event handling) +//:: 2008.05.26 tsunami282 - XP wand: grant percent XP based on each party member's level, not selected party member + +#include "dmfi_db_inc" +#include "dmfi_dmw_inc" +#include "x2_inc_toollib" +#include "dmfi_plychat_inc" +#include "dmfi_plchlishk_i" +#include "dmfi_getln_inc" + +int iNightMusic; +int iDayMusic; +int iBattleMusic; + +//////////////////////////////////////////////////////////////////////// +object DMFI_NextTarget(object oTarget, object oUser) +{ + object oNew; + + if (GetIsPC(oTarget)) + { + if (GetIsObjectValid(GetNextFactionMember(oTarget))) + oNew = GetNextFactionMember(oTarget); + else + oNew = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 1); + } + else + oNew = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, oTarget, 1); + + + if (!GetIsObjectValid(oNew)) + { + SendMessageToPC(oUser, "No valid target to transfer to."); + oNew = oTarget; + } + + SetLocalObject(oUser, "dmfi_univ_target", oNew); + SetCustomToken(20680, GetName(oNew)); + FloatingTextStringOnCreature("Target changed to: "+ GetName(oNew), oUser); + return oNew; +} + +//////////////////////////////////////////////////////////////////////// +//DMFI Creates the "settings" creature +void CreateSetting(object oUser) +{ + object oSetting = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_setting", GetLocation(oUser)); + DelayCommand(0.5f, AssignCommand(oSetting, ActionSpeakString(GetLocalString(oUser, "EffectSetting") + " is currently set at " + FloatToString(GetLocalFloat(oUser, GetLocalString(oUser, "EffectSetting")))))); + SetLocalObject(oSetting, "MyMaster", oUser); + SetListenPattern(oSetting, "**", LISTEN_PATTERN); //listen to all text + SetLocalInt(oSetting, "hls_Listening", 1); //listen to all text + SetListening(oSetting, TRUE); //be sure NPC is listening +} + +//////////////////////////////////////////////////////////////////////// +//DMFI Processes the dice rolls +void RollDemBones(object oUser, int iBroadcast, int iMod = 0, string sAbility = "", int iNum = 1, int iSide = 20) +{ + + string sString = ""; + int iRoll = 0; + int iTotal = 0; + //Build the string + sString = sAbility+"Roll " + IntToString(iNum) + "d" + IntToString(iSide) + ": "; + while (iNum > 1) + { + iRoll = Random(iSide) + 1; + iTotal = iTotal + iRoll; + sString = sString + IntToString(iRoll) + " + "; + iNum--; + } + iRoll = Random(iSide) + 1; + iTotal = iTotal + iRoll; + sString = sString + IntToString(iRoll); + if (iMod) + { + iTotal = iTotal + iMod; + sString = sString + " + Modifier: " + IntToString(iMod); + } + sString = sString + " = Total: " + IntToString(iTotal); + + //Perform appropriate animation + if (GetLocalInt(oUser, "dmfi_dice_no_animate")!=1) + { + switch (GetLocalInt(oUser, "dmfi_univ_int")) + { + case 71: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 5.0f)); break; + case 72: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 1.0)); break; + case 73: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_TAUNT, 1.0)); break; + case 74: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0)); break; + case 78: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 5.0f)); break; + case 81: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_CONJURE1, 1.0, 5.0f)); break; + case 82: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_DODGE_SIDE, 1.0)); break; + case 83: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_TAUNT, 1.0)); break; + case 84: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 5.0f)); break; + case 85: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 1.0)); break; + case 89: AssignCommand(oUser, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BARD_SONG), oUser, 6.0f)); break; + case 91: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 5.0f)); break; + case 95: AssignCommand(oUser, PlayAnimation(ANIMATION_LOOPING_CONJURE2, 1.0, 5.0f)); break; + case 97: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_TAUNT, 1.0)); break; + case 98: AssignCommand(oUser, PlayAnimation(ANIMATION_FIREFORGET_DODGE_DUCK, 1.0)); break; + default: AssignCommand(oUser, PlayAnimation (ANIMATION_LOOPING_GET_MID, 1.0, 3.0)); break; + } + } + + sString = ColorText(sString, "cyan"); + //-------------------------------------------------------- + switch (iBroadcast) + { + case 3: break; //dm only + case 1: AssignCommand(oUser, SpeakString(sString , TALKVOLUME_SHOUT)); break; + case 2: AssignCommand(oUser, SpeakString(sString)); break; + default: if (GetIsPC(oUser)) SendMessageToPC(oUser, sString);break; + } + //-------------------------------------------------------- + AssignCommand(oUser, SpeakString( sString, TALKVOLUME_SILENT_SHOUT)); + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI PC Dicebag +void DoDiceBagFunction(int iDice, object oUser, int iDMOverride = 0) +{ + string sAbility = ""; + int iTrain =0; + int iNum = 0; + int iSide = 0; + int iMod = 0; + int iLeft; + if (iDice < 100) + iLeft = StringToInt(GetStringLeft(IntToString(iDice), 1)); + else + iLeft = 10; + int iRight = StringToInt(GetStringRight(IntToString(iDice), 1)); + switch (iDice) + { + case 61: iNum = 1; iSide = 20; sAbility="Strength Check, "; iMod = GetAbilityModifier(ABILITY_STRENGTH, oUser); break; + case 62: iNum = 1; iSide = 20; sAbility="Dexterity Check, "; iMod = GetAbilityModifier(ABILITY_DEXTERITY, oUser); break; + case 63: iNum = 1; iSide = 20; sAbility="Constitution Check, "; iMod = GetAbilityModifier(ABILITY_CONSTITUTION, oUser); break; + case 64: iNum = 1; iSide = 20; sAbility="Intelligence Check, "; iMod = GetAbilityModifier(ABILITY_INTELLIGENCE, oUser); break; + case 65: iNum = 1; iSide = 20; sAbility="Wisdom Check, "; iMod = GetAbilityModifier(ABILITY_WISDOM, oUser); break; + case 66: iNum = 1; iSide = 20; sAbility="Charisma Check, "; iMod = GetAbilityModifier(ABILITY_CHARISMA, oUser); break; + case 67: iNum = 1; iSide = 20; sAbility="Fortitude Save, "; iMod = GetFortitudeSavingThrow(oUser); break; + case 68: iNum = 1; iSide = 20; sAbility="Reflex Save, "; iMod = GetReflexSavingThrow(oUser); break; + case 69: iNum = 1; iSide = 20; sAbility="Will Save, "; iMod = GetWillSavingThrow(oUser); break; + + case 71: iNum = 1; iSide = 20; iTrain = 1; sAbility="Animal Empathy Check, "; iMod = GetSkillRank(SKILL_ANIMAL_EMPATHY, oUser); break; + case 72: iNum = 1; iSide = 20; sAbility="Appraise Check, "; iMod = GetSkillRank(SKILL_APPRAISE, oUser); break; + case 73: iNum = 1; iSide = 20; sAbility="Bluff Check, "; iMod = GetSkillRank(SKILL_BLUFF, oUser); break; + case 74: iNum = 1; iSide = 20; sAbility="Concentration Check, "; iMod = GetSkillRank(SKILL_CONCENTRATION, oUser); break; + case 75: iNum = 1; iSide = 20; sAbility="Craft Armor Check, "; iMod = GetSkillRank(SKILL_CRAFT_ARMOR, oUser); break; + case 76: iNum = 1; iSide = 20; sAbility="Craft Trap Check, "; iMod = GetSkillRank(SKILL_CRAFT_TRAP, oUser); break; + case 77: iNum = 1; iSide = 20; sAbility="Craft Weapon Check, "; iMod = GetSkillRank(SKILL_CRAFT_WEAPON, oUser); break; + case 78: iNum = 1; iSide = 20; iTrain = 1; sAbility="Disable Trap Check, "; iMod = GetSkillRank(SKILL_DISABLE_TRAP, oUser); break; + case 79: iNum = 1; iSide = 20; sAbility="Discipline Check, "; iMod = GetSkillRank(SKILL_DISCIPLINE, oUser); break; + + case 81: iNum = 1; iSide = 20; sAbility="Heal Check, "; iMod = GetSkillRank(SKILL_HEAL, oUser); break; + case 82: iNum = 1; iSide = 20; sAbility="Hide Check, "; iMod = GetSkillRank(SKILL_HIDE, oUser); break; + case 83: iNum = 1; iSide = 20; sAbility="Intimidate Check, "; iMod = GetSkillRank(SKILL_INTIMIDATE, oUser); break; + case 84: iNum = 1; iSide = 20; sAbility="Listen Check, "; iMod = GetSkillRank(SKILL_LISTEN, oUser); break; + case 85: iNum = 1; iSide = 20; sAbility="Lore Check, "; iMod = GetSkillRank(SKILL_LORE, oUser); break; + case 86: iNum = 1; iSide = 20; sAbility="Move Silently Check, "; iMod = GetSkillRank(SKILL_MOVE_SILENTLY, oUser); break; + case 87: iNum = 1; iSide = 20; iTrain = 1; sAbility="Open Lock Check, "; iMod = GetSkillRank(SKILL_OPEN_LOCK, oUser); break; + case 88: iNum = 1; iSide = 20; sAbility="Parry Check, "; iMod = GetSkillRank(SKILL_PARRY, oUser); break; + case 89: iNum = 1; iSide = 20; sAbility="Perform Check, "; iMod = GetSkillRank(SKILL_PERFORM, oUser); break; + // 2008.07.30 morderon - added ride check + case 90: iNum = 1; iSide = 20; sAbility="Ride, "; iMod = GetSkillRank(SKILL_RIDE, oUser); break; + case 91: iNum = 1; iSide = 20; sAbility="Persuade Check, "; iMod = GetSkillRank(SKILL_PERSUADE, oUser); break; + case 92: iNum = 1; iSide = 20; iTrain = 1; sAbility="Pick Pocket Check, "; iMod = GetSkillRank(SKILL_PICK_POCKET, oUser); break; + case 93: iNum = 1; iSide = 20; sAbility="Search Check, "; iMod = GetSkillRank(SKILL_SEARCH, oUser); break; + case 94: iNum = 1; iSide = 20; iTrain = 1; sAbility="Set Trap Check, "; iMod = GetSkillRank(SKILL_SET_TRAP, oUser); break; + case 95: iNum = 1; iSide = 20; iTrain = 1; sAbility="Spellcraft Check, "; iMod = GetSkillRank(SKILL_SPELLCRAFT, oUser); break; + case 96: iNum = 1; iSide = 20; sAbility="Spot Check, "; iMod = GetSkillRank(SKILL_SPOT, oUser); break; + case 97: iNum = 1; iSide = 20; sAbility="Taunt Check, "; iMod = GetSkillRank(SKILL_TAUNT, oUser); break; + case 98: iNum = 1; iSide = 20; iTrain = 1; sAbility="Tumble Check, "; iMod = GetSkillRank(SKILL_TUMBLE, oUser); break; + case 99: iNum = 1; iSide = 20; iTrain = 1; sAbility="Use Magic Device Check, "; iMod = GetSkillRank(SKILL_USE_MAGIC_DEVICE, oUser); break; + + case 101: SetLocalInt(oUser, "dmfi_dicebag", 2); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 2, oUser); SetCustomToken(20681, "Local"); FloatingTextStringOnCreature("Broadcast Mode set to Local", oUser, FALSE); return; break; + case 102: SetLocalInt(oUser, "dmfi_dicebag", 1); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 1, oUser); SetCustomToken(20681, "Global"); FloatingTextStringOnCreature("Broadcast Mode set to Global", oUser, FALSE); return; break; + case 103: SetLocalInt(oUser, "dmfi_dicebag", 0); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 0, oUser); SetCustomToken(20681, "Private"); FloatingTextStringOnCreature("Broadcast Mode set to Private", oUser, FALSE); return; break; + default: iNum = iRight; + + switch (iLeft) + { + case 1: iSide = 4; break; + case 2: iSide = 6; break; + case 3: iSide = 8; break; + case 4: iSide = 10; break; + case 5: iSide = 20; break; + } + break; + } + if ((iTrain)&&(iMod==0)) + { + string sMsg = ColorText("No dice roll: Skill requires training", "red"); + SendMessageToPC(oUser, sMsg); + AssignCommand(oUser, SpeakString( sMsg, TALKVOLUME_SILENT_SHOUT)); + return; + } + + + int iTell = GetLocalInt(oUser, "dmfi_dicebag"); + + if (iDMOverride) + iTell = iDMOverride; + + RollDemBones(oUser, iTell, iMod, sAbility, iNum, iSide); +} + +//////////////////////////////////////////////////////////////////////// +//By OldManWhistler for the DMFI Control Wand +void DestroyAllItems() +{ + if (GetIsDead(OBJECT_SELF)) + { + object oItem = GetFirstItemInInventory(); + while (GetIsObjectValid(oItem)) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(); + } + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_ARMS))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_ARROWS))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_BELT))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_BOLTS))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_BOOTS))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_BULLETS))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CARMOUR))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CHEST))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CLOAK))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_B))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_L))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_R))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_HEAD))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_LEFTHAND))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_LEFTRING))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_NECK))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND))) + DestroyObject(oItem); + if (GetIsObjectValid(oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTRING))) + DestroyObject(oItem); + } +} + +//////////////////////////////////////////////////////////////////////// +// Function to destroy a target, by OldManWhistler, for the DMFI Control Wand +void DestroyCreature(object oTarget) +{ + AssignCommand(oTarget,SetIsDestroyable(TRUE,FALSE,FALSE)); + DestroyObject(oTarget); +} + +//////////////////////////////////////////////////////////////////////// +//DMFI NPC Control Wand +void DoControlFunction(int iFaction, object oUser) +{ + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + object oArea = GetArea(oUser); + object oChange; + float fAlignShift; + int nAlignShift; + int nReport; + int nMessage; + + object oAlignTarget = GetNearestObject(OBJECT_TYPE_CREATURE, oUser); + + fAlignShift = GetLocalFloat(oUser, "dmfi_reputation"); + + if (fAlignShift == 0.0f) + fAlignShift = 10.0f; + + + nAlignShift = FloatToInt(fAlignShift); + + switch (iFaction) + { + case 10: //Toggle the state of all the encounters in the area + if (GetLocalInt(oArea, "dmfi_encounter_inactive")) + { + oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_ENCOUNTER) + SetEncounterActive(TRUE, oChange); + oChange = GetNextObjectInArea(oArea); + } + FloatingTextStringOnCreature("Bioware encounters are active",oUser, FALSE); + SetLocalInt(oArea, "dmfi_encounter_inactive", FALSE); + } + else + { + oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_ENCOUNTER) + SetEncounterActive(FALSE, oChange); + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE) + { + if (GetIsEncounterCreature(oChange)) + DestroyObject(oChange); //Nuke any encounter creatures in the area + } + oChange = GetNextObjectInArea(oArea); + } + FloatingTextStringOnCreature("Bioware encounters deactivated",oUser, FALSE); + SetLocalInt(oArea, "dmfi_encounter_inactive", TRUE); + } + break; + case 11: ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE); break; + case 12: ChangeToStandardFaction(oTarget, STANDARD_FACTION_COMMONER); break; + case 13: ChangeToStandardFaction(oTarget, STANDARD_FACTION_DEFENDER); break; + case 14: ChangeToStandardFaction(oTarget, STANDARD_FACTION_MERCHANT); break; + case 15: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + ChangeToStandardFaction(oChange, STANDARD_FACTION_HOSTILE); + oChange = GetNextObjectInArea(oArea); + }break; + case 16: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + ChangeToStandardFaction(oChange, STANDARD_FACTION_COMMONER); + oChange = GetNextObjectInArea(oArea); + }break; + case 17: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + ChangeToStandardFaction(oChange, STANDARD_FACTION_DEFENDER); + oChange = GetNextObjectInArea(oArea); + }break; + case 18: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + ChangeToStandardFaction(oChange, STANDARD_FACTION_MERCHANT); + oChange = GetNextObjectInArea(oArea); + }break; + case 21: oChange = GetFirstPC(); + while (GetIsObjectValid(oChange)) + { + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 100, oChange); + oChange = GetNextPC(); + }break; + case 22: oChange = GetFirstPC(); + while (GetIsObjectValid(oChange)) + { + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 20, oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 91, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 50, oChange); + oChange = GetNextPC(); + }break; + case 23: oChange = GetFirstPC(); + while (GetIsObjectValid(oChange)) + { + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 0 , oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 0, oChange); + oChange = GetNextPC(); + }break; + case 24: oChange = GetFirstPC(); + while (GetIsObjectValid(oChange)) + { + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 100, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 100, oChange); + oChange = GetNextPC(); + }break; + case 25: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE) + { + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 0, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 0, oChange); + } + oChange = GetNextObjectInArea(oArea); + }break; + case 26: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE) + { + AssignCommand(oChange, ClearAllActions(TRUE)); + SetStandardFactionReputation(STANDARD_FACTION_HOSTILE, 50, oChange); + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oChange); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 50, oChange); + SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 50, oChange); + } + oChange = GetNextObjectInArea(oArea); + }break; + case 31: SetLocalObject(oUser, "dmfi_customfaction1", oTarget); nMessage = -1; break; + case 32: SetLocalObject(oUser, "dmfi_customfaction2", oTarget); nMessage = -1;break; + case 33: SetLocalObject(oUser, "dmfi_customfaction3", oTarget); nMessage = -1;break; + case 34: SetLocalObject(oUser, "dmfi_customfaction4", oTarget); nMessage = -1;break; + case 35: SetLocalObject(oUser, "dmfi_customfaction5", oTarget); nMessage = -1;break; + case 36: SetLocalObject(oUser, "dmfi_customfaction6", oTarget); nMessage = -1;break; + case 37: SetLocalObject(oUser, "dmfi_customfaction7", oTarget); nMessage = -1;break; + case 38: SetLocalObject(oUser, "dmfi_customfaction8", oTarget); nMessage = -1;break; + case 39: SetLocalObject(oUser, "dmfi_customfaction9", oTarget); nMessage = -1;break; + case 41: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction1")); nMessage = -1;break; + case 42: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction2")); nMessage = -1;break; + case 43: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction3")); nMessage = -1;break; + case 44: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction4")); nMessage = -1;break; + case 45: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction5")); nMessage = -1;break; + case 46: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction6")); nMessage = -1;break; + case 47: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction7")); nMessage = -1;break; + case 48: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction8")); nMessage = -1;break; + case 49: ChangeFaction(oTarget, GetLocalObject(oUser, "dmfi_customfaction9")); nMessage = -1;break; + case 51: RemoveHenchman(GetMaster(oTarget), oTarget); + SetLocalObject(oUser, "dmfi_henchman", oTarget); nMessage = -1;break; + case 52: RemoveHenchman(oTarget, GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oTarget)); + AddHenchman(oTarget, GetLocalObject(oUser, "dmfi_henchman")); nMessage = -1;break; + case 61: AssignCommand(oTarget, ClearAllActions()); AssignCommand(oTarget, ActionMoveAwayFromObject(oUser, TRUE)); nMessage = -1;break; + case 62: AssignCommand(oTarget, ClearAllActions()); AssignCommand(oTarget, ActionForceMoveToObject(oUser, TRUE, 2.0f, 30.0f)); nMessage = -1;break; + case 63: AssignCommand(oTarget, ClearAllActions()); AssignCommand(oTarget, ActionRandomWalk());nMessage = -1; break; + case 64: AssignCommand(oTarget, ClearAllActions()); AssignCommand(oTarget, ActionRest());nMessage = -1; break; + case 65: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + { + AssignCommand(oChange, ClearAllActions()); AssignCommand(oChange, ActionMoveAwayFromObject(oUser, TRUE)); + } + oChange = GetNextObjectInArea(oArea); + }nMessage = -1; break; + case 66: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + { + AssignCommand(oChange, ClearAllActions()); AssignCommand(oChange, ActionForceMoveToObject(oUser, TRUE, 2.0f, 30.0f)); + } + oChange = GetNextObjectInArea(oArea); + }nMessage = -1; break; + case 67: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + { + AssignCommand(oChange, ClearAllActions()); AssignCommand(oChange, ActionRandomWalk()); + } + oChange = GetNextObjectInArea(oArea); + }nMessage = -1; break; + case 68: oChange = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oChange)) + { + if (GetObjectType(oChange) == OBJECT_TYPE_CREATURE && !GetIsPC(oChange)) + { + AssignCommand(oChange, ClearAllActions()); AssignCommand(oChange, ActionRest()); + } + oChange = GetNextObjectInArea(oArea); + } nMessage = -1;break; + case 69: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDisappear(), oTarget); + DestroyObject(oTarget, 1.0); nMessage = -1;break; + case 70: DestroyCreature(oTarget); nMessage = -1;break; + case 71: AssignCommand(oTarget, SetIsDestroyable(FALSE, TRUE, TRUE)); nMessage = -1;break; + case 72: AssignCommand(oTarget, SetIsDestroyable(FALSE, FALSE, TRUE)); nMessage = -1;break; + case 73: AssignCommand(oTarget, SetIsDestroyable(FALSE, FALSE, FALSE));nMessage = -1; break; + case 74: AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE));nMessage = -1; break; + case 75: AssignCommand(oTarget, SetIsDestroyable(FALSE, TRUE, TRUE)); + DelayCommand(0.1, AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDeath(), oTarget))); nMessage = -1;break; + case 76: AssignCommand(oTarget, SetIsDestroyable(FALSE, FALSE, TRUE)); + DelayCommand(0.1, AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDeath(), oTarget))); nMessage = -1;break; + case 77: AssignCommand(oTarget, SetIsDestroyable(FALSE, FALSE, FALSE)); + DelayCommand(0.1, AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDeath(), oTarget))); nMessage = -1;break; + case 78: AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE)); + DelayCommand(0.1, AssignCommand(oTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDeath(), oTarget)));nMessage = -1; break; + case 79: AssignCommand(oTarget, DestroyAllItems()); + DelayCommand(1.0, DestroyCreature(oTarget));nMessage = -1;break; + case 81: //AdjustReputation(oAlignTarget, oTarget, nAlignShift); + AdjustReputation(oTarget, oAlignTarget, nAlignShift); + nReport = GetReputation(oAlignTarget, oTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oTarget) + " vs. " +GetName(oAlignTarget)+": " + IntToString(nReport), oUser); + nReport = GetReputation(oTarget, oAlignTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oAlignTarget) + " vs. " +GetName(oTarget)+": " + IntToString(nReport), oUser); + break; + case 82: //AdjustReputation(oAlignTarget, oTarget, -nAlignShift); + AdjustReputation(oTarget, oAlignTarget, -nAlignShift); + nReport = GetReputation(oAlignTarget, oTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oTarget) + " vs. " +GetName(oAlignTarget)+": " + IntToString(nReport), oUser); + nReport = GetReputation(oTarget, oAlignTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oAlignTarget) + " vs. " +GetName(oTarget)+": " + IntToString(nReport), oUser); + break; + case 83: SetLocalString(oUser, "EffectSetting", "dmfi_reputation"); + CreateSetting(oUser);nMessage = -1; break; + case 84: nReport = GetReputation(oAlignTarget, oTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oTarget) + " vs. " +GetName(oAlignTarget)+": " + IntToString(nReport), oUser); + nReport = GetReputation(oTarget, oAlignTarget); + FloatingTextStringOnCreature("Current Reputation: "+ GetName(oAlignTarget) + " vs. " +GetName(oTarget)+": " + IntToString(nReport), oUser); + nMessage = -1;break; + case 9: { + if (GetLocalInt(GetModule(), "dmfi_safe_factions")!=1) + { + SetLocalInt(GetModule(), "dmfi_safe_factions", 1); + SetDMFIPersistentInt("dmfi", "dmfi_safe_factions", 1, oUser); + FloatingTextStringOnCreature("Default non-hostile faction should ignore PC attacks",oUser, FALSE); + } + else + { + SetLocalInt(GetModule(), "dmfi_safe_factions", 0); + SetDMFIPersistentInt("dmfi", "dmfi_safe_factions", 0, oUser); + FloatingTextStringOnCreature("Bioware faction behavior restored",oUser, FALSE); + } + } + + default: nMessage = -1;break; + + } + + if (nMessage!=-1) + { + if (GetIsImmune(oTarget, IMMUNITY_TYPE_BLINDNESS)) + FloatingTextStringOnCreature("Targeted creature is blind immune - no attack will occur until new perception event is fired", oUser); + else + { + effect eInvis =EffectBlindness(); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oTarget, 6.1); + FloatingTextStringOnCreature("Faction Adjusted - Perception event will fire in 6 seconds", oUser); + } + } + +} + +//////////////////////////////////////////////////////////////////////// +void IdenStuff(object oTarget) +{ + object oItem = GetFirstItemInInventory(oTarget); + while (GetIsObjectValid(oItem)) + { + if (GetIdentified(oItem)==FALSE) + SetIdentified(oItem, TRUE); + + oItem = GetNextItemInInventory(oTarget); + } +} + +//////////////////////////////////////////////////////////////////////// +void TakeStuff(int Level, object oTarget, object oUser) +{ + object oItem = GetFirstItemInInventory(oTarget); + while (GetIsObjectValid(oItem)) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(oTarget); + } + + if (Level == 1) + { + DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CARMOUR,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget)); + DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oTarget)); + } + FloatingTextStringOnCreature("DM Intervention: Inventory Destroyed by DM", oTarget); +} + +//////////////////////////////////////////////////////////////////////// +void TakeUber(object oTarget) +{ + int nMultiplier; + if (GetHitDice(oTarget)<11) + nMultiplier = 1; + else if (GetHitDice(oTarget)<16) + nMultiplier = 2; + else if (GetHitDice(oTarget)<20) + nMultiplier = 3; + else + nMultiplier = 5; + object oItem = GetFirstItemInInventory(oTarget); + while (GetIsObjectValid(oItem)) + { + if (GetGoldPieceValue(oItem)>1000*nMultiplier*GetHitDice(oTarget)) + DestroyObject(oItem); + oItem = GetNextItemInInventory(oTarget); + } + FloatingTextStringOnCreature("DM Intervention: Uber type items have been removed", oTarget); +} + +//////////////////////////////////////////////////////////////////////// +void RotateMe(object oTarget, int Amount, object oUser) +{ + location lLocation = GetLocation (oTarget); + if (GetObjectType(oTarget) != OBJECT_TYPE_PLACEABLE) + { + oTarget = GetNearestObject(OBJECT_TYPE_PLACEABLE, oUser); + FloatingTextStringOnCreature("Target was not a placable, used placeable closest to your avitar", oUser); + } + if (Amount == -2) + { + AssignCommand(oTarget, SetFacing(90.0)); + return; + } + if (Amount == -1) + { + AssignCommand(oTarget, SetFacing(0.0)); + return; + } + if (GetIsObjectValid(oTarget)) + AssignCommand(oTarget, SetFacing(GetFacing(oTarget)+Amount)); +} + +//////////////////////////////////////////////////////////////////////// +void DMFI_Object (object oTarget, int Action, object oUser) +{ + location lLocation = GetLocation (oTarget); + if (GetObjectType(oTarget) != OBJECT_TYPE_PLACEABLE) + { + oTarget = GetNearestObject(OBJECT_TYPE_PLACEABLE, oUser); + FloatingTextStringOnCreature("Target was not a placable, used placeable closest to your avitar", oUser); + } + if (GetIsObjectValid(oTarget)) + { + if (Action==1) + { + DestroyObject(oTarget); + DelayCommand(2.0, FloatingTextStringOnCreature(GetName(oTarget) + "destroyed. If 'static', you must leave and return to see effect.", oUser)); + } + else if (Action ==2) + { + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); + DelayCommand(0.4,SetPlaceableIllumination(oTarget, FALSE)); + DelayCommand(0.5,RecomputeStaticLighting(GetArea(oTarget))); + } + else if (Action ==3) + { + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + DelayCommand(0.4,SetPlaceableIllumination(oTarget, TRUE)); + DelayCommand(0.5,RecomputeStaticLighting(GetArea(oTarget))); + } + } +} + +//////////////////////////////////////////////////////////////////////// +void dmwand_SwapDayNight(int nDay) +{ + int nCurrentHour; + int nCurrentMinute = GetTimeMinute(); + int nCurrentSecond = GetTimeSecond(); + int nCurrentMilli = GetTimeMillisecond(); + + nCurrentHour = ((nDay == 1)?7:19); + + SetTime(nCurrentHour, nCurrentMinute, nCurrentSecond, nCurrentMilli); +} + +//////////////////////////////////////////////////////////////////////// +void dmwand_AdvanceTime(int nHours) +{ + int nCurrentHour = GetTimeHour(); + int nCurrentMinute = GetTimeMinute(); + int nCurrentSecond = GetTimeSecond(); + int nCurrentMilli = GetTimeMillisecond(); + + nCurrentHour += nHours; + SetTime(nCurrentHour, nCurrentMinute, nCurrentSecond, nCurrentMilli); +} + +//////////////////////////////////////////////////////////////////////// +void DMFI_Align(object oUser, object oTarget, int nAlign, int nParty) +{ + if (GetObjectType(oTarget)== OBJECT_TYPE_CREATURE) + { + int nAmount = GetLocalInt(oUser, "dmfi_alignshift"); + + if (nParty) + { + object oParty = GetFirstFactionMember(oTarget, TRUE); + while (GetIsObjectValid(oParty)) + { + AdjustAlignment(oParty, nAlign, nAmount); + oParty = GetNextFactionMember(oTarget, TRUE); + } + FloatingTextStringOnCreature("Party Alignment shifted by " + IntToString(nAmount), oUser); + } + else + { + AdjustAlignment(oTarget, nAlign, nAmount); + FloatingTextStringOnCreature("Target Alignment shifted by " + IntToString(nAmount), oUser); + } + } + else + FloatingTextStringOnCreature("Must target a creature for this action", oUser); + +} + +//////////////////////////////////////////////////////////////////////// +void DMFI_Roll(object oUser) +{ + object oStoreState = GetItemPossessedBy(oUser, "dmfi_dmw"); + int n = GetLocalInt(oUser, "dmfi_alignshift"); + if (n == 1) + n = 2; + else if (n ==2) + n = 5; + else if (n ==5) + n = 10; + else if (n == 10) + n = 1; + FloatingTextStringOnCreature("Adjustment changed to " + IntToString(n), oUser); + SetLocalInt(oUser, "dmfi_alignshift", n); + SetCustomToken(20781, IntToString(n)); + SetDMFIPersistentInt("dmfi", "dmfi_alignshift", n, oUser); +} + + +//////////////////////////////////////////////////////////////////////// +int GetAreaXAxis(object oArea) +{ + + location locTile; + int iX = 0; + int iY = 0; + vector vTile = Vector(0.0, 0.0, 0.0); + + for (iX = 0; iX < 32; ++iX) + { + vTile.x = IntToFloat(iX); + locTile = Location(oArea, vTile, 0.0); + int iRes = GetTileMainLight1Color(locTile); + if (iRes > 32 || iRes < 0) + return(iX); + } + + return 32; +} + +//////////////////////////////////////////////////////////////////////// +int GetAreaYAxis(object oArea) +{ + location locTile; + int iX = 0; + int iY = 0; + vector vTile = Vector(0.0, 0.0, 0.0); + + for (iY = 0; iY < 32; ++iY) + { + vTile.y = IntToFloat(iY); + locTile = Location(oArea, vTile, 0.0); + int iRes = GetTileMainLight1Color(locTile); + if (iRes > 32 || iRes < 0) + return(iY); + } + + return 32; +} + +//////////////////////////////////////////////////////////////////////// +void TilesetMagic(object oUser, int nEffect, int nType) +{ + int iXAxis = GetAreaXAxis(GetArea(oUser)); + int iYAxis = GetAreaYAxis(GetArea(oUser)); + int nBase = GetLocalInt(GetModule(), "dmfi_tileset"); + +// nType definitions: +// 0 fill +// 1 flood +// 2 groundcover + +// nBase definitions: +// 0 default +// 1 Sewer and City - raise the fill effect to -0.1 + + + float ZEffectAdjust = 0.0; + float ZTypeAdjust = 0.1; //default is groundcover + float ZTileAdjust = 0.0; + float ZFinalAxis; + +/* +if (nEffect == X2_TL_GROUNDTILE_ICE) + ZEffectAdjust = -1.0; // lower the effect based on trial and error +*/ + if (nEffect == X2_TL_GROUNDTILE_SEWER_WATER) + ZEffectAdjust = 0.8; + +//now sep based on nType + if (nType == 0) //fill + ZTypeAdjust=-2.0; + else if (nType ==1) + ZTypeAdjust = 2.0; + + ZFinalAxis = ZEffectAdjust + ZTypeAdjust + ZTileAdjust; + +//special case for filling of water and sewer regions + if ((nBase==1) && (nType==0)) + ZFinalAxis = -0.1; + + TLResetAreaGroundTiles(GetArea(oUser), iXAxis, iYAxis); + TLChangeAreaGroundTiles(GetArea(oUser), nEffect , iXAxis, iYAxis, ZFinalAxis); +} + +//////////////////////////////////////////////////////////////////////// +//New DM Wand by Demetrious +void DoNewDMThingy(int iChoice, object oUser) +{ + location lLocation = GetLocalLocation(oUser, "dmfi_univ_location"); + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + int iXAxis = GetAreaXAxis(GetArea(oUser)); + int iYAxis = GetAreaYAxis(GetArea(oUser)); + object oCopy; object oParty; + int n; string sName; + + switch (iChoice) + { + case 11: TakeStuff(1, oTarget, oUser); break; + case 12: TakeStuff(0, oTarget, oUser); break; + case 13: IdenStuff(oTarget); break; + case 14: TakeUber(oTarget); break; + case 15: DMFI_NextTarget(oTarget, oUser);break; + case 20: DMFI_NextTarget(oTarget, oUser);break; + case 21: DMFI_Align(oUser, oTarget, ALIGNMENT_GOOD, 0);break; + case 22: DMFI_Align(oUser, oTarget, ALIGNMENT_EVIL, 0);break; + case 23: DMFI_Align(oUser, oTarget, ALIGNMENT_LAWFUL, 0);break; + case 24: DMFI_Align(oUser, oTarget, ALIGNMENT_CHAOTIC, 0);break; + case 25: DMFI_Align(oUser, oTarget, ALIGNMENT_GOOD, 1);break; + case 26: DMFI_Align(oUser, oTarget, ALIGNMENT_EVIL, 1);break; + case 27: DMFI_Align(oUser, oTarget, ALIGNMENT_LAWFUL, 1);break; + case 28: DMFI_Align(oUser, oTarget, ALIGNMENT_CHAOTIC, 1);break; + case 29: DMFI_Roll(oUser); break; + case 31: SendMessageToPC(oUser, "Item name: "+GetName(oTarget)); + SendMessageToPC(oUser, "Item value: "+IntToString(GetGoldPieceValue(oTarget))); + if (GetDroppableFlag(oTarget)) SendMessageToPC(oUser, "Droppable"); + else SendMessageToPC(oUser, "Not droppable"); + if (GetItemCursedFlag(oTarget)) SendMessageToPC(oUser, "Cursed"); + else SendMessageToPC(oUser, "Not cursed"); + if (GetPlotFlag(oTarget)) SendMessageToPC(oUser, "Plot related"); + else SendMessageToPC(oUser, "Not plot related"); + if (GetStolenFlag(oTarget)) SendMessageToPC(oUser, "Stolen"); + else SendMessageToPC(oUser, "Not stolen"); + SendMessageToPC(oUser, "Charges remaining: " + IntToString(GetItemCharges(oTarget))); + break; + + case 32: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + SetPlotFlag(oTarget, FALSE); DestroyObject(oTarget); + FloatingTextStringOnCreature(GetName(oTarget)+": Item destroyed", oUser); + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + case 33: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + SetItemCharges(oTarget, 0); + FloatingTextStringOnCreature( GetName(oTarget)+": Remaining charges removed", oUser); + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + + + case 34: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + SetItemCharges(oTarget, 999); + FloatingTextStringOnCreature( GetName(oTarget)+": Item fully recharged",oUser); break; + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + + case 35: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + if (GetDroppableFlag(oTarget)) + { + SetDroppableFlag(oTarget, FALSE); + FloatingTextStringOnCreature(GetName(oTarget)+": can NOT be dropped", oUser); + } + else + { + SetDroppableFlag(oTarget, TRUE); + FloatingTextStringOnCreature( GetName(oTarget)+": can be dropped", oUser); + } + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + + case 36: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + if (GetItemCursedFlag(oTarget)) + { + SetItemCursedFlag(oTarget, FALSE); + FloatingTextStringOnCreature(GetName(oTarget)+": NOT cursed", oUser); + } + else + { + SetItemCursedFlag(oTarget, TRUE); + FloatingTextStringOnCreature( GetName(oTarget)+": set to CURSED", oUser); + } + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + + case 37: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + if (GetPlotFlag(oTarget)) + { + SetPlotFlag(oTarget, FALSE); + FloatingTextStringOnCreature(GetName(oTarget)+": NOT plot related", oUser); + } + else + { + SetPlotFlag(oTarget, TRUE); + FloatingTextStringOnCreature( GetName(oTarget)+": set to PLOT", oUser); + } + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + case 38: if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + if (GetStolenFlag(oTarget)) + { + SetStolenFlag(oTarget, FALSE); + FloatingTextStringOnCreature(GetName(oTarget)+": NOT stolen", oUser); + } + else + { + SetStolenFlag(oTarget, TRUE); + FloatingTextStringOnCreature( GetName(oTarget)+": set to Stolen", oUser); + } + } + else + { + FloatingTextStringOnCreature("Invalid target. Target item directly from inventory screen", oUser); + } + break; + + + case 41: DMFI_Object(oTarget, 1, oUser); break; + case 42: DMFI_Object(oTarget, 2, oUser);break; + case 43: DMFI_Object(oTarget, 3, oUser); break; + case 45: RotateMe(oTarget, -2, oUser);break; + case 46: RotateMe(oTarget, -1, oUser);break; + case 47: RotateMe(oTarget, 30, oUser);break; + case 48: RotateMe(oTarget, 45, oUser);break; + case 49: RotateMe(oTarget, 90, oUser);break; + case 40: RotateMe(oTarget, 180, oUser);break; + case 51: dmwand_AdvanceTime(1);break; + case 52: dmwand_AdvanceTime(4);break; + case 53: dmwand_AdvanceTime(8);break; + case 54: dmwand_AdvanceTime(24);break; + case 55: dmwand_SwapDayNight(0);break; + case 50: dmwand_SwapDayNight(1);break; + case 56: SetWeather(GetArea(oUser), WEATHER_CLEAR); break; + case 57: SetWeather(GetArea(oUser), WEATHER_RAIN); break; + case 58: SetWeather(GetArea(oUser), WEATHER_SNOW); break; + case 59: SetWeather(GetArea(oUser), WEATHER_USE_AREA_SETTINGS); break; + case 60: DMFI_report(oTarget, oUser); break; + case 61: DMFI_toad(oTarget, oUser); break; + case 62: DMFI_jail(oTarget, oUser); break; + case 63: AssignCommand(oUser, AddToParty( oUser, GetFactionLeader(oTarget)));break; + case 64: RemoveFromParty(oUser);break; + case 65: ExploreAreaForPlayer(GetArea(oTarget), oTarget); FloatingTextStringOnCreature("Map Given: Target", oUser);break; + case 66: { + FloatingTextStringOnCreature("Map Given: Party", oUser); + object oParty = GetFirstFactionMember(oTarget,TRUE); + while (GetIsObjectValid(oParty)) + { + ExploreAreaForPlayer(GetArea(oTarget), oTarget); + oParty = GetNextFactionMember(oTarget,TRUE); + } + break; + } + case 67: ExportAllCharacters();break; + case 68: dmwand_KickPC(oTarget, oUser);break; + case 69: sName = GetModuleName(); + StartNewModule(sName);break; + case 71: TilesetMagic(oUser, X2_TL_GROUNDTILE_WATER, 0);break; + case 72: TilesetMagic(oUser, X2_TL_GROUNDTILE_ICE, 0);break; + case 73: TilesetMagic(oUser, X2_TL_GROUNDTILE_LAVA, 0) ;break; + case 74: TilesetMagic(oUser, X2_TL_GROUNDTILE_SEWER_WATER, 0);break; + case 75: TilesetMagic(oUser, X2_TL_GROUNDTILE_WATER, 1);break; + case 76: TilesetMagic(oUser, X2_TL_GROUNDTILE_ICE, 1);break; + case 77: TilesetMagic(oUser, X2_TL_GROUNDTILE_LAVA, 1) ;break; + case 78: TilesetMagic(oUser, X2_TL_GROUNDTILE_SEWER_WATER, 1);break; + case 79: TLResetAreaGroundTiles(GetArea(oUser), iXAxis, iYAxis); break; + case 81: TilesetMagic(oUser, X2_TL_GROUNDTILE_ICE, 2);break; + case 82: TilesetMagic(oUser, X2_TL_GROUNDTILE_GRASS, 2);break; + case 83: TilesetMagic(oUser, X2_TL_GROUNDTILE_CAVEFLOOR, 2) ;break; + case 89: TLResetAreaGroundTiles(GetArea(oUser), iXAxis, iYAxis); break; + case 91: StoreCampaignObject("dmfi", "dmfi_copyplayer1", oTarget); + FloatingTextStringOnCreature("Target stored", oUser);break; + case 92: oParty = GetFirstFactionMember(oTarget, TRUE); + n=1; + while (GetIsObjectValid(oParty)) + { + StoreCampaignObject("dmfi", "dmfi_copyplayer"+IntToString(n), oParty); + SendMessageToPC(oUser, GetName(oParty) + " stored"); + n=n+1; + oParty = GetNextFactionMember(oTarget, TRUE); + } + FloatingTextStringOnCreature("Party stored", oUser); + break; + + case 93:n=1; + oCopy = RetrieveCampaignObject("dmfi", "dmfi_copyplayer"+IntToString(n), lLocation); + while (GetIsObjectValid(oCopy)) + { + ChangeToStandardFaction(oCopy, STANDARD_FACTION_COMMONER); + + n=n+1; + oCopy = RetrieveCampaignObject("dmfi", "dmfi_copyplayer"+IntToString(n), lLocation); + AssignCommand(oCopy, SetIsDestroyable(FALSE, TRUE, TRUE)); + } + break; + case 101: SetLocalInt(GetModule(), "dmfi_tileset" , 0); break; + case 102: SetLocalInt(GetModule(), "dmfi_tileset" , 1); break; //sewer/city + + default: break; + } + +} + +//////////////////////////////////////////////////////////////////////// +//This is for the DMFI Dicebag Wand +void DoDMDiceBagFunction(int iDice, object oUser) +{ + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + if (!GetIsObjectValid(oTarget)) + oTarget = oUser; + int iOverride = GetLocalInt(oUser, "dmfi_dicebag"); + object oArea = GetArea(oUser); + object oRoll; + int iLeft; + if (iDice < 100) + iLeft = StringToInt(GetStringLeft(IntToString(iDice), 1)); + else + iLeft = 10; + switch (iLeft) + { + case 1: + case 2: + case 3: + case 4: //Single Creature Roll + DoDiceBagFunction(iDice+50, oTarget, iOverride); break; + case 5: + case 6: + case 7: + case 8://All PCs/NPCs in the area + oRoll = GetFirstObjectInArea(oArea); + while (GetIsObjectValid(oRoll)) + { + if ((GetIsPC(oTarget) && GetIsPC(oRoll)) || (!GetIsPC(oTarget) && !GetIsPC(oRoll) && GetObjectType(oRoll) == OBJECT_TYPE_CREATURE)) + DoDiceBagFunction(iDice+10, oRoll, iOverride); + oRoll = GetNextObjectInArea(oArea); + } + break; + case 10: { + switch (iDice) + { + case 101: SetLocalInt(oUser, "dmfi_dicebag", 2); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 2, oUser); SetCustomToken(20681, "Local"); FloatingTextStringOnCreature("Broadcast Mode set to Local", oUser, FALSE); return; break; + case 102: SetLocalInt(oUser, "dmfi_dicebag", 1); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 1, oUser); SetCustomToken(20681, "Global"); FloatingTextStringOnCreature("Broadcast Mode set to Global", oUser, FALSE); return; break; + case 103: SetLocalInt(oUser, "dmfi_dicebag", 0); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 0, oUser); SetCustomToken(20681, "Private"); FloatingTextStringOnCreature("Broadcast Mode set to Private", oUser, FALSE); return; break; + case 104: SetLocalInt(oUser, "dmfi_dicebag", 3); SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 3, oUser); SetCustomToken(20681, "DM Only"); FloatingTextStringOnCreature("Broadcast Mode set to DM Only", oUser, FALSE); return; break; + case 105: DMFI_NextTarget(oTarget, oUser);break; + case 106: { + if (GetLocalInt(oUser, "dmfi_dice_no_animate")==1) + { + SetLocalInt(oUser, "dmfi_dice_no_animate", 0); + FloatingTextStringOnCreature("Rolls will show animation", oUser); + } + else + { + SetLocalInt(oUser, "dmfi_dice_no_animate", 1); + FloatingTextStringOnCreature("Rolls will NOT show animation", oUser); + } + } + } + } + default: break; + +/* +Demetrious - Saving code for all pcs in case I find a way to put it back into the dicebag. + + //All PCs + oRoll = GetFirstPC(); + while (GetIsObjectValid(oRoll)) + { + DoDiceBagFunction(iDice, oRoll, iOverride); + oRoll = GetNextPC(); + }break; +*/ + + + } +} + +//////////////////////////////////////////////////////////////////////// +void DoOneRingFunction(int iRing, object oUser) +{ + switch (iRing) + { + case 1: SetLocalString(oUser, "dmfi_univ_conv", "afflict"); break; + case 2: SetLocalString(oUser, "dmfi_univ_conv", "faction"); break; + case 3: SetLocalString(oUser, "dmfi_univ_conv", "dicebag"); break; + case 4: SetLocalString(oUser, "dmfi_univ_conv", "dmw"); break; + case 5: SetLocalString(oUser, "dmfi_univ_conv", "emote"); break; + case 6: SetLocalString(oUser, "dmfi_univ_conv", "encounter"); break; + case 7: SetLocalString(oUser, "dmfi_univ_conv", "fx"); break; + case 8: SetLocalString(oUser, "dmfi_univ_conv", "music"); break; + case 91: SetLocalString(oUser, "dmfi_univ_conv", "sound"); break; + case 92: SetLocalString(oUser, "dmfi_univ_conv", "voice"); break; + case 93: SetLocalString(oUser, "dmfi_univ_conv", "xp"); break; + case 94: SetLocalString(oUser, "dmfi_univ_conv", "buff");break; + default: SetLocalString(oUser, "dmfi_univ_conv", "dmw"); break; + } + AssignCommand(oUser, ClearAllActions()); + AssignCommand(oUser, ActionStartConversation(OBJECT_SELF, "dmfi_universal", TRUE)); +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI Sound FX Wand +void DoSoundFunction(int iSound, object oUser) +{ + + location lLocation = GetLocalLocation(oUser, "dmfi_univ_location"); + float fDuration; + float fDelay; + object oTarget; + + if (GetIsDMPossessed(oUser)) + { + fDuration = GetLocalFloat(GetMaster(oUser), "dmfi_effectduration"); + fDelay = GetLocalFloat(GetMaster(oUser), "dmfi_sound_delay"); + } + else + { + fDuration = GetLocalFloat(oUser, "dmfi_effectduration"); + fDelay = GetLocalFloat(oUser, "dmfi_sound_delay"); + } + + switch (iSound) + { + case 11: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_batsflap1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 12: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_bugsscary1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 13: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_crptvoice1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 14: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_orcgrunt1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 15: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_minepick2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 16: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_ratssqeak1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 17: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_rockfallg1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 18: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_rockfalgl2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 19: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_wt_gustcavrn1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 21: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_belltower3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 22: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_claybreak3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 23: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_glasbreak2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 24: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_gongring3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 25: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_marketgrp4"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 26: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_cv_millwheel1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 27: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_sawing1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 28: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_cv_bellwind1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 29: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_cv_smithhamr2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 31: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_firelarge1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 32: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_lavapillr1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 33: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_lavafire1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 34: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_firelarge2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 35: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_surf2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 36: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_drips1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 37: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_waterlap1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 38: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_stream4"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 39: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_na_waterfall2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 41: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_crynight3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 42: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_bushmove1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 43: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_birdsflap2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 44: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_grassmove3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 45: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_hawk1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 46: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_na_leafmove3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 47: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_gulls2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 48: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_songbirds1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 49: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_an_toads1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 51: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_beaker1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 52: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_cauldron1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 53: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_chntmagic1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 54: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_crystalev1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 55: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_crystalic1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 56: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("al_mg_portal1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 57: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_mg_telepin1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 58: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_mg_telepout1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 59: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_mg_frstmagic1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 61: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_tavclap1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 62: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_battlegrp7"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 63: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_laughincf2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 64: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_comtntgrp3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 65: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_chantingm2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 66: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_cryingf2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 67: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_laughingf3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 68: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_chantingf2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 69: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_wailingm6"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 71: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_evilchantm"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 72: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_crows2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 73: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_wailingcf1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 74: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_crptvoice2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 75: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_lafspook2"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 76: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_owlhoot1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 77: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_an_wolfhowl1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 78: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_screamf3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 79: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_pl_zombiem3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 81: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_wt_gustsoft1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 82: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_wt_thundercl3"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 83: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_wt_thunderds4"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + case 84: oTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); DelayCommand(fDelay, AssignCommand(oTarget, PlaySound("as_wt_gusforst1"))); DelayCommand(20.0f, DestroyObject(oTarget)); break; + + //Settings + case 91: + SetLocalString(oUser, "EffectSetting", "dmfi_effectduration"); + CreateSetting(oUser); + break; + case 92: + SetLocalString(oUser, "EffectSetting", "dmfi_sound_delay"); + CreateSetting(oUser); + break; + case 93: + SetLocalString(oUser, "EffectSetting", "dmfi_beamduration"); + CreateSetting(oUser); + break; + case 94: //Change Day Music + iDayMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iDayMusic > 33) iDayMusic = 49; + if (iDayMusic > 55) iDayMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeDay(GetArea(oUser), iDayMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 95: //Change Night Music + iNightMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iNightMusic > 33) iNightMusic = 49; + if (iNightMusic > 55) iNightMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeNight(GetArea(oUser), iNightMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 96: //Play Background Music + MusicBackgroundPlay(GetArea(oUser)); + break; + case 97: //Stop Background Music + MusicBackgroundStop(GetArea(oUser)); + break; + case 98: //Change and Play Battle Music + iBattleMusic = MusicBackgroundGetBattleTrack(GetArea(oUser)) + 1; + if (iBattleMusic < 34 || iBattleMusic > 48) iBattleMusic = 34; + MusicBattleStop(GetArea(oUser)); + MusicBattleChange(GetArea(oUser), iBattleMusic); + MusicBattlePlay(GetArea(oUser)); + break; + case 99: //Stop Battle Music + MusicBattleStop(GetArea(oUser)); + break; + + default: break; + } + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI DM Voice +void DoVoiceFunction(int iSay, object oUser) +{ + object oMod = GetModule(); + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oUser, "dmfi_univ_location"); + object oVoice; + string sSay; + + // Invalid target code - Loiter mode + if (!GetIsObjectValid(oTarget)) + { + switch (iSay) + { + case 8: + // // XXXX DM Spy Functionality - Currently BROKEN + // SetDMFIPersistentInt("dmfi", "dmfi_DMSpy", abs(GetDMFIPersistentInt("dmfi", "dmfi_DMSpy", oUser) - 1), oUser); + // if (GetDMFIPersistentInt("dmfi", "dmfi_DMSpy", oUser) == 1) + // FloatingTextStringOnCreature("DM Spy is on.", oUser, FALSE); + // else + // FloatingTextStringOnCreature("DM Spy is off.", oUser, FALSE); + // break; + + // v1.09 - eavesdrop at location + { + int hooknum = GetLocalInt(oUser, "dmfi_MyListenerHook"); + if (hooknum != 0) RemoveListenerHook(hooknum); + int hookparty = GetLocalInt(oUser, "dmfi_MyListenerPartyMode"); + int hookbcast = GetLocalInt(oUser, "dmfi_MyListenerBcastMode"); + hooknum = AppendListenerHook(2, OBJECT_INVALID, lLocation, + DMFI_CHANNELMASK_TALK|DMFI_CHANNELMASK_WHISPER, + hookparty, hookbcast, oUser); + if (hooknum != 0) + { + // move ditto voice to this location (destroying any existing one) + if (GetIsObjectValid(GetLocalObject(oUser, "dmfi_MyVoice"))) + { + DestroyObject(GetLocalObject(oUser, "dmfi_MyVoice")); + DeleteLocalObject(oUser, "dmfi_MyVoice"); + FloatingTextStringOnCreature("You have destroyed your previous Voice", oUser, FALSE); + } + oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + //Sets the Voice as the object to throw to. + SetLocalObject(oUser, "dmfi_VoiceTarget", oVoice); + //Set Ownership of the Voice to the User + SetLocalObject(oUser, "dmfi_MyVoice", oVoice); + DelayCommand(1.0f, FloatingTextStringOnCreature("The Voice is operational", oUser, FALSE)); + } + else + { + SendMessageToPC(oUser, "ERROR: could not append listener hook!"); + } + SetLocalInt(oUser, "dmfi_MyListenerHook", hooknum); + } + break; + + // case 9: //Destroy any existing Voice attached to the user + // if (GetIsObjectValid(GetLocalObject(oUser, "dmfi_MyVoice"))) + // { + // DestroyObject(GetLocalObject(oUser, "dmfi_MyVoice")); + // DeleteLocalObject(oUser, "dmfi_MyVoice"); + // FloatingTextStringOnCreature("You have destroyed your previous Voice", oUser, FALSE); + // } + // //Create the Voice + // oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + // //Sets the Voice as the object to throw to. + // SetLocalObject(oUser, "dmfi_VoiceTarget", oVoice); + // //Set Ownership of the Voice to the User + // SetLocalObject(oUser, "dmfi_MyVoice", oVoice); + // DelayCommand(1.0f, FloatingTextStringOnCreature("The Voice is operational", oUser, FALSE)); + // break; + + case 9: + // v1.09 - Toggle location range eavesdropping + { + int partylisten = GetLocalInt(oUser, "dmfi_MyListenerPartyMode"); + partylisten++; + if (partylisten > 2) partylisten = 0; + SetLocalInt(oUser, "dmfi_MyListenerPartyMode", partylisten); + string sRange; + if (partylisten == 0) sRange = "EARSHOT"; + else if (partylisten == 1) sRange = "AREA"; + else sRange = "MODULE"; + DelayCommand(1.0f, FloatingTextStringOnCreature("Location eavesdrop mode for new eavesdroppers set to " + sRange, oUser, FALSE)); + } + break; + + // Create a Loiter Voice + default: + oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + SetLocalInt(oVoice, "dmfi_Loiter", 1); + SetLocalString(oVoice, "dmfi_LoiterSay", GetDMFIPersistentString("dmfi", "hls206" + IntToString(iSay))); + break; + } + } + + // You targetted yourself = Record Mode + else if (oTarget == oUser) + { + switch (iSay) + { + // Toggle the mute / unmute NPC function + case 8: SetDMFIPersistentInt("dmfi", "dmfi_AllMute", abs(GetDMFIPersistentInt("dmfi", "dmfi_AllMute") - 1)); + if (GetDMFIPersistentInt("dmfi", "dmfi_AllMute") == 1) + FloatingTextStringOnCreature("All NPC conversations are muted", oUser, FALSE); + else + FloatingTextStringOnCreature("All NPC conversations are unmuted", oUser, FALSE); + break; + + // // XXXX Create a Ditto Voice - Duplicate functionality + // case 9: //Destroy any existing Voice attached to the user + // if (GetIsObjectValid(GetLocalObject(oUser, "dmfi_MyVoice"))) + // { + // DestroyObject(GetLocalObject(oUser, "dmfi_MyVoice")); + // DeleteLocalObject(oUser, "dmfi_MyVoice"); + // FloatingTextStringOnCreature("You have destroyed your previous Voice", oUser, FALSE); + // } + // //Create the Voice + // oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + // + // SetLocalObject(oUser, "dmfi_VoiceTarget", oVoice); + // //Set Ownership of the Voice to the User + // SetLocalObject(oUser, "dmfi_MyVoice", oVoice); + // DelayCommand(1.0f, FloatingTextStringOnCreature("The Voice is operational", oUser, FALSE)); + // break; + + case 9: + { + // v1.09 - toggle eavesdrop bcast - user/alldms + int hookbcast = GetLocalInt(oUser, "dmfi_MyListenerBcastMode"); + hookbcast = !hookbcast; + SetLocalInt(oUser, "dmfi_MyListenerBcastMode", hookbcast); + DelayCommand(1.0f, FloatingTextStringOnCreature("DM-Broadcast mode for new eavesdroppers set to " + (hookbcast ? "ON" : "OFF"), oUser, FALSE)); + } + + case 10: + // v1.09 - cancel eavesdrop mode + { + int hooknum = GetLocalInt(oUser, "dmfi_MyListenerHook"); + if (hooknum != 0) + { + RemoveListenerHook(hooknum); + DeleteLocalInt(oUser, "dmfi_MyListenerHook"); + } + + // destroy any existing ditto voice + if (GetIsObjectValid(GetLocalObject(oUser, "dmfi_MyVoice"))) + { + DestroyObject(GetLocalObject(oUser, "dmfi_MyVoice")); + DeleteLocalObject(oUser, "dmfi_MyVoice"); + FloatingTextStringOnCreature("You have destroyed your previous Voice", oUser, FALSE); + } + } + break; + + default: + // record a new phrase + FloatingTextStringOnCreature("Ready to record new phrase", oUser, FALSE); + SetLocalInt(oUser, "hls_EditPhrase", 20600 + iSay); + // set up to capture next spoken line of text + DMFI_get_line(oUser, TALKVOLUME_TALK, "dmfi_univ_listen", OBJECT_SELF); + break; + } + } + + // You targeted an NPC or Object - Say Something! + else + { + switch (iSay) + { + // Toggle a SINGLE NPC mute / unmute function + case 8: SetLocalInt(oTarget, "dmfi_Mute", abs(GetLocalInt(oTarget, "dmfi_Mute") - 1)); + break; + + case 9: + // XXXXX Set a Single NPC to listen and make it your target - VOICE WIDGET FUNCTION + // SetLocalObject(oUser, "dmfi_VoiceTarget", oTarget); + // if (!GetIsPC(oTarget)) + // { + // FloatingTextStringOnCreature(GetName(oTarget) + " is listening", oUser, FALSE); + // SetListenPattern(oTarget, "**", LISTEN_PATTERN); //listen to all text + // SetLocalInt(oTarget, "hls_Listening", 1); //listen to all text + // SetListening(oTarget, TRUE); //be sure NPC is listening + // } + // //You Targetted a PC - make a voice follow that sucker and listen. + // else + // { + // //delete any valid following voices to stop duplicates + // if (GetIsObjectValid(GetLocalObject(oTarget, "dmfi_VoiceFollow"))) + // { + // DestroyObject(GetLocalObject(oUser, "dmfi_VoiceFollow")); + // FloatingTextStringOnCreature("The prior voice following this character was destroyed", oUser, FALSE); + // } + // + // //Create the Voice + // oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + // //Sets the Voice as the object to throw to. + // DelayCommand(2.0, SetLocalObject(oTarget, "dmfi_VoiceFollow", oVoice)); //only set this for finding a duplicate later + // DelayCommand(2.0, SetLocalObject(oVoice, "dmfi_follow", oTarget)); //set up the player as something to follow + // DelayCommand(1.0f, FloatingTextStringOnCreature("The Voice will follow and listen to " +GetName(oTarget), oUser, FALSE)); + // } + // break; + + // v1.09 - eavesdrop on pc + { + int hooknum = GetLocalInt(oUser, "dmfi_MyListenerHook"); + if (hooknum != 0) RemoveListenerHook(hooknum); + int hookparty = GetLocalInt(oUser, "dmfi_MyListenerPartyMode"); + int hookbcast = GetLocalInt(oUser, "dmfi_MyListenerBcastMode"); + hooknum = AppendListenerHook(1, oTarget, lLocation, + DMFI_CHANNELMASK_TALK|DMFI_CHANNELMASK_WHISPER, + hookparty, hookbcast, oUser); + if (hooknum != 0) + { + SetLocalObject(oUser, "dmfi_VoiceTarget", oTarget); + if (GetIsPC(oTarget)) + { + // targetted PC - + // delete any valid following voices to stop duplicates + object oVoice = GetLocalObject(oTarget, "dmfi_VoiceFollow"); + if (GetIsObjectValid(oVoice)) + { + DestroyObject(oVoice); + DeleteLocalObject(oTarget, "dmfi_VoiceFollow"); + FloatingTextStringOnCreature("The prior voice following this character was destroyed", oUser, FALSE); + } + + // 08.05.13 tsunami282 - we don't use following voices anymore + // // Create the Voice + // oVoice = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_voice", lLocation); + // // Sets the Voice as the object to throw to. + // DelayCommand(2.0, SetLocalObject(oTarget, "dmfi_VoiceFollow", oVoice)); //only set this for finding a duplicate later + // DelayCommand(2.0, SetLocalObject(oVoice, "dmfi_follow", oTarget)); //set up the player as something to follow + // DelayCommand(1.0f, FloatingTextStringOnCreature("The Voice will follow " +GetName(oTarget), oUser, FALSE)); + } + else + { + // targetted NPC - nothing else needed to do + } + } + else + { + SendMessageToPC(oUser, "ERROR: could not append listener hook!"); + } + SetLocalInt(oUser, "dmfi_MyListenerHook", hooknum); + } + break; + + case 10: + // v1.09 - Toggle PC single/party eavesdropping + { + // v1.09 - toggle eavesdrop mode - single/party + int partylisten = GetLocalInt(oUser, "dmfi_MyListenerPartyMode"); + partylisten++; + if (partylisten > 1) partylisten = 0; + SetLocalInt(oUser, "dmfi_MyListenerPartyMode", partylisten); + DelayCommand(1.0f, FloatingTextStringOnCreature("PC eavesdrop mode for new eavesdroppers set to " + (partylisten ? "PARTY" : "PC ONLY"), oUser, FALSE)); + } + break; + default: + sSay = GetDMFIPersistentString("dmfi", "hls206" + IntToString(iSay)); + AssignCommand(oTarget, SpeakString(sSay)); + break; + } + } +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI Affliction Wand +void ReportImmunity(object oT, object oUser) +{ + SendMessageToPC(oUser, "Immunities Reported: (blank if none)"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ABILITY_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Ability Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_AC_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE AC Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ATTACK_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Attack Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_BLINDNESS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Blindness"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CHARM)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Charm"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CONFUSED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Confusion"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CRITICAL_HIT)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Critical Hit"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CURSED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Cursed"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAMAGE_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Damage Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAMAGE_IMMUNITY_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Damage Immunity Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAZED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Dazed"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DEAFNESS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Deafness"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DEATH)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Death"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DISEASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Disease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DOMINATE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Dominate"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ENTANGLE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Entangle"); + if (GetIsImmune(oT, IMMUNITY_TYPE_FEAR)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Fear"); + if (GetIsImmune(oT, IMMUNITY_TYPE_KNOCKDOWN)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Knockdown"); + if (GetIsImmune(oT, IMMUNITY_TYPE_MIND_SPELLS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Mind Spells"); + if (GetIsImmune(oT, IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Movement Speed Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_NEGATIVE_LEVEL)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Negative Level"); + if (GetIsImmune(oT, IMMUNITY_TYPE_PARALYSIS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Paralysis"); + if (GetIsImmune(oT, IMMUNITY_TYPE_POISON)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Poison"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SAVING_THROW_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Saving Throw Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SILENCE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Silence"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SKILL_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Skill Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SLEEP)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Sleep"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SLOW)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Slow"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SNEAK_ATTACK)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Sneak Attack"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SPELL_RESISTANCE_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Spell Resistance Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_STUN)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Stun"); + if (GetIsImmune(oT, IMMUNITY_TYPE_TRAP)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Trap"); +} + +//////////////////////////////////////////////////////////////////////// +void CheckForEffect(effect eA, object oT, object oUser) +{ + int Result = FALSE; + effect Check = GetFirstEffect(oT); + + while (GetIsEffectValid(Check)) + { + if (Check == eA) + Result = TRUE; + + Check = GetNextEffect(oT); + } + if (Result) + FloatingTextStringOnCreature("Affliction Wand Saving Throw Failure: " + GetName(oT), oUser); + else + FloatingTextStringOnCreature("Affliction Wand Saving Throw Success: No Effect: " + GetName(oT), oUser); +} + +//////////////////////////////////////////////////////////////////////// +void DoAfflictFunction(int iAfflict, object oUser) +{ + effect eEffect; + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + float fDuration; + int nDNum; + effect eD; + effect eA; + effect eT; + effect eVis; + int nBug = 0; + int nSaveAmount; float fSaveAmount; + + if (GetIsDMPossessed(oUser)) + { + nDNum = GetLocalInt(GetMaster(oUser), "dmfi_damagemodifier"); + fDuration = GetLocalFloat(GetMaster(oUser), "dmfi_stunduration"); + fSaveAmount = GetLocalFloat(GetMaster(oUser), "dmfi_saveamount"); + } + else + { + nDNum = GetLocalInt(oUser, "dmfi_damagemodifier"); + fDuration = GetLocalFloat(oUser, "dmfi_stunduration"); + fSaveAmount = GetLocalFloat(oUser, "dmfi_saveamount"); + } + + nSaveAmount = FloatToInt(fSaveAmount); + + if (!(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) || + GetIsDM(oTarget)) + { + FloatingTextStringOnCreature("You must target a valid creature!", oUser, FALSE); + return; + } + switch (iAfflict) + { + case 11: eD= EffectDamage(d4(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 12: eD = EffectDamage(d6(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 13: eD = EffectDamage(d8(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 14: eD = EffectDamage(d10(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 15: eD = EffectDamage(d12(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 16: eD = EffectDamage(GetCurrentHitPoints(oTarget)/4, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 17: eD = EffectDamage(GetCurrentHitPoints(oTarget)/2, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 18: eD = EffectDamage(GetCurrentHitPoints(oTarget) * 3 / 4, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis =EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); break; + case 19: eD = EffectDamage(GetCurrentHitPoints(oTarget)-1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis =EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); break; + case 21: eA =EffectDisease(DISEASE_FILTH_FEVER); break; + case 22: eA =EffectDisease(DISEASE_MINDFIRE); break; + case 23: eA =EffectDisease(DISEASE_DREAD_BLISTERS); break; + case 24: eA =EffectDisease(DISEASE_SHAKES); break; + case 25: eA =EffectDisease(DISEASE_VERMIN_MADNESS); break; + case 26: eA =EffectDisease(DISEASE_DEVIL_CHILLS); break; + case 27: eA =EffectDisease(DISEASE_SLIMY_DOOM); break; + case 28: eA =EffectDisease(DISEASE_RED_ACHE); break; + case 29: eA =EffectDisease(DISEASE_ZOMBIE_CREEP); break; + case 31: eA =EffectDisease(DISEASE_BLINDING_SICKNESS); break; + case 32: eA =EffectDisease(DISEASE_CACKLE_FEVER); break; + case 33: eA =EffectDisease(DISEASE_BURROW_MAGGOTS); break; + case 34: eA =EffectDisease(DISEASE_RED_SLAAD_EGGS); break; + case 35: eA =EffectDisease(DISEASE_DEMON_FEVER); break; + case 36: eA =EffectDisease(DISEASE_GHOUL_ROT); break; + case 37: eA =EffectDisease(DISEASE_MUMMY_ROT); break; + case 38: eA =EffectDisease(DISEASE_SOLDIER_SHAKES); break; + case 39: eA =EffectDisease(DISEASE_SOLDIER_SHAKES); break; + case 41: eA =EffectPoison(POISON_TINY_SPIDER_VENOM); break; + case 42: eA =EffectPoison(POISON_ARANEA_VENOM); break; + case 43: eA =EffectPoison(POISON_MEDIUM_SPIDER_VENOM); break; + case 44: eA = EffectPoison(POISON_CARRION_CRAWLER_BRAIN_JUICE); break; + case 45: eA = EffectPoison(POISON_OIL_OF_TAGGIT); break; + case 46: eA = EffectPoison(POISON_ARSENIC); break; + case 47: eA = EffectPoison(POISON_GREENBLOOD_OIL); break; + case 48: eA = EffectPoison(POISON_NITHARIT); break; + case 49: eA = EffectPoison(POISON_PHASE_SPIDER_VENOM); break; + case 51: eA = EffectPoison(POISON_LICH_DUST); break; + case 52: eA = EffectPoison(POISON_SHADOW_ESSENCE); break; + case 53: eA = EffectPoison(POISON_LARGE_SPIDER_VENOM); break; + case 54: eA = EffectPoison(POISON_PURPLE_WORM_POISON); break; + case 55: eA = EffectPoison(POISON_IRON_GOLEM); break; + case 56: eA = EffectPoison(POISON_PIT_FIEND_ICHOR); break; + case 57: eA = EffectPoison(POISON_WYVERN_POISON); break; + case 58: eA = EffectPoison(POISON_BLACK_LOTUS_EXTRACT); break; + case 59: eA = EffectPoison(POISON_GARGANTUAN_SPIDER_VENOM); break; + case 60: eT = EffectPetrify(); break; + case 61: eT = EffectBlindness(); break; + case 62: eT = EffectCurse(4,4,4,4,4,4); break; + case 63: eT = EffectFrightened(); break; + case 64: eT = EffectStunned(); break; + case 65: eT = EffectSilence(); break; + case 66: eT = EffectSleep(); break; + case 67: eT = EffectSlow(); break; + case 68: eT = EffectKnockdown(); nBug = 1; break; + case 69: eD = EffectDamage( GetCurrentHitPoints(oTarget)-1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL); + AssignCommand( oTarget, ClearAllActions()); + AssignCommand( oTarget, ActionPlayAnimation( ANIMATION_LOOPING_DEAD_FRONT, 1.0, 99999.0)); + DelayCommand(0.5, SetCommandable( FALSE, oTarget)); break; + case 71: eA = EffectCutsceneDominated();break; + case 72: eA = EffectCutsceneGhost(); break; + case 73: eA = EffectCutsceneImmobilize(); break; + case 74: eA = EffectCutsceneParalyze(); break; + case 75: nBug = -1; break; //special case for combo death effect + case 81: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_POISON) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 82: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_DISEASE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 83: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_BLINDNESS) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 84: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_CURSE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 85: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_FRIGHTENED) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 86: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_STUNNED) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 87: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_SILENCE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 88: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 89: SetCommandable(TRUE, oTarget); + AssignCommand(oTarget, ClearAllActions()); break; + case 80: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_PETRIFY) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break;//Added July 5, 2003 + +// 99 is a duplicate instance - simple copy. - Demetrious + case 91: SetLocalString(oUser, "EffectSetting", "dmfi_stunduration"); + CreateSetting(oUser); + case 92: SetDMFIPersistentInt("dmfi", "DamageModifier", nDNum+1); SetCustomToken(20780, IntToString(nDNum+1));; break; + case 93: + if (nDNum==1) + { + FloatingTextStringOnCreature("Illegal operation: Minimum modifier is 1.", oUser); + break; + } + else + { + SetDMFIPersistentInt("dmfi", "DamageModifier", nDNum-1); SetCustomToken(20780, IntToString(nDNum-1)); ;break; + break; + } + case 94: ReportImmunity(oTarget, oUser); break; + case 95: DMFI_NextTarget(oTarget, oUser); break; + case 99: SetLocalString(oUser, "EffectSetting", "SaveEffectAmount"); + CreateSetting(oUser); break; + case 101: eT = EffectSavingThrowDecrease(SAVING_THROW_FORT, nSaveAmount); break; + case 102: eT = EffectSavingThrowDecrease(SAVING_THROW_REFLEX, nSaveAmount); break; + case 103: eT = EffectSavingThrowDecrease(SAVING_THROW_WILL, nSaveAmount); break; + case 104: eT = EffectSavingThrowIncrease(SAVING_THROW_FORT, nSaveAmount); break; + case 105: eT = EffectSavingThrowIncrease(SAVING_THROW_REFLEX, nSaveAmount); break; + case 106: eT = EffectSavingThrowIncrease(SAVING_THROW_WILL, nSaveAmount); break; + case 107: eT = EffectSavingThrowDecrease(SAVING_THROW_ALL, nSaveAmount); break; + case 108: eT = EffectSavingThrowIncrease(SAVING_THROW_ALL, nSaveAmount); break; + case 109: SetLocalString(oUser, "EffectSetting", "SaveEffectAmount"); + CreateSetting(oUser); + case 100: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if ((GetEffectType(eEffect) == EFFECT_TYPE_SAVING_THROW_INCREASE) + ||(GetEffectType(eEffect) == EFFECT_TYPE_SAVING_THROW_DECREASE)) + RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break;//Added July 5, 2003 + + + + default: break; + } +//code down here to apply the effects an then go back and see if the +//player successfully saved or did not for the diseases and poisons. + + if ((GetEffectType(eD)!= EFFECT_TYPE_INVALIDEFFECT) || + (GetEffectType(eVis) != EFFECT_TYPE_INVALIDEFFECT)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eD, oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oTarget); + return; + } + if (GetEffectType(eA)!= EFFECT_TYPE_INVALIDEFFECT) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eA, oTarget); + DelayCommand(5.0, CheckForEffect(eA, oTarget, oUser)); + return; + } + if ((GetEffectType(eT)!= EFFECT_TYPE_INVALIDEFFECT) || (nBug ==1)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eT, oTarget, fDuration); + + if ((GetEffectType(eT)==EFFECT_TYPE_SAVING_THROW_INCREASE) || + (GetEffectType(eT)==EFFECT_TYPE_SAVING_THROW_DECREASE)) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Target Saves: Fortitude " + IntToString(GetFortitudeSavingThrow(oTarget)) + + " Reflex " + IntToString(GetReflexSavingThrow(oTarget)) + " Will " + IntToString(GetWillSavingThrow(oTarget)), oUser)); + } + return; + } + if (nBug == -1) + { + object oFollowMe = GetFirstFactionMember(oTarget, TRUE); + + if (!GetIsObjectValid(oFollowMe)) + oFollowMe = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 1,CREATURE_TYPE_IS_ALIVE, TRUE); + + if (GetIsDM(oFollowMe) || GetIsDMPossessed(oFollowMe)) + oFollowMe = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 2,CREATURE_TYPE_IS_ALIVE, TRUE); + + if (!GetIsObjectValid(oFollowMe)) + oFollowMe = oUser; + + AssignCommand(oFollowMe, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneDominated(), oTarget)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget); + } + + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI XP Wand +void DoXPFunction(int iXP, object oUser) +{ + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + object oPartyMember; + int iHD; + int iParty = 0; + int iPercent = 0; + int iReward = 0; + int iGold = 0; + int iValue = 0; + + string sFloating = "DM Granted Bonus"; + + switch (iXP) + { + case 8: DMFI_NextTarget(oTarget, oUser); return; break; + case 11: sFloating = "Roleplaying Bonus"; iPercent = 1; break; + case 12: sFloating = "Roleplaying Bonus"; iPercent = 2; break; + case 13: sFloating = "Roleplaying Bonus"; iPercent = 3; break; + case 14: sFloating = "Roleplaying Bonus"; iPercent = 4; break; + case 15: sFloating = "Roleplaying Bonus"; iPercent = 5; break; + case 21: sFloating = "Main Plot Bonus"; iPercent = 10; break; + case 22: sFloating = "Main Plot Bonus"; iPercent = 20; break; + case 23: sFloating = "Main Plot Bonus"; iPercent = 25; break; + case 24: sFloating = "Main Plot Bonus"; iPercent = 33; break; + case 25: sFloating = "Main Plot Bonus"; iPercent = 50; break; + case 31: sFloating = "Main Plot Bonus"; iPercent = 10; iParty = 1; break; + case 32: sFloating = "Main Plot Bonus"; iPercent = 20; iParty = 1; break; + case 33: sFloating = "Main Plot Bonus"; iPercent = 25; iParty = 1; break; + case 34: sFloating = "Main Plot Bonus"; iPercent = 33; iParty = 1; break; + case 35: sFloating = "Main Plot Bonus"; iPercent = 50; iParty = 1; break; + case 41: sFloating = "Best In Game Bonus"; iPercent = 2; break; + case 42: sFloating = "Best In Game Bonus"; iPercent = 5; break; + case 43: sFloating = "Best In Game Bonus"; iPercent = 10; break; + case 44: sFloating = "Best In Game Bonus"; iPercent = 20; break; + case 45: sFloating = "Best In Game Bonus"; iPercent = 25; break; + case 51: iParty = 1; iReward = 100; break; + case 52: iParty = 1; iReward = 250; break; + case 53: iParty = 1; iReward = 500; break; + case 54: iParty = 1; iReward = 1000; break; + case 55: iParty = 1; iReward = 2000; break; + case 61: iHD = GetHitDice(oTarget); + SendMessageToPC(oUser, GetName(oTarget) +" has received " + IntToString(GetLocalInt(oPartyMember, "dmfi_XPGiven")) + " DMFI WAND XP this session."); + SendMessageToPC(oUser, GetName(oTarget) +" currently has " + IntToString(GetXP(oTarget)) + " total XP."); + SendMessageToPC(oUser, GetName(oTarget) +" currently needs " + IntToString(((iHD * (iHD + 1)) / 2 * 1000) - GetXP(oTarget)) + " to level."); + SendMessageToPC(oUser, GetName(oTarget) +" has "+ IntToString(GetGold(oTarget)) + " gp."); + SendMessageToPC(oUser, GetName(oTarget) +" has items totaling " + IntToString(DMFI_GetNetWorth(oTarget)) + " in gp value."); + return; break; + case 62: oPartyMember=GetFirstFactionMember(oTarget, TRUE); + while (GetIsObjectValid(oPartyMember)==TRUE) + { + iGold = iGold + GetGold(oPartyMember); + iValue = iValue + DMFI_GetNetWorth(oPartyMember); + SendMessageToPC(oUser, GetName(oPartyMember) +" has " + IntToString(GetXP(oPartyMember)) + " XP total."); + oPartyMember = GetNextFactionMember(oTarget, TRUE); + } + SendMessageToPC(oUser, "The party has a total of "+ IntToString(iGold) + " gp."); + SendMessageToPC(oUser, "The party has items totaling " + IntToString(iValue) + " in gp value."); + return; break; + case 63: oPartyMember=GetFirstFactionMember(oTarget, TRUE); + while (GetIsObjectValid(oPartyMember)==TRUE) + { + SendMessageToPC(oUser, GetName(oPartyMember) +" has received " + IntToString(GetLocalInt(oPartyMember, "dmfi_XPGiven")) + " DMFI WAND XP this session."); + oPartyMember = GetNextFactionMember(oTarget, TRUE); + } + return; break; + case 64: oPartyMember=GetFirstFactionMember(oTarget, TRUE); + while (GetIsObjectValid(oPartyMember)==TRUE) + { + int iHD = GetHitDice(oPartyMember); + SendMessageToPC(oUser, GetName(oPartyMember) + " is level " + IntToString(GetHitDice(oPartyMember)) + " and needs " + IntToString(((iHD * (iHD + 1)) / 2 * 1000) - GetXP(oPartyMember)) + " XP to level up."); + oPartyMember = GetNextFactionMember(oTarget, TRUE); + } + return; break; + case 71: sFloating = "DM XP PENALTY"; iReward = -50; break; + case 72: sFloating = "DM XP PENALTY"; iReward = -100; break; + case 73: sFloating = "DM XP PENALTY"; iReward = -250; break; + case 74: sFloating = "DM XP PENALTY"; iReward = -500; break; + case 75: sFloating = "DM XP PENALTY"; iReward = -1000; break; + case 76: sFloating = "DM XP PENALTY"; iReward = -2000; break; + case 77: sFloating = "DM XP PENALTY"; iReward = -((GetHitDice(oTarget) * (GetHitDice(oTarget)-1))/2 * 1000); break; + case 78: sFloating = "DM XP PENALTY"; iReward = -((GetHitDice(oTarget) * (GetHitDice(oTarget)-1))/2 * 1000) - (((GetHitDice(oTarget)-1)*1000)/2); break; + case 79: sFloating = "DM XP PENALTY"; iReward = -((GetXP(oTarget))-(GetXP(oTarget))+1); break; + default: return; + } + + if (iParty==1) + { + // 2008.05.26 tsunami282 - grant percent XP based on each party member's level, not selected party member + int bUsePercent = FALSE; + if (iReward==0) bUsePercent = TRUE; + + oPartyMember=GetFirstFactionMember(oTarget, TRUE); + while (GetIsObjectValid(oPartyMember)) + { + if (bUsePercent) iReward = (GetHitDice(oPartyMember)*iPercent*10); + GiveXPToCreature(oPartyMember, iReward); + SetLocalInt(oPartyMember, "dmfi_XPGiven", GetLocalInt(oPartyMember, "dmfi_XPGiven") + iReward); + FloatingTextStringOnCreature(sFloating + ": " + IntToString(iReward), oPartyMember, FALSE); + SendMessageToAllDMs(GetName(oPartyMember) +" received a "+GetLocalString(oUser, "BonusType")+ " experience reward of "+ IntToString(iReward)+ "."); + oPartyMember = GetNextFactionMember(oTarget, TRUE); + } + // SendMessageToAllDMs("The entire party was granted "+ IntToString(iReward)+ " XP."); + } + + else //single player code + { + if (iReward==0) + iReward = (GetHitDice(oTarget)*iPercent*10); + + int nPrior = GetXP(oTarget); + + SetXP(oTarget, nPrior+iReward); + + SetLocalInt(oTarget, "dmfi_XPGiven", GetLocalInt(oTarget, "dmfi_XPGiven") + iReward); + FloatingTextStringOnCreature(sFloating + ": " + IntToString(iReward), oTarget, FALSE); + SendMessageToAllDMs(GetName(oTarget) +" received a "+GetLocalString(oUser, "BonusType")+ " experience reward of "+ IntToString(iReward)+ "."); + + } + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI Music Wand +void DoMusicFunction(int iMusic, object oUser) +{ + int iSet; + switch (iMusic) + { + case 11: MusicBackgroundPlay(GetArea(oUser)); return; break; + case 12: MusicBackgroundStop(GetArea(oUser)); DelayCommand(1.0, MusicBackgroundStop(GetArea(oUser))); return; break; + case 13: iSet = TRACK_BATTLE_WINTER; break; + case 14: iSet = TRACK_BATTLE_DESERT; break; + case 15: iSet = TRACK_DESERT_DAY; break; + case 16: iSet = TRACK_DESERT_NIGHT; break; + case 17: iSet = TRACK_WINTER_DAY;break; + case 18: iSet = TRACK_HOTU_UNDERMOUNTAIN; break; + case 19: iSet = TRACK_HOTU_WATERDEEP; break; + case 21: iSet = TRACK_HOTU_BATTLE_BOSS1; break; + case 22: iSet = TRACK_HOTU_BATTLE_BOSS2; break; + case 23: iSet = TRACK_HOTU_BATTLE_HELL; break; + case 24: iSet = TRACK_HOTU_THEME;break; + case 25: iSet = TRACK_HOTU_REBELCAMP;break; + case 26: iSet = TRACK_HOTU_QUEEN;break; + case 27: iSet = TRACK_HOTU_DRACOLICH;break; + case 28: iSet = TRACK_HOTU_FIREPLANE;break; + case 29: iSet = TRACK_HOTU_HELLFROZEOVER;break; + case 31: iSet = 34; break; + case 32: iSet = 35; break; + case 33: iSet = 36; break; + case 34: iSet = 37; break; + case 35: iSet = 38; break; + case 36: iSet = 39; break; + case 37: iSet = 40; break; + case 38: iSet = 41; break; + case 39: iSet = 42; break; + case 41: iSet = 43; break; + case 42: iSet = 44; break; + case 43: iSet = 45; break; + case 44: iSet = 46; break; + case 45: iSet = 47; break; + case 46: iSet = 48; break; + case 51: iSet = 15; break; + case 52: iSet = 16; break; + case 53: iSet = 17; break; + case 54: iSet = 18; break; + case 55: iSet = 19; break; + case 56: iSet = 20; break; + case 57: iSet = 21; break; + case 58: iSet = 29; break; + case 61: iSet = 22; break; + case 62: iSet = 23; break; + case 63: iSet = 24; break; + case 64: iSet = 56; break; + case 65: iSet = 25; break; + case 66: iSet = 26; break; + case 67: iSet = 27; break; + case 68: iSet = 49; break; + case 69: iSet = 50; break; + case 71: iSet = 28; break; + case 72: iSet = 7; break; + case 73: iSet = 8; break; + case 74: iSet = 9; break; + case 75: iSet = 10; break; + case 76: iSet = 11; break; + case 77: iSet = 12; break; + case 78: iSet = 13; break; + case 79: iSet = 14; break; + case 81: iSet = 1; break; + case 82: iSet = 2; break; + case 83: iSet = 3; break; + case 84: iSet = 4; break; + case 85: iSet = 5; break; + case 86: iSet = 6; break; + case 91: iSet = 30; break; + case 92: iSet = 31; break; + case 93: iSet = 32; break; + case 94: iSet = 33; break; + case 95: iSet = 51; break; + case 96: iSet = 52; break; + case 97: iSet = 53; break; + case 98: iSet = 54; break; + case 99: iSet = 55; break; + default: break; + } + + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeDay(GetArea(oUser), iSet); + MusicBackgroundChangeNight(GetArea(oUser), iSet); + MusicBackgroundPlay(GetArea(oUser)); + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI Encounter Wand +void Spawn(string sCreature, location lCreature, int iTF = FALSE) +{ + CreateObject(OBJECT_TYPE_CREATURE, sCreature, lCreature, iTF); +} + +//////////////////////////////////////////////////////////////////////// +void CopyMon(object oMon, location lEncounter) +{ + object oCreature = CopyObject(oMon, lEncounter); + effect eEffect = GetFirstEffect(oMon); + while (GetIsEffectValid(eEffect)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oCreature); + eEffect = GetNextEffect(oMon); + } +} + +//////////////////////////////////////////////////////////////////////// +void CreateCustomEncounter(string Template, location lEncounter) +{ + object oWP = GetWaypointByTag(Template); + int n = 1; + object oMon = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, GetLocation(oWP), n); + + while (GetIsObjectValid(oMon) && (GetDistanceBetween(oWP, oMon)<8.0) && (n<9)) + { + DelayCommand(IntToFloat(n), CopyMon(oMon, lEncounter)); + n=n+1; + oMon = GetNearestCreatureToLocation(CREATURE_TYPE_IS_ALIVE, TRUE, GetLocation(oWP), n); + } +} + +//////////////////////////////////////////////////////////////////////// +void CreateEncounter(int iEncounter, location lEncounter, object oUser) +{ + SetLocalInt(oUser, "EncounterType", iEncounter); + switch (iEncounter) + { + case 11: //Animal - Low Badger Encounter + SetLocalString(oUser, "EncounterName", "Low Badger"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_BADGER", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_BADGER", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BADGER", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BADGER", lEncounter, FALSE)); + break; + case 12: //Animal - Low Canine Encounter + SetLocalString(oUser, "EncounterName", "Low Canine"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_WOLF", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_WOLF", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_WOLF", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_WOLF", lEncounter, FALSE)); + break; + case 13: //Animal - Low Feline Encounter + SetLocalString(oUser, "EncounterName", "Low Feline"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_COUGAR", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_COUGAR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_COUGAR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_COUGAR", lEncounter, FALSE)); + break; + case 14: //Animal - Low Bear Encounter + SetLocalString(oUser, "EncounterName", "Low Bear (Boss)"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_BEARBLCK", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_BEARBLCK", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BEARBLCK", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BEARBRWN", lEncounter, FALSE)); + break; + case 15: //Animal - Boar Encounter + SetLocalString(oUser, "EncounterName", "Boar (Boss)"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_BOAR", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_BOAR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BOAR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BOARDIRE", lEncounter, FALSE)); + break; + case 16: //Animal - Medium Feline Encounter + SetLocalString(oUser, "EncounterName", "Medium Feline"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_LION", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_LION", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_LION", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_LION", lEncounter, FALSE)); + break; + case 17: //Animal - High Canine Encounter + SetLocalString(oUser, "EncounterName", "High Canine"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_DIREWOLF", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_DIREWOLF", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_DIREWOLF", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DIREWOLF", lEncounter, FALSE)); + break; + case 18: //Animal - High Feline Encounter + SetLocalString(oUser, "EncounterName", "High Feline"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_DIRETIGER", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_BEASTMALAR001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BEASTMALAR001", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BEASTMALAR001", lEncounter, FALSE)); + break; + case 19: //Animal - High Bear Encounter + SetLocalString(oUser, "EncounterName", "High Bear"); + CreateObject(OBJECT_TYPE_CREATURE, "NW_BEARDIRE", lEncounter, FALSE); + DelayCommand(1.0f, Spawn("NW_BEARDIRE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BEARDIRE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BEARDIREBOSS", lEncounter, FALSE)); + break; + + case 21: //Construct - Flesh Golem + SetLocalString(oUser, "EncounterName", "Flesh Golem"); + DelayCommand(1.0f, Spawn("NW_GOLFLESH", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GOLFLESH", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GOLFLESH", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GOLFLESH", lEncounter, FALSE)); + break; + case 22: //Construct - Minogan + SetLocalString(oUser, "EncounterName", "Minogon"); + DelayCommand(1.0f, Spawn("NW_MINOGON", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_MINOGON", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_MINOGON", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_MINOGON", lEncounter, FALSE)); + break; + case 23: //Construct - Clay Golem + SetLocalString(oUser, "EncounterName", "Clay Golem"); + DelayCommand(1.0f, Spawn("NW_GolClay", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GolClay", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GolClay", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GolClay", lEncounter, FALSE)); + break; + case 24: //Construct - Bone Golem + SetLocalString(oUser, "EncounterName", "Bone Golem"); + DelayCommand(1.0f, Spawn("NW_GolBone", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GolBone", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GolBone", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GolBone", lEncounter, FALSE)); + break; + case 25: //Construct - Helmed Horror + SetLocalString(oUser, "EncounterName", "Helmed Horror"); + DelayCommand(1.0f, Spawn("NW_HELMHORR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_HELMHORR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_HELMHORR", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_HELMHORR", lEncounter, FALSE)); + break; + case 26: //Construct - Stone Golem + SetLocalString(oUser, "EncounterName", "Stone Golem"); + DelayCommand(1.0f, Spawn("NW_GOLSTONE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GOLSTONE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GOLSTONE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GOLSTONE", lEncounter, FALSE)); + break; + case 27: //Construct - Battle Horror + SetLocalString(oUser, "EncounterName", "Battle Horror"); + DelayCommand(1.0f, Spawn("NW_BATHORROR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BATHORROR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BATHORROR", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BATHORROR", lEncounter, FALSE)); + break; + case 28: //Construct - Shield Guardian + SetLocalString(oUser, "EncounterName", "Shield Guardian"); + DelayCommand(1.0f, Spawn("NW_SHGUARD", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SHGUARD", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SHGUARD", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SHGUARD", lEncounter, FALSE)); + break; + case 29: //Construct - Iron Golem + SetLocalString(oUser, "EncounterName", "Iron Golem"); + DelayCommand(1.0f, Spawn("NW_GOLIRON", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GOLIRON", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GOLIRON", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GOLIRON", lEncounter, FALSE)); + break; + case 31: //Dragon - Adult White Dragon + SetLocalString(oUser, "EncounterName", "Adult White Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGWHITE001", lEncounter, FALSE)); + break; + case 32: //Dragon - Adult Black Dragon + SetLocalString(oUser, "EncounterName", "Adult Black Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGBLACK001", lEncounter, FALSE)); + break; + case 33: //Dragon - Adult Green Dragon + SetLocalString(oUser, "EncounterName", "Adult Green Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGGREEN001", lEncounter, FALSE)); + break; + case 34: //Dragon - Adult Blue Dragon + SetLocalString(oUser, "EncounterName", "Adult Blue Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGBLUE001", lEncounter, FALSE)); + break; + case 35: //Dragon - Adult Red Dragon + SetLocalString(oUser, "EncounterName", "Adult Red Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGRED001", lEncounter, FALSE)); + break; + case 36: //Dragon - Old White Dragon + SetLocalString(oUser, "EncounterName", "Old White Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGWHITE002", lEncounter, FALSE)); + break; + case 37: //Dragon - Old Blue Dragon + SetLocalString(oUser, "EncounterName", "Old Blue Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGBLUE002", lEncounter, FALSE)); + break; + case 38: //Dragon - Old Red Dragon + SetLocalString(oUser, "EncounterName", "Old Red Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGRED002", lEncounter, FALSE)); + break; + case 39: //Dragon - Ancient Red Dragon + SetLocalString(oUser, "EncounterName", "Ancient Red Dragon"); + DelayCommand(1.0f, Spawn("NW_DRGRED003", lEncounter, FALSE)); + break; + case 41: //Elemental - Air Elemental + SetLocalString(oUser, "EncounterName", "Air Elemental"); + DelayCommand(1.0f, Spawn("NW_AIR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_AIR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_AIR", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_AIR", lEncounter, FALSE)); + break; + case 42: //Elemental - Earth Elemental + SetLocalString(oUser, "EncounterName", "Earth Elemental"); + DelayCommand(1.0f, Spawn("NW_EARTH", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_EARTH", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_EARTH", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_EARTH", lEncounter, FALSE)); + break; + case 43: //Elemental - Fire Elemental + SetLocalString(oUser, "EncounterName", "Fire Elemental"); + DelayCommand(1.0f, Spawn("NW_FIRE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_FIRE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_FIRE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_FIRE", lEncounter, FALSE)); + break; + case 44: //Elemental - Water Elemental + SetLocalString(oUser, "EncounterName", "Water Elemental"); + DelayCommand(1.0f, Spawn("NW_WATER", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_WATER", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_WATER", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_WATER", lEncounter, FALSE)); + break; + case 45: //Elemental - Huge Air Elemental + SetLocalString(oUser, "EncounterName", "Huge Air Elemental"); + DelayCommand(1.0f, Spawn("NW_AIRHUGE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_AIRHUGE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_AIRHUGE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_AIRHUGE", lEncounter, FALSE)); + break; + case 46: //Elemental - Huge Earth Elemental + SetLocalString(oUser, "EncounterName", "Huge Earth Elemental"); + DelayCommand(1.0f, Spawn("NW_EARTHHUGE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_EARTHHUGE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_EARTHHUGE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_EARTHHUGE", lEncounter, FALSE)); + break; + case 47: //Elemental - Huge Fire Elemental + SetLocalString(oUser, "EncounterName", "Huge Fire Elemental"); + DelayCommand(1.0f, Spawn("NW_FIREHUGE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_FIREHUGE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_FIREHUGE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_FIREHUGE", lEncounter, FALSE)); + break; + case 48: //Elemental - Huge Water Elemental + SetLocalString(oUser, "EncounterName", "Huge Water Elemental"); + DelayCommand(1.0f, Spawn("NW_WATERHUGE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_WATERHUGE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_WATERHUGE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_WATERHUGE", lEncounter, FALSE)); + break; + case 49: //Elemental - Elemental Swarm + SetLocalString(oUser, "EncounterName", "Elemental Swarm"); + DelayCommand(1.0f, Spawn("NW_AIRGREAT", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_EARTHGREAT", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_FIREGREAT", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_WATERGREAT", lEncounter, FALSE)); + break; + case 51: //Giant - Low Ogre + SetLocalString(oUser, "EncounterName", "Low Ogre"); + DelayCommand(1.0f, Spawn("NW_OGRE01", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_OGRE01", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_OGRE02", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_OGRE02", lEncounter, FALSE)); + break; + case 52: //Giant - Low Troll + SetLocalString(oUser, "EncounterName", "Low Troll"); + DelayCommand(1.0f, Spawn("NW_TROLL", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_TROLL", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_TROLL", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_TROLL", lEncounter, FALSE)); + break; + case 53: //Giant - High Ogre + SetLocalString(oUser, "EncounterName", "High Ogre"); + DelayCommand(1.0f, Spawn("NW_OGRECHIEF01", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_OGRECHIEF02", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_OGRECHIEF01", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_OGREMAGE02", lEncounter, FALSE)); + break; + case 54: //Giant - High Troll + SetLocalString(oUser, "EncounterName", "High Troll"); + DelayCommand(1.0f, Spawn("NW_TROLLCHIEF", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_TROLLCHIEF", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_TROLLWIZ", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_TROLLWIZ", lEncounter, FALSE)); + break; + case 55: //Giant - Ettin + SetLocalString(oUser, "EncounterName", "Ettin"); + DelayCommand(1.0f, Spawn("NW_ETTIN", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_ETTIN", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_ETTIN", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ETTIN", lEncounter, FALSE)); + break; + case 56: //Giant - Hill Giant + SetLocalString(oUser, "EncounterName", "Hill Giant"); + DelayCommand(1.0f, Spawn("NW_GNTHILL", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GNTHILL", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GNTMOUNT", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GNTMOUNT", lEncounter, FALSE)); + break; + case 57: //Giant - Frost Giant + SetLocalString(oUser, "EncounterName", "Frost Giant"); + DelayCommand(1.0f, Spawn("NW_GNTFROST", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GNTFROST", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GNTFROST", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GNTFROST", lEncounter, FALSE)); + break; + case 58: //Giant - Fire Giant + SetLocalString(oUser, "EncounterName", "Fire Giant"); + DelayCommand(1.0f, Spawn("NW_GNTFIRE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GNTFIRE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GNTFIRE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GNTFIRE", lEncounter, FALSE)); + break; + case 59: //Giant - Ogre Mage (Boss) + SetLocalString(oUser, "EncounterName", "Ogre Mage (Boss)"); + DelayCommand(1.0f, Spawn("nw_ogreboss", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("nw_ogreboss", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_OGREMAGEBOSS", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_OGREMAGEBOSS", lEncounter, FALSE)); + break; + case 61: //Humanoid - Goblin + SetLocalString(oUser, "EncounterName", "Goblin"); + DelayCommand(1.0f, Spawn("NW_GOBLINA", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GOBLINA", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GOBLINA", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GOBLINB", lEncounter, FALSE)); + break; + case 62: //Humanoid - Kobold + SetLocalString(oUser, "EncounterName", "Kobold"); + DelayCommand(1.0f, Spawn("NW_KOBOLD002", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_KOBOLD002", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_KOBOLD002", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_KOBOLD001", lEncounter, FALSE)); + break; + case 63: //Humanoid - Low Orc + SetLocalString(oUser, "EncounterName", "Low Orc"); + DelayCommand(1.0f, Spawn("NW_ORCB", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_ORCA", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_ORCA", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ORCA", lEncounter, FALSE)); + break; + case 64: //Humanoid - High Orc (Wiz) + SetLocalString(oUser, "EncounterName", "High Orc (Wiz)"); + DelayCommand(1.0f, Spawn("NW_OrcChiefA", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_ORCCHIEFB", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_ORCCHIEFB", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ORCWIZA", lEncounter, FALSE)); + break; + case 65: //Humanoid - Bugbear + SetLocalString(oUser, "EncounterName", "Bugbear"); + DelayCommand(1.0f, Spawn("NW_BUGBEARA", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BUGBEARA", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BUGBEARA", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BUGBEARB", lEncounter, FALSE)); + break; + case 66: //Humanoid - Lizardfolk + SetLocalString(oUser, "EncounterName", "Lizardfolk"); + DelayCommand(1.0f, Spawn("NW_OLDWARRA", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_OLDWARRA", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_OLDWARRA", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_OLDWARB", lEncounter, FALSE)); + break; + case 67: //Humanoid - Minotaur (Wiz) + SetLocalString(oUser, "EncounterName", "Minotaur (Wiz)"); + DelayCommand(1.0f, Spawn("NW_MINOTAUR", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_MINOTAUR", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_MINOTAUR", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_MINWIZ", lEncounter, FALSE)); + break; + case 68: //Humanoid - Fey + SetLocalString(oUser, "EncounterName", "Fey (Mixed)"); + DelayCommand(1.0f, Spawn("NW_GRIG", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GRIG", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_PIXIE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_PIXIE", lEncounter, FALSE)); + break; + case 69: //Humanoid - Yuan-Ti (Mixed) + SetLocalString(oUser, "EncounterName", "Yuan-Ti (Mixed)"); + DelayCommand(1.0f, Spawn("NW_YUAN_TI001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_YUAN_TI001", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_YUAN_TI002", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_YUAN_TI003", lEncounter, FALSE)); + break; + case 71: //Insects - Fire Beetle + SetLocalString(oUser, "EncounterName", "Fire Beetle"); + DelayCommand(1.0f, Spawn("NW_BTLFIRE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BTLFIRE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BTLFIRE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BTLFIRE", lEncounter, FALSE)); + break; + case 72: //Insects - Spitting Fire Beetle + SetLocalString(oUser, "EncounterName", "Spitting Fire Beetle"); + DelayCommand(1.0f, Spawn("NW_BTLFIRE02", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BTLFIRE02", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BTLFIRE02", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BTLFIRE02", lEncounter, FALSE)); + break; + case 73: //Insects - Low Beetle (Mixed) + SetLocalString(oUser, "EncounterName", "Low Beetle (Mixed)"); + DelayCommand(1.0f, Spawn("NW_BTLBOMB", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BTLBOMB", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BTLSTINK", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BTLFIRE02", lEncounter, FALSE)); + break; + case 74: //Insects - Giant Spider + SetLocalString(oUser, "EncounterName", "Giant Spider"); + DelayCommand(1.0f, Spawn("NW_SPIDGIANT", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SPIDGIANT", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SPIDGIANT", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SPIDGIANT", lEncounter, FALSE)); + break; + case 75: //Insects - Sword Spider + SetLocalString(oUser, "EncounterName", "Sword Spider"); + DelayCommand(1.0f, Spawn("NW_SPIDSWRD", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SPIDSWRD", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SPIDSWRD", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SPIDSWRD", lEncounter, FALSE)); + break; + case 76: //Insects - Wraith Spider + SetLocalString(oUser, "EncounterName", "Wraith Spider"); + DelayCommand(1.0f, Spawn("NW_SPIDWRA", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SPIDWRA", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SPIDWRA", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SPIDWRA", lEncounter, FALSE)); + break; + case 77: //Insects - Stag Beetle + SetLocalString(oUser, "EncounterName", "Stag Beetle"); + DelayCommand(1.0f, Spawn("NW_BTLSTAG", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BTLSTAG", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BTLSTAG", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BTLSTAG", lEncounter, FALSE)); + break; + case 78: //Insects - Dire Spider + SetLocalString(oUser, "EncounterName", "Dire Spider"); + DelayCommand(1.0f, Spawn("NW_SPIDDIRE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SPIDDIRE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SPIDDIRE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SPIDDIRE", lEncounter, FALSE)); + break; + case 79: //Insects - Queen Spider + SetLocalString(oUser, "EncounterName", "Queen Spider"); + DelayCommand(1.0f, Spawn("NW_SPIDERBOSS", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SPIDERBOSS", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SPIDERBOSS", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SPIDERBOSS", lEncounter, FALSE)); + break; + case 81: //Undead - Low Zombie + SetLocalString(oUser, "EncounterName", "Zombie"); + DelayCommand(1.0f, Spawn("NW_ZOMBIE01", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_ZOMBIE02", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_ZOMBIE01", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ZOMBIE02", lEncounter, FALSE)); + break; + case 82: //Undead - Low Skeleton + SetLocalString(oUser, "EncounterName", "Low Skeleton"); + DelayCommand(1.0f, Spawn("NW_SKELETON", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SKELETON", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SKELETON", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SKELETON", lEncounter, FALSE)); + break; + case 83: //Undead - Ghoul + SetLocalString(oUser, "EncounterName", "Ghoul"); + DelayCommand(1.0f, Spawn("NW_GHOUL", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GHOUL", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GHOUL", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GHOUL", lEncounter, FALSE)); + break; + case 84: //Undead - Shadow + SetLocalString(oUser, "EncounterName", "Shadow"); + DelayCommand(1.0f, Spawn("NW_SHADOW", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SHADOW", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SHADOW", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SHADOW", lEncounter, FALSE)); + break; + case 85: //Undead - Mummy + SetLocalString(oUser, "EncounterName", "Mummy"); + DelayCommand(1.0f, Spawn("NW_MUMMY", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_MUMMY", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_MUMMY", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_MUMMY", lEncounter, FALSE)); + break; + case 86: //Undead - High Skeleton + SetLocalString(oUser, "EncounterName", "High Skeleton (Mixed)"); + DelayCommand(1.0f, Spawn("NW_SKELWARR01", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_SKELWARR02", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_SKELMAGE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_SKELPRIEST", lEncounter, FALSE)); + break; + case 87: //Undead - Curst (Mixed) + SetLocalString(oUser, "EncounterName", "Curst (Mixed)"); + DelayCommand(1.0f, Spawn("NW_CURST001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_CURST002", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_CURST003", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_CURST004", lEncounter, FALSE)); + break; + case 88: //Undead - Doom Knight + SetLocalString(oUser, "EncounterName", "Doom Knight"); + DelayCommand(1.0f, Spawn("NW_DOOMKGHT", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_DOOMKGHT", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DOOMKGHT", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_DOOMKGHT", lEncounter, FALSE)); + break; + case 89: //Undead - Vampire (Mixed) + SetLocalString(oUser, "EncounterName", "Vampire (Mixed)"); + DelayCommand(1.0f, Spawn("NW_VAMPIRE001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_VAMPIRE002", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_VAMPIRE003", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_VAMPIRE004", lEncounter, FALSE)); + break; + case 91: //NPC - Low Gypsy + SetLocalString(oUser, "EncounterName", "Low Gypsy"); + DelayCommand(1.0f, Spawn("NW_GYPMALE", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_GYPMALE", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_GYPFEMALE", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_GYPFEMALE", lEncounter, FALSE)); + break; + case 92: //NPC - Low Bandit + SetLocalString(oUser, "EncounterName", "Low Bandit"); + DelayCommand(1.0f, Spawn("NW_BANDIT001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BANDIT001", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BANDIT001", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BANDIT002", lEncounter, FALSE)); + break; + case 93: //NPC - Medium Bandit (Mixed) + SetLocalString(oUser, "EncounterName", "Medium Bandit (Mixed)"); + DelayCommand(1.0f, Spawn("NW_BANDIT005", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_BANDIT002", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_BANDIT003", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_BANDIT004", lEncounter, FALSE)); + break; + case 94: //NPC - Low Mercenary (Mixed) + SetLocalString(oUser, "EncounterName", "Low Mercenary (Mixed)"); + DelayCommand(1.0f, Spawn("NW_HUMANMERC001", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_HALFMERC001", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DWARFMERC001", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ELFMERC001", lEncounter, FALSE)); + break; + case 95: //NPC - Elf Ranger + SetLocalString(oUser, "EncounterName", "Elf Ranger"); + DelayCommand(1.0f, Spawn("NW_ELFRANGER005", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_ELFRANGER005", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_ELFRANGER005", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ELFRANGER005", lEncounter, FALSE)); + break; + case 96: //NPC - Low Drow (Mixed) + SetLocalString(oUser, "EncounterName", "Low Drow (Mixed)"); + DelayCommand(1.0f, Spawn("NW_DROWFIGHT005", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_DROWMAGE005", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DROWROGUE005", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_DROWCLER005", lEncounter, FALSE)); + break; + case 97: //NPC - Medium Mercenary (Mixed) + SetLocalString(oUser, "EncounterName", "Medium Mercenary (Mixed)"); + DelayCommand(1.0f, Spawn("NW_HUMANMERC004", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_HALFMERC004", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DWARFMERC004", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ELFMERC004", lEncounter, FALSE)); + break; + case 98: //NPC - High Drow (Mixed) + SetLocalString(oUser, "EncounterName", "High Drow (Mixed)"); + DelayCommand(1.0f, Spawn("NW_DROWFIGHT020", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_DROWMAGE020", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DROWROGUE020", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_DROWCLER020", lEncounter, FALSE)); + break; + case 99: //NPC - High Mercenary (Mixed) + SetLocalString(oUser, "EncounterName", "High Mercenary (Mixed)"); + DelayCommand(1.0f, Spawn("NW_HUMANMERC006", lEncounter, FALSE)); + DelayCommand(2.0f, Spawn("NW_HALFMERC006", lEncounter, FALSE)); + DelayCommand(3.0f, Spawn("NW_DWARFMERC006", lEncounter, FALSE)); + DelayCommand(4.0f, Spawn("NW_ELFMERC006", lEncounter, FALSE)); + break; + case 101: // Custom Encounters + CreateCustomEncounter("DMFI_E1", lEncounter); break; + case 102: CreateCustomEncounter("DMFI_E2", lEncounter); break; + case 103: CreateCustomEncounter("DMFI_E3", lEncounter); break; + case 104: CreateCustomEncounter("DMFI_E4", lEncounter); break; + case 105: CreateCustomEncounter("DMFI_E5", lEncounter); break; + case 106: CreateCustomEncounter("DMFI_E6", lEncounter); break; + case 107: CreateCustomEncounter("DMFI_E7", lEncounter); break; + case 108: CreateCustomEncounter("DMFI_E8", lEncounter); break; + case 109: CreateCustomEncounter("DMFI_E9", lEncounter); break; + default: + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////// +//An FX Wand function +void FXWand_Firestorm(object oDM) +{ + + // FireStorm Effect + location lDMLoc = GetLocation ( oDM); + + + // tell the DM object to rain fire and destruction + AssignCommand ( oDM, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect ( VFX_FNF_METEOR_SWARM), lDMLoc)); + AssignCommand ( oDM, DelayCommand (1.0, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect (VFX_FNF_SCREEN_SHAKE), lDMLoc))); + + // create some fires + object oTargetArea = GetArea(oDM); + int nXPos, nYPos, nCount; + for (nCount = 0; nCount < 15; nCount++) + { + nXPos = Random(30) - 15; + nYPos = Random(30) - 15; + + vector vNewVector = GetPosition(oDM); + vNewVector.x += nXPos; + vNewVector.y += nYPos; + + location lFireLoc = Location(oTargetArea, vNewVector, 0.0); + object oFire = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_flamelarge", lFireLoc, FALSE); + object oDust = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_dustplume", lFireLoc, FALSE); + DelayCommand ( 10.0, DestroyObject ( oFire)); + DelayCommand ( 14.0, DestroyObject ( oDust)); + } + +} + +//////////////////////////////////////////////////////////////////////// +//An FX Wand function +void FXWand_Earthquake(object oDM) +{ + // Earthquake Effect by Jhenne, 06/29/02 + // declare variables used for targetting and commands. + location lDMLoc = GetLocation ( oDM); + + // tell the DM object to shake the screen + AssignCommand( oDM, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), lDMLoc)); + AssignCommand ( oDM, DelayCommand( 2.8, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect ( VFX_FNF_SCREEN_BUMP), lDMLoc))); + AssignCommand ( oDM, DelayCommand( 3.0, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect ( VFX_FNF_SCREEN_SHAKE), lDMLoc))); + AssignCommand ( oDM, DelayCommand( 4.5, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect ( VFX_FNF_SCREEN_BUMP), lDMLoc))); + AssignCommand ( oDM, DelayCommand( 5.8, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect ( VFX_FNF_SCREEN_BUMP), lDMLoc))); + // tell the DM object to play an earthquake sound + AssignCommand ( oDM, PlaySound ("as_cv_boomdist1")); + AssignCommand ( oDM, DelayCommand ( 2.0, PlaySound ("as_wt_thunderds3"))); + AssignCommand ( oDM, DelayCommand ( 4.0, PlaySound ("as_cv_boomdist1"))); + // create a dust plume at the DM and clicking location + object oTargetArea = GetArea(oDM); + int nXPos, nYPos, nCount; + for (nCount = 0; nCount < 15; nCount++) + { + nXPos = Random(30) - 15; + nYPos = Random(30) - 15; + + vector vNewVector = GetPosition(oDM); + vNewVector.x += nXPos; + vNewVector.y += nYPos; + + location lDustLoc = Location(oTargetArea, vNewVector, 0.0); + object oDust = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_dustplume", lDustLoc, FALSE); + DelayCommand ( 4.0, DestroyObject ( oDust)); + } +} + +//////////////////////////////////////////////////////////////////////// +//An FX Wand function +void FXWand_Lightning(object oDM, location lDMLoc) +{ + // Lightning Strike by Jhenne. 06/29/02 + // tell the DM object to create a Lightning visual effect at targetted location + AssignCommand( oDM, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), lDMLoc)); + // tell the DM object to play a thunderclap + AssignCommand ( oDM, PlaySound ("as_wt_thundercl3")); + // create a scorch mark where the lightning hit + object oScorch = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_weathmark", lDMLoc, FALSE); + object oTargetArea = GetArea(oDM); + int nXPos, nYPos, nCount; + for (nCount = 0; nCount < 5; nCount++) + { + nXPos = Random(10) - 5; + nYPos = Random(10) - 5; + + vector vNewVector = GetPositionFromLocation(lDMLoc); + vNewVector.x += nXPos; + vNewVector.y += nYPos; + + location lNewLoc = Location(oTargetArea, vNewVector, 0.0); + AssignCommand( oDM, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_S), lNewLoc)); + } + DelayCommand ( 20.0, DestroyObject ( oScorch)); +} + +//////////////////////////////////////////////////////////////////////// +void FnFEffect(object oUser, int iVFX, location lEffect, float fDelay) +{ + if (fDelay>2.0) FloatingTextStringOnCreature("Delay effect created", oUser, FALSE); + DelayCommand( fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iVFX),lEffect)); +} + +//////////////////////////////////////////////////////////////////////// +void CreateEffects(int iEffect, location lEffect, object oUser) +{ + float fDelay; + float fDuration; + float fBeamDuration; + object oTarget; + + if (GetIsDMPossessed(oUser)) + { + fDelay = GetLocalFloat(GetMaster(oUser), "dmfi_effectdelay"); + fDuration = GetLocalFloat(GetMaster(oUser), "dmfi_effectduration"); + fBeamDuration = GetLocalFloat(GetMaster(oUser), "dmfi_beamduration"); + } + else + { + fDelay = GetLocalFloat(oUser, "dmfi_effectdelay"); + fDuration = GetLocalFloat(oUser, "dmfi_effectduration"); + fBeamDuration = GetLocalFloat(oUser, "dmfi_beamduration"); + } + + if (!GetIsObjectValid(GetLocalObject(oUser, "dmfi_univ_target"))) + oTarget = oUser; + else + oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + switch (iEffect) + { + //SoU/HotU Duration Effects(must have a target) + case 101: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_CLENCHED_FIST), oTarget, fDuration); break; + case 102: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_CRUSHING_HAND), oTarget, fDuration); break; + case 103: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_GRASPING_HAND), oTarget, fDuration); break; + case 104: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_INTERPOSING_HAND), oTarget, fDuration); break; + case 105: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ICESKIN), oTarget, fDuration); break; + case 106: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_INFERNO), oTarget, fDuration); break; + case 107: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PIXIEDUST), oTarget, fDuration); break; + case 108: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget, fDuration); break; + case 109: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION), oTarget, fDuration); break; + case 100: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOSTLY_PULSE), oTarget, fDuration); break; + //Magical Duration Effects + case 10: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CALTROPS),lEffect, fDuration); break; + case 11: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_TENTACLE),lEffect, fDuration); break; + case 12: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_WEB_MASS),lEffect, fDuration); break; + case 13: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_MIND,lEffect, fDelay); break; + case 14: FnFEffect(oUser, VFX_FNF_LOS_HOLY_30,lEffect, fDelay); break; + case 15: FnFEffect(oUser, VFX_FNF_LOS_EVIL_30,lEffect, fDelay); break; + case 16: FnFEffect(oUser, VFX_FNF_SMOKE_PUFF,lEffect, fDelay); break; + case 17: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_NATURE,lEffect, fDelay); break; + case 18: FnFEffect(oUser, VFX_FNF_DISPEL_DISJUNCTION,lEffect, fDelay); break; + case 19: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_EVIL,lEffect, fDelay); break; + //Magical Status Effects (must have a target) + case 21: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oTarget, fDuration); break; + case 22: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN), oTarget, fDuration); break; + case 23: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ENTANGLE), oTarget, fDuration); break; + case 24: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ETHEREAL_VISAGE), oTarget, fDuration); break; + case 25: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE), oTarget, fDuration); break; + case 26: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_INVISIBILITY), oTarget, fDuration); break; + case 27: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BARD_SONG), oTarget, fDuration); break; + case 28: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY), oTarget, fDuration); break; + case 29: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PARALYZED), oTarget, fDuration); break; + case 20: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR), oTarget, fDuration); break; + //Magical Burst Effects + case 31: FnFEffect(oUser, VFX_FNF_FIREBALL,lEffect, fDelay); break; + case 32: FnFEffect(oUser, VFX_FNF_FIRESTORM,lEffect, fDelay); break; + case 33: FnFEffect(oUser, VFX_FNF_HORRID_WILTING,lEffect, fDelay); break; + case 34: FnFEffect(oUser, VFX_FNF_HOWL_WAR_CRY,lEffect, fDelay); break; + case 35: FnFEffect(oUser, VFX_FNF_IMPLOSION,lEffect, fDelay); break; + case 36: FnFEffect(oUser, VFX_FNF_PWKILL,lEffect, fDelay); break; + case 37: FnFEffect(oUser, VFX_FNF_PWSTUN,lEffect, fDelay); break; + case 38: FnFEffect(oUser, VFX_FNF_SOUND_BURST,lEffect, fDelay); break; + case 39: FnFEffect(oUser, VFX_FNF_STRIKE_HOLY,lEffect, fDelay); break; + case 30: FnFEffect(oUser, VFX_FNF_WORD,lEffect, fDelay); break; + //Lighting Effects + case 41: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BLACKOUT),lEffect, fDuration); break; + case 42: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10),oTarget, fDuration); break; + case 43: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_BLUE_20),oTarget, fDuration); break; + case 44: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_GREY_20),oTarget, fDuration); break; + case 45: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_ORANGE_20),oTarget, fDuration); break; + case 46: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_PURPLE_20),oTarget, fDuration); break; + case 47: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_20),oTarget, fDuration); break; + case 48: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20),oTarget, fDuration); break; + case 49: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20),oTarget, fDuration); break; + //Beam Effects + case 50: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_CHAIN, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 51: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_COLD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 52: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_EVIL, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 53: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 54: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE_LASH, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 55: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_HOLY, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 56: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 57: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_MIND, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 58: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_ODD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 59: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_COLD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_EVIL, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE_LASH, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_HOLY, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_MIND, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_ODD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + + //Environmental Effects + case 60: FnFEffect(oUser, VFX_FNF_NATURES_BALANCE,lEffect, fDelay);break; + case 61: FXWand_Lightning(oTarget, lEffect); break; + case 62: FXWand_Firestorm(oTarget); break; + case 63: FXWand_Earthquake(oTarget); break; + case 64: FnFEffect(oUser, VFX_FNF_ICESTORM,lEffect, fDelay); break; + case 65: FnFEffect(oUser, VFX_FNF_SUNBEAM,lEffect, fDelay); break; + case 66: SetWeather(GetArea(oUser), WEATHER_CLEAR); break; + case 67: SetWeather(GetArea(oUser), WEATHER_RAIN); break; + case 68: SetWeather(GetArea(oUser), WEATHER_SNOW); break; + case 69: SetWeather(GetArea(oUser), WEATHER_USE_AREA_SETTINGS); break; + //Summon Effects + case 71: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_1,lEffect, fDelay); break; + case 72: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_2,lEffect, fDelay); break; + case 73: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_3,lEffect, fDelay); break; + case 74: FnFEffect(oUser, VFX_FNF_SUMMON_CELESTIAL,lEffect, fDelay); break; + case 75: FnFEffect(oUser, VFX_FNF_SUMMONDRAGON,lEffect, fDelay); break; + case 76: FnFEffect(oUser, VFX_FNF_SUMMON_EPIC_UNDEAD,lEffect, fDelay); break; + case 77: FnFEffect(oUser, VFX_FNF_SUMMON_GATE,lEffect, fDelay); break; + case 78: FnFEffect(oUser, VFX_FNF_SUMMON_UNDEAD,lEffect, fDelay); break; + case 79: FnFEffect(oUser, VFX_FNF_UNDEAD_DRAGON,lEffect, fDelay); break; + case 70: FnFEffect(oUser, VFX_FNF_WAIL_O_BANSHEES,lEffect, fDelay); break; + //SoU/HotU Effects + case 80: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(322), oTarget, fDuration); break; + case 81: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(132), oTarget, fDuration); break; + case 82: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(133), oTarget, fDuration); break; + case 83: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(136), oTarget, fDuration); break; + case 84: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(137), oTarget, fDuration); break; + case 85: FnFEffect(oUser, VFX_FNF_DEMON_HAND,lEffect, fDelay); break; + case 86: FnFEffect(oUser, VFX_FNF_ELECTRIC_EXPLOSION,lEffect, fDelay); break; + case 87: FnFEffect(oUser, VFX_FNF_GREATER_RUIN,lEffect, fDelay); break; + case 88: FnFEffect(oUser, VFX_FNF_MYSTICAL_EXPLOSION,lEffect, fDelay); break; + case 89: FnFEffect(oUser, VFX_FNF_SWINGING_BLADE,lEffect, fDelay); break; + //Settings + case 91: + SetLocalString(oUser, "EffectSetting", "dmfi_effectduration"); + CreateSetting(oUser); + break; + case 92: + SetLocalString(oUser, "EffectSetting", "dmfi_effectdelay"); + CreateSetting(oUser); + break; + case 93: + SetLocalString(oUser, "EffectSetting", "dmfi_beamduration"); + CreateSetting(oUser); + break; + case 94: //Change Day Music + iDayMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iDayMusic > 33) iDayMusic = 49; + if (iDayMusic > 55) iDayMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeDay(GetArea(oUser), iDayMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 95: //Change Night Music + iNightMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iNightMusic > 33) iNightMusic = 49; + if (iNightMusic > 55) iNightMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeNight(GetArea(oUser), iNightMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 96: //Play Background Music + MusicBackgroundPlay(GetArea(oUser)); + break; + case 97: //Stop Background Music + MusicBackgroundStop(GetArea(oUser)); + break; + case 98: //Change and Play Battle Music + iBattleMusic = MusicBackgroundGetBattleTrack(GetArea(oUser)) + 1; + if (iBattleMusic < 34 || iBattleMusic > 48) iBattleMusic = 34; + MusicBattleStop(GetArea(oUser)); + MusicBattleChange(GetArea(oUser), iBattleMusic); + MusicBattlePlay(GetArea(oUser)); + break; + case 99: //Stop Battle Music + MusicBattleStop(GetArea(oUser)); + break; + + default: break; + } + DeleteLocalObject(oUser, "EffectTarget"); + return; +} + +//////////////////////////////////////////////////////////////////////// +//This function is for the DMFI Emote Wand +void DoEmoteFunction(int iEmote, object oUser) +{ + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + if (!GetIsObjectValid(oTarget)) + oTarget = oUser; + float fDur = 9999.0f; //Duration + + switch (iEmote) + { + case 1: AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_DODGE_SIDE, 1.0)); break; + case 2: AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_DRINK, 1.0)); break; + case 3: AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_DODGE_DUCK, 1.0)); break; + case 4: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_DEAD_BACK, 1.0, fDur)); break; + case 5: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_DEAD_FRONT, 1.0, fDur)); break; + case 6: AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_READ, 1.0)); DelayCommand(3.0f, AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_READ, 1.0)));break; + case 7: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, fDur)); break; + case 81: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_TALK_PLEADING, 1.0, fDur)); break; + case 82: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_CONJURE1, 1.0, fDur)); break; + case 83: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_CONJURE2, 1.0, fDur)); break; + case 84: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_GET_LOW, 1.0, fDur)); break; + case 85: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_GET_MID, 1.0, fDur)); break; + case 86: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_MEDITATE, 1.0, fDur)); break; + case 87: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_TALK_FORCEFUL, 1.0, fDur)); break; + case 88: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_WORSHIP, 1.0, fDur)); break; + case 10: if (!GetLocalInt(oTarget, "hls_emotemute")) FloatingTextStringOnCreature("*emote* commands are off", oTarget, FALSE); + else FloatingTextStringOnCreature("*emote* commands are on", oTarget, FALSE); + SetLocalInt(oTarget, "hls_emotemute", abs(GetLocalInt(oTarget, "hls_emotemute") - 1)); break; + case 91: EmoteDance(oTarget); break; + case 92: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_PAUSE_DRUNK, 1.0, fDur)); break; + case 93: AssignCommand(oTarget, ActionForceFollowObject(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget), 2.0f)); break; + case 94: SitInNearestChair(oTarget); break; + case 95: AssignCommand(oTarget, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, fDur)); DelayCommand(1.0f, AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_DRINK, 1.0))); DelayCommand(3.0f, AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, fDur)));break; + case 96: AssignCommand(oTarget, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, fDur)); DelayCommand(1.0f, AssignCommand(oTarget, PlayAnimation( ANIMATION_FIREFORGET_READ, 1.0))); DelayCommand(3.0f, AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, fDur)));break; + case 97: AssignCommand(oTarget, PlayAnimation( ANIMATION_LOOPING_SPASM, 1.0, fDur)); break; + case 98: SmokePipe(oTarget); break; + default: break; + } +} + +//////////////////////////////////////////////////////////////////////// +void DoBuff (int iChoice, object oUser) +{ + int nChoice = 0; + string sType; + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + int Party = GetLocalInt(oUser, "dmfi_buff_party"); + int CL; + int nSpell1 = SPELL_ALL_SPELLS; + int nSpell2 = SPELL_ALL_SPELLS; + int nSpell3 = SPELL_ALL_SPELLS; + + + switch (iChoice) + { + case 10: nChoice = -1; break; + case 11: nChoice = SPELL_AURA_OF_VITALITY; break; + case 12: nChoice = SPELL_BARKSKIN; break; + case 13: nChoice = SPELL_BATTLETIDE; break; + case 14: nChoice = SPELL_BLESS; break; + case 16: nChoice = SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE; break; + case 17: nChoice = SPELL_CLARITY; break; + case 18: nChoice = SPELL_DEATH_WARD; break; + case 19: nChoice = SPELL_DISPLACEMENT; break; + case 20: nChoice = -1; break; + case 21: nChoice = SPELL_DIVINE_FAVOR; break; + case 22: nChoice = SPELL_DIVINE_POWER; break; + case 23: nChoice = SPELL_ENDURE_ELEMENTS; break; + case 24: nChoice = SPELL_ENTROPIC_SHIELD; break; + case 25: nChoice = SPELL_ELEMENTAL_SHIELD; break; + case 26: nChoice = SPELL_ENERGY_BUFFER; break; + case 27: nChoice = SPELL_ETHEREAL_VISAGE; break; + case 28: nChoice = SPELL_GHOSTLY_VISAGE; break; + case 29: nChoice = SPELL_GLOBE_OF_INVULNERABILITY; break; + case 30: nChoice = -1; break; + case 31: nChoice = SPELL_SANCTUARY; break; + case 32: nChoice = SPELL_GREATER_STONESKIN; break; + case 33: nChoice = SPELL_GREATER_SPELL_MANTLE; break; + case 34: nChoice = SPELL_HASTE; break; + case 35: nChoice = SPELL_INVISIBILITY; break; + case 36: nChoice = SPELL_IMPROVED_INVISIBILITY; break; + case 37: nChoice = SPELL_LESSER_MIND_BLANK;break; + case 38: nChoice = SPELL_LESSER_SPELL_MANTLE; break; + case 39: nChoice = SPELL_MAGE_ARMOR; break; + case 40: nChoice = -1; break; + case 41: nChoice = SPELL_MESTILS_ACID_SHEATH; break; + case 42: nChoice = SPELL_MONSTROUS_REGENERATION; break; + case 43: nChoice = SPELL_PRAYER; break; + case 44: nChoice = SPELL_PREMONITION; break; + case 45: nChoice = SPELL_PROTECTION_FROM_ELEMENTS; break; + case 46: nChoice = SPELL_PROTECTION_FROM_SPELLS; break; + case 47: nChoice = SPELL_REGENERATE; break; + case 48: nChoice = SPELL_RESIST_ELEMENTS; break; + case 49: nChoice = SPELL_SHADOW_SHIELD; break; + case 50: nChoice = -1; break; + case 51: nChoice = SPELL_SHIELD; break; + case 52: nChoice = SPELL_SPELL_MANTLE; break; + case 53: nChoice = SPELL_SPELL_RESISTANCE; break; + case 54: nChoice = SPELL_STONE_BONES; break; + case 55: nChoice = SPELL_STONESKIN; break; + case 56: nChoice = SPELL_TENSERS_TRANSFORMATION; break; + case 57: nChoice = SPELL_TRUE_SEEING; break; + case 58: nChoice = SPELL_DARKNESS; break; + case 59: nChoice = SPELL_WAR_CRY; break; + case 60: nChoice = -1; break; + case 61: sType = "BARD_DEF"; break; + case 62: sType = "BARD_OFF"; break; + case 63: sType = "CLERIC_DEF"; break; + case 64: sType = "CLERIC_OFF"; break; + case 65: sType = "DRUID_DEF"; break; + case 66: sType = "DRUID_OFF"; break; + case 67: sType = "MAGE_DEF"; break; + case 68: sType = "MAGE_OFF"; break; + case 70: nChoice = -1; break; + case 71: sType = "ARMOR"; break; + case 72: sType = "ELEMENTAL"; break; + case 73: sType = "INVIS"; break; + case 74: sType = "MELEE"; break; + case 75: sType = "MIND"; break; + case 76: sType = "SHIELD"; break; + case 77: sType = "SP_PROT"; break; + case 78: sType = "STEALTH"; break; + + case 81: DMFI_NextTarget(oTarget, oUser); nChoice = -1; break; + case 82: SetLocalString(oUser, "dmfi_buff_level", "LOW"); nChoice = -1; + FloatingTextStringOnCreature("Buff level LOW", oUser); + SetCustomToken(20782, "Low"); + SetDMFIPersistentString("dmfi", "dmfi_buff_level", "LOW", oUser); + break; + case 83: SetLocalString(oUser, "dmfi_buff_level", "MID"); nChoice = -1; + FloatingTextStringOnCreature("Buff level MID", oUser); + SetCustomToken(20782, "Mid"); + SetDMFIPersistentString("dmfi", "dmfi_buff_level", "MID", oUser); + break; + case 84: SetLocalString(oUser, "dmfi_buff_level", "HIGH"); nChoice = -1; + FloatingTextStringOnCreature("Buff level HIGH", oUser); + SetCustomToken(20782, "High"); + SetDMFIPersistentString("dmfi", "dmfi_buff_level", "HIGH", oUser); + break; + case 85: SetLocalString(oUser, "dmfi_buff_level", "EPIC"); nChoice = -1; + FloatingTextStringOnCreature("Buff level EPIC", oUser); + SetCustomToken(20782, "Epic"); + SetDMFIPersistentString("dmfi", "dmfi_buff_level", "EPIC", oUser); + break; + case 86: { + if (GetLocalInt(oUser, "dmfi_buff_party")==1) + { + SetLocalInt(oUser, "dmfi_buff_party", 0); + FloatingTextStringOnCreature("Buff set to single target", oUser); + SetCustomToken(20783, "Single Target"); + SetDMFIPersistentInt("dmfi","dmfi_buff_party", 0, oUser); + } + else + { + SetLocalInt(oUser, "dmfi_buff_party", 1); + FloatingTextStringOnCreature("Buff set to party mode", oUser); + SetCustomToken(20783, "Party"); + SetDMFIPersistentInt("dmfi","dmfi_buff_party", 1, oUser); + } + } + case 80: nChoice = -1; break; + default: nChoice = -1; break; + } + + + if (nChoice==-1) + return; + +//set caster level based on set level + string sLevel = GetLocalString(oUser, "dmfi_buff_level"); + + if (sLevel == "LOW") CL = 5; + else if (sLevel == "MID") CL = 10; + else if (sLevel == "HIGH") CL = 15; + else if (sLevel == "EPIC") CL = 20; + + if (nChoice == 0) //only get here if nChoice NOT set + { + string BUFF_TYPE = sType + "_" + sLevel; + + if (BUFF_TYPE == "BARD_DEF_LOW") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_MAGE_ARMOR; + nSpell3 = SPELL_GHOSTLY_VISAGE; + } + else if (BUFF_TYPE =="BARD_OFF_LOW") + { + nSpell1 = SPELL_BULLS_STRENGTH; + nSpell2 = SPELL_MAGE_ARMOR; + nSpell3 = SPELL_MAGIC_WEAPON; + } + else if (BUFF_TYPE == "BARD_DEF_MID") + { + nSpell1 = SPELL_IMPROVED_INVISIBILITY; + nSpell2 = SPELL_GHOSTLY_VISAGE; + nSpell3 = SPELL_CLARITY; + } + else if (BUFF_TYPE == "BARD_OFF_MID") + { + nSpell1 = SPELL_WAR_CRY; + nSpell2 = SPELL_SUMMON_CREATURE_V; + nSpell3 = SPELL_ETHEREAL_VISAGE; + } + else if (BUFF_TYPE == "BARD_DEF_HIGH") + { + nSpell1 = SPELL_ETHEREAL_VISAGE; + nSpell2 = SPELL_IMPROVED_INVISIBILITY; + nSpell3 = SPELL_HASTE; + } + else if (BUFF_TYPE == "BARD_OFF_HIGH") + { + nSpell1 = SPELL_ETHEREAL_VISAGE; + nSpell2 = SPELL_SUMMON_CREATURE_V; + nSpell3 = SPELL_WAR_CRY; + } + else if (BUFF_TYPE == "BARD_DEF_EPIC") + { + nSpell1 = SPELL_ETHEREAL_VISAGE; + nSpell2 = SPELL_ENERGY_BUFFER; + nSpell3 = SPELL_IMPROVED_INVISIBILITY; + } + else if (BUFF_TYPE == "BARD_OFF_EPIC") + { + nSpell1 = SPELL_ETHEREAL_VISAGE; + nSpell2 = SPELL_SUMMON_CREATURE_VI; + nSpell3 = SPELL_MASS_HASTE; + } + + else if (BUFF_TYPE == "MAGE_DEF_LOW") + { + nSpell1 = SPELL_CLARITY; + nSpell2 = SPELL_GHOSTLY_VISAGE; + nSpell3 = SPELL_PROTECTION_FROM_ELEMENTS; + } + else if (BUFF_TYPE == "MAGE_OFF_LOW") + { + nSpell1 = SPELL_GHOSTLY_VISAGE; + nSpell2 = SPELL_DEATH_ARMOR; + nSpell3 = SPELL_HASTE; + } + else if (BUFF_TYPE == "MAGE_DEF_MID") + { + nSpell1 = SPELL_LESSER_SPELL_MANTLE; + nSpell2 = SPELL_STONESKIN; + nSpell3 = SPELL_ELEMENTAL_SHIELD; + } + else if (BUFF_TYPE == "MAGE_OFF_MID") + { + nSpell1 = SPELL_SPELL_MANTLE; + nSpell2 = SPELL_IMPROVED_INVISIBILITY; + nSpell3 = SPELL_SUMMON_CREATURE_V; + } + else if (BUFF_TYPE == "MAGE_DEF_HIGH") + { + nSpell1 = SPELL_SPELL_MANTLE; + nSpell2 = SPELL_SANCTUARY; + nSpell3 = SPELL_MINOR_GLOBE_OF_INVULNERABILITY; + } + else if (BUFF_TYPE == "MAGE_OFF_HIGH") + { + nSpell1 = SPELL_ETHEREAL_VISAGE; + nSpell2 = SPELL_SUMMON_CREATURE_VIII; + nSpell3 = SPELL_SPELL_MANTLE; + } + else if (BUFF_TYPE == "MAGE_DEF_EPIC") + { + nSpell1 = SPELL_PREMONITION; + nSpell2 = SPELL_SPELL_MANTLE; + nSpell3 = SPELL_GLOBE_OF_INVULNERABILITY; + } + else if (BUFF_TYPE == "MAGE_OFF_EPIC") + { + nSpell1 = SPELL_PREMONITION; + nSpell2 = SPELL_MORDENKAINENS_SWORD; + nSpell3 = SPELL_GLOBE_OF_INVULNERABILITY; + } + else if (BUFF_TYPE == "CLERIC_DEF_LOW") + { + nSpell1 = SPELL_PROTECTION_FROM_ELEMENTS; + nSpell2 = SPELL_CLARITY; + nSpell3 = SPELL_DARKVISION; + } + else if (BUFF_TYPE == "CLERIC_OFF_LOW") + { + nSpell1 = SPELL_PRAYER; + nSpell2 = SPELL_MAGIC_VESTMENT; + nSpell3 = SPELL_BULLS_STRENGTH; + } + else if (BUFF_TYPE == "CLERIC_MID_DEF") + { + nSpell1 = SPELL_SANCTUARY; + nSpell2 = SPELL_SPELL_RESISTANCE; + nSpell3 = SPELL_TRUE_SEEING; + } + else if (BUFF_TYPE == "CLERIC_OFF_MID") + { + nSpell1 = SPELL_SUMMON_CREATURE_VI; + nSpell2 = SPELL_BATTLETIDE; + nSpell3 = SPELL_MONSTROUS_REGENERATION; + } + else if (BUFF_TYPE == "CLERIC_DEF_HIGH") + { + nSpell1 = SPELL_SANCTUARY; + nSpell2 = SPELL_REGENERATE; + nSpell3 = SPELL_MONSTROUS_REGENERATION; + } + else if (BUFF_TYPE == "CLERIC_OFF_HIGH") + { + nSpell1 = SPELL_SUMMON_CREATURE_VIII; + nSpell2 = SPELL_REGENERATE; + nSpell3 = SPELL_BATTLETIDE; + } + else if (BUFF_TYPE == "CLERIC_DEF_EPIC") + { + nSpell1 = SPELL_UNDEATHS_ETERNAL_FOE; + nSpell2 = SPELL_REGENERATE; + nSpell3 = SPELL_SANCTUARY; + } + else if (BUFF_TYPE == "CLERIC_OFF_EPIC") + { + nSpell1 = SPELL_SUMMON_CREATURE_IX; + nSpell2 = SPELL_REGENERATE; + nSpell3 = SPELL_BATTLETIDE; + } + else if (BUFF_TYPE == "DRUID_DEF_LOW") + { + nSpell1 = SPELL_PROTECTION_FROM_ELEMENTS; + nSpell2 = SPELL_BARKSKIN; + nSpell3 = SPELL_ONE_WITH_THE_LAND; + } + else if (BUFF_TYPE == "DRUID_OFF_LOW") + { + nSpell1 = SPELL_GREATER_MAGIC_FANG; + nSpell2 = SPELL_BULLS_STRENGTH; + nSpell3 = SPELL_BLOOD_FRENZY; + } + else if (BUFF_TYPE == "DRUID_DEF_MID") + { + nSpell1 = SPELL_SPELL_RESISTANCE; + nSpell2 = SPELL_MONSTROUS_REGENERATION; + nSpell3 = SPELL_STONESKIN; + } + else if (BUFF_TYPE == "DRUID_OFF_MID") + { + nSpell1 = SPELL_STONESKIN; + nSpell2 = SPELL_FREEDOM_OF_MOVEMENT; + nSpell3 = SPELL_MASS_CAMOFLAGE; + } + else if (BUFF_TYPE == "DRUID_DEF_HIGH") + { + nSpell1 = SPELL_PREMONITION; + nSpell2 = SPELL_TRUE_SEEING; + nSpell3 = SPELL_GREATER_STONESKIN; + } + else if (BUFF_TYPE == "DRUID_OFF_HIGH") + { + nSpell1 = SPELL_SUMMON_CREATURE_VIII; + nSpell2 = SPELL_AURA_OF_VITALITY; + nSpell3 = SPELL_ENERGY_BUFFER; + } + else if (BUFF_TYPE == "DRUID_DEF_EPIC") + { + nSpell1 = SPELL_ELEMENTAL_SWARM; + nSpell2 = SPELL_PREMONITION; + nSpell3 = SPELL_TRUE_SEEING; + } + else if (BUFF_TYPE == "DRUID_OFF_EPIC") + { + nSpell1 = SPELL_PREMONITION; + nSpell2 = SPELL_SHAPECHANGE; + nSpell3 = SPELL_AURA_OF_VITALITY; + } + else if (BUFF_TYPE == "AMROR_LOW") + { + nSpell1 = SPELL_MAGE_ARMOR; + nSpell2 = SPELL_INVISIBILITY_PURGE; + } + else if (BUFF_TYPE == "ARMOR_MID") + { + nSpell1 = SPELL_MAGE_ARMOR; + nSpell2 = SPELL_DARKVISION; + nSpell3 = SPELL_INVISIBILITY_PURGE; + } + else if (BUFF_TYPE == "ARMOR_HIGH") + { + nSpell1 = SPELL_MAGE_ARMOR; + nSpell2 = SPELL_STONESKIN; + nSpell3 = SPELL_GHOSTLY_VISAGE; + } + else if (BUFF_TYPE == "ARMOR_EPIC") + { + nSpell1 = SPELL_GHOSTLY_VISAGE; + nSpell2 = SPELL_MAGE_ARMOR; + nSpell3 = SPELL_PREMONITION; + } + else if (BUFF_TYPE == "ELEMENTAL_LOW") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_ENDURE_ELEMENTS; + nSpell3 = SPELL_ENDURANCE; + } + else if (BUFF_TYPE == "ELEMENTAL_MID") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_RESIST_ELEMENTS; + nSpell3 = SPELL_ENDURANCE; + } + else if (BUFF_TYPE == "ELEMENTAL_HIGH") + { + nSpell1 = SPELL_ENDURANCE; + nSpell2 = SPELL_STONESKIN; + nSpell3 = SPELL_PROTECTION_FROM_ELEMENTS; + } + else if (BUFF_TYPE == "ELEMENTAL_EPIC") + { + nSpell1 = SPELL_STONESKIN; + nSpell2 = SPELL_ENERGY_BUFFER; + nSpell3 = SPELL_ENDURANCE; + } + else if (BUFF_TYPE == "INVIS_LOW") + { + nSpell1 = SPELL_CATS_GRACE; + nSpell2 = SPELL_INVISIBILITY; + } + else if (BUFF_TYPE == "INVIS_MID") + { + nSpell1 = SPELL_CATS_GRACE; + nSpell2 = SPELL_MAGE_ARMOR; + nSpell3 = SPELL_INVISIBILITY_SPHERE; + } + else if (BUFF_TYPE == "INVIS_HIGH") + { + nSpell1 = SPELL_MAGE_ARMOR; + nSpell2 = SPELL_CATS_GRACE; + nSpell3 = SPELL_IMPROVED_INVISIBILITY; + } + else if (BUFF_TYPE == "INVIS_EPIC") + { + nSpell1 = SPELL_MAGE_ARMOR; + nSpell2 = SPELL_HASTE; + nSpell3 = SPELL_SANCTUARY; + } + else if (BUFF_TYPE == "MELEE_LOW") + { + nSpell1 = SPELL_MAGIC_WEAPON; + nSpell2 = SPELL_BULLS_STRENGTH; + nSpell3 = SPELL_STONE_BONES; + } + else if (BUFF_TYPE == "MELEE_MID") + { + nSpell1 = SPELL_BULLS_STRENGTH; + nSpell2 = SPELL_STONESKIN; + nSpell3 = SPELL_GREATER_MAGIC_WEAPON; + } + else if (BUFF_TYPE == "MELEE_HIGH") + { + nSpell1 = SPELL_ENDURANCE; + nSpell2 = SPELL_GREATER_STONESKIN; + nSpell3 = SPELL_KEEN_EDGE; + } + else if (BUFF_TYPE == "MELEE_EPIC") + { + nSpell1 = SPELL_TENSERS_TRANSFORMATION; + nSpell2 = SPELL_PREMONITION; + nSpell3 = SPELL_BULLS_STRENGTH; + } + else if (BUFF_TYPE == "MIND_LOW") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_CLARITY; + } + else if (BUFF_TYPE == "MIND_MID") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_OWLS_WISDOM; + nSpell3 = SPELL_LESSER_MIND_BLANK; + } + else if (BUFF_TYPE == "MIND_HIGH") + { + nSpell1 = SPELL_OWLS_WISDOM; + nSpell2 = SPELL_MAGE_ARMOR; + nSpell3 = SPELL_LESSER_MIND_BLANK; + } + else if (BUFF_TYPE == "MIND_EPIC") + { + nSpell1 = SPELL_OWLS_WISDOM; + nSpell2 = SPELL_LESSER_MIND_BLANK; + nSpell3 = SPELL_HASTE; + } + else if (BUFF_TYPE == "SHIELD_LOW") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_INVISIBILITY; + } + else if (BUFF_TYPE == "SHIELD_MID") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_PRAYER; + nSpell3 = SPELL_INVISIBILITY_SPHERE; + } + else if (BUFF_TYPE == "SHIELD_HIGH") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_GHOSTLY_VISAGE; + nSpell3 = SPELL_ELEMENTAL_SHIELD; + } + else if (BUFF_TYPE == "SHIELD_EPIC") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_SHADOW_SHIELD; + nSpell3 = SPELL_SPELL_MANTLE; + } + else if (BUFF_TYPE == "SP_PROT_LOW") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_RESISTANCE; + nSpell3 = SPELL_GHOSTLY_VISAGE; + } + else if (BUFF_TYPE == "SP_PROT_MID") + { + nSpell1 = SPELL_RESISTANCE; + nSpell2 = SPELL_SHIELD; + nSpell3 = SPELL_LESSER_SPELL_MANTLE; + } + else if (BUFF_TYPE == "SP_PROT_HIGH") + { + nSpell1 = SPELL_SHIELD; + nSpell2 = SPELL_ETHEREAL_VISAGE; + nSpell3 = SPELL_GLOBE_OF_INVULNERABILITY; + } + else if (BUFF_TYPE == "SP_PROT_EPIC") + { + nSpell1 = SPELL_PROTECTION_FROM_SPELLS; + nSpell2 = SPELL_GREATER_SPELL_MANTLE; + nSpell3 = SPELL_ETHEREAL_VISAGE; + } + else if (BUFF_TYPE == "STEALTH_LOW") + { + nSpell1 = SPELL_CATS_GRACE; + nSpell2 = SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE; + } + else if (BUFF_TYPE == "STEALTH_MID") + { + nSpell1 = SPELL_CATS_GRACE; + nSpell2 = SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE; + nSpell3 = SPELL_DISPLACEMENT; + } + else if (BUFF_TYPE == "STEALTH_HIGH") + { + nSpell1 = SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE; + nSpell2 = SPELL_CATS_GRACE; + nSpell3 = SPELL_IMPROVED_INVISIBILITY; + } + else if (BUFF_TYPE == "STEALTH_EPIC") + { + nSpell1 = SPELL_CATS_GRACE; + nSpell2 = SPELL_ETHEREAL_VISAGE; + nSpell3 = SPELL_IMPROVED_INVISIBILITY; + } + } + else + { + nSpell1 = nChoice; //set up the single buffs if they were initialized by the choice + } + + string sParty = "target"; + if (Party==1) + { + sParty = "party"; + object oParty = GetFirstFactionMember(oTarget, FALSE); + while (GetIsObjectValid(oParty)) + { + AssignCommand(oTarget, ClearAllActions()); + if (nSpell1!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell1, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + if (nSpell2!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell2, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + if (nSpell3!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell3, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + oParty = GetNextFactionMember (oTarget); + } + } + else + { + AssignCommand(oTarget, ClearAllActions()); + if (nSpell1!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell1, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + if (nSpell2!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell2, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + if (nSpell3!=SPELL_ALL_SPELLS) + AssignCommand(oTarget, ActionCastSpellAtObject(nSpell3, oTarget, METAMAGIC_ANY, TRUE, CL, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + } + SendMessageToPC(oUser, "Buffs Applied to " + sParty + ". Caster Level: " + IntToString(CL)); +} + +//////////////////////////////////////////////////////////////////////// +void ToggleRestVariable(int iCurrent, int iChange, int iDefault, string sTextMessage = "", object oUser = OBJECT_INVALID, string sArea = "") +{ + string sOnOff = "ON"; + if (iCurrent & iChange) //If the variable already exists + { + if (iDefault) + { + sOnOff = "ON"; + } + else + { + sOnOff = "OFF"; + } //Remove the variable + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sArea, iCurrent & ~iChange); + if (sTextMessage != "") + FloatingTextStringOnCreature(sTextMessage + sOnOff, oUser, FALSE); + } + else //if the variable doesn't already exist + { + if (iDefault) + { + sOnOff = "OFF"; + } + else + { + sOnOff = "ON"; + } //Add the variable + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sArea, iCurrent | iChange); + if (sTextMessage != "") + FloatingTextStringOnCreature(sTextMessage + sOnOff, oUser, FALSE); + } +} + +//////////////////////////////////////////////////////////////////////// +void DoRestFunction(int iRest, object oUser) +{ + int iCurrentMod = GetDMFIPersistentInt("dmfi", "dmfi_r_"); + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + object oArea = GetArea(oUser); + object oLoop; + string sAreaTag = GetTag(oArea); + int iCurrentArea = GetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag); + + switch (iRest) + { + //Rest All PCs in the area for DMs, Rest for PCs + case 7: + if (GetIsDM(oUser)) + { + oLoop = GetFirstPC(); + while (GetIsObjectValid(oLoop)) + { + if (oArea == GetArea(oLoop)) + ForceRest(oLoop); + oLoop = GetNextPC(); + } + } + else + { + SetLocalInt(oUser, "dmfi_r_bypass", TRUE); AssignCommand(oUser, ActionRest()); + SetLocalInt(oUser, "dmfi_r_init", TRUE); + int iTime = GetTimeSecond() + GetTimeMinute() * 60 + GetTimeHour() * 3600 + GetCalendarDay() * 24 * 3600 + GetCalendarMonth() *3600 * 24 * 28 + GetCalendarYear() * 24 * 28 * 12 * 3600; + SetLocalInt(oUser, "dmfi_r_startseconds", iTime); + AssignCommand(oUser, ActionRest()); + } break; + case 8: + SetLocalString(oUser, "dmfi_univ_conv", "pc_emote"); + AssignCommand(oUser, ClearAllActions()); + AssignCommand(oUser, ActionStartConversation(OBJECT_SELF, "dmfi_universal", TRUE)); break; + case 9: + SetLocalString(oUser, "dmfi_univ_conv", "pc_dicebag"); + AssignCommand(oUser, ClearAllActions()); + AssignCommand(oUser, ActionStartConversation(OBJECT_SELF, "dmfi_universal", TRUE)); break; + case 11: //Set Unlimited Rest (module): default is ON + iCurrentMod = iCurrentMod & ~0x00000002; //Remove No Rest, if it exists + //Toggle the current Unlimited Rest Variable + ToggleRestVariable(iCurrentMod, 0x00000001, TRUE, "GLOBAL: Unlimited Rest is ", oUser); break; + case 12: //Set No Rest (module): default is OFF + iCurrentMod = iCurrentMod | 0x00000001; //Remove Unlimited Rest, if it exists + //Toggle the current No Rest Variable + ToggleRestVariable(iCurrentMod, 0x00000002, FALSE, "GLOBAL: No Rest is ", oUser); break; + case 13: //Limit Rest by Time: default is OFF + ToggleRestVariable(iCurrentMod, 0x00000004, FALSE, "GLOBAL: Limited Rest - Time is ", oUser); break; + case 14: //Limit Rest by Placeables: default is OFF + ToggleRestVariable(iCurrentMod, 0x00000008, FALSE, "GLOBAL: Limited Rest - Placeables is ", oUser); break; + case 15: //Limit Rest by Armor: default is OFF + ToggleRestVariable(iCurrentMod, 0x00000010, FALSE, "GLOBAL: Limited Rest - Armor is ", oUser); break; + case 16: //Limit Hit Points healed from resting: default is OFF + ToggleRestVariable(iCurrentMod, 0x00000020, FALSE, "GLOBAL: Limit Hit Points is ", oUser); break; + case 17: //Allow spell memorization: default is ON + ToggleRestVariable(iCurrentMod, 0x00000040, TRUE, "GLOBAL: Spell Memorization is ", oUser); break; + case 21: //Set Unlimited Rest (Local) + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod & ~0x00000002; //Remove No Rest, if it exists + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000001, TRUE, "LOCAL: Unlimited Rest is ", oUser, sAreaTag); + break; + case 22: //Set No Rest (module) + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000001; //Remove Unlimited Rest, if it exists + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000002, FALSE, "LOCAL: No Rest is ", oUser, sAreaTag); + break; + case 23: //Limit Rest by Time: default is OFF + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000004, FALSE, "LOCAL: Limited Rest - Time is ", oUser, sAreaTag); + break; + case 24: //Limit Rest by Placeables: default is OFF + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000008, FALSE, "LOCAL: Limited Rest - Placeables is ", oUser, sAreaTag); + break; + case 25: //Limit Rest by Armor: default is OFF + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000010, FALSE, "LOCAL: Limited Rest - Armor is ", oUser, sAreaTag); + break; + case 26: //Limit Hit Points healed from resting: default is OFF + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000020, FALSE, "LOCAL: Limit Hit Points is ", oUser, sAreaTag); + break; + case 27: //Allow spell memorization: default is ON + if (iCurrentArea & 0x00000080) + iCurrentMod = iCurrentArea; + iCurrentMod = iCurrentMod | 0x00000080; //Add Area Override bitflag + ToggleRestVariable(iCurrentMod, 0x00000040, FALSE, "LOCAL: Spell Restriction is ", oUser, sAreaTag); + break; + case 28: //Reset area to module defaults + FloatingTextStringOnCreature("Area set to module defaults", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, 0x00000000); + break; + case 31: //Set Time Limit to 1 game hour per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 1 game hour per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000100); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 1 game hour per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000100); + } break; + case 32: //Set Time Limit to 2 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 2 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000200); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 2 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000200); + } break; + case 33: //Set Time Limit to 4 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 4 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000300); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 4 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000300); + } break; + case 34: //Set Time Limit to 6 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 6 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000400); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 6 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000400); + } break; + case 35: //Set Time Limit to 8 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 8 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000500); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 8 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000500); + } break; + case 36: //Set Time Limit to 12 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 12 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000600); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 12 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000600); + } break; + case 37: //Set Time Limit to 24 game hours per day + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Time Limit set to 24 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00000700); + } + else + { + iCurrentMod = iCurrentMod & ~0x00000f00; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Time Limit set to 24 game hours per rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00000700); + } + case 41: //Toggle placeable flag: DMFI Placeables (tag = dmfi_rest), by default ON + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00001000, TRUE, "LOCAL: DMFI Placeables are ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00001000, TRUE, "GLOBAL: DMFI Placeables are ", oUser); + break; + case 42: //Toggle placeable flag: Campfires + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00002000, FALSE, "LOCAL: Campfire Placeables are ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00002000, FALSE, "GLOBAL: Campfire Placeables are ", oUser); + break; + case 43: //Toggle placeable flag: Bed Rolls + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00004000, FALSE, "LOCAL: Bed Roll Placeables are ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00004000, FALSE, "GLOBAL: Bed Roll Placeables are ", oUser); + break; + case 44: //Toggle placeable flag: Beds + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00008000, FALSE, "LOCAL: Bed Placeables are ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00008000, FALSE, "GLOBAL: Bed Placeables are ", oUser); + break; + case 45: //Toggle placeable flag: Tents + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00010000, FALSE, "LOCAL: Tent Placeables are ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00010000, FALSE, "GLOBAL: Tent Placeables are ", oUser); + break; + case 46: //Toggle placeable flag: Ignore Druids + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00020000, FALSE, "LOCAL: Ignore Druids for Placeable Checks is ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00020000, FALSE, "GLOBAL: Ignore Druids for Placeable Checks is ", oUser); + break; + case 47: //Toggle placeable flag: Ignore Rangers + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00040000, FALSE, "LOCAL: Ignore Rangers for Placeable Checks is ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00040000, FALSE, "GLOBAL: Ignore Rangers for Placeable Checks is ", oUser); + break; + case 48: //Toggle placeable flag: Ignore Barbarians + if (iCurrentArea & 0x00000080) + ToggleRestVariable(iCurrentArea, 0x00080000, FALSE, "LOCAL: Ignore Barbarians for Placeable Checks is ", oUser, sAreaTag); + else + ToggleRestVariable(iCurrentMod, 0x00080000, FALSE, "GLOBAL: Ignore Barbarians for Placeable Checks is ", oUser); + break; + case 51: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 2 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00100000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 2 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00100000); + } break; + case 52: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 6 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00200000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 6 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00200000); + } break; + case 53: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 11 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00300000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 11 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00300000); + } break; + case 54: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 16 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00400000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 16 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00400000); + } break; + case 55: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 31 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00500000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 31 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00500000); + } break; + case 56: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 41 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00600000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 41 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00600000); + } break; + case 57: //Set Armor Weight Restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: Armor Restriction set to 46 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x00700000); + } + else + { + iCurrentMod = iCurrentMod & ~0x00f00000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: Armor Restriction set to 46 pounds", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x00700000); + } break; + case 61: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: No hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x01000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: No hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x01000000); + } break; + case 62: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: 1 hitpoint/level regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x02000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: 1 hitpoint/level regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x02000000); + } break; + case 63: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: (CON) hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x03000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: (CON) hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x03000000); + } break; + case 64: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: 10 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x04000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: 10 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x04000000); + } break; + case 65: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: 25 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x05000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: 25 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x05000000); + } break; + case 66: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: 50 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea | 0x06000000); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: 50 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod | 0x06000000); + } break; + case 67: //Set Hit Point restrictions + if (iCurrentArea & 0x00000080) + { + iCurrentArea = iCurrentArea & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("LOCAL: 100 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_" + sAreaTag, iCurrentArea); + } + else + { + iCurrentMod = iCurrentMod & ~0x0f000000; //Erase current setting + FloatingTextStringOnCreature("GLOBAL: 100 percent of hitpoints regained on rest", oUser, FALSE); + SetDMFIPersistentInt("dmfi", "dmfi_r_", iCurrentMod); + } break; + case 101: //Use Rest Conversation Toggle + if (GetIsDM(oUser)) + ToggleRestVariable(iCurrentMod, 0x10000000, TRUE, "GLOBAL: Rest Conversation is ", oUser); + else + { + SetLocalInt(oUser, "dmfi_r_alternate", ANIMATION_LOOPING_MEDITATE); SetLocalInt(oUser, "dmfi_r_bypass", TRUE); AssignCommand(oUser, ActionRest()); + } break; + case 102: //Use Rest VFX + if (GetIsDM(oUser)) + ToggleRestVariable(iCurrentMod, 0x20000000, TRUE, "GLOBAL: Rest VFX are ", oUser); + else + { + SetLocalInt(oUser, "dmfi_r_alternate", ANIMATION_LOOPING_DEAD_FRONT); SetLocalInt(oUser, "dmfi_r_bypass", TRUE); AssignCommand(oUser, ActionRest()); + } break; + case 103: //Floating Text Feedback + if (GetIsDM(oUser)) + ToggleRestVariable(iCurrentMod, 0x40000000, TRUE, "GLOBAL: Floating Text Feedback is ", oUser); + else + { + SetLocalInt(oUser, "dmfi_r_alternate", ANIMATION_LOOPING_DEAD_BACK); SetLocalInt(oUser, "dmfi_r_bypass", TRUE); AssignCommand(oUser, ActionRest()); + } break; + case 104: //Immobilized Resting + if (GetIsDM(oUser)) + ToggleRestVariable(iCurrentMod, 0x80000000, TRUE, "GLOBAL: Immobile resting is ", oUser); + else + { + SetLocalInt(oUser, "dmfi_r_alternate", ANIMATION_LOOPING_WORSHIP); SetLocalInt(oUser, "dmfi_r_bypass", TRUE); AssignCommand(oUser, ActionRest()); + } break; + case 108: //All PCs in Area are Rested + break; + case 109: //All PCs are Rested + oLoop = GetFirstPC(); + while (GetIsObjectValid(oLoop)) + { + ForceRest(oLoop); + oLoop = GetNextPC(); + } + break; + } +} + +//////////////////////////////////////////////////////////////////////// +void main() +{ + string sDMFI = GetLocalString(OBJECT_SELF, "dmfi_univ_conv"); + int iDMFI = GetLocalInt(OBJECT_SELF, "dmfi_univ_int"); + location lDMFI = GetLocalLocation(OBJECT_SELF, "dmfi_univ_location"); + if (sDMFI == "emote" || sDMFI == "pc_emote") + DoEmoteFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "fx") + CreateEffects(iDMFI, lDMFI, OBJECT_SELF); + else if (sDMFI == "encounter") + CreateEncounter(iDMFI, lDMFI, OBJECT_SELF); + else if (sDMFI == "music") + DoMusicFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "xp") + DoXPFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "server") + dmwand_DoDialogChoice(iDMFI); + else if (sDMFI == "afflict") + DoAfflictFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "voice") + DoVoiceFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "sound") + DoSoundFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "onering") + DoOneRingFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "dicebag") + DoDMDiceBagFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "pc_dicebag") + DoDiceBagFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "faction") + DoControlFunction(iDMFI, OBJECT_SELF); + else if (sDMFI == "dmw") + DoNewDMThingy(iDMFI, OBJECT_SELF); + else if (sDMFI == "buff") + DoBuff(iDMFI, OBJECT_SELF); + else if (sDMFI == "rest") + DoRestFunction(iDMFI, OBJECT_SELF); + + DeleteLocalInt(OBJECT_SELF,"Tens"); +} + diff --git a/nwnds_module/dmfi_exploder.uti b/nwnds_module/dmfi_exploder.uti new file mode 100644 index 000000000..77f39d4d3 Binary files /dev/null and b/nwnds_module/dmfi_exploder.uti differ diff --git a/nwnds_module/dmfi_faction.uti b/nwnds_module/dmfi_faction.uti new file mode 100644 index 000000000..068f1f645 Binary files /dev/null and b/nwnds_module/dmfi_faction.uti differ diff --git a/nwnds_module/dmfi_fx.uti b/nwnds_module/dmfi_fx.uti new file mode 100644 index 000000000..cf173f408 Binary files /dev/null and b/nwnds_module/dmfi_fx.uti differ diff --git a/nwnds_module/dmfi_getln_cbtpl.ncs b/nwnds_module/dmfi_getln_cbtpl.ncs new file mode 100644 index 000000000..21dd76f9e Binary files /dev/null and b/nwnds_module/dmfi_getln_cbtpl.ncs differ diff --git a/nwnds_module/dmfi_getln_cbtpl.nss b/nwnds_module/dmfi_getln_cbtpl.nss new file mode 100644 index 000000000..1f218c4d5 --- /dev/null +++ b/nwnds_module/dmfi_getln_cbtpl.nss @@ -0,0 +1,35 @@ +//:://///////////////////////////////////////////// +//:: DMFI - DMFI_get_line callback template +//:: dmfi_getln_cbtpl +//::////////////////////////////////////////////// +/* + A template (skeleton) function for DMFI_get_line callback processing. + + Use this template to create your script to be invoked when your scripted call + to DMFI_get_line receives input. +*/ +//::////////////////////////////////////////////// +//:: Created By: tsunami282 +//:: Created On: 2008.05.21 +//::////////////////////////////////////////////// + +void main() +{ + int nVolume = GetPCChatVolume(); + object oShouter = GetPCChatSpeaker(); + string sSaid = GetPCChatMessage(); + + // you may wish to define an "abort" input message, such as a line + // containing a single period: + if (sSaid != ".") + { + // put your code here to process the input line (in sSaid) + + } + + // after processing, you will likely want to "eat" the text line, so it is + // not spoken or available for further processing. If you want the line to + // appear, either comment out the following line, or set it to: + // SetPCChatMessage(sSaid); + SetPCChatMessage(""); +} diff --git a/nwnds_module/dmfi_getln_inc.nss b/nwnds_module/dmfi_getln_inc.nss new file mode 100644 index 000000000..d9793a0b7 --- /dev/null +++ b/nwnds_module/dmfi_getln_inc.nss @@ -0,0 +1,61 @@ + +// DMFI_get_line: generic input line processing +// +// You can use this when you want to retrieve a spoken line of text. +// +// Specify the PC you want to listen to, the channel you want to listen on +// (often the TALK channel), and the name of the script to run when a line +// of text is heard. +// +// See the file dmfi_getln_cbtbl for a sample template script for processing +// the heard line. + +#include "dmfi_plychat_inc" + +const string DMFI_GETLINE_HOOK_HANDLE_VARNAME = "dmfi_getline_hookhandle"; + +/** + * + * @author tsunami282 + * @since 1.09 + * + * @param oSpeaker PC we want to listen to. + * @param iChannel voice channel to listen on (use TALKVOLUME_ constants). + * @param sEventScriptName sEventScriptName = name of script to call upon completion + * of input (cannot be blank). + * @param oRequester object requesting the result: the sEventScriptName script + * will be invoked with this as the caller, and therefore it + * must be valid at time of player chat event. + * @return handle (positive int) of the chat event hook +*/ +int DMFI_get_line(object oSpeaker, int iChannel, string sEventScriptName, + object oRequester = OBJECT_SELF) +{ + int hdlHook = 0; + + if (GetIsObjectValid(oSpeaker) && GetIsObjectValid(oRequester) && sEventScriptName != "") + { +// SendMessageToPC(GetFirstPC(), "getline - apply hook"); + hdlHook = DMFI_ChatHookAdd(sEventScriptName, oRequester, (1 << iChannel), + FALSE, oSpeaker, TRUE); +// SendMessageToPC(GetFirstPC(), "getline - hook handle returned is " + IntToString(hdlHook)); + SetLocalInt(oRequester, DMFI_GETLINE_HOOK_HANDLE_VARNAME, hdlHook); + } + + return hdlHook; +} + +/** + * + * + * + * @param hdlHookIn handle of hook handler that we want to un-hook. + * @param oRequester object requesting the result of DMFI_get_line +*/ +void DMFI_cancel_get_line(int hdlHookIn = 0, object oRequester = OBJECT_SELF) +{ + int hdlHook = hdlHookIn; + if (hdlHook == 0) hdlHook = GetLocalInt(oRequester, DMFI_GETLINE_HOOK_HANDLE_VARNAME); + DMFI_ChatHookRemove(hdlHook); +} + diff --git a/nwnds_module/dmfi_init_inc.nss b/nwnds_module/dmfi_init_inc.nss new file mode 100644 index 000000000..bef1c87b3 --- /dev/null +++ b/nwnds_module/dmfi_init_inc.nss @@ -0,0 +1,217 @@ + +#include "dmfi_db_inc" + +const int DMFI_DEFAULT_EMOTES_MUTED = FALSE; + +int dmfiInitialize(object oUser) +{ +//*************************************INITIALIZATION CODE*************************************** +//***************************************RUNS ONE TIME *************************************** + +//voice stuff is module wide + + if (GetLocalInt(GetModule(), "dmfi_initialized") != 1) + { + SendMessageToPC(oUser,":: DMFI Wands & Widgets System ::"); + int iLoop = 20610; + string sText; + while (iLoop < 20680) + { + sText = GetDMFIPersistentString("dmfi", "hls" + IntToString(iLoop)); + SetCustomToken(iLoop, sText); + iLoop++; + } + SendMessageToAllDMs("DMFI voice custom tokens initialized."); + + SetLocalInt(GetModule(), "dmfi_initialized", 1); + } + + +//remainder of settings are user based + + if ((GetLocalInt(oUser, "dmfi_initialized")!=1) && (GetIsDM(oUser) || GetIsDMPossessed(oUser))) + { + //if you have campaign variables set - use those settings + if (GetDMFIPersistentInt("dmfi", "Settings", oUser)==1) + { + FloatingTextStringOnCreature("DMFI Settings Restored", oUser, FALSE); + // SendMessageToPC(oUser, "DMFI Settings Restored"); + + int n = GetDMFIPersistentInt("dmfi", "dmfi_alignshift", oUser); + SetCustomToken(20781, IntToString(n)); + SetLocalInt(oUser, "dmfi_alignshift", n); + SendMessageToPC(oUser, "Settings: Alignment shift: "+IntToString(n)); + + n = GetDMFIPersistentInt("dmfi", "dmfi_safe_factions", oUser); + SetLocalInt(oUser, "dmfi_safe_factions", n); + SendMessageToPC(oUser, "Settings: Factions (1 is DMFI Safe Faction): "+IntToString(n)); + + n = GetDMFIPersistentInt("dmfi", "dmfi_damagemodifier", oUser); + SetLocalInt(oUser, "dmfi_damagemodifier",n); + SendMessageToPC(oUser, "Settings: Damage Modifier: "+IntToString(n)); + + n = GetDMFIPersistentInt("dmfi","dmfi_buff_party",oUser); + SetLocalInt(oUser, "dmfi_buff_party", n); + if (n==1) + SetCustomToken(20783, "Party"); + else + SetCustomToken(20783, "Single Target"); + + SendMessageToPC(oUser, "Settings: Buff Party (1 is Party): "+IntToString(n)); + + string sLevel = GetDMFIPersistentString("dmfi", "dmfi_buff_level", oUser); + SetCustomToken(20782, sLevel); + SetLocalString(oUser, "dmfi_buff_level", sLevel); + SendMessageToPC(oUser, "Settings: Buff Level: "+ sLevel); + + n = GetDMFIPersistentInt("dmfi", "dmfi_dicebag", oUser); + SetLocalInt(oUser, "dmfi_dicebag", n); + + string sText; + if (n==0) + { + SetCustomToken(20681, "Private"); + sText = "Private"; + } + else if (n==1) + { + SetCustomToken(20681, "Global"); + sText = "Global"; + } + else if (n==2) + { + SetCustomToken(20681, "Local"); + sText = "Local"; + } + else if (n==3) + { + SetCustomToken(20681, "DM Only"); + sText = "DM Only"; + } + SendMessageToPC(oUser, "Settings: Dicebag Reporting: "+sText); + + n = GetDMFIPersistentInt("dmfi", "dmfi_dice_no_animate", oUser); + SetLocalInt(oUser, "dmfi_dice_no_animate", n); + SendMessageToPC(oUser, "Settings: Roll Animations (1 is OFF): "+IntToString(n)); + + float f = GetDMFIPersistentFloat("dmfi", "dmfi_reputation", oUser); + SetLocalFloat(oUser, "dmfi_reputation", f); + SendMessageToPC(oUser, "Settings: Reputation Adjustment: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_effectduration", oUser); + SetLocalFloat(oUser, "dmfi_effectduration", f); + SendMessageToPC(oUser, "Settings: Effect Duration: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_sound_delay", oUser); + SetLocalFloat(oUser, "dmfi_sound_delay", f); + SendMessageToPC(oUser, "Settings: Sound Delay: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_beamduration", oUser); + SetLocalFloat(oUser, "dmfi_beamduration", f); + SendMessageToPC(oUser, "Settings: Beam Duration: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_stunduration", oUser); + SetLocalFloat(oUser, "dmfi_stunduration", f); + SendMessageToPC(oUser, "Settings: Stun Duration: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_saveamount", oUser); + SetLocalFloat(oUser, "dmfi_saveamount", f); + SendMessageToPC(oUser, "Settings: Save Adjustment: "+FloatToString(f)); + + f = GetDMFIPersistentFloat("dmfi", "dmfi_effectdelay", oUser); + SetLocalFloat(oUser, "dmfi_effectdelay", f); + SendMessageToPC(oUser, "Settings: Effect Delay: "+FloatToString(f)); + + + } + else + { + FloatingTextStringOnCreature("DMFI Default Settings Initialized", oUser, FALSE); + // SendMessageToPC(oUser, "DMFI Default Settings Initialized"); + + //Setting FOUR campaign variables so 1st use will be slow. + //Recommend initializing your preferences with no players or + //while there is NO fighting. + // SetLocalInt(oUser, "dmfi_initialized", 1); + SetDMFIPersistentInt("dmfi", "Settings", 1, oUser); + + SetCustomToken(20781, "5"); + SetLocalInt(oUser, "dmfi_alignshift", 5); + SetDMFIPersistentInt("dmfi", "dmfi_alignshift", 5, oUser); + SendMessageToPC(oUser, "Settings: Alignment shift: 5"); + + SetCustomToken(20783, "Single Target"); + SetLocalInt(oUser, "dmfi_buff_party", 0); + SetDMFIPersistentInt("dmfi", "dmfi_buff_party", 0, oUser); + SendMessageToPC(oUser, "Settings: Buff set to Single Target: "); + + SetCustomToken(20782, "Low"); + SetLocalString(oUser, "dmfi_buff_level", "LOW"); + SetDMFIPersistentString("dmfi", "dmfi_buff_level", "LOW", oUser); + SendMessageToPC(oUser, "Settings: Buff Level set to LOW: "); + + SetLocalInt(oUser, "dmfi_dicebag", 0); + SetCustomToken(20681, "Private"); + SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 0, oUser); + SendMessageToPC(oUser, "Settings: Dicebag Rolls set to PRIVATE"); + + SetLocalInt(oUser, "", 0); + SetDMFIPersistentInt("dmfi", "dmfi_safe_factions", 0, oUser); + SendMessageToPC(oUser, "Settings: Factions set to BW base behavior"); + + SetLocalFloat(oUser, "dmfi_reputation", 5.0); + SetCustomToken(20784, "5"); + SetDMFIPersistentFloat("dmfi", "dmfi_reputation", 5.0, oUser); + SendMessageToPC(oUser, "Settings: Reputation adjustment: 5"); + + SetDMFIPersistentFloat("dmfi", "dmfi_effectduration", 60.0, oUser); + SetLocalFloat(oUser, "dmfi_effectduration", 60.0); + SetDMFIPersistentFloat("dmfi", "dmfi_sound_delay", 0.2, oUser); + SetLocalFloat(oUser, "dmfi_sound_delay", 0.2); + SetDMFIPersistentFloat("dmfi", "dmfi_beamduration", 5.0, oUser); + SetLocalFloat(oUser, "dmfi_beamduration", 5.0); + SetDMFIPersistentFloat("dmfi", "dmfi_stunduration", 1000.0, oUser); + SetLocalFloat(oUser, "dmfi_stunduration", 1000.0); + SetDMFIPersistentFloat("dmfi", "dmfi_saveamount", 5.0, oUser); + SetLocalFloat(oUser, "dmfi_saveamount", 5.0); + SetDMFIPersistentFloat("dmfi", "dmfi_effectdelay", 1.0, oUser); + SetLocalFloat(oUser, "dmfi_effectdelay", 1.0); + + SendMessageToPC(oUser, "Settings: Effect Duration: 60.0"); + SendMessageToPC(oUser, "Settings: Effect Delay: 1.0"); + SendMessageToPC(oUser, "Settings: Beam Duration: 5.0"); + SendMessageToPC(oUser, "Settings: Stun Duration: 1000.0"); + SendMessageToPC(oUser, "Settings: Sound Delay: 0.2"); + SendMessageToPC(oUser, "Settings: Save Adjustment: 5.0"); + } + } +//********************************END INITIALIZATION*************************** + + // inits for all users (DM & player) + if (GetLocalInt(oUser, "dmfi_initialized")!=1) + { + int bEmotesMuted; + if (GetDMFIPersistentInt("dmfi", "Settings", oUser)==1) + { + bEmotesMuted = GetDMFIPersistentInt("dmfi", "dmfi_emotemute", oUser); + } + else + { + bEmotesMuted = DMFI_DEFAULT_EMOTES_MUTED; + SetDMFIPersistentInt("dmfi", "dmfi_emotemute", bEmotesMuted, oUser); + } + SetLocalInt(oUser, "hls_emotemute", bEmotesMuted); + SendMessageToPC(oUser, "Settings: Emotes "+(bEmotesMuted ? "muted" : "unmuted")); + + SetLocalObject(oUser, "dmfi_VoiceTarget", OBJECT_INVALID); + SendMessageToPC(oUser, "Settings: Voice throw target cleared"); + + SetLocalObject(oUser, "dmfi_univ_target", oUser); + SendMessageToPC(oUser, "Settings: Command target set to self"); + + SetLocalInt(oUser, "dmfi_initialized", 1); + } + + return TRUE; // no errors detected +} + diff --git a/nwnds_module/dmfi_jail_widget.uti b/nwnds_module/dmfi_jail_widget.uti new file mode 100644 index 000000000..364d39f83 Binary files /dev/null and b/nwnds_module/dmfi_jail_widget.uti differ diff --git a/nwnds_module/dmfi_music.uti b/nwnds_module/dmfi_music.uti new file mode 100644 index 000000000..8b0fee636 Binary files /dev/null and b/nwnds_module/dmfi_music.uti differ diff --git a/nwnds_module/dmfi_mute.uti b/nwnds_module/dmfi_mute.uti new file mode 100644 index 000000000..c85ac83db Binary files /dev/null and b/nwnds_module/dmfi_mute.uti differ diff --git a/nwnds_module/dmfi_naming.uti b/nwnds_module/dmfi_naming.uti new file mode 100644 index 000000000..0ac9ac57f Binary files /dev/null and b/nwnds_module/dmfi_naming.uti differ diff --git a/nwnds_module/dmfi_onclienter.ncs b/nwnds_module/dmfi_onclienter.ncs new file mode 100644 index 000000000..db8afe5e8 Binary files /dev/null and b/nwnds_module/dmfi_onclienter.ncs differ diff --git a/nwnds_module/dmfi_onclienter.nss b/nwnds_module/dmfi_onclienter.nss new file mode 100644 index 000000000..c1c0de454 --- /dev/null +++ b/nwnds_module/dmfi_onclienter.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: DMFI - OnClientEnter event handler +//:: dmfi_onclienter +//::////////////////////////////////////////////// +/* + Event handler for the module-level OnClientEnter event. Initializes DMFI system. +*/ +//::////////////////////////////////////////////// +//:: 2008.08.02 tsunami282 - created. + +#include "dmfi_init_inc" + +//////////////////////////////////////////////////////////////////////// +void main() +{ + object oUser = GetEnteringObject(); + + // do any other module OnClientEnter work here + ExecuteScript("x3_mod_def_enter", OBJECT_SELF); + + // initialize DMFI + dmfiInitialize(oUser); +} diff --git a/nwnds_module/dmfi_onering.uti b/nwnds_module/dmfi_onering.uti new file mode 100644 index 000000000..2db20b1b2 Binary files /dev/null and b/nwnds_module/dmfi_onering.uti differ diff --git a/nwnds_module/dmfi_onmodhb.ncs b/nwnds_module/dmfi_onmodhb.ncs new file mode 100644 index 000000000..19d2a9ee2 Binary files /dev/null and b/nwnds_module/dmfi_onmodhb.ncs differ diff --git a/nwnds_module/dmfi_onmodhb.nss b/nwnds_module/dmfi_onmodhb.nss new file mode 100644 index 000000000..af17502a8 --- /dev/null +++ b/nwnds_module/dmfi_onmodhb.nss @@ -0,0 +1,29 @@ + +#include "dmfi_db_inc" + +const int FLUSH_INTERVAL = 30; // seconds between database flushes to disk + +void main() +{ + // see if database is "dirty" (changed since last flush) + if (IsDMFIPersistentDataDirty("dmfi")) + { + // it is, so check if time to flush database + object oMod = GetModule(); + int iTick = GetLocalInt(oMod, "DMFI_MODULE_HEARTBEAT_TICK"); + int iSecsSinceFlush = iTick * 6; + if (iSecsSinceFlush >= FLUSH_INTERVAL) + { + FlushDMFIPersistentData("dmfi"); + iTick = 0; + } + else + { + iTick++; + } + SetLocalInt(oMod, "DMFI_MODULE_HEARTBEAT_TICK", iTick); + } + + // do any other module OnHeartbeat work here + ExecuteScript("x3_mod_def_hb", OBJECT_SELF); +} diff --git a/nwnds_module/dmfi_onplychat.ncs b/nwnds_module/dmfi_onplychat.ncs new file mode 100644 index 000000000..12a8d4440 Binary files /dev/null and b/nwnds_module/dmfi_onplychat.ncs differ diff --git a/nwnds_module/dmfi_onplychat.nss b/nwnds_module/dmfi_onplychat.nss new file mode 100644 index 000000000..e91d7e936 --- /dev/null +++ b/nwnds_module/dmfi_onplychat.nss @@ -0,0 +1,79 @@ +//:://///////////////////////////////////////////// +//:: DMFI - OnPlayerChat event handler +//:: dmfi_onplychat +//::////////////////////////////////////////////// +/* + Event handler for the module-level OnPlayerChat event. Manages scripter-added + event scripts. +*/ +//::////////////////////////////////////////////// +//:: Created By: Merle, with help from mykael22000 and tsunami282 +//:: Created On: 2007.12.12 +//::////////////////////////////////////////////// +//:: 2007.12.27 tsunami282 - implemented hooking tree + +#include "dmfi_plychat_inc" + +const string DMFI_PLAYERCHAT_SCRIPTNAME = "dmfi_plychat_exe"; + +//////////////////////////////////////////////////////////////////////// +void main() +{ + int nVolume = GetPCChatVolume(); + object oShouter = GetPCChatSpeaker(); + + int bInvoke; + string sChatHandlerScript; + int maskChannels; + // int bListenAll; + object oRunner; + int bAutoRemove; + int bDirtyList = FALSE; + int iHook; + object oMod = GetModule(); +// SendMessageToPC(GetFirstPC(), "OnPlayerChat - process hooks"); + int nHooks = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME); + for (iHook = nHooks; iHook > 0; iHook--) // reverse-order execution, last hook gets first dibs + { +// SendMessageToPC(GetFirstPC(), "OnPlayerChat -- process hook #" + IntToString(iHook)); + maskChannels = GetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook); +// SendMessageToPC(GetFirstPC(), "OnPlayerChat -- channel heard=" + IntToString(nVolume) + ", soughtmask=" + IntToString(maskChannels)); + if (((1 << nVolume) & maskChannels) != 0) // right channel + { +// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- channel matched"); + + bInvoke = FALSE; + if (GetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook) != FALSE) + { + bInvoke = TRUE; + } + else + { + object oDesiredSpeaker = GetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook); + if (oShouter == oDesiredSpeaker) bInvoke = TRUE; + } + if (bInvoke) // right speaker + { +// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- speaker matched"); + sChatHandlerScript = GetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook); + oRunner = GetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook); +// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- executing script '" + sChatHandlerScript + "' on object '" + GetName(oRunner) +"'"); + ExecuteScript(sChatHandlerScript, oRunner); + bAutoRemove = GetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook); + if (bAutoRemove) + { +// SendMessageToPC(GetFirstPC(), "OnPlayerChat --- scheduling autoremove"); + bDirtyList = TRUE; + SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook, 0); + } + } + } + } + + if (bDirtyList) DMFI_ChatHookRemove(0); + + // always execute the DMFI parser + ExecuteScript(DMFI_PLAYERCHAT_SCRIPTNAME, OBJECT_SELF); + +} + diff --git a/nwnds_module/dmfi_onrest.ncs b/nwnds_module/dmfi_onrest.ncs new file mode 100644 index 000000000..846c04d3c Binary files /dev/null and b/nwnds_module/dmfi_onrest.ncs differ diff --git a/nwnds_module/dmfi_onrest.nss b/nwnds_module/dmfi_onrest.nss new file mode 100644 index 000000000..5ea59ee60 --- /dev/null +++ b/nwnds_module/dmfi_onrest.nss @@ -0,0 +1,463 @@ +/*DMFI Rest System Alpha by hahnsoo + +CONTENTS +-------- +Placeables>>Special>>Custom 5 - DMFI Bed Roll, DMFI Campfire, DMFI Invisible +Rest Object, DMFI Tent + +Items>>Special>>Custom5 - DMFI Bed Roll (100 gp), DMFI Firewood (1 gp), DMFI +Portable Tent (500 gp) (different gp values for different situations) + +Scripts - dmfi_onrest +(Yup, that's it) + +Description +----------- +This is a robust and versatile rest system that incorporates a LOT of options. +Perhaps too many, I don't know. I tried to find everything that folks would +possibly want in a resting system. The most important "feature" is the rest +conversation menu, which governs for both DM and Player the kind of resting that +is allowed. + +The ways you can control rest in this system are: +1) Global vs. Local - Restrict or release restrictions on resting based on world + settings or on a per-area basis +2) Unlimited vs. Limited vs. No Rest - Have the Players rest at any time they'd + like. Or Limit them according to certain parameters and toggles. Or don't + allow them to rest at all. You can set these both globally and locally + (Unlimited and No Rest areas). +3) Time restriction - The staple of most simple rest restrictions. You can limit + resting per 1, 2, 4, 8, 12, or 24 in-game hours, and the amount of real-time + minutes are calculated for the DM. Again, you can set these both globally + and locally. +4) Placeables - Popularized by Demetrious's Supply-Based Rest, this allows you + to restrict resting according to proximity to objects. It allows you to use + DMFI rest objects (tag = dmfi_restobject), campfires, bedrolls, beds, tents + (a "Name-based" rest placeable), and toggles to include/exclude certain + classes that typically don't care about such niceties. +5) Armor Restrictions - I'm not quite fond of this particular one, but it is a + standard feature of many rest systems and thus included in the package. + Allows you to set what weight of armor allows a PC to rest. +6) Set Hit Point Restrictions - Unlike the other restrictions, this does NOT + prevent resting. What it does is determine how many hitpoints are regained + upon resting, from a gradient of no hitpoints to all hitpoint, and some + interesting options in between (1 HP per level, per 3rd edition, which + skews against fighter classes and CON based HP gain, which skews in favor of + lower level characters). +7) Toggle Spell Memorization - This converts the "rest" into a "pseudorest" + which only heals HP. Useful for a "no spell memorization" zone locally, not + much use globally. +8) Various other "fluff" settings (Snoring, the rest conversation menu, + immobilized resting, floating text feedback). + +There is also a "big red button" option that simply full rests all PCs in the +area. Useful to quickly work around rest restrictions that you have previously +set up. + +Installation +------------ +Change your OnRest event script to the dmfi_onrest script. Or you can do an +external execute script call by using ExecuteScript("dmfi_onrest", OBJECT_SELF); +in your current script. + +The areas in your module should NOT have the "No Rest" box checked, in the areas +which you wish to use this system. + +Configuration +------------- +All configuration of the system is done in-game as a DM. To bring up the Rest +Configuration Menu, press R or the rest button. +The conversation will detail the settings you have in the area (whether you are +using the default Global settings or using the Local area settings to override) +and the particular restrictions that you have set. + +Settings are stored Persistently using the Bioware Database, per the DMFI W&W +default persistence options. If you want to use another database system, simply +edit the the dmfi_db_inc wrapper functions to your liking. + +Unlimited Rest means just that: No restrictions. You may have global +restrictions set up, but as long as Unlimited rest is set globally or locally, +they are ignored. +No Rest means just that: No resting allowed, regardless of restrictions. +Limited Rest means that the restrictions you have set globally or locally are in +effect. You can restrict resting as stated above in the Description. + +When you set any [LOCAL] Area variables, you automatically set the area to +"override" the global rest restrictions. This means that this area follows its +own rules, and isn't governed by the global rules. Setting the [LOCAL] Area +restrictions will copy the current global restriction variables, but after that, +the only way to go back to "global" is to select "Use default [GLOBAL] Module +settings" +Tip: The most useful way to use this is to simply set areas as Unlimited Rest or +No Rest, say an Inn Room or a combat zone, respectively. + +Player Notes +------------ +If you are using the DMFI Rest Menu (on by default), the rest restrictions (if +any) are displayed on your Rest Conversation Menu, telling you why you can't +rest (if you are restricted). You also have the option to access both the DMFI +Dicebag and the DMFI Emote wand directly from the Rest Menu. This allows you to +use emotes or dice checks WITHOUT having that silly "Use Unique Power" +animation. + +Included in this package is a way to do "Alternate Resting Animations". These +animations simply change the way you appear when you rest. Since they use the +ForceRest() function, it isn't a "true" rest... rather it sets you for a certain +amount of time (equal to a normal rest) as un-moveable, and applies the rest at +the end of that time. This just means you don't get the little egg timer. + +This is an ALPHA release, and I'm pretty sure I don't know everything about +Resting systems in the universe. I've tried to incorporate nearly all of the +elements I've seen in other available resting systems and encorporate them into +a small (single script), DMFI-integrated package. + +I would greatly appreciate feedback, suggestions, additions, omissions, bug +reports, whatever. Send them to me at hahns_shin@hotmail.com.*/ + +#include "dmfi_db_inc" +//This function calculates the resting duration based on PC Hit Dice +//Based off of restduration.2da +void FloatyText(string sText, object oPC, int iSettings) +{ + if (!(iSettings & 0x40000000)) + FloatingTextStringOnCreature(sText, oPC, FALSE); +} + +float GetRestDuration(object oPC) +{ + return 10.0f + 0.5f * IntToFloat(GetHitDice(oPC)); +} + +// This function is used as a wrapper for the Rest VFX Object +void DoRestVFX(object oPC, float fDuration, int nEffect) { + effect eEffect; + if (nEffect == -1) { + eEffect = EffectCutsceneImmobilize(); + } else { + eEffect = EffectVisualEffect(nEffect); + } + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eEffect), oPC, fDuration); +} + + +//This function adds the Blindness/Snore effects +//Also adds cutscene immobilize to prevent movement +//Snoring should only occur at start, then follows on the module's hb +void ApplyRestVFX(object oPC, int iSettings) +{ + object oRestVFX = GetObjectByTag("dmfi_restvfxobject"); + effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP); //Sleepy "ZZZ"s + float fDuration = GetRestDuration(oPC); + float fSeconds = 6.0f; + if (!(iSettings & 0x80000000)) //Immobile Resting flag + { + // Pass a -1 for EffectCutsceneImmobilize. + // For a visual effect, simply pass the VFX constant. + AssignCommand(oRestVFX, DoRestVFX(oPC, fDuration, -1)); + } + if (!(iSettings & 0x20000000)) //VFX flag + { + // AssignCommand(oRestVFX, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eBlind), oPC, fDuration)); + AssignCommand(oRestVFX, DoRestVFX(oPC, fDuration, VFX_DUR_BLACKOUT)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC); + } +} + + +// Removes blindness & immobilize -- Merle +void RemoveRestVFX(object oPC) { + object oRestVFX = GetObjectByTag("dmfi_restvfxobject"); + effect eEffect = GetFirstEffect(oPC); + while (GetIsEffectValid(eEffect)) { + if (GetEffectCreator(eEffect) == oRestVFX) { + RemoveEffect(oPC, eEffect); + } + eEffect = GetNextEffect(oPC); + } +} + + +//This function gets the "Final HP" available to the PC after resting +int CalculateFinalHitPoints(object oPC, int iSettings) +{ + int iHP = (iSettings & 0x0f000000); + switch(iHP) + { + case 0x01000000: return 0; break; + case 0x02000000: return GetHitDice(oPC); break; + case 0x03000000: return GetAbilityScore(oPC, ABILITY_CONSTITUTION); break; + case 0x04000000: return GetMaxHitPoints(oPC)/10; break; + case 0x05000000: return GetMaxHitPoints(oPC)/4; break; + case 0x06000000: return GetMaxHitPoints(oPC)/2; break; + case 0x07000000: return GetMaxHitPoints(oPC); break; + default: return GetMaxHitPoints(oPC); break; + } + return GetMaxHitPoints(oPC); +} + +void RemoveMagicalEffects(object oPC) +{ + effect eEffect = GetFirstEffect(oPC); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectSubType(eEffect) == SUBTYPE_MAGICAL) + RemoveEffect(oPC, eEffect); + eEffect = GetNextEffect(oPC); + } +} + +//This function simulates a rest without restoring spells +void DoPseudoRest(object oPC, int iSettings, int iSpells = FALSE) +{ + effect eSnore = EffectVisualEffect(VFX_IMP_SLEEP); + effect eBlind = EffectVisualEffect(VFX_DUR_BLACKOUT); + effect eStop = EffectCutsceneImmobilize(); + float fDuration = GetRestDuration(oPC); + float fSeconds = 6.0f; + int iAnimation = GetLocalInt(oPC, "dmfi_r_alternate"); + if (!iAnimation) + iAnimation = ANIMATION_LOOPING_SIT_CROSS; + AssignCommand(oPC, PlayAnimation(iAnimation, 1.0f, fDuration)); + DelayCommand(0.1, SetCommandable(FALSE, oPC)); + DelayCommand(fDuration, SetCommandable(TRUE, oPC)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eStop), oPC, fDuration); + if (!(iSettings & 0x20000000) && iAnimation != ANIMATION_LOOPING_MEDITATE && iAnimation != ANIMATION_LOOPING_WORSHIP) //If the No VFX flag is not set, do VFX + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ExtraordinaryEffect(eBlind), oPC, fDuration); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC); + while (fSeconds < fDuration) + { + DelayCommand(fSeconds, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSnore, oPC)); + fSeconds += 6.0f; + } + } + if (!iSpells) + { + effect eHeal = EffectHeal(CalculateFinalHitPoints(oPC, iSettings)); //Heal the PC + DelayCommand(fDuration + 0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC)); + DelayCommand(fDuration + 0.1f, RemoveMagicalEffects(oPC)); //Remove all magical effects from PC + } + else + { + DelayCommand(fDuration + 0.1f, ForceRest(oPC)); + } + DeleteLocalInt(oPC, "dmfi_r_alternate"); +} + +//This function determines if the PC is wearing heavy armor +int GetIsWearingHeavyArmor(object oPC, int iSettings) +{ + int iArmor = (iSettings & 0x00f00000); + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + int iWeight = GetWeight(oArmor); + switch(iArmor) + { + default: + case 0x00100000: if (iWeight > 20) return TRUE; break; + case 0x00200000: if (iWeight > 60) return TRUE; break; + case 0x00300000: if (iWeight > 110) return TRUE; break; + case 0x00400000: if (iWeight > 160) return TRUE; break; + case 0x00500000: if (iWeight > 310) return TRUE; break; + case 0x00600000: if (iWeight > 410) return TRUE; break; + case 0x00700000: if (iWeight > 460) return TRUE; break; + } + return FALSE; +} + +//This function determines if the PC is near a resting placeable +int GetIsNearRestingObject(object oPC, int iSettings) +{ + if (iSettings & 0x00020000) //Ignore Druid + { + if (GetLevelByClass(CLASS_TYPE_DRUID, oPC)) + return TRUE; + } + if (iSettings & 0x00040000) //Ignore Ranger + { + if (GetLevelByClass(CLASS_TYPE_RANGER, oPC)) + return TRUE; + } + if (iSettings & 0x00080000) //Ignore Barb + { + if (GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC)) + return TRUE; + } + object oPlaceable = GetFirstObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE); + while (GetIsObjectValid(oPlaceable)) + { + if (!(iSettings & 0x00001000) && GetTag(oPlaceable) == "dmfi_rest") //DMFI Placeables: by default, ON + return TRUE; + if ((iSettings & 0x00002000) && GetStringLowerCase(GetName(oPlaceable)) == "campfire") //Campfires + return TRUE; + if ((iSettings & 0x00004000) && (GetStringLowerCase(GetName(oPlaceable)) == "bed roll" || GetStringLowerCase(GetName(oPlaceable)) == "bedroll")) //Bed rolls + return TRUE; + if ((iSettings & 0x00008000) && GetStringLowerCase(GetName(oPlaceable)) == "bed") //beds + return TRUE; + if ((iSettings & 0x00010000) && GetStringLowerCase(GetName(oPlaceable)) == "tent") //tents + return TRUE; + oPlaceable = GetNextObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE); + } + return FALSE; +} + +// Updated to allow 6 hour breaks and to pass in a percentage if rest is interrupted +void SetNextRestTime(object oPC, int iSettings, float fPercentage = 1.0) +{ + if (fPercentage > 1.0 || fPercentage <= 0.0) { + fPercentage = 1.0; + } + int iHours = (iSettings & 0x00000f00); + int iTime = GetTimeHour() + GetCalendarDay() * 24 + GetCalendarMonth() * 24 * 28 + GetCalendarYear() * 24 * 28 * 12; + + switch(iHours) + { + default: + case 0x00000100: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(1) * fPercentage)); break; + case 0x00000200: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(2) * fPercentage)); break; + case 0x00000300: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(4) * fPercentage)); break; + case 0x00000400: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(6) * fPercentage)); break; + case 0x00000500: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(8) * fPercentage)); break; + case 0x00000600: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(12) * fPercentage)); break; + case 0x00000700: SetLocalInt(oPC, "dmfi_r_nextrest", iTime + FloatToInt(IntToFloat(24) * fPercentage)); break; + } +} + + +//This function determines whether or not you can rest. +int DMFI_CanIRest(object oPC, int iSettings) +{ + if (GetIsDM(oPC)) return TRUE; + if (iSettings & 0x00000002) //No Rest Override + { + if (iSettings & 0x00000080) + FloatyText("This is a No Rest area", oPC, iSettings); + return FALSE; + } + if (!(iSettings & 0x00000001)) //Unlimited Rest Override + { + if (iSettings & 0x00000080) + FloatyText("This is an Unlimited Rest area", oPC, iSettings); + return TRUE; + } + if ((iSettings & 0x00000004) && (iSettings & 0x00000001)) //Time restriction + { + int iTime = GetTimeHour() + GetCalendarDay() * 24 + GetCalendarMonth() * 24 * 28 + GetCalendarYear() * 24 * 28 * 12; + if (iTime < GetLocalInt(oPC, "dmfi_r_nextrest")) + { + FloatyText("You cannot rest at this time. You may rest again in " + IntToString(GetLocalInt(oPC, "dmfi_r_nextrest") - iTime) + " hours.", oPC, iSettings); + return FALSE; + } + } + if ((iSettings & 0x00000008) && (iSettings & 0x00000001)) //Placeable restriction + { + if (!GetIsNearRestingObject(oPC, iSettings)) + { + FloatyText("You are not near a rest placeable", oPC, iSettings); + return FALSE; + } + } + if ((iSettings & 0x00000010) && (iSettings & 0x00000001)) //Armor restriction + { + if (GetIsWearingHeavyArmor(oPC, iSettings)) + { + FloatyText("Your current armor is too heavy to rest", oPC, iSettings); + return FALSE; + } + } + return TRUE; +} + +void main() +{ + object oPC = GetLastPCRested(); + object oArea = GetArea(oPC); + int iSettings; + int iModSettings = GetDMFIPersistentInt("dmfi", "dmfi_r_"); + int iAreaSettings = GetDMFIPersistentInt("dmfi", "dmfi_r_" + GetTag(oArea)); + if (iAreaSettings & 0x00000080) + { + iSettings = iAreaSettings; + } + else + { + iSettings = iModSettings; + } + SetLocalInt(oPC, "dmfi_r_settings", iSettings); + + if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED) + { + SetLocalInt(oPC, "dmfi_norest", !(DMFI_CanIRest(oPC, iSettings))); + SetLocalInt(oPC, "dmfi_r_hitpoints", GetCurrentHitPoints(oPC)); + if (GetIsDM(oPC) || (!(iSettings & 0x10000000) && !GetLocalInt(oPC, "dmfi_r_bypass"))) + { //If the Rest Conversation variable is set, then activate the rest conversation here. + AssignCommand(oPC, ClearAllActions()); + SetLocalString(oPC, "dmfi_univ_conv", "rest"); + AssignCommand(oPC, ActionStartConversation(oPC, "dmfi_universal", TRUE)); + return; + } + if (GetLocalInt(oPC, "dmfi_norest")) //PC cannot rest + { + AssignCommand(oPC, ClearAllActions()); + DeleteLocalInt(oPC, "dmfi_r_bypass"); + return; + } + if ((iSettings & 0x00000004) && (iSettings & 0x00000001)) //Time restriction + SetNextRestTime(oPC, iSettings); + + if (GetLocalInt(oPC, "dmfi_r_alternate") || ((iSettings & 0x00000040) && (iSettings & 0x00000001))) + { + AssignCommand(oPC, ClearAllActions()); + if ((iSettings & 0x00000040) && (iSettings & 0x00000001)) + FloatyText("You cannot regain your spells in this area",oPC, iSettings); + DoPseudoRest(oPC, iSettings, ((iSettings & 0x00000040) && (iSettings & 0x00000001))); + DeleteLocalInt(oPC, "dmfi_r_bypass"); + return; + } + else if (!(iSettings & 0x20000000)) + { //Rest VFX + ApplyRestVFX(oPC, iSettings); + } + if ((iSettings & 0x00000020) && (iSettings & 0x00000001)) + { //Auto Party Drop + FloatyText("You have been removed from the party to prevent rest canceling",oPC, iSettings); + RemoveFromParty(oPC); + } + } + else if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED) + { + // Make sure that resting has been initialized and the start time has been set. Otherwise, the Cancelled Rest Event was fired by + // the Resting conversation. + if (GetLocalInt(oPC, "dmfi_r_init")) + { + int iTime = GetTimeSecond() + GetTimeMinute() * 60 + GetTimeHour() * 3600 + GetCalendarDay() * 24 * 3600 + GetCalendarMonth() *3600 * 24 * 28 + GetCalendarYear() * 24 * 28 * 12 * 3600; + int nTimeRested = iTime - GetLocalInt(oPC, "dmfi_r_startseconds"); + int nFullTime = FloatToInt(GetRestDuration(oPC)); + float fPercentage = IntToFloat(nTimeRested) / IntToFloat(nFullTime); + SetNextRestTime(oPC, iSettings, fPercentage); + // SendMessageToPC(oPC, "Rest interrupted; resting for " + IntToString(nTimeRested) + " out of " + IntToString(nFullTime) + " seconds (" + FloatToString(fPercentage) + "%)."); + SetLocalInt(oPC, "dmfi_r_init", FALSE); + if ((iSettings & 0x00000020) && GetCurrentHitPoints(oPC) > GetLocalInt(oPC, "dmfi_r_hitpoints") && iSettings & 0x00000001) //HP restriction + { + effect eDam = EffectDamage(GetMaxHitPoints(oPC) - GetLocalInt(oPC, "dmfi_r_hitpoints")); + FloatyText("Your hitpoints have been reset",oPC, iSettings); + AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oPC)); + + } + } + RemoveRestVFX(oPC); + } + else if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED) + { + if ((iSettings & 0x00000020) && (iSettings & 0x00000001)) //HP restriction + { + int iDam = GetMaxHitPoints(oPC) - GetLocalInt(oPC, "dmfi_r_hitpoints") - CalculateFinalHitPoints(oPC, iSettings); + if (iDam > 0) + { + effect eDam = EffectDamage(iDam); + FloatyText("You gain back limited HP from this rest",oPC, iSettings); + AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oPC)); + } + } + } + DeleteLocalInt(oPC, "dmfi_r_bypass"); +} diff --git a/nwnds_module/dmfi_pc_dicebag.uti b/nwnds_module/dmfi_pc_dicebag.uti new file mode 100644 index 000000000..9ed977e56 Binary files /dev/null and b/nwnds_module/dmfi_pc_dicebag.uti differ diff --git a/nwnds_module/dmfi_pc_emote.uti b/nwnds_module/dmfi_pc_emote.uti new file mode 100644 index 000000000..5806b74e3 Binary files /dev/null and b/nwnds_module/dmfi_pc_emote.uti differ diff --git a/nwnds_module/dmfi_pc_follow.uti b/nwnds_module/dmfi_pc_follow.uti new file mode 100644 index 000000000..ba7cb5229 Binary files /dev/null and b/nwnds_module/dmfi_pc_follow.uti differ diff --git a/nwnds_module/dmfi_pc_rest001.uti b/nwnds_module/dmfi_pc_rest001.uti new file mode 100644 index 000000000..0add37afa Binary files /dev/null and b/nwnds_module/dmfi_pc_rest001.uti differ diff --git a/nwnds_module/dmfi_pc_rest002.uti b/nwnds_module/dmfi_pc_rest002.uti new file mode 100644 index 000000000..5931a71e2 Binary files /dev/null and b/nwnds_module/dmfi_pc_rest002.uti differ diff --git a/nwnds_module/dmfi_pc_rest003.uti b/nwnds_module/dmfi_pc_rest003.uti new file mode 100644 index 000000000..707b4f0dd Binary files /dev/null and b/nwnds_module/dmfi_pc_rest003.uti differ diff --git a/nwnds_module/dmfi_peace.uti b/nwnds_module/dmfi_peace.uti new file mode 100644 index 000000000..c2df35a53 Binary files /dev/null and b/nwnds_module/dmfi_peace.uti differ diff --git a/nwnds_module/dmfi_playerbook.uti b/nwnds_module/dmfi_playerbook.uti new file mode 100644 index 000000000..ee3175877 Binary files /dev/null and b/nwnds_module/dmfi_playerbook.uti differ diff --git a/nwnds_module/dmfi_plchlishk_i.nss b/nwnds_module/dmfi_plchlishk_i.nss new file mode 100644 index 000000000..ac76a36a2 --- /dev/null +++ b/nwnds_module/dmfi_plchlishk_i.nss @@ -0,0 +1,117 @@ +//:://///////////////////////////////////////////// +//:: DMFI - internal player chat listener hooking include +//:: dmfi_plchlishk_i +//::////////////////////////////////////////////// +/* + Include file containing routines for managing the internal DMFI chain of + "listeners", which are now implemented as OnPlayerChat event handlers rather + than creatures. +*/ +//::////////////////////////////////////////////// +//:: Created By: tsunami282 +//:: Created On: 2008.03.24 +//::////////////////////////////////////////////// + +const int DMFI_LISTEN_ON_CHANNEL_TALK = 1; +const int DMFI_LISTEN_ON_CHANNEL_WHISPER = 1; +const int DMFI_LISTEN_ON_CHANNEL_SHOUT = 1; +const int DMFI_LISTEN_ON_CHANNEL_DM = 1; +const int DMFI_LISTEN_ON_CHANNEL_PARTY = 1; + +const string DMFI_EAVESDROP_HOOK_VARNAME = "dmfi_Eavesdrop"; + +const float WHISPER_DISTANCE = 1.0; +const float TALK_DISTANCE = 30.0; + +string sHookTypeVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Type"; // 1=PC (says), 2=NPC/location (hears) +string sHookCreatureVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Creature"; // must be valid for type 1, for type 2 object_invalid means location only +string sHookRangeModeVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_RangeMode"; // listening range: for type 1, 0=pc only, 1=pc's party; for type 2, 0=earshot, 1=area, 2=module +string sHookLocationVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Location"; // for type 2, location of "listening post" +string sHookChannelsVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Channels"; // bitmask of TALKVOLUME channels to listen to +string sHookOwnerVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_Owner"; // unique ID of owner of this hook (he who will get the captured text) +string sHookBcastDMsVarname = DMFI_EAVESDROP_HOOK_VARNAME + "_BcastDMs"; // 0=relay message to owner only, 1=broadcast to all DMs + +//////////////////////////////////////////////////////////////////////// +void RemoveListenerHook(int hooknum) +{ + int hooktype; + object hookcreature; + location hooklocation; + int hookchannels; + object hookowner; + int hookparty, hookbcast; + + int iHook = hooknum; + string siHook = "", siHookN = ""; + object oMod = GetModule(); + + while (1) + { + siHook = IntToString(iHook); + siHookN = IntToString(iHook+1); + + hooktype = GetLocalInt(oMod, sHookTypeVarname+siHookN); + if (hooktype != 0) + { + hookcreature = GetLocalObject(oMod, sHookCreatureVarname+siHookN); + hooklocation = GetLocalLocation(oMod, sHookLocationVarname+siHookN); + hookchannels = GetLocalInt(oMod, sHookChannelsVarname+siHookN); + hookowner = GetLocalObject(oMod, sHookOwnerVarname+siHookN); + hookparty = GetLocalInt(oMod, sHookRangeModeVarname+siHookN); + hookbcast = GetLocalInt(oMod, sHookBcastDMsVarname+siHookN); + + SetLocalInt(oMod, sHookTypeVarname+siHook, hooktype); + SetLocalObject(oMod, sHookCreatureVarname+siHook, hookcreature); + SetLocalLocation(oMod, sHookLocationVarname+siHook, hooklocation); + SetLocalInt(oMod, sHookChannelsVarname+siHook, hookchannels); + SetLocalObject(oMod, sHookOwnerVarname+siHook, hookowner); + SetLocalInt(oMod, sHookRangeModeVarname+siHook, hookparty); + SetLocalInt(oMod, sHookBcastDMsVarname+siHook, hookbcast); + } + else + { + DeleteLocalInt(oMod, sHookTypeVarname+siHook); + DeleteLocalObject(oMod, sHookCreatureVarname+siHook); + DeleteLocalLocation(oMod, sHookLocationVarname+siHook); + DeleteLocalInt(oMod, sHookChannelsVarname+siHook); + DeleteLocalObject(oMod, sHookOwnerVarname+siHook); + DeleteLocalInt(oMod, sHookRangeModeVarname+siHook); + DeleteLocalInt(oMod, sHookBcastDMsVarname+siHook); + + break; + } + iHook++; + } +} + +//////////////////////////////////////////////////////////////////////// +int AppendListenerHook(int hooktype, object hookcreature, location hooklocation, + int hookchannels, int hookparty, int hookbcast, object hookowner) +{ + int iHook = 0; + + if (hooktype != 0) + { + int iHookType; + string siHook = ""; + object oMod = GetModule(); + iHook = 1; + while (1) + { + siHook = IntToString(iHook); + iHookType = GetLocalInt(oMod, sHookTypeVarname+siHook); + if (iHookType == 0) break; // end of list + iHook++; + } + SetLocalInt(oMod, sHookTypeVarname+siHook, hooktype); + SetLocalObject(oMod, sHookCreatureVarname+siHook, hookcreature); + SetLocalLocation(oMod, sHookLocationVarname+siHook, hooklocation); + SetLocalInt(oMod, sHookChannelsVarname+siHook, hookchannels); + SetLocalObject(oMod, sHookOwnerVarname+siHook, hookowner); + SetLocalInt(oMod, sHookRangeModeVarname+siHook, hookparty); + SetLocalInt(oMod, sHookBcastDMsVarname+siHook, hookbcast); + } + + return iHook; +} + diff --git a/nwnds_module/dmfi_plychat_exe.ncs b/nwnds_module/dmfi_plychat_exe.ncs new file mode 100644 index 000000000..08b1d8af2 Binary files /dev/null and b/nwnds_module/dmfi_plychat_exe.ncs differ diff --git a/nwnds_module/dmfi_plychat_exe.nss b/nwnds_module/dmfi_plychat_exe.nss new file mode 100644 index 000000000..b18749dde --- /dev/null +++ b/nwnds_module/dmfi_plychat_exe.nss @@ -0,0 +1,3911 @@ +//:://///////////////////////////////////////////// +//:: DMFI - OnPlayerChat functions processor +//:: dmfi_plychat_exe +//::////////////////////////////////////////////// +/* + Processor for the OnPlayerChat-triggered DMFI functions. +*/ +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2007.12.12 Merle +//:: - revisions for NWN patch 1.69 +//:: 2008.03.24 tsunami282 +//:: - renamed from dmfi_voice_exe, updated to work with event hooking system +//:: 2008.06.23 Prince Demetri & Night Journey +//:: - added languages: Sylvan, Mulhorandi, Rashemi +//:: 2008.07.30 morderon +//:: - better emote processing, allow certain dot commands for PC's + +#include "x2_inc_switches" +#include "x0_i0_stringlib" +#include "dmfi_string_inc" +#include "dmfi_plchlishk_i" +#include "dmfi_db_inc" + +const int DMFI_LOG_CONVERSATION = TRUE; // turn on or off logging of conversation text + +//////////////////////////////////////////////////////////////////////// +int AppearType (string sCom) +{ +// 2008.03.24 tsunami282 - pull descriptions from 2da first; allow numerics + + // is it numeric? If so just convert and return + if (TestStringAgainstPattern("*n", sCom)) return StringToInt(sCom); + if (sCom == "ARANEA") + return APPEARANCE_TYPE_ARANEA; + if (sCom == "ALLIP") + return APPEARANCE_TYPE_ALLIP; + if (sCom == "ARCH_TARGET") + return APPEARANCE_TYPE_ARCH_TARGET; + if (sCom == "ARIBETH") + return APPEARANCE_TYPE_ARIBETH; + if (sCom == "ASABI_CHIEFTAIN") + return APPEARANCE_TYPE_ASABI_CHIEFTAIN; + if (sCom == "ASABI_SHAMAN") + return APPEARANCE_TYPE_ASABI_SHAMAN; + if (sCom == "ASABI_WARRIOR") + return APPEARANCE_TYPE_ASABI_WARRIOR; + if (sCom == "BADGER") + return APPEARANCE_TYPE_BADGER; + if (sCom == "BADGER_DIRE") + return APPEARANCE_TYPE_BADGER_DIRE; + if (sCom == "BALOR") + return APPEARANCE_TYPE_BALOR; + if (sCom == "BARTENDER") + return APPEARANCE_TYPE_BARTENDER; + if (sCom == "BASILISK") + return APPEARANCE_TYPE_BASILISK; + if (sCom == "BAT") + return APPEARANCE_TYPE_BAT; + if (sCom == "BAT_HORROR") + return APPEARANCE_TYPE_BAT_HORROR; + if (sCom == "BEAR_BLACK") + return APPEARANCE_TYPE_BEAR_BLACK; + if (sCom == "BEAR_BROWN") + return APPEARANCE_TYPE_BEAR_BROWN; + if (sCom == "BEAR_DIRE") + return APPEARANCE_TYPE_BEAR_DIRE; + if (sCom == "BEAR_KODIAK") + return APPEARANCE_TYPE_BEAR_KODIAK; + if (sCom == "BEAR_POLAR") + return APPEARANCE_TYPE_BEAR_POLAR; + if (sCom == "BEETLE_FIRE") + return APPEARANCE_TYPE_BEETLE_FIRE; + if (sCom == "BEETLE_SLICER") + return APPEARANCE_TYPE_BEETLE_SLICER; + if (sCom == "BEETLE_STAG") + return APPEARANCE_TYPE_BEETLE_STAG; + if (sCom == "BEETLE_STINK") + return APPEARANCE_TYPE_BEETLE_STINK; + if (sCom == "BEGGER") + return APPEARANCE_TYPE_BEGGER; + if (sCom == "BLOOD_SAILER") + return APPEARANCE_TYPE_BLOOD_SAILER; + if (sCom == "BOAR") + return APPEARANCE_TYPE_BOAR; + if (sCom == "BOAR_DIRE") + return APPEARANCE_TYPE_BOAR_DIRE; + if (sCom == "BODAK") + return APPEARANCE_TYPE_BODAK; + if (sCom == "BUGBEAR_A") + return APPEARANCE_TYPE_BUGBEAR_A; + if (sCom == "BUGBEAR_B") + return APPEARANCE_TYPE_BUGBEAR_B; + if (sCom == "BUGBEAR_CHIEFTAIN_A") + return APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_A; + if (sCom == "BUGBEAR_CHIEFTAIN_B") + return APPEARANCE_TYPE_BUGBEAR_CHIEFTAIN_B; + if (sCom == "BUGBEAR_SHAMAN_A") + return APPEARANCE_TYPE_BUGBEAR_SHAMAN_A; + if (sCom == "BUGBEAR_SHAMAN_B") + return APPEARANCE_TYPE_BUGBEAR_SHAMAN_B; + if (sCom == "CAT_CAT_DIRE") + return APPEARANCE_TYPE_CAT_CAT_DIRE; + if (sCom == "CAT_COUGAR") + return APPEARANCE_TYPE_CAT_COUGAR; + if (sCom == "CAT_CRAG_CAT") + return APPEARANCE_TYPE_CAT_CRAG_CAT; + if (sCom == "CAT_JAGUAR") + return APPEARANCE_TYPE_CAT_JAGUAR; + if (sCom == "CAT_KRENSHAR") + return APPEARANCE_TYPE_CAT_KRENSHAR; + if (sCom == "CAT_LEOPARD") + return APPEARANCE_TYPE_CAT_LEOPARD; + if (sCom == "CAT_LION") + return APPEARANCE_TYPE_CAT_LION; + if (sCom == "CAT_MPANTHER") + return APPEARANCE_TYPE_CAT_MPANTHER; + if (sCom == "CAT_PANTHER") + return APPEARANCE_TYPE_CAT_PANTHER; + if (sCom == "CHICKEN") + return APPEARANCE_TYPE_CHICKEN; + if (sCom == "COCKATRICE") + return APPEARANCE_TYPE_COCKATRICE; + if (sCom == "COMBAT_DUMMY") + return APPEARANCE_TYPE_COMBAT_DUMMY; + if (sCom == "CONVICT") + return APPEARANCE_TYPE_CONVICT; + if (sCom == "COW") + return APPEARANCE_TYPE_COW; + if (sCom == "CULT_MEMBER") + return APPEARANCE_TYPE_CULT_MEMBER; + if (sCom == "DEER") + return APPEARANCE_TYPE_DEER; + if (sCom == "DEER_STAG") + return APPEARANCE_TYPE_DEER_STAG; + if (sCom == "DEVIL") + return APPEARANCE_TYPE_DEVIL; + if (sCom == "DOG") + return APPEARANCE_TYPE_DOG; + if (sCom == "DOG_BLINKDOG") + return APPEARANCE_TYPE_DOG_BLINKDOG; + if (sCom == "DOG_DIRE_WOLF") + return APPEARANCE_TYPE_DOG_DIRE_WOLF; + if (sCom == "DOG_FENHOUND") + return APPEARANCE_TYPE_DOG_FENHOUND; + if (sCom == "DOG_HELL_HOUND") + return APPEARANCE_TYPE_DOG_HELL_HOUND; + if (sCom == "DOG_SHADOW_MASTIF") + return APPEARANCE_TYPE_DOG_SHADOW_MASTIF; + if (sCom == "DOG_WINTER_WOLF") + return APPEARANCE_TYPE_DOG_WINTER_WOLF; + if (sCom == "DOG_WORG") + return APPEARANCE_TYPE_DOG_WORG; + if (sCom == "DOG_WOLF") + return APPEARANCE_TYPE_DOG_WOLF; + if (sCom == "DOOM_KNIGHT") + return APPEARANCE_TYPE_DOOM_KNIGHT; + if (sCom == "DRAGON_BLACK") + return APPEARANCE_TYPE_DRAGON_BLACK; + if (sCom == "DRAGON_BLUE") + return APPEARANCE_TYPE_DRAGON_BLUE; + if (sCom == "DRAGON_BRASS") + return APPEARANCE_TYPE_DRAGON_BRASS; + if (sCom == "DRAGON_BRONZE") + return APPEARANCE_TYPE_DRAGON_BRONZE; + if (sCom == "DRAGON_COPPER") + return APPEARANCE_TYPE_DRAGON_COPPER; + if (sCom == "DRAGON_GOLD") + return APPEARANCE_TYPE_DRAGON_GOLD; + if (sCom == "DRAGON_GREEN") + return APPEARANCE_TYPE_DRAGON_GREEN; + if (sCom == "DRAGON_RED") + return APPEARANCE_TYPE_DRAGON_RED; + if (sCom == "DRAGON_SILVER") + return APPEARANCE_TYPE_DRAGON_SILVER; + if (sCom == "DRAGON_WHITE") + return APPEARANCE_TYPE_DRAGON_WHITE; + if (sCom == "DROW_CLERIC") + return APPEARANCE_TYPE_DROW_CLERIC; + if (sCom == "DROW_FIGHTER") + return APPEARANCE_TYPE_DROW_FIGHTER; + if (sCom == "DRUEGAR_CLERIC") + return APPEARANCE_TYPE_DRUEGAR_CLERIC; + if (sCom == "DRUEGAR_FIGHTER") + return APPEARANCE_TYPE_DRUEGAR_FIGHTER; + if (sCom == "DRYAD") + return APPEARANCE_TYPE_DRYAD; + if (sCom == "DWARF") + return APPEARANCE_TYPE_DWARF; + if (sCom == "DWARF_NPC_FEMALE") + return APPEARANCE_TYPE_DWARF_NPC_FEMALE; + if (sCom == "DWARF_NPC_MALE") + return APPEARANCE_TYPE_DWARF_NPC_MALE; + if (sCom == "ELEMENTAL_AIR") + return APPEARANCE_TYPE_ELEMENTAL_AIR; + if (sCom == "ELEMENTAL_AIR_ELDER") + return APPEARANCE_TYPE_ELEMENTAL_AIR_ELDER; + if (sCom == "ELEMENTAL_EARTH") + return APPEARANCE_TYPE_ELEMENTAL_EARTH; + if (sCom == "ELEMENTAL_EARTH_ELDER") + return APPEARANCE_TYPE_ELEMENTAL_EARTH_ELDER; + if (sCom == "ELEMENTAL_FIRE") + return APPEARANCE_TYPE_ELEMENTAL_FIRE; + if (sCom == "ELEMENTAL_FIRE_ELDER") + return APPEARANCE_TYPE_ELEMENTAL_FIRE_ELDER; + if (sCom == "ELEMENTAL_WATER") + return APPEARANCE_TYPE_ELEMENTAL_WATER; + if (sCom == "ELEMENTAL_WATER_ELDER") + return APPEARANCE_TYPE_ELEMENTAL_WATER_ELDER; + if (sCom == "ELF") + return APPEARANCE_TYPE_ELF; + if (sCom == "ELF_NPC_FEMALE") + return APPEARANCE_TYPE_ELF_NPC_FEMALE; + if (sCom == "ELF_NPC_MALE_01") + return APPEARANCE_TYPE_ELF_NPC_MALE_01; + if (sCom == "ELF_NPC_MALE_02") + return APPEARANCE_TYPE_ELF_NPC_MALE_02; + if (sCom == "ETTERCAP") + return APPEARANCE_TYPE_ETTERCAP; + if (sCom == "ETTIN") + return APPEARANCE_TYPE_ETTIN; + if (sCom == "FAERIE_DRAGON") + return APPEARANCE_TYPE_FAERIE_DRAGON; + if (sCom == "FAIRY") + return APPEARANCE_TYPE_FAIRY; + if (sCom == "FALCON") + return APPEARANCE_TYPE_FALCON; + if (sCom == "FEMALE_01") + return APPEARANCE_TYPE_FEMALE_01; + if (sCom == "FEMALE_02") + return APPEARANCE_TYPE_FEMALE_02; + if (sCom == "FEMALE_03") + return APPEARANCE_TYPE_FEMALE_03; + if (sCom == "FEMALE_04") + return APPEARANCE_TYPE_FEMALE_04; + if (sCom == "FORMIAN_MYRMARCH") + return APPEARANCE_TYPE_FORMIAN_MYRMARCH; + if (sCom == "FORMIAN_QUEEN") + return APPEARANCE_TYPE_FORMIAN_QUEEN; + if (sCom == "FORMIAN_WARRIOR") + return APPEARANCE_TYPE_FORMIAN_WARRIOR; + if (sCom == "FORMIAN_WORKER") + return APPEARANCE_TYPE_FORMIAN_WORKER; + if (sCom == "GARGOYLE") + return APPEARANCE_TYPE_GARGOYLE; + if (sCom == "GHAST") + return APPEARANCE_TYPE_GHAST; + if (sCom == "GHOUL") + return APPEARANCE_TYPE_GHOUL; + if (sCom == "GHOUL_LORD") + return APPEARANCE_TYPE_GHOUL_LORD; + if (sCom == "GIANT_FIRE") + return APPEARANCE_TYPE_GIANT_FIRE; + if (sCom == "GIANT_FIRE_FEMALE") + return APPEARANCE_TYPE_GIANT_FIRE_FEMALE; + if (sCom == "GIANT_FROST") + return APPEARANCE_TYPE_GIANT_FROST; + if (sCom == "GIANT_FROST_FEMALE") + return APPEARANCE_TYPE_GIANT_FROST_FEMALE; + if (sCom == "GIANT_HILL") + return APPEARANCE_TYPE_GIANT_HILL; + if (sCom == "GIANT_MOUNTAIN") + return APPEARANCE_TYPE_GIANT_MOUNTAIN; + if (sCom == "GNOLL_WARRIOR") + return APPEARANCE_TYPE_GNOLL_WARRIOR; + if (sCom == "GNOLL_WIZ") + return APPEARANCE_TYPE_GNOLL_WIZ; + if (sCom == "GNOME") + return APPEARANCE_TYPE_GNOME; + if (sCom == "GNOME_NPC_FEMALE") + return APPEARANCE_TYPE_GNOME_NPC_FEMALE; + if (sCom == "GNOME_NPC_MALE") + return APPEARANCE_TYPE_GNOME_NPC_MALE; + if (sCom == "GOBLIN_A") + return APPEARANCE_TYPE_GOBLIN_A; + if (sCom == "GOBLIN_B") + return APPEARANCE_TYPE_GOBLIN_B; + if (sCom == "GOBLIN_CHIEF_A") + return APPEARANCE_TYPE_GOBLIN_CHIEF_A; + if (sCom == "GOBLIN_CHIEF_B") + return APPEARANCE_TYPE_GOBLIN_CHIEF_B; + if (sCom == "GOBLIN_SHAMAN_A") + return APPEARANCE_TYPE_GOBLIN_SHAMAN_A; + if (sCom == "GOBLIN_SHAMAN_B") + return APPEARANCE_TYPE_GOBLIN_SHAMAN_B; + if (sCom == "GOLEM_BONE") + return APPEARANCE_TYPE_GOLEM_BONE; + if (sCom == "GOLEM_CLAY") + return APPEARANCE_TYPE_GOLEM_CLAY; + if (sCom == "GOLEM_FLESH") + return APPEARANCE_TYPE_GOLEM_FLESH; + if (sCom == "GOLEM_IRON") + return APPEARANCE_TYPE_GOLEM_IRON; + if (sCom == "GOLEM_STONE") + return APPEARANCE_TYPE_GOLEM_STONE; + if (sCom == "GORGON") + return APPEARANCE_TYPE_GORGON; + if (sCom == "GREY_RENDER") + return APPEARANCE_TYPE_GREY_RENDER; + if (sCom == "GYNOSPHINX") + return APPEARANCE_TYPE_GYNOSPHINX; + if (sCom == "HALF_ELF") + return APPEARANCE_TYPE_HALF_ELF; + if (sCom == "HALF_ORC") + return APPEARANCE_TYPE_HALF_ORC; + if (sCom == "HALF_ORC_NPC_FEMALE") + return APPEARANCE_TYPE_HALF_ORC_NPC_FEMALE; + if (sCom == "HALF_ORC_NPC_MALE_01") + return APPEARANCE_TYPE_HALF_ORC_NPC_MALE_01; + if (sCom == "HALF_ORC_NPC_MALE_02") + return APPEARANCE_TYPE_HALF_ORC_NPC_MALE_02; + if (sCom == "HALFLING") + return APPEARANCE_TYPE_HALFLING; + if (sCom == "HALFLING_NPC_FEMALE") + return APPEARANCE_TYPE_HALFLING_NPC_FEMALE; + if (sCom == "HALFLING_NPC_MALE") + return APPEARANCE_TYPE_HALFLING_NPC_MALE; + if (sCom == "HELMED_HORROR") + return APPEARANCE_TYPE_HELMED_HORROR; + if (sCom == "HEURODIS_LICH") + return APPEARANCE_TYPE_HEURODIS_LICH; + if (sCom == "HOBGOBLIN_WARRIOR") + return APPEARANCE_TYPE_HOBGOBLIN_WARRIOR; + if (sCom == "HOOK_HORROR") + return APPEARANCE_TYPE_HOOK_HORROR; + if (sCom == "HOBGOBLIN_WIZARD") + return APPEARANCE_TYPE_HOBGOBLIN_WIZARD; + if (sCom == "HOUSE_GUARD") + return APPEARANCE_TYPE_HOUSE_GUARD; + if (sCom == "HUMAN") + return APPEARANCE_TYPE_HUMAN; + if (sCom == "HUMAN_NPC_FEMALE_01") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_01; + if (sCom == "HUMAN_NPC_FEMALE_02") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_02; + if (sCom == "HUMAN_NPC_FEMALE_03") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_03; + if (sCom == "HUMAN_NPC_FEMALE_04") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_04; + if (sCom == "HUMAN_NPC_FEMALE_05") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_05; + if (sCom == "HUMAN_NPC_FEMALE_06") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_06; + if (sCom == "HUMAN_NPC_FEMALE_07") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_07; + if (sCom == "HUMAN_NPC_FEMALE_08") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_08; + if (sCom == "HUMAN_NPC_FEMALE_09") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_09; + if (sCom == "HUMAN_NPC_FEMALE_10") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_10; + if (sCom == "HUMAN_NPC_FEMALE_11") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_11; + if (sCom == "HUMAN_NPC_FEMALE_12") + return APPEARANCE_TYPE_HUMAN_NPC_FEMALE_12; + if (sCom == "HUMAN_NPC_MALE_01") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_01; + if (sCom == "HUMAN_NPC_MALE_02") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_02; + if (sCom == "HUMAN_NPC_MALE_03") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_03; + if (sCom == "HUMAN_NPC_MALE_04") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_04; + if (sCom == "HUMAN_NPC_MALE_05") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_05; + if (sCom == "HUMAN_NPC_MALE_06") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_06; + if (sCom == "HUMAN_NPC_MALE_07") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_07; + if (sCom == "HUMAN_NPC_MALE_08") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_08; + if (sCom == "HUMAN_NPC_MALE_09") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_09; + if (sCom == "HUMAN_NPC_MALE_10") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_10; + if (sCom == "HUMAN_NPC_MALE_11") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_11; + if (sCom == "HUMAN_NPC_MALE_12") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_12; + if (sCom == "HUMAN_NPC_MALE_13") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_13; + if (sCom == "HUMAN_NPC_MALE_14") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_14; + if (sCom == "HUMAN_NPC_MALE_15") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_15; + if (sCom == "HUMAN_NPC_MALE_16") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_16; + if (sCom == "HUMAN_NPC_MALE_17") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_17; + if (sCom == "HUMAN_NPC_MALE_18") + return APPEARANCE_TYPE_HUMAN_NPC_MALE_18; + if (sCom == "IMP") + return APPEARANCE_TYPE_IMP; + if (sCom == "INN_KEEPER") + return APPEARANCE_TYPE_INN_KEEPER; + if (sCom == "INTELLECT_DEVOURER") + return APPEARANCE_TYPE_INTELLECT_DEVOURER; + if (sCom == "INVISIBLE_HUMAN_MALE") + return APPEARANCE_TYPE_INVISIBLE_HUMAN_MALE; + if (sCom == "INVISIBLE_STALKER") + return APPEARANCE_TYPE_INVISIBLE_STALKER; + if (sCom == "KID_FEMALE") + return APPEARANCE_TYPE_KID_FEMALE; + if (sCom == "KID_MALE") + return APPEARANCE_TYPE_KID_MALE; + if (sCom == "KOBOLD_A") + return APPEARANCE_TYPE_KOBOLD_A; + if (sCom == "KOBOLD_B") + return APPEARANCE_TYPE_KOBOLD_B; + if (sCom == "KOBOLD_CHIEF_A") + return APPEARANCE_TYPE_KOBOLD_CHIEF_A; + if (sCom == "KOBOLD_CHIEF_B") + return APPEARANCE_TYPE_KOBOLD_CHIEF_B; + if (sCom == "KOBOLD_SHAMAN_A") + return APPEARANCE_TYPE_KOBOLD_SHAMAN_A; + if (sCom == "KOBOLD_SHAMAN_B") + return APPEARANCE_TYPE_KOBOLD_SHAMAN_B; + if (sCom == "LANTERN_ARCHON") + return APPEARANCE_TYPE_LANTERN_ARCHON; + if (sCom == "LICH") + return APPEARANCE_TYPE_LICH; + if (sCom == "LIZARDFOLK_A") + return APPEARANCE_TYPE_LIZARDFOLK_A; + if (sCom == "LIZARDFOLK_B") + return APPEARANCE_TYPE_LIZARDFOLK_B; + if (sCom == "LIZARDFOLK_SHAMAN_A") + return APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_A; + if (sCom == "LIZARDFOLK_SHAMAN_B") + return APPEARANCE_TYPE_LIZARDFOLK_SHAMAN_B; + if (sCom == "LIZARDFOLK_WARRIOR_A") + return APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_A; + if (sCom == "LIZARDFOLK_WARRIOR_B") + return APPEARANCE_TYPE_LIZARDFOLK_WARRIOR_B; + if (sCom == "LUSKAN_GUARD") + return APPEARANCE_TYPE_LUSKAN_GUARD; + if (sCom == "MALE_01") + return APPEARANCE_TYPE_MALE_01; + if (sCom == "MALE_02") + return APPEARANCE_TYPE_MALE_02; + if (sCom == "MALE_03") + return APPEARANCE_TYPE_MALE_03; + if (sCom == "MALE_04") + return APPEARANCE_TYPE_MALE_04; + if (sCom == "MALE_05") + return APPEARANCE_TYPE_MALE_05; + if (sCom == "MANTICORE") + return APPEARANCE_TYPE_MANTICORE; + if (sCom == "MEDUSA") + return APPEARANCE_TYPE_MEDUSA; + if (sCom == "MEPHIT_AIR") + return APPEARANCE_TYPE_MEPHIT_AIR; + if (sCom == "MEPHIT_DUST") + return APPEARANCE_TYPE_MEPHIT_DUST; + if (sCom == "MEPHIT_EARTH") + return APPEARANCE_TYPE_MEPHIT_EARTH; + if (sCom == "MEPHIT_FIRE") + return APPEARANCE_TYPE_MEPHIT_FIRE; + if (sCom == "MEPHIT_ICE") + return APPEARANCE_TYPE_MEPHIT_ICE; + if (sCom == "MEPHIT_MAGMA") + return APPEARANCE_TYPE_MEPHIT_MAGMA; + if (sCom == "MEPHIT_OOZE") + return APPEARANCE_TYPE_MEPHIT_OOZE; + if (sCom == "MEPHIT_SALT") + return APPEARANCE_TYPE_MEPHIT_SALT; + if (sCom == "MEPHIT_STEAM") + return APPEARANCE_TYPE_MEPHIT_STEAM; + if (sCom == "MEPHIT_WATER") + return APPEARANCE_TYPE_MEPHIT_WATER; + if (sCom == "MINOGON") + return APPEARANCE_TYPE_MINOGON; + if (sCom == "MINOTAUR") + return APPEARANCE_TYPE_MINOTAUR; + if (sCom == "MINOTAUR_CHIEFTAIN") + return APPEARANCE_TYPE_MINOTAUR_CHIEFTAIN; + if (sCom == "MINOTAUR_SHAMAN") + return APPEARANCE_TYPE_MINOTAUR_SHAMAN; + if (sCom == "MOHRG") + return APPEARANCE_TYPE_MOHRG; + if (sCom == "MUMMY_COMMON") + return APPEARANCE_TYPE_MUMMY_COMMON; + if (sCom == "MUMMY_FIGHTER_2") + return APPEARANCE_TYPE_MUMMY_FIGHTER_2; + if (sCom == "MUMMY_GREATER") + return APPEARANCE_TYPE_MUMMY_GREATER; + if (sCom == "MUMMY_WARRIOR") + return APPEARANCE_TYPE_MUMMY_WARRIOR; + if (sCom == "NW_MILITIA_MEMBER") + return APPEARANCE_TYPE_NW_MILITIA_MEMBER; + if (sCom == "NWN_AARIN") + return APPEARANCE_TYPE_NWN_AARIN; + if (sCom == "NWN_ARIBETH_EVIL") + return APPEARANCE_TYPE_NWN_ARIBETH_EVIL; + if (sCom == "NWN_HAEDRALINE") + return APPEARANCE_TYPE_NWN_HAEDRALINE; + if (sCom == "NWN_MAUGRIM") + return APPEARANCE_TYPE_NWN_MAUGRIM; + if (sCom == "NWN_MORAG") + return APPEARANCE_TYPE_NWN_MORAG; + if (sCom == "NWN_NASHER") + return APPEARANCE_TYPE_NWN_NASHER; + if (sCom == "NWN_SEDOS") + return APPEARANCE_TYPE_NWN_SEDOS; + if (sCom == "NYMPH") + return APPEARANCE_TYPE_NYMPH; + if (sCom == "OGRE") + return APPEARANCE_TYPE_OGRE; + if (sCom == "OGRE_CHIEFTAIN") + return APPEARANCE_TYPE_OGRE_CHIEFTAIN; + if (sCom == "OGRE_CHIEFTAINB") + return APPEARANCE_TYPE_OGRE_CHIEFTAINB; + if (sCom == "OGRE_MAGE") + return APPEARANCE_TYPE_OGRE_MAGE; + if (sCom == "OGRE_MAGEB") + return APPEARANCE_TYPE_OGRE_MAGEB; + if (sCom == "OGREB") + return APPEARANCE_TYPE_OGREB; + if (sCom == "OLD_MAN") + return APPEARANCE_TYPE_OLD_MAN; + if (sCom == "OLD_WOMAN") + return APPEARANCE_TYPE_OLD_WOMAN; + if (sCom == "ORC_A") + return APPEARANCE_TYPE_ORC_A; + if (sCom == "ORC_B") + return APPEARANCE_TYPE_ORC_B; + if (sCom == "ORC_CHIEFTAIN_A") + return APPEARANCE_TYPE_ORC_CHIEFTAIN_A; + if (sCom == "ORC_CHIEFTAIN_B") + return APPEARANCE_TYPE_ORC_CHIEFTAIN_B; + if (sCom == "ORC_SHAMAN_A") + return APPEARANCE_TYPE_ORC_SHAMAN_A; + if (sCom == "ORC_SHAMAN_B") + return APPEARANCE_TYPE_ORC_SHAMAN_B; + if (sCom == "OX") + return APPEARANCE_TYPE_OX; + if (sCom == "PENGUIN") + return APPEARANCE_TYPE_PENGUIN; + if (sCom == "PLAGUE_VICTIM") + return APPEARANCE_TYPE_PLAGUE_VICTIM; + if (sCom == "PROSTITUTE_01") + return APPEARANCE_TYPE_PROSTITUTE_01; + if (sCom == "PROSTITUTE_02") + return APPEARANCE_TYPE_PROSTITUTE_02; + if (sCom == "PSEUDODRAGON") + return APPEARANCE_TYPE_PSEUDODRAGON; + if (sCom == "QUASIT") + return APPEARANCE_TYPE_QUASIT; + if (sCom == "RAKSHASA_BEAR_MALE") + return APPEARANCE_TYPE_RAKSHASA_BEAR_MALE; + if (sCom == "RAKSHASA_TIGER_FEMALE") + return APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE; + if (sCom == "RAKSHASA_TIGER_MALE") + return APPEARANCE_TYPE_RAKSHASA_TIGER_MALE; + if (sCom == "RAKSHASA_WOLF_MALE") + return APPEARANCE_TYPE_RAKSHASA_WOLF_MALE; + if (sCom == "RAT") + return APPEARANCE_TYPE_RAT; + if (sCom == "RAT_DIRE") + return APPEARANCE_TYPE_RAT_DIRE; + if (sCom == "RAVEN") + return APPEARANCE_TYPE_RAVEN; + if (sCom == "SHADOW") + return APPEARANCE_TYPE_SHADOW; + if (sCom == "SHADOW_FIEND") + return APPEARANCE_TYPE_SHADOW_FIEND; + if (sCom == "SHIELD_GUARDIAN") + return APPEARANCE_TYPE_SHIELD_GUARDIAN; + if (sCom == "SHOP_KEEPER") + return APPEARANCE_TYPE_SHOP_KEEPER; + if (sCom == "SKELETAL_DEVOURER") + return APPEARANCE_TYPE_SKELETAL_DEVOURER; + if (sCom == "SKELETON_CHIEFTAIN") + return APPEARANCE_TYPE_SKELETON_CHIEFTAIN; + if (sCom == "SKELETON_COMMON") + return APPEARANCE_TYPE_SKELETON_COMMON; + if (sCom == "SKELETON_MAGE") + return APPEARANCE_TYPE_SKELETON_MAGE; + if (sCom == "SKELETON_WARRIOR") + return APPEARANCE_TYPE_SKELETON_WARRIOR; + if (sCom == "SKELETON_PRIEST") + return APPEARANCE_TYPE_SKELETON_PRIEST; + if (sCom == "SKELETON_WARRIOR_1") + return APPEARANCE_TYPE_SKELETON_WARRIOR_1; + if (sCom == "SKELETON_WARRIOR_2") + return APPEARANCE_TYPE_SKELETON_WARRIOR_2; + if (sCom == "SPHINX") + return APPEARANCE_TYPE_SPHINX; + if (sCom == "SPIDER_WRAITH") + return APPEARANCE_TYPE_SPIDER_WRAITH; + if (sCom == "STINGER") + return APPEARANCE_TYPE_STINGER; + if (sCom == "STINGER_CHIEFTAIN") + return APPEARANCE_TYPE_STINGER_CHIEFTAIN; + if (sCom == "STINGER_MAGE") + return APPEARANCE_TYPE_STINGER_MAGE; + if (sCom == "STINGER_WARRIOR") + return APPEARANCE_TYPE_STINGER_WARRIOR; + if (sCom == "SUCCUBUS") + return APPEARANCE_TYPE_SUCCUBUS; + if (sCom == "TROLL") + return APPEARANCE_TYPE_TROLL; + if (sCom == "TROLL_CHIEFTAIN") + return APPEARANCE_TYPE_TROLL_CHIEFTAIN; + if (sCom == "TROLL_SHAMAN") + return APPEARANCE_TYPE_TROLL_SHAMAN; + if (sCom == "UMBERHULK") + return APPEARANCE_TYPE_UMBERHULK; + if (sCom == "UTHGARD_ELK_TRIBE") + return APPEARANCE_TYPE_UTHGARD_ELK_TRIBE; + if (sCom == "UTHGARD_TIGER_TRIBE") + return APPEARANCE_TYPE_UTHGARD_TIGER_TRIBE; + if (sCom == "VAMPIRE_FEMALE") + return APPEARANCE_TYPE_VAMPIRE_FEMALE; + if (sCom == "VAMPIRE_MALE") + return APPEARANCE_TYPE_VAMPIRE_MALE; + if (sCom == "VROCK") + return APPEARANCE_TYPE_VROCK; + if (sCom == "WAITRESS") + return APPEARANCE_TYPE_WAITRESS; + if (sCom == "WAR_DEVOURER") + return APPEARANCE_TYPE_WAR_DEVOURER; + if (sCom == "WERECAT") + return APPEARANCE_TYPE_WERECAT; + if (sCom == "WERERAT") + return APPEARANCE_TYPE_WERERAT; + if (sCom == "WEREWOLF") + return APPEARANCE_TYPE_WEREWOLF; + if (sCom == "WIGHT") + return APPEARANCE_TYPE_WIGHT; + if (sCom == "WILL_O_WISP") + return APPEARANCE_TYPE_WILL_O_WISP; + if (sCom == "WRAITH") + return APPEARANCE_TYPE_WRAITH; + if (sCom == "WYRMLING_BLACK") + return APPEARANCE_TYPE_WYRMLING_BLACK; + if (sCom == "WYRMLING_BLUE") + return APPEARANCE_TYPE_WYRMLING_BLUE; + if (sCom == "WYRMLING_BRASS") + return APPEARANCE_TYPE_WYRMLING_BRASS; + if (sCom == "WYRMLING_BRONZE") + return APPEARANCE_TYPE_WYRMLING_BRONZE; + if (sCom == "WYRMLING_COPPER") + return APPEARANCE_TYPE_WYRMLING_COPPER; + if (sCom == "WYRMLING_GOLD") + return APPEARANCE_TYPE_WYRMLING_GOLD; + if (sCom == "WYRMLING_GREEN") + return APPEARANCE_TYPE_WYRMLING_GREEN; + if (sCom == "WYRMLING_RED") + return APPEARANCE_TYPE_WYRMLING_RED; + if (sCom == "WYRMLING_SILVER") + return APPEARANCE_TYPE_WYRMLING_SILVER; + if (sCom == "WYRMLING_WHITE") + return APPEARANCE_TYPE_WYRMLING_WHITE; + if (sCom == "YUAN_TI") + return APPEARANCE_TYPE_YUAN_TI; + if (sCom == "YUAN_TI_CHIEFTEN") + return APPEARANCE_TYPE_YUAN_TI_CHIEFTEN; + if (sCom == "YUAN_TI_WIZARD") + return APPEARANCE_TYPE_YUAN_TI_WIZARD; + if (sCom == "ZOMBIE") + return APPEARANCE_TYPE_ZOMBIE; + if (sCom == "ZOMBIE_ROTTING") + return APPEARANCE_TYPE_ZOMBIE_ROTTING; + if (sCom == "ZOMBIE_TYRANT_FOG") + return APPEARANCE_TYPE_ZOMBIE_TYRANT_FOG; + if (sCom == "ZOMBIE_WARRIOR_1") + return APPEARANCE_TYPE_ZOMBIE_WARRIOR_1; + if (sCom == "ZOMBIE_WARRIOR_2") + return APPEARANCE_TYPE_ZOMBIE_WARRIOR_2; + + // new 1.09 behavior - also check against the 2da + string s2daval; + int i = 0; + while (1) + { + s2daval = Get2DAString("appearance", "NAME", i); + if (s2daval == "") break; // end of file + s2daval = Get2DAString("appearance", "LABEL", i); + if (s2daval != "") + { + if (GetStringUpperCase(sCom) == GetStringUpperCase(s2daval)) return i; + } + i++; + } + return -1; +} + +//////////////////////////////////////////////////////////////////////// +void dmw_CleanUp(object oMySpeaker) +{ + int nCount; + int nCache; + //DeleteLocalObject(oMySpeaker, "dmfi_univ_target"); + DeleteLocalLocation(oMySpeaker, "dmfi_univ_location"); + DeleteLocalObject(oMySpeaker, "dmw_item"); + DeleteLocalString(oMySpeaker, "dmw_repamt"); + DeleteLocalString(oMySpeaker, "dmw_repargs"); + nCache = GetLocalInt(oMySpeaker, "dmw_playercache"); + for (nCount = 1; nCount <= nCache; nCount++) + { + DeleteLocalObject(oMySpeaker, "dmw_playercache" + IntToString(nCount)); + } + DeleteLocalInt(oMySpeaker, "dmw_playercache"); + nCache = GetLocalInt(oMySpeaker, "dmw_itemcache"); + for (nCount = 1; nCount <= nCache; nCount++) + { + DeleteLocalObject(oMySpeaker, "dmw_itemcache" + IntToString(nCount)); + } + DeleteLocalInt(oMySpeaker, "dmw_itemcache"); + for (nCount = 1; nCount <= 10; nCount++) + { + DeleteLocalString(oMySpeaker, "dmw_dialog" + IntToString(nCount)); + DeleteLocalString(oMySpeaker, "dmw_function" + IntToString(nCount)); + DeleteLocalString(oMySpeaker, "dmw_params" + IntToString(nCount)); + } + DeleteLocalString(oMySpeaker, "dmw_playerfunc"); + DeleteLocalInt(oMySpeaker, "dmw_started"); +} + +//////////////////////////////////////////////////////////////////////// +//Smoking Function by Jason Robinson +location GetLocationAboveAndInFrontOf(object oPC, float fDist, float fHeight) +{ + float fDistance = -fDist; + object oTarget = (oPC); + object oArea = GetArea(oTarget); + vector vPosition = GetPosition(oTarget); + vPosition.z += fHeight; + float fOrientation = GetFacing(oTarget); + vector vNewPos = AngleToVector(fOrientation); + float vZ = vPosition.z; + float vX = vPosition.x - fDistance * vNewPos.x; + float vY = vPosition.y - fDistance * vNewPos.y; + fOrientation = GetFacing(oTarget); + vX = vPosition.x - fDistance * vNewPos.x; + vY = vPosition.y - fDistance * vNewPos.y; + vNewPos = AngleToVector(fOrientation); + vZ = vPosition.z; + vNewPos = Vector(vX, vY, vZ); + return Location(oArea, vNewPos, fOrientation); +} + +//////////////////////////////////////////////////////////////////////// +//Smoking Function by Jason Robinson +void SmokePipe(object oActivator) +{ + string sEmote1 = "*puffs on a pipe*"; + string sEmote2 = "*inhales from a pipe*"; + string sEmote3 = "*pulls a mouthful of smoke from a pipe*"; + float fHeight = 1.7; + float fDistance = 0.1; + // Set height based on race and gender + if (GetGender(oActivator) == GENDER_MALE) + { + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.7; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.55; fDistance = 0.08; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.15; fDistance = 0.12; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.12; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.9; fDistance = 0.2; break; + } + } + else + { + // FEMALES + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.6; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.45; fDistance = 0.12; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.1; fDistance = 0.075; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.1; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.8; fDistance = 0.13; break; + } + } + location lAboveHead = GetLocationAboveAndInFrontOf(oActivator, fDistance, fHeight); + // emotes + switch (d3()) + { + case 1: AssignCommand(oActivator, ActionSpeakString(sEmote1)); break; + case 2: AssignCommand(oActivator, ActionSpeakString(sEmote2)); break; + case 3: AssignCommand(oActivator, ActionSpeakString(sEmote3));break; + } + // glow red + AssignCommand(oActivator, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_5), oActivator, 0.15))); + // wait a moment + AssignCommand(oActivator, ActionWait(3.0)); + // puff of smoke above and in front of head + AssignCommand(oActivator, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), lAboveHead))); + // if female, turn head to left + if ((GetGender(oActivator) == GENDER_FEMALE) && (GetRacialType(oActivator) != RACIAL_TYPE_DWARF)) + AssignCommand(oActivator, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 5.0)); +} + +//////////////////////////////////////////////////////////////////////// +void ParseEmote(string sEmote, object oPC) +{ + // allow builder to suppress + if (GetLocalInt(GetModule(), "DMFI_SUPPRESS_EMOTES") != 0) return; + + // see if PC has muted their own emotes + if (GetLocalInt(oPC, "hls_emotemute") != 0) return; + + DeleteLocalInt(oPC, "dmfi_univ_int"); + object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC); + object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC); + + if (GetStringLeft(sEmote, 1) == "*") + { + int iToggle; + string sBuffer; + sBuffer = GetStringRight(sEmote, GetStringLength(sEmote)-1); + while (!iToggle && GetStringLength(sBuffer) > 1) + { + if (GetStringLeft(sBuffer,1) == "*") + iToggle = abs(iToggle - 1); + sBuffer = GetStringRight(sBuffer, GetStringLength(sBuffer)-1); + } + sEmote = GetStringLeft(sEmote, GetStringLength(sEmote)-GetStringLength(sBuffer)); + } + + int iSit; + object oArea; + object oChair; + // morderon - rewrote from here to end for better text case handling + string sLCEmote = GetStringLowerCase(sEmote); + //*emote* rolls + if ((FindSubString(sLCEmote, "strength") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 61); + else if ((FindSubString(sLCEmote, "dexterity") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 62); + else if ((FindSubString(sLCEmote, "constitution") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 63); + else if ((FindSubString(sLCEmote, "intelligence") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 64); + else if ((FindSubString(sLCEmote, "wisdom") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 65); + else if ((FindSubString(sLCEmote, "charisma") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 66); + else if ((FindSubString(sLCEmote, "fortitude") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 67); + else if ((FindSubString(sLCEmote, "reflex") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 68); + else if ((FindSubString(sLCEmote, "will") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 69); + else if ((FindSubString(sLCEmote, "animal empathy") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 71); + else if ((FindSubString(sLCEmote, "appraise") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 72); + else if ((FindSubString(sLCEmote, "bluff") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 73); + else if ((FindSubString(sLCEmote, "concentration") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 74); + else if ((FindSubString(sLCEmote, "craft armor") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 75); + else if ((FindSubString(sLCEmote, "craft trap") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 76); + else if ((FindSubString(sLCEmote, "craft weapon") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 77); + else if ((FindSubString(sLCEmote, "disable trap") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 78); + else if ((FindSubString(sLCEmote, "discipline") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 79); + else if ((FindSubString(sLCEmote, "heal") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 81); + else if ((FindSubString(sLCEmote, "hide") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 82); + else if ((FindSubString(sLCEmote, "intimidate") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 83); + else if ((FindSubString(sLCEmote, "listen") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 84); + else if ((FindSubString(sLCEmote, "lore") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 85); + else if ((FindSubString(sLCEmote, "move silently") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 86); + else if ((FindSubString(sLCEmote, "open lock") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 87); + else if ((FindSubString(sLCEmote, "parry") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 88); + else if ((FindSubString(sLCEmote, "perform") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 89); + else if ((FindSubString(sLCEmote, "persuade") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 91); + else if ((FindSubString(sLCEmote, "pick pocket") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 92); + else if ((FindSubString(sLCEmote, "search") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 93); + else if ((FindSubString(sLCEmote, "set trap") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 94); + else if ((FindSubString(sLCEmote, "spellcraft") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 95); + else if ((FindSubString(sLCEmote, "spot") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 96); + else if ((FindSubString(sLCEmote, "taunt") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 97); + else if ((FindSubString(sLCEmote, "tumble") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 98); + else if ((FindSubString(sLCEmote, "use magic device") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 99); + else if ((FindSubString(sLCEmote, "ride") != -1)) + SetLocalInt(oPC, "dmfi_univ_int", 90); + if (GetLocalInt(oPC, "dmfi_univ_int")) + { + SetLocalString(oPC, "dmfi_univ_conv", "pc_dicebag"); + ExecuteScript("dmfi_execute", oPC); + return; + } + + //*emote* + if (FindSubString(GetStringLowerCase(sEmote), "*bows") != -1 || + FindSubString(GetStringLowerCase(sEmote), " bows") != -1 || + FindSubString(GetStringLowerCase(sEmote), "curtsey") != -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_BOW, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "drink") != -1 || + FindSubString(GetStringLowerCase(sEmote), "sips") != -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_DRINK, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "drinks") != -1 && + FindSubString(GetStringLowerCase(sEmote), "sits") != -1) + { + AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f)); + DelayCommand(1.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_FIREFORGET_DRINK, 1.0))); + DelayCommand(3.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0))); + } + else if (FindSubString(GetStringLowerCase(sEmote), "reads") != -1 && + FindSubString(GetStringLowerCase(sEmote), "sits") != -1) + { + AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f)); + DelayCommand(1.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_FIREFORGET_READ, 1.0))); + DelayCommand(3.0f, AssignCommand(oPC, PlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0))); + } + else if (FindSubString(GetStringLowerCase(sEmote), "sit")!= -1) + { + AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0f)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "greet")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "wave") != -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_GREETING, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "yawn")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "stretch") != -1 || + FindSubString(GetStringLowerCase(sEmote), "bored") != -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "scratch")!= -1) + { + AssignCommand(oPC,ActionUnequipItem(oRightHand)); + AssignCommand(oPC,ActionUnequipItem(oLeftHand)); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 1.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "*reads")!= -1 || + FindSubString(GetStringLowerCase(sEmote), " reads")!= -1|| + FindSubString(GetStringLowerCase(sEmote), "read")!= -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_READ, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "salute")!= -1) + { + AssignCommand(oPC,ActionUnequipItem(oRightHand)); + AssignCommand(oPC,ActionUnequipItem(oLeftHand)); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_SALUTE, 1.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "steal")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "swipe") != -1) + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_STEAL, 1.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "taunt")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "mock") != -1) + { + PlayVoiceChat(VOICE_CHAT_TAUNT, oPC); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_TAUNT, 1.0)); + } + else if ((FindSubString(GetStringLowerCase(sEmote), "smokes") != -1)|| + (FindSubString(GetStringLowerCase(sEmote), "smoke") != -1)) + { + SmokePipe(oPC); + } + else if (FindSubString(GetStringLowerCase(sEmote), "cheer ")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "cheer*")!= -1) + { + PlayVoiceChat(VOICE_CHAT_CHEER, oPC); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY1, 1.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "hooray")!= -1) + { + PlayVoiceChat(VOICE_CHAT_CHEER, oPC); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY2, 1.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "celebrate")!= -1) + { + PlayVoiceChat(VOICE_CHAT_CHEER, oPC); + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_VICTORY3, 1.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "giggle")!= -1 && GetGender(oPC) == GENDER_FEMALE) + AssignCommand(oPC, PlaySound("vs_fshaldrf_haha")); + else if (FindSubString(GetStringLowerCase(sEmote), "flop")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "prone")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "bends")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "stoop")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "fiddle")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 5.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "nod")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "agree")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 4.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "peers")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "scans")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "search")!= -1) + AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_LOOK_FAR, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "*pray")!= -1 || + FindSubString(GetStringLowerCase(sEmote), " pray")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "meditate")!= -1) + { + AssignCommand(oPC,ActionUnequipItem(oRightHand)); + AssignCommand(oPC,ActionUnequipItem(oLeftHand)); + AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 99999.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "drunk")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "woozy")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "tired")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "fatigue")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "exhausted")!= -1) + { + PlayVoiceChat(VOICE_CHAT_REST, oPC); + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED, 1.0, 3.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "fidget")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "shifts")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE2, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "sits")!= -1 && + (FindSubString(GetStringLowerCase(sEmote), "floor")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "ground")!= -1)) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "demand")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "threaten")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "laugh")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "chuckle")!= -1) + { + PlayVoiceChat(VOICE_CHAT_LAUGH, oPC); + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 2.0)); + } + else if (FindSubString(GetStringLowerCase(sEmote), "begs")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "plead")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "worship")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "snore")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "*naps")!= -1 || + FindSubString(GetStringLowerCase(sEmote), " naps")!= -1|| + FindSubString(GetStringLowerCase(sEmote), "nap")!= -1) + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oPC); + else if (FindSubString(GetStringLowerCase(sEmote), "*sings")!= -1 || + FindSubString(GetStringLowerCase(sEmote), " sings")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "hums")!= -1) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BARD_SONG), oPC, 6.0f); + else if (FindSubString(GetStringLowerCase(sEmote), "whistles")!= -1) + AssignCommand(oPC, PlaySound("as_pl_whistle2")); + else if (FindSubString(GetStringLowerCase(sEmote), "talks")!= -1 || + FindSubString(GetStringLowerCase(sEmote), "chats")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "shakes head")!= -1) + { + AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 0.25f)); + DelayCommand(0.15f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.0, 0.25f))); + DelayCommand(0.40f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 0.25f))); + DelayCommand(0.65f, AssignCommand(oPC, PlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.0, 0.25f))); + } + else if (FindSubString(GetStringLowerCase(sEmote), "ducks")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_DODGE_DUCK, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "dodge")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_DODGE_SIDE, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "cantrip")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "spellcast")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "fall")!= -1 && + FindSubString(GetStringLowerCase(sEmote), "back")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 99999.0)); + else if (FindSubString(GetStringLowerCase(sEmote), "spasm")!= -1) + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SPASM, 1.0, 99999.0)); +} + +//////////////////////////////////////////////////////////////////////// +string ConvertCustom(string sLetter, int iRotate) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + + //Functional groups for custom languages + //Vowel Sounds: a, e, i, o, u + //Hard Sounds: b, d, k, p, t + //Sibilant Sounds: c, f, s, q, w + //Soft Sounds: g, h, l, r, y + //Hummed Sounds: j, m, n, v, z + //Oddball out: x, the rarest letter in the alphabet + + string sTranslate = "aeiouAEIOUbdkptBDKPTcfsqwCFSQWghlryGHLRYjmnvzJMNVZxX"; + int iTrans = FindSubString(sTranslate, sLetter); + if (iTrans == -1) return sLetter; //return any character that isn't on the cipher + + //Now here's the tricky part... recalculating the offsets according functional + //letter group, to produce an huge variety of "new" languages. + + int iOffset = iRotate % 5; + int iGroup = iTrans / 5; + int iBonus = iTrans / 10; + int iMultiplier = iRotate / 5; + iOffset = iTrans + iOffset + (iMultiplier * iBonus); + + return GetSubString(sTranslate, iGroup * 5 + iOffset % 5, 1); +}//end ConvertCustom + +//////////////////////////////////////////////////////////////////////// +string ProcessCustom(string sPhrase, int iLanguage) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertCustom(GetStringLeft(sPhrase, 1), iLanguage); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertDrow(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "il"; + case 26: return "Il"; + case 1: return "f"; + case 27: return "F"; + case 2: return "st"; + case 28: return "St"; + case 3: return "w"; + case 4: return "a"; + case 5: return "o"; + case 6: return "v"; + case 7: return "ir"; + case 33: return "Ir"; + case 8: return "e"; + case 9: return "vi"; + case 35: return "Vi"; + case 10: return "go"; + case 11: return "c"; + case 12: return "li"; + case 13: return "l"; + case 14: return "e"; + case 15: return "ty"; + case 41: return "Ty"; + case 16: return "r"; + case 17: return "m"; + case 18: return "la"; + case 44: return "La"; + case 19: return "an"; + case 45: return "An"; + case 20: return "y"; + case 21: return "el"; + case 47: return "El"; + case 22: return "ky"; + case 48: return "Ky"; + case 23: return "'"; + case 24: return "a"; + case 25: return "p'"; + case 29: return "W"; + case 30: return "A"; + case 31: return "O"; + case 32: return "V"; + case 34: return "E"; + case 36: return "Go"; + case 37: return "C"; + case 38: return "Li"; + case 39: return "L"; + case 40: return "E"; + case 42: return "R"; + case 43: return "M"; + case 46: return "Y"; + case 49: return "'"; + case 50: return "A"; + case 51: return "P'"; + + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessDrow(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertDrow(GetStringLeft(sPhrase, 1)); + + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + + +//////////////////////////////////////////////////////////////////////// +string ConvertLeetspeak(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "4"; + case 26: return "4"; + case 1: return "8"; + case 27: return "8"; + case 2: return "("; + case 28: return "("; + case 3: return "|)"; + case 29: return "|)"; + case 4: return "3"; + case 30: return "3"; + case 5: return "f"; + case 31: return "F"; + case 6: return "9"; + case 32: return "9"; + case 7: return "h"; + case 33: return "H"; + case 8: return "!"; + case 34: return "!"; + case 9: return "j"; + case 35: return "J"; + case 10: return "|<"; + case 36: return "|<"; + case 11: return "1"; + case 37: return "1"; +// case 12: return "/\/\"; +// case 38: return "/\/\"; + case 13: return "|\|"; + case 39: return "|\|"; + case 14: return "0"; + case 40: return "0"; + case 15: return "p"; + case 41: return "P"; + case 16: return "Q"; + case 42: return "Q"; + case 17: return "R"; + case 43: return "R"; + case 18: return "5"; + case 44: return "5"; + case 19: return "7"; + case 45: return "7"; + case 20: return "u"; + case 46: return "U"; + case 21: return "\/"; + case 47: return "\/"; + case 22: return "\/\/"; + case 48: return "\/\/"; + case 23: return "x"; + case 49: return "X"; + case 24: return "y"; + case 50: return "Y"; + case 25: return "2"; + case 51: return "2"; + default: return sLetter; + } + return ""; +}//end ConvertLeetspeak + +//////////////////////////////////////////////////////////////////////// +string ProcessLeetspeak(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertLeetspeak(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertInfernal(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "o"; + case 1: return "c"; + case 2: return "r"; + case 3: return "j"; + case 4: return "a"; + case 5: return "v"; + case 6: return "k"; + case 7: return "r"; + case 8: return "y"; + case 9: return "z"; + case 10: return "g"; + case 11: return "m"; + case 12: return "z"; + case 13: return "r"; + case 14: return "y"; + case 15: return "k"; + case 16: return "r"; + case 17: return "n"; + case 18: return "k"; + case 19: return "d"; + case 20: return "'"; + case 21: return "r"; + case 22: return "'"; + case 23: return "k"; + case 24: return "i"; + case 25: return "g"; + case 26: return "O"; + case 27: return "C"; + case 28: return "R"; + case 29: return "J"; + case 30: return "A"; + case 31: return "V"; + case 32: return "K"; + case 33: return "R"; + case 34: return "Y"; + case 35: return "Z"; + case 36: return "G"; + case 37: return "M"; + case 38: return "Z"; + case 39: return "R"; + case 40: return "Y"; + case 41: return "K"; + case 42: return "R"; + case 43: return "N"; + case 44: return "K"; + case 45: return "D"; + case 46: return "'"; + case 47: return "R"; + case 48: return "'"; + case 49: return "K"; + case 50: return "I"; + case 51: return "G"; + default: return sLetter; + } + return ""; +}//end ConvertInfernal + +//////////////////////////////////////////////////////////////////////// +string ProcessInfernal(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertInfernal(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertAbyssal(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 27: return "N"; + case 28: return "M"; + case 29: return "G"; + case 30: return "A"; + case 31: return "K"; + case 32: return "S"; + case 33: return "D"; + case 35: return "H"; + case 36: return "B"; + case 37: return "L"; + case 38: return "P"; + case 39: return "T"; + case 40: return "E"; + case 41: return "B"; + case 43: return "N"; + case 44: return "M"; + case 45: return "G"; + case 48: return "B"; + case 51: return "T"; + case 0: return "oo"; + case 26: return "OO"; + case 1: return "n"; + case 2: return "m"; + case 3: return "g"; + case 4: return "a"; + case 5: return "k"; + case 6: return "s"; + case 7: return "d"; + case 8: return "oo"; + case 34: return "OO"; + case 9: return "h"; + case 10: return "b"; + case 11: return "l"; + case 12: return "p"; + case 13: return "t"; + case 14: return "e"; + case 15: return "b"; + case 16: return "ch"; + case 42: return "Ch"; + case 17: return "n"; + case 18: return "m"; + case 19: return "g"; + case 20: return "ae"; + case 46: return "Ae"; + case 21: return "ts"; + case 47: return "Ts"; + case 22: return "b"; + case 23: return "bb"; + case 49: return "Bb"; + case 24: return "ee"; + case 50: return "Ee"; + case 25: return "t"; + default: return sLetter; + } + return ""; +}//end ConvertAbyssal + +//////////////////////////////////////////////////////////////////////// +string ProcessAbyssal(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertAbyssal(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertCelestial(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "a"; + case 1: return "p"; + case 2: return "v"; + case 3: return "t"; + case 4: return "el"; + case 5: return "b"; + case 6: return "w"; + case 7: return "r"; + case 8: return "i"; + case 9: return "m"; + case 10: return "x"; + case 11: return "h"; + case 12: return "s"; + case 13: return "c"; + case 14: return "u"; + case 15: return "q"; + case 16: return "d"; + case 17: return "n"; + case 18: return "l"; + case 19: return "y"; + case 20: return "o"; + case 21: return "j"; + case 22: return "f"; + case 23: return "g"; + case 24: return "z"; + case 25: return "k"; + case 26: return "A"; + case 27: return "P"; + case 28: return "V"; + case 29: return "T"; + case 30: return "El"; + case 31: return "B"; + case 32: return "W"; + case 33: return "R"; + case 34: return "I"; + case 35: return "M"; + case 36: return "X"; + case 37: return "H"; + case 38: return "S"; + case 39: return "C"; + case 40: return "U"; + case 41: return "Q"; + case 42: return "D"; + case 43: return "N"; + case 44: return "L"; + case 45: return "Y"; + case 46: return "O"; + case 47: return "J"; + case 48: return "F"; + case 49: return "G"; + case 50: return "Z"; + case 51: return "K"; + default: return sLetter; + } + return ""; +}//end ConvertCelestial + +//////////////////////////////////////////////////////////////////////// +string ProcessCelestial(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertCelestial(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertGoblin(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "u"; + case 1: return "p"; + case 2: return ""; + case 3: return "t"; + case 4: return "'"; + case 5: return "v"; + case 6: return "k"; + case 7: return "r"; + case 8: return "o"; + case 9: return "z"; + case 10: return "g"; + case 11: return "m"; + case 12: return "s"; + case 13: return ""; + case 14: return "u"; + case 15: return "b"; + case 16: return ""; + case 17: return "n"; + case 18: return "k"; + case 19: return "d"; + case 20: return "u"; + case 21: return ""; + case 22: return "'"; + case 23: return ""; + case 24: return "o"; + case 25: return "w"; + case 26: return "U"; + case 27: return "P"; + case 28: return ""; + case 29: return "T"; + case 30: return "'"; + case 31: return "V"; + case 32: return "K"; + case 33: return "R"; + case 34: return "O"; + case 35: return "Z"; + case 36: return "G"; + case 37: return "M"; + case 38: return "S"; + case 39: return ""; + case 40: return "U"; + case 41: return "B"; + case 42: return ""; + case 43: return "N"; + case 44: return "K"; + case 45: return "D"; + case 46: return "U"; + case 47: return ""; + case 48: return "'"; + case 49: return ""; + case 50: return "O"; + case 51: return "W"; + default: return sLetter; + } + return ""; +}//end ConvertGoblin + +//////////////////////////////////////////////////////////////////////// +string ProcessGoblin(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertGoblin(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertDraconic(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "e"; + case 26: return "E"; + case 1: return "po"; + case 27: return "Po"; + case 2: return "st"; + case 28: return "St"; + case 3: return "ty"; + case 29: return "Ty"; + case 4: return "i"; + case 5: return "w"; + case 6: return "k"; + case 7: return "ni"; + case 33: return "Ni"; + case 8: return "un"; + case 34: return "Un"; + case 9: return "vi"; + case 35: return "Vi"; + case 10: return "go"; + case 36: return "Go"; + case 11: return "ch"; + case 37: return "Ch"; + case 12: return "li"; + case 38: return "Li"; + case 13: return "ra"; + case 39: return "Ra"; + case 14: return "y"; + case 15: return "ba"; + case 41: return "Ba"; + case 16: return "x"; + case 17: return "hu"; + case 43: return "Hu"; + case 18: return "my"; + case 44: return "My"; + case 19: return "dr"; + case 45: return "Dr"; + case 20: return "on"; + case 46: return "On"; + case 21: return "fi"; + case 47: return "Fi"; + case 22: return "zi"; + case 48: return "Zi"; + case 23: return "qu"; + case 49: return "Qu"; + case 24: return "an"; + case 50: return "An"; + case 25: return "ji"; + case 51: return "Ji"; + case 30: return "I"; + case 31: return "W"; + case 32: return "K"; + case 40: return "Y"; + case 42: return "X"; + default: return sLetter; + } + return ""; +}//end ConvertDraconic + +//////////////////////////////////////////////////////////////////////// +string ProcessDraconic(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertDraconic(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertDwarf(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "az"; + case 26: return "Az"; + case 1: return "po"; + case 27: return "Po"; + case 2: return "zi"; + case 28: return "Zi"; + case 3: return "t"; + case 4: return "a"; + case 5: return "wa"; + case 31: return "Wa"; + case 6: return "k"; + case 7: return "'"; + case 8: return "a"; + case 9: return "dr"; + case 35: return "Dr"; + case 10: return "g"; + case 11: return "n"; + case 12: return "l"; + case 13: return "r"; + case 14: return "ur"; + case 40: return "Ur"; + case 15: return "rh"; + case 41: return "Rh"; + case 16: return "k"; + case 17: return "h"; + case 18: return "th"; + case 44: return "Th"; + case 19: return "k"; + case 20: return "'"; + case 21: return "g"; + case 22: return "zh"; + case 48: return "Zh"; + case 23: return "q"; + case 24: return "o"; + case 25: return "j"; + case 29: return "T"; + case 30: return "A"; + case 32: return "K"; + case 33: return "'"; + case 34: return "A"; + case 36: return "G"; + case 37: return "N"; + case 38: return "L"; + case 39: return "R"; + case 42: return "K"; + case 43: return "H"; + case 45: return "K"; + case 46: return "'"; + case 47: return "G"; + case 49: return "Q"; + case 50: return "O"; + case 51: return "J"; + default: return sLetter; + } return ""; +}//end ConvertDwarf + +//////////////////////////////////////////////////////////////////////// +string ProcessDwarf(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertDwarf(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertElven(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "il"; + case 26: return "Il"; + case 1: return "f"; + case 2: return "ny"; + case 28: return "Ny"; + case 3: return "w"; + case 4: return "a"; + case 5: return "o"; + case 6: return "v"; + case 7: return "ir"; + case 33: return "Ir"; + case 8: return "e"; + case 9: return "qu"; + case 35: return "Qu"; + case 10: return "n"; + case 11: return "c"; + case 12: return "s"; + case 13: return "l"; + case 14: return "e"; + case 15: return "ty"; + case 41: return "Ty"; + case 16: return "h"; + case 17: return "m"; + case 18: return "la"; + case 44: return "La"; + case 19: return "an"; + case 45: return "An"; + case 20: return "y"; + case 21: return "el"; + case 47: return "El"; + case 22: return "am"; + case 48: return "Am"; + case 23: return "'"; + case 24: return "a"; + case 25: return "j"; + + case 27: return "F"; + case 29: return "W"; + case 30: return "A"; + case 31: return "O"; + case 32: return "V"; + case 34: return "E"; + case 36: return "N"; + case 37: return "C"; + case 38: return "S"; + case 39: return "L"; + case 40: return "E"; + case 42: return "H"; + case 43: return "M"; + case 46: return "Y"; + case 49: return "'"; + case 50: return "A"; + case 51: return "J"; + + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessElven(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertElven(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertGnome(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { +//cipher based on English -> Al Baed + case 0: return "y"; + case 1: return "p"; + case 2: return "l"; + case 3: return "t"; + case 4: return "a"; + case 5: return "v"; + case 6: return "k"; + case 7: return "r"; + case 8: return "e"; + case 9: return "z"; + case 10: return "g"; + case 11: return "m"; + case 12: return "s"; + case 13: return "h"; + case 14: return "u"; + case 15: return "b"; + case 16: return "x"; + case 17: return "n"; + case 18: return "c"; + case 19: return "d"; + case 20: return "i"; + case 21: return "j"; + case 22: return "f"; + case 23: return "q"; + case 24: return "o"; + case 25: return "w"; + case 26: return "Y"; + case 27: return "P"; + case 28: return "L"; + case 29: return "T"; + case 30: return "A"; + case 31: return "V"; + case 32: return "K"; + case 33: return "R"; + case 34: return "E"; + case 35: return "Z"; + case 36: return "G"; + case 37: return "M"; + case 38: return "S"; + case 39: return "H"; + case 40: return "U"; + case 41: return "B"; + case 42: return "X"; + case 43: return "N"; + case 44: return "C"; + case 45: return "D"; + case 46: return "I"; + case 47: return "J"; + case 48: return "F"; + case 49: return "Q"; + case 50: return "O"; + case 51: return "W"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessGnome(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertGnome(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertHalfling(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { +//cipher based on Al Baed -> English + case 0: return "e"; + case 1: return "p"; + case 2: return "s"; + case 3: return "t"; + case 4: return "i"; + case 5: return "w"; + case 6: return "k"; + case 7: return "n"; + case 8: return "u"; + case 9: return "v"; + case 10: return "g"; + case 11: return "c"; + case 12: return "l"; + case 13: return "r"; + case 14: return "y"; + case 15: return "b"; + case 16: return "x"; + case 17: return "h"; + case 18: return "m"; + case 19: return "d"; + case 20: return "o"; + case 21: return "f"; + case 22: return "z"; + case 23: return "q"; + case 24: return "a"; + case 25: return "j"; + case 26: return "E"; + case 27: return "P"; + case 28: return "S"; + case 29: return "T"; + case 30: return "I"; + case 31: return "W"; + case 32: return "K"; + case 33: return "N"; + case 34: return "U"; + case 35: return "V"; + case 36: return "G"; + case 37: return "C"; + case 38: return "L"; + case 39: return "R"; + case 40: return "Y"; + case 41: return "B"; + case 42: return "X"; + case 43: return "H"; + case 44: return "M"; + case 45: return "D"; + case 46: return "O"; + case 47: return "F"; + case 48: return "Z"; + case 49: return "Q"; + case 50: return "A"; + case 51: return "J"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessHalfling(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertHalfling(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertOrc(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "ha"; + case 26: return "Ha"; + case 1: return "p"; + case 2: return "z"; + case 3: return "t"; + case 4: return "o"; + case 5: return ""; + case 6: return "k"; + case 7: return "r"; + case 8: return "a"; + case 9: return "m"; + case 10: return "g"; + case 11: return "h"; + case 12: return "r"; + case 13: return "k"; + case 14: return "u"; + case 15: return "b"; + case 16: return "k"; + case 17: return "h"; + case 18: return "g"; + case 19: return "n"; + case 20: return ""; + case 21: return "g"; + case 22: return "r"; + case 23: return "r"; + case 24: return "'"; + case 25: return "m"; + case 27: return "P"; + case 28: return "Z"; + case 29: return "T"; + case 30: return "O"; + case 31: return ""; + case 32: return "K"; + case 33: return "R"; + case 34: return "A"; + case 35: return "M"; + case 36: return "G"; + case 37: return "H"; + case 38: return "R"; + case 39: return "K"; + case 40: return "U"; + case 41: return "B"; + case 42: return "K"; + case 43: return "H"; + case 44: return "G"; + case 45: return "N"; + case 46: return ""; + case 47: return "G"; + case 48: return "R"; + case 49: return "R"; + case 50: return "'"; + case 51: return "M"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessOrc(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertOrc(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertAnimal(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "'"; + case 1: return "'"; + case 2: return "'"; + case 3: return "'"; + case 4: return "'"; + case 5: return "'"; + case 6: return "'"; + case 7: return "'"; + case 8: return "'"; + case 9: return "'"; + case 10: return "'"; + case 11: return "'"; + case 12: return "'"; + case 13: return "'"; + case 14: return "'"; + case 15: return "'"; + case 16: return "'"; + case 17: return "'"; + case 18: return "'"; + case 19: return "'"; + case 20: return "'"; + case 21: return "'"; + case 22: return "'"; + case 23: return "'"; + case 24: return "'"; + case 25: return "'"; + case 26: return "'"; + case 27: return "'"; + case 28: return "'"; + case 29: return "'"; + case 30: return "'"; + case 31: return "'"; + case 32: return "'"; + case 33: return "'"; + case 34: return "'"; + case 35: return "'"; + case 36: return "'"; + case 37: return "'"; + case 38: return "'"; + case 39: return "'"; + case 40: return "'"; + case 41: return "'"; + case 42: return "'"; + case 43: return "'"; + case 44: return "'"; + case 45: return "'"; + case 46: return "'"; + case 47: return "'"; + case 48: return "'"; + case 49: return "'"; + case 50: return "'"; + case 51: return "'"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessAnimal(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertAnimal(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessCant(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + + if (sLetter == "a" || sLetter == "A") return "*shields eyes*"; + if (sLetter == "b" || sLetter == "B") return "*blusters*"; + if (sLetter == "c" || sLetter == "C") return "*coughs*"; + if (sLetter == "d" || sLetter == "D") return "*furrows brow*"; + if (sLetter == "e" || sLetter == "E") return "*examines ground*"; + if (sLetter == "f" || sLetter == "F") return "*frowns*"; + if (sLetter == "g" || sLetter == "G") return "*glances up*"; + if (sLetter == "h" || sLetter == "H") return "*looks thoughtful*"; + if (sLetter == "i" || sLetter == "I") return "*looks bored*"; + if (sLetter == "j" || sLetter == "J") return "*rubs chin*"; + if (sLetter == "k" || sLetter == "K") return "*scratches ear*"; + if (sLetter == "l" || sLetter == "L") return "*looks around*"; + if (sLetter == "m" || sLetter == "M") return "*mmm hmm*"; + if (sLetter == "n" || sLetter == "N") return "*nods*"; + if (sLetter == "o" || sLetter == "O") return "*grins*"; + if (sLetter == "p" || sLetter == "P") return "*smiles*"; + if (sLetter == "q" || sLetter == "Q") return "*shivers*"; + if (sLetter == "r" || sLetter == "R") return "*rolls eyes*"; + if (sLetter == "s" || sLetter == "S") return "*scratches nose*"; + if (sLetter == "t" || sLetter == "T") return "*turns a bit*"; + if (sLetter == "u" || sLetter == "U") return "*glances idly*"; + if (sLetter == "v" || sLetter == "V") return "*runs hand through hair*"; + if (sLetter == "w" || sLetter == "W") return "*waves*"; + if (sLetter == "x" || sLetter == "X") return "*stretches*"; + if (sLetter == "y" || sLetter == "Y") return "*yawns*"; + if (sLetter == "z" || sLetter == "Z") return "*shrugs*"; + + return "*nods*"; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertSylvan(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "i"; + case 1: return "ri"; + case 2: return "ba"; + case 3: return "ma"; + case 4: return "i"; + case 5: return "mo"; + case 6: return "yo"; + case 7: return "f"; + case 8: return "ya"; + case 9: return "ta"; + case 10: return "m"; + case 11: return "t"; + case 12: return "r"; + case 13: return "j"; + case 14: return "nu"; + case 15: return "wi"; + case 16: return "bo"; + case 17: return "w"; + case 18: return "ne"; + case 19: return "na"; + case 20: return "li"; + case 21: return "v"; + case 22: return "ni"; + case 23: return "ya"; + case 24: return "mi"; + case 25: return "og"; + case 26: return "I"; + case 27: return "Ri"; + case 28: return "Ba"; + case 29: return "Ma"; + case 30: return "I"; + case 31: return "Mo"; + case 32: return "Yo"; + case 33: return "F"; + case 34: return "Ya"; + case 35: return "Ta"; + case 36: return "M"; + case 37: return "T"; + case 38: return "R"; + case 39: return "J"; + case 40: return "Nu"; + case 41: return "Wi"; + case 42: return "Bo"; + case 43: return "W"; + case 44: return "Ne"; + case 45: return "Na"; + case 46: return "Li"; + case 47: return "V"; + case 48: return "Ni"; + case 49: return "Ya"; + case 50: return "Mi"; + case 51: return "Og"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessSylvan(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertSylvan(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertRashemi(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "a"; + case 1: return "s"; + case 2: return "n"; + case 3: return "y"; + case 4: return "ov"; + case 5: return "d"; + case 6: return "sk"; + case 7: return "fr"; + case 8: return "u"; + case 9: return "o"; + case 10: return "f"; + case 11: return "r"; + case 12: return "z"; + case 13: return "s"; + case 14: return "o"; + case 15: return "j"; + case 16: return "sk"; + case 17: return " "; + case 18: return "or"; + case 19: return "ka"; + case 20: return "o"; + case 21: return "ka"; + case 22: return "ma"; + case 23: return "o"; + case 24: return "oj"; + case 25: return "y"; + case 26: return "A"; + case 27: return "S"; + case 28: return "N"; + case 29: return "Y"; + case 30: return "Ov"; + case 31: return "D"; + case 32: return "Sk"; + case 33: return "Fr"; + case 34: return "U"; + case 35: return "O"; + case 36: return "F"; + case 37: return "R"; + case 38: return "Z"; + case 39: return "S"; + case 40: return "O"; + case 41: return "J"; + case 42: return "Sk"; + case 43: return "M"; + case 44: return "Or"; + case 45: return "Ka"; + case 46: return "O"; + case 47: return "Ka"; + case 48: return "Ma"; + case 49: return "O"; + case 50: return "Oj"; + case 51: return "Y"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessRashemi(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertRashemi(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string ConvertMulhorandi(string sLetter) +{ + if (GetStringLength(sLetter) > 1) + sLetter = GetStringLeft(sLetter, 1); + string sTranslate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int iTrans = FindSubString(sTranslate, sLetter); + + switch (iTrans) + { + case 0: return "ri"; + case 1: return "dj"; + case 2: return "p"; + case 3: return "al"; + case 4: return "a"; + case 5: return "j"; + case 6: return "y"; + case 7: return "u"; + case 8: return "o"; + case 9: return "f"; + case 10: return "ch"; + case 11: return "d"; + case 12: return "t"; + case 13: return "m"; + case 14: return "eh"; + case 15: return "k"; + case 16: return "ng"; + case 17: return "sh"; + case 18: return "th"; + case 19: return "s"; + case 20: return "e"; + case 21: return "z"; + case 22: return "p"; + case 23: return "qu"; + case 24: return "o"; + case 25: return "z"; + case 26: return "Ri"; + case 27: return "Dj"; + case 28: return "P"; + case 29: return "Al"; + case 30: return "A"; + case 31: return "J"; + case 32: return "Y"; + case 33: return "U"; + case 34: return "O"; + case 35: return "F"; + case 36: return "Ch"; + case 37: return "D"; + case 38: return "T"; + case 39: return "M"; + case 40: return "Eh"; + case 41: return "K"; + case 42: return "Ng"; + case 43: return "Sh"; + case 44: return "Th"; + case 45: return "S"; + case 46: return "E"; + case 47: return "Z"; + case 48: return "P"; + case 49: return "Qu"; + case 50: return "O"; + case 51: return "Z"; + default: return sLetter; + } return ""; +} + +//////////////////////////////////////////////////////////////////////// +string ProcessMulhorandi(string sPhrase) +{ + string sOutput; + int iToggle; + while (GetStringLength(sPhrase) > 1) + { + if (GetStringLeft(sPhrase,1) == "*") + iToggle = abs(iToggle - 1); + if (iToggle) + sOutput = sOutput + GetStringLeft(sPhrase,1); + else + sOutput = sOutput + ConvertMulhorandi(GetStringLeft(sPhrase, 1)); + sPhrase = GetStringRight(sPhrase, GetStringLength(sPhrase)-1); + } + return sOutput; +} + +//////////////////////////////////////////////////////////////////////// +string TranslateCommonToLanguage(int iLang, string sText) +{ + switch (iLang) + { + case 1: //Elven + return ProcessElven(sText); break; + case 2: //Gnome + return ProcessGnome(sText); break; + case 3: //Halfling + return ProcessHalfling(sText); break; + case 4: //Dwarf Note: Race 4 is normally Half Elf and Race 0 is normally Dwarf. This is changed. + return ProcessDwarf(sText); break; + case 5: //Orc + return ProcessOrc(sText); break; + case 6: //Goblin + return ProcessGoblin(sText); break; + case 7: //Draconic + return ProcessDraconic(sText); break; + case 8: //Animal + return ProcessAnimal(sText); break; + case 9: //Thieves Cant + return ProcessCant(sText); break; + case 10: //Celestial + return ProcessCelestial(sText); break; + case 11: //Abyssal + return ProcessAbyssal(sText); break; + case 12: //Infernal + return ProcessInfernal(sText); break; + case 13: + return ProcessDrow(sText); break; + case 14: // Sylvan + return ProcessSylvan(sText); break; + case 15: // Rashemi + return ProcessRashemi(sText); break; + case 16: // Mulhorandi + return ProcessMulhorandi(sText); break; + case 99: //1337 + return ProcessLeetspeak(sText); break; + default: if (iLang > 100) return ProcessCustom(sText, iLang - 100);break; + } + return ""; +} + +//////////////////////////////////////////////////////////////////////// +int GetDefaultRacialLanguage(object oPC, int iRename) +{ + switch (GetRacialType(oPC)) + { + case RACIAL_TYPE_DWARF: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Dwarven");return 4; break; + case RACIAL_TYPE_ELF: + case RACIAL_TYPE_HALFELF: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Elven");return 1; break; + case RACIAL_TYPE_GNOME: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Gnome");return 2; break; + case RACIAL_TYPE_HALFLING: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Halfling");return 3; break; + case RACIAL_TYPE_HUMANOID_ORC: + case RACIAL_TYPE_HALFORC: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Orc");return 5; break; + case RACIAL_TYPE_HUMANOID_GOBLINOID: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Goblin");return 6; break; + case RACIAL_TYPE_HUMANOID_REPTILIAN: + case RACIAL_TYPE_DRAGON: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Draconic");return 7; break; + case RACIAL_TYPE_ANIMAL: if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Animal");return 8; break; + default: + if (GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) + { + if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Animal"); + return 8; + } + if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC)) + { + if (iRename) SetLocalString(oPC, "hls_MyLanguageName", "Thieves' Cant"); + return 9; + } + break; + } + return 0; +} + +//////////////////////////////////////////////////////////////////////// +int GetDefaultClassLanguage(object oPC) +{ + if (GetLevelByClass(CLASS_TYPE_RANGER, oPC) || GetLevelByClass(CLASS_TYPE_DRUID, oPC)) + return 8; + if (GetLevelByClass(CLASS_TYPE_ROGUE, oPC)) + return 9; + if ((GetSubRace(oPC)=="drow") ||(GetSubRace(oPC)=="DROW")||(GetSubRace(oPC)=="Drow")) + return 13; + if ((GetSubRace(oPC)=="fey") ||(GetSubRace(oPC)=="FEY")||(GetSubRace(oPC)=="Fey")) + return 14; + + return 0; +} + +//////////////////////////////////////////////////////////////////////// +int GetIsAlphanumeric(string sCharacter) +{ + if (sCharacter == "a" || + sCharacter == "b" || + sCharacter == "c" || + sCharacter == "d" || + sCharacter == "e" || + sCharacter == "f" || + sCharacter == "g" || + sCharacter == "h" || + sCharacter == "i" || + sCharacter == "j" || + sCharacter == "k" || + sCharacter == "l" || + sCharacter == "m" || + sCharacter == "n" || + sCharacter == "o" || + sCharacter == "p" || + sCharacter == "q" || + sCharacter == "r" || + sCharacter == "s" || + sCharacter == "t" || + sCharacter == "u" || + sCharacter == "v" || + sCharacter == "w" || + sCharacter == "x" || + sCharacter == "y" || + sCharacter == "z" || + sCharacter == "A" || + sCharacter == "B" || + sCharacter == "C" || + sCharacter == "D" || + sCharacter == "E" || + sCharacter == "F" || + sCharacter == "G" || + sCharacter == "H" || + sCharacter == "I" || + sCharacter == "J" || + sCharacter == "K" || + sCharacter == "L" || + sCharacter == "M" || + sCharacter == "N" || + sCharacter == "O" || + sCharacter == "P" || + sCharacter == "Q" || + sCharacter == "R" || + sCharacter == "S" || + sCharacter == "T" || + sCharacter == "U" || + sCharacter == "V" || + sCharacter == "W" || + sCharacter == "X" || + sCharacter == "Y" || + sCharacter == "Z" || + sCharacter == "1" || + sCharacter == "2" || + sCharacter == "3" || + sCharacter == "4" || + sCharacter == "5" || + sCharacter == "6" || + sCharacter == "7" || + sCharacter == "8" || + sCharacter == "9" || + sCharacter == "0") + return TRUE; + + return FALSE; +} + +//////////////////////////////////////////////////////////////////////// +void ParseCommand(object oTarget, object oCommander, string sComIn) +{ +// :: 2008.07.31 morderon / tsunami282 - allow certain . commands for +// :: PCs as well as DM's; allow shortcut targeting of henchies/pets +// :: 2009.07.25 civious / tsunami282 - correct language name parsing for .lang command + + int iOffset=0; + if (GetIsDM(oTarget) && (oTarget != oCommander)) return; //DMs can only be affected by their own .commands + + int bValidTarget = GetIsObjectValid(oTarget); + if (!bValidTarget) + { + DMFISendMessageToPC(oCommander, "No current command target - no commands will function.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + return; + } + + // break into command and args + struct sStringTokenizer st = GetStringTokenizer(sComIn, " "); + st = AdvanceToNextToken(st); + string sCom = GetStringLowerCase(GetNextToken(st)); + string sArgs = LTrim(st.sRemaining); + + // ** commands usable by all pc's/dm's + if (GetStringLeft(sCom, 4) == ".loc") + { + SetLocalInt(oCommander, "dmfi_dicebag", 2); + SetCustomToken(20681, "Local"); + SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 2, oCommander); + FloatingTextStringOnCreature("Broadcast Mode set to Local", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 4) == ".glo") + { + SetLocalInt(oCommander, "dmfi_dicebag", 1); + SetCustomToken(20681, "Global"); + SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 1, oCommander); + FloatingTextStringOnCreature("Broadcast Mode set to Global", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 4) == ".pri") + { + SetLocalInt(oCommander, "dmfi_dicebag", 0); + SetCustomToken(20681, "Private"); + SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 0, oCommander); + FloatingTextStringOnCreature("Broadcast Mode set to Private", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 3) == ".dm") + { + SetLocalInt(oCommander, "dmfi_dicebag", 3); + SetCustomToken(20681, "DM Only"); + SetDMFIPersistentInt("dmfi", "dmfi_dicebag", 3, oCommander); + FloatingTextStringOnCreature("Broadcast Mode set to DM Only", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 5) == ".aniy") + { + SetLocalInt(oCommander, "dmfi_dice_no_animate", 0); + FloatingTextStringOnCreature("Rolls will show animation", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 5) == ".anin") + { + SetLocalInt(oCommander, "dmfi_dice_no_animate", 1); + FloatingTextStringOnCreature("Rolls will NOT show animation", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 5) == ".emoy") // control emotes (based on Morderon code) + { + SetLocalInt(oCommander, "hls_emotemute", 0); + FloatingTextStringOnCreature("*emote* commands are on", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 5) == ".emon") // control emotes (based on Morderon code) + { + SetLocalInt(oCommander, "hls_emotemute", 1); + FloatingTextStringOnCreature("*emote* commands are off", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".lan") //sets the language of the target + { + // check target allowed + if (!(GetIsDM(oCommander) || GetIsDMPossessed(oCommander) || + oTarget == oCommander || GetMaster(oTarget) == oCommander)) + { + FloatingTextStringOnCreature("You cannot perform this command on a creature you do not control.", oCommander, FALSE); + return; + } + + string sArgsLC = GetStringLowerCase(sArgs); + int iLang = 0; + string sLang = ""; + if (FindSubString(sArgsLC, "elven") != -1 || + FindSubString(sArgsLC, "elf") != -1) + { + iLang = 1; + sLang = "Elven"; + } + else if (FindSubString(sArgsLC, "gnom") != -1) + { + iLang = 2; + sLang = "Gnome"; + } + else if (FindSubString(sArgsLC, "halfling") != -1) + { + iLang = 3; + sLang = "Halfling"; + } + else if (FindSubString(sArgsLC, "dwar") != -1) + { + iLang = 4; + sLang = "Dwarven"; + } + else if (FindSubString(sArgsLC, "orc") != -1) + { + iLang = 5; + sLang = "Orc"; + } + else if (FindSubString(sArgsLC, "goblin") != -1) + { + iLang = 6; + sLang = "Goblin"; + } + else if (FindSubString(sArgsLC, "draconic") != -1) + { + iLang = 7; + sLang = "Draconic"; + } + else if (FindSubString(sArgsLC, "animal") != -1) + { + iLang = 8; + sLang = "Animal"; + } + else if (FindSubString(sArgsLC, "cant") != -1) + { + iLang = 9; + sLang = "Thieves' Cant"; + } + else if (FindSubString(sArgsLC, "celestial") != -1) + { + iLang = 10; + sLang = "Celestial"; + } + else if (FindSubString(sArgsLC, "abyssal") != -1) + { + iLang = 11; + sLang = "Abyssal"; + } + else if (FindSubString(sArgsLC, "infernal") != -1) + { + iLang = 12; + sLang = "Infernal"; + } + else if (FindSubString(sArgsLC, "drow") != -1) + { + iLang = 13; + sLang = "Drow"; + } + else if (FindSubString(sArgsLC, "sylvan") != -1) + { + iLang = 14; + sLang = "Sylvan"; + } + else if (FindSubString(sArgsLC, "rashemi") != -1) + { + iLang = 15; + sLang = "Rashemi"; + } + else if (FindSubString(sArgsLC, "mulhorandi") != -1) + { + iLang = 16; + sLang = "Mulhorandi"; + } + // see if target is allowed to speak that language + if (!GetIsDM(oCommander) && !GetIsDMPossessed(oCommander)) // DM's can set any language on anyone + { + // commander is not DM, so see if target can speak desired language: + // language must be default racial or class language, or target + // must have a language widget for it + if (!(GetIsObjectValid(GetItemPossessedBy(oTarget, "hlslang_"+IntToString(iLang))) || + GetDefaultRacialLanguage(oTarget, FALSE) == iLang || + GetDefaultClassLanguage(oTarget) == iLang)) + { + iLang = 0; + } + } + if (iLang > 0) + { + SetLocalInt(oTarget, "hls_MyLanguage", iLang); + SetLocalString(oTarget, "hls_MyLanguageName", sLang); + FloatingTextStringOnCreature("Language for "+GetName(oTarget)+" set to "+sLang, oCommander, FALSE); + } + else + { + FloatingTextStringOnCreature("Unable to set language - invalid target or language", oCommander, FALSE); + } + return; + } + + // that's all the PC commands, bail out if not DM + if (!GetIsDM(oCommander) && !GetIsDMPossessed(oCommander)) + { + DMFISendMessageToPC(oCommander, "DMFI dot command nonexistent or restricted to DM's - aborting.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + return; + } + + if (GetStringLeft(sCom, 7) ==".appear") + { + string sNew = sArgs; + DMFISendMessageToPC(oCommander, "Setting target appearance to: " + sNew, FALSE, DMFI_MESSAGE_COLOR_STATUS); + int Appear = AppearType(sNew); + + if (Appear!=-1) + { + // SetCreatureAppearanceType(GetLocalObject(oCommander, "dmfi_univ_target"), Appear); + SetCreatureAppearanceType(oTarget, Appear); + } + else + { + FloatingTextStringOnCreature("Invalid Appearance Type", oCommander); + } + + + dmw_CleanUp(oCommander); + return; + } + + + if (GetStringLeft(sCom, 5) == ".stre") + iOffset= 11; + else if (GetStringLeft(sCom, 5) == ".dext") + iOffset = 12; + else if (GetStringLeft(sCom, 5) == ".cons") + iOffset = 13; + else if (GetStringLeft(sCom, 5) == ".inte") + iOffset = 14; + else if (GetStringLeft(sCom, 5) == ".wisd") + iOffset = 15; + else if (GetStringLeft(sCom, 5) == ".char") + iOffset = 16; + else if (GetStringLeft(sCom, 5) == ".fort") + iOffset = 17; + else if (GetStringLeft(sCom, 5) == ".refl") + iOffset = 18; + else if (GetStringLeft(sCom, 5) == ".anim") + iOffset = 21; + else if (GetStringLeft(sCom, 5) == ".appr") + iOffset = 22; + else if (GetStringLeft(sCom, 5) == ".bluf") + iOffset = 23; + else if (GetStringLeft(sCom, 5) == ".conc") + iOffset = 24; + else if (GetStringLeft(sCom, 9) == ".craft ar") + iOffset = 25; + else if (GetStringLeft(sCom, 9) == ".craft tr") + iOffset = 26; + else if (GetStringLeft(sCom, 9) == ".craft we") + iOffset = 27; + else if (GetStringLeft(sCom, 5) == ".disa") + iOffset = 28; + else if (GetStringLeft(sCom, 5) == ".disc") + iOffset = 29; + else if (GetStringLeft(sCom, 5) == ".heal") + iOffset = 31; + else if (GetStringLeft(sCom, 5) == ".hide") + iOffset = 32; + else if (GetStringLeft(sCom, 5) == ".inti") + iOffset = 33; + else if (GetStringLeft(sCom, 5) == ".list") + iOffset = 34; + else if (GetStringLeft(sCom, 5) == ".lore") + iOffset = 35; + else if (GetStringLeft(sCom, 5) == ".move") + iOffset = 36; + else if (GetStringLeft(sCom, 5) == ".open") + iOffset = 37; + else if (GetStringLeft(sCom, 5) == ".parr") + iOffset = 38; + else if (GetStringLeft(sCom, 5) == ".perf") + iOffset = 39; + else if (GetStringLeft(sCom, 5) == ".pers") + iOffset = 41; + else if (GetStringLeft(sCom, 5) == ".pick") + iOffset = 42; + else if (GetStringLeft(sCom, 5) == ".sear") + iOffset = 43; + else if (GetStringLeft(sCom, 6) == ".set t") + iOffset = 44; + else if (GetStringLeft(sCom, 5) == ".spel") + iOffset = 45; + else if (GetStringLeft(sCom, 5) == ".spot") + iOffset = 46; + else if (GetStringLeft(sCom, 5) == ".taun") + iOffset = 47; + else if (GetStringLeft(sCom, 5) == ".tumb") + iOffset = 48; + else if (GetStringLeft(sCom, 4) == ".use") + iOffset = 49; + + if (iOffset!=0) + { + if (FindSubString(sCom, "all") != -1 || FindSubString(sArgs, "all") != -1) + SetLocalInt(oCommander, "dmfi_univ_int", iOffset+40); + else + SetLocalInt(oCommander, "dmfi_univ_int", iOffset); + + SetLocalString(oCommander, "dmfi_univ_conv", "dicebag"); + if (GetIsObjectValid(oTarget)) + { + if (oTarget != GetLocalObject(oCommander, "dmfi_univ_target")) + { + SetLocalObject(oCommander, "dmfi_univ_target", oTarget); + FloatingTextStringOnCreature("DMFI Target set to "+GetName(oTarget), oCommander); + } + ExecuteScript("dmfi_execute", oCommander); + } + else + { + DMFISendMessageToPC(oCommander, "No valid DMFI target!", FALSE, DMFI_MESSAGE_COLOR_ALERT); + } + + dmw_CleanUp(oCommander); + return; + } + + + if (GetStringLeft(sCom, 4) == ".set") + { + // sCom = GetStringRight(sCom, GetStringLength(sCom) - 4); + while (sArgs != "") + { + if (GetStringLeft(sArgs, 1) == " " || + GetStringLeft(sArgs, 1) == "[" || + GetStringLeft(sArgs, 1) == "." || + GetStringLeft(sArgs, 1) == ":" || + GetStringLeft(sArgs, 1) == ";" || + GetStringLeft(sArgs, 1) == "*" || + GetIsAlphanumeric(GetStringLeft(sArgs, 1))) + sArgs = GetStringRight(sArgs, GetStringLength(sArgs) - 1); + else + { + SetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sArgs, 1), oTarget); + FloatingTextStringOnCreature("The Control character for " + GetName(oTarget) + " is " + GetStringLeft(sArgs, 1), oCommander, FALSE); + return; + } + } + FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".ani") + { + int iArg = StringToInt(sArgs); + AssignCommand(oTarget, ClearAllActions(TRUE)); + AssignCommand(oTarget, ActionPlayAnimation(iArg, 1.0, 99999.0f)); + return; + } + else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".buf") + { + string sArgsLC = GetStringLowerCase(sArgs); + if (FindSubString(sArgsLC, "low") !=-1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectACIncrease(3, AC_NATURAL_BONUS), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oTarget, 3600.0f); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_RESISTANCE, oTarget, METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, oTarget, METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_CLARITY, oTarget,METAMAGIC_ANY, TRUE, 5, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + FloatingTextStringOnCreature("Low Buff applied: " + GetName(oTarget), oCommander); return; + } + else if (FindSubString(sArgsLC, "mid") !=-1) + { + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_LESSER_SPELL_MANTLE, oTarget, METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_STONESKIN, oTarget, METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD, oTarget,METAMAGIC_ANY, TRUE, 10, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + FloatingTextStringOnCreature("Mid Buff applied: " + GetName(oTarget), oCommander); return; + } + else if (FindSubString(sArgsLC, "high") !=-1) + { + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_SPELL_MANTLE, oTarget, METAMAGIC_ANY, TRUE, 15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_STONESKIN, oTarget, METAMAGIC_ANY, TRUE,15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, oTarget,METAMAGIC_ANY, TRUE, 15, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + FloatingTextStringOnCreature("High Buff applied: " + GetName(oTarget), oCommander); return; + } + else if (FindSubString(sArgsLC, "epic") !=-1) + { + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, oTarget, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_SPELL_RESISTANCE, oTarget, METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, oTarget,METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + AssignCommand(oTarget, ActionCastSpellAtObject(SPELL_CLARITY, oTarget,METAMAGIC_ANY, TRUE, 20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); + FloatingTextStringOnCreature("Epic Buff applied: " + GetName(oTarget), oCommander); return; + } + else if (FindSubString(sArgsLC, "barkskin") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectACIncrease(3, AC_NATURAL_BONUS), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oTarget, 3600.0f); return; + } + else if (FindSubString(sArgsLC, "elements") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_COLD, 20, 40), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_FIRE, 20, 40), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_ACID, 20, 40), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_SONIC, 20, 40), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, 20, 40), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS), oTarget, 3600.0f); return; + } + else if (FindSubString(sArgsLC, "haste") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectHaste(), oTarget, 3600.0f); return; + } + else if (FindSubString(sArgsLC, "immortal") != -1) // tsunami282 added + { + SetImmortal(oTarget, TRUE); + FloatingTextStringOnCreature("The target is set to Immortal (cannot die).", oCommander, FALSE); return; + } + else if (FindSubString(sArgsLC, "mortal") != -1) // tsunami282 added + { + SetImmortal(oTarget, TRUE); + FloatingTextStringOnCreature("The target is set to Mortal (can die).", oCommander, FALSE); return; + } + else if (FindSubString(sArgsLC, "invis") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectInvisibility(INVISIBILITY_TYPE_NORMAL), oTarget, 3600.0f); return; + } + else if (FindSubString(sArgsLC, "unplot") != -1) + { + SetPlotFlag(oTarget, FALSE); + FloatingTextStringOnCreature("The target is set to non-Plot.", oCommander, FALSE); return; + } + else if (FindSubString(sArgsLC, "plot") != -1) + { + SetPlotFlag(oTarget, TRUE); + FloatingTextStringOnCreature("The target is set to Plot.", oCommander, FALSE); return; + } + else if (FindSubString(sArgsLC, "stoneskin") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDamageReduction(10, DAMAGE_POWER_PLUS_THREE, 100), oTarget, 3600.0f); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN), oTarget, 3600.0f); return; + } + else if (FindSubString(sArgsLC, "trues") != -1) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectTrueSeeing(), oTarget, 3600.0f); return; + } + } + else if (GetStringLeft(sCom, 4) == ".dam") + { + int iArg = StringToInt(sArgs); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iArg, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_LRG_RED), oTarget); + FloatingTextStringOnCreature(GetName(oTarget) + " has taken " + IntToString(iArg) + " damage.", oCommander, FALSE); + return; + } + // 2008.05.29 tsunami282 - set description + else if (GetStringLeft(sCom, 5) == ".desc") + { + // object oTgt = GetLocalObject(oCommander, "dmfi_univ_target"); + if (GetIsObjectValid(oTarget)) + { + if (sArgs == ".") // single dot means reset to base description + { + SetDescription(oTarget); + } + else // assign new description + { + SetDescription(oTarget, sArgs); + } + FloatingTextStringOnCreature("Target's description set to " + GetDescription(oTarget), oCommander, FALSE); + } + else + { + FloatingTextStringOnCreature("Invalid target - command not processed.", oCommander, FALSE); + } + } + else if (GetStringLeft(sCom, 5) == ".dism") + { + DestroyObject(oTarget); + FloatingTextStringOnCreature(GetName(oTarget) + " dismissed", oCommander, FALSE); return; + } + else if (GetStringLeft(sCom, 4) == ".inv") + { + OpenInventory(oTarget, oCommander); + return; + } + else if (GetStringLeft(sCom, 4) == ".dmt") + { + SetLocalInt(GetModule(), "dmfi_DMToolLock", abs(GetLocalInt(GetModule(), "dmfi_DMToolLock") -1)); return; + } + // else if (GetStringLowerCase(GetStringLeft(sCom, 4)) == ".dms") + // { + // SetDMFIPersistentInt("dmfi", "dmfi_DMSpy", abs(GetDMFIPersistentInt("dmfi", "dmfi_DMSpy", oCommander) -1), oCommander); return; + // } + else if (GetStringLeft(sCom, 4) == ".fac") + { + string sArgsLC = GetStringLowerCase(sArgs); + if (FindSubString(sArgsLC, "hostile") != -1) + { + ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE); + FloatingTextStringOnCreature("Faction set to hostile", oCommander, FALSE); + } + else if (FindSubString(sArgsLC, "commoner") != -1) + { + ChangeToStandardFaction(oTarget, STANDARD_FACTION_COMMONER); + FloatingTextStringOnCreature("Faction set to commoner", oCommander, FALSE); + } + else if (FindSubString(sArgsLC, "defender") != -1) + { + ChangeToStandardFaction(oTarget, STANDARD_FACTION_DEFENDER); + FloatingTextStringOnCreature("Faction set to defender", oCommander, FALSE); + } + else if (FindSubString(sArgsLC, "merchant") != -1) + { + ChangeToStandardFaction(oTarget, STANDARD_FACTION_MERCHANT); + FloatingTextStringOnCreature("Faction set to merchant", oCommander, FALSE); + } + else + { + DMFISendMessageToPC(oCommander, "Invalid faction name - command aborted.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + return; + } + + // toggle blindness on the target, to cause a re-perception + if (GetIsImmune(oTarget, IMMUNITY_TYPE_BLINDNESS)) + { + DMFISendMessageToPC(oCommander, "Targeted creature is blind immune - no attack will occur until new perception event is fired", FALSE, DMFI_MESSAGE_COLOR_ALERT); + } + else + { + effect eInvis =EffectBlindness(); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eInvis, oTarget, 6.1); + DMFISendMessageToPC(oCommander, "Faction Adjusted - will take effect in 6 seconds", FALSE, DMFI_MESSAGE_COLOR_STATUS); + } + return; + } + else if (GetStringLeft(sCom, 4) == ".fle") + { + AssignCommand(oTarget, ClearAllActions(TRUE)); + AssignCommand(oTarget, ActionMoveAwayFromObject(oCommander, TRUE)); + return; + } + else if (GetStringLeft(sCom, 4) == ".fly") + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDisappear(), oTarget); + return; + } + else if (GetStringLeft(sCom, 4) == ".fol") + { + int iArg = StringToInt(sArgs); + FloatingTextStringOnCreature(GetName(oTarget) + " will follow you for "+IntToString(iArg)+" seconds.", oCommander, FALSE); + AssignCommand(oTarget, ClearAllActions(TRUE)); + AssignCommand(oTarget, ActionForceMoveToObject(oCommander, TRUE, 2.0f, IntToFloat(iArg))); + DelayCommand(IntToFloat(iArg), FloatingTextStringOnCreature(GetName(oTarget) + " has stopped following you.", oCommander, FALSE)); + return; + } + else if (GetStringLeft(sCom, 4) == ".fre") + { + FloatingTextStringOnCreature(GetName(oTarget) + " frozen", oCommander, FALSE); + SetCommandable(TRUE, oTarget); + AssignCommand(oTarget, ClearAllActions(TRUE)); + DelayCommand(0.5f, SetCommandable(FALSE, oTarget)); + return; + } + else if (GetStringLeft(sCom, 4) == ".get") + { + while (sArgs != "") + { + if (GetStringLeft(sArgs, 1) == " " || + GetStringLeft(sArgs, 1) == "[" || + GetStringLeft(sArgs, 1) == "." || + GetStringLeft(sArgs, 1) == ":" || + GetStringLeft(sArgs, 1) == ";" || + GetStringLeft(sArgs, 1) == "*" || + GetIsAlphanumeric(GetStringLeft(sArgs, 1))) + sArgs = GetStringRight(sArgs, GetStringLength(sArgs) - 1); + else + { + object oJump = GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sArgs, 1)); + if (GetIsObjectValid(oJump)) + { + AssignCommand(oJump, ClearAllActions()); + AssignCommand(oJump, ActionJumpToLocation(GetLocation(oCommander))); + } + else + { + FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oCommander, FALSE); + } + return; + } + } + FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oCommander, FALSE); + return; + + } + else if (GetStringLeft(sCom, 4) == ".got") + { + while (sArgs != "") + { + if (GetStringLeft(sArgs, 1) == " " || + GetStringLeft(sArgs, 1) == "[" || + GetStringLeft(sArgs, 1) == "." || + GetStringLeft(sArgs, 1) == ":" || + GetStringLeft(sArgs, 1) == ";" || + GetStringLeft(sArgs, 1) == "*" || + GetIsAlphanumeric(GetStringLeft(sArgs, 1))) + sArgs = GetStringRight(sArgs, GetStringLength(sArgs) - 1); + else + { + object oJump = GetLocalObject(GetModule(), "hls_NPCControl" + GetStringLeft(sArgs, 1)); + if (GetIsObjectValid(oJump)) + { + AssignCommand(oCommander, ClearAllActions()); + AssignCommand(oCommander, ActionJumpToLocation(GetLocation(oJump))); + } + else + { + FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oCommander, FALSE); + } + return; + } + } + FloatingTextStringOnCreature("Your Control Character is not valid. Perhaps you are using a reserved character.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".hea") + { + int iArg = StringToInt(sArgs); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iArg), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_M), oTarget); + FloatingTextStringOnCreature(GetName(oTarget) + " has healed " + IntToString(iArg) + " HP.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".ite") + { + object oCreate = CreateItemOnObject(sArgs, oTarget, 1); + if (GetIsObjectValid(oCreate)) FloatingTextStringOnCreature("Item " + GetName(oCreate) + " created.", oCommander, FALSE); + return; + } + // 2008.05.29 tsunami282 - set name + else if (GetStringLeft(sCom, 5) == ".name") + { + // object oTgt = GetLocalObject(oCommander, "dmfi_univ_target"); + if (GetIsObjectValid(oTarget)) + { + if (sArgs == ".") // single dot means reset to base name + { + SetName(oTarget); + } + else // assign new name + { + SetName(oTarget, sArgs); + } + FloatingTextStringOnCreature("Target's name set to " + GetName(oTarget), oCommander, FALSE); + } + else + { + FloatingTextStringOnCreature("Invalid target - command not processed.", oCommander, FALSE); + } + } + else if (GetStringLeft(sCom, 4) == ".mut") + { + FloatingTextStringOnCreature(GetName(oTarget) + " muted", oCommander, FALSE); + SetLocalInt(oTarget, "dmfi_Mute", 1); + return; + } + else if (GetStringLeft(sCom, 4) == ".npc") + { + object oCreate = CreateObject(OBJECT_TYPE_CREATURE, sArgs, GetLocation(oTarget)); + if (GetIsObjectValid(oCreate)) + FloatingTextStringOnCreature("NPC " + GetName(oCreate) + " created.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".pla") + { + object oCreate = CreateObject(OBJECT_TYPE_PLACEABLE, sArgs, GetLocation(oTarget)); + if (GetIsObjectValid(oCreate)) + FloatingTextStringOnCreature("Placeable " + GetName(oCreate) + " created.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".rem") + { + effect eRemove = GetFirstEffect(oTarget); + while (GetIsEffectValid(eRemove)) + { + RemoveEffect(oTarget, eRemove); + eRemove = GetNextEffect(oTarget); + } + return; + } + else if (GetStringLeft(sCom, 4) == ".say") + { + int iArg = StringToInt(sArgs); + if (GetDMFIPersistentString("dmfi", "hls206" + IntToString(iArg)) != "") + { + AssignCommand(oTarget, SpeakString(GetDMFIPersistentString("dmfi", "hls206" + IntToString(iArg)))); + } + return; + } + else if (GetStringLeft(sCom, 4) == ".tar") + { + object oGet = GetFirstObjectInArea(GetArea(oCommander)); + while (GetIsObjectValid(oGet)) + { + if (FindSubString(GetName(oGet), sArgs) != -1) + { + // SetLocalObject(oCommander, "dmfi_VoiceTarget", oGet); + SetLocalObject(oCommander, "dmfi_univ_target", oGet); + FloatingTextStringOnCreature("You have targeted " + GetName(oGet) + " with the DMFI Targeting Widget", oCommander, FALSE); + return; + } + oGet = GetNextObjectInArea(GetArea(oCommander)); + } + FloatingTextStringOnCreature("Target not found.", oCommander, FALSE); + return; + } + else if (GetStringLeft(sCom, 4) == ".unf") + { + FloatingTextStringOnCreature(GetName(oTarget) + " unfrozen", oCommander, FALSE); + SetCommandable(TRUE, oTarget); return; + } + else if (GetStringLeft(sCom, 4) == ".unm") + { + FloatingTextStringOnCreature(GetName(oTarget) + " un-muted", oCommander, FALSE); + DeleteLocalInt(oTarget, "dmfi_Mute"); return; + } + else if (GetStringLeft(sCom, 4) == ".vfx") + { + int iArg = StringToInt(sArgs); + if (GetTag(oTarget) == "dmfi_voice") + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iArg), GetLocation(oTarget), 10.0f); + else + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(iArg), oTarget, 10.0f); + return; + } + else if (GetStringLeft(sCom, 5) == ".vtar") + { + object oGet = GetFirstObjectInArea(GetArea(oCommander)); + while (GetIsObjectValid(oGet)) + { + if (FindSubString(GetName(oGet), sArgs) != -1) + { + SetLocalObject(oCommander, "dmfi_VoiceTarget", oGet); + FloatingTextStringOnCreature("You have targeted " + GetName(oGet) + " with the Voice Widget", oCommander, FALSE); + return; + } + oGet = GetNextObjectInArea(GetArea(oCommander)); + } + FloatingTextStringOnCreature("Target not found.", oCommander, FALSE); + return; + } +} + +//////////////////////////////////////////////////////////////////////// +void subTranslateToLanguage(string sSaid, object oShouter, int nVolume, + object oMaster, int iTranslate, string sLanguageName, + object oEavesdrop) +{ + string sVolume = "said"; + if (nVolume == TALKVOLUME_WHISPER) sVolume = "whispered"; + else if (nVolume == TALKVOLUME_SHOUT) sVolume = "shouted"; + else if (nVolume == TALKVOLUME_PARTY) sVolume = "said to the party"; + else if (nVolume == TALKVOLUME_SILENT_SHOUT) sVolume = "said to the DM's"; + + //Translate and Send or do Lore check + if (oEavesdrop == oMaster || + GetIsObjectValid(GetItemPossessedBy(oEavesdrop, "hlslang_" + IntToString(iTranslate))) || + GetIsObjectValid(GetItemPossessedBy(oEavesdrop, "babelfish")) || + iTranslate == GetDefaultRacialLanguage(oEavesdrop, 0) || + iTranslate == GetDefaultClassLanguage(oEavesdrop) || + GetIsDM(oEavesdrop) || + GetIsDMPossessed(oEavesdrop)) + { + DelayCommand(0.1, DMFISendMessageToPC(oEavesdrop, GetName(oShouter) + " " + sVolume + " in " + sLanguageName + ": " + sSaid, FALSE, DMFI_MESSAGE_COLOR_TRANSLATION)); + } + else + { + if (iTranslate != 9) + { + string sKnownLanguage; + if (d20() + GetSkillRank(SKILL_LORE, oEavesdrop) > 20) sKnownLanguage = sLanguageName; + else sKnownLanguage = "a language you do not recognize"; + DelayCommand(0.1, DMFISendMessageToPC(oEavesdrop, GetName(oShouter)+" "+sVolume+" something in "+sKnownLanguage+".", FALSE, DMFI_MESSAGE_COLOR_TRANSLATION)); + } + } +} + +//////////////////////////////////////////////////////////////////////// +string TranslateToLanguage(string sSaid, object oShouter, int nVolume, object oMaster) +{ +// arguments +// (return) = translated text +// sSaid = string to translate +// oShouter = object that spoke sSaid +// iVolume = TALKVOLUME setting of speaker +// oMaster = master of oShouter (if oShouter has no master, oMaster should equal oShouter) + + //Gets the current language that the character is speaking + int iTranslate = GetLocalInt(oShouter, "hls_MyLanguage"); + if (!iTranslate) iTranslate = GetDefaultRacialLanguage(oShouter, 1); + if (!iTranslate) + { + DMFISendMessageToPC(oMaster, "Translator Error: your message was dropped.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + return ""; + } + + //Defines language name + string sLanguageName = GetLocalString(oShouter, "hls_MyLanguageName"); + + sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1); // toss the leading translate flag '[' + //Thieves' Cant character limit of 25 + if (iTranslate == 9 && GetStringLength(sSaid) > 25) + sSaid = GetStringLeft(sSaid, 25); + string sSpeak = TranslateCommonToLanguage(iTranslate, sSaid); + // lop off trailing ']' + if (GetStringRight(sSaid, 1) == "]") + sSaid = GetStringLeft(sSaid, GetStringLength(sSaid)-1); + // AssignCommand(oShouter, SpeakString(sSpeak)); // no need reissue translated speech, handled in player chat hook + + // send speech to everyone who should be able to hear + float fDistance = 20.0f; + if (nVolume == TALKVOLUME_WHISPER) + { + fDistance = 1.0f; + } + string sVolume = "said"; + if (nVolume == TALKVOLUME_WHISPER) sVolume = "whispered"; + else if (nVolume == TALKVOLUME_SHOUT) sVolume = "shouted"; + else if (nVolume == TALKVOLUME_PARTY) sVolume = "said to the party"; + else if (nVolume == TALKVOLUME_SILENT_SHOUT) sVolume = "said to the DM's"; + string sKnownLanguage; + + // send translated message to PC's in range who understand it + object oEavesdrop = GetFirstObjectInShape(SHAPE_SPHERE, fDistance, GetLocation(oShouter), FALSE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oEavesdrop)) + { + if (GetIsPC(oEavesdrop) || GetIsDM(oEavesdrop) || GetIsDMPossessed(oEavesdrop) || GetIsPossessedFamiliar(oEavesdrop)) + { + subTranslateToLanguage(sSaid, oShouter, nVolume, oMaster, iTranslate, sLanguageName, oEavesdrop); + } + oEavesdrop = GetNextObjectInShape(SHAPE_SPHERE, fDistance, GetLocation(oShouter), FALSE, OBJECT_TYPE_CREATURE); + } + + // send translated message to DM's in range + oEavesdrop = GetFirstPC(); + while (GetIsObjectValid(oEavesdrop)) + { + if (GetIsDM(oEavesdrop)) + { + if (GetArea(oShouter) == GetArea(oEavesdrop) && + GetDistanceBetweenLocations(GetLocation(oShouter), GetLocation(oEavesdrop)) <= fDistance) + { + subTranslateToLanguage(sSaid, oShouter, nVolume, oMaster, iTranslate, sLanguageName, oEavesdrop); + } + } + oEavesdrop = GetNextPC(); + } + return sSpeak; +} + +//////////////////////////////////////////////////////////////////////// +int RelayTextToEavesdropper(object oShouter, int nVolume, string sSaid) +{ +// arguments +// (return) - flag to continue processing text: X2_EXECUTE_SCRIPT_CONTINUE or +// X2_EXECUTE_SCRIPT_END +// oShouter - object that spoke +// nVolume - channel (TALKVOLUME) text was spoken on +// sSaid - text that was spoken + + int bScriptEnd = X2_EXECUTE_SCRIPT_CONTINUE; + + // sanity checks + if (GetIsObjectValid(oShouter)) + { + int iHookToDelete = 0; + int iHookType = 0; + int channels = 0; + int rangemode = 0; + string siHook = ""; + object oMod = GetModule(); + int iHook = 1; + while (1) + { + siHook = IntToString(iHook); + iHookType = GetLocalInt(oMod, sHookTypeVarname+siHook); + if (iHookType == 0) break; // end of list + + // check channel + channels = GetLocalInt(oMod, sHookChannelsVarname+siHook); + if (((1 << nVolume) & channels) != 0) + { + string sVol = (nVolume == TALKVOLUME_WHISPER ? "whispers" : "says"); + object oOwner = GetLocalObject(oMod, sHookOwnerVarname+siHook); + if (GetIsObjectValid(oOwner)) + { + // it's a channel for us to listen on, process + int bcast = GetLocalInt(oMod, sHookBcastDMsVarname+siHook); + // for type 1, see if speaker is the one we want (pc or party) + // for type 2, see if speaker says his stuff within ("earshot" / area / module) of listener's location + if (iHookType == 1) // listen to what a PC hears + { + object oListener; + location locShouter, locListener; + object oTargeted = GetLocalObject(oMod, sHookCreatureVarname+siHook); + if (GetIsObjectValid(oTargeted)) + { + rangemode = GetLocalInt(oMod, sHookRangeModeVarname+siHook); + if (rangemode) oListener = GetFirstFactionMember(oTargeted, FALSE); // everyone in party are our listeners + else oListener = oTargeted; // only selected PC is our listener + while (GetIsObjectValid(oListener)) + { + // check speaker: + // check within earshot + int bInRange = FALSE; + locShouter = GetLocation(oShouter); + locListener = GetLocation(oListener); + if (oShouter == oListener) + { + bInRange = TRUE; // the target can always hear himself + } + else if (GetAreaFromLocation(locShouter) == GetAreaFromLocation(locListener)) + { + float dist = GetDistanceBetweenLocations(locListener, locShouter); + if ((nVolume == TALKVOLUME_WHISPER && dist <= WHISPER_DISTANCE) || + (nVolume != TALKVOLUME_WHISPER && dist <= TALK_DISTANCE)) + { + bInRange = TRUE; + } + } + if (bInRange) + { + // relay what's said to the hook owner + string sMesg = "("+GetName(GetArea(oShouter))+") "+GetName(oShouter)+" "+sVol+": "+sSaid; + // if (bcast) SendMessageToAllDMs(sMesg); + // else SendMessageToPC(oOwner, sMesg); + DMFISendMessageToPC(oOwner, sMesg, bcast, DMFI_MESSAGE_COLOR_EAVESDROP); + } + if (rangemode == 0) break; // only check the target creature for rangemode 0 + if (bInRange) break; // once any party member hears shouter, we're done + oListener = GetNextFactionMember(oTargeted, FALSE); + } + } + else + { + // bad desired speaker, remove hook + iHookToDelete = iHook; + } + } + else if (iHookType == 2) // listen at location + { + location locShouter, locListener; + object oListener = GetLocalObject(oMod, sHookCreatureVarname+siHook); + if (oListener != OBJECT_INVALID) + { + locListener = GetLocation(oListener); + } + else + { + locListener = GetLocalLocation(oMod, sHookLocationVarname+siHook); + } + locShouter = GetLocation(oShouter); + rangemode = GetLocalInt(oMod, sHookRangeModeVarname+siHook); + int bInRange = FALSE; + if (rangemode == 0) + { + // check within earshot + if (GetAreaFromLocation(locShouter) == GetAreaFromLocation(locListener)) + { + float dist = GetDistanceBetweenLocations(locListener, locShouter); + if ((nVolume == TALKVOLUME_WHISPER && dist <= WHISPER_DISTANCE) || + (nVolume != TALKVOLUME_WHISPER && dist <= TALK_DISTANCE)) + { + bInRange = TRUE; + } + } + } + else if (rangemode == 1) + { + // check within area + if (GetAreaFromLocation(locShouter) == GetAreaFromLocation(locListener)) bInRange = TRUE; + } + else + { + // module-wide + bInRange = TRUE; + } + if (bInRange) + { + // relay what's said to the hook owner + string sMesg = "("+GetName(GetArea(oShouter))+") "+GetName(oShouter)+" "+sVol+": "+sSaid; + // if (bcast) SendMessageToAllDMs(sMesg); + // else SendMessageToPC(oOwner, sMesg); + DMFISendMessageToPC(oOwner, sMesg, bcast, DMFI_MESSAGE_COLOR_EAVESDROP); + } + } + else + { + WriteTimestampedLogEntry("ERROR: DMFI OnPlayerChat handler: invalid iHookType; removing hook."); + iHookToDelete = iHook; + } + } + else + { + // bad owner, delete hook + iHookToDelete = iHook; + } + } + + iHook++; + } + + // remove a bad hook: note we can only remove one bad hook this way, have to rely on subsequent calls to remove any others + if (iHookToDelete > 0) + { + RemoveListenerHook(iHookToDelete); + } + } + + return bScriptEnd; +} + +//////////////////////////////////////////////////////////////////////// +void main() +{ + int bScriptEnd = X2_EXECUTE_SCRIPT_CONTINUE; + int nVolume = GetPCChatVolume(); + object oShouter = GetPCChatSpeaker(); + string sSaid = GetPCChatMessage(); + +// SpawnScriptDebugger(); +// DMFISendMessageToPC(oShouter, IntToString(nVolume)+">> "+sSaid, FALSE, "737"); + + // pass on any heard text to registered listeners + // since listeners are set by DM's, pass the raw unprocessed command text to them + bScriptEnd = RelayTextToEavesdropper(oShouter, nVolume, sSaid); + + if (bScriptEnd == X2_EXECUTE_SCRIPT_CONTINUE) + { + // see if we're supposed to listen on this channel + if ((nVolume == TALKVOLUME_TALK && DMFI_LISTEN_ON_CHANNEL_TALK) || + (nVolume == TALKVOLUME_SILENT_SHOUT && DMFI_LISTEN_ON_CHANNEL_DM) || + (nVolume == TALKVOLUME_WHISPER && DMFI_LISTEN_ON_CHANNEL_WHISPER) || + (nVolume == TALKVOLUME_PARTY && DMFI_LISTEN_ON_CHANNEL_PARTY) || + (nVolume == TALKVOLUME_SHOUT && DMFI_LISTEN_ON_CHANNEL_SHOUT)) + { + // yes we are + // now see if we have a command to parse + // special chars: + // [ = speak in alternate language + // * = perform emote + // : = throw voice to last designated target + // ; = throw voice to master / animal companion / familiar / henchman / summon + // , = throw voice summon / henchman / familiar / animal companion / master + // . = command to execute + + int bChangedText = 0; + object oTarget = OBJECT_INVALID; + int iTargetType = 0; + + // eat leading whitespace + while (GetStringLeft(sSaid, 1) == " ") + { + sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1); + } + + string sLeadChar = GetStringLeft(sSaid, 1); + string s2ndChar = GetStringRight(GetStringLeft(sSaid, 2), 1); + + // check for target selection + if (s2ndChar != sLeadChar) // doubled leadins should be ignored + { + if (sLeadChar == ":") + { + if (GetIsDM(oShouter) || GetIsDMPossessed(oShouter)) + { + // last creature targeted with DMFI Voice Widget + iTargetType = 1; + oTarget = GetLocalObject(oShouter, "dmfi_VoiceTarget"); + } + else + { + // non-DM's can't target others + iTargetType = -1; + oTarget = OBJECT_INVALID; + } + } + else if (sLeadChar == ";") + { + // master / animal companion / familiar / henchman / summon + iTargetType = 2; + oTarget = GetMaster(oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter); + } + } + } + } + } + else if (sLeadChar == ",") + { + // summon / henchman / familiar / animal companion / master + iTargetType = 3; + oTarget = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetMaster(oShouter); + } + } + } + } + } + + if (iTargetType != 0) + { + // eat the targeting character and any whitespace following it + sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1); + while (GetStringLeft(sSaid, 1) == " ") + { + sSaid = GetStringRight(sSaid, GetStringLength(sSaid)-1); + } + sLeadChar = GetStringLeft(sSaid, 1); + } + + // now parse special command char (.command, *emote, [lang) + if (sLeadChar == ".") + { + bChangedText = 1; + if (oTarget == OBJECT_INVALID) + { + // 2008.05.29 tsunami282 - no target set, so dot command uses DMFI targeting wand + oTarget = GetLocalObject(oShouter, "dmfi_univ_target"); + } + + if (GetIsObjectValid(oTarget)) + { + ParseCommand(oTarget, oShouter, sSaid); + sSaid = ""; + } + else + { + // target invalid + bChangedText = 1; + DMFISendMessageToPC(oShouter, "Invalid command target - not processed.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + sSaid = ""; + } + } + else if (sLeadChar == "*") + { + bChangedText = 1; + if (oTarget == OBJECT_INVALID) oTarget = oShouter; // untargeted emotes apply to self + if (GetIsObjectValid(oTarget)) + { + ParseEmote(sSaid, oTarget); + } + else + { + // target invalid + bChangedText = 1; + DMFISendMessageToPC(oShouter, "Invalid emote target - not processed.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + sSaid = ""; + } + } + else if (sLeadChar == "[") + { + bChangedText = 1; + if (oTarget == OBJECT_INVALID) oTarget = oShouter; // untargeted languages spoken by self + if (GetIsObjectValid(oTarget)) + { + sSaid = TranslateToLanguage(sSaid, oTarget, nVolume, oShouter); + } + else + { + // target invalid + bChangedText = 1; + DMFISendMessageToPC(oShouter, "Invalid language target - not processed.", FALSE, DMFI_MESSAGE_COLOR_ALERT); + sSaid = ""; + } + } + } + + if (iTargetType != 0) + { + // throw the message + if (sSaid != "") + { + bChangedText = 1; + AssignCommand(oTarget, SpeakString(sSaid, nVolume)); + if (DMFI_LOG_CONVERSATION) + { + PrintString(""+GetName(GetArea(oTarget))+ " " + GetName(oTarget) + ": " + sSaid + " "); + } + sSaid = ""; + } + } + else + { + // log what was said + if (DMFI_LOG_CONVERSATION && (sSaid != "")) + { + PrintString(""+GetName(GetArea(oShouter))+ " " + GetName(oShouter) + ": " + sSaid + " "); + } + } + + if (bChangedText) + { + SetPCChatMessage(sSaid); + bScriptEnd = X2_EXECUTE_SCRIPT_END; + } + } + } + + SetExecutedScriptReturnValue(bScriptEnd); +} + diff --git a/nwnds_module/dmfi_plychat_inc.nss b/nwnds_module/dmfi_plychat_inc.nss new file mode 100644 index 000000000..a7b144b05 --- /dev/null +++ b/nwnds_module/dmfi_plychat_inc.nss @@ -0,0 +1,142 @@ + +// DMFI OnPlayerChat routines :: event hooking functions +// +// history +// 2008.03.23 tsunami282 - created. +// + +#include "dmfi_arrays_inc" + +const string DMFI_CHATHOOK_HANDLE_ARRAYNAME = "DMFI_CHATHOOK_HANDLE"; +const string DMFI_CHATHOOK_SCRIPT_ARRAYNAME = "DMFI_CHATHOOK_SCRIPT"; +const string DMFI_CHATHOOK_RUNNER_ARRAYNAME = "DMFI_CHATHOOK_RUNNER"; +const string DMFI_CHATHOOK_CHANNELS_ARRAYNAME = "DMFI_CHATHOOK_CHANNELS"; +const string DMFI_CHATHOOK_LISTENALL_ARRAYNAME = "DMFI_CHATHOOK_LISTENALL"; +const string DMFI_CHATHOOK_SPEAKER_ARRAYNAME = "DMFI_CHATHOOK_SPEAKER"; +const string DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME = "DMFI_CHATHOOK_AUTOREMOVE"; +const string DMFI_CHATHOOK_PREVHANDLE_VARNAME = "DMFI_CHATHOOK_PREVHANDLE"; + +int DMFI_CHANNELMASK_TALK = (1 << TALKVOLUME_TALK); +int DMFI_CHANNELMASK_WHISPER = (1 << TALKVOLUME_WHISPER); +int DMFI_CHANNELMASK_SHOUT = (1 << TALKVOLUME_SHOUT); +// * this channel not hookable ** int DMFI_CHANNELMASK_SILENT_TALK = (1 << TALKVOLUME_SILENT_TALK); +int DMFI_CHANNELMASK_DM = (1 << TALKVOLUME_SILENT_SHOUT); +int DMFI_CHANNELMASK_PARTY = (1 << TALKVOLUME_PARTY); +// * this channel not hookable ** int DMFI_CHANNELMASK_TELL = (1 << TALKVOLUME_TELL); + +//////////////////////////////////////////////////////////////////////// +void dmfi__init_chathook_data() +{ + object oMod = GetModule(); + + if (!GetLocalArrayInitialized(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME)) + { + InitializeLocalArray(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, 0); + InitializeLocalArray(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME); + SetLocalArrayLowerBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, 1); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, 0); + } +} + +//////////////////////////////////////////////////////////////////////// +//! Adds a callback function to the OnPlayerChat list. +//! +//! \param sChatHandlerScript name of script to invoke on receiving input +//! \param oScriptRunner object to execute the sChatHandlerScript on +//! \param maskChannels mask of channels to listen on (defaults to all channels) +//! \param bListenAll TRUE to listen to all PC speakers everywhere +//! \param oSpeaker if bListenAll is FALSE, creature to listen to (others will be ignored) +//! \param bAutoRemove - automatically unhook this chathook after first use +//! \return hook handle (needed to remove the hook later); 0 means failed to add the hook +int DMFI_ChatHookAdd(string sChatHandlerScript, object oScriptRunner = OBJECT_SELF, + int maskChannels = -1, int bListenAll = TRUE, object oSpeaker = OBJECT_INVALID, + int bAutoRemove = FALSE) +{ + dmfi__init_chathook_data(); + + object oMod = GetModule(); + + int iHook = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME); + iHook++; + int hdlHook = GetLocalInt(oMod, DMFI_CHATHOOK_PREVHANDLE_VARNAME); + hdlHook++; + if (hdlHook < 1) hdlHook = 1; // reserving 0 and negatives + // SendMessageToPC(GetFirstPC(), "chathookadd - adding hook #" + IntToString(iHook)); + SetLocalInt(oMod, DMFI_CHATHOOK_PREVHANDLE_VARNAME, hdlHook); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook, hdlHook); + SetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook, sChatHandlerScript); + SetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook, oScriptRunner); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook, maskChannels); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook, bListenAll); + SetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook, oSpeaker); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook, bAutoRemove); + + return hdlHook; +} + +//////////////////////////////////////////////////////////////////////// +//! removes a callback function from the OnPlayerChat list. +//! \param hdlHookIn handle of hook to remove (0 for clean up orphans) +//! \return TRUE if requested hook found and removed +int DMFI_ChatHookRemove(int hdlHookIn) +{ + int bRemoved = FALSE; + int hdlHook; + int iHook, iHook2; + object oMod = GetModule(); + int nHooks = GetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME); + for (iHook = 1; iHook <= nHooks; iHook++) + { + while (1) + { + hdlHook = GetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook); + if (hdlHook != 0 && hdlHook != hdlHookIn) break; + + // kill this one + for (iHook2 = iHook; iHook2 < nHooks; iHook2++) + { + SetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, iHook2+1)); + SetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook2, GetLocalArrayString(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, iHook2+1)); + SetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook2, GetLocalArrayObject(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, iHook2+1)); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, iHook2+1)); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, iHook2+1)); + SetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook2, GetLocalArrayObject(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, iHook2+1)); + SetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook2, GetLocalArrayInt(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, iHook2+1)); + } + bRemoved = TRUE; + nHooks--; + if (nHooks < iHook) break; + } + } + + if (bRemoved) + { + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_HANDLE_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SCRIPT_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_RUNNER_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_CHANNELS_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_LISTENALL_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_SPEAKER_ARRAYNAME, nHooks); + SetLocalArrayUpperBound(oMod, DMFI_CHATHOOK_AUTOREMOVE_ARRAYNAME, nHooks); + } + + return bRemoved; +} + diff --git a/nwnds_module/dmfi_remove.uti b/nwnds_module/dmfi_remove.uti new file mode 100644 index 000000000..91480a8fa Binary files /dev/null and b/nwnds_module/dmfi_remove.uti differ diff --git a/nwnds_module/dmfi_rest.utp b/nwnds_module/dmfi_rest.utp new file mode 100644 index 000000000..ed0379265 Binary files /dev/null and b/nwnds_module/dmfi_rest.utp differ diff --git a/nwnds_module/dmfi_rest001.utp b/nwnds_module/dmfi_rest001.utp new file mode 100644 index 000000000..dd994c19c Binary files /dev/null and b/nwnds_module/dmfi_rest001.utp differ diff --git a/nwnds_module/dmfi_rest002.utp b/nwnds_module/dmfi_rest002.utp new file mode 100644 index 000000000..ab5f63388 Binary files /dev/null and b/nwnds_module/dmfi_rest002.utp differ diff --git a/nwnds_module/dmfi_rest003.utp b/nwnds_module/dmfi_rest003.utp new file mode 100644 index 000000000..f203b0811 Binary files /dev/null and b/nwnds_module/dmfi_rest003.utp differ diff --git a/nwnds_module/dmfi_restvfxobje.utp b/nwnds_module/dmfi_restvfxobje.utp new file mode 100644 index 000000000..f00182de3 Binary files /dev/null and b/nwnds_module/dmfi_restvfxobje.utp differ diff --git a/nwnds_module/dmfi_server.uti b/nwnds_module/dmfi_server.uti new file mode 100644 index 000000000..9cba6e723 Binary files /dev/null and b/nwnds_module/dmfi_server.uti differ diff --git a/nwnds_module/dmfi_setting.utc b/nwnds_module/dmfi_setting.utc new file mode 100644 index 000000000..eb5c13b51 Binary files /dev/null and b/nwnds_module/dmfi_setting.utc differ diff --git a/nwnds_module/dmfi_sound.uti b/nwnds_module/dmfi_sound.uti new file mode 100644 index 000000000..1f2872dd0 Binary files /dev/null and b/nwnds_module/dmfi_sound.uti differ diff --git a/nwnds_module/dmfi_string_inc.nss b/nwnds_module/dmfi_string_inc.nss new file mode 100644 index 000000000..a81ddd9be --- /dev/null +++ b/nwnds_module/dmfi_string_inc.nss @@ -0,0 +1,71 @@ +//:://///////////////////////////////////////////// +//:: DMFI - string functions and constants +//:: dmfi_string_inc +//::////////////////////////////////////////////// +/* + Library of functions relating to strings for DMFI. +*/ +//::////////////////////////////////////////////// +//:: Created By: tsunami282 +//:: Created On: 2008.08.11 +//::////////////////////////////////////////////// + +#include "x3_inc_string" + +const string DMFI_MESSAGE_COLOR_ALERT = "733"; // default 733 - brite red +const string DMFI_MESSAGE_COLOR_STATUS = "773"; // default 773 - yellow +const string DMFI_MESSAGE_COLOR_EAVESDROP = "777"; // default 777 - white +const string DMFI_MESSAGE_COLOR_TRANSLATION = "555"; // default 733 - lite gray +const string DMFI_MESSAGE_COLOR_OTHER = ""; // default blank + +//////////////////////////////////////////////////////////////////////// +string LTrim(string sTrimMe, string sDelim = " ") +{ + int l; + + if (sDelim != "") + { + l = GetStringLength(sTrimMe); + while (GetStringLeft(sTrimMe, 1) == sDelim) + { + l--; + if (l < 1) + { + sTrimMe = ""; + break; + } + sTrimMe = GetStringRight(sTrimMe, l); + } + } + + return sTrimMe; +} + +//////////////////////////////////////////////////////////////////////// +void DMFISendMessageToPC(object oPC, string sMsg, int bAllDMs=FALSE, + string sRGB="") +{ + string sColMsg; + object oTarget = oPC; + if (bAllDMs) oTarget = GetFirstPC(); + while (GetIsObjectValid(oTarget)) + { + if ((!bAllDMs) || (GetIsDM(oTarget) || GetIsDMPossessed(oTarget))) + { + if (sRGB != "") + { + sColMsg = StringToRGBString(sMsg, sRGB); + } + else + { + sColMsg = sMsg; + } + SendMessageToPC(oTarget, sColMsg); + } + + if (!bAllDMs) break; + oTarget = GetNextPC(); + } + +} + diff --git a/nwnds_module/dmfi_target.uti b/nwnds_module/dmfi_target.uti new file mode 100644 index 000000000..1e1c89865 Binary files /dev/null and b/nwnds_module/dmfi_target.uti differ diff --git a/nwnds_module/dmfi_unact_nam02.ncs b/nwnds_module/dmfi_unact_nam02.ncs new file mode 100644 index 000000000..5849bef41 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam02.ncs differ diff --git a/nwnds_module/dmfi_unact_nam02.nss b/nwnds_module/dmfi_unact_nam02.nss new file mode 100644 index 000000000..eddecfe18 --- /dev/null +++ b/nwnds_module/dmfi_unact_nam02.nss @@ -0,0 +1,12 @@ + +#include "dmfi_getln_inc" + +void main() +{ + object oListener = OBJECT_SELF; + object oPC = GetPCSpeaker(); + + // attach our listener event + SetLocalString(oListener, "dmfi_getln_mode", "name"); + DMFI_get_line(oPC, TALKVOLUME_TALK, "dmfi_univ_listen", oListener); +} diff --git a/nwnds_module/dmfi_unact_nam03.ncs b/nwnds_module/dmfi_unact_nam03.ncs new file mode 100644 index 000000000..eb538ef69 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam03.ncs differ diff --git a/nwnds_module/dmfi_unact_nam03.nss b/nwnds_module/dmfi_unact_nam03.nss new file mode 100644 index 000000000..97b67f6f3 --- /dev/null +++ b/nwnds_module/dmfi_unact_nam03.nss @@ -0,0 +1,6 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + SetName(oTarget, ""); +} diff --git a/nwnds_module/dmfi_unact_nam04.ncs b/nwnds_module/dmfi_unact_nam04.ncs new file mode 100644 index 000000000..70b1ba757 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam04.ncs differ diff --git a/nwnds_module/dmfi_unact_nam04.nss b/nwnds_module/dmfi_unact_nam04.nss new file mode 100644 index 000000000..55b514748 --- /dev/null +++ b/nwnds_module/dmfi_unact_nam04.nss @@ -0,0 +1,8 @@ + +#include "dmfi_getln_inc" + +void main() +{ + object oListener = OBJECT_SELF; + DMFI_cancel_get_line(0, oListener); +} diff --git a/nwnds_module/dmfi_unact_nam06.ncs b/nwnds_module/dmfi_unact_nam06.ncs new file mode 100644 index 000000000..6e1e25036 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam06.ncs differ diff --git a/nwnds_module/dmfi_unact_nam06.nss b/nwnds_module/dmfi_unact_nam06.nss new file mode 100644 index 000000000..931d0bd8f --- /dev/null +++ b/nwnds_module/dmfi_unact_nam06.nss @@ -0,0 +1,12 @@ + +#include "dmfi_getln_inc" + +void main() +{ + object oListener = OBJECT_SELF; + object oPC = GetPCSpeaker(); + + // attach our listener event + SetLocalString(oListener, "dmfi_getln_mode", "desc"); + DMFI_get_line(oPC, TALKVOLUME_TALK, "dmfi_univ_listen", oListener); +} diff --git a/nwnds_module/dmfi_unact_nam07.ncs b/nwnds_module/dmfi_unact_nam07.ncs new file mode 100644 index 000000000..eb538ef69 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam07.ncs differ diff --git a/nwnds_module/dmfi_unact_nam07.nss b/nwnds_module/dmfi_unact_nam07.nss new file mode 100644 index 000000000..97b67f6f3 --- /dev/null +++ b/nwnds_module/dmfi_unact_nam07.nss @@ -0,0 +1,6 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + SetName(oTarget, ""); +} diff --git a/nwnds_module/dmfi_unact_nam08.ncs b/nwnds_module/dmfi_unact_nam08.ncs new file mode 100644 index 000000000..70b1ba757 Binary files /dev/null and b/nwnds_module/dmfi_unact_nam08.ncs differ diff --git a/nwnds_module/dmfi_unact_nam08.nss b/nwnds_module/dmfi_unact_nam08.nss new file mode 100644 index 000000000..55b514748 --- /dev/null +++ b/nwnds_module/dmfi_unact_nam08.nss @@ -0,0 +1,8 @@ + +#include "dmfi_getln_inc" + +void main() +{ + object oListener = OBJECT_SELF; + DMFI_cancel_get_line(0, oListener); +} diff --git a/nwnds_module/dmfi_uncnd_nam01.ncs b/nwnds_module/dmfi_uncnd_nam01.ncs new file mode 100644 index 000000000..a9f4bfd02 Binary files /dev/null and b/nwnds_module/dmfi_uncnd_nam01.ncs differ diff --git a/nwnds_module/dmfi_uncnd_nam01.nss b/nwnds_module/dmfi_uncnd_nam01.nss new file mode 100644 index 000000000..603d42ca4 --- /dev/null +++ b/nwnds_module/dmfi_uncnd_nam01.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ + // set the custom tokens + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + + string sName = GetName(oTarget); + SetCustomToken(20680, sName); + string sOrigName = GetName(oTarget, TRUE); + SetCustomToken(20681, sOrigName); + + return TRUE; +} diff --git a/nwnds_module/dmfi_uncnd_nam05.ncs b/nwnds_module/dmfi_uncnd_nam05.ncs new file mode 100644 index 000000000..eb9da6b51 Binary files /dev/null and b/nwnds_module/dmfi_uncnd_nam05.ncs differ diff --git a/nwnds_module/dmfi_uncnd_nam05.nss b/nwnds_module/dmfi_uncnd_nam05.nss new file mode 100644 index 000000000..8c2aac6dc --- /dev/null +++ b/nwnds_module/dmfi_uncnd_nam05.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ + // set the custom tokens + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + + string sName = GetDescription(oTarget); + SetCustomToken(20682, sName); + string sOrigName = GetDescription(oTarget, TRUE); + SetCustomToken(20683, sOrigName); + + return TRUE; +} diff --git a/nwnds_module/dmfi_univ_1.ncs b/nwnds_module/dmfi_univ_1.ncs new file mode 100644 index 000000000..6c7d8173a Binary files /dev/null and b/nwnds_module/dmfi_univ_1.ncs differ diff --git a/nwnds_module/dmfi_univ_1.nss b/nwnds_module/dmfi_univ_1.nss new file mode 100644 index 000000000..4a303cdba --- /dev/null +++ b/nwnds_module/dmfi_univ_1.nss @@ -0,0 +1,26 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 1); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 1); + ExecuteScript("dmfi_execute", oPC); + } + else + SetLocalInt(oPC, "Tens", 1); + return; + } +} diff --git a/nwnds_module/dmfi_univ_10.ncs b/nwnds_module/dmfi_univ_10.ncs new file mode 100644 index 000000000..88747d672 Binary files /dev/null and b/nwnds_module/dmfi_univ_10.ncs differ diff --git a/nwnds_module/dmfi_univ_10.nss b/nwnds_module/dmfi_univ_10.nss new file mode 100644 index 000000000..c309cedd8 --- /dev/null +++ b/nwnds_module/dmfi_univ_10.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens")); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "voice" || sConv == "pc_emote" || sConv == "faction") + { + SetLocalInt(oPC, "dmfi_univ_int", 10); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 10); + return; + } +} diff --git a/nwnds_module/dmfi_univ_2.ncs b/nwnds_module/dmfi_univ_2.ncs new file mode 100644 index 000000000..43f0fd4d1 Binary files /dev/null and b/nwnds_module/dmfi_univ_2.ncs differ diff --git a/nwnds_module/dmfi_univ_2.nss b/nwnds_module/dmfi_univ_2.nss new file mode 100644 index 000000000..22a124c65 --- /dev/null +++ b/nwnds_module/dmfi_univ_2.nss @@ -0,0 +1,26 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 2); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 2); + ExecuteScript("dmfi_execute", oPC); + } + else + SetLocalInt(oPC, "Tens", 2); + return; + } +} diff --git a/nwnds_module/dmfi_univ_3.ncs b/nwnds_module/dmfi_univ_3.ncs new file mode 100644 index 000000000..cc63a3cce Binary files /dev/null and b/nwnds_module/dmfi_univ_3.ncs differ diff --git a/nwnds_module/dmfi_univ_3.nss b/nwnds_module/dmfi_univ_3.nss new file mode 100644 index 000000000..20aff9cf6 --- /dev/null +++ b/nwnds_module/dmfi_univ_3.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 3); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 3); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 3); + return; + } +} diff --git a/nwnds_module/dmfi_univ_4.ncs b/nwnds_module/dmfi_univ_4.ncs new file mode 100644 index 000000000..3df73636b Binary files /dev/null and b/nwnds_module/dmfi_univ_4.ncs differ diff --git a/nwnds_module/dmfi_univ_4.nss b/nwnds_module/dmfi_univ_4.nss new file mode 100644 index 000000000..a27b9653b --- /dev/null +++ b/nwnds_module/dmfi_univ_4.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 4); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 4); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 4); + return; + } +} diff --git a/nwnds_module/dmfi_univ_5.ncs b/nwnds_module/dmfi_univ_5.ncs new file mode 100644 index 000000000..90de7871a Binary files /dev/null and b/nwnds_module/dmfi_univ_5.ncs differ diff --git a/nwnds_module/dmfi_univ_5.nss b/nwnds_module/dmfi_univ_5.nss new file mode 100644 index 000000000..1d9da1c6e --- /dev/null +++ b/nwnds_module/dmfi_univ_5.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 5); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 5); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 5); + return; + } +} diff --git a/nwnds_module/dmfi_univ_6.ncs b/nwnds_module/dmfi_univ_6.ncs new file mode 100644 index 000000000..d40cdb845 Binary files /dev/null and b/nwnds_module/dmfi_univ_6.ncs differ diff --git a/nwnds_module/dmfi_univ_6.nss b/nwnds_module/dmfi_univ_6.nss new file mode 100644 index 000000000..09ec7a957 --- /dev/null +++ b/nwnds_module/dmfi_univ_6.nss @@ -0,0 +1,28 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 6); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || + sConv == "server" || sConv == "onering") + { + SetLocalInt(oPC, "dmfi_univ_int", 6); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 6); + return; + } +} diff --git a/nwnds_module/dmfi_univ_7.ncs b/nwnds_module/dmfi_univ_7.ncs new file mode 100644 index 000000000..5db730db0 Binary files /dev/null and b/nwnds_module/dmfi_univ_7.ncs differ diff --git a/nwnds_module/dmfi_univ_7.nss b/nwnds_module/dmfi_univ_7.nss new file mode 100644 index 000000000..e08d0ebf1 --- /dev/null +++ b/nwnds_module/dmfi_univ_7.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 7); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "pc_emote" || sConv == "emote" || sConv == "server" || sConv == "onering" || sConv == "rest") + { + SetLocalInt(oPC, "dmfi_univ_int", 7); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 7); + return; + } +} diff --git a/nwnds_module/dmfi_univ_8.ncs b/nwnds_module/dmfi_univ_8.ncs new file mode 100644 index 000000000..64490805d Binary files /dev/null and b/nwnds_module/dmfi_univ_8.ncs differ diff --git a/nwnds_module/dmfi_univ_8.nss b/nwnds_module/dmfi_univ_8.nss new file mode 100644 index 000000000..6ca0800ad --- /dev/null +++ b/nwnds_module/dmfi_univ_8.nss @@ -0,0 +1,28 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 8); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(( sConv == "server") || (sConv == "xp") || + (sConv == "voice") || (sConv == "onering") || (sConv == "rest")) + { + SetLocalInt(oPC, "dmfi_univ_int", 8); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 8); + return; + } +} diff --git a/nwnds_module/dmfi_univ_9.ncs b/nwnds_module/dmfi_univ_9.ncs new file mode 100644 index 000000000..bedf24f1f Binary files /dev/null and b/nwnds_module/dmfi_univ_9.ncs differ diff --git a/nwnds_module/dmfi_univ_9.nss b/nwnds_module/dmfi_univ_9.nss new file mode 100644 index 000000000..a56a9fcf0 --- /dev/null +++ b/nwnds_module/dmfi_univ_9.nss @@ -0,0 +1,27 @@ +void main() +{ + object oPC = GetPCSpeaker(); + object oTarget = GetLocalObject(oPC, "dmfi_univ_target"); + location lLocation = GetLocalLocation(oPC, "dmfi_univ_location"); + string sConv = GetLocalString(oPC, "dmfi_univ_conv"); + + if (GetLocalInt(oPC, "Tens")) + { + SetLocalInt(oPC, "dmfi_univ_int", 10*GetLocalInt(oPC, "Tens") + 9); + ExecuteScript("dmfi_execute", oPC); + DeleteLocalInt(oPC, "Tens"); + return; + } + else + { + if(sConv == "server" || sConv == "voice" || sConv == "faction" || sConv == "rest") + { + SetLocalInt(oPC, "dmfi_univ_int", 9); + ExecuteScript("dmfi_execute", oPC); + return; + } + else + SetLocalInt(oPC, "Tens", 9); + return; + } +} diff --git a/nwnds_module/dmfi_univ_cond.ncs b/nwnds_module/dmfi_univ_cond.ncs new file mode 100644 index 000000000..402af2e49 Binary files /dev/null and b/nwnds_module/dmfi_univ_cond.ncs differ diff --git a/nwnds_module/dmfi_univ_cond.nss b/nwnds_module/dmfi_univ_cond.nss new file mode 100644 index 000000000..3a95f9503 --- /dev/null +++ b/nwnds_module/dmfi_univ_cond.nss @@ -0,0 +1,363 @@ +//DMFI Universal Wand scripts by hahnsoo + +//////////////////////////////////////////////////////////////////////// +//This initializes the rest dialog. +//If limited by Time, report how long it will take before the PC can rest again +//If DM, tell the DM the interval of time between rests. +//If limited by placeable, report that the PC needs a restable object nearby +//If DM, tell the DM that the rest is limited by placeables. +//If limited by Armor, report that the PC is wearing armor that prevents resting +//If DM, tell the DM that the rest is limited by armor weight. +//If in an area that doesn't allow spell memorization, report this to the PC +//If DM, tell the DM that spell memorization is restricted in this area. +//If hit point restrictions are "up", tell the PC how many hitpoints they would gain by resting +//If DM, tell the DM what level of Hitpoint restrictions are in effect. +void SetRestTokens(object oPC) +{ + object oArea = GetArea(oPC); + int iSettings = GetLocalInt(oPC, "dmfi_r_settings"); + int iMinutesPerHour = FloatToInt(HoursToSeconds(1))/60; + SetCustomToken(20792, IntToString(iMinutesPerHour)); + SetCustomToken(20793, IntToString(iMinutesPerHour * 2)); + SetCustomToken(20794, IntToString(iMinutesPerHour * 4)); + SetCustomToken(20795, IntToString(iMinutesPerHour * 6)); + SetCustomToken(20796, IntToString(iMinutesPerHour * 8)); + SetCustomToken(20797, IntToString(iMinutesPerHour * 12)); + SetCustomToken(20798, IntToString(iMinutesPerHour * 24)); + + if (GetIsDM(oPC)) + { + string sRest = ""; + if (iSettings & 0x00000080) + { + SetCustomToken(20789, "[LOCAL]"); + sRest = sRest + "[LOCAL] settings in effect"; + if (iSettings & 0x00000002) + sRest = sRest + "\nThis is a No Rest area"; + else if (!(iSettings & 0x00000001)) + sRest = sRest + "\nThis is an Unlimited Rest area"; + } + else + { + SetCustomToken(20789, "[GLOBAL]"); + sRest = sRest + "[GLOBAL] settings in effect"; + if (iSettings & 0x00000002) + sRest = sRest + "\nNo Rest is set globally"; + else if (!(iSettings & 0x00000001)) + sRest = sRest + "\nUnlimited Rest is set globally"; + } + if (iSettings & 0x00000004) + { + sRest = sRest + "\nRest is limited by Time: "; + switch (iSettings & 0x00000f00) + { + default: + case 0x00000100: sRest = sRest + "1 hour"; break; + case 0x00000200: sRest = sRest + "2 hours"; break; + case 0x00000300: sRest = sRest + "4 hours"; break; + case 0x00000400: sRest = sRest + "6 hours"; break; + case 0x00000500: sRest = sRest + "8 hours"; break; + case 0x00000600: sRest = sRest + "12 hours"; break; + case 0x00000700: sRest = sRest + "24 hours"; break; + } + } + if (iSettings & 0x00000008) //Placeables + { + sRest = sRest + "\nRest is limited by Placeables: "; + if (!(iSettings & 0x00001000)) sRest = sRest + "DMFI_placeables "; + if (iSettings & 0x00002000) sRest = sRest + "Campfires "; + if (iSettings & 0x00004000) sRest = sRest + "Bed_Rolls "; + if (iSettings & 0x00008000) sRest = sRest + "Beds "; + if (iSettings & 0x00010000) sRest = sRest + "Tents "; + if ((iSettings & 0x00020000) || (iSettings & 0x00040000) || (iSettings & 0x00080000)) + { + sRest = sRest + "\nClasses that ignore restrictions: "; + if (iSettings & 0x00020000) sRest = sRest + "Druids "; + if (iSettings & 0x00040000) sRest = sRest + "Rangers "; + if (iSettings & 0x00080000) sRest = sRest + "Barbarians "; + } + } + if (iSettings & 0x00000010) //Armor + { + sRest = sRest + "\nRest is limited by Armor: "; + switch (iSettings & 0x00f00000) + { + default: + case 0x00100000: sRest = sRest + "2 pounds"; break; + case 0x00200000: sRest = sRest + "6 pounds"; break; + case 0x00300000: sRest = sRest + "11 pounds"; break; + case 0x00400000: sRest = sRest + "16 pounds"; break; + case 0x00500000: sRest = sRest + "31 pounds"; break; + case 0x00600000: sRest = sRest + "41 pounds"; break; + case 0x00700000: sRest = sRest + "46 pounds"; break; + } + } + if (iSettings & 0x00000020) //Hit point limits + { + sRest = sRest + "\nHit points are limited to: "; + switch (iSettings & 0x0f000000) + { + case 0x01000000: sRest = sRest + "0 HP"; break; + case 0x02000000: sRest = sRest + "1 HP/level"; break; + case 0x03000000: sRest = sRest + "(CON) HP"; break; + case 0x04000000: sRest = sRest + "10 percent of max"; break; + case 0x05000000: sRest = sRest + "25 percent of max"; break; + case 0x06000000: sRest = sRest + "50 percent of max"; break; + default: + case 0x07000000: sRest = sRest + "100 percent"; break; + } + } + if (iSettings & 0x00000040) //Spell memorization + { + sRest = sRest + "\nSpell memorization is OFF"; + } + SetCustomToken(20791, sRest); + } + else //For PCs + { //Setting rest tokens + string sRest = ""; + if (iSettings & 0x00000080) + { + if (iSettings & 0x00000002) + sRest = sRest + "\nThis is a No Rest area"; + else if (!(iSettings & 0x00000001)) + sRest = sRest + "\nThis is an Unlimited Rest area"; + } + else + { + if (iSettings & 0x00000002) + sRest = sRest + "\nNo Rest is set globally"; + else if (!(iSettings & 0x00000001)) + sRest = sRest + "\nUnlimited Rest is set globally"; + } + if (iSettings & 0x00000004 && iSettings & 0x00000001) + { + int iTime = GetTimeHour() + GetCalendarDay() * 24 + GetCalendarMonth() * 24 * 28 + GetCalendarYear() * 24 * 28 * 12; + int iNext = GetLocalInt(oPC, "dmfi_r_nextrest"); + if (iNext > iTime) + sRest = sRest + "\nYou may rest again in " + IntToString(iNext - iTime) + " hours"; + } + if (iSettings & 0x00000008 && iSettings & 0x00000001) //Placeables + { + if (!(GetLevelByClass(CLASS_TYPE_DRUID, oPC) && (iSettings & 0x00020000)) || + !(GetLevelByClass(CLASS_TYPE_RANGER, oPC) && (iSettings & 0x00040000)) || + !(GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC) && (iSettings & 0x00080000))) + { + object oPlaceable = GetFirstObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE); + int iBreak = 0; + while (GetIsObjectValid(oPlaceable) && !iBreak) + { + if (!(iSettings & 0x00001000) && GetTag(oPlaceable) == "dmfi_rest") //DMFI Placeables: by default, ON + iBreak = 1; + if ((iSettings & 0x00002000) && GetStringLowerCase(GetName(oPlaceable)) == "campfire") //Campfires + iBreak = 1; + if ((iSettings & 0x00004000) && (GetStringLowerCase(GetName(oPlaceable)) == "bed roll" || GetStringLowerCase(GetName(oPlaceable)) == "bedroll")) //Bed rolls + iBreak = 1; + if ((iSettings & 0x00008000) && GetStringLowerCase(GetName(oPlaceable)) == "bed") //beds + iBreak = 1; + if ((iSettings & 0x00010000) && GetStringLowerCase(GetName(oPlaceable)) == "tent") //tents + iBreak = 1; + oPlaceable = GetNextObjectInShape(SHAPE_SPHERE, 6.0f, GetLocation(oPC), TRUE, OBJECT_TYPE_PLACEABLE); + } + if (!iBreak) + { + sRest = sRest + "\nYou are not near a rest placeable"; + } + } + } + if ((iSettings & 0x00000010) && iSettings & 0x00000001)//Armor + { + int iArmor = (iSettings & 0x00f00000); + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + int iWeight = GetWeight(oArmor); + switch(iArmor) + { + default: + case 0x00100000: if (iWeight > 20) sRest = sRest + "\nYou cannot rest in armor heavier than Clothing"; break; + case 0x00200000: if (iWeight > 60) sRest = sRest + "\nYou cannot rest in armor heavier than Padded"; break; + case 0x00300000: if (iWeight > 110) sRest = sRest + "\nYou cannot rest in armor heavier than Leather"; break; + case 0x00400000: if (iWeight > 160) sRest = sRest + "\nYou cannot rest in armor heavier than Studded Leather"; break; + case 0x00500000: if (iWeight > 310) sRest = sRest + "\nYou cannot rest in armor heavier than Chain Shirt"; break; + case 0x00600000: if (iWeight > 410) sRest = sRest + "\nYou cannot rest in armor heavier than Chain Mail"; break; + case 0x00700000: if (iWeight > 460) sRest = sRest + "\nYou cannot rest in armor heavier than Banded Mail"; break; + } + } + if (iSettings & 0x00000020 && iSettings & 0x00000001) //Hit point limits + { + sRest = sRest + "\nOn Rest, you will regain "; + switch (iSettings & 0x0f000000) + { + case 0x01000000: sRest = sRest + "0 HP"; break; + case 0x02000000: sRest = sRest + IntToString(GetHitDice(oPC)) + " HP"; break; + case 0x03000000: sRest = sRest + IntToString(GetAbilityScore(oPC, ABILITY_CONSTITUTION)) + " HP"; break; + case 0x04000000: sRest = sRest + IntToString(GetMaxHitPoints(oPC)/10) + " HP"; break; + case 0x05000000: sRest = sRest + IntToString(GetMaxHitPoints(oPC)/4) + " HP"; break; + case 0x06000000: sRest = sRest + IntToString(GetMaxHitPoints(oPC)/2) + " HP"; break; + default: + case 0x07000000: sRest = sRest + "full HP"; break; + } + sRest = sRest + "\nResting will drop you from the party"; + } + if (iSettings & 0x00000040 && iSettings & 0x00000001) //Spell memorization + { + sRest = sRest + "\nYou cannot memorize spells here"; + } + SetCustomToken(20790, sRest); + } +} + +//////////////////////////////////////////////////////////////////////// +int StartingConditional() +{ + object oPC = GetPCSpeaker(); + DeleteLocalInt(oPC, "Tens"); + int iOffset = GetLocalInt(oPC, "dmfi_univ_offset")+1; + string sOffset = GetLocalString(oPC, "dmfi_univ_conv"); + SetLocalInt(oPC, "dmfi_univ_offset", iOffset); + + if (sOffset == "afflict" && iOffset==1) + return TRUE; + else if (sOffset == "pc_emote" && iOffset==2) + return TRUE; + else if (sOffset == "emote" && iOffset==2) + return TRUE; + else if (sOffset == "encounter" && iOffset==3) + return TRUE; + else if (sOffset == "fx" && iOffset==4) + return TRUE; + else if (sOffset == "music" && iOffset==5) + return TRUE; + else if (sOffset == "sound" && iOffset==6) + return TRUE; + else if (sOffset == "xp" && iOffset==7) + return TRUE; + else if (sOffset == "onering" && iOffset==8) + return TRUE; + else if (sOffset == "pc_dicebag" && iOffset==9) + { + SetLocalInt(oPC, "dmfi_univ_offset", 8); + + if (GetLocalInt(oPC, "dmfi_dicebag")==0) + SetCustomToken(20681, "Private"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==1) + SetCustomToken(20681, "Global"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==2) + SetCustomToken(20681, "Local"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==3) + SetCustomToken(20681, "DM Only"); + + return TRUE; + } + else if (sOffset == "dicebag" && iOffset==10) + { + SetLocalInt(oPC, "dmfi_univ_offset", 9); + + if (GetLocalInt(oPC, "dmfi_dicebag")==0) + SetCustomToken(20681, "Private"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==1) + SetCustomToken(20681, "Global"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==2) + SetCustomToken(20681, "Local"); + else if (GetLocalInt(oPC, "dmfi_dicebag")==3) + SetCustomToken(20681, "DM Only"); + + string sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + + return TRUE; + } + else if (sOffset == "voice" && + GetIsObjectValid(GetLocalObject(oPC, "dmfi_univ_target")) && + oPC != GetLocalObject(oPC, "dmfi_univ_target") && + iOffset==11) + { + string sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + // pc range single/party + int hookparty = GetLocalInt(oPC, "dmfi_MyListenerPartyMode"); + if (hookparty == 0) SetCustomToken(20681, "*Single* / Party"); + else SetCustomToken(20681, "Single / *Party*"); + return TRUE; + } + else if (sOffset == "voice" && + !GetIsObjectValid(GetLocalObject(oPC, "dmfi_univ_target")) && + iOffset==12) + { + string sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + // loc range earshot/area/module + int hookparty = GetLocalInt(oPC, "dmfi_MyListenerPartyMode"); + if (hookparty == 0) SetCustomToken(20681, "*Earshot* / Area / Module"); + else if (hookparty == 1) SetCustomToken(20681, "Earshot / *Area* / Module"); + else SetCustomToken(20681, "Earshot / Area / *Module*"); + return TRUE; + } + else if (sOffset == "voice" && + GetIsObjectValid(GetLocalObject(oPC, "dmfi_univ_target")) && + oPC == GetLocalObject(oPC, "dmfi_univ_target") && + iOffset==13) + { + string sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + // self bcast one dm/all dm + int hookbcast = GetLocalInt(oPC, "dmfi_MyListenerBcastMode"); + if (hookbcast == 0) SetCustomToken(20681, "*Self* / All DMs"); + else SetCustomToken(20681, "Self / *All DMs*"); + return TRUE; + } + else if (sOffset == "faction" && iOffset==14) + { + int iLoop = 1; + string sName; + object sFaction; + while (iLoop < 10) + { + sFaction = GetLocalObject(oPC, "dmfi_customfaction" + IntToString(iLoop)); + sName = GetName(sFaction); + SetCustomToken(20690 + iLoop, sName + "'s Faction "); + iLoop++; + } + + SetCustomToken(20690, GetName(GetLocalObject(oPC, "dmfi_henchman"))); + SetCustomToken(20784, FloatToString(GetLocalFloat(oPC, "dmfi_reputation"))); + sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + return TRUE; + } + else if (sOffset == "dmw" && iOffset ==15) + { + SetCustomToken(20781, IntToString(GetLocalInt(oPC, "dmfi_alignshift"))); + return TRUE; + } + else if (sOffset == "buff" && iOffset ==16) + { + if (GetLocalInt(oPC, "dmfi_buff_party")==0) + SetCustomToken(20783, "Single Target"); + else + SetCustomToken(20783, "Party"); + SetCustomToken(20782, GetLocalString(oPC, "dmfi_buff_level")); + return TRUE; + } + else if (sOffset == "rest" && iOffset == 17 && !GetIsDM(oPC) && GetLocalInt(oPC, "dmfi_norest")) //This is the case of a No-Rest situation + { + SetRestTokens(oPC); + return TRUE; + } + else if (sOffset == "rest" && iOffset == 18 && !GetIsDM(oPC) && !GetLocalInt(oPC, "dmfi_norest")) //This is the case of a Rest situation + { + SetRestTokens(oPC); + return TRUE; + } + else if (sOffset == "rest" && iOffset == 19 && GetIsDM(oPC)) //This is the case of a DM activating the rest menu + { + SetRestTokens(oPC); + return TRUE; + } + else if (sOffset == "naming" && iOffset==20) + { + string sName = GetName(GetLocalObject(oPC, "dmfi_univ_target")); + SetCustomToken(20680, sName); + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/dmfi_univ_dmw.ncs b/nwnds_module/dmfi_univ_dmw.ncs new file mode 100644 index 000000000..53b275a16 Binary files /dev/null and b/nwnds_module/dmfi_univ_dmw.ncs differ diff --git a/nwnds_module/dmfi_univ_dmw.nss b/nwnds_module/dmfi_univ_dmw.nss new file mode 100644 index 000000000..054708f1a --- /dev/null +++ b/nwnds_module/dmfi_univ_dmw.nss @@ -0,0 +1,334 @@ +//DMFI Universal Wand scripts by hahnsoo +int DMW_START_CUSTOM_TOKEN = 8000; + +//Retrieve targetting information +object oMySpeaker = GetLastSpeaker(); +object oMyTarget = GetLocalObject(oMySpeaker, "dmfi_univ_target"); +location lMyLoc = GetLocalLocation(oMySpeaker, "dmfi_univ_location"); + +int dmwand_isnearbydestroyable() +{ + object oMyTest = GetFirstObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL); + int nTargetType = GetObjectType(oMyTest); + return (GetIsObjectValid(oMyTest) && (! GetIsPC(oMyTest)) && ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE))); +} + +int dmwand_istargetcreateable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + return ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE)); +} + +int dmwand_istargetdestroyable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + if(! GetIsPC(oMyTarget)) + { + return ((nTargetType == OBJECT_TYPE_ITEM) || (nTargetType == OBJECT_TYPE_PLACEABLE) || (nTargetType == OBJECT_TYPE_CREATURE)); + } + return FALSE; +} + +int dmwand_istargetinvalid() +{ + return !GetIsObjectValid(oMyTarget); +} + +int dmwand_istargetinventory() +{ + return (GetIsObjectValid(oMyTarget) && GetHasInventory(oMyTarget)); +} + +int dmwand_istargetnotme() +{ + return (GetIsObjectValid(oMyTarget) && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetpcornpc() +{ + return (GetIsObjectValid(oMyTarget) && GetAbilityScore(oMyTarget, ABILITY_CONSTITUTION)); +} + +int dmwand_istargetnpc() +{ + return (dmwand_istargetpcornpc() && (! GetIsPC(oMyTarget))); +} + +int dmwand_istargetpc() +{ + return (GetIsObjectValid(oMyTarget) && GetIsPC(oMyTarget)); +} + +int dmwand_istargetpcnme() +{ + return (GetIsObjectValid(oMyTarget) && GetIsPC(oMyTarget) && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetpcornpcnme() +{ + return (dmwand_istargetpcornpc() && (oMySpeaker != oMyTarget)); +} + +int dmwand_istargetplaceable() +{ + if(! GetIsObjectValid(oMyTarget)) { return FALSE; } + + int nTargetType = GetObjectType(oMyTarget); + return (nTargetType == OBJECT_TYPE_PLACEABLE); +} + +int dmw_conv_Start(int nCurrent, int nChoice, string sParams = "") +{ + string sText = ""; + string sCall = ""; + string sCallParams = ""; + + switch(nCurrent) + { + case 0: + nCurrent = 0; + sText = "Welcome to the Server tool: This will allow you to find any player to perform simple functions."; + sCall = ""; + sCallParams = ""; + break; + + case 1: + nCurrent = 1; + if(dmwand_istargetpcnme()) + { + sText = "Penguin this player."; + sCall = "func_Toad"; + sCallParams = ""; + break; + } + case 2: + nCurrent = 2; + if(dmwand_istargetpcnme()) + { + sText = "Unpenguin this player."; + sCall = "func_Untoad"; + sCallParams = ""; + break; + } + case 3: + nCurrent = 3; + if(dmwand_istargetpcnme()) + { + sText = "Boot this player."; + sCall = "func_KickPC"; + sCallParams = ""; + break; + } + + case 4: + nCurrent = 4; + if(dmwand_istargetinvalid()) + { + sText = "List all players..."; + sCall = "conv_ListPlayers"; + sCallParams = "func_PlayerListConv"; + break; + } + + case 5: + nCurrent = 5; + if(dmwand_istargetpcnme()) + { + sText = "Jump this player to my location."; + sCall = "func_JumpPlayerHere"; + sCallParams = ""; + break; + } + case 6: + nCurrent = 6; + if(dmwand_istargetpcnme()) + { + sText = "Jump me to this player's location."; + sCall = "func_JumpToPlayer"; + sCallParams = ""; + break; + } + case 7: + nCurrent = 7; + if(dmwand_istargetpcnme()) + { + sText = "Jump this player's party to my location."; + sCall = "func_JumpPartyHere"; + sCallParams = ""; + break; + } + default: + nCurrent = 0; + sText = ""; + sCall = ""; + sCallParams = ""; + break; + } + + SetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nChoice), sText); + SetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice), sCall); + SetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice), sCallParams); + + return nCurrent; +} + +int dmwand_BuildConversationDialog(int nCurrent, int nChoice, string sConversation, string sParams) +{ + if(TestStringAgainstPattern(sConversation, "Start")) + { + return dmw_conv_Start(nCurrent, nChoice, sParams); + } + return FALSE; +} + +void dmwand_BuildConversation(string sConversation, string sParams) +{ + int nLast; + int nTemp; + int nChoice = 1; + int nCurrent = 1; + int nMatch; + + if(TestStringAgainstPattern(sParams, "prev")) + { + //Get the number choice to start with + nCurrent = GetLocalInt(oMySpeaker, "dmw_dialogprev"); + + //Since we're going to the previous page, there will be a next + SetLocalString(oMySpeaker, "dmw_dialog9", "Next ->"); + SetLocalString(oMySpeaker, "dmw_function9", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params9", "next"); + SetLocalInt(oMySpeaker, "dmw_dialognext", nCurrent); + + nChoice = 8; + for(;nChoice >= 0; nChoice--) + { + int nTemp1 = nCurrent; + int nTemp2 = nCurrent; + nMatch = nTemp2; + while((nCurrent == nMatch) && (nTemp2 > 0)) + { + nTemp2--; + nMatch = dmwand_BuildConversationDialog(nTemp2, nChoice, sConversation, sParams); + } + + if(nTemp2 <= 0) + { + //we went back too far for some reason, so make this choice blank + SetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nChoice), ""); + SetLocalString(oMySpeaker, "dmw_function" + IntToString(nChoice), ""); + SetLocalString(oMySpeaker, "dmw_params" + IntToString(nChoice), ""); + } + nLast = nTemp; + nTemp = nTemp1; + nTemp1 = nMatch; + nCurrent = nMatch; + } + + if(nMatch > 0) + { + SetLocalString(oMySpeaker, "dmw_dialog1", "<- previous"); + SetLocalString(oMySpeaker, "dmw_function1", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params1", "prev"); + SetLocalInt(oMySpeaker, "dmw_dialogprev", nLast); + } + + //fill the NPC's dialog spot + //(saved for last because the build process tromps on it) + dmwand_BuildConversationDialog(0, 0, sConversation, sParams); + } + else + { + //fill the NPC's dialog spot + dmwand_BuildConversationDialog(0, 0, sConversation, sParams); + + //No parameters specified, start at the top of the conversation + if(sParams == "") + { + nChoice = 1; + nCurrent = 1; + } + + //A "next->" choice was selected + if(TestStringAgainstPattern(sParams, "next")) + { + //get the number choice to start with + nCurrent = GetLocalInt(oMySpeaker, "dmw_dialognext"); + + //set this as the number for the "previous" choice to use + SetLocalInt(oMySpeaker, "dmw_dialogprev", nCurrent); + + //Set the first dialog choice to be "previous" + nChoice = 2; + SetLocalString(oMySpeaker, "dmw_dialog1", "<- Previous"); + SetLocalString(oMySpeaker, "dmw_function1", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params1", "prev"); + } + + //Loop through to build the dialog list + for(;nChoice <= 10; nChoice++) + { + nMatch = dmwand_BuildConversationDialog(nCurrent, nChoice, sConversation, sParams); + //nLast will be the value of the choice before the last one + nLast = nTemp; + nTemp = nMatch; + if(nMatch > 0) { nCurrent = nMatch; } + if(nMatch == 0) { nLast = 0; } + nCurrent++; + } + + //If there were enough choices to fill 10 spots, make spot 9 a "next" + if(nLast > 0) + { + SetLocalString(oMySpeaker, "dmw_dialog9", "Next ->"); + SetLocalString(oMySpeaker, "dmw_function9", "conv_" + sConversation); + SetLocalString(oMySpeaker, "dmw_params9", "next"); + SetLocalInt(oMySpeaker, "dmw_dialognext", nLast); + } + } +} + +void dmwand_StartConversation() +{ + if(! GetIsObjectValid(oMySpeaker)) + { + return; + } + + dmwand_BuildConversation("Start", ""); +} + +int StartingConditional() +{ + object oPC = GetPCSpeaker(); + int nMyNum = 0; + + DeleteLocalInt(oPC, "Tens"); + DeleteLocalInt(oPC, "dmfi_univ_offset"); + SetLocalInt(OBJECT_SELF, "dmfi_dmwOffset", 1); + //Check whether this conversation has been started already, start it if not. + int nStarted = GetLocalInt(oMySpeaker, "dmw_started"); + if(! nStarted) + { + SetLocalInt(oMySpeaker, "dmw_started", 1); + dmwand_StartConversation(); + } + + string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum)); + + if(sMyString == "") + { + return FALSE; + } + else if (GetLocalString(oPC, "dmfi_univ_conv") == "server") + { + SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString); + return TRUE; + } + else + return FALSE; +} diff --git a/nwnds_module/dmfi_univ_listen.ncs b/nwnds_module/dmfi_univ_listen.ncs new file mode 100644 index 000000000..2b136fd74 Binary files /dev/null and b/nwnds_module/dmfi_univ_listen.ncs differ diff --git a/nwnds_module/dmfi_univ_listen.nss b/nwnds_module/dmfi_univ_listen.nss new file mode 100644 index 000000000..c1f928a4b --- /dev/null +++ b/nwnds_module/dmfi_univ_listen.nss @@ -0,0 +1,115 @@ + +// dmfi_univ_listen + +// template: dmfi_getln_cbtpl +// triggered from OnPlayerChat callback + +#include "dmfi_db_inc" + +void main() +{ + int nVolume = GetPCChatVolume(); + object oShouter = GetPCChatSpeaker(); + string sSaid = GetPCChatMessage(); + +// SendMessageToPC(GetFirstPC(), "ENTER dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid); + // first, lets deal with a getln event + string getln_mode = GetLocalString(OBJECT_SELF, "dmfi_getln_mode"); + if (getln_mode == "name") + { + if (sSaid != ".") + { + object oTarget = GetLocalObject(oShouter, "dmfi_univ_target"); + SetName(oTarget, sSaid); + } + DeleteLocalString(OBJECT_SELF, "dmfi_getln_mode"); + } + else if (getln_mode == "desc") + { + if (sSaid != ".") + { + object oTarget = GetLocalObject(oShouter, "dmfi_univ_target"); + SetDescription(oTarget, sSaid); + } + DeleteLocalString(OBJECT_SELF, "dmfi_getln_mode"); + } + else + { + // you may wish to define an "abort" input message, such as a line + // containing a single period: + if (sSaid != ".") + { + // put your code here to process the input line (in sSaid) + + if (GetIsDM(oShouter)) SetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter), 1); + if (GetIsDMPossessed(oShouter)) SetLocalObject(GetMaster(oShouter), "dmfi_familiar", oShouter); + + object oTarget = GetLocalObject(oShouter, "dmfi_VoiceTarget"); + object oMaster = OBJECT_INVALID; + if (GetIsObjectValid(oTarget)) oMaster = oShouter; + + int iPhrase = GetLocalInt(oShouter, "hls_EditPhrase"); + + object oSummon; + + if (GetIsObjectValid(oShouter) && GetIsDM(oShouter)) + { + if (GetTag(OBJECT_SELF) == "dmfi_setting" && GetLocalString(oShouter, "EffectSetting") != "") + { + string sPhrase = GetLocalString(oShouter, "EffectSetting"); + SetLocalFloat(oShouter, sPhrase, StringToFloat(sSaid)); + SetDMFIPersistentFloat("dmfi", sPhrase, StringToFloat(sSaid), oShouter); + DeleteLocalString(oShouter, "EffectSetting"); + DelayCommand(0.5, ActionSpeakString("The setting " + sPhrase + " has been changed to " + FloatToString(GetLocalFloat(oShouter, sPhrase)))); + DelayCommand(1.5, DestroyObject(OBJECT_SELF)); + } + } + + if (GetIsObjectValid(oShouter) && GetIsPC(oShouter)) + { + if (sSaid != GetLocalString(GetModule(), "hls_voicebuffer")) + { + SetLocalString(GetModule(), "hls_voicebuffer", sSaid); + + // PrintString(""+GetName(GetArea(oShouter))+ " " + GetName(oShouter) + ": " + sSaid + " "); + + // if the phrase begins with .MyName, reparse the string as a voice throw + if (GetStringLeft(sSaid, GetStringLength("." + GetName(OBJECT_SELF))) == "." + GetName(OBJECT_SELF) && + (GetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter)) || + GetIsDM(oShouter) || GetIsDMPossessed(oShouter))) + { + oTarget = OBJECT_SELF; + sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - GetStringLength("." + GetName(OBJECT_SELF))); + if (GetStringLeft(sSaid, 1) == " ") sSaid = GetStringRight(sSaid, GetStringLength(sSaid) - 1); + sSaid = ":" + sSaid; + SetPCChatMessage(sSaid); +// SendMessageToPC(GetFirstPC(), "LEAVE(1) dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid); + return; // must bail out here to prevent clearing of message at end + } + + if (iPhrase) + { + if (iPhrase > 0) + { + SetCustomToken(iPhrase, sSaid); + SetDMFIPersistentString("dmfi", "hls" + IntToString(iPhrase), sSaid); + FloatingTextStringOnCreature("Phrase " + IntToString(iPhrase) + " has been recorded", oShouter, FALSE); + } + else if (iPhrase < 0) + { + + } + DeleteLocalInt(oShouter, "hls_EditPhrase"); + } + } + } + } + } + + // after processing, you will likely want to "eat" the text line, so it is + // not spoken or available for further processing + SetPCChatMessage(""); + +// SendMessageToPC(GetFirstPC(), "LEAVE(2) dmfi_univ_listen: speaker=" + GetName(oShouter) + ", channel=" + IntToString(nVolume) + ", said=" + sSaid); + +} diff --git a/nwnds_module/dmfi_universal.dlg b/nwnds_module/dmfi_universal.dlg new file mode 100644 index 000000000..1c11deddf Binary files /dev/null and b/nwnds_module/dmfi_universal.dlg differ diff --git a/nwnds_module/dmfi_voice.utc b/nwnds_module/dmfi_voice.utc new file mode 100644 index 000000000..22e2ae70d Binary files /dev/null and b/nwnds_module/dmfi_voice.utc differ diff --git a/nwnds_module/dmfi_voice.uti b/nwnds_module/dmfi_voice.uti new file mode 100644 index 000000000..f88319530 Binary files /dev/null and b/nwnds_module/dmfi_voice.uti differ diff --git a/nwnds_module/dmfi_voice1.ncs b/nwnds_module/dmfi_voice1.ncs new file mode 100644 index 000000000..4c8372e9b Binary files /dev/null and b/nwnds_module/dmfi_voice1.ncs differ diff --git a/nwnds_module/dmfi_voice1.nss b/nwnds_module/dmfi_voice1.nss new file mode 100644 index 000000000..6aa2b0f68 --- /dev/null +++ b/nwnds_module/dmfi_voice1.nss @@ -0,0 +1,65 @@ +//:://///////////////////////////////////////////// +//:: Default On Heartbeat +//:: NW_C2_DEFAULT1 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This script will have people perform default + animations. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 23, 2001 +//::////////////////////////////////////////////// +#include "dmfi_db_inc" + +void main() +{ + object oFollow = GetLocalObject(OBJECT_SELF, "dmfi_follow"); + int iLoiter = GetLocalInt(OBJECT_SELF, "dmfi_Loiter"); + + // Will fire ONE time only - makes the thing hard to see + if (!GetLocalInt(OBJECT_SELF, "hls_invis")) + { + SetListenPattern(OBJECT_SELF, "**", LISTEN_PATTERN); //listen to all text + SetLocalInt(OBJECT_SELF, "hls_Listening", 1); //listen to all text + SetListening(OBJECT_SELF, TRUE); //be sure NPC is listening + + //leave it here rather than add the one time loop to EVERY creature through a OS script change + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), OBJECT_SELF); + SetLocalInt(OBJECT_SELF, "hls_invis",1); + } + + if (GetIsObjectValid(oFollow)) + { + if (GetArea(oFollow)==GetArea(OBJECT_SELF)) + { + AssignCommand(OBJECT_SELF, ClearAllActions(TRUE)); + AssignCommand(OBJECT_SELF, ActionForceFollowObject(oFollow)); + } + else + { + AssignCommand(OBJECT_SELF, ClearAllActions(TRUE)); + AssignCommand(OBJECT_SELF, ActionJumpToObject(oFollow)); + AssignCommand(OBJECT_SELF, ActionForceFollowObject(oFollow)); + } + } + // If just following and listening, then return. + if (!iLoiter) + return; + + // If in loiter mode, look for a PC and make the announcement when appropraite + object oPC = GetFirstObjectInShape(SHAPE_SPHERE, 10.0f, GetLocation(OBJECT_SELF), TRUE); + while(GetIsObjectValid(oPC)) + { + if (GetIsPC(oPC) && + !GetIsDM(oPC) && + iLoiter) + { + SpeakString(GetLocalString(OBJECT_SELF, "dmfi_LoiterSay")); + DestroyObject(OBJECT_SELF); + } + oPC = GetNextObjectInShape(SHAPE_SPHERE, 10.0f, GetLocation(OBJECT_SELF), TRUE); + } +} diff --git a/nwnds_module/dmfi_voice_exe.ncs b/nwnds_module/dmfi_voice_exe.ncs new file mode 100644 index 000000000..74f190ec8 Binary files /dev/null and b/nwnds_module/dmfi_voice_exe.ncs differ diff --git a/nwnds_module/dmfi_voice_exe.nss b/nwnds_module/dmfi_voice_exe.nss new file mode 100644 index 000000000..d4b637786 --- /dev/null +++ b/nwnds_module/dmfi_voice_exe.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: DMFI - settings voice command handler +//:: dmfi_voice_exe +//::////////////////////////////////////////////// +/* + Processor for the text heard by the settings adjuster creature. +*/ +//::////////////////////////////////////////////// +//:: Created By: The DMFI Team +//:: Created On: +//::////////////////////////////////////////////// +//:: 2008.08.02 tsunami282 - most code transferred to dmfi_plychat_exe, this +//:: script now used for processing what the Settings Adjuster creature hears. + +#include "dmfi_db_inc" + +void main() +{ + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + + if (GetIsDM(oShouter)) + SetLocalInt(GetModule(), "dmfi_Admin" + GetPCPublicCDKey(oShouter), 1); + + if (GetIsDMPossessed(oShouter)) + SetLocalObject(GetMaster(oShouter), "dmfi_familiar", oShouter); + + object oTarget = GetLocalObject(oShouter, "dmfi_VoiceTarget"); + object oMaster = OBJECT_INVALID; + if (GetIsObjectValid(oTarget)) + oMaster = oShouter; + + int iPhrase = GetLocalInt(oShouter, "hls_EditPhrase"); + + object oSummon; + + if (nMatch == LISTEN_PATTERN && GetIsObjectValid(oShouter) && GetIsDM(oShouter)) + { + string sSaid = GetMatchedSubstring(0); + + if (GetTag(OBJECT_SELF) == "dmfi_setting" && GetLocalString(oShouter, "EffectSetting") != "") + { + string sPhrase = GetLocalString(oShouter, "EffectSetting"); + SetLocalFloat(oShouter, sPhrase, StringToFloat(sSaid)); + SetDMFIPersistentFloat("dmfi", sPhrase, StringToFloat(sSaid), oShouter); + DeleteLocalString(oShouter, "EffectSetting"); + DelayCommand(0.5, ActionSpeakString("The setting " + sPhrase + " has been changed to " + FloatToString(GetLocalFloat(oShouter, sPhrase)))); + DelayCommand(1.5, DestroyObject(OBJECT_SELF)); + //maybe add a return here + } + } +} + diff --git a/nwnds_module/dmfi_voicewidget.uti b/nwnds_module/dmfi_voicewidget.uti new file mode 100644 index 000000000..b160a7b96 Binary files /dev/null and b/nwnds_module/dmfi_voicewidget.uti differ diff --git a/nwnds_module/dmfi_x_afflict.ncs b/nwnds_module/dmfi_x_afflict.ncs new file mode 100644 index 000000000..7884102ba Binary files /dev/null and b/nwnds_module/dmfi_x_afflict.ncs differ diff --git a/nwnds_module/dmfi_x_afflict.nss b/nwnds_module/dmfi_x_afflict.nss new file mode 100644 index 000000000..85ce123a8 --- /dev/null +++ b/nwnds_module/dmfi_x_afflict.nss @@ -0,0 +1,377 @@ +#include "dmfi_db_inc" + + +object DMFI_NextTarget(object oTarget, object oUser) +{ + object oNew; + + if (GetIsPC(oTarget)) + { + if (GetIsObjectValid(GetNextFactionMember(oTarget))) + oNew = GetNextFactionMember(oTarget); + else + oNew = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 1); + } + else + oNew = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, oTarget, 1); + + + if (!GetIsObjectValid(oNew)) + { + SendMessageToPC(oUser, "No valid target to transfer to."); + oNew = oTarget; + } + + SetLocalObject(oUser, "dmfi_univ_target", oNew); + SetCustomToken(20680, GetName(oNew)); + FloatingTextStringOnCreature("Target changed to: "+ GetName(oNew), oUser); + return oNew; +} + +//DMFI Creates the "settings" creature +void CreateSetting(object oUser) +{ + object oSetting = CreateObject(OBJECT_TYPE_CREATURE, "dmfi_setting", GetLocation(oUser)); + DelayCommand(0.5f, AssignCommand(oSetting, ActionSpeakString(GetLocalString(oUser, "EffectSetting") + " is currently set at " + FloatToString(GetLocalFloat(oUser, GetLocalString(oUser, "EffectSetting")))))); + SetLocalObject(oSetting, "MyMaster", oUser); + SetListenPattern(oSetting, "**", LISTEN_PATTERN); //listen to all text + SetLocalInt(oSetting, "hls_Listening", 1); //listen to all text + SetListening(oSetting, TRUE); //be sure NPC is listening +} + +//This function is for the DMFI Affliction Wand +void ReportImmunity(object oT, object oUser) +{ + SendMessageToPC(oUser, "Immunities Reported: (blank if none)"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ABILITY_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Ability Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_AC_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE AC Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ATTACK_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Attack Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_BLINDNESS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Blindness"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CHARM)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Charm"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CONFUSED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Confusion"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CRITICAL_HIT)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Critical Hit"); + if (GetIsImmune(oT, IMMUNITY_TYPE_CURSED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Cursed"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAMAGE_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Damage Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAMAGE_IMMUNITY_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Damage Immunity Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DAZED)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Dazed"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DEAFNESS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Deafness"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DEATH)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Death"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DISEASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Disease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_DOMINATE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Dominate"); + if (GetIsImmune(oT, IMMUNITY_TYPE_ENTANGLE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Entangle"); + if (GetIsImmune(oT, IMMUNITY_TYPE_FEAR)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Fear"); + if (GetIsImmune(oT, IMMUNITY_TYPE_KNOCKDOWN)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Knockdown"); + if (GetIsImmune(oT, IMMUNITY_TYPE_MIND_SPELLS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Mind Spells"); + if (GetIsImmune(oT, IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Movement Speed Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_NEGATIVE_LEVEL)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Negative Level"); + if (GetIsImmune(oT, IMMUNITY_TYPE_PARALYSIS)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Paralysis"); + if (GetIsImmune(oT, IMMUNITY_TYPE_POISON)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Poison"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SAVING_THROW_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Saving Throw Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SILENCE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Silence"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SKILL_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Skill Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SLEEP)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Sleep"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SLOW)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Slow"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SNEAK_ATTACK)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Sneak Attack"); + if (GetIsImmune(oT, IMMUNITY_TYPE_SPELL_RESISTANCE_DECREASE)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Spell Resistance Decrease"); + if (GetIsImmune(oT, IMMUNITY_TYPE_STUN)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Stun"); + if (GetIsImmune(oT, IMMUNITY_TYPE_TRAP)) + SendMessageToPC(oUser, GetName(oT) + " IMMUNE Trap"); +} + +void CheckForEffect(effect eA, object oT, object oUser) +{ + int Result = FALSE; + effect Check = GetFirstEffect(oT); + + while (GetIsEffectValid(Check)) + { + if (Check == eA) + Result = TRUE; + + Check = GetNextEffect(oT); + } + if (Result) + FloatingTextStringOnCreature("Affliction Wand Saving Throw Failure: " + GetName(oT), oUser); + else + FloatingTextStringOnCreature("Affliction Wand Saving Throw Success: No Effect: " + GetName(oT), oUser); +} + +void main() +{ + int iAfflict = GetLocalInt(OBJECT_SELF, "dmfi_univ_int"); + object oUser = OBJECT_SELF; + effect eEffect; + object oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + float fDuration; + int nDNum; + effect eD; + effect eA; + effect eT; + effect eVis; + int nBug = 0; + int nSaveAmount; float fSaveAmount; + + nDNum = GetLocalInt(oUser, "dmfi_damagemodifier"); + fDuration = GetLocalFloat(oUser, "dmfi_stunduration"); + fSaveAmount = GetLocalFloat(oUser, "dmfi_saveamount"); + + nSaveAmount = FloatToInt(fSaveAmount); + + if (!(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE) || + GetIsDM(oTarget)) + { + FloatingTextStringOnCreature("You must target a valid creature!", oUser, FALSE); + return; + } + switch(iAfflict) + { + case 11: eD= EffectDamage(d4(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 12: eD = EffectDamage(d6(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 13: eD = EffectDamage(d8(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 14: eD = EffectDamage(d10(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 15: eD = EffectDamage(d12(nDNum), DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL); break; + case 16: eD = EffectDamage(GetCurrentHitPoints(oTarget)/4, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 17: eD = EffectDamage(GetCurrentHitPoints(oTarget)/2, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis = EffectVisualEffect(VFX_COM_BLOOD_LRG_RED); break; + case 18: eD = EffectDamage(GetCurrentHitPoints(oTarget) * 3 / 4, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis =EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); break; + case 19: eD = EffectDamage(GetCurrentHitPoints(oTarget)-1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + eVis =EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); break; + case 21: eA =EffectDisease(DISEASE_FILTH_FEVER); break; + case 22: eA =EffectDisease(DISEASE_MINDFIRE); break; + case 23: eA =EffectDisease(DISEASE_DREAD_BLISTERS); break; + case 24: eA =EffectDisease(DISEASE_SHAKES); break; + case 25: eA =EffectDisease(DISEASE_VERMIN_MADNESS); break; + case 26: eA =EffectDisease(DISEASE_DEVIL_CHILLS); break; + case 27: eA =EffectDisease(DISEASE_SLIMY_DOOM); break; + case 28: eA =EffectDisease(DISEASE_RED_ACHE); break; + case 29: eA =EffectDisease(DISEASE_ZOMBIE_CREEP); break; + case 31: eA =EffectDisease(DISEASE_BLINDING_SICKNESS); break; + case 32: eA =EffectDisease(DISEASE_CACKLE_FEVER); break; + case 33: eA =EffectDisease(DISEASE_BURROW_MAGGOTS); break; + case 34: eA =EffectDisease(DISEASE_RED_SLAAD_EGGS); break; + case 35: eA =EffectDisease(DISEASE_DEMON_FEVER); break; + case 36: eA =EffectDisease(DISEASE_GHOUL_ROT); break; + case 37: eA =EffectDisease(DISEASE_MUMMY_ROT); break; + case 38: eA =EffectDisease(DISEASE_SOLDIER_SHAKES); break; + case 39: eA =EffectDisease(DISEASE_SOLDIER_SHAKES); break; + case 41: eA =EffectPoison(POISON_TINY_SPIDER_VENOM); break; + case 42: eA =EffectPoison(POISON_ARANEA_VENOM); break; + case 43: eA =EffectPoison(POISON_MEDIUM_SPIDER_VENOM); break; + case 44: eA = EffectPoison(POISON_CARRION_CRAWLER_BRAIN_JUICE); break; + case 45: eA = EffectPoison(POISON_OIL_OF_TAGGIT); break; + case 46: eA = EffectPoison(POISON_ARSENIC); break; + case 47: eA = EffectPoison(POISON_GREENBLOOD_OIL); break; + case 48: eA = EffectPoison(POISON_NITHARIT); break; + case 49: eA = EffectPoison(POISON_PHASE_SPIDER_VENOM); break; + case 51: eA = EffectPoison(POISON_LICH_DUST); break; + case 52: eA = EffectPoison(POISON_SHADOW_ESSENCE); break; + case 53: eA = EffectPoison(POISON_LARGE_SPIDER_VENOM); break; + case 54: eA = EffectPoison(POISON_PURPLE_WORM_POISON); break; + case 55: eA = EffectPoison(POISON_IRON_GOLEM); break; + case 56: eA = EffectPoison(POISON_PIT_FIEND_ICHOR); break; + case 57: eA = EffectPoison(POISON_WYVERN_POISON); break; + case 58: eA = EffectPoison(POISON_BLACK_LOTUS_EXTRACT); break; + case 59: eA = EffectPoison(POISON_GARGANTUAN_SPIDER_VENOM); break; + case 60: eT = EffectPetrify(); break; + case 61: eT = EffectBlindness(); break; + case 62: eT = EffectCurse(4,4,4,4,4,4); break; + case 63: eT = EffectFrightened(); break; + case 64: eT = EffectStunned(); break; + case 65: eT = EffectSilence(); break; + case 66: eT = EffectSleep(); break; + case 67: eT = EffectSlow(); break; + case 68: eT = EffectKnockdown(); nBug = 1; break; + case 69: eD = EffectDamage( GetCurrentHitPoints(oTarget)-1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL); + AssignCommand( oTarget, ClearAllActions()); + AssignCommand( oTarget, ActionPlayAnimation( ANIMATION_LOOPING_DEAD_FRONT, 1.0, 99999.0)); + DelayCommand(0.5, SetCommandable( FALSE, oTarget)); break; + case 71: eA = EffectCutsceneDominated();break; + case 72: eA = EffectCutsceneGhost(); break; + case 73: eA = EffectCutsceneImmobilize(); break; + case 74: eA = EffectCutsceneParalyze(); break; + case 75: nBug = -1; break; //special case for combo death effect + case 81: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_POISON) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 82: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_DISEASE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 83: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_BLINDNESS) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 84: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_CURSE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 85: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_FRIGHTENED) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 86: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_STUNNED) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 87: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_SILENCE) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 88: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break; + case 89: SetCommandable(TRUE, oTarget); + AssignCommand(oTarget, ClearAllActions()); break; + case 80: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if (GetEffectType(eEffect) == EFFECT_TYPE_PETRIFY) RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break;//Added July 5, 2003 + +// 99 is a duplicate instance - simple copy. - Demetrious + case 91: SetLocalString(oUser, "EffectSetting", "dmfi_stunduration"); + CreateSetting(oUser); + case 92: SetDMFIPersistentInt("dmfi", "DamageModifier", nDNum+1); SetCustomToken(20780, IntToString(nDNum+1));; break; + case 93: + if (nDNum==1) + { + FloatingTextStringOnCreature("Illegal operation: Minimum modifier is 1.", oUser); + break; + } + else + { + SetDMFIPersistentInt("dmfi", "DamageModifier", nDNum-1); SetCustomToken(20780, IntToString(nDNum-1)); ;break; + break; + } + case 94: ReportImmunity(oTarget, oUser); break; + case 95: DMFI_NextTarget(oTarget, oUser); break; + case 99: SetLocalString(oUser, "EffectSetting", "SaveEffectAmount"); + CreateSetting(oUser); break; + case 101: eT = EffectSavingThrowDecrease(SAVING_THROW_FORT, nSaveAmount); break; + case 102: eT = EffectSavingThrowDecrease(SAVING_THROW_REFLEX, nSaveAmount); break; + case 103: eT = EffectSavingThrowDecrease(SAVING_THROW_WILL, nSaveAmount); break; + case 104: eT = EffectSavingThrowIncrease(SAVING_THROW_FORT, nSaveAmount); break; + case 105: eT = EffectSavingThrowIncrease(SAVING_THROW_REFLEX, nSaveAmount); break; + case 106: eT = EffectSavingThrowIncrease(SAVING_THROW_WILL, nSaveAmount); break; + case 107: eT = EffectSavingThrowDecrease(SAVING_THROW_ALL, nSaveAmount); break; + case 108: eT = EffectSavingThrowIncrease(SAVING_THROW_ALL, nSaveAmount); break; + case 109: SetLocalString(oUser, "EffectSetting", "SaveEffectAmount"); + CreateSetting(oUser); + case 100: eEffect = GetFirstEffect(oTarget); + while (GetIsEffectValid(eEffect)) + { + if ((GetEffectType(eEffect) == EFFECT_TYPE_SAVING_THROW_INCREASE) + ||(GetEffectType(eEffect) == EFFECT_TYPE_SAVING_THROW_DECREASE)) + RemoveEffect(oTarget, eEffect); + eEffect = GetNextEffect(oTarget); + } break;//Added July 5, 2003 + + + + default: break; + } +//code down here to apply the effects an then go back and see if the +//player successfully saved or did not for the diseases and poisons. + + if ((GetEffectType(eD)!= EFFECT_TYPE_INVALIDEFFECT) || + (GetEffectType(eVis) != EFFECT_TYPE_INVALIDEFFECT)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eD, oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, oTarget); + return; + } + if (GetEffectType(eA)!= EFFECT_TYPE_INVALIDEFFECT) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eA, oTarget); + DelayCommand(5.0, CheckForEffect(eA, oTarget, oUser)); + return; + } + if ((GetEffectType(eT)!= EFFECT_TYPE_INVALIDEFFECT) || (nBug ==1)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eT, oTarget, fDuration); + + if ((GetEffectType(eT)==EFFECT_TYPE_SAVING_THROW_INCREASE) || + (GetEffectType(eT)==EFFECT_TYPE_SAVING_THROW_DECREASE)) + { + DelayCommand(1.0, FloatingTextStringOnCreature("Target Saves: Fortitude " + IntToString(GetFortitudeSavingThrow(oTarget)) + + " Reflex " + IntToString(GetReflexSavingThrow(oTarget)) + " Will " + IntToString(GetWillSavingThrow(oTarget)), oUser)); + } + return; + } + if (nBug == -1) + { + object oFollowMe = GetFirstFactionMember(oTarget, TRUE); + + if (!GetIsObjectValid(oFollowMe)) + oFollowMe = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 1,CREATURE_TYPE_IS_ALIVE, TRUE); + + if (GetIsDM(oFollowMe) || GetIsDMPossessed(oFollowMe)) + oFollowMe = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oTarget, 2,CREATURE_TYPE_IS_ALIVE, TRUE); + + if (!GetIsObjectValid(oFollowMe)) + oFollowMe = oUser; + + AssignCommand(oFollowMe, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneDominated(), oTarget)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget); + } + + return; +} diff --git a/nwnds_module/dmfi_x_emote.ncs b/nwnds_module/dmfi_x_emote.ncs new file mode 100644 index 000000000..f71299efa Binary files /dev/null and b/nwnds_module/dmfi_x_emote.ncs differ diff --git a/nwnds_module/dmfi_x_emote.nss b/nwnds_module/dmfi_x_emote.nss new file mode 100644 index 000000000..3b0c69f69 --- /dev/null +++ b/nwnds_module/dmfi_x_emote.nss @@ -0,0 +1,218 @@ +//Smoking Function by Jason Robinson +location GetLocationAboveAndInFrontOf(object oPC, float fDist, float fHeight) +{ + float fDistance = -fDist; + object oTarget = (oPC); + object oArea = GetArea(oTarget); + vector vPosition = GetPosition(oTarget); + vPosition.z += fHeight; + float fOrientation = GetFacing(oTarget); + vector vNewPos = AngleToVector(fOrientation); + float vZ = vPosition.z; + float vX = vPosition.x - fDistance * vNewPos.x; + float vY = vPosition.y - fDistance * vNewPos.y; + fOrientation = GetFacing(oTarget); + vX = vPosition.x - fDistance * vNewPos.x; + vY = vPosition.y - fDistance * vNewPos.y; + vNewPos = AngleToVector(fOrientation); + vZ = vPosition.z; + vNewPos = Vector(vX, vY, vZ); + return Location(oArea, vNewPos, fOrientation); +} + +//Smoking Function by Jason Robinson +void SmokePipe(object oActivator) +{ + string sEmote1 = "*puffs on a pipe*"; + string sEmote2 = "*inhales from a pipe*"; + string sEmote3 = "*pulls a mouthful of smoke from a pipe*"; + float fHeight = 1.7; + float fDistance = 0.1; + // Set height based on race and gender + if (GetGender(oActivator) == GENDER_MALE) + { + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.7; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.55; fDistance = 0.08; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.15; fDistance = 0.12; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.12; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.9; fDistance = 0.2; break; + } + } + else + { + // FEMALES + switch (GetRacialType(oActivator)) + { + case RACIAL_TYPE_HUMAN: + case RACIAL_TYPE_HALFELF: fHeight = 1.6; fDistance = 0.12; break; + case RACIAL_TYPE_ELF: fHeight = 1.45; fDistance = 0.12; break; + case RACIAL_TYPE_GNOME: + case RACIAL_TYPE_HALFLING: fHeight = 1.1; fDistance = 0.075; break; + case RACIAL_TYPE_DWARF: fHeight = 1.2; fDistance = 0.1; break; + case RACIAL_TYPE_HALFORC: fHeight = 1.8; fDistance = 0.13; break; + } + } + location lAboveHead = GetLocationAboveAndInFrontOf(oActivator, fDistance, fHeight); + // emotes + switch (d3()) + { + case 1: AssignCommand(oActivator, ActionSpeakString(sEmote1)); break; + case 2: AssignCommand(oActivator, ActionSpeakString(sEmote2)); break; + case 3: AssignCommand(oActivator, ActionSpeakString(sEmote3));break; + } + // glow red + AssignCommand(oActivator, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_5), oActivator, 0.15))); + // wait a moment + AssignCommand(oActivator, ActionWait(3.0)); + // puff of smoke above and in front of head + AssignCommand(oActivator, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), lAboveHead))); + // if female, turn head to left + if ((GetGender(oActivator) == GENDER_FEMALE) && (GetRacialType(oActivator) != RACIAL_TYPE_DWARF)) + AssignCommand(oActivator, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.0, 5.0)); +} + +void EmoteDance(object oPC) +{ + object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC); + object oLeftHand = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC); + + AssignCommand(oPC,ActionUnequipItem(oRightHand)); + AssignCommand(oPC,ActionUnequipItem(oLeftHand)); + + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_FORCEFUL,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 2.0, 2.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1,1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3,2.0)); + AssignCommand(oPC,ActionDoCommand(PlayVoiceChat(VOICE_CHAT_LAUGH,oPC))); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 1.0)); + AssignCommand(oPC,ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2,1.0)); + + AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oLeftHand,INVENTORY_SLOT_LEFTHAND))); + AssignCommand(oPC,ActionDoCommand(ActionEquipItem(oRightHand,INVENTORY_SLOT_RIGHTHAND))); +} + +void SitInNearestChair(object oPC) +{ + object oSit,oRightHand,oLeftHand,oChair,oCouch,oBenchPew,oStool; + float fDistSit;int nth; + // get the closest chair, couch bench or stool + nth = 1;oChair = GetNearestObjectByTag("Chair", oPC,nth); + while(oChair != OBJECT_INVALID && GetSittingCreature(oChair) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("Chair", oPC,nth);} + + nth = 1;oCouch = GetNearestObjectByTag("Couch", oPC,nth); + while(oCouch != OBJECT_INVALID && GetSittingCreature(oCouch) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("Couch", oPC,nth);} + + nth = 1;oBenchPew = GetNearestObjectByTag("BenchPew", oPC,nth); + while(oBenchPew != OBJECT_INVALID && GetSittingCreature(oBenchPew) != OBJECT_INVALID) + {nth++;oChair = GetNearestObjectByTag("BenchPew", oPC,nth);} + /* 1.27 bug + nth = 1;oStool = GetNearestObjectByTag("Stool", oPC,nth); + while(oStool != OBJECT_INVALID && GetSittingCreature(oStool) != OBJECT_INVALID) + {nth++;oStool = GetNearestObjectByTag("Stool", oPC,nth);} + */ + // get the distance between the user and each object (-1.0 is the result if no + // object is found + float fDistanceChair = GetDistanceToObject(oChair); + float fDistanceBench = GetDistanceToObject(oBenchPew); + float fDistanceCouch = GetDistanceToObject(oCouch); + float fDistanceStool = GetDistanceToObject(oStool); + + // if any of the objects are invalid (not there), change the return value + // to a high number so the distance math can work + if (fDistanceChair == -1.0) + {fDistanceChair =1000.0;} + + if (fDistanceBench == -1.0) + {fDistanceBench = 1000.0;} + + if (fDistanceCouch == -1.0) + {fDistanceCouch = 1000.0;} + + if (fDistanceStool == -1.0) + {fDistanceStool = 1000.0;} + + // find out which object is closest to the PC + if (fDistanceChair2.0) FloatingTextStringOnCreature("Delay effect created", oUser, FALSE); + DelayCommand( fDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iVFX),lEffect)); +} + +void main() +{ + int iDayMusic, iNightMusic, iBattleMusic; + int iEffect = GetLocalInt(OBJECT_SELF, "dmfi_univ_int"); + location lEffect = GetLocalLocation(OBJECT_SELF, "dmfi_univ_location"); + object oUser = OBJECT_SELF; + float fDelay; + float fDuration; + float fBeamDuration; + object oTarget; + + fDelay = GetLocalFloat(oUser, "dmfi_effectdelay"); + fDuration = GetLocalFloat(oUser, "dmfi_effectduration"); + fBeamDuration = GetLocalFloat(oUser, "dmfi_beamduration"); + + if (!GetIsObjectValid(GetLocalObject(oUser, "dmfi_univ_target"))) + oTarget = oUser; + else + oTarget = GetLocalObject(oUser, "dmfi_univ_target"); + switch(iEffect) + { + //SoU/HotU Duration Effects(must have a target) + case 101: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_CLENCHED_FIST), oTarget, fDuration); break; + case 102: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_CRUSHING_HAND), oTarget, fDuration); break; + case 103: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_GRASPING_HAND), oTarget, fDuration); break; + case 104: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BIGBYS_INTERPOSING_HAND), oTarget, fDuration); break; + case 105: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ICESKIN), oTarget, fDuration); break; + case 106: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_INFERNO), oTarget, fDuration); break; + case 107: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PIXIEDUST), oTarget, fDuration); break; + case 108: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oTarget, fDuration); break; + case 109: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION), oTarget, fDuration); break; + case 100: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOSTLY_PULSE), oTarget, fDuration); break; + //Magical Duration Effects + case 10: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CALTROPS),lEffect, fDuration); break; + case 11: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_TENTACLE),lEffect, fDuration); break; + case 12: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_WEB_MASS),lEffect, fDuration); break; + case 13: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_MIND,lEffect, fDelay); break; + case 14: FnFEffect(oUser, VFX_FNF_LOS_HOLY_30,lEffect, fDelay); break; + case 15: FnFEffect(oUser, VFX_FNF_LOS_EVIL_30,lEffect, fDelay); break; + case 16: FnFEffect(oUser, VFX_FNF_SMOKE_PUFF,lEffect, fDelay); break; + case 17: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_NATURE,lEffect, fDelay); break; + case 18: FnFEffect(oUser, VFX_FNF_DISPEL_DISJUNCTION,lEffect, fDelay); break; + case 19: FnFEffect(oUser, VFX_FNF_GAS_EXPLOSION_EVIL,lEffect, fDelay); break; + //Magical Status Effects (must have a target) + case 21: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_BARKSKIN), oTarget, fDuration); break; + case 22: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN), oTarget, fDuration); break; + case 23: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ENTANGLE), oTarget, fDuration); break; + case 24: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ETHEREAL_VISAGE), oTarget, fDuration); break; + case 25: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE), oTarget, fDuration); break; + case 26: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_INVISIBILITY), oTarget, fDuration); break; + case 27: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BARD_SONG), oTarget, fDuration); break; + case 28: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY), oTarget, fDuration); break; + case 29: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PARALYZED), oTarget, fDuration); break; + case 20: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR), oTarget, fDuration); break; + //Magical Burst Effects + case 31: FnFEffect(oUser, VFX_FNF_FIREBALL,lEffect, fDelay); break; + case 32: FnFEffect(oUser, VFX_FNF_FIRESTORM,lEffect, fDelay); break; + case 33: FnFEffect(oUser, VFX_FNF_HORRID_WILTING,lEffect, fDelay); break; + case 34: FnFEffect(oUser, VFX_FNF_HOWL_WAR_CRY,lEffect, fDelay); break; + case 35: FnFEffect(oUser, VFX_FNF_IMPLOSION,lEffect, fDelay); break; + case 36: FnFEffect(oUser, VFX_FNF_PWKILL,lEffect, fDelay); break; + case 37: FnFEffect(oUser, VFX_FNF_PWSTUN,lEffect, fDelay); break; + case 38: FnFEffect(oUser, VFX_FNF_SOUND_BURST,lEffect, fDelay); break; + case 39: FnFEffect(oUser, VFX_FNF_STRIKE_HOLY,lEffect, fDelay); break; + case 30: FnFEffect(oUser, VFX_FNF_WORD,lEffect, fDelay); break; + //Lighting Effects + case 41: ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_BLACKOUT),lEffect, fDuration); break; + case 42: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_ANTI_LIGHT_10),oTarget, fDuration); break; + case 43: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_BLUE_20),oTarget, fDuration); break; + case 44: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_GREY_20),oTarget, fDuration); break; + case 45: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_ORANGE_20),oTarget, fDuration); break; + case 46: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_PURPLE_20),oTarget, fDuration); break; + case 47: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_20),oTarget, fDuration); break; + case 48: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20),oTarget, fDuration); break; + case 49: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20),oTarget, fDuration); break; + //Beam Effects + case 50: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_CHAIN, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 51: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_COLD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 52: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_EVIL, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 53: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 54: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE_LASH, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 55: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_HOLY, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 56: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 57: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_MIND, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 58: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_ODD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + case 59: ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_COLD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_EVIL, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_FIRE_LASH, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_HOLY, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_LIGHTNING, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_MIND, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBeam(VFX_BEAM_ODD, oUser, BODY_NODE_CHEST, FALSE), oTarget, fBeamDuration); break; + + //Environmental Effects + case 60: FnFEffect(oUser, VFX_FNF_NATURES_BALANCE,lEffect, fDelay);break; + case 61: FXWand_Lightning(oTarget, lEffect); break; + case 62: FXWand_Firestorm(oTarget); break; + case 63: FXWand_Earthquake(oTarget); break; + case 64: FnFEffect(oUser, VFX_FNF_ICESTORM,lEffect, fDelay); break; + case 65: FnFEffect(oUser, VFX_FNF_SUNBEAM,lEffect, fDelay); break; + case 66: SetWeather(GetArea(oUser), WEATHER_CLEAR); break; + case 67: SetWeather(GetArea(oUser), WEATHER_RAIN); break; + case 68: SetWeather(GetArea(oUser), WEATHER_SNOW); break; + case 69: SetWeather(GetArea(oUser), WEATHER_USE_AREA_SETTINGS); break; + //Summon Effects + case 71: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_1,lEffect, fDelay); break; + case 72: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_2,lEffect, fDelay); break; + case 73: FnFEffect(oUser, VFX_FNF_SUMMON_MONSTER_3,lEffect, fDelay); break; + case 74: FnFEffect(oUser, VFX_FNF_SUMMON_CELESTIAL,lEffect, fDelay); break; + case 75: FnFEffect(oUser, VFX_FNF_SUMMONDRAGON,lEffect, fDelay); break; + case 76: FnFEffect(oUser, VFX_FNF_SUMMON_EPIC_UNDEAD,lEffect, fDelay); break; + case 77: FnFEffect(oUser, VFX_FNF_SUMMON_GATE,lEffect, fDelay); break; + case 78: FnFEffect(oUser, VFX_FNF_SUMMON_UNDEAD,lEffect, fDelay); break; + case 79: FnFEffect(oUser, VFX_FNF_UNDEAD_DRAGON,lEffect, fDelay); break; + case 70: FnFEffect(oUser, VFX_FNF_WAIL_O_BANSHEES,lEffect, fDelay); break; + //SoU/HotU Effects + case 80: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(322), oTarget, fDuration); break; + case 81: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(132), oTarget, fDuration); break; + case 82: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(133), oTarget, fDuration); break; + case 83: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(136), oTarget, fDuration); break; + case 84: ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(137), oTarget, fDuration); break; + case 85: FnFEffect(oUser, VFX_FNF_DEMON_HAND,lEffect, fDelay); break; + case 86: FnFEffect(oUser, VFX_FNF_ELECTRIC_EXPLOSION,lEffect, fDelay); break; + case 87: FnFEffect(oUser, VFX_FNF_GREATER_RUIN,lEffect, fDelay); break; + case 88: FnFEffect(oUser, VFX_FNF_MYSTICAL_EXPLOSION,lEffect, fDelay); break; + case 89: FnFEffect(oUser, VFX_FNF_SWINGING_BLADE,lEffect, fDelay); break; + //Settings + case 91: + SetLocalString(oUser, "EffectSetting", "dmfi_effectduration"); + CreateSetting(oUser); + break; + case 92: + SetLocalString(oUser, "EffectSetting", "dmfi_effectdelay"); + CreateSetting(oUser); + break; + case 93: + SetLocalString(oUser, "EffectSetting", "dmfi_beamduration"); + CreateSetting(oUser); + break; + case 94: //Change Day Music + iDayMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iDayMusic > 33) iDayMusic = 49; + if (iDayMusic > 55) iDayMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeDay(GetArea(oUser), iDayMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 95: //Change Night Music + iNightMusic = MusicBackgroundGetDayTrack(GetArea(oUser)) + 1; + if (iNightMusic > 33) iNightMusic = 49; + if (iNightMusic > 55) iNightMusic = 1; + MusicBackgroundStop(GetArea(oUser)); + MusicBackgroundChangeNight(GetArea(oUser), iNightMusic); + MusicBackgroundPlay(GetArea(oUser)); + break; + case 96: //Play Background Music + MusicBackgroundPlay(GetArea(oUser)); + break; + case 97: //Stop Background Music + MusicBackgroundStop(GetArea(oUser)); + break; + case 98: //Change and Play Battle Music + iBattleMusic = MusicBackgroundGetBattleTrack(GetArea(oUser)) + 1; + if (iBattleMusic < 34 || iBattleMusic > 48) iBattleMusic = 34; + MusicBattleStop(GetArea(oUser)); + MusicBattleChange(GetArea(oUser), iBattleMusic); + MusicBattlePlay(GetArea(oUser)); + break; + case 99: //Stop Battle Music + MusicBattleStop(GetArea(oUser)); + break; + + default: break; + } + DeleteLocalObject(oUser, "EffectTarget"); + return; +} diff --git a/nwnds_module/dmfi_xp.uti b/nwnds_module/dmfi_xp.uti new file mode 100644 index 000000000..384f1c86d Binary files /dev/null and b/nwnds_module/dmfi_xp.uti differ diff --git a/nwnds_module/dog001.utc b/nwnds_module/dog001.utc new file mode 100644 index 000000000..0523063b0 Binary files /dev/null and b/nwnds_module/dog001.utc differ diff --git a/nwnds_module/dog002.utc b/nwnds_module/dog002.utc new file mode 100644 index 000000000..9aa9a35e0 Binary files /dev/null and b/nwnds_module/dog002.utc differ diff --git a/nwnds_module/dog003.utc b/nwnds_module/dog003.utc new file mode 100644 index 000000000..8d0faf6b1 Binary files /dev/null and b/nwnds_module/dog003.utc differ diff --git a/nwnds_module/dog004.utc b/nwnds_module/dog004.utc new file mode 100644 index 000000000..320f5a8f5 Binary files /dev/null and b/nwnds_module/dog004.utc differ diff --git a/nwnds_module/door_agafari001.utd b/nwnds_module/door_agafari001.utd new file mode 100644 index 000000000..1059853b1 Binary files /dev/null and b/nwnds_module/door_agafari001.utd differ diff --git a/nwnds_module/door_area_trans.ncs b/nwnds_module/door_area_trans.ncs new file mode 100644 index 000000000..2efd78c5d Binary files /dev/null and b/nwnds_module/door_area_trans.ncs differ diff --git a/nwnds_module/door_area_trans.nss b/nwnds_module/door_area_trans.nss new file mode 100644 index 000000000..b1e9c33ad --- /dev/null +++ b/nwnds_module/door_area_trans.nss @@ -0,0 +1,102 @@ +//////////////////////////////////////// +/* + Closes door when player transitions + + If the player opens door and does not transition the door + will not close. + + This script doesn't interfere with the Area Transiton Wizard. + +*/ +//////////////////////////////////////// +#include "x0_inc_henai" +void b_FollowMaster(object oMaster); +void main() +{ + object oClicker = GetClickingObject(); + object oSelf = OBJECT_SELF; + object oDest = GetTransitionTarget(OBJECT_SELF); + +if(oDest == OBJECT_INVALID) + { + SendMessageToAllDMs("Door "+GetTag(OBJECT_SELF)+ + " is missing a transition target"); + return; + } + +// Seems the script is firing twice, once for the door actually used +// and once for the transition target +if(GetLocalInt(oClicker,"DoorOnce") == FALSE) +{ + SetLocalInt(oClicker,"DoorOnce",TRUE); + DelayCommand(1.1,DeleteLocalInt(oClicker,"DoorOnce")); + + if(GetIsPC(oClicker)==TRUE) + { + SetLocalInt(oClicker,"PC_USED_DOOR",TRUE); + AssignCommand(oClicker,JumpToObject(oDest)); + + b_FollowMaster(oClicker); + + AssignCommand(oClicker,ActionDoCommand(SignalEvent(oSelf, + EventUserDefined(9006)))); + } + + else // A different script was required for npc's. Go figure. + { + // Allows for npc to perform the door open animation before + // jumping to the destination. Otherwise the npc will still be + // performing the door open animation when he transitions and sometimes + // transitions back to his original location. + DelayCommand(1.0,AssignCommand(oClicker,JumpToObject(oDest))); + + + // When an NPC is chasing a player, he sometimes transitions to an + // area before player does then leaves when he sees + // nothing and\or WalkWaypoints fires. This gives him something else + // to do for a half second (like walk behind the door.. geesh). + DelayCommand(1.2,AssignCommand(oClicker, + ActionMoveAwayFromObject(oDest,FALSE,0.1))); + + // I'm sick of re-writing the bw ai. It's assumed that + // if no enemy is present or the npc is not in combat, + // DetermineCombatRound will do nothing. + DelayCommand(1.2,AssignCommand(oClicker, + ActionDoCommand(DetermineCombatRound()))); + + + DelayCommand(3.0,SignalEvent(oSelf,EventUserDefined(9006))); + + } + +} + +} + +void a_FollowMaster(object oMaster) +{ + float fDist = GetFollowDistance(); + ActionForceFollowObject(oMaster,fDist); + +} + +void b_FollowMaster(object oMaster) +{ + object oAssociate = GetFirstFactionMember(oMaster,FALSE); + while(oAssociate != OBJECT_INVALID) + { + + if(GetAssociateType(oAssociate)!= ASSOCIATE_TYPE_NONE) + { + if(GetAssociateState(NW_ASC_MODE_STAND_GROUND,oAssociate) == TRUE) + {SetAssociateState(NW_ASC_MODE_STAND_GROUND,FALSE,oAssociate);} + + if(oMaster != OBJECT_INVALID) + {AssignCommand(oAssociate,a_FollowMaster(oMaster));} + + } + oAssociate = GetNextFactionMember(oMaster,FALSE); + } +} + + diff --git a/nwnds_module/door_attacked.ncs b/nwnds_module/door_attacked.ncs new file mode 100644 index 000000000..934f294bc Binary files /dev/null and b/nwnds_module/door_attacked.ncs differ diff --git a/nwnds_module/door_attacked.nss b/nwnds_module/door_attacked.nss new file mode 100644 index 000000000..ed22b875e --- /dev/null +++ b/nwnds_module/door_attacked.nss @@ -0,0 +1,71 @@ +///////////////////////////////////////////////// +/* + Summon guard if attacked. + + If the Player attacking the door is in + the line of sight of the Defender he will respond. + This is not the same as a perception event and the + guard may not normally have percieved the action. + + Variables set on the Defender(at spawn in); + int "DEFENDER" 1 + +*/ +///////////////////////////////////////////////// +#include "nw_i0_generic" +void GoHostile(object oPC, object oDefender); +void main() +{ +if(GetLocalInt(OBJECT_SELF,"FoundDefender") == TRUE) + {return;} +else + { + SetLocalInt(OBJECT_SELF,"FoundDefender",TRUE); + + //don't call for help for 5 more rounds + DelayCommand(30.0,DeleteLocalInt(OBJECT_SELF,"FoundDefender")); + + int bDefender; + int nth = 1; + object oDefender = GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nth); + + while(oDefender != OBJECT_INVALID) + { + bDefender = GetLocalInt(oDefender,"DEFENDER"); + + // Am I a defender + if(bDefender == TRUE) + { + if(GetIsInCombat(oDefender) == FALSE) + { + object oPC = GetLastHostileActor(); + if(LineOfSightObject(oDefender,oPC) == TRUE) + { + vector vFacing = GetPosition(oPC); + GoHostile(oPC,oDefender); + AssignCommand(oDefender,ClearAllActions()); + AssignCommand(oDefender,SetFacingPoint(vFacing)); + AssignCommand(oDefender,SpeakString("Stop theif!")); + AssignCommand(oDefender,PlayVoiceChat(VOICE_CHAT_BATTLECRY1)); + AssignCommand(oDefender,ActionForceMoveToObject(oPC,TRUE,4.0)); + AssignCommand(oDefender,ActionDoCommand(DetermineCombatRound(oPC)));} + } + oDefender = OBJECT_INVALID; + } + else + { + nth=nth+1; + oDefender = GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nth); + } + } + } +} +void GoHostile(object oPC, object oDefender) +{ + SetIsTemporaryEnemy(oPC,oDefender,TRUE); + if(GetAssociateType(oPC) != ASSOCIATE_TYPE_NONE) + { + object oMaster = GetMaster(oPC); + SetIsTemporaryEnemy(oMaster,oDefender,TRUE); + } +} diff --git a/nwnds_module/door_death.ncs b/nwnds_module/door_death.ncs new file mode 100644 index 000000000..14a7210a7 Binary files /dev/null and b/nwnds_module/door_death.ncs differ diff --git a/nwnds_module/door_death.nss b/nwnds_module/door_death.nss new file mode 100644 index 000000000..6522397e9 --- /dev/null +++ b/nwnds_module/door_death.nss @@ -0,0 +1,37 @@ +///////////////////////////////// +/* + Creates a Placeable borken door to replace the one just destroyed + if the LocalString of the door is either "door_wood" or "door_dungeon" + + otherwise it executes the default HoTU sctipt for creating a craftable + item +*/ +//////////////////////////////// +void main() +{ +object oDest = GetTransitionTarget(OBJECT_SELF); + +if( oDest != OBJECT_INVALID) + { + // kludge because transition door is not actually destroyed + // and will close both doors if used with auto closed scripts + int nMaxHP=GetMaxHitPoints(oDest); + effect eDamage = EffectDamage(nMaxHP); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oDest); + + + string sPlaceable = GetLocalString(OBJECT_SELF,"BROKEN_DOOR"); + if(sPlaceable != "") + { + location lLocation = GetLocation(OBJECT_SELF); + CreateObject(OBJECT_TYPE_PLACEABLE,sPlaceable,lLocation,FALSE,"BROKEN_DOOR"); + } + } +else +{ + if(d100(1)>75) + {ExecuteScript("x2_door_death", OBJECT_SELF);} + +} + +} diff --git a/nwnds_module/door_fail2open.ncs b/nwnds_module/door_fail2open.ncs new file mode 100644 index 000000000..21650b5c5 Binary files /dev/null and b/nwnds_module/door_fail2open.ncs differ diff --git a/nwnds_module/door_fail2open.nss b/nwnds_module/door_fail2open.nss new file mode 100644 index 000000000..5ef172dc7 --- /dev/null +++ b/nwnds_module/door_fail2open.nss @@ -0,0 +1,53 @@ +///////////////////////////////////////// +/* + Generic door OnFailToOpen event + + - if the tag of the door is "barred" when this + event fires, the door will speak the string + "The door is barred from the other side" + + -If a LocalInt "GREETING" is assigned to the door + and is TRUE, + a). the event starts a conversation using the + door's tag as the resref for the dialog. + + ie: If the door's tag is Door01, save the conversation file + as door01. To avoid any potential glitches, the door's + tag should probably be all lower case. + + b). SetLocalObject(oPC,"oDoor",OBJECT_SELF); is used + so GetLocalObject can be used as a reference within + the conversation. The following shoule be included + in the door's dialog OnConversation End Event; + + object oPC = GetPCSpeaker(); + DeleteLocalObject(oPC,"oDoor"); + +*/ +//////////////////////////////////////// +void main() +{ + +string sTag = GetTag(OBJECT_SELF); +string sDialogResRef=sTag; + +if(sTag == "barred") + {SpeakString("The door is barred from the other side");} +else + { + if(GetLocalInt(OBJECT_SELF,"GREETING") == FALSE) + {return;} + else + { + object oPC = GetClickingObject(); + + if(GetIsPC(oPC) == FALSE) + {return;} + else + { + SetLocalObject(oPC,"oDoor",OBJECT_SELF); + ActionStartConversation(oPC,sDialogResRef,TRUE,FALSE); + } + } + } +} diff --git a/nwnds_module/door_open.ncs b/nwnds_module/door_open.ncs new file mode 100644 index 000000000..000dace07 Binary files /dev/null and b/nwnds_module/door_open.ncs differ diff --git a/nwnds_module/door_open.nss b/nwnds_module/door_open.nss new file mode 100644 index 000000000..30f8dc13f --- /dev/null +++ b/nwnds_module/door_open.nss @@ -0,0 +1,16 @@ +// closes door when when associate gets knocked behind door and +// opens it to follow Master +void main() +{ + +object oDest = GetTransitionTarget(OBJECT_SELF); +if(oDest == OBJECT_INVALID) + {return;} +else + { + + object oNPC = GetLastUsedBy(); + if(GetAssociateType(oNPC) != ASSOCIATE_TYPE_NONE) + {DelayCommand(2.0,ActionCloseDoor(OBJECT_SELF));} + } +} diff --git a/nwnds_module/door_unlock.ncs b/nwnds_module/door_unlock.ncs new file mode 100644 index 000000000..dd7b6ce6a Binary files /dev/null and b/nwnds_module/door_unlock.ncs differ diff --git a/nwnds_module/door_unlock.nss b/nwnds_module/door_unlock.nss new file mode 100644 index 000000000..cb4ea6068 --- /dev/null +++ b/nwnds_module/door_unlock.nss @@ -0,0 +1,66 @@ +///////////////////////////////////////////////// +/* + Summon guard if unlocked. + + Variables set on the Defender(at spawn in); + int "DEFENDER" 1 + +*/ +///////////////////////////////////////////////// +#include "nw_i0_generic" +void GoHostile(object oPC, object oDefender); +void main() +{ + object oDest = GetTransitionTarget(OBJECT_SELF); + object oPC = GetLastUnlocked(); + SetLocked(oDest,FALSE); +/* + if(GetAssociateType(oNPC) != ASSOCIATE_TYPE_NONE) + {oPC = GetMaster(oPC);} +*/ + int bDefender; + int nth = 1; + object oDefender = GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nth); + + while(oDefender != OBJECT_INVALID) + { + bDefender = GetLocalInt(oDefender,"DEFENDER"); + + // Am I a defender + if(bDefender == TRUE) + { + if(GetIsInCombat(oDefender) == FALSE) + { + + if(LineOfSightObject(oDefender,oPC) == TRUE) + { + vector vFacing = GetPosition(oPC); + //SetIsTemporaryEnemy(oPC,oDefender,TRUE); + GoHostile(oPC,oDefender); + AssignCommand(oDefender,ClearAllActions()); + AssignCommand(oDefender,SetFacingPoint(vFacing)); + AssignCommand(oDefender,SpeakString("Stop theif!")); + AssignCommand(oDefender,PlayVoiceChat(VOICE_CHAT_BATTLECRY1)); + AssignCommand(oDefender,ActionForceMoveToObject(oPC,TRUE,4.0)); + AssignCommand(oDefender,ActionDoCommand(DetermineCombatRound(oPC)));} + } + oDefender = OBJECT_INVALID; + } + else + { + nth=nth+1; + oDefender = GetNearestObject(OBJECT_TYPE_CREATURE,OBJECT_SELF,nth); + } + } + + +} +void GoHostile(object oPC, object oDefender) +{ + object oFactionMember = GetFactionLeader(oPC); + while(oFactionMember != OBJECT_INVALID) + { + SetIsTemporaryEnemy(oFactionMember,oDefender,TRUE); + oFactionMember = GetNextFactionMember(oPC); + } +} diff --git a/nwnds_module/door_userd.ncs b/nwnds_module/door_userd.ncs new file mode 100644 index 000000000..d40f41263 Binary files /dev/null and b/nwnds_module/door_userd.ncs differ diff --git a/nwnds_module/door_userd.nss b/nwnds_module/door_userd.nss new file mode 100644 index 000000000..d8f194ab8 --- /dev/null +++ b/nwnds_module/door_userd.nss @@ -0,0 +1,10 @@ +//Closes door if it is open +void main() +{ +int iEvent = GetUserDefinedEventNumber(); +if(iEvent == 9006) + { + DelayCommand(1.5,ActionCloseDoor(OBJECT_SELF)); + + } +} diff --git a/nwnds_module/doorpalcus.itp b/nwnds_module/doorpalcus.itp new file mode 100644 index 000000000..c725fd783 Binary files /dev/null and b/nwnds_module/doorpalcus.itp differ diff --git a/nwnds_module/dr_wraith_touch.ncs b/nwnds_module/dr_wraith_touch.ncs new file mode 100644 index 000000000..41265a44a Binary files /dev/null and b/nwnds_module/dr_wraith_touch.ncs differ diff --git a/nwnds_module/dr_wraith_touch.nss b/nwnds_module/dr_wraith_touch.nss new file mode 100644 index 000000000..9a35f474b --- /dev/null +++ b/nwnds_module/dr_wraith_touch.nss @@ -0,0 +1,72 @@ +//:: +//:: A pnp version of the Dread Wraith's CON draining touch. +//:: +//:: Modified by: DM Heatstroke 01-04-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoConDamage(object oTarget, object oCaster) +{ // Get Ability Damage + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + int nDam = d8(); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam); + eCon = ExtraordinaryEffect(eCon); + + // Setup oCaster's healing + effect eDrain = EffectTemporaryHitpoints(5); + eDrain = ExtraordinaryEffect(eDrain); + effect eDrainVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + // Determine if they can die from ability loss + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + // Get oCaster's Touch DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nTouchDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nTouchDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { // If they fail a save & have less than a 3 Constitution, kill them + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + + } + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCon, oTarget, 8640.0); // 24 "Athas Reborn" hours -DMH + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oCaster); // Heal up + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDrainVis, oCaster); // Apply Viz + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoConDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/draining_touch.ncs b/nwnds_module/draining_touch.ncs new file mode 100644 index 000000000..1f2f3ca28 Binary files /dev/null and b/nwnds_module/draining_touch.ncs differ diff --git a/nwnds_module/draining_touch.nss b/nwnds_module/draining_touch.nss new file mode 100644 index 000000000..348859f5c --- /dev/null +++ b/nwnds_module/draining_touch.nss @@ -0,0 +1,173 @@ +//:: +//:: A pnp version of the Ghost's ability draining touch. +//:: +//:: Modified by: DM Heatstroke 01-10-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoAbilityDamage(object oTarget, object oCaster) +{ // Get ability & amount to drain + int nAbility; + int nDam = Random(5)+1; + int nRandom = Random(5)+1; + if (nRandom == 1) + { + nAbility = ABILITY_STRENGTH; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Strength", TALKVOLUME_SILENT_SHOUT); + } + + else if (nRandom == 2) + { + nAbility = ABILITY_CONSTITUTION; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Constitution", TALKVOLUME_SILENT_SHOUT); + } + + else if (nRandom == 3) + { + nAbility = ABILITY_DEXTERITY; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Dexterity", TALKVOLUME_SILENT_SHOUT); + } + else if (nRandom == 4) + { + nAbility = ABILITY_INTELLIGENCE; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Intelligence", TALKVOLUME_SILENT_SHOUT); + } + else if (nRandom == 5) + { + nAbility = ABILITY_WISDOM; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Wisdom", TALKVOLUME_SILENT_SHOUT); + } + else + { + nAbility = ABILITY_CHARISMA; + //SpeakString("Choice "+IntToString(nRandom)+". Draining "+IntToString(nDam)+" Charisma", TALKVOLUME_SILENT_SHOUT); + } + + // Setup ability drain + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eDrain = EffectAbilityDecrease(nAbility, nDam); + eDrain = ExtraordinaryEffect(eDrain); + + // Setup oCaster's healing + effect eHeal = EffectHeal(5); + effect eDrainVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + // Determine if they can die from ability loss + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + // Get oCaster's Touch DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nTouchDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nTouchDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { // If they fail a save & have less than a 3 in any ability score, kill them + int nStr = GetAbilityScore(oTarget,ABILITY_STRENGTH); + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + int nDex = GetAbilityScore(oTarget,ABILITY_DEXTERITY); + int nInt = GetAbilityScore(oTarget,ABILITY_INTELLIGENCE); + int nWis = GetAbilityScore(oTarget,ABILITY_WISDOM); + int nCha = GetAbilityScore(oTarget,ABILITY_CHARISMA); + if ( ( nStr - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Strength Drain."); + //SpeakString(GetName(oTarget)+" Died from Strength Drain", TALKVOLUME_SILENT_SHOUT); + + } + else if ( ( nDex - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Dexterity Drain."); + //SpeakString(GetName(oTarget)+" Died from Dexterity Drain", TALKVOLUME_SILENT_SHOUT); + + } + else if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Constitution Drain."); + //SpeakString(GetName(oTarget)+" Died from Constitution Drain", TALKVOLUME_SILENT_SHOUT); + + } + else if ( ( nInt - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Intelligence Drain."); + //SpeakString(GetName(oTarget)+" Died from Intelligence Drain", TALKVOLUME_SILENT_SHOUT); + + } + else if ( ( nWis - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Wisdom Drain."); + //SpeakString(GetName(oTarget)+" Died from Wisdom Drain", TALKVOLUME_SILENT_SHOUT); + + } + else if ( ( nCha - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + SendMessageToPC(oTarget,"You died from Charisma Drain."); + //SpeakString(GetName(oTarget)+" Died from Charisma Drain", TALKVOLUME_SILENT_SHOUT); + + } + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oTarget, 8640.0); // 24 "Athas Reborn" hours -DMH + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oCaster); // Heal up + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDrainVis, oCaster); // Apply Viz + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoAbilityDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/drainingmelody.ncs b/nwnds_module/drainingmelody.ncs new file mode 100644 index 000000000..87f763b26 Binary files /dev/null and b/nwnds_module/drainingmelody.ncs differ diff --git a/nwnds_module/drainingmelody.nss b/nwnds_module/drainingmelody.nss new file mode 100644 index 000000000..7424fd7f6 --- /dev/null +++ b/nwnds_module/drainingmelody.nss @@ -0,0 +1,13 @@ +void main() +{ + //Set and apply AOE object + effect eVis = EffectVisualEffect(VFX_DUR_INVISIBILITY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVis, OBJECT_SELF); + + effect eAOE = EffectAreaOfEffect(AOE_MOB_DRAGON_FEAR,"melody1","melody2","melody3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/draj_daglair_a1.are b/nwnds_module/draj_daglair_a1.are new file mode 100644 index 000000000..d862967f0 Binary files /dev/null and b/nwnds_module/draj_daglair_a1.are differ diff --git a/nwnds_module/draj_daglair_a1.gic b/nwnds_module/draj_daglair_a1.gic new file mode 100644 index 000000000..c9341425b Binary files /dev/null and b/nwnds_module/draj_daglair_a1.gic differ diff --git a/nwnds_module/draj_daglair_a1.git b/nwnds_module/draj_daglair_a1.git new file mode 100644 index 000000000..4c9075645 Binary files /dev/null and b/nwnds_module/draj_daglair_a1.git differ diff --git a/nwnds_module/draj_daglair_a2.are b/nwnds_module/draj_daglair_a2.are new file mode 100644 index 000000000..df7942208 Binary files /dev/null and b/nwnds_module/draj_daglair_a2.are differ diff --git a/nwnds_module/draj_daglair_a2.gic b/nwnds_module/draj_daglair_a2.gic new file mode 100644 index 000000000..3091a1dc4 Binary files /dev/null and b/nwnds_module/draj_daglair_a2.gic differ diff --git a/nwnds_module/draj_daglair_a2.git b/nwnds_module/draj_daglair_a2.git new file mode 100644 index 000000000..10dca9f2e Binary files /dev/null and b/nwnds_module/draj_daglair_a2.git differ diff --git a/nwnds_module/draj_daglair_b1.are b/nwnds_module/draj_daglair_b1.are new file mode 100644 index 000000000..6c6c3e13f Binary files /dev/null and b/nwnds_module/draj_daglair_b1.are differ diff --git a/nwnds_module/draj_daglair_b1.gic b/nwnds_module/draj_daglair_b1.gic new file mode 100644 index 000000000..ca4addf27 Binary files /dev/null and b/nwnds_module/draj_daglair_b1.gic differ diff --git a/nwnds_module/draj_daglair_b1.git b/nwnds_module/draj_daglair_b1.git new file mode 100644 index 000000000..f236a221b Binary files /dev/null and b/nwnds_module/draj_daglair_b1.git differ diff --git a/nwnds_module/draj_daglair_b2.are b/nwnds_module/draj_daglair_b2.are new file mode 100644 index 000000000..15647ecf4 Binary files /dev/null and b/nwnds_module/draj_daglair_b2.are differ diff --git a/nwnds_module/draj_daglair_b2.gic b/nwnds_module/draj_daglair_b2.gic new file mode 100644 index 000000000..5161e7f8a Binary files /dev/null and b/nwnds_module/draj_daglair_b2.gic differ diff --git a/nwnds_module/draj_daglair_b2.git b/nwnds_module/draj_daglair_b2.git new file mode 100644 index 000000000..a075424bf Binary files /dev/null and b/nwnds_module/draj_daglair_b2.git differ diff --git a/nwnds_module/drake_air001.utc b/nwnds_module/drake_air001.utc new file mode 100644 index 000000000..a699cdfcf Binary files /dev/null and b/nwnds_module/drake_air001.utc differ diff --git a/nwnds_module/drake_earth001.utc b/nwnds_module/drake_earth001.utc new file mode 100644 index 000000000..465e78e12 Binary files /dev/null and b/nwnds_module/drake_earth001.utc differ diff --git a/nwnds_module/drake_fire001.utc b/nwnds_module/drake_fire001.utc new file mode 100644 index 000000000..b80077d76 Binary files /dev/null and b/nwnds_module/drake_fire001.utc differ diff --git a/nwnds_module/drake_water001.utc b/nwnds_module/drake_water001.utc new file mode 100644 index 000000000..178eda241 Binary files /dev/null and b/nwnds_module/drake_water001.utc differ diff --git a/nwnds_module/draqoman1.utc b/nwnds_module/draqoman1.utc new file mode 100644 index 000000000..85c85f61b Binary files /dev/null and b/nwnds_module/draqoman1.utc differ diff --git a/nwnds_module/draqoman2.utc b/nwnds_module/draqoman2.utc new file mode 100644 index 000000000..d0529799e Binary files /dev/null and b/nwnds_module/draqoman2.utc differ diff --git a/nwnds_module/dream_tendril.ncs b/nwnds_module/dream_tendril.ncs new file mode 100644 index 000000000..1a209e601 Binary files /dev/null and b/nwnds_module/dream_tendril.ncs differ diff --git a/nwnds_module/dream_tendril.nss b/nwnds_module/dream_tendril.nss new file mode 100644 index 000000000..89bf37ba6 --- /dev/null +++ b/nwnds_module/dream_tendril.nss @@ -0,0 +1,52 @@ +void DoIntDamage(object oTarget, object oOrigin ) +{ + int nKillEm = 0; + if ( (!GetIsPC( oTarget ) ) || ( GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES ) ) + { + nKillEm = 1; + } + + effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + int nDam = d4(); + effect eInt = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nDam); + eInt = SupernaturalEffect(eInt); + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eInt,oTarget); + return; + } + + effect eHeal = EffectTemporaryHitpoints(5); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_S); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHeal, oOrigin, HoursToSeconds(1)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHealVis, oOrigin); + + if ( GetAbilityScore(oTarget,ABILITY_INTELLIGENCE) - nDam < 3 && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eInt,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +} + +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + int nInt = GetAbilityScore(oTarget,ABILITY_INTELLIGENCE); + + if ( !GetLocalInt(oTarget,"NotMindless") && nInt == 3 ) + return; + + if ( nInt != 3 ) + SetLocalInt(oTarget,"NotMindless",1); + + DelayCommand(0.1,DoIntDamage(oTarget,oOrigin)); +} diff --git a/nwnds_module/dreamtendril.uti b/nwnds_module/dreamtendril.uti new file mode 100644 index 000000000..172f9e2af Binary files /dev/null and b/nwnds_module/dreamtendril.uti differ diff --git a/nwnds_module/dreamvestige001.utc b/nwnds_module/dreamvestige001.utc new file mode 100644 index 000000000..ac20f634c Binary files /dev/null and b/nwnds_module/dreamvestige001.utc differ diff --git a/nwnds_module/drgred004.utc b/nwnds_module/drgred004.utc new file mode 100644 index 000000000..f92d0c095 Binary files /dev/null and b/nwnds_module/drgred004.utc differ diff --git a/nwnds_module/drm_vestigehide.uti b/nwnds_module/drm_vestigehide.uti new file mode 100644 index 000000000..bfbbc88aa Binary files /dev/null and b/nwnds_module/drm_vestigehide.uti differ diff --git a/nwnds_module/drunkskin.uti b/nwnds_module/drunkskin.uti new file mode 100644 index 000000000..effadf0db Binary files /dev/null and b/nwnds_module/drunkskin.uti differ diff --git a/nwnds_module/ds_aarak_bite_c.uti b/nwnds_module/ds_aarak_bite_c.uti new file mode 100644 index 000000000..040e7b45d Binary files /dev/null and b/nwnds_module/ds_aarak_bite_c.uti differ diff --git a/nwnds_module/ds_aarak_bite_d.uti b/nwnds_module/ds_aarak_bite_d.uti new file mode 100644 index 000000000..e88456ca5 Binary files /dev/null and b/nwnds_module/ds_aarak_bite_d.uti differ diff --git a/nwnds_module/ds_aarak_bite_f.uti b/nwnds_module/ds_aarak_bite_f.uti new file mode 100644 index 000000000..69ec0032f Binary files /dev/null and b/nwnds_module/ds_aarak_bite_f.uti differ diff --git a/nwnds_module/ds_aarak_bite_g.uti b/nwnds_module/ds_aarak_bite_g.uti new file mode 100644 index 000000000..b2db590d5 Binary files /dev/null and b/nwnds_module/ds_aarak_bite_g.uti differ diff --git a/nwnds_module/ds_aarak_bite_h.uti b/nwnds_module/ds_aarak_bite_h.uti new file mode 100644 index 000000000..9cdad43bc Binary files /dev/null and b/nwnds_module/ds_aarak_bite_h.uti differ diff --git a/nwnds_module/ds_aarak_bite_l.uti b/nwnds_module/ds_aarak_bite_l.uti new file mode 100644 index 000000000..97a337f07 Binary files /dev/null and b/nwnds_module/ds_aarak_bite_l.uti differ diff --git a/nwnds_module/ds_aarak_bite_m.uti b/nwnds_module/ds_aarak_bite_m.uti new file mode 100644 index 000000000..eb2808045 Binary files /dev/null and b/nwnds_module/ds_aarak_bite_m.uti differ diff --git a/nwnds_module/ds_aarak_bite_s.uti b/nwnds_module/ds_aarak_bite_s.uti new file mode 100644 index 000000000..2568db20c Binary files /dev/null and b/nwnds_module/ds_aarak_bite_s.uti differ diff --git a/nwnds_module/ds_aarak_bite_t.uti b/nwnds_module/ds_aarak_bite_t.uti new file mode 100644 index 000000000..682a55771 Binary files /dev/null and b/nwnds_module/ds_aarak_bite_t.uti differ diff --git a/nwnds_module/ds_aarak_claw_c.uti b/nwnds_module/ds_aarak_claw_c.uti new file mode 100644 index 000000000..38fbf000c Binary files /dev/null and b/nwnds_module/ds_aarak_claw_c.uti differ diff --git a/nwnds_module/ds_aarak_claw_d.uti b/nwnds_module/ds_aarak_claw_d.uti new file mode 100644 index 000000000..c61871af7 Binary files /dev/null and b/nwnds_module/ds_aarak_claw_d.uti differ diff --git a/nwnds_module/ds_aarak_claw_f.uti b/nwnds_module/ds_aarak_claw_f.uti new file mode 100644 index 000000000..bd7ca43fd Binary files /dev/null and b/nwnds_module/ds_aarak_claw_f.uti differ diff --git a/nwnds_module/ds_aarak_claw_g.uti b/nwnds_module/ds_aarak_claw_g.uti new file mode 100644 index 000000000..072702d43 Binary files /dev/null and b/nwnds_module/ds_aarak_claw_g.uti differ diff --git a/nwnds_module/ds_aarak_claw_h.uti b/nwnds_module/ds_aarak_claw_h.uti new file mode 100644 index 000000000..a31263873 Binary files /dev/null and b/nwnds_module/ds_aarak_claw_h.uti differ diff --git a/nwnds_module/ds_aarak_claw_l.uti b/nwnds_module/ds_aarak_claw_l.uti new file mode 100644 index 000000000..beece248c Binary files /dev/null and b/nwnds_module/ds_aarak_claw_l.uti differ diff --git a/nwnds_module/ds_aarak_claw_m.uti b/nwnds_module/ds_aarak_claw_m.uti new file mode 100644 index 000000000..0ce8f1eaa Binary files /dev/null and b/nwnds_module/ds_aarak_claw_m.uti differ diff --git a/nwnds_module/ds_aarak_claw_s.uti b/nwnds_module/ds_aarak_claw_s.uti new file mode 100644 index 000000000..3cc45dc0e Binary files /dev/null and b/nwnds_module/ds_aarak_claw_s.uti differ diff --git a/nwnds_module/ds_aarak_claw_t.uti b/nwnds_module/ds_aarak_claw_t.uti new file mode 100644 index 000000000..09d5ced1f Binary files /dev/null and b/nwnds_module/ds_aarak_claw_t.uti differ diff --git a/nwnds_module/ds_ac_boneclaw01.utc b/nwnds_module/ds_ac_boneclaw01.utc new file mode 100644 index 000000000..8422c1bcc Binary files /dev/null and b/nwnds_module/ds_ac_boneclaw01.utc differ diff --git a/nwnds_module/ds_ac_jankx01.utc b/nwnds_module/ds_ac_jankx01.utc new file mode 100644 index 000000000..d8864f711 Binary files /dev/null and b/nwnds_module/ds_ac_jankx01.utc differ diff --git a/nwnds_module/ds_ac_jankx02.utc b/nwnds_module/ds_ac_jankx02.utc new file mode 100644 index 000000000..b0d67db97 Binary files /dev/null and b/nwnds_module/ds_ac_jankx02.utc differ diff --git a/nwnds_module/ds_ac_jankx03.utc b/nwnds_module/ds_ac_jankx03.utc new file mode 100644 index 000000000..d73213e7d Binary files /dev/null and b/nwnds_module/ds_ac_jankx03.utc differ diff --git a/nwnds_module/ds_ac_jankx04.utc b/nwnds_module/ds_ac_jankx04.utc new file mode 100644 index 000000000..5cdcc0453 Binary files /dev/null and b/nwnds_module/ds_ac_jankx04.utc differ diff --git a/nwnds_module/ds_ac_jankx05.utc b/nwnds_module/ds_ac_jankx05.utc new file mode 100644 index 000000000..f001336ee Binary files /dev/null and b/nwnds_module/ds_ac_jankx05.utc differ diff --git a/nwnds_module/ds_ac_jankx06.utc b/nwnds_module/ds_ac_jankx06.utc new file mode 100644 index 000000000..06c5c361b Binary files /dev/null and b/nwnds_module/ds_ac_jankx06.utc differ diff --git a/nwnds_module/ds_ac_jankx07.utc b/nwnds_module/ds_ac_jankx07.utc new file mode 100644 index 000000000..10359f4d9 Binary files /dev/null and b/nwnds_module/ds_ac_jankx07.utc differ diff --git a/nwnds_module/ds_ac_jankx08.utc b/nwnds_module/ds_ac_jankx08.utc new file mode 100644 index 000000000..adf1da297 Binary files /dev/null and b/nwnds_module/ds_ac_jankx08.utc differ diff --git a/nwnds_module/ds_ac_jankx09.utc b/nwnds_module/ds_ac_jankx09.utc new file mode 100644 index 000000000..af2d373e3 Binary files /dev/null and b/nwnds_module/ds_ac_jankx09.utc differ diff --git a/nwnds_module/ds_ac_jankx10.utc b/nwnds_module/ds_ac_jankx10.utc new file mode 100644 index 000000000..15651bd3a Binary files /dev/null and b/nwnds_module/ds_ac_jankx10.utc differ diff --git a/nwnds_module/ds_ac_jankx11.utc b/nwnds_module/ds_ac_jankx11.utc new file mode 100644 index 000000000..fcd438247 Binary files /dev/null and b/nwnds_module/ds_ac_jankx11.utc differ diff --git a/nwnds_module/ds_ac_jankx12.utc b/nwnds_module/ds_ac_jankx12.utc new file mode 100644 index 000000000..21b77bd7a Binary files /dev/null and b/nwnds_module/ds_ac_jankx12.utc differ diff --git a/nwnds_module/ds_ac_jankx13.utc b/nwnds_module/ds_ac_jankx13.utc new file mode 100644 index 000000000..9af6825cf Binary files /dev/null and b/nwnds_module/ds_ac_jankx13.utc differ diff --git a/nwnds_module/ds_ac_jankx14.utc b/nwnds_module/ds_ac_jankx14.utc new file mode 100644 index 000000000..fc56f21f2 Binary files /dev/null and b/nwnds_module/ds_ac_jankx14.utc differ diff --git a/nwnds_module/ds_ac_jankx15.utc b/nwnds_module/ds_ac_jankx15.utc new file mode 100644 index 000000000..f247010ed Binary files /dev/null and b/nwnds_module/ds_ac_jankx15.utc differ diff --git a/nwnds_module/ds_ac_jankx16.utc b/nwnds_module/ds_ac_jankx16.utc new file mode 100644 index 000000000..7fde6a444 Binary files /dev/null and b/nwnds_module/ds_ac_jankx16.utc differ diff --git a/nwnds_module/ds_ac_jankx17.utc b/nwnds_module/ds_ac_jankx17.utc new file mode 100644 index 000000000..346179175 Binary files /dev/null and b/nwnds_module/ds_ac_jankx17.utc differ diff --git a/nwnds_module/ds_ac_jankx18.utc b/nwnds_module/ds_ac_jankx18.utc new file mode 100644 index 000000000..29167750e Binary files /dev/null and b/nwnds_module/ds_ac_jankx18.utc differ diff --git a/nwnds_module/ds_ac_jankx19.utc b/nwnds_module/ds_ac_jankx19.utc new file mode 100644 index 000000000..3edf65433 Binary files /dev/null and b/nwnds_module/ds_ac_jankx19.utc differ diff --git a/nwnds_module/ds_ac_jankx20.utc b/nwnds_module/ds_ac_jankx20.utc new file mode 100644 index 000000000..16fee6692 Binary files /dev/null and b/nwnds_module/ds_ac_jankx20.utc differ diff --git a/nwnds_module/ds_ac_jankx21.utc b/nwnds_module/ds_ac_jankx21.utc new file mode 100644 index 000000000..422c4f199 Binary files /dev/null and b/nwnds_module/ds_ac_jankx21.utc differ diff --git a/nwnds_module/ds_ac_jankx22.utc b/nwnds_module/ds_ac_jankx22.utc new file mode 100644 index 000000000..3303e2f90 Binary files /dev/null and b/nwnds_module/ds_ac_jankx22.utc differ diff --git a/nwnds_module/ds_ac_jankx23.utc b/nwnds_module/ds_ac_jankx23.utc new file mode 100644 index 000000000..7db6dc867 Binary files /dev/null and b/nwnds_module/ds_ac_jankx23.utc differ diff --git a/nwnds_module/ds_ac_jankx24.utc b/nwnds_module/ds_ac_jankx24.utc new file mode 100644 index 000000000..a763443dd Binary files /dev/null and b/nwnds_module/ds_ac_jankx24.utc differ diff --git a/nwnds_module/ds_ac_jankx25.utc b/nwnds_module/ds_ac_jankx25.utc new file mode 100644 index 000000000..5fb36f474 Binary files /dev/null and b/nwnds_module/ds_ac_jankx25.utc differ diff --git a/nwnds_module/ds_ac_jankx26.utc b/nwnds_module/ds_ac_jankx26.utc new file mode 100644 index 000000000..e2b530edf Binary files /dev/null and b/nwnds_module/ds_ac_jankx26.utc differ diff --git a/nwnds_module/ds_ac_jankx27.utc b/nwnds_module/ds_ac_jankx27.utc new file mode 100644 index 000000000..92007cfd1 Binary files /dev/null and b/nwnds_module/ds_ac_jankx27.utc differ diff --git a/nwnds_module/ds_ac_jankx28.utc b/nwnds_module/ds_ac_jankx28.utc new file mode 100644 index 000000000..7b1b53282 Binary files /dev/null and b/nwnds_module/ds_ac_jankx28.utc differ diff --git a/nwnds_module/ds_ac_jankx29.utc b/nwnds_module/ds_ac_jankx29.utc new file mode 100644 index 000000000..24168ffde Binary files /dev/null and b/nwnds_module/ds_ac_jankx29.utc differ diff --git a/nwnds_module/ds_ac_jankx30.utc b/nwnds_module/ds_ac_jankx30.utc new file mode 100644 index 000000000..0eeca5c1c Binary files /dev/null and b/nwnds_module/ds_ac_jankx30.utc differ diff --git a/nwnds_module/ds_ac_jankx31.utc b/nwnds_module/ds_ac_jankx31.utc new file mode 100644 index 000000000..b3c5ad193 Binary files /dev/null and b/nwnds_module/ds_ac_jankx31.utc differ diff --git a/nwnds_module/ds_ac_jankx32.utc b/nwnds_module/ds_ac_jankx32.utc new file mode 100644 index 000000000..a5f8a8a9f Binary files /dev/null and b/nwnds_module/ds_ac_jankx32.utc differ diff --git a/nwnds_module/ds_ac_jankx33.utc b/nwnds_module/ds_ac_jankx33.utc new file mode 100644 index 000000000..e909710e7 Binary files /dev/null and b/nwnds_module/ds_ac_jankx33.utc differ diff --git a/nwnds_module/ds_ac_jankx34.utc b/nwnds_module/ds_ac_jankx34.utc new file mode 100644 index 000000000..5a9d0f11d Binary files /dev/null and b/nwnds_module/ds_ac_jankx34.utc differ diff --git a/nwnds_module/ds_ac_jankx35.utc b/nwnds_module/ds_ac_jankx35.utc new file mode 100644 index 000000000..551ae178d Binary files /dev/null and b/nwnds_module/ds_ac_jankx35.utc differ diff --git a/nwnds_module/ds_ac_jankx36.utc b/nwnds_module/ds_ac_jankx36.utc new file mode 100644 index 000000000..f32416e85 Binary files /dev/null and b/nwnds_module/ds_ac_jankx36.utc differ diff --git a/nwnds_module/ds_ac_jankx37.utc b/nwnds_module/ds_ac_jankx37.utc new file mode 100644 index 000000000..0d0985252 Binary files /dev/null and b/nwnds_module/ds_ac_jankx37.utc differ diff --git a/nwnds_module/ds_ac_jankx38.utc b/nwnds_module/ds_ac_jankx38.utc new file mode 100644 index 000000000..7e0f27354 Binary files /dev/null and b/nwnds_module/ds_ac_jankx38.utc differ diff --git a/nwnds_module/ds_ac_jankx39.utc b/nwnds_module/ds_ac_jankx39.utc new file mode 100644 index 000000000..df6ef467b Binary files /dev/null and b/nwnds_module/ds_ac_jankx39.utc differ diff --git a/nwnds_module/ds_ac_jankx40.utc b/nwnds_module/ds_ac_jankx40.utc new file mode 100644 index 000000000..3b19f5ddc Binary files /dev/null and b/nwnds_module/ds_ac_jankx40.utc differ diff --git a/nwnds_module/ds_ac_jhakar01.utc b/nwnds_module/ds_ac_jhakar01.utc new file mode 100644 index 000000000..c32586387 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar01.utc differ diff --git a/nwnds_module/ds_ac_jhakar02.utc b/nwnds_module/ds_ac_jhakar02.utc new file mode 100644 index 000000000..01c796dd4 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar02.utc differ diff --git a/nwnds_module/ds_ac_jhakar03.utc b/nwnds_module/ds_ac_jhakar03.utc new file mode 100644 index 000000000..cb70c6269 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar03.utc differ diff --git a/nwnds_module/ds_ac_jhakar04.utc b/nwnds_module/ds_ac_jhakar04.utc new file mode 100644 index 000000000..984323d1d Binary files /dev/null and b/nwnds_module/ds_ac_jhakar04.utc differ diff --git a/nwnds_module/ds_ac_jhakar05.utc b/nwnds_module/ds_ac_jhakar05.utc new file mode 100644 index 000000000..048e6ae5d Binary files /dev/null and b/nwnds_module/ds_ac_jhakar05.utc differ diff --git a/nwnds_module/ds_ac_jhakar06.utc b/nwnds_module/ds_ac_jhakar06.utc new file mode 100644 index 000000000..6174a1cc4 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar06.utc differ diff --git a/nwnds_module/ds_ac_jhakar07.utc b/nwnds_module/ds_ac_jhakar07.utc new file mode 100644 index 000000000..07630d923 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar07.utc differ diff --git a/nwnds_module/ds_ac_jhakar08.utc b/nwnds_module/ds_ac_jhakar08.utc new file mode 100644 index 000000000..fe2b7f070 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar08.utc differ diff --git a/nwnds_module/ds_ac_jhakar09.utc b/nwnds_module/ds_ac_jhakar09.utc new file mode 100644 index 000000000..384468e19 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar09.utc differ diff --git a/nwnds_module/ds_ac_jhakar10.utc b/nwnds_module/ds_ac_jhakar10.utc new file mode 100644 index 000000000..00c932623 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar10.utc differ diff --git a/nwnds_module/ds_ac_jhakar11.utc b/nwnds_module/ds_ac_jhakar11.utc new file mode 100644 index 000000000..72fde873f Binary files /dev/null and b/nwnds_module/ds_ac_jhakar11.utc differ diff --git a/nwnds_module/ds_ac_jhakar12.utc b/nwnds_module/ds_ac_jhakar12.utc new file mode 100644 index 000000000..75dd254ed Binary files /dev/null and b/nwnds_module/ds_ac_jhakar12.utc differ diff --git a/nwnds_module/ds_ac_jhakar13.utc b/nwnds_module/ds_ac_jhakar13.utc new file mode 100644 index 000000000..37637d51d Binary files /dev/null and b/nwnds_module/ds_ac_jhakar13.utc differ diff --git a/nwnds_module/ds_ac_jhakar14.utc b/nwnds_module/ds_ac_jhakar14.utc new file mode 100644 index 000000000..d5fc11028 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar14.utc differ diff --git a/nwnds_module/ds_ac_jhakar15.utc b/nwnds_module/ds_ac_jhakar15.utc new file mode 100644 index 000000000..9e14f9345 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar15.utc differ diff --git a/nwnds_module/ds_ac_jhakar16.utc b/nwnds_module/ds_ac_jhakar16.utc new file mode 100644 index 000000000..c7160ea74 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar16.utc differ diff --git a/nwnds_module/ds_ac_jhakar17.utc b/nwnds_module/ds_ac_jhakar17.utc new file mode 100644 index 000000000..8c0e4913b Binary files /dev/null and b/nwnds_module/ds_ac_jhakar17.utc differ diff --git a/nwnds_module/ds_ac_jhakar18.utc b/nwnds_module/ds_ac_jhakar18.utc new file mode 100644 index 000000000..ca0d7553d Binary files /dev/null and b/nwnds_module/ds_ac_jhakar18.utc differ diff --git a/nwnds_module/ds_ac_jhakar19.utc b/nwnds_module/ds_ac_jhakar19.utc new file mode 100644 index 000000000..ad363152b Binary files /dev/null and b/nwnds_module/ds_ac_jhakar19.utc differ diff --git a/nwnds_module/ds_ac_jhakar20.utc b/nwnds_module/ds_ac_jhakar20.utc new file mode 100644 index 000000000..cf8747a98 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar20.utc differ diff --git a/nwnds_module/ds_ac_jhakar21.utc b/nwnds_module/ds_ac_jhakar21.utc new file mode 100644 index 000000000..1fa869e75 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar21.utc differ diff --git a/nwnds_module/ds_ac_jhakar22.utc b/nwnds_module/ds_ac_jhakar22.utc new file mode 100644 index 000000000..3eb2aa460 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar22.utc differ diff --git a/nwnds_module/ds_ac_jhakar23.utc b/nwnds_module/ds_ac_jhakar23.utc new file mode 100644 index 000000000..1b9eb5728 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar23.utc differ diff --git a/nwnds_module/ds_ac_jhakar24.utc b/nwnds_module/ds_ac_jhakar24.utc new file mode 100644 index 000000000..eb764a336 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar24.utc differ diff --git a/nwnds_module/ds_ac_jhakar25.utc b/nwnds_module/ds_ac_jhakar25.utc new file mode 100644 index 000000000..8df9dfa25 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar25.utc differ diff --git a/nwnds_module/ds_ac_jhakar26.utc b/nwnds_module/ds_ac_jhakar26.utc new file mode 100644 index 000000000..ec2a29de7 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar26.utc differ diff --git a/nwnds_module/ds_ac_jhakar27.utc b/nwnds_module/ds_ac_jhakar27.utc new file mode 100644 index 000000000..7dd79a732 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar27.utc differ diff --git a/nwnds_module/ds_ac_jhakar28.utc b/nwnds_module/ds_ac_jhakar28.utc new file mode 100644 index 000000000..7dd92e777 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar28.utc differ diff --git a/nwnds_module/ds_ac_jhakar29.utc b/nwnds_module/ds_ac_jhakar29.utc new file mode 100644 index 000000000..dbec53971 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar29.utc differ diff --git a/nwnds_module/ds_ac_jhakar30.utc b/nwnds_module/ds_ac_jhakar30.utc new file mode 100644 index 000000000..0a2fc614c Binary files /dev/null and b/nwnds_module/ds_ac_jhakar30.utc differ diff --git a/nwnds_module/ds_ac_jhakar31.utc b/nwnds_module/ds_ac_jhakar31.utc new file mode 100644 index 000000000..115342b59 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar31.utc differ diff --git a/nwnds_module/ds_ac_jhakar32.utc b/nwnds_module/ds_ac_jhakar32.utc new file mode 100644 index 000000000..3518b7727 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar32.utc differ diff --git a/nwnds_module/ds_ac_jhakar33.utc b/nwnds_module/ds_ac_jhakar33.utc new file mode 100644 index 000000000..d79353f04 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar33.utc differ diff --git a/nwnds_module/ds_ac_jhakar34.utc b/nwnds_module/ds_ac_jhakar34.utc new file mode 100644 index 000000000..63c73c1ce Binary files /dev/null and b/nwnds_module/ds_ac_jhakar34.utc differ diff --git a/nwnds_module/ds_ac_jhakar35.utc b/nwnds_module/ds_ac_jhakar35.utc new file mode 100644 index 000000000..a57a3a1aa Binary files /dev/null and b/nwnds_module/ds_ac_jhakar35.utc differ diff --git a/nwnds_module/ds_ac_jhakar36.utc b/nwnds_module/ds_ac_jhakar36.utc new file mode 100644 index 000000000..ce29ef474 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar36.utc differ diff --git a/nwnds_module/ds_ac_jhakar37.utc b/nwnds_module/ds_ac_jhakar37.utc new file mode 100644 index 000000000..645d26ee4 Binary files /dev/null and b/nwnds_module/ds_ac_jhakar37.utc differ diff --git a/nwnds_module/ds_ac_jhakar38.utc b/nwnds_module/ds_ac_jhakar38.utc new file mode 100644 index 000000000..38db6dc3e Binary files /dev/null and b/nwnds_module/ds_ac_jhakar38.utc differ diff --git a/nwnds_module/ds_ac_jhakar39.utc b/nwnds_module/ds_ac_jhakar39.utc new file mode 100644 index 000000000..e90a6b43b Binary files /dev/null and b/nwnds_module/ds_ac_jhakar39.utc differ diff --git a/nwnds_module/ds_ac_jhakar40.utc b/nwnds_module/ds_ac_jhakar40.utc new file mode 100644 index 000000000..5f40c39fb Binary files /dev/null and b/nwnds_module/ds_ac_jhakar40.utc differ diff --git a/nwnds_module/ds_ac_sandhowl03.utc b/nwnds_module/ds_ac_sandhowl03.utc new file mode 100644 index 000000000..e6438f414 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl03.utc differ diff --git a/nwnds_module/ds_ac_sandhowl04.utc b/nwnds_module/ds_ac_sandhowl04.utc new file mode 100644 index 000000000..b68dd8660 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl04.utc differ diff --git a/nwnds_module/ds_ac_sandhowl05.utc b/nwnds_module/ds_ac_sandhowl05.utc new file mode 100644 index 000000000..fdfdd79b0 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl05.utc differ diff --git a/nwnds_module/ds_ac_sandhowl06.utc b/nwnds_module/ds_ac_sandhowl06.utc new file mode 100644 index 000000000..c33d3b578 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl06.utc differ diff --git a/nwnds_module/ds_ac_sandhowl07.utc b/nwnds_module/ds_ac_sandhowl07.utc new file mode 100644 index 000000000..25f36646f Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl07.utc differ diff --git a/nwnds_module/ds_ac_sandhowl08.utc b/nwnds_module/ds_ac_sandhowl08.utc new file mode 100644 index 000000000..7255bc280 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl08.utc differ diff --git a/nwnds_module/ds_ac_sandhowl09.utc b/nwnds_module/ds_ac_sandhowl09.utc new file mode 100644 index 000000000..8f5eef9dc Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl09.utc differ diff --git a/nwnds_module/ds_ac_sandhowl10.utc b/nwnds_module/ds_ac_sandhowl10.utc new file mode 100644 index 000000000..95dbecdb8 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl10.utc differ diff --git a/nwnds_module/ds_ac_sandhowl11.utc b/nwnds_module/ds_ac_sandhowl11.utc new file mode 100644 index 000000000..27cbde96e Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl11.utc differ diff --git a/nwnds_module/ds_ac_sandhowl12.utc b/nwnds_module/ds_ac_sandhowl12.utc new file mode 100644 index 000000000..65dd27907 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl12.utc differ diff --git a/nwnds_module/ds_ac_sandhowl13.utc b/nwnds_module/ds_ac_sandhowl13.utc new file mode 100644 index 000000000..c2b71a731 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl13.utc differ diff --git a/nwnds_module/ds_ac_sandhowl14.utc b/nwnds_module/ds_ac_sandhowl14.utc new file mode 100644 index 000000000..69ebf9b92 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl14.utc differ diff --git a/nwnds_module/ds_ac_sandhowl15.utc b/nwnds_module/ds_ac_sandhowl15.utc new file mode 100644 index 000000000..b9cb2db96 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl15.utc differ diff --git a/nwnds_module/ds_ac_sandhowl16.utc b/nwnds_module/ds_ac_sandhowl16.utc new file mode 100644 index 000000000..86e8f523f Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl16.utc differ diff --git a/nwnds_module/ds_ac_sandhowl17.utc b/nwnds_module/ds_ac_sandhowl17.utc new file mode 100644 index 000000000..d83fbd364 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl17.utc differ diff --git a/nwnds_module/ds_ac_sandhowl18.utc b/nwnds_module/ds_ac_sandhowl18.utc new file mode 100644 index 000000000..fca884b43 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl18.utc differ diff --git a/nwnds_module/ds_ac_sandhowl19.utc b/nwnds_module/ds_ac_sandhowl19.utc new file mode 100644 index 000000000..d918f2189 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl19.utc differ diff --git a/nwnds_module/ds_ac_sandhowl20.utc b/nwnds_module/ds_ac_sandhowl20.utc new file mode 100644 index 000000000..35aa19791 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl20.utc differ diff --git a/nwnds_module/ds_ac_sandhowl21.utc b/nwnds_module/ds_ac_sandhowl21.utc new file mode 100644 index 000000000..9eb135af5 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl21.utc differ diff --git a/nwnds_module/ds_ac_sandhowl22.utc b/nwnds_module/ds_ac_sandhowl22.utc new file mode 100644 index 000000000..db0c0831d Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl22.utc differ diff --git a/nwnds_module/ds_ac_sandhowl23.utc b/nwnds_module/ds_ac_sandhowl23.utc new file mode 100644 index 000000000..2ae1ddd8b Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl23.utc differ diff --git a/nwnds_module/ds_ac_sandhowl24.utc b/nwnds_module/ds_ac_sandhowl24.utc new file mode 100644 index 000000000..83bd018d9 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl24.utc differ diff --git a/nwnds_module/ds_ac_sandhowl25.utc b/nwnds_module/ds_ac_sandhowl25.utc new file mode 100644 index 000000000..d10206ad3 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl25.utc differ diff --git a/nwnds_module/ds_ac_sandhowl26.utc b/nwnds_module/ds_ac_sandhowl26.utc new file mode 100644 index 000000000..d31effcd0 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl26.utc differ diff --git a/nwnds_module/ds_ac_sandhowl27.utc b/nwnds_module/ds_ac_sandhowl27.utc new file mode 100644 index 000000000..218d8644c Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl27.utc differ diff --git a/nwnds_module/ds_ac_sandhowl28.utc b/nwnds_module/ds_ac_sandhowl28.utc new file mode 100644 index 000000000..6beaed1ee Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl28.utc differ diff --git a/nwnds_module/ds_ac_sandhowl29.utc b/nwnds_module/ds_ac_sandhowl29.utc new file mode 100644 index 000000000..d89da4874 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl29.utc differ diff --git a/nwnds_module/ds_ac_sandhowl30.utc b/nwnds_module/ds_ac_sandhowl30.utc new file mode 100644 index 000000000..cc5f76df6 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl30.utc differ diff --git a/nwnds_module/ds_ac_sandhowl31.utc b/nwnds_module/ds_ac_sandhowl31.utc new file mode 100644 index 000000000..9fe7b572a Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl31.utc differ diff --git a/nwnds_module/ds_ac_sandhowl32.utc b/nwnds_module/ds_ac_sandhowl32.utc new file mode 100644 index 000000000..4d452c12d Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl32.utc differ diff --git a/nwnds_module/ds_ac_sandhowl33.utc b/nwnds_module/ds_ac_sandhowl33.utc new file mode 100644 index 000000000..8acae8cca Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl33.utc differ diff --git a/nwnds_module/ds_ac_sandhowl34.utc b/nwnds_module/ds_ac_sandhowl34.utc new file mode 100644 index 000000000..e364de3b5 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl34.utc differ diff --git a/nwnds_module/ds_ac_sandhowl35.utc b/nwnds_module/ds_ac_sandhowl35.utc new file mode 100644 index 000000000..717876304 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl35.utc differ diff --git a/nwnds_module/ds_ac_sandhowl36.utc b/nwnds_module/ds_ac_sandhowl36.utc new file mode 100644 index 000000000..1c87113fe Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl36.utc differ diff --git a/nwnds_module/ds_ac_sandhowl37.utc b/nwnds_module/ds_ac_sandhowl37.utc new file mode 100644 index 000000000..3537134eb Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl37.utc differ diff --git a/nwnds_module/ds_ac_sandhowl38.utc b/nwnds_module/ds_ac_sandhowl38.utc new file mode 100644 index 000000000..7d42d3255 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl38.utc differ diff --git a/nwnds_module/ds_ac_sandhowl39.utc b/nwnds_module/ds_ac_sandhowl39.utc new file mode 100644 index 000000000..efe4a12d3 Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl39.utc differ diff --git a/nwnds_module/ds_ac_sandhowl40.utc b/nwnds_module/ds_ac_sandhowl40.utc new file mode 100644 index 000000000..e3fd5d47c Binary files /dev/null and b/nwnds_module/ds_ac_sandhowl40.utc differ diff --git a/nwnds_module/ds_ac_ztal01.utc b/nwnds_module/ds_ac_ztal01.utc new file mode 100644 index 000000000..17fb3be64 Binary files /dev/null and b/nwnds_module/ds_ac_ztal01.utc differ diff --git a/nwnds_module/ds_ac_ztal02.utc b/nwnds_module/ds_ac_ztal02.utc new file mode 100644 index 000000000..ae730f279 Binary files /dev/null and b/nwnds_module/ds_ac_ztal02.utc differ diff --git a/nwnds_module/ds_ac_ztal03.utc b/nwnds_module/ds_ac_ztal03.utc new file mode 100644 index 000000000..58e8141fe Binary files /dev/null and b/nwnds_module/ds_ac_ztal03.utc differ diff --git a/nwnds_module/ds_ac_ztal04.utc b/nwnds_module/ds_ac_ztal04.utc new file mode 100644 index 000000000..a031b8bfc Binary files /dev/null and b/nwnds_module/ds_ac_ztal04.utc differ diff --git a/nwnds_module/ds_ac_ztal05.utc b/nwnds_module/ds_ac_ztal05.utc new file mode 100644 index 000000000..eac5a725b Binary files /dev/null and b/nwnds_module/ds_ac_ztal05.utc differ diff --git a/nwnds_module/ds_ac_ztal06.utc b/nwnds_module/ds_ac_ztal06.utc new file mode 100644 index 000000000..4f08549fd Binary files /dev/null and b/nwnds_module/ds_ac_ztal06.utc differ diff --git a/nwnds_module/ds_ac_ztal07.utc b/nwnds_module/ds_ac_ztal07.utc new file mode 100644 index 000000000..77d3cb266 Binary files /dev/null and b/nwnds_module/ds_ac_ztal07.utc differ diff --git a/nwnds_module/ds_ac_ztal08.utc b/nwnds_module/ds_ac_ztal08.utc new file mode 100644 index 000000000..6111cd3fc Binary files /dev/null and b/nwnds_module/ds_ac_ztal08.utc differ diff --git a/nwnds_module/ds_ac_ztal09.utc b/nwnds_module/ds_ac_ztal09.utc new file mode 100644 index 000000000..32ecfff4d Binary files /dev/null and b/nwnds_module/ds_ac_ztal09.utc differ diff --git a/nwnds_module/ds_ac_ztal10.utc b/nwnds_module/ds_ac_ztal10.utc new file mode 100644 index 000000000..7c37860f6 Binary files /dev/null and b/nwnds_module/ds_ac_ztal10.utc differ diff --git a/nwnds_module/ds_ac_ztal11.utc b/nwnds_module/ds_ac_ztal11.utc new file mode 100644 index 000000000..98c8ce00e Binary files /dev/null and b/nwnds_module/ds_ac_ztal11.utc differ diff --git a/nwnds_module/ds_ac_ztal12.utc b/nwnds_module/ds_ac_ztal12.utc new file mode 100644 index 000000000..a0f0707a4 Binary files /dev/null and b/nwnds_module/ds_ac_ztal12.utc differ diff --git a/nwnds_module/ds_ac_ztal13.utc b/nwnds_module/ds_ac_ztal13.utc new file mode 100644 index 000000000..ebedcfb41 Binary files /dev/null and b/nwnds_module/ds_ac_ztal13.utc differ diff --git a/nwnds_module/ds_ac_ztal14.utc b/nwnds_module/ds_ac_ztal14.utc new file mode 100644 index 000000000..599848e74 Binary files /dev/null and b/nwnds_module/ds_ac_ztal14.utc differ diff --git a/nwnds_module/ds_ac_ztal15.utc b/nwnds_module/ds_ac_ztal15.utc new file mode 100644 index 000000000..659627830 Binary files /dev/null and b/nwnds_module/ds_ac_ztal15.utc differ diff --git a/nwnds_module/ds_ac_ztal16.utc b/nwnds_module/ds_ac_ztal16.utc new file mode 100644 index 000000000..94467df41 Binary files /dev/null and b/nwnds_module/ds_ac_ztal16.utc differ diff --git a/nwnds_module/ds_ac_ztal17.utc b/nwnds_module/ds_ac_ztal17.utc new file mode 100644 index 000000000..a8fd2970b Binary files /dev/null and b/nwnds_module/ds_ac_ztal17.utc differ diff --git a/nwnds_module/ds_ac_ztal18.utc b/nwnds_module/ds_ac_ztal18.utc new file mode 100644 index 000000000..6e6ef2cfa Binary files /dev/null and b/nwnds_module/ds_ac_ztal18.utc differ diff --git a/nwnds_module/ds_ac_ztal19.utc b/nwnds_module/ds_ac_ztal19.utc new file mode 100644 index 000000000..0b635a2b8 Binary files /dev/null and b/nwnds_module/ds_ac_ztal19.utc differ diff --git a/nwnds_module/ds_ac_ztal20.utc b/nwnds_module/ds_ac_ztal20.utc new file mode 100644 index 000000000..c0868a856 Binary files /dev/null and b/nwnds_module/ds_ac_ztal20.utc differ diff --git a/nwnds_module/ds_ac_ztal21.utc b/nwnds_module/ds_ac_ztal21.utc new file mode 100644 index 000000000..786dc9611 Binary files /dev/null and b/nwnds_module/ds_ac_ztal21.utc differ diff --git a/nwnds_module/ds_ac_ztal22.utc b/nwnds_module/ds_ac_ztal22.utc new file mode 100644 index 000000000..009be880d Binary files /dev/null and b/nwnds_module/ds_ac_ztal22.utc differ diff --git a/nwnds_module/ds_ac_ztal23.utc b/nwnds_module/ds_ac_ztal23.utc new file mode 100644 index 000000000..5dc02d128 Binary files /dev/null and b/nwnds_module/ds_ac_ztal23.utc differ diff --git a/nwnds_module/ds_ac_ztal24.utc b/nwnds_module/ds_ac_ztal24.utc new file mode 100644 index 000000000..6fb9eb815 Binary files /dev/null and b/nwnds_module/ds_ac_ztal24.utc differ diff --git a/nwnds_module/ds_ac_ztal25.utc b/nwnds_module/ds_ac_ztal25.utc new file mode 100644 index 000000000..e6eeff1a0 Binary files /dev/null and b/nwnds_module/ds_ac_ztal25.utc differ diff --git a/nwnds_module/ds_ac_ztal26.utc b/nwnds_module/ds_ac_ztal26.utc new file mode 100644 index 000000000..9ebbf10ae Binary files /dev/null and b/nwnds_module/ds_ac_ztal26.utc differ diff --git a/nwnds_module/ds_ac_ztal27.utc b/nwnds_module/ds_ac_ztal27.utc new file mode 100644 index 000000000..e90cba29d Binary files /dev/null and b/nwnds_module/ds_ac_ztal27.utc differ diff --git a/nwnds_module/ds_ac_ztal28.utc b/nwnds_module/ds_ac_ztal28.utc new file mode 100644 index 000000000..d591a3a77 Binary files /dev/null and b/nwnds_module/ds_ac_ztal28.utc differ diff --git a/nwnds_module/ds_ac_ztal29.utc b/nwnds_module/ds_ac_ztal29.utc new file mode 100644 index 000000000..72c9774a4 Binary files /dev/null and b/nwnds_module/ds_ac_ztal29.utc differ diff --git a/nwnds_module/ds_ac_ztal30.utc b/nwnds_module/ds_ac_ztal30.utc new file mode 100644 index 000000000..b23cf71cf Binary files /dev/null and b/nwnds_module/ds_ac_ztal30.utc differ diff --git a/nwnds_module/ds_ac_ztal31.utc b/nwnds_module/ds_ac_ztal31.utc new file mode 100644 index 000000000..6317baa35 Binary files /dev/null and b/nwnds_module/ds_ac_ztal31.utc differ diff --git a/nwnds_module/ds_ac_ztal32.utc b/nwnds_module/ds_ac_ztal32.utc new file mode 100644 index 000000000..974516c01 Binary files /dev/null and b/nwnds_module/ds_ac_ztal32.utc differ diff --git a/nwnds_module/ds_ac_ztal33.utc b/nwnds_module/ds_ac_ztal33.utc new file mode 100644 index 000000000..c71eadba0 Binary files /dev/null and b/nwnds_module/ds_ac_ztal33.utc differ diff --git a/nwnds_module/ds_ac_ztal34.utc b/nwnds_module/ds_ac_ztal34.utc new file mode 100644 index 000000000..a8bb0607c Binary files /dev/null and b/nwnds_module/ds_ac_ztal34.utc differ diff --git a/nwnds_module/ds_ac_ztal35.utc b/nwnds_module/ds_ac_ztal35.utc new file mode 100644 index 000000000..61410eca7 Binary files /dev/null and b/nwnds_module/ds_ac_ztal35.utc differ diff --git a/nwnds_module/ds_ac_ztal36.utc b/nwnds_module/ds_ac_ztal36.utc new file mode 100644 index 000000000..8ed793c71 Binary files /dev/null and b/nwnds_module/ds_ac_ztal36.utc differ diff --git a/nwnds_module/ds_ac_ztal37.utc b/nwnds_module/ds_ac_ztal37.utc new file mode 100644 index 000000000..e16483b25 Binary files /dev/null and b/nwnds_module/ds_ac_ztal37.utc differ diff --git a/nwnds_module/ds_ac_ztal38.utc b/nwnds_module/ds_ac_ztal38.utc new file mode 100644 index 000000000..1d1130ae7 Binary files /dev/null and b/nwnds_module/ds_ac_ztal38.utc differ diff --git a/nwnds_module/ds_ac_ztal39.utc b/nwnds_module/ds_ac_ztal39.utc new file mode 100644 index 000000000..49b145852 Binary files /dev/null and b/nwnds_module/ds_ac_ztal39.utc differ diff --git a/nwnds_module/ds_ac_ztal40.utc b/nwnds_module/ds_ac_ztal40.utc new file mode 100644 index 000000000..e3e5cf904 Binary files /dev/null and b/nwnds_module/ds_ac_ztal40.utc differ diff --git a/nwnds_module/ds_airbeast001.utc b/nwnds_module/ds_airbeast001.utc new file mode 100644 index 000000000..36904776c Binary files /dev/null and b/nwnds_module/ds_airbeast001.utc differ diff --git a/nwnds_module/ds_alc_ondisturb.ncs b/nwnds_module/ds_alc_ondisturb.ncs new file mode 100644 index 000000000..f9d616a6b Binary files /dev/null and b/nwnds_module/ds_alc_ondisturb.ncs differ diff --git a/nwnds_module/ds_alc_ondisturb.nss b/nwnds_module/ds_alc_ondisturb.nss new file mode 100644 index 000000000..dd9f51627 --- /dev/null +++ b/nwnds_module/ds_alc_ondisturb.nss @@ -0,0 +1,5 @@ +#include "wow_inc_forge" +void main() +{ + wow_Forge(); +} diff --git a/nwnds_module/ds_alc_onused.ncs b/nwnds_module/ds_alc_onused.ncs new file mode 100644 index 000000000..67f9feb83 Binary files /dev/null and b/nwnds_module/ds_alc_onused.ncs differ diff --git a/nwnds_module/ds_alc_onused.nss b/nwnds_module/ds_alc_onused.nss new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/nwnds_module/ds_alc_onused.nss @@ -0,0 +1 @@ + diff --git a/nwnds_module/ds_altlt_sil001.uti b/nwnds_module/ds_altlt_sil001.uti new file mode 100644 index 000000000..820728bd3 Binary files /dev/null and b/nwnds_module/ds_altlt_sil001.uti differ diff --git a/nwnds_module/ds_altlt_sil002.uti b/nwnds_module/ds_altlt_sil002.uti new file mode 100644 index 000000000..b9185cbb9 Binary files /dev/null and b/nwnds_module/ds_altlt_sil002.uti differ diff --git a/nwnds_module/ds_altlt_sil003.uti b/nwnds_module/ds_altlt_sil003.uti new file mode 100644 index 000000000..e9bdbcda3 Binary files /dev/null and b/nwnds_module/ds_altlt_sil003.uti differ diff --git a/nwnds_module/ds_altlt_sil004.uti b/nwnds_module/ds_altlt_sil004.uti new file mode 100644 index 000000000..bc9230a3b Binary files /dev/null and b/nwnds_module/ds_altlt_sil004.uti differ diff --git a/nwnds_module/ds_altlt_sil005.uti b/nwnds_module/ds_altlt_sil005.uti new file mode 100644 index 000000000..3601fdff2 Binary files /dev/null and b/nwnds_module/ds_altlt_sil005.uti differ diff --git a/nwnds_module/ds_altlt_sil006.uti b/nwnds_module/ds_altlt_sil006.uti new file mode 100644 index 000000000..068f59816 Binary files /dev/null and b/nwnds_module/ds_altlt_sil006.uti differ diff --git a/nwnds_module/ds_altlt_sil007.uti b/nwnds_module/ds_altlt_sil007.uti new file mode 100644 index 000000000..94100770b Binary files /dev/null and b/nwnds_module/ds_altlt_sil007.uti differ diff --git a/nwnds_module/ds_altlt_sil008.uti b/nwnds_module/ds_altlt_sil008.uti new file mode 100644 index 000000000..841571f25 Binary files /dev/null and b/nwnds_module/ds_altlt_sil008.uti differ diff --git a/nwnds_module/ds_altlt_sil009.uti b/nwnds_module/ds_altlt_sil009.uti new file mode 100644 index 000000000..ab76d5c35 Binary files /dev/null and b/nwnds_module/ds_altlt_sil009.uti differ diff --git a/nwnds_module/ds_altlt_tomai.uti b/nwnds_module/ds_altlt_tomai.uti new file mode 100644 index 000000000..a703ef86b Binary files /dev/null and b/nwnds_module/ds_altlt_tomai.uti differ diff --git a/nwnds_module/ds_altsl_sil001.uti b/nwnds_module/ds_altsl_sil001.uti new file mode 100644 index 000000000..f6b72e9bb Binary files /dev/null and b/nwnds_module/ds_altsl_sil001.uti differ diff --git a/nwnds_module/ds_altsl_sil002.uti b/nwnds_module/ds_altsl_sil002.uti new file mode 100644 index 000000000..89c2fd894 Binary files /dev/null and b/nwnds_module/ds_altsl_sil002.uti differ diff --git a/nwnds_module/ds_amclbp_basetu.uti b/nwnds_module/ds_amclbp_basetu.uti new file mode 100644 index 000000000..685bb5ce0 Binary files /dev/null and b/nwnds_module/ds_amclbp_basetu.uti differ diff --git a/nwnds_module/ds_amclrb_urtmpl.uti b/nwnds_module/ds_amclrb_urtmpl.uti new file mode 100644 index 000000000..71e281e15 Binary files /dev/null and b/nwnds_module/ds_amclrb_urtmpl.uti differ diff --git a/nwnds_module/ds_amdbp_kled001.uti b/nwnds_module/ds_amdbp_kled001.uti new file mode 100644 index 000000000..3f4cf6942 Binary files /dev/null and b/nwnds_module/ds_amdbp_kled001.uti differ diff --git a/nwnds_module/ds_amdbp_kled002.uti b/nwnds_module/ds_amdbp_kled002.uti new file mode 100644 index 000000000..2d083b619 Binary files /dev/null and b/nwnds_module/ds_amdbp_kled002.uti differ diff --git a/nwnds_module/ds_amdbp_kled003.uti b/nwnds_module/ds_amdbp_kled003.uti new file mode 100644 index 000000000..f6073be98 Binary files /dev/null and b/nwnds_module/ds_amdbp_kled003.uti differ diff --git a/nwnds_module/ds_amltlt_babau.uti b/nwnds_module/ds_amltlt_babau.uti new file mode 100644 index 000000000..fbf71a87c Binary files /dev/null and b/nwnds_module/ds_amltlt_babau.uti differ diff --git a/nwnds_module/ds_amltsl_tormnd.uti b/nwnds_module/ds_amltsl_tormnd.uti new file mode 100644 index 000000000..b26bd6b3c Binary files /dev/null and b/nwnds_module/ds_amltsl_tormnd.uti differ diff --git a/nwnds_module/ds_amltsl_uriktm.uti b/nwnds_module/ds_amltsl_uriktm.uti new file mode 100644 index 000000000..e95dc1a96 Binary files /dev/null and b/nwnds_module/ds_amltsl_uriktm.uti differ diff --git a/nwnds_module/ds_ammdbp_strabo.uti b/nwnds_module/ds_ammdbp_strabo.uti new file mode 100644 index 000000000..3fd3ca3e1 Binary files /dev/null and b/nwnds_module/ds_ammdbp_strabo.uti differ diff --git a/nwnds_module/ds_amuletexit.ncs b/nwnds_module/ds_amuletexit.ncs new file mode 100644 index 000000000..84f85ad1a Binary files /dev/null and b/nwnds_module/ds_amuletexit.ncs differ diff --git a/nwnds_module/ds_amuletexit.nss b/nwnds_module/ds_amuletexit.nss new file mode 100644 index 000000000..81d7cea1e --- /dev/null +++ b/nwnds_module/ds_amuletexit.nss @@ -0,0 +1,10 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +string sDoor = GetTag(OBJECT_SELF); +int num = Random(9) + 1; +string sExit = "MD"+IntToString(num); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +string sWP = GetLocalString(oPC, sDoor); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag(sExit)))); +} diff --git a/nwnds_module/ds_anvil_ondstrb.ncs b/nwnds_module/ds_anvil_ondstrb.ncs new file mode 100644 index 000000000..f9d616a6b Binary files /dev/null and b/nwnds_module/ds_anvil_ondstrb.ncs differ diff --git a/nwnds_module/ds_anvil_ondstrb.nss b/nwnds_module/ds_anvil_ondstrb.nss new file mode 100644 index 000000000..dd9f51627 --- /dev/null +++ b/nwnds_module/ds_anvil_ondstrb.nss @@ -0,0 +1,5 @@ +#include "wow_inc_forge" +void main() +{ + wow_Forge(); +} diff --git a/nwnds_module/ds_anvil_onused.ncs b/nwnds_module/ds_anvil_onused.ncs new file mode 100644 index 000000000..a8990626d Binary files /dev/null and b/nwnds_module/ds_anvil_onused.ncs differ diff --git a/nwnds_module/ds_anvil_onused.nss b/nwnds_module/ds_anvil_onused.nss new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/nwnds_module/ds_anvil_onused.nss @@ -0,0 +1 @@ + diff --git a/nwnds_module/ds_aprig001.utc b/nwnds_module/ds_aprig001.utc new file mode 100644 index 000000000..e77f2be91 Binary files /dev/null and b/nwnds_module/ds_aprig001.utc differ diff --git a/nwnds_module/ds_ashgolem001.utc b/nwnds_module/ds_ashgolem001.utc new file mode 100644 index 000000000..78c07c0bb Binary files /dev/null and b/nwnds_module/ds_ashgolem001.utc differ diff --git a/nwnds_module/ds_ashgolem002.utc b/nwnds_module/ds_ashgolem002.utc new file mode 100644 index 000000000..3b275f306 Binary files /dev/null and b/nwnds_module/ds_ashgolem002.utc differ diff --git a/nwnds_module/ds_athdolphin001.utc b/nwnds_module/ds_athdolphin001.utc new file mode 100644 index 000000000..89f4eefa4 Binary files /dev/null and b/nwnds_module/ds_athdolphin001.utc differ diff --git a/nwnds_module/ds_athshark001.utc b/nwnds_module/ds_athshark001.utc new file mode 100644 index 000000000..562621f01 Binary files /dev/null and b/nwnds_module/ds_athshark001.utc differ diff --git a/nwnds_module/ds_athsloth001.utc b/nwnds_module/ds_athsloth001.utc new file mode 100644 index 000000000..f0e567cb7 Binary files /dev/null and b/nwnds_module/ds_athsloth001.utc differ diff --git a/nwnds_module/ds_awningtent01.utp b/nwnds_module/ds_awningtent01.utp new file mode 100644 index 000000000..eba725408 Binary files /dev/null and b/nwnds_module/ds_awningtent01.utp differ diff --git a/nwnds_module/ds_baazrag001.utc b/nwnds_module/ds_baazrag001.utc new file mode 100644 index 000000000..9eafec18c Binary files /dev/null and b/nwnds_module/ds_baazrag001.utc differ diff --git a/nwnds_module/ds_babau_001.utc b/nwnds_module/ds_babau_001.utc new file mode 100644 index 000000000..5f510be47 Binary files /dev/null and b/nwnds_module/ds_babau_001.utc differ diff --git a/nwnds_module/ds_babau_002.utc b/nwnds_module/ds_babau_002.utc new file mode 100644 index 000000000..e7f2568d7 Binary files /dev/null and b/nwnds_module/ds_babau_002.utc differ diff --git a/nwnds_module/ds_babau_boss.utc b/nwnds_module/ds_babau_boss.utc new file mode 100644 index 000000000..9515143bd Binary files /dev/null and b/nwnds_module/ds_babau_boss.utc differ diff --git a/nwnds_module/ds_barrier1.ncs b/nwnds_module/ds_barrier1.ncs new file mode 100644 index 000000000..c09e0bbfd Binary files /dev/null and b/nwnds_module/ds_barrier1.ncs differ diff --git a/nwnds_module/ds_barrier1.nss b/nwnds_module/ds_barrier1.nss new file mode 100644 index 000000000..852d49afd --- /dev/null +++ b/nwnds_module/ds_barrier1.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetEnteringObject(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "clockworkamulet"); +if (GetIsObjectValid(oItemToTake)) +{ +FloatingTextStringOnCreature("The Clockwork Amulet glows softly.", oPC, FALSE); +AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Barrier1")))); +} +} diff --git a/nwnds_module/ds_barrier2.ncs b/nwnds_module/ds_barrier2.ncs new file mode 100644 index 000000000..fd717b1c8 Binary files /dev/null and b/nwnds_module/ds_barrier2.ncs differ diff --git a/nwnds_module/ds_barrier2.nss b/nwnds_module/ds_barrier2.nss new file mode 100644 index 000000000..60086c4df --- /dev/null +++ b/nwnds_module/ds_barrier2.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetEnteringObject(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "clockworkamul001"); +if (GetIsObjectValid(oItemToTake)) +{ +FloatingTextStringOnCreature("The Clockwork Amulet glows softly.", oPC, FALSE); +AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Barrier2")))); +} +} diff --git a/nwnds_module/ds_barrier3.ncs b/nwnds_module/ds_barrier3.ncs new file mode 100644 index 000000000..2b2ebadf1 Binary files /dev/null and b/nwnds_module/ds_barrier3.ncs differ diff --git a/nwnds_module/ds_barrier3.nss b/nwnds_module/ds_barrier3.nss new file mode 100644 index 000000000..bc3b67f52 --- /dev/null +++ b/nwnds_module/ds_barrier3.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetEnteringObject(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "clockworkamulet"); +if (GetIsObjectValid(oItemToTake)) +{ +FloatingTextStringOnCreature("The Clockwork Amulet glows softly.", oPC, FALSE); +AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Barrier3")))); +} +} diff --git a/nwnds_module/ds_barrier4.ncs b/nwnds_module/ds_barrier4.ncs new file mode 100644 index 000000000..0e2cda902 Binary files /dev/null and b/nwnds_module/ds_barrier4.ncs differ diff --git a/nwnds_module/ds_barrier4.nss b/nwnds_module/ds_barrier4.nss new file mode 100644 index 000000000..ec6ba6b45 --- /dev/null +++ b/nwnds_module/ds_barrier4.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetEnteringObject(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "clockworkamul001"); +if (GetIsObjectValid(oItemToTake)) +{ +FloatingTextStringOnCreature("The Clockwork Amulet glows softly.", oPC, FALSE); +AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Barrier4")))); +} +} diff --git a/nwnds_module/ds_barrier5.ncs b/nwnds_module/ds_barrier5.ncs new file mode 100644 index 000000000..5adbc1e71 Binary files /dev/null and b/nwnds_module/ds_barrier5.ncs differ diff --git a/nwnds_module/ds_barrier5.nss b/nwnds_module/ds_barrier5.nss new file mode 100644 index 000000000..432f8fea7 --- /dev/null +++ b/nwnds_module/ds_barrier5.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetEnteringObject(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "clockworkamul002"); +if (GetIsObjectValid(oItemToTake)) +{ +FloatingTextStringOnCreature("The Clockwork Amulet glows softly.", oPC, FALSE); +AssignCommand(oPC, ActionJumpToLocation(GetLocation(GetObjectByTag("WPAmuletRoom3")))); +} +} diff --git a/nwnds_module/ds_basicitems.ncs b/nwnds_module/ds_basicitems.ncs new file mode 100644 index 000000000..966012237 Binary files /dev/null and b/nwnds_module/ds_basicitems.ncs differ diff --git a/nwnds_module/ds_basicitems.nss b/nwnds_module/ds_basicitems.nss new file mode 100644 index 000000000..816e68b3b --- /dev/null +++ b/nwnds_module/ds_basicitems.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("BasicItems"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ds_bed_used.ncs b/nwnds_module/ds_bed_used.ncs new file mode 100644 index 000000000..6130c87e8 Binary files /dev/null and b/nwnds_module/ds_bed_used.ncs differ diff --git a/nwnds_module/ds_bed_used.nss b/nwnds_module/ds_bed_used.nss new file mode 100644 index 000000000..1ca1f659e --- /dev/null +++ b/nwnds_module/ds_bed_used.nss @@ -0,0 +1,18 @@ +void main() +{ + // BedrollOnUsed.NSS + // 7/01/02 Jesse Fox + // TBP: in OnUsed event of bedroll placeable + object oPC = GetLastUsedBy(); + if (GetDistanceBetween(oPC, OBJECT_SELF) < 2.8) + { + SetLocalObject(oPC, "inbed", OBJECT_SELF); + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, SetFacing(GetFacing(OBJECT_SELF))); + AssignCommand(oPC, ActionRest()); + DelayCommand(20.0,DeleteLocalObject(oPC, "inbed")); + } + else + FloatingTextStringOnCreature("You are too far away.",oPC,FALSE); +} + diff --git a/nwnds_module/ds_bed_usedb.ncs b/nwnds_module/ds_bed_usedb.ncs new file mode 100644 index 000000000..fb2a31739 Binary files /dev/null and b/nwnds_module/ds_bed_usedb.ncs differ diff --git a/nwnds_module/ds_bed_usedb.nss b/nwnds_module/ds_bed_usedb.nss new file mode 100644 index 000000000..a6b95c53b --- /dev/null +++ b/nwnds_module/ds_bed_usedb.nss @@ -0,0 +1,25 @@ +void main() +{ + // BedrollOnUsed.NSS + // 7/01/02 Jesse Fox + // TBP: in OnUsed event of bedroll placeable + object oPC = GetLastUsedBy(); + +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "RedFactionHelm"); +if(GetIsObjectValid(oItemToTake) != 0) { +ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(),oPC); +FloatingTextStringOnCreature("You have been killed in your sleep.",oPC,FALSE); +} + if (GetDistanceBetween(oPC, OBJECT_SELF) < 2.8) + { + SetLocalObject(oPC, "inbed", OBJECT_SELF); + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, SetFacing(GetFacing(OBJECT_SELF))); + AssignCommand(oPC, ActionRest()); + DelayCommand(20.0,DeleteLocalObject(oPC, "inbed")); + } + else + FloatingTextStringOnCreature("You are too far away.",oPC,FALSE); +} + diff --git a/nwnds_module/ds_bed_usedr.ncs b/nwnds_module/ds_bed_usedr.ncs new file mode 100644 index 000000000..feb1cd745 Binary files /dev/null and b/nwnds_module/ds_bed_usedr.ncs differ diff --git a/nwnds_module/ds_bed_usedr.nss b/nwnds_module/ds_bed_usedr.nss new file mode 100644 index 000000000..6e1a676b8 --- /dev/null +++ b/nwnds_module/ds_bed_usedr.nss @@ -0,0 +1,26 @@ +void main() +{ + // BedrollOnUsed.NSS + // 7/01/02 Jesse Fox + // TBP: in OnUsed event of bedroll placeable + object oPC = GetLastUsedBy(); +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "BlueFactionHelm"); +if(GetIsObjectValid(oItemToTake) != 0) { +ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(),oPC); +FloatingTextStringOnCreature("You have been killed in your sleep.",oPC,FALSE); +} + + + if (GetDistanceBetween(oPC, OBJECT_SELF) < 2.8) + { + SetLocalObject(oPC, "inbed", OBJECT_SELF); + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, SetFacing(GetFacing(OBJECT_SELF))); + AssignCommand(oPC, ActionRest()); + DelayCommand(20.0,DeleteLocalObject(oPC, "inbed")); + } + else + FloatingTextStringOnCreature("You are too far away.",oPC,FALSE); +} + diff --git a/nwnds_module/ds_belgoi_claw_c.uti b/nwnds_module/ds_belgoi_claw_c.uti new file mode 100644 index 000000000..6c942730d Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_c.uti differ diff --git a/nwnds_module/ds_belgoi_claw_d.uti b/nwnds_module/ds_belgoi_claw_d.uti new file mode 100644 index 000000000..0085264a6 Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_d.uti differ diff --git a/nwnds_module/ds_belgoi_claw_f.uti b/nwnds_module/ds_belgoi_claw_f.uti new file mode 100644 index 000000000..6527facd6 Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_f.uti differ diff --git a/nwnds_module/ds_belgoi_claw_g.uti b/nwnds_module/ds_belgoi_claw_g.uti new file mode 100644 index 000000000..f0503b1c6 Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_g.uti differ diff --git a/nwnds_module/ds_belgoi_claw_h.uti b/nwnds_module/ds_belgoi_claw_h.uti new file mode 100644 index 000000000..8c579e60c Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_h.uti differ diff --git a/nwnds_module/ds_belgoi_claw_l.uti b/nwnds_module/ds_belgoi_claw_l.uti new file mode 100644 index 000000000..a517a84df Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_l.uti differ diff --git a/nwnds_module/ds_belgoi_claw_m.uti b/nwnds_module/ds_belgoi_claw_m.uti new file mode 100644 index 000000000..359df3b25 Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_m.uti differ diff --git a/nwnds_module/ds_belgoi_claw_s.uti b/nwnds_module/ds_belgoi_claw_s.uti new file mode 100644 index 000000000..d5708d9de Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_s.uti differ diff --git a/nwnds_module/ds_belgoi_claw_t.uti b/nwnds_module/ds_belgoi_claw_t.uti new file mode 100644 index 000000000..63b79f60e Binary files /dev/null and b/nwnds_module/ds_belgoi_claw_t.uti differ diff --git a/nwnds_module/ds_bite_sltsrp04.uti b/nwnds_module/ds_bite_sltsrp04.uti new file mode 100644 index 000000000..7b14fe6ff Binary files /dev/null and b/nwnds_module/ds_bite_sltsrp04.uti differ diff --git a/nwnds_module/ds_bloodgrass001.utc b/nwnds_module/ds_bloodgrass001.utc new file mode 100644 index 000000000..1d379fb04 Binary files /dev/null and b/nwnds_module/ds_bloodgrass001.utc differ diff --git a/nwnds_module/ds_blosskill001.utc b/nwnds_module/ds_blosskill001.utc new file mode 100644 index 000000000..9d7b1e5ba Binary files /dev/null and b/nwnds_module/ds_blosskill001.utc differ diff --git a/nwnds_module/ds_boabatree01.utp b/nwnds_module/ds_boabatree01.utp new file mode 100644 index 000000000..379724959 Binary files /dev/null and b/nwnds_module/ds_boabatree01.utp differ diff --git a/nwnds_module/ds_bogosnake001.utc b/nwnds_module/ds_bogosnake001.utc new file mode 100644 index 000000000..9f7df925a Binary files /dev/null and b/nwnds_module/ds_bogosnake001.utc differ diff --git a/nwnds_module/ds_bogwader001.utc b/nwnds_module/ds_bogwader001.utc new file mode 100644 index 000000000..c69a953ae Binary files /dev/null and b/nwnds_module/ds_bogwader001.utc differ diff --git a/nwnds_module/ds_boringb001.utc b/nwnds_module/ds_boringb001.utc new file mode 100644 index 000000000..e0c85efe8 Binary files /dev/null and b/nwnds_module/ds_boringb001.utc differ diff --git a/nwnds_module/ds_bottlegrd001.utp b/nwnds_module/ds_bottlegrd001.utp new file mode 100644 index 000000000..7485cd959 Binary files /dev/null and b/nwnds_module/ds_bottlegrd001.utp differ diff --git a/nwnds_module/ds_bottlegrd002.utp b/nwnds_module/ds_bottlegrd002.utp new file mode 100644 index 000000000..daafd3564 Binary files /dev/null and b/nwnds_module/ds_bottlegrd002.utp differ diff --git a/nwnds_module/ds_brainseed001.utc b/nwnds_module/ds_brainseed001.utc new file mode 100644 index 000000000..c63e8b155 Binary files /dev/null and b/nwnds_module/ds_brainseed001.utc differ diff --git a/nwnds_module/ds_brasspipe001.utp b/nwnds_module/ds_brasspipe001.utp new file mode 100644 index 000000000..8ef5e5574 Binary files /dev/null and b/nwnds_module/ds_brasspipe001.utp differ diff --git a/nwnds_module/ds_brazier001.utp b/nwnds_module/ds_brazier001.utp new file mode 100644 index 000000000..0192366b5 Binary files /dev/null and b/nwnds_module/ds_brazier001.utp differ diff --git a/nwnds_module/ds_brohg001.utc b/nwnds_module/ds_brohg001.utc new file mode 100644 index 000000000..7f00f95dc Binary files /dev/null and b/nwnds_module/ds_brohg001.utc differ diff --git a/nwnds_module/ds_cactus003.utp b/nwnds_module/ds_cactus003.utp new file mode 100644 index 000000000..e43a41028 Binary files /dev/null and b/nwnds_module/ds_cactus003.utp differ diff --git a/nwnds_module/ds_cactus004.utp b/nwnds_module/ds_cactus004.utp new file mode 100644 index 000000000..c3c567677 Binary files /dev/null and b/nwnds_module/ds_cactus004.utp differ diff --git a/nwnds_module/ds_cactus006.utp b/nwnds_module/ds_cactus006.utp new file mode 100644 index 000000000..0599be521 Binary files /dev/null and b/nwnds_module/ds_cactus006.utp differ diff --git a/nwnds_module/ds_cactus02.utp b/nwnds_module/ds_cactus02.utp new file mode 100644 index 000000000..b4828e276 Binary files /dev/null and b/nwnds_module/ds_cactus02.utp differ diff --git a/nwnds_module/ds_callguards.ncs b/nwnds_module/ds_callguards.ncs new file mode 100644 index 000000000..5b6899303 Binary files /dev/null and b/nwnds_module/ds_callguards.ncs differ diff --git a/nwnds_module/ds_callguards.nss b/nwnds_module/ds_callguards.nss new file mode 100644 index 000000000..526f50657 --- /dev/null +++ b/nwnds_module/ds_callguards.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: Default: Commoner Calls Guards +//:: ds_callguards +//::////////////////////////////////////////////// + +void main() +{ + object oPC = GetLastDisturbed(); + ExecuteScript("prc_npc_disturb", OBJECT_SELF); + if(GetIsDM(oPC) || GetIsDMPossessed(oPC) || !GetIsPC(oPC)) + { + string sMsg ="Thank you master, may I have another?"; + SpeakString(sMsg, TALKVOLUME_WHISPER); + return; + } + +SpeakString("Guards! Help! Thief!", TALKVOLUME_TALK); +DelayCommand(2.0,AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Jail"))))); +DelayCommand(6.0,FloatingTextStringOnCreature(GetName(oPC)+" has been arrested for theft.",oPC,FALSE)); + +} diff --git a/nwnds_module/ds_canbluffva.ncs b/nwnds_module/ds_canbluffva.ncs new file mode 100644 index 000000000..a57cfe0fe Binary files /dev/null and b/nwnds_module/ds_canbluffva.ncs differ diff --git a/nwnds_module/ds_canbluffva.nss b/nwnds_module/ds_canbluffva.nss new file mode 100644 index 000000000..e4d613ad7 --- /dev/null +++ b/nwnds_module/ds_canbluffva.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetHitDice(oPC) < 35) return FALSE; + +if (GetAlignmentGoodEvil(oPC) != ALIGNMENT_EVIL) return FALSE; + +if (!GetHasSkill(SKILL_BLUFF, oPC)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ds_carru001.utc b/nwnds_module/ds_carru001.utc new file mode 100644 index 000000000..03ab275e7 Binary files /dev/null and b/nwnds_module/ds_carru001.utc differ diff --git a/nwnds_module/ds_carru002.utc b/nwnds_module/ds_carru002.utc new file mode 100644 index 000000000..c66d203e4 Binary files /dev/null and b/nwnds_module/ds_carru002.utc differ diff --git a/nwnds_module/ds_chasmheart01.utc b/nwnds_module/ds_chasmheart01.utc new file mode 100644 index 000000000..253eae19f Binary files /dev/null and b/nwnds_module/ds_chasmheart01.utc differ diff --git a/nwnds_module/ds_chasmheart02.utc b/nwnds_module/ds_chasmheart02.utc new file mode 100644 index 000000000..0564ee042 Binary files /dev/null and b/nwnds_module/ds_chasmheart02.utc differ diff --git a/nwnds_module/ds_checkforskull.ncs b/nwnds_module/ds_checkforskull.ncs new file mode 100644 index 000000000..c659edbba Binary files /dev/null and b/nwnds_module/ds_checkforskull.ncs differ diff --git a/nwnds_module/ds_checkforskull.nss b/nwnds_module/ds_checkforskull.nss new file mode 100644 index 000000000..39e7c27d5 --- /dev/null +++ b/nwnds_module/ds_checkforskull.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_checkforskull +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 4:07:48 PM +//::////////////////////////////////////////////// +int GetNumItems(object oTarget,string sItem) +{ +int nNumItems = 0; +object oItem = GetFirstItemInInventory(oTarget); +while (GetIsObjectValid(oItem) == TRUE) +{ +if (GetTag(oItem) == sItem) +{ +nNumItems = nNumItems + GetNumStackedItems(oItem); +} +oItem = GetNextItemInInventory(oTarget); +} +return nNumItems; +} + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetNumItems(oPC, "CRFT_GIANTSKULL") < 1) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ds_chesia.dlg b/nwnds_module/ds_chesia.dlg new file mode 100644 index 000000000..8405911ef Binary files /dev/null and b/nwnds_module/ds_chesia.dlg differ diff --git a/nwnds_module/ds_cilops001.utc b/nwnds_module/ds_cilops001.utc new file mode 100644 index 000000000..58b4d1778 Binary files /dev/null and b/nwnds_module/ds_cilops001.utc differ diff --git a/nwnds_module/ds_cistern.ncs b/nwnds_module/ds_cistern.ncs new file mode 100644 index 000000000..aead03c21 Binary files /dev/null and b/nwnds_module/ds_cistern.ncs differ diff --git a/nwnds_module/ds_cistern.nss b/nwnds_module/ds_cistern.nss new file mode 100644 index 000000000..659e9eb01 --- /dev/null +++ b/nwnds_module/ds_cistern.nss @@ -0,0 +1,5 @@ +void main() +{ +AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("CISTERN")))); +DelayCommand(5.0,FloatingTextStringOnCreature("There is a Cistern under the bed.",GetLastUsedBy(),FALSE)); +} diff --git a/nwnds_module/ds_claygolem001.utc b/nwnds_module/ds_claygolem001.utc new file mode 100644 index 000000000..b913f6030 Binary files /dev/null and b/nwnds_module/ds_claygolem001.utc differ diff --git a/nwnds_module/ds_clockmaze.ncs b/nwnds_module/ds_clockmaze.ncs new file mode 100644 index 000000000..ffaa2b406 Binary files /dev/null and b/nwnds_module/ds_clockmaze.ncs differ diff --git a/nwnds_module/ds_clockmaze.nss b/nwnds_module/ds_clockmaze.nss new file mode 100644 index 000000000..00f867537 --- /dev/null +++ b/nwnds_module/ds_clockmaze.nss @@ -0,0 +1,38 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +int num; +num = Random(9) + 1; +string sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor1", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor2", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor3", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor4", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor5", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor6", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor7", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor8", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor9", sExit); +num = Random(9) + 1; +string sDoor = "MazeDoor"+IntToString(num); +SetLocalString(oPC, sDoor, "WPAmuletRoom1"); +SetLocalString(oPC, "MazeEntrance1", "ME1"); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("MEnt1")))); +} diff --git a/nwnds_module/ds_clockmaze1.ncs b/nwnds_module/ds_clockmaze1.ncs new file mode 100644 index 000000000..110eeeb57 Binary files /dev/null and b/nwnds_module/ds_clockmaze1.ncs differ diff --git a/nwnds_module/ds_clockmaze1.ndb b/nwnds_module/ds_clockmaze1.ndb new file mode 100644 index 000000000..6b4c77ed0 --- /dev/null +++ b/nwnds_module/ds_clockmaze1.ndb @@ -0,0 +1,49 @@ +NDB V1.0 +0000001 0000001 0000002 0000004 0000036 +N00 ds_clockmaze1 +s 03 vector +sf f x +sf f y +sf f z +f 00000015 000004f4 000 v main +f 0000000d 00000015 000 v #loader +v 0000003f 000004ec 00000000 o oPC +v 00000084 000004ec 00000004 i num +v 000000a7 000004ec 00000008 s sExit +v 0000043f 000004ec 0000000c s sDoor +l00 0000003 00000015 0000003d +l00 0000004 0000003d 00000082 +l00 0000005 00000082 00000084 +l00 0000006 00000084 000000a5 +l00 0000007 000000a5 000000ca +l00 0000008 000000ca 000000ec +l00 0000009 000000ec 0000010d +l00 0000010 0000010d 00000130 +l00 0000011 00000130 00000152 +l00 0000012 00000152 00000173 +l00 0000013 00000173 00000196 +l00 0000014 00000196 000001b8 +l00 0000015 000001b8 000001d9 +l00 0000016 000001d9 000001fc +l00 0000017 000001fc 0000021e +l00 0000018 0000021e 0000023f +l00 0000019 0000023f 00000262 +l00 0000020 00000262 00000284 +l00 0000021 00000284 000002a5 +l00 0000022 000002a5 000002c8 +l00 0000023 000002c8 000002ea +l00 0000024 000002ea 0000030b +l00 0000025 0000030b 0000032e +l00 0000026 0000032e 00000350 +l00 0000027 00000350 00000371 +l00 0000028 00000371 00000394 +l00 0000029 00000394 000003b6 +l00 0000030 000003b6 000003d7 +l00 0000031 000003d7 000003fa +l00 0000032 000003fa 0000041c +l00 0000033 0000041c 0000043d +l00 0000034 0000043d 00000468 +l00 0000035 00000468 0000048e +l00 0000036 0000048e 000004af +l00 0000037 000004af 000004ec +l00 0000038 000004f2 000004f4 diff --git a/nwnds_module/ds_clockmaze1.nss b/nwnds_module/ds_clockmaze1.nss new file mode 100644 index 000000000..798c410f0 --- /dev/null +++ b/nwnds_module/ds_clockmaze1.nss @@ -0,0 +1,38 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +int num; +num = Random(9) + 1; +string sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor1", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor2", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor3", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor4", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor5", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor6", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor7", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor8", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor9", sExit); +num = Random(9) + 1; +string sDoor = "MazeDoor"+IntToString(num); +SetLocalString(oPC, sDoor, "WPAmuletRoom1"); +SetLocalString(oPC, "MazeExit1", "ME1"); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("MEnt1")))); +} diff --git a/nwnds_module/ds_clockmaze2.ncs b/nwnds_module/ds_clockmaze2.ncs new file mode 100644 index 000000000..57466e60c Binary files /dev/null and b/nwnds_module/ds_clockmaze2.ncs differ diff --git a/nwnds_module/ds_clockmaze2.ndb b/nwnds_module/ds_clockmaze2.ndb new file mode 100644 index 000000000..fb8fd6614 --- /dev/null +++ b/nwnds_module/ds_clockmaze2.ndb @@ -0,0 +1,49 @@ +NDB V1.0 +0000001 0000001 0000002 0000004 0000036 +N00 ds_clockmaze2 +s 03 vector +sf f x +sf f y +sf f z +f 00000015 000004f4 000 v main +f 0000000d 00000015 000 v #loader +v 0000003f 000004ec 00000000 o oPC +v 00000084 000004ec 00000004 i num +v 000000a7 000004ec 00000008 s sExit +v 0000043f 000004ec 0000000c s sDoor +l00 0000003 00000015 0000003d +l00 0000004 0000003d 00000082 +l00 0000005 00000082 00000084 +l00 0000006 00000084 000000a5 +l00 0000007 000000a5 000000ca +l00 0000008 000000ca 000000ec +l00 0000009 000000ec 0000010d +l00 0000010 0000010d 00000130 +l00 0000011 00000130 00000152 +l00 0000012 00000152 00000173 +l00 0000013 00000173 00000196 +l00 0000014 00000196 000001b8 +l00 0000015 000001b8 000001d9 +l00 0000016 000001d9 000001fc +l00 0000017 000001fc 0000021e +l00 0000018 0000021e 0000023f +l00 0000019 0000023f 00000262 +l00 0000020 00000262 00000284 +l00 0000021 00000284 000002a5 +l00 0000022 000002a5 000002c8 +l00 0000023 000002c8 000002ea +l00 0000024 000002ea 0000030b +l00 0000025 0000030b 0000032e +l00 0000026 0000032e 00000350 +l00 0000027 00000350 00000371 +l00 0000028 00000371 00000394 +l00 0000029 00000394 000003b6 +l00 0000030 000003b6 000003d7 +l00 0000031 000003d7 000003fa +l00 0000032 000003fa 0000041c +l00 0000033 0000041c 0000043d +l00 0000034 0000043d 00000468 +l00 0000035 00000468 0000048e +l00 0000036 0000048e 000004af +l00 0000037 000004af 000004ec +l00 0000038 000004f2 000004f4 diff --git a/nwnds_module/ds_clockmaze2.nss b/nwnds_module/ds_clockmaze2.nss new file mode 100644 index 000000000..2053ce262 --- /dev/null +++ b/nwnds_module/ds_clockmaze2.nss @@ -0,0 +1,38 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +int num; +num = Random(9) + 1; +string sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor1", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor2", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor3", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor4", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor5", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor6", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor7", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor8", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor9", sExit); +num = Random(9) + 1; +string sDoor = "MazeDoor"+IntToString(num); +SetLocalString(oPC, sDoor, "WPAmuletRoom2"); +SetLocalString(oPC, "MazeExit1", "ME2"); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("MEnt1")))); +} diff --git a/nwnds_module/ds_clockmaze3.ncs b/nwnds_module/ds_clockmaze3.ncs new file mode 100644 index 000000000..c39b0e2cb Binary files /dev/null and b/nwnds_module/ds_clockmaze3.ncs differ diff --git a/nwnds_module/ds_clockmaze3.ndb b/nwnds_module/ds_clockmaze3.ndb new file mode 100644 index 000000000..1dc8d4d60 --- /dev/null +++ b/nwnds_module/ds_clockmaze3.ndb @@ -0,0 +1,49 @@ +NDB V1.0 +0000001 0000001 0000002 0000004 0000036 +N00 ds_clockmaze3 +s 03 vector +sf f x +sf f y +sf f z +f 00000015 000004f4 000 v main +f 0000000d 00000015 000 v #loader +v 0000003f 000004ec 00000000 o oPC +v 00000084 000004ec 00000004 i num +v 000000a7 000004ec 00000008 s sExit +v 0000043f 000004ec 0000000c s sDoor +l00 0000003 00000015 0000003d +l00 0000004 0000003d 00000082 +l00 0000005 00000082 00000084 +l00 0000006 00000084 000000a5 +l00 0000007 000000a5 000000ca +l00 0000008 000000ca 000000ec +l00 0000009 000000ec 0000010d +l00 0000010 0000010d 00000130 +l00 0000011 00000130 00000152 +l00 0000012 00000152 00000173 +l00 0000013 00000173 00000196 +l00 0000014 00000196 000001b8 +l00 0000015 000001b8 000001d9 +l00 0000016 000001d9 000001fc +l00 0000017 000001fc 0000021e +l00 0000018 0000021e 0000023f +l00 0000019 0000023f 00000262 +l00 0000020 00000262 00000284 +l00 0000021 00000284 000002a5 +l00 0000022 000002a5 000002c8 +l00 0000023 000002c8 000002ea +l00 0000024 000002ea 0000030b +l00 0000025 0000030b 0000032e +l00 0000026 0000032e 00000350 +l00 0000027 00000350 00000371 +l00 0000028 00000371 00000394 +l00 0000029 00000394 000003b6 +l00 0000030 000003b6 000003d7 +l00 0000031 000003d7 000003fa +l00 0000032 000003fa 0000041c +l00 0000033 0000041c 0000043d +l00 0000034 0000043d 00000468 +l00 0000035 00000468 0000048e +l00 0000036 0000048e 000004af +l00 0000037 000004af 000004ec +l00 0000038 000004f2 000004f4 diff --git a/nwnds_module/ds_clockmaze3.nss b/nwnds_module/ds_clockmaze3.nss new file mode 100644 index 000000000..11a9cf325 --- /dev/null +++ b/nwnds_module/ds_clockmaze3.nss @@ -0,0 +1,38 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +int num; +num = Random(9) + 1; +string sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor1", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor2", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor3", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor4", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor5", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor6", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor7", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor8", sExit); +num = Random(9) + 1; +sExit = "MD"+IntToString(num); +SetLocalString(oPC, "MazeDoor9", sExit); +num = Random(9) + 1; +string sDoor = "MazeDoor"+IntToString(num); +SetLocalString(oPC, sDoor, "WPAmuletRoom3"); +SetLocalString(oPC, "MazeExit1", "ME3"); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("MEnt1")))); +} diff --git a/nwnds_module/ds_clockmazedoor.ncs b/nwnds_module/ds_clockmazedoor.ncs new file mode 100644 index 000000000..a4cbb89f2 Binary files /dev/null and b/nwnds_module/ds_clockmazedoor.ncs differ diff --git a/nwnds_module/ds_clockmazedoor.ndb b/nwnds_module/ds_clockmazedoor.ndb new file mode 100644 index 000000000..774a3f8eb --- /dev/null +++ b/nwnds_module/ds_clockmazedoor.ndb @@ -0,0 +1,18 @@ +NDB V1.0 +0000001 0000001 0000002 0000003 0000006 +N00 ds_clockmazedoor +s 03 vector +sf f x +sf f y +sf f z +f 00000015 00000106 000 v main +f 0000000d 00000015 000 v #loader +v 0000003f 000000fe 00000000 s sDoor +v 0000005a 000000fe 00000004 o oPC +v 0000009f 000000fe 00000008 s sWP +l00 0000003 00000015 0000003d +l00 0000004 0000003d 00000058 +l00 0000005 00000058 0000009d +l00 0000006 0000009d 000000c2 +l00 0000007 000000c2 000000fe +l00 0000009 00000104 00000106 diff --git a/nwnds_module/ds_clockmazedoor.nss b/nwnds_module/ds_clockmazedoor.nss new file mode 100644 index 000000000..6a8015a6a --- /dev/null +++ b/nwnds_module/ds_clockmazedoor.nss @@ -0,0 +1,9 @@ +void main() +{ +DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); +string sDoor = GetTag(OBJECT_SELF); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +string sWP = GetLocalString(oPC, sDoor); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag(sWP)))); + +} diff --git a/nwnds_module/ds_closedoors.ncs b/nwnds_module/ds_closedoors.ncs new file mode 100644 index 000000000..18f8b9409 Binary files /dev/null and b/nwnds_module/ds_closedoors.ncs differ diff --git a/nwnds_module/ds_closedoors.ndb b/nwnds_module/ds_closedoors.ndb new file mode 100644 index 000000000..fab19cfea --- /dev/null +++ b/nwnds_module/ds_closedoors.ndb @@ -0,0 +1,11 @@ +NDB V1.0 +0000001 0000001 0000002 0000000 0000002 +N00 ds_closedoors +s 03 vector +sf f x +sf f y +sf f z +f 00000015 0000003f 000 v main +f 0000000d 00000015 000 v #loader +l00 0000003 00000015 0000003d +l00 0000004 0000003d 0000003f diff --git a/nwnds_module/ds_closedoors.nss b/nwnds_module/ds_closedoors.nss new file mode 100644 index 000000000..079dd84bc --- /dev/null +++ b/nwnds_module/ds_closedoors.nss @@ -0,0 +1,5 @@ +//Closes door if it is open +void main() +{ + DelayCommand(25.0,ActionCloseDoor(OBJECT_SELF)); +} diff --git a/nwnds_module/ds_comonattack.ncs b/nwnds_module/ds_comonattack.ncs new file mode 100644 index 000000000..65dc0d718 Binary files /dev/null and b/nwnds_module/ds_comonattack.ncs differ diff --git a/nwnds_module/ds_comonattack.nss b/nwnds_module/ds_comonattack.nss new file mode 100644 index 000000000..a740dd9c4 --- /dev/null +++ b/nwnds_module/ds_comonattack.nss @@ -0,0 +1,87 @@ +//:://///////////////////////////////////////////// +//:: Default: Commoner Attacked +//:: ds_comonattack +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" +void main() +{ + ExecuteScript("prc_npc_physatt", OBJECT_SELF); + int nMsg = d6(); + string sMsg; + switch (nMsg) + { + case 1: sMsg = "Guards! Help!"; break; + case 2: sMsg = "Help I'm being repressed!"; break; + case 3: sMsg = "Where is a guard when you need one?!"; break; + case 4: sMsg = "Bleeeeeee!"; break; + case 5: sMsg = "No, you can have all my money! Please!"; break; + case 6: sMsg = "Someone save me!"; break; + } + +SpeakString(sMsg, TALKVOLUME_TALK); + + +if (d4() > 2) { +object oPC = GetLastHostileActor(); + if(GetIsDM(oPC) || GetIsDMPossessed(oPC) || !GetIsPC(oPC)) + { + sMsg ="Thank you master, may I have another?"; + SpeakString(sMsg, TALKVOLUME_WHISPER); + return; + } + +DelayCommand(2.0,AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Jail"))))); +DelayCommand(6.0,FloatingTextStringOnCreature(GetName(oPC)+" has been arrested.",oPC,FALSE)); +DelayCommand(7.0,SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oPC)); +} + + if(!GetFleeToExit()) + { + if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(GetLastAttacker())) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + //AdjustReputation(GetLastAttacker(), OBJECT_SELF, -100); + SetSummonHelpIfAttacked(); + DetermineSpecialBehavior(GetLastAttacker()); + } + else + { + if(GetArea(GetLastAttacker()) == GetArea(OBJECT_SELF)) + { + SetSummonHelpIfAttacked(); + DetermineCombatRound(); + } + } + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + //Shout that I was attacked + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + } + } + else + { + //Put a check in to see if this attacker was the last attacker + //Possibly change the GetNPCWarning function to make the check + SetSpawnInCondition(NW_FLAG_SET_WARNINGS, FALSE); + } + } + else + { + ActivateFleeToExit(); + } + if(GetSpawnInCondition(NW_FLAG_ATTACK_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1005)); + } + + +} + + diff --git a/nwnds_module/ds_comoncastat.ncs b/nwnds_module/ds_comoncastat.ncs new file mode 100644 index 000000000..e05292164 Binary files /dev/null and b/nwnds_module/ds_comoncastat.ncs differ diff --git a/nwnds_module/ds_comoncastat.nss b/nwnds_module/ds_comoncastat.nss new file mode 100644 index 000000000..9fbe4bdc5 --- /dev/null +++ b/nwnds_module/ds_comoncastat.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: Default: Commoner Cast At +//:: ds_comoncastat +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" + +void main() +{ + ExecuteScript("prc_npc_spellat", OBJECT_SELF); + object oPC = GetLastSpellCaster(); + if(GetIsDM(oPC) || GetIsDMPossessed(oPC) || !GetIsPC(oPC)) + { + string sMsg ="Thank you, master. May I have another?" ; + SpeakString(sMsg, TALKVOLUME_WHISPER); + return; + } +SpeakString("Magic! Guards!", TALKVOLUME_TALK); +if (d4() > 2) { +DelayCommand(2.0,AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Jail"))))); +DelayCommand(6.0,FloatingTextStringOnCreature(GetName(oPC)+" has been arrested for magic use.",oPC,FALSE)); +DelayCommand(7.0,SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 50, oPC)); +} + object oCaster = GetLastSpellCaster(); + if(GetLastSpellHarmful()) + { + if( + !GetIsObjectValid(GetAttackTarget()) && + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttemptedAttackTarget()) && + GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)) + ) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(oCaster); + } + else + { + DetermineCombatRound(oCaster); + } + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + //Shout that I was attacked + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + } + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1011)); + } + +} diff --git a/nwnds_module/ds_comtree.utp b/nwnds_module/ds_comtree.utp new file mode 100644 index 000000000..d77535f15 Binary files /dev/null and b/nwnds_module/ds_comtree.utp differ diff --git a/nwnds_module/ds_conashelae001.utc b/nwnds_module/ds_conashelae001.utc new file mode 100644 index 000000000..e47ffb113 Binary files /dev/null and b/nwnds_module/ds_conashelae001.utc differ diff --git a/nwnds_module/ds_contree_sm.utp b/nwnds_module/ds_contree_sm.utp new file mode 100644 index 000000000..b18fad974 Binary files /dev/null and b/nwnds_module/ds_contree_sm.utp differ diff --git a/nwnds_module/ds_crimsonbounce.ncs b/nwnds_module/ds_crimsonbounce.ncs new file mode 100644 index 000000000..4a6a1d2b5 Binary files /dev/null and b/nwnds_module/ds_crimsonbounce.ncs differ diff --git a/nwnds_module/ds_crimsonbounce.nss b/nwnds_module/ds_crimsonbounce.nss new file mode 100644 index 000000000..7d5eb4a67 --- /dev/null +++ b/nwnds_module/ds_crimsonbounce.nss @@ -0,0 +1,8 @@ +void main() +{ +int nEntryPoint = d8(); +string sPoint = "Crimson" + IntToString(nEntryPoint); + +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag(sPoint)))); +} diff --git a/nwnds_module/ds_critic001.utc b/nwnds_module/ds_critic001.utc new file mode 100644 index 000000000..a2ad37c08 Binary files /dev/null and b/nwnds_module/ds_critic001.utc differ diff --git a/nwnds_module/ds_crodlu001.utc b/nwnds_module/ds_crodlu001.utc new file mode 100644 index 000000000..fd30af92d Binary files /dev/null and b/nwnds_module/ds_crodlu001.utc differ diff --git a/nwnds_module/ds_crodlu002.utc b/nwnds_module/ds_crodlu002.utc new file mode 100644 index 000000000..b6bc44ed9 Binary files /dev/null and b/nwnds_module/ds_crodlu002.utc differ diff --git a/nwnds_module/ds_crodlu003.utc b/nwnds_module/ds_crodlu003.utc new file mode 100644 index 000000000..d8bf5cbf3 Binary files /dev/null and b/nwnds_module/ds_crodlu003.utc differ diff --git a/nwnds_module/ds_cw_heartbeat.ncs b/nwnds_module/ds_cw_heartbeat.ncs new file mode 100644 index 000000000..b7ff1a202 Binary files /dev/null and b/nwnds_module/ds_cw_heartbeat.ncs differ diff --git a/nwnds_module/ds_cw_heartbeat.nss b/nwnds_module/ds_cw_heartbeat.nss new file mode 100644 index 000000000..e25e4021d --- /dev/null +++ b/nwnds_module/ds_cw_heartbeat.nss @@ -0,0 +1,8 @@ +#include "spawn_main" + +void main() +{ + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE), GetLocation(GetObjectByTag("WP_CAT_FLAMESTRIKE"))); + Spawn(); +} diff --git a/nwnds_module/ds_cw_ondisturb.ncs b/nwnds_module/ds_cw_ondisturb.ncs new file mode 100644 index 000000000..043e47ddc Binary files /dev/null and b/nwnds_module/ds_cw_ondisturb.ncs differ diff --git a/nwnds_module/ds_cw_ondisturb.nss b/nwnds_module/ds_cw_ondisturb.nss new file mode 100644 index 000000000..75d48bdec --- /dev/null +++ b/nwnds_module/ds_cw_ondisturb.nss @@ -0,0 +1,121 @@ +void WhatsBeenPutIn(); +void WhatsBeenTakenOut(); +void CreateSomething(string szThing); + +void main() +{ + if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED) + { + WhatsBeenPutIn(); + + if ((GetLocalInt(OBJECT_SELF, "nIceKey") > 0) && (GetLocalInt(OBJECT_SELF, "nFireKey") > 0) && (GetLocalInt(OBJECT_SELF, "nEarthKey") > 0) && (GetLocalInt(OBJECT_SELF, "nAirKey") > 0) && (GetLocalInt(OBJECT_SELF, "nClockworkAmulet1") > 0) && (GetLocalInt(OBJECT_SELF, "nClockworkAmulet2") > 0) && (GetLocalInt(OBJECT_SELF, "nClockworkAmulet3") > 0)) + { + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), OBJECT_SELF)); + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), OBJECT_SELF)); + DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HARM), OBJECT_SELF)); + + DelayCommand(0.5, CreateSomething("elementalkey")); + + SetLocalInt(OBJECT_SELF, "nIceKey", GetLocalInt(OBJECT_SELF, "nIceKey") - 1); + SetLocalInt(OBJECT_SELF, "nFireKey", GetLocalInt(OBJECT_SELF, "nFireKey") - 1); + SetLocalInt(OBJECT_SELF, "nEarthKey", GetLocalInt(OBJECT_SELF, "nEarthKey") - 1); + SetLocalInt(OBJECT_SELF, "nAirKey", GetLocalInt(OBJECT_SELF, "nAirKey") - 1); + SetLocalInt(OBJECT_SELF, "nClockworkAmulet1", GetLocalInt(OBJECT_SELF, "nClockworkAmulet1") - 1); + SetLocalInt(OBJECT_SELF, "nClockworkAmulet2", GetLocalInt(OBJECT_SELF, "nClockworkAmulet2") - 1); + SetLocalInt(OBJECT_SELF, "nClockworkAmulet3", GetLocalInt(OBJECT_SELF, "nClockworkAmulet3") - 1); + + + object oToDestroy = GetItemPossessedBy(OBJECT_SELF, "icekey"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "firekey"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "earthkey"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "airkey"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "clockworkamulet"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "clockworkamul001"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + oToDestroy = GetItemPossessedBy(OBJECT_SELF, "clockworkamul002"); + DelayCommand(0.2, DestroyObject(oToDestroy)); + } + } + + if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_REMOVED) + WhatsBeenTakenOut(); +} + +void WhatsBeenPutIn() +{ + string sTag; + object oItem = GetInventoryDisturbItem(); + if (GetIsObjectValid(oItem)) + { + sTag = GetTag(oItem); + if (sTag == "icekey") + { + SetLocalInt(OBJECT_SELF, "nIceKey", GetLocalInt(OBJECT_SELF, "nIceKey") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_ICESTORM), OBJECT_SELF)); + } + else if (sTag == "firekey") + { + SetLocalInt(OBJECT_SELF, "nFireKey", GetLocalInt(OBJECT_SELF, "nFireKey") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_METEOR_SWARM), OBJECT_SELF)); + } + else if (sTag == "earthkey") + { + SetLocalInt(OBJECT_SELF, "nEarthKey", GetLocalInt(OBJECT_SELF, "nEarthKey") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), OBJECT_SELF, 6.0)); + } + else if (sTag == "airkey") + { + SetLocalInt(OBJECT_SELF, "nAirKey", GetLocalInt(OBJECT_SELF, "nAirKey") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), OBJECT_SELF)); + } + else if (sTag == "clockworkamulet") + { + SetLocalInt(OBJECT_SELF, "nClockworkAmulet1", GetLocalInt(OBJECT_SELF, "nClockworkAmulet1") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_BLUE_20), OBJECT_SELF, 12.0)); + } + else if (sTag == "clockworkamul001") + { + SetLocalInt(OBJECT_SELF, "nClockworkAmulet2", GetLocalInt(OBJECT_SELF, "nClockworkAmulet2") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_RED_20), OBJECT_SELF, 12.0)); + } + else if (sTag == "clockworkamul002") + { + SetLocalInt(OBJECT_SELF, "nClockworkAmulet3", GetLocalInt(OBJECT_SELF, "nClockworkAmulet3") + 1); + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_LIGHT_PURPLE_20), OBJECT_SELF, 12.0)); + } + } +} + +void WhatsBeenTakenOut() +{ + string sTag; + object oItem = GetInventoryDisturbItem(); + if (GetIsObjectValid(oItem)) + { + sTag = GetTag(oItem); + if (sTag == "icekey") + SetLocalInt(OBJECT_SELF, "nIceKey", GetLocalInt(OBJECT_SELF, "nIceKey") - 1); + else if (sTag == "firekey") + SetLocalInt(OBJECT_SELF, "nFireKey", GetLocalInt(OBJECT_SELF, "nFireKey") - 1); + else if (sTag == "earthkey") + SetLocalInt(OBJECT_SELF, "nEarthKey", GetLocalInt(OBJECT_SELF, "nEarthKey") - 1); + else if (sTag == "airkey") + SetLocalInt(OBJECT_SELF, "nAirKey", GetLocalInt(OBJECT_SELF, "nAirKey") - 1); + else if (sTag == "clockworkamulet") + SetLocalInt(OBJECT_SELF, "nClockworkAmulet1", GetLocalInt(OBJECT_SELF, "nClockworkAmulet1") - 1); + else if (sTag == "clockworkamul001") + SetLocalInt(OBJECT_SELF, "nClockworkAmulet2", GetLocalInt(OBJECT_SELF, "nClockworkAmulet2") - 1); + else if (sTag == "clockworkamul002") + SetLocalInt(OBJECT_SELF, "nClockworkAmulet3", GetLocalInt(OBJECT_SELF, "nClockworkAmulet3") - 1); + } +} + +void CreateSomething(string szThing) +{ + CreateItemOnObject(szThing); +} diff --git a/nwnds_module/ds_cw_onenter.ncs b/nwnds_module/ds_cw_onenter.ncs new file mode 100644 index 000000000..0c0dc0481 Binary files /dev/null and b/nwnds_module/ds_cw_onenter.ncs differ diff --git a/nwnds_module/ds_cw_onenter.nss b/nwnds_module/ds_cw_onenter.nss new file mode 100644 index 000000000..8d47dd0c6 --- /dev/null +++ b/nwnds_module/ds_cw_onenter.nss @@ -0,0 +1,6 @@ +void main() +{ + object oPC = GetEnteringObject(); + if (GetIsPC(oPC)) + SetLocalInt(OBJECT_SELF, "PCIsInArea", GetLocalInt(OBJECT_SELF, "PCIsInArea") + 1); +} diff --git a/nwnds_module/ds_cw_onexit.ncs b/nwnds_module/ds_cw_onexit.ncs new file mode 100644 index 000000000..d5d49fabe Binary files /dev/null and b/nwnds_module/ds_cw_onexit.ncs differ diff --git a/nwnds_module/ds_cw_onexit.nss b/nwnds_module/ds_cw_onexit.nss new file mode 100644 index 000000000..b8f46b7e4 --- /dev/null +++ b/nwnds_module/ds_cw_onexit.nss @@ -0,0 +1,35 @@ +#include "spawn_main" + +void main() +{ + object oPC = GetExitingObject(); + if (GetIsPC(oPC)) + { + int nPCCount = GetLocalInt(OBJECT_SELF, "PCIsInArea"); + SetLocalInt(OBJECT_SELF, "PCIsInArea", nPCCount - 1); + nPCCount--; + if (nPCCount < 1) + { + int iObjectType; + object oItem = GetFirstObjectInArea(); + while (GetIsObjectValid(oItem)) + { + iObjectType = GetObjectType(oItem); + switch(iObjectType) + { + case OBJECT_TYPE_PLACEABLE: { + if (GetTag(oItem) == "Body Bag") + DestroyObject(oItem); + break; + } + case OBJECT_TYPE_ITEM: { + DestroyObject(oItem); + break; + } + } + oItem = GetNextObjectInArea(); + } + Spawn(); + } + } +} diff --git a/nwnds_module/ds_cw_onunlock.ncs b/nwnds_module/ds_cw_onunlock.ncs new file mode 100644 index 000000000..f6d32ecf3 Binary files /dev/null and b/nwnds_module/ds_cw_onunlock.ncs differ diff --git a/nwnds_module/ds_cw_onunlock.nss b/nwnds_module/ds_cw_onunlock.nss new file mode 100644 index 000000000..a1855bb61 --- /dev/null +++ b/nwnds_module/ds_cw_onunlock.nss @@ -0,0 +1,32 @@ +void main() +{ + object oPlayer = GetLastUnlocked(); + object oKey = GetItemPossessedBy(oPlayer, "elementalkey"); + DestroyObject(oKey); + + string sItem; + switch (d20()) + { + case 1: sItem = "fistsofdrunkenma"; break; + case 2: sItem = "theceruleanarm"; break; + case 3: sItem = "sunslasher"; break; + case 4: sItem = "bootsofthedra"; break; + case 5: sItem = "hadesedge"; break; + case 6: sItem = "ragnarok"; break; + case 7: sItem = "severer"; break; + case 8: sItem = "drakebonegythk"; break; + case 9: sItem = "grafnaspride"; break; + case 10: sItem = "devestation"; break; + case 11: sItem = "villichimaster"; break; + case 12: sItem = "blackhelmofhusil"; break; + case 13: sItem = "heredatschainoff"; break; + case 14: sItem = "lightingstriker"; break; + case 15: sItem = "imbuedboots"; break; + case 16: sItem = "kylesboots"; break; + case 17: sItem = "defilersguise"; break; + case 18: sItem = "nevasglare"; break; + case 19: sItem = "drakeivoryblade"; break; + case 20: sItem = "forgedplateofthe"; break; + } + CreateItemOnObject(sItem); +} diff --git a/nwnds_module/ds_cw_opentomb.ncs b/nwnds_module/ds_cw_opentomb.ncs new file mode 100644 index 000000000..6ee2ef316 Binary files /dev/null and b/nwnds_module/ds_cw_opentomb.ncs differ diff --git a/nwnds_module/ds_cw_opentomb.nss b/nwnds_module/ds_cw_opentomb.nss new file mode 100644 index 000000000..9bfdf4c1c --- /dev/null +++ b/nwnds_module/ds_cw_opentomb.nss @@ -0,0 +1,5 @@ +void main() +{ + DelayCommand(1.0, ActionCloseDoor(OBJECT_SELF)); + SetLocked(OBJECT_SELF, TRUE); +} diff --git a/nwnds_module/ds_dog005.utc b/nwnds_module/ds_dog005.utc new file mode 100644 index 000000000..dace06216 Binary files /dev/null and b/nwnds_module/ds_dog005.utc differ diff --git a/nwnds_module/ds_dreamone.ncs b/nwnds_module/ds_dreamone.ncs new file mode 100644 index 000000000..b33710a0e Binary files /dev/null and b/nwnds_module/ds_dreamone.ncs differ diff --git a/nwnds_module/ds_dreamone.nss b/nwnds_module/ds_dreamone.nss new file mode 100644 index 000000000..0f5891179 --- /dev/null +++ b/nwnds_module/ds_dreamone.nss @@ -0,0 +1,7 @@ +void main() +{ + object oPlayer = GetLastUsedBy(); + + AssignCommand(oPlayer, ClearAllActions()); + AssignCommand(oPlayer, ActionJumpToObject(GetWaypointByTag("cut02way_enter"))); +} diff --git a/nwnds_module/ds_dretch001.utc b/nwnds_module/ds_dretch001.utc new file mode 100644 index 000000000..b321c00cc Binary files /dev/null and b/nwnds_module/ds_dretch001.utc differ diff --git a/nwnds_module/ds_drik001.utc b/nwnds_module/ds_drik001.utc new file mode 100644 index 000000000..fe9302a57 Binary files /dev/null and b/nwnds_module/ds_drik001.utc differ diff --git a/nwnds_module/ds_dunecrab001.utc b/nwnds_module/ds_dunecrab001.utc new file mode 100644 index 000000000..853b44e26 Binary files /dev/null and b/nwnds_module/ds_dunecrab001.utc differ diff --git a/nwnds_module/ds_dunecrab002.utc b/nwnds_module/ds_dunecrab002.utc new file mode 100644 index 000000000..062929137 Binary files /dev/null and b/nwnds_module/ds_dunecrab002.utc differ diff --git a/nwnds_module/ds_dustglider001.utc b/nwnds_module/ds_dustglider001.utc new file mode 100644 index 000000000..47c05b194 Binary files /dev/null and b/nwnds_module/ds_dustglider001.utc differ diff --git a/nwnds_module/ds_dustgull001.utc b/nwnds_module/ds_dustgull001.utc new file mode 100644 index 000000000..282be0bf2 Binary files /dev/null and b/nwnds_module/ds_dustgull001.utc differ diff --git a/nwnds_module/ds_earthbeast001.utc b/nwnds_module/ds_earthbeast001.utc new file mode 100644 index 000000000..0fd1da5a9 Binary files /dev/null and b/nwnds_module/ds_earthbeast001.utc differ diff --git a/nwnds_module/ds_ec.ncs b/nwnds_module/ds_ec.ncs new file mode 100644 index 000000000..86c4721fe Binary files /dev/null and b/nwnds_module/ds_ec.ncs differ diff --git a/nwnds_module/ds_ec.nss b/nwnds_module/ds_ec.nss new file mode 100644 index 000000000..390e5c6ec --- /dev/null +++ b/nwnds_module/ds_ec.nss @@ -0,0 +1,9 @@ +void main() +{ +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC); +if (GetTimeHour() > 19 || GetTimeHour() < 7) +{ +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_ECAWAY")))); +DelayCommand(4.8, FloatingTextStringOnCreature("The Elven Caravan has left, leaving the Oasis at the mercy of the desert inhabitants.", oPC, FALSE)); +} +} diff --git a/nwnds_module/ds_ecaway.ncs b/nwnds_module/ds_ecaway.ncs new file mode 100644 index 000000000..aed573e97 Binary files /dev/null and b/nwnds_module/ds_ecaway.ncs differ diff --git a/nwnds_module/ds_ecaway.nss b/nwnds_module/ds_ecaway.nss new file mode 100644 index 000000000..d24ec71e3 --- /dev/null +++ b/nwnds_module/ds_ecaway.nss @@ -0,0 +1,9 @@ +void main() +{ +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC); +if (GetTimeHour() > 6 && GetTimeHour() < 20) +{ +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_EC")))); +DelayCommand(4.8, FloatingTextStringOnCreature("The Elven Caravan has arrived and set up camp at the Oasis.", oPC, FALSE)); +} +} diff --git a/nwnds_module/ds_elvenrope001.utc b/nwnds_module/ds_elvenrope001.utc new file mode 100644 index 000000000..588b75594 Binary files /dev/null and b/nwnds_module/ds_elvenrope001.utc differ diff --git a/nwnds_module/ds_enc_exit.ncs b/nwnds_module/ds_enc_exit.ncs new file mode 100644 index 000000000..a25653c50 Binary files /dev/null and b/nwnds_module/ds_enc_exit.ncs differ diff --git a/nwnds_module/ds_enc_exit.nss b/nwnds_module/ds_enc_exit.nss new file mode 100644 index 000000000..f39265efa --- /dev/null +++ b/nwnds_module/ds_enc_exit.nss @@ -0,0 +1,34 @@ +string LocationToString(location lLocation) +{ + object oArea = GetAreaFromLocation(lLocation); + vector vPosition = GetPositionFromLocation(lLocation); + float fOrientation = GetFacingFromLocation(lLocation); + return "#AREA#" + GetTag(oArea) + + "#POSITION_X#" + FloatToString(vPosition.x) + + "#POSITION_Y#" + FloatToString(vPosition.y) + + "#POSITION_Z#" + FloatToString(vPosition.z) + + "#ORIENTATION#" + FloatToString(fOrientation) + "#END#"; +} +void main() +{ + location lTarget; + + // Get the creature who triggered this event. + object oPC = GetEnteringObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Find the location to which to teleport. + lTarget = GetLocalLocation(oPC, "ls_stored_loc"); + // Verify that the location is valid before attempting to teleport. + // (The script will stop here if no location was previously stored.) + if ( GetAreaFromLocation(lTarget) == OBJECT_INVALID ) + return; + + // Teleport the PC. + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, JumpToLocation(lTarget)); +} + diff --git a/nwnds_module/ds_enc_exit_pl.ncs b/nwnds_module/ds_enc_exit_pl.ncs new file mode 100644 index 000000000..4fbc43534 Binary files /dev/null and b/nwnds_module/ds_enc_exit_pl.ncs differ diff --git a/nwnds_module/ds_enc_exit_pl.nss b/nwnds_module/ds_enc_exit_pl.nss new file mode 100644 index 000000000..21fb8f9d7 --- /dev/null +++ b/nwnds_module/ds_enc_exit_pl.nss @@ -0,0 +1,34 @@ +string LocationToString(location lLocation) +{ + object oArea = GetAreaFromLocation(lLocation); + vector vPosition = GetPositionFromLocation(lLocation); + float fOrientation = GetFacingFromLocation(lLocation); + return "#AREA#" + GetTag(oArea) + + "#POSITION_X#" + FloatToString(vPosition.x) + + "#POSITION_Y#" + FloatToString(vPosition.y) + + "#POSITION_Z#" + FloatToString(vPosition.z) + + "#ORIENTATION#" + FloatToString(fOrientation) + "#END#"; +} +void main() +{ + location lTarget; + + // Get the creature who triggered this event. + object oPC = GetLastUsedBy(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Find the location to which to teleport. + lTarget = GetLocalLocation(oPC, "ls_stored_loc"); + // Verify that the location is valid before attempting to teleport. + // (The script will stop here if no location was previously stored.) + if ( GetAreaFromLocation(lTarget) == OBJECT_INVALID ) + return; + + // Teleport the PC. + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, JumpToLocation(lTarget)); +} + diff --git a/nwnds_module/ds_enternesttal2.ncs b/nwnds_module/ds_enternesttal2.ncs new file mode 100644 index 000000000..0e3f467b1 Binary files /dev/null and b/nwnds_module/ds_enternesttal2.ncs differ diff --git a/nwnds_module/ds_enternesttal2.nss b/nwnds_module/ds_enternesttal2.nss new file mode 100644 index 000000000..52ee15792 --- /dev/null +++ b/nwnds_module/ds_enternesttal2.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_nestspeech2")); + +} + + diff --git a/nwnds_module/ds_enternesttalk.ncs b/nwnds_module/ds_enternesttalk.ncs new file mode 100644 index 000000000..8864815f6 Binary files /dev/null and b/nwnds_module/ds_enternesttalk.ncs differ diff --git a/nwnds_module/ds_enternesttalk.nss b/nwnds_module/ds_enternesttalk.nss new file mode 100644 index 000000000..4f467be5e --- /dev/null +++ b/nwnds_module/ds_enternesttalk.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_nestspeech1")); +} + + diff --git a/nwnds_module/ds_erdland001.utc b/nwnds_module/ds_erdland001.utc new file mode 100644 index 000000000..5827b5405 Binary files /dev/null and b/nwnds_module/ds_erdland001.utc differ diff --git a/nwnds_module/ds_erdland002.utc b/nwnds_module/ds_erdland002.utc new file mode 100644 index 000000000..569089fda Binary files /dev/null and b/nwnds_module/ds_erdland002.utc differ diff --git a/nwnds_module/ds_exit_urik_sew.ncs b/nwnds_module/ds_exit_urik_sew.ncs new file mode 100644 index 000000000..3b66c547b Binary files /dev/null and b/nwnds_module/ds_exit_urik_sew.ncs differ diff --git a/nwnds_module/ds_exit_urik_sew.nss b/nwnds_module/ds_exit_urik_sew.nss new file mode 100644 index 000000000..f0e380179 --- /dev/null +++ b/nwnds_module/ds_exit_urik_sew.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: Urik Below Sewer Exit +//:: ds_exit_urik_sew.nss +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* +Transitions from Urik Sewers to Urik - Obsidian Gate + +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: March 14 2021 +//::////////////////////////////////////////////// + +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_URIKBELOW_SEWER_EXIT"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/ds_factions.ncs b/nwnds_module/ds_factions.ncs new file mode 100644 index 000000000..c691807c0 Binary files /dev/null and b/nwnds_module/ds_factions.ncs differ diff --git a/nwnds_module/ds_factions.nss b/nwnds_module/ds_factions.nss new file mode 100644 index 000000000..795938aa1 --- /dev/null +++ b/nwnds_module/ds_factions.nss @@ -0,0 +1,92 @@ +object oPlayer,oItem; + void SetupFactions (object oPC) +{ +oItem = GetItemPossessedBy(oPC, "FAC_HELM_TYRTMP"); +object oItem2 = GetItemPossessedBy(oPC, "FAC_ITPNCK_URIKT"); +if(GetIsObjectValid(oItem) != 0 || GetIsObjectValid(oItem2) != 0) + { + SendMessageToPC(oPC,GetName(oItem)+" detected."); +// SendMessageToPC(oPC,"Attempting to set faction with "+GetName(GetObjectByTag("VeiledAlliance"))+" as hostile."); + AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), -100); +// SendMessageToPC(oPC,"Attempting to set faction with "+GetName(GetObjectByTag("Templar"))+" as friendly."); + AdjustReputation(oPC, GetObjectByTag("NPC_TYRGUARD001"), 100); + oPlayer = GetFirstPC(); + while ( GetIsPC (oPlayer) == TRUE) + { + oItem = GetItemPossessedBy(oPlayer, "FAC_HELM_VEILED"); + if(GetIsObjectValid(oItem) != 0) + { +// SendMessageToPC(oPC,GetName(oItem)+" detected on "+GetName(oPlayer)); + SendMessageToPC(oPC,"Attempting to set VA member "+GetName(oPlayer)+" as an enemy."); + SendMessageToPC(oPlayer,"Templar "+GetName(oPC)+" has just been seen in Tyr."); + SetPCDislike(oPC,oPlayer); + } + oItem = GetItemPossessedBy(oPlayer, "FAC_ITMNCK_TYRVA"); + if(GetIsObjectValid(oItem) != 0) + { +// SendMessageToPC(oPC,GetName(oItem)+" detected on "+GetName(oPlayer)); + SendMessageToPC(oPC,"Attempting to set VA member "+GetName(oPlayer)+" as an enemy."); + SendMessageToPC(oPlayer,"Templar "+GetName(oPC)+" has just been seen in Tyr."); + SetPCDislike(oPC,oPlayer); + } + oItem = GetItemPossessedBy(oPlayer, "FAC_ITMNCK_URKVA"); + if(GetIsObjectValid(oItem) != 0) + { +// SendMessageToPC(oPC,GetName(oItem)+" detected on "+GetName(oPlayer)); + SendMessageToPC(oPC,"Attempting to set VA member "+GetName(oPlayer)+" as an enemy."); + SendMessageToPC(oPlayer,"Templar "+GetName(oPC)+" has just been seen in Tyr."); + SetPCDislike(oPC,oPlayer); + } + oPlayer = GetNextPC(); + } + } + +oItem = GetItemPossessedBy(oPC, "FAC_HELM_VEILED"); +oItem2 = GetItemPossessedBy(oPC, "FAC_ITMNCK_TYRVA"); +object oItem3 = GetItemPossessedBy(oPC, "FAC_ITMNCK_URKVA"); +if(GetIsObjectValid(oItem) != 0 || + GetIsObjectValid(oItem2) != 0 || + GetIsObjectValid(oItem3) != 0) + { + SendMessageToPC(oPC,GetName(oItem)+" detected."); +// SendMessageToPC(oPC,"Attempting to set faction with "+GetName(GetObjectByTag("VeiledAlliance"))+" as friendly."); + AdjustReputation(oPC, GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), 100); +// SendMessageToPC(oPC,"Attempting to set faction with "+GetName(GetObjectByTag("Templar"))+" as hostile."); + AdjustReputation(oPC, GetObjectByTag("NPC_TYRGUARD001"), -100); + oPlayer = GetFirstPC(); + while ( GetIsPC (oPlayer) == TRUE) + { + oItem = GetItemPossessedBy(oPlayer, "FAC_HELM_TYRTMP"); + if(GetIsObjectValid(oItem) != 0) + { +// SendMessageToPC(oPC,GetName(oItem)+" detected on "+GetName(oPlayer)); + SendMessageToPC(oPC,"Attempting to set Templar "+GetName(oPlayer)+" as an enemy."); + SendMessageToPC(oPlayer,"VA member "+GetName(oPC)+" has just been seen in Tyr."); + SetPCDislike(oPC,oPlayer); + } + oItem = GetItemPossessedBy(oPlayer, "FAC_ITPNCK_URIKT"); + if(GetIsObjectValid(oItem) != 0) + { +// SendMessageToPC(oPC,GetName(oItem)+" detected on "+GetName(oPlayer)); + SendMessageToPC(oPC,"Attempting to set Templar "+GetName(oPlayer)+" as an enemy."); + SendMessageToPC(oPlayer,"VA member "+GetName(oPC)+" has just been seen in Tyr."); + SetPCDislike(oPC,oPlayer); + } + oPlayer = GetNextPC(); + } + } +} + +void main() +{ + object oPC = GetEnteringObject(); + if (!GetIsObjectValid(oPC))oPC = OBJECT_SELF; + +if (GetIsPC(oPC)) +SetupFactions (oPC); + + SendMessageToPC(oPC,"VA reputation is now "+IntToString(GetReputation(GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"), oPC))); + SendMessageToPC(oPC,"Templar reputation is now "+IntToString(GetReputation(GetObjectByTag("NPC_TYRGUARD001"), oPC))); +// Make sure faction with non-combatant is ok +AdjustReputation(oPC, GetObjectByTag("DS_KANK001"), 100); +} diff --git a/nwnds_module/ds_feylaar001.utc b/nwnds_module/ds_feylaar001.utc new file mode 100644 index 000000000..95f5fe207 Binary files /dev/null and b/nwnds_module/ds_feylaar001.utc differ diff --git a/nwnds_module/ds_fihyr001.utc b/nwnds_module/ds_fihyr001.utc new file mode 100644 index 000000000..47e945462 Binary files /dev/null and b/nwnds_module/ds_fihyr001.utc differ diff --git a/nwnds_module/ds_fihyr002.utc b/nwnds_module/ds_fihyr002.utc new file mode 100644 index 000000000..ff154d893 Binary files /dev/null and b/nwnds_module/ds_fihyr002.utc differ diff --git a/nwnds_module/ds_firebeast001.utc b/nwnds_module/ds_firebeast001.utc new file mode 100644 index 000000000..a1c7d8705 Binary files /dev/null and b/nwnds_module/ds_firebeast001.utc differ diff --git a/nwnds_module/ds_fireeel001.utc b/nwnds_module/ds_fireeel001.utc new file mode 100644 index 000000000..ee9eb7532 Binary files /dev/null and b/nwnds_module/ds_fireeel001.utc differ diff --git a/nwnds_module/ds_firelizard001.utc b/nwnds_module/ds_firelizard001.utc new file mode 100644 index 000000000..e84dda966 Binary files /dev/null and b/nwnds_module/ds_firelizard001.utc differ diff --git a/nwnds_module/ds_flailer001.utc b/nwnds_module/ds_flailer001.utc new file mode 100644 index 000000000..bf585b956 Binary files /dev/null and b/nwnds_module/ds_flailer001.utc differ diff --git a/nwnds_module/ds_flamewalker01.utc b/nwnds_module/ds_flamewalker01.utc new file mode 100644 index 000000000..02213532a Binary files /dev/null and b/nwnds_module/ds_flamewalker01.utc differ diff --git a/nwnds_module/ds_flamewalker02.utc b/nwnds_module/ds_flamewalker02.utc new file mode 100644 index 000000000..a41709307 Binary files /dev/null and b/nwnds_module/ds_flamewalker02.utc differ diff --git a/nwnds_module/ds_floater001.utc b/nwnds_module/ds_floater001.utc new file mode 100644 index 000000000..dd9b6438b Binary files /dev/null and b/nwnds_module/ds_floater001.utc differ diff --git a/nwnds_module/ds_foodstall001.utp b/nwnds_module/ds_foodstall001.utp new file mode 100644 index 000000000..1561c1539 Binary files /dev/null and b/nwnds_module/ds_foodstall001.utp differ diff --git a/nwnds_module/ds_foodstall02.utp b/nwnds_module/ds_foodstall02.utp new file mode 100644 index 000000000..e6b6feb71 Binary files /dev/null and b/nwnds_module/ds_foodstall02.utp differ diff --git a/nwnds_module/ds_fordorran001.utc b/nwnds_module/ds_fordorran001.utc new file mode 100644 index 000000000..ea7623805 Binary files /dev/null and b/nwnds_module/ds_fordorran001.utc differ diff --git a/nwnds_module/ds_fromcrafters.ncs b/nwnds_module/ds_fromcrafters.ncs new file mode 100644 index 000000000..a70cf8cce Binary files /dev/null and b/nwnds_module/ds_fromcrafters.ncs differ diff --git a/nwnds_module/ds_fromcrafters.nss b/nwnds_module/ds_fromcrafters.nss new file mode 100644 index 000000000..407a3d9c7 --- /dev/null +++ b/nwnds_module/ds_fromcrafters.nss @@ -0,0 +1,6 @@ +void main() +{ + + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetWaypointByTag("FROMCRAFTERS")))); + DelayCommand(10.0,SetLocked(OBJECT_SELF,TRUE)); +} diff --git a/nwnds_module/ds_g_lizard001.utc b/nwnds_module/ds_g_lizard001.utc new file mode 100644 index 000000000..672cb7418 Binary files /dev/null and b/nwnds_module/ds_g_lizard001.utc differ diff --git a/nwnds_module/ds_gaj_001.utc b/nwnds_module/ds_gaj_001.utc new file mode 100644 index 000000000..f4500e0d3 Binary files /dev/null and b/nwnds_module/ds_gaj_001.utc differ diff --git a/nwnds_module/ds_gargsnake001.utc b/nwnds_module/ds_gargsnake001.utc new file mode 100644 index 000000000..cd912173e Binary files /dev/null and b/nwnds_module/ds_gargsnake001.utc differ diff --git a/nwnds_module/ds_gaurdcastat.ncs b/nwnds_module/ds_gaurdcastat.ncs new file mode 100644 index 000000000..7936f9c01 Binary files /dev/null and b/nwnds_module/ds_gaurdcastat.ncs differ diff --git a/nwnds_module/ds_gaurdcastat.nss b/nwnds_module/ds_gaurdcastat.nss new file mode 100644 index 000000000..8e488fb32 --- /dev/null +++ b/nwnds_module/ds_gaurdcastat.nss @@ -0,0 +1,142 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spell Cast At +//:: NW_C2_DEFAULTB +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This determines if the spell just cast at the + target is harmful or not. + + GZ 2003-Oct-02 : - New AoE Behavior AI. Will use + Dispel Magic against AOES + - Flying Creatures will ignore + Grease + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 6, 2001 +//:: Last Modified On: 2003-Oct-13 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" +#include "x2_i0_spells" +void main() +{ + object oCaster = GetLastSpellCaster(); + SpeakString("Magic! Get 'em!", TALKVOLUME_TALK); + + //if(GetLastSpellHarmful()) + { + SetCommandable(TRUE); + + // ------------------------------------------------------------------ + // If I was hurt by someone in my own faction + // Then clear any hostile feelings I have against them + // After all, we're all just trying to do our job here + // if we singe some eyebrow hair, oh well. + // ------------------------------------------------------------------ + if (GetFactionEqual(oCaster, OBJECT_SELF) == TRUE) + { + ClearPersonalReputation(oCaster, OBJECT_SELF); + ClearAllActions(TRUE); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(OBJECT_INVALID))); + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + return; + } + + int bAttack = TRUE; + // ------------------------------------------------------------------ + // GZ, 2003-Oct-02 + // Try to do something smart if we are subject to an AoE Spell. + // ------------------------------------------------------------------ + if (MatchAreaOfEffectSpell(GetLastSpell()) == TRUE) + { + int nAI = (GetBestAOEBehavior(GetLastSpell())); // from x2_i0_spells + switch (nAI) + { + case X2_SPELL_AOEBEHAVIOR_DISPEL_L: + case X2_SPELL_AOEBEHAVIOR_DISPEL_N: + case X2_SPELL_AOEBEHAVIOR_DISPEL_M: + case X2_SPELL_AOEBEHAVIOR_DISPEL_G: + case X2_SPELL_AOEBEHAVIOR_DISPEL_C: + bAttack = FALSE; + ActionCastSpellAtLocation(nAI, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + break; + + case X2_SPELL_AOEBEHAVIOR_FLEE: + ClearActions(CLEAR_NW_C2_DEFAULTB_GUSTWIND); + oCaster = GetLastSpellCaster(); + ActionForceMoveToObject(oCaster, TRUE, 2.0); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(oCaster))); + bAttack = FALSE; + break; + + case X2_SPELL_AOEBEHAVIOR_IGNORE: + // well ... nothing + break; + + case X2_SPELL_AOEBEHAVIOR_GUST: + ActionCastSpellAtLocation(SPELL_GUST_OF_WIND, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + bAttack = FALSE; + break; + } + + } + // --------------------------------------------------------------------- + // Not an area of effect spell, but another hostile spell. + // If we're not already fighting someone else, + // attack the caster. + // --------------------------------------------------------------------- + if( !GetIsFighting(OBJECT_SELF) && bAttack) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(oCaster); + } + else + { + DetermineCombatRound(oCaster); + } + } + + // We were attacked, so yell for help + SetCommandable(TRUE); + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + //Shout that I was attacked + SpeakString("NSpeakSW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + //else + //{ + // --------------------------------------------------------------------- + // July 14, 2003 BK + // If there is a valid enemy nearby and a NON HARMFUL spell has been + // cast on me I should call DetermineCombatRound + // I may be invisible and casting spells on myself to buff myself up + // --------------------------------------------------------------------- + // object oEnemy =GetNearestEnemy(); + // if (GetIsObjectValid(oEnemy) == TRUE) + // { + // SpeakString("keep me in combat"); + // DetermineCombatRound(oEnemy); + // } + //} + + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + + +} diff --git a/nwnds_module/ds_gboneclaw001.utc b/nwnds_module/ds_gboneclaw001.utc new file mode 100644 index 000000000..3015df037 Binary files /dev/null and b/nwnds_module/ds_gboneclaw001.utc differ diff --git a/nwnds_module/ds_giantcrag001.utc b/nwnds_module/ds_giantcrag001.utc new file mode 100644 index 000000000..9f7940fce Binary files /dev/null and b/nwnds_module/ds_giantcrag001.utc differ diff --git a/nwnds_module/ds_giveclockmap.ncs b/nwnds_module/ds_giveclockmap.ncs new file mode 100644 index 000000000..1e105f1ae Binary files /dev/null and b/nwnds_module/ds_giveclockmap.ncs differ diff --git a/nwnds_module/ds_giveclockmap.nss b/nwnds_module/ds_giveclockmap.nss new file mode 100644 index 000000000..dfb8faa12 --- /dev/null +++ b/nwnds_module/ds_giveclockmap.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_giveclockmap +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 7:08:33 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + SetLocalInt(GetPCSpeaker(), "nClock", 10); + CreateItemOnObject("mapofclockwork", GetPCSpeaker(), 1); + CreateItemOnObject("helmofthemind", GetPCSpeaker(), 1); + RemoveJournalQuestEntry("glyph1",GetPCSpeaker()); + RemoveJournalQuestEntry("glyph2",GetPCSpeaker()); + RemoveJournalQuestEntry("glyph3",GetPCSpeaker()); + RemoveJournalQuestEntry("glyph4",GetPCSpeaker()); + RemoveJournalQuestEntry("glyph5",GetPCSpeaker()); + RemoveJournalQuestEntry("glyph6",GetPCSpeaker()); +} diff --git a/nwnds_module/ds_givefish.ncs b/nwnds_module/ds_givefish.ncs new file mode 100644 index 000000000..46486d97e Binary files /dev/null and b/nwnds_module/ds_givefish.ncs differ diff --git a/nwnds_module/ds_givefish.nss b/nwnds_module/ds_givefish.nss new file mode 100644 index 000000000..9a71b6263 --- /dev/null +++ b/nwnds_module/ds_givefish.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_givefish +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 4:25:04 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("QST_DRIEDFISH", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFirstTimeTalked", 3); + + SetLocalInt(GetPCSpeaker(), "nTriciQuest", 1); + +} diff --git a/nwnds_module/ds_givegoldskull.ncs b/nwnds_module/ds_givegoldskull.ncs new file mode 100644 index 000000000..a80af13f5 Binary files /dev/null and b/nwnds_module/ds_givegoldskull.ncs differ diff --git a/nwnds_module/ds_givegoldskull.nss b/nwnds_module/ds_givegoldskull.nss new file mode 100644 index 000000000..ad3fb9de6 --- /dev/null +++ b/nwnds_module/ds_givegoldskull.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_givegoldskull +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 4:08:39 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 10); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 25); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "CRFT_GIANTSKULL"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/ds_givesack.ncs b/nwnds_module/ds_givesack.ncs new file mode 100644 index 000000000..9d3726141 Binary files /dev/null and b/nwnds_module/ds_givesack.ncs differ diff --git a/nwnds_module/ds_givesack.nss b/nwnds_module/ds_givesack.nss new file mode 100644 index 000000000..7bb6f391b --- /dev/null +++ b/nwnds_module/ds_givesack.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_givesack +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 4:24:21 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("crft_spidersac", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFirstTimeTalked", 2); + +} diff --git a/nwnds_module/ds_glacierflow01.utc b/nwnds_module/ds_glacierflow01.utc new file mode 100644 index 000000000..057109da7 Binary files /dev/null and b/nwnds_module/ds_glacierflow01.utc differ diff --git a/nwnds_module/ds_glacierflow02.utc b/nwnds_module/ds_glacierflow02.utc new file mode 100644 index 000000000..416182f6c Binary files /dev/null and b/nwnds_module/ds_glacierflow02.utc differ diff --git a/nwnds_module/ds_gorak001.utc b/nwnds_module/ds_gorak001.utc new file mode 100644 index 000000000..5980ae28b Binary files /dev/null and b/nwnds_module/ds_gorak001.utc differ diff --git a/nwnds_module/ds_gr_fihyr001.utc b/nwnds_module/ds_gr_fihyr001.utc new file mode 100644 index 000000000..32d4eba13 Binary files /dev/null and b/nwnds_module/ds_gr_fihyr001.utc differ diff --git a/nwnds_module/ds_gr_fihyr002.utc b/nwnds_module/ds_gr_fihyr002.utc new file mode 100644 index 000000000..9225957c5 Binary files /dev/null and b/nwnds_module/ds_gr_fihyr002.utc differ diff --git a/nwnds_module/ds_grdcptholiday.uti b/nwnds_module/ds_grdcptholiday.uti new file mode 100644 index 000000000..e2a009f64 Binary files /dev/null and b/nwnds_module/ds_grdcptholiday.uti differ diff --git a/nwnds_module/ds_grysilthor001.utc b/nwnds_module/ds_grysilthor001.utc new file mode 100644 index 000000000..1a60974e5 Binary files /dev/null and b/nwnds_module/ds_grysilthor001.utc differ diff --git a/nwnds_module/ds_guardcastat.ncs b/nwnds_module/ds_guardcastat.ncs new file mode 100644 index 000000000..9abeed222 Binary files /dev/null and b/nwnds_module/ds_guardcastat.ncs differ diff --git a/nwnds_module/ds_guardcastat.nss b/nwnds_module/ds_guardcastat.nss new file mode 100644 index 000000000..a43920514 --- /dev/null +++ b/nwnds_module/ds_guardcastat.nss @@ -0,0 +1,143 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spell Cast At +//:: NW_C2_DEFAULTB +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This determines if the spell just cast at the + target is harmful or not. + + GZ 2003-Oct-02 : - New AoE Behavior AI. Will use + Dispel Magic against AOES + - Flying Creatures will ignore + Grease + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 6, 2001 +//:: Last Modified On: 2003-Oct-13 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" +#include "x2_i0_spells" +void main() +{ + ExecuteScript("prc_npc_spellat", OBJECT_SELF); + object oCaster = GetLastSpellCaster(); + SpeakString("Magic! Get 'em!", TALKVOLUME_TALK); + + //if(GetLastSpellHarmful()) + { + SetCommandable(TRUE); + + // ------------------------------------------------------------------ + // If I was hurt by someone in my own faction + // Then clear any hostile feelings I have against them + // After all, we're all just trying to do our job here + // if we singe some eyebrow hair, oh well. + // ------------------------------------------------------------------ + if (GetFactionEqual(oCaster, OBJECT_SELF) == TRUE) + { + ClearPersonalReputation(oCaster, OBJECT_SELF); + ClearAllActions(TRUE); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(OBJECT_INVALID))); + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + return; + } + + int bAttack = TRUE; + // ------------------------------------------------------------------ + // GZ, 2003-Oct-02 + // Try to do something smart if we are subject to an AoE Spell. + // ------------------------------------------------------------------ + if (MatchAreaOfEffectSpell(GetLastSpell()) == TRUE) + { + int nAI = (GetBestAOEBehavior(GetLastSpell())); // from x2_i0_spells + switch (nAI) + { + case X2_SPELL_AOEBEHAVIOR_DISPEL_L: + case X2_SPELL_AOEBEHAVIOR_DISPEL_N: + case X2_SPELL_AOEBEHAVIOR_DISPEL_M: + case X2_SPELL_AOEBEHAVIOR_DISPEL_G: + case X2_SPELL_AOEBEHAVIOR_DISPEL_C: + bAttack = FALSE; + ActionCastSpellAtLocation(nAI, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + break; + + case X2_SPELL_AOEBEHAVIOR_FLEE: + ClearActions(CLEAR_NW_C2_DEFAULTB_GUSTWIND); + oCaster = GetLastSpellCaster(); + ActionForceMoveToObject(oCaster, TRUE, 2.0); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(oCaster))); + bAttack = FALSE; + break; + + case X2_SPELL_AOEBEHAVIOR_IGNORE: + // well ... nothing + break; + + case X2_SPELL_AOEBEHAVIOR_GUST: + ActionCastSpellAtLocation(SPELL_GUST_OF_WIND, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + bAttack = FALSE; + break; + } + + } + // --------------------------------------------------------------------- + // Not an area of effect spell, but another hostile spell. + // If we're not already fighting someone else, + // attack the caster. + // --------------------------------------------------------------------- + if( !GetIsFighting(OBJECT_SELF) && bAttack) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(oCaster); + } + else + { + DetermineCombatRound(oCaster); + } + } + + // We were attacked, so yell for help + SetCommandable(TRUE); + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + //Shout that I was attacked + SpeakString("NSpeakSW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + //else + //{ + // --------------------------------------------------------------------- + // July 14, 2003 BK + // If there is a valid enemy nearby and a NON HARMFUL spell has been + // cast on me I should call DetermineCombatRound + // I may be invisible and casting spells on myself to buff myself up + // --------------------------------------------------------------------- + // object oEnemy =GetNearestEnemy(); + // if (GetIsObjectValid(oEnemy) == TRUE) + // { + // SpeakString("keep me in combat"); + // DetermineCombatRound(oEnemy); + // } + //} + + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + + +} diff --git a/nwnds_module/ds_guardholidays.uti b/nwnds_module/ds_guardholidays.uti new file mode 100644 index 000000000..a24ea4e81 Binary files /dev/null and b/nwnds_module/ds_guardholidays.uti differ diff --git a/nwnds_module/ds_has100gp.ncs b/nwnds_module/ds_has100gp.ncs new file mode 100644 index 000000000..5d196110b Binary files /dev/null and b/nwnds_module/ds_has100gp.ncs differ diff --git a/nwnds_module/ds_has100gp.nss b/nwnds_module/ds_has100gp.nss new file mode 100644 index 000000000..14d706841 --- /dev/null +++ b/nwnds_module/ds_has100gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 99) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has1500gp.ncs b/nwnds_module/ds_has1500gp.ncs new file mode 100644 index 000000000..075bd28f9 Binary files /dev/null and b/nwnds_module/ds_has1500gp.ncs differ diff --git a/nwnds_module/ds_has1500gp.nss b/nwnds_module/ds_has1500gp.nss new file mode 100644 index 000000000..b790fefe9 --- /dev/null +++ b/nwnds_module/ds_has1500gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 1499) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has1800gp.ncs b/nwnds_module/ds_has1800gp.ncs new file mode 100644 index 000000000..7ec31bbd2 Binary files /dev/null and b/nwnds_module/ds_has1800gp.ncs differ diff --git a/nwnds_module/ds_has1800gp.nss b/nwnds_module/ds_has1800gp.nss new file mode 100644 index 000000000..4c67a0d90 --- /dev/null +++ b/nwnds_module/ds_has1800gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 1799) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has200gp.ncs b/nwnds_module/ds_has200gp.ncs new file mode 100644 index 000000000..be8558357 Binary files /dev/null and b/nwnds_module/ds_has200gp.ncs differ diff --git a/nwnds_module/ds_has200gp.nss b/nwnds_module/ds_has200gp.nss new file mode 100644 index 000000000..9dc7fa7ca --- /dev/null +++ b/nwnds_module/ds_has200gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 199) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has300gp.ncs b/nwnds_module/ds_has300gp.ncs new file mode 100644 index 000000000..ffe7691fd Binary files /dev/null and b/nwnds_module/ds_has300gp.ncs differ diff --git a/nwnds_module/ds_has300gp.nss b/nwnds_module/ds_has300gp.nss new file mode 100644 index 000000000..f4c376431 --- /dev/null +++ b/nwnds_module/ds_has300gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 299) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has4000gp.ncs b/nwnds_module/ds_has4000gp.ncs new file mode 100644 index 000000000..d159901b6 Binary files /dev/null and b/nwnds_module/ds_has4000gp.ncs differ diff --git a/nwnds_module/ds_has4000gp.nss b/nwnds_module/ds_has4000gp.nss new file mode 100644 index 000000000..5ccfbbcd2 --- /dev/null +++ b/nwnds_module/ds_has4000gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 3999) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has50000gp.ncs b/nwnds_module/ds_has50000gp.ncs new file mode 100644 index 000000000..2475341f3 Binary files /dev/null and b/nwnds_module/ds_has50000gp.ncs differ diff --git a/nwnds_module/ds_has50000gp.nss b/nwnds_module/ds_has50000gp.nss new file mode 100644 index 000000000..ba777623a --- /dev/null +++ b/nwnds_module/ds_has50000gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 50000) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has500gp.ncs b/nwnds_module/ds_has500gp.ncs new file mode 100644 index 000000000..d0a9016dc Binary files /dev/null and b/nwnds_module/ds_has500gp.ncs differ diff --git a/nwnds_module/ds_has500gp.nss b/nwnds_module/ds_has500gp.nss new file mode 100644 index 000000000..aff58885a --- /dev/null +++ b/nwnds_module/ds_has500gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 499) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_has50gp.ncs b/nwnds_module/ds_has50gp.ncs new file mode 100644 index 000000000..6485a6929 Binary files /dev/null and b/nwnds_module/ds_has50gp.ncs differ diff --git a/nwnds_module/ds_has50gp.nss b/nwnds_module/ds_has50gp.nss new file mode 100644 index 000000000..596e92350 --- /dev/null +++ b/nwnds_module/ds_has50gp.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 49) + return TRUE; +return FALSE; +} + diff --git a/nwnds_module/ds_has700gp.ncs b/nwnds_module/ds_has700gp.ncs new file mode 100644 index 000000000..14b8a2873 Binary files /dev/null and b/nwnds_module/ds_has700gp.ncs differ diff --git a/nwnds_module/ds_has700gp.nss b/nwnds_module/ds_has700gp.nss new file mode 100644 index 000000000..56fbe2f33 --- /dev/null +++ b/nwnds_module/ds_has700gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetGold(GetPCSpeaker()) > 699) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_hasclockmap.ncs b/nwnds_module/ds_hasclockmap.ncs new file mode 100644 index 000000000..39ebfd543 Binary files /dev/null and b/nwnds_module/ds_hasclockmap.ncs differ diff --git a/nwnds_module/ds_hasclockmap.nss b/nwnds_module/ds_hasclockmap.nss new file mode 100644 index 000000000..7194817fb --- /dev/null +++ b/nwnds_module/ds_hasclockmap.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_hasclockmap +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 7:12:43 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "MapofClockworkIsle"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} diff --git a/nwnds_module/ds_hatori001.utc b/nwnds_module/ds_hatori001.utc new file mode 100644 index 000000000..8b234f35f Binary files /dev/null and b/nwnds_module/ds_hatori001.utc differ diff --git a/nwnds_module/ds_hide_sltsrp02.uti b/nwnds_module/ds_hide_sltsrp02.uti new file mode 100644 index 000000000..8b2287859 Binary files /dev/null and b/nwnds_module/ds_hide_sltsrp02.uti differ diff --git a/nwnds_module/ds_hq_citdldoor.ncs b/nwnds_module/ds_hq_citdldoor.ncs new file mode 100644 index 000000000..12c997fef Binary files /dev/null and b/nwnds_module/ds_hq_citdldoor.ncs differ diff --git a/nwnds_module/ds_hq_citdldoor.nss b/nwnds_module/ds_hq_citdldoor.nss new file mode 100644 index 000000000..707fec755 --- /dev/null +++ b/nwnds_module/ds_hq_citdldoor.nss @@ -0,0 +1,43 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: Used to bar the entrance to the Citidel of Fire unless the PC +// has spoken with Xia + +location lTarget; +object oTarget; +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYds_hermitquest"); +if (nInt >= 2) + { + oTarget = GetWaypointByTag("CITADEL1"); + + lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + + if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + + AssignCommand(oPC, ClearAllActions()); + + AssignCommand(oPC, ActionJumpToLocation(lTarget)); + + } +else + { + FloatingTextStringOnCreature("The door bars your entry.", oPC); + + } + +} diff --git a/nwnds_module/ds_hq_complete.ncs b/nwnds_module/ds_hq_complete.ncs new file mode 100644 index 000000000..3433f43f1 Binary files /dev/null and b/nwnds_module/ds_hq_complete.ncs differ diff --git a/nwnds_module/ds_hq_complete.nss b/nwnds_module/ds_hq_complete.nss new file mode 100644 index 000000000..a735acc80 --- /dev/null +++ b/nwnds_module/ds_hq_complete.nss @@ -0,0 +1,25 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: Used to reward PCs for completing The Hermit Questas well as +// remove the Obsidian Orb + +#include "nw_i0_tool" + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_OOBSORB01"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +RewardPartyXP(1500, oPC, TRUE); + +SetLocalInt(oPC, "nHQJob", 4); + +} diff --git a/nwnds_module/ds_hq_conv_start.ncs b/nwnds_module/ds_hq_conv_start.ncs new file mode 100644 index 000000000..51cdd1b81 Binary files /dev/null and b/nwnds_module/ds_hq_conv_start.ncs differ diff --git a/nwnds_module/ds_hq_conv_start.nss b/nwnds_module/ds_hq_conv_start.nss new file mode 100644 index 000000000..026bbc0cb --- /dev/null +++ b/nwnds_module/ds_hq_conv_start.nss @@ -0,0 +1,10 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: Used to start conversations on 2 placeables: The Exit Portal +// in The Pit of Fire and The Dying Slave Tribe Member in +// Barrens Cave. +void main() +{ + ActionStartConversation(GetLastUsedBy(),""); +} diff --git a/nwnds_module/ds_hq_heartbeat.ncs b/nwnds_module/ds_hq_heartbeat.ncs new file mode 100644 index 000000000..4a7017280 Binary files /dev/null and b/nwnds_module/ds_hq_heartbeat.ncs differ diff --git a/nwnds_module/ds_hq_heartbeat.nss b/nwnds_module/ds_hq_heartbeat.nss new file mode 100644 index 000000000..166b425b2 --- /dev/null +++ b/nwnds_module/ds_hq_heartbeat.nss @@ -0,0 +1,9 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: Used to fire the visual effects in the 2nd floor of the +// Citidel of Fire +void main() +{ + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE), GetLocation(GetObjectByTag("WP_HQ_FLAMESTRIKE"))); +} diff --git a/nwnds_module/ds_hq_kaisharga.ncs b/nwnds_module/ds_hq_kaisharga.ncs new file mode 100644 index 000000000..2327be0a2 Binary files /dev/null and b/nwnds_module/ds_hq_kaisharga.ncs differ diff --git a/nwnds_module/ds_hq_kaisharga.nss b/nwnds_module/ds_hq_kaisharga.nss new file mode 100644 index 000000000..a74f28a5a --- /dev/null +++ b/nwnds_module/ds_hq_kaisharga.nss @@ -0,0 +1,20 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: This is the OnPerceived script for the Kaisharga on +// Citadel Level 3. + +object oSeen = GetLastPerceived(); +int nCount = GetLocalInt(OBJECT_SELF,"SaidMyLine"); +void main () +{ + nCount ++; + if (nCount==1) + { + if (GetIsPC(oSeen)) + { + ActionSpeakString("... eykuhl nehdrak - What? Who are you?! How dare you interrupt! You will pay for disrupting the ritual! Attack!!"); + SetLocalInt(OBJECT_SELF,"SaidMyLine",nCount); + } + } +} diff --git a/nwnds_module/ds_hq_orbcheck.ncs b/nwnds_module/ds_hq_orbcheck.ncs new file mode 100644 index 000000000..fb99265d1 Binary files /dev/null and b/nwnds_module/ds_hq_orbcheck.ncs differ diff --git a/nwnds_module/ds_hq_orbcheck.nss b/nwnds_module/ds_hq_orbcheck.nss new file mode 100644 index 000000000..f8f38aaa1 --- /dev/null +++ b/nwnds_module/ds_hq_orbcheck.nss @@ -0,0 +1,19 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: To detemine whether or not the PC has the Obsidian Orb, +// which is obtained by killing Kimzahn Pyrering, for +// the purpose of rewarding quest xp. + +#include "nw_i0_tool" +int StartingConditional() +{ + if(!HasItem(GetPCSpeaker(), "QST_OOBSORB01")) + { + return FALSE; + } + else + { + return TRUE; + } +} diff --git a/nwnds_module/ds_hq_portpc.ncs b/nwnds_module/ds_hq_portpc.ncs new file mode 100644 index 000000000..409409203 Binary files /dev/null and b/nwnds_module/ds_hq_portpc.ncs differ diff --git a/nwnds_module/ds_hq_portpc.nss b/nwnds_module/ds_hq_portpc.nss new file mode 100644 index 000000000..f9c6dec40 --- /dev/null +++ b/nwnds_module/ds_hq_portpc.nss @@ -0,0 +1,15 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: To send the PC from the portal in The Pit of Fire to the +// waypoint outside The Citadel in The Barrens. + +void main() +{ + object oPC = GetLastUsedBy(); + object oDest = GetObjectByTag("DS_citadelportalexit"); + if(GetIsPC(oPC)) + { + AssignCommand(oPC,JumpToObject(oDest)); + } +} diff --git a/nwnds_module/ds_hq_stage1.ncs b/nwnds_module/ds_hq_stage1.ncs new file mode 100644 index 000000000..e5b520f53 Binary files /dev/null and b/nwnds_module/ds_hq_stage1.ncs differ diff --git a/nwnds_module/ds_hq_stage1.nss b/nwnds_module/ds_hq_stage1.nss new file mode 100644 index 000000000..6e89e4083 --- /dev/null +++ b/nwnds_module/ds_hq_stage1.nss @@ -0,0 +1,18 @@ + /* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYds_hermitquest"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ds_hq_stage2.ncs b/nwnds_module/ds_hq_stage2.ncs new file mode 100644 index 000000000..94b51908a Binary files /dev/null and b/nwnds_module/ds_hq_stage2.ncs differ diff --git a/nwnds_module/ds_hq_stage2.nss b/nwnds_module/ds_hq_stage2.nss new file mode 100644 index 000000000..4645b9e7d --- /dev/null +++ b/nwnds_module/ds_hq_stage2.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYds_hermitquest"); + +if (!(nInt == 2)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ds_hq_stage3.ncs b/nwnds_module/ds_hq_stage3.ncs new file mode 100644 index 000000000..5456dfca9 Binary files /dev/null and b/nwnds_module/ds_hq_stage3.ncs differ diff --git a/nwnds_module/ds_hq_stage3.nss b/nwnds_module/ds_hq_stage3.nss new file mode 100644 index 000000000..c8070b44f --- /dev/null +++ b/nwnds_module/ds_hq_stage3.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYds_hermitquest"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ds_hq_stage4.ncs b/nwnds_module/ds_hq_stage4.ncs new file mode 100644 index 000000000..5702f3259 Binary files /dev/null and b/nwnds_module/ds_hq_stage4.ncs differ diff --git a/nwnds_module/ds_hq_stage4.nss b/nwnds_module/ds_hq_stage4.nss new file mode 100644 index 000000000..95b8776ff --- /dev/null +++ b/nwnds_module/ds_hq_stage4.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYds_hermitquest"); + +if (!(nInt == 4)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ds_hunt_cactus01.utc b/nwnds_module/ds_hunt_cactus01.utc new file mode 100644 index 000000000..62ac1699f Binary files /dev/null and b/nwnds_module/ds_hunt_cactus01.utc differ diff --git a/nwnds_module/ds_idfiend001.utc b/nwnds_module/ds_idfiend001.utc new file mode 100644 index 000000000..ef126c5f2 Binary files /dev/null and b/nwnds_module/ds_idfiend001.utc differ diff --git a/nwnds_module/ds_idol003.utp b/nwnds_module/ds_idol003.utp new file mode 100644 index 000000000..abde9707f Binary files /dev/null and b/nwnds_module/ds_idol003.utp differ diff --git a/nwnds_module/ds_idol01.utp b/nwnds_module/ds_idol01.utp new file mode 100644 index 000000000..53f632058 Binary files /dev/null and b/nwnds_module/ds_idol01.utp differ diff --git a/nwnds_module/ds_ingredients.ncs b/nwnds_module/ds_ingredients.ncs new file mode 100644 index 000000000..e566ab40f Binary files /dev/null and b/nwnds_module/ds_ingredients.ncs differ diff --git a/nwnds_module/ds_ingredients.nss b/nwnds_module/ds_ingredients.nss new file mode 100644 index 000000000..173da454d --- /dev/null +++ b/nwnds_module/ds_ingredients.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName at_011 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 11:56:58 AM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("Ingredients"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/ds_inix001.utc b/nwnds_module/ds_inix001.utc new file mode 100644 index 000000000..1911bd335 Binary files /dev/null and b/nwnds_module/ds_inix001.utc differ diff --git a/nwnds_module/ds_isclock0.ncs b/nwnds_module/ds_isclock0.ncs new file mode 100644 index 000000000..249f9bc98 Binary files /dev/null and b/nwnds_module/ds_isclock0.ncs differ diff --git a/nwnds_module/ds_isclock0.nss b/nwnds_module/ds_isclock0.nss new file mode 100644 index 000000000..3e5e9c56a --- /dev/null +++ b/nwnds_module/ds_isclock0.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_isclock0 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 7:10:17 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nClock") < 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ds_isclock1.ncs b/nwnds_module/ds_isclock1.ncs new file mode 100644 index 000000000..aeb829a7e Binary files /dev/null and b/nwnds_module/ds_isclock1.ncs differ diff --git a/nwnds_module/ds_isclock1.nss b/nwnds_module/ds_isclock1.nss new file mode 100644 index 000000000..e72d13d9b --- /dev/null +++ b/nwnds_module/ds_isclock1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_isclock1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 7:10:57 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nClock") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ds_isclock2.ncs b/nwnds_module/ds_isclock2.ncs new file mode 100644 index 000000000..2b3db3815 Binary files /dev/null and b/nwnds_module/ds_isclock2.ncs differ diff --git a/nwnds_module/ds_isclock2.nss b/nwnds_module/ds_isclock2.nss new file mode 100644 index 000000000..04d41a9e3 --- /dev/null +++ b/nwnds_module/ds_isclock2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_isclock2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 4:10:18 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nClock") >= 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ds_isclock8.ncs b/nwnds_module/ds_isclock8.ncs new file mode 100644 index 000000000..5d68a186a Binary files /dev/null and b/nwnds_module/ds_isclock8.ncs differ diff --git a/nwnds_module/ds_isclock8.nss b/nwnds_module/ds_isclock8.nss new file mode 100644 index 000000000..6ff91f173 --- /dev/null +++ b/nwnds_module/ds_isclock8.nss @@ -0,0 +1,14 @@ +int StartingConditional() +{ + + // Inspect local variables + if((GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph1") == 1) && + (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph2") == 1) && + (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph3") == 1) && + (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph4") == 1) && + (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph5") == 1) && + (GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "glyph6") == 1)) + return TRUE; + + return FALSE; +} diff --git a/nwnds_module/ds_isthief.ncs b/nwnds_module/ds_isthief.ncs new file mode 100644 index 000000000..0da1b27e1 Binary files /dev/null and b/nwnds_module/ds_isthief.ncs differ diff --git a/nwnds_module/ds_isthief.nss b/nwnds_module/ds_isthief.nss new file mode 100644 index 000000000..08a5a85f7 --- /dev/null +++ b/nwnds_module/ds_isthief.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_ROGUE, oPC)==0)) +return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ds_isunderlvl7.ncs b/nwnds_module/ds_isunderlvl7.ncs new file mode 100644 index 000000000..aa9553667 Binary files /dev/null and b/nwnds_module/ds_isunderlvl7.ncs differ diff --git a/nwnds_module/ds_isunderlvl7.nss b/nwnds_module/ds_isunderlvl7.nss new file mode 100644 index 000000000..94c44b1cc --- /dev/null +++ b/nwnds_module/ds_isunderlvl7.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetHitDice(GetPCSpeaker()) < 7) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/ds_isva.ncs b/nwnds_module/ds_isva.ncs new file mode 100644 index 000000000..11becad9d Binary files /dev/null and b/nwnds_module/ds_isva.ncs differ diff --git a/nwnds_module/ds_isva.nss b/nwnds_module/ds_isva.nss new file mode 100644 index 000000000..0173eeade --- /dev/null +++ b/nwnds_module/ds_isva.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ +if (GetIsObjectValid(GetItemPossessedBy(GetPCSpeaker(), "VeiledAllianceAmulet"))) + return TRUE; + return FALSE; +} diff --git a/nwnds_module/ds_isva3.ncs b/nwnds_module/ds_isva3.ncs new file mode 100644 index 000000000..be561e3c7 Binary files /dev/null and b/nwnds_module/ds_isva3.ncs differ diff --git a/nwnds_module/ds_isva3.nss b/nwnds_module/ds_isva3.nss new file mode 100644 index 000000000..22a4cfa40 --- /dev/null +++ b/nwnds_module/ds_isva3.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "urikva") >= 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/ds_itemcleanup.ncs b/nwnds_module/ds_itemcleanup.ncs new file mode 100644 index 000000000..db10200f2 Binary files /dev/null and b/nwnds_module/ds_itemcleanup.ncs differ diff --git a/nwnds_module/ds_itemcleanup.nss b/nwnds_module/ds_itemcleanup.nss new file mode 100644 index 000000000..0c17f10f3 --- /dev/null +++ b/nwnds_module/ds_itemcleanup.nss @@ -0,0 +1,35 @@ +#include "spawn_main" + +void CleanUpArea() +{ + if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0) + { + object oItem = GetFirstObjectInArea(); + int iObjectType; + while (GetIsObjectValid(oItem)) + { + iObjectType = GetObjectType(oItem); + switch(iObjectType) + { + case OBJECT_TYPE_PLACEABLE: + if (GetTag(oItem) == "Body Bag") + DestroyObject(oItem); + break; + case OBJECT_TYPE_ITEM: + DestroyObject(oItem); + break; + } + oItem = GetNextObjectInArea(); + } + } +} + +void main() +{ + Spawn_OnAreaExit(); + if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0) DelayCommand(300.0, CleanUpArea()); + //NC:EDIT + //Added to enable Defiling Aura for NPC's + object oEntering = GetExitingObject(); + SetLocalInt(GetArea(oEntering), "X2_L_WILD_MAGIC", 0); +} diff --git a/nwnds_module/ds_itmclk_tormnd.uti b/nwnds_module/ds_itmclk_tormnd.uti new file mode 100644 index 000000000..24741d6ef Binary files /dev/null and b/nwnds_module/ds_itmclk_tormnd.uti differ diff --git a/nwnds_module/ds_jaguar001.utc b/nwnds_module/ds_jaguar001.utc new file mode 100644 index 000000000..f7346bd65 Binary files /dev/null and b/nwnds_module/ds_jaguar001.utc differ diff --git a/nwnds_module/ds_jankx001.utc b/nwnds_module/ds_jankx001.utc new file mode 100644 index 000000000..473a4a4dc Binary files /dev/null and b/nwnds_module/ds_jankx001.utc differ diff --git a/nwnds_module/ds_jhakar001.utc b/nwnds_module/ds_jhakar001.utc new file mode 100644 index 000000000..fbcfb10d1 Binary files /dev/null and b/nwnds_module/ds_jhakar001.utc differ diff --git a/nwnds_module/ds_jhakar002.utc b/nwnds_module/ds_jhakar002.utc new file mode 100644 index 000000000..b477b8e8f Binary files /dev/null and b/nwnds_module/ds_jhakar002.utc differ diff --git a/nwnds_module/ds_jozhal001.utc b/nwnds_module/ds_jozhal001.utc new file mode 100644 index 000000000..87aaeee1d Binary files /dev/null and b/nwnds_module/ds_jozhal001.utc differ diff --git a/nwnds_module/ds_jumpjailout.ncs b/nwnds_module/ds_jumpjailout.ncs new file mode 100644 index 000000000..6edd89e82 Binary files /dev/null and b/nwnds_module/ds_jumpjailout.ncs differ diff --git a/nwnds_module/ds_jumpjailout.nss b/nwnds_module/ds_jumpjailout.nss new file mode 100644 index 000000000..602eedce0 --- /dev/null +++ b/nwnds_module/ds_jumpjailout.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_jumpjailout +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/8/02 7:26:12 PM +//:: Edited By: DM Heatstroke +//:: Edited On: 10/30/08 6:51 PM +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + //Set up faction variables + object oPC = GetPCSpeaker(); + object oTyrian = GetObjectByTag("ATHAS_FACTION_TYR"); + object oUrikite = GetObjectByTag("ATHAS_FACTION_URIK"); + object oNoncombat = GetObjectByTag("ATHAS_FACTION_NONCOMBATANT"); + object oNeut1 = GetObjectByTag("ATHAS_FACTION_NEUTRAL1"); + object oNeut2 = GetObjectByTag("ATHAS_FACTION_NEUTRAL2"); + object oVA = GetObjectByTag("ATHAS_FACTION_VEILEDALLIANCE"); + object oDraqo = GetObjectByTag("ATHAS_FACTION_DRAQO"); + + // Set the faction to like the player so they may leave jail safely. + AdjustReputation(GetPCSpeaker(), OBJECT_SELF, 80); + AdjustReputation(GetPCSpeaker(), oTyrian, 80); + AdjustReputation(GetPCSpeaker(), oUrikite, 80); + AdjustReputation(GetPCSpeaker(), oNoncombat, 80); + AdjustReputation(GetPCSpeaker(), oNeut1, 80); + AdjustReputation(GetPCSpeaker(), oNeut2, 80); + AdjustReputation(GetPCSpeaker(), oVA, 80); + AdjustReputation(GetPCSpeaker(), oDraqo, 80); + + // Set standard factions to like the player so they may leave jail safely. + SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80); + SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80); + DetermineCombatRound(GetPCSpeaker()); + AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_JailOut")))); +} diff --git a/nwnds_module/ds_jumptoclock.ncs b/nwnds_module/ds_jumptoclock.ncs new file mode 100644 index 000000000..9a5bb067e Binary files /dev/null and b/nwnds_module/ds_jumptoclock.ncs differ diff --git a/nwnds_module/ds_jumptoclock.nss b/nwnds_module/ds_jumptoclock.nss new file mode 100644 index 000000000..db4c5b557 --- /dev/null +++ b/nwnds_module/ds_jumptoclock.nss @@ -0,0 +1,5 @@ +void main() +{ + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("ClockworkStart")))); + +} diff --git a/nwnds_module/ds_jumptocrawl.ncs b/nwnds_module/ds_jumptocrawl.ncs new file mode 100644 index 000000000..79e6469d1 Binary files /dev/null and b/nwnds_module/ds_jumptocrawl.ncs differ diff --git a/nwnds_module/ds_jumptocrawl.nss b/nwnds_module/ds_jumptocrawl.nss new file mode 100644 index 000000000..692698d19 --- /dev/null +++ b/nwnds_module/ds_jumptocrawl.nss @@ -0,0 +1,6 @@ +void main() +{ + +AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("THECRAWL")))); +DelayCommand(10.0,SetLocked(GetObjectByTag("KatjanasCloset"),TRUE)); +} diff --git a/nwnds_module/ds_jumptocrimson.ncs b/nwnds_module/ds_jumptocrimson.ncs new file mode 100644 index 000000000..e77975f2c Binary files /dev/null and b/nwnds_module/ds_jumptocrimson.ncs differ diff --git a/nwnds_module/ds_jumptocrimson.nss b/nwnds_module/ds_jumptocrimson.nss new file mode 100644 index 000000000..e6076529e --- /dev/null +++ b/nwnds_module/ds_jumptocrimson.nss @@ -0,0 +1,6 @@ +void main() +{ +TakeGoldFromCreature(250, GetPCSpeaker(), TRUE); +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_CrimsonEnter")))); +} + diff --git a/nwnds_module/ds_jumptodead.ncs b/nwnds_module/ds_jumptodead.ncs new file mode 100644 index 000000000..8f7a9cd5c Binary files /dev/null and b/nwnds_module/ds_jumptodead.ncs differ diff --git a/nwnds_module/ds_jumptodead.nss b/nwnds_module/ds_jumptodead.nss new file mode 100644 index 000000000..de76871df --- /dev/null +++ b/nwnds_module/ds_jumptodead.nss @@ -0,0 +1,5 @@ +void main() +{ + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_DEADSREVENGE")))); + DelayCommand(30.0,SetLocked(GetObjectByTag("dt_healerschest"),TRUE)); +} diff --git a/nwnds_module/ds_jumptoemotion.ncs b/nwnds_module/ds_jumptoemotion.ncs new file mode 100644 index 000000000..846ea2ebf Binary files /dev/null and b/nwnds_module/ds_jumptoemotion.ncs differ diff --git a/nwnds_module/ds_jumptoemotion.nss b/nwnds_module/ds_jumptoemotion.nss new file mode 100644 index 000000000..6bd15efd6 --- /dev/null +++ b/nwnds_module/ds_jumptoemotion.nss @@ -0,0 +1,5 @@ +void main() +{ +object oUser = GetLastUsedBy(); +AssignCommand(oUser,ActionJumpToLocation(GetLocation(GetWaypointByTag("WP_EMOTIONAL")))); +} diff --git a/nwnds_module/ds_jumptointro.ncs b/nwnds_module/ds_jumptointro.ncs new file mode 100644 index 000000000..083c7b686 Binary files /dev/null and b/nwnds_module/ds_jumptointro.ncs differ diff --git a/nwnds_module/ds_jumptointro.nss b/nwnds_module/ds_jumptointro.nss new file mode 100644 index 000000000..4f951eaa6 --- /dev/null +++ b/nwnds_module/ds_jumptointro.nss @@ -0,0 +1,14 @@ +void main() +{ + object oPlayer = GetEnteringObject(); + if (GetIsPC(oPlayer)) + { + if (GetHitDice(oPlayer) ==3) + { + if (!GetIsDM(oPlayer)) + { + AssignCommand(oPlayer, ActionJumpToObject(GetWaypointByTag("cut01way_enter"))); + } + } + } +} diff --git a/nwnds_module/ds_jumptopriests.ncs b/nwnds_module/ds_jumptopriests.ncs new file mode 100644 index 000000000..f6e304e32 Binary files /dev/null and b/nwnds_module/ds_jumptopriests.ncs differ diff --git a/nwnds_module/ds_jumptopriests.nss b/nwnds_module/ds_jumptopriests.nss new file mode 100644 index 000000000..c33ee374b --- /dev/null +++ b/nwnds_module/ds_jumptopriests.nss @@ -0,0 +1,6 @@ +void main() +{ + + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("THEPRIESTS")))); + DelayCommand(10.0,SetLocked(GetObjectByTag("3BarreltoPriests"),TRUE)); +} diff --git a/nwnds_module/ds_jumptosot.ncs b/nwnds_module/ds_jumptosot.ncs new file mode 100644 index 000000000..c1208c860 Binary files /dev/null and b/nwnds_module/ds_jumptosot.ncs differ diff --git a/nwnds_module/ds_jumptosot.nss b/nwnds_module/ds_jumptosot.nss new file mode 100644 index 000000000..d252fd5b6 --- /dev/null +++ b/nwnds_module/ds_jumptosot.nss @@ -0,0 +1,5 @@ +void main() +{ +object oUser = GetLastUsedBy(); +AssignCommand(oUser,ActionJumpToLocation(GetLocation(GetWaypointByTag("WP_UNDERHILL")))); +} diff --git a/nwnds_module/ds_jumptotherevs.ncs b/nwnds_module/ds_jumptotherevs.ncs new file mode 100644 index 000000000..2e61d5bb8 Binary files /dev/null and b/nwnds_module/ds_jumptotherevs.ncs differ diff --git a/nwnds_module/ds_jumptotherevs.nss b/nwnds_module/ds_jumptotherevs.nss new file mode 100644 index 000000000..89e9c70ea --- /dev/null +++ b/nwnds_module/ds_jumptotherevs.nss @@ -0,0 +1,5 @@ +void main() +{ +AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("THEREVS")))); +DelayCommand(10.0,SetLocked(GetObjectByTag("WeaverCabinet"),TRUE)); +} diff --git a/nwnds_module/ds_justlreward.ncs b/nwnds_module/ds_justlreward.ncs new file mode 100644 index 000000000..dd94d8188 Binary files /dev/null and b/nwnds_module/ds_justlreward.ncs differ diff --git a/nwnds_module/ds_justlreward.nss b/nwnds_module/ds_justlreward.nss new file mode 100644 index 000000000..c8b708f10 --- /dev/null +++ b/nwnds_module/ds_justlreward.nss @@ -0,0 +1,10 @@ +#include "nw_i0_plotwizard" +void main() +{ + object oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_LASKCHFHEAD"); + DestroyObject(oItemToTake); + CreateItemOnObject("QST_ITNCK_JUSTL", GetPCSpeaker()); + PWSetMinLocalIntPartyPCSpeaker("p001state_Justl", 3); + PWSetMinLocalIntPartyPCSpeaker("p001state", 3); + PWGiveExperienceParty(GetPCSpeaker(), 2000); +} diff --git a/nwnds_module/ds_kalin001.utc b/nwnds_module/ds_kalin001.utc new file mode 100644 index 000000000..88228f486 Binary files /dev/null and b/nwnds_module/ds_kalin001.utc differ diff --git a/nwnds_module/ds_kank001.utc b/nwnds_module/ds_kank001.utc new file mode 100644 index 000000000..73d48fb3a Binary files /dev/null and b/nwnds_module/ds_kank001.utc differ diff --git a/nwnds_module/ds_kank002.utc b/nwnds_module/ds_kank002.utc new file mode 100644 index 000000000..b604947e3 Binary files /dev/null and b/nwnds_module/ds_kank002.utc differ diff --git a/nwnds_module/ds_killinnocent.ncs b/nwnds_module/ds_killinnocent.ncs new file mode 100644 index 000000000..ae6741018 Binary files /dev/null and b/nwnds_module/ds_killinnocent.ncs differ diff --git a/nwnds_module/ds_killinnocent.nss b/nwnds_module/ds_killinnocent.nss new file mode 100644 index 000000000..aeaa66601 --- /dev/null +++ b/nwnds_module/ds_killinnocent.nss @@ -0,0 +1,97 @@ +//::////////////////////////////////////////////////// +//:: ds_killinnocent +/* + OnDeath event handler for commoner NPCs. + + Adjusts killer's alignment if appropriate and + alerts allies to our death. + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// +//::////////////////////////////////////////////////// +//:: Modified By: Deva Winblood +//:: Modified On: April 1st, 2008 +//:: Added Support for Dying Wile Mounted +//::///////////////////////////////////////////////// + +#include "x2_inc_compon" +#include "x0_i0_spawncond" +//#include "x3_inc_horse" + +void ClearSlot(int iSlotID); + +void main() +{ + + int nClass = GetLevelByClass(CLASS_TYPE_COMMONER); + int nAlign = GetAlignmentGoodEvil(OBJECT_SELF); + object oKiller = GetLastKiller(); + + ExecuteScript("prc_npc_death", OBJECT_SELF); + ExecuteScript("prc_pwondeath", OBJECT_SELF); + + if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) + SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE); + + // Default Commoner alignment changing. (If the commoner is not evil!) + if (nClass > 1 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, 10); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, 5); + } + } + } + + // Call to allies to let them know we're dead + SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK); + + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + // NOTE: the OnDeath user-defined event does not + // trigger reliably and should probably be removed + if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1007)); + } + craft_drop_items(OBJECT_SELF); + + ClearSlot(INVENTORY_SLOT_CHEST); + + // initialise local variables + int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); + object oPC = GetLastKiller(); + string sTagSelf = GetTag(OBJECT_SELF); + string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); + AdjustAlignment (oPC, ALIGNMENT_EVIL, 7); + // check for correct kill task target and complete + if(sTagSelf == sTagTarget && nKillFlag == 1) + { + SetLocalInt(oPC, "KILL_TASK_FLAG", 2); + AddJournalQuestEntry("kt_journal_01", 99, oPC); + } +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} diff --git a/nwnds_module/ds_kip001.utc b/nwnds_module/ds_kip001.utc new file mode 100644 index 000000000..cc928bec4 Binary files /dev/null and b/nwnds_module/ds_kip001.utc differ diff --git a/nwnds_module/ds_kluzd001.utc b/nwnds_module/ds_kluzd001.utc new file mode 100644 index 000000000..593403531 Binary files /dev/null and b/nwnds_module/ds_kluzd001.utc differ diff --git a/nwnds_module/ds_kreel001.utc b/nwnds_module/ds_kreel001.utc new file mode 100644 index 000000000..982d3419c Binary files /dev/null and b/nwnds_module/ds_kreel001.utc differ diff --git a/nwnds_module/ds_kreen_bite_c.uti b/nwnds_module/ds_kreen_bite_c.uti new file mode 100644 index 000000000..073461e0f Binary files /dev/null and b/nwnds_module/ds_kreen_bite_c.uti differ diff --git a/nwnds_module/ds_kreen_bite_d.uti b/nwnds_module/ds_kreen_bite_d.uti new file mode 100644 index 000000000..f43314ee6 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_d.uti differ diff --git a/nwnds_module/ds_kreen_bite_f.uti b/nwnds_module/ds_kreen_bite_f.uti new file mode 100644 index 000000000..66bf2ace6 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_f.uti differ diff --git a/nwnds_module/ds_kreen_bite_g.uti b/nwnds_module/ds_kreen_bite_g.uti new file mode 100644 index 000000000..d365f0933 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_g.uti differ diff --git a/nwnds_module/ds_kreen_bite_h.uti b/nwnds_module/ds_kreen_bite_h.uti new file mode 100644 index 000000000..97541a1b9 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_h.uti differ diff --git a/nwnds_module/ds_kreen_bite_l.uti b/nwnds_module/ds_kreen_bite_l.uti new file mode 100644 index 000000000..507dca012 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_l.uti differ diff --git a/nwnds_module/ds_kreen_bite_m.uti b/nwnds_module/ds_kreen_bite_m.uti new file mode 100644 index 000000000..2232bfa74 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_m.uti differ diff --git a/nwnds_module/ds_kreen_bite_s.uti b/nwnds_module/ds_kreen_bite_s.uti new file mode 100644 index 000000000..f7ae52b96 Binary files /dev/null and b/nwnds_module/ds_kreen_bite_s.uti differ diff --git a/nwnds_module/ds_kreen_bite_t.uti b/nwnds_module/ds_kreen_bite_t.uti new file mode 100644 index 000000000..758e13a1b Binary files /dev/null and b/nwnds_module/ds_kreen_bite_t.uti differ diff --git a/nwnds_module/ds_kreen_claw_c.uti b/nwnds_module/ds_kreen_claw_c.uti new file mode 100644 index 000000000..385eaaf69 Binary files /dev/null and b/nwnds_module/ds_kreen_claw_c.uti differ diff --git a/nwnds_module/ds_kreen_claw_d.uti b/nwnds_module/ds_kreen_claw_d.uti new file mode 100644 index 000000000..2ffea90d5 Binary files /dev/null and b/nwnds_module/ds_kreen_claw_d.uti differ diff --git a/nwnds_module/ds_kreen_claw_f.uti b/nwnds_module/ds_kreen_claw_f.uti new file mode 100644 index 000000000..f56d040bd Binary files /dev/null and b/nwnds_module/ds_kreen_claw_f.uti differ diff --git a/nwnds_module/ds_kreen_claw_g.uti b/nwnds_module/ds_kreen_claw_g.uti new file mode 100644 index 000000000..d0aedd450 Binary files /dev/null and b/nwnds_module/ds_kreen_claw_g.uti differ diff --git a/nwnds_module/ds_kreen_claw_h.uti b/nwnds_module/ds_kreen_claw_h.uti new file mode 100644 index 000000000..8986e1dce Binary files /dev/null and b/nwnds_module/ds_kreen_claw_h.uti differ diff --git a/nwnds_module/ds_kreen_claw_l.uti b/nwnds_module/ds_kreen_claw_l.uti new file mode 100644 index 000000000..c8f2303cd Binary files /dev/null and b/nwnds_module/ds_kreen_claw_l.uti differ diff --git a/nwnds_module/ds_kreen_claw_m.uti b/nwnds_module/ds_kreen_claw_m.uti new file mode 100644 index 000000000..40bb35d0d Binary files /dev/null and b/nwnds_module/ds_kreen_claw_m.uti differ diff --git a/nwnds_module/ds_kreen_claw_s.uti b/nwnds_module/ds_kreen_claw_s.uti new file mode 100644 index 000000000..b4e774c55 Binary files /dev/null and b/nwnds_module/ds_kreen_claw_s.uti differ diff --git a/nwnds_module/ds_kreen_claw_t.uti b/nwnds_module/ds_kreen_claw_t.uti new file mode 100644 index 000000000..acb34e3bf Binary files /dev/null and b/nwnds_module/ds_kreen_claw_t.uti differ diff --git a/nwnds_module/ds_lboneclaw001.utc b/nwnds_module/ds_lboneclaw001.utc new file mode 100644 index 000000000..f16403c0b Binary files /dev/null and b/nwnds_module/ds_lboneclaw001.utc differ diff --git a/nwnds_module/ds_lichmerch.ncs b/nwnds_module/ds_lichmerch.ncs new file mode 100644 index 000000000..6b351d5e4 Binary files /dev/null and b/nwnds_module/ds_lichmerch.ncs differ diff --git a/nwnds_module/ds_lichmerch.nss b/nwnds_module/ds_lichmerch.nss new file mode 100644 index 000000000..7376a355b --- /dev/null +++ b/nwnds_module/ds_lichmerch.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_lichmerch +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/24/2002 5:03:12 PM +//::////////////////////////////////////////////// +void main() +{ + + // Either open the store with that tag or let the user know that no store exists. + object oStore = GetNearestObjectByTag("lich"); + if(GetObjectType(oStore) == OBJECT_TYPE_STORE) + OpenStore(oStore, GetPCSpeaker()); + else + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); +} diff --git a/nwnds_module/ds_lirr001.utc b/nwnds_module/ds_lirr001.utc new file mode 100644 index 000000000..88bc856a0 Binary files /dev/null and b/nwnds_module/ds_lirr001.utc differ diff --git a/nwnds_module/ds_lizmintr001.utc b/nwnds_module/ds_lizmintr001.utc new file mode 100644 index 000000000..ef5f26e52 Binary files /dev/null and b/nwnds_module/ds_lizmintr001.utc differ diff --git a/nwnds_module/ds_lizsubterr001.utc b/nwnds_module/ds_lizsubterr001.utc new file mode 100644 index 000000000..2ccf259e2 Binary files /dev/null and b/nwnds_module/ds_lizsubterr001.utc differ diff --git a/nwnds_module/ds_loot.nss b/nwnds_module/ds_loot.nss new file mode 100644 index 000000000..1cb88c1d6 --- /dev/null +++ b/nwnds_module/ds_loot.nss @@ -0,0 +1,836 @@ +int nRandom = d100(); +string sItem; +int nStack = 1; + +void dsoCreateItemOnObject(string sItemTemplate, object oTarget = OBJECT_SELF, int nStackSize = 1) + { + // Make sure it's a blueprint by trimming to 16 and lowercasing it +// SpeakString("Will create item "+sItemTemplate+" stack "+IntToString(nStackSize)); + sItemTemplate = GetSubString(sItemTemplate, 0, 16); + sItemTemplate = GetStringLowerCase(sItemTemplate); + //SpeakString("Attempting to create item "+sItemTemplate+" stack "+IntToString(nStackSize)); + object oItem = CreateItemOnObject(sItemTemplate, oTarget, nStackSize); + } + +void TrashLoot () { +nRandom = d20(); +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "Bandage"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Bandage"; break; +case 9: sItem = "Ginseng"; break; +case 10: sItem = "Ginseng"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + + }//switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); + +} // TrashLoot + + +void UberLoot () { +nRandom = d100(); +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; +case 20: sItem = "iconicamuletofch"; break; +case 21: sItem = "iconicamuletofst"; break; +case 22: sItem = "iconicringofdext"; break; +case 23: sItem = "iconicamuletofwi"; break; +case 24: sItem = "iconicringofinte"; break; +case 25: sItem = "iconicringofs"; break; +case 26: sItem = "iconicringofwisd"; break; +case 27: sItem = "iconicamuletofco"; break; +case 28: sItem = "iconicamuletofde"; break; +case 29: sItem = "iconicamuletofin"; break; +case 30: sItem = "iconicringofcons"; break; +case 31: sItem = "jingsgarb"; break; +case 32: sItem = "rhulthaunmaste"; break; +case 33: sItem = "robeofillwill"; break; +case 34: sItem = "phandarashelm"; break; +case 35: sItem = "beastmasterarm"; break; +case 36: sItem = "battleragearmo"; break; +case 37: sItem = "forgedshieldof"; break; +case 38: sItem = "halfbreedsguardi"; break; +case 39: sItem = "girdleofpower"; break; +case 40: sItem = "jandorasgarb"; break; +case 41: sItem = "jandorastiara"; break; +case 42: sItem = "bracersofwardi"; break; +case 43: sItem = "torakswrap"; break; +case 44: sItem = "spectralcloak"; break; +case 45: sItem = "blindingedgegaun"; break; +case 46: sItem = "greaterringofadr"; break; +case 47: sItem = "scorchedaxeof"; break; +case 48: sItem = "ragnarok"; break; +case 49: sItem = "ginosbackstabb"; break; +case 50: sItem = "thecleavelander"; break; +case 51: sItem = "lifesapper"; break; +case 52: sItem = "heartpiercer"; break; +case 53: sItem = "thewifebeater"; break; +case 54: sItem = "theeclipse"; break; +case 55: sItem = "justlshammer"; break; +case 56: sItem = "sunstaff"; break; +case 57: sItem = "destinysedge"; break; +case 58: sItem = "theicyheart"; break; +case 59: sItem = "jandorasbracers"; break; +case 60: sItem = "beastmasterarm"; break; +case 61: sItem = "theoldballandcha"; break; +case 62: sItem = "heartripper"; break; +case 63: sItem = "beastmasterbla"; break; +case 64: sItem = "theharvester"; break; +case 65: sItem = "devestation"; break; +case 66: sItem = "shininggythka"; break; +case 67: sItem = "drakebonegythk"; break; +case 68: sItem = "robesofthewis"; break; +case 69: sItem = "lalorsspine"; break; +case 70: sItem = "psitana"; break; +case 71: sItem = "solarflare"; break; +case 72: sItem = "lalisbliss"; break; +case 73: sItem = "messengerofraj"; break; +case 74: sItem = "embraceofthespir"; break; +case 75: sItem = "regaliaofsanshir"; break; +case 76: sItem = "helmofsanshir"; break; +case 77: sItem = "sanshirswall"; break; +case 78: sItem = "sanshirsfury"; break; +case 79: sItem = "heartofthecalder"; break; +case 80: sItem = "mountainsoul"; break; + + + }//switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); + +} // UberLoot + + +void Loot() +{ +int nBump = GetHitDice(OBJECT_SELF); +//SpeakString("My hit dice "+IntToString(nBump)); + + + + +if (nBump < 6) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + +case 15: sItem = "it_thnmisc002"; break; +case 16: sItem = "it_torch002"; break; +case 17: sItem = "it_thnmisc002"; break; +case 18: sItem = "it_msmlmisc024"; break; +case 19: sItem = "it_msmlmisc025"; break; +case 20: sItem = "it_msmlmisc012"; break; +case 21: sItem = "wswss002"; break; +case 22: sItem = "wblcl002"; break; +case 23: sItem = "wblfh002"; break; +case 24: sItem = "BoneLightFlail"; break; +case 25: sItem = "wblhl002"; break; +case 26: sItem = "wblhw002"; break; +case 27: sItem = "wblml002"; break; +case 28: sItem = "wblms002"; break; +case 29: sItem = "DoubleBladedSpear"; break; +case 30: sItem = "wplhb002"; break; +case 31: sItem = "wplss002"; break; +case 32: sItem = "WoodenQuarterstaff"; break; +case 33: sItem = "wbwxh002"; break; +case 34: sItem = "wbwxl002"; break; +case 35: sItem = "wbwln002"; break; +case 36: sItem = "wbwsh002"; break; +case 37: sItem = "wbwsl002"; break; +case 38: sItem = "Compress"; break; +case 39: sItem = "MagicCornJuice"; break; +case 40: sItem = "MagicOrangeJuice"; break; +case 41: sItem = "MagicSpinachJuice"; break; +case 42: sItem = "MagicalBannanaJuice"; break; +case 43: sItem = "AcidCrystal"; break; +case 44: sItem = "Bandage"; break; +case 45: sItem = "Brimstone"; break; +case 46: sItem = "ChargedCrystal"; break; +case 47: sItem = "IceNine"; break; +case 48: sItem = "ErdluBlood"; break; +case 49: sItem = "Ginseng"; break; +case 50: sItem = "Spinach"; break; +case 51: sItem = "Water"; break; +case 52: sItem = "water001"; break; +case 53: sItem = "water002"; break; +case 54: sItem = "aarcl006"; break; +case 55: sItem = "Compress"; break; +case 56: sItem = "aarcl007"; break; +case 57: sItem = "Compress"; break; +case 58: sItem = "aarcl004"; break; +case 59: sItem = "aarcl011"; break; +case 60: sItem = "aarcl010"; break; +case 61: sItem = "aarcl013"; break; +case 62: sItem = "aarcl003"; break; +case 63: sItem = "aarcl002"; break; +case 64: sItem = "aarcl015"; break; +case 65: sItem = "ARHE005"; break; +case 66: sItem = "ARHE002"; break; +case 67: sItem = "ashlw002"; break; +case 68: sItem = "ashsw002"; break; +case 69: sItem = "ashto002"; break; +case 70: sItem = "waxhn002"; break; +case 71: sItem = "wswdg002"; break; +case 72: sItem = "wswls002"; break; +case 73: sItem = "woodenquartersta"; break; +case 74: sItem = "bonescythe"; break; +case 75: sItem = "bonesickle"; break; +case 76: sItem = "bonekama"; break; +case 77: sItem = "alchbasics"; break; + + + +// Stack these 12-50 +case 81: sItem = "Chatchka"; break; +case 82: sItem = "wthax002"; break; +case 83: sItem = "wthdt002"; break; +case 84: sItem = "wamar002"; break; +case 85: sItem = "wambo002"; break; +case 86: sItem = "wambu002"; break; +} + +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} // end under 6 chart + + +if (nBump > 5 && nBump < 11) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + + +case 20: sItem = "aarcl008"; break; +case 21: sItem = "aarcl012"; break; +case 22: sItem = "aarcl009"; break; +case 23: sItem = "ironhelmet"; break; +case 24: sItem = "spelunkershelm"; break; +case 25: sItem = "aarcl014"; break; +case 26: sItem = "aarcl005"; break; +case 27: sItem = "ashmlw003"; break; +case 28: sItem = "ashmsw003"; break; +case 29: sItem = "ashmto003"; break; +case 30: sItem = "bookoflore"; break; +case 31: sItem = "bracersofdefense"; break; +case 32: sItem = "cloakofcamoflaug"; break; +case 33: sItem = "lesseramuletofin"; break; +case 34: sItem = "lesseramuletofst"; break; +case 35: sItem = "lesseramuletofwi"; break; +case 36: sItem = "lesserringofinte"; break; +case 37: sItem = "lesserringofwisd"; break; +case 38: sItem = "basichealersk"; break; +case 39: sItem = "it_contain003"; break; +case 40: sItem = "adventurersamule"; break; +case 41: sItem = "arachnidsnecklac"; break; +case 42: sItem = "waxgr002"; break; +case 43: sItem = "waxmhn003"; break; +case 44: sItem = "waxbt002"; break; +case 45: sItem = "wswmbs003"; break; +case 46: sItem = "wswmdg003"; break; +case 47: sItem = "wswmgs003"; break; +case 48: sItem = "wswmls003"; break; +case 49: sItem = "wswmrp003"; break; +case 50: sItem = "wswmsc003"; break; +case 51: sItem = "wswmss003"; break; +case 52: sItem = "ironspikedclub"; break; +case 53: sItem = "wblmfl003"; break; +case 54: sItem = "wblmfh003"; break; +case 55: sItem = "wblmhl003"; break; +case 56: sItem = "wblmhw003"; break; +case 57: sItem = "wblmml003"; break; +case 58: sItem = "wblmms003"; break; +case 59: sItem = "wandofmissiles"; break; +case 60: sItem = "wplmhb003"; break; +case 61: sItem = "wplmss003"; break; +case 62: sItem = "giantslayersling"; break; +case 63: sItem = "ironscalemail"; break; +case 64: sItem = "irondoubleblad"; break; +case 65: sItem = "ironkukri"; break; +case 66: sItem = "IronKama"; break; +case 67: sItem = "IronScythe"; break; +case 68: sItem = "IronSickle"; break; +case 69: sItem = "ironshodquarte"; break; +case 70: sItem = "parryingdagger"; break; +case 71: sItem = "lesseramuletofco"; break; +case 72: sItem = "lesseramuletofde"; break; +case 73: sItem = "lesserringofstre"; break; +case 74: sItem = "lesserringofdext"; break; +case 75: sItem = "lesserringofcons"; break; +case 76: sItem = "lesseramuletofch"; break; +case 77: sItem = "lesserringofchar"; break; +case 78: sItem = "vineclothing"; break; +case 79: sItem = "cloakofwarding"; break; +case 81: sItem = "bloodgrassbolts"; break; +case 82: sItem = "bloodgrassarrow"; break; +case 83: sItem = "timiristhorn"; break; +case 84: sItem = "preciousbootsofr"; break; +case 85: sItem = "jeweledglovesofs"; break; +case 86: sItem = "alchbasics2"; break; +case 87: sItem = "alchbasics3"; break; +case 88: sItem = "bookofelementa"; break; +case 89: sItem = "bookofelemenweap"; break; +case 90: sItem = "charmofprotect"; break; +case 91: sItem = "glovesofdeftne"; break; +case 92: sItem = "charmofprotect"; break; +case 93: sItem = "it_mglove005"; break; +case 94: sItem = "charmofprotect"; break; +case 95: sItem = "glovesofpilfer"; break; +case 96: sItem = "glovesofthegl"; break; +case 97: sItem = "glovesoftheta"; break; +case 98: sItem = "elvenboots"; break; +case 99: sItem = "sandalsofnimbl"; break; +case 100: sItem = "toolbelt"; break; +} // switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} // if + +if (nBump > 10 && nBump < 16) { +switch (nRandom) + { + + +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + + +case 20: sItem = "shroudofdecay"; break; +case 21: sItem = "ringofdexterity"; break; +case 22: sItem = "agafarireinforce"; break; +case 23: sItem = "ashmlw004"; break; +case 24: sItem = "ashmsw004"; break; +case 25: sItem = "ashmto004"; break; +case 26: sItem = "agararimedshield"; break; +case 27: sItem = "agararismshield"; break; +case 28: sItem = "smallshieldofpro"; break; +case 29: sItem = "amuletofcharisma"; break; +case 30: sItem = "mirrorshield"; break; +case 31: sItem = "towershieldofspe"; break; +case 32: sItem = "gladiatorsgauntl"; break; +case 33: sItem = "glovesoftheeleme"; break; +case 34: sItem = "amuletofintellig"; break; +case 35: sItem = "amuletofstrength"; break; +case 36: sItem = "amuletofwisdom"; break; +case 37: sItem = "defilersgreed"; break; +case 38: sItem = "dispelring"; break; +case 39: sItem = "ringofintelligen"; break; +case 40: sItem = "ringofpolymorph"; break; +case 41: sItem = "ringofwisdom"; break; +case 42: sItem = "ringofcharisma"; break; +case 43: sItem = "fireaxe001"; break; +case 44: sItem = "wandoflightning"; break; +case 45: sItem = "steelbandedmai"; break; +case 46: sItem = "steelhelmet"; break; +case 47: sItem = "steelchainshir"; break; +case 48: sItem = "steelringmail"; break; +case 49: sItem = "steelstuddedar"; break; +case 50: sItem = "steelchainmail"; break; +case 51: sItem = "steelscalemail"; break; +case 52: sItem = "steelgreataxe"; break; +case 53: sItem = "steelhandaxe"; break; +case 54: sItem = "steelbattleaxe"; break; +case 55: sItem = "steelbastardsw"; break; +case 56: sItem = "steeldagger"; break; +case 57: sItem = "steelgreatsword"; break; +case 58: sItem = "steellongsword"; break; +case 59: sItem = "steelrapier"; break; +case 60: sItem = "steelscimitar"; break; +case 61: sItem = "steelshortswor"; break; +case 62: sItem = "steelspikedclu"; break; +case 63: sItem = "steelflail"; break; +case 64: sItem = "steelheavyflai"; break; +case 65: sItem = "steellighthamm"; break; +case 66: sItem = "steelwarhammer"; break; +case 67: sItem = "steelmace"; break; +case 68: sItem = "steelmorningsta"; break; +case 69: sItem = "steeldoublebla"; break; +case 70: sItem = "SteelKama"; break; +case 71: sItem = "SteelKukri"; break; +case 72: sItem = "SteelScythe"; break; +case 73: sItem = "steelsickle"; break; +case 74: sItem = "SteelHalberd"; break; +case 75: sItem = "SteelSpear"; break; +case 76: sItem = "steelshodquart"; break; +case 77: sItem = "amuletofconstitu"; break; +case 78: sItem = "amuletofdexterit"; break; +case 79: sItem = "ringofconstituti"; break; +case 80: sItem = "ringofstrength"; break; +case 81: sItem = "glitteringchatck"; break; +case 82: sItem = "zombieberries"; break; +case 83: sItem = "steelthrowinga"; break; +case 84: sItem = "steelthrowingd"; break; +case 85: sItem = "robeofmysticrune"; break; +case 86: sItem = "gridshands"; break; +case 87: sItem = "wrensbow"; break; +case 88: sItem = "steelstuddedgaun"; break; +case 89: sItem = "alassrashope"; break; +case 90: sItem = "greatersandston"; break; +case 91: sItem = "bookofgreaterele"; break; +case 92: sItem = "forestcloak"; break; +case 93: sItem = "bookofelemclothi"; break; +case 94: sItem = "mekillothidela"; break; +case 95: sItem = "kankshellbrace"; break; +case 96: sItem = "mekillothidehe"; break; +case 97: sItem = "mekillothidear"; break; +case 98: sItem = "mekillothideligh"; break; +case 99: sItem = "mekillothidmed"; break; +case 100: sItem = "mekillothidesm"; break; + + + } //switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} //if +if (nBump > 15 && nBump < 20) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + + +case 20: sItem = "mcloth009"; break; +case 21: sItem = "mcloth016"; break; +case 22: sItem = "cloth014"; break; +case 23: sItem = "cloth008"; break; +case 24: sItem = "mcloth015"; break; +case 25: sItem = "mcloth008"; break; +case 26: sItem = "cloth005"; break; +case 27: sItem = "agafariplate"; break; +case 28: sItem = "maarcl054"; break; +case 29: sItem = "dragonforgedhelm"; break; +case 30: sItem = "eagleeyehelmet"; break; +case 31: sItem = "helmofeyes"; break; +case 32: sItem = "thieveshood"; break; +case 33: sItem = "agafaribreastpla"; break; +case 34: sItem = "it_mboots006"; break; +case 35: sItem = "cloakofthewastes"; break; +case 36: sItem = "necromancerscloa"; break; +case 37: sItem = "dragonforgedgaun"; break; +case 39: sItem = "ringofcontrolled"; break; +case 40: sItem = "it_mring006"; break; +case 41: sItem = "advancedhealer"; break; +case 42: sItem = "hornofaknar"; break; +case 43: sItem = "rockstemcleaver"; break; +case 44: sItem = "rockstemchopper"; break; +case 45: sItem = "rockstemcutter"; break; +case 46: sItem = "diseasedbastards"; break; +case 47: sItem = "dewsticker"; break; +case 48: sItem = "dewstalk"; break; +case 49: sItem = "dewslicer"; break; +case 50: sItem = "dewstabber"; break; +case 51: sItem = "lesserwarhammero"; break; +case 52: sItem = "rodofteeth"; break; +case 53: sItem = "flamethrower"; break; +case 54: sItem = "tempest"; break; +case 55: sItem = "steelhalfplate"; break; +case 56: sItem = "steelplatemail"; break; +case 57: sItem = "hugoshand"; break; +case 58: sItem = "mysticarrow"; break; +case 59: sItem = "mysticbolt"; break; +case 60: sItem = "giantslayerstone"; break; +case 61: sItem = "kapow"; break; +case 62: sItem = "theentertainer"; break; +case 63: sItem = "rockstemhacker"; break; +case 64: sItem = "ringofclairsen"; break; +case 65: sItem = "ebonlotulis"; break; +case 66: sItem = "imbuedbardsfr"; break; +case 67: sItem = "gemofseeing"; break; +case 68: sItem = "sharpshadowblad"; break; +case 69: sItem = "rangersbeltof"; break; +case 70: sItem = "tarilsjournalone"; break; +case 71: sItem = "tarilsjournaltwo"; break; + + } //switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} //if + +if (nBump > 19 && nBump < 25) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + +case 20: sItem = "spiderarmor"; break; +case 21: sItem = "championsbuckle"; break; +case 22: sItem = "preserversgloves"; break; +case 23: sItem = "amuletofstealth"; break; +case 24: sItem = "greateramuletofi"; break; +case 25: sItem = "greateramuletofs"; break; +case 26: sItem = "greateramuletofw"; break; +case 27: sItem = "greaterringofint"; break; +case 28: sItem = "greaterringofwis"; break; +case 29: sItem = "experthealers"; break; +case 30: sItem = "heartofashelgora"; break; +case 31: sItem = "athasianheat"; break; +case 32: sItem = "hadesedge"; break; +case 33: sItem = "helswrath"; break; +case 34: sItem = "steakknife"; break; +case 35: sItem = "thekeeperofbalan"; break; +case 36: sItem = "masblade"; break; +case 37: sItem = "drakeivoryblade"; break; +case 38: sItem = "thewhacker"; break; +case 39: sItem = "insanityscrescen"; break; +case 40: sItem = "greateramuletofh"; break; +case 41: sItem = "greaterringofcha"; break; +case 42: sItem = "villichigarb"; break; +case 43: sItem = "ninelivessteal"; break; +case 44: sItem = "crushblow"; break; +case 45: sItem = "starofmourning"; break; +case 46: sItem = "preservershope"; break; +case 47: sItem = "eyegouger"; break; +case 48: sItem = "pandorasbow"; break; +case 49: sItem = "greateramuletofc"; break; +case 50: sItem = "greateramuletofd"; break; +case 51: sItem = "greaterringofcon"; break; +case 52: sItem = "greaterringofdex"; break; +case 53: sItem = "greaterringofstr"; break; +case 54: sItem = "dragonforgedboot"; break; +case 55: sItem = "soracksbreeches"; break; +case 56: sItem = "magnificationlen"; break; +case 57: sItem = "greatercloakof"; break; +case 58: sItem = "dwarfhideboots"; break; +case 59: sItem = "lifeslasher"; break; +case 60: sItem = "sureshot"; break; +case 61: sItem = "phrinsbow"; break; +case 62: sItem = "luteofzephyr"; break; +case 63: sItem = "garraouksedge"; break; +case 64: sItem = "livingsash"; break; +case 65: sItem = "beltofinertial"; break; +case 66: sItem = "ashenshield"; break; +case 67: sItem = "lifeshapedsmal"; break; +case 68: sItem = "lifeshapedlarg"; break; +case 69: sItem = "bonebreaker"; break; +case 70: sItem = "koshisfriend"; break; +case 71: sItem = "strangescroll"; break; + + } //switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} //if + +if (nBump > 24 && nBump < 40) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + +case 20: sItem = "dragonforgedplat"; break; +case 21: sItem = "defilersbane"; break; +case 22: sItem = "deadmanshide"; break; +case 23: sItem = "protectorofthegl"; break; +case 24: sItem = "lichhaircloak"; break; +case 25: sItem = "mastersamuletofi"; break; +case 26: sItem = "mastersamuletofs"; break; +case 27: sItem = "mastersamuletofw"; break; +case 28: sItem = "mastersringofint"; break; +case 29: sItem = "mastersringofwis"; break; +case 30: sItem = "ringofhate"; break; +case 31: sItem = "dragonforgedbast"; break; +case 32: sItem = "faynorsfang"; break; +case 33: sItem = "screamingscimita"; break; +case 34: sItem = "silentscream"; break; +case 35: sItem = "chiblade"; break; +case 36: sItem = "staffoftheomega"; break; +case 37: sItem = "staffofdefense"; break; +case 38: sItem = "staffofthehumble"; break; +case 39: sItem = "it_msmlmisc017"; break; +case 40: sItem = "mastersamuletofc"; break; +case 41: sItem = "mastersamuletofd"; break; +case 42: sItem = "mastersringofcon"; break; +case 43: sItem = "mastersringofdex"; break; +case 44: sItem = "mastersringofstr"; break; +case 45: sItem = "mastersamuletofh"; break; +case 46: sItem = "mastersringofcha"; break; +case 47: sItem = "midnightstar"; break; +case 48: sItem = "shocker"; break; +case 49: sItem = "sunrunnerring"; break; +case 50: sItem = "helmetofforeseei"; break; +case 51: sItem = "lichsgreedring"; break; +case 52: sItem = "forgottenaxe"; break; +case 53: sItem = "ekairfather"; break; +case 54: sItem = "magicacornjui002"; break; +case 55: sItem = "drakeforgedgreat"; break; +case 56: sItem = "zanscord"; break; +case 57: sItem = "thesunbasher"; break; +case 58: sItem = "jazstsboots"; break; +case 59: sItem = "bootsofthedra"; break; +case 60: sItem = "thestoryteller"; break; +case 61: sItem = "ceruleanslasher"; break; +case 62: sItem = "severer"; break; +case 63: sItem = "shieldofraging"; break; +case 64: sItem = "imbuedtalid"; break; +case 65: sItem = "bastionsblade"; break; +case 66: sItem = "robeofthewis"; break; +case 67: sItem = "giantsarmbow"; break; +case 68: sItem = "bowoftheguardedl"; break; +case 69: sItem = "possessedshortbo"; break; +case 70: sItem = "deadaimheavyc"; break; +case 71: sItem = "deadaimcrossbo"; break; +case 72: sItem = "gemidansharp"; break; +case 73: sItem = "theceruleanarm"; break; +case 74: sItem = "lalorsspine"; break; +case 75: sItem = "staffofthebla"; break; +case 76: sItem = "staffofthegra"; break; +case 77: sItem = "bootsoftheearth"; break; +case 78: sItem = "starofbodach"; break; +case 79: sItem = "baneofearth"; break; +case 80: sItem = "galianschain"; break; +case 81: sItem = "strangescroll"; break; + + } //switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +} //if +if (nBump > 40 && nBump < 60) { +switch (nRandom) + { +case 1: sItem = "Compress"; break; +case 2: sItem = "MagicCornJuice"; break; +case 3: sItem = "MagicOrangeJuice"; break; +case 4: sItem = "MagicSpinachJuice"; break; +case 5: sItem = "MagicalBannanaJuice"; break; +case 6: sItem = "AcidCrystal"; break; +case 7: sItem = "Bandage"; break; +case 8: sItem = "Brimstone"; break; +case 9: sItem = "ChargedCrystal"; break; +case 10: sItem = "IceNine"; break; +case 11: sItem = "ErdluBlood"; break; +case 12: sItem = "Ginseng"; break; +case 13: sItem = "Spinach"; break; +case 14: sItem = "Water"; break; + +case 20: sItem = "imbueddraqomanbl"; break; +case 21: sItem = "dregothsrage"; break; +case 22: sItem = "heartofthecalder"; break; +case 23: sItem = "thearmofdrego"; break; +case 24: sItem = "beastmasterarm"; break; +case 25: sItem = "iconicamuletofch"; break; +case 26: sItem = "iconicringofdext"; break; +case 27: sItem = "iconicamuletofst"; break; +case 28: sItem = "iconicamuletofwi"; break; +case 29: sItem = "iconicringofinte"; break; +case 30: sItem = "iconicringofs"; break; +case 31: sItem = "jingsgarb"; break; +case 32: sItem = "rhulthaunmaste"; break; +case 33: sItem = "robeofillwill"; break; +case 34: sItem = "phandarashelm"; break; +case 35: sItem = "forgedshieldof"; break; +case 36: sItem = "halfbreedsguardi"; break; +case 37: sItem = "girdleofpower"; break; +case 38: sItem = "jandorasgarb"; break; +case 39: sItem = "jandorastiara"; break; +case 40: sItem = "bracersofwardi"; break; +case 41: sItem = "torakswrap"; break; +case 42: sItem = "iconicringofwisd"; break; +case 43: sItem = "iconicamuletofco"; break; +case 44: sItem = "iconicamuletofde"; break; +case 45: sItem = "iconicringofchar"; break; +case 46: sItem = "iconicamuletofin"; break; +case 47: sItem = "iconicringofcons"; break; +case 48: sItem = "spectralcloak"; break; +case 49: sItem = "blindingedgegaun"; break; +case 50: sItem = "staffoftime"; break; +case 51: sItem = "bootsofevasion"; break; +case 52: sItem = "bloodbonearmor"; break; +case 53: sItem = "greaterringofadr"; break; +case 54: sItem = "scorchedaxeof"; break; +case 55: sItem = "giftoftheelem"; break; +case 56: sItem = "ragnarok"; break; +case 57: sItem = "ginosbackstabb"; break; +case 58: sItem = "jazstsboots"; break; +case 59: sItem = "bootsofthedra"; break; +case 60: sItem = "shimmeringblade"; break; +case 61: sItem = "thecleavelander"; break; +case 62: sItem = "lifesapper"; break; +case 63: sItem = "heartpiercer"; break; +case 64: sItem = "thewifebeater"; break; +case 65: sItem = "theeclipse"; break; +case 66: sItem = "justlshammer"; break; +case 67: sItem = "sunstaff"; break; +case 68: sItem = "theicyheart"; break; +case 69: sItem = "possessedshortbo"; break; +case 70: sItem = "theoldballandcha"; break; +case 71: sItem = "theharvester"; break; +case 72: sItem = "gemidansharp"; break; +case 73: sItem = "imbueddraqomanch"; break; +case 74: sItem = "lalorsspine"; break; +case 75: sItem = "destinysedge"; break; +case 76: sItem = "harbringerofsilt"; break; +case 77: sItem = "mindshatterflail"; break; +case 78: sItem = "nightstalker"; break; +case 79: sItem = "psimitar"; break; +case 80: sItem = "soulsharvest"; break; +case 81: sItem = "ds_a8_gorgoth001"; break; +case 82: sItem = "ds_h0_gorgoth001"; break; +case 83: sItem = "embraceofthespir"; break; +case 84: sItem = "devestation"; break; +case 85: sItem = "drakebonegythk"; break; +case 86: sItem = "guardianofthe"; break; +case 87: sItem = "heartofland"; break; +case 88: sItem = "messengerofraj"; break; +case 89: sItem = "retscutter"; break; +case 90: sItem = "solarflare"; break; +case 91: sItem = "lalisbliss"; break; +case 92: sItem = "shimmeringblade"; break; +case 93: sItem = "thecleavelander"; break; +case 94: sItem = "gauntletsoffai"; break; +case 95: sItem = "regaliaofsanshir"; break; +case 96: sItem = "helmofsanshir"; break; +case 97: sItem = "sanshirswall"; break; +case 98: sItem = "sanshirsfury"; break; +case 99: sItem = "heartofthecalder"; break; + + } + + + // switch +//if (nRandom > 80) +//nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +//dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); +}//if + +if (nRandom > 80) +nStack = 10+d20(2); +//SpeakString("Item rolled case "+IntToString(nRandom)+" sItem "+sItem+" Stack "+IntToString(nStack)); +dsoCreateItemOnObject(sItem,OBJECT_SELF,nStack); + + +if (nBump > 56 && nBump < 61) { +UberLoot(); +} + +if (nBump > 58) { +int nTries =0; +int nDrops = d4(); +while (nTries < nDrops) { + +UberLoot(); +nTries++; +} + + +} + +} + +//void main() +//{ +//Loot(); +//} diff --git a/nwnds_module/ds_makescroll.ncs b/nwnds_module/ds_makescroll.ncs new file mode 100644 index 000000000..415627eb7 Binary files /dev/null and b/nwnds_module/ds_makescroll.ncs differ diff --git a/nwnds_module/ds_makescroll.nss b/nwnds_module/ds_makescroll.nss new file mode 100644 index 000000000..d483967f6 --- /dev/null +++ b/nwnds_module/ds_makescroll.nss @@ -0,0 +1,788 @@ +int nSpell, nXP, nGoldCost, nNewXP,nWizLevel,nSorLevel,nBarLevel; +float fXPCost, fNewXP, fBaseLevel, fGoldCost; +string sScroll; +object oCaster; + +void main() +{ +oCaster=GetLastSpellCaster(); +nWizLevel=GetLevelByClass(CLASS_TYPE_WIZARD,oCaster); +nSorLevel=GetLevelByClass(CLASS_TYPE_SORCERER,oCaster); +nBarLevel=GetLevelByClass(CLASS_TYPE_BARD,oCaster); +fXPCost=12.5; //This is the default setting for the d20 rules but can be modified +nXP=GetXP(oCaster); +nSpell=GetLastSpell(); + + + + + +if(nSpell==SPELL_ACID_FOG) +{ +fBaseLevel=66.0; //basically the spell level times the lowest caster level needed to cast the spell +sScroll="it_sparscr604"; //the respective scroll id +} +else if(nSpell==SPELL_ANIMATE_DEAD) +{ +fBaseLevel=45.0; +sScroll="it_sparscr510"; +} +else if(nSpell==SPELL_BESTOW_CURSE) +{ +fBaseLevel=28.0; +sScroll="it_sparscr415"; +} +else if(nSpell==SPELL_BLINDNESS_AND_DEAFNESS) +{ +fBaseLevel=6.0; +sScroll="it_sparscr212"; +} +else if(nSpell==SPELL_BULLS_STRENGTH) +{ +fBaseLevel=6.0; +sScroll="it_sparscr213"; +} +else if(nSpell==SPELL_BURNING_HANDS) +{ +fBaseLevel=1.0; +sScroll="it_sparscr113"; +} +else if(nSpell==SPELL_CATS_GRACE) +{ +fBaseLevel=6.0; +sScroll="it_sparscr214"; +} +else if(nSpell==SPELL_CHAIN_LIGHTNING) +{ +fBaseLevel=66.0; +sScroll="it_sparscr608"; +} +else if(nSpell==SPELL_CHARM_MONSTER) +{ +fBaseLevel=28.0; +sScroll="it_sparscr406"; +} +else if(nSpell==SPELL_CHARM_PERSON) +{ +fBaseLevel=1.0; +sScroll="it_sparscr108"; +} +else if(nSpell==SPELL_CIRCLE_OF_DEATH) +{ +fBaseLevel=66.0; +sScroll="it_sparscr611"; +} +else if(nSpell==SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE) +{ +fBaseLevel=15.0; +sScroll="it_sparscr308"; +} +else if(nSpell==SPELL_CLARITY) +{ +fBaseLevel=6.0; +sScroll="it_sparscr218"; +} +else if(nSpell==SPELL_CLOUDKILL) +{ +fBaseLevel=45.0; +sScroll="it_sparscr503"; +} +else if(nSpell==SPELL_COLOR_SPRAY) +{ +fBaseLevel=1.0; +sScroll="it_sparscr111"; +} +else if(nSpell==SPELL_CONE_OF_COLD) +{ +fBaseLevel=45.0; +sScroll="it_sparscr508"; +} +else if(nSpell==SPELL_CONFUSION) +{ +fBaseLevel=28.0; +sScroll="it_sparscr407"; +} +else if(nSpell==SPELL_CONTAGION) +{ +fBaseLevel=28.0; +sScroll="it_sparscr412"; +} +else if(nSpell==SPELL_CONTROL_UNDEAD) +{ +fBaseLevel=91.0; +sScroll="it_sparscr708"; +} +else if(nSpell==SPELL_DARKNESS) +{ +fBaseLevel=6.0; +sScroll="it_sparscr207"; +} +else if(nSpell==SPELL_DAZE) +{ +fBaseLevel=0.5; +sScroll="it_sparscr"; +} +else if(nSpell==SPELL_DELAYED_BLAST_FIREBALL) +{ +fBaseLevel=91.0; +sScroll="it_sparscr705"; +} +else if(nSpell==SPELL_DISMISSAL) +{ +fBaseLevel=45.0; +sScroll="it_sparscr502"; +} +else if(nSpell==SPELL_DISPEL_MAGIC) +{ +fBaseLevel=15.0; +sScroll="it_sparscr302"; +} +else if(nSpell==SPELL_DOMINATE_MONSTER) +{ +fBaseLevel=153.0; +sScroll="it_sparscr906"; +} +else if(nSpell==SPELL_DOMINATE_PERSON) +{ +fBaseLevel=45.0; +sScroll="it_sparscr504"; +} +else if(nSpell==SPELL_EAGLE_SPLEDOR) +{ +fBaseLevel=6.0; +sScroll="it_sparscr220"; +} +else if(nSpell==SPELL_ELEMENTAL_SHIELD) +{ +fBaseLevel=28.0; +sScroll="it_sparscr417"; +} +else if(nSpell==SPELL_ENDURANCE) +{ +fBaseLevel=6.0; +sScroll="it_sparscr216"; +} +else if(nSpell==SPELL_ENDURE_ELEMENTS) +{ +fBaseLevel=1.0; +sScroll="it_sparscr102"; +} +else if(nSpell==SPELL_ENERGY_DRAIN) +{ +fBaseLevel=153.0; +sScroll="it_sparscr909"; +} +else if(nSpell==SPELL_ENERVATION) +{ +fBaseLevel=28.0; +sScroll="it_sparscr413"; +} +else if(nSpell==SPELL_ETHEREAL_VISAGE) +{ +fBaseLevel=66.0; +sScroll="it_sparscr609"; +} +else if(nSpell==SPELL_FEAR) +{ +fBaseLevel=28.0; +sScroll="it_sparscr414"; +} +else if(nSpell==SPELL_FEEBLEMIND) +{ +fBaseLevel=45.0; +sScroll="it_sparscr505"; +} +else if(nSpell==SPELL_FINGER_OF_DEATH) +{ +fBaseLevel=91.0; +sScroll="it_sparscr709"; +} +else if(nSpell==SPELL_FIREBALL) +{ +fBaseLevel=15.0; +sScroll="it_sparscr310"; +} +else if(nSpell==SPELL_FLAME_ARROW) +{ +fBaseLevel=15.0; +sScroll="it_sparscr305"; +} +else if(nSpell==SPELL_FOXS_CUNNING) +{ +fBaseLevel=6.0; +sScroll="it_sparscr221"; +} +else if(nSpell==SPELL_GATE) +{ +fBaseLevel=153.0; +sScroll="it_sparscr903"; +} +else if(nSpell==SPELL_GHOSTLY_VISAGE) +{ +fBaseLevel=6.0; +sScroll="it_sparscr209"; +} +else if(nSpell==SPELL_GHOUL_TOUCH) +{ +fBaseLevel=6.0; +sScroll="it_sparscr210"; +} +else if(nSpell==VFX_DUR_GLOBE_INVULNERABILITY) +{ +fBaseLevel=66.0; +sScroll="it_sparscr602"; +} +else if(nSpell==SPELL_GREASE) +{ +fBaseLevel=1.0; +sScroll="it_sparscr104"; +} +else if(nSpell==SPELL_GREATER_DISPELLING) +{ +fBaseLevel=66.0; +sScroll="it_sparscr603"; +} +else if(nSpell==SPELL_GREATER_PLANAR_BINDING) +{ +fBaseLevel=120.0; +sScroll="it_sparscr804"; +} +else if(nSpell==SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW) +{ +fBaseLevel=45.0; +sScroll="it_sparscr509"; +} +else if(nSpell==SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE) +{ +fBaseLevel=45.0; +sScroll="it_sparscr509"; +} +else if(nSpell==SPELL_GREATER_SHADOW_CONJURATION_MIRROR_IMAGE) +{ +fBaseLevel=45.0; +sScroll="it_sparscr509"; +} +else if(nSpell==SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW) +{ +fBaseLevel=45.0; +sScroll="it_sparscr509"; +} +else if(nSpell==SPELL_GREATER_SHADOW_CONJURATION_WEB) +{ +fBaseLevel=45.0; +sScroll="it_sparscr509"; +} +else if(nSpell==SPELL_GREATER_SPELL_BREACH) +{ +fBaseLevel=66.0; +sScroll="it_sparscr613"; +} +else if(nSpell==SPELL_GREATER_SPELL_MANTLE) +{ +fBaseLevel=153.0; +sScroll="it_sparscr913"; +} +else if(nSpell==SPELL_GREATER_STONESKIN) +{ +fBaseLevel=66.0; +sScroll="it_sparscr614"; +} +else if(nSpell==SPELL_HASTE) +{ +fBaseLevel=15.0; +sScroll="it_sparscr313"; +} +else if(nSpell==SPELL_HOLD_MONSTER) +{ +fBaseLevel=45.0; +sScroll="it_sparscr506"; +} +else if(nSpell==SPELL_HOLD_PERSON) +{ +fBaseLevel=15.0; +sScroll="it_sparscr309"; +} +else if(nSpell==SPELL_HORRID_WILTING) +{ +fBaseLevel=120.0; +sScroll="it_sparscr"; +} +else if(nSpell==SPELL_IDENTIFY) +{ +fBaseLevel=1.0; +sScroll="it_sparscr107"; +} +else if(nSpell==SPELL_IMPROVED_INVISIBILITY) +{ +fBaseLevel=28.0; +sScroll="it_sparscr409"; +} +else if(nSpell==SPELL_INCENDIARY_CLOUD) +{ +fBaseLevel=120.0; +sScroll="it_sparscr805"; +} +else if(nSpell==SPELL_INVISIBILITY) +{ +fBaseLevel=6.0; +sScroll="it_sparscr208"; +} +else if(nSpell==SPELL_INVISIBILITY_SPHERE) +{ +fBaseLevel=15.0; +sScroll="it_sparscr315"; +} +else if(nSpell==SPELL_KNOCK) +{ +fBaseLevel=6.0; +sScroll="it_sparscr217"; +} +else if(nSpell==SPELL_LESSER_DISPEL) +{ +fBaseLevel=6.0; +sScroll="it_sparscr219"; +} +else if(nSpell==SPELL_LESSER_MIND_BLANK) +{ +fBaseLevel=45.0; +sScroll="it_sparscr512"; +} +else if(nSpell==SPELL_LESSER_PLANAR_BINDING) +{ +fBaseLevel=45.0; +sScroll="it_sparscr513"; +} +else if(nSpell==SPELL_LESSER_SPELL_BREACH) +{ +fBaseLevel=28.0; +sScroll="it_sparscr418"; +} +else if(nSpell==SPELL_LESSER_SPELL_MANTLE) +{ +fBaseLevel=45.0; +sScroll="it_sparscr514"; +} +else if(nSpell==SPELL_LIGHT) +{ +fBaseLevel=0.5; +sScroll="it_sparscr005"; +} +else if(nSpell==SPELL_LIGHTNING_BOLT) +{ +fBaseLevel=15.0; +sScroll="it_sparscr311"; +} +else if(nSpell==SPELL_MAGE_ARMOR) +{ +fBaseLevel=1.0; +sScroll="it_sparscr105"; +} +else if(nSpell==SPELL_MAGIC_CIRCLE_AGAINST_CHAOS) +{ +fBaseLevel=15.0; +sScroll="it_sparscr303"; +} +else if(nSpell==SPELL_MAGIC_CIRCLE_AGAINST_EVIL) +{ +fBaseLevel=15.0; +sScroll="it_sparscr303"; +} +else if(nSpell==SPELL_MAGIC_CIRCLE_AGAINST_GOOD) +{ +fBaseLevel=15.0; +sScroll="it_sparscr303"; +} +else if(nSpell==SPELL_MAGIC_CIRCLE_AGAINST_LAW) +{ +fBaseLevel=15.0; +sScroll="it_sparscr303"; +} +else if(nSpell==SPELL_MAGIC_MISSILE) +{ +fBaseLevel=1.0; +sScroll="it_sparscr111"; +} +else if(nSpell==SPELL_MASS_BLINDNESS_AND_DEAFNESS) +{ +fBaseLevel=120.0; +sScroll="it_sparscr808"; +} +else if(nSpell==SPELL_MASS_CHARM) +{ +fBaseLevel=120.0; +sScroll="it_sparscr807"; +} +else if(nSpell==SPELL_MASS_HASTE) +{ +fBaseLevel=66.0; +sScroll="it_sparscr612"; +} +else if(nSpell==SPELL_MELFS_ACID_ARROW) +{ +fBaseLevel=6.0; +sScroll="it_sparscr203"; +} +else if(nSpell==SPELL_METEOR_SWARM) +{ +fBaseLevel=153.0; +sScroll="it_sparscr907"; +} +else if(nSpell==SPELL_MIND_BLANK) +{ +fBaseLevel=120.0; +sScroll="it_sparscr802"; +} +else if(nSpell==SPELL_MIND_FOG) +{ +fBaseLevel=45.0; +sScroll="it_sparscr507"; +} +else if(nSpell==SPELL_MINOR_GLOBE_OF_INVULNERABILITY) +{ +fBaseLevel=28.0; +sScroll="it_sparscr402"; +} +else if(nSpell==SPELL_MORDENKAINENS_DISJUNCTION) +{ +fBaseLevel=153.0; +sScroll="it_sparscr902"; +} +else if(nSpell==SPELL_MORDENKAINENS_SWORD) +{ +fBaseLevel=91.0; +sScroll="it_sparscr706"; +} +else if(nSpell==SPELL_NEGATIVE_ENERGY_BURST) +{ +fBaseLevel=15.0; +sScroll="it_sparscr316"; +} +else if(nSpell==SPELL_NEGATIVE_ENERGY_RAY) +{ +fBaseLevel=1.0; +sScroll="it_sparscr114"; +} +else if(nSpell==SPELL_OWLS_WISDOM) +{ +fBaseLevel=6.0; +sScroll="it_sparscr222"; +} +else if(nSpell==SPELL_PHANTASMAL_KILLER) +{ +fBaseLevel=28.0; +sScroll="it_sparscr410"; +} +else if(nSpell==SPELL_PLANAR_BINDING) +{ +fBaseLevel=66.0; +sScroll="it_sparscr605"; +} +else if(nSpell==SPELL_POLYMORPH_SELF) +{ +fBaseLevel=28.0; +sScroll="it_sparscr416"; +} +else if(nSpell==SPELL_POWER_WORD_KILL) +{ +fBaseLevel=153.0; +sScroll="it_sparscr904"; +} +else if(nSpell==SPELL_POWER_WORD_STUN) +{ +fBaseLevel=91.0; +sScroll="it_sparscr703"; +} +else if(nSpell==SPELL_PREMONITION) +{ +fBaseLevel=120.0; +sScroll="it_sparscr809"; +} +else if(nSpell==SPELL_PRISMATIC_SPRAY) +{ +fBaseLevel=91.0; +sScroll="it_sparscr707"; +} +else if(nSpell==SPELL_PROTECTION__FROM_CHAOS) +{ +fBaseLevel=1.0; +sScroll="it_sparscr103"; +} +else if(nSpell==SPELL_PROTECTION_FROM_EVIL) +{ +fBaseLevel=1.0; +sScroll="it_sparscr103"; +} +else if(nSpell==SPELL_PROTECTION_FROM_GOOD) +{ +fBaseLevel=1.0; +sScroll="it_sparscr103"; +} +else if(nSpell==SPELL_PROTECTION_FROM_LAW) +{ +fBaseLevel=1.0; +sScroll="it_sparscr103"; +} +else if(nSpell==SPELL_PROTECTION_FROM_ELEMENTS) +{ +fBaseLevel=15.0; +sScroll="it_sparscr304"; +} +else if(nSpell==SPELL_PROTECTION_FROM_SPELLS) +{ +fBaseLevel=120.0; +sScroll="it_sparscr803"; +} +else if(nSpell==SPELL_RAY_OF_ENFEEBLEMENT) +{ +fBaseLevel=1.0; +sScroll="it_sparscr112"; +} +else if(nSpell==SPELL_RAY_OF_FROST) +{ +fBaseLevel=0.5; +sScroll="it_sparscr003"; +} +else if(nSpell==SPELL_REMOVE_CURSE) +{ +fBaseLevel=28.0; +sScroll="it_sparscr403"; +} +else if(nSpell==SPELL_RESIST_ELEMENTS) +{ +fBaseLevel=6.0; +sScroll="it_sparscr202"; +} +else if(nSpell==SPELL_RESISTANCE) +{ +fBaseLevel=0.5; +sScroll="it_sparscr002"; +} +else if(nSpell==SPELL_SCARE) +{ +fBaseLevel=6.0; +sScroll="it_sparscr211"; +} +else if(nSpell==SPELL_SEE_INVISIBILITY) +{ +fBaseLevel=6.0; +sScroll="it_sparscr206"; +} +else if(nSpell==SPELL_SHADES_CONE_OF_COLD) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADES_FIREBALL) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADES_STONESKIN) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADES_SUMMON_SHADOW) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADES_WALL_OF_FIRE) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADOW_CONJURATION_DARKNESS) +{ +fBaseLevel=66.0; +sScroll="it_sparscr610"; +} +else if(nSpell==SPELL_SHADOW_CONJURATION_INIVSIBILITY) +{ +fBaseLevel=28.0; +sScroll="it_sparscr411"; +} +else if(nSpell==SPELL_SHADOW_CONJURATION_MAGE_ARMOR) +{ +fBaseLevel=28.0; +sScroll="it_sparscr411"; +} +else if(nSpell==SPELL_SHADOW_CONJURATION_MAGIC_MISSILE) +{ +fBaseLevel=28.0; +sScroll="it_sparscr411"; +} +else if(nSpell==SPELL_SHADOW_CONJURATION_SUMMON_SHADOW) +{ +fBaseLevel=28.0; +sScroll="it_sparscr411"; +} +else if(nSpell==SPELL_SHAPECHANGE) +{ +fBaseLevel=153.0; +sScroll="it_sparscr911"; +} +else if(nSpell==SPELL_SLEEP) +{ +fBaseLevel=1.0; +sScroll="it_sparscr109"; +} +else if(nSpell==SPELL_SLOW) +{ +fBaseLevel=15.0; +sScroll="it_sparscr314"; +} +else if(nSpell==SPELL_SPELL_MANTLE) +{ +fBaseLevel=91.0; +sScroll="it_sparscr702"; +} +else if(nSpell==SPELL_STINKING_CLOUD) +{ +fBaseLevel=15.0; +sScroll="it_sparscr306"; +} +else if(nSpell==SPELL_STONESKIN) +{ +fBaseLevel=28.0; +sScroll="it_sparscr404"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_I) +{ +fBaseLevel=1.0; +sScroll="it_sparscr106"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_II) +{ +fBaseLevel=6.0; +sScroll="it_sparscr204"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_III) +{ +fBaseLevel=15.0; +sScroll="it_sparscr307"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_IV) +{ +fBaseLevel=28.0; +sScroll="it_sparscr405"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_V) +{ +fBaseLevel=45.0; +sScroll="it_sparscr511"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_VI) +{ +fBaseLevel=66.0; +sScroll="it_sparscr606"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_VII) +{ +fBaseLevel=91.0; +sScroll="it_sparscr704"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_VIII) +{ +fBaseLevel=120.0; +sScroll="it_sparscr806"; +} +else if(nSpell==SPELL_SUMMON_CREATURE_IX) +{ +fBaseLevel=153.0; +sScroll="it_sparscr905"; +} +else if(nSpell==SPELL_TENSERS_TRANSFORMATION) +{ +fBaseLevel=66.0; +sScroll="it_sparscr615"; +} +else if(nSpell==SPELL_TIME_STOP) +{ +fBaseLevel=153.0; +sScroll="it_sparscr912"; +} +else if(nSpell==SPELL_TRUE_SEEING) +{ +fBaseLevel=66.0; +sScroll="it_sparscr607"; +} +else if(nSpell==SPELL_VAMPIRIC_TOUCH) +{ +fBaseLevel=15.0; +sScroll="it_sparscr312"; +} +else if(nSpell==SPELL_WAIL_OF_THE_BANSHEE) +{ +fBaseLevel=153.0; +sScroll="it_sparscr910"; +} +else if(nSpell==SPELL_WALL_OF_FIRE) +{ +fBaseLevel=28.0; +sScroll="it_sparscr408"; +} +else if(nSpell==SPELL_WEB) +{ +fBaseLevel=6.0; +sScroll="it_sparscr205"; +} +else if(nSpell==SPELL_WEIRD) +{ +fBaseLevel=153.0; +sScroll="it_sparscr908"; +} +// else if(nSpell=) //Find Ultravision spell +// { +// fBaseLevel=.0; +// sScroll="it_sparscr"; +// } + + + + + + +else +{ +AssignCommand(oCaster,SpeakString("It is not possible to make that spell into a scroll")); +} + + +if (!(sScroll == "")) { +if(!(nWizLevel==0)) +{ +fNewXP=(nXP - (fBaseLevel * fXPCost)); +nNewXP=FloatToInt(fNewXP); +fGoldCost=(fBaseLevel * 25); +nGoldCost=FloatToInt(fGoldCost); +SetXP(oCaster,nNewXP); +TakeGoldFromCreature(nGoldCost,oCaster,TRUE); +CreateItemOnObject(sScroll,oCaster,1); +} +else if(!(nSorLevel==0)) +{ +fNewXP=(nXP - (fBaseLevel * fXPCost)); +nNewXP=FloatToInt(fNewXP); +fGoldCost=(fBaseLevel * 25); +nGoldCost=FloatToInt(fGoldCost); +SetXP(oCaster,nNewXP); +TakeGoldFromCreature(nGoldCost,oCaster,TRUE); +CreateItemOnObject(sScroll,oCaster,1); +} +else if (!(nBarLevel==0)) +{ +fNewXP=(nXP - (fBaseLevel * fXPCost)); +nNewXP=FloatToInt(fNewXP); +fGoldCost=(fBaseLevel * 25); +nGoldCost=FloatToInt(fGoldCost); +SetXP(oCaster,nNewXP); +TakeGoldFromCreature(nGoldCost,oCaster,TRUE); +CreateItemOnObject(sScroll,oCaster,1); +} +else +AssignCommand(oCaster,SpeakString("You lack the knowledge to create this item.")); +} +AssignCommand(oCaster,SpeakString("Made " +sScroll)); +CreateItemOnObject(sScroll,OBJECT_SELF,1); +} diff --git a/nwnds_module/ds_map_enc.ncs b/nwnds_module/ds_map_enc.ncs new file mode 100644 index 000000000..791bd3d40 Binary files /dev/null and b/nwnds_module/ds_map_enc.ncs differ diff --git a/nwnds_module/ds_map_enc.nss b/nwnds_module/ds_map_enc.nss new file mode 100644 index 000000000..33b07b51f --- /dev/null +++ b/nwnds_module/ds_map_enc.nss @@ -0,0 +1,57 @@ +string LocationToString(location lLocation) +{ + object oArea = GetAreaFromLocation(lLocation); + vector vPosition = GetPositionFromLocation(lLocation); + float fOrientation = GetFacingFromLocation(lLocation); + return "#AREA#" + GetTag(oArea) + + "#POSITION_X#" + FloatToString(vPosition.x) + + "#POSITION_Y#" + FloatToString(vPosition.y) + + "#POSITION_Z#" + FloatToString(vPosition.z) + + "#ORIENTATION#" + FloatToString(fOrientation) + "#END#"; +} +void main() +{ + object oPartyMember, oArea, oTarget; + object oPC = GetExitingObject(); + + if (oPC != GetFactionLeader(oPC)) // <- only the party leader can trigger + return; + + int bGoing; + // Only fire for (real) PCs. + if (!GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC)) + return; + + if (GetIsDawn() || GetIsDay()) + bGoing = (Random(100) <= 5); + else + bGoing = (Random(100) <= 10); + + if (bGoing) + { + oArea = GetArea(oPC); + oPartyMember = GetFirstFactionMember(oPC, TRUE); // <-- Change to TRUE + location lStart = GetLocation(oPC); + + if (d100() <= 15) + oTarget = GetWaypointByTag("DS_DESCENC_2"); + else + oTarget = GetWaypointByTag("DS_DESCENC_1"); + + location lTarget = GetLocation(oTarget); + + while (GetIsObjectValid(oPartyMember)) + { + if (GetArea(oPartyMember) == oArea && GetDistanceBetween(oPC, oPartyMember) <= 30.0) // <- change to whatever distance you want in meters + { + // SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); // <-- change this line to + SetLocalLocation(oPartyMember, "ls_stored_loc", lStart); // <-- use saved location because if the oPC has already jumped, + // it'll use the PC's new location in the encounter area + AssignCommand(oPartyMember, ClearAllActions()); + AssignCommand(oPartyMember, ActionJumpToLocation(lTarget)); + } + + oPartyMember = GetNextFactionMember(oPC, TRUE); // <-- change to TRUE + } + } + } diff --git a/nwnds_module/ds_map_enc_sc.ncs b/nwnds_module/ds_map_enc_sc.ncs new file mode 100644 index 000000000..03b6732a8 Binary files /dev/null and b/nwnds_module/ds_map_enc_sc.ncs differ diff --git a/nwnds_module/ds_map_enc_sc.nss b/nwnds_module/ds_map_enc_sc.nss new file mode 100644 index 000000000..dca76d977 --- /dev/null +++ b/nwnds_module/ds_map_enc_sc.nss @@ -0,0 +1,57 @@ +string LocationToString(location lLocation) +{ + object oArea = GetAreaFromLocation(lLocation); + vector vPosition = GetPositionFromLocation(lLocation); + float fOrientation = GetFacingFromLocation(lLocation); + return "#AREA#" + GetTag(oArea) + + "#POSITION_X#" + FloatToString(vPosition.x) + + "#POSITION_Y#" + FloatToString(vPosition.y) + + "#POSITION_Z#" + FloatToString(vPosition.z) + + "#ORIENTATION#" + FloatToString(fOrientation) + "#END#"; +} +void main() +{ + object oPartyMember, oArea, oTarget; + object oPC = GetExitingObject(); + + if (oPC != GetFactionLeader(oPC)) // <- only the party leader can trigger + return; + + int bGoing; + // Only fire for (real) PCs. + if (!GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC)) + return; + + if (GetIsDawn() || GetIsDay()) + bGoing = (Random(100) <= 5); + else + bGoing = (Random(100) <= 10); + + if (bGoing) + { + oArea = GetArea(oPC); + oPartyMember = GetFirstFactionMember(oPC, TRUE); // <-- Change to TRUE + location lStart = GetLocation(oPC); + + if (d100() <= 15) + oTarget = GetWaypointByTag("DS_SCRUBENC_2"); + else + oTarget = GetWaypointByTag("DS_SCRUBENC_1"); + + location lTarget = GetLocation(oTarget); + + while (GetIsObjectValid(oPartyMember)) + { + if (GetArea(oPartyMember) == oArea && GetDistanceBetween(oPC, oPartyMember) <= 30.0) // <- change to whatever distance you want in meters + { + // SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); // <-- change this line to + SetLocalLocation(oPartyMember, "ls_stored_loc", lStart); // <-- use saved location because if the oPC has already jumped, + // it'll use the PC's new location in the encounter area + AssignCommand(oPartyMember, ClearAllActions()); + AssignCommand(oPartyMember, ActionJumpToLocation(lTarget)); + } + + oPartyMember = GetNextFactionMember(oPC, TRUE); // <-- change to TRUE + } + } + } diff --git a/nwnds_module/ds_marketstal005.utp b/nwnds_module/ds_marketstal005.utp new file mode 100644 index 000000000..be0ed6811 Binary files /dev/null and b/nwnds_module/ds_marketstal005.utp differ diff --git a/nwnds_module/ds_marketstall00.utp b/nwnds_module/ds_marketstall00.utp new file mode 100644 index 000000000..6085eeb8e Binary files /dev/null and b/nwnds_module/ds_marketstall00.utp differ diff --git a/nwnds_module/ds_marketstall01.utp b/nwnds_module/ds_marketstall01.utp new file mode 100644 index 000000000..b4a9c2f5e Binary files /dev/null and b/nwnds_module/ds_marketstall01.utp differ diff --git a/nwnds_module/ds_mekilliot001.utc b/nwnds_module/ds_mekilliot001.utc new file mode 100644 index 000000000..9a27c9ee5 Binary files /dev/null and b/nwnds_module/ds_mekilliot001.utc differ diff --git a/nwnds_module/ds_mekilliot002.utc b/nwnds_module/ds_mekilliot002.utc new file mode 100644 index 000000000..30aea5beb Binary files /dev/null and b/nwnds_module/ds_mekilliot002.utc differ diff --git a/nwnds_module/ds_merchdoors.ncs b/nwnds_module/ds_merchdoors.ncs new file mode 100644 index 000000000..263cf6f2e Binary files /dev/null and b/nwnds_module/ds_merchdoors.ncs differ diff --git a/nwnds_module/ds_merchdoors.nss b/nwnds_module/ds_merchdoors.nss new file mode 100644 index 000000000..242c3d598 --- /dev/null +++ b/nwnds_module/ds_merchdoors.nss @@ -0,0 +1,13 @@ +void main() + { + if (GetIsNight()) + { + ActionCloseDoor(OBJECT_SELF); + ActionSpeakString("This door is locked. A sign on the door says, 'Closed for the night.'"); + return; + } + + else + DelayCommand(20.0,ActionCloseDoor(OBJECT_SELF)); + return; + } diff --git a/nwnds_module/ds_mf_trader01.utc b/nwnds_module/ds_mf_trader01.utc new file mode 100644 index 000000000..e3ac1adac Binary files /dev/null and b/nwnds_module/ds_mf_trader01.utc differ diff --git a/nwnds_module/ds_moleboar001.utc b/nwnds_module/ds_moleboar001.utc new file mode 100644 index 000000000..b0d2b7682 Binary files /dev/null and b/nwnds_module/ds_moleboar001.utc differ diff --git a/nwnds_module/ds_mtn_stalker01.utc b/nwnds_module/ds_mtn_stalker01.utc new file mode 100644 index 000000000..e923f5ecb Binary files /dev/null and b/nwnds_module/ds_mtn_stalker01.utc differ diff --git a/nwnds_module/ds_mtn_stalker02.utc b/nwnds_module/ds_mtn_stalker02.utc new file mode 100644 index 000000000..c46575bd9 Binary files /dev/null and b/nwnds_module/ds_mtn_stalker02.utc differ diff --git a/nwnds_module/ds_neo_otyugh001.utc b/nwnds_module/ds_neo_otyugh001.utc new file mode 100644 index 000000000..ded822a00 Binary files /dev/null and b/nwnds_module/ds_neo_otyugh001.utc differ diff --git a/nwnds_module/ds_news.ncs b/nwnds_module/ds_news.ncs new file mode 100644 index 000000000..07623951c Binary files /dev/null and b/nwnds_module/ds_news.ncs differ diff --git a/nwnds_module/ds_news.nss b/nwnds_module/ds_news.nss new file mode 100644 index 000000000..a911dc818 --- /dev/null +++ b/nwnds_module/ds_news.nss @@ -0,0 +1,18 @@ +void main() +{ +object oPC = GetLastUsedBy(); +ExploreAreaForPlayer(GetArea(oPC),oPC); +ExploreAreaForPlayer(GetObjectByTag("AltarukREBUILD"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TheVillageofKled"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrMerchantDistrictREBUILD"),oPC); +ExploreAreaForPlayer(GetObjectByTag("NobleQuarters"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrNoblesQuartersREBUILD"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrSSArena"),oPC); +ExploreAreaForPlayer(GetObjectByTag("GladatorialStadiumFoyer"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrTheKingsGardens"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrTemplarsQuarters"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrTheGoldenCity"),oPC); +ExploreAreaForPlayer(GetObjectByTag("TyrTheWarrens"),oPC); +ActionStartConversation(GetLastUsedBy()); + +} diff --git a/nwnds_module/ds_nfirsttime.ncs b/nwnds_module/ds_nfirsttime.ncs new file mode 100644 index 000000000..c5fea0c0a Binary files /dev/null and b/nwnds_module/ds_nfirsttime.ncs differ diff --git a/nwnds_module/ds_nfirsttime.nss b/nwnds_module/ds_nfirsttime.nss new file mode 100644 index 000000000..6cf3cb717 --- /dev/null +++ b/nwnds_module/ds_nfirsttime.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_settalked +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:24:12 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nFirstTimeTalked", 1); + +} diff --git a/nwnds_module/ds_npcattack.ncs b/nwnds_module/ds_npcattack.ncs new file mode 100644 index 000000000..9867bb32c Binary files /dev/null and b/nwnds_module/ds_npcattack.ncs differ diff --git a/nwnds_module/ds_npcattack.nss b/nwnds_module/ds_npcattack.nss new file mode 100644 index 000000000..c5f1f2273 --- /dev/null +++ b/nwnds_module/ds_npcattack.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_npcattack +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/8/02 7:26:12 PM +//::////////////////////////////////////////////// +#include "nw_i0_generic" + +void main() +{ + + // Set the faction to hate the player, then attack the player + AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -100); + DetermineCombatRound(GetPCSpeaker()); +} diff --git a/nwnds_module/ds_o2_kragling.ncs b/nwnds_module/ds_o2_kragling.ncs new file mode 100644 index 000000000..e12d30e41 Binary files /dev/null and b/nwnds_module/ds_o2_kragling.ncs differ diff --git a/nwnds_module/ds_o2_kragling.nss b/nwnds_module/ds_o2_kragling.nss new file mode 100644 index 000000000..8aadebce0 --- /dev/null +++ b/nwnds_module/ds_o2_kragling.nss @@ -0,0 +1,32 @@ +void ActionCreate(string sCreature, location lLoc); + +void main() +{ + if (GetLocalInt(OBJECT_SELF, "Timer") >= 180) + { + object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0) + { + effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD); + string sCreature = "ZOMBIE002"; + // * 50% chance of a Kragling instead + if (Random(100) > 50) + { + sCreature = "kragling_f001"; + } + location lLoc = GetLocation(OBJECT_SELF); + DelayCommand(0.3, ActionCreate(sCreature, lLoc)); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMind, lLoc); + SetLocalInt(OBJECT_SELF, "Timer", 0); + } + } + else + { + SetLocalInt(OBJECT_SELF, "Timer", GetLocalInt(OBJECT_SELF, "Timer") + 6); + } +} + +void ActionCreate(string sCreature, location lLoc) +{ + CreateObject(OBJECT_TYPE_CREATURE, sCreature, lLoc); +} diff --git a/nwnds_module/ds_o2_skeleton.ncs b/nwnds_module/ds_o2_skeleton.ncs new file mode 100644 index 000000000..6a9b53cff Binary files /dev/null and b/nwnds_module/ds_o2_skeleton.ncs differ diff --git a/nwnds_module/ds_o2_skeleton.nss b/nwnds_module/ds_o2_skeleton.nss new file mode 100644 index 000000000..9e68469b0 --- /dev/null +++ b/nwnds_module/ds_o2_skeleton.nss @@ -0,0 +1,32 @@ +void ActionCreate(string sCreature, location lLoc); + +void main() +{ + if (GetLocalInt(OBJECT_SELF, "Timer") >= 180) + { + object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0) + { + effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD); + string sCreature = "NW_SKELWARR01"; + // * 10% chance of a skeleton chief instead + if (Random(100) > 90) + { + sCreature = "NW_SKELCHIEF"; + } + location lLoc = GetLocation(OBJECT_SELF); + DelayCommand(0.3, ActionCreate(sCreature, lLoc)); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMind, GetLocation(OBJECT_SELF)); + SetLocalInt(OBJECT_SELF, "Timer", 0); + } + } + else + { + SetLocalInt(OBJECT_SELF, "Timer", GetLocalInt(OBJECT_SELF, "Timer") + 6); + } +} + +void ActionCreate(string sCreature, location lLoc) +{ + CreateObject(OBJECT_TYPE_CREATURE, sCreature, lLoc); +} diff --git a/nwnds_module/ds_o2_zombie.ncs b/nwnds_module/ds_o2_zombie.ncs new file mode 100644 index 000000000..cb6dc8766 Binary files /dev/null and b/nwnds_module/ds_o2_zombie.ncs differ diff --git a/nwnds_module/ds_o2_zombie.nss b/nwnds_module/ds_o2_zombie.nss new file mode 100644 index 000000000..b9a97a5fc --- /dev/null +++ b/nwnds_module/ds_o2_zombie.nss @@ -0,0 +1,32 @@ +void ActionCreate(string sCreature, location lLoc); + +void main() +{ + if (GetLocalInt(OBJECT_SELF, "Timer") >= 180) + { + object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0) + { + effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD); + string sCreature = "ZOMBIE002"; + // * 10% chance of a Ghoul instead + if (Random(100) > 90) + { + sCreature = "GHOUL001"; + } + location lLoc = GetLocation(OBJECT_SELF); + DelayCommand(0.3, ActionCreate(sCreature, lLoc)); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMind, lLoc); + SetLocalInt(OBJECT_SELF, "Timer", 0); + } + } + else + { + SetLocalInt(OBJECT_SELF, "Timer", GetLocalInt(OBJECT_SELF, "Timer") + 6); + } +} + +void ActionCreate(string sCreature, location lLoc) +{ + CreateObject(OBJECT_TYPE_CREATURE, sCreature, lLoc); +} diff --git a/nwnds_module/ds_obretriever01.utc b/nwnds_module/ds_obretriever01.utc new file mode 100644 index 000000000..c37b81fc5 Binary files /dev/null and b/nwnds_module/ds_obretriever01.utc differ diff --git a/nwnds_module/ds_obretriever02.utc b/nwnds_module/ds_obretriever02.utc new file mode 100644 index 000000000..aabb183ea Binary files /dev/null and b/nwnds_module/ds_obretriever02.utc differ diff --git a/nwnds_module/ds_overmap_tran1.ncs b/nwnds_module/ds_overmap_tran1.ncs new file mode 100644 index 000000000..8a715a8cf Binary files /dev/null and b/nwnds_module/ds_overmap_tran1.ncs differ diff --git a/nwnds_module/ds_overmap_tran1.nss b/nwnds_module/ds_overmap_tran1.nss new file mode 100644 index 000000000..a506c4abd --- /dev/null +++ b/nwnds_module/ds_overmap_tran1.nss @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// World Map Transtion Placable OnUsed +// +// ds_overmap_trans.nss +// +// DM Heatstroke / 2021-04-12 +// +// Teleports PC to waypoint stored in "DESTINATION" local string var. +// +/////////////////////////////////////////////////////////////////////////////// + +void main() + { + object oPC = GetPCSpeaker(); + string sDestination = GetLocalString(OBJECT_SELF, "DESTINATION1"); + + if (!GetIsPC(oPC)) return; + + object oTarget; + location lTarget; + + oTarget = GetWaypointByTag(sDestination); + lTarget = GetLocation(oTarget); + + //only do the jump if the location is valid. + //though not flawless, we just check if it is in a valid area. + //the script will stop if the location isn't valid - meaning that + //nothing put after the teleport will fire either. + //the current location won't be stored, either + + if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + + SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); + + AssignCommand(oPC, ClearAllActions()); + + AssignCommand(oPC, ActionJumpToLocation(lTarget)); + + } diff --git a/nwnds_module/ds_overmap_tran2.ncs b/nwnds_module/ds_overmap_tran2.ncs new file mode 100644 index 000000000..2edc9d794 Binary files /dev/null and b/nwnds_module/ds_overmap_tran2.ncs differ diff --git a/nwnds_module/ds_overmap_tran2.nss b/nwnds_module/ds_overmap_tran2.nss new file mode 100644 index 000000000..90d6e2905 --- /dev/null +++ b/nwnds_module/ds_overmap_tran2.nss @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// World Map Transtion Placable OnUsed +// +// ds_overmap_trans.nss +// +// DM Heatstroke / 2021-04-12 +// +// Teleports PC to waypoint stored in "DESTINATION" local string var. +// +/////////////////////////////////////////////////////////////////////////////// + +void main() + { + object oPC = GetPCSpeaker(); + string sDestination = GetLocalString(OBJECT_SELF, "DESTINATION2"); + if (!GetIsPC(oPC)) return; + + object oTarget; + location lTarget; + + oTarget = GetWaypointByTag(sDestination); + lTarget = GetLocation(oTarget); + + //only do the jump if the location is valid. + //though not flawless, we just check if it is in a valid area. + //the script will stop if the location isn't valid - meaning that + //nothing put after the teleport will fire either. + //the current location won't be stored, either + + if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + + SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); + + AssignCommand(oPC, ClearAllActions()); + + AssignCommand(oPC, ActionJumpToLocation(lTarget)); + + } diff --git a/nwnds_module/ds_overmap_tran3.ncs b/nwnds_module/ds_overmap_tran3.ncs new file mode 100644 index 000000000..fc5fb7a8c Binary files /dev/null and b/nwnds_module/ds_overmap_tran3.ncs differ diff --git a/nwnds_module/ds_overmap_tran3.nss b/nwnds_module/ds_overmap_tran3.nss new file mode 100644 index 000000000..28c599d6e --- /dev/null +++ b/nwnds_module/ds_overmap_tran3.nss @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// World Map Transtion Placable OnUsed +// +// ds_overmap_trans.nss +// +// DM Heatstroke / 2021-04-12 +// +// Teleports PC to waypoint stored in "DESTINATION" local string var. +// +/////////////////////////////////////////////////////////////////////////////// + +void main() + { + object oPC = GetPCSpeaker(); + string sDestination = GetLocalString(OBJECT_SELF, "DESTINATION3"); + if (!GetIsPC(oPC)) return; + + object oTarget; + location lTarget; + + oTarget = GetWaypointByTag(sDestination); + lTarget = GetLocation(oTarget); + + //only do the jump if the location is valid. + //though not flawless, we just check if it is in a valid area. + //the script will stop if the location isn't valid - meaning that + //nothing put after the teleport will fire either. + //the current location won't be stored, either + + if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + + SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); + + AssignCommand(oPC, ClearAllActions()); + + AssignCommand(oPC, ActionJumpToLocation(lTarget)); + + } diff --git a/nwnds_module/ds_overmap_trans.ncs b/nwnds_module/ds_overmap_trans.ncs new file mode 100644 index 000000000..91c2b6718 Binary files /dev/null and b/nwnds_module/ds_overmap_trans.ncs differ diff --git a/nwnds_module/ds_overmap_trans.nss b/nwnds_module/ds_overmap_trans.nss new file mode 100644 index 000000000..573a5bd10 --- /dev/null +++ b/nwnds_module/ds_overmap_trans.nss @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// World Map Transtion Placable OnUsed +// +// ds_overmap_trans.nss +// +// DM Heatstroke / 2021-04-12 +// +// Teleports PC to waypoint stored in "DESTINATION" local string var. +// +/////////////////////////////////////////////////////////////////////////////// + +void main() + { + object oPC = GetLastUsedBy(); + string sDestination = GetLocalString(OBJECT_SELF, "DESTINATION"); + + if (!GetIsPC(oPC)) return; + + object oTarget; + location lTarget; + + oTarget = GetWaypointByTag(sDestination); + lTarget = GetLocation(oTarget); + + //only do the jump if the location is valid. + //though not flawless, we just check if it is in a valid area. + //the script will stop if the location isn't valid - meaning that + //nothing put after the teleport will fire either. + //the current location won't be stored, either + + if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + + SetLocalLocation(oPC, "ls_stored_loc", GetLocation(oPC)); + + AssignCommand(oPC, ClearAllActions()); + + AssignCommand(oPC, ActionJumpToLocation(lTarget)); + + } diff --git a/nwnds_module/ds_pedestal001.utp b/nwnds_module/ds_pedestal001.utp new file mode 100644 index 000000000..a41a24a09 Binary files /dev/null and b/nwnds_module/ds_pedestal001.utp differ diff --git a/nwnds_module/ds_pipeorgan001.utp b/nwnds_module/ds_pipeorgan001.utp new file mode 100644 index 000000000..3c6bd847e Binary files /dev/null and b/nwnds_module/ds_pipeorgan001.utp differ diff --git a/nwnds_module/ds_playerloc.ncs b/nwnds_module/ds_playerloc.ncs new file mode 100644 index 000000000..c7e421619 Binary files /dev/null and b/nwnds_module/ds_playerloc.ncs differ diff --git a/nwnds_module/ds_playerloc.nss b/nwnds_module/ds_playerloc.nss new file mode 100644 index 000000000..0f226b99a --- /dev/null +++ b/nwnds_module/ds_playerloc.nss @@ -0,0 +1,79 @@ +//NiteCap 6-27-08 +//Divining pool script + + +// only shows PC's with in the +/- 6 level range +// oSeer should point to the object using the script ie PC using the script +// oToBeSeen is the PC to check v/s the oSeer +int GetPCCanBeSeen(object oSeer, object oToBeSeen); + + +//beg main +/*void main() +{ +object oUser = GetLastUsedBy(); +object oPC = GetFirstPC(); +string SpeakText; + + while (GetIsPC(oPC)) + { + if(!GetIsDM(oPC) || !GetIsDMPossessed(oPC)) + { + if (GetPCCanBeSeen(oUser,oPC)) + { + SpeakText += GetName(oPC); + SpeakText += " is in "; + SpeakText += GetName(GetArea(oPC)); + SpeakText += "\n"; + oPC = GetNextPC(); + } + } + oPC = GetNextPC(); + } + SpeakString(SpeakText); +} + //end main + + +int GetPCCanBeSeen(object oSeer, object oToBeSeen) +{ + int iUHD = GetHitDice(oSeer); + int iPCHD=GetHitDice(oToBeSeen); + // base is unseen + int bSeen=FALSE; + + //if the user's hitdice are more than the PC oToBeSeen + if (iUHD = iPCHD) + { + if((iUHD - iPCHD) <= 6)bSeen=TRUE; + } + //if the user's hitdice are less than the PC oToBeSeen + if (iPCHD >= iUHD) + { + if((iPCHD-iUHD)<=6)bSeen=TRUE; + } + //let us see? + return bSeen; +} + +*/ + + +//Old Script +void main() +{ +//if (GetIsDM(GetLastUsedBy()) == TRUE){ +object oPC = GetFirstPC(); +string SpeakText; +while ( GetIsPC (oPC) == TRUE) +{ +if (GetHitDice(oPC) > 19) { +SpeakText += GetName(oPC); +SpeakText += " is in "; +SpeakText += GetName(GetArea(oPC)); +SpeakText += "\n"; +} +oPC = GetNextPC(); +} +SpeakString(SpeakText); +} diff --git a/nwnds_module/ds_plc_death.ncs b/nwnds_module/ds_plc_death.ncs new file mode 100644 index 000000000..5f2960687 Binary files /dev/null and b/nwnds_module/ds_plc_death.ncs differ diff --git a/nwnds_module/ds_plc_death.nss b/nwnds_module/ds_plc_death.nss new file mode 100644 index 000000000..c7a60cd4e --- /dev/null +++ b/nwnds_module/ds_plc_death.nss @@ -0,0 +1,57 @@ +//:://////////////////////////////////////////////////////////////////////////// +//:: Name Faction Placeables/s v1 +//:: FileName ds_plc_death +//:: Copyright (c) 2009 Athas Reborn +//:://////////////////////////////////////////////////////////////////////////// +/* + Makes placables faction dislike oKiller +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: 5th October, 2009 +//:: Event Used: OnDeath event of a placable +//:://////////////////////////////////////////////////////////////////////////// + +#include "x2_inc_compon" + +// ----------------------------------------------------------------------------- +// CONSTANTS - Settings below +// ----------------------------------------------------------------------------- + +const int DO_CRAFT_DROP = TRUE; // Drop default Bioware crafting item? + +// ----------------------------------------------------------------------------- +// PROTOTYPES +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// FUNCTIONS +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// MAIN +// ----------------------------------------------------------------------------- + + +void main() + { + object oSelf = OBJECT_SELF; + object oKiller = GetLastKiller(); + + if (!GetIsPC(oKiller)) return; + + while (GetIsObjectValid(GetMaster(oKiller))) + { + oKiller=GetMaster(oKiller); + } + + if(GetIsObjectValid(oKiller)) + { + AdjustReputation(oKiller, OBJECT_SELF, -5); + AdjustAlignment (oKiller, ALIGNMENT_CHAOTIC, 5); + } + + if(DO_CRAFT_DROP) + craft_drop_placeable(); + } + diff --git a/nwnds_module/ds_plotbag1.ncs b/nwnds_module/ds_plotbag1.ncs new file mode 100644 index 000000000..088826cc5 Binary files /dev/null and b/nwnds_module/ds_plotbag1.ncs differ diff --git a/nwnds_module/ds_plotbag1.nss b/nwnds_module/ds_plotbag1.nss new file mode 100644 index 000000000..47105302c --- /dev/null +++ b/nwnds_module/ds_plotbag1.nss @@ -0,0 +1,28 @@ +int nInt; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 200) + { + AssignCommand(oPC, TakeGoldFromCreature(300, oPC, TRUE)); + + CreateItemOnObject("ar_it_contain001", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Teren"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ds_plotbag2.ncs b/nwnds_module/ds_plotbag2.ncs new file mode 100644 index 000000000..62a77ae98 Binary files /dev/null and b/nwnds_module/ds_plotbag2.ncs differ diff --git a/nwnds_module/ds_plotbag2.nss b/nwnds_module/ds_plotbag2.nss new file mode 100644 index 000000000..a8c003dd6 --- /dev/null +++ b/nwnds_module/ds_plotbag2.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 700) + { + AssignCommand(oPC, TakeGoldFromCreature(700, oPC, TRUE)); + + CreateItemOnObject("ar_it_contain002", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Teren"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ds_plotbag3.ncs b/nwnds_module/ds_plotbag3.ncs new file mode 100644 index 000000000..4ead66b1f Binary files /dev/null and b/nwnds_module/ds_plotbag3.ncs differ diff --git a/nwnds_module/ds_plotbag3.nss b/nwnds_module/ds_plotbag3.nss new file mode 100644 index 000000000..0d10150c8 --- /dev/null +++ b/nwnds_module/ds_plotbag3.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 1500) + { + AssignCommand(oPC, TakeGoldFromCreature(1500, oPC, TRUE)); + + CreateItemOnObject("ar_it_contain003", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Teren"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ds_plotbag4.ncs b/nwnds_module/ds_plotbag4.ncs new file mode 100644 index 000000000..d603286c4 Binary files /dev/null and b/nwnds_module/ds_plotbag4.ncs differ diff --git a/nwnds_module/ds_plotbag4.nss b/nwnds_module/ds_plotbag4.nss new file mode 100644 index 000000000..e739af2e3 --- /dev/null +++ b/nwnds_module/ds_plotbag4.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 4000) + { + AssignCommand(oPC, TakeGoldFromCreature(4000, oPC, TRUE)); + + CreateItemOnObject("ar_it_contain004", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Teren"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ds_pot_defense.uti b/nwnds_module/ds_pot_defense.uti new file mode 100644 index 000000000..a21a00684 Binary files /dev/null and b/nwnds_module/ds_pot_defense.uti differ diff --git a/nwnds_module/ds_pot_magicdef.uti b/nwnds_module/ds_pot_magicdef.uti new file mode 100644 index 000000000..ffcfee47f Binary files /dev/null and b/nwnds_module/ds_pot_magicdef.uti differ diff --git a/nwnds_module/ds_pot_retreat.uti b/nwnds_module/ds_pot_retreat.uti new file mode 100644 index 000000000..6a3e38e9c Binary files /dev/null and b/nwnds_module/ds_pot_retreat.uti differ diff --git a/nwnds_module/ds_pot_rockhide.uti b/nwnds_module/ds_pot_rockhide.uti new file mode 100644 index 000000000..b597e39db Binary files /dev/null and b/nwnds_module/ds_pot_rockhide.uti differ diff --git a/nwnds_module/ds_pot_shadheart.uti b/nwnds_module/ds_pot_shadheart.uti new file mode 100644 index 000000000..f1a30e3ac Binary files /dev/null and b/nwnds_module/ds_pot_shadheart.uti differ diff --git a/nwnds_module/ds_psionocus001.utc b/nwnds_module/ds_psionocus001.utc new file mode 100644 index 000000000..065e65eb5 Binary files /dev/null and b/nwnds_module/ds_psionocus001.utc differ diff --git a/nwnds_module/ds_psishadow001.utc b/nwnds_module/ds_psishadow001.utc new file mode 100644 index 000000000..26a37ffc4 Binary files /dev/null and b/nwnds_module/ds_psishadow001.utc differ diff --git a/nwnds_module/ds_psurlon001.utc b/nwnds_module/ds_psurlon001.utc new file mode 100644 index 000000000..aed2500af Binary files /dev/null and b/nwnds_module/ds_psurlon001.utc differ diff --git a/nwnds_module/ds_psurlon002.utc b/nwnds_module/ds_psurlon002.utc new file mode 100644 index 000000000..039c3e880 Binary files /dev/null and b/nwnds_module/ds_psurlon002.utc differ diff --git a/nwnds_module/ds_psurlon003.utc b/nwnds_module/ds_psurlon003.utc new file mode 100644 index 000000000..199d09085 Binary files /dev/null and b/nwnds_module/ds_psurlon003.utc differ diff --git a/nwnds_module/ds_psurlon004.utc b/nwnds_module/ds_psurlon004.utc new file mode 100644 index 000000000..48972e0a2 Binary files /dev/null and b/nwnds_module/ds_psurlon004.utc differ diff --git a/nwnds_module/ds_psurlon005.utc b/nwnds_module/ds_psurlon005.utc new file mode 100644 index 000000000..20be1b310 Binary files /dev/null and b/nwnds_module/ds_psurlon005.utc differ diff --git a/nwnds_module/ds_psurlon006.utc b/nwnds_module/ds_psurlon006.utc new file mode 100644 index 000000000..c2696d31e Binary files /dev/null and b/nwnds_module/ds_psurlon006.utc differ diff --git a/nwnds_module/ds_pterrax001.utc b/nwnds_module/ds_pterrax001.utc new file mode 100644 index 000000000..eca87fcea Binary files /dev/null and b/nwnds_module/ds_pterrax001.utc differ diff --git a/nwnds_module/ds_puddinfish001.utc b/nwnds_module/ds_puddinfish001.utc new file mode 100644 index 000000000..0b8da74e6 Binary files /dev/null and b/nwnds_module/ds_puddinfish001.utc differ diff --git a/nwnds_module/ds_raakle001.utc b/nwnds_module/ds_raakle001.utc new file mode 100644 index 000000000..d64553225 Binary files /dev/null and b/nwnds_module/ds_raakle001.utc differ diff --git a/nwnds_module/ds_rasclinn001.utc b/nwnds_module/ds_rasclinn001.utc new file mode 100644 index 000000000..d391aa1c3 Binary files /dev/null and b/nwnds_module/ds_rasclinn001.utc differ diff --git a/nwnds_module/ds_razorwing001.utc b/nwnds_module/ds_razorwing001.utc new file mode 100644 index 000000000..b164b465b Binary files /dev/null and b/nwnds_module/ds_razorwing001.utc differ diff --git a/nwnds_module/ds_rhinob001.utc b/nwnds_module/ds_rhinob001.utc new file mode 100644 index 000000000..2d7aa69af Binary files /dev/null and b/nwnds_module/ds_rhinob001.utc differ diff --git a/nwnds_module/ds_rnd_guard_spw.ncs b/nwnds_module/ds_rnd_guard_spw.ncs new file mode 100644 index 000000000..201eb165e Binary files /dev/null and b/nwnds_module/ds_rnd_guard_spw.ncs differ diff --git a/nwnds_module/ds_rnd_guard_spw.nss b/nwnds_module/ds_rnd_guard_spw.nss new file mode 100644 index 000000000..f570be807 --- /dev/null +++ b/nwnds_module/ds_rnd_guard_spw.nss @@ -0,0 +1,429 @@ +//:://///////////////////////////////////////////// +//:: Name ds_rnd_guard_spw +//:: Copyright (c) 2001 Bioware Corp. +//:: Copyright (c) NWN Dark Sun +//::////////////////////////////////////////////// +/* + Randomized Appearance Guard On Spawn script + + + 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. + + 2021-03-17: DMH + Added randomization bits. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "NW_I0_GENERIC" +#include "ms_name_inc" +#include "NW_O2_CONINCLUDE" +#include "x2_inc_switches" + +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // User defined OnSpawn event requested? + int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS"); + + //Randomizes Armor + int nResult = d6(1); + object oArmor; + 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"; + + DelayCommand(3.0, ActionEquipItem(CreateItemOnObject(sItem), INVENTORY_SLOT_CHEST)); + + + // Pre Spawn Event requested + if (nSpecEvent == 1 || nSpecEvent == 3 ) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"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 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 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 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 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 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 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)); + } + + //modify to try fix on Various Aura effects. + //NC:EDIT +/* int nAtropal = GetTag(OBJECT_SELF)=="ATROPAL001" ? TRUE : FALSE; + if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF); + int nNWalker = GetTag(OBJECT_SELF)=="Nightwalker" ? TRUE : FALSE; + if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nNCrawler = GetTag(OBJECT_SELF)=="Nightcrawler" ? TRUE : FALSE; + if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nVoidWraith = GetTag(OBJECT_SELF)=="Voidwraith" ? TRUE : FALSE; + if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF); + int AtropalScion = GetTag(OBJECT_SELF)=="AtropalScion" ? TRUE : FALSE; + if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF); + int nGhast = GetTag(OBJECT_SELF)=="GHAST001" ? TRUE : FALSE; + if(nGhast)ExecuteScript("ghast_stench",OBJECT_SELF); */ + + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + int nSkinColor; + nSkinColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(12)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + //Calls the Random Name Generator + ms_Nomenclature(OBJECT_SELF); + + + SetLocalInt(OBJECT_SELF, "iDialogue", Random(10) + 1); + //SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + +} diff --git a/nwnds_module/ds_rnd_kledg_spw.ncs b/nwnds_module/ds_rnd_kledg_spw.ncs new file mode 100644 index 000000000..2a10d319b Binary files /dev/null and b/nwnds_module/ds_rnd_kledg_spw.ncs differ diff --git a/nwnds_module/ds_rnd_kledg_spw.nss b/nwnds_module/ds_rnd_kledg_spw.nss new file mode 100644 index 000000000..960eb7ff9 --- /dev/null +++ b/nwnds_module/ds_rnd_kledg_spw.nss @@ -0,0 +1,437 @@ +//:://///////////////////////////////////////////// +//:: Name ds_rnd_kledg_spw +//:: Copyright (c) 2001 Bioware Corp. +//:: Copyright (c) NWN Dark Sun +//::////////////////////////////////////////////// +/* + Randomized Appearance Guard On Spawn script + + + 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. + + 2021-03-17: DMH + Added randomization bits. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "NW_I0_GENERIC" +#include "ms_name_inc" +#include "NW_O2_CONINCLUDE" +#include "x2_inc_switches" + +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"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 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 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 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 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 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 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)); + } + + //modify to try fix on Various Aura effects. + //NC:EDIT +/* int nAtropal = GetTag(OBJECT_SELF)=="ATROPAL001" ? TRUE : FALSE; + if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF); + int nNWalker = GetTag(OBJECT_SELF)=="Nightwalker" ? TRUE : FALSE; + if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nNCrawler = GetTag(OBJECT_SELF)=="Nightcrawler" ? TRUE : FALSE; + if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nVoidWraith = GetTag(OBJECT_SELF)=="Voidwraith" ? TRUE : FALSE; + if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF); + int AtropalScion = GetTag(OBJECT_SELF)=="AtropalScion" ? TRUE : FALSE; + if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF); + int nGhast = GetTag(OBJECT_SELF)=="GHAST001" ? TRUE : FALSE; + if(nGhast)ExecuteScript("ghast_stench",OBJECT_SELF); */ + + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + int nSkinColor; + nSkinColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(12)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + int nTattoo1; + nTattoo1 = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_1, nTattoo1); + + int nTattoo2; + nTattoo2 = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_TATTOO_2, nTattoo2); + + //Calls the Random Name Generator + ms_Nomenclature(OBJECT_SELF); + +//Randomizes Armor + int nResult = d6(1); + object oArmor; + 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"; + + DelayCommand(1.0, ActionEquipItem(CreateItemOnObject(sItem), INVENTORY_SLOT_CHEST)); + + + SetLocalInt(OBJECT_SELF, "iDialogue", Random(10) + 1); + //SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + +} diff --git a/nwnds_module/ds_rock_cactus01.utc b/nwnds_module/ds_rock_cactus01.utc new file mode 100644 index 000000000..53acf2d6a Binary files /dev/null and b/nwnds_module/ds_rock_cactus01.utc differ diff --git a/nwnds_module/ds_rubbslug001.utc b/nwnds_module/ds_rubbslug001.utc new file mode 100644 index 000000000..820f40f63 Binary files /dev/null and b/nwnds_module/ds_rubbslug001.utc differ diff --git a/nwnds_module/ds_ruktoi001.utc b/nwnds_module/ds_ruktoi001.utc new file mode 100644 index 000000000..5d9600757 Binary files /dev/null and b/nwnds_module/ds_ruktoi001.utc differ diff --git a/nwnds_module/ds_s_shadow_01.utc b/nwnds_module/ds_s_shadow_01.utc new file mode 100644 index 000000000..8e8b84cdf Binary files /dev/null and b/nwnds_module/ds_s_shadow_01.utc differ diff --git a/nwnds_module/ds_s_shadow_02.utc b/nwnds_module/ds_s_shadow_02.utc new file mode 100644 index 000000000..2d80800d4 Binary files /dev/null and b/nwnds_module/ds_s_shadow_02.utc differ diff --git a/nwnds_module/ds_s_shadow_03.utc b/nwnds_module/ds_s_shadow_03.utc new file mode 100644 index 000000000..4cabecef0 Binary files /dev/null and b/nwnds_module/ds_s_shadow_03.utc differ diff --git a/nwnds_module/ds_s_shadow_04.utc b/nwnds_module/ds_s_shadow_04.utc new file mode 100644 index 000000000..89fa2c7a0 Binary files /dev/null and b/nwnds_module/ds_s_shadow_04.utc differ diff --git a/nwnds_module/ds_s_shadow_05.utc b/nwnds_module/ds_s_shadow_05.utc new file mode 100644 index 000000000..9c80fa44c Binary files /dev/null and b/nwnds_module/ds_s_shadow_05.utc differ diff --git a/nwnds_module/ds_s_shadow_06.utc b/nwnds_module/ds_s_shadow_06.utc new file mode 100644 index 000000000..d1478d240 Binary files /dev/null and b/nwnds_module/ds_s_shadow_06.utc differ diff --git a/nwnds_module/ds_s_shadow_07.utc b/nwnds_module/ds_s_shadow_07.utc new file mode 100644 index 000000000..d83460bd1 Binary files /dev/null and b/nwnds_module/ds_s_shadow_07.utc differ diff --git a/nwnds_module/ds_s_shadow_08.utc b/nwnds_module/ds_s_shadow_08.utc new file mode 100644 index 000000000..75adb915d Binary files /dev/null and b/nwnds_module/ds_s_shadow_08.utc differ diff --git a/nwnds_module/ds_s_shadow_09.utc b/nwnds_module/ds_s_shadow_09.utc new file mode 100644 index 000000000..596ca14da Binary files /dev/null and b/nwnds_module/ds_s_shadow_09.utc differ diff --git a/nwnds_module/ds_safearea.dlg b/nwnds_module/ds_safearea.dlg new file mode 100644 index 000000000..b23bf8472 Binary files /dev/null and b/nwnds_module/ds_safearea.dlg differ diff --git a/nwnds_module/ds_sandgolem001.utc b/nwnds_module/ds_sandgolem001.utc new file mode 100644 index 000000000..fb48e228a Binary files /dev/null and b/nwnds_module/ds_sandgolem001.utc differ diff --git a/nwnds_module/ds_sandgolem002.utc b/nwnds_module/ds_sandgolem002.utc new file mode 100644 index 000000000..3b4f4db69 Binary files /dev/null and b/nwnds_module/ds_sandgolem002.utc differ diff --git a/nwnds_module/ds_scrab001.utc b/nwnds_module/ds_scrab001.utc new file mode 100644 index 000000000..475f07cee Binary files /dev/null and b/nwnds_module/ds_scrab001.utc differ diff --git a/nwnds_module/ds_sentinelhide.uti b/nwnds_module/ds_sentinelhide.uti new file mode 100644 index 000000000..6af0d8fb9 Binary files /dev/null and b/nwnds_module/ds_sentinelhide.uti differ diff --git a/nwnds_module/ds_setclock1.ncs b/nwnds_module/ds_setclock1.ncs new file mode 100644 index 000000000..7c6621619 Binary files /dev/null and b/nwnds_module/ds_setclock1.ncs differ diff --git a/nwnds_module/ds_setclock1.nss b/nwnds_module/ds_setclock1.nss new file mode 100644 index 000000000..11ab415c3 --- /dev/null +++ b/nwnds_module/ds_setclock1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_setclock1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 7:10:37 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nClock", 1); + +} diff --git a/nwnds_module/ds_setclock2.ncs b/nwnds_module/ds_setclock2.ncs new file mode 100644 index 000000000..5cedef04b Binary files /dev/null and b/nwnds_module/ds_setclock2.ncs differ diff --git a/nwnds_module/ds_setclock2.nss b/nwnds_module/ds_setclock2.nss new file mode 100644 index 000000000..98280dbcc --- /dev/null +++ b/nwnds_module/ds_setclock2.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_setclock2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/14/02 5:35:08 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nClock", 2); + +} diff --git a/nwnds_module/ds_setlvl3.ncs b/nwnds_module/ds_setlvl3.ncs new file mode 100644 index 000000000..ec2ffad64 Binary files /dev/null and b/nwnds_module/ds_setlvl3.ncs differ diff --git a/nwnds_module/ds_setlvl3.nss b/nwnds_module/ds_setlvl3.nss new file mode 100644 index 000000000..f262b65ba --- /dev/null +++ b/nwnds_module/ds_setlvl3.nss @@ -0,0 +1,13 @@ +void main() +{ + if (GetHitDice(GetPCSpeaker()) < 3) + SetXP(GetPCSpeaker(), 3000); + +// Capture the PC in a variable for later use in the AssignCommand +// object oPC = GetPCSpeaker(); +// Give the speaker the items +// object oSpecialItem = CreateItemOnObject ("PsionicLevel1", GetPCSpeaker(), 1); +//Force the speaker to equip the item that was just given +// AssignCommand(oPC, ActionEquipItem (oSpecialItem, INVENTORY_SLOT_CARMOUR)); + +} diff --git a/nwnds_module/ds_sewerladder.utd b/nwnds_module/ds_sewerladder.utd new file mode 100644 index 000000000..2ba6289bd Binary files /dev/null and b/nwnds_module/ds_sewerladder.utd differ diff --git a/nwnds_module/ds_shaqat001.utc b/nwnds_module/ds_shaqat001.utc new file mode 100644 index 000000000..b949664c1 Binary files /dev/null and b/nwnds_module/ds_shaqat001.utc differ diff --git a/nwnds_module/ds_shodowkey.ncs b/nwnds_module/ds_shodowkey.ncs new file mode 100644 index 000000000..68dec76e4 Binary files /dev/null and b/nwnds_module/ds_shodowkey.ncs differ diff --git a/nwnds_module/ds_shodowkey.nss b/nwnds_module/ds_shodowkey.nss new file mode 100644 index 000000000..f56170f5f --- /dev/null +++ b/nwnds_module/ds_shodowkey.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + +object oItemToTake; +oItemToTake = GetItemPossessedBy(oPC, "ShadowKey"); +if(GetIsObjectValid(oItemToTake) != 0) { +FloatingTextStringOnCreature("The Key glows softly.", oPC, FALSE); +AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("WP_Shadow")))); +} +} diff --git a/nwnds_module/ds_silkwyrm001.utc b/nwnds_module/ds_silkwyrm001.utc new file mode 100644 index 000000000..d285b6006 Binary files /dev/null and b/nwnds_module/ds_silkwyrm001.utc differ diff --git a/nwnds_module/ds_silteel001.utc b/nwnds_module/ds_silteel001.utc new file mode 100644 index 000000000..0e05f726f Binary files /dev/null and b/nwnds_module/ds_silteel001.utc differ diff --git a/nwnds_module/ds_siltrunner001.utc b/nwnds_module/ds_siltrunner001.utc new file mode 100644 index 000000000..b79766d3f Binary files /dev/null and b/nwnds_module/ds_siltrunner001.utc differ diff --git a/nwnds_module/ds_siltserpent01.utc b/nwnds_module/ds_siltserpent01.utc new file mode 100644 index 000000000..ab02a8705 Binary files /dev/null and b/nwnds_module/ds_siltserpent01.utc differ diff --git a/nwnds_module/ds_siltserpent04.utc b/nwnds_module/ds_siltserpent04.utc new file mode 100644 index 000000000..1752fed9f Binary files /dev/null and b/nwnds_module/ds_siltserpent04.utc differ diff --git a/nwnds_module/ds_siltspawn001.utc b/nwnds_module/ds_siltspawn001.utc new file mode 100644 index 000000000..7efa3e24a Binary files /dev/null and b/nwnds_module/ds_siltspawn001.utc differ diff --git a/nwnds_module/ds_siltspider001.utc b/nwnds_module/ds_siltspider001.utc new file mode 100644 index 000000000..00e5b97dc Binary files /dev/null and b/nwnds_module/ds_siltspider001.utc differ diff --git a/nwnds_module/ds_siltweird001.utc b/nwnds_module/ds_siltweird001.utc new file mode 100644 index 000000000..434f0b20b Binary files /dev/null and b/nwnds_module/ds_siltweird001.utc differ diff --git a/nwnds_module/ds_sit.ncs b/nwnds_module/ds_sit.ncs new file mode 100644 index 000000000..a1671621a Binary files /dev/null and b/nwnds_module/ds_sit.ncs differ diff --git a/nwnds_module/ds_sit.nss b/nwnds_module/ds_sit.nss new file mode 100644 index 000000000..9732e5a2b --- /dev/null +++ b/nwnds_module/ds_sit.nss @@ -0,0 +1,6 @@ +void main() +{ + object oPlayer = GetLastUsedBy(); + object oChair = OBJECT_SELF; + AssignCommand(oPlayer, ActionSit(oChair)); +} diff --git a/nwnds_module/ds_skyfish001.utc b/nwnds_module/ds_skyfish001.utc new file mode 100644 index 000000000..b439d382e Binary files /dev/null and b/nwnds_module/ds_skyfish001.utc differ diff --git a/nwnds_module/ds_spinewyrm001.utc b/nwnds_module/ds_spinewyrm001.utc new file mode 100644 index 000000000..f7d8bf1fa Binary files /dev/null and b/nwnds_module/ds_spinewyrm001.utc differ diff --git a/nwnds_module/ds_spyretower1tk.ncs b/nwnds_module/ds_spyretower1tk.ncs new file mode 100644 index 000000000..e8cb0a8fd Binary files /dev/null and b/nwnds_module/ds_spyretower1tk.ncs differ diff --git a/nwnds_module/ds_spyretower1tk.nss b/nwnds_module/ds_spyretower1tk.nss new file mode 100644 index 000000000..150774606 --- /dev/null +++ b/nwnds_module/ds_spyretower1tk.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_spyretower1")); +} + + diff --git a/nwnds_module/ds_ss_zull.utc b/nwnds_module/ds_ss_zull.utc new file mode 100644 index 000000000..2836d791a Binary files /dev/null and b/nwnds_module/ds_ss_zull.utc differ diff --git a/nwnds_module/ds_stonegolem002.utc b/nwnds_module/ds_stonegolem002.utc new file mode 100644 index 000000000..41392feac Binary files /dev/null and b/nwnds_module/ds_stonegolem002.utc differ diff --git a/nwnds_module/ds_strine001.utc b/nwnds_module/ds_strine001.utc new file mode 100644 index 000000000..cd5d6c692 Binary files /dev/null and b/nwnds_module/ds_strine001.utc differ diff --git a/nwnds_module/ds_styr001.utc b/nwnds_module/ds_styr001.utc new file mode 100644 index 000000000..96fe5e4c8 Binary files /dev/null and b/nwnds_module/ds_styr001.utc differ diff --git a/nwnds_module/ds_sundial.ncs b/nwnds_module/ds_sundial.ncs new file mode 100644 index 000000000..430132665 Binary files /dev/null and b/nwnds_module/ds_sundial.ncs differ diff --git a/nwnds_module/ds_sundial.nss b/nwnds_module/ds_sundial.nss new file mode 100644 index 000000000..b9adccd16 --- /dev/null +++ b/nwnds_module/ds_sundial.nss @@ -0,0 +1,8 @@ +void main() +{ +int nHour = GetTimeHour(); +int nMin = GetTimeMinute(); +int nSec = GetTimeSecond(); +string sTime = "The time is " + IntToString(nHour) + ":" + IntToString(nMin) + ":" + IntToString(nSec) + " on day " + IntToString(GetCalendarDay()) + " of the month " + IntToString(GetCalendarMonth()) + " of the year " + IntToString(GetCalendarYear()); +ActionSpeakString(sTime); +} diff --git a/nwnds_module/ds_swampviper001.utc b/nwnds_module/ds_swampviper001.utc new file mode 100644 index 000000000..a30b72d4c Binary files /dev/null and b/nwnds_module/ds_swampviper001.utc differ diff --git a/nwnds_module/ds_swampviper002.utc b/nwnds_module/ds_swampviper002.utc new file mode 100644 index 000000000..7748bc91c Binary files /dev/null and b/nwnds_module/ds_swampviper002.utc differ diff --git a/nwnds_module/ds_swampviper003.utc b/nwnds_module/ds_swampviper003.utc new file mode 100644 index 000000000..a973df68d Binary files /dev/null and b/nwnds_module/ds_swampviper003.utc differ diff --git a/nwnds_module/ds_tailor_ondist.ncs b/nwnds_module/ds_tailor_ondist.ncs new file mode 100644 index 000000000..f9d616a6b Binary files /dev/null and b/nwnds_module/ds_tailor_ondist.ncs differ diff --git a/nwnds_module/ds_tailor_ondist.nss b/nwnds_module/ds_tailor_ondist.nss new file mode 100644 index 000000000..dd9f51627 --- /dev/null +++ b/nwnds_module/ds_tailor_ondist.nss @@ -0,0 +1,5 @@ +#include "wow_inc_forge" +void main() +{ + wow_Forge(); +} diff --git a/nwnds_module/ds_tailor_onused.ncs b/nwnds_module/ds_tailor_onused.ncs new file mode 100644 index 000000000..1ef636059 Binary files /dev/null and b/nwnds_module/ds_tailor_onused.ncs differ diff --git a/nwnds_module/ds_tailor_onused.nss b/nwnds_module/ds_tailor_onused.nss new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/nwnds_module/ds_tailor_onused.nss @@ -0,0 +1 @@ + diff --git a/nwnds_module/ds_take10kxp.ncs b/nwnds_module/ds_take10kxp.ncs new file mode 100644 index 000000000..aaf1c8bf1 Binary files /dev/null and b/nwnds_module/ds_take10kxp.ncs differ diff --git a/nwnds_module/ds_take10kxp.nss b/nwnds_module/ds_take10kxp.nss new file mode 100644 index 000000000..baccdec7f --- /dev/null +++ b/nwnds_module/ds_take10kxp.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName ds_take10kxp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 3/3/2004 10:21:48 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some xp from the player + object oPC = GetPCSpeaker(); + int nLevel = GetHitDice(oPC); //Get level + int nXP = GetXP(oPC); //Save XP so we can restore it afterwards + int nDelevelXP = (nLevel-1) * (nLevel - 2) * 500; //Work out how much XP will delevel the PC + SetXP(oPC, nDelevelXP); +} diff --git a/nwnds_module/ds_takis001.utc b/nwnds_module/ds_takis001.utc new file mode 100644 index 000000000..eb1f2f60d Binary files /dev/null and b/nwnds_module/ds_takis001.utc differ diff --git a/nwnds_module/ds_tapestry004.utp b/nwnds_module/ds_tapestry004.utp new file mode 100644 index 000000000..5e8367ef8 Binary files /dev/null and b/nwnds_module/ds_tapestry004.utp differ diff --git a/nwnds_module/ds_tapestry02.utp b/nwnds_module/ds_tapestry02.utp new file mode 100644 index 000000000..bf56987c2 Binary files /dev/null and b/nwnds_module/ds_tapestry02.utp differ diff --git a/nwnds_module/ds_tarek_slam_c.uti b/nwnds_module/ds_tarek_slam_c.uti new file mode 100644 index 000000000..7af495fd6 Binary files /dev/null and b/nwnds_module/ds_tarek_slam_c.uti differ diff --git a/nwnds_module/ds_tarek_slam_d.uti b/nwnds_module/ds_tarek_slam_d.uti new file mode 100644 index 000000000..d9035ad6d Binary files /dev/null and b/nwnds_module/ds_tarek_slam_d.uti differ diff --git a/nwnds_module/ds_tarek_slam_f.uti b/nwnds_module/ds_tarek_slam_f.uti new file mode 100644 index 000000000..a1c9cf799 Binary files /dev/null and b/nwnds_module/ds_tarek_slam_f.uti differ diff --git a/nwnds_module/ds_tarek_slam_g.uti b/nwnds_module/ds_tarek_slam_g.uti new file mode 100644 index 000000000..b670faf1d Binary files /dev/null and b/nwnds_module/ds_tarek_slam_g.uti differ diff --git a/nwnds_module/ds_tarek_slam_h.uti b/nwnds_module/ds_tarek_slam_h.uti new file mode 100644 index 000000000..7ea7ef4f3 Binary files /dev/null and b/nwnds_module/ds_tarek_slam_h.uti differ diff --git a/nwnds_module/ds_tarek_slam_l.uti b/nwnds_module/ds_tarek_slam_l.uti new file mode 100644 index 000000000..d9ee647a7 Binary files /dev/null and b/nwnds_module/ds_tarek_slam_l.uti differ diff --git a/nwnds_module/ds_tarek_slam_m.uti b/nwnds_module/ds_tarek_slam_m.uti new file mode 100644 index 000000000..74244d9cb Binary files /dev/null and b/nwnds_module/ds_tarek_slam_m.uti differ diff --git a/nwnds_module/ds_tarek_slam_s.uti b/nwnds_module/ds_tarek_slam_s.uti new file mode 100644 index 000000000..f623889ad Binary files /dev/null and b/nwnds_module/ds_tarek_slam_s.uti differ diff --git a/nwnds_module/ds_tarek_slam_t.uti b/nwnds_module/ds_tarek_slam_t.uti new file mode 100644 index 000000000..990db73ac Binary files /dev/null and b/nwnds_module/ds_tarek_slam_t.uti differ diff --git a/nwnds_module/ds_tari_bite_c.uti b/nwnds_module/ds_tari_bite_c.uti new file mode 100644 index 000000000..f37059235 Binary files /dev/null and b/nwnds_module/ds_tari_bite_c.uti differ diff --git a/nwnds_module/ds_tari_bite_d.uti b/nwnds_module/ds_tari_bite_d.uti new file mode 100644 index 000000000..e487fb38a Binary files /dev/null and b/nwnds_module/ds_tari_bite_d.uti differ diff --git a/nwnds_module/ds_tari_bite_f.uti b/nwnds_module/ds_tari_bite_f.uti new file mode 100644 index 000000000..f48948dcf Binary files /dev/null and b/nwnds_module/ds_tari_bite_f.uti differ diff --git a/nwnds_module/ds_tari_bite_g.uti b/nwnds_module/ds_tari_bite_g.uti new file mode 100644 index 000000000..6efe0151d Binary files /dev/null and b/nwnds_module/ds_tari_bite_g.uti differ diff --git a/nwnds_module/ds_tari_bite_h.uti b/nwnds_module/ds_tari_bite_h.uti new file mode 100644 index 000000000..8bd2c90e5 Binary files /dev/null and b/nwnds_module/ds_tari_bite_h.uti differ diff --git a/nwnds_module/ds_tari_bite_l.uti b/nwnds_module/ds_tari_bite_l.uti new file mode 100644 index 000000000..9117ab2e6 Binary files /dev/null and b/nwnds_module/ds_tari_bite_l.uti differ diff --git a/nwnds_module/ds_tari_bite_m.uti b/nwnds_module/ds_tari_bite_m.uti new file mode 100644 index 000000000..02bb772cb Binary files /dev/null and b/nwnds_module/ds_tari_bite_m.uti differ diff --git a/nwnds_module/ds_tari_bite_s.uti b/nwnds_module/ds_tari_bite_s.uti new file mode 100644 index 000000000..9baa9b194 Binary files /dev/null and b/nwnds_module/ds_tari_bite_s.uti differ diff --git a/nwnds_module/ds_tari_bite_t.uti b/nwnds_module/ds_tari_bite_t.uti new file mode 100644 index 000000000..5a8d0c50f Binary files /dev/null and b/nwnds_module/ds_tari_bite_t.uti differ diff --git a/nwnds_module/ds_tents001.utp b/nwnds_module/ds_tents001.utp new file mode 100644 index 000000000..ada7cf263 Binary files /dev/null and b/nwnds_module/ds_tents001.utp differ diff --git a/nwnds_module/ds_tents006.utp b/nwnds_module/ds_tents006.utp new file mode 100644 index 000000000..efe253101 Binary files /dev/null and b/nwnds_module/ds_tents006.utp differ diff --git a/nwnds_module/ds_tents011.utp b/nwnds_module/ds_tents011.utp new file mode 100644 index 000000000..c058319b7 Binary files /dev/null and b/nwnds_module/ds_tents011.utp differ diff --git a/nwnds_module/ds_thrw_flameoil.uti b/nwnds_module/ds_thrw_flameoil.uti new file mode 100644 index 000000000..8085a4f1f Binary files /dev/null and b/nwnds_module/ds_thrw_flameoil.uti differ diff --git a/nwnds_module/ds_tocrafters.ncs b/nwnds_module/ds_tocrafters.ncs new file mode 100644 index 000000000..a80a1f0b9 Binary files /dev/null and b/nwnds_module/ds_tocrafters.ncs differ diff --git a/nwnds_module/ds_tocrafters.nss b/nwnds_module/ds_tocrafters.nss new file mode 100644 index 000000000..84760a198 --- /dev/null +++ b/nwnds_module/ds_tocrafters.nss @@ -0,0 +1,6 @@ +void main() +{ + + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetWaypointByTag("TOCRAFTERS")))); + DelayCommand(10.0,SetLocked(OBJECT_SELF,TRUE)); +} diff --git a/nwnds_module/ds_torchstand001.utp b/nwnds_module/ds_torchstand001.utp new file mode 100644 index 000000000..d9902c5df Binary files /dev/null and b/nwnds_module/ds_torchstand001.utp differ diff --git a/nwnds_module/ds_tounderclock1.ncs b/nwnds_module/ds_tounderclock1.ncs new file mode 100644 index 000000000..1d650b4e1 Binary files /dev/null and b/nwnds_module/ds_tounderclock1.ncs differ diff --git a/nwnds_module/ds_tounderclock1.nss b/nwnds_module/ds_tounderclock1.nss new file mode 100644 index 000000000..7c8b94798 --- /dev/null +++ b/nwnds_module/ds_tounderclock1.nss @@ -0,0 +1,5 @@ +void main() +{ + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("WPUnderClock1")))); + +} diff --git a/nwnds_module/ds_tounderclock2.ncs b/nwnds_module/ds_tounderclock2.ncs new file mode 100644 index 000000000..6f4cf72f0 Binary files /dev/null and b/nwnds_module/ds_tounderclock2.ncs differ diff --git a/nwnds_module/ds_tounderclock2.nss b/nwnds_module/ds_tounderclock2.nss new file mode 100644 index 000000000..abe107ce4 --- /dev/null +++ b/nwnds_module/ds_tounderclock2.nss @@ -0,0 +1,5 @@ +void main() +{ + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("WPUnderClock2")))); + +} diff --git a/nwnds_module/ds_tounderclock3.ncs b/nwnds_module/ds_tounderclock3.ncs new file mode 100644 index 000000000..130fd719c Binary files /dev/null and b/nwnds_module/ds_tounderclock3.ncs differ diff --git a/nwnds_module/ds_tounderclock3.nss b/nwnds_module/ds_tounderclock3.nss new file mode 100644 index 000000000..cb10a7e53 --- /dev/null +++ b/nwnds_module/ds_tounderclock3.nss @@ -0,0 +1,5 @@ +void main() +{ + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetObjectByTag("WPUnderClock3")))); + +} diff --git a/nwnds_module/ds_tova.ncs b/nwnds_module/ds_tova.ncs new file mode 100644 index 000000000..12c3a256b Binary files /dev/null and b/nwnds_module/ds_tova.ncs differ diff --git a/nwnds_module/ds_tova.nss b/nwnds_module/ds_tova.nss new file mode 100644 index 000000000..c7384d677 --- /dev/null +++ b/nwnds_module/ds_tova.nss @@ -0,0 +1,6 @@ +void main() +{ + + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetWaypointByTag("TOBHVA")))); + DelayCommand(10.0,SetLocked(OBJECT_SELF,TRUE)); +} diff --git a/nwnds_module/ds_tr_dr_air01.utc b/nwnds_module/ds_tr_dr_air01.utc new file mode 100644 index 000000000..dafb37775 Binary files /dev/null and b/nwnds_module/ds_tr_dr_air01.utc differ diff --git a/nwnds_module/ds_tr_dr_earth01.utc b/nwnds_module/ds_tr_dr_earth01.utc new file mode 100644 index 000000000..86c6511e4 Binary files /dev/null and b/nwnds_module/ds_tr_dr_earth01.utc differ diff --git a/nwnds_module/ds_trin001.utc b/nwnds_module/ds_trin001.utc new file mode 100644 index 000000000..39639b1e5 Binary files /dev/null and b/nwnds_module/ds_trin001.utc differ diff --git a/nwnds_module/ds_tulk001.utc b/nwnds_module/ds_tulk001.utc new file mode 100644 index 000000000..237215bbd Binary files /dev/null and b/nwnds_module/ds_tulk001.utc differ diff --git a/nwnds_module/ds_vaalignck.ncs b/nwnds_module/ds_vaalignck.ncs new file mode 100644 index 000000000..653311b8d Binary files /dev/null and b/nwnds_module/ds_vaalignck.ncs differ diff --git a/nwnds_module/ds_vaalignck.nss b/nwnds_module/ds_vaalignck.nss new file mode 100644 index 000000000..83e148e5e --- /dev/null +++ b/nwnds_module/ds_vaalignck.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Restrict based on the player's alignment + if(GetAlignmentGoodEvil(GetPCSpeaker()) == ALIGNMENT_EVIL) + return TRUE; + + return FALSE; +} diff --git a/nwnds_module/ds_vorlon_guard1.utc b/nwnds_module/ds_vorlon_guard1.utc new file mode 100644 index 000000000..9c3af9902 Binary files /dev/null and b/nwnds_module/ds_vorlon_guard1.utc differ diff --git a/nwnds_module/ds_vorlon_guard2.utc b/nwnds_module/ds_vorlon_guard2.utc new file mode 100644 index 000000000..3ec6be650 Binary files /dev/null and b/nwnds_module/ds_vorlon_guard2.utc differ diff --git a/nwnds_module/ds_vrock001.utc b/nwnds_module/ds_vrock001.utc new file mode 100644 index 000000000..3e20d9baf Binary files /dev/null and b/nwnds_module/ds_vrock001.utc differ diff --git a/nwnds_module/ds_wateruse.ncs b/nwnds_module/ds_wateruse.ncs new file mode 100644 index 000000000..b77ac2a18 Binary files /dev/null and b/nwnds_module/ds_wateruse.ncs differ diff --git a/nwnds_module/ds_wateruse.nss b/nwnds_module/ds_wateruse.nss new file mode 100644 index 000000000..262b532c5 --- /dev/null +++ b/nwnds_module/ds_wateruse.nss @@ -0,0 +1,54 @@ +/* ds_wateruse +this goes in every area that you consume water in +*/ + +//:: adjust for the endurance feat id. +// const int FEAT_SURVIVAL = 1148; <--- Using Trackless Step instead. + + +//#include "sha_subr_methds" + +void main() +{ +int nToTake = 1; // Number of canteens to take. +string sTag = "AR_IT_WATER"; // Tag of Water items. +object oArea = GetArea(OBJECT_SELF); +object oPC = GetFirstPC(); + +while (GetIsPC(oPC) == TRUE && GetHasFeat(201, oPC) == FALSE) // Trackless Step + +{ +if (GetArea(oPC) == oArea){ +int nThirst = GetLocalInt(oPC,"nThirst"); +if (nThirst < 500) + { + nThirst++; + int nRandom = d10(); + switch(nRandom) + { + case 1: + nThirst++; + nThirst++; + break; + case 2: + nThirst++; + break; + } + SetLocalInt(oPC, "nThirst", nThirst); + } else { + SendMessageToPC(oPC,"You are thirsty."); + SetLocalInt(oPC, "nThirst", 0); + object oItemToTake = GetItemPossessedBy(oPC, "AR_IT_WATER"); + if(GetIsObjectValid(oItemToTake) == TRUE) + { + DestroyObject(oItemToTake); + } else { + AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ExtraordinaryEffect(EffectCurse(0, 0, 2, 0, 0, 0)), oPC)); + } + } +} // if area +oPC = GetNextPC(); +} // while +} + + diff --git a/nwnds_module/ds_wezer001.utc b/nwnds_module/ds_wezer001.utc new file mode 100644 index 000000000..cdd6b3519 Binary files /dev/null and b/nwnds_module/ds_wezer001.utc differ diff --git a/nwnds_module/ds_wezer003.utc b/nwnds_module/ds_wezer003.utc new file mode 100644 index 000000000..543bf51b4 Binary files /dev/null and b/nwnds_module/ds_wezer003.utc differ diff --git a/nwnds_module/ds_wswdg_inix.uti b/nwnds_module/ds_wswdg_inix.uti new file mode 100644 index 000000000..a0ba9ba35 Binary files /dev/null and b/nwnds_module/ds_wswdg_inix.uti differ diff --git a/nwnds_module/ds_wswls_inix.uti b/nwnds_module/ds_wswls_inix.uti new file mode 100644 index 000000000..e43925d22 Binary files /dev/null and b/nwnds_module/ds_wswls_inix.uti differ diff --git a/nwnds_module/ds_wswls_mekilot.uti b/nwnds_module/ds_wswls_mekilot.uti new file mode 100644 index 000000000..a6175ed45 Binary files /dev/null and b/nwnds_module/ds_wswls_mekilot.uti differ diff --git a/nwnds_module/ds_wswls_steel.uti b/nwnds_module/ds_wswls_steel.uti new file mode 100644 index 000000000..08835e7ad Binary files /dev/null and b/nwnds_module/ds_wswls_steel.uti differ diff --git a/nwnds_module/ds_wswls_stone.uti b/nwnds_module/ds_wswls_stone.uti new file mode 100644 index 000000000..108686768 Binary files /dev/null and b/nwnds_module/ds_wswls_stone.uti differ diff --git a/nwnds_module/ds_wswmls_inix01.uti b/nwnds_module/ds_wswmls_inix01.uti new file mode 100644 index 000000000..7478f51ae Binary files /dev/null and b/nwnds_module/ds_wswmls_inix01.uti differ diff --git a/nwnds_module/ds_wswmls_steel1.uti b/nwnds_module/ds_wswmls_steel1.uti new file mode 100644 index 000000000..50c3bbeb0 Binary files /dev/null and b/nwnds_module/ds_wswmls_steel1.uti differ diff --git a/nwnds_module/ds_wswmls_steel2.uti b/nwnds_module/ds_wswmls_steel2.uti new file mode 100644 index 000000000..98510481b Binary files /dev/null and b/nwnds_module/ds_wswmls_steel2.uti differ diff --git a/nwnds_module/ds_wswmss_bone01.uti b/nwnds_module/ds_wswmss_bone01.uti new file mode 100644 index 000000000..6bd4bdf60 Binary files /dev/null and b/nwnds_module/ds_wswmss_bone01.uti differ diff --git a/nwnds_module/ds_zik_trin_ak01.utc b/nwnds_module/ds_zik_trin_ak01.utc new file mode 100644 index 000000000..cedde501f Binary files /dev/null and b/nwnds_module/ds_zik_trin_ak01.utc differ diff --git a/nwnds_module/ds_zik_trin_ta01.utc b/nwnds_module/ds_zik_trin_ta01.utc new file mode 100644 index 000000000..4c8b1c2d4 Binary files /dev/null and b/nwnds_module/ds_zik_trin_ta01.utc differ diff --git a/nwnds_module/ds_ztal001.utc b/nwnds_module/ds_ztal001.utc new file mode 100644 index 000000000..ba24a30e3 Binary files /dev/null and b/nwnds_module/ds_ztal001.utc differ diff --git a/nwnds_module/ds_ztal002.utc b/nwnds_module/ds_ztal002.utc new file mode 100644 index 000000000..0e90d85f5 Binary files /dev/null and b/nwnds_module/ds_ztal002.utc differ diff --git a/nwnds_module/dspiderbite.ncs b/nwnds_module/dspiderbite.ncs new file mode 100644 index 000000000..ae454ce53 Binary files /dev/null and b/nwnds_module/dspiderbite.ncs differ diff --git a/nwnds_module/dspiderbite.nss b/nwnds_module/dspiderbite.nss new file mode 100644 index 000000000..efe42b015 --- /dev/null +++ b/nwnds_module/dspiderbite.nss @@ -0,0 +1,63 @@ +#include "NW_I0_SPELLS" + + +void DoPoison(object oTarget, object oCaster) +{ +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + SetLocalInt(oTarget,"IsPoisoned",0); + else + SetLocalInt(oTarget,"IsPoisoned",1); */ + + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + int nDam = d12(2); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_POISON) || + GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to poison."); + return; + } + + if ( !MySavingThrow(SAVING_THROW_FORT,oTarget,94,SAVING_THROW_TYPE_POISON,oCaster) ) + { + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_POISON) || + GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to poison."); + return; + } + + DelayCommand(0.1,DoPoison(oTarget,oCaster)); + DelayCommand(RoundsToSeconds(10),DoPoison(oTarget,oCaster)); +} diff --git a/nwnds_module/dspiderbite.uti b/nwnds_module/dspiderbite.uti new file mode 100644 index 000000000..4edfad103 Binary files /dev/null and b/nwnds_module/dspiderbite.uti differ diff --git a/nwnds_module/dspiderhide.uti b/nwnds_module/dspiderhide.uti new file mode 100644 index 000000000..1b3cb5859 Binary files /dev/null and b/nwnds_module/dspiderhide.uti differ diff --git a/nwnds_module/dunebandit_001.utc b/nwnds_module/dunebandit_001.utc new file mode 100644 index 000000000..fa9c3fe32 Binary files /dev/null and b/nwnds_module/dunebandit_001.utc differ diff --git a/nwnds_module/dunebandit_002.utc b/nwnds_module/dunebandit_002.utc new file mode 100644 index 000000000..0be4a61aa Binary files /dev/null and b/nwnds_module/dunebandit_002.utc differ diff --git a/nwnds_module/dunebandit_003.utc b/nwnds_module/dunebandit_003.utc new file mode 100644 index 000000000..45a8cbe0e Binary files /dev/null and b/nwnds_module/dunebandit_003.utc differ diff --git a/nwnds_module/dunecrabclaw.uti b/nwnds_module/dunecrabclaw.uti new file mode 100644 index 000000000..f4f28c69f Binary files /dev/null and b/nwnds_module/dunecrabclaw.uti differ diff --git a/nwnds_module/dunereaper001.utc b/nwnds_module/dunereaper001.utc new file mode 100644 index 000000000..98e321c0f Binary files /dev/null and b/nwnds_module/dunereaper001.utc differ diff --git a/nwnds_module/dunereaper002.utc b/nwnds_module/dunereaper002.utc new file mode 100644 index 000000000..75439b16c Binary files /dev/null and b/nwnds_module/dunereaper002.utc differ diff --git a/nwnds_module/dunereaperclaw.uti b/nwnds_module/dunereaperclaw.uti new file mode 100644 index 000000000..d2c8d71ff Binary files /dev/null and b/nwnds_module/dunereaperclaw.uti differ diff --git a/nwnds_module/dunereaperhide.uti b/nwnds_module/dunereaperhide.uti new file mode 100644 index 000000000..94d411632 Binary files /dev/null and b/nwnds_module/dunereaperhide.uti differ diff --git a/nwnds_module/dunestalker_001.utc b/nwnds_module/dunestalker_001.utc new file mode 100644 index 000000000..bcbfbeb37 Binary files /dev/null and b/nwnds_module/dunestalker_001.utc differ diff --git a/nwnds_module/dunestalkerhid.uti b/nwnds_module/dunestalkerhid.uti new file mode 100644 index 000000000..8c16c35d8 Binary files /dev/null and b/nwnds_module/dunestalkerhid.uti differ diff --git a/nwnds_module/dunewarriorhide.uti b/nwnds_module/dunewarriorhide.uti new file mode 100644 index 000000000..2ed8dba36 Binary files /dev/null and b/nwnds_module/dunewarriorhide.uti differ diff --git a/nwnds_module/dustdigger001.utc b/nwnds_module/dustdigger001.utc new file mode 100644 index 000000000..9884aada9 Binary files /dev/null and b/nwnds_module/dustdigger001.utc differ diff --git a/nwnds_module/dustdiggerhide.uti b/nwnds_module/dustdiggerhide.uti new file mode 100644 index 000000000..285a74a31 Binary files /dev/null and b/nwnds_module/dustdiggerhide.uti differ diff --git a/nwnds_module/dw_banshee001.utc b/nwnds_module/dw_banshee001.utc new file mode 100644 index 000000000..05871be7a Binary files /dev/null and b/nwnds_module/dw_banshee001.utc differ diff --git a/nwnds_module/dw_bansheehide01.uti b/nwnds_module/dw_bansheehide01.uti new file mode 100644 index 000000000..76ba141f5 Binary files /dev/null and b/nwnds_module/dw_bansheehide01.uti differ diff --git a/nwnds_module/dw_bansheeslam01.uti b/nwnds_module/dw_bansheeslam01.uti new file mode 100644 index 000000000..2a7bc5b51 Binary files /dev/null and b/nwnds_module/dw_bansheeslam01.uti differ diff --git a/nwnds_module/dw_ghost001.utc b/nwnds_module/dw_ghost001.utc new file mode 100644 index 000000000..3af995338 Binary files /dev/null and b/nwnds_module/dw_ghost001.utc differ diff --git a/nwnds_module/dw_ghosthide001.uti b/nwnds_module/dw_ghosthide001.uti new file mode 100644 index 000000000..388920d9a Binary files /dev/null and b/nwnds_module/dw_ghosthide001.uti differ diff --git a/nwnds_module/dw_ghostslam001.uti b/nwnds_module/dw_ghostslam001.uti new file mode 100644 index 000000000..d1a598cef Binary files /dev/null and b/nwnds_module/dw_ghostslam001.uti differ diff --git a/nwnds_module/dw_raaig001.utc b/nwnds_module/dw_raaig001.utc new file mode 100644 index 000000000..5955a176a Binary files /dev/null and b/nwnds_module/dw_raaig001.utc differ diff --git a/nwnds_module/dw_raaighide001.uti b/nwnds_module/dw_raaighide001.uti new file mode 100644 index 000000000..3b9d31f65 Binary files /dev/null and b/nwnds_module/dw_raaighide001.uti differ diff --git a/nwnds_module/dwarfbansheeslam.uti b/nwnds_module/dwarfbansheeslam.uti new file mode 100644 index 000000000..01532fdc0 Binary files /dev/null and b/nwnds_module/dwarfbansheeslam.uti differ diff --git a/nwnds_module/dydrina.utc b/nwnds_module/dydrina.utc new file mode 100644 index 000000000..5ca35e7f3 Binary files /dev/null and b/nwnds_module/dydrina.utc differ diff --git a/nwnds_module/dyec00.uti b/nwnds_module/dyec00.uti new file mode 100644 index 000000000..38b070fa2 Binary files /dev/null and b/nwnds_module/dyec00.uti differ diff --git a/nwnds_module/dyec01.uti b/nwnds_module/dyec01.uti new file mode 100644 index 000000000..c68d2e62e Binary files /dev/null and b/nwnds_module/dyec01.uti differ diff --git a/nwnds_module/dyec02.uti b/nwnds_module/dyec02.uti new file mode 100644 index 000000000..b468f060e Binary files /dev/null and b/nwnds_module/dyec02.uti differ diff --git a/nwnds_module/dyec03.uti b/nwnds_module/dyec03.uti new file mode 100644 index 000000000..d42ab0583 Binary files /dev/null and b/nwnds_module/dyec03.uti differ diff --git a/nwnds_module/dyec04.uti b/nwnds_module/dyec04.uti new file mode 100644 index 000000000..f73de95ba Binary files /dev/null and b/nwnds_module/dyec04.uti differ diff --git a/nwnds_module/dyec05.uti b/nwnds_module/dyec05.uti new file mode 100644 index 000000000..798df7787 Binary files /dev/null and b/nwnds_module/dyec05.uti differ diff --git a/nwnds_module/dyec06.uti b/nwnds_module/dyec06.uti new file mode 100644 index 000000000..f6c842b38 Binary files /dev/null and b/nwnds_module/dyec06.uti differ diff --git a/nwnds_module/dyec07.uti b/nwnds_module/dyec07.uti new file mode 100644 index 000000000..11f1f9952 Binary files /dev/null and b/nwnds_module/dyec07.uti differ diff --git a/nwnds_module/dyec08.uti b/nwnds_module/dyec08.uti new file mode 100644 index 000000000..d1eb4377b Binary files /dev/null and b/nwnds_module/dyec08.uti differ diff --git a/nwnds_module/dyec09.uti b/nwnds_module/dyec09.uti new file mode 100644 index 000000000..5ce054f62 Binary files /dev/null and b/nwnds_module/dyec09.uti differ diff --git a/nwnds_module/dyec10.uti b/nwnds_module/dyec10.uti new file mode 100644 index 000000000..ecd3c3fb3 Binary files /dev/null and b/nwnds_module/dyec10.uti differ diff --git a/nwnds_module/dyec11.uti b/nwnds_module/dyec11.uti new file mode 100644 index 000000000..03c1e0fdc Binary files /dev/null and b/nwnds_module/dyec11.uti differ diff --git a/nwnds_module/dyec12.uti b/nwnds_module/dyec12.uti new file mode 100644 index 000000000..405fe5dc4 Binary files /dev/null and b/nwnds_module/dyec12.uti differ diff --git a/nwnds_module/dyec13.uti b/nwnds_module/dyec13.uti new file mode 100644 index 000000000..d4f24b4dc Binary files /dev/null and b/nwnds_module/dyec13.uti differ diff --git a/nwnds_module/dyec14.uti b/nwnds_module/dyec14.uti new file mode 100644 index 000000000..e5d972fe6 Binary files /dev/null and b/nwnds_module/dyec14.uti differ diff --git a/nwnds_module/dyec15.uti b/nwnds_module/dyec15.uti new file mode 100644 index 000000000..8227ea4f4 Binary files /dev/null and b/nwnds_module/dyec15.uti differ diff --git a/nwnds_module/dyec16.uti b/nwnds_module/dyec16.uti new file mode 100644 index 000000000..4efdcd2cc Binary files /dev/null and b/nwnds_module/dyec16.uti differ diff --git a/nwnds_module/dyec17.uti b/nwnds_module/dyec17.uti new file mode 100644 index 000000000..8e0ab513a Binary files /dev/null and b/nwnds_module/dyec17.uti differ diff --git a/nwnds_module/dyec18.uti b/nwnds_module/dyec18.uti new file mode 100644 index 000000000..74add6c0a Binary files /dev/null and b/nwnds_module/dyec18.uti differ diff --git a/nwnds_module/dyec19.uti b/nwnds_module/dyec19.uti new file mode 100644 index 000000000..faf4115a7 Binary files /dev/null and b/nwnds_module/dyec19.uti differ diff --git a/nwnds_module/dyec20.uti b/nwnds_module/dyec20.uti new file mode 100644 index 000000000..ae5bdc05f Binary files /dev/null and b/nwnds_module/dyec20.uti differ diff --git a/nwnds_module/dyec21.uti b/nwnds_module/dyec21.uti new file mode 100644 index 000000000..94e93f5ca Binary files /dev/null and b/nwnds_module/dyec21.uti differ diff --git a/nwnds_module/dyec22.uti b/nwnds_module/dyec22.uti new file mode 100644 index 000000000..85912734c Binary files /dev/null and b/nwnds_module/dyec22.uti differ diff --git a/nwnds_module/dyec23.uti b/nwnds_module/dyec23.uti new file mode 100644 index 000000000..6598f5bee Binary files /dev/null and b/nwnds_module/dyec23.uti differ diff --git a/nwnds_module/dyec24.uti b/nwnds_module/dyec24.uti new file mode 100644 index 000000000..474ec034b Binary files /dev/null and b/nwnds_module/dyec24.uti differ diff --git a/nwnds_module/dyec25.uti b/nwnds_module/dyec25.uti new file mode 100644 index 000000000..20062e52f Binary files /dev/null and b/nwnds_module/dyec25.uti differ diff --git a/nwnds_module/dyec26.uti b/nwnds_module/dyec26.uti new file mode 100644 index 000000000..61079dab0 Binary files /dev/null and b/nwnds_module/dyec26.uti differ diff --git a/nwnds_module/dyec27.uti b/nwnds_module/dyec27.uti new file mode 100644 index 000000000..efc80846b Binary files /dev/null and b/nwnds_module/dyec27.uti differ diff --git a/nwnds_module/dyec28.uti b/nwnds_module/dyec28.uti new file mode 100644 index 000000000..64d326702 Binary files /dev/null and b/nwnds_module/dyec28.uti differ diff --git a/nwnds_module/dyec29.uti b/nwnds_module/dyec29.uti new file mode 100644 index 000000000..5fdacd897 Binary files /dev/null and b/nwnds_module/dyec29.uti differ diff --git a/nwnds_module/dyec30.uti b/nwnds_module/dyec30.uti new file mode 100644 index 000000000..70f8522c6 Binary files /dev/null and b/nwnds_module/dyec30.uti differ diff --git a/nwnds_module/dyec31.uti b/nwnds_module/dyec31.uti new file mode 100644 index 000000000..a0e1eb2fe Binary files /dev/null and b/nwnds_module/dyec31.uti differ diff --git a/nwnds_module/dyec32.uti b/nwnds_module/dyec32.uti new file mode 100644 index 000000000..43769b85c Binary files /dev/null and b/nwnds_module/dyec32.uti differ diff --git a/nwnds_module/dyec33.uti b/nwnds_module/dyec33.uti new file mode 100644 index 000000000..e7e660333 Binary files /dev/null and b/nwnds_module/dyec33.uti differ diff --git a/nwnds_module/dyec34.uti b/nwnds_module/dyec34.uti new file mode 100644 index 000000000..4b8b7e1a0 Binary files /dev/null and b/nwnds_module/dyec34.uti differ diff --git a/nwnds_module/dyec35.uti b/nwnds_module/dyec35.uti new file mode 100644 index 000000000..dca57bcca Binary files /dev/null and b/nwnds_module/dyec35.uti differ diff --git a/nwnds_module/dyec36.uti b/nwnds_module/dyec36.uti new file mode 100644 index 000000000..5fbf3616e Binary files /dev/null and b/nwnds_module/dyec36.uti differ diff --git a/nwnds_module/dyec37.uti b/nwnds_module/dyec37.uti new file mode 100644 index 000000000..4ab1df01e Binary files /dev/null and b/nwnds_module/dyec37.uti differ diff --git a/nwnds_module/dyec38.uti b/nwnds_module/dyec38.uti new file mode 100644 index 000000000..41d26b9ae Binary files /dev/null and b/nwnds_module/dyec38.uti differ diff --git a/nwnds_module/dyec39.uti b/nwnds_module/dyec39.uti new file mode 100644 index 000000000..70cb9ca55 Binary files /dev/null and b/nwnds_module/dyec39.uti differ diff --git a/nwnds_module/dyec40.uti b/nwnds_module/dyec40.uti new file mode 100644 index 000000000..ec21d73e3 Binary files /dev/null and b/nwnds_module/dyec40.uti differ diff --git a/nwnds_module/dyec41.uti b/nwnds_module/dyec41.uti new file mode 100644 index 000000000..9558d1b5b Binary files /dev/null and b/nwnds_module/dyec41.uti differ diff --git a/nwnds_module/dyec42.uti b/nwnds_module/dyec42.uti new file mode 100644 index 000000000..f2472355b Binary files /dev/null and b/nwnds_module/dyec42.uti differ diff --git a/nwnds_module/dyec43.uti b/nwnds_module/dyec43.uti new file mode 100644 index 000000000..15391ff17 Binary files /dev/null and b/nwnds_module/dyec43.uti differ diff --git a/nwnds_module/dyec44.uti b/nwnds_module/dyec44.uti new file mode 100644 index 000000000..0b85e09e2 Binary files /dev/null and b/nwnds_module/dyec44.uti differ diff --git a/nwnds_module/dyec45.uti b/nwnds_module/dyec45.uti new file mode 100644 index 000000000..fc3902f93 Binary files /dev/null and b/nwnds_module/dyec45.uti differ diff --git a/nwnds_module/dyec46.uti b/nwnds_module/dyec46.uti new file mode 100644 index 000000000..6415f5735 Binary files /dev/null and b/nwnds_module/dyec46.uti differ diff --git a/nwnds_module/dyec47.uti b/nwnds_module/dyec47.uti new file mode 100644 index 000000000..e845b52dc Binary files /dev/null and b/nwnds_module/dyec47.uti differ diff --git a/nwnds_module/dyec48.uti b/nwnds_module/dyec48.uti new file mode 100644 index 000000000..f7b44dcce Binary files /dev/null and b/nwnds_module/dyec48.uti differ diff --git a/nwnds_module/dyec49.uti b/nwnds_module/dyec49.uti new file mode 100644 index 000000000..394dbfc43 Binary files /dev/null and b/nwnds_module/dyec49.uti differ diff --git a/nwnds_module/dyec50.uti b/nwnds_module/dyec50.uti new file mode 100644 index 000000000..2fd7be1bb Binary files /dev/null and b/nwnds_module/dyec50.uti differ diff --git a/nwnds_module/dyec51.uti b/nwnds_module/dyec51.uti new file mode 100644 index 000000000..08c74ed29 Binary files /dev/null and b/nwnds_module/dyec51.uti differ diff --git a/nwnds_module/dyec52.uti b/nwnds_module/dyec52.uti new file mode 100644 index 000000000..c67bca637 Binary files /dev/null and b/nwnds_module/dyec52.uti differ diff --git a/nwnds_module/dyec53.uti b/nwnds_module/dyec53.uti new file mode 100644 index 000000000..895c7ef4e Binary files /dev/null and b/nwnds_module/dyec53.uti differ diff --git a/nwnds_module/dyec54.uti b/nwnds_module/dyec54.uti new file mode 100644 index 000000000..097ab2312 Binary files /dev/null and b/nwnds_module/dyec54.uti differ diff --git a/nwnds_module/dyec55.uti b/nwnds_module/dyec55.uti new file mode 100644 index 000000000..cb59cfcb9 Binary files /dev/null and b/nwnds_module/dyec55.uti differ diff --git a/nwnds_module/dyec56.uti b/nwnds_module/dyec56.uti new file mode 100644 index 000000000..64cebd67a Binary files /dev/null and b/nwnds_module/dyec56.uti differ diff --git a/nwnds_module/dyec57.uti b/nwnds_module/dyec57.uti new file mode 100644 index 000000000..68c8f0905 Binary files /dev/null and b/nwnds_module/dyec57.uti differ diff --git a/nwnds_module/dyec58.uti b/nwnds_module/dyec58.uti new file mode 100644 index 000000000..134e18612 Binary files /dev/null and b/nwnds_module/dyec58.uti differ diff --git a/nwnds_module/dyec59.uti b/nwnds_module/dyec59.uti new file mode 100644 index 000000000..539fd782d Binary files /dev/null and b/nwnds_module/dyec59.uti differ diff --git a/nwnds_module/dyec60.uti b/nwnds_module/dyec60.uti new file mode 100644 index 000000000..85022cb27 Binary files /dev/null and b/nwnds_module/dyec60.uti differ diff --git a/nwnds_module/dyec61.uti b/nwnds_module/dyec61.uti new file mode 100644 index 000000000..3e793d6cd Binary files /dev/null and b/nwnds_module/dyec61.uti differ diff --git a/nwnds_module/dyec62.uti b/nwnds_module/dyec62.uti new file mode 100644 index 000000000..a54544c44 Binary files /dev/null and b/nwnds_module/dyec62.uti differ diff --git a/nwnds_module/dyec63.uti b/nwnds_module/dyec63.uti new file mode 100644 index 000000000..761560667 Binary files /dev/null and b/nwnds_module/dyec63.uti differ diff --git a/nwnds_module/dyel00.uti b/nwnds_module/dyel00.uti new file mode 100644 index 000000000..f127ce699 Binary files /dev/null and b/nwnds_module/dyel00.uti differ diff --git a/nwnds_module/dyel01.uti b/nwnds_module/dyel01.uti new file mode 100644 index 000000000..1cf8bbb36 Binary files /dev/null and b/nwnds_module/dyel01.uti differ diff --git a/nwnds_module/dyel014.uti b/nwnds_module/dyel014.uti new file mode 100644 index 000000000..246463b3f Binary files /dev/null and b/nwnds_module/dyel014.uti differ diff --git a/nwnds_module/dyel02.uti b/nwnds_module/dyel02.uti new file mode 100644 index 000000000..f79e67975 Binary files /dev/null and b/nwnds_module/dyel02.uti differ diff --git a/nwnds_module/dyel03.uti b/nwnds_module/dyel03.uti new file mode 100644 index 000000000..9c21e8530 Binary files /dev/null and b/nwnds_module/dyel03.uti differ diff --git a/nwnds_module/dyel04.uti b/nwnds_module/dyel04.uti new file mode 100644 index 000000000..b29cfbc77 Binary files /dev/null and b/nwnds_module/dyel04.uti differ diff --git a/nwnds_module/dyel05.uti b/nwnds_module/dyel05.uti new file mode 100644 index 000000000..9c8d8d392 Binary files /dev/null and b/nwnds_module/dyel05.uti differ diff --git a/nwnds_module/dyel06.uti b/nwnds_module/dyel06.uti new file mode 100644 index 000000000..50cd085ff Binary files /dev/null and b/nwnds_module/dyel06.uti differ diff --git a/nwnds_module/dyel07.uti b/nwnds_module/dyel07.uti new file mode 100644 index 000000000..9220e803c Binary files /dev/null and b/nwnds_module/dyel07.uti differ diff --git a/nwnds_module/dyel08.uti b/nwnds_module/dyel08.uti new file mode 100644 index 000000000..395e35a73 Binary files /dev/null and b/nwnds_module/dyel08.uti differ diff --git a/nwnds_module/dyel09.uti b/nwnds_module/dyel09.uti new file mode 100644 index 000000000..7786340d1 Binary files /dev/null and b/nwnds_module/dyel09.uti differ diff --git a/nwnds_module/dyel10.uti b/nwnds_module/dyel10.uti new file mode 100644 index 000000000..1ff51bc07 Binary files /dev/null and b/nwnds_module/dyel10.uti differ diff --git a/nwnds_module/dyel11.uti b/nwnds_module/dyel11.uti new file mode 100644 index 000000000..cca3fcc1c Binary files /dev/null and b/nwnds_module/dyel11.uti differ diff --git a/nwnds_module/dyel12.uti b/nwnds_module/dyel12.uti new file mode 100644 index 000000000..015cafa9b Binary files /dev/null and b/nwnds_module/dyel12.uti differ diff --git a/nwnds_module/dyel13.uti b/nwnds_module/dyel13.uti new file mode 100644 index 000000000..f2e5025ed Binary files /dev/null and b/nwnds_module/dyel13.uti differ diff --git a/nwnds_module/dyel15.uti b/nwnds_module/dyel15.uti new file mode 100644 index 000000000..bd6a0fdd5 Binary files /dev/null and b/nwnds_module/dyel15.uti differ diff --git a/nwnds_module/dyel16.uti b/nwnds_module/dyel16.uti new file mode 100644 index 000000000..08a9d2e8e Binary files /dev/null and b/nwnds_module/dyel16.uti differ diff --git a/nwnds_module/dyel17.uti b/nwnds_module/dyel17.uti new file mode 100644 index 000000000..6144eb41a Binary files /dev/null and b/nwnds_module/dyel17.uti differ diff --git a/nwnds_module/dyel18.uti b/nwnds_module/dyel18.uti new file mode 100644 index 000000000..00133e3ed Binary files /dev/null and b/nwnds_module/dyel18.uti differ diff --git a/nwnds_module/dyel19.uti b/nwnds_module/dyel19.uti new file mode 100644 index 000000000..d74a65c8b Binary files /dev/null and b/nwnds_module/dyel19.uti differ diff --git a/nwnds_module/dyel20.uti b/nwnds_module/dyel20.uti new file mode 100644 index 000000000..aad64b09e Binary files /dev/null and b/nwnds_module/dyel20.uti differ diff --git a/nwnds_module/dyel21.uti b/nwnds_module/dyel21.uti new file mode 100644 index 000000000..f2ae6cc53 Binary files /dev/null and b/nwnds_module/dyel21.uti differ diff --git a/nwnds_module/dyel22.uti b/nwnds_module/dyel22.uti new file mode 100644 index 000000000..08b0dc794 Binary files /dev/null and b/nwnds_module/dyel22.uti differ diff --git a/nwnds_module/dyel23.uti b/nwnds_module/dyel23.uti new file mode 100644 index 000000000..9548036dc Binary files /dev/null and b/nwnds_module/dyel23.uti differ diff --git a/nwnds_module/dyel24.uti b/nwnds_module/dyel24.uti new file mode 100644 index 000000000..26b25c9fe Binary files /dev/null and b/nwnds_module/dyel24.uti differ diff --git a/nwnds_module/dyel25.uti b/nwnds_module/dyel25.uti new file mode 100644 index 000000000..39d3f77c6 Binary files /dev/null and b/nwnds_module/dyel25.uti differ diff --git a/nwnds_module/dyel26.uti b/nwnds_module/dyel26.uti new file mode 100644 index 000000000..deca8fd21 Binary files /dev/null and b/nwnds_module/dyel26.uti differ diff --git a/nwnds_module/dyel27.uti b/nwnds_module/dyel27.uti new file mode 100644 index 000000000..a9e0f5ae9 Binary files /dev/null and b/nwnds_module/dyel27.uti differ diff --git a/nwnds_module/dyel28.uti b/nwnds_module/dyel28.uti new file mode 100644 index 000000000..730cac6e6 Binary files /dev/null and b/nwnds_module/dyel28.uti differ diff --git a/nwnds_module/dyel29.uti b/nwnds_module/dyel29.uti new file mode 100644 index 000000000..66e443a50 Binary files /dev/null and b/nwnds_module/dyel29.uti differ diff --git a/nwnds_module/dyel30.uti b/nwnds_module/dyel30.uti new file mode 100644 index 000000000..33ac3a6de Binary files /dev/null and b/nwnds_module/dyel30.uti differ diff --git a/nwnds_module/dyel31.uti b/nwnds_module/dyel31.uti new file mode 100644 index 000000000..7eb8a93a4 Binary files /dev/null and b/nwnds_module/dyel31.uti differ diff --git a/nwnds_module/dyel32.uti b/nwnds_module/dyel32.uti new file mode 100644 index 000000000..c6611430f Binary files /dev/null and b/nwnds_module/dyel32.uti differ diff --git a/nwnds_module/dyel33.uti b/nwnds_module/dyel33.uti new file mode 100644 index 000000000..daecb741f Binary files /dev/null and b/nwnds_module/dyel33.uti differ diff --git a/nwnds_module/dyel34.uti b/nwnds_module/dyel34.uti new file mode 100644 index 000000000..b771a7dd9 Binary files /dev/null and b/nwnds_module/dyel34.uti differ diff --git a/nwnds_module/dyel35.uti b/nwnds_module/dyel35.uti new file mode 100644 index 000000000..3183bdc5b Binary files /dev/null and b/nwnds_module/dyel35.uti differ diff --git a/nwnds_module/dyel36.uti b/nwnds_module/dyel36.uti new file mode 100644 index 000000000..d8361e229 Binary files /dev/null and b/nwnds_module/dyel36.uti differ diff --git a/nwnds_module/dyel37.uti b/nwnds_module/dyel37.uti new file mode 100644 index 000000000..9fea7443b Binary files /dev/null and b/nwnds_module/dyel37.uti differ diff --git a/nwnds_module/dyel38.uti b/nwnds_module/dyel38.uti new file mode 100644 index 000000000..7195b527c Binary files /dev/null and b/nwnds_module/dyel38.uti differ diff --git a/nwnds_module/dyel39.uti b/nwnds_module/dyel39.uti new file mode 100644 index 000000000..ea8ecb70a Binary files /dev/null and b/nwnds_module/dyel39.uti differ diff --git a/nwnds_module/dyel40.uti b/nwnds_module/dyel40.uti new file mode 100644 index 000000000..55a7175be Binary files /dev/null and b/nwnds_module/dyel40.uti differ diff --git a/nwnds_module/dyel41.uti b/nwnds_module/dyel41.uti new file mode 100644 index 000000000..c9a2671b4 Binary files /dev/null and b/nwnds_module/dyel41.uti differ diff --git a/nwnds_module/dyel42.uti b/nwnds_module/dyel42.uti new file mode 100644 index 000000000..f52401860 Binary files /dev/null and b/nwnds_module/dyel42.uti differ diff --git a/nwnds_module/dyel43.uti b/nwnds_module/dyel43.uti new file mode 100644 index 000000000..0971af701 Binary files /dev/null and b/nwnds_module/dyel43.uti differ diff --git a/nwnds_module/dyel44.uti b/nwnds_module/dyel44.uti new file mode 100644 index 000000000..bdb8428cd Binary files /dev/null and b/nwnds_module/dyel44.uti differ diff --git a/nwnds_module/dyel45.uti b/nwnds_module/dyel45.uti new file mode 100644 index 000000000..eb21ebfb1 Binary files /dev/null and b/nwnds_module/dyel45.uti differ diff --git a/nwnds_module/dyel46.uti b/nwnds_module/dyel46.uti new file mode 100644 index 000000000..fe52badfb Binary files /dev/null and b/nwnds_module/dyel46.uti differ diff --git a/nwnds_module/dyel47.uti b/nwnds_module/dyel47.uti new file mode 100644 index 000000000..28b337bd6 Binary files /dev/null and b/nwnds_module/dyel47.uti differ diff --git a/nwnds_module/dyel48.uti b/nwnds_module/dyel48.uti new file mode 100644 index 000000000..253cc34f6 Binary files /dev/null and b/nwnds_module/dyel48.uti differ diff --git a/nwnds_module/dyel49.uti b/nwnds_module/dyel49.uti new file mode 100644 index 000000000..5b60026d9 Binary files /dev/null and b/nwnds_module/dyel49.uti differ diff --git a/nwnds_module/dyel50.uti b/nwnds_module/dyel50.uti new file mode 100644 index 000000000..3023adfa0 Binary files /dev/null and b/nwnds_module/dyel50.uti differ diff --git a/nwnds_module/dyel51.uti b/nwnds_module/dyel51.uti new file mode 100644 index 000000000..fbf1528fe Binary files /dev/null and b/nwnds_module/dyel51.uti differ diff --git a/nwnds_module/dyel52.uti b/nwnds_module/dyel52.uti new file mode 100644 index 000000000..51ad2b9cc Binary files /dev/null and b/nwnds_module/dyel52.uti differ diff --git a/nwnds_module/dyel53.uti b/nwnds_module/dyel53.uti new file mode 100644 index 000000000..09ffc896f Binary files /dev/null and b/nwnds_module/dyel53.uti differ diff --git a/nwnds_module/dyel54.uti b/nwnds_module/dyel54.uti new file mode 100644 index 000000000..9a3ab5867 Binary files /dev/null and b/nwnds_module/dyel54.uti differ diff --git a/nwnds_module/dyel55.uti b/nwnds_module/dyel55.uti new file mode 100644 index 000000000..526520900 Binary files /dev/null and b/nwnds_module/dyel55.uti differ diff --git a/nwnds_module/dyel56.uti b/nwnds_module/dyel56.uti new file mode 100644 index 000000000..ede9e97b0 Binary files /dev/null and b/nwnds_module/dyel56.uti differ diff --git a/nwnds_module/dyel57.uti b/nwnds_module/dyel57.uti new file mode 100644 index 000000000..279c2efd1 Binary files /dev/null and b/nwnds_module/dyel57.uti differ diff --git a/nwnds_module/dyel58.uti b/nwnds_module/dyel58.uti new file mode 100644 index 000000000..311d3e482 Binary files /dev/null and b/nwnds_module/dyel58.uti differ diff --git a/nwnds_module/dyel59.uti b/nwnds_module/dyel59.uti new file mode 100644 index 000000000..09baa9c0f Binary files /dev/null and b/nwnds_module/dyel59.uti differ diff --git a/nwnds_module/dyel60.uti b/nwnds_module/dyel60.uti new file mode 100644 index 000000000..f902f652a Binary files /dev/null and b/nwnds_module/dyel60.uti differ diff --git a/nwnds_module/dyel61.uti b/nwnds_module/dyel61.uti new file mode 100644 index 000000000..23126c842 Binary files /dev/null and b/nwnds_module/dyel61.uti differ diff --git a/nwnds_module/dyel62.uti b/nwnds_module/dyel62.uti new file mode 100644 index 000000000..3d96f4561 Binary files /dev/null and b/nwnds_module/dyel62.uti differ diff --git a/nwnds_module/dyel63.uti b/nwnds_module/dyel63.uti new file mode 100644 index 000000000..8b610b22c Binary files /dev/null and b/nwnds_module/dyel63.uti differ diff --git a/nwnds_module/dyem00.uti b/nwnds_module/dyem00.uti new file mode 100644 index 000000000..129b3707b Binary files /dev/null and b/nwnds_module/dyem00.uti differ diff --git a/nwnds_module/dyem01.uti b/nwnds_module/dyem01.uti new file mode 100644 index 000000000..27e204578 Binary files /dev/null and b/nwnds_module/dyem01.uti differ diff --git a/nwnds_module/dyem02.uti b/nwnds_module/dyem02.uti new file mode 100644 index 000000000..4139a6540 Binary files /dev/null and b/nwnds_module/dyem02.uti differ diff --git a/nwnds_module/dyem026.uti b/nwnds_module/dyem026.uti new file mode 100644 index 000000000..1a3a9febb Binary files /dev/null and b/nwnds_module/dyem026.uti differ diff --git a/nwnds_module/dyem03.uti b/nwnds_module/dyem03.uti new file mode 100644 index 000000000..51ec15d98 Binary files /dev/null and b/nwnds_module/dyem03.uti differ diff --git a/nwnds_module/dyem04.uti b/nwnds_module/dyem04.uti new file mode 100644 index 000000000..411832ffd Binary files /dev/null and b/nwnds_module/dyem04.uti differ diff --git a/nwnds_module/dyem05.uti b/nwnds_module/dyem05.uti new file mode 100644 index 000000000..9f9a5c983 Binary files /dev/null and b/nwnds_module/dyem05.uti differ diff --git a/nwnds_module/dyem06.uti b/nwnds_module/dyem06.uti new file mode 100644 index 000000000..abafc5785 Binary files /dev/null and b/nwnds_module/dyem06.uti differ diff --git a/nwnds_module/dyem07.uti b/nwnds_module/dyem07.uti new file mode 100644 index 000000000..1ea5a37f6 Binary files /dev/null and b/nwnds_module/dyem07.uti differ diff --git a/nwnds_module/dyem08.uti b/nwnds_module/dyem08.uti new file mode 100644 index 000000000..28de0fd57 Binary files /dev/null and b/nwnds_module/dyem08.uti differ diff --git a/nwnds_module/dyem09.uti b/nwnds_module/dyem09.uti new file mode 100644 index 000000000..bce4bff05 Binary files /dev/null and b/nwnds_module/dyem09.uti differ diff --git a/nwnds_module/dyem10.uti b/nwnds_module/dyem10.uti new file mode 100644 index 000000000..dcbee13ca Binary files /dev/null and b/nwnds_module/dyem10.uti differ diff --git a/nwnds_module/dyem11.uti b/nwnds_module/dyem11.uti new file mode 100644 index 000000000..c32eb4c68 Binary files /dev/null and b/nwnds_module/dyem11.uti differ diff --git a/nwnds_module/dyem12.uti b/nwnds_module/dyem12.uti new file mode 100644 index 000000000..313086eff Binary files /dev/null and b/nwnds_module/dyem12.uti differ diff --git a/nwnds_module/dyem13.uti b/nwnds_module/dyem13.uti new file mode 100644 index 000000000..21334d9e4 Binary files /dev/null and b/nwnds_module/dyem13.uti differ diff --git a/nwnds_module/dyem14.uti b/nwnds_module/dyem14.uti new file mode 100644 index 000000000..64ea7263d Binary files /dev/null and b/nwnds_module/dyem14.uti differ diff --git a/nwnds_module/dyem15.uti b/nwnds_module/dyem15.uti new file mode 100644 index 000000000..ff39372fe Binary files /dev/null and b/nwnds_module/dyem15.uti differ diff --git a/nwnds_module/dyem16.uti b/nwnds_module/dyem16.uti new file mode 100644 index 000000000..997c689fc Binary files /dev/null and b/nwnds_module/dyem16.uti differ diff --git a/nwnds_module/dyem17.uti b/nwnds_module/dyem17.uti new file mode 100644 index 000000000..b00c461c7 Binary files /dev/null and b/nwnds_module/dyem17.uti differ diff --git a/nwnds_module/dyem18.uti b/nwnds_module/dyem18.uti new file mode 100644 index 000000000..d7bad7298 Binary files /dev/null and b/nwnds_module/dyem18.uti differ diff --git a/nwnds_module/dyem19.uti b/nwnds_module/dyem19.uti new file mode 100644 index 000000000..6e0d7e191 Binary files /dev/null and b/nwnds_module/dyem19.uti differ diff --git a/nwnds_module/dyem20.uti b/nwnds_module/dyem20.uti new file mode 100644 index 000000000..87f13adc3 Binary files /dev/null and b/nwnds_module/dyem20.uti differ diff --git a/nwnds_module/dyem21.uti b/nwnds_module/dyem21.uti new file mode 100644 index 000000000..d47bc34f7 Binary files /dev/null and b/nwnds_module/dyem21.uti differ diff --git a/nwnds_module/dyem22.uti b/nwnds_module/dyem22.uti new file mode 100644 index 000000000..6749577d0 Binary files /dev/null and b/nwnds_module/dyem22.uti differ diff --git a/nwnds_module/dyem23.uti b/nwnds_module/dyem23.uti new file mode 100644 index 000000000..a66ca257c Binary files /dev/null and b/nwnds_module/dyem23.uti differ diff --git a/nwnds_module/dyem24.uti b/nwnds_module/dyem24.uti new file mode 100644 index 000000000..6dfc018d4 Binary files /dev/null and b/nwnds_module/dyem24.uti differ diff --git a/nwnds_module/dyem25.uti b/nwnds_module/dyem25.uti new file mode 100644 index 000000000..1421fcfd5 Binary files /dev/null and b/nwnds_module/dyem25.uti differ diff --git a/nwnds_module/dyem26.uti b/nwnds_module/dyem26.uti new file mode 100644 index 000000000..4ee1036f4 Binary files /dev/null and b/nwnds_module/dyem26.uti differ diff --git a/nwnds_module/dyem27.uti b/nwnds_module/dyem27.uti new file mode 100644 index 000000000..54eff5255 Binary files /dev/null and b/nwnds_module/dyem27.uti differ diff --git a/nwnds_module/dyem28.uti b/nwnds_module/dyem28.uti new file mode 100644 index 000000000..ce2337cdb Binary files /dev/null and b/nwnds_module/dyem28.uti differ diff --git a/nwnds_module/dyem29.uti b/nwnds_module/dyem29.uti new file mode 100644 index 000000000..f54bac072 Binary files /dev/null and b/nwnds_module/dyem29.uti differ diff --git a/nwnds_module/dyem30.uti b/nwnds_module/dyem30.uti new file mode 100644 index 000000000..c22e4f6f5 Binary files /dev/null and b/nwnds_module/dyem30.uti differ diff --git a/nwnds_module/dyem31.uti b/nwnds_module/dyem31.uti new file mode 100644 index 000000000..f21ce1d90 Binary files /dev/null and b/nwnds_module/dyem31.uti differ diff --git a/nwnds_module/dyem32.uti b/nwnds_module/dyem32.uti new file mode 100644 index 000000000..39383f8e5 Binary files /dev/null and b/nwnds_module/dyem32.uti differ diff --git a/nwnds_module/dyem33.uti b/nwnds_module/dyem33.uti new file mode 100644 index 000000000..d84601319 Binary files /dev/null and b/nwnds_module/dyem33.uti differ diff --git a/nwnds_module/dyem34.uti b/nwnds_module/dyem34.uti new file mode 100644 index 000000000..9944df27b Binary files /dev/null and b/nwnds_module/dyem34.uti differ diff --git a/nwnds_module/dyem35.uti b/nwnds_module/dyem35.uti new file mode 100644 index 000000000..eeb9f49d1 Binary files /dev/null and b/nwnds_module/dyem35.uti differ diff --git a/nwnds_module/dyem36.uti b/nwnds_module/dyem36.uti new file mode 100644 index 000000000..23ddb2d86 Binary files /dev/null and b/nwnds_module/dyem36.uti differ diff --git a/nwnds_module/dyem37.uti b/nwnds_module/dyem37.uti new file mode 100644 index 000000000..0cd31ad6e Binary files /dev/null and b/nwnds_module/dyem37.uti differ diff --git a/nwnds_module/dyem38.uti b/nwnds_module/dyem38.uti new file mode 100644 index 000000000..7bbf0adb5 Binary files /dev/null and b/nwnds_module/dyem38.uti differ diff --git a/nwnds_module/dyem39.uti b/nwnds_module/dyem39.uti new file mode 100644 index 000000000..1ec216ebf Binary files /dev/null and b/nwnds_module/dyem39.uti differ diff --git a/nwnds_module/dyem40.uti b/nwnds_module/dyem40.uti new file mode 100644 index 000000000..a6d4f6dbb Binary files /dev/null and b/nwnds_module/dyem40.uti differ diff --git a/nwnds_module/dyem41.uti b/nwnds_module/dyem41.uti new file mode 100644 index 000000000..5d1d43269 Binary files /dev/null and b/nwnds_module/dyem41.uti differ diff --git a/nwnds_module/dyem42.uti b/nwnds_module/dyem42.uti new file mode 100644 index 000000000..cacd13a76 Binary files /dev/null and b/nwnds_module/dyem42.uti differ diff --git a/nwnds_module/dyem43.uti b/nwnds_module/dyem43.uti new file mode 100644 index 000000000..84e97a870 Binary files /dev/null and b/nwnds_module/dyem43.uti differ diff --git a/nwnds_module/dyem44.uti b/nwnds_module/dyem44.uti new file mode 100644 index 000000000..f7edd9a8d Binary files /dev/null and b/nwnds_module/dyem44.uti differ diff --git a/nwnds_module/dyem45.uti b/nwnds_module/dyem45.uti new file mode 100644 index 000000000..dd56e9ebb Binary files /dev/null and b/nwnds_module/dyem45.uti differ diff --git a/nwnds_module/dyem46.uti b/nwnds_module/dyem46.uti new file mode 100644 index 000000000..3cc3de2f0 Binary files /dev/null and b/nwnds_module/dyem46.uti differ diff --git a/nwnds_module/dyem47.uti b/nwnds_module/dyem47.uti new file mode 100644 index 000000000..c6266c119 Binary files /dev/null and b/nwnds_module/dyem47.uti differ diff --git a/nwnds_module/dyem48.uti b/nwnds_module/dyem48.uti new file mode 100644 index 000000000..9a2d03205 Binary files /dev/null and b/nwnds_module/dyem48.uti differ diff --git a/nwnds_module/dyem49.uti b/nwnds_module/dyem49.uti new file mode 100644 index 000000000..2598c9bfc Binary files /dev/null and b/nwnds_module/dyem49.uti differ diff --git a/nwnds_module/dyem50.uti b/nwnds_module/dyem50.uti new file mode 100644 index 000000000..90ba9a6e0 Binary files /dev/null and b/nwnds_module/dyem50.uti differ diff --git a/nwnds_module/dyem51.uti b/nwnds_module/dyem51.uti new file mode 100644 index 000000000..5e7c504b7 Binary files /dev/null and b/nwnds_module/dyem51.uti differ diff --git a/nwnds_module/dyem52.uti b/nwnds_module/dyem52.uti new file mode 100644 index 000000000..03aebe5d6 Binary files /dev/null and b/nwnds_module/dyem52.uti differ diff --git a/nwnds_module/dyem53.uti b/nwnds_module/dyem53.uti new file mode 100644 index 000000000..371dfc71e Binary files /dev/null and b/nwnds_module/dyem53.uti differ diff --git a/nwnds_module/dyem54.uti b/nwnds_module/dyem54.uti new file mode 100644 index 000000000..437cff044 Binary files /dev/null and b/nwnds_module/dyem54.uti differ diff --git a/nwnds_module/dyem55.uti b/nwnds_module/dyem55.uti new file mode 100644 index 000000000..2ca038feb Binary files /dev/null and b/nwnds_module/dyem55.uti differ diff --git a/nwnds_module/dyem60.uti b/nwnds_module/dyem60.uti new file mode 100644 index 000000000..e0a9dbe0a Binary files /dev/null and b/nwnds_module/dyem60.uti differ diff --git a/nwnds_module/dyem61.uti b/nwnds_module/dyem61.uti new file mode 100644 index 000000000..be92791eb Binary files /dev/null and b/nwnds_module/dyem61.uti differ diff --git a/nwnds_module/dyem62.uti b/nwnds_module/dyem62.uti new file mode 100644 index 000000000..a9cbcb556 Binary files /dev/null and b/nwnds_module/dyem62.uti differ diff --git a/nwnds_module/dyem63.uti b/nwnds_module/dyem63.uti new file mode 100644 index 000000000..e3b2419bc Binary files /dev/null and b/nwnds_module/dyem63.uti differ diff --git a/nwnds_module/earth_cleric.ncs b/nwnds_module/earth_cleric.ncs new file mode 100644 index 000000000..15a4d7558 Binary files /dev/null and b/nwnds_module/earth_cleric.ncs differ diff --git a/nwnds_module/earth_cleric.nss b/nwnds_module/earth_cleric.nss new file mode 100644 index 000000000..77b459114 --- /dev/null +++ b/nwnds_module/earth_cleric.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they don't have Earth domain, unequip the item + if(!GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/earthdrakebite.uti b/nwnds_module/earthdrakebite.uti new file mode 100644 index 000000000..5c9af7724 Binary files /dev/null and b/nwnds_module/earthdrakebite.uti differ diff --git a/nwnds_module/earthdrakeclaw.uti b/nwnds_module/earthdrakeclaw.uti new file mode 100644 index 000000000..b940d5edb Binary files /dev/null and b/nwnds_module/earthdrakeclaw.uti differ diff --git a/nwnds_module/earthdrakeprops.uti b/nwnds_module/earthdrakeprops.uti new file mode 100644 index 000000000..3560a76f7 Binary files /dev/null and b/nwnds_module/earthdrakeprops.uti differ diff --git a/nwnds_module/earthdraketail.uti b/nwnds_module/earthdraketail.uti new file mode 100644 index 000000000..4b47a40b6 Binary files /dev/null and b/nwnds_module/earthdraketail.uti differ diff --git a/nwnds_module/ebonsentslam.uti b/nwnds_module/ebonsentslam.uti new file mode 100644 index 000000000..01fd6bc5d Binary files /dev/null and b/nwnds_module/ebonsentslam.uti differ diff --git a/nwnds_module/ebonsenttoga.uti b/nwnds_module/ebonsenttoga.uti new file mode 100644 index 000000000..92ec7a191 Binary files /dev/null and b/nwnds_module/ebonsenttoga.uti differ diff --git a/nwnds_module/ee_carnal_forge.are b/nwnds_module/ee_carnal_forge.are new file mode 100644 index 000000000..7cc463195 Binary files /dev/null and b/nwnds_module/ee_carnal_forge.are differ diff --git a/nwnds_module/ee_carnal_forge.gic b/nwnds_module/ee_carnal_forge.gic new file mode 100644 index 000000000..f4c3d9c90 Binary files /dev/null and b/nwnds_module/ee_carnal_forge.gic differ diff --git a/nwnds_module/ee_carnal_forge.git b/nwnds_module/ee_carnal_forge.git new file mode 100644 index 000000000..c119f63e6 Binary files /dev/null and b/nwnds_module/ee_carnal_forge.git differ diff --git a/nwnds_module/ee_emo_abattior.are b/nwnds_module/ee_emo_abattior.are new file mode 100644 index 000000000..dd14db63f Binary files /dev/null and b/nwnds_module/ee_emo_abattior.are differ diff --git a/nwnds_module/ee_emo_abattior.gic b/nwnds_module/ee_emo_abattior.gic new file mode 100644 index 000000000..46a2b318c Binary files /dev/null and b/nwnds_module/ee_emo_abattior.gic differ diff --git a/nwnds_module/ee_emo_abattior.git b/nwnds_module/ee_emo_abattior.git new file mode 100644 index 000000000..22cbe8604 Binary files /dev/null and b/nwnds_module/ee_emo_abattior.git differ diff --git a/nwnds_module/ee_enigma_rift.are b/nwnds_module/ee_enigma_rift.are new file mode 100644 index 000000000..353b91369 Binary files /dev/null and b/nwnds_module/ee_enigma_rift.are differ diff --git a/nwnds_module/ee_enigma_rift.gic b/nwnds_module/ee_enigma_rift.gic new file mode 100644 index 000000000..304775044 Binary files /dev/null and b/nwnds_module/ee_enigma_rift.gic differ diff --git a/nwnds_module/ee_enigma_rift.git b/nwnds_module/ee_enigma_rift.git new file mode 100644 index 000000000..e63bc3f0f Binary files /dev/null and b/nwnds_module/ee_enigma_rift.git differ diff --git a/nwnds_module/ee_hellhole.are b/nwnds_module/ee_hellhole.are new file mode 100644 index 000000000..c32ae0a9f Binary files /dev/null and b/nwnds_module/ee_hellhole.are differ diff --git a/nwnds_module/ee_hellhole.gic b/nwnds_module/ee_hellhole.gic new file mode 100644 index 000000000..6a00c811c Binary files /dev/null and b/nwnds_module/ee_hellhole.gic differ diff --git a/nwnds_module/ee_hellhole.git b/nwnds_module/ee_hellhole.git new file mode 100644 index 000000000..d5f8204a9 Binary files /dev/null and b/nwnds_module/ee_hellhole.git differ diff --git a/nwnds_module/ee_life_end_path.are b/nwnds_module/ee_life_end_path.are new file mode 100644 index 000000000..fcd5edc82 Binary files /dev/null and b/nwnds_module/ee_life_end_path.are differ diff --git a/nwnds_module/ee_life_end_path.gic b/nwnds_module/ee_life_end_path.gic new file mode 100644 index 000000000..e9b2fce00 Binary files /dev/null and b/nwnds_module/ee_life_end_path.gic differ diff --git a/nwnds_module/ee_life_end_path.git b/nwnds_module/ee_life_end_path.git new file mode 100644 index 000000000..e73232cbc Binary files /dev/null and b/nwnds_module/ee_life_end_path.git differ diff --git a/nwnds_module/ee_temple_within.are b/nwnds_module/ee_temple_within.are new file mode 100644 index 000000000..4fb7280ae Binary files /dev/null and b/nwnds_module/ee_temple_within.are differ diff --git a/nwnds_module/ee_temple_within.gic b/nwnds_module/ee_temple_within.gic new file mode 100644 index 000000000..5daa51644 Binary files /dev/null and b/nwnds_module/ee_temple_within.gic differ diff --git a/nwnds_module/ee_temple_within.git b/nwnds_module/ee_temple_within.git new file mode 100644 index 000000000..d7bb22d03 Binary files /dev/null and b/nwnds_module/ee_temple_within.git differ diff --git a/nwnds_module/ee_womb_chaos.are b/nwnds_module/ee_womb_chaos.are new file mode 100644 index 000000000..71a411dcc Binary files /dev/null and b/nwnds_module/ee_womb_chaos.are differ diff --git a/nwnds_module/ee_womb_chaos.gic b/nwnds_module/ee_womb_chaos.gic new file mode 100644 index 000000000..a84807178 Binary files /dev/null and b/nwnds_module/ee_womb_chaos.gic differ diff --git a/nwnds_module/ee_womb_chaos.git b/nwnds_module/ee_womb_chaos.git new file mode 100644 index 000000000..538847911 Binary files /dev/null and b/nwnds_module/ee_womb_chaos.git differ diff --git a/nwnds_module/efreeti001.utc b/nwnds_module/efreeti001.utc new file mode 100644 index 000000000..221442ed2 Binary files /dev/null and b/nwnds_module/efreeti001.utc differ diff --git a/nwnds_module/efreetiprops.uti b/nwnds_module/efreetiprops.uti new file mode 100644 index 000000000..db06bfc89 Binary files /dev/null and b/nwnds_module/efreetiprops.uti differ diff --git a/nwnds_module/efreetislam.uti b/nwnds_module/efreetislam.uti new file mode 100644 index 000000000..ce278d2c8 Binary files /dev/null and b/nwnds_module/efreetislam.uti differ diff --git a/nwnds_module/eldaviaragbite.uti b/nwnds_module/eldaviaragbite.uti new file mode 100644 index 000000000..4eba8cd03 Binary files /dev/null and b/nwnds_module/eldaviaragbite.uti differ diff --git a/nwnds_module/elearthelemhide.uti b/nwnds_module/elearthelemhide.uti new file mode 100644 index 000000000..fd2ca5370 Binary files /dev/null and b/nwnds_module/elearthelemhide.uti differ diff --git a/nwnds_module/elem_air_el001.utc b/nwnds_module/elem_air_el001.utc new file mode 100644 index 000000000..8c67ccea9 Binary files /dev/null and b/nwnds_module/elem_air_el001.utc differ diff --git a/nwnds_module/elem_air_gr001.utc b/nwnds_module/elem_air_gr001.utc new file mode 100644 index 000000000..6594894e0 Binary files /dev/null and b/nwnds_module/elem_air_gr001.utc differ diff --git a/nwnds_module/elem_air_hg001.utc b/nwnds_module/elem_air_hg001.utc new file mode 100644 index 000000000..ff2d112c4 Binary files /dev/null and b/nwnds_module/elem_air_hg001.utc differ diff --git a/nwnds_module/elem_air_lg001.utc b/nwnds_module/elem_air_lg001.utc new file mode 100644 index 000000000..9b5fd25a5 Binary files /dev/null and b/nwnds_module/elem_air_lg001.utc differ diff --git a/nwnds_module/elem_air_md001.utc b/nwnds_module/elem_air_md001.utc new file mode 100644 index 000000000..182ea67c0 Binary files /dev/null and b/nwnds_module/elem_air_md001.utc differ diff --git a/nwnds_module/elem_air_pr001.utc b/nwnds_module/elem_air_pr001.utc new file mode 100644 index 000000000..72c1a4be1 Binary files /dev/null and b/nwnds_module/elem_air_pr001.utc differ diff --git a/nwnds_module/elem_air_sm001.utc b/nwnds_module/elem_air_sm001.utc new file mode 100644 index 000000000..23f18c6c4 Binary files /dev/null and b/nwnds_module/elem_air_sm001.utc differ diff --git a/nwnds_module/elem_earth_el001.utc b/nwnds_module/elem_earth_el001.utc new file mode 100644 index 000000000..860dac9e2 Binary files /dev/null and b/nwnds_module/elem_earth_el001.utc differ diff --git a/nwnds_module/elem_earth_gr001.utc b/nwnds_module/elem_earth_gr001.utc new file mode 100644 index 000000000..990f07461 Binary files /dev/null and b/nwnds_module/elem_earth_gr001.utc differ diff --git a/nwnds_module/elem_earth_hg001.utc b/nwnds_module/elem_earth_hg001.utc new file mode 100644 index 000000000..f80982065 Binary files /dev/null and b/nwnds_module/elem_earth_hg001.utc differ diff --git a/nwnds_module/elem_earth_lg001.utc b/nwnds_module/elem_earth_lg001.utc new file mode 100644 index 000000000..82cb0669f Binary files /dev/null and b/nwnds_module/elem_earth_lg001.utc differ diff --git a/nwnds_module/elem_earth_md001.utc b/nwnds_module/elem_earth_md001.utc new file mode 100644 index 000000000..37b2ad3ab Binary files /dev/null and b/nwnds_module/elem_earth_md001.utc differ diff --git a/nwnds_module/elem_earth_pr001.utc b/nwnds_module/elem_earth_pr001.utc new file mode 100644 index 000000000..392c92dc7 Binary files /dev/null and b/nwnds_module/elem_earth_pr001.utc differ diff --git a/nwnds_module/elem_earth_sm001.utc b/nwnds_module/elem_earth_sm001.utc new file mode 100644 index 000000000..1016773e0 Binary files /dev/null and b/nwnds_module/elem_earth_sm001.utc differ diff --git a/nwnds_module/elem_fire_el001.utc b/nwnds_module/elem_fire_el001.utc new file mode 100644 index 000000000..88dd6db2b Binary files /dev/null and b/nwnds_module/elem_fire_el001.utc differ diff --git a/nwnds_module/elem_fire_gr001.utc b/nwnds_module/elem_fire_gr001.utc new file mode 100644 index 000000000..6179dda7d Binary files /dev/null and b/nwnds_module/elem_fire_gr001.utc differ diff --git a/nwnds_module/elem_fire_hg001.utc b/nwnds_module/elem_fire_hg001.utc new file mode 100644 index 000000000..fb9a0555b Binary files /dev/null and b/nwnds_module/elem_fire_hg001.utc differ diff --git a/nwnds_module/elem_fire_lg001.utc b/nwnds_module/elem_fire_lg001.utc new file mode 100644 index 000000000..963685d21 Binary files /dev/null and b/nwnds_module/elem_fire_lg001.utc differ diff --git a/nwnds_module/elem_fire_md001.utc b/nwnds_module/elem_fire_md001.utc new file mode 100644 index 000000000..e4a0ad442 Binary files /dev/null and b/nwnds_module/elem_fire_md001.utc differ diff --git a/nwnds_module/elem_fire_pr001.utc b/nwnds_module/elem_fire_pr001.utc new file mode 100644 index 000000000..bf9cdc9ce Binary files /dev/null and b/nwnds_module/elem_fire_pr001.utc differ diff --git a/nwnds_module/elem_fire_sm001.utc b/nwnds_module/elem_fire_sm001.utc new file mode 100644 index 000000000..1822cda8e Binary files /dev/null and b/nwnds_module/elem_fire_sm001.utc differ diff --git a/nwnds_module/elem_mag_el001.utc b/nwnds_module/elem_mag_el001.utc new file mode 100644 index 000000000..c447337ff Binary files /dev/null and b/nwnds_module/elem_mag_el001.utc differ diff --git a/nwnds_module/elem_mag_gr001.utc b/nwnds_module/elem_mag_gr001.utc new file mode 100644 index 000000000..51bc656ff Binary files /dev/null and b/nwnds_module/elem_mag_gr001.utc differ diff --git a/nwnds_module/elem_mag_hg001.utc b/nwnds_module/elem_mag_hg001.utc new file mode 100644 index 000000000..8b26a8976 Binary files /dev/null and b/nwnds_module/elem_mag_hg001.utc differ diff --git a/nwnds_module/elem_mag_lg001.utc b/nwnds_module/elem_mag_lg001.utc new file mode 100644 index 000000000..d13d96fb2 Binary files /dev/null and b/nwnds_module/elem_mag_lg001.utc differ diff --git a/nwnds_module/elem_mag_md001.utc b/nwnds_module/elem_mag_md001.utc new file mode 100644 index 000000000..5c6c98aa1 Binary files /dev/null and b/nwnds_module/elem_mag_md001.utc differ diff --git a/nwnds_module/elem_mag_sm001.utc b/nwnds_module/elem_mag_sm001.utc new file mode 100644 index 000000000..cf77bf76e Binary files /dev/null and b/nwnds_module/elem_mag_sm001.utc differ diff --git a/nwnds_module/elem_rain_el001.utc b/nwnds_module/elem_rain_el001.utc new file mode 100644 index 000000000..9ef354147 Binary files /dev/null and b/nwnds_module/elem_rain_el001.utc differ diff --git a/nwnds_module/elem_rain_gr001.utc b/nwnds_module/elem_rain_gr001.utc new file mode 100644 index 000000000..d7d35419d Binary files /dev/null and b/nwnds_module/elem_rain_gr001.utc differ diff --git a/nwnds_module/elem_rain_hg001.utc b/nwnds_module/elem_rain_hg001.utc new file mode 100644 index 000000000..fe1193bd9 Binary files /dev/null and b/nwnds_module/elem_rain_hg001.utc differ diff --git a/nwnds_module/elem_rain_lg001.utc b/nwnds_module/elem_rain_lg001.utc new file mode 100644 index 000000000..22cfb81b3 Binary files /dev/null and b/nwnds_module/elem_rain_lg001.utc differ diff --git a/nwnds_module/elem_rain_md001.utc b/nwnds_module/elem_rain_md001.utc new file mode 100644 index 000000000..14d6b4f5d Binary files /dev/null and b/nwnds_module/elem_rain_md001.utc differ diff --git a/nwnds_module/elem_rain_sm001.utc b/nwnds_module/elem_rain_sm001.utc new file mode 100644 index 000000000..6bb6dfeec Binary files /dev/null and b/nwnds_module/elem_rain_sm001.utc differ diff --git a/nwnds_module/elem_silt_el001.utc b/nwnds_module/elem_silt_el001.utc new file mode 100644 index 000000000..ee910ff55 Binary files /dev/null and b/nwnds_module/elem_silt_el001.utc differ diff --git a/nwnds_module/elem_silt_gr001.utc b/nwnds_module/elem_silt_gr001.utc new file mode 100644 index 000000000..5d3430955 Binary files /dev/null and b/nwnds_module/elem_silt_gr001.utc differ diff --git a/nwnds_module/elem_silt_hg001.utc b/nwnds_module/elem_silt_hg001.utc new file mode 100644 index 000000000..2c592a2ea Binary files /dev/null and b/nwnds_module/elem_silt_hg001.utc differ diff --git a/nwnds_module/elem_silt_lg001.utc b/nwnds_module/elem_silt_lg001.utc new file mode 100644 index 000000000..525ec82d6 Binary files /dev/null and b/nwnds_module/elem_silt_lg001.utc differ diff --git a/nwnds_module/elem_silt_md001.utc b/nwnds_module/elem_silt_md001.utc new file mode 100644 index 000000000..b7ec4ddfc Binary files /dev/null and b/nwnds_module/elem_silt_md001.utc differ diff --git a/nwnds_module/elem_silt_sm001.utc b/nwnds_module/elem_silt_sm001.utc new file mode 100644 index 000000000..47ebce3d4 Binary files /dev/null and b/nwnds_module/elem_silt_sm001.utc differ diff --git a/nwnds_module/elem_sun_el001.utc b/nwnds_module/elem_sun_el001.utc new file mode 100644 index 000000000..2d3ed2f42 Binary files /dev/null and b/nwnds_module/elem_sun_el001.utc differ diff --git a/nwnds_module/elem_sun_gr001.utc b/nwnds_module/elem_sun_gr001.utc new file mode 100644 index 000000000..ee60c8ae4 Binary files /dev/null and b/nwnds_module/elem_sun_gr001.utc differ diff --git a/nwnds_module/elem_sun_hg001.utc b/nwnds_module/elem_sun_hg001.utc new file mode 100644 index 000000000..b0cc4e8c0 Binary files /dev/null and b/nwnds_module/elem_sun_hg001.utc differ diff --git a/nwnds_module/elem_sun_lg001.utc b/nwnds_module/elem_sun_lg001.utc new file mode 100644 index 000000000..4dcda587c Binary files /dev/null and b/nwnds_module/elem_sun_lg001.utc differ diff --git a/nwnds_module/elem_sun_md001.utc b/nwnds_module/elem_sun_md001.utc new file mode 100644 index 000000000..5b7038e45 Binary files /dev/null and b/nwnds_module/elem_sun_md001.utc differ diff --git a/nwnds_module/elem_sun_sm001.utc b/nwnds_module/elem_sun_sm001.utc new file mode 100644 index 000000000..1b0539979 Binary files /dev/null and b/nwnds_module/elem_sun_sm001.utc differ diff --git a/nwnds_module/elem_water_el001.utc b/nwnds_module/elem_water_el001.utc new file mode 100644 index 000000000..3197d0dc0 Binary files /dev/null and b/nwnds_module/elem_water_el001.utc differ diff --git a/nwnds_module/elem_water_gr001.utc b/nwnds_module/elem_water_gr001.utc new file mode 100644 index 000000000..59ceabaee Binary files /dev/null and b/nwnds_module/elem_water_gr001.utc differ diff --git a/nwnds_module/elem_water_hg001.utc b/nwnds_module/elem_water_hg001.utc new file mode 100644 index 000000000..1d00b9509 Binary files /dev/null and b/nwnds_module/elem_water_hg001.utc differ diff --git a/nwnds_module/elem_water_lg001.utc b/nwnds_module/elem_water_lg001.utc new file mode 100644 index 000000000..e7dc818ba Binary files /dev/null and b/nwnds_module/elem_water_lg001.utc differ diff --git a/nwnds_module/elem_water_md001.utc b/nwnds_module/elem_water_md001.utc new file mode 100644 index 000000000..a7a558ef8 Binary files /dev/null and b/nwnds_module/elem_water_md001.utc differ diff --git a/nwnds_module/elem_water_pr001.utc b/nwnds_module/elem_water_pr001.utc new file mode 100644 index 000000000..169f59b7b Binary files /dev/null and b/nwnds_module/elem_water_pr001.utc differ diff --git a/nwnds_module/elem_water_sm001.utc b/nwnds_module/elem_water_sm001.utc new file mode 100644 index 000000000..07cf33b34 Binary files /dev/null and b/nwnds_module/elem_water_sm001.utc differ diff --git a/nwnds_module/elementalsymbol.ncs b/nwnds_module/elementalsymbol.ncs new file mode 100644 index 000000000..f4f021cfa Binary files /dev/null and b/nwnds_module/elementalsymbol.ncs differ diff --git a/nwnds_module/elementalsymbol.nss b/nwnds_module/elementalsymbol.nss new file mode 100644 index 000000000..768cfb027 --- /dev/null +++ b/nwnds_module/elementalsymbol.nss @@ -0,0 +1,30 @@ +#include "x2_inc_spellhook" + +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + if (nEvent == X2_ITEM_EVENT_ACTIVATE) + { + oPC = GetItemActivator(); + oItem = GetItemActivated(); + effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3); + effect ePoly; + int nPoly; + int nDuration = GetLevelByClass(CLASS_TYPE_CLERIC, oPC); + + if(GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) nPoly = POLYMORPH_TYPE_HUGE_AIR_ELEMENTAL; + if(GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) nPoly = POLYMORPH_TYPE_HUGE_EARTH_ELEMENTAL; + if(GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) nPoly = POLYMORPH_TYPE_HUGE_FIRE_ELEMENTAL; + if(GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) nPoly = POLYMORPH_TYPE_HUGE_WATER_ELEMENTAL; + + ePoly = EffectPolymorph(nPoly); + + //Apply the VFX impact and effects + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC)); + DelayCommand(0.4, AssignCommand(oPC, ClearAllActions())); // prevents an exploit + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oPC, TurnsToSeconds(nDuration))); + } +} diff --git a/nwnds_module/elfguard001.utc b/nwnds_module/elfguard001.utc new file mode 100644 index 000000000..980ee122e Binary files /dev/null and b/nwnds_module/elfguard001.utc differ diff --git a/nwnds_module/elfireelemhide.uti b/nwnds_module/elfireelemhide.uti new file mode 100644 index 000000000..40bae3b81 Binary files /dev/null and b/nwnds_module/elfireelemhide.uti differ diff --git a/nwnds_module/elmagelemhide.uti b/nwnds_module/elmagelemhide.uti new file mode 100644 index 000000000..ed1d0ef5c Binary files /dev/null and b/nwnds_module/elmagelemhide.uti differ diff --git a/nwnds_module/elrainelemhide.uti b/nwnds_module/elrainelemhide.uti new file mode 100644 index 000000000..22628ebd3 Binary files /dev/null and b/nwnds_module/elrainelemhide.uti differ diff --git a/nwnds_module/elsiltelemhide.uti b/nwnds_module/elsiltelemhide.uti new file mode 100644 index 000000000..27b66502b Binary files /dev/null and b/nwnds_module/elsiltelemhide.uti differ diff --git a/nwnds_module/elsunelemhide.uti b/nwnds_module/elsunelemhide.uti new file mode 100644 index 000000000..f11e87c37 Binary files /dev/null and b/nwnds_module/elsunelemhide.uti differ diff --git a/nwnds_module/elvawenhide.uti b/nwnds_module/elvawenhide.uti new file mode 100644 index 000000000..743f5bc65 Binary files /dev/null and b/nwnds_module/elvawenhide.uti differ diff --git a/nwnds_module/elvenraider001.utc b/nwnds_module/elvenraider001.utc new file mode 100644 index 000000000..9164ee106 Binary files /dev/null and b/nwnds_module/elvenraider001.utc differ diff --git a/nwnds_module/elvenraider002.utc b/nwnds_module/elvenraider002.utc new file mode 100644 index 000000000..2480787a6 Binary files /dev/null and b/nwnds_module/elvenraider002.utc differ diff --git a/nwnds_module/elwaterelemhide.uti b/nwnds_module/elwaterelemhide.uti new file mode 100644 index 000000000..d39fc88ff Binary files /dev/null and b/nwnds_module/elwaterelemhide.uti differ diff --git a/nwnds_module/ema_xp4trap_dis.ncs b/nwnds_module/ema_xp4trap_dis.ncs new file mode 100644 index 000000000..541f22ce9 Binary files /dev/null and b/nwnds_module/ema_xp4trap_dis.ncs differ diff --git a/nwnds_module/ema_xp4trap_dis.nss b/nwnds_module/ema_xp4trap_dis.nss new file mode 100644 index 000000000..b6fad1617 --- /dev/null +++ b/nwnds_module/ema_xp4trap_dis.nss @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------- + +New Name: ema_xp4trap_dis +Date: 19-OCT-2003 - created +Date: 20-oct-2003 - reworked comments +Re-creator: Drakkenkin + +Notes: +This Script was made from the scripts Telzar08Trap_XP_award and + Velar03trap_disarm_xp. The Scripts were made by Telzar and Velar + respectively. + +I re-worked this script because I like most of one of the script but + I like the detection if the PC is in or out of combat of the + other script. So I combined the two. + +----------------------------------------------------------------------*/ + + +// Variables +object oPC=GetLastDisarmed(); +int iXPaward = 0; +int iXPawarddc = 0; + +void main() +{ + if (GetIsInCombat(oPC)) + { + iXPawarddc = (GetTrapDisarmDC(OBJECT_SELF) *10); + // Multiplies the Trap Disarm DC by 10 + + iXPaward = (iXPawarddc -((GetHitDice(oPC)-1)*10)); + // Subtracts 10xp for every (level - 1) of pc form award. + //(this way 1st level Pcs get full xp). + } + else + { + + iXPawarddc = (GetTrapDisarmDC(OBJECT_SELF) *5); + // Multiplies the Trap Disarm DC by 5 + + iXPaward = (iXPawarddc -((GetHitDice(oPC)-1)*5)); + // Subtracts 5xp for every (level - 1) of pc form award. + } + SendMessageToPC( (oPC ),"Trap disarmed"); + // Sends message to the PC stating - trap was disarmed. + + if (iXPaward >= 1) + // checks to make sure that the xp award is at least 1. + { + GiveXPToCreature(oPC, iXPaward); + // If the XP reward is at least 1 then give the PC a reward. + } + else + // If the XP award is less then 1. + { + GiveXPToCreature(oPC, 1); + // give 1 xp. + } +} diff --git a/nwnds_module/embraceofthespir.uti b/nwnds_module/embraceofthespir.uti new file mode 100644 index 000000000..c25791423 Binary files /dev/null and b/nwnds_module/embraceofthespir.uti differ diff --git a/nwnds_module/enc_desert001.are b/nwnds_module/enc_desert001.are new file mode 100644 index 000000000..8a39a44ae Binary files /dev/null and b/nwnds_module/enc_desert001.are differ diff --git a/nwnds_module/enc_desert001.gic b/nwnds_module/enc_desert001.gic new file mode 100644 index 000000000..9c4d2e62d Binary files /dev/null and b/nwnds_module/enc_desert001.gic differ diff --git a/nwnds_module/enc_desert001.git b/nwnds_module/enc_desert001.git new file mode 100644 index 000000000..18eb62b6b Binary files /dev/null and b/nwnds_module/enc_desert001.git differ diff --git a/nwnds_module/enc_ds_start.ncs b/nwnds_module/enc_ds_start.ncs new file mode 100644 index 000000000..8ce7fa987 Binary files /dev/null and b/nwnds_module/enc_ds_start.ncs differ diff --git a/nwnds_module/enc_ds_start.nss b/nwnds_module/enc_ds_start.nss new file mode 100644 index 000000000..8b63ee945 --- /dev/null +++ b/nwnds_module/enc_ds_start.nss @@ -0,0 +1,11 @@ +void main() +{ + //added to enable defiling aura on NPC's + object oEntering = GetEnteringObject(); + object oArea = GetArea(oEntering); + SetLocalInt(oArea, "X2_L_WILD_MAGIC", 1); + + object oSpawner = GetObjectByTag("re_x1x2x3x5t0"); + SetLocalInt(oSpawner, "re_bFirstRun", FALSE); + +} diff --git a/nwnds_module/enc_scrub_pl001.are b/nwnds_module/enc_scrub_pl001.are new file mode 100644 index 000000000..3a2421edf Binary files /dev/null and b/nwnds_module/enc_scrub_pl001.are differ diff --git a/nwnds_module/enc_scrub_pl001.gic b/nwnds_module/enc_scrub_pl001.gic new file mode 100644 index 000000000..b2efb2004 Binary files /dev/null and b/nwnds_module/enc_scrub_pl001.gic differ diff --git a/nwnds_module/enc_scrub_pl001.git b/nwnds_module/enc_scrub_pl001.git new file mode 100644 index 000000000..701c383e0 Binary files /dev/null and b/nwnds_module/enc_scrub_pl001.git differ diff --git a/nwnds_module/encounterpalcus.itp b/nwnds_module/encounterpalcus.itp new file mode 100644 index 000000000..ac6085add Binary files /dev/null and b/nwnds_module/encounterpalcus.itp differ diff --git a/nwnds_module/erdlu001.utc b/nwnds_module/erdlu001.utc new file mode 100644 index 000000000..c0ee84846 Binary files /dev/null and b/nwnds_module/erdlu001.utc differ diff --git a/nwnds_module/erdlu002.utc b/nwnds_module/erdlu002.utc new file mode 100644 index 000000000..847dab2c5 Binary files /dev/null and b/nwnds_module/erdlu002.utc differ diff --git a/nwnds_module/ettercapbite.uti b/nwnds_module/ettercapbite.uti new file mode 100644 index 000000000..0a6a151ff Binary files /dev/null and b/nwnds_module/ettercapbite.uti differ diff --git a/nwnds_module/evardsblacktenta.uti b/nwnds_module/evardsblacktenta.uti new file mode 100644 index 000000000..7ba5149e2 Binary files /dev/null and b/nwnds_module/evardsblacktenta.uti differ diff --git a/nwnds_module/eviscerator.ncs b/nwnds_module/eviscerator.ncs new file mode 100644 index 000000000..9e2ecaa64 Binary files /dev/null and b/nwnds_module/eviscerator.ncs differ diff --git a/nwnds_module/eviscerator.nss b/nwnds_module/eviscerator.nss new file mode 100644 index 000000000..15afe38c2 --- /dev/null +++ b/nwnds_module/eviscerator.nss @@ -0,0 +1,131 @@ +//:: +//:: A pnp version of the Slaughter Wight's Lvl draining touch, +//:: Eviscorator Feat & Death master feat. +//:: +//:: Modified by: DM Heatstroke 01-30-11 +//:: + +#include "NW_I0_GENERIC" +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +int GetIsShaken(object oTarget,object oOrigin) +{ + effect eEffect = GetFirstEffect(oTarget); + int nEffectType; + + while ( GetIsEffectValid(eEffect) ) + { +// AssignCommand(oTarget,SpeakString("Effect Creator: " + GetName(GetEffectCreator(eEffect)) +// + " Effect ID: " + IntToString(GetEffectSpellId(eEffect)) +// + " Effect Type: " + IntToString(GetEffectType(eEffect)) )); + + if ( GetEffectCreator(eEffect) == oOrigin && + GetEffectSpellId(eEffect) == 700 ) + { + nEffectType = GetEffectType(eEffect); + if ( nEffectType == EFFECT_TYPE_ATTACK_DECREASE || + nEffectType == EFFECT_TYPE_SAVING_THROW_DECREASE || + nEffectType == EFFECT_TYPE_SKILL_DECREASE ) + { + AssignCommand(oTarget,SpeakString("**Shaken!**")); + return TRUE; + } +} + eEffect = GetNextEffect(oTarget); + } + + //AssignCommand(oTarget,SpeakString("I am not shaken")); + return FALSE; +} + +void DoLevelDrain(object oTarget, object oCaster) +{ + // Setup oCaster's healing + effect eDrain = EffectTemporaryHitpoints(5); + eDrain = ExtraordinaryEffect(eDrain); + effect eVis1 = EffectVisualEffect(VFX_IMP_HEALING_L); + + // Setup Level Drain + effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eNeg = EffectNegativeLevel(1); + eNeg = SupernaturalEffect(eNeg); + + // Drain levels from oTarget + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNeg, oTarget, HoursToSeconds(24)); + // Apply Temp HP to oCaster + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oCaster, HoursToSeconds(1)); + +} + +void main() +{ + object oCaster = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) + { + SendMessageToPC(oTarget,"Immune to level drain."); + return; + } + + DelayCommand(0.1,DoLevelDrain(oTarget,oCaster)); + + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + return; + if ( GetIsImmune( oTarget, IMMUNITY_TYPE_CRITICAL_HIT ) ) + return; + + if ( d20() < 14 ) + return; + + effect eImp = EffectVisualEffect(VFX_FNF_LOS_EVIL_30); + + effect eVis = EffectVisualEffect(VFX_IMP_DOOM); + + effect eAttack = EffectAttackDecrease(2); + effect eSaves = EffectSavingThrowDecrease(SAVING_THROW_ALL,2); + effect eSkills = EffectSkillDecrease(SKILL_ALL_SKILLS,2); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eAttack,eSaves); + eLink = EffectLinkEffects(eLink,eSkills); + eLink = EffectLinkEffects(eLink,eDur); + + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink2 = EffectLinkEffects(eVis2,eDur2); + + object oAOE = GetFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(30.0), GetLocation(oTarget)); + + float fDelay; + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + while ( GetIsObjectValid( oAOE ) ) + { + if ( oAOE != oCaster && GetIsEnemy(oAOE,oCaster) ) + { + if ( !GetIsImmune( oAOE, IMMUNITY_TYPE_MIND_SPELLS ) && + !GetIsImmune( oAOE, IMMUNITY_TYPE_FEAR ) && + !GetHasEffect( EFFECT_TYPE_FRIGHTENED, oAOE) ) + { + fDelay = GetDistanceBetween(oAOE,oTarget) / 20; + if ( GetIsShaken(oAOE, oCaster) ) + { + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink2,oAOE,RoundsToSeconds(10))); +// AssignCommand(oAOE,SpeakString("Fear! Oh no!")); + } + else + { + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oAOE)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oAOE,RoundsToSeconds(10))); + } + } + } + oAOE = GetNextObjectInShape(SHAPE_SPHERE, FeetToMeters(30.0), GetLocation(oTarget)); + } + + +} diff --git a/nwnds_module/explorearea.ncs b/nwnds_module/explorearea.ncs new file mode 100644 index 000000000..a0344e18b Binary files /dev/null and b/nwnds_module/explorearea.ncs differ diff --git a/nwnds_module/explorearea.nss b/nwnds_module/explorearea.nss new file mode 100644 index 000000000..b50553084 --- /dev/null +++ b/nwnds_module/explorearea.nss @@ -0,0 +1,4 @@ +void main() +{ +ExploreAreaForPlayer(GetArea(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,OBJECT_SELF)),GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,OBJECT_SELF)); +} diff --git a/nwnds_module/ey_dpcon_erewood.are b/nwnds_module/ey_dpcon_erewood.are new file mode 100644 index 000000000..f17736152 Binary files /dev/null and b/nwnds_module/ey_dpcon_erewood.are differ diff --git a/nwnds_module/ey_dpcon_erewood.gic b/nwnds_module/ey_dpcon_erewood.gic new file mode 100644 index 000000000..1a36a63ab Binary files /dev/null and b/nwnds_module/ey_dpcon_erewood.gic differ diff --git a/nwnds_module/ey_dpcon_erewood.git b/nwnds_module/ey_dpcon_erewood.git new file mode 100644 index 000000000..b69a6f3ba Binary files /dev/null and b/nwnds_module/ey_dpcon_erewood.git differ diff --git a/nwnds_module/f_kraglingbite.uti b/nwnds_module/f_kraglingbite.uti new file mode 100644 index 000000000..35227c18b Binary files /dev/null and b/nwnds_module/f_kraglingbite.uti differ diff --git a/nwnds_module/f_kraglinghide.uti b/nwnds_module/f_kraglinghide.uti new file mode 100644 index 000000000..aac73d735 Binary files /dev/null and b/nwnds_module/f_kraglinghide.uti differ diff --git a/nwnds_module/fac_ac.utc b/nwnds_module/fac_ac.utc new file mode 100644 index 000000000..a1e8a00a9 Binary files /dev/null and b/nwnds_module/fac_ac.utc differ diff --git a/nwnds_module/fac_helm_anvilcr.uti b/nwnds_module/fac_helm_anvilcr.uti new file mode 100644 index 000000000..1d268f21a Binary files /dev/null and b/nwnds_module/fac_helm_anvilcr.uti differ diff --git a/nwnds_module/fac_helm_berreng.uti b/nwnds_module/fac_helm_berreng.uti new file mode 100644 index 000000000..77d3f4d78 Binary files /dev/null and b/nwnds_module/fac_helm_berreng.uti differ diff --git a/nwnds_module/fac_helm_crimson.uti b/nwnds_module/fac_helm_crimson.uti new file mode 100644 index 000000000..6a08d64e7 Binary files /dev/null and b/nwnds_module/fac_helm_crimson.uti differ diff --git a/nwnds_module/fac_helm_draqo.uti b/nwnds_module/fac_helm_draqo.uti new file mode 100644 index 000000000..d07b97678 Binary files /dev/null and b/nwnds_module/fac_helm_draqo.uti differ diff --git a/nwnds_module/fac_helm_ebonhrt.uti b/nwnds_module/fac_helm_ebonhrt.uti new file mode 100644 index 000000000..b14b389ad Binary files /dev/null and b/nwnds_module/fac_helm_ebonhrt.uti differ diff --git a/nwnds_module/fac_helm_irnclaw.uti b/nwnds_module/fac_helm_irnclaw.uti new file mode 100644 index 000000000..59b53d05a Binary files /dev/null and b/nwnds_module/fac_helm_irnclaw.uti differ diff --git a/nwnds_module/fac_helm_llcabal.uti b/nwnds_module/fac_helm_llcabal.uti new file mode 100644 index 000000000..356f3f7f3 Binary files /dev/null and b/nwnds_module/fac_helm_llcabal.uti differ diff --git a/nwnds_module/fac_helm_tyrtmp.uti b/nwnds_module/fac_helm_tyrtmp.uti new file mode 100644 index 000000000..206c4d1c1 Binary files /dev/null and b/nwnds_module/fac_helm_tyrtmp.uti differ diff --git a/nwnds_module/fac_helm_uriktmp.uti b/nwnds_module/fac_helm_uriktmp.uti new file mode 100644 index 000000000..d288c28be Binary files /dev/null and b/nwnds_module/fac_helm_uriktmp.uti differ diff --git a/nwnds_module/fac_helm_veiled.uti b/nwnds_module/fac_helm_veiled.uti new file mode 100644 index 000000000..204350c5c Binary files /dev/null and b/nwnds_module/fac_helm_veiled.uti differ diff --git a/nwnds_module/fac_itmnck_tyrva.uti b/nwnds_module/fac_itmnck_tyrva.uti new file mode 100644 index 000000000..fd611b713 Binary files /dev/null and b/nwnds_module/fac_itmnck_tyrva.uti differ diff --git a/nwnds_module/fac_itmnck_urkva.uti b/nwnds_module/fac_itmnck_urkva.uti new file mode 100644 index 000000000..ca5643c51 Binary files /dev/null and b/nwnds_module/fac_itmnck_urkva.uti differ diff --git a/nwnds_module/fac_itmrng_draqo.uti b/nwnds_module/fac_itmrng_draqo.uti new file mode 100644 index 000000000..cba5b74bb Binary files /dev/null and b/nwnds_module/fac_itmrng_draqo.uti differ diff --git a/nwnds_module/fac_itpnck_draqo.uti b/nwnds_module/fac_itpnck_draqo.uti new file mode 100644 index 000000000..81b812a03 Binary files /dev/null and b/nwnds_module/fac_itpnck_draqo.uti differ diff --git a/nwnds_module/fac_itpnck_tyrtm.uti b/nwnds_module/fac_itpnck_tyrtm.uti new file mode 100644 index 000000000..f63a68bc1 Binary files /dev/null and b/nwnds_module/fac_itpnck_tyrtm.uti differ diff --git a/nwnds_module/fac_itpnck_urikt.uti b/nwnds_module/fac_itpnck_urikt.uti new file mode 100644 index 000000000..d54c13fb7 Binary files /dev/null and b/nwnds_module/fac_itpnck_urikt.uti differ diff --git a/nwnds_module/fac_itprng_thief.uti b/nwnds_module/fac_itprng_thief.uti new file mode 100644 index 000000000..c9a867dab Binary files /dev/null and b/nwnds_module/fac_itprng_thief.uti differ diff --git a/nwnds_module/fac_key_ac.uti b/nwnds_module/fac_key_ac.uti new file mode 100644 index 000000000..2b1a035a8 Binary files /dev/null and b/nwnds_module/fac_key_ac.uti differ diff --git a/nwnds_module/fac_key_ac_m.uti b/nwnds_module/fac_key_ac_m.uti new file mode 100644 index 000000000..42b87e8f5 Binary files /dev/null and b/nwnds_module/fac_key_ac_m.uti differ diff --git a/nwnds_module/fac_key_berren.uti b/nwnds_module/fac_key_berren.uti new file mode 100644 index 000000000..1674453bd Binary files /dev/null and b/nwnds_module/fac_key_berren.uti differ diff --git a/nwnds_module/fac_key_berren_m.uti b/nwnds_module/fac_key_berren_m.uti new file mode 100644 index 000000000..e88667edd Binary files /dev/null and b/nwnds_module/fac_key_berren_m.uti differ diff --git a/nwnds_module/fac_key_cl.uti b/nwnds_module/fac_key_cl.uti new file mode 100644 index 000000000..fca0c3b9d Binary files /dev/null and b/nwnds_module/fac_key_cl.uti differ diff --git a/nwnds_module/fac_key_cl_m.uti b/nwnds_module/fac_key_cl_m.uti new file mode 100644 index 000000000..cdeb94e86 Binary files /dev/null and b/nwnds_module/fac_key_cl_m.uti differ diff --git a/nwnds_module/fac_key_craftr.uti b/nwnds_module/fac_key_craftr.uti new file mode 100644 index 000000000..cf95b74ae Binary files /dev/null and b/nwnds_module/fac_key_craftr.uti differ diff --git a/nwnds_module/fac_key_craftr_m.uti b/nwnds_module/fac_key_craftr_m.uti new file mode 100644 index 000000000..0ad5cf434 Binary files /dev/null and b/nwnds_module/fac_key_craftr_m.uti differ diff --git a/nwnds_module/fac_key_draqoman.uti b/nwnds_module/fac_key_draqoman.uti new file mode 100644 index 000000000..1d93951fa Binary files /dev/null and b/nwnds_module/fac_key_draqoman.uti differ diff --git a/nwnds_module/fac_key_eh.uti b/nwnds_module/fac_key_eh.uti new file mode 100644 index 000000000..256e6ab82 Binary files /dev/null and b/nwnds_module/fac_key_eh.uti differ diff --git a/nwnds_module/fac_key_eh_m.uti b/nwnds_module/fac_key_eh_m.uti new file mode 100644 index 000000000..9b47fcc87 Binary files /dev/null and b/nwnds_module/fac_key_eh_m.uti differ diff --git a/nwnds_module/fac_key_illithid.uti b/nwnds_module/fac_key_illithid.uti new file mode 100644 index 000000000..be4b6cfe2 Binary files /dev/null and b/nwnds_module/fac_key_illithid.uti differ diff --git a/nwnds_module/fac_key_irnclw.uti b/nwnds_module/fac_key_irnclw.uti new file mode 100644 index 000000000..109b4ab23 Binary files /dev/null and b/nwnds_module/fac_key_irnclw.uti differ diff --git a/nwnds_module/fac_key_irnclw_m.uti b/nwnds_module/fac_key_irnclw_m.uti new file mode 100644 index 000000000..bb14e4939 Binary files /dev/null and b/nwnds_module/fac_key_irnclw_m.uti differ diff --git a/nwnds_module/fac_key_llc.uti b/nwnds_module/fac_key_llc.uti new file mode 100644 index 000000000..068219cd9 Binary files /dev/null and b/nwnds_module/fac_key_llc.uti differ diff --git a/nwnds_module/fac_key_llc_m.uti b/nwnds_module/fac_key_llc_m.uti new file mode 100644 index 000000000..4a38114b0 Binary files /dev/null and b/nwnds_module/fac_key_llc_m.uti differ diff --git a/nwnds_module/fac_key_tyrtemp.uti b/nwnds_module/fac_key_tyrtemp.uti new file mode 100644 index 000000000..0488e6008 Binary files /dev/null and b/nwnds_module/fac_key_tyrtemp.uti differ diff --git a/nwnds_module/fac_key_tyrva.uti b/nwnds_module/fac_key_tyrva.uti new file mode 100644 index 000000000..a4f2115f0 Binary files /dev/null and b/nwnds_module/fac_key_tyrva.uti differ diff --git a/nwnds_module/fac_key_uriktemp.uti b/nwnds_module/fac_key_uriktemp.uti new file mode 100644 index 000000000..1ac995fa3 Binary files /dev/null and b/nwnds_module/fac_key_uriktemp.uti differ diff --git a/nwnds_module/fac_key_urikva.uti b/nwnds_module/fac_key_urikva.uti new file mode 100644 index 000000000..a8ba0fecf Binary files /dev/null and b/nwnds_module/fac_key_urikva.uti differ diff --git a/nwnds_module/facanimal.utc b/nwnds_module/facanimal.utc new file mode 100644 index 000000000..fd43df9f7 Binary files /dev/null and b/nwnds_module/facanimal.utc differ diff --git a/nwnds_module/facbelgoi.utc b/nwnds_module/facbelgoi.utc new file mode 100644 index 000000000..03daabf8b Binary files /dev/null and b/nwnds_module/facbelgoi.utc differ diff --git a/nwnds_module/faccommoner.utc b/nwnds_module/faccommoner.utc new file mode 100644 index 000000000..67796a886 Binary files /dev/null and b/nwnds_module/faccommoner.utc differ diff --git a/nwnds_module/faccrimsonleigon.utc b/nwnds_module/faccrimsonleigon.utc new file mode 100644 index 000000000..51bc82c06 Binary files /dev/null and b/nwnds_module/faccrimsonleigon.utc differ diff --git a/nwnds_module/faccromlincyclop.utc b/nwnds_module/faccromlincyclop.utc new file mode 100644 index 000000000..e4925059b Binary files /dev/null and b/nwnds_module/faccromlincyclop.utc differ diff --git a/nwnds_module/facdefender.utc b/nwnds_module/facdefender.utc new file mode 100644 index 000000000..6c9b323c1 Binary files /dev/null and b/nwnds_module/facdefender.utc differ diff --git a/nwnds_module/facdie.utc b/nwnds_module/facdie.utc new file mode 100644 index 000000000..364c52dd5 Binary files /dev/null and b/nwnds_module/facdie.utc differ diff --git a/nwnds_module/facdraqoman.utc b/nwnds_module/facdraqoman.utc new file mode 100644 index 000000000..39f8c6f69 Binary files /dev/null and b/nwnds_module/facdraqoman.utc differ diff --git a/nwnds_module/facdraxxontempla.utc b/nwnds_module/facdraxxontempla.utc new file mode 100644 index 000000000..975e9b510 Binary files /dev/null and b/nwnds_module/facdraxxontempla.utc differ diff --git a/nwnds_module/facgith.utc b/nwnds_module/facgith.utc new file mode 100644 index 000000000..bf335a1e9 Binary files /dev/null and b/nwnds_module/facgith.utc differ diff --git a/nwnds_module/fachostile.utc b/nwnds_module/fachostile.utc new file mode 100644 index 000000000..9715305c5 Binary files /dev/null and b/nwnds_module/fachostile.utc differ diff --git a/nwnds_module/facironclaw.utc b/nwnds_module/facironclaw.utc new file mode 100644 index 000000000..4dfe205e7 Binary files /dev/null and b/nwnds_module/facironclaw.utc differ diff --git a/nwnds_module/fackleddwarves.utc b/nwnds_module/fackleddwarves.utc new file mode 100644 index 000000000..f8ad9a7a4 Binary files /dev/null and b/nwnds_module/fackleddwarves.utc differ diff --git a/nwnds_module/faclowlife.utc b/nwnds_module/faclowlife.utc new file mode 100644 index 000000000..e3102b298 Binary files /dev/null and b/nwnds_module/faclowlife.utc differ diff --git a/nwnds_module/facm_pc.utc b/nwnds_module/facm_pc.utc new file mode 100644 index 000000000..9d3568af7 Binary files /dev/null and b/nwnds_module/facm_pc.utc differ diff --git a/nwnds_module/facmerchant.utc b/nwnds_module/facmerchant.utc new file mode 100644 index 000000000..1bb3b50cc Binary files /dev/null and b/nwnds_module/facmerchant.utc differ diff --git a/nwnds_module/facmonstrous.utc b/nwnds_module/facmonstrous.utc new file mode 100644 index 000000000..6a1777046 Binary files /dev/null and b/nwnds_module/facmonstrous.utc differ diff --git a/nwnds_module/facneutral1.utc b/nwnds_module/facneutral1.utc new file mode 100644 index 000000000..a07fc315e Binary files /dev/null and b/nwnds_module/facneutral1.utc differ diff --git a/nwnds_module/facneutral2.utc b/nwnds_module/facneutral2.utc new file mode 100644 index 000000000..1b6e08d7f Binary files /dev/null and b/nwnds_module/facneutral2.utc differ diff --git a/nwnds_module/facnoncombatant.utc b/nwnds_module/facnoncombatant.utc new file mode 100644 index 000000000..e00e2e054 Binary files /dev/null and b/nwnds_module/facnoncombatant.utc differ diff --git a/nwnds_module/facpirate.utc b/nwnds_module/facpirate.utc new file mode 100644 index 000000000..ab5bdd489 Binary files /dev/null and b/nwnds_module/facpirate.utc differ diff --git a/nwnds_module/facsilverhand.utc b/nwnds_module/facsilverhand.utc new file mode 100644 index 000000000..d25f0eee9 Binary files /dev/null and b/nwnds_module/facsilverhand.utc differ diff --git a/nwnds_module/factari.utc b/nwnds_module/factari.utc new file mode 100644 index 000000000..1dd6ada59 Binary files /dev/null and b/nwnds_module/factari.utc differ diff --git a/nwnds_module/factemplar.utc b/nwnds_module/factemplar.utc new file mode 100644 index 000000000..80812856d Binary files /dev/null and b/nwnds_module/factemplar.utc differ diff --git a/nwnds_module/facthrax.utc b/nwnds_module/facthrax.utc new file mode 100644 index 000000000..7f5cfdf14 Binary files /dev/null and b/nwnds_module/facthrax.utc differ diff --git a/nwnds_module/facundead.utc b/nwnds_module/facundead.utc new file mode 100644 index 000000000..b42c43014 Binary files /dev/null and b/nwnds_module/facundead.utc differ diff --git a/nwnds_module/facurikite.utc b/nwnds_module/facurikite.utc new file mode 100644 index 000000000..70daa1087 Binary files /dev/null and b/nwnds_module/facurikite.utc differ diff --git a/nwnds_module/facva.utc b/nwnds_module/facva.utc new file mode 100644 index 000000000..56816a9d9 Binary files /dev/null and b/nwnds_module/facva.utc differ diff --git a/nwnds_module/facyuanti.utc b/nwnds_module/facyuanti.utc new file mode 100644 index 000000000..68f6b83e9 Binary files /dev/null and b/nwnds_module/facyuanti.utc differ diff --git a/nwnds_module/fael001.utc b/nwnds_module/fael001.utc new file mode 100644 index 000000000..b76be1ad7 Binary files /dev/null and b/nwnds_module/fael001.utc differ diff --git a/nwnds_module/faelbite.uti b/nwnds_module/faelbite.uti new file mode 100644 index 000000000..684ad67e2 Binary files /dev/null and b/nwnds_module/faelbite.uti differ diff --git a/nwnds_module/faelhide.uti b/nwnds_module/faelhide.uti new file mode 100644 index 000000000..fb7c21ce9 Binary files /dev/null and b/nwnds_module/faelhide.uti differ diff --git a/nwnds_module/faelslam.uti b/nwnds_module/faelslam.uti new file mode 100644 index 000000000..e1eceefec Binary files /dev/null and b/nwnds_module/faelslam.uti differ diff --git a/nwnds_module/fallen001.utc b/nwnds_module/fallen001.utc new file mode 100644 index 000000000..2dd1623e3 Binary files /dev/null and b/nwnds_module/fallen001.utc differ diff --git a/nwnds_module/fallen002.utc b/nwnds_module/fallen002.utc new file mode 100644 index 000000000..f9565afb1 Binary files /dev/null and b/nwnds_module/fallen002.utc differ diff --git a/nwnds_module/fallenhide_001.uti b/nwnds_module/fallenhide_001.uti new file mode 100644 index 000000000..7eb51a19a Binary files /dev/null and b/nwnds_module/fallenhide_001.uti differ diff --git a/nwnds_module/fallenslam_001.uti b/nwnds_module/fallenslam_001.uti new file mode 100644 index 000000000..ae9fca682 Binary files /dev/null and b/nwnds_module/fallenslam_001.uti differ diff --git a/nwnds_module/fariadone.ncs b/nwnds_module/fariadone.ncs new file mode 100644 index 000000000..daf372887 Binary files /dev/null and b/nwnds_module/fariadone.ncs differ diff --git a/nwnds_module/fariadone.nss b/nwnds_module/fariadone.nss new file mode 100644 index 000000000..53f18b4d0 --- /dev/null +++ b/nwnds_module/fariadone.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName fariadone +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 2:32:38 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "VAQ", 1); + +} diff --git a/nwnds_module/fear2_aura.ncs b/nwnds_module/fear2_aura.ncs new file mode 100644 index 000000000..c65c5fe8d Binary files /dev/null and b/nwnds_module/fear2_aura.ncs differ diff --git a/nwnds_module/fear2_aura.nss b/nwnds_module/fear2_aura.nss new file mode 100644 index 000000000..a4cf97d9a --- /dev/null +++ b/nwnds_module/fear2_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_FEAR,"fear2_aura1","null","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/fear2_aura1.ncs b/nwnds_module/fear2_aura1.ncs new file mode 100644 index 000000000..1c7e2eb3c Binary files /dev/null and b/nwnds_module/fear2_aura1.ncs differ diff --git a/nwnds_module/fear2_aura1.nss b/nwnds_module/fear2_aura1.nss new file mode 100644 index 000000000..fcf2efab3 --- /dev/null +++ b/nwnds_module/fear2_aura1.nss @@ -0,0 +1,33 @@ +#include "NW_I0_SPELLS" + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + int nLevel = GetHitDice(oCaster); + int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + + if ( nLevel > 20 ) + nLevel = 20; + + float fDuration = RoundsToSeconds(d4()); + + if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster ) + return; + + effect eFear = EffectParalyze(); + effect eImp = EffectVisualEffect(VFX_IMP_FEAR_S); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eFear,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_FEAR,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration); + } +} diff --git a/nwnds_module/fear_aura.ncs b/nwnds_module/fear_aura.ncs new file mode 100644 index 000000000..44e8d176c Binary files /dev/null and b/nwnds_module/fear_aura.ncs differ diff --git a/nwnds_module/fear_aura.nss b/nwnds_module/fear_aura.nss new file mode 100644 index 000000000..ed701763c --- /dev/null +++ b/nwnds_module/fear_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_FEAR,"fear_aura1","null","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/fear_aura1.ncs b/nwnds_module/fear_aura1.ncs new file mode 100644 index 000000000..3157025fe Binary files /dev/null and b/nwnds_module/fear_aura1.ncs differ diff --git a/nwnds_module/fear_aura1.nss b/nwnds_module/fear_aura1.nss new file mode 100644 index 000000000..5512eea5d --- /dev/null +++ b/nwnds_module/fear_aura1.nss @@ -0,0 +1,33 @@ +#include "NW_I0_SPELLS" + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + int nLevel = GetHitDice(oCaster); + int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + + if ( nLevel > 20 ) + nLevel = 20; + + float fDuration = RoundsToSeconds(nLevel); + + if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster ) + return; + + effect eFear = EffectFrightened(); + effect eImp = EffectVisualEffect(VFX_IMP_FEAR_S); + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eFear,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,nDC,SAVING_THROW_TYPE_FEAR,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,fDuration); + } +} diff --git a/nwnds_module/fincludes.nss b/nwnds_module/fincludes.nss new file mode 100644 index 000000000..d1b27258b --- /dev/null +++ b/nwnds_module/fincludes.nss @@ -0,0 +1,37 @@ +//:://///////////////////////////////////////////// +//:: Finny Includes ^^ +//:: fincludes +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +General stuff +*/ +//::////////////////////////////////////////////// +//:: Created By: FinneousPJ +//:: Created On: 28.8.2005 +//::////////////////////////////////////////////// + +const int FEAT_LAW_DOMAIN_POWER = 1151; +const int FEAT_CHAOS_DOMAIN_POWER = 1150; +// const int FEAT_LUCK_DOMAIN_POWER = 309; +const int FEAT_MAGMA_DOMAIN_POWER = 1153; +const int FEAT_SILT_DOMAIN_POWER = 1154; +const int FEAT_RAIN_DOMAIN_POWER = 1155; +const int FEAT_TEMPLAR_DOMAIN_POWER = 1157; +const int FEAT_ORONIS_DOMAIN_POWER = 1158; +const int FEAT_HAMANU_DOMAIN_POWER = 1159; +const int FEAT_THEOBA_DOMAIN_POWER = 1160; +const int FEAT_DREGOTH_DOMAIN_POWER = 1161; +const int FEAT_NIBENAY_DOMAIN_POWER = 1162; + +const int SPELL_ELEMENTAL_IMBUEMENT = 2012; +const int SPELL_HAND_OF_THE_SORCERER_KINGS = 2100; +const int SPELL_MIGHT_OF_THE_SORCERER_KINGS = 2101; +const int SPELL_WISDOM_OF_THE_SORCERER_KINGS = 2102; +const int SPELL_BRAMBLEWOOD = 2015; +const int SPELL_HEARTSEEKER = 2016; +const int SPELL_OBSIDIANDEATH = 2022; + +const int SPELLABILITY_DIVINE_PRESENCE = 1997; + +// void main(){} diff --git a/nwnds_module/findtraps.uti b/nwnds_module/findtraps.uti new file mode 100644 index 000000000..6eb35c1f9 Binary files /dev/null and b/nwnds_module/findtraps.uti differ diff --git a/nwnds_module/fire_cleric.ncs b/nwnds_module/fire_cleric.ncs new file mode 100644 index 000000000..ba7fc98ba Binary files /dev/null and b/nwnds_module/fire_cleric.ncs differ diff --git a/nwnds_module/fire_cleric.nss b/nwnds_module/fire_cleric.nss new file mode 100644 index 000000000..8996bb743 --- /dev/null +++ b/nwnds_module/fire_cleric.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they don't have Fire domain, unequip the item + if(!GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/firearmorl.uti b/nwnds_module/firearmorl.uti new file mode 100644 index 000000000..ba88d8724 Binary files /dev/null and b/nwnds_module/firearmorl.uti differ diff --git a/nwnds_module/firebatbite.uti b/nwnds_module/firebatbite.uti new file mode 100644 index 000000000..e65ea30e4 Binary files /dev/null and b/nwnds_module/firebatbite.uti differ diff --git a/nwnds_module/firebatskin.uti b/nwnds_module/firebatskin.uti new file mode 100644 index 000000000..70568121c Binary files /dev/null and b/nwnds_module/firebatskin.uti differ diff --git a/nwnds_module/firedrakeprops.uti b/nwnds_module/firedrakeprops.uti new file mode 100644 index 000000000..cbbb67dd3 Binary files /dev/null and b/nwnds_module/firedrakeprops.uti differ diff --git a/nwnds_module/firedraketail.uti b/nwnds_module/firedraketail.uti new file mode 100644 index 000000000..eed3c1d94 Binary files /dev/null and b/nwnds_module/firedraketail.uti differ diff --git a/nwnds_module/firekragbite.uti b/nwnds_module/firekragbite.uti new file mode 100644 index 000000000..f05a9dc98 Binary files /dev/null and b/nwnds_module/firekragbite.uti differ diff --git a/nwnds_module/firekraghide.uti b/nwnds_module/firekraghide.uti new file mode 100644 index 000000000..97f9e2b47 Binary files /dev/null and b/nwnds_module/firekraghide.uti differ diff --git a/nwnds_module/firemephitclaw.uti b/nwnds_module/firemephitclaw.uti new file mode 100644 index 000000000..3c6bbec3f Binary files /dev/null and b/nwnds_module/firemephitclaw.uti differ diff --git a/nwnds_module/firenymphhide.uti b/nwnds_module/firenymphhide.uti new file mode 100644 index 000000000..4ea9f5580 Binary files /dev/null and b/nwnds_module/firenymphhide.uti differ diff --git a/nwnds_module/firenymphrobe.uti b/nwnds_module/firenymphrobe.uti new file mode 100644 index 000000000..b0fc32857 Binary files /dev/null and b/nwnds_module/firenymphrobe.uti differ diff --git a/nwnds_module/firenymphtouch.uti b/nwnds_module/firenymphtouch.uti new file mode 100644 index 000000000..d76e09d6b Binary files /dev/null and b/nwnds_module/firenymphtouch.uti differ diff --git a/nwnds_module/firesubtypeund.uti b/nwnds_module/firesubtypeund.uti new file mode 100644 index 000000000..a8cddb9f5 Binary files /dev/null and b/nwnds_module/firesubtypeund.uti differ diff --git a/nwnds_module/flamebros_tail.ncs b/nwnds_module/flamebros_tail.ncs new file mode 100644 index 000000000..226eb3119 Binary files /dev/null and b/nwnds_module/flamebros_tail.ncs differ diff --git a/nwnds_module/flamebros_tail.nss b/nwnds_module/flamebros_tail.nss new file mode 100644 index 000000000..bd118d7c3 --- /dev/null +++ b/nwnds_module/flamebros_tail.nss @@ -0,0 +1,71 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d4(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + effect eFireDmg = EffectDamage(d6(1), DAMAGE_TYPE_FIRE); + int nSTR_Target; + int nSTR_Creature; + +// Large & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_LARGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d4+STR Modifier bludgeoning damage & 1d6 Fire Damage + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eFireDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Black Mastyrial TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The flamebrother tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The flamebrother is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Flamebrother +// entangle attempt failed. Otherwise it simply gets entangled as intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/flamebros_tail.uti b/nwnds_module/flamebros_tail.uti new file mode 100644 index 000000000..cb8ddefff Binary files /dev/null and b/nwnds_module/flamebros_tail.uti differ diff --git a/nwnds_module/flamesnake2bite.uti b/nwnds_module/flamesnake2bite.uti new file mode 100644 index 000000000..211750f50 Binary files /dev/null and b/nwnds_module/flamesnake2bite.uti differ diff --git a/nwnds_module/flamesnake2hid.uti b/nwnds_module/flamesnake2hid.uti new file mode 100644 index 000000000..506ec595f Binary files /dev/null and b/nwnds_module/flamesnake2hid.uti differ diff --git a/nwnds_module/flamesnake3bit.uti b/nwnds_module/flamesnake3bit.uti new file mode 100644 index 000000000..5e1fad2c6 Binary files /dev/null and b/nwnds_module/flamesnake3bit.uti differ diff --git a/nwnds_module/flamesnake3hid.uti b/nwnds_module/flamesnake3hid.uti new file mode 100644 index 000000000..99c9a8558 Binary files /dev/null and b/nwnds_module/flamesnake3hid.uti differ diff --git a/nwnds_module/flamesnakebite.uti b/nwnds_module/flamesnakebite.uti new file mode 100644 index 000000000..eca3c8a68 Binary files /dev/null and b/nwnds_module/flamesnakebite.uti differ diff --git a/nwnds_module/flamesnakehide.uti b/nwnds_module/flamesnakehide.uti new file mode 100644 index 000000000..14a82861e Binary files /dev/null and b/nwnds_module/flamesnakehide.uti differ diff --git a/nwnds_module/flamestatue.dlg b/nwnds_module/flamestatue.dlg new file mode 100644 index 000000000..e3f6172be Binary files /dev/null and b/nwnds_module/flamestatue.dlg differ diff --git a/nwnds_module/flamestatue1.dlg b/nwnds_module/flamestatue1.dlg new file mode 100644 index 000000000..2587cb8f3 Binary files /dev/null and b/nwnds_module/flamestatue1.dlg differ diff --git a/nwnds_module/flamingoil.uti b/nwnds_module/flamingoil.uti new file mode 100644 index 000000000..2ad5f4da4 Binary files /dev/null and b/nwnds_module/flamingoil.uti differ diff --git a/nwnds_module/floater_ondamage.ncs b/nwnds_module/floater_ondamage.ncs new file mode 100644 index 000000000..ebf490ddf Binary files /dev/null and b/nwnds_module/floater_ondamage.ncs differ diff --git a/nwnds_module/floater_ondamage.nss b/nwnds_module/floater_ondamage.nss new file mode 100644 index 000000000..3722321f7 --- /dev/null +++ b/nwnds_module/floater_ondamage.nss @@ -0,0 +1,78 @@ +//:://///////////////////////////////////////////// +//:: Name floater_onDamage +//:: Copyright (c) 2021 NWN Dark Sun +//::////////////////////////////////////////////// +/* + Floater's OnDamaged script +*/ +//::////////////////////////////////////////////// +//:: Created By: Jaysyn +//:: Created On: May 28th 2021 +//::////////////////////////////////////////////// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +void main() +{ + object oCaster = OBJECT_SELF; + int nMetaMagic = GetMetaMagicFeat(); + int nDamage; + int nRnd = d8(1); + float fDelay; + effect eExplode = EffectVisualEffect(VFX_FNF_FIREBALL); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + effect eDam; + //Get the spell target location as opposed to the spell target. + location lTarget = GetLocation(OBJECT_SELF); + object oDamager = GetLastDamager(); + int nDC = 10 + GetDamageDealtByType(DAMAGE_TYPE_FIRE); + + //-------------------------------------------------------------------------- + // Detect fire damage -> Roll Fort save -> Explode on fail. + //-------------------------------------------------------------------------- + + if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) >= 1) + { + if(!MySavingThrow(SAVING_THROW_FORT, oCaster, nDC, SAVING_THROW_TYPE_FIRE, oDamager, 0.0f )) + { + //Declare the spell shape, size and the location. Capture the first target object in the shape. + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR); + //Cycle through the targets within the spell shape until an invalid object is captured. + while (GetIsObjectValid(oTarget)) + { + //Fire cast spell at event for the specified target + //SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FIREBALL)); + //Get the distance between the explosion and the target to calculate delay + fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20; + if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay)) + { + //Adjust the damage based on the Reflex Save, Evasion and Improved Evasion. + nDamage = GetReflexAdjustedDamage(nRnd, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE); + //Set the damage effect + eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + if(nDamage > 0) + { + // Apply effects to the currently selected target. + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); + //This visual effect is applied to the target object not the location as above. This visual effect + //represents the flame that erupts on the target not on the ground. + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + } + } + + //Select the next target within the spell shape. + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_SMALL, lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR); + effect eDeath; + eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDeath, oCaster); + } + } + } + //-------------------------------------------------------------------------- + // Execute default AI code + //-------------------------------------------------------------------------- + ExecuteScript("prc_npc_damaged", OBJECT_SELF); + ExecuteScript("loc_ondamaged", OBJECT_SELF); +} diff --git a/nwnds_module/floatingdisk.utc b/nwnds_module/floatingdisk.utc new file mode 100644 index 000000000..e51a13c89 Binary files /dev/null and b/nwnds_module/floatingdisk.utc differ diff --git a/nwnds_module/for_ridge_kuray.are b/nwnds_module/for_ridge_kuray.are new file mode 100644 index 000000000..18c9e3be5 Binary files /dev/null and b/nwnds_module/for_ridge_kuray.are differ diff --git a/nwnds_module/for_ridge_kuray.gic b/nwnds_module/for_ridge_kuray.gic new file mode 100644 index 000000000..9be9104df Binary files /dev/null and b/nwnds_module/for_ridge_kuray.gic differ diff --git a/nwnds_module/for_ridge_kuray.git b/nwnds_module/for_ridge_kuray.git new file mode 100644 index 000000000..fdb12a877 Binary files /dev/null and b/nwnds_module/for_ridge_kuray.git differ diff --git a/nwnds_module/fordorran_aura.ncs b/nwnds_module/fordorran_aura.ncs new file mode 100644 index 000000000..11c175df7 Binary files /dev/null and b/nwnds_module/fordorran_aura.ncs differ diff --git a/nwnds_module/fordorran_aura.nss b/nwnds_module/fordorran_aura.nss new file mode 100644 index 000000000..b4a6aba62 --- /dev/null +++ b/nwnds_module/fordorran_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_TYRANT_FOG,"fordorranaura1","fordorranaura2","fordorranaura3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/fordorranaura1.ncs b/nwnds_module/fordorranaura1.ncs new file mode 100644 index 000000000..eba2755cb Binary files /dev/null and b/nwnds_module/fordorranaura1.ncs differ diff --git a/nwnds_module/fordorranaura1.nss b/nwnds_module/fordorranaura1.nss new file mode 100644 index 000000000..10598c977 --- /dev/null +++ b/nwnds_module/fordorranaura1.nss @@ -0,0 +1,26 @@ +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + + effect ePoison = EffectPoison(67); // Fordorran Musk Poison + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || + ( nRace == RACIAL_TYPE_ELEMENTAL ) || + ( nRace == 52 ) || // Plants are immune to poison. + ( nRace == RACIAL_TYPE_UNDEAD )) + return; + + if(GetIsEnemy(oTarget, oCaster)) + { + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + } +} diff --git a/nwnds_module/fordorranaura2.ncs b/nwnds_module/fordorranaura2.ncs new file mode 100644 index 000000000..f537d2a4f Binary files /dev/null and b/nwnds_module/fordorranaura2.ncs differ diff --git a/nwnds_module/fordorranaura2.nss b/nwnds_module/fordorranaura2.nss new file mode 100644 index 000000000..581876674 --- /dev/null +++ b/nwnds_module/fordorranaura2.nss @@ -0,0 +1,29 @@ +#include "NW_I0_SPELLS" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + + effect ePoison = EffectPoison(67); // Fordorran Musk Poison + effect eVis = EffectVisualEffect(VFX_IMP_POISON_S); + + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || + ( nRace == RACIAL_TYPE_ELEMENTAL ) || + ( nRace == 52 ) || // Plants are immune to poison. + ( nRace == RACIAL_TYPE_UNDEAD )) + return; + + ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePoison, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/fordorranaura3.ncs b/nwnds_module/fordorranaura3.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/fordorranaura3.ncs differ diff --git a/nwnds_module/fordorranaura3.nss b/nwnds_module/fordorranaura3.nss new file mode 100644 index 000000000..8dbf3f240 --- /dev/null +++ b/nwnds_module/fordorranaura3.nss @@ -0,0 +1,4 @@ +void main() +{ + +} diff --git a/nwnds_module/forest_ridge_001.are b/nwnds_module/forest_ridge_001.are new file mode 100644 index 000000000..bcc041754 Binary files /dev/null and b/nwnds_module/forest_ridge_001.are differ diff --git a/nwnds_module/forest_ridge_001.gic b/nwnds_module/forest_ridge_001.gic new file mode 100644 index 000000000..2fbcc5d85 Binary files /dev/null and b/nwnds_module/forest_ridge_001.gic differ diff --git a/nwnds_module/forest_ridge_001.git b/nwnds_module/forest_ridge_001.git new file mode 100644 index 000000000..6f5e746f0 Binary files /dev/null and b/nwnds_module/forest_ridge_001.git differ diff --git a/nwnds_module/fort_amber.are b/nwnds_module/fort_amber.are new file mode 100644 index 000000000..146bb3601 Binary files /dev/null and b/nwnds_module/fort_amber.are differ diff --git a/nwnds_module/fort_amber.gic b/nwnds_module/fort_amber.gic new file mode 100644 index 000000000..0b6108d48 Binary files /dev/null and b/nwnds_module/fort_amber.gic differ diff --git a/nwnds_module/fort_amber.git b/nwnds_module/fort_amber.git new file mode 100644 index 000000000..da007a277 Binary files /dev/null and b/nwnds_module/fort_amber.git differ diff --git a/nwnds_module/fort_kalvis.dlg b/nwnds_module/fort_kalvis.dlg new file mode 100644 index 000000000..a0a1e8f5d Binary files /dev/null and b/nwnds_module/fort_kalvis.dlg differ diff --git a/nwnds_module/fort_kalvis.ncs b/nwnds_module/fort_kalvis.ncs new file mode 100644 index 000000000..951190aa9 Binary files /dev/null and b/nwnds_module/fort_kalvis.ncs differ diff --git a/nwnds_module/fort_kalvis.nss b/nwnds_module/fort_kalvis.nss new file mode 100644 index 000000000..75617d348 --- /dev/null +++ b/nwnds_module/fort_kalvis.nss @@ -0,0 +1,43 @@ + +void main() +{ + int nHench; + object oHench; + object oTarget; + + // Get the PC who is in this conversation. + object oPC = GetPCSpeaker(); + + // Find the location to which to teleport. + oTarget = GetWaypointByTag("fort_kalvis_wp1"); + + // Teleport the PC. + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, JumpToObject(oTarget)); + + // Also teleport associates. + oHench = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + + // Support for multiple henchmen (includes horses). + nHench = 1; + oHench = GetHenchman(oPC, 1); + while ( oHench != OBJECT_INVALID ) + { + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + // Next henchman. + oHench = GetHenchman(oPC, ++nHench); + } +} + diff --git a/nwnds_module/fort_skonz.are b/nwnds_module/fort_skonz.are new file mode 100644 index 000000000..d951adf54 Binary files /dev/null and b/nwnds_module/fort_skonz.are differ diff --git a/nwnds_module/fort_skonz.gic b/nwnds_module/fort_skonz.gic new file mode 100644 index 000000000..41bebaedc Binary files /dev/null and b/nwnds_module/fort_skonz.gic differ diff --git a/nwnds_module/fort_skonz.git b/nwnds_module/fort_skonz.git new file mode 100644 index 000000000..7003a3538 Binary files /dev/null and b/nwnds_module/fort_skonz.git differ diff --git a/nwnds_module/fortamber.are b/nwnds_module/fortamber.are new file mode 100644 index 000000000..ef2e8688d Binary files /dev/null and b/nwnds_module/fortamber.are differ diff --git a/nwnds_module/fortamber.gic b/nwnds_module/fortamber.gic new file mode 100644 index 000000000..c2fe93e5f Binary files /dev/null and b/nwnds_module/fortamber.gic differ diff --git a/nwnds_module/fortamber.git b/nwnds_module/fortamber.git new file mode 100644 index 000000000..d663b9823 Binary files /dev/null and b/nwnds_module/fortamber.git differ diff --git a/nwnds_module/fortbutcher.are b/nwnds_module/fortbutcher.are new file mode 100644 index 000000000..8ed6d1f90 Binary files /dev/null and b/nwnds_module/fortbutcher.are differ diff --git a/nwnds_module/fortbutcher.gic b/nwnds_module/fortbutcher.gic new file mode 100644 index 000000000..7fc64ab02 Binary files /dev/null and b/nwnds_module/fortbutcher.gic differ diff --git a/nwnds_module/fortbutcher.git b/nwnds_module/fortbutcher.git new file mode 100644 index 000000000..7fe090e1f Binary files /dev/null and b/nwnds_module/fortbutcher.git differ diff --git a/nwnds_module/fortianto.are b/nwnds_module/fortianto.are new file mode 100644 index 000000000..aeacb653b Binary files /dev/null and b/nwnds_module/fortianto.are differ diff --git a/nwnds_module/fortianto.gic b/nwnds_module/fortianto.gic new file mode 100644 index 000000000..65158100a Binary files /dev/null and b/nwnds_module/fortianto.gic differ diff --git a/nwnds_module/fortianto.git b/nwnds_module/fortianto.git new file mode 100644 index 000000000..00e6e00eb Binary files /dev/null and b/nwnds_module/fortianto.git differ diff --git a/nwnds_module/fortiron.are b/nwnds_module/fortiron.are new file mode 100644 index 000000000..454f33558 Binary files /dev/null and b/nwnds_module/fortiron.are differ diff --git a/nwnds_module/fortiron.gic b/nwnds_module/fortiron.gic new file mode 100644 index 000000000..b9b84adf2 Binary files /dev/null and b/nwnds_module/fortiron.gic differ diff --git a/nwnds_module/fortiron.git b/nwnds_module/fortiron.git new file mode 100644 index 000000000..fb0524d9c Binary files /dev/null and b/nwnds_module/fortiron.git differ diff --git a/nwnds_module/fortskonz.are b/nwnds_module/fortskonz.are new file mode 100644 index 000000000..482f5221d Binary files /dev/null and b/nwnds_module/fortskonz.are differ diff --git a/nwnds_module/fortskonz.gic b/nwnds_module/fortskonz.gic new file mode 100644 index 000000000..67142b3e0 Binary files /dev/null and b/nwnds_module/fortskonz.gic differ diff --git a/nwnds_module/fortskonz.git b/nwnds_module/fortskonz.git new file mode 100644 index 000000000..176ce8f1d Binary files /dev/null and b/nwnds_module/fortskonz.git differ diff --git a/nwnds_module/foyerclose.ncs b/nwnds_module/foyerclose.ncs new file mode 100644 index 000000000..ed1e0c9d4 Binary files /dev/null and b/nwnds_module/foyerclose.ncs differ diff --git a/nwnds_module/foyerclose.nss b/nwnds_module/foyerclose.nss new file mode 100644 index 000000000..94ec4bf8c --- /dev/null +++ b/nwnds_module/foyerclose.nss @@ -0,0 +1,5 @@ +void main() +{ + DelayCommand(5.0,ActionCloseDoor(GetObjectByTag("ToFoyer"))); + DelayCommand(5.0,SetLocked(GetObjectByTag("ToFoyer"),TRUE)); +} diff --git a/nwnds_module/frostedpits.are b/nwnds_module/frostedpits.are new file mode 100644 index 000000000..bb8092c29 Binary files /dev/null and b/nwnds_module/frostedpits.are differ diff --git a/nwnds_module/frostedpits.gic b/nwnds_module/frostedpits.gic new file mode 100644 index 000000000..d1926d30a Binary files /dev/null and b/nwnds_module/frostedpits.gic differ diff --git a/nwnds_module/frostedpits.git b/nwnds_module/frostedpits.git new file mode 100644 index 000000000..6e1b8b252 Binary files /dev/null and b/nwnds_module/frostedpits.git differ diff --git a/nwnds_module/frozentimes.are b/nwnds_module/frozentimes.are new file mode 100644 index 000000000..2e9fd9329 Binary files /dev/null and b/nwnds_module/frozentimes.are differ diff --git a/nwnds_module/frozentimes.gic b/nwnds_module/frozentimes.gic new file mode 100644 index 000000000..da0c7ba16 Binary files /dev/null and b/nwnds_module/frozentimes.gic differ diff --git a/nwnds_module/frozentimes.git b/nwnds_module/frozentimes.git new file mode 100644 index 000000000..294d1b07e Binary files /dev/null and b/nwnds_module/frozentimes.git differ diff --git a/nwnds_module/ftamb_torasinn.are b/nwnds_module/ftamb_torasinn.are new file mode 100644 index 000000000..714389846 Binary files /dev/null and b/nwnds_module/ftamb_torasinn.are differ diff --git a/nwnds_module/ftamb_torasinn.gic b/nwnds_module/ftamb_torasinn.gic new file mode 100644 index 000000000..82cb2315d Binary files /dev/null and b/nwnds_module/ftamb_torasinn.gic differ diff --git a/nwnds_module/ftamb_torasinn.git b/nwnds_module/ftamb_torasinn.git new file mode 100644 index 000000000..2502b8bf9 Binary files /dev/null and b/nwnds_module/ftamb_torasinn.git differ diff --git a/nwnds_module/ftamb_weapons.are b/nwnds_module/ftamb_weapons.are new file mode 100644 index 000000000..b4127f637 Binary files /dev/null and b/nwnds_module/ftamb_weapons.are differ diff --git a/nwnds_module/ftamb_weapons.gic b/nwnds_module/ftamb_weapons.gic new file mode 100644 index 000000000..40a415f2b Binary files /dev/null and b/nwnds_module/ftamb_weapons.gic differ diff --git a/nwnds_module/ftamb_weapons.git b/nwnds_module/ftamb_weapons.git new file mode 100644 index 000000000..c49839239 Binary files /dev/null and b/nwnds_module/ftamb_weapons.git differ diff --git a/nwnds_module/ftamber_office.are b/nwnds_module/ftamber_office.are new file mode 100644 index 000000000..29ce3ad4d Binary files /dev/null and b/nwnds_module/ftamber_office.are differ diff --git a/nwnds_module/ftamber_office.gic b/nwnds_module/ftamber_office.gic new file mode 100644 index 000000000..ce88df2d2 Binary files /dev/null and b/nwnds_module/ftamber_office.gic differ diff --git a/nwnds_module/ftamber_office.git b/nwnds_module/ftamber_office.git new file mode 100644 index 000000000..0637ffefb Binary files /dev/null and b/nwnds_module/ftamber_office.git differ diff --git a/nwnds_module/ftsknz_kanksrest.are b/nwnds_module/ftsknz_kanksrest.are new file mode 100644 index 000000000..aa3838185 Binary files /dev/null and b/nwnds_module/ftsknz_kanksrest.are differ diff --git a/nwnds_module/ftsknz_kanksrest.gic b/nwnds_module/ftsknz_kanksrest.gic new file mode 100644 index 000000000..23b2f29e9 Binary files /dev/null and b/nwnds_module/ftsknz_kanksrest.gic differ diff --git a/nwnds_module/ftsknz_kanksrest.git b/nwnds_module/ftsknz_kanksrest.git new file mode 100644 index 000000000..ce95dade4 Binary files /dev/null and b/nwnds_module/ftsknz_kanksrest.git differ diff --git a/nwnds_module/ftsknz_office.are b/nwnds_module/ftsknz_office.are new file mode 100644 index 000000000..f2baa8477 Binary files /dev/null and b/nwnds_module/ftsknz_office.are differ diff --git a/nwnds_module/ftsknz_office.gic b/nwnds_module/ftsknz_office.gic new file mode 100644 index 000000000..cd7f84d38 Binary files /dev/null and b/nwnds_module/ftsknz_office.gic differ diff --git a/nwnds_module/ftsknz_office.git b/nwnds_module/ftsknz_office.git new file mode 100644 index 000000000..63c5ed6d8 Binary files /dev/null and b/nwnds_module/ftsknz_office.git differ diff --git a/nwnds_module/ftsknz_smithy.are b/nwnds_module/ftsknz_smithy.are new file mode 100644 index 000000000..f2b80f372 Binary files /dev/null and b/nwnds_module/ftsknz_smithy.are differ diff --git a/nwnds_module/ftsknz_smithy.gic b/nwnds_module/ftsknz_smithy.gic new file mode 100644 index 000000000..aae34d4d8 Binary files /dev/null and b/nwnds_module/ftsknz_smithy.gic differ diff --git a/nwnds_module/ftsknz_smithy.git b/nwnds_module/ftsknz_smithy.git new file mode 100644 index 000000000..b10268528 Binary files /dev/null and b/nwnds_module/ftsknz_smithy.git differ diff --git a/nwnds_module/g_crimsavanna_e.are b/nwnds_module/g_crimsavanna_e.are new file mode 100644 index 000000000..21a50d947 Binary files /dev/null and b/nwnds_module/g_crimsavanna_e.are differ diff --git a/nwnds_module/g_crimsavanna_e.gic b/nwnds_module/g_crimsavanna_e.gic new file mode 100644 index 000000000..17e6966bd Binary files /dev/null and b/nwnds_module/g_crimsavanna_e.gic differ diff --git a/nwnds_module/g_crimsavanna_e.git b/nwnds_module/g_crimsavanna_e.git new file mode 100644 index 000000000..59fb86358 Binary files /dev/null and b/nwnds_module/g_crimsavanna_e.git differ diff --git a/nwnds_module/g_crimsavanna_n.are b/nwnds_module/g_crimsavanna_n.are new file mode 100644 index 000000000..56f9a64ac Binary files /dev/null and b/nwnds_module/g_crimsavanna_n.are differ diff --git a/nwnds_module/g_crimsavanna_n.gic b/nwnds_module/g_crimsavanna_n.gic new file mode 100644 index 000000000..3d0d44065 Binary files /dev/null and b/nwnds_module/g_crimsavanna_n.gic differ diff --git a/nwnds_module/g_crimsavanna_n.git b/nwnds_module/g_crimsavanna_n.git new file mode 100644 index 000000000..98c6bff5c Binary files /dev/null and b/nwnds_module/g_crimsavanna_n.git differ diff --git a/nwnds_module/g_crimsavanna_w.are b/nwnds_module/g_crimsavanna_w.are new file mode 100644 index 000000000..13d54d369 Binary files /dev/null and b/nwnds_module/g_crimsavanna_w.are differ diff --git a/nwnds_module/g_crimsavanna_w.gic b/nwnds_module/g_crimsavanna_w.gic new file mode 100644 index 000000000..ed6e10233 Binary files /dev/null and b/nwnds_module/g_crimsavanna_w.gic differ diff --git a/nwnds_module/g_crimsavanna_w.git b/nwnds_module/g_crimsavanna_w.git new file mode 100644 index 000000000..27d7267c6 Binary files /dev/null and b/nwnds_module/g_crimsavanna_w.git differ diff --git a/nwnds_module/gasw_antcave_01.are b/nwnds_module/gasw_antcave_01.are new file mode 100644 index 000000000..af54e49bb Binary files /dev/null and b/nwnds_module/gasw_antcave_01.are differ diff --git a/nwnds_module/gasw_antcave_01.gic b/nwnds_module/gasw_antcave_01.gic new file mode 100644 index 000000000..427260f9d Binary files /dev/null and b/nwnds_module/gasw_antcave_01.gic differ diff --git a/nwnds_module/gasw_antcave_01.git b/nwnds_module/gasw_antcave_01.git new file mode 100644 index 000000000..a34458584 Binary files /dev/null and b/nwnds_module/gasw_antcave_01.git differ diff --git a/nwnds_module/gasw_belgoilair.are b/nwnds_module/gasw_belgoilair.are new file mode 100644 index 000000000..791140bef Binary files /dev/null and b/nwnds_module/gasw_belgoilair.are differ diff --git a/nwnds_module/gasw_belgoilair.gic b/nwnds_module/gasw_belgoilair.gic new file mode 100644 index 000000000..1ddaa0dbe Binary files /dev/null and b/nwnds_module/gasw_belgoilair.gic differ diff --git a/nwnds_module/gasw_belgoilair.git b/nwnds_module/gasw_belgoilair.git new file mode 100644 index 000000000..fafcfe432 Binary files /dev/null and b/nwnds_module/gasw_belgoilair.git differ diff --git a/nwnds_module/gasw_bloodsands.are b/nwnds_module/gasw_bloodsands.are new file mode 100644 index 000000000..e4104c2d6 Binary files /dev/null and b/nwnds_module/gasw_bloodsands.are differ diff --git a/nwnds_module/gasw_bloodsands.gic b/nwnds_module/gasw_bloodsands.gic new file mode 100644 index 000000000..b1d9f9b11 Binary files /dev/null and b/nwnds_module/gasw_bloodsands.gic differ diff --git a/nwnds_module/gasw_bloodsands.git b/nwnds_module/gasw_bloodsands.git new file mode 100644 index 000000000..6641b13b6 Binary files /dev/null and b/nwnds_module/gasw_bloodsands.git differ diff --git a/nwnds_module/gasw_bs_mastlair.are b/nwnds_module/gasw_bs_mastlair.are new file mode 100644 index 000000000..450ca40d0 Binary files /dev/null and b/nwnds_module/gasw_bs_mastlair.are differ diff --git a/nwnds_module/gasw_bs_mastlair.gic b/nwnds_module/gasw_bs_mastlair.gic new file mode 100644 index 000000000..fc55ec57f Binary files /dev/null and b/nwnds_module/gasw_bs_mastlair.gic differ diff --git a/nwnds_module/gasw_bs_mastlair.git b/nwnds_module/gasw_bs_mastlair.git new file mode 100644 index 000000000..0175b102b Binary files /dev/null and b/nwnds_module/gasw_bs_mastlair.git differ diff --git a/nwnds_module/gasw_deadcreek.are b/nwnds_module/gasw_deadcreek.are new file mode 100644 index 000000000..6d85d1451 Binary files /dev/null and b/nwnds_module/gasw_deadcreek.are differ diff --git a/nwnds_module/gasw_deadcreek.gic b/nwnds_module/gasw_deadcreek.gic new file mode 100644 index 000000000..b74cea7c9 Binary files /dev/null and b/nwnds_module/gasw_deadcreek.gic differ diff --git a/nwnds_module/gasw_deadcreek.git b/nwnds_module/gasw_deadcreek.git new file mode 100644 index 000000000..2c47cf058 Binary files /dev/null and b/nwnds_module/gasw_deadcreek.git differ diff --git a/nwnds_module/gasw_defiled.are b/nwnds_module/gasw_defiled.are new file mode 100644 index 000000000..7635bb216 Binary files /dev/null and b/nwnds_module/gasw_defiled.are differ diff --git a/nwnds_module/gasw_defiled.gic b/nwnds_module/gasw_defiled.gic new file mode 100644 index 000000000..716e55fab Binary files /dev/null and b/nwnds_module/gasw_defiled.gic differ diff --git a/nwnds_module/gasw_defiled.git b/nwnds_module/gasw_defiled.git new file mode 100644 index 000000000..37954a1e4 Binary files /dev/null and b/nwnds_module/gasw_defiled.git differ diff --git a/nwnds_module/gasw_drywellmine.are b/nwnds_module/gasw_drywellmine.are new file mode 100644 index 000000000..aa4aba2af Binary files /dev/null and b/nwnds_module/gasw_drywellmine.are differ diff --git a/nwnds_module/gasw_drywellmine.gic b/nwnds_module/gasw_drywellmine.gic new file mode 100644 index 000000000..1555f1bf4 Binary files /dev/null and b/nwnds_module/gasw_drywellmine.gic differ diff --git a/nwnds_module/gasw_drywellmine.git b/nwnds_module/gasw_drywellmine.git new file mode 100644 index 000000000..d5a9844ce Binary files /dev/null and b/nwnds_module/gasw_drywellmine.git differ diff --git a/nwnds_module/gasw_elvenoasis.are b/nwnds_module/gasw_elvenoasis.are new file mode 100644 index 000000000..a2a9b8687 Binary files /dev/null and b/nwnds_module/gasw_elvenoasis.are differ diff --git a/nwnds_module/gasw_elvenoasis.gic b/nwnds_module/gasw_elvenoasis.gic new file mode 100644 index 000000000..b362a68a4 Binary files /dev/null and b/nwnds_module/gasw_elvenoasis.gic differ diff --git a/nwnds_module/gasw_elvenoasis.git b/nwnds_module/gasw_elvenoasis.git new file mode 100644 index 000000000..c472d8215 Binary files /dev/null and b/nwnds_module/gasw_elvenoasis.git differ diff --git a/nwnds_module/gasw_greatspyre.are b/nwnds_module/gasw_greatspyre.are new file mode 100644 index 000000000..8fd24ef7e Binary files /dev/null and b/nwnds_module/gasw_greatspyre.are differ diff --git a/nwnds_module/gasw_greatspyre.gic b/nwnds_module/gasw_greatspyre.gic new file mode 100644 index 000000000..632a38b1f Binary files /dev/null and b/nwnds_module/gasw_greatspyre.gic differ diff --git a/nwnds_module/gasw_greatspyre.git b/nwnds_module/gasw_greatspyre.git new file mode 100644 index 000000000..086cf94b2 Binary files /dev/null and b/nwnds_module/gasw_greatspyre.git differ diff --git a/nwnds_module/gasw_nomadcamp.are b/nwnds_module/gasw_nomadcamp.are new file mode 100644 index 000000000..13472bf43 Binary files /dev/null and b/nwnds_module/gasw_nomadcamp.are differ diff --git a/nwnds_module/gasw_nomadcamp.gic b/nwnds_module/gasw_nomadcamp.gic new file mode 100644 index 000000000..437486bf5 Binary files /dev/null and b/nwnds_module/gasw_nomadcamp.gic differ diff --git a/nwnds_module/gasw_nomadcamp.git b/nwnds_module/gasw_nomadcamp.git new file mode 100644 index 000000000..6a7b2ba59 Binary files /dev/null and b/nwnds_module/gasw_nomadcamp.git differ diff --git a/nwnds_module/gasw_northex_01.are b/nwnds_module/gasw_northex_01.are new file mode 100644 index 000000000..6efce2248 Binary files /dev/null and b/nwnds_module/gasw_northex_01.are differ diff --git a/nwnds_module/gasw_northex_01.gic b/nwnds_module/gasw_northex_01.gic new file mode 100644 index 000000000..e97681b16 Binary files /dev/null and b/nwnds_module/gasw_northex_01.gic differ diff --git a/nwnds_module/gasw_northex_01.git b/nwnds_module/gasw_northex_01.git new file mode 100644 index 000000000..bc2e20808 Binary files /dev/null and b/nwnds_module/gasw_northex_01.git differ diff --git a/nwnds_module/gasw_northex_02.are b/nwnds_module/gasw_northex_02.are new file mode 100644 index 000000000..cf2bb3c4a Binary files /dev/null and b/nwnds_module/gasw_northex_02.are differ diff --git a/nwnds_module/gasw_northex_02.gic b/nwnds_module/gasw_northex_02.gic new file mode 100644 index 000000000..3e6ca0c0d Binary files /dev/null and b/nwnds_module/gasw_northex_02.gic differ diff --git a/nwnds_module/gasw_northex_02.git b/nwnds_module/gasw_northex_02.git new file mode 100644 index 000000000..6614c13d0 Binary files /dev/null and b/nwnds_module/gasw_northex_02.git differ diff --git a/nwnds_module/gasw_northex_03.are b/nwnds_module/gasw_northex_03.are new file mode 100644 index 000000000..7a2b913ce Binary files /dev/null and b/nwnds_module/gasw_northex_03.are differ diff --git a/nwnds_module/gasw_northex_03.gic b/nwnds_module/gasw_northex_03.gic new file mode 100644 index 000000000..01f09be8d Binary files /dev/null and b/nwnds_module/gasw_northex_03.gic differ diff --git a/nwnds_module/gasw_northex_03.git b/nwnds_module/gasw_northex_03.git new file mode 100644 index 000000000..bf062c8a4 Binary files /dev/null and b/nwnds_module/gasw_northex_03.git differ diff --git a/nwnds_module/gasw_oasis.are b/nwnds_module/gasw_oasis.are new file mode 100644 index 000000000..2cdb33a05 Binary files /dev/null and b/nwnds_module/gasw_oasis.are differ diff --git a/nwnds_module/gasw_oasis.gic b/nwnds_module/gasw_oasis.gic new file mode 100644 index 000000000..8062baca1 Binary files /dev/null and b/nwnds_module/gasw_oasis.gic differ diff --git a/nwnds_module/gasw_oasis.git b/nwnds_module/gasw_oasis.git new file mode 100644 index 000000000..98d140a91 Binary files /dev/null and b/nwnds_module/gasw_oasis.git differ diff --git a/nwnds_module/gasw_oldamber001.are b/nwnds_module/gasw_oldamber001.are new file mode 100644 index 000000000..1d608c91e Binary files /dev/null and b/nwnds_module/gasw_oldamber001.are differ diff --git a/nwnds_module/gasw_oldamber001.gic b/nwnds_module/gasw_oldamber001.gic new file mode 100644 index 000000000..9a99fc2f8 Binary files /dev/null and b/nwnds_module/gasw_oldamber001.gic differ diff --git a/nwnds_module/gasw_oldamber001.git b/nwnds_module/gasw_oldamber001.git new file mode 100644 index 000000000..f9d8718e5 Binary files /dev/null and b/nwnds_module/gasw_oldamber001.git differ diff --git a/nwnds_module/gasw_redsands.are b/nwnds_module/gasw_redsands.are new file mode 100644 index 000000000..fdd5a9914 Binary files /dev/null and b/nwnds_module/gasw_redsands.are differ diff --git a/nwnds_module/gasw_redsands.gic b/nwnds_module/gasw_redsands.gic new file mode 100644 index 000000000..53fff0655 Binary files /dev/null and b/nwnds_module/gasw_redsands.gic differ diff --git a/nwnds_module/gasw_redsands.git b/nwnds_module/gasw_redsands.git new file mode 100644 index 000000000..b6620b6eb Binary files /dev/null and b/nwnds_module/gasw_redsands.git differ diff --git a/nwnds_module/gasw_shiftsands.are b/nwnds_module/gasw_shiftsands.are new file mode 100644 index 000000000..faca8212f Binary files /dev/null and b/nwnds_module/gasw_shiftsands.are differ diff --git a/nwnds_module/gasw_shiftsands.gic b/nwnds_module/gasw_shiftsands.gic new file mode 100644 index 000000000..f1a884154 Binary files /dev/null and b/nwnds_module/gasw_shiftsands.gic differ diff --git a/nwnds_module/gasw_shiftsands.git b/nwnds_module/gasw_shiftsands.git new file mode 100644 index 000000000..eac980d9f Binary files /dev/null and b/nwnds_module/gasw_shiftsands.git differ diff --git a/nwnds_module/gasw_the_wastes.are b/nwnds_module/gasw_the_wastes.are new file mode 100644 index 000000000..c49683e23 Binary files /dev/null and b/nwnds_module/gasw_the_wastes.are differ diff --git a/nwnds_module/gasw_the_wastes.gic b/nwnds_module/gasw_the_wastes.gic new file mode 100644 index 000000000..878dab598 Binary files /dev/null and b/nwnds_module/gasw_the_wastes.gic differ diff --git a/nwnds_module/gasw_the_wastes.git b/nwnds_module/gasw_the_wastes.git new file mode 100644 index 000000000..d8e2af6e0 Binary files /dev/null and b/nwnds_module/gasw_the_wastes.git differ diff --git a/nwnds_module/gasw_tradert01.are b/nwnds_module/gasw_tradert01.are new file mode 100644 index 000000000..dc7045839 Binary files /dev/null and b/nwnds_module/gasw_tradert01.are differ diff --git a/nwnds_module/gasw_tradert01.gic b/nwnds_module/gasw_tradert01.gic new file mode 100644 index 000000000..0dc3ca321 Binary files /dev/null and b/nwnds_module/gasw_tradert01.gic differ diff --git a/nwnds_module/gasw_tradert01.git b/nwnds_module/gasw_tradert01.git new file mode 100644 index 000000000..1ee46adf7 Binary files /dev/null and b/nwnds_module/gasw_tradert01.git differ diff --git a/nwnds_module/gasw_tradert02.are b/nwnds_module/gasw_tradert02.are new file mode 100644 index 000000000..cfdec89fb Binary files /dev/null and b/nwnds_module/gasw_tradert02.are differ diff --git a/nwnds_module/gasw_tradert02.gic b/nwnds_module/gasw_tradert02.gic new file mode 100644 index 000000000..be94a89ce Binary files /dev/null and b/nwnds_module/gasw_tradert02.gic differ diff --git a/nwnds_module/gasw_tradert02.git b/nwnds_module/gasw_tradert02.git new file mode 100644 index 000000000..97c408af2 Binary files /dev/null and b/nwnds_module/gasw_tradert02.git differ diff --git a/nwnds_module/gasw_tradert03.are b/nwnds_module/gasw_tradert03.are new file mode 100644 index 000000000..23c73f9b2 Binary files /dev/null and b/nwnds_module/gasw_tradert03.are differ diff --git a/nwnds_module/gasw_tradert03.gic b/nwnds_module/gasw_tradert03.gic new file mode 100644 index 000000000..90e7f2453 Binary files /dev/null and b/nwnds_module/gasw_tradert03.gic differ diff --git a/nwnds_module/gasw_tradert03.git b/nwnds_module/gasw_tradert03.git new file mode 100644 index 000000000..bd7787a26 Binary files /dev/null and b/nwnds_module/gasw_tradert03.git differ diff --git a/nwnds_module/gasw_tradert04.are b/nwnds_module/gasw_tradert04.are new file mode 100644 index 000000000..f98edc5da Binary files /dev/null and b/nwnds_module/gasw_tradert04.are differ diff --git a/nwnds_module/gasw_tradert04.gic b/nwnds_module/gasw_tradert04.gic new file mode 100644 index 000000000..f9d523888 Binary files /dev/null and b/nwnds_module/gasw_tradert04.gic differ diff --git a/nwnds_module/gasw_tradert04.git b/nwnds_module/gasw_tradert04.git new file mode 100644 index 000000000..45307b32c Binary files /dev/null and b/nwnds_module/gasw_tradert04.git differ diff --git a/nwnds_module/gasw_tradert05.are b/nwnds_module/gasw_tradert05.are new file mode 100644 index 000000000..fe2bfe073 Binary files /dev/null and b/nwnds_module/gasw_tradert05.are differ diff --git a/nwnds_module/gasw_tradert05.gic b/nwnds_module/gasw_tradert05.gic new file mode 100644 index 000000000..33a0bbe33 Binary files /dev/null and b/nwnds_module/gasw_tradert05.gic differ diff --git a/nwnds_module/gasw_tradert05.git b/nwnds_module/gasw_tradert05.git new file mode 100644 index 000000000..8ce9d9a8c Binary files /dev/null and b/nwnds_module/gasw_tradert05.git differ diff --git a/nwnds_module/gasw_tradert06.are b/nwnds_module/gasw_tradert06.are new file mode 100644 index 000000000..5587ea249 Binary files /dev/null and b/nwnds_module/gasw_tradert06.are differ diff --git a/nwnds_module/gasw_tradert06.gic b/nwnds_module/gasw_tradert06.gic new file mode 100644 index 000000000..f9d523888 Binary files /dev/null and b/nwnds_module/gasw_tradert06.gic differ diff --git a/nwnds_module/gasw_tradert06.git b/nwnds_module/gasw_tradert06.git new file mode 100644 index 000000000..db0597558 Binary files /dev/null and b/nwnds_module/gasw_tradert06.git differ diff --git a/nwnds_module/gasw_wd_the_hill.are b/nwnds_module/gasw_wd_the_hill.are new file mode 100644 index 000000000..48c38b24f Binary files /dev/null and b/nwnds_module/gasw_wd_the_hill.are differ diff --git a/nwnds_module/gasw_wd_the_hill.gic b/nwnds_module/gasw_wd_the_hill.gic new file mode 100644 index 000000000..ec9cb92c5 Binary files /dev/null and b/nwnds_module/gasw_wd_the_hill.gic differ diff --git a/nwnds_module/gasw_wd_the_hill.git b/nwnds_module/gasw_wd_the_hill.git new file mode 100644 index 000000000..44bb73215 Binary files /dev/null and b/nwnds_module/gasw_wd_the_hill.git differ diff --git a/nwnds_module/gasw_wd_undrhill.are b/nwnds_module/gasw_wd_undrhill.are new file mode 100644 index 000000000..b8765da5a Binary files /dev/null and b/nwnds_module/gasw_wd_undrhill.are differ diff --git a/nwnds_module/gasw_wd_undrhill.gic b/nwnds_module/gasw_wd_undrhill.gic new file mode 100644 index 000000000..cbcdf2fc5 Binary files /dev/null and b/nwnds_module/gasw_wd_undrhill.gic differ diff --git a/nwnds_module/gasw_wd_undrhill.git b/nwnds_module/gasw_wd_undrhill.git new file mode 100644 index 000000000..7e9a1ca25 Binary files /dev/null and b/nwnds_module/gasw_wd_undrhill.git differ diff --git a/nwnds_module/gatetrigger.ncs b/nwnds_module/gatetrigger.ncs new file mode 100644 index 000000000..edaf0b78f Binary files /dev/null and b/nwnds_module/gatetrigger.ncs differ diff --git a/nwnds_module/gatetrigger.nss b/nwnds_module/gatetrigger.nss new file mode 100644 index 000000000..fc5f27f0a --- /dev/null +++ b/nwnds_module/gatetrigger.nss @@ -0,0 +1,29 @@ +//****************************************************************************** +//* stargatish portal script put on_disturbed for dhd +//* written by BWW aka Lord Nikon +//* 12/05/04 +//* Triggers the gate transition when player steps across it +//****************************************************************************** + +void main() +{ +object oPC = GetEnteringObject(); +location oTarget = GetLocalLocation(oPC,"GATEADDY"); +object oGATE = GetLocalObject(oPC,"GATETARGET"); +object oOFF = GetNearestObjectByTag("stargate_on"); +location lOFF = GetLocation(oOFF); +object oON = GetNearestObjectByTag("stargate_on",oGATE); +location lON = GetLocation(oON); +object oONE; + //turns off gates 20 sec after they step through + //local gate + DestroyObject(oOFF,20.0); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_off",lOFF); + //destination gate + DestroyObject(oON,20.0); + CreateObject(OBJECT_TYPE_PLACEABLE,"stargate_off",lON); +//transports pc +AssignCommand(oPC,ActionJumpToLocation(oTarget)); +//resets code +SetCampaignString("SPENCER","sCode","",oPC); +} diff --git a/nwnds_module/gen_inc_color.nss b/nwnds_module/gen_inc_color.nss new file mode 100644 index 000000000..3a6f69957 --- /dev/null +++ b/nwnds_module/gen_inc_color.nss @@ -0,0 +1,66 @@ +// Genji Include Color gen_inc_color +// first: 1-4-03 + +// requires a waypoint called "dm_vault_drop" in a dm only area, +// and genji's coloring book placeable "gen_coloringbook". Which should have been downloaded with this. + +// --------------------------------------------------------------[ function prototypes ] + +// simple function to use the name of a item holding escape sequences that, though they will not compile, +// they can be interpreted at run time and produce rbg scales between 32 and 255 in increments. +// -- allows 3375 colors to be made. +// for example SendMessageToPC(pc,GetRGB(15,15,1)+ "Help, I'm on fire!") will produce yellow text. +// more examples: +/* + GetRGB() := WHITE // no parameters, default is white + GetRGB(15,15,1):= YELLOW + GetRGB(15,5,1) := ORANGE + GetRGB(15,1,1) := RED + GetRGB(7,7,15) := BLUE + GetRGB(1,15,1) := NEON GREEN + GetRGB(1,11,1) := GREEN + GetRGB(9,6,1) := BROWN + GetRGB(11,9,11):= LIGHT PURPLE + GetRGB(12,10,7):= TAN + GetRGB(8,1,8) := PURPLE + GetRGB(13,9,13):= PLUM + GetRGB(1,7,7) := TEAL + GetRGB(1,15,15):= CYAN + GetRGB(1,1,15) := BRIGHT BLUE +*/ +// issues? contact genji@thegenji.com +// special thanks to ADAL-Miko and Rich Dersheimer in the bio forums. +#include "wow_inc_headers" +// --------------------------------------------------------------[ function implementations ] +string GetTextColor(string sColor = "WHITE") +{ + string sReturn; + if(sColor == "WHITE") sReturn = GetRGB(); + else if(sColor == "YELLOW") sReturn = GetRGB(15, 15, 1); + else if(sColor == "ORANGE") sReturn = GetRGB(15, 5, 1); + else if(sColor == "RED") sReturn = GetRGB(15, 1, 1); + else if(sColor == "BLUE") sReturn = GetRGB(7, 7, 15); + else if(sColor == "NEON_GREEN") sReturn = GetRGB(1, 15, 1); + else if(sColor == "GREEN") sReturn = GetRGB(1, 11, 1); + else if(sColor == "BROWN") sReturn = GetRGB(9, 6, 1); + else if(sColor == "LIGHT_PURPLE") sReturn = GetRGB(11, 9, 11); + else if(sColor == "TAN") sReturn = GetRGB(12, 10, 7); + else if(sColor == "PURPLE") sReturn = GetRGB(8, 1, 8); + else if(sColor == "PLUM") sReturn = GetRGB(13, 9, 13); + else if(sColor == "TEAL") sReturn = GetRGB(1, 7, 7); + else if(sColor == "CYAN") sReturn = GetRGB(1, 15, 15); + else if(sColor == "BRIGHT_BLUE") sReturn = GetRGB(1, 1, 15); + return sReturn; +} + +string GetRGB(int red = 15,int green = 15,int blue = 15) +{ + object coloringBook = GetObjectByTag("Gen_ColoringBook"); + if (coloringBook == OBJECT_INVALID) + coloringBook = CreateObject(OBJECT_TYPE_ITEM,"gen_coloringbook",GetLocation(GetWaypointByTag("DM_ONLY_AREA"))); + string buffer = GetName(coloringBook); + if(red > 15) red = 15; if(green > 15) green = 15; if(blue > 15) blue = 15; + return ""; +} + +//void main () {} diff --git a/nwnds_module/gfiresnakesla.uti b/nwnds_module/gfiresnakesla.uti new file mode 100644 index 000000000..a744d388a Binary files /dev/null and b/nwnds_module/gfiresnakesla.uti differ diff --git a/nwnds_module/gfiresnaketai.uti b/nwnds_module/gfiresnaketai.uti new file mode 100644 index 000000000..a4effac3c Binary files /dev/null and b/nwnds_module/gfiresnaketai.uti differ diff --git a/nwnds_module/gh_anvilcracker.are b/nwnds_module/gh_anvilcracker.are new file mode 100644 index 000000000..1ca31242b Binary files /dev/null and b/nwnds_module/gh_anvilcracker.are differ diff --git a/nwnds_module/gh_anvilcracker.gic b/nwnds_module/gh_anvilcracker.gic new file mode 100644 index 000000000..e793a35b4 Binary files /dev/null and b/nwnds_module/gh_anvilcracker.gic differ diff --git a/nwnds_module/gh_anvilcracker.git b/nwnds_module/gh_anvilcracker.git new file mode 100644 index 000000000..79742c82b Binary files /dev/null and b/nwnds_module/gh_anvilcracker.git differ diff --git a/nwnds_module/gh_crafters.are b/nwnds_module/gh_crafters.are new file mode 100644 index 000000000..ccd1a8bbf Binary files /dev/null and b/nwnds_module/gh_crafters.are differ diff --git a/nwnds_module/gh_crafters.gic b/nwnds_module/gh_crafters.gic new file mode 100644 index 000000000..f0f39b93e Binary files /dev/null and b/nwnds_module/gh_crafters.gic differ diff --git a/nwnds_module/gh_crafters.git b/nwnds_module/gh_crafters.git new file mode 100644 index 000000000..04525cdc5 Binary files /dev/null and b/nwnds_module/gh_crafters.git differ diff --git a/nwnds_module/gh_crimsonlegion.are b/nwnds_module/gh_crimsonlegion.are new file mode 100644 index 000000000..06d75649f Binary files /dev/null and b/nwnds_module/gh_crimsonlegion.are differ diff --git a/nwnds_module/gh_crimsonlegion.gic b/nwnds_module/gh_crimsonlegion.gic new file mode 100644 index 000000000..f0e8a9104 Binary files /dev/null and b/nwnds_module/gh_crimsonlegion.gic differ diff --git a/nwnds_module/gh_crimsonlegion.git b/nwnds_module/gh_crimsonlegion.git new file mode 100644 index 000000000..169b33fc8 Binary files /dev/null and b/nwnds_module/gh_crimsonlegion.git differ diff --git a/nwnds_module/gh_ebonheart.are b/nwnds_module/gh_ebonheart.are new file mode 100644 index 000000000..432739222 Binary files /dev/null and b/nwnds_module/gh_ebonheart.are differ diff --git a/nwnds_module/gh_ebonheart.gic b/nwnds_module/gh_ebonheart.gic new file mode 100644 index 000000000..b376651e0 Binary files /dev/null and b/nwnds_module/gh_ebonheart.gic differ diff --git a/nwnds_module/gh_ebonheart.git b/nwnds_module/gh_ebonheart.git new file mode 100644 index 000000000..ea4155c9d Binary files /dev/null and b/nwnds_module/gh_ebonheart.git differ diff --git a/nwnds_module/gh_houseironclaw.are b/nwnds_module/gh_houseironclaw.are new file mode 100644 index 000000000..661d2e3a7 Binary files /dev/null and b/nwnds_module/gh_houseironclaw.are differ diff --git a/nwnds_module/gh_houseironclaw.gic b/nwnds_module/gh_houseironclaw.gic new file mode 100644 index 000000000..eb33d99a5 Binary files /dev/null and b/nwnds_module/gh_houseironclaw.gic differ diff --git a/nwnds_module/gh_houseironclaw.git b/nwnds_module/gh_houseironclaw.git new file mode 100644 index 000000000..3b01a76aa Binary files /dev/null and b/nwnds_module/gh_houseironclaw.git differ diff --git a/nwnds_module/gh_lowlifecabal.are b/nwnds_module/gh_lowlifecabal.are new file mode 100644 index 000000000..080ab05c2 Binary files /dev/null and b/nwnds_module/gh_lowlifecabal.are differ diff --git a/nwnds_module/gh_lowlifecabal.gic b/nwnds_module/gh_lowlifecabal.gic new file mode 100644 index 000000000..ca4ac6eb6 Binary files /dev/null and b/nwnds_module/gh_lowlifecabal.gic differ diff --git a/nwnds_module/gh_lowlifecabal.git b/nwnds_module/gh_lowlifecabal.git new file mode 100644 index 000000000..4f9da3e3c Binary files /dev/null and b/nwnds_module/gh_lowlifecabal.git differ diff --git a/nwnds_module/ghast001.utc b/nwnds_module/ghast001.utc new file mode 100644 index 000000000..25153dce5 Binary files /dev/null and b/nwnds_module/ghast001.utc differ diff --git a/nwnds_module/ghast002.utc b/nwnds_module/ghast002.utc new file mode 100644 index 000000000..a3f421929 Binary files /dev/null and b/nwnds_module/ghast002.utc differ diff --git a/nwnds_module/ghast003.utc b/nwnds_module/ghast003.utc new file mode 100644 index 000000000..be6d65b65 Binary files /dev/null and b/nwnds_module/ghast003.utc differ diff --git a/nwnds_module/ghast_stench.ncs b/nwnds_module/ghast_stench.ncs new file mode 100644 index 000000000..33a4f72b6 Binary files /dev/null and b/nwnds_module/ghast_stench.ncs differ diff --git a/nwnds_module/ghast_stench.nss b/nwnds_module/ghast_stench.nss new file mode 100644 index 000000000..f109ca475 --- /dev/null +++ b/nwnds_module/ghast_stench.nss @@ -0,0 +1,16 @@ +//:: +//:: Ghast_stench +//:: +//:: A pnp version of the Ghast's sickening stench. +//:: +//:: Modified by: DM Heatstroke 01-20-11 +//:: + +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_TYRANT_FOG,"ghast_stench1","null","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/ghast_stench1.ncs b/nwnds_module/ghast_stench1.ncs new file mode 100644 index 000000000..fdc51f635 Binary files /dev/null and b/nwnds_module/ghast_stench1.ncs differ diff --git a/nwnds_module/ghast_stench1.nss b/nwnds_module/ghast_stench1.nss new file mode 100644 index 000000000..24e72bfe6 --- /dev/null +++ b/nwnds_module/ghast_stench1.nss @@ -0,0 +1,59 @@ +//:: +//:: Ghast_stench1 +//:: +//:: A pnp version of the Ghast's sickening stench. +//:: Aura OnEnter script +//:: +//:: Modified by: DM Heatstroke 01-20-11 +//:: + +#include "NW_I0_SPELLS" + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + int nLevel = GetHitDice(oCaster); + int nDC = 10 + nLevel / 2 + GetAbilityModifier(ABILITY_CHARISMA,oCaster); + + float fDuration = TurnsToSeconds(d6()+4); + string sImmune = "GHAST_IMMUNE"; + + if ( !GetIsEnemy(oTarget,oCaster) || + oTarget == oCaster || + GetIsImmune(oTarget, IMMUNITY_TYPE_POISON) || + GetLocalInt(oTarget, sImmune) ) + + return; + + //:: Setup Sickening effect + effect eSick1 = EffectAttackDecrease(2); + effect eSick2 = EffectDamageDecrease(2,DAMAGE_TYPE_MAGICAL); + effect eSick3 = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2, SAVING_THROW_TYPE_ALL); + effect eSick4 = EffectSkillDecrease(SKILL_ALL_SKILLS, 2); + + //:: Setup visuals + effect eImp = EffectVisualEffect(VFX_IMP_POISON_S); + effect eVis1 = EffectVisualEffect(VFX_DUR_FLIES); + effect eVis2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + //:: Setup EffectLink + effect eSick = EffectLinkEffects(eSick1, eSick2); + eSick = EffectLinkEffects(eSick, eSick3); + eSick = EffectLinkEffects(eSick, eSick4); + eSick = EffectLinkEffects(eSick, eVis1); + eSick = EffectLinkEffects(eSick, eVis2); + eSick = ExtraordinaryEffect(eSick); + + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_POISON, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eImp, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSick, oTarget, fDuration); + } + else + { + SetLocalInt(oTarget, sImmune, 1); + } + +} diff --git a/nwnds_module/ghastbite001.uti b/nwnds_module/ghastbite001.uti new file mode 100644 index 000000000..3d60fda1d Binary files /dev/null and b/nwnds_module/ghastbite001.uti differ diff --git a/nwnds_module/ghastclaw001.uti b/nwnds_module/ghastclaw001.uti new file mode 100644 index 000000000..0b3f5e075 Binary files /dev/null and b/nwnds_module/ghastclaw001.uti differ diff --git a/nwnds_module/ghosttouch.uti b/nwnds_module/ghosttouch.uti new file mode 100644 index 000000000..04c56b13f Binary files /dev/null and b/nwnds_module/ghosttouch.uti differ diff --git a/nwnds_module/ghoul001.utc b/nwnds_module/ghoul001.utc new file mode 100644 index 000000000..9269d8f9a Binary files /dev/null and b/nwnds_module/ghoul001.utc differ diff --git a/nwnds_module/ghoul_bite.ncs b/nwnds_module/ghoul_bite.ncs new file mode 100644 index 000000000..fe9a8cad0 Binary files /dev/null and b/nwnds_module/ghoul_bite.ncs differ diff --git a/nwnds_module/ghoul_bite.nss b/nwnds_module/ghoul_bite.nss new file mode 100644 index 000000000..496b1ffac --- /dev/null +++ b/nwnds_module/ghoul_bite.nss @@ -0,0 +1,53 @@ +//:: +//:: Ghoul_touch +//:: +//:: A pnp version of the Ghoul's diseased & paralytic bite. +//:: +//:: Modified by: DM Heatstroke 01-19-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoGhoulBite(object oTarget, object oCaster) +{ // Setup disease + effect eVis1 = EffectVisualEffect(VFX_IMP_DISEASE_S); + effect eDisease = EffectDisease(DISEASE_GHOUL_ROT); + eDisease = ExtraordinaryEffect(eDisease); + effect eSick = EffectLinkEffects(eDisease, eVis1); + + // Setup paralytic touch + effect eVis2 = EffectVisualEffect(VFX_DUR_PARALYZED); + float fDuration = RoundsToSeconds(d4()+1); + effect eParalyze = EffectParalyze(); + eParalyze = ExtraordinaryEffect(eParalyze); + effect eStun = EffectLinkEffects(eParalyze, eVis2); + + // Get oCaster's Bite DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nBiteDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw to resist the paralytic touch + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nBiteDC, SAVING_THROW_TYPE_NONE, oCaster) && + !GetHasFeat(4711, oTarget) && // PRC Elven feat + !GetHasFeat(256, oTarget) ) // Bioware Weapon Prof: Elf + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStun, oTarget, fDuration); + } + + // Roll a saving throw to resist the diseased bite + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nBiteDC, SAVING_THROW_TYPE_DISEASE, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSick, oTarget); + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + + DelayCommand(0.1,DoGhoulBite(oTarget,oCaster)); + +} diff --git a/nwnds_module/ghoul_claw.ncs b/nwnds_module/ghoul_claw.ncs new file mode 100644 index 000000000..df6d5a308 Binary files /dev/null and b/nwnds_module/ghoul_claw.ncs differ diff --git a/nwnds_module/ghoul_claw.nss b/nwnds_module/ghoul_claw.nss new file mode 100644 index 000000000..4ae4f9416 --- /dev/null +++ b/nwnds_module/ghoul_claw.nss @@ -0,0 +1,42 @@ +//:: +//:: Ghoul_claw +//:: +//:: A pnp version of the Ghoul's paralytic claws. +//:: +//:: Modified by: DM Heatstroke 01-19-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoGhoulClaw(object oTarget, object oCaster) +{ // Setup paralytic touch + effect eVis = EffectVisualEffect(VFX_DUR_PARALYZED); + float fDuration = RoundsToSeconds(d4()+1); + effect eParalyze = EffectParalyze(); + eParalyze = ExtraordinaryEffect(eParalyze); + effect eStun = EffectLinkEffects(eParalyze, eVis); + + // Get oCaster's Bite DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nBiteDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw to resist the paralytic touch + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nBiteDC, SAVING_THROW_TYPE_NONE, oCaster) && + !GetHasFeat(4711, oTarget) && // PRC Elven feat + !GetHasFeat(256, oTarget) ) // Bioware Weapon Prof: Elf + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStun, oTarget, fDuration); + } + +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + + DelayCommand(0.1,DoGhoulClaw(oTarget,oCaster)); + +} diff --git a/nwnds_module/ghoulbite001.uti b/nwnds_module/ghoulbite001.uti new file mode 100644 index 000000000..4192ddc34 Binary files /dev/null and b/nwnds_module/ghoulbite001.uti differ diff --git a/nwnds_module/ghoulclaw001.uti b/nwnds_module/ghoulclaw001.uti new file mode 100644 index 000000000..c694cee5e Binary files /dev/null and b/nwnds_module/ghoulclaw001.uti differ diff --git a/nwnds_module/ghoulspawn.utc b/nwnds_module/ghoulspawn.utc new file mode 100644 index 000000000..f736a1a1a Binary files /dev/null and b/nwnds_module/ghoulspawn.utc differ diff --git a/nwnds_module/giant_slug_hide.uti b/nwnds_module/giant_slug_hide.uti new file mode 100644 index 000000000..28f819cf3 Binary files /dev/null and b/nwnds_module/giant_slug_hide.uti differ diff --git a/nwnds_module/giantashen001.utc b/nwnds_module/giantashen001.utc new file mode 100644 index 000000000..9c8fbbdd1 Binary files /dev/null and b/nwnds_module/giantashen001.utc differ diff --git a/nwnds_module/giantashen002.utc b/nwnds_module/giantashen002.utc new file mode 100644 index 000000000..0412234ea Binary files /dev/null and b/nwnds_module/giantashen002.utc differ diff --git a/nwnds_module/giantdesert001.utc b/nwnds_module/giantdesert001.utc new file mode 100644 index 000000000..362fb7161 Binary files /dev/null and b/nwnds_module/giantdesert001.utc differ diff --git a/nwnds_module/giantleechbite.ncs b/nwnds_module/giantleechbite.ncs new file mode 100644 index 000000000..4f82cea33 Binary files /dev/null and b/nwnds_module/giantleechbite.ncs differ diff --git a/nwnds_module/giantleechbite.nss b/nwnds_module/giantleechbite.nss new file mode 100644 index 000000000..4a36f56f3 --- /dev/null +++ b/nwnds_module/giantleechbite.nss @@ -0,0 +1,59 @@ +// Giant Leech's Blooddrain Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nConDrain = d4(1); + int nSTR_Target; + int nSTR_Creature; + int nLeechFull; + effect eLeechOn = EffectMovementSpeedIncrease(99); + effect eLeechOff = EffectMovementSpeedDecrease(99); + effect eBloodDrain = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Tiny & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_TINY || + GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Drain 1d4 points of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodDrain, oTarget); + +// Increase the tick's speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLeechOn, oPC); + +// When the tick drains 4 CON worth of blood it will detach & run away. + if (nLeechFull >= 4) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLeechOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nLeechFull = nLeechFull + nConDrain; + +FloatingTextStringOnCreature("The leech is draining your blood!", oTarget); + + } diff --git a/nwnds_module/giantleechbite.uti b/nwnds_module/giantleechbite.uti new file mode 100644 index 000000000..6ada4e5ff Binary files /dev/null and b/nwnds_module/giantleechbite.uti differ diff --git a/nwnds_module/giantplains001.utc b/nwnds_module/giantplains001.utc new file mode 100644 index 000000000..6aeb5cb80 Binary files /dev/null and b/nwnds_module/giantplains001.utc differ diff --git a/nwnds_module/giantshadow001.utc b/nwnds_module/giantshadow001.utc new file mode 100644 index 000000000..ec1e3b29b Binary files /dev/null and b/nwnds_module/giantshadow001.utc differ diff --git a/nwnds_module/giantsharness.uti b/nwnds_module/giantsharness.uti new file mode 100644 index 000000000..71d1fe487 Binary files /dev/null and b/nwnds_module/giantsharness.uti differ diff --git a/nwnds_module/gianttickbite.ncs b/nwnds_module/gianttickbite.ncs new file mode 100644 index 000000000..608ad4ca2 Binary files /dev/null and b/nwnds_module/gianttickbite.ncs differ diff --git a/nwnds_module/gianttickbite.nss b/nwnds_module/gianttickbite.nss new file mode 100644 index 000000000..db221abe7 --- /dev/null +++ b/nwnds_module/gianttickbite.nss @@ -0,0 +1,76 @@ +// Giant Tick's Bloodsuck Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nConDrain = d4(1); + int nSTR_Target; + int nSTR_Creature; + int nTickFull; + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); + +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You force the tick to detach from your body.", oTarget); + return; + } + +// Drain 1d4 points of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodSuck, oTarget); + +// Increase the tick's speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the tick drains 8 CON worth of blood it will detach & run away. + if (nTickFull >= 8) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +FloatingTextStringOnCreature("The tick is draining your blood!", oTarget); + + } diff --git a/nwnds_module/gianttickbite.uti b/nwnds_module/gianttickbite.uti new file mode 100644 index 000000000..ef8153936 Binary files /dev/null and b/nwnds_module/gianttickbite.uti differ diff --git a/nwnds_module/gip_st_barren001.are b/nwnds_module/gip_st_barren001.are new file mode 100644 index 000000000..34a9902b8 Binary files /dev/null and b/nwnds_module/gip_st_barren001.are differ diff --git a/nwnds_module/gip_st_barren001.gic b/nwnds_module/gip_st_barren001.gic new file mode 100644 index 000000000..eeb1b95cb Binary files /dev/null and b/nwnds_module/gip_st_barren001.gic differ diff --git a/nwnds_module/gip_st_barren001.git b/nwnds_module/gip_st_barren001.git new file mode 100644 index 000000000..a75d6cfd6 Binary files /dev/null and b/nwnds_module/gip_st_barren001.git differ diff --git a/nwnds_module/gip_st_barren002.are b/nwnds_module/gip_st_barren002.are new file mode 100644 index 000000000..cbd14e115 Binary files /dev/null and b/nwnds_module/gip_st_barren002.are differ diff --git a/nwnds_module/gip_st_barren002.gic b/nwnds_module/gip_st_barren002.gic new file mode 100644 index 000000000..dd7ec098c Binary files /dev/null and b/nwnds_module/gip_st_barren002.gic differ diff --git a/nwnds_module/gip_st_barren002.git b/nwnds_module/gip_st_barren002.git new file mode 100644 index 000000000..49ead8610 Binary files /dev/null and b/nwnds_module/gip_st_barren002.git differ diff --git a/nwnds_module/gip_wastelands01.are b/nwnds_module/gip_wastelands01.are new file mode 100644 index 000000000..b7a749755 Binary files /dev/null and b/nwnds_module/gip_wastelands01.are differ diff --git a/nwnds_module/gip_wastelands01.gic b/nwnds_module/gip_wastelands01.gic new file mode 100644 index 000000000..c7e4bf17d Binary files /dev/null and b/nwnds_module/gip_wastelands01.gic differ diff --git a/nwnds_module/gip_wastelands01.git b/nwnds_module/gip_wastelands01.git new file mode 100644 index 000000000..bbe5146b9 Binary files /dev/null and b/nwnds_module/gip_wastelands01.git differ diff --git a/nwnds_module/gip_wastelands02.are b/nwnds_module/gip_wastelands02.are new file mode 100644 index 000000000..6580647b8 Binary files /dev/null and b/nwnds_module/gip_wastelands02.are differ diff --git a/nwnds_module/gip_wastelands02.gic b/nwnds_module/gip_wastelands02.gic new file mode 100644 index 000000000..828c51250 Binary files /dev/null and b/nwnds_module/gip_wastelands02.gic differ diff --git a/nwnds_module/gip_wastelands02.git b/nwnds_module/gip_wastelands02.git new file mode 100644 index 000000000..c6da82d0f Binary files /dev/null and b/nwnds_module/gip_wastelands02.git differ diff --git a/nwnds_module/gith_caverns001.are b/nwnds_module/gith_caverns001.are new file mode 100644 index 000000000..ecdf60823 Binary files /dev/null and b/nwnds_module/gith_caverns001.are differ diff --git a/nwnds_module/gith_caverns001.gic b/nwnds_module/gith_caverns001.gic new file mode 100644 index 000000000..3e50cd4aa Binary files /dev/null and b/nwnds_module/gith_caverns001.gic differ diff --git a/nwnds_module/gith_caverns001.git b/nwnds_module/gith_caverns001.git new file mode 100644 index 000000000..544459523 Binary files /dev/null and b/nwnds_module/gith_caverns001.git differ diff --git a/nwnds_module/gith_caverns002.are b/nwnds_module/gith_caverns002.are new file mode 100644 index 000000000..8dc6b96c8 Binary files /dev/null and b/nwnds_module/gith_caverns002.are differ diff --git a/nwnds_module/gith_caverns002.gic b/nwnds_module/gith_caverns002.gic new file mode 100644 index 000000000..8923b7e03 Binary files /dev/null and b/nwnds_module/gith_caverns002.gic differ diff --git a/nwnds_module/gith_caverns002.git b/nwnds_module/gith_caverns002.git new file mode 100644 index 000000000..6abea217e Binary files /dev/null and b/nwnds_module/gith_caverns002.git differ diff --git a/nwnds_module/gith_caverns003.are b/nwnds_module/gith_caverns003.are new file mode 100644 index 000000000..ec20d6342 Binary files /dev/null and b/nwnds_module/gith_caverns003.are differ diff --git a/nwnds_module/gith_caverns003.gic b/nwnds_module/gith_caverns003.gic new file mode 100644 index 000000000..f101952e7 Binary files /dev/null and b/nwnds_module/gith_caverns003.gic differ diff --git a/nwnds_module/gith_caverns003.git b/nwnds_module/gith_caverns003.git new file mode 100644 index 000000000..fcf95590b Binary files /dev/null and b/nwnds_module/gith_caverns003.git differ diff --git a/nwnds_module/gith_caverns004.are b/nwnds_module/gith_caverns004.are new file mode 100644 index 000000000..d636f19bf Binary files /dev/null and b/nwnds_module/gith_caverns004.are differ diff --git a/nwnds_module/gith_caverns004.gic b/nwnds_module/gith_caverns004.gic new file mode 100644 index 000000000..020757abe Binary files /dev/null and b/nwnds_module/gith_caverns004.gic differ diff --git a/nwnds_module/gith_caverns004.git b/nwnds_module/gith_caverns004.git new file mode 100644 index 000000000..319909e7a Binary files /dev/null and b/nwnds_module/gith_caverns004.git differ diff --git a/nwnds_module/gith_caverns005.are b/nwnds_module/gith_caverns005.are new file mode 100644 index 000000000..bd2194e56 Binary files /dev/null and b/nwnds_module/gith_caverns005.are differ diff --git a/nwnds_module/gith_caverns005.gic b/nwnds_module/gith_caverns005.gic new file mode 100644 index 000000000..edcf1c8a6 Binary files /dev/null and b/nwnds_module/gith_caverns005.gic differ diff --git a/nwnds_module/gith_caverns005.git b/nwnds_module/gith_caverns005.git new file mode 100644 index 000000000..5accd2525 Binary files /dev/null and b/nwnds_module/gith_caverns005.git differ diff --git a/nwnds_module/githyanki001.utc b/nwnds_module/githyanki001.utc new file mode 100644 index 000000000..5e5f23d9c Binary files /dev/null and b/nwnds_module/githyanki001.utc differ diff --git a/nwnds_module/githyanki002.utc b/nwnds_module/githyanki002.utc new file mode 100644 index 000000000..88aac8540 Binary files /dev/null and b/nwnds_module/githyanki002.utc differ diff --git a/nwnds_module/githyanki003.utc b/nwnds_module/githyanki003.utc new file mode 100644 index 000000000..c1360d806 Binary files /dev/null and b/nwnds_module/githyanki003.utc differ diff --git a/nwnds_module/gloom.utc b/nwnds_module/gloom.utc new file mode 100644 index 000000000..5360f964c Binary files /dev/null and b/nwnds_module/gloom.utc differ diff --git a/nwnds_module/gloomhide.uti b/nwnds_module/gloomhide.uti new file mode 100644 index 000000000..ffcf905e5 Binary files /dev/null and b/nwnds_module/gloomhide.uti differ diff --git a/nwnds_module/glow_desert001.are b/nwnds_module/glow_desert001.are new file mode 100644 index 000000000..ec383e44f Binary files /dev/null and b/nwnds_module/glow_desert001.are differ diff --git a/nwnds_module/glow_desert001.gic b/nwnds_module/glow_desert001.gic new file mode 100644 index 000000000..9f38fe3d6 Binary files /dev/null and b/nwnds_module/glow_desert001.gic differ diff --git a/nwnds_module/glow_desert001.git b/nwnds_module/glow_desert001.git new file mode 100644 index 000000000..fc5981599 Binary files /dev/null and b/nwnds_module/glow_desert001.git differ diff --git a/nwnds_module/glow_desert002.are b/nwnds_module/glow_desert002.are new file mode 100644 index 000000000..da7b6e954 Binary files /dev/null and b/nwnds_module/glow_desert002.are differ diff --git a/nwnds_module/glow_desert002.gic b/nwnds_module/glow_desert002.gic new file mode 100644 index 000000000..5c90b44a4 Binary files /dev/null and b/nwnds_module/glow_desert002.gic differ diff --git a/nwnds_module/glow_desert002.git b/nwnds_module/glow_desert002.git new file mode 100644 index 000000000..d36f00781 Binary files /dev/null and b/nwnds_module/glow_desert002.git differ diff --git a/nwnds_module/gntwolfspider001.utc b/nwnds_module/gntwolfspider001.utc new file mode 100644 index 000000000..c0c48070a Binary files /dev/null and b/nwnds_module/gntwolfspider001.utc differ diff --git a/nwnds_module/goingtoalt.ncs b/nwnds_module/goingtoalt.ncs new file mode 100644 index 000000000..bae1545a4 Binary files /dev/null and b/nwnds_module/goingtoalt.ncs differ diff --git a/nwnds_module/goingtoalt.nss b/nwnds_module/goingtoalt.nss new file mode 100644 index 000000000..c85f424e7 --- /dev/null +++ b/nwnds_module/goingtoalt.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName goingtoalt +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/31/02 6:22:43 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/gold_scorp001.utc b/nwnds_module/gold_scorp001.utc new file mode 100644 index 000000000..69d6b524b Binary files /dev/null and b/nwnds_module/gold_scorp001.utc differ diff --git a/nwnds_module/gold_scorp_sting.uti b/nwnds_module/gold_scorp_sting.uti new file mode 100644 index 000000000..ce1c495dd Binary files /dev/null and b/nwnds_module/gold_scorp_sting.uti differ diff --git a/nwnds_module/goldenkey.ncs b/nwnds_module/goldenkey.ncs new file mode 100644 index 000000000..aea33a161 Binary files /dev/null and b/nwnds_module/goldenkey.ncs differ diff --git a/nwnds_module/goldenkey.nss b/nwnds_module/goldenkey.nss new file mode 100644 index 000000000..d46118c32 --- /dev/null +++ b/nwnds_module/goldenkey.nss @@ -0,0 +1,26 @@ +//:://///////////////////////////////////////////// +//:: FileName goldenkey +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/2/02 6:18:05 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("QST_GOLDENKEY3", GetPCSpeaker(), 1); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_GOLDENKEY1"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + + object oItemToTake2; + oItemToTake2 = GetItemPossessedBy(GetPCSpeaker(), "QST_GOLDENKEY2"); + if(GetIsObjectValid(oItemToTake2) != 0) + DestroyObject(oItemToTake2); + + +} diff --git a/nwnds_module/goldforclock.ncs b/nwnds_module/goldforclock.ncs new file mode 100644 index 000000000..8cb2640a2 Binary files /dev/null and b/nwnds_module/goldforclock.ncs differ diff --git a/nwnds_module/goldforclock.nss b/nwnds_module/goldforclock.nss new file mode 100644 index 000000000..ad9dadda7 --- /dev/null +++ b/nwnds_module/goldforclock.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName goldforclock +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/17/2002 6:13:09 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + object oPC = GetPCSpeaker(); + // Make sure the PC speaker has these items in their inventory + if((GetGold(oPC)) < 500) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/golembone001.utc b/nwnds_module/golembone001.utc new file mode 100644 index 000000000..a4dcf4e66 Binary files /dev/null and b/nwnds_module/golembone001.utc differ diff --git a/nwnds_module/golembone002.utc b/nwnds_module/golembone002.utc new file mode 100644 index 000000000..9dda30501 Binary files /dev/null and b/nwnds_module/golembone002.utc differ diff --git a/nwnds_module/golemjade001.utc b/nwnds_module/golemjade001.utc new file mode 100644 index 000000000..6205a3b1b Binary files /dev/null and b/nwnds_module/golemjade001.utc differ diff --git a/nwnds_module/golemjade002.utc b/nwnds_module/golemjade002.utc new file mode 100644 index 000000000..8ddef01cf Binary files /dev/null and b/nwnds_module/golemjade002.utc differ diff --git a/nwnds_module/golemmagma001.utc b/nwnds_module/golemmagma001.utc new file mode 100644 index 000000000..a2f0d9713 Binary files /dev/null and b/nwnds_module/golemmagma001.utc differ diff --git a/nwnds_module/golemmagma002.utc b/nwnds_module/golemmagma002.utc new file mode 100644 index 000000000..38097c85c Binary files /dev/null and b/nwnds_module/golemmagma002.utc differ diff --git a/nwnds_module/golemobsidian001.utc b/nwnds_module/golemobsidian001.utc new file mode 100644 index 000000000..01f56375f Binary files /dev/null and b/nwnds_module/golemobsidian001.utc differ diff --git a/nwnds_module/golemobsidian002.utc b/nwnds_module/golemobsidian002.utc new file mode 100644 index 000000000..2562ee87e Binary files /dev/null and b/nwnds_module/golemobsidian002.utc differ diff --git a/nwnds_module/golemrock001.utc b/nwnds_module/golemrock001.utc new file mode 100644 index 000000000..806da47a6 Binary files /dev/null and b/nwnds_module/golemrock001.utc differ diff --git a/nwnds_module/golemrock002.utc b/nwnds_module/golemrock002.utc new file mode 100644 index 000000000..ae21caa1d Binary files /dev/null and b/nwnds_module/golemrock002.utc differ diff --git a/nwnds_module/golemsalt001.utc b/nwnds_module/golemsalt001.utc new file mode 100644 index 000000000..78ffcde08 Binary files /dev/null and b/nwnds_module/golemsalt001.utc differ diff --git a/nwnds_module/golemsalt002.utc b/nwnds_module/golemsalt002.utc new file mode 100644 index 000000000..9b60f8b5d Binary files /dev/null and b/nwnds_module/golemsalt002.utc differ diff --git a/nwnds_module/golemwood001.utc b/nwnds_module/golemwood001.utc new file mode 100644 index 000000000..e99ccb7c5 Binary files /dev/null and b/nwnds_module/golemwood001.utc differ diff --git a/nwnds_module/golemwood002.utc b/nwnds_module/golemwood002.utc new file mode 100644 index 000000000..f191c3c8a Binary files /dev/null and b/nwnds_module/golemwood002.utc differ diff --git a/nwnds_module/gong.dlg b/nwnds_module/gong.dlg new file mode 100644 index 000000000..64f7f9791 Binary files /dev/null and b/nwnds_module/gong.dlg differ diff --git a/nwnds_module/grairelemhide.uti b/nwnds_module/grairelemhide.uti new file mode 100644 index 000000000..0d1f674a8 Binary files /dev/null and b/nwnds_module/grairelemhide.uti differ diff --git a/nwnds_module/grdireratbite.uti b/nwnds_module/grdireratbite.uti new file mode 100644 index 000000000..7c5454fe8 Binary files /dev/null and b/nwnds_module/grdireratbite.uti differ diff --git a/nwnds_module/grearthelemhide.uti b/nwnds_module/grearthelemhide.uti new file mode 100644 index 000000000..ff582d9ff Binary files /dev/null and b/nwnds_module/grearthelemhide.uti differ diff --git a/nwnds_module/grfireelemhide.uti b/nwnds_module/grfireelemhide.uti new file mode 100644 index 000000000..75c2edf14 Binary files /dev/null and b/nwnds_module/grfireelemhide.uti differ diff --git a/nwnds_module/grrainelemhide.uti b/nwnds_module/grrainelemhide.uti new file mode 100644 index 000000000..9322bdc34 Binary files /dev/null and b/nwnds_module/grrainelemhide.uti differ diff --git a/nwnds_module/grsiltelemhide.uti b/nwnds_module/grsiltelemhide.uti new file mode 100644 index 000000000..82b53c86e Binary files /dev/null and b/nwnds_module/grsiltelemhide.uti differ diff --git a/nwnds_module/grsiltelemslam.uti b/nwnds_module/grsiltelemslam.uti new file mode 100644 index 000000000..13e06a691 Binary files /dev/null and b/nwnds_module/grsiltelemslam.uti differ diff --git a/nwnds_module/grsunelemhide.uti b/nwnds_module/grsunelemhide.uti new file mode 100644 index 000000000..59cbcb736 Binary files /dev/null and b/nwnds_module/grsunelemhide.uti differ diff --git a/nwnds_module/grueharginn001.utc b/nwnds_module/grueharginn001.utc new file mode 100644 index 000000000..d522ca237 Binary files /dev/null and b/nwnds_module/grueharginn001.utc differ diff --git a/nwnds_module/grueildriss001.utc b/nwnds_module/grueildriss001.utc new file mode 100644 index 000000000..dff9e398f Binary files /dev/null and b/nwnds_module/grueildriss001.utc differ diff --git a/nwnds_module/grwaterelemhide.uti b/nwnds_module/grwaterelemhide.uti new file mode 100644 index 000000000..6e7617c83 Binary files /dev/null and b/nwnds_module/grwaterelemhide.uti differ diff --git a/nwnds_module/guardcloak.uti b/nwnds_module/guardcloak.uti new file mode 100644 index 000000000..d8e9fbd08 Binary files /dev/null and b/nwnds_module/guardcloak.uti differ diff --git a/nwnds_module/guardhide.uti b/nwnds_module/guardhide.uti new file mode 100644 index 000000000..4b5c9b84a Binary files /dev/null and b/nwnds_module/guardhide.uti differ diff --git a/nwnds_module/guutesquest.ncs b/nwnds_module/guutesquest.ncs new file mode 100644 index 000000000..37c39431e Binary files /dev/null and b/nwnds_module/guutesquest.ncs differ diff --git a/nwnds_module/guutesquest.nss b/nwnds_module/guutesquest.nss new file mode 100644 index 000000000..d047d9f88 --- /dev/null +++ b/nwnds_module/guutesquest.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName guutesquest +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/30/02 12:47:56 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "talkedtoguute") != 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/gw_bannernone.dlg b/nwnds_module/gw_bannernone.dlg new file mode 100644 index 000000000..d736bb18f Binary files /dev/null and b/nwnds_module/gw_bannernone.dlg differ diff --git a/nwnds_module/gw_claim.ncs b/nwnds_module/gw_claim.ncs new file mode 100644 index 000000000..319fda313 Binary files /dev/null and b/nwnds_module/gw_claim.ncs differ diff --git a/nwnds_module/gw_claim.nss b/nwnds_module/gw_claim.nss new file mode 100644 index 000000000..8c435350f --- /dev/null +++ b/nwnds_module/gw_claim.nss @@ -0,0 +1,10 @@ +void main() +{ +object oPC = GetPCSpeaker(); +object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC); +string sGuild = GetSubString(GetTag(oHelm),5,4); +SpeakString(sGuild,TALKVOLUME_TALK); +location loc = GetLocation(OBJECT_SELF); +CreateObject(OBJECT_TYPE_PLACEABLE, "banner"+sGuild, loc, TRUE); +DestroyObject(OBJECT_SELF, 0.0); +} diff --git a/nwnds_module/gw_notguilded.ncs b/nwnds_module/gw_notguilded.ncs new file mode 100644 index 000000000..ccf0d9c2c Binary files /dev/null and b/nwnds_module/gw_notguilded.ncs differ diff --git a/nwnds_module/gw_notguilded.nss b/nwnds_module/gw_notguilded.nss new file mode 100644 index 000000000..3c7b85335 --- /dev/null +++ b/nwnds_module/gw_notguilded.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); +object oHelm = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC); +if (GetSubString(GetTag(oHelm),1,4) == "helm") +return FALSE; +return TRUE; +} diff --git a/nwnds_module/gw_spiderbite.uti b/nwnds_module/gw_spiderbite.uti new file mode 100644 index 000000000..d8cc62caf Binary files /dev/null and b/nwnds_module/gw_spiderbite.uti differ diff --git a/nwnds_module/half_rg_druid001.utc b/nwnds_module/half_rg_druid001.utc new file mode 100644 index 000000000..d2fa1d74d Binary files /dev/null and b/nwnds_module/half_rg_druid001.utc differ diff --git a/nwnds_module/halfbandit_001.utc b/nwnds_module/halfbandit_001.utc new file mode 100644 index 000000000..1f2c8d042 Binary files /dev/null and b/nwnds_module/halfbandit_001.utc differ diff --git a/nwnds_module/halfgiant001.utc b/nwnds_module/halfgiant001.utc new file mode 100644 index 000000000..0235ec51d Binary files /dev/null and b/nwnds_module/halfgiant001.utc differ diff --git a/nwnds_module/halfgiant002.utc b/nwnds_module/halfgiant002.utc new file mode 100644 index 000000000..76f317394 Binary files /dev/null and b/nwnds_module/halfgiant002.utc differ diff --git a/nwnds_module/halfgiant003.utc b/nwnds_module/halfgiant003.utc new file mode 100644 index 000000000..9f3e5acf6 Binary files /dev/null and b/nwnds_module/halfgiant003.utc differ diff --git a/nwnds_module/halfgiant004.utc b/nwnds_module/halfgiant004.utc new file mode 100644 index 000000000..d81f2f5d9 Binary files /dev/null and b/nwnds_module/halfgiant004.utc differ diff --git a/nwnds_module/halfgiant005.utc b/nwnds_module/halfgiant005.utc new file mode 100644 index 000000000..898ad4888 Binary files /dev/null and b/nwnds_module/halfgiant005.utc differ diff --git a/nwnds_module/halfgiant006.utc b/nwnds_module/halfgiant006.utc new file mode 100644 index 000000000..b1910436c Binary files /dev/null and b/nwnds_module/halfgiant006.utc differ diff --git a/nwnds_module/halfgiant007.utc b/nwnds_module/halfgiant007.utc new file mode 100644 index 000000000..6869d1689 Binary files /dev/null and b/nwnds_module/halfgiant007.utc differ diff --git a/nwnds_module/halfgiant999.utc b/nwnds_module/halfgiant999.utc new file mode 100644 index 000000000..936217ac9 Binary files /dev/null and b/nwnds_module/halfgiant999.utc differ diff --git a/nwnds_module/halfhunter001.utc b/nwnds_module/halfhunter001.utc new file mode 100644 index 000000000..1254083bc Binary files /dev/null and b/nwnds_module/halfhunter001.utc differ diff --git a/nwnds_module/halfranger001.utc b/nwnds_module/halfranger001.utc new file mode 100644 index 000000000..0b0e7d215 Binary files /dev/null and b/nwnds_module/halfranger001.utc differ diff --git a/nwnds_module/harginnslam.uti b/nwnds_module/harginnslam.uti new file mode 100644 index 000000000..c6980832a Binary files /dev/null and b/nwnds_module/harginnslam.uti differ diff --git a/nwnds_module/harrginskin.uti b/nwnds_module/harrginskin.uti new file mode 100644 index 000000000..a95cd1f11 Binary files /dev/null and b/nwnds_module/harrginskin.uti differ diff --git a/nwnds_module/hasledger.ncs b/nwnds_module/hasledger.ncs new file mode 100644 index 000000000..cc7a4a14e Binary files /dev/null and b/nwnds_module/hasledger.ncs differ diff --git a/nwnds_module/hasledger.nss b/nwnds_module/hasledger.nss new file mode 100644 index 000000000..6ffc79963 --- /dev/null +++ b/nwnds_module/hasledger.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName hasledger +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:33:35 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "JaryxsLedger")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/haste.uti b/nwnds_module/haste.uti new file mode 100644 index 000000000..7e9f1c66c Binary files /dev/null and b/nwnds_module/haste.uti differ diff --git a/nwnds_module/havehide2.ncs b/nwnds_module/havehide2.ncs new file mode 100644 index 000000000..c44502923 Binary files /dev/null and b/nwnds_module/havehide2.ncs differ diff --git a/nwnds_module/havehide2.nss b/nwnds_module/havehide2.nss new file mode 100644 index 000000000..4b377fbb3 --- /dev/null +++ b/nwnds_module/havehide2.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName havehide2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/8/02 4:01:17 PM +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "AirDrakeHide"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/hb_prism.ncs b/nwnds_module/hb_prism.ncs new file mode 100644 index 000000000..152b2e0ea Binary files /dev/null and b/nwnds_module/hb_prism.ncs differ diff --git a/nwnds_module/hb_prism.nss b/nwnds_module/hb_prism.nss new file mode 100644 index 000000000..ec154859d --- /dev/null +++ b/nwnds_module/hb_prism.nss @@ -0,0 +1,34 @@ +//:://///////////////////////////////////////////// +//:: Name hb_prism +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Prismasaurus heartbeat script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void RandomGlow() +{ + int nEffect = 408 + Random(16); + + effect eGlow = EffectVisualEffect(nEffect); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eGlow,OBJECT_SELF,1.0); +} + + + +void main() +{ + ExecuteScript("x2_def_heartbeat", OBJECT_SELF); + + RandomGlow(); + DelayCommand(1.0,RandomGlow()); + DelayCommand(2.0,RandomGlow()); + DelayCommand(3.0,RandomGlow()); + DelayCommand(4.0,RandomGlow()); + DelayCommand(5.0,RandomGlow()); +} diff --git a/nwnds_module/hejkin001.utc b/nwnds_module/hejkin001.utc new file mode 100644 index 000000000..9c38bd0b4 Binary files /dev/null and b/nwnds_module/hejkin001.utc differ diff --git a/nwnds_module/hejkin_brute001.utc b/nwnds_module/hejkin_brute001.utc new file mode 100644 index 000000000..f7b99d0d2 Binary files /dev/null and b/nwnds_module/hejkin_brute001.utc differ diff --git a/nwnds_module/hejkinbrute.utc b/nwnds_module/hejkinbrute.utc new file mode 100644 index 000000000..712143b62 Binary files /dev/null and b/nwnds_module/hejkinbrute.utc differ diff --git a/nwnds_module/hejkinclaw.uti b/nwnds_module/hejkinclaw.uti new file mode 100644 index 000000000..af61d5cd7 Binary files /dev/null and b/nwnds_module/hejkinclaw.uti differ diff --git a/nwnds_module/hejkincleric.utc b/nwnds_module/hejkincleric.utc new file mode 100644 index 000000000..b782f4f89 Binary files /dev/null and b/nwnds_module/hejkincleric.utc differ diff --git a/nwnds_module/hejkincleric001.utc b/nwnds_module/hejkincleric001.utc new file mode 100644 index 000000000..919e96341 Binary files /dev/null and b/nwnds_module/hejkincleric001.utc differ diff --git a/nwnds_module/hejkinhide001.uti b/nwnds_module/hejkinhide001.uti new file mode 100644 index 000000000..2052dd635 Binary files /dev/null and b/nwnds_module/hejkinhide001.uti differ diff --git a/nwnds_module/hejkinrobe.uti b/nwnds_module/hejkinrobe.uti new file mode 100644 index 000000000..488da2c1a Binary files /dev/null and b/nwnds_module/hejkinrobe.uti differ diff --git a/nwnds_module/hejkinscale.uti b/nwnds_module/hejkinscale.uti new file mode 100644 index 000000000..942b65ff8 Binary files /dev/null and b/nwnds_module/hejkinscale.uti differ diff --git a/nwnds_module/hellhoundbite.uti b/nwnds_module/hellhoundbite.uti new file mode 100644 index 000000000..9dfbb491c Binary files /dev/null and b/nwnds_module/hellhoundbite.uti differ diff --git a/nwnds_module/helper.dlg b/nwnds_module/helper.dlg new file mode 100644 index 000000000..69a6714ed Binary files /dev/null and b/nwnds_module/helper.dlg differ diff --git a/nwnds_module/hench_i0_act.nss b/nwnds_module/hench_i0_act.nss new file mode 100644 index 000000000..cfc620077 --- /dev/null +++ b/nwnds_module/hench_i0_act.nss @@ -0,0 +1,157 @@ +/* + + Henchman Inventory And Battle AI + + This file contains functions used in the default On* scripts + for henchman actions during noncombat. This includes dealing + with traps, locks, items, and containers + +*/ + +#include "hench_i0_generic" + +// void main() { } + +// Removes master force trap and locks +void ClearForceOptions(); + +// force associate to open given lock +void OpenLock(object oLock); + +// force associate to disarm given trap +void ForceTrap(object oTrap); + +// true if free to work with trap, locks, items +int GetIAmNotDoingAnything(); + +// checks if associate should do any actions with +// traps, locks, or items +int HenchCheckArea(int nClearActions = FALSE); + +// finds nears trap or locked item +object HenchGetLockedOrTrappedObject(object oMaster); + + +// strings for actions +const string sLockMasterFailed = "tk_master_lock_failed"; +const string sForceTrap = "tk_force_trap"; + + +void ClearForceOptions() +{ + DeleteLocalObject(OBJECT_SELF, sLockMasterFailed); + DeleteLocalInt(OBJECT_SELF, sForceTrap); +} + + +void OpenLock(object oLock) +{ + if (GetIsObjectValid(oLock)) + { + SetLocalObject(OBJECT_SELF, sLockMasterFailed, oLock); + ExecuteScript("hench_o0_act", OBJECT_SELF); + } +} + + +void ForceTrap(object oTrap) +{ + if (GetIsObjectValid(oTrap)) + { + SetLocalObject(OBJECT_SELF, sLockMasterFailed, oTrap); + SetLocalInt(OBJECT_SELF, sForceTrap, TRUE); + ExecuteScript("hench_o0_act", OBJECT_SELF); + } +} + + +int GetIAmNotDoingAnything() +{ + int currentAction = GetCurrentAction(OBJECT_SELF); + + return !IsInConversation(OBJECT_SELF) + && !GetIsObjectValid(GetAttemptedAttackTarget()) + && !GetIsObjectValid(GetAttemptedSpellTarget()) + && currentAction != ACTION_REST + && currentAction != ACTION_DISABLETRAP + && currentAction != ACTION_OPENLOCK + && currentAction != ACTION_USEOBJECT + && currentAction != ACTION_RECOVERTRAP + && currentAction != ACTION_EXAMINETRAP + && currentAction != ACTION_PICKUPITEM + && currentAction != ACTION_HEAL + && currentAction != ACTION_TAUNT; +} + + +int HenchCheckArea(int nClearActions = FALSE) +{ + // only execute if we have something to do + if (!GetAssociateState(NW_ASC_MODE_STAND_GROUND) && !GetLocalInt(OBJECT_SELF, sHenchDontAttackFlag) && + GetIAmNotDoingAnything() && + ((GetHasSkill(SKILL_DISABLE_TRAP) && !GetLocalInt(OBJECT_SELF, sHenchNoDisarmTraps)) || + GetLocalInt(OBJECT_SELF, sHenchAutoOpenLocks) || + GetLocalInt(OBJECT_SELF, sHenchAutoPickup) || GetLocalInt(OBJECT_SELF, sHenchAutoOpenChest) || + GetIsObjectValid(GetLocalObject(OBJECT_SELF, sLockMasterFailed)))) + { + if (!GetLocalInt(OBJECT_SELF, "tk_doing_action")) + { + ExecuteScript("hench_o0_act", OBJECT_SELF); + return GetLocalInt(OBJECT_SELF, "tk_action_result"); + } + else + { + ActionDoCommand(ExecuteScript("hench_o0_act", OBJECT_SELF)); + return TRUE; + } + } + else + { + ClearForceOptions(); + } + return FALSE; +} + + +//:://///////////////////////////////////////////// +//:: Get Locked or Trapped Object +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Finds the closest locked or trapped object to the object + passed in up to a maximum of 10 objects. +*/ +//::////////////////////////////////////////////// +//:: Created By: Pausanias +//:: Created On: ?????? +//::////////////////////////////////////////////// + +object HenchGetLockedOrTrappedObject(object oMaster) +{ + int nCnt = 1; + int bValid = TRUE; + object oRealMaster = GetRealMaster(); + object oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_TRIGGER, GetLocation(oMaster), nCnt); + while (GetIsObjectValid(oLastObject) && bValid) + { + //COMMENT THIS BACK IN WHEN DOOR ACTION WORKS ON PLACABLE. + + //object oItem = GetFirstItemInInventory(oLastObject); + if(GetLocked(oLastObject) || + (GetIsTrapped(oLastObject) && + (GetTrapDetectedBy(oLastObject,OBJECT_SELF) || + GetTrapDetectedBy(oLastObject,oRealMaster)))) + { + return oLastObject; + } + nCnt++; + if(nCnt == 10) + { + bValid = FALSE; + } + oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_TRIGGER, GetLocation(oMaster), nCnt); + } + return OBJECT_INVALID; +} + + diff --git a/nwnds_module/hench_i0_ai.nss b/nwnds_module/hench_i0_ai.nss new file mode 100644 index 000000000..341918e3c --- /dev/null +++ b/nwnds_module/hench_i0_ai.nss @@ -0,0 +1,995 @@ +/* + + Henchman Inventory And Battle AI + + This file contains functions used in the default On* scripts + for combat. It acts as filter preventing the main hench_o0_ai + from being called more than it needs to. (Usually only to start + combat, heartbeat, or end combat round.) + +*/ + +#include "hench_i0_generic" +#include "hench_i0_melee" + + +// void main() { } + + +// Sets the location of an unheard or unseen enemy +// Either moved out of range or did attack while not detected +void SetEnemyLocation(object oEnemy); + +// Clears the last unheard, unseen enemy location +void ClearEnemyLocation(); + +// Moves to the last perceived enemy location +void MoveToLastSeenOrHeard(int bDoSearch = TRUE); + +// New determinecombatround call. Determines if call should cause +// main AI script to run +void HenchDetermineCombatRound(object oIntruder = OBJECT_INVALID, int bForceInterrupt = FALSE); + +// Simplified combat start, used by commoners +void HenchStartAttack(object oIntruder); + +// modified TalentFlee routine +int HenchTalentFlee(object oIntruder = OBJECT_INVALID); + +// modified GetNearestSeenOrHeardEnemy to not get dead creatures +object GetNearestSeenOrHeardEnemyNotDead(int bCheckIsPC = FALSE); + +// modified DetermineSpecialBehavior, calls HenchDetermineCombatRound instead +void HenchDetermineSpecialBehavior(object oIntruder = OBJECT_INVALID); + +// used to attack non creature items (placeables and doors) +void HenchAttackObject(object oTarget); + +// associate (henchman, etc.) determines if enemy is perceived or not +int HenchGetIsEnemyPerceived(); + +// modified TalentAdvancedBuff routine +int HenchTalentAdvancedBuff(float fDistance); + +// get nearest ally that is higher in hit dice +object GetNearestTougherFriend(object oSelf, object oPC); + +// main stealth and wandering code +int DoStealthAndWander(); + +// checks if stealth should be removed because you or nearby friend has been detected +void CheckRemoveStealth(); + +// code for bashing placeables +int HenchBashDoorCheck(int bPolymorphed); + + +const int HENCH_AI_SCRIPT_NOT_RUN = 0; +const int HENCH_AI_SCRIPT_IN_PROGRESS = 1; +const int HENCH_AI_SCRIPT_ALREADY_RUN = 2; + +const string HENCH_AI_SCRIPT_RUN_STATE = "AIIntruder"; +const string HENCH_AI_SCRIPT_FORCE = "AIIntruderForce"; +const string HENCH_AI_SCRIPT_INTRUDER_OBJ = "AIIntruderObj"; + +const string sHenchLastHeardOrSeen = "LastSeenOrHeard"; + + +void SetEnemyLocation(object oEnemy) +{ + SetLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen, TRUE); + + location enemyLocation = GetLocation(oEnemy); + SetLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen, enemyLocation); + + // Get the area, position and facing + object oArea = GetAreaFromLocation (enemyLocation); + vector vPosition = GetPositionFromLocation (enemyLocation); + float fFacing = GetFacingFromLocation (enemyLocation); + + vPosition.z += 100.0; + + // Build a new location, which faces in the opposite direction + enemyLocation = Location (oArea, vPosition, fFacing); + // make sure old position is gone + object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); + if (GetIsObjectValid(oInvisTarget)) + { + DestroyObject(oInvisTarget); + DeleteLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); + } + + oInvisTarget = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", enemyLocation); + SetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen, oInvisTarget); +} + + +void ClearEnemyLocation() +{ + DeleteLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen); + DeleteLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen); + + object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); + if (GetIsObjectValid(oInvisTarget)) + { + DestroyObject(oInvisTarget); + DeleteLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); + } +} + + +void MoveToLastSeenOrHeard(int bDoSearch = TRUE) +{ + location moveToLoc = GetLocalLocation(OBJECT_SELF, sHenchLastHeardOrSeen); + if (GetDistanceBetweenLocations(GetLocation(OBJECT_SELF), moveToLoc) <= 5.0) + { + ClearEnemyLocation(); + // go to search + // TODO add spells to help search + DeleteLocalInt(OBJECT_SELF, HENCH_AI_SCRIPT_RUN_STATE); + if (bDoSearch) + { + // search around for awhile + ActionDoCommand(SetActionMode(OBJECT_SELF, ACTION_MODE_DETECT, TRUE)); + ActionRandomWalk(); + DelayCommand(10.0, HenchDetermineCombatRound()); + } + } + else + { + object oInvisTarget = GetLocalObject(OBJECT_SELF, sHenchLastHeardOrSeen); + ActionMoveToObject(oInvisTarget, TRUE); + } +} + + +void HenchDetermineCombatRound(object oIntruder = OBJECT_INVALID, int bForceInterrupt = FALSE) +{ +// Jug_Debug(GetName(OBJECT_SELF) + " det com round called with " + GetName(oIntruder) + " force = " + IntToString(bForceInterrupt)); + + if(GetAssociateState(NW_ASC_IS_BUSY)) + { + return; + } + + string sAIScript = GetLocalString(OBJECT_SELF, "AIScript"); + if (sAIScript == "") + { + sAIScript = "hench_o0_ai"; + } + + SetLocalObject(OBJECT_SELF, HENCH_AI_SCRIPT_INTRUDER_OBJ, oIntruder); + SetLocalInt(OBJECT_SELF, HENCH_AI_SCRIPT_FORCE, bForceInterrupt); + + if (bForceInterrupt) + { + SetLocalInt(OBJECT_SELF, HENCH_AI_SCRIPT_RUN_STATE, HENCH_AI_SCRIPT_IN_PROGRESS); + ExecuteScript(sAIScript, OBJECT_SELF); + return; + } + + // check if we have to actually determine to rerun ai + int iAIIntruderLevel = GetLocalInt(OBJECT_SELF, HENCH_AI_SCRIPT_RUN_STATE); + + if (iAIIntruderLevel == HENCH_AI_SCRIPT_NOT_RUN) + { + // first run of HenchDetermineCombatRound + SetLocalInt(OBJECT_SELF, HENCH_AI_SCRIPT_RUN_STATE, HENCH_AI_SCRIPT_IN_PROGRESS); + ExecuteScript(sAIScript, OBJECT_SELF); + return; + } + object oLastTarget = GetLocalObject(OBJECT_SELF, sHenchLastTarget); + + if(!GetIsObjectValid(oLastTarget) || GetIsDead(oLastTarget) || !GetIsEnemy(oLastTarget) || GetLocalInt(oLastTarget, sHenchRunningAway)) + { + oLastTarget = OBJECT_INVALID; + } + else if (!GetObjectSeen(oLastTarget) && !GetObjectHeard(oLastTarget)) + { + oLastTarget = OBJECT_INVALID; + } + if (!GetIsObjectValid(oLastTarget)) + { + // prevent too many calls to main script if already moving to an unseen and + // unheard monster + if (!GetLocalInt(OBJECT_SELF, sHenchLastHeardOrSeen) || GetObjectSeen(oIntruder) || GetObjectHeard(oIntruder)) + { + ExecuteScript(sAIScript, OBJECT_SELF); + } + } + else if (GetIsObjectValid(oIntruder)) + { + if (GetDistanceToObject(oIntruder) <= 5.0 && GetDistanceToObject(oLastTarget) > 5.0) + { + ExecuteScript(sAIScript, OBJECT_SELF); + } + else if (GetObjectSeen(oIntruder) && !GetObjectSeen(oLastTarget)) + { + ExecuteScript(sAIScript, OBJECT_SELF); + } + } +} + + +void HenchStartAttack(object oIntruder) +{ + SetLocalObject(OBJECT_SELF, HENCH_AI_SCRIPT_INTRUDER_OBJ, oIntruder); + ExecuteScript("hench_o0_att", OBJECT_SELF); +} + + +// FLEE COMBAT AND HOSTILES +int HenchTalentFlee(object oIntruder = OBJECT_INVALID) +{ + object oTarget = oIntruder; + if(!GetIsObjectValid(oIntruder)) + { + oTarget = GetLastHostileActor(); + if(!GetIsObjectValid(oTarget) || GetIsDead(oTarget)) + { + oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN); + float fDist = GetDistanceBetween(OBJECT_SELF, oTarget); + if(!GetIsObjectValid(oTarget)) + { + return FALSE; + } + } + } + ClearAllActions(); + //Look at this to remove the delay + ActionMoveAwayFromObject(oTarget, TRUE, 10.0f); + DelayCommand(4.0, ClearAllActions()); + return TRUE; +} + + +object GetNearestSeenOrHeardEnemyNotDead(int bCheckIsPC = FALSE) +{ + int curCount = 1; + object oTarget; + while (1) + { + oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, curCount, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if (!GetIsObjectValid(oTarget)) + { + break; + } + if (!GetPlotFlag(oTarget)) + { + return oTarget; + } + curCount ++; + } + curCount = 1; + while (1) + { + oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, curCount, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if (!GetIsObjectValid(oTarget)) + { + return OBJECT_INVALID; + } + if (!GetPlotFlag(oTarget) && !(bCheckIsPC && GetIsPC(GetTopMaster(oTarget)))) + { + return oTarget; + } + curCount++; + } + return OBJECT_INVALID; +} + + +//:://///////////////////////////////////////////// +//:: Determine Special Behavior +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the special behavior used by the NPC. + Generally all NPCs who you want to behave differently + than the default behavior. + For these behaviors, passing in a valid object will + cause the creature to become hostile the the attacker. + + MODIFIED February 7 2003: + - Rearranged logic order a little so that the creatures + will actually randomwalk when not fighting + + - Modified by Tony K to call HenchDetermineCombatRound + + - Modified by LoCash (Jan 12-Mar 06 2004): + BW's original function was completely broken, it needed + to be re-written. original code by "fendis_khan". + many enhancements made. herbivores now work + "out of the box" as they should, omnivores need faction + changed to a non-Hostile. Check "Animals" in the Toolset's + Monster palette for various examples of creatures using + omnivore, herbivore spawn scripts. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 14, 2001 +//::////////////////////////////////////////////// + +void HenchDetermineSpecialBehavior(object oIntruder = OBJECT_INVALID) +{ + object oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, 1, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + + // Omnivore behavior routine + if(GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE)) + { + // no current attacker and not currently in combat + if(!GetIsObjectValid(oIntruder) && !GetIsInCombat()) + { + // does not have a current target + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + // enemy creature nearby + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 13.0) + { + ClearAllActions(); + HenchDetermineCombatRound(oTarget); + return; + } + int nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + + // neutral creature, too close + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or an "Animal Companion" + SetLocalInt(OBJECT_SELF, "lcTempEnemy", 8); + SetIsTemporaryEnemy(oTarget); + ClearAllActions(); + HenchDetermineCombatRound(oTarget); + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, ++nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + } + + // non friend creature, too close + nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, OBJECT_SELF, nTarget); + + // heard neutral or enemy creature, too close + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) + { + if(!GetIsFriend(oTarget) && GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or an "Animal Companion" + SetLocalInt(OBJECT_SELF, "lcTempEnemy", 8); + SetIsTemporaryEnemy(oTarget); + ClearAllActions(); + HenchDetermineCombatRound(oTarget); + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, OBJECT_SELF, ++nTarget); + } + + if(!IsInConversation(OBJECT_SELF)) + { + // 25% chance of just standing around instead of constantly + // randWalking; i thought it looked odd seeing the animal(s) + // in a constant state of movement, was not realistic, + // at least according to my Nat'l Geographic videos + if ( (d4() != 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + return; + } + else if ( (d4() == 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + ClearAllActions(); + return; + } + else + { + ClearAllActions(); + ActionRandomWalk(); + return; + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) // enter combat when attacked + { + // after a while (20-25 seconds), omnivore (boar) "gives up" + // chasing someone who didn't hurt it. but if the person fought back + // this condition won't run and the boar will fight to death + if(GetLocalInt(OBJECT_SELF, "lcTempEnemy") != FALSE && (GetLastDamager() == OBJECT_INVALID || GetLastDamager() != oTarget) ) + { + int nPatience = GetLocalInt(OBJECT_SELF, "lcTempEnemy"); + if (nPatience <= 1) + { + ClearAllActions(); + ClearPersonalReputation(oTarget); // reset reputation + DeleteLocalInt(OBJECT_SELF, "lcTempEnemy"); + return; + } + SetLocalInt(OBJECT_SELF, "lcTempEnemy", --nPatience); + } + ClearAllActions(); + HenchDetermineCombatRound(oIntruder); + } + } + + // Herbivore behavior routine + else if(GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + // no current attacker & not currently in combat + if(!GetIsObjectValid(oIntruder) && (GetIsInCombat() == FALSE)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && // does not have a current target + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 13.0) // enemy creature, too close + { + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, 16.0); // flee from enemy + return; + } + int nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) // only consider close creatures + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or Animal Companion + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, 16.0); // run away + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, ++nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + } + nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, OBJECT_SELF, nTarget); + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) // only consider close creatures + { + if(!GetIsFriend(oTarget) && GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or Animal Companion + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, 16.0); // run away + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, OBJECT_SELF, ++nTarget); + } + if(!IsInConversation(OBJECT_SELF)) + { + + // 75% chance of randomWalking around, 25% chance of just standing there. more realistic + if ( (d4() != 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + return; + } + else if ( (d4() == 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + ClearAllActions(); + return; + } + else + { + ClearAllActions(); + ActionRandomWalk(); + return; + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) // NEW BEHAVIOR - run away when attacked + { + ClearAllActions(); + ActionMoveAwayFromLocation(GetLocation(OBJECT_SELF), TRUE, 16.0); + } + } +} + + +void HenchAttackObject(object oTarget) +{ + if (GetWeaponRanged(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND))) + { + UseCombatAttack(oTarget); + } + else if(GetHasFeat(FEAT_IMPROVED_POWER_ATTACK)) + { + UseCombatAttack(oTarget, FEAT_IMPROVED_POWER_ATTACK); + } + else if(GetHasFeat(FEAT_POWER_ATTACK)) + { + UseCombatAttack(oTarget, FEAT_POWER_ATTACK); + } + else if(GetHasFeat(FEAT_DIRTY_FIGHTING)) + { + UseCombatAttack(oTarget, FEAT_DIRTY_FIGHTING); + } + else + { + UseCombatAttack(oTarget); + } +} + + +int HenchGetIsEnemyPerceived() +{ + object oClosestSeen = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, + OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, + CREATURE_TYPE_IS_ALIVE, TRUE); + + if (GetIsObjectValid(oClosestSeen)) + { + return TRUE; + } + object oClosestHeard = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, + OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD_AND_NOT_SEEN, + CREATURE_TYPE_IS_ALIVE, TRUE); + if (GetIsObjectValid(oClosestHeard)) + { + if (GetDistanceToObject(oClosestHeard) <= fHenchHearingDistance) + { + return TRUE; + } + object oRealMaster = GetRealMaster(); + if (GetIsObjectValid(oRealMaster)) + { + if (GetDistanceBetween(oRealMaster, oClosestHeard) <= fHenchMasterHearingDistance) + { + return TRUE; + } + } + } + return FALSE; +} + + +// FAST BUFF SELF +int HenchTalentAdvancedBuff(float fDistance) +{ + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + if(GetIsObjectValid(oPC) && GetDistanceToObject(oPC) <= fDistance) + { + if(!GetIsFighting(OBJECT_SELF)) + { + ClearAllActions(); + //Combat Protections + if(GetHasSpell(SPELL_PREMONITION)) + { + ActionCastSpellAtObject(SPELL_PREMONITION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_GREATER_STONESKIN)) + { + ActionCastSpellAtObject(SPELL_GREATER_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, 0, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_STONESKIN)) + { + ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + //Visage Protections + if(GetHasSpell(SPELL_SHADOW_SHIELD)) + { + ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_ETHEREAL_VISAGE)) + { + ActionCastSpellAtObject(SPELL_ETHEREAL_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_GHOSTLY_VISAGE)) + { + ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + //Mantle Protections + if(GetHasSpell(SPELL_GREATER_SPELL_MANTLE)) + { + ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SPELL_MANTLE)) + { + ActionCastSpellAtObject(SPELL_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_LESSER_SPELL_BREACH)) + { + ActionCastSpellAtObject(SPELL_LESSER_SPELL_BREACH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + // Globes + if(GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY)) + { + ActionCastSpellAtObject(SPELL_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY)) + { + ActionCastSpellAtObject(SPELL_MINOR_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + + //Misc Protections + if(GetHasSpell(SPELL_ELEMENTAL_SHIELD)) + { + ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if (GetHasSpell(SPELL_MESTILS_ACID_SHEATH)&& !GetHasSpellEffect(SPELL_MESTILS_ACID_SHEATH)) + { + ActionCastSpellAtObject(SPELL_MESTILS_ACID_SHEATH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if (GetHasSpell(SPELL_DEATH_ARMOR)&& !GetHasSpellEffect(SPELL_DEATH_ARMOR)) + { + ActionCastSpellAtObject(SPELL_DEATH_ARMOR, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + + //Elemental Protections + if(GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS)) + { + ActionCastSpellAtObject(SPELL_PROTECTION_FROM_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_RESIST_ELEMENTS)) + { + ActionCastSpellAtObject(SPELL_RESIST_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_ENDURE_ELEMENTS)) + { + ActionCastSpellAtObject(SPELL_ENDURE_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + + //Mental Protections + if(GetHasSpell(SPELL_MIND_BLANK)) + { + ActionCastSpellAtObject(SPELL_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_LESSER_MIND_BLANK)) + { + ActionCastSpellAtObject(SPELL_LESSER_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_CLARITY)) + { + ActionCastSpellAtObject(SPELL_CLARITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + //Summon Ally + // TODO add gate!!!! + if(GetHasSpell(SPELL_BLACK_BLADE_OF_DISASTER)) + { + ActionCastSpellAtLocation(SPELL_BLACK_BLADE_OF_DISASTER, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_ELEMENTAL_SWARM)) + { + ActionCastSpellAtLocation(SPELL_ELEMENTAL_SWARM, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_IX)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IX, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_CREATE_GREATER_UNDEAD)) + { + ActionCastSpellAtLocation(SPELL_CREATE_GREATER_UNDEAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_GREATER_PLANAR_BINDING)) + { + ActionCastSpellAtLocation(SPELL_GREATER_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_VIII)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VIII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_MORDENKAINENS_SWORD)) + { + ActionCastSpellAtLocation(SPELL_MORDENKAINENS_SWORD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_VII)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_CREATE_UNDEAD)) + { + ActionCastSpellAtLocation(SPELL_CREATE_UNDEAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_PLANAR_BINDING)) + { + ActionCastSpellAtLocation(SPELL_PLANAR_BINDING, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_VI)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VI, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_V)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_V, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELLABILITY_SUMMON_SLAAD)) + { + ActionCastSpellAtLocation(SPELLABILITY_SUMMON_SLAAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELLABILITY_SUMMON_TANARRI)) + { + ActionCastSpellAtLocation(SPELLABILITY_SUMMON_TANARRI, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELLABILITY_SUMMON_MEPHIT)) + { + ActionCastSpellAtLocation(SPELLABILITY_SUMMON_MEPHIT, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELLABILITY_SUMMON_CELESTIAL)) + { + ActionCastSpellAtLocation(SPELLABILITY_SUMMON_CELESTIAL, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_ANIMATE_DEAD)) + { + ActionCastSpellAtLocation(SPELL_ANIMATE_DEAD, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_IV)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IV, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_III)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_III, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_II)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_II, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + else if(GetHasSpell(SPELL_SUMMON_CREATURE_I)) + { + ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } + return TRUE; + } + } + return FALSE; +} + + +object GetNearestTougherFriend(object oSelf, object oPC) +{ + int i = 0; + + object oFriend = oSelf; + + int nEqual = 0; + int nNear = 0; + while (GetIsObjectValid(oFriend)) + { + if (GetDistanceBetween(oSelf, oFriend) < 40.0 && oFriend != oSelf) + { + ++nNear; + if (GetHitDice(oFriend) > GetHitDice(oSelf)) + return oFriend; + if (GetHitDice(oFriend) == GetHitDice(oSelf)) + ++nEqual; + } + ++i; + oFriend = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, + oSelf, i); + } + + SetLocalInt(OBJECT_SELF,"LocalBoss",FALSE); + if (nEqual == 0) + if (nNear > 0 || GetHitDice(oPC) - GetHitDice(OBJECT_SELF) < 2) + { + SetLocalInt(OBJECT_SELF,"LocalBoss",TRUE); + } + + return OBJECT_INVALID; +} + + +// Auldar: Configurable distance at which to "hide", if the PC, or PC's Associate is within that distance. +// TK 40 doesn't seem to be far enough +const float stealthDistThresh = 80.0; + + // Pausanias: monsters try to find you. +int DoStealthAndWander() +{ + if (GetPlotFlag(OBJECT_SELF)) + { + return FALSE; + } + int nStealthAndWander = GetMonsterOptions(HENCH_MONAI_STEALTH | HENCH_MONAI_WANDER); + if (!nStealthAndWander) + { + return FALSE; + } + + // Auldar: and they now stealth if they have some skill points (and not marked with plot flag) + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + object oNearestHostile = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + + if (!(GetIsObjectValid(oNearestHostile) && GetIsObjectValid(oPC) && GetIsEnemy(oPC))) + { + return FALSE; + } + + int bActionsCleared = FALSE; + if ((nStealthAndWander & HENCH_MONAI_STEALTH) && !GetPlotFlag(OBJECT_SELF) && + !GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH)) + { + // Auldar: Checking if the NPC is hostile to the PC and has skill points in Hide + // or move silently, and it not marked Plot. If so, go stealthy even if not flagged + // by the module creator as Stealth on spawn, as long as the PC or associate is hostile and close. + if (CheckStealth()) + { + // Auldar: Check how far away the nearest hostile Creature is + float enemyDistance = GetDistanceToObject(oNearestHostile); + + // Auldar: and check if it's a PC, or a PC's associate. + object oRealHostileMaster = GetRealMaster(oNearestHostile); + if (((oPC == oNearestHostile) || (GetIsObjectValid(oRealHostileMaster) + && GetIsPC(oRealHostileMaster) && GetIsEnemy(oRealHostileMaster))) + && (enemyDistance <= stealthDistThresh) && (enemyDistance != -1.0)) + { + ClearAllActions(); + bActionsCleared = TRUE; + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE); + } + } + // Auldar: here ends Auldar's NPC stealth code. Back to Paus' work :) + } + // Auldar: Reducing the distance from 40.0 to 25.0 to reduce the "bloodbath" effect + // requested by FoxBat. + if ((nStealthAndWander & HENCH_MONAI_WANDER) && GetDistanceToObject(oPC) < 25.0) + { + int ScoutMode = GetLocalInt(OBJECT_SELF,"ScoutMode"); + if (ScoutMode == 0) + { + ScoutMode = d2(); + SetLocalInt(OBJECT_SELF,"ScoutMode",ScoutMode); + } + object oTarget = GetNearestTougherFriend(OBJECT_SELF,oPC); + if (!GetLocalInt(OBJECT_SELF,"LocalBoss")) + { + int fDist = 15; + if (!GetIsObjectValid(oTarget) || ScoutMode == 1) + { + fDist = 10; + oTarget = oPC; + if (d10() > 5) fDist = 25; + } + + location lNew; + if (GetLocalInt(OBJECT_SELF,"OpenedDoor")) + { + lNew = GetLocalLocation(OBJECT_SELF,"ScoutZone"); + SetLocalInt(OBJECT_SELF,"OpenedDoor",FALSE); + } + else + { + vector vLoc = GetPosition(oTarget); + vLoc.x += fDist-IntToFloat(Random(2*fDist+1)); + vLoc.y += fDist-IntToFloat(Random(2*fDist+1)); + vLoc.z += fDist-IntToFloat(Random(2*fDist+1)); + lNew = Location(GetArea(oTarget),vLoc,0.); + SetLocalLocation(OBJECT_SELF,"ScoutZone",lNew); + } + if (!bActionsCleared) + { + ClearAllActions(); + } + ActionMoveToLocation(lNew); + return TRUE; + } + } + return FALSE; +} + + +void CheckRemoveStealth() +{ + if (GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH)) + { + int iCheckStealthAmount = GetSkillRank(SKILL_HIDE) + GetSkillRank(SKILL_MOVE_SILENTLY) + 5; + + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, FALSE); + + location testLocation = GetLocation(OBJECT_SELF); + + object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, 15.0, testLocation, TRUE); + while(GetIsObjectValid(oCreature)) + { + if (GetActionMode(oCreature, ACTION_MODE_STEALTH) && + GetIsFriend(oCreature) && + !GetIsPC(oCreature)) + { + if (GetSkillRank(SKILL_HIDE, oCreature) + GetSkillRank(SKILL_MOVE_SILENTLY, oCreature) <= iCheckStealthAmount) + { +// Jug_Debug(GetName(OBJECT_SELF) + " turning off stealth for + " + GetName(oCreature)); + SetActionMode(oCreature, ACTION_MODE_STEALTH, FALSE); + } + } + oCreature = GetNextObjectInShape(SHAPE_SPHERE, 15.0, testLocation, TRUE); + } + } +} + + +// Pausanias's version of the last: float GetEnemyChallenge() +// My forumla: Total Challenge of Enemy = log ( Sum (2**challenge) ) +// Auldar: Changed to 1.5 at Paus' request to better mirror the 3E DMG +float GetEnemyChallenge(object oRelativeTo=OBJECT_SELF) +{ + float fChallenge = 0.; + + object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, GetLocation(OBJECT_SELF), TRUE); + while(GetIsObjectValid(oTarget)) + { + if (GetIsEnemy(oTarget)) + { + if (GetObjectSeen(oTarget) || GetObjectHeard(oTarget)) + { + // if (!GetIsDisabled(oTarget)) + { + fChallenge += pow(1.5, GetChallengeRating(oTarget)); + } + } + } + oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, GetLocation(OBJECT_SELF), TRUE); + } + return (log(fChallenge)/log(1.5)) - (IntToFloat(GetHitDice(oRelativeTo)) * HENCH_HITDICE_TO_CR); +} + + +//:://///////////////////////////////////////////// +//:: Bash Doors +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Used in DetermineCombatRound to keep a + henchmen bashing doors. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 4, 2002 +//::////////////////////////////////////////////// + +int HenchBashDoorCheck(int bPolymorphed) +{ + int bDoor = FALSE; + //This code is here to make sure that henchmen keep bashing doors and placeables. + object oDoor = GetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + + if(GetIsObjectValid(oDoor)) + { + int nDoorMax = GetMaxHitPoints(oDoor); + int nDoorNow = GetCurrentHitPoints(oDoor); + int nCnt = GetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP"); + if(GetLocked(oDoor) || GetIsTrapped(oDoor)) + { + if(nDoorMax == nDoorNow) + { + nCnt++; + SetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP", nCnt); + } + if(nCnt <= 2) + { + bDoor = TRUE; + HenchAttackObject(oDoor); + } + } + if(!bDoor) + { + DeleteLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + DeleteLocalInt(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH_HP"); + VoiceCuss(); + ActionDoCommand(HenchEquipDefaultWeapons()); + } + } + return bDoor; +} + + +void HenchStartRangedBashDoor(object oDoor) +{ + ActionEquipMostDamagingRanged(oDoor); + if (GetDistanceToObject(oDoor) < 5.0) + { + ActionMoveAwayFromObject(oDoor, FALSE, 5.0); + } + else + { + ActionWait(0.5); + } + ActionAttack(oDoor); + SetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH", oDoor); +} diff --git a/nwnds_module/hench_i0_conv.nss b/nwnds_module/hench_i0_conv.nss new file mode 100644 index 000000000..4064c3c2d --- /dev/null +++ b/nwnds_module/hench_i0_conv.nss @@ -0,0 +1,220 @@ +/* + + Henchman Inventory And Battle AI + + This file contains scripts used settings in conversations +*/ + +// void main() { } + + +#include "x0_i0_assoc" + + +const string sHenchAutoRecoverTraps = "AutoRecoverTraps"; +const string sHenchAutoOpenLocks = "AutoOpenLocks"; +const string sHenchAutoPickup = "AutoPickup"; +const string sHenchAutoOpenChest = "AutoOpenChest"; +const string sHenchNoDisarmTraps = "NoDisarmTraps"; + + +const string sHenchStealthMode = "X2_HENCH_STEALTH_MODE"; +const string sHenchStopCasting = "X2_L_STOPCASTING"; +const string sHenchDontDispel = "X2_HENCH_DO_NOT_DISPEL"; +const string sHenchSpellChallenge = "NewHenchChallenge"; +const string sHenchDisableAutoHide = "HenchDisableAutoHide"; + +const string sHenchDontSummon = "DontSummon"; +const string sHenchDontCastMelee = "DoNotCastMelee"; + +const string sHenchFamiliarChallenge = "NewFamiliarChallenge"; +const string sHenchFamiliarToDeath = "FamiliarToTheDeath"; + +const string sHenchAniCompChallenge = "NewAniCompChallenge"; +const string sHenchAniCompToDeath = "AniCompToTheDeath"; + +const string sHenchDualWieldState = "DualWieldState"; +const string sHenchLightOffHand = "LightOffHand"; +const string sHenchHenchRange = "HenchRange"; + + +const string sHenchFamiliarPreStr = "Fam"; +const string sHenchAniCompPreStr = "Ani"; +const string sHenchSummonPreStr = "Sum"; +const string sHenchDominatePreStr = "Dom"; + + +const string sHenchDefSettingsSet = "HENCH_DEF_SETTINGS_SET"; + + +string HenchGetAssocString(int iAssocType) +{ + if (iAssocType == ASSOCIATE_TYPE_FAMILIAR) + { + return sHenchFamiliarPreStr; + } + else if (iAssocType == ASSOCIATE_TYPE_ANIMALCOMPANION) + { + return sHenchAniCompPreStr; + } + else if (iAssocType == ASSOCIATE_TYPE_SUMMONED) + { + return sHenchSummonPreStr; + } + else if (iAssocType == ASSOCIATE_TYPE_DOMINATED) + { + return sHenchDominatePreStr; + } + return "null"; +} + + +void HenchSetAssociateInt(string sName, int iValue) +{ + SetLocalInt(OBJECT_SELF, sName, iValue); + + int iAssocType = GetAssociateType(OBJECT_SELF); + if ((iAssocType == ASSOCIATE_TYPE_NONE) || + (iAssocType == ASSOCIATE_TYPE_HENCHMAN)) + { + return; + } + + SetLocalInt(GetPCSpeaker(), HenchGetAssocString(iAssocType) + sName, iValue); +} + + +void HenchSetAssociateFloat(string sName, float fValue) +{ + SetLocalFloat(OBJECT_SELF, sName, fValue); + + int iAssocType = GetAssociateType(OBJECT_SELF); + if ((iAssocType == ASSOCIATE_TYPE_NONE) || + (iAssocType == ASSOCIATE_TYPE_HENCHMAN)) + { + return; + } + + SetLocalFloat(GetPCSpeaker(), HenchGetAssocString(iAssocType) + sName, fValue); +} + + +void HenchSetDefSettings() +{ + int iAssocType = GetAssociateType(OBJECT_SELF); + if ((iAssocType == ASSOCIATE_TYPE_NONE) || + (iAssocType == ASSOCIATE_TYPE_HENCHMAN)) + { + return; + } + + string preDefStr = HenchGetAssocString(iAssocType); + object oPC = GetPCSpeaker(); + + SetLocalInt(oPC, preDefStr + sAssociateMasterConditionVarname, GetLocalInt(OBJECT_SELF, sAssociateMasterConditionVarname)); + SetLocalInt(oPC, preDefStr + sHenchStealthMode, GetLocalInt(OBJECT_SELF, sHenchStealthMode)); + SetLocalInt(oPC, preDefStr + sHenchStopCasting, GetLocalInt(OBJECT_SELF, sHenchStopCasting)); + SetLocalInt(oPC, preDefStr + sHenchDontDispel, GetLocalInt(OBJECT_SELF, sHenchDontDispel)); +} + + +void HenchGetDefSettings() +{ + if (GetLocalInt(OBJECT_SELF, sHenchDefSettingsSet)) + { + return; + } + + SetLocalInt(OBJECT_SELF, sHenchDefSettingsSet, TRUE); + + int iAssocType = GetAssociateType(OBJECT_SELF); + if ((iAssocType == ASSOCIATE_TYPE_NONE) || + (iAssocType == ASSOCIATE_TYPE_HENCHMAN)) + { + return; + } + + string preDefStr = HenchGetAssocString(iAssocType); + object oPC = GetMaster(); + if (!GetIsObjectValid(oPC) || !GetIsPC(oPC)) + { + return; + } + + object oTarget; + object oSource; + string preSrcStr; + // check if the PC has never had settings copied + // for associate type + if (!GetLocalInt(oPC, preDefStr + sHenchDefSettingsSet)) + { + SetLocalInt(oPC, preDefStr + sHenchDefSettingsSet, TRUE); + oTarget = oPC; + oSource = OBJECT_SELF; + preSrcStr = preDefStr; + preDefStr = ""; + } + else + { + oTarget = OBJECT_SELF; + oSource = oPC; + preSrcStr = ""; + } + + SetLocalInt(oTarget, preSrcStr + sAssociateMasterConditionVarname, + GetLocalInt(oSource, preDefStr + sAssociateMasterConditionVarname)); + SetLocalInt(oTarget, preSrcStr + sHenchStealthMode, + GetLocalInt(oSource, preDefStr + sHenchStealthMode)); + SetLocalInt(oTarget, preSrcStr + sHenchStopCasting, + GetLocalInt(oSource, preDefStr + sHenchStopCasting)); + SetLocalInt(oTarget, preSrcStr + sHenchDontDispel, + GetLocalInt(oSource, preDefStr + sHenchDontDispel)); + SetLocalInt(oTarget, preSrcStr + sHenchDisableAutoHide, + GetLocalInt(oSource, preDefStr + sHenchDisableAutoHide)); + if (GetHasSkill(SKILL_DISABLE_TRAP)) + { + SetLocalInt(oTarget, preSrcStr + sHenchNoDisarmTraps, + GetLocalInt(oSource, preDefStr + sHenchNoDisarmTraps)); + SetLocalInt(oTarget, preSrcStr + sHenchAutoRecoverTraps, + GetLocalInt(oSource, preDefStr + sHenchAutoRecoverTraps)); + } + if (GetHasSkill(SKILL_OPEN_LOCK)) + { + SetLocalInt(oTarget, preSrcStr + sHenchAutoOpenLocks, + GetLocalInt(oSource, preDefStr + sHenchAutoOpenLocks)); + } + SetLocalInt(oTarget, preSrcStr + sHenchAutoPickup, + GetLocalInt(oSource, preDefStr + sHenchAutoPickup)); + if (GetSkillRank(SKILL_SEARCH) * 3 / 4 >= GetHitDice(OBJECT_SELF)) + { + SetLocalInt(oTarget, preSrcStr + sHenchAutoOpenChest, + GetLocalInt(oSource, preDefStr + sHenchAutoOpenChest)); + } + SetLocalFloat(oTarget, preSrcStr + sHenchSpellChallenge, + GetLocalFloat(oSource, preDefStr + sHenchSpellChallenge)); + SetLocalInt(oTarget, preSrcStr + sHenchDualWieldState, + GetLocalInt(oSource, preDefStr + sHenchDualWieldState)); + SetLocalInt(oTarget, preSrcStr + sHenchLightOffHand, + GetLocalInt(oSource, preDefStr + sHenchLightOffHand)); + SetLocalFloat(oTarget, preSrcStr + sHenchHenchRange, + GetLocalFloat(oSource, preDefStr + sHenchHenchRange)); +} + + +void HenchSetAssociateFlee(float fChallenge, int bFightToDeath) +{ + object oPC = GetPCSpeaker(); + int iAssocType = GetAssociateType(OBJECT_SELF); + // Set the variables + if (iAssocType == ASSOCIATE_TYPE_FAMILIAR) + { + SetLocalFloat(oPC, sHenchFamiliarChallenge, fChallenge); + SetLocalInt(oPC, sHenchFamiliarToDeath, bFightToDeath); + } + else if (iAssocType == ASSOCIATE_TYPE_ANIMALCOMPANION) + { + SetLocalFloat(oPC, sHenchAniCompChallenge, fChallenge); + SetLocalInt(oPC, sHenchAniCompToDeath, bFightToDeath); + } +} + diff --git a/nwnds_module/hench_i0_equip.nss b/nwnds_module/hench_i0_equip.nss new file mode 100644 index 000000000..5544c6b79 --- /dev/null +++ b/nwnds_module/hench_i0_equip.nss @@ -0,0 +1,770 @@ +/* + + Henchman Inventory And Battle AI + + This file contains routines used in equipping monsters + and henchman. Contains modified EquipAppropriateWeapons + function (renamed HenchEquipAppropriateWeapons) + +*/ + +#include "hench_i0_generic" + +// void main() { } + +// internal weapon state settings +const int HENCH_AI_WEAPON_INIT = 0x00000001; +const int HENCH_AI_HAS_MELEE = 0x00000002; +const int HENCH_AI_HAS_MELEE_WEAPON = 0x00000004; +const int HENCH_AI_HAS_RANGED_WEAPON = 0x00000008; + + +const string HENCH_AI_WEAPON = "HENCH_AI_WEAPON"; +const string HENCH_AI_STORED_MELEE = "HenchStoredMeleeWeapon"; +const string HENCH_AI_STORED_RANGED = "HenchStoredRangedWeapon"; +const string HENCH_AI_STORED_SHIELD = "StoredShield"; +const string HENCH_AI_SHIELD_STATUS = "HaveShieldStatus"; +const string HENCH_AI_STORED_OFF_HAND = "StoredOffHand"; +const string HENCH_AI_OFF_HAND_STATUS = "HaveOffhandStatus"; +const string HENCH_AI_SWITCHED_TO_MELEE = "SwitchedToMelee"; +const string HENCH_AI_COMBAT_EQUIP = "HenchCombatEquip"; + + +// void main() { } + + +// cache weapon state information on self +void SetWeaponState(int nCondition, int bValid = TRUE); + +// un-equip weapons from left and right hands +void UnequipWeapons(); + +// equip best shield available +void EquipShield(int bIndicateStatus); + +// get cached weapon state information +int GetInitWeaponStatus(); + +// equip best melee weapon(s) against target AND check for shield +int EquipMeleeWeapons(object oTarget, int bIndicateStatus, int iCallNumber); + +// equip best ranged weapon(s) against target +int EquipRangedWeapon(object oTarget, int bIndicateStatus, int iCallNumber); + +// equip best weapons based on target and threshold distance +int HenchEquipAppropriateWeapons(object oTarget, float fThresholdDistance, int bIndicateSwitch, int bPolymorphed); + +// continue weapon equipping that is in progress +void ActionContinueEquip(object oTarget, int bIndicateStatus, int iCallNumber); + +// wrapper to equip default weapons +void HenchEquipDefaultWeapons(object oCreature = OBJECT_SELF, int bShowStatus = FALSE); + +// clear all cached weapon state information +void ClearWeaponStates(object oCreature = OBJECT_SELF); + +// equip weapons on self +void ActionChangeEquippedWeapons(); + +// equip weapons on target creature +void ChangeEquippedWeapons(object oCreature); + + +void SetWeaponState(int nCondition, int bValid = TRUE) +{ + int nStatus = GetLocalInt(OBJECT_SELF, HENCH_AI_WEAPON); + if (bValid) + { + nStatus = nStatus | nCondition; + SetLocalInt(OBJECT_SELF, HENCH_AI_WEAPON, nStatus); + } + else + { + nStatus = nStatus & ~nCondition; + SetLocalInt(OBJECT_SELF, HENCH_AI_WEAPON, nStatus); + } +} + + +void UnequipWeapons() +{ + object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if (GetIsObjectValid(oRight)) + { + ActionUnequipItem(oRight); + } + object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND); + if (GetIsObjectValid(oLeft)) + { + ActionUnequipItem(oLeft); + } +} + + +void EquipShield(int bIndicateStatus) +{ + int iHaveShieldStatus = GetLocalInt(OBJECT_SELF, HENCH_AI_SHIELD_STATUS); + object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND); + if (iHaveShieldStatus == 2) + { + // not really a shield, get rid of + if (GetIsObjectValid(oShield)) + { + ActionUnequipItem(oShield); + } + return; + } + if (iHaveShieldStatus == 1) + { + object oStoredShield = GetLocalObject(OBJECT_SELF, HENCH_AI_STORED_SHIELD); + if (oStoredShield == oShield) + { + return; + } + + if (GetIsObjectValid(oStoredShield) && (GetItemPossessor(oStoredShield) == OBJECT_SELF)) + { + ActionEquipItem(oStoredShield, INVENTORY_SLOT_LEFTHAND); + return; + } + } + + int nMaxValue = 0; + int iCreatureSize = GetCreatureSize(OBJECT_SELF); + object oRealMaster = GetRealMaster(); + int bNoPCMaster = !(GetIsObjectValid(oRealMaster) && GetIsPC(oRealMaster)); + if (GetIsObjectValid(oShield)) + { + int nSize = 1; // note start at one less so easy compare with creature size + switch (GetBaseItemType(oShield)) + { + case BASE_ITEM_TOWERSHIELD: + nSize ++; + case BASE_ITEM_LARGESHIELD: + nSize ++; + case BASE_ITEM_SMALLSHIELD: + if (bNoPCMaster || GetIdentified(oShield)) + { + int bPlotFlag = GetPlotFlag(oShield); + if (bPlotFlag) + { + SetPlotFlag(oShield, FALSE); + } + nMaxValue = GetGoldPieceValue(oShield); + if (bPlotFlag) + { + SetPlotFlag(oShield, TRUE); + } + } + else + { + nMaxValue = 2; + } + break; +/* case BASE_ITEM_TORCH: + nMaxValue = 1; + break; */ + default: + // not a shield - remove + ActionUnequipItem(oShield); + oShield = OBJECT_INVALID; + break; + } + } + + int iNewShield = FALSE; + int tempValue; + int bHasShieldProf = GetHasFeat(FEAT_SHIELD_PROFICIENCY); + int bCantUseShield = FALSE; +// int bCanUseTorch = (iCreatureSize > 1) && GetCreatureUseItems(OBJECT_SELF); + + object oItem = GetFirstItemInInventory(); + while (GetIsObjectValid(oItem)) + { + // skip past any items in a container + if (GetHasInventory(oItem)) + { + object oContainer = oItem; + object oSubItem = GetFirstItemInInventory(oContainer); + oItem = GetNextItemInInventory(); + while (GetIsObjectValid(oSubItem)) + { + oItem = GetNextItemInInventory(); + oSubItem = GetNextItemInInventory(oContainer); + } + continue; + } + int nSize = 1; // note start at one less so easy compare with creature size + switch (GetBaseItemType(oItem)) + { + case BASE_ITEM_TOWERSHIELD: + nSize ++; + case BASE_ITEM_LARGESHIELD: + nSize ++; + case BASE_ITEM_SMALLSHIELD: + if (bHasShieldProf && (iCreatureSize >= nSize)) + { + if (bNoPCMaster || GetIdentified(oItem)) + { + int bPlotFlag = GetPlotFlag(oItem); + if (bPlotFlag) + { + SetPlotFlag(oItem, FALSE); + } + tempValue = GetGoldPieceValue(oItem); + if (bPlotFlag) + { + SetPlotFlag(oItem, TRUE); + } + } + else + { + tempValue = 2; + } + if (tempValue > nMaxValue) + { + nMaxValue = tempValue; + oShield = oItem; + iNewShield = TRUE; + } + } + else + { + bCantUseShield = TRUE; + } + break; +/* case BASE_ITEM_TORCH: + if (bCanUseTorch && (1 > nMaxValue)) + { + nMaxValue = 1; + oShield = oItem; + iNewShield = TRUE; + } */ + break; + default: + break; + + } + oItem = GetNextItemInInventory(); + } + if (nMaxValue > 0) + { + SetLocalInt(OBJECT_SELF, HENCH_AI_SHIELD_STATUS, 1); + SetLocalObject(OBJECT_SELF, HENCH_AI_STORED_SHIELD, oShield); + } + else + { + SetLocalInt(OBJECT_SELF, HENCH_AI_SHIELD_STATUS, 2); + DeleteLocalObject(OBJECT_SELF, HENCH_AI_STORED_SHIELD); + } + if (iNewShield) + { + ActionEquipItem(oShield, INVENTORY_SLOT_LEFTHAND); + } + else if (bCantUseShield && bIndicateStatus) + { + SpeakString(sHenchCantUseShield); + } +} + + +int GetMeleeWeaponSize(object oItem) +{ + if (GetWeaponRanged(oItem)) + { + return 0; + } + int nBase = GetBaseItemType(oItem); + if (nBase == BASE_ITEM_TORCH) + { + return 0; + } + string sWeaponSizeStr = "HENCH_AI_WEAPON_SIZE_" + IntToString(nBase); + object oModule = GetModule(); + int iWeaponSize = GetLocalInt(oModule, sWeaponSizeStr); + if (iWeaponSize == 0) + { + iWeaponSize = StringToInt(Get2DAString("baseitems", "WeaponSize", nBase)); + if (iWeaponSize == 0) + { + iWeaponSize = -1; + } + SetLocalInt(oModule, sWeaponSizeStr, iWeaponSize); + } + if (iWeaponSize > 0) + { + return iWeaponSize; + } + return 0; +} + + +int GetInitWeaponStatus() +{ + int nResult = GetLocalInt(OBJECT_SELF, HENCH_AI_WEAPON); + if (nResult) + { + return nResult; + } + + int bHasMeleeWeapon; + int bHasMeleeAttack; + int bHasRangedWeapon; + + object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if (GetIsObjectValid(oItem)) + { + if (GetWeaponRanged(oItem)) + { + bHasRangedWeapon = TRUE; + } + else if (GetMeleeWeaponSize(oItem) > 0) + { + bHasMeleeWeapon = TRUE; + } + } + + oItem = GetFirstItemInInventory(); + while (GetIsObjectValid(oItem) && !(bHasMeleeWeapon && bHasRangedWeapon)) + { + // skip past any items in a container + if (GetHasInventory(oItem)) + { + object oContainer = oItem; + object oSubItem = GetFirstItemInInventory(oContainer); + oItem = GetNextItemInInventory(); + while (GetIsObjectValid(oSubItem)) + { + oItem = GetNextItemInInventory(); + oSubItem = GetNextItemInInventory(oContainer); + } + continue; + } + if (!bHasRangedWeapon && GetWeaponRanged(oItem)) + { + bHasRangedWeapon = TRUE; + } + else if (!bHasMeleeWeapon && GetMeleeWeaponSize(oItem) > 0) + { + bHasMeleeWeapon = TRUE; + } + oItem = GetNextItemInInventory(); + } + if (!bHasMeleeWeapon) + { + if (GetHasFeat(FEAT_IMPROVED_UNARMED_STRIKE)) + { + bHasMeleeAttack = TRUE; + } + else if (GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_R))) + { + bHasMeleeAttack = TRUE; + } + else if (GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_B))) + { + bHasMeleeAttack = TRUE; + } + else if (GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CWEAPON_L))) + { + bHasMeleeAttack = TRUE; + } + } + else + { + bHasMeleeAttack = TRUE; + } + if (bHasMeleeAttack) + { + nResult = HENCH_AI_WEAPON_INIT | HENCH_AI_HAS_MELEE; + } + else + { + nResult = HENCH_AI_WEAPON_INIT; + } + if (bHasMeleeWeapon) + { + nResult = nResult | HENCH_AI_HAS_MELEE_WEAPON; + } + if (bHasRangedWeapon) + { + nResult = nResult | HENCH_AI_HAS_RANGED_WEAPON; + } + + SetLocalInt(OBJECT_SELF, HENCH_AI_WEAPON, nResult); + return nResult; +} + + +int EquipMeleeWeapons(object oTarget, int bIndicateStatus, int iCallNumber) +{ +// float time = IntToFloat(GetTimeSecond()) + IntToFloat(GetTimeMillisecond()) /1000.0; +// Jug_Debug(GetName(OBJECT_SELF) + " equip melee vs. " + GetName(oTarget) + " call number " + IntToString(iCallNumber) + " time " + FloatToString(time)); + + int nWeaponStatus = GetInitWeaponStatus(); + if (iCallNumber == 1) + { + if (!(nWeaponStatus & HENCH_AI_HAS_MELEE_WEAPON)) + { + if ((nWeaponStatus & HENCH_AI_HAS_MELEE)) + { + // no weapons, has creature attacks, make sure ranged weapons removed + UnequipWeapons(); + } + return TRUE; + } + ActionEquipMostDamagingMelee(oTarget); + return FALSE; + } + + object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + int iCreatureSize = GetCreatureSize(OBJECT_SELF); + int iRWeaponSize = GetMeleeWeaponSize(oRight); + + if (iRWeaponSize > iCreatureSize) + { + // two handed weapon - done + return TRUE; + } + // for dual weapon selection, must wait until right weapon is equipped + if (!GetIsObjectValid(oRight)) + { + if (nWeaponStatus & HENCH_AI_HAS_MELEE) + { + return TRUE; + } + else + { + SetWeaponState(HENCH_AI_HAS_MELEE_WEAPON, FALSE); + return TRUE; + } + } + + int dualWieldState = GetLocalInt(OBJECT_SELF, sHenchDualWieldState); + if (dualWieldState == 0) + { + dualWieldState = GetHasFeat(FEAT_TWO_WEAPON_FIGHTING) ? 1 : 2; + } + + if (dualWieldState == 2) + { + EquipShield(bIndicateStatus); + return TRUE; + } + // already have something in left + object oOrigLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND); + int iHaveOffHandStatus = GetLocalInt(OBJECT_SELF, HENCH_AI_OFF_HAND_STATUS); + if (iHaveOffHandStatus == 2) + { + EquipShield(bIndicateStatus); + return TRUE; + } + if (iHaveOffHandStatus == 1) + { + object oStoredOffHand = GetLocalObject(OBJECT_SELF, HENCH_AI_STORED_OFF_HAND); + if (oStoredOffHand == oOrigLeft) + { + return TRUE; + } + + if (GetIsObjectValid(oStoredOffHand) && (GetItemPossessor(oStoredOffHand) == OBJECT_SELF) && + oRight != oStoredOffHand) + { + ActionEquipItem(oStoredOffHand, INVENTORY_SLOT_LEFTHAND); + return TRUE; + } + } + + object oLeft = OBJECT_INVALID; + int nLeftPrevEquip = GetIsObjectValid(oOrigLeft); + int nMaxValue = 0; + int iMaxWeaponSize = iCreatureSize; + if (GetLocalInt(OBJECT_SELF, sHenchLightOffHand) && (iRWeaponSize >= iCreatureSize)) + { + iMaxWeaponSize--; + } + int iCurWeaponSize; + if (nLeftPrevEquip) + { + iCurWeaponSize = GetMeleeWeaponSize(oOrigLeft); + if (iCurWeaponSize != 0 && iCurWeaponSize <= iMaxWeaponSize) + { + if (GetIdentified(oOrigLeft)) + { + int bPlotFlag = GetPlotFlag(oOrigLeft); + if (bPlotFlag) + { + SetPlotFlag(oOrigLeft, FALSE); + } + nMaxValue = GetGoldPieceValue(oOrigLeft); + if (bPlotFlag) + { + SetPlotFlag(oOrigLeft, TRUE); + } + } + else + { + nMaxValue = 1; + } + oLeft = oOrigLeft; + } + } + // Then look for more than 1 single handed melee weapon + int iNewOffHand = FALSE; + + object oItem = GetFirstItemInInventory(); + while (GetIsObjectValid(oItem)) + { + // skip past any items in a container + if (GetHasInventory(oItem)) + { + object oContainer = oItem; + object oSubItem = GetFirstItemInInventory(oContainer); + oItem = GetNextItemInInventory(); + while (GetIsObjectValid(oSubItem)) + { + oItem = GetNextItemInInventory(); + oSubItem = GetNextItemInInventory(oContainer); + } + continue; + } + int nItemType = GetBaseItemType(oItem); + if (nItemType != BASE_ITEM_LIGHTFLAIL && nItemType != BASE_ITEM_MORNINGSTAR && + nItemType != BASE_ITEM_WHIP) + { + iCurWeaponSize = GetMeleeWeaponSize(oItem); + if (iCurWeaponSize != 0 && iCurWeaponSize <= iMaxWeaponSize) + { + int tempValue; + if (GetIdentified(oItem)) + { + int bPlotFlag = GetPlotFlag(oItem); + if (bPlotFlag) + { + SetPlotFlag(oItem, FALSE); + } + tempValue = GetGoldPieceValue(oItem); + if (bPlotFlag) + { + SetPlotFlag(oItem, TRUE); + } + } + else + { + tempValue = 1; + } + if (tempValue > nMaxValue) + { + nMaxValue = tempValue; + oLeft = oItem; + iNewOffHand = TRUE; + } + } + } + oItem = GetNextItemInInventory(); + } + if (nMaxValue > 0) + { + SetLocalInt(OBJECT_SELF, HENCH_AI_OFF_HAND_STATUS, 1); + SetLocalObject(OBJECT_SELF, HENCH_AI_STORED_OFF_HAND, oLeft); + } + else + { + SetLocalInt(OBJECT_SELF, HENCH_AI_OFF_HAND_STATUS, 2); + DeleteLocalObject(OBJECT_SELF, HENCH_AI_STORED_OFF_HAND); + } + if (iNewOffHand) + { + ActionEquipItem(oLeft, INVENTORY_SLOT_LEFTHAND); + } + else if (GetIsObjectValid(oOrigLeft) && oOrigLeft == oLeft) + { + // nothing to do + } + else + { + EquipShield(bIndicateStatus); + } + return TRUE; +} + + +int EquipRangedWeapon(object oTarget, int bIndicateStatus, int iCallNumber) +{ +// float time = IntToFloat(GetTimeSecond()) + IntToFloat(GetTimeMillisecond()) /1000.0; +//Jug_Debug(GetName(OBJECT_SELF) + " equip ranged vs. " + GetName(oTarget) + " call number " + IntToString(iCallNumber) + " time " + FloatToString(time)); + if (iCallNumber == 1) + { + ActionEquipMostDamagingRanged(oTarget); + return FALSE; + } + + object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if (!GetWeaponRanged(oRight)) + { + if (iCallNumber == 2) + { + ActionWait(0.3); + return FALSE; + } +// object oRealMaster = GetRealMaster(); +// if (GetIsObjectValid(oRealMaster) && GetIsPC(oRealMaster)) +// { +// SpeakString(sHenchCantUseRanged); +// } +// Jug_Debug(GetName(OBJECT_SELF) + " turning off ranged weapons"); + SetWeaponState(HENCH_AI_HAS_RANGED_WEAPON, FALSE); + SetLocalInt(OBJECT_SELF, "UseRangedWeapons", FALSE); + return EquipMeleeWeapons(oTarget, bIndicateStatus, 1); + } + + switch (GetBaseItemType(oRight)) + { + case BASE_ITEM_DART: + case BASE_ITEM_SHURIKEN: + case BASE_ITEM_SLING: + case BASE_ITEM_THROWINGAXE: + EquipShield(bIndicateStatus); + break; + } + return TRUE; +} + + +//:://///////////////////////////////////////////// +//:: Equip Appropriate Weapons +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Makes the user get his best weapons. If the + user is a Henchmen then he checks the player + preference. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 2, 2002 +//::////////////////////////////////////////////// + +int HenchEquipAppropriateWeapons(object oTarget, float fThresholdDistance, int bIndicateSwitch, int bPolymorphed) +{ +// Jug_Debug(GetName(OBJECT_SELF) + " trying out equip"); + + if (bPolymorphed) + { + return TRUE; + } + int nWeaponStatus = GetInitWeaponStatus(); + int bUseRanged; + + if (nWeaponStatus & HENCH_AI_HAS_RANGED_WEAPON) + { + // has ranged weapons + object oRealMaster = GetRealMaster(); + if(GetIsObjectValid(oRealMaster) && GetIsPC(oRealMaster) && !GetAssociateState(NW_ASC_USE_RANGED_WEAPON)) + { + bUseRanged = FALSE; + } + else + { + if (nWeaponStatus & HENCH_AI_HAS_MELEE) + { + // if has melee weapons (includes creature weapons & monk class) + // if z distance is greater than two then assume cliff + // TODO add size of creatures for distance? + bUseRanged = (GetDistanceToObject(oTarget) > fThresholdDistance) || + (fabs(GetPosition(OBJECT_SELF).z - GetPosition(oTarget).z) > 2.0); + } + else + { + bUseRanged = TRUE; + } + } + } + else + { + bUseRanged = FALSE; + } + if (bIndicateSwitch && GetAssociateState(NW_ASC_USE_RANGED_WEAPON)) + { + if (!(nWeaponStatus & HENCH_AI_HAS_RANGED_WEAPON)) + { + DeleteLocalInt(OBJECT_SELF, HENCH_AI_SWITCHED_TO_MELEE); + } + else + { + int bSwitchedToMelee = GetLocalInt(OBJECT_SELF, HENCH_AI_SWITCHED_TO_MELEE); + if (bUseRanged && bSwitchedToMelee) + { + SpeakString(sHenchSwitchToMissle); + DeleteLocalInt(OBJECT_SELF, HENCH_AI_SWITCHED_TO_MELEE); + } + else if (!bUseRanged && !bSwitchedToMelee) + { + SpeakString(sHenchSwitchToRanged); + SetLocalInt(OBJECT_SELF, HENCH_AI_SWITCHED_TO_MELEE, TRUE); + } + } + } + SetLocalInt(OBJECT_SELF, "UseRangedWeapons", bUseRanged); + if (bUseRanged) + { + object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if (!GetWeaponRanged(oRight)) + { + object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND); + if (GetIsObjectValid(oLeft)) + { + // get rid of weapon or shield + // shield or weapon in left hand prevents switch to ranged + ActionUnequipItem(oLeft); + ActionWait(0.3); + } + } + return EquipRangedWeapon(oTarget, bIndicateSwitch, 1); + } + else + { + return EquipMeleeWeapons(oTarget, bIndicateSwitch, 1); + } +} + + +void ActionContinueEquip(object oTarget, int bIndicateStatus, int iCallNumber) +{ + if (GetLocalInt(OBJECT_SELF, "UseRangedWeapons")) + { + if (!EquipRangedWeapon(oTarget, bIndicateStatus, iCallNumber)) + { + ActionDoCommand(ActionContinueEquip(oTarget, bIndicateStatus, iCallNumber + 1)); + } + } + else + { + if (!EquipMeleeWeapons(oTarget, bIndicateStatus, iCallNumber)) + { + ActionDoCommand(ActionContinueEquip(oTarget, bIndicateStatus, iCallNumber + 1)); + } + } +} + + +const string sHenchShowWeaponStatus = "HenchShowWeaponStatus"; + +void HenchEquipDefaultWeapons(object oCreature = OBJECT_SELF, int bShowStatus = FALSE) +{ + if (bShowStatus) + { + SetLocalInt(oCreature, sHenchShowWeaponStatus, TRUE); + } + ExecuteScript("hench_o0_equip", oCreature); +} + + +void ClearWeaponStates(object oCreature = OBJECT_SELF) +{ + DeleteLocalInt(oCreature, HENCH_AI_SWITCHED_TO_MELEE); + DeleteLocalInt(oCreature, HENCH_AI_SHIELD_STATUS); + DeleteLocalObject(oCreature, HENCH_AI_STORED_SHIELD); + DeleteLocalInt(oCreature, HENCH_AI_OFF_HAND_STATUS); + DeleteLocalObject(oCreature, HENCH_AI_STORED_OFF_HAND); + DeleteLocalInt(oCreature, HENCH_AI_WEAPON); +} diff --git a/nwnds_module/hench_i0_generic.nss b/nwnds_module/hench_i0_generic.nss new file mode 100644 index 000000000..06891d321 --- /dev/null +++ b/nwnds_module/hench_i0_generic.nss @@ -0,0 +1,654 @@ +/* + + Henchman Inventory And Battle AI + + This file contains miscellaneous functions used by + many scripts. + +*/ + +// void main() { } + +#include "nw_i0_generic" +#include "x0_i0_voice" +#include "hench_i0_strings" +#include "hench_i0_options" +#include "hench_i0_conv" + + + +// This constant somewhat matches taking a henchmen hit dice and converting to CR rating +const float HENCH_HITDICE_TO_CR = 0.7; + +// general effects on self +const int HENCH_HAS_ETHEREAL_EFFECT = 0x001; +const int HENCH_HAS_CONCEALMENT_EFFECT = 0x002; +const int HENCH_HAS_INVISIBILITY_EFFECT = 0x004; +const int HENCH_HAS_SANTUARY_EFFECT = 0x008; +const int HENCH_HAS_DAZED_EFFECT = 0x010; +const int HENCH_HAS_CONFUSED_EFFECT = 0x020; +const int HENCH_HAS_CHARMED_EFFECT = 0x040; +const int HENCH_HAS_POLYMORPH_EFFECT = 0x080; +const int HENCH_HAS_HASTE_EFFECT = 0x100; +const int HENCH_HAS_TIMESTOP_EFFECT = 0x200; + + +const string sHenchSummonedFamiliar = "HenchSummonedFamiliar"; +const string sHenchSummonedAniComp = "HenchSummonedAniComp"; +const string sHenchPseudoSummon = "HenchPseudoSummon"; + + +const string sHenchDontAttackFlag = "DoNotAttack"; +const string sHenchScoutingFlag = "Scouting"; +const string sHenchScoutTarget = "ScoutTarget"; +const string sHenchRunningAway = "RunningAway"; + + +const int HENCH_HEAL_SELF_UNKNOWN = 0; +const int HENCH_HEAL_SELF_CANT = 1; +const int HENCH_HEAL_SELF_WAIT = 2; +const int HENCH_HEAL_SELF_IN_PROG = 3; +const string HENCH_HEAL_SELF_STATE = "HenchHealSelfState"; + + +// As MyPrintString, but to screen instead of log +void Jug_Debug(string sString); + +// returns TRUE if any one of the two effect types are present +int GetHasAnyEffect2(int nEffectType1, int nEffectType2, object oTarget = OBJECT_SELF); + +// returns TRUE if the target is disabled +int GetIsDisabled(object oTarget); + +// returns TRUE if the target is disabled or has another effect +int GetIsDisabled1(int nOtherEffect, object oTarget); + +// returns TRUE if the target is disabled or has another effect +int GetIsDisabled2(int nOtherEffect1, int nOtherEffect2, object oTarget); + +// returns TRUE if racial type is a humanoid +int GetIsHumanoid(int nRacial); + +// returns TRUE if creature can use items from their inventory +int GetCreatureUseItems(object oCreature); + +// returns TRUE if the item property is present in any one of the equipped items +int GetCreatureHasItemProperty(int nItemProperty, object oCreature = OBJECT_SELF); + +// set array access for objects +void SetObjectArray(object oSource, string sName, int iElem, object oElem); + +// get array access for objects +object GetObjectArray(object oSource, string sName, int iElem); + +// set array access for ints +void SetIntArray(object oSource, string sName, int iElem, int iState); + +// get array access for ints +int GetIntArray(object oSource, string sName, int iElem); + +// set array access for floats +void SetFloatArray(object oSource, string sName, int iElem, float fVal); + +// get array access for floats +float GetFloatArray(object oSource, string sName, int iElem); + +// returns TRUE if object1 and object are on opposite sides of door +int IsOnOppositeSideOfDoor(object oDoor, object obj1, object obj2); + +// stores the last spell cast (no timeout) +void HenchSetLastGenericSpellCast(int nSpell); + +// returns the highest level master of oAssociate +// returns OBJECT_INVALID if no master +object GetRealMaster(object oAssociate = OBJECT_SELF); + +// returns the highest level master of oAssociate +// returns OBJECT_SELF if no master +object GetTopMaster(object oAssociate = OBJECT_SELF); + +// converts a prestige class into the best matching primary class +int HenchConvertClass(int nClass, object oCharacter); + +// returns the class type that best represents oCharacter +int HenchDetermineClassToUse(object oCharacter = OBJECT_SELF); + +// Cleans all temporary values used during combat +void CleanCombatVars(); + + + +// As MyPrintString, but to screen instead of log +void Jug_Debug(string sString) +{ + SendMessageToPC(GetFirstPC(), sString); +} + + +int GetHasAnyEffect2(int nEffectType1, int nEffectType2, object oTarget = OBJECT_SELF) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + int nTestEffect = GetEffectType(eCheck); + if(nTestEffect == nEffectType1) + { + return TRUE; + } + if(nTestEffect == nEffectType2) + { + return TRUE; + } + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + + +int GetIsDisabled(object oTarget) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + switch (GetEffectType(eCheck)) + { + case EFFECT_TYPE_PARALYZE: + case EFFECT_TYPE_STUNNED: + case EFFECT_TYPE_FRIGHTENED: + case EFFECT_TYPE_SLEEP: + case EFFECT_TYPE_DAZED: + case EFFECT_TYPE_CONFUSED: + case EFFECT_TYPE_TURNED: + case EFFECT_TYPE_PETRIFY: + return TRUE; + } + + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + + +int GetIsDisabled1(int nOtherEffect, object oTarget) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + int nTestEffect = GetEffectType(eCheck); + switch (nTestEffect) + { + case EFFECT_TYPE_PARALYZE: + case EFFECT_TYPE_STUNNED: + case EFFECT_TYPE_FRIGHTENED: + case EFFECT_TYPE_SLEEP: + case EFFECT_TYPE_DAZED: + case EFFECT_TYPE_CONFUSED: + case EFFECT_TYPE_TURNED: + case EFFECT_TYPE_PETRIFY: + return TRUE; + } + if (nTestEffect == nOtherEffect) + { + return TRUE; + } + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + + +int GetIsDisabled2(int nOtherEffect1, int nOtherEffect2, object oTarget) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + int nTestEffect = GetEffectType(eCheck); + switch (nTestEffect) + { + case EFFECT_TYPE_PARALYZE: + case EFFECT_TYPE_STUNNED: + case EFFECT_TYPE_FRIGHTENED: + case EFFECT_TYPE_SLEEP: + case EFFECT_TYPE_DAZED: + case EFFECT_TYPE_CONFUSED: + case EFFECT_TYPE_TURNED: + case EFFECT_TYPE_PETRIFY: + return TRUE; + } + if (nTestEffect == nOtherEffect1) + { + return TRUE; + } + if (nTestEffect == nOtherEffect2) + { + return TRUE; + } + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + + +int GetIsHumanoid(int nRacial) +{ + return + (nRacial == RACIAL_TYPE_DWARF) || + (nRacial == RACIAL_TYPE_ELF) || + (nRacial == RACIAL_TYPE_GNOME) || + (nRacial == RACIAL_TYPE_HUMANOID_GOBLINOID) || + (nRacial == RACIAL_TYPE_HALFLING) || + (nRacial == RACIAL_TYPE_HUMAN) || + (nRacial == RACIAL_TYPE_HALFELF) || + (nRacial == RACIAL_TYPE_HALFORC) || + (nRacial == RACIAL_TYPE_HUMANOID_MONSTROUS) || + (nRacial == RACIAL_TYPE_HUMANOID_ORC) || + (nRacial == RACIAL_TYPE_HUMANOID_REPTILIAN); +} + + +int GetCreatureUseItems(object oCreature) +{ + if (GetIsPlayableRacialType(oCreature)) + { + return TRUE; + } + int nRace = GetRacialType(oCreature); + if ((nRace >= RACIAL_TYPE_HUMANOID_GOBLINOID && nRace <= RACIAL_TYPE_HUMANOID_REPTILIAN) || + nRace == RACIAL_TYPE_FEY || nRace == RACIAL_TYPE_GIANT) + { + return TRUE; + } + int nAppearanceType = GetAppearanceType(oCreature); + if (nRace == RACIAL_TYPE_UNDEAD) + { + return nAppearanceType != APPEARANCE_TYPE_DRACOLICH && + nAppearanceType != APPEARANCE_TYPE_SKELETAL_DEVOURER && + nAppearanceType != APPEARANCE_TYPE_ALLIP; + } + if (nAppearanceType >= APPEARANCE_TYPE_DWARF && nAppearanceType <= APPEARANCE_TYPE_HUMAN) + { + return TRUE; + } + if (nRace == RACIAL_TYPE_ABERRATION) + { + return nAppearanceType == APPEARANCE_TYPE_MINDFLAYER || + nAppearanceType == APPEARANCE_TYPE_MINDFLAYER_2 || + nAppearanceType == APPEARANCE_TYPE_MINDFLAYER_ALHOON || + nAppearanceType == APPEARANCE_TYPE_DRIDER || + nAppearanceType == APPEARANCE_TYPE_DRIDER_CHIEF || + nAppearanceType == APPEARANCE_TYPE_DRIDER_FEMALE || + GetCreatureUseItemsOverride(oCreature); + } + if (nRace == RACIAL_TYPE_OUTSIDER) + { + return nAppearanceType == APPEARANCE_TYPE_SUCCUBUS || + nAppearanceType == APPEARANCE_TYPE_AZER_MALE || + nAppearanceType == APPEARANCE_TYPE_AZER_FEMALE || + nAppearanceType == APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE || + nAppearanceType == APPEARANCE_TYPE_RAKSHASA_TIGER_FEMALE || + GetCreatureUseItemsOverride(oCreature); + } + return GetCreatureUseItemsOverride(oCreature); +} + + +int GetCreatureHasItemProperty(int nItemProperty, object oCreature = OBJECT_SELF) +{ + int i; + for (i = 0; i < NUM_INVENTORY_SLOTS; i++) + { + object oItem = GetItemInSlot(i, oCreature); + if(GetItemHasItemProperty(oItem, nItemProperty)) + { + return TRUE; + } + } + return FALSE; +} + + +void SetObjectArray(object oSource, string sName, int iElem, object oElem) +{ + string sFull = sName+IntToString(iElem); + SetLocalObject(oSource,sFull,oElem); +} + +object GetObjectArray(object oSource, string sName, int iElem) +{ + string sFull = sName+IntToString(iElem); + return GetLocalObject(oSource,sFull); +} + +void SetIntArray(object oSource, string sName, int iElem, int iState) +{ + string sFull = sName+IntToString(iElem); + SetLocalInt(oSource,sFull,iState); +} + +int GetIntArray(object oSource, string sName, int iElem) +{ + string sFull = sName+IntToString(iElem); + return GetLocalInt(oSource,sFull); +} + +void SetFloatArray(object oSource, string sName, int iElem, float fVal) +{ + string sFull = sName+IntToString(iElem); + SetLocalFloat(oSource,sFull,fVal); +} + +float GetFloatArray(object oSource, string sName, int iElem) +{ + string sFull = sName+IntToString(iElem); + return GetLocalFloat(oSource,sFull); +} + +int IsOnOppositeSideOfDoor(object oDoor, object obj1, object obj2) +{ + float fDoorAngle = GetFacing(oDoor); + + vector vDoor = GetPositionFromLocation(GetLocation(oDoor)); + vector v1 = GetPositionFromLocation(GetLocation(obj1)); + vector v2 = GetPositionFromLocation(GetLocation(obj2)); + + float fAngle1 = VectorToAngle(v1 - vDoor); + float fAngle2 = VectorToAngle(v2 - vDoor); + + fAngle1 -= fDoorAngle; + fAngle2 -= fDoorAngle; + if (fAngle1 < 0.0) + { + fAngle1 += 360.0; + } + if (fAngle2 < 0.0) + { + fAngle2 += 360.0; + } + + int bSide1 = fAngle1 < 90.0 || fAngle1 > 270.0; + int bSide2 = fAngle2 < 90.0 || fAngle2 > 270.0; + + return bSide1 != bSide2; +} + + +void HenchSetLastGenericSpellCast(int nSpell) +{ + SetLocalInt(OBJECT_SELF, "NW_GENERIC_LAST_SPELL", nSpell); +} + + +//69MEH69 GetRealMaster Code +object GetRealMaster(object oAssociate = OBJECT_SELF) +{ + object oMaster = GetMaster(oAssociate); + if (GetIsObjectValid(oMaster)) + { + while (GetIsObjectValid(GetMaster(oMaster))) + { + oMaster = GetMaster(oMaster); + } + } + return oMaster; +} + + +object GetTopMaster(object oAssociate = OBJECT_SELF) +{ + object oRetVal = oAssociate; + object oMaster = GetMaster(oAssociate); + while (GetIsObjectValid(oMaster)) + { + oRetVal = oMaster; + oMaster = GetMaster(oMaster); + } + return oRetVal; +} + + +object GetTopAssociate(object oAssociate = OBJECT_SELF) +{ + object oRetVal = oAssociate; + object oMaster = GetMaster(oAssociate); + if (GetIsObjectValid(oMaster)) + { + while (GetIsObjectValid(GetMaster(oMaster))) + { + oRetVal = oMaster; + oMaster = GetMaster(oMaster); + } + } + return oRetVal; +} + + +int HenchConvertClass(int nClass, object oCharacter) +{ + switch(nClass) + { + case CLASS_TYPE_SHADOWDANCER: + case CLASS_TYPE_ASSASSIN: + return CLASS_TYPE_ROGUE; + case CLASS_TYPE_HARPER: + case CLASS_TYPE_ARCANE_ARCHER: + case CLASS_TYPE_DRAGON_DISCIPLE: + return CLASS_TYPE_BARD; + case CLASS_TYPE_SHIFTER: + return CLASS_TYPE_DRUID; + case CLASS_TYPE_PALE_MASTER: + return GetClassByPosition(1, oCharacter); + } + return nClass; +} + + +int HenchDetermineClassToUse(object oCharacter = OBJECT_SELF) +{ + int nClass; + int nTotal = GetHitDice(oCharacter); + if (nTotal < 1) + { + nTotal = 1; + } + + int nClassLevel1 = GetLevelByPosition(1, oCharacter); + int nClass1 = GetClassByPosition(1, oCharacter); + // quick exit + if (nClassLevel1 >= nTotal) + { + return nClass1; + } + + int nClassLevel2 = GetLevelByPosition(2, oCharacter); + int nClass2 = GetClassByPosition(2, oCharacter); + int nClassLevel3 = GetLevelByPosition(3, oCharacter); + int nClass3 = GetClassByPosition(3, oCharacter); + + // blackguard over everthing else + if (nClass1 == CLASS_TYPE_BLACKGUARD || nClass2 == CLASS_TYPE_BLACKGUARD || + nClass3 == CLASS_TYPE_BLACKGUARD) + { + return CLASS_TYPE_BLACKGUARD; + } + if (nClass1 == CLASS_TYPE_DIVINE_CHAMPION || nClass2 == CLASS_TYPE_DIVINE_CHAMPION || + nClass3 == CLASS_TYPE_DIVINE_CHAMPION) + { + return CLASS_TYPE_DIVINE_CHAMPION; + } + if (nClass1 == CLASS_TYPE_WEAPON_MASTER || nClass2 == CLASS_TYPE_WEAPON_MASTER || + nClass3 == CLASS_TYPE_WEAPON_MASTER) + { + return CLASS_TYPE_WEAPON_MASTER; + } + if (nClass1 == CLASS_TYPE_DWARVEN_DEFENDER || nClass2 == CLASS_TYPE_DWARVEN_DEFENDER || + nClass3 == CLASS_TYPE_DWARVEN_DEFENDER) + { + return CLASS_TYPE_DWARVEN_DEFENDER; + } + // adjust classes to remove prestige + nClass1 = HenchConvertClass(nClass1, oCharacter); + nClass2 = HenchConvertClass(nClass2, oCharacter); + nClass3 = HenchConvertClass(nClass3, oCharacter); + if (nClass1 == nClass2) + { + nClassLevel1 += nClassLevel2; + nClassLevel2 = 0; + } + if (nClass1 == nClass3) + { + nClassLevel1 += nClassLevel3; + nClassLevel3 = 0; + } + if (nClass2 == nClass3) + { + nClassLevel2 += nClassLevel3; + nClassLevel3 = 0; + } + // find top class + int nMaxClassLevel = nClassLevel1 >= nClassLevel2 ? nClassLevel1 : nClassLevel2; + nMaxClassLevel = nMaxClassLevel >= nClassLevel3 ? nMaxClassLevel : nClassLevel3; + // filter out classes less than two levels below the max + if (nMaxClassLevel - 1 > nClassLevel1) + { + nClassLevel1 = 0; + } + if (nMaxClassLevel - 1 > nClassLevel2) + { + nClassLevel2 = 0; + } + if (nMaxClassLevel - 1 > nClassLevel3) + { + nClassLevel3 = 0; + } + nTotal = nClassLevel1 + nClassLevel2 + nClassLevel3; + int nPickClass = Random(nTotal); + nPickClass -= nClassLevel1; + if (nPickClass < 0) + { + return nClass1; + } + nPickClass -= nClassLevel2; + if (nPickClass < 0) + { + return nClass2; + } + return nClass3; +} + + +int CheckStealth() +{ + int nStealthCheck = GetLocalInt(OBJECT_SELF, "canStealth"); + if (nStealthCheck == 0) + { + nStealthCheck = ((GetSkillRank(SKILL_HIDE, OBJECT_SELF, TRUE) > 0) || + (GetSkillRank(SKILL_MOVE_SILENTLY, OBJECT_SELF, TRUE) > 0)) ? 1 : 2; + SetLocalInt(OBJECT_SELF, "canStealth", nStealthCheck); + } + return nStealthCheck == 1; +} + + +void SetCombatMode(int nCombatMode = -1) +{ + int index; + for (index = ACTION_MODE_PARRY; index <= ACTION_MODE_DIRTY_FIGHTING; index ++) + { + int bEnable = nCombatMode == index; + if (GetActionMode(OBJECT_SELF, index) != bEnable) + { + if (bEnable) + { + ActionDoCommand(SetActionMode(OBJECT_SELF, index, TRUE)); + } + else + { + SetActionMode(OBJECT_SELF, index, bEnable); + } + } + } +} + + +const string sHenchLastAttackLocation = "HENCH_LAST_ATTACK_LOC"; + +void UseCombatAttack(object oTarget, int nFeatID = -1, int nCombatMode = -1) +{ + SetCombatMode(nCombatMode); + if (nFeatID < 0) + { + ActionAttack(oTarget); + } + else + { + ActionUseFeat(nFeatID, oTarget); + } + SetLocalLocation(OBJECT_SELF, sHenchLastAttackLocation, GetLocation(OBJECT_SELF)); +//const string sHenchLastAttackLocation = "HENCH_LAST_ATTACK_LOC"; + +} + + +const string henchCombatRoundStr = "tkCombatRoundCount"; +const string henchLastDraBrStr = "tkLastDragonBreath"; +const string henchLastDispelStr = "tkLastDispel"; +const string henchLastDomStr = "tkLastDominate"; +const string henchLastTurnStr = "tkLastTurning"; +const string henchSpellKnownFlagsStr = "HenchSpellKnownFlags"; +const string henchNoAttackSpStr = "tkNoAttackSpellTalents"; +const string henchNoEnhanceSpStr = "tkNoEnhanceSpellTalents"; +const string henchNoCondSpStr = "tkNoConditionalSpellTalents"; +const string henchNoPotionStr = "tkNoPotions"; +const string henchBuffCountStr = "HenchCurBuffCount"; +const string henchHealCountStr = "HenchCurHealCount"; +const string sHenchLastTarget = "LastTarget"; +const string sHenchShouldIAttackMessageGiven = "HenchShouldIAttackMessageGiven"; + + +const int HENCH_MAIN_SPELL_SERIES = 0x1; +const int HENCH_CURE_COND_SPELL = 0x2; + +int GetSpellUnknownFlag(int flag) +{ + return GetLocalInt(OBJECT_SELF, henchSpellKnownFlagsStr) & flag; +} + + +void SetSpellUnknownFlag(int flag) +{ + SetLocalInt(OBJECT_SELF, henchSpellKnownFlagsStr, GetLocalInt(OBJECT_SELF, henchSpellKnownFlagsStr) | flag); +} + + +void CleanCombatVars() +{ + DeleteLocalInt(OBJECT_SELF, henchCombatRoundStr); + DeleteLocalInt(OBJECT_SELF, henchLastDraBrStr); + DeleteLocalInt(OBJECT_SELF, henchLastDispelStr); + DeleteLocalInt(OBJECT_SELF, henchLastDomStr); + DeleteLocalInt(OBJECT_SELF, henchLastTurnStr); + DeleteLocalInt(OBJECT_SELF, henchSpellKnownFlagsStr); + DeleteLocalInt(OBJECT_SELF, henchNoAttackSpStr); + DeleteLocalInt(OBJECT_SELF, henchNoEnhanceSpStr); + DeleteLocalInt(OBJECT_SELF, henchNoCondSpStr); + DeleteLocalInt(OBJECT_SELF, henchNoPotionStr); + DeleteLocalInt(OBJECT_SELF, "CloseRangeEnhanced"); + DeleteLocalObject(OBJECT_SELF, sHenchLastTarget); + DeleteLocalLocation(OBJECT_SELF, sHenchLastAttackLocation); + DeleteLocalInt(OBJECT_SELF, sHenchShouldIAttackMessageGiven); +} + + +void ReportUnseenAllies() +{ + location testTargetLoc = GetLocation(OBJECT_SELF); + object oAllyTest = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, testTargetLoc, TRUE, OBJECT_TYPE_CREATURE); + while (GetIsObjectValid(oAllyTest)) + { + if (!GetObjectSeen(oAllyTest) && GetIsPC(GetTopMaster(oAllyTest))) + { + SpeakString(sHenchCantSeeTarget + GetName(oAllyTest)); + } + oAllyTest = GetNextObjectInShape(SHAPE_SPHERE, 20.0, testTargetLoc, TRUE, OBJECT_TYPE_CREATURE); + } +} diff --git a/nwnds_module/hench_i0_melee.nss b/nwnds_module/hench_i0_melee.nss new file mode 100644 index 000000000..2468bc5d2 --- /dev/null +++ b/nwnds_module/hench_i0_melee.nss @@ -0,0 +1,702 @@ +/* + + Henchman Inventory And Battle AI + + This file contains a modified form of the original TalentMeleeAttack. + Major modification to not randomly pick feats to use. + +*/ + +#include "hench_i0_equip" + +// void main() { } + + +int GetItemAttackBonus(object oTarget, object oItem) +{ + int nReturnVal = 0; + + itemproperty oProp = GetFirstItemProperty(oItem); + while (GetIsItemPropertyValid(oProp)) + { + int bGetSetting = FALSE; + switch (GetItemPropertyType(oProp)) + { + case ITEM_PROPERTY_ENHANCEMENT_BONUS: + case ITEM_PROPERTY_ATTACK_BONUS: + bGetSetting = TRUE; + break; + case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP: + case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP: + switch (GetItemPropertySubType(oProp)) + { + case IP_CONST_ALIGNMENTGROUP_NEUTRAL: + bGetSetting = (GetAlignmentGoodEvil(oTarget) == ALIGNMENT_NEUTRAL) || + (GetAlignmentLawChaos(oTarget) == ALIGNMENT_NEUTRAL); + break; + case IP_CONST_ALIGNMENTGROUP_LAWFUL: + bGetSetting = GetAlignmentLawChaos(oTarget) == ALIGNMENT_LAWFUL; + break; + case IP_CONST_ALIGNMENTGROUP_CHAOTIC: + bGetSetting = GetAlignmentLawChaos(oTarget) == ALIGNMENT_CHAOTIC; + break; + case IP_CONST_ALIGNMENTGROUP_GOOD: + bGetSetting = GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD; + break; + case IP_CONST_ALIGNMENTGROUP_EVIL: + bGetSetting = GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL; + break; + } + break; + case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP: + case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP: + bGetSetting = GetItemPropertySubType(oProp) == GetRacialType(oTarget); + break; + case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT: + case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT: + { + int iSpecificAlignment = GetItemPropertySubType(oProp); + switch (iSpecificAlignment % 3) + { + case 0: + bGetSetting = GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD; + break; + case 1: + bGetSetting = GetAlignmentGoodEvil(oTarget) == ALIGNMENT_NEUTRAL; + break; + case 2: + bGetSetting = GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL; + break; + } + if (bGetSetting) + { + bGetSetting = FALSE; + switch (iSpecificAlignment / 3) + { + case 0: + bGetSetting = GetAlignmentLawChaos(oTarget) == ALIGNMENT_LAWFUL; + break; + case 1: + bGetSetting = GetAlignmentLawChaos(oTarget) == ALIGNMENT_NEUTRAL; + break; + case 2: + bGetSetting = GetAlignmentLawChaos(oTarget) == ALIGNMENT_CHAOTIC; + break; + } + } + } + break; + } + if (bGetSetting) + { + int itemPropValue = GetItemPropertyCostTableValue(oProp); + if (itemPropValue > nReturnVal) + { + nReturnVal = itemPropValue; + } + } + oProp = GetNextItemProperty(oItem); + } + return nReturnVal; +} + + +int GetMeleeAttackBonus(object oCreature, object oWeaponRight, object oTarget) +{ + int nReturn = 0; + // Finesse only if we are using a proper weapon + int nStrMod = GetAbilityModifier(ABILITY_STRENGTH, oCreature); + int nDexMod = GetAbilityModifier(ABILITY_DEXTERITY, oCreature); + int bCanFinesse = GetHasFeat(FEAT_WEAPON_FINESSE, oCreature) && (nDexMod > nStrMod); + + if (GetIsObjectValid(oWeaponRight)) + { + nReturn += GetItemAttackBonus(oTarget, oWeaponRight); + if (bCanFinesse) + { + switch (GetBaseItemType(oWeaponRight)) + { + // only these weapons can be finessed + case BASE_ITEM_DAGGER: + case BASE_ITEM_HANDAXE: + case BASE_ITEM_KAMA: + case BASE_ITEM_KUKRI: + case BASE_ITEM_LIGHTHAMMER: + case BASE_ITEM_LIGHTMACE: + case BASE_ITEM_RAPIER: + case BASE_ITEM_SHORTSWORD: + case BASE_ITEM_SHURIKEN: + case BASE_ITEM_SICKLE: + case BASE_ITEM_THROWINGAXE: + break; + default: + bCanFinesse = FALSE; + } + } + } + else + { + // note: creature weapons can be finessed + oWeaponRight = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oCreature); + if (GetIsObjectValid(oWeaponRight)) + { + nReturn += GetItemAttackBonus(oTarget, oWeaponRight); + } + else + { + oWeaponRight = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oCreature); + if (GetIsObjectValid(oWeaponRight)) + { + nReturn += GetItemAttackBonus(oTarget, oWeaponRight); + } + else + { + oWeaponRight = GetItemInSlot(INVENTORY_SLOT_ARMS, oCreature); + if (GetIsObjectValid(oWeaponRight)) + { + nReturn += GetItemAttackBonus(oTarget, oWeaponRight); + } + } + } + } + object oWeaponLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oCreature); + int nOffHandWeaponSize = GetMeleeWeaponSize(oWeaponLeft); + if (nOffHandWeaponSize > 0) + { + if (nOffHandWeaponSize == GetCreatureSize(oCreature)) + { + nReturn -= 2; + } + else + { + // TODO more could be done here + nReturn -= 4; + } + } + if(bCanFinesse) + { + nReturn += nDexMod; + } + else + { + nReturn += nStrMod; + } + return nReturn; +} + + +int GetRangeAttackBonus(object oCreature, object oRangedWeapon, object oTarget) +{ + int nReturn = GetItemAttackBonus(oTarget, oRangedWeapon); + int nDexMod = GetAbilityModifier(ABILITY_DEXTERITY, oCreature); + int nWisMod = GetAbilityModifier(ABILITY_WISDOM, oCreature); + if (GetHasFeat(FEAT_ZEN_ARCHERY, oCreature) && (nWisMod > nDexMod)) + { + nReturn += nWisMod; + } + else + { + nReturn += nDexMod; + } + int itemType = GetBaseItemType(oRangedWeapon); + if ((itemType == BASE_ITEM_LONGBOW) || (itemType == BASE_ITEM_SHORTBOW)) + { + int nLevel = GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oCreature); + if (nLevel > 0) + { + nReturn += ((nLevel+1)/2); + } + } + return nReturn; +} + + +int GetAttackBonus(object oCreature, object oTarget) +{ + object oRightWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oCreature); + if (GetWeaponRanged(oRightWeapon)) + { + return GetRangeAttackBonus(oCreature, oRightWeapon, oTarget); + } + return GetMeleeAttackBonus(oCreature, oRightWeapon, oTarget); +} + + +void HenchDoTalentMeleeAttack(object oTarget, float fThresholdDistance, int iCreatureType) +{ + int iIntCheck = GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) - 2; + if (iIntCheck < 6) + { + // have less smart creatures not use best combat feats all the time + if (iIntCheck < 1) + { + iIntCheck = 1; + } + if (iIntCheck < d6()) + { + UseCombatAttack(oTarget); + return; + } + } + object oRightWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + int bRangedWeapon = GetWeaponRanged(oRightWeapon); + + int iAC = GetAC(oTarget); + int iNewBAB = GetBaseAttackBonus(OBJECT_SELF) + 5 + d4(2); + + if(bRangedWeapon) + { + // At a -2 to hit, this can disarm the arms or legs...speed or attack bonus + if(d8() == 1 && GetHasFeat(FEAT_CALLED_SHOT) && !GetHasFeatEffect(FEAT_CALLED_SHOT, oTarget) + && !GetIsImmune(oTarget, IMMUNITY_TYPE_CRITICAL_HIT, OBJECT_SELF) && !GetIsDisabled(oTarget)) + { + iNewBAB += GetRangeAttackBonus(OBJECT_SELF, oRightWeapon, oTarget); + if((iNewBAB - 2) >= iAC) + { + UseCombatAttack(oTarget, FEAT_CALLED_SHOT); + return; + } + } + // Always use if present + if(GetHasFeat(FEAT_RAPID_SHOT)) + { + int iItemType = GetBaseItemType(oRightWeapon); + if (iItemType == BASE_ITEM_SHORTBOW || iItemType == BASE_ITEM_LONGBOW) + { + UseCombatAttack(oTarget, FEAT_RAPID_SHOT); + return; + } + } + ActionAttack(oTarget); + return; + } + iNewBAB += GetMeleeAttackBonus(OBJECT_SELF, oRightWeapon, oTarget); + + float relativeChallenge; + if (iCreatureType == 0) + { + // mosters always use best feat + relativeChallenge = -10.0; + } + else + { + relativeChallenge = iCreatureType == 1 ? IntToFloat(GetHitDice(OBJECT_SELF)) * HENCH_HITDICE_TO_CR : GetChallengeRating(OBJECT_SELF); + relativeChallenge -= GetIsPC(oTarget) || GetAssociateType(oTarget) == ASSOCIATE_TYPE_HENCHMAN ? + IntToFloat(GetHitDice(oTarget)) * HENCH_HITDICE_TO_CR : GetChallengeRating(oTarget); + } + + // For use against them evil pests! Top - one use only anyway. + if(GetHasFeat(FEAT_SMITE_EVIL) && GetAlignmentGoodEvil(oTarget) == ALIGNMENT_EVIL && + relativeChallenge <= 2.0) + { + UseCombatAttack(oTarget, FEAT_SMITE_EVIL); + return; + } + if(GetHasFeat(FEAT_SMITE_GOOD) && GetAlignmentGoodEvil(oTarget) == ALIGNMENT_GOOD && + relativeChallenge <= 2.0) + { + UseCombatAttack(oTarget, FEAT_SMITE_GOOD); + return; + } + + // * only the playable races have whirlwind attack + // * Attempt to Use Whirlwind Attack + if (GetHasFeat(FEAT_WHIRLWIND_ATTACK) && GetOKToWhirl(OBJECT_SELF)) + { + int iAttackThreshold; + if (GetCurrentHitPoints(oTarget) <= (GetMeleeAttackBonus(OBJECT_SELF, oRightWeapon, oTarget) + 5)) + { + // a single hit is likely to kill target, check if any other targets are available + iAttackThreshold = 2; + } + else + { + // set number of whirlwind targets needed equal to the number of attacks per round + iAttackThreshold = GetBaseAttackBonus(OBJECT_SELF); + if (GetHitDice(OBJECT_SELF) > 20) + { + iAttackThreshold -= GetHitDice(OBJECT_SELF) / 2; + } + iAttackThreshold = (iAttackThreshold + 4) / 5; + } + float fThresholdDistance; + int iSizeThreshold; + if (GetHasFeat(FEAT_IMPROVED_WHIRLWIND)) + { + fThresholdDistance = 10.0; + iSizeThreshold = CREATURE_SIZE_HUGE; + } + else + { + fThresholdDistance = 3.0; + iSizeThreshold = CREATURE_SIZE_MEDIUM; + } + int enemyIndex = 1; + object oTestTarget = GetNearestEnemy(OBJECT_SELF, enemyIndex++); + while (GetIsObjectValid(oTestTarget)) + { + if ((GetDistanceToObject(oTestTarget) <= fThresholdDistance) && + (GetCreatureSize(oTestTarget) <= iSizeThreshold)) + { + --iAttackThreshold; + if (iAttackThreshold <= 0) + { + break; + } + } + oTestTarget = GetNearestEnemy(OBJECT_SELF, enemyIndex++); + } +// Jug_Debug(GetName(OBJECT_SELF) + " num attacks " + IntToString((GetBaseAttackBonus(OBJECT_SELF) + 1) / 5) + " count is " + IntToString(iAttackThreshold)); + if (iAttackThreshold <= 0) + { + UseCombatAttack(OBJECT_SELF, FEAT_WHIRLWIND_ATTACK); + return; + } + } + // TODO update for HotU, dwarven defender (is same as barb rage?) + if (relativeChallenge <= 2.0 && TryKiDamage(oTarget)) + { + return; + } + + if (d6() == 1 && !GetIsImmune(oTarget, IMMUNITY_TYPE_CRITICAL_HIT, OBJECT_SELF) && (iNewBAB >= iAC)) + { + int bHasQuiveringPalm = GetHasFeat(FEAT_QUIVERING_PALM); + int bHasStunningFist = GetHasFeat(FEAT_STUNNING_FIST); + int bHasSAP = GetHasFeat(FEAT_SAP); + int bHasCalledShot = GetHasFeat(FEAT_CALLED_SHOT) && d3() == 1; + if ((bHasQuiveringPalm || bHasStunningFist || bHasSAP || bHasCalledShot) && + relativeChallenge <= 2.0 && + (GetCharacterLevel(OBJECT_SELF) / 2 + 10 + GetAbilityModifier(ABILITY_WISDOM) >= + GetFortitudeSavingThrow(oTarget) + 5 + Random(15))) + { + if(!GetIsDisabled(oTarget)) + { + if (bHasQuiveringPalm && !GetIsObjectValid(oRightWeapon)) + { + UseCombatAttack(oTarget, FEAT_QUIVERING_PALM); + return; + } + if (bHasStunningFist) + { + int iMod = iNewBAB; + if (GetIsObjectValid(oRightWeapon) || (GetLevelByClass(CLASS_TYPE_MONK) == 0)) + { + iMod -= 4; + } + if (iMod >= iAC) + { + UseCombatAttack(oTarget, FEAT_STUNNING_FIST); + return; + } + } + // OK, not for PCs, but may be on an NPC. -4 Attack. Above the one below. + if(bHasSAP) + { + if((iNewBAB - 4) >= iAC) + { + UseCombatAttack(oTarget, FEAT_SAP); + return; + } + } + if (bHasCalledShot) + { + // At a -2 to hit, this can disarm the arms or legs...speed or attack bonus + if(((iNewBAB - 2) >= iAC) && !GetHasFeatEffect(FEAT_CALLED_SHOT, oTarget)) + { + UseCombatAttack(oTarget, FEAT_CALLED_SHOT); + return; + } + } + } + } + } + + int bHasImprovedKnockdown = GetHasFeat(FEAT_IMPROVED_KNOCKDOWN); + if((bHasImprovedKnockdown || GetHasFeat(FEAT_KNOCKDOWN)) && + !GetIsImmune(oTarget, IMMUNITY_TYPE_KNOCKDOWN, OBJECT_SELF) && + !GetHasFeatEffect(FEAT_KNOCKDOWN, oTarget) && + !GetHasFeatEffect(FEAT_IMPROVED_KNOCKDOWN, oTarget)) + { + // By far the BEST feat to use - knocking them down lets you freely attack them! + // These return 1-5, based on size. + int iOurSize = GetCreatureSize(OBJECT_SELF); + int iTheirSize = GetCreatureSize(oTarget); + if (bHasImprovedKnockdown) + { + iOurSize++; + } + int bUse = iOurSize > iTheirSize; + if (!bUse && ((iOurSize + 1) >= iTheirSize)) + { + int iMod = iNewBAB - 4; + // check if one size larger + if (iOurSize != iTheirSize) + { + iMod -= 4; + } + if(iMod >= iAC) + { + bUse = iMod > GetSkillRank(SKILL_DISCIPLINE, oTarget); + } + } + if(bUse) + { + UseCombatAttack(oTarget, bHasImprovedKnockdown ? FEAT_IMPROVED_KNOCKDOWN : FEAT_KNOCKDOWN); + return; + } + } + // start using expertise if have under 50% hit points + if (GetPercentageHPLoss(OBJECT_SELF) < 50 && + (GetHasFeat(FEAT_EXPERTISE) || GetHasFeat(FEAT_IMPROVED_EXPERTISE))) + { + // get estimation of opponent attack vs. my AC + int iMyAC = GetAC(OBJECT_SELF); + int iTargetsBAB = GetBaseAttackBonus(oTarget) + 5 + d4(2) + GetAttackBonus(oTarget, OBJECT_SELF); + + if(GetHasFeat(FEAT_IMPROVED_EXPERTISE) && (iTargetsBAB - 5) >= iMyAC) + { + UseCombatAttack(oTarget, -1, ACTION_MODE_IMPROVED_EXPERTISE); + return; + } + if(iTargetsBAB >= iMyAC) + { + UseCombatAttack(oTarget, -1, ACTION_MODE_EXPERTISE); + return; + } + } + + // Only use parry on an active melee attacker, and + // only if our parry skill > our AC - 10 + // JE, Apr.14,2004: Bugfix to make this actually work. Thanks to the message board + // members who investigated this. + if (GetSkillRank(SKILL_PARRY) > (GetAC(OBJECT_SELF) - 10)) + { + object oTargetRightWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + if (GetAttackTarget(oTarget) == OBJECT_SELF && + GetIsObjectValid(oTargetRightWeapon) && + !GetWeaponRanged(oTargetRightWeapon)) + { + int iAttackChance = GetBaseAttackBonus(oTarget) + GetAttackBonus(oTarget, OBJECT_SELF) - GetAC(OBJECT_SELF); + if ((iAttackChance > -20) && (GetPercentageHPLoss(OBJECT_SELF) < 65)) + { + object oNearestFriend = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if (GetIsObjectValid(oNearestFriend) && GetDistanceToObject(oNearestFriend) <= 5.0) + { + UseCombatAttack(oTarget, -1, ACTION_MODE_PARRY); + return; + } + } + } + } + +// +// Auldar: Give 10% chance to Taunt if target is within 3.5 meters and is a challenge, if Skill points have been +// spent in Taunt skill indicating intention to use, and a taunt isn't in effect +// + if ((d10 () == 1) && ((relativeChallenge <= 2.0) || + (GetCharacterLevel(oTarget) > (GetCharacterLevel(OBJECT_SELF) - 2))) + && (GetDistanceToObject(oTarget) <= 3.5)) + { + // Auldar: Adding a check for the Taunt skill, and ensuring that noone with ONLY a CHA mod to + // Taunt will use the skill. + // This confirms that some points are spent in the skill indicating an intention for the NPC to use them. + // Also using 69MEH69's idea to check for a negative modifier so we don't subtract a negative number (ie add) + // to the skill check + if ((GetSkillRank(SKILL_TAUNT, OBJECT_SELF, TRUE) > 0) && ((GetSkillRank(SKILL_TAUNT) + 5 + d4(2)) > GetSkillRank(SKILL_CONCENTRATION, oTarget))) + { + ActionUseSkill(SKILL_TAUNT, oTarget); + return; + } + } + + if(d4() == 1 && (GetHasFeat(FEAT_IMPROVED_DISARM) || GetHasFeat(FEAT_DISARM)) && + GetIsCreatureDisarmable(oTarget) && + ((GetIsObjectValid(oRightWeapon) && !GetWeaponRanged(oRightWeapon)) || !GetIsObjectValid(oRightWeapon))) + { + object oTargetRightWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + if (GetIsObjectValid(oTargetRightWeapon) && !GetWeaponRanged(oTargetRightWeapon)) + { + int iWeaponSize; + if (GetIsObjectValid(oRightWeapon)) + { + iWeaponSize = GetMeleeWeaponSize(oRightWeapon); + } + else + { + iWeaponSize = GetCreatureSize(OBJECT_SELF); + } + int iTargetWeaponSize = GetMeleeWeaponSize(oTargetRightWeapon); + + // No AOO, and only a -4 penalty to hit. + if(GetHasFeat(FEAT_IMPROVED_DISARM)) + { + // Apply weapon size penalites/bonuses to check - Use right weapons. + int iMod = iWeaponSize - iTargetWeaponSize; + if(iMod != 0) iMod += (iMod * 4); + if(((iNewBAB - 4 + iMod) >= iAC) && (iMod > GetSkillRank(SKILL_DISCIPLINE, oTarget))) + { + UseCombatAttack(oTarget, FEAT_IMPROVED_DISARM); + return; + } + } + // Provokes an AOO. Improved does not, but this is -6, and bonuses depend on weapons used (sizes) + else if(d2() == 1) + { + // Apply weapon size penalites/bonuses to check - Use right weapons. + int iMod = iWeaponSize - iTargetWeaponSize; + if(iMod != 0) iMod += (iMod * 4); + if(((iNewBAB - 6 + iMod) >= iAC) && (iMod > GetSkillRank(SKILL_DISCIPLINE, oTarget))) + { + UseCombatAttack(oTarget, FEAT_DISARM); + return; + } + } + } + } + + // This activates an extra attack, at -2 to hit. Of course, only unarmed and kama + if(GetHasFeat(FEAT_FLURRY_OF_BLOWS) && ((iNewBAB - 2) >= iAC) && (!GetIsObjectValid(oRightWeapon) || + (GetBaseItemType(oRightWeapon) == BASE_ITEM_KAMA))) + { + UseCombatAttack(oTarget, FEAT_FLURRY_OF_BLOWS); + return; + } + // -10 to hit - make sure by extra 5 + if(GetHasFeat(FEAT_IMPROVED_POWER_ATTACK) && ((iNewBAB - 15) >= iAC)) + { + UseCombatAttack(oTarget, FEAT_IMPROVED_POWER_ATTACK); + return; + } + // is a -5 to hit - make sure by extra 5 + if(GetHasFeat(FEAT_POWER_ATTACK) && ((iNewBAB - 10) >= iAC)) + { + UseCombatAttack(oTarget, FEAT_POWER_ATTACK); + return; + } + // extra damage with only one attack + if (GetHasFeat(FEAT_DIRTY_FIGHTING) && GetBaseAttackBonus(OBJECT_SELF) < 8) + { + UseCombatAttack(oTarget, FEAT_DIRTY_FIGHTING); + return; + } + + UseCombatAttack(oTarget); +} + + +void ActionContinueMeleeAttack(object oTarget, float fThresholdDistance, int iCreatureType, int iCallNumber) +{ + if (GetLocalInt(OBJECT_SELF, "UseRangedWeapons")) + { + if (!EquipRangedWeapon(oTarget, iCreatureType == 1, iCallNumber)) + { + ActionDoCommand(ActionContinueMeleeAttack(oTarget, fThresholdDistance, iCreatureType, iCallNumber + 1)); + return; + } + } + else + { + if (!EquipMeleeWeapons(oTarget, iCreatureType == 1, iCallNumber)) + { + ActionDoCommand(ActionContinueMeleeAttack(oTarget, fThresholdDistance, iCreatureType, iCallNumber + 1)); + return; + } + } + HenchDoTalentMeleeAttack(oTarget, fThresholdDistance, iCreatureType); +} + + +// MELEE ATTACK OTHERS +/* + ISSUE 1: Talent Melee Attack should set the Last Spell Used to 0 so that melee casters can use + a single special ability. + + Auldar: Made changes here to use Taunt when appropriate as well as more accurate calculations for + To-Hit vs Target AC. + + Tony: Made major changes in using attack feats. Heavily modified code from Jasperre. +*/ + +int HenchTalentMeleeAttack(object oIntruder, float fThresholdDistance, int iMeleeAttackers, int iCreatureType, int bPolymorphed) +{ + object oTarget = oIntruder; + + if (iCreatureType == 0) + { + MonsterBattleCry(); + } + else if (iCreatureType == 1) + { + HenchBattleCry(); + } + + // allow sneak attack to use other feats + if(GetHasFeat(FEAT_SNEAK_ATTACK)) + { + //Sneak Attack Flanking attack + float fRange = iMeleeAttackers ? 3.5 : /* bRangedWeapon*/ TRUE ? 50.0 : 5.0; + int iEnemyAC, iAC = 100; + object oRealMaster = GetRealMaster(); + int bEnemyMaster = FALSE; + object oLastSneakTarget = GetLocalObject(OBJECT_SELF, "LastSneakTarget"); + object oAttackTarget; + int nCnt = 1; + object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, nCnt, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + object oBest = OBJECT_INVALID; + while(GetIsObjectValid(oEnemy) && GetDistanceToObject(oEnemy) <= fRange) + { + if(!GetPlotFlag(oEnemy) && !GetIsImmune(oEnemy, IMMUNITY_TYPE_SNEAK_ATTACK, OBJECT_SELF)) + { + oAttackTarget = GetAttackTarget(oEnemy); + if(oAttackTarget != OBJECT_SELF) + { + if (oEnemy == oLastSneakTarget) + { + oBest = oEnemy; + break; + } + iEnemyAC = GetAC(oEnemy); + if (oAttackTarget == oRealMaster) + { + if (!bEnemyMaster) + { + bEnemyMaster = TRUE; + iAC = iEnemyAC; + oBest = oEnemy; + } + else if(iAC > iEnemyAC) + { + iAC = iEnemyAC; + oBest = oEnemy; + } + } + else if(iAC > iEnemyAC) + { + iAC = iEnemyAC; + oBest = oEnemy; + } + } + } + nCnt++; + oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, nCnt, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + } + + if (GetIsObjectValid(oBest)) + { + oTarget = oBest; + SetLocalObject(OBJECT_SELF, "LastSneakTarget", oBest); + } + } + + if (!HenchEquipAppropriateWeapons(oTarget, fThresholdDistance, iCreatureType == 1, bPolymorphed)) + { + ActionDoCommand(ActionContinueMeleeAttack(oTarget, fThresholdDistance, iCreatureType, 2)); + } + else + { + HenchDoTalentMeleeAttack(oTarget, fThresholdDistance, iCreatureType); + } + + return TRUE; +} diff --git a/nwnds_module/hench_i0_monsho.nss b/nwnds_module/hench_i0_monsho.nss new file mode 100644 index 000000000..068875981 --- /dev/null +++ b/nwnds_module/hench_i0_monsho.nss @@ -0,0 +1,166 @@ +/* + + Henchman Inventory And Battle AI + + This file is used for responding to monster shouts. Mostly + involves getting the listening creature to start attacking + unseen and unheard foe. + +*/ + + +#include "hench_i0_act" +#include "hench_i0_ai" + + +// void main() { } + + +//:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Allows the listener to react in a manner + consistant with the given shout but only to one + combat shout per round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// + +//NOTE ABOUT COMMONERS +/* + Commoners are universal cowards. If you attack anyone they will flee for 4 seconds away from the attacker. + However to make the commoners into a mob, make a single commoner at least 10th level of the same faction. + If that higher level commoner is attacked or killed then the commoners will attack the attacker. They will disperse again + after some of them are killed. Should NOT make multi-class creatures using commoners. +*/ +//NOTE ABOUT BLOCKERS +/* + It should be noted that the Generic Script for On Dialogue attempts to get a local set on the shouter by itself. + This object represents the LastOpenedBy object. It is this object that becomes the oIntruder within this function. +*/ + +//NOTE ABOUT INTRUDERS +/* + The intruder object is for cases where a placable needs to pass a LastOpenedBy Object or a AttackMyAttacker + needs to make his attacker the enemy of everyone. +*/ + +// modified form of shout handler, calls different routines +void HenchMonRespondToShout(object oShouter, int nShoutIndex, object oIntruder = OBJECT_INVALID) +{ + // Pausanias: Do not respond to shouts if you've surrendered. + int iSurrendered = GetLocalInt(OBJECT_SELF,"Generic_Surrender"); + if (iSurrendered) return; + + switch (nShoutIndex) + { + case 1://NW_GENERIC_SHOUT_I_WAS_ATTACKED: + case 3://NW_GENERIC_SHOUT_I_AM_DEAD: + { + object oTarget = oIntruder; + if(!GetIsObjectValid(oTarget)) + { + oTarget = GetLastHostileActor(oShouter); + if (!GetIsObjectValid(oTarget)) + { + oTarget = GetLocalObject(oShouter, sHenchLastTarget); + } + } + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oTarget)) + { + if(!GetIsFriend(oTarget) && GetIsFriend(oShouter)) + { + RemoveAmbientSleep(); + HenchDetermineCombatRound(oTarget); + } + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + HenchStartAttack(GetLastHostileActor(oShouter)); + } + else + { + HenchDetermineCombatRound(oTarget); + } + } + else + { + HenchDetermineSpecialBehavior(); + } + } + break; + + case 2://NW_GENERIC_SHOUT_MOB_ATTACK: + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + //Is friendly check to make sure that only like minded commoners attack. + if(GetIsFriend(oShouter)) + { + HenchStartAttack(GetLastHostileActor(oShouter)); + } + } + else + { + HenchDetermineSpecialBehavior(); + } + } + break; + + //For this shout to work the object must shout the following + //string sHelp = "NW_BLOCKER_BLK_" + GetTag(OBJECT_SELF); + case 4: //BLOCKER OBJECT HAS BEEN DISTURBED + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oIntruder)) + { + SetIsTemporaryEnemy(oIntruder); + HenchDetermineCombatRound(oIntruder); + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + HenchStartAttack(GetLastHostileActor(oShouter)); + } + else + { + HenchDetermineCombatRound(); + } + } + break; + + case 5: //ATTACK MY TARGET + { + if(GetIsFriend(oShouter)) + { + AdjustReputation(oIntruder, OBJECT_SELF, -100); + SetIsTemporaryEnemy(oIntruder); + HenchDetermineCombatRound(oIntruder); + } + } + break; + + case 6: //CALL_TO_ARMS + { + //This was once commented out. + HenchDetermineCombatRound(); + } + break; + } +} \ No newline at end of file diff --git a/nwnds_module/hench_i0_options.nss b/nwnds_module/hench_i0_options.nss new file mode 100644 index 000000000..a546a0230 --- /dev/null +++ b/nwnds_module/hench_i0_options.nss @@ -0,0 +1,130 @@ +/* + + Henchman Inventory And Battle AI + + This file is used for options for the henchman ai. + + The exe and hak versions are different than the erf version. + + The exe and hak version still use the small scripts to control options. + + The erf version can just be built directly using this file without using + the small control files, it can be changed to anything including + module properties, spawn script, etc. + +*/ + + +// void main() { } + + +// how frequently shouts are done by monsters to call in allies to help +// DM clients can get flooded with these messages in which case the +// number can be increased to reduce the frequency. +const int HENCH_MONSTER_SHOUT_FREQUENCY = 5; + +// This flag turns off when set to true monsters hearing other monsters and +// attacking them +const int HENCH_MONSTER_DONT_CHECK_HEARD_MONSTER = FALSE; + + +// general options +const int HENCH_GENAI_SOUINSTALLED = 0x0001; // expansion pack installed (includes HotU) +const int HENCH_GENAI_ENABLEHEARING = 0x0002; // (obsolete) creatures use hearing +const int HENCH_GENAI_ENABLERAISE = 0x0004; // will use raise dead and resurrection + + +int GetGeneralOptions(int nSel) +{ + return HENCH_GENAI_SOUINSTALLED | HENCH_GENAI_ENABLERAISE; +} + + +// monster options +const int HENCH_MONAI_STEALTH = 0x0001; // monsters use stealth +const int HENCH_MONAI_WANDER = 0x0002; // monsters can wander +const int HENCH_MONAI_UNLOCK = 0x0004; // monsters can unlock or bash locked doors +const int HENCH_MONAI_OPEN = 0x0008; // monsters can open doors +const int HENCH_MONAI_DISTRIB = 0x0010; // monsters distribute themselves when attacking +const int HENCH_MONAI_HASTE = 0x0020; // monsters haste themselves after being damaged +const int HENCH_MONAI_HEALPT = 0x0040; // monsters generate heal potions +const int HENCH_MONAI_COMP = 0x0080; // monsters summon familiars and animal companions + + +int GetMonsterOptions(int nSel) +{ + int nReturn = HENCH_MONAI_STEALTH | HENCH_MONAI_COMP; + + if (nSel & HENCH_MONAI_WANDER) + { + if (d10() > 2) + { + nReturn = nReturn | HENCH_MONAI_WANDER; + } + } + if (nSel & HENCH_MONAI_DISTRIB) + { + // monsters distribute themselves when attacking + if (GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES) + { + nReturn = nReturn | HENCH_MONAI_DISTRIB; + } + } +/* if (nSel & HENCH_MONAI_HASTE) + { + // monsters haste themselves after being damaged + if (GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT) + { + nReturn = nReturn | HENCH_MONAI_HASTE; + } + }*/ +/* if (nSel & HENCH_MONAI_HEALPT) + { + int iChance = d10(); + int iDifficulty = GetGameDifficulty(); + + // Self healing below 50% if enemy is far, otherwise between 20% and 50% only + if ((iDifficulty == GAME_DIFFICULTY_DIFFICULT && iChance > 2) || + (iDifficulty == GAME_DIFFICULTY_CORE_RULES && iChance > 8)) + { + nReturn = nReturn | HENCH_MONAI_HEALPT; + } + } */ + return nReturn; +} + + +// henchman options +const int HENCH_HENAI_NOATTACK = 0x0001; // associates dont attack master on damage +const int HENCH_HENAI_INVENTORY = 0x0002; // PC can use inventory on associates + +const float fHenchHearingDistance = 5.0; +const float fHenchMasterHearingDistance = 100.0; + + +int GetHenchmanOptions(int nSel) +{ + return HENCH_HENAI_NOATTACK | HENCH_HENAI_INVENTORY; +} + + +// provides override for creature using items (i.e. Valen in HotU) +int GetCreatureUseItemsOverride(object oCreature) +{ +// if (GetTag(oCreature) == "x2_hen_valen") +// { +// return TRUE; +// } + return FALSE; +} + + +// prevent heartbeat detection of enemies +int GetUseHeartbeatDetect() +{ + return FALSE; +} + + + + diff --git a/nwnds_module/hench_i0_strings.nss b/nwnds_module/hench_i0_strings.nss new file mode 100644 index 000000000..c00780e70 --- /dev/null +++ b/nwnds_module/hench_i0_strings.nss @@ -0,0 +1,185 @@ +/* + + Henchman Inventory And Battle AI + + This file is used for strings for the henchman ai. + + This file contains all strings shown to the PC. (Useful for + multilanguage support and customization.) + +*/ + + +// void main() { } + +// weapons equipping +const string sHenchCantUseShield = "I don't know how to use this shield!"; +const string sHenchCantUseRanged = "I can't use ranged weapons."; +const string sHenchSwitchToMissle = "I'm switching back to my missile weapon!"; +const string sHenchSwitchToRanged = "I'm switching to my melee weapon for now!"; +// generic +const string sHenchSomethingFishy = "There's something fishy near that door..."; +// hen shout +const string sHenchPeacefulModeCancel = "***Peaceful Follow Mode Canceled***"; +const string sHenchHenchmanFollow = "I will follow but not attack our enemies until you tell me otherwise."; +const string sHenchFamiliarFollow = "I will be happy to follow you, avoiding combat until you tell me otherwise!"; +const string sHenchAnCompFollow = " understands that it should follow, waiting for your command to attack.>"; +const string sHenchOtherFollow1 = " 10) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_alt_boy.dlg b/nwnds_module/hs_alt_boy.dlg new file mode 100644 index 000000000..cc9cf9933 Binary files /dev/null and b/nwnds_module/hs_alt_boy.dlg differ diff --git a/nwnds_module/hs_altguard.dlg b/nwnds_module/hs_altguard.dlg new file mode 100644 index 000000000..00ad09647 Binary files /dev/null and b/nwnds_module/hs_altguard.dlg differ diff --git a/nwnds_module/hs_bluff_med.ncs b/nwnds_module/hs_bluff_med.ncs new file mode 100644 index 000000000..e539b3b40 Binary files /dev/null and b/nwnds_module/hs_bluff_med.ncs differ diff --git a/nwnds_module/hs_bluff_med.nss b/nwnds_module/hs_bluff_med.nss new file mode 100644 index 000000000..c294adcde --- /dev/null +++ b/nwnds_module/hs_bluff_med.nss @@ -0,0 +1,15 @@ +//:://///////////////////////////////////////////// +//:: FileName hs_bluff_med +//::////////////////////////////////////////////// + +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_MEDIUM, SKILL_BLUFF, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/hs_boxingbookie.dlg b/nwnds_module/hs_boxingbookie.dlg new file mode 100644 index 000000000..e9a80c30d Binary files /dev/null and b/nwnds_module/hs_boxingbookie.dlg differ diff --git a/nwnds_module/hs_brimlystore.ncs b/nwnds_module/hs_brimlystore.ncs new file mode 100644 index 000000000..ff87ae16e Binary files /dev/null and b/nwnds_module/hs_brimlystore.ncs differ diff --git a/nwnds_module/hs_brimlystore.nss b/nwnds_module/hs_brimlystore.nss new file mode 100644 index 000000000..7189f769c --- /dev/null +++ b/nwnds_module/hs_brimlystore.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("BrimlysStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/hs_canspeaktari.ncs b/nwnds_module/hs_canspeaktari.ncs new file mode 100644 index 000000000..b3df53db1 Binary files /dev/null and b/nwnds_module/hs_canspeaktari.ncs differ diff --git a/nwnds_module/hs_canspeaktari.nss b/nwnds_module/hs_canspeaktari.nss new file mode 100644 index 000000000..15ea10d2f --- /dev/null +++ b/nwnds_module/hs_canspeaktari.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "hlslang_2") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/hs_chikchak.dlg b/nwnds_module/hs_chikchak.dlg new file mode 100644 index 000000000..a9e9b5221 Binary files /dev/null and b/nwnds_module/hs_chikchak.dlg differ diff --git a/nwnds_module/hs_chkmaddoxdoc.ncs b/nwnds_module/hs_chkmaddoxdoc.ncs new file mode 100644 index 000000000..288c9ed2c Binary files /dev/null and b/nwnds_module/hs_chkmaddoxdoc.ncs differ diff --git a/nwnds_module/hs_chkmaddoxdoc.nss b/nwnds_module/hs_chkmaddoxdoc.nss new file mode 100644 index 000000000..70eaf08e7 --- /dev/null +++ b/nwnds_module/hs_chkmaddoxdoc.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "maddoxapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (!(nInt == 2)) + return FALSE; + +if (GetItemPossessedBy(oPC, "sokidocument") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_chkmaddoxdoc1.ncs b/nwnds_module/hs_chkmaddoxdoc1.ncs new file mode 100644 index 000000000..e7d85bb33 Binary files /dev/null and b/nwnds_module/hs_chkmaddoxdoc1.ncs differ diff --git a/nwnds_module/hs_chkmaddoxdoc1.nss b/nwnds_module/hs_chkmaddoxdoc1.nss new file mode 100644 index 000000000..7efd8fe88 --- /dev/null +++ b/nwnds_module/hs_chkmaddoxdoc1.nss @@ -0,0 +1,22 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "sokidocument") == OBJECT_INVALID) return FALSE; + +if (GetLocalInt(oPC, "maddoxapproves") != 1) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt < 1) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/hs_commoner1.dlg b/nwnds_module/hs_commoner1.dlg new file mode 100644 index 000000000..2167b2b76 Binary files /dev/null and b/nwnds_module/hs_commoner1.dlg differ diff --git a/nwnds_module/hs_cv_agustus.dlg b/nwnds_module/hs_cv_agustus.dlg new file mode 100644 index 000000000..aa1fe13ba Binary files /dev/null and b/nwnds_module/hs_cv_agustus.dlg differ diff --git a/nwnds_module/hs_del_pc.dlg b/nwnds_module/hs_del_pc.dlg new file mode 100644 index 000000000..2b769bc0a Binary files /dev/null and b/nwnds_module/hs_del_pc.dlg differ diff --git a/nwnds_module/hs_draqoman1.dlg b/nwnds_module/hs_draqoman1.dlg new file mode 100644 index 000000000..2e46d2fe5 Binary files /dev/null and b/nwnds_module/hs_draqoman1.dlg differ diff --git a/nwnds_module/hs_elfguard.dlg b/nwnds_module/hs_elfguard.dlg new file mode 100644 index 000000000..35a3091e0 Binary files /dev/null and b/nwnds_module/hs_elfguard.dlg differ diff --git a/nwnds_module/hs_elfhedia.dlg b/nwnds_module/hs_elfhedia.dlg new file mode 100644 index 000000000..7edaac3f7 Binary files /dev/null and b/nwnds_module/hs_elfhedia.dlg differ diff --git a/nwnds_module/hs_failedvabluff.ncs b/nwnds_module/hs_failedvabluff.ncs new file mode 100644 index 000000000..46a450155 Binary files /dev/null and b/nwnds_module/hs_failedvabluff.ncs differ diff --git a/nwnds_module/hs_failedvabluff.nss b/nwnds_module/hs_failedvabluff.nss new file mode 100644 index 000000000..0da344c17 --- /dev/null +++ b/nwnds_module/hs_failedvabluff.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt < 7) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_g_head_fem.dlg b/nwnds_module/hs_g_head_fem.dlg new file mode 100644 index 000000000..68a32e9d2 Binary files /dev/null and b/nwnds_module/hs_g_head_fem.dlg differ diff --git a/nwnds_module/hs_g_head_male.dlg b/nwnds_module/hs_g_head_male.dlg new file mode 100644 index 000000000..7c78cdd0b Binary files /dev/null and b/nwnds_module/hs_g_head_male.dlg differ diff --git a/nwnds_module/hs_g_islvl3fem.ncs b/nwnds_module/hs_g_islvl3fem.ncs new file mode 100644 index 000000000..826a7957d Binary files /dev/null and b/nwnds_module/hs_g_islvl3fem.ncs differ diff --git a/nwnds_module/hs_g_islvl3fem.nss b/nwnds_module/hs_g_islvl3fem.nss new file mode 100644 index 000000000..68e3e81e5 --- /dev/null +++ b/nwnds_module/hs_g_islvl3fem.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetGender(oPC) != GENDER_FEMALE) return FALSE; + +if (GetHitDice(oPC) < 3) return FALSE; + +return TRUE; +} + + diff --git a/nwnds_module/hs_g_islvl3male.ncs b/nwnds_module/hs_g_islvl3male.ncs new file mode 100644 index 000000000..81c6de4b4 Binary files /dev/null and b/nwnds_module/hs_g_islvl3male.ncs differ diff --git a/nwnds_module/hs_g_islvl3male.nss b/nwnds_module/hs_g_islvl3male.nss new file mode 100644 index 000000000..609213b8f --- /dev/null +++ b/nwnds_module/hs_g_islvl3male.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetGender(oPC) != GENDER_MALE) return FALSE; + +if (GetHitDice(oPC) < 3) return FALSE; + +return TRUE; +} + + diff --git a/nwnds_module/hs_getistari.ncs b/nwnds_module/hs_getistari.ncs new file mode 100644 index 000000000..c410708c9 Binary files /dev/null and b/nwnds_module/hs_getistari.ncs differ diff --git a/nwnds_module/hs_getistari.nss b/nwnds_module/hs_getistari.nss new file mode 100644 index 000000000..242a1dd4d --- /dev/null +++ b/nwnds_module/hs_getistari.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetHitDice(oPC) < 3) return FALSE; + +if (GetRacialType(oPC) != RACIAL_TYPE_GNOME) return FALSE; + +if (GetStringLowerCase(GetSubRace(oPC)) != "tari") return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_gimpy.dlg b/nwnds_module/hs_gimpy.dlg new file mode 100644 index 000000000..e5b3cd5d0 Binary files /dev/null and b/nwnds_module/hs_gimpy.dlg differ diff --git a/nwnds_module/hs_giveurikammy.ncs b/nwnds_module/hs_giveurikammy.ncs new file mode 100644 index 000000000..a94505041 Binary files /dev/null and b/nwnds_module/hs_giveurikammy.ncs differ diff --git a/nwnds_module/hs_giveurikammy.nss b/nwnds_module/hs_giveurikammy.nss new file mode 100644 index 000000000..80e81d2a5 --- /dev/null +++ b/nwnds_module/hs_giveurikammy.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(200, oPC, FALSE); + +CreateItemOnObject("uriktempammy", oPC); + +} + diff --git a/nwnds_module/hs_haskreelsqst.ncs b/nwnds_module/hs_haskreelsqst.ncs new file mode 100644 index 000000000..61ac5a90e Binary files /dev/null and b/nwnds_module/hs_haskreelsqst.ncs differ diff --git a/nwnds_module/hs_haskreelsqst.nss b/nwnds_module/hs_haskreelsqst.nss new file mode 100644 index 000000000..85654123b --- /dev/null +++ b/nwnds_module/hs_haskreelsqst.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt < 1) + return FALSE; + +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt >= 4) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_isuriktemplar.ncs b/nwnds_module/hs_isuriktemplar.ncs new file mode 100644 index 000000000..2bfd8f450 Binary files /dev/null and b/nwnds_module/hs_isuriktemplar.ncs differ diff --git a/nwnds_module/hs_isuriktemplar.nss b/nwnds_module/hs_isuriktemplar.nss new file mode 100644 index 000000000..fea9f372e --- /dev/null +++ b/nwnds_module/hs_isuriktemplar.nss @@ -0,0 +1,46 @@ +int GetNumItems(object oTarget,string sItem) +{ +int nNumItems = 0; +object oItem = GetFirstItemInInventory(oTarget); +while (GetIsObjectValid(oItem) == TRUE) +{ +if (GetTag(oItem) == sItem) +{ +nNumItems = nNumItems + GetNumStackedItems(oItem); +} +oItem = GetNextItemInInventory(oTarget); +} +return nNumItems; +} + +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetNumItems(oPC, "di_RedEar") != 0) return FALSE; + +if (GetItemPossessedBy(oPC, "uriktempammy") == OBJECT_INVALID) return FALSE; + +if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SHIFTER, oPC)!=0)) +return FALSE; + +if (GetAbilityScore(oPC, ABILITY_INTELLIGENCE, TRUE) < 12) return FALSE; + +if (GetAlignmentLawChaos(oPC) != ALIGNMENT_LAWFUL) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/hs_jaryx.dlg b/nwnds_module/hs_jaryx.dlg new file mode 100644 index 000000000..36a103fb9 Binary files /dev/null and b/nwnds_module/hs_jaryx.dlg differ diff --git a/nwnds_module/hs_killgoodtari.ncs b/nwnds_module/hs_killgoodtari.ncs new file mode 100644 index 000000000..d729aa4cf Binary files /dev/null and b/nwnds_module/hs_killgoodtari.ncs differ diff --git a/nwnds_module/hs_killgoodtari.nss b/nwnds_module/hs_killgoodtari.nss new file mode 100644 index 000000000..3683fcca4 --- /dev/null +++ b/nwnds_module/hs_killgoodtari.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +AdjustAlignment(oPC, ALIGNMENT_EVIL, 10); + +object oTarget; +oTarget = OBJECT_SELF; + +AdjustReputation(oPC, oTarget, -100); + +SetLocalInt(oPC, "TARIKILLER", 1); + +} + diff --git a/nwnds_module/hs_kledguard.dlg b/nwnds_module/hs_kledguard.dlg new file mode 100644 index 000000000..850784513 Binary files /dev/null and b/nwnds_module/hs_kledguard.dlg differ diff --git a/nwnds_module/hs_kreel_reward1.ncs b/nwnds_module/hs_kreel_reward1.ncs new file mode 100644 index 000000000..d081e2522 Binary files /dev/null and b/nwnds_module/hs_kreel_reward1.ncs differ diff --git a/nwnds_module/hs_kreel_reward1.nss b/nwnds_module/hs_kreel_reward1.nss new file mode 100644 index 000000000..d53bea626 --- /dev/null +++ b/nwnds_module/hs_kreel_reward1.nss @@ -0,0 +1,46 @@ +//:://///////////////////////////////////////////// +//:: FileName hs_kreel_reward1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="MatthaisEar") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +{ + // Give the speaker the items + int nVeggie = d6(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("iconicringofinte", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("iconicringofwisd", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("iconicringofcons", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 3) && (nVeggie <= 4)) + CreateItemOnObject("iconicringofdext", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 5)) + CreateItemOnObject("iconicringofs", GetPCSpeaker(), 1); + //% chance + else if (nVeggie > 5) + CreateItemOnObject("iconicringofchar", GetPCSpeaker(), 1); + }} diff --git a/nwnds_module/hs_kreel_reward2.ncs b/nwnds_module/hs_kreel_reward2.ncs new file mode 100644 index 000000000..4a6d36e95 Binary files /dev/null and b/nwnds_module/hs_kreel_reward2.ncs differ diff --git a/nwnds_module/hs_kreel_reward2.nss b/nwnds_module/hs_kreel_reward2.nss new file mode 100644 index 000000000..78ced8cf1 --- /dev/null +++ b/nwnds_module/hs_kreel_reward2.nss @@ -0,0 +1,64 @@ +//:://///////////////////////////////////////////// +//:: FileName hs_kreel_reward2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="MatthaisEar") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +{ + // Give the speaker the items + int nVeggie = d12(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("thescorcher", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("heartofdarkness", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("thedoomsword", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 3) && (nVeggie <= 4)) + CreateItemOnObject("enforcer", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 5)) + CreateItemOnObject("shiveringedge", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 5) && (nVeggie <= 6)) + CreateItemOnObject("clawofdregoth", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 7)) + CreateItemOnObject("daslechoblade", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 7) && (nVeggie <= 8)) + CreateItemOnObject("liarsblade", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 9)) + CreateItemOnObject("deadlandsrapier", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 9) && (nVeggie <= 10)) + CreateItemOnObject("shadowsedge", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 11)) + CreateItemOnObject("barbedboneblade", GetPCSpeaker(), 1); + //% chance + else if (nVeggie > 11) + CreateItemOnObject("touchoftheblack", GetPCSpeaker(), 1); + }} diff --git a/nwnds_module/hs_kreel_reward3.ncs b/nwnds_module/hs_kreel_reward3.ncs new file mode 100644 index 000000000..bb8fb1edd Binary files /dev/null and b/nwnds_module/hs_kreel_reward3.ncs differ diff --git a/nwnds_module/hs_kreel_reward3.nss b/nwnds_module/hs_kreel_reward3.nss new file mode 100644 index 000000000..8b4695fce --- /dev/null +++ b/nwnds_module/hs_kreel_reward3.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: FileName hs_kreel_reward3 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:34:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="MatthaisEar") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +{ + // Give the speaker the items + int nVeggie = d4(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("spectralcloak", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("githskincloak", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("torakswrap", GetPCSpeaker(), 1); + //% chance + else if (nVeggie > 3) + CreateItemOnObject("travisscloak", GetPCSpeaker(), 1); + }} diff --git a/nwnds_module/hs_kreelapproves.ncs b/nwnds_module/hs_kreelapproves.ncs new file mode 100644 index 000000000..4c2ceba5a Binary files /dev/null and b/nwnds_module/hs_kreelapproves.ncs differ diff --git a/nwnds_module/hs_kreelapproves.nss b/nwnds_module/hs_kreelapproves.nss new file mode 100644 index 000000000..386f468c8 --- /dev/null +++ b/nwnds_module/hs_kreelapproves.nss @@ -0,0 +1,28 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetHitDice(oPC) < 35) return FALSE; + +if ((GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DIVINECHAMPION, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SHIFTER, oPC)!=0)) +return FALSE; + +if (GetAlignmentGoodEvil(oPC) != ALIGNMENT_EVIL) return FALSE; + +if (!GetHasSkill(SKILL_BLUFF, oPC)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_maddoxapprove.ncs b/nwnds_module/hs_maddoxapprove.ncs new file mode 100644 index 000000000..86e4ea97d Binary files /dev/null and b/nwnds_module/hs_maddoxapprove.ncs differ diff --git a/nwnds_module/hs_maddoxapprove.nss b/nwnds_module/hs_maddoxapprove.nss new file mode 100644 index 000000000..36939ce4f --- /dev/null +++ b/nwnds_module/hs_maddoxapprove.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "maddoxapproves", 1); + +} diff --git a/nwnds_module/hs_maddoxchk.ncs b/nwnds_module/hs_maddoxchk.ncs new file mode 100644 index 000000000..67ef4a212 Binary files /dev/null and b/nwnds_module/hs_maddoxchk.ncs differ diff --git a/nwnds_module/hs_maddoxchk.nss b/nwnds_module/hs_maddoxchk.nss new file mode 100644 index 000000000..f6802ae15 --- /dev/null +++ b/nwnds_module/hs_maddoxchk.nss @@ -0,0 +1,29 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_HARPER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SHIFTER, oPC)!=0)) +return FALSE; + +if (GetAbilityScore(oPC, ABILITY_INTELLIGENCE, TRUE) < 12) return FALSE; + +if (GetAlignmentLawChaos(oPC) != ALIGNMENT_LAWFUL) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_maddoxchk0.ncs b/nwnds_module/hs_maddoxchk0.ncs new file mode 100644 index 000000000..7e2144e85 Binary files /dev/null and b/nwnds_module/hs_maddoxchk0.ncs differ diff --git a/nwnds_module/hs_maddoxchk0.nss b/nwnds_module/hs_maddoxchk0.nss new file mode 100644 index 000000000..ada09cb6c --- /dev/null +++ b/nwnds_module/hs_maddoxchk0.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt >= 1) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_maddoxdone.ncs b/nwnds_module/hs_maddoxdone.ncs new file mode 100644 index 000000000..ffee26ec9 Binary files /dev/null and b/nwnds_module/hs_maddoxdone.ncs differ diff --git a/nwnds_module/hs_maddoxdone.nss b/nwnds_module/hs_maddoxdone.nss new file mode 100644 index 000000000..9b561d574 --- /dev/null +++ b/nwnds_module/hs_maddoxdone.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt >= 7) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_maddoxgivedoc.ncs b/nwnds_module/hs_maddoxgivedoc.ncs new file mode 100644 index 000000000..29b21921f Binary files /dev/null and b/nwnds_module/hs_maddoxgivedoc.ncs differ diff --git a/nwnds_module/hs_maddoxgivedoc.nss b/nwnds_module/hs_maddoxgivedoc.nss new file mode 100644 index 000000000..e3a4a0297 --- /dev/null +++ b/nwnds_module/hs_maddoxgivedoc.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("urikdocuments", oPC); + +} + diff --git a/nwnds_module/hs_maddoxrejects.ncs b/nwnds_module/hs_maddoxrejects.ncs new file mode 100644 index 000000000..a0f1ea5c8 Binary files /dev/null and b/nwnds_module/hs_maddoxrejects.ncs differ diff --git a/nwnds_module/hs_maddoxrejects.nss b/nwnds_module/hs_maddoxrejects.nss new file mode 100644 index 000000000..be24808a0 --- /dev/null +++ b/nwnds_module/hs_maddoxrejects.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetLocalInt(oPC, "maddoxrejected") != 1) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/hs_maddoxreward.ncs b/nwnds_module/hs_maddoxreward.ncs new file mode 100644 index 000000000..8ce7e199e Binary files /dev/null and b/nwnds_module/hs_maddoxreward.ncs differ diff --git a/nwnds_module/hs_maddoxreward.nss b/nwnds_module/hs_maddoxreward.nss new file mode 100644 index 000000000..83fda261d --- /dev/null +++ b/nwnds_module/hs_maddoxreward.nss @@ -0,0 +1,16 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("uriktempkey", oPC); + +} diff --git a/nwnds_module/hs_maddoxsetno.ncs b/nwnds_module/hs_maddoxsetno.ncs new file mode 100644 index 000000000..27368b6cb Binary files /dev/null and b/nwnds_module/hs_maddoxsetno.ncs differ diff --git a/nwnds_module/hs_maddoxsetno.nss b/nwnds_module/hs_maddoxsetno.nss new file mode 100644 index 000000000..b197c9128 --- /dev/null +++ b/nwnds_module/hs_maddoxsetno.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "maddoxrejected", 1); + +} diff --git a/nwnds_module/hs_magmavendor.dlg b/nwnds_module/hs_magmavendor.dlg new file mode 100644 index 000000000..59579bddb Binary files /dev/null and b/nwnds_module/hs_magmavendor.dlg differ diff --git a/nwnds_module/hs_magmavendor.ncs b/nwnds_module/hs_magmavendor.ncs new file mode 100644 index 000000000..3d32ec4fd Binary files /dev/null and b/nwnds_module/hs_magmavendor.ncs differ diff --git a/nwnds_module/hs_magmavendor.nss b/nwnds_module/hs_magmavendor.nss new file mode 100644 index 000000000..dd8c0569d --- /dev/null +++ b/nwnds_module/hs_magmavendor.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("MagmaVendor"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/hs_mf_healer.dlg b/nwnds_module/hs_mf_healer.dlg new file mode 100644 index 000000000..d0905670f Binary files /dev/null and b/nwnds_module/hs_mf_healer.dlg differ diff --git a/nwnds_module/hs_noturiktemp.ncs b/nwnds_module/hs_noturiktemp.ncs new file mode 100644 index 000000000..bc876f322 Binary files /dev/null and b/nwnds_module/hs_noturiktemp.ncs differ diff --git a/nwnds_module/hs_noturiktemp.nss b/nwnds_module/hs_noturiktemp.nss new file mode 100644 index 000000000..d847f0c1d --- /dev/null +++ b/nwnds_module/hs_noturiktemp.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt >= 6) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_openguildstor.ncs b/nwnds_module/hs_openguildstor.ncs new file mode 100644 index 000000000..0e8548ce4 Binary files /dev/null and b/nwnds_module/hs_openguildstor.ncs differ diff --git a/nwnds_module/hs_openguildstor.nss b/nwnds_module/hs_openguildstor.nss new file mode 100644 index 000000000..2b446a8c0 --- /dev/null +++ b/nwnds_module/hs_openguildstor.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("GuildStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/hs_pc_inferior.ncs b/nwnds_module/hs_pc_inferior.ncs new file mode 100644 index 000000000..c3a08c245 Binary files /dev/null and b/nwnds_module/hs_pc_inferior.ncs differ diff --git a/nwnds_module/hs_pc_inferior.nss b/nwnds_module/hs_pc_inferior.nss new file mode 100644 index 000000000..25684702e --- /dev/null +++ b/nwnds_module/hs_pc_inferior.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt < 6) + return FALSE; + +if (GetHitDice(oPC) > 30) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_pc_superior.ncs b/nwnds_module/hs_pc_superior.ncs new file mode 100644 index 000000000..ddfca7dac Binary files /dev/null and b/nwnds_module/hs_pc_superior.ncs differ diff --git a/nwnds_module/hs_pc_superior.nss b/nwnds_module/hs_pc_superior.nss new file mode 100644 index 000000000..aba288c5d --- /dev/null +++ b/nwnds_module/hs_pc_superior.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt < 6) + return FALSE; + +if (GetHitDice(oPC) < 30) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_plute.dlg b/nwnds_module/hs_plute.dlg new file mode 100644 index 000000000..e5b3cd5d0 Binary files /dev/null and b/nwnds_module/hs_plute.dlg differ diff --git a/nwnds_module/hs_roomvalet.ncs b/nwnds_module/hs_roomvalet.ncs new file mode 100644 index 000000000..48832df6c Binary files /dev/null and b/nwnds_module/hs_roomvalet.ncs differ diff --git a/nwnds_module/hs_roomvalet.nss b/nwnds_module/hs_roomvalet.nss new file mode 100644 index 000000000..e337b6c10 --- /dev/null +++ b/nwnds_module/hs_roomvalet.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: HS Room Valet +//:: HS_RoomValet +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Picks inn room waypoint based on a variable + set on a nearby object, then moves the PC to + that waypoint +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: May 29, 2012 +//::////////////////////////////////////////////// + + +void main() +{ + object oValet = OBJECT_SELF; + object oPC = GetPCSpeaker(); + object oArea = GetArea(oValet); + object oDesk = GetNearestObjectByTag("ZEP_DESK01"); + string sInnRoom = GetLocalString(oDesk, "INN_ROOM"); + object oWayPoint = GetWaypointByTag(sInnRoom); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/hs_slainmatthias.ncs b/nwnds_module/hs_slainmatthias.ncs new file mode 100644 index 000000000..2cbfc156e Binary files /dev/null and b/nwnds_module/hs_slainmatthias.ncs differ diff --git a/nwnds_module/hs_slainmatthias.nss b/nwnds_module/hs_slainmatthias.nss new file mode 100644 index 000000000..10a3adb39 --- /dev/null +++ b/nwnds_module/hs_slainmatthias.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "MatthiasEar") == OBJECT_INVALID) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt < 3) + return FALSE; + +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt >= 4) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/hs_takedoc.ncs b/nwnds_module/hs_takedoc.ncs new file mode 100644 index 000000000..35124fc4d Binary files /dev/null and b/nwnds_module/hs_takedoc.ncs differ diff --git a/nwnds_module/hs_takedoc.nss b/nwnds_module/hs_takedoc.nss new file mode 100644 index 000000000..6d7d30f24 --- /dev/null +++ b/nwnds_module/hs_takedoc.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "sokidocument"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/hs_tarichief.dlg b/nwnds_module/hs_tarichief.dlg new file mode 100644 index 000000000..3cc9cda41 Binary files /dev/null and b/nwnds_module/hs_tarichief.dlg differ diff --git a/nwnds_module/hs_taridruid.dlg b/nwnds_module/hs_taridruid.dlg new file mode 100644 index 000000000..12f8be25c Binary files /dev/null and b/nwnds_module/hs_taridruid.dlg differ diff --git a/nwnds_module/hs_taristore.ncs b/nwnds_module/hs_taristore.ncs new file mode 100644 index 000000000..0e8548ce4 Binary files /dev/null and b/nwnds_module/hs_taristore.ncs differ diff --git a/nwnds_module/hs_taristore.nss b/nwnds_module/hs_taristore.nss new file mode 100644 index 000000000..d2c56de87 --- /dev/null +++ b/nwnds_module/hs_taristore.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("GuildStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/hs_taritrader.dlg b/nwnds_module/hs_taritrader.dlg new file mode 100644 index 000000000..f96ae71b8 Binary files /dev/null and b/nwnds_module/hs_taritrader.dlg differ diff --git a/nwnds_module/hs_tarivillager.dlg b/nwnds_module/hs_tarivillager.dlg new file mode 100644 index 000000000..631e98a46 Binary files /dev/null and b/nwnds_module/hs_tarivillager.dlg differ diff --git a/nwnds_module/hs_tarivillager2.dlg b/nwnds_module/hs_tarivillager2.dlg new file mode 100644 index 000000000..2b89f15c0 Binary files /dev/null and b/nwnds_module/hs_tarivillager2.dlg differ diff --git a/nwnds_module/hs_tavernwench.dlg b/nwnds_module/hs_tavernwench.dlg new file mode 100644 index 000000000..546df82b5 Binary files /dev/null and b/nwnds_module/hs_tavernwench.dlg differ diff --git a/nwnds_module/hs_templarkreel.dlg b/nwnds_module/hs_templarkreel.dlg new file mode 100644 index 000000000..8e38d2aaf Binary files /dev/null and b/nwnds_module/hs_templarkreel.dlg differ diff --git a/nwnds_module/hs_toramund.dlg b/nwnds_module/hs_toramund.dlg new file mode 100644 index 000000000..37159f5a0 Binary files /dev/null and b/nwnds_module/hs_toramund.dlg differ diff --git a/nwnds_module/hs_waitingforear.ncs b/nwnds_module/hs_waitingforear.ncs new file mode 100644 index 000000000..616a68bfd Binary files /dev/null and b/nwnds_module/hs_waitingforear.ncs differ diff --git a/nwnds_module/hs_waitingforear.nss b/nwnds_module/hs_waitingforear.nss new file mode 100644 index 000000000..44f228f65 --- /dev/null +++ b/nwnds_module/hs_waitingforear.nss @@ -0,0 +1,62 @@ +int GetNumItems(object oTarget,string sItem) +{ +int nNumItems = 0; +object oItem = GetFirstItemInInventory(oTarget); +while (GetIsObjectValid(oItem) == TRUE) +{ +if (GetTag(oItem) == sItem) +{ +nNumItems = nNumItems + GetNumStackedItems(oItem); +} +oItem = GetNextItemInInventory(oTarget); +} +return nNumItems; +} + +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetNumItems(oPC, "di_RedEar") > 0) return FALSE; + +if (GetNumItems(oPC, "uriktempkey") > 0) return FALSE; + +if (GetItemPossessedBy(oPC, "uriktempammy") == OBJECT_INVALID) return FALSE; + +if (GetItemPossessedBy(oPC, "uriktemphelm") == OBJECT_INVALID) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt < 4) + return FALSE; + +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYUrikTemplars"); + +if (nInt >= 5) + return FALSE; + +if (GetAbilityScore(oPC, ABILITY_INTELLIGENCE, TRUE) < 12) return FALSE; + +if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALADIN, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SHIFTER, oPC)!=0)) +return FALSE; + +if (GetAlignmentLawChaos(oPC) != ALIGNMENT_LAWFUL) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_wonthelpkreel.ncs b/nwnds_module/hs_wonthelpkreel.ncs new file mode 100644 index 000000000..4896aff7f Binary files /dev/null and b/nwnds_module/hs_wonthelpkreel.ncs differ diff --git a/nwnds_module/hs_wonthelpkreel.nss b/nwnds_module/hs_wonthelpkreel.nss new file mode 100644 index 000000000..c14a8fe74 --- /dev/null +++ b/nwnds_module/hs_wonthelpkreel.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt < 5) + return FALSE; + +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYAssassination!"); + +if (nInt >= 6) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hs_yehina.dlg b/nwnds_module/hs_yehina.dlg new file mode 100644 index 000000000..33a3788ab Binary files /dev/null and b/nwnds_module/hs_yehina.dlg differ diff --git a/nwnds_module/hs_yehinadone.ncs b/nwnds_module/hs_yehinadone.ncs new file mode 100644 index 000000000..b5017abbe Binary files /dev/null and b/nwnds_module/hs_yehinadone.ncs differ diff --git a/nwnds_module/hs_yehinadone.nss b/nwnds_module/hs_yehinadone.nss new file mode 100644 index 000000000..5aab29bf1 --- /dev/null +++ b/nwnds_module/hs_yehinadone.nss @@ -0,0 +1,40 @@ +int GetNumItems(object oTarget,string sItem) +{ +int nNumItems = 0; +object oItem = GetFirstItemInInventory(oTarget); +while (GetIsObjectValid(oItem) == TRUE) +{ +if (GetTag(oItem) == sItem) +{ +nNumItems = nNumItems + GetNumStackedItems(oItem); +} +oItem = GetNextItemInInventory(oTarget); +} +return nNumItems; +} + +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (nInt < 11) + return FALSE; + +if (GetNumItems(oPC, "fac_helm_tyrtmp") <= 1) return FALSE; + +if (GetNumItems(oPC, "FAC_ITPNCK_TYRTM") <= 1) return FALSE; + +if (GetNumItems(oPC, "FAC_KEY_TYRTEMP") <= 1) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/hsaltdrakebite.uti b/nwnds_module/hsaltdrakebite.uti new file mode 100644 index 000000000..de556e97e Binary files /dev/null and b/nwnds_module/hsaltdrakebite.uti differ diff --git a/nwnds_module/hulkcorpse001.utc b/nwnds_module/hulkcorpse001.utc new file mode 100644 index 000000000..1d4930f22 Binary files /dev/null and b/nwnds_module/hulkcorpse001.utc differ diff --git a/nwnds_module/hulkingcorspeh.uti b/nwnds_module/hulkingcorspeh.uti new file mode 100644 index 000000000..acd04dcdb Binary files /dev/null and b/nwnds_module/hulkingcorspeh.uti differ diff --git a/nwnds_module/humanbandit_001.utc b/nwnds_module/humanbandit_001.utc new file mode 100644 index 000000000..4689caae1 Binary files /dev/null and b/nwnds_module/humanbandit_001.utc differ diff --git a/nwnds_module/humanbandit_002.utc b/nwnds_module/humanbandit_002.utc new file mode 100644 index 000000000..dfbcc6121 Binary files /dev/null and b/nwnds_module/humanbandit_002.utc differ diff --git a/nwnds_module/hunefer001.utc b/nwnds_module/hunefer001.utc new file mode 100644 index 000000000..545a7044e Binary files /dev/null and b/nwnds_module/hunefer001.utc differ diff --git a/nwnds_module/hunefer_rot.ncs b/nwnds_module/hunefer_rot.ncs new file mode 100644 index 000000000..11c6fe8f4 Binary files /dev/null and b/nwnds_module/hunefer_rot.ncs differ diff --git a/nwnds_module/hunefer_rot.nss b/nwnds_module/hunefer_rot.nss new file mode 100644 index 000000000..d67c7ab99 --- /dev/null +++ b/nwnds_module/hunefer_rot.nss @@ -0,0 +1,102 @@ +#include "NW_I0_SPELLS" + + +void DoConDamage(object oTarget) +{ + if ( !GetIsObjectValid(oTarget) ) + return; + + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + int nDam = d6(); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + +} + +void DoRot(object oTarget ) +{ + if ( !GetIsObjectValid(oTarget) ) + return; + if ( !GetLocalInt(oTarget,"hunefer_rot") ) + return; + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE) ) + { + SendMessageToPC(oTarget,"Immune to Disease."); + SetLocalInt(oTarget,"hunefer_rot",0); + return; + } + + + int nResult = MySavingThrow(SAVING_THROW_FORT,oTarget,35,SAVING_THROW_TYPE_DISEASE); + if ( nResult == 0 ) + { + DelayCommand(0.1,DoConDamage(oTarget)); + } + + // Normally Hunefer rot can only be removed by remove disease, not by + // making saving throws + if ( nResult == 1 && GetGameDifficulty() != GAME_DIFFICULTY_DIFFICULT + && GetGameDifficulty() != GAME_DIFFICULTY_CORE_RULES && + GetIsPC(oTarget) ) + { + SetLocalInt(oTarget,"hunefer_rot",0); + SendMessageToPC(oTarget,"Recovered from Disease."); + } + if ( nResult != 2 ) + { + DelayCommand(6.0,DoRot(oTarget)); + } + else + { + SetLocalInt(oTarget,"hunefer_rot",0); + SendMessageToPC(oTarget,"Immune to Disease."); + } +/* else + { + SetLocalInt(oTarget,"hunefer_rot",0); + } + if ( nResult == 2 ) + { + + } */ +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + + if ( GetLocalInt(oTarget,"hunefer_rot") ) + { + return; + } + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE) ) + { + SendMessageToPC(oTarget,"Immune to Disease."); + return; + } + if ( MySavingThrow(SAVING_THROW_FORT,oTarget,35,SAVING_THROW_TYPE_DISEASE) ) + return; + + SendMessageToPC(oTarget,"You have contracted Hunefer Rot"); + SetLocalInt(oTarget,"hunefer_rot",1); + DelayCommand(6.0,DoRot(oTarget)); +} diff --git a/nwnds_module/huneferhide.uti b/nwnds_module/huneferhide.uti new file mode 100644 index 000000000..6e514b63e Binary files /dev/null and b/nwnds_module/huneferhide.uti differ diff --git a/nwnds_module/huneferslam.uti b/nwnds_module/huneferslam.uti new file mode 100644 index 000000000..7fda24bef Binary files /dev/null and b/nwnds_module/huneferslam.uti differ diff --git a/nwnds_module/i420_ghost_hb.ncs b/nwnds_module/i420_ghost_hb.ncs new file mode 100644 index 000000000..27fe0bae2 Binary files /dev/null and b/nwnds_module/i420_ghost_hb.ncs differ diff --git a/nwnds_module/i420_ghost_hb.nss b/nwnds_module/i420_ghost_hb.nss new file mode 100644 index 000000000..1d3359631 --- /dev/null +++ b/nwnds_module/i420_ghost_hb.nss @@ -0,0 +1,6 @@ +#include "i420_ghost_inc" + +void main() +{ + i420_Ghost(OBJECT_SELF); +} diff --git a/nwnds_module/i420_ghost_inc.nss b/nwnds_module/i420_ghost_inc.nss new file mode 100644 index 000000000..530f723fc --- /dev/null +++ b/nwnds_module/i420_ghost_inc.nss @@ -0,0 +1,31 @@ +///////////////////////////////////////////////////// +// // +// Invizible420's Ghost w/ visuals and Possession // +// // +// Created 03/11/03 By: Invizible420 // +// // +///////////////////////////////////////////////////// +/* + Description: This is the on_heartbeat script + for a ghost. I tried to make it fairly + accurate to 3rd edition rules (at least as + close as NWN will let me). + + This heartbeat script will give the ghost a + percent chance to use Malevolence (posses) + the pc as well as do some of the other nasty + things that 3rd edition ghosts can do. + + This script will only fire if a PC is within + fDist (See Below) meters of the ghost and if + a PC is in the area. + So to not consume unnecessary CPU cycles. + + SEE i420_ghost_fx + for more details and customization +*/ + +void i420_Ghost(object oTarget) +{ +ExecuteScript("i420_ghost_fx",oTarget); +} diff --git a/nwnds_module/icestorm.uti b/nwnds_module/icestorm.uti new file mode 100644 index 000000000..87388a9d7 Binary files /dev/null and b/nwnds_module/icestorm.uti differ diff --git a/nwnds_module/iconicringofcons.uti b/nwnds_module/iconicringofcons.uti new file mode 100644 index 000000000..56677ad25 Binary files /dev/null and b/nwnds_module/iconicringofcons.uti differ diff --git a/nwnds_module/idfiendprops.uti b/nwnds_module/idfiendprops.uti new file mode 100644 index 000000000..a41fd4396 Binary files /dev/null and b/nwnds_module/idfiendprops.uti differ diff --git a/nwnds_module/ilithidtent002.uti b/nwnds_module/ilithidtent002.uti new file mode 100644 index 000000000..4265e4f12 Binary files /dev/null and b/nwnds_module/ilithidtent002.uti differ diff --git a/nwnds_module/illithid001.utc b/nwnds_module/illithid001.utc new file mode 100644 index 000000000..bf6c9c00b Binary files /dev/null and b/nwnds_module/illithid001.utc differ diff --git a/nwnds_module/illithid002.utc b/nwnds_module/illithid002.utc new file mode 100644 index 000000000..659583277 Binary files /dev/null and b/nwnds_module/illithid002.utc differ diff --git a/nwnds_module/illithid003.utc b/nwnds_module/illithid003.utc new file mode 100644 index 000000000..841f45321 Binary files /dev/null and b/nwnds_module/illithid003.utc differ diff --git a/nwnds_module/illithid004.utc b/nwnds_module/illithid004.utc new file mode 100644 index 000000000..9a431d127 Binary files /dev/null and b/nwnds_module/illithid004.utc differ diff --git a/nwnds_module/illithid005.utc b/nwnds_module/illithid005.utc new file mode 100644 index 000000000..59fab7e18 Binary files /dev/null and b/nwnds_module/illithid005.utc differ diff --git a/nwnds_module/illithidboots001.uti b/nwnds_module/illithidboots001.uti new file mode 100644 index 000000000..800137d2e Binary files /dev/null and b/nwnds_module/illithidboots001.uti differ diff --git a/nwnds_module/illithidhide.uti b/nwnds_module/illithidhide.uti new file mode 100644 index 000000000..148dad661 Binary files /dev/null and b/nwnds_module/illithidhide.uti differ diff --git a/nwnds_module/illithidhide002.uti b/nwnds_module/illithidhide002.uti new file mode 100644 index 000000000..633531077 Binary files /dev/null and b/nwnds_module/illithidhide002.uti differ diff --git a/nwnds_module/illithidhide003.uti b/nwnds_module/illithidhide003.uti new file mode 100644 index 000000000..5eee2189e Binary files /dev/null and b/nwnds_module/illithidhide003.uti differ diff --git a/nwnds_module/illithidtent001.uti b/nwnds_module/illithidtent001.uti new file mode 100644 index 000000000..b1e8297a0 Binary files /dev/null and b/nwnds_module/illithidtent001.uti differ diff --git a/nwnds_module/immunetomindh.uti b/nwnds_module/immunetomindh.uti new file mode 100644 index 000000000..f60c386b8 Binary files /dev/null and b/nwnds_module/immunetomindh.uti differ diff --git a/nwnds_module/imp_ constrict.ncs b/nwnds_module/imp_ constrict.ncs new file mode 100644 index 000000000..f49ed8a35 Binary files /dev/null and b/nwnds_module/imp_ constrict.ncs differ diff --git a/nwnds_module/imp_ constrict.nss b/nwnds_module/imp_ constrict.nss new file mode 100644 index 000000000..e56208846 --- /dev/null +++ b/nwnds_module/imp_ constrict.nss @@ -0,0 +1,68 @@ +// Improved Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(2)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d6+7 bludgeoning damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// creature TRIED to entangle him. Otherwise tell him that he GOT entangled. + + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/imprisonedchild.utc b/nwnds_module/imprisonedchild.utc new file mode 100644 index 000000000..61efb2f87 Binary files /dev/null and b/nwnds_module/imprisonedchild.utc differ diff --git a/nwnds_module/inc_ai.nss b/nwnds_module/inc_ai.nss new file mode 100644 index 000000000..8884f3a9d --- /dev/null +++ b/nwnds_module/inc_ai.nss @@ -0,0 +1,23 @@ +int GetCanAct(object oCreature) +{ + effect eEffect = GetFirstEffect(oCreature); + int nEffect; + while ( GetIsEffectValid( eEffect )) + { + nEffect = GetEffectType(eEffect); + if ( nEffect == EFFECT_TYPE_PARALYZE || + nEffect == EFFECT_TYPE_DAZED || + nEffect == EFFECT_TYPE_DOMINATED || + nEffect == EFFECT_TYPE_FRIGHTENED || + nEffect == EFFECT_TYPE_PETRIFY || + nEffect == EFFECT_TYPE_SLEEP || + nEffect == EFFECT_TYPE_STUNNED || + nEffect == EFFECT_TYPE_TURNED ) + return FALSE; + + eEffect = GetNextEffect(oCreature); + } + return TRUE; +} + +//void main () {} \ No newline at end of file diff --git a/nwnds_module/inc_suffocate.nss b/nwnds_module/inc_suffocate.nss new file mode 100644 index 000000000..6d9f478ba --- /dev/null +++ b/nwnds_module/inc_suffocate.nss @@ -0,0 +1,54 @@ +void SuffocateCheck(object oTarget) +{ + int nRounds = GetLocalInt(oTarget,"SuffocateRounds"); + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + + int nDif = nCon * 2 - nRounds; + + if ( nDif < 0 ) + { + int nDC = 9 - nDif; + SendMessageToPC(oTarget,"You are suffocating!"); + int nRoll = d20() + GetAbilityModifier(ABILITY_CONSTITUTION,oTarget); + if ( nRoll >= nDC ) + { + SendMessageToPC(oTarget,"Constitution check: "+ IntToString(nRoll)+ " vs dc " + IntToString(nDC) + " :Success!"); + } + else + { + SendMessageToPC(oTarget,"Constitution check: "+ IntToString(nRoll)+ " vs dc " + IntToString(nDC) + " :Failure!"); + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + } + else + { + SendMessageToPC(oTarget,"You can't breath! You have " + IntToString(nDif) + + " rounds of breath left!"); + } +} + +void Suffocate(object oTarget) +{ + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD ) || ( nRace == RACIAL_TYPE_OOZE ) ) + return; + effect eVis = EffectVisualEffect(VFX_IMP_SONIC); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + + int nRounds = GetLocalInt(oTarget,"SuffocateRounds"); + nRounds++; + SetLocalInt(oTarget,"SuffocateRounds",nRounds); + SuffocateCheck(oTarget); +} + +void GiveBreath(object oTarget) +{ + SetLocalInt(oTarget,"SuffocateRounds",0); +} + +//void main () {} diff --git a/nwnds_module/intdevourer001.utc b/nwnds_module/intdevourer001.utc new file mode 100644 index 000000000..b3e9623d3 Binary files /dev/null and b/nwnds_module/intdevourer001.utc differ diff --git a/nwnds_module/intdevourprops.uti b/nwnds_module/intdevourprops.uti new file mode 100644 index 000000000..2f5dcf2c5 Binary files /dev/null and b/nwnds_module/intdevourprops.uti differ diff --git a/nwnds_module/intelligencedown.ncs b/nwnds_module/intelligencedown.ncs new file mode 100644 index 000000000..1d91d7987 Binary files /dev/null and b/nwnds_module/intelligencedown.ncs differ diff --git a/nwnds_module/intelligencedown.nss b/nwnds_module/intelligencedown.nss new file mode 100644 index 000000000..853db7329 --- /dev/null +++ b/nwnds_module/intelligencedown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_INTELLIGENCE, -2); +} diff --git a/nwnds_module/intelligenceup.ncs b/nwnds_module/intelligenceup.ncs new file mode 100644 index 000000000..428fed13e Binary files /dev/null and b/nwnds_module/intelligenceup.ncs differ diff --git a/nwnds_module/intelligenceup.nss b/nwnds_module/intelligenceup.nss new file mode 100644 index 000000000..3edae9b0f --- /dev/null +++ b/nwnds_module/intelligenceup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_INTELLIGENCE, 2); +} diff --git a/nwnds_module/invis_corpse_bdy.utp b/nwnds_module/invis_corpse_bdy.utp new file mode 100644 index 000000000..99c944ae7 Binary files /dev/null and b/nwnds_module/invis_corpse_bdy.utp differ diff --git a/nwnds_module/invis_corpse_bon.utp b/nwnds_module/invis_corpse_bon.utp new file mode 100644 index 000000000..b849f19bc Binary files /dev/null and b/nwnds_module/invis_corpse_bon.utp differ diff --git a/nwnds_module/invis_corpse_obj.utp b/nwnds_module/invis_corpse_obj.utp new file mode 100644 index 000000000..7a9ba124a Binary files /dev/null and b/nwnds_module/invis_corpse_obj.utp differ diff --git a/nwnds_module/invis_corpse_pch.utp b/nwnds_module/invis_corpse_pch.utp new file mode 100644 index 000000000..f7c584819 Binary files /dev/null and b/nwnds_module/invis_corpse_pch.utp differ diff --git a/nwnds_module/invis_corpse_pot.utp b/nwnds_module/invis_corpse_pot.utp new file mode 100644 index 000000000..c6622816d Binary files /dev/null and b/nwnds_module/invis_corpse_pot.utp differ diff --git a/nwnds_module/invis_corpse_scr.utp b/nwnds_module/invis_corpse_scr.utp new file mode 100644 index 000000000..af3604fb9 Binary files /dev/null and b/nwnds_module/invis_corpse_scr.utp differ diff --git a/nwnds_module/invis_corpse_tre.utp b/nwnds_module/invis_corpse_tre.utp new file mode 100644 index 000000000..1e4a49fba Binary files /dev/null and b/nwnds_module/invis_corpse_tre.utp differ diff --git a/nwnds_module/ioramh001.utc b/nwnds_module/ioramh001.utc new file mode 100644 index 000000000..a08a0409a Binary files /dev/null and b/nwnds_module/ioramh001.utc differ diff --git a/nwnds_module/ioramhpropertie.uti b/nwnds_module/ioramhpropertie.uti new file mode 100644 index 000000000..646264c3c Binary files /dev/null and b/nwnds_module/ioramhpropertie.uti differ diff --git a/nwnds_module/ioramhsrobes.uti b/nwnds_module/ioramhsrobes.uti new file mode 100644 index 000000000..fe556a623 Binary files /dev/null and b/nwnds_module/ioramhsrobes.uti differ diff --git a/nwnds_module/isbreakfast.ncs b/nwnds_module/isbreakfast.ncs new file mode 100644 index 000000000..869b37694 Binary files /dev/null and b/nwnds_module/isbreakfast.ncs differ diff --git a/nwnds_module/isbreakfast.nss b/nwnds_module/isbreakfast.nss new file mode 100644 index 000000000..14478ff10 --- /dev/null +++ b/nwnds_module/isbreakfast.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: Is Breakfast +//:: IsBreakfast +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Returns TRUE if the module time is between + 4am & 10am +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: May 28, 2012 +//::////////////////////////////////////////////// + +int StartingConditional() +{ +int nHour = GetTimeHour(); + +if (nHour > 10) return FALSE; +if (nHour < 4) return FALSE; + +else return TRUE; +} diff --git a/nwnds_module/it_creitem002.uti b/nwnds_module/it_creitem002.uti new file mode 100644 index 000000000..571d71ff0 Binary files /dev/null and b/nwnds_module/it_creitem002.uti differ diff --git a/nwnds_module/it_creitem006.uti b/nwnds_module/it_creitem006.uti new file mode 100644 index 000000000..3dd731885 Binary files /dev/null and b/nwnds_module/it_creitem006.uti differ diff --git a/nwnds_module/it_creitem055.uti b/nwnds_module/it_creitem055.uti new file mode 100644 index 000000000..5bb38bc9e Binary files /dev/null and b/nwnds_module/it_creitem055.uti differ diff --git a/nwnds_module/it_creitemdro001.uti b/nwnds_module/it_creitemdro001.uti new file mode 100644 index 000000000..07adc3b7d Binary files /dev/null and b/nwnds_module/it_creitemdro001.uti differ diff --git a/nwnds_module/it_crewpb003.uti b/nwnds_module/it_crewpb003.uti new file mode 100644 index 000000000..57688d0ba Binary files /dev/null and b/nwnds_module/it_crewpb003.uti differ diff --git a/nwnds_module/it_crewps005.uti b/nwnds_module/it_crewps005.uti new file mode 100644 index 000000000..c5e3b437f Binary files /dev/null and b/nwnds_module/it_crewps005.uti differ diff --git a/nwnds_module/it_crewps028.uti b/nwnds_module/it_crewps028.uti new file mode 100644 index 000000000..03d4cc2f6 Binary files /dev/null and b/nwnds_module/it_crewps028.uti differ diff --git a/nwnds_module/it_crewpsp011.uti b/nwnds_module/it_crewpsp011.uti new file mode 100644 index 000000000..d4ef338ed Binary files /dev/null and b/nwnds_module/it_crewpsp011.uti differ diff --git a/nwnds_module/it_deathlock001.uti b/nwnds_module/it_deathlock001.uti new file mode 100644 index 000000000..d062040f9 Binary files /dev/null and b/nwnds_module/it_deathlock001.uti differ diff --git a/nwnds_module/it_gold002.uti b/nwnds_module/it_gold002.uti new file mode 100644 index 000000000..dcd7dc0a7 Binary files /dev/null and b/nwnds_module/it_gold002.uti differ diff --git a/nwnds_module/it_gold003.uti b/nwnds_module/it_gold003.uti new file mode 100644 index 000000000..a160d22cc Binary files /dev/null and b/nwnds_module/it_gold003.uti differ diff --git a/nwnds_module/it_ildriss001.uti b/nwnds_module/it_ildriss001.uti new file mode 100644 index 000000000..ac32abb31 Binary files /dev/null and b/nwnds_module/it_ildriss001.uti differ diff --git a/nwnds_module/it_torch003.uti b/nwnds_module/it_torch003.uti new file mode 100644 index 000000000..b3dd1d5d0 Binary files /dev/null and b/nwnds_module/it_torch003.uti differ diff --git a/nwnds_module/it_trap005.uti b/nwnds_module/it_trap005.uti new file mode 100644 index 000000000..be2a15cd4 Binary files /dev/null and b/nwnds_module/it_trap005.uti differ diff --git a/nwnds_module/item008.uti b/nwnds_module/item008.uti new file mode 100644 index 000000000..45e4934b9 Binary files /dev/null and b/nwnds_module/item008.uti differ diff --git a/nwnds_module/itempalcus.itp b/nwnds_module/itempalcus.itp new file mode 100644 index 000000000..aa0194811 Binary files /dev/null and b/nwnds_module/itempalcus.itp differ diff --git a/nwnds_module/j_inc_constants.nss b/nwnds_module/j_inc_constants.nss new file mode 100644 index 000000000..9b6b398db --- /dev/null +++ b/nwnds_module/j_inc_constants.nss @@ -0,0 +1,2189 @@ +/************************ [Constants] ****************************************** + Filename: j_inc_constants +************************* [Constants] ****************************************** + This file just holds many constants, and many common functions (EG: Set + and Get spawn in conditions) to stop repeating code. + + See workings for more information. +************************* [History] ******************************************** + 1.3 - Added to make sure things are not repeated + constants in one place +************************* [Workings] ******************************************* + By using the SoU implimented way of defining static variables, "const" means + I can have a whole include which will include all used variables - this + keeps it all uniformed, and compiles better - as in all variable names + will be valid. + + It may also help speed, as variables which are repeated, are going to be + there to pick up from memory. + + If it does cause a lot of lag, more updates should clean this up. + + - To Do - Impliment better Debug system (see j_inc_debug) which you can + uncomment them long debug strings so that they don't get added to compiled + scripts if not used. +************************* [Arguments] ****************************************** + Arguments: N/A +************************* [Constants] *****************************************/ + +// This makes most scripts have debug anyway, and so its there :-). +// Multiple includes are ignored anyway :-D +#include "j_inc_debug" + +// This is a seperate script from all others. It is executed if a creature wants +// to DetermineCombatRound. It must be seperate to have override and non-override +// versions working together. +const string COMBAT_FILE = "j_ai_detercombat"; // FILENAME + +// Byond that, do NOT change the rest of these constants, unless you know +// what you are doing! +// I recommend not adding to this file either. Making your own constants +// file will make it full-proof. +//nw_walk_wp +// - FILE_ +const string FILE_WALK_WAYPOINTS = "j_ai_walkwaypoin"; // FILENAME +const string FILE_RE_SET_WEAPONS = "j_ai_setweapons"; // FILENAME +// If we are dead when this fires, it destroys us +const string FILE_DEATH_CLEANUP = "j_ai_destroyself"; // FILENAME + +// Heartbeat files. Speeds up (hopefully!) heartbeat calls and cirtainly heartbeat file size. +const string FILE_HEARTBEAT_TALENT_BUFF = "j_ai_heart_buff"; +const string FILE_HEARTBEAT_LOOT = "j_ai_heart_loot"; +const string FILE_HEARTBEAT_ANIMATIONS = "j_ai_heart_aimate"; +const string FILE_HEARTBEAT_WALK_TO_PC = "j_ai_heart_serch"; + +const string FILE_DRAGON_WING_BUFFET = "j_ai_wingbuffet"; +const string FILE_FLY_ATTACK = "j_ai_wingflying"; + +// Spell trigger creation file +const string FILE_SPELLTRIGGER_START = "j_ai_spelltrig1"; + +// Special: custom AI script set to a standard local string to this: +const string AI_CUSTOM_AI_SCRIPT = "AI_CUSTOM_AI_SCRIPT"; + +/******************************************************************************/ +// Simple constants to save re-typing ETC. +/******************************************************************************/ +// Just trying this. It won't harm anything, as with the const word, if the +// numbers are not used, they are not added, but if they are, getting them from +// these might be better. +// - Especially used for imputting the spell talent numbers, and required +// INT, WIS or CHA for that spell. :-D +const int iM10 = -10;// Dying threshold - die at -11 +const int iM1 = -1; +const int i0 = 0; +const int i1 = 1; +const int i2 = 2; +const int i3 = 3; +const int i4 = 4; +const int i5 = 5; +const int i6 = 6; +const int i7 = 7; +const int i8 = 8; +const int i9 = 9; +const int i10 = 10; +const int i11 = 11; +const int i12 = 12; +const int i13 = 13; +const int i14 = 14; +const int i15 = 15; +const int i16 = 16; +const int i17 = 17; +const int i18 = 18; +const int i19 = 19; +const int i20 = 20; +const int i21 = 21; +const int i22 = 22; +const int i23 = 23;// SpellAllSpells +const int i24 = 24; +const int i25 = 25; +const int i30 = 30; +const int i35 = 35; +const int i40 = 40;// Here onwards are normally %'s +const int i50 = 50; +const int i60 = 60; +const int i70 = 70; +const int i80 = 80; +const int i90 = 90; +const int i99 = 99; +const int i100 = 100; +const int i150 = 150;// Limit for PW Stun + +const float f0 = 0.0; +const float f1 = 1.0; +const float f2 = 2.0; +const float f3 = 3.0; +const float f4 = 4.0; +const float f5 = 5.0; +const float f6 = 6.0;// 1 heartbeat/round +const float f8 = 8.0;// Useful...for some reason +const float f9 = 9.0; +const float f10 = 10.0; +const float f11 = 11.0;// Range for some spell cones +const float f12 = 12.0;// 2 heartbeats/rounds +const float f15 = 15.0; +const float f16 = 16.0;// Double f8, the range of summon spells. +const float f18 = 18.0;// 3 heartbeats/rounds +const float f20 = 20.0; +const float f24 = 24.0;// 4 heartbeats/rounds +const float f30 = 30.0; +const float f35 = 35.0; +const float f40 = 40.0; +const float f50 = 50.0; +const float f60 = 60.0; + +// Ranges for spells - from Ranges.2da +const float fTouchRange = 2.25; +const float fShortRange = 8.0; +const float fMediumRange = 20.0; +const float fLongRange = 40.0; + +// Types: +// S. = Stored +// FILENAME +// CONSTANT +// S.CONSTANT +// S.INTEGER +// S.OBJECT +// S.FLOAT + +/******************************************************************************/ +// Global overriding actions +/******************************************************************************/ +// Leader thing +const int AI_SPECIAL_ACTIONS_ME_RUNNER = 1; // CONSTANT +// Fleeing +const int AI_SPECIAL_ACTIONS_FLEE = 2; // CONSTANT +// Moving out of a pre-set AOE. +const int AI_SPECIAL_ACTIONS_MOVE_OUT_OF_AOE = 3; // CONSTANT + +// This is trap thing. If we (on heartbeat) start disarming a trap, can we +// ignore it in combat? +const string TRAP_CAN_IGNORE_IN_COMBAT = "TRAP_CAN_IGNORE_IN_COMBAT";// S.INTEGER + +// Override for all AI scripts +const string AI_TOGGLE = "AI_TOGGLE"; // INTEGER + +// Set to a local int... +// 1 = Beholder AI +// 2 = Mindflayer AI +const string AI_SPECIAL_AI = "AI_SPECIAL_AI"; + +// Set to the last AI spell category cast. +const string ITEM_TALENT_VALUE = "ITEM_TALENT_VALUE"; // S.CONSTANT + + /*************************** Constant set-up ******************************* + We set up all global Spawn In Constants - hex numbers, used to check + one integer stored OnSpawn for settings the AI should use. + + Also constants for strings, and local variables. + **************************** Constant set-up ******************************/ + +/******************************************************************************/ +// String constants not associated with On Spawn options. Usually values. +/******************************************************************************/ +const string AI_INTELLIGENCE = "AI_INTELLIGENCE"; // S.INTEGER +const string AI_MORALE = "AI_MORALE"; // S.INTEGER +// Used for spontaeous spells, in the combat AI include and spell files. +const string AI_SPONTAEUOUSLY_CAST_HEALING = "AI_SPONTAEUOUSLY_CAST_HEALING";// S.INTEGER +// The last level of what summoned animal we cast. +const string AI_LAST_SUMMONED_LEVEL = "AI_LAST_SUMMONED_LEVEL"; // S.INTEGER +// Stores (if got FEAT_TURN_UNDEAD) the max level of undead we can turn. +const string AI_TURNING_LEVEL = "AI_TURNING_LEVEL"; // S.INTEGER +// Stores the amount of spell levels we are totally immune to +// - Set to a local int. +const string AI_SPELL_IMMUNE_LEVEL = "AI_SPELL_IMMUNE_LEVEL"; // S.INTEGER + +// Effects constants, actually set on the PC's too for performance :-) +const string AI_EFFECT_HEX = "AI_EFFECT_HEX"; +const string AI_SPELL_HEX = "AI_SPELL_HEX"; +const string AI_ABILITY_DECREASE = "AI_ABILITY_DECREASE"; +// Timer for resetting PC effects +const string AI_TIMER_EFFECT_SET = "AI_TIMER_EFFECT_SET"; +// This is not a timer, but if 1, it means the NPC uses Jasperre's AI and sets +// thier own effects +const string AI_JASPERRES_EFFECT_SET = "AI_JASPERRES_EFFECT_SET"; +// This is a timer for checking allies for spell effects, for buffing. +// - If TRUE, it won't loop around until it finds one to cast at. +// AI_TIMER_BUFF_ALLY_SPELL + IntToString(iSpell); +const string AI_TIMER_BUFF_ALLY_SPELL = "AI_TIMER_BUFF_ALLY_SPELL"; + +// When set to TRUE, it will stop heartbeat flee casting spells +// Deleted when we reach our flee target. +const string AI_HEARTBEAT_FLEE_SPELLS = "AI_HEARTBEAT_FLEE_SPELLS";// S.INTEGER + +// Timer for blocking creatures, and allies re-initiating combat +const string AI_TIMER_BLOCKED = "AI_TIMER_BLOCKED"; + +// this is set for 0.1 second to stop multiple DetermineCombatRound scripts being called +// in a short space of time. +const string AI_DEFAULT_AI_COOLDOWN = "AI_DEFAULT_AI_COOLDOWN"; + +// If this timer is set On Death, it means we do NOT apply EffectDeath to self. +const string AI_TIMER_DEATH_EFFECT_DEATH = "AI_TIMER_DEATH_EFFECT_DEATH"; + +/******************************************************************************/ +// Spell Trigger numbers/constants/settings +/******************************************************************************/ + +// Sets to a cirtain condition +const string SPELLTRIGGER_NOT_GOT_FIRST_SPELL = "AIST_FRST";// - When we !GetHasSpellEffect(iFirstSpell); +const string SPELLTRIGGER_DAMAGED_AT_PERCENT = "AIST_DAMA";// - When we are below X percent of HP, it fires +const string SPELLTRIGGER_IMMOBILE = "AIST_IMMB";// - When we are uncommandable/paralyzed/sleeping, etc. +const string SPELLTRIGGER_START_OF_COMBAT = "AIST_STCM";// - Fired first, whatever condition + +// Set up as: +// ASST_FRSTXY +// X - Spell trigger number (1-9) +// Y - Spell trigger spell stored (1-9) +// Local integer +// MAXINT_ASST_FRST1 +// Max number of spells in this trigger +// ASS_FRSTUSED +// This is set to TRUE if used up this round. +const string USED = "USED"; +// This is used for damage %, and is 1-100 for damage at % triggers. +const string VALUE = "VALUE"; +// Our spell trigger creature object +const string AI_SPELL_TRIGGER_CREATURE = "AI_SPELL_TRIGGER_CREATURE"; + +// When max is set to -1, we actually reset this on rest event. + +// Local on casters +// - Max no. of spells +const string AI_SPELLTRIG_MAXSPELLS = "AI_SPELLTRIG_MAXSPELLS"; +// - Constant for prefix - EG: AIST_IMMB3 for the third Immobile spell trig. +const string AI_SPELLTRIG_PREFIX = "AI_SPELLTRIG_PREFIX"; + +/******************************************************************************/ +// These are the "forgotten" constants, for spells/feats in SoU. +/******************************************************************************/ +// FEATS +// THese are the forgotten ones. Others are remembered. +// I have left OUT the ones which we cannot "use" + +// These are blackguard. Note that they are under spell abilities, but I'd rather +// use them as ActionUseFeat. +const int AI_FEAT_BG_CREATE_UNDEAD = 474; // CONSTANT +const int AI_FEAT_BG_FIENDISH_SERVANT = 475; // CONSTANT +// Othes +const int AI_FEAT_PM_CREATE_UNDEAD = 890; +const int AI_FEAT_PM_ANIMATE_DEAD = 889; +const int AI_FEAT_PM_CREATE_GREATER_UNDEAD = 895; + +// Polymorphing ones missing +const int AI_FEAT_EPIC_WILD_SHAPE_UNDEAD = 872; +const int AI_FEAT_EPIC_WILD_SHAPE_DRAGON = 873; +const int AI_FEAT_GREATER_WILDSHAPE_1 = 898; +const int AI_FEAT_GREATER_WILDSHAPE_2 = 900; +const int AI_FEAT_GREATER_WILDSHAPE_3 = 901; +const int AI_FEAT_HUMANOID_SHAPE = 902; +const int AI_FEAT_GREATER_WILDSHAPE_4 = 903; + +const int AI_FEAT_EPIC_OUTSIDER_SHAPE = 1060; +const int AI_FEAT_EPIC_CONSTRUCT_SHAPE = 1061; +const int AI_FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_1 = 1062; +const int AI_FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_2 = 1063; +const int AI_FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_3 = 1064; +const int AI_FEAT_EPIC_SHIFTER_INFINITE_WILDSHAPE_4 = 1065; +const int AI_FEAT_EPIC_SHIFTER_INFINITE_HUMANOID_SHAPE = 1066; +const int AI_FEAT_EPIC_DRUID_INFINITE_WILDSHAPE = 1068; +const int AI_FEAT_EPIC_DRUID_INFINITE_ELEMENTAL_SHAPE = 1069; + +const int AI_FEAT_EPIC_PLANAR_TURNING = 854; + +// Used in tunr undead checking. Faster then looping effects - GetHasSpellEffect(AI_SPELL_FEAT_TURN_UNDEAD); +const int AI_SPELL_FEAT_TURN_UNDEAD = 308; + +const int AI_SPELL_EVIL_BLIGHT = 566; +const int AI_SPELL_FEAT_PLANAR_TURNING = 643; + +// Epic spells are feats, but act like spells. +const int AI_FEAT_EPIC_SPELL_MUMMY_DUST = 874; +// SPELL_EPIC_MUMMY_DUST +const int AI_FEAT_EPIC_SPELL_DRAGON_KNIGHT = 875; +// SPELL_EPIC_DRAGON_KNIGHT +const int AI_FEAT_EPIC_SPELL_HELLBALL = 876; +const int AI_FEAT_EPIC_SPELL_EPIC_MAGE_ARMOR = 877; +const int AI_FEAT_EPIC_SPELL_RUIN = 878; +const int AI_FEAT_EPIC_SPELL_EPIC_WARDING = 990; + +const int AI_SPELL_EPIC_WARDING = 695; + +// healing ones missed +// Harm self - undead heal! +const int AI_SPELLABILITY_UNDEAD_HARM_SELF = 759; +// Cure Others Critical Wounds +const int AI_SPELLABILITY_CURE_CRITICAL_WOUNDS_OTHER= 567; + + +// Subspell set to this: +const string AI_SPELL_SUB_SPELL_CAST = "AI_SPELL_SUB_SPELL_CAST"; + +// For checking if they have this spell's effects. Most are feats, if not all. +const int AI_SPELL_BARD_SONG = 411; // CONSTANT +const int AI_SPELL_CURSE_SONG = 644; // CONSTANT +// - hordes - still not in! +const int AI_SPELL_OWLS_INSIGHT = 438; // CONSTANT + +// These are not anywhere, even though blackguard and AA ones are +const int AI_SPELL_HARPER_CATS_GRACE = 481; +const int AI_SPELL_HARPER_EAGLE_SPLEDOR = 482; + +// Shifter only spells (monster abilities) that are limited +const int AI_SPELLABILITY_GWILDSHAPE_STONEGAZE = 687; +const int AI_SPELLABILITY_GWILDSHAPE_DRIDER_DARKNESS= 688; +const int AI_SPELLABILITY_GWILDSHAPE_SPIKES = 692;// Manticore Spikes - no limit +const int AI_SPELLABILITY_GWILDSHAPE_MINDBLAST = 693;// GWildShape_Mindblast +const int AI_SPELLABILITY_VAMPIRE_DOMINATION_GAZE = 800;// Dom gaze. + +// Special monster abilities/other hordes spells +// - Some are shifter. Marked by SHIFT at end +const int AI_SPELLABILITY_HARPYSONG = 686;// SHIFT - Harpysong +const int AI_SPELLABILITY_SUMMON_BAATEZU = 701; +const int AI_SPELLABILITY_EYEBALL_RAY_0 = 710;// EyeballRay0 +const int AI_SPELLABILITY_EYEBALL_RAY_1 = 711;// EyeballRay1 +const int AI_SPELLABILITY_EYEBALL_RAY_2 = 712;// EyeballRay2 +const int AI_SPELLABILITY_MINDFLAYER_MINDBLAST_10 = 713;// Mindflayer Mindblast 10 +const int AI_SPELLABILITY_MINDFLAYER_PARAGON_MINDBLAST = 714;// Mindflayer Paragon Mindblast +const int AI_SPELLABILITY_GOLEM_RANGED_SLAM = 715; +const int AI_SPELLABILITY_SUCKBRAIN = 716;// SuckBrain +const int AI_SPELLABILITY_BEHOLDER_MAGIC_CONE = 727;// Beholder_Anti_Magic_Cone +const int AI_SPELLABILITY_BEBELITH_WEB = 731;// Bebelith Web +const int AI_SPELLABILITY_BEHOLDER_ALLRAYS = 736;// Beholder_Special_Spell_AI +const int AI_SPELLABILITY_PSIONIC_INERTIAL_BARRIER = 741;// Psionic Inertial Barrier +const int AI_SPELLABILITY_SHADOWBLEND = 757;// ShadowBlend - Shadow dragon. +const int AI_SPELLABILITY_AURA_OF_HELLFIRE = 761;// Aura +const int AI_SPELLABILITY_HELL_INFERNO = 762;// Hell Inferno - worse then SPELL_INFERNO +const int AI_SPELLABILITY_PSIONIC_MASS_CONCUSSION = 763;// Damage to AOE - psiconic mass concussion +const int AI_SPELLABILITY_SHADOW_ATTACK = 769;// SHIFTER Shadow Attack - also shifter +const int AI_SPELLABILITY_SLAAD_CHAOS_SPITTLE = 770;// SHIFTER Slaad Chaos Spittle - also shifter +const int AI_SPELLABILITY_BATTLE_BOULDER_TOSS = 773; +const int AI_SPELLABILITY_PRISMATIC_DEFLECTING_FORCE= 774;// Deflecting_Force +const int AI_SPELLABILITY_GIANT_HURL_ROCK = 775; +const int AI_SPELLABILITY_ILLITHID_MINDBLAST = 789; +const int AI_SPELLABILITY_VAMPIRE_INVISIBILITY = 799;// SHIFTER Vampire Invis. +const int AI_SPELLABILITY_AZER_FIRE_BLAST = 801;// SHIFTER Fire Blast. +const int AI_SPELLABILITY_SHIFTER_SPECTRE_ATTACK = 802;// SHIFTER Spectire Attack. + +// Constants for AOE's +const string AI_AOE_PER_STORM = "AOE_PER_STORM"; +const string AI_AOE_PER_CREEPING_DOOM = "AOE_PER_CREEPING_DOOM"; +const string AI_AOE_PER_FOGSTINK = "AOE_PER_FOGSTINK"; +const string AI_AOE_PER_GREASE = "AOE_PER_GREASE"; +const string AI_AOE_PER_WALLFIRE = "AOE_PER_WALLFIRE"; +const string AI_AOE_PER_WALLBLADE = "AOE_PER_WALLBLADE"; +const string AI_AOE_PER_FOGACID = "VFX_PER_FOGACID"; +const string AI_AOE_PER_FOGFIRE = "VFX_PER_FOGFIRE"; +const string AI_AOE_PER_FOGKILL = "AOE_PER_FOGKILL"; +const string AI_AOE_PER_FOGMIND = "VFX_PER_FOGMIND"; +const string AI_AOE_PER_ENTANGLE = "VFX_PER_ENTANGLE"; +const string AI_AOE_PER_EVARDS_BLACK_TENTACLES = "VFX_PER_EVARDS_BLACK_TENTACLES"; +const string AI_AOE_PER_FOGBEWILDERMENT = "VFX_PER_FOGBEWILDERMENT"; +const string AI_AOE_PER_STONEHOLD = "VFX_PER_STONEHOLD"; +const string AI_AOE_PER_WEB = "VFX_PER_WEB"; + +// When we ActionAttack +const int AI_NORMAL_MELEE_ATTACK = 1000; // CONSTANT +const int AI_PARRY_ATTACK = 2000; // CONSTANT + +/******************************************************************************/ +// The ignore string. If a creature has this set to anything but 0, then the AI ignores them. +/******************************************************************************/ +const string AI_IGNORE_TOGGLE = "AI_IGNORE_TOGGLE"; // S.INTEGER + +/******************************************************************************/ +// String constants not associated with Different Workings during play. +/******************************************************************************/ + +// In Other AI, this is set on high damage +const string AI_MORALE_PENALTY = "AI_MORALE_PENALTY"; // S.INTEGER +// Set via. SetCurrentAction +const string AI_CURRENT_ACTION = "AI_CURRENT_ACTION"; // S.INTEGER +// This is set to TRUE once we have died once. +const string WE_HAVE_DIED_ONCE = "WE_HAVE_DIED_ONCE"; // S.INTEGER +// Amount of deaths. +const string AMOUNT_OF_DEATHS = "AMOUNT_OF_DEATHS"; // S.INTEGER +// Turns off death script firing at all - used for Bioware lootable stuff. +const string I_AM_TOTALLY_DEAD = "I_AM_TOTALLY_DEAD"; // S.INTEGER + +const string MAX_ELEMENTAL_DAMAGE = "MAX_ELEMENTAL_DAMAGE"; // S.INTEGER +const string LAST_ELEMENTAL_DAMAGE = "LAST_ELEMENTAL_DAMAGE"; // S.INTEGER +// For this, it sets AI_HIGHEST_DAMAGER to the damager. +const string AI_HIGHEST_DAMAGE_AMOUNT = "AI_HIGHEST_DAMAGE_AMOUNT";// S.INTEGER +// This needs the damager to be the stored "AI_STORED_LAST_ATTACKER" +const string AI_HIGHEST_PHISICAL_DAMAGE_AMOUNT = "AI_HIGHEST_PHISICAL_DAMAGE_AMOUNT";// S.INTEGER +// Healing kits +const string AI_VALID_HEALING_KIT_OBJECT = "AI_VALID_HEALING_KIT_OBJECT";// S.INTEGER +const string AI_VALID_HEALING_KITS = "AI_VALID_HEALING_KITS"; // S.INTEGER +// Set to TRUE before re-setting things, it ignores weapons, only does healing kits. +const string RESET_HEALING_KITS = "RESET_HEALING_KITS"; // S.INTEGER +// TRUE if any of the SoU animations are valid. +const string AI_VALID_ANIMATIONS = "AI_VALID_ANIMATIONS"; + +// The amounts set to these are waypoint things +const string WAYPOINT_RUN = "WAYPOINT_RUN"; +const string WAYPOINT_PAUSE = "WAYPOINT_PAUSE"; + +// S.FLOAT +/******************************************************************************/ +// Shout strings. +/******************************************************************************/ +// 1 - I was attacked. :-P +const string I_WAS_ATTACKED = "I_WAS_ATTACKED"; // CONSTANT +// 2 is blocked NWN thingy +// 3 - Call to arms - Determines combat round +const string CALL_TO_ARMS = "CALL_TO_ARMS"; // CONSTANT +// 4 - Runner shout (shouts on heartbeat if running) +const string HELP_MY_FRIEND = "HELP_MY_FRIEND"; // CONSTANT +// 5 - Leader flee now +const string LEADER_FLEE_NOW = "LEADER_FLEE_NOW"; // CONSTANT +// 6 - Attack target X (specific target) +const string LEADER_ATTACK_TARGET = "LEADER_ATTACK_TARGET"; // CONSTANT +// 7 - I was killed - May flee if lots die! +const string I_WAS_KILLED = "I_WAS_KILLED"; // CONSTANT +// 8 - 1.3 - PLaceables/doors which shout this get responded to! +const string I_WAS_OPENED = "I_WAS_OPENED"; // CONSTANT + +// Extra - runner location variable (local location) +const string AI_HELP_MY_FRIEND_LOCATION = "AI_HELP_MY_FRIEND_LOCATION";// LOCATION +// Set on a placeable, by the placeable - thier last opener. +const string PLACEABLE_LAST_OPENED_BY = "PLACEABLE_LAST_OPENED_BY";// Object + +/******************************************************************************/ +// All timers (the end bits. Not the prefixes.) +/******************************************************************************/ +const string AI_TIMER_TURN_OFF_HIDE = "AI_TURN_OFF_HIDE"; // S.INTEGER +const string AI_TIMER_JUST_CAST_INVISIBILITY = "AI_TIMER_JUST_CAST_INVISIBILITY";//S.INTEGER +const string AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID = "AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID";// S.INTEGER +// Heartbeat "move to PC" searching +const string AI_TIMER_SEARCHING = "AI_TIMER_SEARCHING"; // S.INTEGER +const string AI_TIMER_STILL_PICKING_UP_ITEMS = "AI_TIMER_STILL_PICKING_UP_ITEMS";// S.INTEGER +const string AI_TIMER_AIMATIONS_PAUSE = "AI_TIMER_AIMATIONS_PAUSE"; // S.INTEGER +const string AI_TIMER_ATTACKED_IN_HTH = "AI_TIMER_ATTACKED_IN_HTH"; // S.INTEGER +const string AI_TIMER_TAUNT = "AI_TIMER_TAUNT"; // S.INTEGER +const string AI_TIMER_EMPATHY = "AI_TIMER_EMPATHY"; // S.INTEGER +// Special: Adds AOE spell which caused the event. +const string AI_TIMER_AOE_SPELL_EVENT = "AI_TIMER_AOE_SPELL_EVENT"; +const string AI_TIMER_FLEE = "AI_TIMER_FLEE"; +const string AI_TIMER_LEADER_SENT_RUNNER = "AI_TIMER_LEADER_SENT_RUNNER"; + +// Special search timer - stops calling Search() +const string AI_TIMER_SEARCH = "AI_TIMER_SEARCH_TIMER"; // S.INTEGER + +// On phisical attacked - if knockdown adn they can hit us (and not doofing the AI) +// then we use healing sooner as, basically, we may be knockdowned too much! +const string AI_TIMER_KNOCKDOWN = "AI_TIMER_KNOCKDOWN_TIMER"; + + +// Timer to stop cure condition in AI firing. +const string AI_TIMER_CURE_CONDITION = "AI_TIMER_CURE_CONDITION"; + +/******************************************************************************/ +// All speak talk arrays +/******************************************************************************/ +const string AI_TALK_ON_PERCIEVE_ENEMY = "AI_TALK_ON_PERCIEVE_ENEMY";// S.STRING +const string AI_TALK_ON_CONVERSATION = "AI_TALK_ON_CONVERSATION"; // S.STRING +const string AI_TALK_ON_PHISICALLY_ATTACKED = "AI_TALK_ON_PHISICALLY_ATTACKED";// S.STRING +const string AI_TALK_ON_DAMAGED = "AI_TALK_ON_DAMAGED"; // S.STRING +const string AI_TALK_ON_DEATH = "AI_TALK_ON_DEATH"; // S.STRING +const string AI_TALK_ON_HOSTILE_SPELL_CAST_AT = "AI_TALK_ON_HOSTILE_SPELL_CAST_AT";// S.STRING +const string AI_TALK_ON_MORALE_BREAK = "AI_TALK_ON_MORALE_BREAK";// S.STRING +const string AI_TALK_ON_COMBAT_ROUND = "AI_TALK_ON_COMBAT_ROUND";// S.STRING +const string AI_TALK_WE_PASS_POTION = "AI_TALK_WE_PASS_POTION"; +const string AI_TALK_WE_GOT_POTION = "AI_TALK_WE_GOT_POTION"; +const string AI_TALK_ON_CANNOT_RUN = "AI_TALK_ON_CANNOT_RUN"; +const string AI_TALK_ON_STUPID_RUN = "AI_TALK_ON_STUPID_RUN"; +const string AI_TALK_ON_COMBAT_ROUND_EQUAL = "AI_TALK_ON_COMBAT_ROUND_EQUAL"; +const string AI_TALK_ON_COMBAT_ROUND_THEM_OVER_US = "AI_TALK_ON_COMBAT_ROUND_THEM_OVER_US"; +const string AI_TALK_ON_COMBAT_ROUND_US_OVER_THEM = "AI_TALK_ON_COMBAT_ROUND_US_OVER_THEM"; +const string AI_TALK_ON_TAUNT = "AI_TALK_ON_TAUNT"; + +const string AI_TALK_ON_LEADER_SEND_RUNNER = "AI_TALK_ON_LEADER_SEND_RUNNER"; +const string AI_TALK_ON_LEADER_ATTACK_TARGET = "AI_TALK_ON_LEADER_ATTACK_TARGET"; +// Constant for the Size of the a string array - the prefix. +const string ARRAY_SIZE = "ARRAY_SIZE_"; // S.STRING +const string ARRAY_PERCENT = "ARRAY_PER_"; // S.STRING + +// Time stop stored array. +const string TIME_STOP_LAST_ = "TIME_STOP_LAST_"; +const string TIME_STOP_LAST_ARRAY_SIZE = "TIME_STOP_LAST_ARRAY_SIZE"; + +/******************************************************************************/ +// Objects +/******************************************************************************/ +// THe leader shout sets an object for others to attack. +const string AI_ATTACK_SPECIFIC_OBJECT = "AI_ATTACK_SPECIFIC_OBJECT";// S.OBJECT +// Our flee object string name +const string AI_FLEE_TO = "AI_FLEE_TO"; // S.OBJECT +// Object - The AOE we have been set to move from - special action +const string AI_AOE_FLEE_FROM = "AI_AOE_FLEE_FROM"; // S.OBJECT +// - RANGE to flee from the above object +// - Stored as a normal float value. +const string AI_AOE_FLEE_FROM_RANGE = "AI_AOE_FLEE_FROM_RANGE"; // S.FLOAT +// Set to whatever we attack, so others can find out. +const string AI_TO_ATTACK = "AI_TO_ATTACK"; // S.OBJECT +// The last phisical attacker set. +const string AI_STORED_LAST_ATTACKER = "AI_STORED_LAST_ATTACKER";// S.OBJECT +// Highest damager +const string AI_HIGHEST_DAMAGER = "AI_HIGHEST_DAMAGER"; // S.OBJECT +// Last person (set on the perception of inaudible or invisible) to have +// invisibility. It is also a local location (no prefix) for where they were! +const string AI_LAST_TO_GO_INVISIBLE = "AI_LAST_TO_GO_INVISIBLE";// S.OBJECT +// Stored under AI object as normal. If valid, we are meant to run to it. +const string AI_RUNNER_TARGET = "AI_RUNNER_TARGET"; // S.OBJECT +/******************************************************************************/ +// Looting special +/******************************************************************************/ +// Current object to take the thing +const string AI_CURRENT_TAKER = "AI_CURRENT_TAKER"; // S.OBJECT +// Exact tag of default body bags. +const string BODY_BAG = "BodyBag"; + +/******************************************************************************/ +// Weapons. +/******************************************************************************/ +// Arrays, so we have an array (best to worst value) +const string AI_WEAPON_PRIMARY = "AI_WEAPON_PRIMARY"; // S.OBJECT +const string AI_WEAPON_SECONDARY = "AI_WEAPON_SECONDARY"; // S.OBJECT +const string AI_WEAPON_TWO_HANDED = "AI_WEAPON_TWO_HANDED"; // S.OBJECT +const string AI_WEAPON_RANGED = "AI_WEAPON_RANGED"; // S.OBJECT +const string AI_WEAPON_RANGED_2 = "AI_WEAPON_RANGED_2"; // S.OBJECT +const string AI_WEAPON_RANGED_SHIELD = "AI_WEAPON_RANGED_SHIELD";// S.INTEGER +const string AI_WEAPON_RANGED_AMMOSLOT = "AI_WEAPON_RANGED_AMMOSLOT";// S.INTEGER +const string AI_WEAPON_RANGED_IS_UNLIMITED = "AI_WEAPON_RANGED_IS_UNLIMITED";// S.INTEGER +const string AI_WEAPON_SHIELD = "AI_WEAPON_SHIELD"; // S.OBJECT +const string AI_WEAPON_SHIELD_2 = "AI_WEAPON_SHIELD_2"; // S.OBJECT +// End post-fixs as it were +const string WEAP_SIZE = "AI_WEAP_SIZE"; // CONSTANT +const string WEAP_DAMAGE = "AI_WEAP_DAMAGE"; // CONSTANT + +/******************************************************************************* + Constants for spawn options + + These are set via. SetSpawnInCondition. They have sName set to the right + one else it is never picked up. + + Names: + + - Targeting & Fleeing (AI_TARGETING_FLEE_MASTER) + - Fighting & Spells (AI_COMBAT_MASTER) + - Other Combat - Healing, Skills & bosses (AI_OTHER_COMBAT_MASTER) + - Other - Death corpses, minor things (AI_OTHER_MASTER) + - User Defined (AI_UDE_MASTER) + - Shouts N/A + - Default Bioware settings (NW_GENERIC_MASTER) +*******************************************************************************/ + +/******************************************************************************/ +/******************************************************************************/ +//Master Constants for UDEs +/******************************************************************************/ +/******************************************************************************/ +const string AI_UDE_MASTER = "AI_UDE_MASTER"; +const string EXIT_UDE_PREFIX_ = "EXIT_UDE_PREFIX_";// Exit string, like EXIT_UDE_PREFIX_1001 is the heartbeat exit +/******************************************************************************/ +/******************************************************************************/ + +// Added pre- events. Starts them at 1021+, the originals (and some new) are 1001+ +const int AI_FLAG_UDE_HEARTBEAT_EVENT = 0x00000001; // 1001 +const int EVENT_HEARTBEAT_EVENT = 1001; +const int AI_FLAG_UDE_HEARTBEAT_PRE_EVENT = 0x00000002; // 1021 +const int EVENT_HEARTBEAT_PRE_EVENT = 1021; + +const int AI_FLAG_UDE_PERCIEVE_EVENT = 0x00000004; // 1002 +const int EVENT_PERCIEVE_EVENT = 1002; +const int AI_FLAG_UDE_PERCIEVE_PRE_EVENT = 0x00000008; // 1022 +const int EVENT_PERCIEVE_PRE_EVENT = 1022; + +const int AI_FLAG_UDE_END_COMBAT_ROUND_EVENT = 0x00000010; // 1003 +const int EVENT_END_COMBAT_ROUND_EVENT = 1003; +const int AI_FLAG_UDE_END_COMBAT_ROUND_PRE_EVENT = 0x00000020; // 1023 +const int EVENT_END_COMBAT_ROUND_PRE_EVENT = 1023; + +const int AI_FLAG_UDE_ON_DIALOGUE_EVENT = 0x00000040; // 1004 +const int EVENT_ON_DIALOGUE_EVENT = 1004; +const int AI_FLAG_UDE_ON_DIALOGUE_PRE_EVENT = 0x00000080; // 1024 +const int EVENT_ON_DIALOGUE_PRE_EVENT = 1024; + +const int AI_FLAG_UDE_ATTACK_EVENT = 0x00000010; // 1005 +const int EVENT_ATTACK_EVENT = 1005; +const int AI_FLAG_UDE_ATTACK_PRE_EVENT = 0x00000020; // 1025 +const int EVENT_ATTACK_PRE_EVENT = 1025; + +const int AI_FLAG_UDE_DAMAGED_EVENT = 0x00000040; // 1006 +const int EVENT_DAMAGED_EVENT = 1006; +const int AI_FLAG_UDE_DAMAGED_PRE_EVENT = 0x00000080; // 1026 +const int EVENT_DAMAGED_PRE_EVENT = 1026; + +const int AI_FLAG_UDE_DEATH_EVENT = 0x00000100; // 1007 +const int EVENT_DEATH_EVENT = 1007; +const int AI_FLAG_UDE_DEATH_PRE_EVENT = 0x00000200; // 1027 +const int EVENT_DEATH_PRE_EVENT = 1027; + +const int AI_FLAG_UDE_DISTURBED_EVENT = 0x00000400; // 1008 +const int EVENT_DISTURBED_EVENT = 1008; +const int AI_FLAG_UDE_DISTURBED_PRE_EVENT = 0x00000800; // 1028 +const int EVENT_DISTURBED_PRE_EVENT = 1028; + +const int AI_FLAG_UDE_RESTED_EVENT = 0x00004000; // 1009 +const int EVENT_RESTED_EVENT = 1009; +const int AI_FLAG_UDE_RESTED_PRE_EVENT = 0x00004000; // 1029 +const int EVENT_RESTED_PRE_EVENT = 1029; + +const int AI_FLAG_UDE_SPELL_CAST_AT_EVENT = 0x00001000; // 1011 +const int EVENT_SPELL_CAST_AT_EVENT = 1011; +const int AI_FLAG_UDE_SPELL_CAST_AT_PRE_EVENT = 0x00002000; // 1031 +const int EVENT_SPELL_CAST_AT_PRE_EVENT = 1031; + +const int AI_FLAG_UDE_COMBAT_ACTION_EVENT = 0x00004000; // 1012 +const int EVENT_COMBAT_ACTION_EVENT = 1012; +const int AI_FLAG_UDE_COMBAT_ACTION_PRE_EVENT = 0x00004000; // 1032 +const int EVENT_COMBAT_ACTION_PRE_EVENT = 1032; + +const int AI_FLAG_UDE_DAMAGED_AT_1_HP = 0x80000000; // 1014 +const int EVENT_DAMAGED_AT_1_HP = 1014; + +const int AI_FLAG_UDE_ON_BLOCKED_EVENT = 0x00008000; // 1015 +const int EVENT_ON_BLOCKED_EVENT = 1015; +const int AI_FLAG_UDE_ON_BLOCKED_PRE_EVENT = 0x00010000; // 1035 +const int EVENT_ON_BLOCKED_PRE_EVENT = 1035; + + +/******************************************************************************/ +/******************************************************************************/ +// Fleeing & Targeting settings, under AI_TARGETING_FLEE_MASTER +/******************************************************************************/ +const string AI_TARGETING_FLEE_MASTER = "AI_TARGETING_FLEE_MASTER"; +/******************************************************************************/ +/******************************************************************************/ + +// Targeting settings +// We only attack the lowest current HP. +const int AI_FLAG_TARGETING_LIKE_LOWER_HP = 0x00000001; +// We only attack the lowest AC (as in 1.2). +const int AI_FLAG_TARGETING_LIKE_LOWER_AC = 0x00000002; +// We go straight for mages/sorcerors +const int AI_FLAG_TARGETING_LIKE_MAGE_CLASSES = 0x00000004; +// We go for those who are using ranged weapons, especially against us! +// 1. Any ranged attackers attacking us. 2. Any ranged attackers. +const int AI_FLAG_TARGETING_LIKE_ARCHERS = 0x00000008; +// Attack PC's we see +const int AI_FLAG_TARGETING_LIKE_PCS = 0x00000010; +// Only attack PC targets if any in range +const int AI_FLAG_TARGETING_FILTER_FOR_PC_TARGETS = 0x00000020; +// Got for lowest HD +const int AI_FLAG_TARGETING_LIKE_LOWER_HD = 0x00000040; + +// Morale settings + +// This will flee to a waypoint set below. +// This is good for fleeing to a boss, fleeing to another area and so on. +const int AI_FLAG_FLEEING_FLEE_TO_WAYPOINT_IF_VALID = 0x00000080; +// This will make the creature never flee at all. +const int AI_FLAG_FLEEING_FEARLESS = 0x00000100; +// This will flee to an object, with the correct tag. +const int AI_FLAG_FLEEING_FLEE_TO_OBJECT = 0x00000200; +// This will make the creature never flee at all. +const int AI_FLAG_FLEEING_FLEE_TO_NEAREST_NONE_SEEN = 0x00000400; +// This will make the creature never fight against impossible odds. +const int AI_FLAG_FLEEING_NEVER_FIGHT_IMPOSSIBLE_ODDS = 0x00000800; +// This turns OFF any sort of group morale bonuses. +const int AI_FLAG_FLEEING_TURN_OFF_GROUP_MORALE = 0x00001000; +// Stops the overriding of HP% we'd need to test our morale. +const int AI_FLAG_FLEEING_NO_OVERRIDING_HP_AMOUNT = 0x00002000; + +// Stored integer, base morale save (Default 10) +const string BASE_MORALE_SAVE = "BASE_MORALE_SAVE";// S.INTEGER + +// Penalites for large damage... +const string AI_DAMAGE_AT_ONCE_FOR_MORALE_PENALTY = "AI_DAMAGE_AT_ONCE_FOR_MORALE_PENALTY";// S.INTEGER +const string AI_DAMAGE_AT_ONCE_PENALTY = "AI_DAMAGE_AT_ONCE_PENALTY";// S.INTEGER + +const string AMOUNT_OF_HD_DIFFERENCE_TO_CHECK = "AMOUNT_OF_HD_DIFFERENCE_TO_CHECK";// S.INTEGER +const string HP_PERCENT_TO_CHECK_AT = "HP_PERCENT_TO_CHECK_AT"; // S.INTEGER +// This is DIFFERENT to the AI_FLEE_TO. This is a set object On Spawn +const string AI_FLEE_OBJECT = "AI_FLEE_OBJECT"; // S.OBJECT + +const string AI_FAVOURED_ENEMY_RACE = "AI_FAVOURED_ENEMY_RACE"; // S.CONSTANT +const string AI_FAVOURED_ENEMY_CLASS = "AI_FAVOURED_ENEMY_CLASS"; // S.CONSTANT + +// How many rounds can we target 1 target? +const string AI_MAX_TURNS_TO_ATTACK_ONE_TARGET = "AI_MAX_TURNS_TO_ATTACK_ONE_TARGET"; + +// Locals recording the progress of re-targetting each target, against the above +// limit, default of 6 rounds. +const string AI_MELEE_TURNS_ATTACKING = "AI_MELEE_TURNS_ATTACKING"; +const string AI_SPELL_TURNS_ATTACKING = "AI_SPELL_TURNS_ATTACKING"; +const string AI_RANGED_TURNS_ATTACKING = "AI_RANGED_TURNS_ATTACKING"; + +// %'s. Chance to change targets in the next round. +const string AI_MELEE_LAST_TO_NEW_TARGET_CHANCE = "AI_MELEE_NT_CHANCE"; +const string AI_RANGED_LAST_TO_NEW_TARGET_CHANCE = "AI_RANGE_NT_CHANCE"; +const string AI_SPELL_LAST_TO_NEW_TARGET_CHANCE = "AI_SPELLS_NT_CHANCE"; + +// Internal AI use only! + +// Targeting often-used constants. +const string MAXIMUM = "MAXIMUM"; +const string MINIMUM = "MINIMUM"; +const int TARGET_HIGHER = 1; +const int TARGET_LOWER = 0; + +const string TARGETING_ISPC = "TARGETING_ISPC"; +const string TARGETING_MANTALS = "TARGETING_MANTALS"; +const string TARGETING_RANGE = "TARGETING_RANGE"; +const string TARGETING_AC = "TARGETING_AC"; +const string TARGETING_SAVES = "TARGETING_SAVES"; +const string TARGETING_PHISICALS = "TARGETING_PHISICALS"; +const string TARGETING_BAB = "TARGETING_BAB"; +const string TARGETING_HITDICE = "TARGETING_HITDICE"; +const string TARGETING_HP_PERCENT = "TARGETING_HP_PERCENT"; +const string TARGETING_HP_CURRENT = "TARGETING_HP_CURRENT"; +const string TARGETING_HP_MAXIMUM = "TARGETING_HP_MAXIMUM"; + +// Generic Include constants for locals +const string AI_LAST_MELEE_TARGET = "AI_LAST_MELEE_TARGET"; +const string AI_LAST_SPELL_TARGET = "AI_LAST_SPELL_TARGET"; +const string AI_LAST_RANGED_TARGET = "AI_LAST_RANGED_TARGET"; +// This is how many turns we've been attacking target X +// Should be 0 to reset targets. +const string GLOBAL_TURNS_ATTACKING_MELEE_TARGET = "GLOBAL_TURNS_ATTACKING_MELEE_TARGET";//S.INTEGER +const string GLOBAL_TURNS_ATTACKING_SPELL_TARGET = "GLOBAL_TURNS_ATTACKING_SPELL_TARGET";//S.INTEGER +const string GLOBAL_TURNS_ATTACKING_RANGED_TARGET = "GLOBAL_TURNS_ATTACKING_RANGED_TARGET";//S.INTEGER + +/******************************************************************************/ +/******************************************************************************/ +// Fighting & Spells variables, set under AI_COMBAT_MASTER +/******************************************************************************/ +const string AI_COMBAT_MASTER = "AI_COMBAT_MASTER"; +// AI_FLAG_COMBAT_ +/******************************************************************************/ +/******************************************************************************/ + +/******************************************************************************/ +// Mage settings +/******************************************************************************/ +// This will make the creature counterspell mages specifically +const int AI_FLAG_COMBAT_COUNTER_SPELL_ARCANE = 0x00000001; +// This will make the creature counterspell clerics specifically. +const int AI_FLAG_COMBAT_COUNTER_SPELL_DIVINE = 0x00000002; +// This will make the creature only counterspell if it has a group to +// help it. +const int AI_FLAG_COMBAT_COUNTER_SPELL_ONLY_IN_GROUP = 0x00000004; + +// Makes sure that any targeting never hits allies. +const int AI_FLAG_COMBAT_NEVER_HIT_ALLIES = 0x00000010; +// This ignores allies that would survive by being hit by the spell +const int AI_FLAG_COMBAT_AOE_DONT_MIND_IF_THEY_SURVIVE = 0x00000020; +// Targets more with single target (rather than AOE) spells, trying +// to kill one target rather than many. +const int AI_FLAG_COMBAT_SINGLE_TARGETING = 0x00000040; +// Likes AOE spells - more the merrier, for targeting. +const int AI_FLAG_COMBAT_MANY_TARGETING = 0x00000080; +// Improved ... +const int AI_FLAG_COMBAT_IMPROVED_INSTANT_DEATH_SPELLS = 0x00002000; +const int AI_FLAG_COMBAT_IMPROVED_SUMMON_TARGETING = 0x00004000; +const int AI_FLAG_COMBAT_IMPROVED_IMMUNITY_CHECKING = 0x00008000; +const int AI_FLAG_COMBAT_IMPROVED_SPECIFIC_SPELL_IMMUNITY= 0x00010000; +// When set, this will force use all potions +const int AI_FLAG_COMBAT_USE_ALL_POTIONS = 0x00020000; +// This will make the creature use ranged spells, before moving in bit by bit. +// Ranges of spells are 40, then 20, 8, 2.5 and then 0 (or self! hehe) +const int AI_FLAG_COMBAT_LONGER_RANGED_SPELLS_FIRST = 0x00040000; +// Dispels highest level mage in range rather then spell target. +const int AI_FLAG_COMBAT_DISPEL_MAGES_MORE = 0x00080000; +// Dispels in order of spell power on dispel target +const int AI_FLAG_COMBAT_DISPEL_IN_ORDER = 0x00100000; +// Turn on more ally buffing +const int AI_FLAG_COMBAT_MORE_ALLY_BUFFING_SPELLS = 0x00200000; + +// This will make the creature summon thier respective familiars/animal companions. +const int AI_FLAG_COMBAT_SUMMON_FAMILIAR = 0x00400000; +// Uses spells, to buff before an enemy comes near. (changed: not NW_prefix) +const int AI_FLAG_COMBAT_FLAG_FAST_BUFF_ENEMY = 0x00800000; + +// Set integers + +const string AI_AOE_HD_DIFFERENCE = "AI_AOE_HD_DIFFERENCE"; +// Ignore AOE target if got this amount of allies in a blast area +const string AI_AOE_ALLIES_LOWEST_IN_AOE = "AI_AOE_ALLIES_LOWEST_IN_AOE"; + +// Cheat cast spells set to this (SetAIConstant, with a + IntToString(1+) added) +const string AI_CHEAT_CAST_SPELL = "AI_CHEAT_CAST_SPELL"; + +// the spell last valid random casting +const string GLOBAL_LAST_SPELL_INFORMATION = "GLOBAL_LAST_SPELL_INFORMATION"; + +/******************************************************************************/ +// Fighter settings +/******************************************************************************/ +// This sets to pick up weapons which are disarmed. +const int AI_FLAG_COMBAT_PICK_UP_DISARMED_WEAPONS = 0x01000000; +// IE TANK! Well, if we do have ranged weapons (EG giants with slings +// for "rocks"), but are bloody tougher in HTH. +const int AI_FLAG_COMBAT_BETTER_AT_HAND_TO_HAND = 0x02000000; +// Moves back, uses more ranged weapons +const int AI_FLAG_COMBAT_ARCHER_ATTACKING = 0x04000000; +// Forces move back if got ranged weapon +const int AI_FLAG_COMBAT_ARCHER_ALWAYS_MOVE_BACK = 0x08000000; +// Forces using a bow (if got one) +const int AI_FLAG_COMBAT_ARCHER_ALWAYS_USE_BOW = 0x10000000; +// No killing off low HP PC's +const int AI_FLAG_COMBAT_NO_GO_FOR_THE_KILL = 0x20000000; + +// What range to use missile weapons +const string AI_RANGED_WEAPON_RANGE = "AI_RANGED_WEAPON_RANGE"; +/******************************************************************************/ +// Dragon settings +/******************************************************************************/ +// No wing buffet. +const int AI_FLAG_COMBAT_NO_WING_BUFFET = 0x40000000; +// (Dragon) flying on +const int AI_FLAG_COMBAT_FLYING = 0x80000000; + +// String constants - integers +const string AI_DRAGON_FREQUENCY_OF_BUFFET = "AI_DRAGON_FREQUENCY_OF_BUFFET"; +const string AI_DRAGON_FREQUENCY_OF_BREATH = "AI_DRAGON_FREQUENCY_OF_BREATH"; +// Constants for counters +const string AI_DRAGONS_BREATH = "AI_DRAGONS_BREATH"; +const string AI_WING_BUFFET = "AI_WING_BUFFET"; + +// Flying to target +const string AI_FLYING_TARGET = "AI_FLYING_TARGET"; + +/******************************************************************************/ +/******************************************************************************/ +// Other Combat - Healing, Skills & bosses - AI_OTHER_COMBAT_MASTER +/******************************************************************************/ +const string AI_OTHER_COMBAT_MASTER = "AI_OTHER_COMBAT_MASTER"; +//AI_FLAG_OTHER_COMBAT_ +/******************************************************************************/ +/******************************************************************************/ + +/******************************************************************************/ +// Healing settings +// % to heal allies. Advanced healing search, and if they are a front liner or not. +/******************************************************************************/ +const int AI_FLAG_OTHER_COMBAT_HEAL_AT_PERCENT_NOT_AMOUNT = 0x00000001; +const int AI_FLAG_OTHER_COMBAT_WILL_RAISE_ALLIES_IN_BATTLE = 0x00000002; +const int AI_FLAG_OTHER_COMBAT_NO_CURING = 0x00000004; +const int AI_FLAG_OTHER_COMBAT_ONLY_CURE_SELF = 0x00000008; +const int AI_FLAG_OTHER_COMBAT_ONLY_RESTORE_SELF = 0x00000010; +const int AI_FLAG_OTHER_COMBAT_GIVE_POTIONS_TO_HELP = 0x00000020; +const int AI_FLAG_OTHER_COMBAT_USE_BAD_HEALING_SPELLS = 0x00000040; + +// Locals +const string AI_HEALING_US_PERCENT = "AI_HEALING_US_PERCENT"; // S.INTEGER +const string AI_HEALING_ALLIES_PERCENT = "AI_HEALING_ALLIES_PERCENT"; // S.INTEGER +const string SECONDS_BETWEEN_STATUS_CHECKS = "ROUNDS_BETWEEN_STATUS_CHECKS";// S.INTEGER + +/******************************************************************************/ +// Skill settings +// How the NPC uses skills (pickpocket, taunt, healing kits...) and disarming traps. +/******************************************************************************/ +const int AI_FLAG_OTHER_COMBAT_NO_PICKPOCKETING = 0x00000080; +const int AI_FLAG_OTHER_COMBAT_FORCE_PICKPOCKETING = 0x00000100; +const int AI_FLAG_OTHER_COMBAT_NO_TAUNTING = 0x00000200; +const int AI_FLAG_OTHER_COMBAT_FORCE_TAUNTING = 0x00000400; +const int AI_FLAG_OTHER_COMBAT_NO_EMPATHY = 0x00000800; +const int AI_FLAG_OTHER_COMBAT_FORCE_EMPATHY = 0x00001000; +const int AI_FLAG_OTHER_COMBAT_NO_HIDING = 0x00002000; +const int AI_FLAG_OTHER_COMBAT_FORCE_HIDING = 0x00004000; +const int AI_FLAG_OTHER_COMBAT_NO_OPENING_LOCKED_DOORS = 0x00008000; +const int AI_FLAG_OTHER_COMBAT_FORCE_OPENING_LOCKED_DOORS = 0x00010000; +const int AI_FLAG_OTHER_COMBAT_NO_USING_HEALING_KITS = 0x00020000; +const int AI_FLAG_OTHER_COMBAT_FORCE_USING_HEALING_KITS = 0x00040000; +const int AI_FLAG_OTHER_COMBAT_NO_SEARCH = 0x00080000; +const int AI_FLAG_OTHER_COMBAT_FORCE_SEARCH = 0x00100000; +const int AI_FLAG_OTHER_COMBAT_NO_CONCENTRATION = 0x00200000; +const int AI_FLAG_OTHER_COMBAT_FORCE_CONCENTRATION = 0x00400000; +const int AI_FLAG_OTHER_COMBAT_NO_PARRYING = 0x00800000; +const int AI_FLAG_OTHER_COMBAT_FORCE_PARRYING = 0x01000000; + +// Counts up the concentration move counter, if over 5 we won't move back AGAIN +// but stand and fight a bit! +const string AI_CONCENTRATIONMOVE_COUNTER = "AI_CONCENTRATIONMOVE_COUNTER"; + +/******************************************************************************/ +// Boss settings, AI_BOSS_MASTER +// Leaders/Boss settings +/******************************************************************************/ +// Boss shout. Brings creatures in a pre-set, or standard range to us. +const int AI_FLAG_OTHER_COMBAT_BOSS_MONSTER_SHOUT = 0x02000000; +// Are we the group leader? +const int AI_FLAG_OTHER_COMBAT_GROUP_LEADER = 0x04000000; + +// Range for the shout +const string AI_BOSS_MONSTER_SHOUT_RANGE = "AI_BOSS_MONSTER_SHOUT_RANGE"; +// counter - adds 1, when 4+, we may shout for people to attack our target. +const string AI_LEADER_SHOUT_COUNT = "AI_LEADER_SHOUT_COUNT"; + +/******************************************************************************/ +/******************************************************************************/ +// Bioware variables +// NW_GENERIC_MASTER. Mostly used for animations + stuff. +/******************************************************************************/ +const string NW_GENERIC_MASTER = "NW_GENERIC_MASTER"; +/******************************************************************************/ +/******************************************************************************/ + +//const int NW_FLAG_SPECIAL_CONVERSATION = 0x00000001; +//const int NW_FLAG_SHOUT_ATTACK_MY_TARGET = 0x00000002; +const int NW_FLAG_STEALTH = 0x00000004; +const int NW_FLAG_SEARCH = 0x00000008; +//const int NW_FLAG_SET_WARNINGS = 0x00000010; +//const int NW_FLAG_ESCAPE_RETURN = 0x00000020; //Failed +//const int NW_FLAG_ESCAPE_LEAVE = 0x00000040; +//const int NW_FLAG_TELEPORT_RETURN = 0x00000080; //Failed +//const int NW_FLAG_TELEPORT_LEAVE = 0x00000100; +//const int NW_FLAG_PERCIEVE_EVENT = 0x00000200; +//const int NW_FLAG_ATTACK_EVENT = 0x00000400; +//const int NW_FLAG_DAMAGED_EVENT = 0x00000800; +//const int NW_FLAG_SPELL_CAST_AT_EVENT = 0x00001000; +//const int NW_FLAG_DISTURBED_EVENT = 0x00002000; +//const int NW_FLAG_END_COMBAT_ROUND_EVENT = 0x00004000; +//const int NW_FLAG_ON_DIALOGUE_EVENT = 0x00008000; +//const int NW_FLAG_RESTED_EVENT = 0x00010000; +//const int NW_FLAG_DEATH_EVENT = 0x00020000; +//const int NW_FLAG_SPECIAL_COMBAT_CONVERSATION = 0x00040000; +const int NW_FLAG_AMBIENT_ANIMATIONS = 0x00080000; +//const int NW_FLAG_HEARTBEAT_EVENT = 0x00100000; +const int NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS = 0x00200000; +const int NW_FLAG_DAY_NIGHT_POSTING = 0x00400000; +const int NW_FLAG_AMBIENT_ANIMATIONS_AVIAN = 0x00800000; +//const int NW_FLAG_APPEAR_SPAWN_IN_ANIMATION = 0x01000000; +//const int NW_FLAG_SLEEPING_AT_NIGHT = 0x02000000; +//const int NW_FLAG_FAST_BUFF_ENEMY = 0x04000000; + + +/******************************************************************************/ +// Other settings, AI_OTHER_MASTER +// Death, minor things. +/******************************************************************************/ +const string AI_OTHER_MASTER = "AI_OTHER_MASTER"; +//AI_FLAG_OTHER_ +/******************************************************************************/ + +/******************************************************************************/ +// Death +/******************************************************************************/ +// This turns off corpses - they won't be set to destroyable, and will be +// destroyed on death, instantly. +const int AI_FLAG_OTHER_TURN_OFF_CORPSES = 0x00000001; +// This will turn on Bioware's SetLootable stuff. It is performed On Death (Using EffectRessurection) +const int AI_FLAG_OTHER_USE_BIOWARE_LOOTING = 0x00400000; + +const string AI_WE_WILL_CREATE_ON_DEATH = "AI_WE_WILL_CREATE_ON_DEATH";// S.STRING +const string AI_DEATH_VISUAL_EFFECT = "AI_DEATH_VISUAL_EFFECT"; // S.CONSTANT +const string AI_CORPSE_DESTROY_TIME = "AI_CORPSE_DESTROY_TIME"; // S.INTEGER + +/******************************************************************************/ +// Behaviour +/******************************************************************************/ +// We search around going nearer enemies on heartbeat. +const int AI_FLAG_OTHER_SEARCH_IF_ENEMIES_NEAR = 0x00000002; +// We change to hostile when we are attacked. +const int AI_FLAG_OTHER_CHANGE_FACTIONS_TO_HOSTILE_ON_ATTACK = 0x00000004; +// We don't attack when we see an enemy, they must attack us normally. +const int AI_FLAG_OTHER_ONLY_ATTACK_IF_ATTACKED = 0x00000008; +// We rest at the end of combat, after searching. +const int AI_FLAG_OTHER_REST_AFTER_COMBAT = 0x00000010; +// No voice chats. +const int AI_FLAG_OTHER_NO_PLAYING_VOICE_CHAT = 0x00000040; + +const string AI_SEARCH_IF_ENEMIES_NEAR_RANGE = "AI_SEARCH_IF_ENEMIES_NEAR_RANGE";// S.INTEGER +const string AI_DOOR_INTELLIGENCE = "AI_DOOR_INTELLIGENCE"; // S.INTEGER +// Items and loot picking extra bags. +const string AI_LOOT_BAG_OTHER_1 = "AI_LOOT_BAG_OTHER_1"; // S.STRING +const string AI_LOOT_BAG_OTHER_2 = "AI_LOOT_BAG_OTHER_2"; // S.STRING +const string AI_LOOT_BAG_OTHER_3 = "AI_LOOT_BAG_OTHER_3"; // S.STRING + +/******************************************************************************/ +// Alignment - only 2 things +/******************************************************************************/ +// Do we stop commoner default? +const int AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE = 0x00000080; +// Do we stop commoner default? +const int AI_FLAG_OTHER_FORCE_COMMONER_ALIGNMENT_CHANGE = 0x00000100; + +/******************************************************************************/ +// Lag settings +/******************************************************************************/ +// We do not use any items. +const int AI_FLAG_OTHER_LAG_NO_ITEMS = 0x00000200; +// No casting of spells! +const int AI_FLAG_OTHER_LAG_NO_SPELLS = 0x00000400; +// No listening, for anything. +const int AI_FLAG_OTHER_LAG_NO_LISTENING = 0x00000800; +// Use ActionEquipMostDamagingMelee/Ranged instead of my set weapons. +const int AI_FLAG_OTHER_LAG_EQUIP_MOST_DAMAGING = 0x00001000; +// We never cure allies - so less GetHasEffect checks. +const int AI_FLAG_OTHER_LAG_NO_CURING_ALLIES = 0x00002000; +// return; on heartbeat. +const int AI_FLAG_OTHER_LAG_IGNORE_HEARTBEAT = 0x00004000; +// Go for the nearest seen enemy always +const int AI_FLAG_OTHER_LAG_TARGET_NEAREST_ENEMY = 0x00008000; + +// SetAI level things. +const string LAG_AI_LEVEL_NO_PC_OR_ENEMY_50M = "LAG_AI_LEVEL_NO_PC_OR_ENEMY_50M"; +const string LAG_AI_LEVEL_YES_PC_OR_ENEMY_50M = "LAG_AI_LEVEL_YES_PC_OR_ENEMY_50M"; +const string LAG_AI_LEVEL_COMBAT = "LAG_AI_LEVEL_COMBAT"; + +/******************************************************************************/ +// Other settings +/******************************************************************************/ + +// If they are damaged a lot, they may spawn a critical wounds potion and use it. +const int AI_FLAG_OTHER_CHEAT_MORE_POTIONS = 0x00010000; +// This will store thier starting location, and then move back there after combat +// Will turn off if there are waypoints. +const int AI_FLAG_OTHER_RETURN_TO_SPAWN_LOCATION = 0x00020000; +// This will affect conversations - will they clear all actions before hand? +const int AI_FLAG_OTHER_NO_CLEAR_ACTIONS_BEFORE_CONVERSATION = 0x00040000; +// Last one! This stops all polymorphing by spells/feats +const int AI_FLAG_OTHER_NO_POLYMORPHING = 0x00080000; +// Ignore emotes +const int AI_FLAG_OTHER_DONT_RESPOND_TO_EMOTES = 0x00100000; +// Don't ever shout +const int AI_FLAG_OTHER_DONT_SHOUT = 0x00200000; + +const string EMOTE_STAR = "*"; +// Locals +const string AI_POLYMORPH_INTO = "AI_POLYMORPH_INTO"; // S.CONSTANT +const string AI_RETURN_TO_POINT = "AI_RETURN_TO_POINT"; // S.INTEGER + +/******************************************************************************/ +// The spell validnessess: +/******************************************************************************/ +const string AI_VALID_SPELLS = "AI_VALID_SPELLS"; +/******************************************************************************/ +// Max CR used OnSpawn or other GetCreatureTalentBest places +const int MAXCR = 20; + +// Doesn't set what they are, only if they exsist. +const int AI_VALID_TALENT_HARMFUL_AREAEFFECT_DISCRIMINANT = 0x00000001;// 1 - This is the constant number added to AI_VALID_SPELLS spawn settings. +const int AI_VALID_TALENT_HARMFUL_RANGED = 0x00000002;// 2 +const int AI_VALID_TALENT_HARMFUL_TOUCH = 0x00000004; +const int AI_VALID_TALENT_BENEFICIAL_HEALING_AREAEFFECT = 0x00000008; +const int AI_VALID_TALENT_BENEFICIAL_HEALING_TOUCH = 0x00000010; +const int AI_VALID_TALENT_BENEFICIAL_CONDITIONAL_AREAEFFECT = 0x00000020; +const int AI_VALID_TALENT_BENEFICIAL_CONDITIONAL_SINGLE = 0x00000040; +const int AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_AREAEFFECT = 0x00000080; +const int AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_SINGLE = 0x00000100; +const int AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_SELF = 0x00000200; +const int AI_VALID_TALENT_HARMFUL_AREAEFFECT_INDISCRIMINANT = 0x00000400; +const int AI_VALID_TALENT_BENEFICIAL_PROTECTION_SELF = 0x00000800; +const int AI_VALID_TALENT_BENEFICIAL_PROTECTION_SINGLE = 0x00001000; +const int AI_VALID_TALENT_BENEFICIAL_PROTECTION_AREAEFFECT = 0x00002000; +const int AI_VALID_TALENT_BENEFICIAL_OBTAIN_ALLIES = 0x00004000; +const int AI_VALID_TALENT_PERSISTENT_AREA_OF_EFFECT = 0x00008000; +const int AI_VALID_TALENT_BENEFICIAL_HEALING_POTION = 0x00010000; +const int AI_VALID_TALENT_DRAGONS_BREATH = 0x00040000; +const int AI_VALID_TALENT_HARMFUL_MELEE = 0x00200000; +// Seperate GetHasSpell checks. Restoration ETC. +const int AI_VALID_CURE_CONDITION_SPELLS = 0x00400000; +// OTHER spells not from the aboves +const int AI_VALID_OTHER_SPELL = 0x00800000; +// Any spell from the aboves +const int AI_VALID_ANY_SPELL = 0x80000000; + +// Unused. This is mearly to not use talents if we don't have any! +//const string AI_TALENT_HARMFUL_MELEE = "AI_TALENT_HM"; + +/******************************************************************************/ +// Other file constants (default1, 2, 4-9, a, b, e +/******************************************************************************/ +// Name of the tempoary target that we have seen/been damaged by/etc. +const string AI_TEMP_SET_TARGET = "AI_TEMP_SET_TARGET"; + +const string AI_TIMER = "AI_TIMER_"; // Prefix for timers +const string AI_CONSTANT = "AI_CONSTANT_"; // Prefix for constansts +const string AI_INTEGER = "AI_INTEGER_"; // Prefix for integers +const string AI_OBJECT = "AI_OBJECT_"; // Prefix for objects + +// Array constants +const string MAXINT_ = "MAXINT_"; +const string s1 = "1"; +const string s0 = "0";// Used mainly for spell triggers + +const string ARRAY_TEMP_ENEMIES = "ARRAY_TEMP_ENEMIES"; +const string ARRAY_TEMP_ALLIES = "ARRAY_TEMP_ALLIES"; +const string ARRAY_TEMP_ARRAY = "ARRAY_TEMP_ARRAY"; + +const string ARRAY_MELEE_ENEMY = "ARRAY_MELEE_ENEMY"; +const string ARRAY_RANGED_ENEMY = "ARRAY_RANGED_ENEMY"; +const string ARRAY_SPELL_ENEMY = "ARRAY_SPELL_ENEMY"; + +// Some generic AI file constants +const string ARRAY_ENEMY_RANGE = "ARRAY_ENEMY_RANGE"; +const string ARRAY_ENEMY_RANGE_SEEN = "ARRAY_ENEMY_RANGE_SEEN"; +const string ARRAY_ENEMY_RANGE_HEARD = "ARRAY_ENEMY_RANGE_HEARD"; + +const string ARRAY_ALLIES_RANGE = "ARRAY_ALLIES_RANGE"; +const string ARRAY_ALLIES_RANGE_SEEN = "ARRAY_ALLIES_RANGE_SEEN"; +const string ARRAY_ALLIES_RANGE_SEEN_BUFF = "ARRAY_ALLIES_RANGE_SEEN_BUFF"; + +// RE-setting weapons uses this local integer identifier. +const string AI_WEAPONSETTING_SETWEAPONS = "AI_WEAPONSETTING_SETWEAPONS"; + +/******************************************************************************/ +// Functions in almost all scripts which include this :-P +/******************************************************************************/ + +// This reports the AI toggle of oTarget. +// * If the AI is OFF, it is TRUE. +// * Returns Dead + Commandable + AI Off integers +int GetAIOff(object oTarget = OBJECT_SELF); +// Sets the AI to NOT use any scripts (or run through them) EXCEPT death! +void SetAIOff(object oTarget = OBJECT_SELF); +// Resets the AI off integer, so the AI scripts run. +void SetAIOn(object oTarget = OBJECT_SELF); + +// This sets a spawn in condition. +// * nCondition - the condition to check for (From the "j_inc_constants" file) +// * sName - The name its stored under +void SetSpawnInCondition(int nCondition, string sName); +// This removes a spawn in condition. +// * nCondition - the condition to check for (From the "j_inc_constants" file) +// * sName - The name its stored under +void DeleteSpawnInCondition(int nCondition, string sName); +// Gets a spawn in condition. +// * nCondition - the condition to check for (From the "j_inc_constants" file) +// * sName - The name its stored under +// * oTarget - The target to look at (Ususally ourselves) +int GetSpawnInCondition(int nCondition, string sName, object oTarget = OBJECT_SELF); + +// We can only ever set ONE special action. These are special things, such as +// fleeing (that are a mixture of special things). +// * Use the AI_SPECIAL_ACTIONS_ constants in the constant file. +void SetCurrentAction(int nAction); +// Deletes the special action stored. +// * Use the AI_SPECIAL_ACTIONS_ constants in the constant file. +void ResetCurrentAction(); +// Gets the current special action stored. +// * Use the AI_SPECIAL_ACTIONS_ constants in the constant file. +int GetCurrentSetAction(); + +// Sets a local constant to sName, adding one to set right (so values of 0 become 1). +// * Use GetLocalConstant to return original value set. +// (To stop local's going awary, we set them with pre-fixes.) +void SetAIConstant(string sName, int iConstant); +// Returns a constant set to sName (Takes one away). +// * Therefore, returns -1 on error. +// (To stop local's going awary, we set them with pre-fixes.) +int GetAIConstant(string sName); +// Deletes a constant set to sName. +// (To stop local's going awary, we set them with pre-fixes.) +int J_DeleteAIConstant(string sName); + +// Sets a local AI integers to ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +void SetAIInteger(string sName, int iValue); +// Gets a local AI integers from ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +int GetAIInteger(string sName); +// Gets a local AI integers from ourselves. +// - We can define boundries for what it returns. +// (To stop local's going awary, we set them with pre-fixes.) +// If X is < iBottom or > iTop, return iDefault. +int GetBoundriedAIInteger(string sName, int iDefault = 10, int iTop = 10, int iBottom = 1); +// Deletes a local AI integers from ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +int DeleteAIInteger(string sName); + +// Sets a local AI object to ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +void SetAIObject(string sName, object oObject); +// Gets a local AI object from ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +object GetAIObject(string sName); +// Deletes a local AI object from ourselves. +// (To stop local's going awary, we set them with pre-fixes.) +void J_DeleteAIObject(string sName); + +// Sets up a timer. +// * sName - the variable name (Adds a pre-fix). +// * fDuration - the time until it is removed. +void SetLocalTimer(string sName, float fDuration); +// TRUE if the timer set to sName is still running. +int GetLocalTimer(string sName); + +// Arrays +// Sets a local INTEGER array on ourselves. +// * sArray - the array name. +// * oObjectArray - The object we will set. +// * iValue - The value to check. It is done HIGHEST to LOWEST. +void SetArrayIntegerValue(string sArray, object oObjectArray, int iValue); +// This will move all integer values from a point back a position +// * sArray - the array name. +// * iNumberStart - The value to start at. +// * iMax - The old-highest (or highest in the order) of the array (EG the 10th of 10) +void MoveArrayIntegerBackOne(string sArray, int iNumberStart, int iMax); + +// Sets a local FLOAT array on ourselves. +// * sArray - the array name. +// * oObjectArray - The object we will set. +// * fValue - The value to check. It is done LOWEST (nearest) to HIGHEST (fathest). +void SetArrayFloatValue(string sArray, object oObjectArray, float fValue); +// This will move all float values from a point back a position +// * sArray - the array name. +// * iNumberStart - The value to start at. +// * iMax - The old-highest (or highest in the order) of the array (EG the 10th of 10) +void MoveArrayFloatBackOne(string sArray, int iNumberStart, int iMax); + +// Deletes all the things in an array...set to sArray +void DeleteArray(string sArray); + +// Set the oTarget to ignorable. +// * The AI ignores, and shouldn't intentioally target, the creature. +void SetIgnore(object oTarget); +// Gets if the oTarget is ignorable. +// * The AI ignores, and shouldn't intentioally target, the creature. +int GetIgnore(object oTarget); +// This gets if the oTarget can be targeted as an enemy. +// * Returns if a DM, is faction Equal, is dead or the ignore variable. +int GetIgnoreNoFriend(object oTarget); + +// Fires a User Defined Event. +// * iSpawnValue - The spawn value (like NW_FLAG_PERCIEVE_PRE_EVENT) +// * iNumber - The number to fire (like EVENT_PERCIEVE_PRE_EVENT) +// Returns TRUE if the event fires. +int FireUserEvent(int iSpawnValue, int iNumber); +// This sets to exit the script. Use in the defaultd (On User Defined) file. +// For example: We want to not attack PC's with the item "ROCK" (Tag). We +// therefore use the event EVENT_PERCIEVE_PRE_EVENT to exit if they have that item +// because we go friendly to them. +// * iNumber - The user defined number to exit from. +void SetToExitFromUDE(int iNumber); +// This is used for Pre-events. If we exit from EVENT_PERCIEVE_PRE_EVENT, and +// use SetToExitFromUDE, this returns TRUE (ONCE!) +// * iNumber - The user defined number to exit from. +int ExitFromUDE(int iNumber); + +// We check if we are attacking anything +// * Checks Attempted* Targets, Get the AttackTarget of us. +// * Checks GetIsInCombat at the end. If that is TRUE, we should be doing proper rounds anyway. +int GetIsFighting(); +// We check if we can perform a combat action currently. +// * Checks our action list. Some things like skills, opening doors and so on +// we don't want to interrupt before they are done. +// * Also used within DetermineCombatRound +int GetIsBusyWithAction(); +// This checks GetIsFighting and GetIsBusyWithAction, returns FALSE if we can +// do a combat round (IE we don't have anything to interrupt and are not already +// in combat!) +// * IE it adds GetIsBusyWithAction with GetIsFighting to give 0, 1 or 2. +// * Checks if we are fleeing too +int CannotPerformCombatRound(); +// This will SpeakString a value from sName's array. i1000 uses a d1000 for % chance +void SpeakArrayString(string sName, int i1000 = FALSE); +// This is used in combat (at the end thereof) and when something shouts, and is a placeable. +// * oTarget - The target which may have shouted, or similar. Moves to and closes normally. +// If no oTarget, it still searches +void Search(object oTarget = OBJECT_INVALID); +// Used in Search(). This apply Trueseeing, See invisibility, or Invisiblity purge +// if we have neither of the 3 on us. +void SearchSpells(); + +// Returns our custom AI file (if any) +// - Blank string if not set +string GetCustomAIFileName(); +// Sets our custom AI file +// - Needs a 16 or less character string +// - Should execute actions +// - Can sort actions against a imputted target (EG: On Percieved enemy) by +// "GetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET)" +void SetCustomAIFileName(string sAIFileName); + +// This is still used - we just set a local object and execute script. +// Set the script to use by COMBAT_FILE constant +void DetermineCombatRound(object oTarget = OBJECT_INVALID); + +// This checks the current special action (fleeing, runner, door smashing) +// - Returns FALSE if none of them are performed +// Use this to make sure that an ActionMoveTo or DCR doesn't fire if we are fleeing. +// - This does not perform any actions. +int GetIsPerformingSpecialAction(); + +// This will, if we are set that we can, shout the string. +void AISpeakString(string sString); + +/*:://///////////////////////////////////////////// +//:: Name: AI ON, or OFF. +//:://///////////////////////////////////////////// + Scripted version of AI on/off toggle. + + It stops all AI scripts from running - using "if(GetAIStatus()) return;" + + Simple, but effective! +//::////////////////////////////////////////////*/ +int GetAIOff(object oTarget) +{ + if(GetIsDead(oTarget) || + !GetCommandable(oTarget) || + GetLocalInt(oTarget, AI_TOGGLE)) + { + return TRUE; + } + return FALSE; +} +void SetAIOff(object oTarget) +{ + SetLocalInt(oTarget, AI_TOGGLE, TRUE); +} +void SetAIOn(object oTarget) +{ + DeleteLocalInt(oTarget, AI_TOGGLE); +} +/*:://///////////////////////////////////////////// +//:: Name: GetSpawnInCondition +//:://///////////////////////////////////////////// + This returns the condition of it (True or False) + You can specify a name (as some use AI_SKILLS_MASTER for example.) + 1.3: Changed to a simpler thing, hopefully faster (taken from SoU AI). +//::////////////////////////////////////////////*/ +int GetSpawnInCondition(int nCondition, string sName, object oTarget = OBJECT_SELF) +{ + return (GetLocalInt(oTarget, sName) & nCondition); +} +void SetSpawnInCondition(int nCondition, string sName) +{ + SetLocalInt(OBJECT_SELF, sName, (GetLocalInt(OBJECT_SELF, sName) | nCondition)); +} +void DeleteSpawnInCondition(int nCondition, string sName) +{ + SetLocalInt(OBJECT_SELF, sName, (GetLocalInt(OBJECT_SELF, sName) & ~nCondition)); +} +/*:://///////////////////////////////////////////// +//:: Name: SetCurrentAction, ResetCurrentAction, GetCurrentSetAction. +//:://///////////////////////////////////////////// + We can only ever set ONE action. These are special things, such as + fleeing. + Use the AI_ACTION constants in the constant file. +//::////////////////////////////////////////////*/ +void SetCurrentAction(int nAction) +{ + SetLocalInt(OBJECT_SELF, AI_CURRENT_ACTION, nAction); +} +void ResetCurrentAction() +{ + DeleteLocalInt(OBJECT_SELF, AI_CURRENT_ACTION); +} +int GetCurrentSetAction() +{ + return GetLocalInt(OBJECT_SELF, AI_CURRENT_ACTION); +} +/*:://///////////////////////////////////////////// +//:: Name: SetLocalTimer, GetLocalTimer +//:://///////////////////////////////////////////// + Gets/Sets a local timer. +//::////////////////////////////////////////////*/ +void SetLocalTimer(string sName, float fDuration) +{ + sName = AI_TIMER + sName; + SetLocalInt(OBJECT_SELF, sName, TRUE); + DelayCommand(fDuration, DeleteLocalInt(OBJECT_SELF, sName)); +} +int GetLocalTimer(string sName) +{ + return GetLocalInt(OBJECT_SELF, AI_TIMER + sName); +} +/*:://///////////////////////////////////////////// +//:: Name: Array functions. +//:://///////////////////////////////////////////// + Set array values to local integers/floats under the values stated. +//::////////////////////////////////////////////*/ +// Sets a local INTEGER array on ourselves. +// * sArray - the array name. +// * oObjectArray - The object we will set. +// * iValue - The value to check. It is done HIGHEST to LOWEST. +void SetArrayIntegerValue(string sArray, object oObjectArray, int iValue) +{ + int iValueAtPosition, iMax, i; + // Get the current size + iMax = GetLocalInt(OBJECT_SELF, MAXINT_ + sArray); + string sArrayStore = sArray; + // Special - IE no valid array values at the start. + if(iMax < i1) + { + sArrayStore += s1; + SetLocalInt(OBJECT_SELF, sArray + s1, iValue); + SetLocalObject(OBJECT_SELF, sArray + s1, oObjectArray); + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, i1); // always the first. + } + // Else, we will set it in the array. + else + { + // Loop through the items stored already. + for(i = i1; i <= iMax; i++) + { + // Get the value of the item. + iValueAtPosition = GetLocalInt(OBJECT_SELF, sArray + IntToString(i)); + // If imput is greater than stored...move all of them back one. + if(iValue > iValueAtPosition) + { + // Move all values from this point onwards back one. + MoveArrayIntegerBackOne(sArray, i, iMax); + // Set the local object and the local integer. + sArrayStore += IntToString(i); + SetLocalInt(OBJECT_SELF, sArrayStore, iValue); + SetLocalObject(OBJECT_SELF, sArrayStore, oObjectArray); + // Set max values we have (IE add one!) 1.3beta - changed from iMax++ + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, ++iMax); + break; + } + // If at end, just add at end. + else if(i == iMax) + { + // Set the local object and the local integer. + sArrayStore += IntToString(i + i1); + SetLocalInt(OBJECT_SELF, sArrayStore, iValue); + SetLocalObject(OBJECT_SELF, sArrayStore, oObjectArray); + // Set max values we have (IE add one!) + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, ++iMax); + break; + } + } + } +} +// This will move all integer values from a point back a position +// * sArray - the array name. +// * iNumberStart - The value to start at. +// * iMax - The old-highest (or highest in the order) of the array (EG the 10th of 10) +void MoveArrayIntegerBackOne(string sArray, int iNumberStart, int iMax) +{ + // Objects, the old name for that value and the new one. + object oObjectAtNumber; + string sCurrentName, sNewName; + int iArrayAtNumberValue, i; + // Move it from the back, back one, then then next... + // Start at value 5 (Max) and move it to 6, then move to 4, move it + // to 5 and so on down to iNumber Start, say, 3, so we get to 3, move it to 4, + // and space 3 is free. + for(i = iMax; i >= iNumberStart; i--) + { + // Sets the name up right. + sCurrentName = sArray + IntToString(i); // The current name to get values. + sNewName = sArray + IntToString(i + i1); // Move back = Add one + // Set the things up in the right parts. + oObjectAtNumber = GetLocalObject(OBJECT_SELF, sCurrentName); + iArrayAtNumberValue = GetLocalInt(OBJECT_SELF, sCurrentName); + // To the NEW name - we add one to the i value. + SetLocalObject(OBJECT_SELF, sNewName, oObjectAtNumber); + SetLocalInt(OBJECT_SELF, sNewName, iArrayAtNumberValue); + } +} +// Sets a local FLOAT array on ourselves. +// * sArray - the array name. +// * oObjectArray - The object we will set. +// * fValue - The value to check. It is done LOWEST (nearest) to HIGHEST (fathest). +void SetArrayFloatValue(string sArray, object oObjectArray, float fValue) +{ + int iMax, i; + iMax = GetLocalInt(OBJECT_SELF, MAXINT_ + sArray); + string sArrayStore = sArray; + float fValueAtPosition; + // Special - IE no valid array values at the start. + if(iMax <= FALSE) + { + sArrayStore = sArray + s1; + SetLocalFloat(OBJECT_SELF, sArrayStore, fValue); + SetLocalObject(OBJECT_SELF, sArrayStore, oObjectArray); + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, i1); // always the first. + } + // Else, we will set it in the array. + else + { + // Loop through the items stored already. + for(i = i1; i <= iMax; i++) + { + // Get the value of the item. + fValueAtPosition = GetLocalFloat(OBJECT_SELF, sArray + IntToString(i)); + // If imput is LESS (nearer) than stored...move all of them back one. + if(fValue < fValueAtPosition) + { + // Move all values from this point onwards back one. + MoveArrayFloatBackOne(sArray, i, iMax); + // Set the local object and the local integer. + sArrayStore = sArray + IntToString(i); + SetLocalFloat(OBJECT_SELF, sArrayStore, fValue); + SetLocalObject(OBJECT_SELF, sArrayStore, oObjectArray); + // Set max values we have (IE add one!) 1.3 beta - it was iMax++ + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, ++iMax); + break; + } + // Else, if it is the end value (iMax) we set it at the end + else if(i == iMax) + { + // Set the local object and the local integer. + sArrayStore = sArray + IntToString(i + i1); + SetLocalFloat(OBJECT_SELF, sArrayStore, fValue); + SetLocalObject(OBJECT_SELF, sArrayStore, oObjectArray); + // Set max values we have (IE add one!) + SetLocalInt(OBJECT_SELF, MAXINT_ + sArray, ++iMax); + break; + } + } + } +} +// This will move all float values from a point back a position +// * sArray - the array name. +// * iNumberStart - The value to start at. +// * iMax - The old-highest (or highest in the order) of the array (EG the 10th of 10) +void MoveArrayFloatBackOne(string sArray, int iNumberStart, int iMax) +{ + // Objects, the old name for that value and the new one. + object oObjectAtNumber; + string sCurrentName, sNewName; + int i; + float fArrayAtNumberValue; + // Move it from the back, back one, then then next... + for(i = iMax; i >= iNumberStart; i--) + { + // Sets the name up right. + sCurrentName = sArray + IntToString(i); // The current name to get values. + sNewName = sArray + IntToString(i + i1); // Move back = Add one + // Set the things up in the right parts. + oObjectAtNumber = GetLocalObject(OBJECT_SELF, sCurrentName); + fArrayAtNumberValue = GetLocalFloat(OBJECT_SELF, sCurrentName); + // To the NEW name - we add one to the i value. + SetLocalObject(OBJECT_SELF, sNewName, oObjectAtNumber); + SetLocalFloat(OBJECT_SELF, sNewName, fArrayAtNumberValue); + } +} +// Deletes all the things in an array...set to sArray +void DeleteArray(string sArray) +{ + int i, iMax; + string sNewName; + // Max values, if any + iMax = GetLocalInt(OBJECT_SELF, MAXINT_ + sArray); + if(iMax) + { + for(i = i1; i <= iMax; i++) + { + sNewName = sArray + IntToString(i); + DeleteLocalObject(OBJECT_SELF, sNewName);// Object + DeleteLocalInt(OBJECT_SELF, sNewName);// Value + DeleteLocalFloat(OBJECT_SELF, sNewName);// Value + } + } + // Here, we do delete the max + DeleteLocalInt(OBJECT_SELF, MAXINT_ + sArray); +} + + +/*:://///////////////////////////////////////////// +//:: Name: SetLocalTimer, GetLocalTimer +//:://///////////////////////////////////////////// + Set/Get the oTarget to ignorable. + * The AI ignores, and shouldn't intentioally target, the creature. +//::////////////////////////////////////////////*/ +void SetIgnore(object oTarget) +{ + SetLocalInt(oTarget, AI_IGNORE_TOGGLE, TRUE); +} +int GetIgnore(object oTarget) +{ + return GetLocalInt(oTarget, AI_IGNORE_TOGGLE); +} +int GetIgnoreNoFriend(object oTarget) +{ + if(GetLocalInt(oTarget, AI_IGNORE_TOGGLE) || GetFactionEqual(oTarget) || + GetIsDM(oTarget) || GetIsDead(oTarget)) + { + return TRUE; + } + return FALSE; +} +/*:://///////////////////////////////////////////// +//:: Name: SetLocalConstant, GetLocalConstant +//:://///////////////////////////////////////////// + Sets a constant (from nwscript.nss) +//::////////////////////////////////////////////*/ +void SetAIConstant(string sName, int iConstant) +{ + SetLocalInt(OBJECT_SELF, AI_CONSTANT + sName, iConstant + i1); +} +int GetAIConstant(string sName) +{ + return GetLocalInt(OBJECT_SELF, AI_CONSTANT + sName) - i1; +} +void DeleteAIConstant(string sName) +{ + DeleteLocalInt(OBJECT_SELF, AI_CONSTANT + sName); +} +/*:://///////////////////////////////////////////// +//:: Name: SetAIInteger, GetAIInteger +//:://///////////////////////////////////////////// + To stop local's going awary, we set them with pre-fixes. +//::////////////////////////////////////////////*/ +void SetAIInteger(string sName, int iValue) +{ + SetLocalInt(OBJECT_SELF, AI_INTEGER + sName, iValue); +} +int GetAIInteger(string sName) +{ + return GetLocalInt(OBJECT_SELF, AI_INTEGER + sName); +} +int GetBoundriedAIInteger(string sName, int iDefault, int iTop, int iBottom) +{ + int iReturn = GetAIInteger(sName); + // Boundries + if(iReturn < iBottom || iReturn > iTop) + { + iReturn = iDefault; + } + return iReturn; +} +void J_DeleteAIInteger(string sName) +{ + DeleteLocalInt(OBJECT_SELF, AI_INTEGER + sName); +} +/*:://///////////////////////////////////////////// +//:: Name: SetAIObject, GetAIObject +//:://///////////////////////////////////////////// + To stop local's going awary, we set them with pre-fixes. +//::////////////////////////////////////////////*/ +void SetAIObject(string sName, object oObject) +{ + SetLocalObject(OBJECT_SELF, AI_OBJECT + sName, oObject); +} +object GetAIObject(string sName) +{ + return GetLocalObject(OBJECT_SELF, AI_OBJECT + sName); +} +void DeleteAIObject(string sName) +{ + DeleteLocalObject(OBJECT_SELF, AI_OBJECT + sName); +} + +/*:://///////////////////////////////////////////// +//:: Name: FireUserEvent +//:://///////////////////////////////////////////// +// Fires a User Defined Event. +// * iSpawnValue - The spawn value (like NW_FLAG_PERCIEVE_PRE_EVENT) +// * iNumber - The number to fire (like EVENT_PERCIEVE_PRE_EVENT) +// Returns TRUE if the event fires. +//::////////////////////////////////////////////*/ +int FireUserEvent(int iSpawnValue, int iNumber) +{ + // Check spawn in condition + if(GetSpawnInCondition(iSpawnValue, AI_UDE_MASTER)) + { + // Signal event (and return TRUE) + SignalEvent(OBJECT_SELF, EventUserDefined(iNumber)); + return TRUE; + } + return FALSE; +} +/*:://///////////////////////////////////////////// +//:: Name: SetToExitFromUDE +//:://///////////////////////////////////////////// +// This sets to exit the script. Use in the defaultd (On User Defined) file. +// For example: We want to not attack PC's with the item "ROCK" (Tag). We +// therefore use the event EVENT_PERCIEVE_PRE_EVENT to exit if they have that item +// because we go friendly to them. +// * iNumber - The user defined number to exit from. +//::////////////////////////////////////////////*/ +void SetToExitFromUDE(int iNumber) +{ + SetLocalInt(OBJECT_SELF, EXIT_UDE_PREFIX_ + IntToString(iNumber), TRUE); +} +/*:://///////////////////////////////////////////// +//:: Name: ExitFromUDE +//:://///////////////////////////////////////////// +// This is used for Pre-events. If we exit from EVENT_PERCIEVE_PRE_EVENT, and +// use SetToExitFromUDE, this returns TRUE (ONCE!) +// * iNumber - The user defined number to exit from. +//::////////////////////////////////////////////*/ +int ExitFromUDE(int iNumber) +{ + // Set up string to delete/check + string sCheck = EXIT_UDE_PREFIX_ + IntToString(iNumber); + // Check local value + if(GetLocalInt(OBJECT_SELF, sCheck)) + { + // Delete if valid (not equal to one) and return TRUE to exit + DeleteLocalInt(OBJECT_SELF, sCheck); + return TRUE; + } + return FALSE; +} + +/*:://///////////////////////////////////////////// +//:: Name: GetIsFighting, GetIsBusyWithAction, CanPerformCombatRound +//:://///////////////////////////////////////////// +// Busy things - are we doing an action we don't want to override with ClearAllActions? +// Checks them here. +//::////////////////////////////////////////////*/ + +// We check if we are attacking anything +// * Checks Attempted* Targets, Get the AttackTarget of us. +// * Checks GetIsInCombat at the end. If that is TRUE, we should be doing proper rounds anyway. +int GetIsFighting() +{ + // Do we already have a target? + if(GetIsObjectValid(GetAttackTarget()) || + GetIsObjectValid(GetAttemptedAttackTarget()) || + GetIsObjectValid(GetAttemptedSpellTarget())) + { + return TRUE; + } + // Final check. Are we in combat? + return GetIsInCombat(); +} +// We check if we can perform a combat action currently. +// * Checks our action list. Some things like skills, opening doors and so on +// we don't want to interrupt before they are done. +// * Also used within DetermineCombatRound +int GetIsBusyWithAction() +{ + // Set up actions. + int iAction = GetCurrentAction(); + // Common dropout ones to speed it up. + if(iAction == ACTION_INVALID || + iAction == ACTION_WAIT || + iAction == ACTION_FOLLOW || + iAction == ACTION_MOVETOPOINT || + iAction == ACTION_DIALOGOBJECT || + iAction == ACTION_REST || + iAction == ACTION_USEOBJECT || + iAction == ACTION_COUNTERSPELL || + iAction == ACTION_DISABLETRAP || + iAction == ACTION_EXAMINETRAP || + iAction == ACTION_FLAGTRAP || + iAction == ACTION_RECOVERTRAP) + { + return FALSE; + } + else + if(iAction == ACTION_ATTACKOBJECT)// Very common. Could be a door as well as a creature! + { + // This is a special thing...if we are attacking a non-creature, we + // return FALSE anyway, to attack the creature. + + // Therefore, if we are attacking a creature though, we return TRUE as + // we do not want to change objects. :-P + int iAttackObjectType = GetObjectType(GetAttackTarget()); + // Note: as this returns -1 on error, its easier to just use an if/else + // checking the integers, with a -1 dropout. + if(iAttackObjectType != -1) + { + // We never stop attacking one creature + if(iAttackObjectType == OBJECT_TYPE_CREATURE) + { + return TRUE; + } + // we may stop attacking a door if we are not fleeing though + // But if we are attacking a door and fleeing, don't react. + else if(iAttackObjectType == OBJECT_TYPE_DOOR && + !GetIsObjectValid(GetAIObject(AI_FLEE_TO))) + { + return TRUE; + } + } + } + // We are opening a door... (or unlocking one) + else + if(iAction == ACTION_OPENDOOR || // Opening a door! + iAction == ACTION_OPENLOCK) // The AI only unlocks doors + { + // It may be that we want to always unlock doors and open them as we + // are fleeing. + if(!GetIsObjectValid(GetAIObject(AI_FLEE_TO))) + { + return TRUE; + } + } + // If we are using a cirtain skill or similar, don't try and attack. + else + if(iAction == ACTION_ANIMALEMPATHY || // An "attack" skill we use + iAction == ACTION_CASTSPELL || // Casting a spell shouldn't be interrupted. + iAction == ACTION_HEAL || // Heal skill. A very important way to heal and not to override + iAction == ACTION_ITEMCASTSPELL || // Scrolls, potions ETC. + iAction == ACTION_LOCK || // Won't be used. Added for completeness. + iAction == ACTION_PICKPOCKET || // Sometimes used in combat. Nifty! + iAction == ACTION_PICKUPITEM || // We may be picking up lost weapons (disarmed ones) + iAction == ACTION_SETTRAP || // Can't seem to work it :-/ Well, here for completeness + iAction == ACTION_TAUNT) // Taunt shouldn't be interrupted. + { + return TRUE; + } + return FALSE; +} +// This checks GetIsFighting and GetIsBusyWithAction, returns FALSE if we can +// do a combat round (IE we don't have anything to interrupt and are not already +// in combat!) +// * IE it adds GetIsBusyWithAction with GetIsFighting to give 0, 1 or 2. +// * Checks if we are fleeing too +int CannotPerformCombatRound() +{ + return GetIsPerformingSpecialAction() + GetIsBusyWithAction() + GetIsFighting(); +} + +// This will SpeakString a value from sName's array. i1000 uses a d1000 for % chance +void SpeakArrayString(string sName, int i1000 = FALSE) +{ + // Need a valid array (arrays of 1 are just that - 1 value to choose from.) + int iSize = GetLocalInt(OBJECT_SELF, ARRAY_SIZE + sName); + if(iSize > i0) + { + // Make sure we are not dead (unless we should be) + if(sName != AI_TALK_ON_DEATH) + { + if(GetIsDead(OBJECT_SELF)) return; + } + // Do we carry on? + int iCarryOn = FALSE; + if(i1000 == TRUE) + { + // Do the % check now. Values 1-1000 randomised. + if((Random(1000) + i1) <= GetLocalInt(OBJECT_SELF, ARRAY_PERCENT + sName)) iCarryOn = TRUE; + } + else + { + // 100 normal one. + if(d100() <= GetLocalInt(OBJECT_SELF, ARRAY_PERCENT + sName)) iCarryOn = TRUE; + } + if(iCarryOn) + { + int iRandomOne = i1; + if(iSize > i1) + { + // Randomise - we add one, so instead of 0-2 (for 3 values) it goes 1-3. + iRandomOne = Random(iSize) + i1; + } + // Now, to choose one... + string sSpeak = GetLocalString(OBJECT_SELF, sName + IntToString(iRandomOne)); + // And speak! + // - Added random delay for 0.1 to 1.2 seconds to add some variety, + // if it is used for n1000 + if(sSpeak != "") + { + // Code sorta taken from NW_I0_Spells, the random stuff. + // FloatToInt(15);/FloatToInt(fRandom * 10.0); + if(i1000 == TRUE) + { + float fDelay = IntToFloat(Random(15) + 1) / 10.0; + DelayCommand(fDelay, SpeakString(sSpeak)); + } + else + { + // Speak instantly. + SpeakString(sSpeak); + } + } + } + } +} +// Used in Search(). This apply Trueseeing, See invisibility, or Invisiblity purge +// if we have neither of the 3 on us. +void SearchSpells() +{ + effect eCheck = GetFirstEffect(OBJECT_SELF); + int iEffectType, iBreak; + while(GetIsEffectValid(eCheck) && iBreak == FALSE) + { + iEffectType = GetEffectType(eCheck); + if(iEffectType == EFFECT_TYPE_TRUESEEING || + iEffectType == EFFECT_TYPE_SEEINVISIBLE) + { + iBreak = TRUE; + } + eCheck = GetNextEffect(OBJECT_SELF); + } + // We have effects, stop. + if(iBreak == TRUE && !GetHasSpellEffect(SPELL_INVISIBILITY_PURGE)) + { + return; + } + // Else we apply the best spell we have. + if(GetHasSpell(SPELL_TRUE_SEEING)) + { + ActionCastSpellAtObject(SPELL_TRUE_SEEING, OBJECT_SELF); + return; + } + if(GetHasSpell(SPELL_SEE_INVISIBILITY)) + { + ActionCastSpellAtObject(SPELL_SEE_INVISIBILITY, OBJECT_SELF); + return; + } + if(GetHasSpell(SPELL_INVISIBILITY_PURGE)) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY_PURGE, OBJECT_SELF); + return; + } +} +// This is used in combat (at the end thereof) and when something shouts, and is a placeable. +// * oTarget - The target which may have shouted, or similar. Moves to and closes normally. +// If no oTarget, it still searches +void Search(object oTarget = OBJECT_INVALID) +{ + if(GetIsObjectValid(GetAttemptedSpellTarget()) || + GetIsObjectValid(GetAttemptedAttackTarget()) || + GetIsObjectValid(GetAttackTarget()) || + GetLocalTimer(AI_TIMER_SEARCH)) + { + return; + } + else + { + // Stop now + ClearAllActions(); + // Rest after combat? + if(GetSpawnInCondition(AI_FLAG_OTHER_REST_AFTER_COMBAT, AI_OTHER_MASTER)) + { + // 71: "[Search] Resting" + DebugActionSpeakByInt(71); + ForceRest(OBJECT_SELF); + ActionWait(f1); + } + // Determine the amount of time to search if there is antone else around. + int iIntelligence = GetBoundriedAIInteger(AI_INTELLIGENCE, i10, i10, i1); + float fTime = IntToFloat(iIntelligence * i3); + // Set local timer for a minimum of 4 seconds + SetLocalTimer(AI_TIMER_SEARCH, f4); + // Check some spells. Cast one if we have no true seeing ETC. + SearchSpells(); + // Stealth/search. + int iStealth = GetStealthMode(OBJECT_SELF); + int iSearch = GetDetectMode(OBJECT_SELF); + // We perfere to hide again if we search if set to...sneaky! + if(GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_HIDING, AI_OTHER_COMBAT_MASTER)) + { + if(iStealth != STEALTH_MODE_ACTIVATED) + { + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE); + } + } + else + { + // If we are hiding, stop to search (we shouldn't be - who knows?) + if(iStealth == STEALTH_MODE_ACTIVATED) + { + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, FALSE); + } + // And search! + if(iSearch != DETECT_MODE_ACTIVE && !GetHasFeat(FEAT_KEEN_SENSE)) + { + SetActionMode(OBJECT_SELF, ACTION_MODE_DETECT, TRUE); + } + } + // We check around the target, if there is one. + if(GetIsObjectValid(oTarget)) + { + ActionMoveToLocation(GetLocation(oTarget)); + // If it is a chest ETC. We close it. + if(GetIsOpen(oTarget)) + { + if(GetObjectType(oTarget) == OBJECT_TYPE_DOOR) + { + ActionCloseDoor(oTarget); + } + else + { + // Close it + ActionDoCommand(DoPlaceableObjectAction(oTarget, PLACEABLE_ACTION_USE)); + } + } + } + // We will get nearest enemy at the very least + else + { + // Use nearest heard + object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, + OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD); + if(GetIsObjectValid(oEnemy)) + { + // Move to location + ActionMoveToLocation(GetLocation(oEnemy)); + } + } + // Note: Here, we will return to spawn location after moving to the + // object, if it is a valid setting, else we do the normal randomwalk + if(GetSpawnInCondition(AI_FLAG_OTHER_RETURN_TO_SPAWN_LOCATION, AI_OTHER_MASTER)) + { + ActionMoveToLocation(GetLocalLocation(OBJECT_SELF, AI_RETURN_TO_POINT)); + } + else + { + // 72: "[Search] Searching, No one to attack. [Time] " + FloatToString(fTime, i3, i2) + DebugActionSpeakByInt(72, OBJECT_INVALID, FALSE, FloatToString(fTime, i3, i2)); + // Randomly walk. + ActionRandomWalk(); + // Clear all actions stops Random Walk + DelayCommand((fTime - f1), ClearAllActions()); + // Delay a 30 second walk waypoints (which stops ActionRandomWalk). + DelayCommand(fTime, ExecuteScript(FILE_WALK_WAYPOINTS, OBJECT_SELF)); + } + } +} + +// Returns our custom AI file (if any) +// - Blank string if not set +string GetCustomAIFileName() +{ + return GetLocalString(OBJECT_SELF, AI_CUSTOM_AI_SCRIPT); +} +// Sets our custom AI file +// - Needs a 16 or less character string +// - Should execute actions +// - Can sort actions against a imputted target (EG: On Percieved enemy) by +// "GetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET)" +void SetCustomAIFileName(string sAIFileName) +{ + SetLocalString(OBJECT_SELF, AI_CUSTOM_AI_SCRIPT, sAIFileName); +} + +/*:://///////////////////////////////////////////// +//:: Name: DetermineCombatRound +//:://///////////////////////////////////////////// + This is still used - we just set a local object and execute script. + Argument - iCustom = Custom Files, so we determine not with default3 +//:://///////////////////////////////////////////*/ +void DetermineCombatRound(object oTarget = OBJECT_INVALID) +{ + // Check for custom AI script, else fire default. + string sAI = GetCustomAIFileName(); + // Fire default AI script + if(sAI == "") + { + // Sanity check - to not fire this off multiple times, we make sure temp + // object is not the same as oTarget (and valid) + if(!GetIsObjectValid(oTarget) || (GetIsObjectValid(oTarget) && + !GetLocalTimer(AI_DEFAULT_AI_COOLDOWN))) + { + // 73: "[Call for DCR] Default AI [Pre-Set Target]" + GetName(oTarget) + DebugActionSpeakByInt(73, oTarget); + SetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET, oTarget); + ExecuteScript(COMBAT_FILE, OBJECT_SELF); + SetLocalTimer(AI_DEFAULT_AI_COOLDOWN, 0.1); + } + } + // Fire custom AI script + else + { + SetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET, oTarget); + // 74: "[Call for DCR] Custom AI [" + sAI + "] [Pre-Set Target]" + GetName(oTarget) + DebugActionSpeakByInt(74, oTarget, FALSE, sAI); + // Execute it + ExecuteScript(sAI, OBJECT_SELF); + } +} + + +// This checks the current special action (fleeing, runner, door smashing) +// - Returns FALSE if none of them are performed +// Use this to make sure that an ActionMoveTo or DCR doesn't fire if we are fleeing. +int GetIsPerformingSpecialAction() +{ + int iAction = GetCurrentSetAction(); + object oTarget = GetAttackTarget(); + object oRunTarget; + switch(iAction) + { + case AI_SPECIAL_ACTIONS_ME_RUNNER: + { + oRunTarget = GetAIObject(AI_RUNNER_TARGET); + if(GetIsObjectValid(oRunTarget)) + { + if(GetObjectSeen(oRunTarget)) + { + // Stop thinking we are a runner if we can see the run target + ResetCurrentAction(); + } + else + { + // Else we are running to the + return TRUE; + } + } + } + break; + case AI_SPECIAL_ACTIONS_FLEE: + { + oRunTarget = GetAIObject(AI_FLEE_TO); + if(GetIsObjectValid(oRunTarget)) + { + if(GetObjectSeen(oRunTarget)) + { + // If we see the flee target, reset targets + ResetCurrentAction(); + } + else + { + // Else flee! + return TRUE; + } + } + else + { + // Check if we have bad intellgence, and we will run away + // from the nearest enemy if heard. + if(GetAIInteger(AI_INTELLIGENCE) <= i3) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetLastHostileActor(); + if(!GetIsObjectValid(oRunTarget) || GetIsDead(oRunTarget)) + { + ResetCurrentAction(); + return FALSE; + } + } + } + // Running from enemy + return TRUE; + } + ResetCurrentAction(); + } + } + break; + case AI_SPECIAL_ACTIONS_MOVE_OUT_OF_AOE: + { + // We must be X distance away from a cirtain AOE, if we are not, we + // move. + oRunTarget = GetAIObject(AI_AOE_FLEE_FROM); + + // If not valid, or already far enough away, delete special action + // and return false. + if(!GetIsObjectValid(oRunTarget) || + GetLocalFloat(OBJECT_SELF, AI_AOE_FLEE_FROM_RANGE) < GetDistanceToObject(oRunTarget)) + { + ResetCurrentAction(); + } + else + { + // Valid and still in range + return TRUE; + } + } + break; + } + // Return false to carry on a normal DCR or move to enemy. + return FALSE; +} + +// This will, if we are set that we can, shout the string. +void AISpeakString(string sString) +{ + // Spawn condition to turn it off. + if(!GetSpawnInCondition(AI_FLAG_OTHER_DONT_SHOUT, AI_OTHER_MASTER)) + { + // Silent talk = "DebugMode 1" only can see, is the "talk" version of the DM + // channel. + SpeakString(sString, TALKVOLUME_SILENT_TALK); + } +} +// Debug: To compile this script full, uncomment all of the below. +/* - Add two "/"'s at the start of this line +void main() +{ + return; +} +//*/ diff --git a/nwnds_module/j_inc_debug.nss b/nwnds_module/j_inc_debug.nss new file mode 100644 index 000000000..802ab9c7a --- /dev/null +++ b/nwnds_module/j_inc_debug.nss @@ -0,0 +1,188 @@ +/************************ [Debug] ********************************************** + Filename: J_Inc_Debug +************************* [Debug] ********************************************** + This contains DebugActionSpeak, the debug function. + + Makes it easier to uncomment debug lines. +************************* [History] ******************************************** + 1.3 - Added +************************* [Workings] ******************************************* + DebugActionSpeak normally writes a timestamped log entry, and speak a silent + string Server Admins can hear. + + To Do: Might make it more generic debug lines, where you can uncomment all + "XX" lines HERE, not in the files, so it compiles without them, and only + need an integer to speak one. + + 1.3 added: + - DebugActionSpeakByInt(int iInteger); + - Removes many strings into this file + - Can easily comment out all string so they are not added to compiled + scripts if debugging unused (This saves space on compiled files :-D ) + - Always uncomment the right bits if not using any debugging. +************************* [Arguments] ****************************************** + Arguments: N/A +************************* [Debug] *********************************************/ + +// This will speak a cirtain integer number string (similar to a dialog reference). +// - I (Jass) have just moved all strings I used all the time into here, so +// if the strings are uncommented, they will not be compiled +// - The numbers have no reference to much really. +// - Calls DebugActionSpeak! +// - See J_INC_DEBUG to uncomment/recomment in +void DebugActionSpeakByInt(int iInteger, object oInput = OBJECT_INVALID, int iInput = FALSE, string sInput = ""); + +// Speaks and stamps a debug string. +// - See J_INC_DEBUG to uncomment/recomment the debug strings. +// - Only used in special circumstances. +void DebugActionSpeak(string sString); + +// This will speak a cirtain integer number string (similar to a dialog reference). +// - I (Jass) have just moved all strings I used all the time into here, so +// if the strings are uncommented, they will not be compiled +// - The numbers have no reference to much really. +// - Calls DebugActionSpeak! +// - See J_INC_DEBUG to uncomment/recomment in +void DebugActionSpeakByInt(int iInteger, object oInput = OBJECT_INVALID, int iInput = FALSE, string sInput = "") +{ + // TO UNCOMMENT/COMMENT: + // - Add/Remove in "//" before the next lines "/*" + // - Recompile all files + + /* + + string sDebug; + switch(iInteger) + { + // - Generic AI stuff + case 1: sDebug = "[DCR:Melee] Most Damaging Weapon. Target: " + GetName(oInput); break; + case 2: sDebug = "[DCR:Melee] Most Damaging as Not Effective"; break; + case 3: sDebug = "[DCR:Melee] Melee Code. No valid melee target/Dead. Exiting"; break; + case 4: sDebug = "[DCR:Melee] Melee attack. [Target] " + GetName(oInput) + " [Feat/Attack] " + IntToString(iInput); break; + case 5: sDebug = "[DCR:Caster] Defensive Casting Mode ON [Enemy] " + GetName(oInput); break; + case 6: sDebug = "[DCR:Caster] Moving away from AOO's. [Enemy] " + GetName(oInput); break; + case 7: sDebug = "[DCR:Casting] Talent(item) [TalentID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 8: sDebug = "[DCR:Casting] Workaround for Spontaeous [SpellID] " + IntToString(iInput) + " [Target] " + GetName(oInput); break; + case 9: sDebug = "[DCR:Casting] NormalSpell [ID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 10: sDebug = "[DCR:Casting] TalentSpell. [ID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 11: sDebug = "[DCR:Casting] SubSpecialSpell. [ID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 12: sDebug = "[DCR:Casting] NormalRandomSpell. [ID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 13: sDebug = "[DCR:Casting] Backup spell caught: " + IntToString(iInput); break; + case 14: sDebug = "[DCR:Feat] [ID] " + IntToString(iInput) + " [Enemy] " + GetName(oInput); break; + case 15: sDebug = "[DCR:Casting] Grenade [ID] " + IntToString(iInput) + " [Target] " + GetName(oInput) + " [Location] " + sInput; break; + case 16: sDebug = "[AOE Call] Moving out of/Dispeling an AOE. [Tag] " + GetTag(oInput); break; + case 17: sDebug = "[DCR:Special] Darkness + Caster. No seen enemy. Dispel/Move."; break; + case 18: sDebug = "[DRC:Talent] Using Talent (Healing). [TalentID] " + IntToString(iInput) + " [Target] " + GetName(oInput); break; + case 19: sDebug = "[DCR:Healing] (Should) Healing [Target]" + GetName(oInput) + " [CurrentHP|Max|ID|Rank|Power] " + IntToString(iInput); break; + case 20: sDebug = "[DCR Healing] Boss Action, create Critical Wounds potion"; break; + case 21: sDebug = "[DCR:Casting] Healing self with healing kit, [Kit] " + GetName(oInput); break; + case 22: sDebug = "[DCR:Feat] Summoning my familiar"; break; + case 23: sDebug = "[DCR:Feat] Summoning my animal companion"; break; + case 24: sDebug = "[DCR:Fleeing] Stupid/Panic/Flee moving from enemies/position - We are a commoner/no morale/failed < 3 int"; break; + case 25: sDebug = "[DCR:Fleeing] Fleeing to allies. [ID Array] " + sInput + " [Ally] " + GetName(oInput); break; + case 26: sDebug = "[DCR:GFTK] Attacking a PC who is dying/asleep! [Enemy]" + GetName(oInput); break; + case 27: sDebug = "[DCR:Moving] Archer Retreating back from the enemy [Enemy]" + GetName(oInput); break; + case 28: sDebug = "[DCR:Turning] Using Turn Undead"; break; + case 29: sDebug = "[DCR:Bard Song] Using"; break; + case 30: sDebug = "[DCR:Bard Curse Song] Using"; break; + case 31: sDebug = "[DCR:All Spells] Error! No casting (No spells, items, target Etc)."; break; + case 32: sDebug = "[DCR:All Spells] [Modifier|BaseDC|SRA] " + IntToString(iInput); break; + case 33: sDebug = "[DCR:Casting] Cheat Spell. End of Spells. [Spell] " + IntToString(iInput) + "[Target]" + GetName(oInput); break; + case 34: sDebug = "[DCR:All Spells] Ranged Spells. Should use closer spells/move nearer"; break; + case 35: sDebug = "[DCR:Dragon] Breath weapon & attacking [Breath ID] " + IntToString(iInput) + " [Target] " + GetName(oInput); break; + case 36: sDebug = "[DCR:Dragon] Wing Buffet [Target] " + GetName(oInput); break; + case 37: sDebug = "[DCR:Beholder] Teleport"; break; + case 38: sDebug = "[DCR:Beholder] Rays"; break; + case 39: sDebug = "[DCR:Targeting] No valid enemies in sight, moving to allies target's. [Target] " + GetName(oInput); break; + case 40: sDebug = "[DCR:Targeting] Override Target Seen. [Name]" + GetName(oInput); break; + case 41: sDebug = "[DCR:Targeting] No seen in LOS, Attempting to MOVE to something [Target]" + GetName(oInput); break; + case 42: sDebug = "[DCR:Skill] Using agressive skill (+Attack). [Skill] " + IntToString(iInput) + " [Enemy]" + GetName(oInput); break; + case 43: sDebug = "[DCR:Pre-Melee Spells] All Potions Using. [Spell ID] " + IntToString(iInput); break; + case 44: sDebug = "[DCR:Pre-Melee Spells] True Strike Emptive attack [Target] " + GetName(oInput); break; + case 45: sDebug = "[DCR:CounterSpell] Counterspelling. [Target] " + GetName(oInput); break; + case 46: sDebug = "[DRC] START [Intruder]" + GetName(oInput); break; + case 47: sDebug = "[DCR] [PREMITURE EXIT] Cannot Do Anything."; break; + case 48: sDebug = "[DCR] [PREMITURE EXIT] Dazed move away."; break; + case 49: sDebug = "[DCR] [PREMITURE EXIT] Fleeing or otherwise"; break; + case 50: sDebug = "[DRC] END - DELETE PAST TARGETS"; break; + // Perception + case 51: sDebug = "[Perception] Our Enemy Target changed areas. Stopping, moving too...and attack... [Percieved] " + GetName(oInput); break; + case 52: sDebug = "[Perception] Enemy Vanished (Same area) Retargeting/Searching [Percieved] " + GetName(oInput); break; + case 53: sDebug = "[Perception] Enemy seen, and was old enemy/cannot see current. Re-evaluating (no spell) [Percieved] " + GetName(oInput); break; + case 54: sDebug = "[Perception] Enemy Seen. Not in combat, attacking. [Percieved] " + GetName(oInput); break; + case 55: sDebug = "[Perception] Percieved Dead Friend! Moving and Searching [Percieved] " + GetName(oInput); break; + case 56: sDebug = "[Perception] Percieved Alive Fighting Friend! Moving to and attacking. [Percieved] " + GetName(oInput); break; + // Conversation + case 57: sDebug = "[Shout] Friend (may be PC) in combat. Attacking! [Friend] " + GetName(oInput); break; + case 58: sDebug = "[Shout] Responding to shout [Enemy] " + GetName(oInput) + " Who has spoken!"; break; + // Phisical Attacked + case 59: sDebug = "[Phisically Attacked] Attacking back. [Attacker(enemy)] " + GetName(oInput); break; + case 60: sDebug = "[Phisically Attacked] Not same area. [Attacker(enemy)] " + GetName(oInput); break; + // Damaged + case 61: sDebug = "[Damaged] Morale Penalty for 600 seconds [Penalty]" + IntToString(iInput); break; + case 62: sDebug = "[Damaged] Not in combat: DCR [Damager]" + GetName(oInput); break; + case 63: sDebug = "[Damaged] Not in combat: DCR. Ally hit us. [Damager(Ally?)]" + GetName(oInput); break; + // Death + case 64: sDebug = "[Death] Checking corpse status in " + IntToString(iInput) + " [Killer] " + GetName(oInput) + " [Times Died Now] " + sInput; break; + // Disturbed + case 65: sDebug = "[Disturbed] (pickpocket) Attacking Enemy [Disturber] " + GetName(oInput) + " [Type] " + IntToString(iInput); break; + // Rest + case 66: sDebug = "[Rested] Resting. [Type(should be invalid)] " + IntToString(iInput); break; + // Spell Cast at + case 67: sDebug = "[Spell] Caster isn't a creature! May look for target [Caster] " + GetName(oInput); break; + case 68: sDebug = "[Spell:Enemy/Hostile] Not in combat. Attacking: [Caster] " + GetName(oInput); break; + case 69: sDebug = "[Spell] (ally). Not in combat. May Attack/Move [Caster] " + GetName(oInput); break; + // Spell Other AI + // - Shouts + case 70: sDebug = "[Shout] Reacting To Shout. [ShoutNo.] " + IntToString(iInput) + " [Shouter] " + GetName(oInput); break; + // Constants + // - Search + case 71: sDebug = "[Search] Resting"; break; + case 72: sDebug = "[Search] Searching, No one to attack. [Time] " + sInput; break; + // - DCR + case 73: sDebug = "[Call for DCR] Default AI [Pre-Set Target]" + GetName(oInput); break; + case 74: sDebug = "[Call for DCR] Custom AI [" + sInput + "] [Pre-Set Target]" + GetName(oInput); break; + // Destroy self + case 75: sDebug = "[Dead] Setting to selectable/destroyable (so we go) for Bioware corpses."; break; + case 76: sDebug = "[Dead] Destroying self finally."; break; + // Waypoints + case 77: sDebug = "[Waypoints] Returning to spawn location. [Area] " + GetName(oInput); break; + + default: return; break; + } + if(sDebug != "") + { + DebugActionSpeak(sDebug); + } + // */ +} + +void DebugActionSpeak(string sString) +{ +// You MUST uncomment this line, IF you use either of the below things + //string sNew = "[Debug]" + GetName(OBJECT_SELF) + "[ObjectID]" + ObjectToString(OBJECT_SELF) + " [Debug] " + sString; + +// Note, uncomment this, so that DM's can hear the debug speaks, normally it is +// only server admins who can hear the debug. If you are not testing, it might +// be best to keep this uncommented. +// Futher: - Must have debug mode set to 1 +// - Only the server admin can seem to see this. + //SpeakString(sNew, TALKVOLUME_SILENT_TALK); + +// Note, uncomment this line to send a message to the first PC in the module. +// - Useful for singleplayer testing + //SendMessageToPC(GetFirstPC(), sNew); + +// This writes the entry to the log, very important, if debugging +// Futher: - If left up for a long time, logs can get very big with the AI +// - Use to find problems in the AI and report to me :-D (Jasperre) + //WriteTimestampedLogEntry(sNew); +} + +// Debug: To compile this script full, uncomment all of the below. +/* +void main() +{ + DebugActionSpeak("Test"); +} +*/ diff --git a/nwnds_module/j_inc_heartbeat.nss b/nwnds_module/j_inc_heartbeat.nss new file mode 100644 index 000000000..fa00cfcb9 --- /dev/null +++ b/nwnds_module/j_inc_heartbeat.nss @@ -0,0 +1,277 @@ +/************************ [Heartbeat Include] ********************************** + Filename: J_Inc_Heartbeat +************************* [Heartbeat Include] ********************************** + This contains any heartbeat function calls. + + Note that the heartbeat uses ExecuteScript for larget behaviours that are + better split up so the heartbeat is as tiny as possible. +************************* [History] ******************************************** + 1.3 After Beta - Added +************************* [Workings] ******************************************* + This is included in nw_c2_default1 and j_ai_onheartbeat. + + Contains things like in j_inc_other_ai +************************* [Arguments] ****************************************** + Arguments: N/A +************************* [Heartbeat Include] *********************************/ + +#include "J_INC_CONSTANTS" + +// Bioware walk waypoints condition name +const string sWalkwayVarname = "NW_WALK_CONDITION"; +// Walk waypoint constant set in the SoU waypoint include +const int NW_WALK_FLAG_CONSTANT = 0x00000002; + +// Checks: +// * Dead +// * Uncommandable +// * No valid location +// * Petrified, paralised, ETC. +// Note: If sleep is found, it may apply Zzzz randomly, as well as stopping. +int JumpOutOfHeartBeat(); + +// This checks fleeing, door bashing and so on, to stop the heartbeat +// and perform the override special action, rather then run normal behaviour. +int PerformSpecialAction(); + +// Get whether the condition is set +// * Bioware SoU Waypoint call. +int GetWalkCondition(int nCondition, object oCreature=OBJECT_SELF); + +// Cast fleeing spells. +// - Invisiblity (best) +// - Haste/Expeditious Retreat +void ActionCastFleeingSpells(); + +// Attempt to cast iSpell. TRUE if true. +int FleeingSpellCast(int iSpell); + +int JumpOutOfHeartBeat() +{ + // What to return + int iReturn = FALSE; + // Checks: + // * Dead + Uncommandable are in GetAIOff + // * No valid location + // * Petrified, paralised, ETC. + // Note: If sleep is found, it may apply Zzzz randomly, as well as stopping. + + // Effect checking + effect eCheck = GetFirstEffect(OBJECT_SELF); + int iEffectType; + while(GetIsEffectValid(eCheck) && iReturn == FALSE) + { + iEffectType = GetEffectType(eCheck); + // Sleep is special + if(iEffectType == EFFECT_TYPE_SLEEP) + { + iReturn = i2;// This immediantly breaks. + } + // ALL these stop heartbeat. + else if(iEffectType == EFFECT_TYPE_PARALYZE || iEffectType == EFFECT_TYPE_STUNNED || + iEffectType == EFFECT_TYPE_FRIGHTENED || /* Removed sleep above */ + iEffectType == EFFECT_TYPE_TURNED || iEffectType == EFFECT_TYPE_PETRIFY || + iEffectType == EFFECT_TYPE_DAZED || iEffectType == EFFECT_TYPE_TIMESTOP || + iEffectType == EFFECT_TYPE_DISAPPEARAPPEAR || iEffectType == EFFECT_TYPE_CHARMED || + iEffectType == EFFECT_TYPE_DOMINATED || iEffectType == EFFECT_TYPE_CONFUSED) + { + iReturn = i1;// 1 = No Zzz. We continue to check for Zzz as well. + } + eCheck = GetNextEffect(OBJECT_SELF); + } + // Do we fire the heartbeat event? + if(iReturn != FALSE) + { + // If it is sleep... Zzzzz sometimes. + if(iReturn == i2 && d6() == i1) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, + EffectVisualEffect(VFX_IMP_SLEEP), + OBJECT_SELF); + } + FireUserEvent( + AI_FLAG_UDE_HEARTBEAT_EVENT, + EVENT_HEARTBEAT_EVENT);// Fire event 1001 + } + return iReturn; +} + +// This checks fleeing, door bashing and so on, to stop the heartbeat +// and perform the override special action, rather then run normal behaviour. +int PerformSpecialAction() +{ + int iAction = GetCurrentSetAction(); + object oTarget = GetAttackTarget(); + object oRunTarget; + switch(iAction) + { + // - Leader has made me a runner. I must run to a nearby group calling + // for help to get more men + case AI_SPECIAL_ACTIONS_ME_RUNNER: + { + oRunTarget = GetAIObject(AI_RUNNER_TARGET); + if(GetIsObjectValid(oRunTarget)) + { + if(GetObjectSeen(oRunTarget)) + { + // Stop thinking we are a runner if we can see the run target + ResetCurrentAction(); + AISpeakString(HELP_MY_FRIEND); + return FALSE; + } + else + { + // Else run to them + if(GetObjectHeard(oRunTarget)) + { + AISpeakString(HELP_MY_FRIEND); + } + ClearAllActions(); + ActionMoveToObject(oRunTarget, TRUE); + return TRUE; + } + } + } + break; + // - I am fleeing. + case AI_SPECIAL_ACTIONS_FLEE: + { + oRunTarget = GetAIObject(AI_FLEE_TO); + if(GetIsObjectValid(oRunTarget)) + { + // If they are a leader, and seen, and they are running, we + // obviously follow only. + if(GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_GROUP_LEADER, AI_OTHER_COMBAT_MASTER, oRunTarget) || + GetLocalInt(oRunTarget, AI_CURRENT_ACTION) == AI_SPECIAL_ACTIONS_FLEE) + { + ClearAllActions(); + // New - cast fleeing spells. Important (and only used + // at higher intelligence) things like Expeditious retreat. + // - Only used once - one invisibility or haste. Deleted above. + ActionCastFleeingSpells(); + ActionForceFollowObject(oRunTarget, f3); + } + else if(GetObjectSeen(oRunTarget)) + { + // If we see the flee target, reset targets + ResetCurrentAction(); + // We will delete the local int (set to TRUE) which we + // stopped fleeing spells from + DeleteAIInteger(AI_HEARTBEAT_FLEE_SPELLS); + // Speak to allies to come :-) + AISpeakString(HELP_MY_FRIEND); + // Return FALSE. + return FALSE; + } + else + { + // Else flee! + if(GetObjectHeard(oRunTarget)) + { + AISpeakString(HELP_MY_FRIEND); + } + ClearAllActions(); + // New - cast fleeing spells. Important (and only used + // at higher intelligence) things like Expeditious retreat. + // - Only used once - one invisibility or haste. Deleted above. + ActionCastFleeingSpells(); + ActionMoveToObject(oRunTarget, TRUE); + return TRUE; + } + } + else + { + // Check if we have bad intellgence, and we will run away + // from the nearest enemy if heard. + if(GetAIInteger(AI_INTELLIGENCE) <= i3) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetLastHostileActor(); + if(!GetIsObjectValid(oRunTarget) || GetIsDead(oRunTarget)) + { + ResetCurrentAction(); + return FALSE; + } + } + } + // Run from enemy + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, f50); + return TRUE; + } + ResetCurrentAction(); + return FALSE; + } + } + break; + case AI_SPECIAL_ACTIONS_MOVE_OUT_OF_AOE: + { + // We must be X distance away from a cirtain AOE, if we are not, we + // move. + oRunTarget = GetAIObject(AI_AOE_FLEE_FROM); + + // If not valid, or already far enough away, delete special action + // and return false. + if(!GetIsObjectValid(oRunTarget) || + GetLocalFloat(OBJECT_SELF, AI_AOE_FLEE_FROM_RANGE) < GetDistanceToObject(oRunTarget)) + { + ResetCurrentAction(); + return FALSE; + } + else + { + // Valid and still in range + // - Run away + ClearAllActions(); + ActionMoveAwayFromLocation(GetLocation(oRunTarget), TRUE, GetLocalFloat(OBJECT_SELF, AI_AOE_FLEE_FROM_RANGE)); + return TRUE; + } + } + break; + } + // Return false to carry on a normal heartbeat + return FALSE; +} + +// Get whether the condition is set +// * Bioware SoU Waypoint call. +int GetWalkCondition(int nCondition, object oCreature=OBJECT_SELF) +{ + return (GetLocalInt(oCreature, sWalkwayVarname) & nCondition); +} + +// Cast fleeing spells. +// - Invisiblity (best) +// - Haste/Expeditious Retreat +void ActionCastFleeingSpells() +{ + // Not got local + if(GetAIInteger(AI_HEARTBEAT_FLEE_SPELLS)) return; + // Set local + SetAIInteger(AI_HEARTBEAT_FLEE_SPELLS, TRUE); + + // Invisibilities + if(FleeingSpellCast(SPELL_IMPROVED_INVISIBILITY)) return; + if(FleeingSpellCast(SPELL_INVISIBILITY)) return; + + // Haste + if(FleeingSpellCast(SPELL_MASS_HASTE)) return; + if(FleeingSpellCast(SPELL_HASTE)) return; + if(FleeingSpellCast(SPELL_EXPEDITIOUS_RETREAT)) return; +} + +// Attempt to cast iSpell. TRUE if true. +int FleeingSpellCast(int iSpell) +{ + if(GetHasSpell(iSpell)) + { + ActionCastSpellAtObject(iSpell, OBJECT_SELF); + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/j_inc_npc_attack.nss b/nwnds_module/j_inc_npc_attack.nss new file mode 100644 index 000000000..0946ff634 --- /dev/null +++ b/nwnds_module/j_inc_npc_attack.nss @@ -0,0 +1,432 @@ +/************************ [Combat Attack] ************************************** + Filename: j_inc_npc_attack +************************* [Combat Attack] ************************************** + What does this do? + + It is a wrapper/include for getting a creature to attack target X, or do + Y. I use this for conversations, triggers, the lot, as a simple wrapper + that will execute my AI. + + There are several functions here to do things, that may be useful wrappers. + + And it also keeps Combat files SMALL! I uses Execute Script to fire the + combat file, not include it here. +************************* [History] ******************************************** + 1.3 - Added +************************* [Workings] ******************************************* + Include this in any conversation file or whatever, and mearly read the + descriptions of the different functions, and it will do what it says :-) +************************* [Arguments] ****************************************** + Arguments: +************************* [Combat Attack] *************************************/ + +// Include the constants for the combat, spawn integers ETC. +#include "j_inc_constants" + +// Hostile amount +const int HOSTILE = -100;// Reputation to change to +const int TYPE_ALL_PCS = 1;// is all PC's in the world. +const int TYPE_ALL_AREA = 2;// is all PC's in the specific area. +const int TYPE_IN_RANGE = 3;// is all PC's within fRange. + +// A slightly modified way to determine a combat round. +// * oTarget - The target to attack +// * sShout - The string to silently speak to get allies to come and help +void DetermineSpeakCombatRound(object oTarget = OBJECT_INVALID, string sShout = ""); + +// A slightly modified way to determine a combat round. +// * oTarget - The target to attack +// * oAttacker - The NPC who you want to determine a combat round, on oTarget +void DetermineSpeakCombatRoundNotMe(object oTarget, object oAttacker); + +// This is the main wrapper to get an NPC to attack in conversation. +// * fDelay - The delay AFTER adjusting reputation, that we attack and shout +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// Example, how to keep flags already set: +// HostileAttackPCSpeaker(0.0, GetPlotFlag(), GetImmortal()); +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackPCSpeaker(float fDelay = 0.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE); + +// This will make our faction hostile to the target, and attack them. +// * oTarget - The target object to attack +// * fDelay - The delay AFTER adjusting reputation, that we attack and shout +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// Example, how to keep flags already set: +// HostileAttackObject(oPC, 0.0, GetPlotFlag(), GetImmortal()); +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackObject(object oTarget, float fDelay = 0.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE); + +// This will make our faction hostile to the target, and shout. +// * oTarget - The target object to shout about. +// Use: Placeables, disturbers and so on. +// Note: Placeables are normally defaulted hostile faction! Must change it to work +void ShoutAbout(object oTarget); + +// This will make our faction hostile to ALL(!) PC's...in the area or game or range +// * iType - TYPE_ALL_PCS (1) is all PC's in the world. +// - TYPE_ALL_AREA (2) is all PC's in the specific area. +// - TYPE_IN_RANGE (3) is all PC's within fRange. +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackAllPCs(int iType = 1, float fRange = 40.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE); + +// This will thier most damaging weapon, and wait to disarm it. +// * fDuration - Delay until the weapon is withdrawn. +// * iRanged - if TRUE, it will equip a ranged weapon as a prioritory (EquipRanged call) +void EquipWeaponsDuration(float fDuration, int iRanged = FALSE); +// Disarms the persons right-hand-weapon +void RemoveWeapons(); + +// Plays talks like "ATTACK!" and "Group Near Me" etc. +// * iLowest, iHighest - the High/Lowest value to use. +// 0 = ATTACK, 1 = TAUNT, 2-4 = BATTLE(1-3), 5 = ENEMIES, 6 = GROUP, 7 = HELP. +void PlaySomeTaunt(int iLowest = 0, int iHighest = 7); + +// Gets all allies of ourselves to attack oTarget +// * oTarget - The target to attack. +void AlliesAttack(object oTarget); + +// Returns the nearest PC object +object GetNearestPCCreature(); +// Returns the nearest enemy (but doesn't determine if it can see/hear it) +object GetNearestEnemyCreature(); +// Returns the nearest friend +object GetNearestFriendCreature(); + + +// A slightly modified way to determine a combat round. +// * oTarget - The target to attack +// * sShout - The string to silently speak to get allies to come and help +void DetermineSpeakCombatRound(object oTarget, string sShout) +{ + // Shout + if(sShout != "") AISpeakString(sShout); + + // Check for custom AI script, else fire default. + string sAI = GetCustomAIFileName(); + // Fire default AI script + if(sAI == "") + { + // Sanity check - to not fire this off multiple times, we make sure temp + // object is not the same as oTarget (and valid) + if(!GetIsObjectValid(oTarget) || (GetIsObjectValid(oTarget) && + !GetLocalTimer(AI_DEFAULT_AI_COOLDOWN))) + { + SetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET, oTarget); + ExecuteScript(COMBAT_FILE, OBJECT_SELF); + SetLocalTimer(AI_DEFAULT_AI_COOLDOWN, 0.1); + } + } + // Fire custom AI script + else + { + SetLocalObject(OBJECT_SELF, AI_TEMP_SET_TARGET, oTarget); + ExecuteScript(sAI, OBJECT_SELF); + } +} + +// A slightly modified way to determine a combat round. +// * oTarget - The target to attack +// * oAttacker - The NPC who you want to determine a combat round, on oTarget +void DetermineSpeakCombatRoundNotMe(object oTarget, object oAttacker) +{ + // Check for custom AI script, else fire default. + string sAI = GetLocalString(oAttacker, AI_CUSTOM_AI_SCRIPT); + // Fire default AI script + if(sAI == "") + { + // Sanity check - to not fire this off multiple times, we make sure temp + // object is not the same as oTarget (and valid) + if(!GetIsObjectValid(oTarget) || (GetIsObjectValid(oTarget) && + !GetLocalTimer(AI_DEFAULT_AI_COOLDOWN))) + { + SetLocalObject(oAttacker, AI_TEMP_SET_TARGET, oTarget); + ExecuteScript(COMBAT_FILE, oAttacker); + SetLocalTimer(AI_DEFAULT_AI_COOLDOWN, 0.1); + } + } + // Fire custom AI script + else + { + SetLocalObject(oAttacker, AI_TEMP_SET_TARGET, oTarget); + ExecuteScript(sAI, oAttacker); + } +} +// This is the main wrapper to get an NPC to attack in conversation. +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// Example, how to keep flags already set: +// AttackPCSpeaker(GetPlotFlag(), GetImmortal()); +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackPCSpeaker(float fDelay = 0.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE) +{ + // Get the PC + object oPC = GetPCSpeaker(); + // Error checking + if(!GetIsObjectValid(oPC) || GetIsDM(oPC)) return; + // Change the flags + if(GetPlotFlag() != iPlot) + SetPlotFlag(OBJECT_SELF, iPlot); + if(GetImmortal() != iImmortal) + SetImmortal(OBJECT_SELF, iPlot); + + // We make them hostile to our faction + AdjustReputation(oPC, OBJECT_SELF, HOSTILE); + // Attack them + SetLocalObject(OBJECT_SELF, AI_TO_ATTACK, oPC); + if(fDelay > 0.0) + { + // Round start... + DelayCommand(fDelay, DetermineSpeakCombatRound(oPC, I_WAS_ATTACKED)); + if(iAllAllies) + DelayCommand(fDelay, AlliesAttack(oPC)); + } + else + { + // Round start... + DetermineSpeakCombatRound(oPC, I_WAS_ATTACKED); + if(iAllAllies) AlliesAttack(oPC); + } +} + +// This will make our faction hostile to the target, and attack them. +// * oTarget - The target object to attack +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// Example, how to keep flags already set: +// AttackObject(oPC, GetPlotFlag(), GetImmortal()); +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackObject(object oTarget, float fDelay = 0.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE) +{ + // Error checking + if(!GetIsObjectValid(oTarget) || GetIsDM(oTarget)) return; + // Change the flags + if(GetPlotFlag() != iPlot) + SetPlotFlag(OBJECT_SELF, iPlot); + if(GetImmortal() != iImmortal) + SetImmortal(OBJECT_SELF, iPlot); + + // We make them hostile to our faction + AdjustReputation(oTarget, OBJECT_SELF, HOSTILE); + // Attack them + SetLocalObject(OBJECT_SELF, AI_TO_ATTACK, oTarget); + if(fDelay > 0.0) + { + // Round start... + DelayCommand(fDelay, DetermineSpeakCombatRound(oTarget, I_WAS_ATTACKED)); + } + else + { + // Round start... + DetermineSpeakCombatRound(oTarget, I_WAS_ATTACKED); + } +} + +// This will make our faction hostile to the target, and shout. +// * oTarget - The target object to shout about. +// Use: Placeables, disturbers and so on. +void ShoutAbout(object oTarget) +{ + // We make them hostile to our faction + AdjustReputation(oTarget, OBJECT_SELF, HOSTILE); + // And shout for others to attack + AISpeakString(CALL_TO_ARMS); +} + +// This will make our faction hostile to ALL(!) PC's...in the area or game or range +// * iType - TYPE_ALL_PCS (1) is all PC's in the world. +// - TYPE_ALL_AREA (2) is all PC's in the specific area. +// - TYPE_IN_RANGE (3) is all PC's within fRange. +// * iPlot - The plot flag to set to (Usually FALSE). +// * iImmortal - The immortal flag to set to (Usually FALSE). +// * iAllAllies - This will determine combat rounds against the target, that are in 50.0M. False = Don't +void HostileAttackAllPCs(int iType = 1, float fRange = 40.0, int iPlot = FALSE, int iImmortal = FALSE, int iAllAllies = TRUE) +{ + object oPC, oToAttack; + int iShout, iCnt; + float fNearestEnemy = 10000.0; + object oArea = GetArea(OBJECT_SELF); + switch(iType) + { + case TYPE_ALL_PCS:// s all PC's in the world. + { + oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + if(!GetIsDM(oPC) && + GetIsObjectValid(GetArea(oPC))) + { + AdjustReputation(oPC, OBJECT_SELF, HOSTILE); + if(GetArea(oPC) == oArea) + { + if(GetDistanceToObject(oPC) <= fNearestEnemy) + { + oToAttack = oPC; + } + } + iShout = TRUE; + } + oPC = GetNextPC(); + } + } + break; + case TYPE_ALL_AREA:// is all PC's in the specific area. + { + iCnt = 1; + oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + while(GetIsObjectValid(oPC)) + { + // Attack it! (if not a DM!) + if(!GetIsDM(oPC)) + { + AdjustReputation(oPC, OBJECT_SELF, HOSTILE); + if(GetArea(oPC) == oArea) + { + if(GetDistanceToObject(oPC) <= fNearestEnemy) + { + oToAttack = oPC; + } + } + iShout = TRUE; + } + // Next one + iCnt++; + oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, + OBJECT_SELF, iCnt); + } + } + break; + case TYPE_IN_RANGE:// is all PC's within fRange. + { + iCnt = 1; + oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + while(GetIsObjectValid(oPC) && GetDistanceToObject(oPC) <= fRange) + { + // Attack it! (if not a DM!) + if(!GetIsDM(oPC)) + { + AdjustReputation(oPC, OBJECT_SELF, HOSTILE); + if(GetArea(oPC) == oArea) + { + if(GetDistanceToObject(oPC) <= fNearestEnemy) + { + oToAttack = oPC; + } + } + iShout = TRUE; + } + // Next one + iCnt++; + oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, + OBJECT_SELF, iCnt); + } + } + break; + } + // Attack nearest one (if valid) + if(GetIsObjectValid(oToAttack)) + { + DetermineSpeakCombatRound(oToAttack); + if(iAllAllies) AlliesAttack(oToAttack); + } + // Check if we shout + if(iShout) AISpeakString(CALL_TO_ARMS); +} +// This will thier most damaging melee weapon, and wait to disarm it. +// * fDuration - Delay until the weapon is withdrawn. +void EquipWeaponsDuration(float fDuration, int iRanged = FALSE) +{ + if(iRanged) + { + // Equip any most damaging (don't use oVersus, incase it doesn't arm anything) + ActionEquipMostDamagingRanged(); + } + else + { + // Equip any most damaging (don't use oVersus, incase it doesn't arm anything) + ActionEquipMostDamagingMelee(); + } + // Delay the un-equip + DelayCommand(fDuration, RemoveWeapons()); +} +// Disarms the persons right-hand-weapon +void RemoveWeapons() +{ + // cannot be in combat, duh! + if(GetIsInCombat() || GetIsObjectValid(GetAttackTarget())) + return; + // Get the weapon, make sure it is valid, and... + object oUnequip = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND); + if(GetIsObjectValid(oUnequip)) + { + // ...unequip it. + ClearAllActions(); + ActionUnequipItem(oUnequip); + } +} +/*:://///////////////////////////////////////////// +//:: PlaySomeTaunt +//:://///////////////////////////////////////////// + Plays talks like "ATTACK!" and "Group Near Me" etc. + * iLowest, iHighest - the High/Lowest value to use. + 0 = ATTACK, 1 = TAUNT, 2-4 = BATTLE(1-3), 5 = ENEMIES, 6 = GROUP, 7 = HELP. +//:://///////////////////////////////////////////// +//:: Created by : Jasperre +//:://///////////////////////////////////////////*/ +void PlaySomeTaunt(int iLowest, int iHighest) +{ + int iRandom = Random(iHighest) + iLowest; + int iVoice = VOICE_CHAT_ATTACK; + switch (iRandom) + { + case 0: iVoice = VOICE_CHAT_ATTACK; break; + case 1: iVoice = VOICE_CHAT_TAUNT; break; + case 2: iVoice = VOICE_CHAT_BATTLECRY1; break; + case 3: iVoice = VOICE_CHAT_BATTLECRY2; break; + case 4: iVoice = VOICE_CHAT_BATTLECRY3; break; + case 5: iVoice = VOICE_CHAT_ENEMIES; break; + case 6: iVoice = VOICE_CHAT_GROUP; break; + case 7: iVoice = VOICE_CHAT_HELP; break; + default: iVoice = VOICE_CHAT_ATTACK; break; + } + PlayVoiceChat(iVoice); +} + +// Gets all allies of ourselves to attack oTarget +// * oTarget - The target to attack. +void AlliesAttack(object oTarget) +{ + if(!GetIsObjectValid(oTarget)) return; + int iCnt = 1; + object oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, iCnt, CREATURE_TYPE_IS_ALIVE, TRUE); + while(GetIsObjectValid(oAlly) && GetDistanceToObject(oAlly) <= 50.0) + { + // A slightly modified way to determine a combat round. + // * oTarget - The target to attack + // * oAttacker - The NPC who you want to determine a combat round, on oTarget + DetermineSpeakCombatRoundNotMe(oTarget, oAlly); + iCnt++; + oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, iCnt, CREATURE_TYPE_IS_ALIVE, TRUE); + } +} + +// Returns the nearest PC object +object GetNearestPCCreature() +{ + return GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +} +// Returns the nearest enemy (but doesn't determine if it can see/hear it) +object GetNearestEnemyCreature() +{ + return GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); +} +// Returns the nearest friend +object GetNearestFriendCreature() +{ + return GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND); +} + +//void main(){} diff --git a/nwnds_module/j_inc_other_ai.nss b/nwnds_module/j_inc_other_ai.nss new file mode 100644 index 000000000..2e2e7bf7a --- /dev/null +++ b/nwnds_module/j_inc_other_ai.nss @@ -0,0 +1,512 @@ +/************************ [Include - Other AI Functions] *********************** + Filename: j_inc_other_ai +************************* [Include - Other AI Functions] *********************** + This contains fuctions and calls for these scripts: + nw_c2_default2 - Percieve + nw_c2_default3 - On Combat round End (For DetermineCombatRound() only) + nw_c2_default4 - Conversation (shout) + nw_c2_default5 - Phisical attacked + nw_c2_default6 - Damaged + nw_c2_default8 - Disturbed + nw_c2_defaultb - Spell cast at + Ones that don't use this use different/No includes. + + HOPEFULLY it will make them faster, if they don't run combat. + + They use Execute Script to initiate combat. (With the override ones + initiating the override version, the normal initiateing the normal). +************************* [History] ******************************************** + 1.3 - Added to speed up compilings and gather non-combat, or other workings + in one place. +************************* [Workings] ******************************************* + This is included, by #include "J_INC_OTHER_AI" in other AI files. + + They then use these functions in them scripts. +************************* [Arguments] ****************************************** + Arguments: N/A +************************* Include - Other AI Functions] ***********************/ + +// All constants. +#include "j_inc_constants" + + +// Responds to it (like makinging the callers attacker thier target) +// Called in OnConversation, and thats it. Use "ShouterFriend" To stop repeated GetIsFriend calls. +void RespondToShout(object oShouter, int nShoutIndex); +// Gets the attacker or attakee of the target, which should be a friend +object GetIntruderFromShout(object oShouter); + +// Shouts, or really brings all people in 60.0M(by default) to the "shouter" +void ShoutBossShout(object oEnemy); +// Checks the target for a specific EFFECT_TYPE constant value +// Returns TRUE or FALSE. Used On Damaged for polymorph checking. +int GetHasEffect(int nEffectType, object oTarget = OBJECT_SELF); +// This sets a morale penalty, to the exsisting one, if there is one. +// It will reduce itself after fDuration (or if we die, ETC, it is deleted). +// It is deleted at the end of combat as well. +void SetMoralePenalty(int iPenalty, float fDuration = 0.0); +// Removes iPenalty amount if it can. +void RemoveMoralePenalty(int iPenalty); +// At 5+ intelligence, we fire off any dispells at oPlaceables location +void SearchDispells(object oPlaceable); + +// This MAY make us set a local timer to turn off hiding. +// Turn of hiding, a timer to activate Hiding in the main file. This is +// done in each of the events, with the opposition checking seen/heard. +void TurnOffHiding(object oIntruder); +// Used when we percieve a new enemy and are not in combat. Hides the creature +// appropriatly with spawn settings and ability. +// - At least it will clear all actions if it doesn't set hiding on +void HideOrClear(); + +// This MIGHT move to oEnemy +// - Checks special actions, such as fleeing, and may run instead! +void ActionMoveToEnemy(object oEnemy); + +// Returns TRUE if we have under 0 morale, set to flee. +// - They then run! (Badly) +int PerceptionFleeFrom(object oEnemy); + +/*:://///////////////////////////////////////////// +//:: Name: ShoutBossShout +//:://///////////////////////////////////////////// + This is used in the OnPercieve, and if we are set to, + we will "shout" and bring lots of allies a running +//:://///////////////////////////////////////////*/ +void ShoutBossShout(object oEnemy) +{ + if(GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_BOSS_MONSTER_SHOUT, AI_OTHER_COMBAT_MASTER)) + { + // Get the range (and default to 60.0 M) + float fRange = IntToFloat(GetBoundriedAIInteger(AI_BOSS_MONSTER_SHOUT_RANGE, i60, 370)); + // We loop through nearest not-seen, not-heard allies and get them + // to attack the person. + int Cnt = i1; + // Not seen, not heard... + object oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, + OBJECT_SELF, Cnt, CREATURE_TYPE_IS_ALIVE, TRUE, + CREATURE_TYPE_PERCEPTION, PERCEPTION_NOT_SEEN_AND_NOT_HEARD); + // Get who thier target is. + object oThierTarget; + while(GetIsObjectValid(oAlly) && GetDistanceToObject(oAlly) <= fRange) + { + oThierTarget = GetLocalObject(oAlly, AI_TO_ATTACK); + // If they are not attacking the enemy, we assing them to attack. + if(oThierTarget != oEnemy) + { + // Can't be in combat. + if(!GetIsInCombat(oAlly)) + { + // Set them to move to this + SetLocalObject(oAlly, AI_TO_ATTACK, oEnemy); + // Make them attack the person + SetLocalObject(oAlly, AI_TEMP_SET_TARGET, oEnemy); + ExecuteScript(COMBAT_FILE, oAlly); + } + } + Cnt++; + oAlly = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, + OBJECT_SELF, Cnt, CREATURE_TYPE_IS_ALIVE, TRUE, + CREATURE_TYPE_PERCEPTION, PERCEPTION_NOT_SEEN_AND_NOT_HEARD); + } + // Remove it :-) + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_BOSS_MONSTER_SHOUT, AI_OTHER_COMBAT_MASTER); + } +} +// This MAY make us set a local timer to turn off hiding. +// Turn of hiding, a timer to activate Hiding in the main file. This is +// done in each of the events, with the opposition checking seen/heard. +void TurnOffHiding(object oIntruder) +{ + if(!GetLocalTimer(AI_TIMER_TURN_OFF_HIDE) && + // Are we actually seen/heard or is it just an AOE? + (GetObjectSeen(OBJECT_SELF, oIntruder) || + GetObjectHeard(OBJECT_SELF, oIntruder))) + { + SetLocalTimer(AI_TIMER_TURN_OFF_HIDE, f18); + } +} + +// Used when we percieve a new enemy and are not in combat. Hides the creature +// appropriatly with spawn settings and ability. +// - At least it will clear all actions if it doesn't set hiding on +void HideOrClear() +{ + // Spawn in conditions for it + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_HIDING, AI_OTHER_COMBAT_MASTER) && + GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH) == FALSE) + { + // Need skill or force on + if((GetSkillRank(SKILL_HIDE) - i4 >= GetHitDice(OBJECT_SELF)) || + GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_HIDING, AI_OTHER_COMBAT_MASTER)) + { + // Use hide + ClearAllActions(TRUE); + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE); + // Stop + return; + } + } + // Else clear all actions normally. + ClearAllActions(); +} + +/*:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//:://///////////////////////////////////////////// + Useage: + +//NOTE ABOUT BLOCKERS + + int NW_GENERIC_SHOUT_BLOCKER = 2; + + It should be noted that the Generic Script for On Dialogue attempts to get a local + set on the shouter by itself. This object represents the LastOpenedBy object. It + is this object that becomes the oIntruder within this function. + +//NOTE ABOUT INTRUDERS + + These are the enemy that attacked the shouter. + +//NOTE ABOUT EVERYTHING ELSE + + I_WAS_ATTACKED = 1; + + If not in combat, attack the attackee of the shouter. Basically the best + way to get people to come and help us. + + CALL_TO_ARMS = 3; + + If not in combat, determine combat round. By default, it should check any + allies it can see/hear for thier targets and help them too. + + HELP_MY_FRIEND = 4; + + This is a runner thing. Said when the runner sees the target to run to. + Gets a local location, and sets off people to run to it. + If no valid area for the location, no moving :-P + + We also shout this if we are fleeing. It will set the person to buff too. + + LEADER_FLEE_NOW = 5 + + We flee to a pre-set object or follow the leader (who should be fleeing). + + LEADER_ATTACK_TARGET = 6 + + We attack the intruder next round, by setting it as a local object to + override other choices. + + I_WAS_KILLED = 7 + + If lots are killed in one go - ouch! morale penalty each time someone dies. + + I_WAS_OPENED = 8 + + Chests/Doors which say this get the AI onto the tails of those who opened it, OR + they get searched! :-) +//:://///////////////////////////////////////////// +// Modified almost completely: Jasperre +//:://///////////////////////////////////////////*/ +// Gets the attacker or attakee of the target, which should be a friend +object GetIntruderFromShout(object oShouter) +{ + object oIntruder = GetAttackTarget(oShouter); + if(!GetIsObjectValid(oIntruder) || + GetIgnoreNoFriend(oIntruder)) + { + oIntruder = GetLastHostileActor(oShouter); + if(GetIgnoreNoFriend(oIntruder)) + { + return OBJECT_INVALID; + } + } + return oIntruder; +} + +void RespondToShout(object oShouter, int nShoutIndex) +{ + object oIntruder; + // Ones we don't care about if we are in combat... + if(nShoutIndex == i6) // "Attack specific object" + { + // If a leader, we set it as a local object, nothing more + if(GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_GROUP_LEADER, AI_OTHER_COMBAT_MASTER, oShouter)) + { + oIntruder = GetLocalObject(oShouter, AI_ATTACK_SPECIFIC_OBJECT); + if(GetObjectSeen(oIntruder)) + { + // Set local object to use in next DetermineCombatRound. + // We do not interrupt current acition (EG: Life saving stoneskins!) to re-direct. + SetAIObject(AI_ATTACK_SPECIFIC_OBJECT, oIntruder); + // 6 second delay. + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f6); + } + } + return; + } + else if(nShoutIndex == i5)// "leader flee now" + { + // If a leader, we set it as a local object, nothing more + if(GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_GROUP_LEADER, AI_OTHER_COMBAT_MASTER, oShouter)) + { + oIntruder = GetLocalObject(oShouter, AI_FLEE_TO); + // RUN! If intruder set is over 5.0M or no valid intruder + ClearAllActions(); + // 70. "[Shout] Reacting To Shout. [ShoutNo.] " + IntToString(iInput) + " [Shouter] " + GetName(oInput) + DebugActionSpeakByInt(70, oShouter, nShoutIndex); + SetCurrentAction(AI_SPECIAL_ACTIONS_FLEE); + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f12); + if(GetIsObjectValid(oIntruder)) + { + SetAIObject(AI_FLEE_TO, oIntruder); + ActionMoveToObject(oIntruder); + } + else // Else, we will just follow our leader! + { + SetAIObject(AI_FLEE_TO, oShouter); + ActionForceFollowObject(oShouter, f3); + } + } + return; + } + // If the shout is number 8, it is "I was opened" and so can only be a + // placeable or door. + else if(nShoutIndex == i8)// "I was opened" + { + // We need somewhat complexe here - to get thier opener. + int nType = GetObjectType(oShouter); + // Check object type. If not a placeable nor door - stop script. + if(nType == OBJECT_TYPE_PLACEABLE || + nType == OBJECT_TYPE_DOOR) + { + // Now, we assign the placeable/door to set thier opener. + // - Need to check it works. + AssignCommand(oShouter, SetLocalObject(oShouter, PLACEABLE_LAST_OPENED_BY, GetLastOpenedBy())); + oIntruder = GetLocalObject(oShouter, PLACEABLE_LAST_OPENED_BY); + if(GetIsObjectValid(oIntruder)) + { + // Attack + ClearAllActions(); + DetermineCombatRound(oShouter); + } + } + } + // Else, we must not be in combat for the rest + else if(!CannotPerformCombatRound()) + { + // Call to arms requires nothing special + if(nShoutIndex == i3)// "Call to arms" + { + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f6); + // 70. "[Shout] Reacting To Shout. [ShoutNo.] " + IntToString(iInput) + " [Shouter] " + GetName(oInput) + DebugActionSpeakByInt(70, oShouter, nShoutIndex); + DetermineCombatRound(); + } + // Ones we can GetIntruderFromShout(oShouter); + if(nShoutIndex == i1 || // "I was attacked" + nShoutIndex == i4 || // "Help my friend" + nShoutIndex == i7) // "I was killed" + { + // Am not already fighting, and we don't ignore the intruder + oIntruder = GetIntruderFromShout(oShouter); + if(!GetIsObjectValid(oIntruder)) + { + return; + } + } + if(nShoutIndex == i1 || + nShoutIndex == i7) + { + // Morale penalty if they were killed + if(nShoutIndex == i7) + { + SetMoralePenalty((GetHitDice(oShouter)/i4), f18); + } + // Get intruder + // 70. "[Shout] Reacting To Shout. [ShoutNo.] " + IntToString(iInput) + " [Shouter] " + GetName(oInput) + DebugActionSpeakByInt(70, oShouter, nShoutIndex); + if(GetObjectSeen(oIntruder)) + { + // Stop, and attack, if we can see them! + ClearAllActions(); + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f9); + DetermineCombatRound(oIntruder); + DelayCommand(f2, AISpeakString(I_WAS_ATTACKED)); + } + else // Else the enemy is not seen + { + // If I can see neither the shouter nor the enemy + // stop what I am doing, and move to the attacker. + // - 1.3 change. They move to the attackers location (IE directed by ally) + ClearAllActions(); + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f6); + // This will move to oIntruder if nothing else + DetermineCombatRound(oIntruder); + // Shout to other allies, after a second. + DelayCommand(f2, AISpeakString(HELP_MY_FRIEND)); + } + } + else if(nShoutIndex == i4)// "Help my friend" + { + // We move to where the runner/shouter wants us. + location lMoveTo = GetLocalLocation(oShouter, AI_HELP_MY_FRIEND_LOCATION); + // 70. "[Shout] Reacting To Shout. [ShoutNo.] " + IntToString(iInput) + " [Shouter] " + GetName(oInput) + DebugActionSpeakByInt(70, oShouter, nShoutIndex); + SetLocalTimer(AI_TIMER_SHOUT_IGNORE_ANYTHING_SAID, f6); + if(GetIsObjectValid(GetAreaFromLocation(lMoveTo))) + { + ActionMoveToLocation(lMoveTo, TRUE); + ActionDoCommand(DetermineCombatRound()); + } + else + { + // If we do not know of the friend attacker, we will follow them + ClearAllActions(); + SetSpawnInCondition(AI_FLAG_COMBAT_FLAG_FAST_BUFF_ENEMY, AI_COMBAT_MASTER); + ActionForceFollowObject(oShouter, f3); + ActionDoCommand(DetermineCombatRound()); + } + } + } +} + +void SearchDispells(object oPlaceable) +{ + // No dispelling at low intelligence. + if(GetBoundriedAIInteger(AI_INTELLIGENCE) < i5) return; + location lPlace = GetLocation(oPlaceable); + // Move closer if not seen. + if(!GetObjectSeen(oPlaceable)) + { + // Move nearer - 6 M is out of the dispell range + ActionMoveToObject(oPlaceable, TRUE, f6); + } + // Dispell if we have any - at the location of oPlaceable. + if(GetHasSpell(SPELL_LESSER_DISPEL)) + { + ActionCastSpellAtLocation(SPELL_LESSER_DISPEL, lPlace); + } + else if(GetHasSpell(SPELL_DISPEL_MAGIC)) + { + ActionCastSpellAtLocation(SPELL_DISPEL_MAGIC, lPlace); + } + else if(GetHasSpell(SPELL_GREATER_DISPELLING)) + { + ActionCastSpellAtLocation(SPELL_GREATER_DISPELLING, lPlace); + } + else if(GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION)) + { + ActionCastSpellAtLocation(SPELL_MORDENKAINENS_DISJUNCTION, lPlace); + } +} + +// Get Has Effect +// Checks to see if the target has a given +// effect, usually from a spell. Really useful this is. +int GetHasEffect(int nEffectType, object oTarget = OBJECT_SELF) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + if(GetEffectType(eCheck) == nEffectType) + { + return TRUE; + break; + } + eCheck = GetNextEffect(oTarget); + } + return FALSE; +} + +// This sets a morale penalty, to the exsisting one, if there is one. +// It will reduce itself (by the penalty) after fDuration (or if we die, ETC, it is deleted). +// It is deleted at the end of combat as well. +void SetMoralePenalty(int iPenalty, float fDuration = 0.0) +{ + int iOriginal = GetAIInteger(AI_MORALE_PENALTY); + int iNew = iOriginal + iPenalty; + SetAIInteger(AI_MORALE_PENALTY, iNew); + DelayCommand(fDuration, RemoveMoralePenalty(iPenalty)); +} +void RemoveMoralePenalty(int iPenalty) +{ + int iOriginal = GetAIInteger(AI_MORALE_PENALTY); + int iNew = iOriginal - iPenalty; + if(iNew > 0 && !GetIsDead(OBJECT_SELF)) + { + SetAIInteger(AI_MORALE_PENALTY, iNew); + } + else + { + DeleteAIInteger(AI_MORALE_PENALTY); + } +} + +// This MIGHT move to oEnemy +// - Checks special actions, such as fleeing, and may run instead! +void ActionMoveToEnemy(object oEnemy) +{ + // Make sure that we are not fleeing badly (-1 morale from all enemies) + if(GetIsEnemy(oEnemy)) + { + // -1 morale, flee + if(PerceptionFleeFrom(oEnemy)) return; + } + if(GetIsPerformingSpecialAction()) + { + // Stop if we have an action we don't want to override + return; + } + // End default is move to the enemy + ClearAllActions(); + ActionMoveToObject(oEnemy, TRUE); + // combat round to heal/search/whatever + if(!GetFactionEqual(oEnemy)) + { + ActionDoCommand(DetermineCombatRound(oEnemy)); + } +} + +// Returns TRUE if we have under 0 morale, set to flee. +// - They then run! (Badly) +int PerceptionFleeFrom(object oEnemy) +{ + object oRunTarget = oEnemy; + if(GetAIInteger(AI_INTELLIGENCE) < FALSE) + { + // Valid run from target + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, i1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD, CREATURE_TYPE_IS_ALIVE, TRUE); + if(!GetIsObjectValid(oRunTarget)) + { + oRunTarget = GetLastHostileActor(); + if(!GetIsObjectValid(oRunTarget) || GetIsDead(oRunTarget)) + { + // Stop - nothing to flee from! + return FALSE; + } + } + } + } + // Run from enemy + ClearAllActions(); + ActionMoveAwayFromObject(oRunTarget, TRUE, f50); + return TRUE; + } + // 0 or more morale. + return FALSE; +} + +// Debug: To compile this script full, uncomment all of the below. +/* - Add two "/"'s at the start of this line +void main() +{ + return; +} +//*/ diff --git a/nwnds_module/j_inc_setweapons.nss b/nwnds_module/j_inc_setweapons.nss new file mode 100644 index 000000000..a8f708f51 --- /dev/null +++ b/nwnds_module/j_inc_setweapons.nss @@ -0,0 +1,2043 @@ +/************************ [Include - Set Weapons] ****************************** + Filename: J_Inc_Setweapons +************************* [Include - Set Weapons] ****************************** + This holds all the stuff for setting up local objects for weapons we have + or have not got - normally the best to worst. +************************* [History] ******************************************** + 1.0 - Put in include + 1.3 - Fixed minor things, added arrays of weapons (for deul wielding) and + heal kits and stuff added. + Added to OnSpawn. +************************* [Workings] ******************************************* + This is included in "j_ai_setweapons" and executed from other places VIA it. + + This migth change, but not likely. It could be re-included OnSpawn at least + for spawning in. + + Yraen's script really. Modified some things in it though, trying to speed it up + Changed things like if statements to switches, tried (somewhat unsucessfully) to + Add the magical staff (never equips it?) and the values are now much cleaner and + better valued. + + NOTE: + + - Ignores OVERWHELMING CRITICAL + - Ignores DEVASTATING CRITICAL + - Ignores EPIC WEAPON FOCUS + - Ignores EPIC WEAPON SPECIALIZATION + - Ignores WEAPON OF CHOICE + + So if you really want the item to be used, just use one weapon. + + This is because epic feats, 5 lots, xAmount of checks, is many too many for + it to be worth it. Maybe less then 1% would ever come up true, out of the + many GetHasFeat() checks. + + The lower level ones are taken into account, however! And these are much + more common. +************************* [Arguments] ****************************************** + Arguments: N/A +************************* [Include - Set Weapons] *****************************/ + +#include "j_inc_constants" + +/*****Structure******/ +// Things we use throughout, saves time (and Get's) putting them here. + +int ProfWizard, ProfDruid, ProfMonk, ProfElf, ProfRogue, ProfSimple, + ProfMartial, ProfExotic, ProfShield, +/* +int ProfWizard = FALSE; +int ProfDruid = FALSE; +int ProfMonk = FALSE; +int ProfElf = FALSE; +int ProfRogue = FALSE; +int ProfSimple = FALSE; +int ProfMartial = FALSE; +int ProfExotic = FALSE; +int ProfShield = FALSE; +*/ +// If we set have the right two-weapon fighting feats, this is set +/*int*/ProfTwoWeapons, // = FALSE; +// This contains our current size. +/*int*/CreatureSize, +/*int*/CreatureStrength, // = FALSE; +// This tracks the current item value (so less Get/Set). +/*int*/CurrentItemValue, // = FALSE; +/*int*/CurrentItemIsMighty, // = FALSE; +/*int*/CurrentItemIsUnlimited, // = FALSE; +/*int*/CurrentItemSize, // = FALSE; +/*int*/CurrentItemDamage, // = FALSE; // Special - Damage is set in the bigger arrays. +/*int*/CurrentItemType, // = -1; // Set to -1 in loop anyway. +// I'm scripting, not doing grammer here! +/*int*/HasArrows, // = FALSE; +/*int*/HasBolts, // = FALSE; +/*int*/HasBullets; // = FALSE; + +// String for setting a value integer to an item +const string SETWEP_VALUE = "VALUE"; +const string SETWEP_DISTANCE = "DISTANCE"; +const string SETWEP_IS_UNLIMITED = "SETWEP_IS_UNLIMITED"; +const string SETWEP_SHIELD = "SHIELD"; + +// Constants for weapon size. +const int WEAPON_SIZE_INVALID = 0; +const int WEAPON_SIZE_TINY = 1; +const int WEAPON_SIZE_SMALL = 2; +const int WEAPON_SIZE_MEDIUM = 3; +const int WEAPON_SIZE_LARGE = 4; + +//int CREATURE_SIZE_INVALID = 0; +//int CREATURE_SIZE_TINY = 1; +//int CREATURE_SIZE_SMALL = 2; +//int CREATURE_SIZE_MEDIUM = 3; +//int CREATURE_SIZE_LARGE = 4; +//int CREATURE_SIZE_HUGE = 5; + +/**** MAIN CALLS ****/ +// Start of the whole thing... +// - Runs through ALL inventory items, and the weapon/ammo slots, to +// set what weapons are best to use, backup ones, shields and so forth! +void SetWeapons(object oTarget = OBJECT_SELF); +// Goes through and sets a value and then a weopen to all weopen items +void SortInventory(object oTarget); +// This returns the size of oItem +int GetWeaponSize(object oItem = OBJECT_INVALID); +// reset healing kits only on oTarget. +void ResetHealingKits(object oTarget); + +/**** SETTING ****/ +// Ranged weopen is set - final one to use. +void SetRangedWeapon(object oTarget); +// Sets the primary weopen to use. +void SetPrimaryWeapon(object oTarget, object oItem = OBJECT_INVALID); +// sets the Two Handed Weopen to use. +void SetTwoHandedWeapon(object oTarget, object oItem = OBJECT_INVALID); +// Ammo counters are set, although I do not think they specifically are equipped. +void SetAmmoCounters(object oTarget); +// Sets the object shield to use. Best one. +void SetShield(object oTarget); +// Like the ranged weapons, we set this so we can have 2 shields (so we can tell +// when to re-set such things). +void StoreShield(object oTarget, object oItem); +// Uses right prefix to store the object to oTarget. +void SWFinalAIObject(object oTarget, string sName, object oObject); +// Uses right prefix to store the iInt to oTarget. +void SWFinalAIInteger(object oTarget, string sName, int iInt); +// Deletes object with Prefix +void SWDeleteAIObject(object oTarget, string sName); +// Deletes integer with Prefix +void SWDeleteAIInteger(object oTarget, string sName); + +// Sets the weapon to the array, in the right spot... +// If iSecondary is TRUE, it uses the weapon size, and creature size to modifiy +// the value. +void ArrayOfWeapons(string sArray, object oTarget, object oItem, int iValue, int iSecondary = FALSE); +// Deletes all the things in an array...set to sArray +void DeleteDatabase(object oTarget, string sArray); +// Deletes all things, before we start! +void DeleteAllPreviousWeapons(object oTarget); + +/**** STORING ****/ +// Stores the ranged weopen - it also needs to check ammo before choosing one. +void StoreRangedWeapon(object oTarget, object oItem = OBJECT_INVALID); +// This adds the maximum damage onto the value +void BaseLargeWeapons(object oTarget, object oItem = OBJECT_INVALID); +// This adds the maximum damage onto the value. +void BaseMediumWeapons(object oTarget, object oItem = OBJECT_INVALID); +// This adds the maximum damage onto the value +void BaseSmallWeapons(object oTarget, object oItem = OBJECT_INVALID); +// This adds the maximum damage onto the value +void BaseTinyWeapons(object oTarget, object oItem = OBJECT_INVALID); +// This adds the effects onto the value +void BaseEffects(object oTarget, object oItem = OBJECT_INVALID); +// This will take the weapon size, and things, and apply the right base effects. +void DoEffectsOf(object oTarget, object oItem); + +/*** OTHER ****/ +// Erm...deletes the ints. Like wizard and so on. +void DeleteInts(object oTarget); +// This returns _STATE local int +int GetState(object oTarget); +// This is the deletion of the values of weapons. +void DeleteValueInts(object oTarget, string sArray); +// This moves the values from iMax to iNumberStart back one in the list. +void MoveArrayBackOne(string sArray, int iNumberStart, object oTarget, int iMax); +// Special: Apply EffectCutsceneImmobilize +void AI_SpecialActionApplyItem(object oTarget); +// Special: Remove EffectCutsceneImmobilize +void AI_SpecialActionRemoveItem(object oTarget); +// Gets a item talent value, no applying of EffectCutsceneImmobilize. +// - iTalent, 1-21. +void AI_SetItemTalentValue(int iTalent); + +//:://///////////////////////////////////////////// +//:: Name SetWeopens +//::////////////////////////////////////////////// +/* + Main call - it starts the process of checking + Inventory, and so on +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void SetWeapons(object oTarget = OBJECT_SELF) +{ + // Deletes all previous things, even if we don't have them, just in case. + DeleteAllPreviousWeapons(oTarget); + + // We don't do this if we have AI_FLAG_OTHER_LAG_EQUIP_MOST_DAMAGING set. + if(GetSpawnInCondition(AI_FLAG_OTHER_LAG_EQUIP_MOST_DAMAGING, AI_OTHER_MASTER)) return; + + // Gets the creature size, stores it... + CreatureSize = GetCreatureSize(oTarget); + // No need to take off strength. It is pulrey for mighty weapons, we + // add on this bonus to the value. + CreatureStrength = GetAbilityModifier(ABILITY_STRENGTH, oTarget); + if(CreatureStrength < i0) + { + CreatureStrength = i0; + } + // Ints, globally set. + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_DRUID, oTarget)) + ProfDruid = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_ELF, oTarget)) + ProfElf = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_EXOTIC, oTarget)) + ProfExotic = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_MARTIAL, oTarget)) + ProfMartial = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_MONK, oTarget)) + ProfMonk = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_ROGUE, oTarget)) + ProfRogue = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_SIMPLE, oTarget)) + ProfSimple = TRUE; + if(GetHasFeat(FEAT_WEAPON_PROFICIENCY_WIZARD, oTarget)) + ProfWizard = TRUE; + if(GetHasFeat(FEAT_SHIELD_PROFICIENCY, oTarget)) + ProfShield = TRUE; + if(GetHasFeat(FEAT_TWO_WEAPON_FIGHTING, oTarget) || + GetHasFeat(FEAT_AMBIDEXTERITY, oTarget) || + GetHasFeat(FEAT_IMPROVED_TWO_WEAPON_FIGHTING, oTarget)) + { + ProfTwoWeapons = TRUE; + } + // Sorts the inventory, on oTarget, with CreatureSize of creature + SortInventory(oTarget); +} + +//:://///////////////////////////////////////////// +//:: Name SortInventory +//::////////////////////////////////////////////// +/* + Right - Goes through all items in the inventory + It, based in Weopen size and creature size, + do base effects of it (value it), if a weopen +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void SortInventory(object oTarget) +{ + // Note to self: Removed potion setting. THis is done each round in AI include + // because it is probably better that way. + int nBase, nWeaponSize, iCnt; + object oItem, oHighestKit; + int iHealingKitsAmount, iItemValue; + int iRunningValue = i0; // For kits + + // Onto the slots - if we are checking them! + // Slots 4 and 5. (HTH weapons) + for(iCnt = INVENTORY_SLOT_RIGHTHAND; // 4 + iCnt <= INVENTORY_SLOT_LEFTHAND; // 5 + iCnt++) + { + oItem = GetItemInSlot(iCnt, oTarget); + if(GetIsObjectValid(oItem)) + { + CurrentItemType = GetBaseItemType(oItem); + CurrentItemSize = GetWeaponSize(oItem); + CurrentItemDamage = FALSE;// Reset + if(CurrentItemSize)// Is over 0 + { + DoEffectsOf(oTarget, oItem); + } + } + } + // Slots 11, 12 and 13. (some ammo slots) + for(iCnt = INVENTORY_SLOT_ARROWS; //11 + iCnt <= INVENTORY_SLOT_BOLTS; //13 + iCnt++) + { + oItem = GetItemInSlot(iCnt, oTarget); + if(GetIsObjectValid(oItem)) + { + CurrentItemType = GetBaseItemType(oItem); + CurrentItemSize = GetWeaponSize(oItem); + CurrentItemDamage = FALSE;// Reset + if(CurrentItemSize) + { + DoEffectsOf(oTarget, oItem); + } + } + } + // The inventory + oItem = GetFirstItemInInventory(oTarget); + while(GetIsObjectValid(oItem)) + { + // Added some else statements to speed it up + CurrentItemType = GetBaseItemType(oItem); + if(CurrentItemType == BASE_ITEM_HEALERSKIT) + { + iHealingKitsAmount++; + iItemValue = GetGoldPieceValue(oItem); + // Stacked kits be worth what they should be seperatly. + iItemValue = iItemValue/GetNumStackedItems(oItem); + if(iItemValue > iRunningValue) + { + iRunningValue = iItemValue; + oHighestKit = oItem; + } + } + // Else, is it a arrow, bolt or bullet? + else if(CurrentItemType == BASE_ITEM_ARROW || + CurrentItemType == BASE_ITEM_BOLT || + CurrentItemType == BASE_ITEM_BULLET) + { + SetAmmoCounters(oTarget); + } + else + // else it isn't a healing kit, or ammo...what is it? + // Likely a weapon, so we check + { + // Only need current item size, if it is a weapon! + CurrentItemSize = GetWeaponSize(oItem); + CurrentItemDamage = FALSE;// Reset + if(CurrentItemSize)// Is over 0 (valid weapon) + { + // Do the appropriate enchantment issuse and so on. + DoEffectsOf(oTarget, oItem); + } + } + oItem = GetNextItemInInventory(oTarget); + } + // Set our ranged weapons (if any) + SetRangedWeapon(oTarget); + // Set our shield (if any) + SetShield(oTarget); + // Need some, any! + if(iHealingKitsAmount > i0) + { + // set healing kits (if any) + SWFinalAIObject(oTarget, AI_VALID_HEALING_KIT_OBJECT, oHighestKit); + // Set amount left + SWFinalAIInteger(oTarget, AI_VALID_HEALING_KITS, iHealingKitsAmount); + } + // Added in item setting functions. apply EffectCutsceneImmobilize, remove at end, but + // in the middle we do item talents. + if(!GetSpawnInCondition(AI_FLAG_OTHER_LAG_NO_ITEMS, AI_OTHER_MASTER, oTarget)) + { + AI_SpecialActionApplyItem(oTarget); + + // Loop talents (not ones we won't set however) + for(iCnt = i1; iCnt <= i15; iCnt++) + { + // Ignore healing ones. + if(iCnt != i4 && iCnt != i5) + { + AI_SetItemTalentValue(iCnt); + } + } + + AI_SpecialActionRemoveItem(oTarget); + } + // Delete things, FINALLY. really! I mean, this is it, it runs, as it is, + // and the other things run off it as things are met...! + DelayCommand(0.1, DeleteInts(oTarget)); +} + +void DoEffectsOf(object oTarget, object oItem) +{ + // 1.3 = changed to switch statement. + // Note: Anything not done BaseEffects of cannot even be used by the character. + switch(CurrentItemSize) + { + // Tiny weapons - If we are under large size, and is a dagger or similar + case WEAPON_SIZE_TINY: + { + if(CreatureSize < CREATURE_SIZE_LARGE) BaseEffects(oTarget, oItem); + } + break; + // Small Weapons - If we are large (not giant) and size is like a shortsword + case CREATURE_SIZE_SMALL: + { + if(CreatureSize < CREATURE_SIZE_HUGE) BaseEffects(oTarget, oItem); + } + break; + // Medium weapons - If we are over tiny, and size is like a longsword + case WEAPON_SIZE_MEDIUM: + { + if(CreatureSize > CREATURE_SIZE_TINY) BaseEffects(oTarget, oItem); + } + break; + // Large weapons - anything that is over small, and the size is like a spear + case WEAPON_SIZE_LARGE: + { + if(CreatureSize > WEAPON_SIZE_SMALL) BaseEffects(oTarget, oItem); + } + break; + } +} + +//:://///////////////////////////////////////////// +//:: Name BaseEffects +//::////////////////////////////////////////////// +/* + Sets the value (+/- int) of the item + Things like haste are worth more... +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void BaseEffects(object oTarget, object oItem) +{ + // Reset value + CurrentItemValue = i0; + if(GetIsObjectValid(oItem)) + { + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ABILITY_BONUS)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BONUS_FEAT)) + CurrentItemValue += i6; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N)) + CurrentItemValue += i2; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_CAST_SPELL)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS)) + CurrentItemValue += i6; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_REDUCTION)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_RESISTANCE)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_VULNERABILITY)) + CurrentItemValue -= i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DARKVISION)) + CurrentItemValue += i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ABILITY_SCORE)) + CurrentItemValue -= i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_AC)) + CurrentItemValue -= i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER)) + CurrentItemValue -= i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_DAMAGE)) + CurrentItemValue -= i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER)) + CurrentItemValue -= i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SAVING_THROWS)) + CurrentItemValue -= i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC)) + CurrentItemValue -= i3; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER)) + CurrentItemValue -= i2; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS)) + CurrentItemValue += i7; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP)) + CurrentItemValue += i6; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP)) + CurrentItemValue += i6; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE)) + CurrentItemValue += i1; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE)) + CurrentItemValue += i1; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_FREEDOM_OF_MOVEMENT)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_HASTE)) + CurrentItemValue += i12; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_HOLY_AVENGER)) + CurrentItemValue += i10; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)) + CurrentItemValue += i10; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL)) + CurrentItemValue += i12; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMPROVED_EVASION)) + CurrentItemValue += i10; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_KEEN)) + CurrentItemValue += i7; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_LIGHT)) + CurrentItemValue += i1; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MASSIVE_CRITICALS)) + CurrentItemValue += i2; +// if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MIND_BLANK)) +// CurrentItemValue += i4;// Do not think It exsists. + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MONSTER_DAMAGE)) + CurrentItemValue += i1; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_NO_DAMAGE)) + CurrentItemValue -= i10;// EEEKK! Bad bad bad!! + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_HIT_PROPERTIES)) + CurrentItemValue += i8;// Includes all vorpal and so on! +// if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_MONSTER_HIT)) +// CurrentItemValue += i8;// Can't be on a weapon + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_POISON)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION)) + CurrentItemValue += i8; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION_VAMPIRIC)) + CurrentItemValue += i6; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SAVING_THROW_BONUS)) + CurrentItemValue += i5; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC)) + CurrentItemValue += i4; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SKILL_BONUS)) + CurrentItemValue += i2; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SPELL_RESISTANCE)) + CurrentItemValue += i7; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRUE_SEEING)) + CurrentItemValue += i11; + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_TURN_RESISTANCE)) + CurrentItemValue += i8; +// if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_VORPAL)) +// CurrentItemValue += i8;// Removed as Bioware will remove this constant. Doesn't exsist. +// if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_WOUNDING)) +// CurrentItemValue += i8;// Removed as Bioware will remove this constant. Doesn't exsist. + // Special cases + // Set is unlimited to TRUE or FALSE, add 10 if TRUE. + CurrentItemIsUnlimited = GetItemHasItemProperty(oItem, ITEM_PROPERTY_UNLIMITED_AMMUNITION); + if(CurrentItemIsUnlimited) CurrentItemValue += i10; + // Same as above, for mighty + CurrentItemIsMighty = GetItemHasItemProperty(oItem, ITEM_PROPERTY_MIGHTY); + if(CurrentItemIsMighty) CurrentItemValue += i3; + + switch (CurrentItemSize) + { + case WEAPON_SIZE_INVALID:// Invalid Size, stop + { + return; + } + break; + case WEAPON_SIZE_TINY:// Tiny weapons (EG: Daggers, Slings) + { + BaseTinyWeapons(oTarget, oItem); + return; + } + break; + case WEAPON_SIZE_SMALL:// Small Weapons (EG short Swords) + { + BaseSmallWeapons(oTarget, oItem); + return; + } + break; + case WEAPON_SIZE_MEDIUM: // Medium weapons (EG long swords) + { + BaseMediumWeapons(oTarget, oItem); + return; + } + break; + case WEAPON_SIZE_LARGE: // Large Weapons (EG greataxes) + { + BaseLargeWeapons(oTarget, oItem); + return; + } + break; + } + } +} + +//:://///////////////////////////////////////////// +//:: Name BaseLargeWeapons +//::////////////////////////////////////////////// +/* + This adds the maximum damage onto the value +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void BaseLargeWeapons(object oTarget, object oItem) +{ + // No need for weopen size...we know we can use it! + switch(CurrentItemType) + { + case BASE_ITEM_DIREMACE: + { + // This is the only one that needs documenting. All are similar. + if(ProfExotic == TRUE)// We are proficient in exotics... + { + CurrentItemDamage = i16;// Set max damage. + CurrentItemValue += // We add onto the current value some things... + (CurrentItemDamage + // The damage (maximum) done by it. + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_DIRE_MACE)) + // Adds 1 if specailised in it + (GetHasFeat(FEAT_IMPROVED_CRITICAL_DIRE_MACE) * i2) +// Adds 2 if can do good criticals in it + (GetHasFeat(FEAT_WEAPON_FOCUS_DIRE_MACE) * i2)); // Adds 2 if we do +2 damage with it + // If a very big creature - set as a primary weopen + if(CreatureSize >= CREATURE_SIZE_LARGE)//4+ + { + SetPrimaryWeapon(oTarget, oItem); + } + // If a medium creature - set as a two-handed weopen + else if(CreatureSize == CREATURE_SIZE_MEDIUM)//=3 + { + // Add 16 more for a "second" weapon. + CurrentItemValue += CurrentItemDamage; + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_DOUBLEAXE: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i16;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_DOUBLE_AXE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_DOUBLE_AXE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_DOUBLE_AXE) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE)//4+ + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM)//=3 + { + // Add 16 more for a "second" weapon. + CurrentItemValue += i16; + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_TWOBLADEDSWORD: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i16;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_TWO_BLADED_SWORD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_TWO_BLADED_SWORD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + CurrentItemValue += CurrentItemDamage; + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_GREATAXE: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i12;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_GREAT_AXE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_GREAT_AXE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_AXE) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_GREATSWORD: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i12;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_GREAT_SWORD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_GREAT_SWORD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_GREAT_SWORD) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_HALBERD: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HALBERD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_HALBERD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_HALBERD) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_HEAVYFLAIL: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HEAVY_FLAIL)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_HEAVY_FLAIL) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_FLAIL) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_SCYTHE: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SCYTHE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SCYTHE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SCYTHE) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_SHORTSPEAR: + { + if(ProfSimple == TRUE || ProfDruid == TRUE) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SPEAR)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SPEAR) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SPEAR) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + // Note: Should work, should be the same!! + case BASE_ITEM_QUARTERSTAFF: + case BASE_ITEM_MAGICSTAFF: + { + if(ProfWizard == TRUE || ProfSimple == TRUE || ProfRogue == TRUE || + ProfMonk == TRUE || ProfDruid == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_STAFF)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_STAFF) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_STAFF) * i2)); + if(CreatureSize >= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_MEDIUM) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_LONGBOW: + { + if(CreatureSize >= CREATURE_SIZE_MEDIUM && + (ProfMartial == TRUE || ProfElf == TRUE)) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LONGBOW)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LONGBOW) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LONGBOW) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_TOWERSHIELD: + { + if(ProfShield == TRUE && + CreatureSize >= CREATURE_SIZE_MEDIUM) + { + CurrentItemValue += GetItemACValue(oItem); + StoreShield(oTarget, oItem); + } + } + break; + } +} + +//:://///////////////////////////////////////////// +//:: Name BaseMediumWeapons +//::////////////////////////////////////////////// +/* + Adds the damage to the value +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void BaseMediumWeapons(object oTarget, object oItem) +{ + switch (CurrentItemType) + { + case BASE_ITEM_BASTARDSWORD: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_BASTARD_SWORD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_BASTARD_SWORD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_BASTARD_SWORD) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_BATTLEAXE: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_BATTLE_AXE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_BATTLE_AXE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_BATTLE_AXE) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_DWARVENWARAXE: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_DWAXE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_DWAXE) * i2) + + (GetHasFeat(FEAT_EPIC_WEAPON_FOCUS_DWAXE) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + case BASE_ITEM_CLUB: + { + if(ProfWizard == TRUE || ProfSimple == TRUE || + ProfMonk == TRUE || ProfDruid == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_CLUB)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_CLUB) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_CLUB) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_KATANA: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_KATANA)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_KATANA) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_KATANA) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_LIGHTFLAIL: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LIGHT_FLAIL)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LIGHT_FLAIL) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_FLAIL) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_LONGSWORD: + { + if(ProfMartial == TRUE || ProfElf == TRUE) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LONG_SWORD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LONG_SWORD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LONG_SWORD) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_MORNINGSTAR: + { + if(ProfSimple == TRUE || ProfRogue == TRUE) // Primary only + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_MORNING_STAR)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_MORNING_STAR) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_MORNING_STAR) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_RAPIER: + { + if(ProfRogue == TRUE || ProfMartial == TRUE || ProfElf == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_RAPIER)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_RAPIER) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_RAPIER) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_SCIMITAR: + { + if(ProfMartial == TRUE || ProfDruid == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SCIMITAR)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SCIMITAR) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SCIMITAR) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_WARHAMMER: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + GetHasFeat(FEAT_WEAPON_SPECIALIZATION_WAR_HAMMER) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_WAR_HAMMER) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_WAR_HAMMER) * i2)); + if(CreatureSize >= CREATURE_SIZE_MEDIUM) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_SMALL) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_HEAVYCROSSBOW: + { + if(CreatureSize >= CREATURE_SIZE_SMALL && + (ProfWizard == TRUE || ProfSimple == TRUE || + ProfRogue == TRUE || ProfMonk == TRUE)) + { + CurrentItemDamage = i10;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_HEAVY_CROSSBOW) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_SHORTBOW: + { + if(CreatureSize >= CREATURE_SIZE_SMALL && + (ProfRogue == TRUE || ProfMartial == TRUE || ProfElf == TRUE)) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SHORTBOW)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SHORTBOW) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SHORTBOW) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_LARGESHIELD: + { + if(CreatureSize >= CREATURE_SIZE_SMALL && + ProfShield == TRUE) + { + CurrentItemValue += GetItemACValue(oItem); + StoreShield(oTarget, oItem); + } + } + break; + } +} + +//:://///////////////////////////////////////////// +//:: Name BaseSmallWeapons +//::////////////////////////////////////////////// +/* + Adds the damage to the value...then sets it +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// +void BaseSmallWeapons(object oTarget, object oItem) +{ + switch (CurrentItemType) + { + case BASE_ITEM_HANDAXE: + { + if(ProfMonk == TRUE || ProfMartial == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_HAND_AXE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_HAND_AXE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_HAND_AXE) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_KAMA: + { + if(ProfMonk == TRUE || ProfExotic == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_KAMA)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_KAMA) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_KAMA) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_LIGHTHAMMER: + { + if(ProfMartial == TRUE) + { + CurrentItemDamage = i4;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LIGHT_HAMMER) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LIGHT_HAMMER) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_HAMMER) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_LIGHTMACE: + { + if(ProfSimple == TRUE || ProfRogue == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LIGHT_MACE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LIGHT_MACE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_MACE) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_SHORTSWORD: + { + if(ProfRogue == TRUE || ProfMartial == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SHORT_SWORD)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SHORT_SWORD) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SHORT_SWORD) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_WHIP: + { + if(ProfExotic == TRUE) + { + CurrentItemDamage = i2;// Set max damage. + CurrentItemValue += CurrentItemDamage; + // We add a special amount, 10, as it is only used as a secondary + // weapon, and only in the offhand. + CurrentItemValue += i10; + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_SICKLE: + { + if(ProfSimple == TRUE || ProfDruid == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SICKLE)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SICKLE) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SICKLE) * i2)); + if(CreatureSize >= CREATURE_SIZE_SMALL && + CreatureSize <= CREATURE_SIZE_LARGE) + { + SetPrimaryWeapon(oTarget, oItem); + } + else if(CreatureSize == CREATURE_SIZE_TINY) + { + SetTwoHandedWeapon(oTarget, oItem); + } + } + } + break; + case BASE_ITEM_DART: + { + // Ranged weapons below + if(CreatureSize <= CREATURE_SIZE_LARGE && + (ProfSimple == TRUE || ProfRogue == TRUE || ProfDruid == TRUE)) + { + CurrentItemDamage = i4;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_DART)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_DART) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_DART) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_LIGHTCROSSBOW: + { + if(CreatureSize <= CREATURE_SIZE_LARGE && + (ProfWizard == TRUE || ProfSimple == TRUE || + ProfRogue == TRUE || ProfMonk == TRUE)) + { + CurrentItemDamage = i8;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_LIGHT_CROSSBOW) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_SLING: + { + if(CreatureSize <= CREATURE_SIZE_LARGE && + (ProfSimple == TRUE || ProfMonk == TRUE || ProfDruid == TRUE)) + { + CurrentItemDamage = i4;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CurrentItemIsMighty * CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SLING)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SLING) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SLING) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_THROWINGAXE: + { + if(CreatureSize <= CREATURE_SIZE_LARGE && ProfMartial == TRUE) + { + CurrentItemDamage = i6;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (CreatureStrength) + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SLING)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SLING) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SLING) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_SMALLSHIELD: + { + if(ProfShield) + { + CurrentItemValue += GetItemACValue(oItem); + StoreShield(oTarget, oItem); + } + } + break; + } +} + +//:://///////////////////////////////////////////// +//:: Name BaseTinyWeapons +//::////////////////////////////////////////////// +/* + Adds damage to the value, and sets it. +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void BaseTinyWeapons(object oTarget, object oItem) +{ + switch (CurrentItemType) + { + case BASE_ITEM_DAGGER: + { + if(CreatureSize <= CREATURE_SIZE_MEDIUM && + (ProfWizard == TRUE || ProfSimple == TRUE || ProfRogue == TRUE || + ProfMonk == TRUE || ProfDruid == TRUE)) + { + CurrentItemDamage = i4;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_DAGGER)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_DAGGER) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_DAGGER) * i2)); + SetPrimaryWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_KUKRI: + { + if(CreatureSize <= CREATURE_SIZE_MEDIUM && ProfExotic == TRUE) + { + CurrentItemDamage = i4;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_KUKRI)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_KUKRI) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_KUKRI) * i2)); + SetPrimaryWeapon(oTarget, oItem); + } + } + break; + case BASE_ITEM_SHURIKEN: + { + // Ranged weapons below + if(CreatureSize <= CREATURE_SIZE_MEDIUM && + (ProfMonk == TRUE || ProfExotic == TRUE)) + { + CurrentItemDamage = i3;// Set max damage. + CurrentItemValue += (CurrentItemDamage + + (GetHasFeat(FEAT_WEAPON_SPECIALIZATION_SHURIKEN)) + + (GetHasFeat(FEAT_IMPROVED_CRITICAL_SHURIKEN) * i2) + + (GetHasFeat(FEAT_WEAPON_FOCUS_SHURIKEN) * i2)); + StoreRangedWeapon(oTarget, oItem); + } + } + break; + } +} +//:://///////////////////////////////////////////// +//:: Name SetPrimaryWeapon +//::////////////////////////////////////////////// +/* + If the value of the object is greater than the + stored one, set it. + If the weopen is of lesser value, and can deul + wield, then set it as a weopen that can be deul wielded. + + Re-written. Sets the objects into an array (at the end). +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void SetPrimaryWeapon(object oTarget, object oItem) +{ + // We insert the value into an array of all primary weapons, based + // on value. + if(CurrentItemType != BASE_ITEM_WHIP) // WHIPs are secondary only + { + ArrayOfWeapons(AI_WEAPON_PRIMARY, oTarget, oItem, CurrentItemValue); + } + // We also set up secondary array for all weapons which can be used well + // in the off hand. + // This takes some value off for size of weapon...depending on our size! + // IE to hit is lower, it is a lower value. + if(ProfTwoWeapons == TRUE && + // 4 = Light flail, 47 = Morningstar - NOT a valid second weapon. + CurrentItemType != BASE_ITEM_LIGHTFLAIL && + CurrentItemType != BASE_ITEM_MORNINGSTAR) + { + ArrayOfWeapons(AI_WEAPON_SECONDARY, oTarget, oItem, CurrentItemValue, TRUE); + } +} +//:://///////////////////////////////////////////// +//:: Name SetTwoHandedWeapon +//::////////////////////////////////////////////// +/* + Sets a two-handed weopen to use. +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void SetTwoHandedWeapon(object oTarget, object oItem) +{ + // We insert the value into an array of all 2 handed weapons, based + // on value. + ArrayOfWeapons(AI_WEAPON_TWO_HANDED, oTarget, oItem, CurrentItemValue); +} + +//:://///////////////////////////////////////////// +//:: Name SetRangedWeapon +//::////////////////////////////////////////////// +/* + Sets a ranged weopen - based on ammo as well + We only set one (until we don't use it) and in the AI + checks for ammo. Important - the default AI does't do that + well, and just equips a HTH weapon instead! + - Name SetAmmoCounters + Used to check ammo - for setting ranged weopen + - Name StoreRangedWeapon + First part of setting ranged weopen. Stores it! + It needs to check for ammo when it is set, you see +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void StoreRangedWeapon(object oTarget, object oItem) +{ + int nNth = GetLocalInt(oTarget, SETWEP_DISTANCE); + nNth++; + string sNth = IntToString(nNth); + // Special: If unlimited ammo, we will use regardless of ammo. + SetLocalInt(oItem, SETWEP_IS_UNLIMITED, CurrentItemIsUnlimited); + SetLocalInt(oItem, SETWEP_VALUE, CurrentItemValue); + SetLocalObject(oTarget, SETWEP_DISTANCE + sNth, oItem); + SetLocalInt(oTarget, SETWEP_DISTANCE, nNth); +} + +void SetAmmoCounters(object oTarget) +{ + switch(CurrentItemType) + { + case BASE_ITEM_ARROW: + { + HasArrows = TRUE; + return; + } + break; + case BASE_ITEM_BOLT: + { + HasBolts = TRUE; + return; + } + break; + case BASE_ITEM_BULLET: + { + HasBullets = TRUE; + return; + } + break; + } +} + +void SetRangedWeapon(object oTarget) +{ + // Special: We set 2 weapons. The second just states there is a second + // and so we re-set weapons if we get round to using it. + int nNth = i1; + string sNth = IntToString(nNth); + object oItem = GetLocalObject(oTarget, SETWEP_DISTANCE + sNth); + int nBase, iHighestValueWeapon, iValue, iUnlimited, iShield, + iNextHighestValueWeapon, iHighestUnlimited, iAmmoSlot; + object oHighestItem, oNextHighestItem; + + while(GetIsObjectValid(oItem)) + { + nBase = GetBaseItemType(oItem); + iValue = GetLocalInt(oItem, SETWEP_VALUE); + iUnlimited = GetLocalInt(oItem, SETWEP_IS_UNLIMITED); + if(nBase == BASE_ITEM_DART || nBase == BASE_ITEM_SHURIKEN || + nBase == BASE_ITEM_THROWINGAXE) + // 31 = Dart, 59 = Shuriken, 63 = Throwing axe + { + //iHighestValueWeapon starts as 0, so + if(iValue > iHighestValueWeapon || + iHighestValueWeapon == i0) + { + iHighestValueWeapon = iValue; + oHighestItem = oItem; + iShield = TRUE; + // We set right hand, because it is a throwing weapon + iAmmoSlot = INVENTORY_SLOT_RIGHTHAND; + iHighestUnlimited = iUnlimited; + } + else if(iValue > iNextHighestValueWeapon || + iNextHighestValueWeapon == i0) + { + iNextHighestValueWeapon = iValue; + oNextHighestItem = oItem; + } + } + else if(nBase == BASE_ITEM_HEAVYCROSSBOW || + nBase == BASE_ITEM_LIGHTCROSSBOW)// 6 = Heavy, 7 = Light X-bow + { + if(HasBolts == TRUE || iUnlimited == TRUE) + { + if(iValue > iHighestValueWeapon || + iHighestValueWeapon == i0) + { + iHighestValueWeapon = iValue; + oHighestItem = oItem; + iAmmoSlot = INVENTORY_SLOT_BOLTS; + iShield = FALSE; + iHighestUnlimited = iUnlimited; + } + else if(iValue > iNextHighestValueWeapon || + iNextHighestValueWeapon == i0) + { + iNextHighestValueWeapon = iValue; + oNextHighestItem = oItem; + } + } + } + else if(nBase == BASE_ITEM_LONGBOW || + nBase == BASE_ITEM_SHORTBOW)// 8 = Long, 11 = Short bow + { + if(HasArrows == TRUE || iUnlimited == TRUE) + { + if(iValue > iHighestValueWeapon || + iHighestValueWeapon == i0) + { + iHighestValueWeapon = iValue; + oHighestItem = oItem; + iShield = FALSE; + iAmmoSlot = INVENTORY_SLOT_ARROWS; + iHighestUnlimited = iUnlimited; + } + else if(iValue > iNextHighestValueWeapon || + iNextHighestValueWeapon == i0) + { + iNextHighestValueWeapon = iValue; + oNextHighestItem = oItem; + } + } + } + else if(nBase == BASE_ITEM_SLING)// 61 = Sling + { + if(HasBullets == TRUE || iUnlimited == TRUE) + { + if(iValue > iHighestValueWeapon || + iHighestValueWeapon == i0) + { + iHighestValueWeapon = iValue; + oHighestItem = oItem; + iShield = TRUE; + iAmmoSlot = INVENTORY_SLOT_BULLETS; + iHighestUnlimited = iUnlimited; + } + else if(iValue > iNextHighestValueWeapon || + iNextHighestValueWeapon == i0) + { + iNextHighestValueWeapon = iValue; + oNextHighestItem = oItem; + } + } + } + DeleteLocalInt(oItem, SETWEP_VALUE); + DeleteLocalInt(oItem, SETWEP_IS_UNLIMITED); + DeleteLocalObject(oTarget, SETWEP_DISTANCE + sNth); + nNth++; + sNth = IntToString(nNth); + oItem = GetLocalObject(oTarget, SETWEP_DISTANCE + sNth); + } + // No setting if not valid! + if(GetIsObjectValid(oHighestItem)) + { + SWFinalAIObject(oTarget, AI_WEAPON_RANGED, oHighestItem); + SWFinalAIInteger(oTarget, AI_WEAPON_RANGED_AMMOSLOT, iAmmoSlot); + if(iHighestUnlimited) + { + SWFinalAIInteger(oTarget, AI_WEAPON_RANGED_IS_UNLIMITED, iHighestUnlimited); + } + // Can a shield be used with it? Default is 0, we only set non 0 values. + if(iShield) + { + SWFinalAIInteger(oTarget, AI_WEAPON_RANGED_SHIELD, iShield); + } + // No setting if not valid! + if(GetIsObjectValid(oNextHighestItem)) + { + SWFinalAIObject(oTarget, AI_WEAPON_RANGED_2, oNextHighestItem); + } + } +} + +//:://///////////////////////////////////////////// +//:: Name SetShield, StoreShield +//::////////////////////////////////////////////// +/* + V. Simple. If value is higher, set the shield +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +void StoreShield(object oTarget, object oItem) +{ + int nNth = GetLocalInt(oTarget, SETWEP_SHIELD); + nNth++; + string sNth = IntToString(nNth); + // Set the value, so we can use the top values again. + SetLocalInt(oItem, SETWEP_VALUE, CurrentItemValue); + SetLocalObject(oTarget, SETWEP_SHIELD + sNth, oItem); + SetLocalInt(oTarget, SETWEP_SHIELD, nNth); +} + +void SetShield(object oTarget) +{ + int nNth = i1; + string sNth = IntToString(nNth); + object oItem = GetLocalObject(oTarget, SETWEP_SHIELD + sNth); + int iHighestValueShield, iValue, iNextHighestValueShield; + object oHighestShield, oNextHighestShield; + + while(GetIsObjectValid(oItem)) + { + iValue = GetLocalInt(oItem, SETWEP_VALUE); + if(iValue > iHighestValueShield) + { + oHighestShield = oItem; + iHighestValueShield = iValue; + } + else if(iValue > iNextHighestValueShield) + { + oNextHighestShield = oItem; + iNextHighestValueShield = iValue; + } + DeleteLocalInt(oItem, SETWEP_VALUE); + DeleteLocalObject(oTarget, SETWEP_SHIELD + sNth); + nNth++; + sNth = IntToString(nNth); + // Get next shield + oItem = GetLocalObject(oTarget, SETWEP_SHIELD + sNth); + } + if(GetIsObjectValid(oHighestShield)) + { + SWFinalAIObject(oTarget, AI_WEAPON_SHIELD, oHighestShield); + // Need original if second + if(GetIsObjectValid(oNextHighestShield)) + { + SWFinalAIObject(oTarget, AI_WEAPON_SHIELD_2, oNextHighestShield); + } + } +} + +//:://///////////////////////////////////////////// +//:: Name GetWeoponSize +//::////////////////////////////////////////////// +/* + Returns the Base Weopen size of oItem +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// + +int GetWeaponSize(object oItem) +{ + switch(GetBaseItemType(oItem)) + { + // Tiny + // 22, 42, 59. + case BASE_ITEM_DAGGER: + case BASE_ITEM_KUKRI: + case BASE_ITEM_SHURIKEN: + return WEAPON_SIZE_TINY; + break; + // Small + // 0, 7, 9, 14, 31, 37, 38, 40, 60, 61, 63 + case BASE_ITEM_SHORTSWORD: + case BASE_ITEM_LIGHTCROSSBOW: + case BASE_ITEM_LIGHTMACE: + case BASE_ITEM_SMALLSHIELD: + case BASE_ITEM_DART: + case BASE_ITEM_LIGHTHAMMER: + case BASE_ITEM_HANDAXE: + case BASE_ITEM_KAMA: + case BASE_ITEM_SICKLE: + case BASE_ITEM_SLING: + case BASE_ITEM_THROWINGAXE: + case BASE_ITEM_WHIP: // Hordes + return WEAPON_SIZE_SMALL; + break; + // Medium + // 1, 2, 3, 4, 5, 6, 11, 28, 41, 47, 51, 53, 56 + // 1-6 = + // BASE_ITEM_LONGSWORD, BASE_ITEM_BATTLEAXE, BASE_ITEM_BASTARDSWORD + // BASE_ITEM_LIGHTFLAIL, BASE_ITEM_WARHAMMER, BASE_ITEM_HEAVYCROSSBOW + case BASE_ITEM_LONGSWORD: + case BASE_ITEM_BATTLEAXE: + case BASE_ITEM_BASTARDSWORD: + case BASE_ITEM_LIGHTFLAIL: + case BASE_ITEM_WARHAMMER: + case BASE_ITEM_HEAVYCROSSBOW: + case BASE_ITEM_SHORTBOW: + case BASE_ITEM_CLUB: + case BASE_ITEM_KATANA: + case BASE_ITEM_MORNINGSTAR: + case BASE_ITEM_RAPIER: + case BASE_ITEM_SCIMITAR: + case BASE_ITEM_LARGESHIELD: + case BASE_ITEM_DWARVENWARAXE: // Hordes + return WEAPON_SIZE_MEDIUM; + break; + // Large weapons + // 8, 10, 12, 13, 18, 32, 33, 35, 45, 50, 55, 57, 58 + case BASE_ITEM_LONGBOW: + case BASE_ITEM_HALBERD: + case BASE_ITEM_TWOBLADEDSWORD: + case BASE_ITEM_GREATSWORD: + case BASE_ITEM_GREATAXE: + case BASE_ITEM_DIREMACE: + case BASE_ITEM_DOUBLEAXE: + case BASE_ITEM_HEAVYFLAIL: + case BASE_ITEM_MAGICSTAFF: + case BASE_ITEM_QUARTERSTAFF: + case BASE_ITEM_SCYTHE: + case BASE_ITEM_TOWERSHIELD: + case BASE_ITEM_SHORTSPEAR: + return WEAPON_SIZE_LARGE; + break; + } + return FALSE; +} + +//:://///////////////////////////////////////////// +//:: Name DeleteInts +//::////////////////////////////////////////////// +/* + Deletes everything, like what weopen they are using + and what proficiencies they have that may be stored. +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// +void DeleteInts(object oTarget) +{ + // Deletes the INT's, for values, in the array's. + DeleteValueInts(oTarget, AI_WEAPON_PRIMARY); + DeleteValueInts(oTarget, AI_WEAPON_SECONDARY); + DeleteValueInts(oTarget, AI_WEAPON_TWO_HANDED); + // Missile and shield ones. + DeleteLocalInt(oTarget, SETWEP_DISTANCE); + DeleteLocalInt(oTarget, SETWEP_SHIELD); +} + +//:://///////////////////////////////////////////// +//:: Name ArrayOfWeapons, MoveArrayBackOne +//::////////////////////////////////////////////// +/* + This is the arrays, IE sets up what weapons + we have value first, good for searching through + later and +*/ +//::////////////////////////////////////////////// +//:: Created By: Yrean +//:: Modified By: Jasperre +//::////////////////////////////////////////////// +void ArrayOfWeapons(string sArray, object oTarget, object oItem, int iValue, int iSecondary = FALSE) +{ + // Check for if it is secondary. + // We add some value based on the creature size against weapon size. + // - We also may take away some. + int iSetValue = iValue; + if(iSecondary == TRUE) + { + // We take 2 or add 2 for different sizes. Not too much...but enough? + iSetValue += ((CreatureSize - CurrentItemSize) * i2); + } + int iOtherItemsValues, i, iBreak; + int iMax = GetLocalInt(oTarget, MAXINT_ + sArray); + string sArrayStore; + // Special - no max items! + if(iMax < i1) + { + sArrayStore = sArray + s1; + SetLocalInt(oTarget, sArrayStore, iSetValue); + SetLocalInt(oTarget, sArrayStore + WEAP_SIZE, CurrentItemSize); + SetLocalInt(oTarget, sArrayStore + WEAP_DAMAGE, CurrentItemDamage); + SetLocalObject(oTarget, sArrayStore, oItem); + iMax++; + SetLocalInt(oTarget, MAXINT_ + sArray, iMax); + } + // Else, we will set it in the array. + else + { + // Loop through the items stored already. + for(i = i1; (i <= iMax && iBreak != TRUE); i++) + { + // Get the value of the item. + iOtherItemsValues = GetLocalInt(oTarget, sArray + IntToString(i)); + // If imput is greater than stored...move all of them back one. + if(iValue > iOtherItemsValues) + { + // Set weapon size as well. + sArrayStore = sArray + IntToString(i); + MoveArrayBackOne(sArray, i, oTarget, iMax); + SetLocalInt(oTarget, sArrayStore, iSetValue); + SetLocalInt(oTarget, sArrayStore + WEAP_SIZE, CurrentItemSize); + SetLocalInt(oTarget, sArrayStore + WEAP_DAMAGE, CurrentItemDamage); + SetLocalObject(oTarget, sArrayStore, oItem); + iMax++; + SetLocalInt(oTarget, MAXINT_ + sArray, iMax); + iBreak = TRUE; + } + // If end, we set to the end :-) + else if(i == iMax) + { + // Set weapon size as well. Add one to i to be at the end. + sArrayStore = sArray + IntToString(i + i1); + SetLocalInt(oTarget, sArrayStore, iSetValue); + SetLocalInt(oTarget, sArrayStore + WEAP_SIZE, CurrentItemSize); + SetLocalInt(oTarget, sArrayStore + WEAP_DAMAGE, CurrentItemDamage); + SetLocalObject(oTarget, sArrayStore, oItem); + iMax++; + SetLocalInt(oTarget, MAXINT_ + sArray, iMax); + iBreak = TRUE; + } + } + } +} + +void MoveArrayBackOne(string sArray, int iNumberStart, object oTarget, int iMax) +{ + // Get the first item... + object oItemAtNumber; + string sCurrentName, sNewName; + int iItemAtNumberValue, i, iCurrentItemSize, iCurrentItemDamage; + // Move it from the back, back one, then then next... + for(i = iMax; i >= iNumberStart; i--) + { + // Sets the name up right. + sCurrentName = sArray + IntToString(i); + sNewName = sArray + IntToString(i + i1); + // Set the things up in the right parts. + oItemAtNumber = GetLocalObject(oTarget, sCurrentName); + iItemAtNumberValue = GetLocalInt(oTarget, sCurrentName); + iCurrentItemSize = GetLocalInt(oTarget, sCurrentName + WEAP_SIZE); + iCurrentItemDamage = GetLocalInt(oTarget, sCurrentName + WEAP_DAMAGE); + // To the NEW name - we add one to the i value. + SetLocalObject(oTarget, sNewName, oItemAtNumber); + SetLocalInt(oTarget, sNewName, iItemAtNumberValue); + SetLocalInt(oTarget, sNewName + WEAP_SIZE, iCurrentItemSize); + SetLocalInt(oTarget, sNewName + WEAP_DAMAGE, iCurrentItemSize); + } +} +void DeleteDatabase(object oTarget, string sArray) +{ + int iMax = GetLocalInt(oTarget, MAXINT_ + sArray); + int i; + string sNewName; + if(iMax) + { + for(i = i1; i <= iMax; i++) + { + sNewName = sArray + IntToString(i); + DeleteLocalObject(oTarget, sNewName);// Object + DeleteLocalInt(oTarget, sNewName);// Value + DeleteLocalInt(oTarget, sNewName + WEAP_SIZE);// Size + DeleteLocalInt(oTarget, sNewName + WEAP_DAMAGE);// Damage + } + } + // Here, we do delete the max + DeleteLocalInt(oTarget, MAXINT_ + sArray); +} +void DeleteValueInts(object oTarget, string sArray) +{ + int iMax = GetLocalInt(oTarget, MAXINT_ + sArray); + int i; + if(iMax) + { + for(i = i1; i <= iMax; i++) + { + DeleteLocalInt(oTarget, sArray + IntToString(i)); + } + } + // Note: We keep the size... +} + +void SWFinalAIObject(object oTarget, string sName, object oObject) +{ + SetLocalObject(oTarget, AI_OBJECT + sName, oObject); +} +void SWFinalAIInteger(object oTarget, string sName, int iInt) +{ + SetLocalInt(oTarget, AI_INTEGER + sName, iInt); +} +void SWDeleteAIObject(object oTarget, string sName) +{ + DeleteLocalObject(oTarget, AI_OBJECT + sName); +} +void SWDeleteAIInteger(object oTarget, string sName) +{ + DeleteLocalInt(oTarget, AI_INTEGER + sName); +} + +// reset healing kits only on oTarget. +void ResetHealingKits(object oTarget) +{ + object oItem, oHighestKit; + int iHealingKitsAmount, iItemValue; + int iRunningValue = i0; // For kits + // The inventory + oItem = GetFirstItemInInventory(oTarget); + while(GetIsObjectValid(oItem)) + { + if(GetBaseItemType(oItem) == BASE_ITEM_HEALERSKIT) + { + iHealingKitsAmount++; + iItemValue = GetGoldPieceValue(oItem); + // Stacked kits be worth what they should be seperatly. + iItemValue = iItemValue/GetNumStackedItems(oItem); + if(iItemValue > iRunningValue) + { + iRunningValue = iItemValue; + oHighestKit = oItem; + } + } + oItem = GetNextItemInInventory(oTarget); + } + // Need some, any! + if(iHealingKitsAmount > i0) + { + // set healing kits (if any) + SWFinalAIObject(oTarget, AI_VALID_HEALING_KIT_OBJECT, oHighestKit); + // Set amount left + SWFinalAIInteger(oTarget, AI_VALID_HEALING_KITS, iHealingKitsAmount); + } +} + +void DeleteAllPreviousWeapons(object oTarget) +{ + DeleteDatabase(oTarget, AI_WEAPON_PRIMARY); + DeleteDatabase(oTarget, AI_WEAPON_SECONDARY); + DeleteDatabase(oTarget, AI_WEAPON_TWO_HANDED); + + SWDeleteAIInteger(oTarget, AI_WEAPON_RANGED_SHIELD); + SWDeleteAIInteger(oTarget, AI_WEAPON_RANGED_IS_UNLIMITED); + SWDeleteAIInteger(oTarget, AI_WEAPON_RANGED_AMMOSLOT); + SWDeleteAIObject(oTarget, AI_WEAPON_RANGED); + SWDeleteAIObject(oTarget, AI_WEAPON_RANGED_2); + SWDeleteAIObject(oTarget, AI_WEAPON_SHIELD); + SWDeleteAIObject(oTarget, AI_WEAPON_SHIELD_2); +} + +// Special: Apply EffectCutsceneImmobilize +void AI_SpecialActionApplyItem(object oTarget) +{ + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneImmobilize(), oTarget); +} +// Special: Remove EffectCutsceneImmobilize +void AI_SpecialActionRemoveItem(object oTarget) +{ + effect eCheck = GetFirstEffect(oTarget); + while(GetIsEffectValid(eCheck)) + { + if(GetEffectType(eCheck) == EFFECT_TYPE_CUTSCENEIMMOBILIZE && + GetEffectSpellId(eCheck) == iM1) RemoveEffect(oTarget, eCheck); + eCheck = GetNextEffect(oTarget); + } +} +// Gets a item talent value +// - iTalent, 1-21. +void AI_SetItemTalentValue(int iTalent) +{ + // We are already EffectCutsceneImmobilized + + // Simply get the best. + talent tCheck = GetCreatureTalentBest(iTalent, i20); + int iValue = GetIdFromTalent(tCheck); + + // Set to value. + SetAIConstant(ITEM_TALENT_VALUE + IntToString(iTalent), iValue); +} + +//void main(){ SetWeapons(); } diff --git a/nwnds_module/j_inc_spawnin.nss b/nwnds_module/j_inc_spawnin.nss new file mode 100644 index 000000000..7739f8df1 --- /dev/null +++ b/nwnds_module/j_inc_spawnin.nss @@ -0,0 +1,1242 @@ +/************************ [Spawn In Include] *********************************** + Filename: J_Inc_SpawnIn +************************* [Spawn In Include] *********************************** + This contains all the functions used in the spawning process, in one easy + and very long file. + + It also importantly sets up spells we have, or at least talents, so we + know if we have any spells from category X. +************************* [History] ******************************************** + 1.3 - Changed, added a lot of new things (such as constants file) +************************* [Workings] ******************************************* + This doesn't call anything to run the rest, except AI_SetUpEndOfSpawn has + a lot of things that the generic AI requires (SetListeningPatterns and skills + and waypoints ETC) + + See the spawn in script for all the actual uses. +************************* [Arguments] ****************************************** + Arguments: N/A see spawn in script +************************* [Spawn In Include] **********************************/ + +// All constants. +#include "j_inc_setweapons" +// Set weapons +// - Constants file is in this + +// Special: Bioware SoU Waypoints/Animations constants +// - Here so I know where they are :-P +const string sAnimCondVarname = "NW_ANIM_CONDITION"; +// If set, the NPC is civilized +const int NW_ANIM_FLAG_IS_CIVILIZED = 0x00000400; +// If set, the NPC will use voicechats +const int NW_ANIM_FLAG_CHATTER = 0x00000004; +// If set, the NPC is mobile in a close-range +const int NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE = 0x00000200; + +/******************************************************************************/ +// Functions: +/******************************************************************************/ +// This will activate one aura, very quickly. +// If we have more than one...oh well. +void AI_AdvancedAuras(); +// Activate the aura number, if it is possible. +void AI_ActivateAura(int nAuraNumber); +// This is an attempt to speed up some things. +// We use talents to set general valid categories. +// Levels are also accounted for, checking the spell given and using a switch +// statement to get the level. +void AI_SetUpSpells(); + +// Base for moving round thier waypoints +// - Uses ExectuteScript to run the waypoint walking. +void SpawnWalkWayPoints(int nRun = FALSE, float fPause = 1.0); + +// Sets up what we will listen to (everything!) +void AI_SetListeningPatterns(); +// This will set what creature to create OnDeath. +void AI_SetDeathResRef(string sResRef); +// This will set the string, sNameOfValue, to sValue. Array size of 1. +// - Use iPercentToSay to determine what % out of 100 it is said. +void AI_SetSpawnInSpeakValue(string sNameOfValue, string sValue, int iPercentToSay = 100); +// This will choose a random string, using iAmountOfValues, which is +// the amount of non-empty strings given. The size of the array is therefore 1. +// - Use iPercentToSay to determine what % out of 100 it is said. +void AI_SetSpawnInSpeakRandomValue(string sNameOfValue, int iPercentToSay, int iAmountOfValues, string sValue1, string sValue2, string sValue3 = "", string sValue4 = "", string sValue5 = "", string sValue6 = "", string sValue7 = "", string sValue8 = "", string sValue9 = "", string sValue10 = "", string sValue11 = "", string sValue12 = ""); +// This will set an array of values, to sNameOfValue, for one to be chosen to +// be said at the right time :-) +// - sNameOfValue must be a valid name. +// - Use iPercentToSay to determine what % out of 100 it is said. +// NOTE: If the sNameOfValue is any combat one, we make that 1/100 to 1/1000. +void AI_SetSpawnInSpeakArray(string sNameOfValue, int iPercentToSay, int iSize, string sValue1, string sValue2, string sValue3 = "", string sValue4 = "", string sValue5 = "", string sValue6 = "", string sValue7 = "", string sValue8 = "", string sValue9 = "", string sValue10 = "", string sValue11 = "", string sValue12 = ""); + +// This applies an increase, decrease or no change to the intended stat. +void AI_ApplyStatChange(int iStat, int iAmount); +// This will alter (magically) an ammount of random stats - iAmount +// by a value within iLowest and iHighest. +void AI_CreateRandomStats(int iLowest, int iHighest, int iAmount); +// This will randomise other stats. Put both numbers to 0 to ignore some. +// iHPMin, iHPMax = HP changes. +// iReflexSaveMin, iReflexSaveMax = Reflex Save changes +// iWillSaveMin, iWillSaveMax = Will Save changes +// iFortSaveMin, iFortSaveMax = Fortitude Save changes +// iACMin, iACMax = AC change. +// Use iACType to define the AC type - default AC_DODGE_BONUS +void AI_CreateRandomOther(int iHPMin, int iHPMax, int iReflexSaveMin = 0, int iReflexSaveMax = 0, int iWillSaveMin = 0, int iWillSaveMax = 0, int iFortSaveMin = 0, int iFortSaveMax = 0, int iACMin = 0, int iACMax = 0, int iACType = AC_DODGE_BONUS); + +// Sets up thier selection of skills, to integers, if they would ever use them. +// NOTE: it also triggers "hide" if they have enough skill and not stopped. +void AI_SetUpSkillToUse(); +// Sets the turning level if we have FEAT_TURN_UNDEAD. +// - Called from AI_SetUpEndOfSpawn. +void AI_SetTurningLevel(); +// This MUST be called. It fires these events: +// SetUpSpells, SetUpSkillToUse, SetListeningPatterns, SetWeapons, AdvancedAuras. +// These MUST be called! the AI might fail to work correctly if they don't fire! +void AI_SetUpEndOfSpawn(); +// This will make the visual effect passed play INSTANTLY at the creatures location. +// * iVFX - The visual effect constant number +void AI_SpawnInInstantVisual(int iVFX); +// This will make the visual effect passed play PERMAMENTLY. +// * iVFX - The visual effect constant number +// NOTE: They will be made to be SUPERNATUAL, so are not dispelled! +void AI_SpawnInPermamentVisual(int iVFX); +// This should not be used! +// * called from SetUpEndOfSpawn. +void AI_SetMaybeFearless(); +// This will set the MAXIMUM and MINIMUM targets to pass this stage (under sName) +// of the targeting system. IE: +// - If we set it to min of 5, max of 10, for AC, if we cancled 5 targets on having +// AC higher then wanted, we will take the highest 5 minimum. +// If there are over 10, we take a max of 10 to choose from. +// * iType - must be TARGET_HIGHER or TARGET_LOWER. Defaults to the lowest, so it +// targets the lowest value for sName. +void AI_SetAITargetingValues(string sName, int iType, int iMinimum, int iMaximum); + + +// Levels up us. +// * nLevel - Levels to this number (doesn't do anything if already GetHitDice >= nLevel). +// * nClass, nClass2, nClass3 - the 3 classes to level up in. Only needs 1 minimum +// Spreads equally if there is more then 1 nClass. +// Sets up spells to use automatically, but DOES NOT CHANGE CHALLENGE RATING! +void AI_LevelUpCreature(int nLevel, int nClass, int nClass2 = CLASS_TYPE_INVALID, int nClass3 = CLASS_TYPE_INVALID); + +// Used in AI_LevelUpCreature. +// - Levels up OBJECT_SELF, in nClass for nLevels +void AI_LevelLoop(int nClass, int nLevels); + +// Sets up what random spells to cheat-cast at the end of all known spells. +// it does NOT check for immunities, barriers, or anything else. +// - You can set spells to more then one of the imputs to have a higher % to cast that one. +void SetAICheatCastSpells(int iSpell1, int iSpell2, int iSpell3, int iSpell4, int iSpell5, int iSpell6); + +// Mark that the given creature has the given condition set for anitmations +// * Bioware SoU animations thing. +void SetAnimationCondition(int nCondition, int bValid = TRUE, object oCreature = OBJECT_SELF); + +// Sets we are a Beholder and use Ray attacks, and Animagic Ray. +void SetBeholderAI(); +// Set we are a mindflayer, and uses some special AI for them. +void SetMindflayerAI(); + +// This will set a spell trigger up. Under cirtain conditions, spells are released +// and cast on the caster. +// Once fired, a spell trigger is only reset by resting. Only 1 of each max is fired at once! +// * sType - is specifically: +// SPELLTRIGGER_DAMAGED_AT_PERCENT - When damaged, the trigger fires. Use iValue for the %. One at a time is fired. +// SPELLTRIGGER_IMMOBILE - Fired when held/paralyzed/sleeping ETC. One at a time is fired. +// SPELLTRIGGER_NOT_GOT_FIRST_SPELL - Makes sure !GetHasSpellEffect(iSpell1) already, +// then fires. Checks all in this category each round (first one fires!) +// SPELLTRIGGER_START_OF_COMBAT - Triggered always, at the start of DetermineCombatRound. +// * iNumber - can be 1-9, in sequential order of when you want them to fire. +// * iValue - is only required with DAMAGED_AT_PERCENT. +// * iSpellX - Cannot be 0. It should only really be defensive spells. +void SetSpellTrigger(string sType, int iValue, int iNumber, int iSpell1, int iSpell2 = 0, int iSpell3 = 0, int iSpell4 = 0, int iSpell5 = 0, int iSpell6 = 0, int iSpell7 = 0, int iSpell8 = 0, int iSpell9 = 0); + +// Mark that the given creature has the given condition set +void SetAnimationCondition(int nCondition, int bValid = TRUE, object oCreature = OBJECT_SELF) +{ + int nCurrentCond = GetLocalInt(oCreature, sAnimCondVarname); + if (bValid) { + SetLocalInt(oCreature, sAnimCondVarname, nCurrentCond | nCondition); + } else { + SetLocalInt(oCreature, sAnimCondVarname, nCurrentCond & ~nCondition); + } +} + +// Sets up what random spells to cheat-cast at the end of all known spells. +// it does NOT check for immunities, barriers, or anything else. +// - You can set spells to more then one of the imputs to have a higher % to cast that one. +void SetAICheatCastSpells(int iSpell1, int iSpell2, int iSpell3, int iSpell4, int iSpell5, int iSpell6) +{ + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i1), iSpell1); + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i2), iSpell2); + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i3), iSpell3); + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i4), iSpell4); + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i5), iSpell5); + SetAIConstant(AI_CHEAT_CAST_SPELL + IntToString(i6), iSpell6); +} + + +// Levels up us. +// * nLevel - Levels to this number (doesn't do anything if already GetHitDice >= nLevel). +// * nClass, nClass2, nClass3 - the 3 classes to level up in. Only needs 1 minimum +// - Spreads equally if there is more then 1 nClass. +// - Sets up spells to use automatically, but DOES NOT CHANGE CHALLENGE RATING! +// - Does NOT check for validness, or report any information. +void AI_LevelUpCreature(int nLevel, int nClass, int nClass2 = CLASS_TYPE_INVALID, int nClass3 = CLASS_TYPE_INVALID) +{ + // Divide by 1, 2 or 3 (100%, 50%, 33%) + int iDivideBy = (nClass >= i0) + (nClass2 >= i0) + (nClass3 >= i0); + + int iTotalPerClass = nLevel / iDivideBy; + + // Limit and loop - Class 1. + AI_LevelLoop(nClass, iTotalPerClass); + // 2 + AI_LevelLoop(nClass2, iTotalPerClass); + // 3 + AI_LevelLoop(nClass3, iTotalPerClass); +} + +// Used in AI_LevelUpCreature. +// - Levels up OBJECT_SELF, in iClass for nLevels +void AI_LevelLoop(int nClass, int nLevels) +{ + // Limit and loop + while(nLevels > FALSE) + { + LevelUpHenchman(OBJECT_SELF, nClass, TRUE); + nLevels--; + } +} + + +// This will set what creature to create OnDeath. +void AI_SetDeathResRef(string sResRef) +{ + SetLocalString(OBJECT_SELF, AI_WE_WILL_CREATE_ON_DEATH, sResRef); +} +// This will set the string, sNameOfValue, to sValue. Array size of 1. +// - Use iPercentToSay to determine what % out of 100 it is said. +void AI_SetSpawnInSpeakValue(string sNameOfValue, string sValue, int iPercentToSay) +{ + SetLocalString(OBJECT_SELF, sNameOfValue + s1, sValue); + // The array is 1 big! + SetLocalInt(OBJECT_SELF, ARRAY_SIZE + sNameOfValue, i1); + SetLocalInt(OBJECT_SELF, ARRAY_PERCENT + sNameOfValue, iPercentToSay); +} +// This will choose a random string, using iAmountOfValues, which is +// the amount of non-empty strings given. The size of the array is therefore 1. +// - Use iPercentToSay to determine what % out of 100 it is said. +void AI_SetSpawnInSpeakRandomValue(string sNameOfValue, int iPercentToSay, int iAmountOfValues, string sValue1, string sValue2, string sValue3, string sValue4, string sValue5, string sValue6, string sValue7, string sValue8, string sValue9, string sValue10, string sValue11, string sValue12) +{ + // Need a value amount of values! + if(iAmountOfValues) + { + int iRandomNum = Random(iAmountOfValues) -1; // take one, as it is 0 - X, not 1 - X + string sValueToUse; + switch(iRandomNum) + { + case(i0):{sValueToUse = sValue1;}break; + case(i1):{sValueToUse = sValue2;}break; + case(i2):{sValueToUse = sValue3;}break; + case(i3):{sValueToUse = sValue4;}break; + case(i4):{sValueToUse = sValue5;}break; + case(i5):{sValueToUse = sValue6;}break; + case(i6):{sValueToUse = sValue7;}break; + case(i7):{sValueToUse = sValue8;}break; + case(i8):{sValueToUse = sValue9;}break; + case(i9):{sValueToUse = sValue10;}break; + case(i10):{sValueToUse = sValue11;}break; + case(i11):{sValueToUse = sValue12;}break; + } + SetLocalString(OBJECT_SELF, sNameOfValue + s1, sValueToUse); + // The array is 1 big! + SetLocalInt(OBJECT_SELF, ARRAY_SIZE + sNameOfValue, i1); + SetLocalInt(OBJECT_SELF, ARRAY_PERCENT + sNameOfValue, iPercentToSay); + } +} +void AI_SetSpawnInSpeakArray(string sNameOfValue, int iPercentToSay, int iSize, string sValue1, string sValue2, string sValue3 = "", string sValue4 = "", string sValue5 = "", string sValue6 = "", string sValue7 = "", string sValue8 = "", string sValue9 = "", string sValue10 = "", string sValue11 = "", string sValue12 = "") +{ + if(iSize >= i1) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "1", sValue1); + if(iSize >= i2) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "2", sValue2); + if(iSize >= i3) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "3", sValue3); + if(iSize >= i4) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "4", sValue4); + if(iSize >= i5) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "5", sValue5); + if(iSize >= i6) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "6", sValue6); + if(iSize >= i7) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "7", sValue7); + if(iSize >= i8) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "8", sValue8); + if(iSize >= i9) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "9", sValue9); + if(iSize >= i10) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "10", sValue10); + if(iSize >= i11) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "11", sValue11); + if(iSize >= i12) + { + SetLocalString(OBJECT_SELF, sNameOfValue + "12", sValue12); + // Hehe, this looks not stright if you stare at it! :-P + } } } } } } } } } } } } + // The array is so big... + SetLocalInt(OBJECT_SELF, ARRAY_SIZE + sNameOfValue, iSize); + SetLocalInt(OBJECT_SELF, ARRAY_PERCENT + sNameOfValue, iPercentToSay); +} +// This applies an increase, decrease or no change to the intended stat. +void AI_ApplyStatChange(int iStat, int iAmount) +{ + if(iAmount != i0) + { + effect eChange; + if(iAmount < i0) + { + int iNewAmount = abs(iAmount); + eChange = SupernaturalEffect(EffectAbilityDecrease(iStat, iNewAmount)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else + { + eChange = SupernaturalEffect(EffectAbilityIncrease(iStat, iAmount)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } +} +// This will, eventually, choose X number of stats, and change them within the +// range given. +void AI_CreateRandomStats(int iLowest, int iHighest, int iAmount) +{ + if(iAmount > i0 && !(iLowest == i0 && iHighest == i0) && iHighest >= iLowest) + { + int iRange = iHighest - iLowest; + int iNumSlots = iAmount; + if(iNumSlots > i6) iNumSlots = i6; + int iNumLeft = i6; + // Walk through each stat and figure out what it's chance of being + // modified is. As an example, suppose we wanted to have 4 randomized + // abilities. We'd look at the first ability and it would have a 4 in 6 + // chance of being picked. Let's suppose it was, the next ability would + // have a 3 in 5 chance of being picked. If this next ability wasn't + // picked to be changed, the 3rd ability woud have a 3 in 4 chance of + // being picked and so on. + int iCnt; + int iChange; + for(iCnt = i0; (iNumSlots > i0) && (iCnt < i6); iCnt++) + { + if((iNumSlots == iNumLeft) || (Random(iNumLeft) < iNumSlots)) + { + iChange = Random(iRange) + iLowest; + AI_ApplyStatChange(iCnt, iChange); + iNumSlots--; + } + iNumLeft--; + } + } +} + +void AI_CreateRandomOther(int iHPMin, int iHPMax, int iReflexSaveMin = 0, int iReflexSaveMax = 0, int iWillSaveMin = 0, int iWillSaveMax = 0, int iFortSaveMin = 0, int iFortSaveMax = 0, int iACMin = 0, int iACMax = 0, int iACType = AC_DODGE_BONUS) +{ + int iRange, iChange, iNewChange; + effect eChange; + if(!(iHPMin == i0 && iHPMax == i0) && iHPMax >= iHPMin) + { + iRange = iHPMax - iHPMin; + iChange = Random(iRange) + iHPMin; + if(iChange > i0) + { + eChange = SupernaturalEffect(EffectTemporaryHitpoints(iChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else if(iChange < i0 && GetMaxHitPoints() > i1) + { + eChange = EffectDamage(iChange, DAMAGE_TYPE_DIVINE, DAMAGE_POWER_PLUS_FIVE); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } + if(!(iReflexSaveMin == i0 && iReflexSaveMax == i0) && iReflexSaveMax >= iReflexSaveMin) + { + iRange = iReflexSaveMax - iReflexSaveMin; + iChange = Random(iRange) + iReflexSaveMin; + if(iChange > i0) + { + eChange = SupernaturalEffect(EffectSavingThrowIncrease(SAVING_THROW_REFLEX, iChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else if(iChange < i0 && GetReflexSavingThrow(OBJECT_SELF) > i1) + { + iNewChange = abs(iChange); + eChange = SupernaturalEffect(EffectSavingThrowDecrease(SAVING_THROW_REFLEX, iNewChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } + if(!(iWillSaveMin == i0 && iWillSaveMax == i0) && iWillSaveMax >= iWillSaveMin) + { + iRange = iWillSaveMax - iWillSaveMin; + iChange = Random(iRange) + iWillSaveMin; + if(iChange > i0) + { + eChange = SupernaturalEffect(EffectSavingThrowIncrease(SAVING_THROW_WILL, iChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else if(iChange < i0 && GetWillSavingThrow(OBJECT_SELF) > i1) + { + iNewChange = abs(iChange); + eChange = SupernaturalEffect(EffectSavingThrowDecrease(SAVING_THROW_WILL, iNewChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } + if(!(iFortSaveMin == i0 && iFortSaveMax == i0) && iFortSaveMax >= iFortSaveMin) + { + iRange = iFortSaveMax - iFortSaveMin; + iChange = Random(iRange) + iFortSaveMin; + if(iChange > i0) + { + eChange = SupernaturalEffect(EffectSavingThrowIncrease(SAVING_THROW_FORT, iChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else if(iChange < i0 && GetFortitudeSavingThrow(OBJECT_SELF) > 1) + { + iNewChange = abs(iChange); + eChange = SupernaturalEffect(EffectSavingThrowDecrease(SAVING_THROW_FORT, iNewChange)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } + if(!(iACMin == i0 && iACMax == i0) && iACMax >= iACMin) + { + iRange = iACMax - iACMin; + iChange = Random(iRange) + iACMin; + if(iChange > i0) + { + eChange = SupernaturalEffect(EffectACIncrease(iChange, iACType)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + else if(iChange < i0) + { + iNewChange = abs(iChange); + eChange = SupernaturalEffect(EffectACDecrease(iNewChange, iACType)); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, OBJECT_SELF); + } + } +} + +/*:://///////////////////////////////////////////// +//:: SetListeningPatterns +//::////////////////////////////////////////////// + Changed a lot. added in "**" (all) listening, for hearing enemies. +//::////////////////////////////////////////////*/ + +void AI_SetListeningPatterns() +{ + // Lag check + if(GetSpawnInCondition(AI_FLAG_OTHER_LAG_NO_LISTENING, AI_OTHER_MASTER)) return; + SetListening(OBJECT_SELF, TRUE); +// Anyone that can hear it, and is not fighting, comes and helps + SetListenPattern(OBJECT_SELF, I_WAS_ATTACKED, i1); + //Set a custom listening pattern for the creature so that placables with + //"NW_BLOCKER" + Blocker NPC Tag will correctly call to their blockers. + string sBlocker = "NW_BLOCKER_BLK_" + GetTag(OBJECT_SELF); + SetListenPattern(OBJECT_SELF, sBlocker, i2); +// Determines combat round, if not fighting + SetListenPattern(OBJECT_SELF, CALL_TO_ARMS, i3); + // These call to allies, to move them to a battle. + SetListenPattern(OBJECT_SELF, HELP_MY_FRIEND, i4); + SetListenPattern(OBJECT_SELF, LEADER_FLEE_NOW, i5); + SetListenPattern(OBJECT_SELF, LEADER_ATTACK_TARGET, i6); + // 1.3 - Need a killed one. + SetListenPattern(OBJECT_SELF, I_WAS_KILLED, i7); + // 1.3 - PLaceables/doors which shout this get responded to! + SetListenPattern(OBJECT_SELF, I_WAS_OPENED, i8); +// This will make the listener hear anything, used to react to enemy talking. + SetListenPattern(OBJECT_SELF, "**", i0); +} +// Base for moving round thier waypoints +// - Uses ExectuteScript to run the waypoint walking. +void SpawnWalkWayPoints(int nRun = FALSE, float fPause = 1.0) +{ + SetLocalInt(OBJECT_SELF, WAYPOINT_RUN, nRun); + SetLocalFloat(OBJECT_SELF, WAYPOINT_PAUSE, fPause); + ExecuteScript(FILE_WALK_WAYPOINTS, OBJECT_SELF); +} + + +void AI_SetUpEndOfSpawn() +{ + // Check if we are using custom AI - this cuts out much of the stuff + // used on spawn. + int bCustomAIFile = FALSE; + + // Check custom AI file + if(GetCustomAIFileName() != "") + { + bCustomAIFile = TRUE; + } + + if(GetSpawnInCondition(AI_FLAG_OTHER_RETURN_TO_SPAWN_LOCATION, AI_OTHER_MASTER)) + { + // This will store thier starting location, and then move back there after combat + // Will turn off if there are waypoints. It is set in SetUpEndOfSpawn. + SetLocalLocation(OBJECT_SELF, AI_RETURN_TO_POINT, GetLocation(OBJECT_SELF)); + } + + // Set up if we are immune to cirtain levels of spells naturally for better + // AI spellcasters. + object oHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR, OBJECT_SELF); + // Get if immune is on + if(GetItemHasItemProperty(oHide, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL)) + { + itemproperty eCheck = GetFirstItemProperty(oHide); + int iAmount; + // Check for item properties until we find the level. + while(GetIsItemPropertyValid(eCheck) && iAmount == FALSE) + { + // Check subtype. + if(GetItemPropertyType(eCheck) == ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL) + { + // Get the amount + iAmount = GetItemPropertyCostTableValue(eCheck); + } + eCheck = GetNextItemProperty(oHide); + } + // Set it + if(iAmount) + { + SetLocalInt(OBJECT_SELF, AI_SPELL_IMMUNE_LEVEL, iAmount); + } + } + // Animations - any valid? + if(GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS, NW_GENERIC_MASTER) || + GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN, NW_GENERIC_MASTER) || + GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS, NW_GENERIC_MASTER)) + { + SetAIInteger(AI_VALID_ANIMATIONS, TRUE); + } + + // All things only used by my personal AI. + if(!bCustomAIFile) + { + if(GetLevelByClass(CLASS_TYPE_COMMONER) && GetHitDice(OBJECT_SELF) < i10) + { + SetAIInteger(AI_MORALE, iM1); + } + if(!GetSpawnInCondition(AI_FLAG_FLEEING_FEARLESS, AI_TARGETING_FLEE_MASTER)) + { + AI_SetMaybeFearless(); + } + // Set if we are a beholder or mindflayer + switch(GetAppearanceType(OBJECT_SELF)) + { + case 401: //beholder + case 402: //beholder + case 403: //beholder + case 472: // Hive mother + SetBeholderAI(); + break; + + case 413: //Mindflayer + case 414: // Mindflayer2 + case 415: // Mindflayer_Alhoon + SetMindflayerAI(); + break; + } + // This NEEDS to be called - to set up categories of spells the creature + // will use + AI_SetUpSpells(); + // Sets up thier selection of skills, to integers, if they would ever use them. + // NOTE: it also triggers "hide" if they have enough skill and not stopped. + AI_SetUpSkillToUse(); + // Sets the turning level if we have FEAT_TURN_UNDEAD. + AI_SetTurningLevel(); + // This sets what weapons the creature will use. They will use the best, according to a "value" + // Giving a creature the feat Two-weapon-fighting makes them deul wield if appropriate weapons. + SetWeapons(); + } + + // We don't set up corpses if set not to...else set to resurrect + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // Note: Here, if we can, we set Bioware's lootable on. + if(GetSpawnInCondition(AI_FLAG_OTHER_USE_BIOWARE_LOOTING, AI_OTHER_MASTER)) + { + // Set to lootable + SetLootable(OBJECT_SELF, TRUE); + } + // Just handling corpse raising/resurrection/removal + // - Undestroyable, Raiseable and Selectable + SetIsDestroyable(FALSE, TRUE, TRUE); + } + + + // Goes through and sets up which shouts the NPC will listen to. + // - Custom AI uses this also + AI_SetListeningPatterns(); + + // This activates the creatures top aura. + if(GetCommandable()) AI_AdvancedAuras(); +} + +// Sets the turning level if we have FEAT_TURN_UNDEAD. +void AI_SetTurningLevel() +{ + // Most taken directly from NW_S2_TURNDEAD which is used with FEAT_TURN_UNDEAD + if(GetHasFeat(FEAT_TURN_UNDEAD)) + { + // By default, it is clerical levels which provide turn undead power. + // We can turn HD up to nTurnLevel (HD = GetHitDice + GetTurnREsistsnceHD of undead) + int nTurnLevel = GetLevelByClass(CLASS_TYPE_CLERIC); + // Paladins turn at -2 the level of clerics + if(GetLevelByClass(CLASS_TYPE_PALADIN) - i2 > nTurnLevel) + { + nTurnLevel = GetLevelByClass(CLASS_TYPE_PALADIN) - i2; + } + // Blackguard gets to turn at HITDICE -2 level, not character level, + // as it says in NW_S2_TURNDEAD. + if(GetLevelByClass(CLASS_TYPE_BLACKGUARD) > i0 && (GetHitDice(OBJECT_SELF) - i2 > nTurnLevel)) + { + nTurnLevel = GetHitDice(OBJECT_SELF) - i2; + } + // BTW, the number of undead turned is at least nTurnLevel, so we + // can always turn one :-D + SetAIInteger(AI_TURNING_LEVEL, nTurnLevel); + // Note: Turn undead could be used for FEAT_DIVINE_MIGHT and FEAT_DIVINE_SHIELD + } +} + +void AI_SetMaybeFearless() +{ + switch(GetRacialType(OBJECT_SELF)) + { + case RACIAL_TYPE_CONSTRUCT: + case RACIAL_TYPE_DRAGON: + case RACIAL_TYPE_UNDEAD: + case RACIAL_TYPE_OUTSIDER: + { + SetSpawnInCondition(AI_FLAG_FLEEING_FEARLESS, AI_TARGETING_FLEE_MASTER); + return; + } + break; + } + if(GetHasFeat(FEAT_AURA_OF_COURAGE) || + GetHasFeat(FEAT_RESIST_NATURES_LURE) || + GetIsImmune(OBJECT_SELF, IMMUNITY_TYPE_FEAR)) + { + SetSpawnInCondition(AI_FLAG_FLEEING_FEARLESS, AI_TARGETING_FLEE_MASTER); + } +} + +// Activate all auras. +void AI_ActivateAura(int nAuraNumber) +{ + // Just ActionCast - cheat cast, as then we can use it unlmimted times, as books say. + if(GetHasSpell(nAuraNumber)) + { + ActionCastSpellAtObject(nAuraNumber, OBJECT_SELF, METAMAGIC_NONE, TRUE, i20, PROJECTILE_PATH_TYPE_DEFAULT, TRUE); + } +} + +void AI_AdvancedAuras() +{ + if(GetSpawnInCondition(AI_VALID_TALENT_PERSISTENT_AREA_OF_EFFECT, AI_VALID_SPELLS)) + { + // NOTE: + // - All cheat cast. As DMG, they should be always on OR free action to reapply. + ClearAllActions(); + AI_ActivateAura(SPELLABILITY_DRAGON_FEAR); + AI_ActivateAura(SPELLABILITY_AURA_UNEARTHLY_VISAGE); + AI_ActivateAura(SPELLABILITY_AURA_BLINDING); + AI_ActivateAura(SPELLABILITY_AURA_OF_COURAGE); + AI_ActivateAura(SPELLABILITY_AURA_PROTECTION); + AI_ActivateAura(SPELLABILITY_AURA_STUN); + AI_ActivateAura(SPELLABILITY_AURA_FIRE); + AI_ActivateAura(SPELLABILITY_AURA_COLD); + AI_ActivateAura(SPELLABILITY_AURA_ELECTRICITY); + AI_ActivateAura(SPELLABILITY_AURA_UNNATURAL); + AI_ActivateAura(SPELLABILITY_AURA_FEAR); + AI_ActivateAura(SPELLABILITY_AURA_UNNATURAL); + AI_ActivateAura(SPELLABILITY_AURA_MENACE); + AI_ActivateAura(SPELLABILITY_TYRANT_FOG_MIST); + AI_ActivateAura(AI_SPELLABILITY_AURA_OF_HELLFIRE); + } +} + +// Sets up thier selection of skills, to integers, if they would ever use them. +// NOTE: it also triggers "hide" if they have enough skill and not stopped. +void AI_SetUpSkillToUse() +{ + int iHitDice = GetHitDice(OBJECT_SELF); + // Hiding. We turn off if we have no skill or under 1 skill in it + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_HIDING, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_HIDE) || + GetSkillRank(SKILL_HIDE) <= i1) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_HIDING, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_HIDING, AI_OTHER_COMBAT_MASTER); + } + } + // Pickpocketing...we only turn it OFF here if low skill (or none) Needs 1/4 HD. + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_PICKPOCKETING, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_PICK_POCKET) || + GetSkillRank(SKILL_PICK_POCKET) < (iHitDice/i4)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_PICKPOCKETING, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_PICKPOCKETING, AI_OTHER_COMBAT_MASTER); + } + } + // Taunting. Again, only off if low skill. Needs half of HD + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_TAUNTING, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_TAUNT) || + GetSkillRank(SKILL_TAUNT) < (iHitDice/i2)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_TAUNTING, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_TAUNTING, AI_OTHER_COMBAT_MASTER); + } + } + // Empathy. Again, only off if low skill. Needs any, checked futher in game. + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_EMPATHY, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_ANIMAL_EMPATHY)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_EMPATHY, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_EMPATHY, AI_OTHER_COMBAT_MASTER); + } + } + // Unlocking doors. Again, only off if low skill. Needs any, checked futher in game. + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_OPENING_LOCKED_DOORS, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_OPEN_LOCK)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_OPENING_LOCKED_DOORS, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_OPENING_LOCKED_DOORS, AI_OTHER_COMBAT_MASTER); + } + } + // Healing kits. + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_USING_HEALING_KITS, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_HEAL)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_USING_HEALING_KITS, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_USING_HEALING_KITS, AI_OTHER_COMBAT_MASTER); + } + } + // Parrying + // Only on if we have some skill in it :-) + if(!GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_PARRYING, AI_OTHER_COMBAT_MASTER)) + { + if(!GetHasSkill(SKILL_PARRY)) + { + SetSpawnInCondition(AI_FLAG_OTHER_COMBAT_NO_PARRYING, AI_OTHER_COMBAT_MASTER); + DeleteSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_PARRYING, AI_OTHER_COMBAT_MASTER); + } + } +} + +// This is an attempt to speed up some things. +// We use talents to set general valid categories. +// Levels are also accounted for, checking the spell given and using a switch +// statement to get the level. +void AI_SetUpSpells() +{ + /*************************************************************************** + We use talents, and Get2daString to check levels, and so on... + + We set: + - If the talent is a valid one at all + - If we know it (GetHasSpell) we check the level of the spell. Set if highest. + - We set the actual talent number as a spell. + + // These must match the list in nwscreaturestats.cpp + int TALENT_CATEGORY_HARMFUL_AREAEFFECT_DISCRIMINANT = 1; + int TALENT_CATEGORY_HARMFUL_RANGED = 2; + int TALENT_CATEGORY_HARMFUL_TOUCH = 3; + int TALENT_CATEGORY_BENEFICIAL_HEALING_AREAEFFECT = 4; + int TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH = 5; + int TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_AREAEFFECT = 6; + int TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_SINGLE = 7; + int TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT = 8; + int TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SINGLE = 9; + int TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SELF = 10; + int TALENT_CATEGORY_HARMFUL_AREAEFFECT_INDISCRIMINANT = 11; + int TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF = 12; + int TALENT_CATEGORY_BENEFICIAL_PROTECTION_SINGLE = 13; + int TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT = 14; + int TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES = 15; + int TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT = 16; + int TALENT_CATEGORY_BENEFICIAL_HEALING_POTION = 17; + int TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_POTION = 18; + int TALENT_CATEGORY_DRAGONS_BREATH = 19; + int TALENT_CATEGORY_BENEFICIAL_PROTECTION_POTION = 20; + int TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_POTION = 21; + int TALENT_CATEGORY_HARMFUL_MELEE = 22; + ***************************************************************************/ + talent tCheck; + // This is set to TRUE if any are valid. :-D + int SpellAnySpell; + + + /** TALENT_CATEGORY_HARMFUL_AREAEFFECT_DISCRIMINANT = 1; ***************** + These are *generally* spells which are Harmful, affect many targets in an + area, and don't hit allies. Spells such as Wierd (An illusion fear spell, so + allies would know it wasn't real, but enemies wouldn't) and so on. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_AREAEFFECT_DISCRIMINANT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_HARMFUL_AREAEFFECT_DISCRIMINANT, AI_VALID_SPELLS); + } + /** TALENT_CATEGORY_HARMFUL_RANGED = 2; ***************** + These are classed as single target, short or longer ranged spells. Anything + that affects one target, and isn't a touch spell, is this category. Examples + like Acid Arrow or Finger of Death. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_RANGED, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_HARMFUL_RANGED, AI_VALID_SPELLS); + } + /** TALENT_CATEGORY_HARMFUL_TOUCH = 3; ***************** + A limited selection. All touch spells, like Harm. Not much to add but they + only affect one target. Note: Inflict range are also in here (but remember + that GetHasSpell returns TRUE if they can spontaeously cast it as well!) + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_TOUCH, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_HARMFUL_TOUCH, AI_VALID_SPELLS); + } + /** TALENT_CATEGORY_BENEFICIAL_HEALING_AREAEFFECT = 4; ***************** + Healing area effects. Basically, only Mass Heal and Healing Circle :0P + + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_HEALING_AREAEFFECT, MAXCR); + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_HEALING_AREAEFFECT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH = 5; ***************** + These are all the healing spells that touch - Cure X wounds and heal really. + Also, feat Wholeness of Body and Lay on Hands as well. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_HEALING_TOUCH, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_AREAEFFECT = 6; ***************** + These are spells which help people in an area to rid effects, normally. IE + normally, a condition must be met to cast it, like them being stunned. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_AREAEFFECT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_CONDITIONAL_AREAEFFECT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_SINGLE = 7; ***************** + This is the same as the AOE version, but things like Clarity, single target + ones. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_CONDITIONAL_SINGLE, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_CONDITIONAL_SINGLE, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT = 8; ***************** + Enhancing stats, or self or others. Friendly, and usually stat-changing. They + contain all ones that, basically, don't protect and stop damage, but help + defeat enemies. In the AOE ones are things like Invisiblity Sphere. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_AREAEFFECT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_AREAEFFECT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SINGLE = 9; ***************** + Enchancing, these are the more single ones, like Bulls Strength. See above as well. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SINGLE, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_SINGLE, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SELF = 10; **************** + Self-encancing spells, that can't be cast on allies, like Divine Power :-) + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_ENHANCEMENT_SELF, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_ENHANCEMENT_SELF, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_HARMFUL_AREAEFFECT_INDISCRIMINANT = 11; **************** + This is the AOE spells which never discriminate between allies, and enemies, + such as the well known spell Fireball. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_AREAEFFECT_INDISCRIMINANT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_HARMFUL_AREAEFFECT_INDISCRIMINANT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF = 12; **************** + Protection spells are usually a Mage's only way to stop instant death. Self + only spells include the likes of Premonition :-) + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_PROTECTION_SELF, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_PROTECTION_SELF, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT = 14; **************** + Protection spells are usually a Mage's only way to stop instant death. + Area effect ones are the likes of Protection From Spells. Limited ones here. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_PROTECTION_AREAEFFECT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_PROTECTION_AREAEFFECT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES = 15; **************** + Allies, or obtaining them, is anything they can summon. Basically, all + Summon Monster 1-9, Innate ones like Summon Tanarri and ones like Gate. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_OBTAIN_ALLIES, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_BENEFICIAL_OBTAIN_ALLIES, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT = 16; **************** + These are NOT AOE spells like acid fog, but rather the Aura's that a monster + can use. Also, oddly, Rage's, Monk's Wholeness of Body and so on are here... + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_PERSISTENT_AREA_OF_EFFECT, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + SpellAnySpell = TRUE; + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_PERSISTENT_AREA_OF_EFFECT, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_DRAGONS_BREATH = 19; **************** + Dragon Breaths. These are all the breaths avalible to Dragons. :-D Nothing else. + + All counted as level 9 innate caster level. Monster ability only :0) + + Contains (By level, innate): + 9. Dragon Breath Acid, Cold, Fear, Fire, Gas, Lightning, Paralyze, Sleep, Slow, Weaken. + ***************************************************************************/ + + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_DRAGONS_BREATH, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck)) + { + // Then set we have it + SetSpawnInCondition(AI_VALID_TALENT_DRAGONS_BREATH, AI_VALID_SPELLS); + } + + /** TALENT_CATEGORY_HARMFUL_MELEE = 22; **************** + We might as well check if we have any valid feats :-P + + Contains: + Called Shot, Disarm, Imp. Power Attack, Knockdown, Power Attack, Rapid Shot, + Sap, Stunning Fist, Flurry of blows, Quivering Palm, Smite Evil, + Expertise (and Imp), Smite Good + Note: + Whirlwind attack (Improved), Dirty Fighting. + ***************************************************************************/ + tCheck = GetCreatureTalentBest(TALENT_CATEGORY_HARMFUL_MELEE, MAXCR); + // Valid? + if(GetIsTalentValid(tCheck) || + GetHasFeat(FEAT_IMPROVED_WHIRLWIND) || + GetHasFeat(FEAT_WHIRLWIND_ATTACK) || + GetHasFeat(FEAT_DIRTY_FIGHTING) || + GetHasFeat(FEAT_KI_DAMAGE)) + { + // Then set we have it. If we don't have any, we never check Knockdown ETC. + SetSpawnInCondition(AI_VALID_TALENT_HARMFUL_MELEE, AI_VALID_SPELLS); + } + + if(SpellAnySpell == TRUE) + { + SetSpawnInCondition(AI_VALID_ANY_SPELL, AI_VALID_SPELLS); + } + // All spells in no category. + if( +// GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE) || + GetHasSpell(SPELL_DARKNESS) || +// GetHasSpell(71) || // Greater shadow conjuration +// GetHasSpell(SPELL_IDENTIFY) || +// GetHasSpell(SPELL_KNOCK) || + GetHasSpell(SPELL_LIGHT) || + GetHasSpell(SPELL_POLYMORPH_SELF) || +// GetHasSpell(158) || // Shades +// GetHasSpell(159) || // Shadow conjuration + GetHasSpell(SPELL_SHAPECHANGE) || + GetHasSpell(321) || // Protection... + GetHasSpell(322) || // Magic circle... + GetHasSpell(323) || // Aura... +// GetHasSpell(SPELL_LEGEND_LORE) || +// GetHasSpell(SPELL_FIND_TRAPS) || + GetHasSpell(SPELL_CONTINUAL_FLAME) || +// GetHasSpell(SPELL_ONE_WITH_THE_LAND) || +// GetHasSpell(SPELL_CAMOFLAGE) || + GetHasSpell(SPELL_BLOOD_FRENZY) || +// GetHasSpell(SPELL_AMPLIFY) || + GetHasSpell(SPELL_ETHEREALNESS) || + GetHasSpell(SPELL_DIVINE_SHIELD) || + GetHasSpell(SPELL_DIVINE_MIGHT) || + // Added in again 18th nov + GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS) || + GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS) || + GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS) || + GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS) || + // Feats that will be cast in the spell list. + // MOST are under talents anyway, these are ones which are not + GetHasFeat(FEAT_PRESTIGE_DARKNESS)) + { + SetSpawnInCondition(AI_VALID_OTHER_SPELL, AI_VALID_SPELLS); + SetSpawnInCondition(AI_VALID_ANY_SPELL, AI_VALID_SPELLS); + } + // SPELL_GREATER_RESTORATION - Ability Decrease, AC decrease, Attack decrease, + // Damage Decrease, Damage Immunity Decrease, Saving Throw Decrease, Spell + // resistance Decrease, Skill decrease, Blindness, Deaf, Curse, Disease, Poison, + // Charmed, Dominated, Dazed, Confused, Frightened, Negative level, Paralyze, + // Slow, Stunned. + // SPELL_FREEDOM - Paralyze, Entangle, Slow, Movement speed decrease. (+Immunity!) + // SPELL_RESTORATION - Ability Decrease, AC decrease, Attack Decrease, + // Damage Decrease, Damage Immunity Decrease, Saving Throw Decrease, + // Spell Resistance Decrease, Skill Decrease, Blindess, Deaf, Paralyze, Negative level + // SPELL_REMOVE_BLINDNESS_AND_DEAFNESS - Blindess, Deaf. + // SPELL_NEUTRALIZE_POISON - Poison + // SPELL_REMOVE_DISEASE - Disease + // SPELL_REMOVE_CURSE - Curse + // SPELL_LESSER_RESTORATION - Ability Decrease, AC decrease, Attack Decrease, + // Cure condition spells! :-) + if(GetHasSpell(SPELL_GREATER_RESTORATION) || GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT) || + GetHasSpell(SPELL_RESTORATION) || GetHasSpell(SPELL_REMOVE_BLINDNESS_AND_DEAFNESS) || + GetHasSpell(SPELL_NEUTRALIZE_POISON) || GetHasSpell(SPELL_REMOVE_DISEASE) || + GetHasSpell(SPELL_REMOVE_CURSE) || GetHasSpell(SPELL_LESSER_RESTORATION) || + GetHasSpell(SPELL_STONE_TO_FLESH)) + { + SetSpawnInCondition(AI_VALID_CURE_CONDITION_SPELLS, AI_VALID_SPELLS); + } +} + +// This will make the visual effect passed play INSTANTLY at the creatures location. +// * iVFX - The visual effect constant number +void AI_SpawnInInstantVisual(int iVFX) +{ + // Beta 3 change: Made to at location. + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, + EffectVisualEffect(iVFX), + GetLocation(OBJECT_SELF)); +} +// This will make the visual effect passed play PERMAMENTLY. +// * If a VFX is -1, it is ignored. +// * iVFX1-4 - The visual effect constant number +// NOTE: They will be made to be SUPERNATUAL, so are not dispelled! +void AI_SpawnInPermamentVisual(int iVFX) +{ + ApplyEffectToObject(DURATION_TYPE_INSTANT, + SupernaturalEffect(EffectVisualEffect(iVFX)), + OBJECT_SELF); +} +// This will set the MAXIMUM and MINIMUM targets to pass this stage (under sName) +// of the targeting system. IE: +// - If we set it to min of 5, max of 10, for AC, if we cancled 5 targets on having +// AC higher then wanted, we will take the highest 5 minimum. +// If there are over 10, we take a max of 10 to choose from. +// * iType - must be TARGET_HIGHER or TARGET_LOWER. Defaults to the lowest, so it +// targets the lowest value for sName. +void AI_SetAITargetingValues(string sName, int iType, int iMinimum, int iMaximum) +{ + // Error checking + if((iType == TARGET_HIGHER || iType == TARGET_LOWER) && + iMinimum >= i1 && iMaximum >= i1 && iMaximum >= iMinimum) + { + // Set the type to sName. + // - It is TARGET_HIGHER (1) or TARGET_LOWER (0). + SetAIInteger(sName, iType); + + // Minimum amount of targets for this? + SetAIInteger(sName + MINIMUM, iMinimum); + + // Maximum targets for this? + SetAIInteger(sName + MAXIMUM, iMaximum); + } +} + +// Sets we are a Beholder and use Ray attacks, and Animagic Ray. +void SetBeholderAI() +{ + // 1 = beholder + SetAIInteger(AI_SPECIAL_AI, i1); +} +// Set we are a mindflayer, and uses some special AI for them. +void SetMindflayerAI() +{ + // 2 = mindflayer + SetAIInteger(AI_SPECIAL_AI, i2); +} + +// This will set a spell trigger up. Under cirtain conditions, spells are released +// and cast on the caster. +// Once fired, a spell trigger is only reset by resting. +// * sType - is specifically: +// SPELLTRIGGER_DAMAGED_AT_PERCENT - When damaged, the trigger fires. Use iValue for the %. One at a time is fired. +// SPELLTRIGGER_IMMOBILE - Fired when held/paralyzed/sleeping ETC. One at a time is fired. +// SPELLTRIGGER_NOT_GOT_FIRST_SPELL - Makes sure !GetHasSpellEffect(iSpell1) already, +// then fires. Checks all in this category each round. +// SPELLTRIGGER_START_OF_COMBAT - All these are all fired at the start of combat. +// * iNumber - can be 1-9, in sequential order of when you want them to fire. +// * iValue - is only required with DAMAGED_AT_PERCENT. Only the first one set is used. +// * iSpellX - Cannot be 0. It should only really be defensive spells. +void SetSpellTrigger(string sType, int iValue, int iNumber, int iSpell1, int iSpell2 = 0, int iSpell3 = 0, int iSpell4 = 0, int iSpell5 = 0, int iSpell6 = 0, int iSpell7 = 0, int iSpell8 = 0, int iSpell9 = 0) +{ + // Either get our spell trigger (creature) or create one + object oTrigger = GetAIObject(AI_SPELL_TRIGGER_CREATURE); + // Is it valid? + if(!GetIsObjectValid(oTrigger)) + { + // Create it + oTrigger = CreateObject(OBJECT_TYPE_CREATURE, "jass_spelltrig", GetLocation(OBJECT_SELF)); + // Set local on them for the target + AddHenchman(OBJECT_SELF, oTrigger); + // Local for us to get our spell trigger (should be our henchmen) + SetAIObject(AI_SPELL_TRIGGER_CREATURE, oTrigger); + } + int iSize = i1; + string sTotalID = sType + IntToString(iNumber); + + SetLocalInt(oTrigger, sTotalID + "1", iSpell1); + if(iSpell2 != FALSE) + { iSize = 2; + SetLocalInt(oTrigger, sTotalID + "2", iSpell2); } + if(iSpell3 != FALSE) + { iSize = 3; + SetLocalInt(oTrigger, sTotalID + "3", iSpell3); } + if(iSpell4 != FALSE) + { iSize = 4; + SetLocalInt(oTrigger, sTotalID + "4", iSpell4); } + if(iSpell5 != FALSE) + { iSize = 5; + SetLocalInt(oTrigger, sTotalID + "5", iSpell5); } + if(iSpell6 != FALSE) + { iSize = 6; + SetLocalInt(oTrigger, sTotalID + "6", iSpell6); } + if(iSpell7 != FALSE) + { iSize = 7; + SetLocalInt(oTrigger, sTotalID + "7", iSpell7); } + if(iSpell8 != FALSE) + { iSize = 8; + SetLocalInt(oTrigger, sTotalID + "8", iSpell8); } + if(iSpell9 != FALSE) + { iSize = 9; + SetLocalInt(oTrigger, sTotalID + "9", iSpell9); } + + // Set final sizes ETC. + SetLocalInt(oTrigger, MAXINT_ + sTotalID, iSize); + SetLocalInt(oTrigger, sTotalID + USED, FALSE); + + // Check value + if(iValue > GetLocalInt(oTrigger, VALUE + sType)) + { + SetLocalInt(oTrigger, VALUE + sType, iValue); + } + + // Set how many spell triggers we have too + if(iNumber > GetLocalInt(oTrigger, MAXIMUM + sType)) + { + SetLocalInt(oTrigger, MAXIMUM + sType, iNumber); + } +} +// Debug: To compile this script, uncomment all of the below. +/* - Add two "/"'s at the start of this line +void main() +{ + return; +} +//*/ diff --git a/nwnds_module/jadegolemhide.uti b/nwnds_module/jadegolemhide.uti new file mode 100644 index 000000000..d5d23f5a4 Binary files /dev/null and b/nwnds_module/jadegolemhide.uti differ diff --git a/nwnds_module/jadegolemslam.uti b/nwnds_module/jadegolemslam.uti new file mode 100644 index 000000000..d27f7d975 Binary files /dev/null and b/nwnds_module/jadegolemslam.uti differ diff --git a/nwnds_module/jalaclaw.uti b/nwnds_module/jalaclaw.uti new file mode 100644 index 000000000..00b2220df Binary files /dev/null and b/nwnds_module/jalaclaw.uti differ diff --git a/nwnds_module/jalapincers.uti b/nwnds_module/jalapincers.uti new file mode 100644 index 000000000..bb7ff0c1d Binary files /dev/null and b/nwnds_module/jalapincers.uti differ diff --git a/nwnds_module/jalathgakbite.ncs b/nwnds_module/jalathgakbite.ncs new file mode 100644 index 000000000..18045a852 Binary files /dev/null and b/nwnds_module/jalathgakbite.ncs differ diff --git a/nwnds_module/jalathgakbite.nss b/nwnds_module/jalathgakbite.nss new file mode 100644 index 000000000..a5cf107ee --- /dev/null +++ b/nwnds_module/jalathgakbite.nss @@ -0,0 +1,59 @@ +// Jalath'gak Blood Drain Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nConDrain = d6(1); + int nSTR_Target; + int nSTR_Creature; + int nTickFull; + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Tiny & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_TINY || + GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Drain 1d6 points of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodSuck, oTarget); + +// Increase the tick's speed so it can stay "attached" to it's victim +// ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the tick drains 32 CON worth of blood it will detach & run away. + if (nTickFull >= 32) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +FloatingTextStringOnCreature("The jalath'gak is draining your blood!", oTarget); + + } diff --git a/nwnds_module/jankxclaw.uti b/nwnds_module/jankxclaw.uti new file mode 100644 index 000000000..cfb613500 Binary files /dev/null and b/nwnds_module/jankxclaw.uti differ diff --git a/nwnds_module/jaryxdone.ncs b/nwnds_module/jaryxdone.ncs new file mode 100644 index 000000000..d06a61626 Binary files /dev/null and b/nwnds_module/jaryxdone.ncs differ diff --git a/nwnds_module/jaryxdone.nss b/nwnds_module/jaryxdone.nss new file mode 100644 index 000000000..1c2187831 --- /dev/null +++ b/nwnds_module/jaryxdone.nss @@ -0,0 +1,12 @@ +//:://///////////////////////////////////////////// +//:: FileName jaryxdone +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:38:07 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "VAQ", 2); +} diff --git a/nwnds_module/jellymustard001.utc b/nwnds_module/jellymustard001.utc new file mode 100644 index 000000000..5414b19e0 Binary files /dev/null and b/nwnds_module/jellymustard001.utc differ diff --git a/nwnds_module/jewelers_table.utp b/nwnds_module/jewelers_table.utp new file mode 100644 index 000000000..b8ee8824c Binary files /dev/null and b/nwnds_module/jewelers_table.utp differ diff --git a/nwnds_module/jogoweap.ncs b/nwnds_module/jogoweap.ncs new file mode 100644 index 000000000..0d9cb47d5 Binary files /dev/null and b/nwnds_module/jogoweap.ncs differ diff --git a/nwnds_module/jogoweap.nss b/nwnds_module/jogoweap.nss new file mode 100644 index 000000000..c73d76d69 --- /dev/null +++ b/nwnds_module/jogoweap.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("LowMagicWeapons"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + gplotAppraiseOpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/jointhieves.ncs b/nwnds_module/jointhieves.ncs new file mode 100644 index 000000000..f76f1fdd3 Binary files /dev/null and b/nwnds_module/jointhieves.ncs differ diff --git a/nwnds_module/jointhieves.nss b/nwnds_module/jointhieves.nss new file mode 100644 index 000000000..19c7d8238 --- /dev/null +++ b/nwnds_module/jointhieves.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName jointhieves +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:13:00 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") == 0)) + return FALSE; + + object oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "FAC_ITPRNG_THIEF"); + if(GetIsObjectValid(oItemToTake) == TRUE) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/js_hq_citdl_port.dlg b/nwnds_module/js_hq_citdl_port.dlg new file mode 100644 index 000000000..7335f0afc Binary files /dev/null and b/nwnds_module/js_hq_citdl_port.dlg differ diff --git a/nwnds_module/jumptoarena.ncs b/nwnds_module/jumptoarena.ncs new file mode 100644 index 000000000..b9d577e0d Binary files /dev/null and b/nwnds_module/jumptoarena.ncs differ diff --git a/nwnds_module/jumptoarena.nss b/nwnds_module/jumptoarena.nss new file mode 100644 index 000000000..b7e0c9c50 --- /dev/null +++ b/nwnds_module/jumptoarena.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_ARENASPAWN")))); +} diff --git a/nwnds_module/jumptocw.ncs b/nwnds_module/jumptocw.ncs new file mode 100644 index 000000000..9b41ea383 Binary files /dev/null and b/nwnds_module/jumptocw.ncs differ diff --git a/nwnds_module/jumptocw.nss b/nwnds_module/jumptocw.nss new file mode 100644 index 000000000..23b13f49d --- /dev/null +++ b/nwnds_module/jumptocw.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_CWTOFIELDS")))); +} diff --git a/nwnds_module/jumptokled.ncs b/nwnds_module/jumptokled.ncs new file mode 100644 index 000000000..5c16bfd7c Binary files /dev/null and b/nwnds_module/jumptokled.ncs differ diff --git a/nwnds_module/jumptokled.nss b/nwnds_module/jumptokled.nss new file mode 100644 index 000000000..a2d66a87e --- /dev/null +++ b/nwnds_module/jumptokled.nss @@ -0,0 +1,43 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_KLED"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/jumptomim.ncs b/nwnds_module/jumptomim.ncs new file mode 100644 index 000000000..ef01c96dd Binary files /dev/null and b/nwnds_module/jumptomim.ncs differ diff --git a/nwnds_module/jumptomim.nss b/nwnds_module/jumptomim.nss new file mode 100644 index 000000000..13b353466 --- /dev/null +++ b/nwnds_module/jumptomim.nss @@ -0,0 +1,33 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_MIMSBASEMENT"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/jumptosafecave.ncs b/nwnds_module/jumptosafecave.ncs new file mode 100644 index 000000000..a52969b81 Binary files /dev/null and b/nwnds_module/jumptosafecave.ncs differ diff --git a/nwnds_module/jumptosafecave.nss b/nwnds_module/jumptosafecave.nss new file mode 100644 index 000000000..8381fceee --- /dev/null +++ b/nwnds_module/jumptosafecave.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_SAFECAVESPAWN")))); +} diff --git a/nwnds_module/jumptoundeadtown.ncs b/nwnds_module/jumptoundeadtown.ncs new file mode 100644 index 000000000..0ef8afdce Binary files /dev/null and b/nwnds_module/jumptoundeadtown.ncs differ diff --git a/nwnds_module/jumptoundeadtown.nss b/nwnds_module/jumptoundeadtown.nss new file mode 100644 index 000000000..2dd755c2c --- /dev/null +++ b/nwnds_module/jumptoundeadtown.nss @@ -0,0 +1,4 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_UNDEADTOWNSPAWN")))); +} diff --git a/nwnds_module/ka_5knives.dlg b/nwnds_module/ka_5knives.dlg new file mode 100644 index 000000000..047eadf6b Binary files /dev/null and b/nwnds_module/ka_5knives.dlg differ diff --git a/nwnds_module/ka_amberinn.dlg b/nwnds_module/ka_amberinn.dlg new file mode 100644 index 000000000..6a0a9d575 Binary files /dev/null and b/nwnds_module/ka_amberinn.dlg differ diff --git a/nwnds_module/ka_ancientaltar.dlg b/nwnds_module/ka_ancientaltar.dlg new file mode 100644 index 000000000..4e5246908 Binary files /dev/null and b/nwnds_module/ka_ancientaltar.dlg differ diff --git a/nwnds_module/ka_arelia.dlg b/nwnds_module/ka_arelia.dlg new file mode 100644 index 000000000..c18b7ff6e Binary files /dev/null and b/nwnds_module/ka_arelia.dlg differ diff --git a/nwnds_module/ka_arkanos.dlg b/nwnds_module/ka_arkanos.dlg new file mode 100644 index 000000000..0ace51ee6 Binary files /dev/null and b/nwnds_module/ka_arkanos.dlg differ diff --git a/nwnds_module/ka_babaudeath.ncs b/nwnds_module/ka_babaudeath.ncs new file mode 100644 index 000000000..5eb6f772d Binary files /dev/null and b/nwnds_module/ka_babaudeath.ncs differ diff --git a/nwnds_module/ka_babaudeath.nss b/nwnds_module/ka_babaudeath.nss new file mode 100644 index 000000000..091a673b5 --- /dev/null +++ b/nwnds_module/ka_babaudeath.nss @@ -0,0 +1,242 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" +#include "nw_j_assassin" +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); + +void main() + { + object oNPC = OBJECT_SELF; + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oNPC); + object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oNPC); + + // Give a 5% chance to drop armor &/or equipped weapon + int bDroppableA = d100() > 95; + int bDroppableW = d100() > 95; + + SetDroppableFlag(oArmor, bDroppableA); + SetDroppableFlag(oWeapon, bDroppableW); + +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "Clockwork") == 8) + { + AddJournalQuestEntry ("Clockwork", 9, oPC); + } +} +SetLocalInt(GetLastKiller(), "nKilledBabau", 1); + SpeakString("Rargh!", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/ka_brutedeath.ncs b/nwnds_module/ka_brutedeath.ncs new file mode 100644 index 000000000..2898949cc Binary files /dev/null and b/nwnds_module/ka_brutedeath.ncs differ diff --git a/nwnds_module/ka_brutedeath.nss b/nwnds_module/ka_brutedeath.nss new file mode 100644 index 000000000..7fcf9e4f6 --- /dev/null +++ b/nwnds_module/ka_brutedeath.nss @@ -0,0 +1,231 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" +#include "nw_j_assassin" +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "HejkinRaiders") == 1) + { + AddJournalQuestEntry ("HejkinRaiders", 2, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledhejkin", 1); + SpeakString("*You recover the stolen Iron Shipment*", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +CreateItemOnObject("stoleniron", oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/ka_buypasscoin.ncs b/nwnds_module/ka_buypasscoin.ncs new file mode 100644 index 000000000..3cb9bf95f Binary files /dev/null and b/nwnds_module/ka_buypasscoin.ncs differ diff --git a/nwnds_module/ka_buypasscoin.nss b/nwnds_module/ka_buypasscoin.nss new file mode 100644 index 000000000..40884c6de --- /dev/null +++ b/nwnds_module/ka_buypasscoin.nss @@ -0,0 +1,28 @@ +int nInt; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 100) + { + AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE)); + + CreateItemOnObject("passcoin", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Ephanie"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ka_captainreynol.dlg b/nwnds_module/ka_captainreynol.dlg new file mode 100644 index 000000000..e86d5d358 Binary files /dev/null and b/nwnds_module/ka_captainreynol.dlg differ diff --git a/nwnds_module/ka_checklvl3to7.ncs b/nwnds_module/ka_checklvl3to7.ncs new file mode 100644 index 000000000..739a5db75 Binary files /dev/null and b/nwnds_module/ka_checklvl3to7.ncs differ diff --git a/nwnds_module/ka_checklvl3to7.nss b/nwnds_module/ka_checklvl3to7.nss new file mode 100644 index 000000000..d7f65a4ee --- /dev/null +++ b/nwnds_module/ka_checklvl3to7.nss @@ -0,0 +1,17 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetHitDice(oPC) >= 3)) return FALSE; + +if (!(GetHitDice(oPC) <= 7)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_checklvl5to10.ncs b/nwnds_module/ka_checklvl5to10.ncs new file mode 100644 index 000000000..2b6e3b329 Binary files /dev/null and b/nwnds_module/ka_checklvl5to10.ncs differ diff --git a/nwnds_module/ka_checklvl5to10.nss b/nwnds_module/ka_checklvl5to10.nss new file mode 100644 index 000000000..db1bbbb40 --- /dev/null +++ b/nwnds_module/ka_checklvl5to10.nss @@ -0,0 +1,17 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetHitDice(oPC) >= 5)) return FALSE; + +if (!(GetHitDice(oPC) <= 10)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chirl.dlg b/nwnds_module/ka_chirl.dlg new file mode 100644 index 000000000..eface412a Binary files /dev/null and b/nwnds_module/ka_chirl.dlg differ diff --git a/nwnds_module/ka_chkaltar.ncs b/nwnds_module/ka_chkaltar.ncs new file mode 100644 index 000000000..5091d32e0 Binary files /dev/null and b/nwnds_module/ka_chkaltar.ncs differ diff --git a/nwnds_module/ka_chkaltar.nss b/nwnds_module/ka_chkaltar.nss new file mode 100644 index 000000000..8683fdfe7 --- /dev/null +++ b/nwnds_module/ka_chkaltar.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 5)) + return FALSE; + +return TRUE; +} + + + + diff --git a/nwnds_module/ka_chkaltar2.ncs b/nwnds_module/ka_chkaltar2.ncs new file mode 100644 index 000000000..f730d9c79 Binary files /dev/null and b/nwnds_module/ka_chkaltar2.ncs differ diff --git a/nwnds_module/ka_chkaltar2.nss b/nwnds_module/ka_chkaltar2.nss new file mode 100644 index 000000000..20c7410da --- /dev/null +++ b/nwnds_module/ka_chkaltar2.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt >= 6)) + return FALSE; + +return TRUE; +} + + + + diff --git a/nwnds_module/ka_chkbaker1.ncs b/nwnds_module/ka_chkbaker1.ncs new file mode 100644 index 000000000..a747de179 Binary files /dev/null and b/nwnds_module/ka_chkbaker1.ncs differ diff --git a/nwnds_module/ka_chkbaker1.nss b/nwnds_module/ka_chkbaker1.nss new file mode 100644 index 000000000..93ade7bd0 --- /dev/null +++ b/nwnds_module/ka_chkbaker1.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "baker") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkhas250gp.ncs b/nwnds_module/ka_chkhas250gp.ncs new file mode 100644 index 000000000..43329d381 Binary files /dev/null and b/nwnds_module/ka_chkhas250gp.ncs differ diff --git a/nwnds_module/ka_chkhas250gp.nss b/nwnds_module/ka_chkhas250gp.nss new file mode 100644 index 000000000..47085cc37 --- /dev/null +++ b/nwnds_module/ka_chkhas250gp.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + if(GetGold(GetPCSpeaker()) < 250) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/ka_chklvl10to20.ncs b/nwnds_module/ka_chklvl10to20.ncs new file mode 100644 index 000000000..e337dd159 Binary files /dev/null and b/nwnds_module/ka_chklvl10to20.ncs differ diff --git a/nwnds_module/ka_chklvl10to20.nss b/nwnds_module/ka_chklvl10to20.nss new file mode 100644 index 000000000..654048c4b --- /dev/null +++ b/nwnds_module/ka_chklvl10to20.nss @@ -0,0 +1,17 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetHitDice(oPC) >= 10)) return FALSE; + +if (!(GetHitDice(oPC) <= 20)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkselene1.ncs b/nwnds_module/ka_chkselene1.ncs new file mode 100644 index 000000000..c202c8714 Binary files /dev/null and b/nwnds_module/ka_chkselene1.ncs differ diff --git a/nwnds_module/ka_chkselene1.nss b/nwnds_module/ka_chkselene1.nss new file mode 100644 index 000000000..90f85329d --- /dev/null +++ b/nwnds_module/ka_chkselene1.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)==0)&& + (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)==0)) +return FALSE; + +if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkselene2.ncs b/nwnds_module/ka_chkselene2.ncs new file mode 100644 index 000000000..e185f0516 Binary files /dev/null and b/nwnds_module/ka_chkselene2.ncs differ diff --git a/nwnds_module/ka_chkselene2.nss b/nwnds_module/ka_chkselene2.nss new file mode 100644 index 000000000..b384000b6 --- /dev/null +++ b/nwnds_module/ka_chkselene2.nss @@ -0,0 +1,22 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} + + diff --git a/nwnds_module/ka_chkselene3.ncs b/nwnds_module/ka_chkselene3.ncs new file mode 100644 index 000000000..f6f373f48 Binary files /dev/null and b/nwnds_module/ka_chkselene3.ncs differ diff --git a/nwnds_module/ka_chkselene3.nss b/nwnds_module/ka_chkselene3.nss new file mode 100644 index 000000000..c50a5ec83 --- /dev/null +++ b/nwnds_module/ka_chkselene3.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_SHADEMESSAGE") == OBJECT_INVALID) return FALSE; + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 2)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkselene4.ncs b/nwnds_module/ka_chkselene4.ncs new file mode 100644 index 000000000..154b75d6f Binary files /dev/null and b/nwnds_module/ka_chkselene4.ncs differ diff --git a/nwnds_module/ka_chkselene4.nss b/nwnds_module/ka_chkselene4.nss new file mode 100644 index 000000000..52eaffea6 --- /dev/null +++ b/nwnds_module/ka_chkselene4.nss @@ -0,0 +1,22 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt >= 2)) + return FALSE; + +return TRUE; +} + + diff --git a/nwnds_module/ka_chkselene5.ncs b/nwnds_module/ka_chkselene5.ncs new file mode 100644 index 000000000..8eb22f9ac Binary files /dev/null and b/nwnds_module/ka_chkselene5.ncs differ diff --git a/nwnds_module/ka_chkselene5.nss b/nwnds_module/ka_chkselene5.nss new file mode 100644 index 000000000..4fe0278bf --- /dev/null +++ b/nwnds_module/ka_chkselene5.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_SELENEPACK") == OBJECT_INVALID) return FALSE; + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkselene6.ncs b/nwnds_module/ka_chkselene6.ncs new file mode 100644 index 000000000..abd6cb97c Binary files /dev/null and b/nwnds_module/ka_chkselene6.ncs differ diff --git a/nwnds_module/ka_chkselene6.nss b/nwnds_module/ka_chkselene6.nss new file mode 100644 index 000000000..a94aff57b --- /dev/null +++ b/nwnds_module/ka_chkselene6.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt >= 3)) + return FALSE; + +return TRUE; +} + + + diff --git a/nwnds_module/ka_chkselene7.ncs b/nwnds_module/ka_chkselene7.ncs new file mode 100644 index 000000000..cee0f9395 Binary files /dev/null and b/nwnds_module/ka_chkselene7.ncs differ diff --git a/nwnds_module/ka_chkselene7.nss b/nwnds_module/ka_chkselene7.nss new file mode 100644 index 000000000..d62720e4b --- /dev/null +++ b/nwnds_module/ka_chkselene7.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 4)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_HELM_MARTOSA") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + + + diff --git a/nwnds_module/ka_chkselene8.ncs b/nwnds_module/ka_chkselene8.ncs new file mode 100644 index 000000000..901a57fdf Binary files /dev/null and b/nwnds_module/ka_chkselene8.ncs differ diff --git a/nwnds_module/ka_chkselene8.nss b/nwnds_module/ka_chkselene8.nss new file mode 100644 index 000000000..06acfe000 --- /dev/null +++ b/nwnds_module/ka_chkselene8.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt >= 5)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_chkselene9.ncs b/nwnds_module/ka_chkselene9.ncs new file mode 100644 index 000000000..627e6b867 Binary files /dev/null and b/nwnds_module/ka_chkselene9.ncs differ diff --git a/nwnds_module/ka_chkselene9.nss b/nwnds_module/ka_chkselene9.nss new file mode 100644 index 000000000..ad5b1d0ff --- /dev/null +++ b/nwnds_module/ka_chkselene9.nss @@ -0,0 +1,22 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "seleneapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 6)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_ANCIENTSTAT") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_chkvorax1.ncs b/nwnds_module/ka_chkvorax1.ncs new file mode 100644 index 000000000..40df45dd6 Binary files /dev/null and b/nwnds_module/ka_chkvorax1.ncs differ diff --git a/nwnds_module/ka_chkvorax1.nss b/nwnds_module/ka_chkvorax1.nss new file mode 100644 index 000000000..b031fddec --- /dev/null +++ b/nwnds_module/ka_chkvorax1.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 5)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax2.ncs b/nwnds_module/ka_chkvorax2.ncs new file mode 100644 index 000000000..e56ccda00 Binary files /dev/null and b/nwnds_module/ka_chkvorax2.ncs differ diff --git a/nwnds_module/ka_chkvorax2.nss b/nwnds_module/ka_chkvorax2.nss new file mode 100644 index 000000000..84d4a2b08 --- /dev/null +++ b/nwnds_module/ka_chkvorax2.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt >= 6)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax3.ncs b/nwnds_module/ka_chkvorax3.ncs new file mode 100644 index 000000000..71d4158bc Binary files /dev/null and b/nwnds_module/ka_chkvorax3.ncs differ diff --git a/nwnds_module/ka_chkvorax3.nss b/nwnds_module/ka_chkvorax3.nss new file mode 100644 index 000000000..533d838b8 --- /dev/null +++ b/nwnds_module/ka_chkvorax3.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 7)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax4.ncs b/nwnds_module/ka_chkvorax4.ncs new file mode 100644 index 000000000..50167bed0 Binary files /dev/null and b/nwnds_module/ka_chkvorax4.ncs differ diff --git a/nwnds_module/ka_chkvorax4.nss b/nwnds_module/ka_chkvorax4.nss new file mode 100644 index 000000000..ea01932bf --- /dev/null +++ b/nwnds_module/ka_chkvorax4.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt >= 8)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax5.ncs b/nwnds_module/ka_chkvorax5.ncs new file mode 100644 index 000000000..15295a55e Binary files /dev/null and b/nwnds_module/ka_chkvorax5.ncs differ diff --git a/nwnds_module/ka_chkvorax5.nss b/nwnds_module/ka_chkvorax5.nss new file mode 100644 index 000000000..db290f219 --- /dev/null +++ b/nwnds_module/ka_chkvorax5.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 9)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_SHOMLOOT") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax6.ncs b/nwnds_module/ka_chkvorax6.ncs new file mode 100644 index 000000000..a3f369fff Binary files /dev/null and b/nwnds_module/ka_chkvorax6.ncs differ diff --git a/nwnds_module/ka_chkvorax6.nss b/nwnds_module/ka_chkvorax6.nss new file mode 100644 index 000000000..bae27a882 --- /dev/null +++ b/nwnds_module/ka_chkvorax6.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 10)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkvorax7.ncs b/nwnds_module/ka_chkvorax7.ncs new file mode 100644 index 000000000..4e96d1d32 Binary files /dev/null and b/nwnds_module/ka_chkvorax7.ncs differ diff --git a/nwnds_module/ka_chkvorax7.nss b/nwnds_module/ka_chkvorax7.nss new file mode 100644 index 000000000..1264c8d82 --- /dev/null +++ b/nwnds_module/ka_chkvorax7.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "templaramulet") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkweis.ncs b/nwnds_module/ka_chkweis.ncs new file mode 100644 index 000000000..28f602829 Binary files /dev/null and b/nwnds_module/ka_chkweis.ncs differ diff --git a/nwnds_module/ka_chkweis.nss b/nwnds_module/ka_chkweis.nss new file mode 100644 index 000000000..16d939db0 --- /dev/null +++ b/nwnds_module/ka_chkweis.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_HIGHBUREAU01") == OBJECT_INVALID) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (GetLocalInt(oPC, "yehinaapproves") != 1) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc.ncs b/nwnds_module/ka_chkyehinadoc.ncs new file mode 100644 index 000000000..72c96066a Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc.nss b/nwnds_module/ka_chkyehinadoc.nss new file mode 100644 index 000000000..84047b652 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 2)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_YEHINADOCS") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc1.ncs b/nwnds_module/ka_chkyehinadoc1.ncs new file mode 100644 index 000000000..e3d4fb221 Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc1.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc1.nss b/nwnds_module/ka_chkyehinadoc1.nss new file mode 100644 index 000000000..a51d4ad86 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc1.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc2.ncs b/nwnds_module/ka_chkyehinadoc2.ncs new file mode 100644 index 000000000..bfd034cb5 Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc2.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc2.nss b/nwnds_module/ka_chkyehinadoc2.nss new file mode 100644 index 000000000..14d025ff6 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc2.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt >= 3)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc3.ncs b/nwnds_module/ka_chkyehinadoc3.ncs new file mode 100644 index 000000000..c226a7889 Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc3.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc3.nss b/nwnds_module/ka_chkyehinadoc3.nss new file mode 100644 index 000000000..cdc246916 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc3.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 4)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc4.ncs b/nwnds_module/ka_chkyehinadoc4.ncs new file mode 100644 index 000000000..a3f369fff Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc4.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc4.nss b/nwnds_module/ka_chkyehinadoc4.nss new file mode 100644 index 000000000..bae27a882 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc4.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 10)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc5.ncs b/nwnds_module/ka_chkyehinadoc5.ncs new file mode 100644 index 000000000..5b58c7c70 Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc5.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc5.nss b/nwnds_module/ka_chkyehinadoc5.nss new file mode 100644 index 000000000..658fd17d3 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc5.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_chkyehinadoc6.ncs b/nwnds_module/ka_chkyehinadoc6.ncs new file mode 100644 index 000000000..ee8b279d8 Binary files /dev/null and b/nwnds_module/ka_chkyehinadoc6.ncs differ diff --git a/nwnds_module/ka_chkyehinadoc6.nss b/nwnds_module/ka_chkyehinadoc6.nss new file mode 100644 index 000000000..9b3fec0c0 --- /dev/null +++ b/nwnds_module/ka_chkyehinadoc6.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinaapproves") == 1)) return FALSE; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt >= 5)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockjournal.dlg b/nwnds_module/ka_clockjournal.dlg new file mode 100644 index 000000000..d6cc937bd Binary files /dev/null and b/nwnds_module/ka_clockjournal.dlg differ diff --git a/nwnds_module/ka_clockwork1.ncs b/nwnds_module/ka_clockwork1.ncs new file mode 100644 index 000000000..88f66cc46 Binary files /dev/null and b/nwnds_module/ka_clockwork1.ncs differ diff --git a/nwnds_module/ka_clockwork1.nss b/nwnds_module/ka_clockwork1.nss new file mode 100644 index 000000000..b556562ee --- /dev/null +++ b/nwnds_module/ka_clockwork1.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 1)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_clockwork14.ncs b/nwnds_module/ka_clockwork14.ncs new file mode 100644 index 000000000..47bc10442 Binary files /dev/null and b/nwnds_module/ka_clockwork14.ncs differ diff --git a/nwnds_module/ka_clockwork14.nss b/nwnds_module/ka_clockwork14.nss new file mode 100644 index 000000000..60d5bb8c4 --- /dev/null +++ b/nwnds_module/ka_clockwork14.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 12)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork15.ncs b/nwnds_module/ka_clockwork15.ncs new file mode 100644 index 000000000..be4a3a8f0 Binary files /dev/null and b/nwnds_module/ka_clockwork15.ncs differ diff --git a/nwnds_module/ka_clockwork15.nss b/nwnds_module/ka_clockwork15.nss new file mode 100644 index 000000000..ed5f37722 --- /dev/null +++ b/nwnds_module/ka_clockwork15.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt >= 6)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork16.ncs b/nwnds_module/ka_clockwork16.ncs new file mode 100644 index 000000000..b7c0470ab Binary files /dev/null and b/nwnds_module/ka_clockwork16.ncs differ diff --git a/nwnds_module/ka_clockwork16.nss b/nwnds_module/ka_clockwork16.nss new file mode 100644 index 000000000..247259b90 --- /dev/null +++ b/nwnds_module/ka_clockwork16.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 5)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +if (GetItemPossessedBy(oPC, "esutascharm") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork3.ncs b/nwnds_module/ka_clockwork3.ncs new file mode 100644 index 000000000..e874a8770 Binary files /dev/null and b/nwnds_module/ka_clockwork3.ncs differ diff --git a/nwnds_module/ka_clockwork3.nss b/nwnds_module/ka_clockwork3.nss new file mode 100644 index 000000000..0eab68083 --- /dev/null +++ b/nwnds_module/ka_clockwork3.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 11)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork5.ncs b/nwnds_module/ka_clockwork5.ncs new file mode 100644 index 000000000..42a634610 Binary files /dev/null and b/nwnds_module/ka_clockwork5.ncs differ diff --git a/nwnds_module/ka_clockwork5.nss b/nwnds_module/ka_clockwork5.nss new file mode 100644 index 000000000..6ba66f9ce --- /dev/null +++ b/nwnds_module/ka_clockwork5.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 2)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork6.ncs b/nwnds_module/ka_clockwork6.ncs new file mode 100644 index 000000000..e7ab9dc79 Binary files /dev/null and b/nwnds_module/ka_clockwork6.ncs differ diff --git a/nwnds_module/ka_clockwork6.nss b/nwnds_module/ka_clockwork6.nss new file mode 100644 index 000000000..21de77ffb --- /dev/null +++ b/nwnds_module/ka_clockwork6.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 3)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork7.ncs b/nwnds_module/ka_clockwork7.ncs new file mode 100644 index 000000000..4ff478861 Binary files /dev/null and b/nwnds_module/ka_clockwork7.ncs differ diff --git a/nwnds_module/ka_clockwork7.nss b/nwnds_module/ka_clockwork7.nss new file mode 100644 index 000000000..a2be3af30 --- /dev/null +++ b/nwnds_module/ka_clockwork7.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 4)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockwork9.ncs b/nwnds_module/ka_clockwork9.ncs new file mode 100644 index 000000000..24afc93ce Binary files /dev/null and b/nwnds_module/ka_clockwork9.ncs differ diff --git a/nwnds_module/ka_clockwork9.nss b/nwnds_module/ka_clockwork9.nss new file mode 100644 index 000000000..04003f202 --- /dev/null +++ b/nwnds_module/ka_clockwork9.nss @@ -0,0 +1,21 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYClockwork"); + +if (!(nInt == 6)) + return FALSE; + +if (GetItemPossessedBy(oPC, "MapofClockworkIsle") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_clockworkfin.ncs b/nwnds_module/ka_clockworkfin.ncs new file mode 100644 index 000000000..ce96a34ec Binary files /dev/null and b/nwnds_module/ka_clockworkfin.ncs differ diff --git a/nwnds_module/ka_clockworkfin.nss b/nwnds_module/ka_clockworkfin.nss new file mode 100644 index 000000000..bbd68c666 --- /dev/null +++ b/nwnds_module/ka_clockworkfin.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "clockworkbook1"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +oItem = GetItemPossessedBy(oPC, "clockworkbook2"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +oItem = GetItemPossessedBy(oPC, "clockworkscroll"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +SetLocalInt(oPC, "clockworkstart", 0); + +} diff --git a/nwnds_module/ka_coochkurik.ncs b/nwnds_module/ka_coochkurik.ncs new file mode 100644 index 000000000..3ce01218b Binary files /dev/null and b/nwnds_module/ka_coochkurik.ncs differ diff --git a/nwnds_module/ka_coochkurik.nss b/nwnds_module/ka_coochkurik.nss new file mode 100644 index 000000000..7da3a76e6 --- /dev/null +++ b/nwnds_module/ka_coochkurik.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "coourik") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_delia.dlg b/nwnds_module/ka_delia.dlg new file mode 100644 index 000000000..99ddeba3d Binary files /dev/null and b/nwnds_module/ka_delia.dlg differ diff --git a/nwnds_module/ka_detourchk2.ncs b/nwnds_module/ka_detourchk2.ncs new file mode 100644 index 000000000..3e0ba1ebe Binary files /dev/null and b/nwnds_module/ka_detourchk2.ncs differ diff --git a/nwnds_module/ka_detourchk2.nss b/nwnds_module/ka_detourchk2.nss new file mode 100644 index 000000000..4261ecf84 --- /dev/null +++ b/nwnds_module/ka_detourchk2.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYDetour"); + +if (!(nInt == 2)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_CARAVANSUP") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_detourchk3.ncs b/nwnds_module/ka_detourchk3.ncs new file mode 100644 index 000000000..5285a03b9 Binary files /dev/null and b/nwnds_module/ka_detourchk3.ncs differ diff --git a/nwnds_module/ka_detourchk3.nss b/nwnds_module/ka_detourchk3.nss new file mode 100644 index 000000000..c8f850921 --- /dev/null +++ b/nwnds_module/ka_detourchk3.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYDetour"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_detourchk4.ncs b/nwnds_module/ka_detourchk4.ncs new file mode 100644 index 000000000..399589216 Binary files /dev/null and b/nwnds_module/ka_detourchk4.ncs differ diff --git a/nwnds_module/ka_detourchk4.nss b/nwnds_module/ka_detourchk4.nss new file mode 100644 index 000000000..76e30a7c9 --- /dev/null +++ b/nwnds_module/ka_detourchk4.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYDetour"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_detourtrigger.ncs b/nwnds_module/ka_detourtrigger.ncs new file mode 100644 index 000000000..1cdb20bec Binary files /dev/null and b/nwnds_module/ka_detourtrigger.ncs differ diff --git a/nwnds_module/ka_detourtrigger.nss b/nwnds_module/ka_detourtrigger.nss new file mode 100644 index 000000000..b94815922 --- /dev/null +++ b/nwnds_module/ka_detourtrigger.nss @@ -0,0 +1,46 @@ +string sDeny; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYDetour"); + +if (!(nInt == 1)) + { + sDeny="It appears as if a vehicle has headed north of here, but there is no sign of it now..."; + + SendMessageToPC(oPC, sDeny); + + return; + } + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_DETOUR"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_didbook.ncs b/nwnds_module/ka_didbook.ncs new file mode 100644 index 000000000..d3aa2df60 Binary files /dev/null and b/nwnds_module/ka_didbook.ncs differ diff --git a/nwnds_module/ka_didbook.nss b/nwnds_module/ka_didbook.nss new file mode 100644 index 000000000..5a202f11e --- /dev/null +++ b/nwnds_module/ka_didbook.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYSageAdvice"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_didhuntquest1.ncs b/nwnds_module/ka_didhuntquest1.ncs new file mode 100644 index 000000000..75c04ec34 Binary files /dev/null and b/nwnds_module/ka_didhuntquest1.ncs differ diff --git a/nwnds_module/ka_didhuntquest1.nss b/nwnds_module/ka_didhuntquest1.nss new file mode 100644 index 000000000..6b064da44 --- /dev/null +++ b/nwnds_module/ka_didhuntquest1.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYhuntandgather1"); + +if (nInt < 2) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_elvadeath.ncs b/nwnds_module/ka_elvadeath.ncs new file mode 100644 index 000000000..f1cd4bae5 Binary files /dev/null and b/nwnds_module/ka_elvadeath.ncs differ diff --git a/nwnds_module/ka_elvadeath.nss b/nwnds_module/ka_elvadeath.nss new file mode 100644 index 000000000..ca0174b1f --- /dev/null +++ b/nwnds_module/ka_elvadeath.nss @@ -0,0 +1,230 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" +#include "nw_j_assassin" +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "Clockwork") == 3) + { + AddJournalQuestEntry ("Clockwork", 4, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledElva", 1); + SpeakString("Damn you!", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/ka_entermim.ncs b/nwnds_module/ka_entermim.ncs new file mode 100644 index 000000000..967967858 Binary files /dev/null and b/nwnds_module/ka_entermim.ncs differ diff --git a/nwnds_module/ka_entermim.nss b/nwnds_module/ka_entermim.nss new file mode 100644 index 000000000..2aa04fbfd --- /dev/null +++ b/nwnds_module/ka_entermim.nss @@ -0,0 +1,33 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnOpen +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_MIMHOUSE"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_entermimsew1.ncs b/nwnds_module/ka_entermimsew1.ncs new file mode 100644 index 000000000..ace815927 Binary files /dev/null and b/nwnds_module/ka_entermimsew1.ncs differ diff --git a/nwnds_module/ka_entermimsew1.nss b/nwnds_module/ka_entermimsew1.nss new file mode 100644 index 000000000..f0fc9b8b3 --- /dev/null +++ b/nwnds_module/ka_entermimsew1.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_mimsew1")); + +} + + diff --git a/nwnds_module/ka_entermimsew2.ncs b/nwnds_module/ka_entermimsew2.ncs new file mode 100644 index 000000000..26661cca7 Binary files /dev/null and b/nwnds_module/ka_entermimsew2.ncs differ diff --git a/nwnds_module/ka_entermimsew2.nss b/nwnds_module/ka_entermimsew2.nss new file mode 100644 index 000000000..7a70dd299 --- /dev/null +++ b/nwnds_module/ka_entermimsew2.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_mimsew2")); + +} + + diff --git a/nwnds_module/ka_entermimsew3.ncs b/nwnds_module/ka_entermimsew3.ncs new file mode 100644 index 000000000..dc4268a70 Binary files /dev/null and b/nwnds_module/ka_entermimsew3.ncs differ diff --git a/nwnds_module/ka_entermimsew3.nss b/nwnds_module/ka_entermimsew3.nss new file mode 100644 index 000000000..d611af376 --- /dev/null +++ b/nwnds_module/ka_entermimsew3.nss @@ -0,0 +1,25 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_mimsew3")); + +} + + diff --git a/nwnds_module/ka_entertrail1.ncs b/nwnds_module/ka_entertrail1.ncs new file mode 100644 index 000000000..7eb5ea2b3 Binary files /dev/null and b/nwnds_module/ka_entertrail1.ncs differ diff --git a/nwnds_module/ka_entertrail1.nss b/nwnds_module/ka_entertrail1.nss new file mode 100644 index 000000000..d3c0d667d --- /dev/null +++ b/nwnds_module/ka_entertrail1.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_trailspeech")); +} + + diff --git a/nwnds_module/ka_entertrail2.ncs b/nwnds_module/ka_entertrail2.ncs new file mode 100644 index 000000000..bc009c6ec Binary files /dev/null and b/nwnds_module/ka_entertrail2.ncs differ diff --git a/nwnds_module/ka_entertrail2.nss b/nwnds_module/ka_entertrail2.nss new file mode 100644 index 000000000..9374b66f7 --- /dev/null +++ b/nwnds_module/ka_entertrail2.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_trailspeech2")); +} + + diff --git a/nwnds_module/ka_entertrail3.ncs b/nwnds_module/ka_entertrail3.ncs new file mode 100644 index 000000000..1334dbadd Binary files /dev/null and b/nwnds_module/ka_entertrail3.ncs differ diff --git a/nwnds_module/ka_entertrail3.nss b/nwnds_module/ka_entertrail3.nss new file mode 100644 index 000000000..d071b0807 --- /dev/null +++ b/nwnds_module/ka_entertrail3.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnEnter +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int DoOnce = GetLocalInt(oPC, GetTag(OBJECT_SELF)); + +if (DoOnce==TRUE) return; + +SetLocalInt(oPC, GetTag(OBJECT_SELF), TRUE); + +AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("ka_trailspeech3")); +} + + diff --git a/nwnds_module/ka_ephanie.dlg b/nwnds_module/ka_ephanie.dlg new file mode 100644 index 000000000..8c02d0993 Binary files /dev/null and b/nwnds_module/ka_ephanie.dlg differ diff --git a/nwnds_module/ka_esutacheck1.ncs b/nwnds_module/ka_esutacheck1.ncs new file mode 100644 index 000000000..0434d0216 Binary files /dev/null and b/nwnds_module/ka_esutacheck1.ncs differ diff --git a/nwnds_module/ka_esutacheck1.nss b/nwnds_module/ka_esutacheck1.nss new file mode 100644 index 000000000..84ee8ab07 --- /dev/null +++ b/nwnds_module/ka_esutacheck1.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYesutascharge"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_esutacheck2.ncs b/nwnds_module/ka_esutacheck2.ncs new file mode 100644 index 000000000..ef7e7c1f7 Binary files /dev/null and b/nwnds_module/ka_esutacheck2.ncs differ diff --git a/nwnds_module/ka_esutacheck2.nss b/nwnds_module/ka_esutacheck2.nss new file mode 100644 index 000000000..065962f4b --- /dev/null +++ b/nwnds_module/ka_esutacheck2.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYesutascharge"); + +if (!(nInt == 2)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_esutacheck3.ncs b/nwnds_module/ka_esutacheck3.ncs new file mode 100644 index 000000000..c7e779ae3 Binary files /dev/null and b/nwnds_module/ka_esutacheck3.ncs differ diff --git a/nwnds_module/ka_esutacheck3.nss b/nwnds_module/ka_esutacheck3.nss new file mode 100644 index 000000000..427e71e36 --- /dev/null +++ b/nwnds_module/ka_esutacheck3.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYesutascharge"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_esutadone.ncs b/nwnds_module/ka_esutadone.ncs new file mode 100644 index 000000000..b274a095b Binary files /dev/null and b/nwnds_module/ka_esutadone.ncs differ diff --git a/nwnds_module/ka_esutadone.nss b/nwnds_module/ka_esutadone.nss new file mode 100644 index 000000000..37a8706e3 --- /dev/null +++ b/nwnds_module/ka_esutadone.nss @@ -0,0 +1,23 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "githchiefhead"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +RewardPartyXP(700, oPC, TRUE); + +} + diff --git a/nwnds_module/ka_esutareward.ncs b/nwnds_module/ka_esutareward.ncs new file mode 100644 index 000000000..4a9498c2a Binary files /dev/null and b/nwnds_module/ka_esutareward.ncs differ diff --git a/nwnds_module/ka_esutareward.nss b/nwnds_module/ka_esutareward.nss new file mode 100644 index 000000000..713641ced --- /dev/null +++ b/nwnds_module/ka_esutareward.nss @@ -0,0 +1,18 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyGP(1000, oPC, FALSE); + +CreateItemOnObject("skydancercharm", oPC); + +} diff --git a/nwnds_module/ka_fence.dlg b/nwnds_module/ka_fence.dlg new file mode 100644 index 000000000..ea19aae7b Binary files /dev/null and b/nwnds_module/ka_fence.dlg differ diff --git a/nwnds_module/ka_fencestore.ncs b/nwnds_module/ka_fencestore.ncs new file mode 100644 index 000000000..a6d197a21 Binary files /dev/null and b/nwnds_module/ka_fencestore.ncs differ diff --git a/nwnds_module/ka_fencestore.nss b/nwnds_module/ka_fencestore.nss new file mode 100644 index 000000000..03a36c453 --- /dev/null +++ b/nwnds_module/ka_fencestore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("Fence"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_firevendor.dlg b/nwnds_module/ka_firevendor.dlg new file mode 100644 index 000000000..6a244c5f1 Binary files /dev/null and b/nwnds_module/ka_firevendor.dlg differ diff --git a/nwnds_module/ka_fmrenny.dlg b/nwnds_module/ka_fmrenny.dlg new file mode 100644 index 000000000..c480781ab Binary files /dev/null and b/nwnds_module/ka_fmrenny.dlg differ diff --git a/nwnds_module/ka_fortarmor.dlg b/nwnds_module/ka_fortarmor.dlg new file mode 100644 index 000000000..0641897e8 Binary files /dev/null and b/nwnds_module/ka_fortarmor.dlg differ diff --git a/nwnds_module/ka_fortarmor.ncs b/nwnds_module/ka_fortarmor.ncs new file mode 100644 index 000000000..bf00ddb4b Binary files /dev/null and b/nwnds_module/ka_fortarmor.ncs differ diff --git a/nwnds_module/ka_fortarmor.nss b/nwnds_module/ka_fortarmor.nss new file mode 100644 index 000000000..8aa6bc69e --- /dev/null +++ b/nwnds_module/ka_fortarmor.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("FortArmor"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_fortitems.dlg b/nwnds_module/ka_fortitems.dlg new file mode 100644 index 000000000..b7ba3e320 Binary files /dev/null and b/nwnds_module/ka_fortitems.dlg differ diff --git a/nwnds_module/ka_fortitems.ncs b/nwnds_module/ka_fortitems.ncs new file mode 100644 index 000000000..0c2e091b4 Binary files /dev/null and b/nwnds_module/ka_fortitems.ncs differ diff --git a/nwnds_module/ka_fortitems.nss b/nwnds_module/ka_fortitems.nss new file mode 100644 index 000000000..e5bc9ff33 --- /dev/null +++ b/nwnds_module/ka_fortitems.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("FortItems"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_gatherquest1.dlg b/nwnds_module/ka_gatherquest1.dlg new file mode 100644 index 000000000..8e5f38bfc Binary files /dev/null and b/nwnds_module/ka_gatherquest1.dlg differ diff --git a/nwnds_module/ka_give100xp50gp.ncs b/nwnds_module/ka_give100xp50gp.ncs new file mode 100644 index 000000000..4b7935c09 Binary files /dev/null and b/nwnds_module/ka_give100xp50gp.ncs differ diff --git a/nwnds_module/ka_give100xp50gp.nss b/nwnds_module/ka_give100xp50gp.nss new file mode 100644 index 000000000..5337afaaf --- /dev/null +++ b/nwnds_module/ka_give100xp50gp.nss @@ -0,0 +1,18 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(100, oPC, FALSE); + +RewardPartyGP(50, oPC, FALSE); + +} diff --git a/nwnds_module/ka_givebread.ncs b/nwnds_module/ka_givebread.ncs new file mode 100644 index 000000000..e6dff3332 Binary files /dev/null and b/nwnds_module/ka_givebread.ncs differ diff --git a/nwnds_module/ka_givebread.nss b/nwnds_module/ka_givebread.nss new file mode 100644 index 000000000..2d8983422 --- /dev/null +++ b/nwnds_module/ka_givebread.nss @@ -0,0 +1,9 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("larzbread", oPC); + +} diff --git a/nwnds_module/ka_givecharm.ncs b/nwnds_module/ka_givecharm.ncs new file mode 100644 index 000000000..65e3426fa Binary files /dev/null and b/nwnds_module/ka_givecharm.ncs differ diff --git a/nwnds_module/ka_givecharm.nss b/nwnds_module/ka_givecharm.nss new file mode 100644 index 000000000..58d8f9d25 --- /dev/null +++ b/nwnds_module/ka_givecharm.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("esutascharm", oPC); + +} diff --git a/nwnds_module/ka_givecomponent.ncs b/nwnds_module/ka_givecomponent.ncs new file mode 100644 index 000000000..a62e6837e Binary files /dev/null and b/nwnds_module/ka_givecomponent.ncs differ diff --git a/nwnds_module/ka_givecomponent.nss b/nwnds_module/ka_givecomponent.nss new file mode 100644 index 000000000..35f46f65e --- /dev/null +++ b/nwnds_module/ka_givecomponent.nss @@ -0,0 +1,8 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("magicalcomponent", oPC); + +} diff --git a/nwnds_module/ka_givehunt10.ncs b/nwnds_module/ka_givehunt10.ncs new file mode 100644 index 000000000..9f175842d Binary files /dev/null and b/nwnds_module/ka_givehunt10.ncs differ diff --git a/nwnds_module/ka_givehunt10.nss b/nwnds_module/ka_givehunt10.nss new file mode 100644 index 000000000..69ce318fc --- /dev/null +++ b/nwnds_module/ka_givehunt10.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem10", oPC); + +} + diff --git a/nwnds_module/ka_givehunt2.ncs b/nwnds_module/ka_givehunt2.ncs new file mode 100644 index 000000000..3879cdac6 Binary files /dev/null and b/nwnds_module/ka_givehunt2.ncs differ diff --git a/nwnds_module/ka_givehunt2.nss b/nwnds_module/ka_givehunt2.nss new file mode 100644 index 000000000..1d8a1ef19 --- /dev/null +++ b/nwnds_module/ka_givehunt2.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem2", oPC); + +} + diff --git a/nwnds_module/ka_givehunt3.ncs b/nwnds_module/ka_givehunt3.ncs new file mode 100644 index 000000000..bfa608aba Binary files /dev/null and b/nwnds_module/ka_givehunt3.ncs differ diff --git a/nwnds_module/ka_givehunt3.nss b/nwnds_module/ka_givehunt3.nss new file mode 100644 index 000000000..373298a1e --- /dev/null +++ b/nwnds_module/ka_givehunt3.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem3", oPC); + +} + diff --git a/nwnds_module/ka_givehunt4.ncs b/nwnds_module/ka_givehunt4.ncs new file mode 100644 index 000000000..a8633aef9 Binary files /dev/null and b/nwnds_module/ka_givehunt4.ncs differ diff --git a/nwnds_module/ka_givehunt4.nss b/nwnds_module/ka_givehunt4.nss new file mode 100644 index 000000000..d799f1a27 --- /dev/null +++ b/nwnds_module/ka_givehunt4.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem4", oPC); + +} + diff --git a/nwnds_module/ka_givehunt5.ncs b/nwnds_module/ka_givehunt5.ncs new file mode 100644 index 000000000..df8587105 Binary files /dev/null and b/nwnds_module/ka_givehunt5.ncs differ diff --git a/nwnds_module/ka_givehunt5.nss b/nwnds_module/ka_givehunt5.nss new file mode 100644 index 000000000..62c8f62cb --- /dev/null +++ b/nwnds_module/ka_givehunt5.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem5", oPC); + +} + diff --git a/nwnds_module/ka_givehunt6.ncs b/nwnds_module/ka_givehunt6.ncs new file mode 100644 index 000000000..f11e98ad7 Binary files /dev/null and b/nwnds_module/ka_givehunt6.ncs differ diff --git a/nwnds_module/ka_givehunt6.nss b/nwnds_module/ka_givehunt6.nss new file mode 100644 index 000000000..d7ee934f1 --- /dev/null +++ b/nwnds_module/ka_givehunt6.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem6", oPC); + +} + diff --git a/nwnds_module/ka_givehunt7.ncs b/nwnds_module/ka_givehunt7.ncs new file mode 100644 index 000000000..2b4d6d68c Binary files /dev/null and b/nwnds_module/ka_givehunt7.ncs differ diff --git a/nwnds_module/ka_givehunt7.nss b/nwnds_module/ka_givehunt7.nss new file mode 100644 index 000000000..0732836e8 --- /dev/null +++ b/nwnds_module/ka_givehunt7.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem7", oPC); + +} + diff --git a/nwnds_module/ka_givehunt8.ncs b/nwnds_module/ka_givehunt8.ncs new file mode 100644 index 000000000..c05529e94 Binary files /dev/null and b/nwnds_module/ka_givehunt8.ncs differ diff --git a/nwnds_module/ka_givehunt8.nss b/nwnds_module/ka_givehunt8.nss new file mode 100644 index 000000000..722cf6dc0 --- /dev/null +++ b/nwnds_module/ka_givehunt8.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem8", oPC); + +} + diff --git a/nwnds_module/ka_givehunt9.ncs b/nwnds_module/ka_givehunt9.ncs new file mode 100644 index 000000000..d3e9ef3c6 Binary files /dev/null and b/nwnds_module/ka_givehunt9.ncs differ diff --git a/nwnds_module/ka_givehunt9.nss b/nwnds_module/ka_givehunt9.nss new file mode 100644 index 000000000..25a832581 --- /dev/null +++ b/nwnds_module/ka_givehunt9.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("huntitem9", oPC); + +} + diff --git a/nwnds_module/ka_givemeteor.ncs b/nwnds_module/ka_givemeteor.ncs new file mode 100644 index 000000000..9493383df Binary files /dev/null and b/nwnds_module/ka_givemeteor.ncs differ diff --git a/nwnds_module/ka_givemeteor.nss b/nwnds_module/ka_givemeteor.nss new file mode 100644 index 000000000..819250d1a --- /dev/null +++ b/nwnds_module/ka_givemeteor.nss @@ -0,0 +1,9 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("qst_meteoriteore", oPC); + +} + diff --git a/nwnds_module/ka_givesapphire.ncs b/nwnds_module/ka_givesapphire.ncs new file mode 100644 index 000000000..1f372ef20 Binary files /dev/null and b/nwnds_module/ka_givesapphire.ncs differ diff --git a/nwnds_module/ka_givesapphire.nss b/nwnds_module/ka_givesapphire.nss new file mode 100644 index 000000000..f729ca7c3 --- /dev/null +++ b/nwnds_module/ka_givesapphire.nss @@ -0,0 +1,19 @@ +int nInt; +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetGold(oPC) >= 50000) + { + AssignCommand(oPC, TakeGoldFromCreature(50000, oPC, TRUE)); + + CreateItemOnObject("largefinelycutsa", oPC); + + } +else + { + AssignCommand(GetObjectByTag("Korik"), ActionSpeakString("Do not try and cheat me fool! I am wise to such tricks!")); + +} +} diff --git a/nwnds_module/ka_giveselenepac.ncs b/nwnds_module/ka_giveselenepac.ncs new file mode 100644 index 000000000..5c43448ff Binary files /dev/null and b/nwnds_module/ka_giveselenepac.ncs differ diff --git a/nwnds_module/ka_giveselenepac.nss b/nwnds_module/ka_giveselenepac.nss new file mode 100644 index 000000000..b06d13ca7 --- /dev/null +++ b/nwnds_module/ka_giveselenepac.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_SELENEPACK", oPC); + +} + diff --git a/nwnds_module/ka_giveshademess.ncs b/nwnds_module/ka_giveshademess.ncs new file mode 100644 index 000000000..bd93870d0 Binary files /dev/null and b/nwnds_module/ka_giveshademess.ncs differ diff --git a/nwnds_module/ka_giveshademess.nss b/nwnds_module/ka_giveshademess.nss new file mode 100644 index 000000000..cb6ac9a02 --- /dev/null +++ b/nwnds_module/ka_giveshademess.nss @@ -0,0 +1,17 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_SHADEMESSAGE", oPC); + +} + + diff --git a/nwnds_module/ka_giveshinbook.ncs b/nwnds_module/ka_giveshinbook.ncs new file mode 100644 index 000000000..8c0cb4b37 Binary files /dev/null and b/nwnds_module/ka_giveshinbook.ncs differ diff --git a/nwnds_module/ka_giveshinbook.nss b/nwnds_module/ka_giveshinbook.nss new file mode 100644 index 000000000..e98658ee2 --- /dev/null +++ b/nwnds_module/ka_giveshinbook.nss @@ -0,0 +1,10 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_ITBK_LASTSEA", oPC); + +} + diff --git a/nwnds_module/ka_giveshomkey.ncs b/nwnds_module/ka_giveshomkey.ncs new file mode 100644 index 000000000..8a2fcbe92 Binary files /dev/null and b/nwnds_module/ka_giveshomkey.ncs differ diff --git a/nwnds_module/ka_giveshomkey.nss b/nwnds_module/ka_giveshomkey.nss new file mode 100644 index 000000000..9668ad088 --- /dev/null +++ b/nwnds_module/ka_giveshomkey.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("AR_KEY_HOUSESHOM", oPC); + +} + diff --git a/nwnds_module/ka_givestartbook.ncs b/nwnds_module/ka_givestartbook.ncs new file mode 100644 index 000000000..26e116439 Binary files /dev/null and b/nwnds_module/ka_givestartbook.ncs differ diff --git a/nwnds_module/ka_givestartbook.nss b/nwnds_module/ka_givestartbook.nss new file mode 100644 index 000000000..7971c1563 --- /dev/null +++ b/nwnds_module/ka_givestartbook.nss @@ -0,0 +1,11 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("bookoflaws", oPC); + +CreateItemOnObject("bookofmagical", oPC); + +} diff --git a/nwnds_module/ka_givestatue.ncs b/nwnds_module/ka_givestatue.ncs new file mode 100644 index 000000000..e083a457a Binary files /dev/null and b/nwnds_module/ka_givestatue.ncs differ diff --git a/nwnds_module/ka_givestatue.nss b/nwnds_module/ka_givestatue.nss new file mode 100644 index 000000000..3f5b9d297 --- /dev/null +++ b/nwnds_module/ka_givestatue.nss @@ -0,0 +1,18 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyGP(200, oPC, FALSE); + +CreateItemOnObject("QST_ANCIENTSTAT", oPC); + +} diff --git a/nwnds_module/ka_givesupplies.ncs b/nwnds_module/ka_givesupplies.ncs new file mode 100644 index 000000000..09fcdff19 Binary files /dev/null and b/nwnds_module/ka_givesupplies.ncs differ diff --git a/nwnds_module/ka_givesupplies.nss b/nwnds_module/ka_givesupplies.nss new file mode 100644 index 000000000..e722af3b2 --- /dev/null +++ b/nwnds_module/ka_givesupplies.nss @@ -0,0 +1,9 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_CARAVANSUP", oPC); + +} diff --git a/nwnds_module/ka_giveurikvakey.ncs b/nwnds_module/ka_giveurikvakey.ncs new file mode 100644 index 000000000..0c040782c Binary files /dev/null and b/nwnds_module/ka_giveurikvakey.ncs differ diff --git a/nwnds_module/ka_giveurikvakey.nss b/nwnds_module/ka_giveurikvakey.nss new file mode 100644 index 000000000..b89fb1439 --- /dev/null +++ b/nwnds_module/ka_giveurikvakey.nss @@ -0,0 +1,8 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("urikvakey", oPC); + +} diff --git a/nwnds_module/ka_glandhuntin15.ncs b/nwnds_module/ka_glandhuntin15.ncs new file mode 100644 index 000000000..acc8a543b Binary files /dev/null and b/nwnds_module/ka_glandhuntin15.ncs differ diff --git a/nwnds_module/ka_glandhuntin15.nss b/nwnds_module/ka_glandhuntin15.nss new file mode 100644 index 000000000..b73eeac81 --- /dev/null +++ b/nwnds_module/ka_glandhuntin15.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetLocalInt(oPC, "glandhunt") != 15) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_glandhuntint1.ncs b/nwnds_module/ka_glandhuntint1.ncs new file mode 100644 index 000000000..0dfbe5e01 Binary files /dev/null and b/nwnds_module/ka_glandhuntint1.ncs differ diff --git a/nwnds_module/ka_glandhuntint1.nss b/nwnds_module/ka_glandhuntint1.nss new file mode 100644 index 000000000..5bba37f51 --- /dev/null +++ b/nwnds_module/ka_glandhuntint1.nss @@ -0,0 +1,19 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "Gland1"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +int nInt; +nInt = GetLocalInt(oPC, "glandhunt"); + +nInt += 1; + +SetLocalInt(oPC, "glandhunt", nInt); + +} diff --git a/nwnds_module/ka_goldlion1.ncs b/nwnds_module/ka_goldlion1.ncs new file mode 100644 index 000000000..e8b968ca9 Binary files /dev/null and b/nwnds_module/ka_goldlion1.ncs differ diff --git a/nwnds_module/ka_goldlion1.nss b/nwnds_module/ka_goldlion1.nss new file mode 100644 index 000000000..3af29f092 --- /dev/null +++ b/nwnds_module/ka_goldlion1.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_GOLDLIONROOM1"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_goldlion2.ncs b/nwnds_module/ka_goldlion2.ncs new file mode 100644 index 000000000..c84d0702b Binary files /dev/null and b/nwnds_module/ka_goldlion2.ncs differ diff --git a/nwnds_module/ka_goldlion2.nss b/nwnds_module/ka_goldlion2.nss new file mode 100644 index 000000000..f392704b6 --- /dev/null +++ b/nwnds_module/ka_goldlion2.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_GOLDLIONROOM2"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_has1gland.ncs b/nwnds_module/ka_has1gland.ncs new file mode 100644 index 000000000..1e988db69 Binary files /dev/null and b/nwnds_module/ka_has1gland.ncs differ diff --git a/nwnds_module/ka_has1gland.nss b/nwnds_module/ka_has1gland.nss new file mode 100644 index 000000000..5c240eae3 --- /dev/null +++ b/nwnds_module/ka_has1gland.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "Gland1") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasairhide.ncs b/nwnds_module/ka_hasairhide.ncs new file mode 100644 index 000000000..ec1580fbd Binary files /dev/null and b/nwnds_module/ka_hasairhide.ncs differ diff --git a/nwnds_module/ka_hasairhide.nss b/nwnds_module/ka_hasairhide.nss new file mode 100644 index 000000000..ee7270dc6 --- /dev/null +++ b/nwnds_module/ka_hasairhide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hasairhide +/* + + Detects the presence of a air drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_air_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_hasbaker1.ncs b/nwnds_module/ka_hasbaker1.ncs new file mode 100644 index 000000000..2b27c50bc Binary files /dev/null and b/nwnds_module/ka_hasbaker1.ncs differ diff --git a/nwnds_module/ka_hasbaker1.nss b/nwnds_module/ka_hasbaker1.nss new file mode 100644 index 000000000..4a288b890 --- /dev/null +++ b/nwnds_module/ka_hasbaker1.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYMorningDelivery"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hasbaker2.ncs b/nwnds_module/ka_hasbaker2.ncs new file mode 100644 index 000000000..226ab54ef Binary files /dev/null and b/nwnds_module/ka_hasbaker2.ncs differ diff --git a/nwnds_module/ka_hasbaker2.nss b/nwnds_module/ka_hasbaker2.nss new file mode 100644 index 000000000..c2989d17c --- /dev/null +++ b/nwnds_module/ka_hasbaker2.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYMorningDelivery"); + +if (!(nInt == 2)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hasblood.ncs b/nwnds_module/ka_hasblood.ncs new file mode 100644 index 000000000..42a9633a3 Binary files /dev/null and b/nwnds_module/ka_hasblood.ncs differ diff --git a/nwnds_module/ka_hasblood.nss b/nwnds_module/ka_hasblood.nss new file mode 100644 index 000000000..c869895e6 --- /dev/null +++ b/nwnds_module/ka_hasblood.nss @@ -0,0 +1,15 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt == 3)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_ASHENDRBLOOD") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasblood2.ncs b/nwnds_module/ka_hasblood2.ncs new file mode 100644 index 000000000..3959166cc Binary files /dev/null and b/nwnds_module/ka_hasblood2.ncs differ diff --git a/nwnds_module/ka_hasblood2.nss b/nwnds_module/ka_hasblood2.nss new file mode 100644 index 000000000..fc8c9cd75 --- /dev/null +++ b/nwnds_module/ka_hasblood2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_ASHENDRBLOOD") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasclockstart.ncs b/nwnds_module/ka_hasclockstart.ncs new file mode 100644 index 000000000..622caa5cd Binary files /dev/null and b/nwnds_module/ka_hasclockstart.ncs differ diff --git a/nwnds_module/ka_hasclockstart.nss b/nwnds_module/ka_hasclockstart.nss new file mode 100644 index 000000000..07608cecc --- /dev/null +++ b/nwnds_module/ka_hasclockstart.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "clockworkstart") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasearthhide.ncs b/nwnds_module/ka_hasearthhide.ncs new file mode 100644 index 000000000..d3ea4b2b2 Binary files /dev/null and b/nwnds_module/ka_hasearthhide.ncs differ diff --git a/nwnds_module/ka_hasearthhide.nss b/nwnds_module/ka_hasearthhide.nss new file mode 100644 index 000000000..27557b7e3 --- /dev/null +++ b/nwnds_module/ka_hasearthhide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hasearthhide +/* + + Detects the presence of a earth drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_earth_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_haselemstone.ncs b/nwnds_module/ka_haselemstone.ncs new file mode 100644 index 000000000..2f9f23a70 Binary files /dev/null and b/nwnds_module/ka_haselemstone.ncs differ diff --git a/nwnds_module/ka_haselemstone.nss b/nwnds_module/ka_haselemstone.nss new file mode 100644 index 000000000..48f1cb946 --- /dev/null +++ b/nwnds_module/ka_haselemstone.nss @@ -0,0 +1,26 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_haselemstone.nss +/* + + Detects the presence of elemental stones + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "crft_coldstone") != OBJECT_INVALID || + GetItemPossessedBy(oPC, "crft_brimstone") != OBJECT_INVALID || + GetItemPossessedBy(oPC, "crft_acidcrystal") != OBJECT_INVALID || + GetItemPossessedBy(oPC, "crft_shokcrystal") != OBJECT_INVALID) + + return TRUE; + +else return FALSE; +} diff --git a/nwnds_module/ka_hasfirehide.ncs b/nwnds_module/ka_hasfirehide.ncs new file mode 100644 index 000000000..223f310ef Binary files /dev/null and b/nwnds_module/ka_hasfirehide.ncs differ diff --git a/nwnds_module/ka_hasfirehide.nss b/nwnds_module/ka_hasfirehide.nss new file mode 100644 index 000000000..28ee8f376 --- /dev/null +++ b/nwnds_module/ka_hasfirehide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hasfirehide +/* + + Detects the presence of a fire drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_fire_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_hasgithhead.ncs b/nwnds_module/ka_hasgithhead.ncs new file mode 100644 index 000000000..f4c176e6b Binary files /dev/null and b/nwnds_module/ka_hasgithhead.ncs differ diff --git a/nwnds_module/ka_hasgithhead.nss b/nwnds_module/ka_hasgithhead.nss new file mode 100644 index 000000000..0c5120a38 --- /dev/null +++ b/nwnds_module/ka_hasgithhead.nss @@ -0,0 +1,19 @@ +// Script by: Nyadarus +// Created: September 2003 +// Used in: The Hermit Quest +// Purpose: To detemine whether or not the PC has the Obsidian Orb, +// which is obtained by killing Thyraximus the Crazed, for +// the purpose of rewarding quest xp. +#include "nw_i0_tool" +int StartingConditional() +{ + if(!HasItem(GetPCSpeaker(), "githchiefhead")) + { + return FALSE; + } + else + { + return TRUE; + } +} + diff --git a/nwnds_module/ka_hashunt1.ncs b/nwnds_module/ka_hashunt1.ncs new file mode 100644 index 000000000..865f123e0 Binary files /dev/null and b/nwnds_module/ka_hashunt1.ncs differ diff --git a/nwnds_module/ka_hashunt1.nss b/nwnds_module/ka_hashunt1.nss new file mode 100644 index 000000000..52358c74c --- /dev/null +++ b/nwnds_module/ka_hashunt1.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt2.ncs b/nwnds_module/ka_hashunt2.ncs new file mode 100644 index 000000000..43e96f52d Binary files /dev/null and b/nwnds_module/ka_hashunt2.ncs differ diff --git a/nwnds_module/ka_hashunt2.nss b/nwnds_module/ka_hashunt2.nss new file mode 100644 index 000000000..dc7ac3629 --- /dev/null +++ b/nwnds_module/ka_hashunt2.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 2)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt3.ncs b/nwnds_module/ka_hashunt3.ncs new file mode 100644 index 000000000..1d7a8a08d Binary files /dev/null and b/nwnds_module/ka_hashunt3.ncs differ diff --git a/nwnds_module/ka_hashunt3.nss b/nwnds_module/ka_hashunt3.nss new file mode 100644 index 000000000..66102c2e3 --- /dev/null +++ b/nwnds_module/ka_hashunt3.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 3)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt4.ncs b/nwnds_module/ka_hashunt4.ncs new file mode 100644 index 000000000..2d4ffcbb6 Binary files /dev/null and b/nwnds_module/ka_hashunt4.ncs differ diff --git a/nwnds_module/ka_hashunt4.nss b/nwnds_module/ka_hashunt4.nss new file mode 100644 index 000000000..9415a1bdf --- /dev/null +++ b/nwnds_module/ka_hashunt4.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 4)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt5.ncs b/nwnds_module/ka_hashunt5.ncs new file mode 100644 index 000000000..ca1f64b53 Binary files /dev/null and b/nwnds_module/ka_hashunt5.ncs differ diff --git a/nwnds_module/ka_hashunt5.nss b/nwnds_module/ka_hashunt5.nss new file mode 100644 index 000000000..92d25ffa2 --- /dev/null +++ b/nwnds_module/ka_hashunt5.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 5)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt6.ncs b/nwnds_module/ka_hashunt6.ncs new file mode 100644 index 000000000..006c6bc14 Binary files /dev/null and b/nwnds_module/ka_hashunt6.ncs differ diff --git a/nwnds_module/ka_hashunt6.nss b/nwnds_module/ka_hashunt6.nss new file mode 100644 index 000000000..ee5e80eb8 --- /dev/null +++ b/nwnds_module/ka_hashunt6.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 6)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt7.ncs b/nwnds_module/ka_hashunt7.ncs new file mode 100644 index 000000000..050f582c2 Binary files /dev/null and b/nwnds_module/ka_hashunt7.ncs differ diff --git a/nwnds_module/ka_hashunt7.nss b/nwnds_module/ka_hashunt7.nss new file mode 100644 index 000000000..b9b6b9073 --- /dev/null +++ b/nwnds_module/ka_hashunt7.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 7)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt8.ncs b/nwnds_module/ka_hashunt8.ncs new file mode 100644 index 000000000..afbfd66c0 Binary files /dev/null and b/nwnds_module/ka_hashunt8.ncs differ diff --git a/nwnds_module/ka_hashunt8.nss b/nwnds_module/ka_hashunt8.nss new file mode 100644 index 000000000..840fdc6c0 --- /dev/null +++ b/nwnds_module/ka_hashunt8.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 8)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hashunt9.ncs b/nwnds_module/ka_hashunt9.ncs new file mode 100644 index 000000000..b8eec8170 Binary files /dev/null and b/nwnds_module/ka_hashunt9.ncs differ diff --git a/nwnds_module/ka_hashunt9.nss b/nwnds_module/ka_hashunt9.nss new file mode 100644 index 000000000..5bd63b3ab --- /dev/null +++ b/nwnds_module/ka_hashunt9.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "hunt") == 9)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_haskyrikey.ncs b/nwnds_module/ka_haskyrikey.ncs new file mode 100644 index 000000000..8c91c03cc Binary files /dev/null and b/nwnds_module/ka_haskyrikey.ncs differ diff --git a/nwnds_module/ka_haskyrikey.nss b/nwnds_module/ka_haskyrikey.nss new file mode 100644 index 000000000..22b3a1937 --- /dev/null +++ b/nwnds_module/ka_haskyrikey.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "KyrisKey") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hasmagmahide.ncs b/nwnds_module/ka_hasmagmahide.ncs new file mode 100644 index 000000000..41881c37b Binary files /dev/null and b/nwnds_module/ka_hasmagmahide.ncs differ diff --git a/nwnds_module/ka_hasmagmahide.nss b/nwnds_module/ka_hasmagmahide.nss new file mode 100644 index 000000000..862002e18 --- /dev/null +++ b/nwnds_module/ka_hasmagmahide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hasmagmahide +/* + + Detects the presence of a magma drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_magma_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_hasmeteor.ncs b/nwnds_module/ka_hasmeteor.ncs new file mode 100644 index 000000000..ab3bb00d2 Binary files /dev/null and b/nwnds_module/ka_hasmeteor.ncs differ diff --git a/nwnds_module/ka_hasmeteor.nss b/nwnds_module/ka_hasmeteor.nss new file mode 100644 index 000000000..9b097a5a0 --- /dev/null +++ b/nwnds_module/ka_hasmeteor.nss @@ -0,0 +1,15 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt == 2)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_METEORITEORE") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasmim2.ncs b/nwnds_module/ka_hasmim2.ncs new file mode 100644 index 000000000..fa0fe32a7 Binary files /dev/null and b/nwnds_module/ka_hasmim2.ncs differ diff --git a/nwnds_module/ka_hasmim2.nss b/nwnds_module/ka_hasmim2.nss new file mode 100644 index 000000000..c6128f666 --- /dev/null +++ b/nwnds_module/ka_hasmim2.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostHeirloom"); + +if (!(nInt == 2)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hasrainhide.ncs b/nwnds_module/ka_hasrainhide.ncs new file mode 100644 index 000000000..dba136c43 Binary files /dev/null and b/nwnds_module/ka_hasrainhide.ncs differ diff --git a/nwnds_module/ka_hasrainhide.nss b/nwnds_module/ka_hasrainhide.nss new file mode 100644 index 000000000..28f338fc4 --- /dev/null +++ b/nwnds_module/ka_hasrainhide.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hasrainhide +/* + + Detects the presence of a rain drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_rain_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} \ No newline at end of file diff --git a/nwnds_module/ka_hasrikusaxe30.ncs b/nwnds_module/ka_hasrikusaxe30.ncs new file mode 100644 index 000000000..31fe0965d Binary files /dev/null and b/nwnds_module/ka_hasrikusaxe30.ncs differ diff --git a/nwnds_module/ka_hasrikusaxe30.nss b/nwnds_module/ka_hasrikusaxe30.nss new file mode 100644 index 000000000..35f884075 --- /dev/null +++ b/nwnds_module/ka_hasrikusaxe30.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "Metal_WPrelude") == OBJECT_INVALID) return FALSE; + +if (!(GetHitDice(oPC) >= 30)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hassageadvice.ncs b/nwnds_module/ka_hassageadvice.ncs new file mode 100644 index 000000000..8bc1974bf Binary files /dev/null and b/nwnds_module/ka_hassageadvice.ncs differ diff --git a/nwnds_module/ka_hassageadvice.nss b/nwnds_module/ka_hassageadvice.nss new file mode 100644 index 000000000..dfb3ebe35 --- /dev/null +++ b/nwnds_module/ka_hassageadvice.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "SageAdvice") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ka_hassapphire.ncs b/nwnds_module/ka_hassapphire.ncs new file mode 100644 index 000000000..8fba0f280 Binary files /dev/null and b/nwnds_module/ka_hassapphire.ncs differ diff --git a/nwnds_module/ka_hassapphire.nss b/nwnds_module/ka_hassapphire.nss new file mode 100644 index 000000000..b45ced987 --- /dev/null +++ b/nwnds_module/ka_hassapphire.nss @@ -0,0 +1,15 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt == 5)) + return FALSE; + +if (GetItemPossessedBy(oPC, "QST_LG_SAPPHIRE") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_hassilthide.ncs b/nwnds_module/ka_hassilthide.ncs new file mode 100644 index 000000000..3bd9475b5 Binary files /dev/null and b/nwnds_module/ka_hassilthide.ncs differ diff --git a/nwnds_module/ka_hassilthide.nss b/nwnds_module/ka_hassilthide.nss new file mode 100644 index 000000000..48869a2ff --- /dev/null +++ b/nwnds_module/ka_hassilthide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hassilthide +/* + + Detects the presence of a silt drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_silt_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_hassunhide.ncs b/nwnds_module/ka_hassunhide.ncs new file mode 100644 index 000000000..6200a12fe Binary files /dev/null and b/nwnds_module/ka_hassunhide.ncs differ diff --git a/nwnds_module/ka_hassunhide.nss b/nwnds_module/ka_hassunhide.nss new file mode 100644 index 000000000..53a406768 --- /dev/null +++ b/nwnds_module/ka_hassunhide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_hassunhide +/* + + Detects the presence of a sun drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_sun_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_haswaterhide.ncs b/nwnds_module/ka_haswaterhide.ncs new file mode 100644 index 000000000..22e924883 Binary files /dev/null and b/nwnds_module/ka_haswaterhide.ncs differ diff --git a/nwnds_module/ka_haswaterhide.nss b/nwnds_module/ka_haswaterhide.nss new file mode 100644 index 000000000..321f5e530 --- /dev/null +++ b/nwnds_module/ka_haswaterhide.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_haswaterhide +/* + + Detects the presence of a water drake hide + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + + +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "crft_water_dr_hd"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} + + diff --git a/nwnds_module/ka_hejkinchk1.ncs b/nwnds_module/ka_hejkinchk1.ncs new file mode 100644 index 000000000..41d6cea50 Binary files /dev/null and b/nwnds_module/ka_hejkinchk1.ncs differ diff --git a/nwnds_module/ka_hejkinchk1.nss b/nwnds_module/ka_hejkinchk1.nss new file mode 100644 index 000000000..10f768f57 --- /dev/null +++ b/nwnds_module/ka_hejkinchk1.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYHejkinRaiders"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hejkinchk2.ncs b/nwnds_module/ka_hejkinchk2.ncs new file mode 100644 index 000000000..038f3f5d3 Binary files /dev/null and b/nwnds_module/ka_hejkinchk2.ncs differ diff --git a/nwnds_module/ka_hejkinchk2.nss b/nwnds_module/ka_hejkinchk2.nss new file mode 100644 index 000000000..1fc2b0074 --- /dev/null +++ b/nwnds_module/ka_hejkinchk2.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYHejkinRaiders"); + +if (!(nInt == 2)) + return FALSE; +if (GetItemPossessedBy(oPC, "stoleniron") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hejkinchk3.ncs b/nwnds_module/ka_hejkinchk3.ncs new file mode 100644 index 000000000..2e16952f6 Binary files /dev/null and b/nwnds_module/ka_hejkinchk3.ncs differ diff --git a/nwnds_module/ka_hejkinchk3.nss b/nwnds_module/ka_hejkinchk3.nss new file mode 100644 index 000000000..536466e55 --- /dev/null +++ b/nwnds_module/ka_hejkinchk3.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYHejkinRaiders"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_hejkinrew.ncs b/nwnds_module/ka_hejkinrew.ncs new file mode 100644 index 000000000..e7c3f844c Binary files /dev/null and b/nwnds_module/ka_hejkinrew.ncs differ diff --git a/nwnds_module/ka_hejkinrew.nss b/nwnds_module/ka_hejkinrew.nss new file mode 100644 index 000000000..a342777d3 --- /dev/null +++ b/nwnds_module/ka_hejkinrew.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName at_trakrewboots +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(500, GetPCSpeaker()); + +object oPC = GetPCSpeaker(); + +RewardPartyGP(500, oPC, FALSE); + + // Give the speaker the items + CreateItemOnObject("stiffcloak", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_hide_conv_end.ncs b/nwnds_module/ka_hide_conv_end.ncs new file mode 100644 index 000000000..3b3990015 Binary files /dev/null and b/nwnds_module/ka_hide_conv_end.ncs differ diff --git a/nwnds_module/ka_hide_conv_end.nss b/nwnds_module/ka_hide_conv_end.nss new file mode 100644 index 000000000..df816113b --- /dev/null +++ b/nwnds_module/ka_hide_conv_end.nss @@ -0,0 +1,26 @@ +#include "NW_I0_GENERIC" +string swow_ResRef = "testskin"; + +void wow_EquipHide(object oPC) +{ + object oHide = CreateItemOnObject(swow_ResRef, oPC); + + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionEquipItem(oHide, INVENTORY_SLOT_CARMOUR)); + if(GetIsObjectValid(oHide)) SendMessageToPC(oPC, "Hide created, should be equipped"); + else SendMessageToPC(oPC, "Hide creation failed"); +} + +void main() +{ + object oPC = GetPCSpeaker(); + + if(GetLocalInt(oPC, "WOW_EQUIP_HIDE")) + { + DeleteLocalInt(oPC, "WOW_EQUIP_HIDE"); + object oHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC); + if(GetIsObjectValid(oHide)) DestroyObject(oHide); + DelayCommand(1.0, wow_EquipHide(oPC)); + } + WalkWayPoints(); +} diff --git a/nwnds_module/ka_houseoffinger.ncs b/nwnds_module/ka_houseoffinger.ncs new file mode 100644 index 000000000..4c2930c2a Binary files /dev/null and b/nwnds_module/ka_houseoffinger.ncs differ diff --git a/nwnds_module/ka_houseoffinger.nss b/nwnds_module/ka_houseoffinger.nss new file mode 100644 index 000000000..ac39e4573 --- /dev/null +++ b/nwnds_module/ka_houseoffinger.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_HOUSEOFINGERSROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_houseofglitte.dlg b/nwnds_module/ka_houseofglitte.dlg new file mode 100644 index 000000000..6ce96bad2 Binary files /dev/null and b/nwnds_module/ka_houseofglitte.dlg differ diff --git a/nwnds_module/ka_hunt1_reward1.ncs b/nwnds_module/ka_hunt1_reward1.ncs new file mode 100644 index 000000000..5998f41c0 Binary files /dev/null and b/nwnds_module/ka_hunt1_reward1.ncs differ diff --git a/nwnds_module/ka_hunt1_reward1.nss b/nwnds_module/ka_hunt1_reward1.nss new file mode 100644 index 000000000..971379bb2 --- /dev/null +++ b/nwnds_module/ka_hunt1_reward1.nss @@ -0,0 +1,17 @@ +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + int nVeggie = d3(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("kankhelm", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("spelunkershelm", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("steelhelmet", GetPCSpeaker(), 1); + } + diff --git a/nwnds_module/ka_hunt1_reward2.ncs b/nwnds_module/ka_hunt1_reward2.ncs new file mode 100644 index 000000000..de83633c8 Binary files /dev/null and b/nwnds_module/ka_hunt1_reward2.ncs differ diff --git a/nwnds_module/ka_hunt1_reward2.nss b/nwnds_module/ka_hunt1_reward2.nss new file mode 100644 index 000000000..651eee9d5 --- /dev/null +++ b/nwnds_module/ka_hunt1_reward2.nss @@ -0,0 +1,17 @@ +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + int nVeggie = d3(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("forestcloak", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("stiffcloak", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("cloakofradianc", GetPCSpeaker(), 1); + } + diff --git a/nwnds_module/ka_hunt1_reward3.ncs b/nwnds_module/ka_hunt1_reward3.ncs new file mode 100644 index 000000000..52821d83a Binary files /dev/null and b/nwnds_module/ka_hunt1_reward3.ncs differ diff --git a/nwnds_module/ka_hunt1_reward3.nss b/nwnds_module/ka_hunt1_reward3.nss new file mode 100644 index 000000000..b8417a33e --- /dev/null +++ b/nwnds_module/ka_hunt1_reward3.nss @@ -0,0 +1,17 @@ +#include "nw_i0_tool" + +void main() +{ + // Give the speaker the items + int nVeggie = d3(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("giantslayersling", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("dullsurgicalblad", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("steelhalberd", GetPCSpeaker(), 1); + } + diff --git a/nwnds_module/ka_hunt1rew.ncs b/nwnds_module/ka_hunt1rew.ncs new file mode 100644 index 000000000..d38109e59 Binary files /dev/null and b/nwnds_module/ka_hunt1rew.ncs differ diff --git a/nwnds_module/ka_hunt1rew.nss b/nwnds_module/ka_hunt1rew.nss new file mode 100644 index 000000000..ba6f5386d --- /dev/null +++ b/nwnds_module/ka_hunt1rew.nss @@ -0,0 +1,17 @@ +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "Gland1"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +RewardPartyXP(1000, oPC, FALSE); + +RewardPartyGP(1000, oPC, FALSE); + +} diff --git a/nwnds_module/ka_huntconvo2.dlg b/nwnds_module/ka_huntconvo2.dlg new file mode 100644 index 000000000..fd84a370d Binary files /dev/null and b/nwnds_module/ka_huntconvo2.dlg differ diff --git a/nwnds_module/ka_inc_loothomes.nss b/nwnds_module/ka_inc_loothomes.nss new file mode 100644 index 000000000..98823a96e --- /dev/null +++ b/nwnds_module/ka_inc_loothomes.nss @@ -0,0 +1,885 @@ +/* +Checks: Actions: + 1 = Skill 1 = Jump to a waypoint + 2 = Attrib 2 = Play Animation + 3 = failed before 3 = Play Sound + 4 = already looted 4 = Set failed to loot + 5 = Rogue of at least X levels 5 = Set looted + 6 = Hasn't looted yet 6 = Give gold + 7 = Hasn't failed yet 7 = Give exp + 8 = Give item(s) + + + + + + +ka_lootablehomes + +int WOW__ROOTS // The number of root nodes for this conversation +int WOW__LINES // The number of lines in this conversation +int WOW__ROGUE_LEVEL // This is the level of rogue needed to access this door. +string WOW__WAYPOINT // The waypoint to jump to if this is a door +int WOW__ROOT#_LINE // Points to the line number of this root +int WOW__LINE#_PC // This tells if this line is a PC line (option) or not +int WOW__LINE#_NEXT // This is the total number of next lines for this node +int WOW__LINE#_NEXT# // The number(s) of the possible next lines +string WOW__LINE#_CHECK // Which type of check(s) to run as a StartingConditional, supports AND (&&) and OR (||) +int WOW__LINE#_SKILL // Which skill comes into play (see skills.2da for the numbers) +int WOW__LINE#_SKILLDC // The DC which to roll the skill against +int WOW__LINE#_ATTRIB // Which attribute comes into play (see iprp_abilities for the numbers) +int WOW__LINE#_ATTRIBDC // The DC which to roll the attribute against +string WOW__LINE#_ACTIONS // Which actions to run as an ActionsTaken +int WOW__LINE#_ANIMATION // Which animations to play +float WOW__LINE#_ANIMATION_DURATION // The duration to play the animation for +string WOW__LINE#_SOUND // Which sound to play +string WOW__LINE#_REWARD_EXP // The amount of exp to reward to the player +string WOW__LINE#_REWARD_GOLD // The amount of gold to reward to the player +string WOW__LINE#_REWARD_ITEMS // The items to reward to the player +string WOW__LINE#_NUM_ITEMS // The number of items to reward the player with +string WOW__LINE#_TEXT // The text that appears in the conversation + +*/ +#include "ka_inc_traps" + +void wow_ReturnToDoor() +{ + object oPC = GetClickingObject(); + location lLoc = GetLocalLocation(oPC, "WOW_LOOTABLE_RETURN_POINT"); + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, JumpToLocation(lLoc)); +} + +int wow_StartingConditional() +{ + int nReturn; + int nCount = wow_GetCount(); + int nPage = wow_GetCurrentPage(); + int nToken = wow_FindBeginningToken(); + + switch(nCount) + { + case 0: + { + if(nPage == 0) nReturn = wow_SetRoots(); + else nReturn = wow_SetNPCLine(); + wow_IncreaseCount(); + break; + } + default: + { + nReturn = wow_SetPCLine(); + break; + } + } + return nReturn; +} + +void wow_OnUsed() +{ + if(GetLocalInt(GetModule(), "WOW_LOADING_SYSTEM") > 0) return; + string sConv = wow_FindEmptyConversation(); + wow_SetConversationActive(sConv); + object oPC; + if(GetObjectType(OBJECT_SELF) == OBJECT_TYPE_DOOR) oPC = GetClickingObject(); + else oPC = GetLastUsedBy(); + ActionStartConversation(oPC, sConv, TRUE, FALSE); +} + +void wow_ClearFields() +{ + wow_ClearCount(); + wow_SetCurrentPage(0); + wow_SetConversationInactive(); +} + +int wow_GetNextLineCount(int nLine) +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_NEXT"); +} + +int wow_SetPCLine() +{ + int nReturn; + int nPage = wow_GetCurrentPage(); + int nCount = wow_GetCount(); + int nNext = wow_GetNextLineCount(nPage); + + if(nCount <= nNext) + { + int nLine = GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nPage)+"_NEXT"+IntToString(nCount)); + nReturn = wow_RunLineCheck(nLine); + if(nReturn) + { + int nToken = wow_FindBeginningToken() + nCount; + wow_SetText(nLine, nToken); + } + } + wow_IncreaseCount(); + if(wow_GetCount() == 10) wow_ClearCount(); + return nReturn; +} + +int wow_SetNPCLine() +{ + int nReturn; + int nPage = wow_GetCurrentPage(); + int nCount = wow_GetNextLineCount(nPage); + + if(nCount == 0) nReturn = FALSE; + else + { + int nNth; + int nToken = wow_FindBeginningToken(); + int nLine; + object oModule = GetModule(); + + while(nNth <= nCount && !nReturn) + { + nNth++; + nLine = GetLocalInt(oModule, "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nPage)+"_NEXT"+IntToString(nNth)); + nReturn = wow_RunLineCheck(nLine); + if(nReturn) + { + wow_SetText(nLine, nToken); + wow_SetCurrentPage(nLine); + } + } + } + return nReturn; +} + +int wow_SetRoots() +{ + object oModule = GetModule(); + int nRoots = wow_GetRootCount(); + int nToken = wow_FindBeginningToken(); + int nCount, nCheck, nLine; + + while(nCount < nRoots && !nCheck) + { + nCount++; + nLine = GetLocalInt(oModule, "WOW_"+GetTag(OBJECT_SELF)+"_ROOT"+IntToString(nCount)+"_LINE"); + nCheck = wow_RunLineCheck(nLine); + if(nCheck) + { + wow_SetText(nLine, nToken); + wow_SetCurrentPage(nLine); + } + } + return TRUE; +} + +void wow_SetText(int nLine, int nToken) +{ + string sText = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_TEXT"); + sText = wow_GetAndReturnColoredText(sText); + SetCustomToken(nToken, sText); +} + +void wow_ActionsTaken(int nPCLine) +{ + int nPage = wow_GetCurrentPage(); + int nLine = GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nPage)+"_NEXT"+IntToString(nPCLine)); + if(nPCLine == 0) nLine = nPage; + wow_RunActions(nLine); +} + +int wow_RunCheck(int nCheck, int nLine) +{ + object oPC = GetPCSpeaker(); + int nReturn = FALSE; + + switch(nCheck) + { + case 0: + { + nReturn = TRUE; + break; + } + case 1: + { + if((GetSkillRank(wow_GetSkill(nLine), oPC) + d20()) >= wow_GetSkillDC(nLine)) nReturn = TRUE; + break; + } + case 2: + { + if((GetAbilityModifier(wow_GetAttribute(nLine), oPC) + d20()) >= wow_GetAttributeDC(nLine)) nReturn = TRUE; + break; + } + case 3: + { + nReturn = wow_GetFailedBefore(); + break; + } + case 4: + { + nReturn = wow_GetAlreadyLooted(); + break; + } + case 5: + { + if(GetLevelByClass(CLASS_TYPE_ROGUE, oPC) >= wow_GetRogueLevel()) nReturn = TRUE; + break; + } + case 6: + { + nReturn = !wow_GetAlreadyLooted(); + break; + } + case 7: + { + nReturn = !wow_GetFailedBefore(); + break; + } + } + return nReturn; +} + +int wow_CountWaypoints(string sWaypoint) +{ + int nCount; + object oWP = GetObjectByTag(sWaypoint, nCount); + while(GetIsObjectValid(oWP)) + { + nCount++; + oWP = GetObjectByTag(sWaypoint, nCount); + } + return nCount; +} + +void wow_JumpToWaypoint() +{ + object oModule = GetModule(); + object oPC = GetPCSpeaker(); + string sWP = GetLocalString(oModule, "WOW_"+GetTag(OBJECT_SELF)+"_WAYPOINT"); + int nCount = wow_CountWaypoints(sWP); + object oWP; + + if(nCount == 1) + { + oWP = GetWaypointByTag(sWP); + } + else + { + int nWP = GetLocalInt(oModule, "WOW_"+GetName(oPC)+sWP); + if(nWP > nCount) nWP = 0; + oWP = GetObjectByTag(sWP, nWP); + SetLocalInt(oModule, "WOW_"+GetName(oPC)+sWP, (nWP + 1)); + } + if(GetIsObjectValid(oWP)) + { + SetLocalLocation(oPC, "WOW_LOOTABLE_RETURN_POINT", GetLocation(oPC)); + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, JumpToObject(oWP)); + } +} + +void wow_RunAction(int nAction, int nLine) +{ + switch(nAction) + { + case 1: + { + wow_JumpToWaypoint(); + break; + } + case 2: + { + wow_RunAnimation(nLine); + break; + } + case 3: + { + wow_PlaySound(nLine); + break; + } + case 4: + { + wow_SetFailedBefore(); + break; + } + case 5: + { + wow_SetAlreadyLooted(); + break; + } + case 6: + { + wow_RewardGold(nLine); + break; + } + case 7: + { + wow_RewardExp(nLine); + break; + } + case 8: + { + wow_RewardItems(nLine); + break; + } + } +} + +int wow_GetFailedBefore() +{ + return GetLocalInt(OBJECT_SELF, GetName(GetPCSpeaker())+"FAILED"); +} + +int wow_GetAlreadyLooted() +{ + return GetLocalInt(OBJECT_SELF, GetName(GetPCSpeaker())+"LOOTED"); +} + +void wow_SetFailedBefore() +{ + SetLocalInt(OBJECT_SELF, GetName(GetPCSpeaker())+"FAILED", TRUE); +} + +void wow_SetAlreadyLooted() +{ + SetLocalInt(OBJECT_SELF, GetName(GetPCSpeaker())+"LOOTED", TRUE); +} + +int wow_GetSkill(int nLine) +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_SKILL"); +} + +int wow_GetSkillDC(int nLine) +{ + string sDC = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_SKILLDC"); + int nDC; + + if(wow_CountDs(sDC) > 0) + { + int nLength = GetStringLength(sDC); + int nSub = wow_FindD(sDC); + string sNum = GetStringLeft(sDC, nSub); + string sDice = GetStringRight(sDC, (nLength - (nSub + 1))); + nDC = wow_RollDice(StringToInt(sNum), StringToInt(sDice)); + } + else nDC = StringToInt(sDC); + return nDC; +} + +int wow_GetAttribute(int nLine) +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_ATTRIB"); +} + +int wow_GetAttributeDC(int nLine) +{ + string sDC = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_ATTRIBDC"); + int nDC; + + if(wow_CountDs(sDC) > 0) + { + int nLength = GetStringLength(sDC); + int nSub = wow_FindD(sDC); + string sNum = GetStringLeft(sDC, nSub); + string sDice = GetStringRight(sDC, (nLength - (nSub + 1))); + nDC = wow_RollDice(StringToInt(sNum), StringToInt(sDice)); + } + else nDC = StringToInt(sDC); + return nDC; +} + +string wow_GetWaypointTag() +{ + return GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_WAYPOINT"); +} + +void wow_RewardExp(int nLine) +{ + string sExp = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_REWARD_EXP"); + int nExp; + + if(wow_CountDs(sExp) > 0) + { + int nLength = GetStringLength(sExp); + int nSub = wow_FindD(sExp); + string sNum = GetStringLeft(sExp, nSub); + string sDice = GetStringRight(sExp, (nLength - (nSub + 1))); + nExp = wow_RollDice(StringToInt(sNum), StringToInt(sDice)); + } + else nExp = StringToInt(sExp); + GiveXPToCreature(GetPCSpeaker(), nExp); + +} + +void wow_RewardGold(int nLine) +{ + string sGold = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_REWARD_GOLD"); + int nGold; + + if(wow_CountDs(sGold) > 0) + { + int nLength = GetStringLength(sGold); + int nSub = wow_FindD(sGold); + string sNum = GetStringLeft(sGold, nSub); + string sDice = GetStringRight(sGold, (nLength - (nSub + 1))); + nGold = wow_RollDice(StringToInt(sNum), StringToInt(sDice)); + } + else nGold = StringToInt(sGold); + GiveGoldToCreature(GetPCSpeaker(), nGold); +} + +int wow_GetRewardNumItems(int nLine) +{ + string sItems = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_NUM_ITEMS"); + int nItems; + + if(wow_CountDs(sItems) > 0) + { + int nLength = GetStringLength(sItems); + int nSub = wow_FindD(sItems); + string sNum = GetStringLeft(sItems, nSub); + string sDice = GetStringRight(sItems, (nLength - (nSub + 1))); + nItems = wow_RollDice(StringToInt(sNum), StringToInt(sDice)); + } + else nItems = StringToInt(sItems); + return nItems; +} + +void wow_RewardItems(int nLine) +{ + string sItems = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_REWARD_ITEMS"); + int nReward = wow_GetRewardNumItems(nLine); + int nCount = wow_CountMarkers(sItems); + + if(nCount == 0) + { + for(nCount = 1; nCount <= nReward; nCount++) + { + CreateItemOnObject(sItems, GetPCSpeaker()); + } + } + else + { + string sChosen; + int nSub, nGiven, nChosen, nLength, nRight, nNth; + nCount++; + while(nGiven != nReward) + { + nChosen = Random(nCount) + 1; + + if(nChosen == 1) + { + nSub = wow_FindMarker(sItems); + sChosen = GetStringLeft(sItems, nSub); + } + else + { + sChosen = sItems; + for(nNth = 1; nNth <= nChosen; nNth++) + { + nSub = wow_FindMarker(sChosen); + nLength = GetStringLength(sChosen); + nRight = nLength - (nSub + 2); + sChosen = GetStringRight(sChosen, nRight); + } + nSub = wow_FindMarker(sChosen); + if(nSub != -1) sChosen = GetStringLeft(sChosen, nSub); + } + nGiven++; + CreateItemOnObject(sChosen, GetPCSpeaker()); + } + } +} + +void wow_PlaySound(int nLine) +{ + string sSound = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_SOUND"); + if(sSound != "") PlaySound(sSound); +} + +float wow_GetAnimationTime(int nLine) +{ + return GetLocalFloat(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_ANIMATION_DURATION"); +} + +void wow_RunAnimation(int nLine) +{ + object oTarget; + int nAnimation = wow_GetAnimation(nLine); + if(nAnimation < 200) oTarget = GetPCSpeaker(); + else oTarget = OBJECT_SELF; + + float fDuration = wow_GetAnimationTime(nLine); + AssignCommand(oTarget, PlayAnimation(nAnimation, 1.0, fDuration)); +} + +int wow_GetAnimation(int nLine) +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_ANIMATION"); +} + +void wow_RunActions(int nLine) +{ + string sText = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_ACTIONS"); + wow_SetCurrentPage(nLine); + + if(sText == "") return; + + int nCount = wow_CountMarkers(sText); + int nRight, nLength; + int nSub = wow_FindMarker(sText); + string sLeft; + while(nSub != -1) + { + nLength = GetStringLength(sText); + sLeft = GetStringLeft(sText, nSub); + wow_RunAction(StringToInt(sLeft), nLine); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + nSub = wow_FindMarker(sText); + } + wow_RunAction(StringToInt(sText), nLine); +} + +int wow_RunLineCheck(int nLine) +{ + string sCheck = GetLocalString(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_CHECK"); + string sTemp; + int nTotal = wow_CountANDs(sCheck) + wow_CountORs(sCheck); + int nAnd = wow_FindAND(sCheck); + int nOr = wow_FindOR(sCheck); + int nSub, nCheck, nNth, nLength, nRight; + + if(!nTotal) nCheck = wow_RunCheck(StringToInt(sCheck), nLine); + else + { + if(nAnd != -1 && (nOr == -1 || nAnd < nOr)) nSub = nAnd; + else if(nOr != -1 && (nAnd == -1 || nOr < nAnd)) nSub = nOr; + else nSub = -1; + nTotal++; + for(nNth = 1; nNth <= nTotal; nNth++) + { + nLength = GetStringLength(sCheck); + if(nNth == 1) + { + sTemp = GetStringLeft(sCheck, nSub); + nCheck = wow_RunCheck(StringToInt(sTemp), nLine); + nRight = nLength - nSub; + sCheck = GetStringRight(sCheck, nRight); + } + else + { + if(nAnd == 0) + { + nRight = nLength - 3; + sCheck = GetStringRight(sCheck, nRight); + nLength = GetStringLength(sCheck); + } + else + { + nRight = nLength - 2; + sCheck = GetStringRight(sCheck, nRight); + nLength = GetStringLength(sCheck); + } + nAnd = wow_FindAND(sCheck); + nOr = wow_FindOR(sCheck); + if(nAnd != -1 && (nOr == -1 || nAnd < nOr)) nSub = nAnd; + else if(nOr != -1 && (nAnd == -1 || nOr < nAnd)) nSub = nOr; + else nSub = -1; + if(nSub != -1) + { + sTemp = GetStringLeft(sCheck, nSub); + nRight = nLength - nSub; + sCheck = GetStringRight(sCheck, nRight); + } + else sTemp = sCheck; + if(nAnd == 0) nCheck = (nCheck && wow_RunCheck(StringToInt(sTemp), nLine)); + else nCheck = (nCheck || wow_RunCheck(StringToInt(sTemp), nLine)); + } + nAnd = wow_FindAND(sCheck); + nOr = wow_FindOR(sCheck); + if(nAnd != -1 && (nOr == -1 || nAnd < nOr)) nSub = nAnd; + else if(nOr != -1 && (nAnd == -1 || nOr < nAnd)) nSub = nOr; + else nSub = -1; + } + } + return nCheck; +} + +int wow_CountANDs(string sText) +{ + int nSub, nCount, nLength, nRight; + while(nSub != -1) + { + nSub = wow_FindAND(sText); + if(nSub != -1) + { + nCount++; + nLength = GetStringLength(sText); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + } + } + return nCount; +} + +int wow_CountORs(string sText) +{ + int nSub, nCount, nLength, nRight; + while(nSub != -1) + { + nSub = wow_FindOR(sText); + if(nSub != -1) + { + nCount++; + nLength = GetStringLength(sText); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + } + } + return nCount; +} + +int wow_FindAND(string sText) +{ + return FindSubString(sText, "AND"); +} + +int wow_FindOR(string sText) +{ + return FindSubString(sText, "OR"); +} + + +void wow_SetUpNextLines(string sVariable, string sText) +{ + int nCount = wow_CountMarkers(sText); + object oModule = GetModule(); + + if(nCount == 0) + { + SetLocalInt(oModule, sVariable+"1", StringToInt(sText)); + SetLocalInt(oModule, sVariable, 1); + } + else + { + int nNth, nTemp, nLength, nRight, nLine; + string sTemp; + int nSub = wow_FindMarker(sText); + + while(nSub != -1) + { + nLine++; + nLength = GetStringLength(sText); + sTemp = GetStringLeft(sText, nSub); + nTemp = StringToInt(sTemp); + SetLocalInt(oModule, sVariable+IntToString(nLine), nTemp); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + nSub = wow_FindMarker(sText); + if(nSub == -1) + { + nLine++; + nTemp = StringToInt(sText); + SetLocalInt(oModule, sVariable+IntToString(nLine), nTemp); + SetLocalInt(oModule, sVariable, nLine); + } + } + } +} + +int wow_GetIsPCLine(int nLine) +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINE"+IntToString(nLine)+"_PC"); +} + +int wow_GetRootCount() +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_ROOTS"); +} + +int wow_GetLineCount() +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_LINES"); +} + +int wow_GetRogueLevel() +{ + return GetLocalInt(GetModule(), "WOW_"+GetTag(OBJECT_SELF)+"_ROGUE_LEVEL"); +} + +int wow_GetCount() +{ + return GetLocalInt(OBJECT_SELF, "WOW_COUNTER"); +} + +void wow_IncreaseCount() +{ + SetLocalInt(OBJECT_SELF, "WOW_COUNTER", (wow_GetCount() + 1)); +} + +void wow_ClearCount() +{ + DeleteLocalInt(OBJECT_SELF, "WOW_COUNTER"); +} + +int wow_GetCurrentPage() +{ + return GetLocalInt(OBJECT_SELF, "WOW_PAGE"); +} + +void wow_SetCurrentPage(int nPage) +{ + SetLocalInt(OBJECT_SELF, "WOW_PAGE", nPage); +} + +int wow_FindBeginningToken() +{ + string sConv = GetLocalString(OBJECT_SELF, "WOW_CONVERSATION"); + sConv = GetStringRight(sConv, 2); + int nConv = StringToInt(sConv); + int nReturn; + + switch(nConv) + { + case 1: nReturn = 51000; break; + case 2: nReturn = 51010; break; + case 3: nReturn = 51020; break; + case 4: nReturn = 51030; break; + case 5: nReturn = 51040; break; + default: break; + } + return nReturn; +} + +void wow_SetConversationInactive() +{ + string sConv = GetLocalString(OBJECT_SELF, "WOW_CONVERSATION"); + DeleteLocalInt(GetModule(), sConv); + DeleteLocalString(OBJECT_SELF, "WOW_CONVERSATION"); +} + +void wow_SetConversationActive(string sConv) +{ + SetLocalInt(GetModule(), sConv, TRUE); + SetLocalString(OBJECT_SELF, "WOW_CONVERSATION", sConv); +} + +string wow_FindEmptyConversation() +{ + string sReturn; + string sConv = "ka_loot_home_0"; + int nBreak = FALSE; + int nNth; + object oModule = GetModule(); + for(nNth = 1; (nNth <= 5) && (!nBreak); nNth++) + { + if(!GetLocalInt(oModule, sConv+IntToString(nNth))) + { + nBreak = TRUE; + sReturn = sConv+IntToString(nNth); + } + } + return sReturn; +} + +void wow_SetUpConversation(string sTag, string s2DA, int nRow = 0) +{ + string sMax = Get2DAString(s2DA, "ROOT_NODE", 0); + int nMax = StringToInt(sMax); + if(nRow == 0) nRow++; + if(nRow > nMax) + { + DelayCommand(0.5, wow_SetUpLootableHomes()); + } + else + { + string sTemp, sUse, sRow, sBase; + int nStop = nRow + 3; + object oModule = GetModule(); + int nRoot = GetLocalInt(oModule, "WOW_"+sTag+"_ROOTS"); + int nTemp; + sTemp = Get2DAString(s2DA, "PC", 0); + SetLocalInt(oModule, "WOW_"+sTag+"_LINES", nMax); + if(sTemp != "") + { + int nRogue = StringToInt(sTemp); + SetLocalInt(oModule, "WOW_"+sTag+"_ROGUE_LEVEL", nRogue); + } + sTemp = Get2DAString(s2DA, "NEXT_NODE", 0); + if(sTemp != "") SetLocalString(oModule, "WOW_"+sTag+"_WAYPOINT", sTemp); + + for(nRow = nRow; (nRow < nStop) && ((nRow < nMax) || (nRow == nMax)); nRow++) + { + sRow = IntToString(nRow); + sUse = "WOW_"+sTag+"_LINE"+sRow+"_"; + sTemp = Get2DAString(s2DA, "ROOT_NODE", nRow); + if(sTemp != "") + { + nTemp = StringToInt(sTemp); + sBase = "WOW_"+sTag+"_ROOT"+sTemp+"_"; + SetLocalInt(oModule, sBase+"LINE", nRow); + nRoot++; + SetLocalInt(oModule, "WOW_"+sTag+"_ROOTS", nRoot); + } + sTemp = Get2DAString(s2DA, "PC", nRow); + if(sTemp != "") SetLocalInt(oModule, sUse+"PC", TRUE); + sTemp = Get2DAString(s2DA, "NEXT_NODE", nRow); + if(sTemp != "") wow_SetUpNextLines(sUse+"NEXT", sTemp); + sTemp = Get2DAString(s2DA, "CHECK", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"CHECK", sTemp); + sTemp = Get2DAString(s2DA, "SKILL", nRow); + if(sTemp != "") SetLocalInt(oModule, sUse+"SKILL", StringToInt(sTemp)); + sTemp = Get2DAString(s2DA, "SKILL_DC", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"SKILLDC", sTemp); + sTemp = Get2DAString(s2DA, "ATTRIB", nRow); + if(sTemp != "") SetLocalInt(oModule, sUse+"ATTRIB", StringToInt(sTemp)); + sTemp = Get2DAString(s2DA, "ATTRIB_DC", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"ATTRIBDC", sTemp); + sTemp = Get2DAString(s2DA, "ACTIONS", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"ACTIONS", sTemp); + sTemp = Get2DAString(s2DA, "ANIMATION", nRow); + if(sTemp != "") SetLocalInt(oModule, sUse+"ANIMATION", StringToInt(sTemp)); + sTemp = Get2DAString(s2DA, "DURATION", nRow); + if(sTemp != "") SetLocalFloat(oModule, sUse+"ANIMATION_DURATION", StringToFloat(sTemp)); + sTemp = Get2DAString(s2DA, "SOUND", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"SOUND", sTemp); + sTemp = Get2DAString(s2DA, "REWARD_EXP", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"REWARD_EXP", sTemp); + sTemp = Get2DAString(s2DA, "REWARD_GOLD", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"REWARD_GOLD", sTemp); + sTemp = Get2DAString(s2DA, "REWARD_ITEMS", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"REWARD_ITEMS", sTemp); + sTemp = Get2DAString(s2DA, "NUM_ITEMS", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"NUM_ITEMS", sTemp); + sTemp = Get2DAString(s2DA, "TEXT", nRow); + if(sTemp != "") SetLocalString(oModule, sUse+"TEXT", sTemp); + } + if(nRow <= nMax) DelayCommand(1.0, wow_SetUpConversation(sTag, s2DA, nRow)); + else DelayCommand(1.0, wow_SetUpLootableHomes()); + } +} + +void wow_SetUpLootableHomes() +{ + string sMax = Get2DAString("ka_lootablehomes", "TAG", 0); + int nMax = StringToInt(sMax); + object oModule = GetModule(); + int nRow = GetLocalInt(oModule, "WOW_CONVERSATION_LOADING"); + nRow++; + + if(nRow > nMax) + { + DeleteLocalInt(oModule, "WOW_CONVERSATION_LOADING"); + DelayCommand(0.5, wow_Setup()); + } + else + { + SetLocalInt(oModule, "WOW_CONVERSATION_LOADING", nRow); + string sTag = Get2DAString("ka_lootablehomes", "TAG", nRow); + string s2DA = Get2DAString("ka_lootablehomes", "2DA", nRow); +// SetLocalString(oModule, "WOW_CONVERSATION"+IntToString(nRow), sTag); + if(sTag != "" && s2DA != "") DelayCommand(0.5, wow_SetUpConversation(sTag, s2DA)); + else DelayCommand(0.5, wow_SetUpLootableHomes()); + } +} + +//void main () {} diff --git a/nwnds_module/ka_inc_traps.nss b/nwnds_module/ka_inc_traps.nss new file mode 100644 index 000000000..ad1c162fa --- /dev/null +++ b/nwnds_module/ka_inc_traps.nss @@ -0,0 +1,73 @@ +/* +DAMAGE_TYPE_BLUDGEONING = 1; +DAMAGE_TYPE_PIERCING = 2; +DAMAGE_TYPE_SLASHING = 4; +DAMAGE_TYPE_MAGICAL = 8; +DAMAGE_TYPE_ACID = 16; +DAMAGE_TYPE_COLD = 32; +DAMAGE_TYPE_DIVINE = 64; +DAMAGE_TYPE_ELECTRICAL = 128; +DAMAGE_TYPE_FIRE = 256; +DAMAGE_TYPE_NEGATIVE = 512; +DAMAGE_TYPE_POSITIVE = 1024; +DAMAGE_TYPE_SONIC = 2048; + +DAMAGE_BONUS_1 = 1; +DAMAGE_BONUS_2 = 2; +DAMAGE_BONUS_3 = 3; +DAMAGE_BONUS_4 = 4; +DAMAGE_BONUS_5 = 5; +DAMAGE_BONUS_1d4 = 6; +DAMAGE_BONUS_1d6 = 7; +DAMAGE_BONUS_1d8 = 8; +DAMAGE_BONUS_1d10 = 9; +DAMAGE_BONUS_2d6 = 10; +DAMAGE_BONUS_2d8 = 11; +DAMAGE_BONUS_2d4 = 12; +DAMAGE_BONUS_2d10 = 13; +DAMAGE_BONUS_1d12 = 14; +DAMAGE_BONUS_2d12 = 15; +DAMAGE_BONUS_6 = 16; +DAMAGE_BONUS_7 = 17; +DAMAGE_BONUS_8 = 18; +DAMAGE_BONUS_9 = 19; +DAMAGE_BONUS_10 = 20; +DAMAGE_BONUS_11 = 21; +DAMAGE_BONUS_12 = 22; +DAMAGE_BONUS_13 = 23; +DAMAGE_BONUS_14 = 24; +DAMAGE_BONUS_15 = 25; +DAMAGE_BONUS_16 = 26; +DAMAGE_BONUS_17 = 27; +DAMAGE_BONUS_18 = 28; +DAMAGE_BONUS_19 = 29; +DAMAGE_BONUS_20 = 30; + +DAMAGE_POWER_NORMAL = 0; +DAMAGE_POWER_PLUS_ONE = 1; +DAMAGE_POWER_PLUS_TWO = 2; +DAMAGE_POWER_PLUS_THREE = 3; +DAMAGE_POWER_PLUS_FOUR = 4; +DAMAGE_POWER_PLUS_FIVE = 5; +DAMAGE_POWER_ENERGY = 6; +DAMAGE_POWER_PLUS_SIX = 7; +DAMAGE_POWER_PLUS_SEVEN = 8; +DAMAGE_POWER_PLUS_EIGHT = 9; +DAMAGE_POWER_PLUS_NINE = 10; +DAMAGE_POWER_PLUS_TEN = 11; +DAMAGE_POWER_PLUS_ELEVEN = 12; +DAMAGE_POWER_PLUS_TWELVE = 13; +DAMAGE_POWER_PLUS_THIRTEEN = 14; +DAMAGE_POWER_PLUS_FOURTEEN = 15; +DAMAGE_POWER_PLUS_FIFTEEN = 16; +DAMAGE_POWER_PLUS_SIXTEEN = 17; +DAMAGE_POWER_PLUS_SEVENTEEN = 18; +DAMAGE_POWER_PLUS_EIGHTEEN = 19; +DAMAGE_POWER_PLUS_NINTEEN = 20; +DAMAGE_POWER_PLUS_TWENTY = 21; +*/ + +#include "wow_inc_forge" + +//void main () {} + diff --git a/nwnds_module/ka_isdraqoman.ncs b/nwnds_module/ka_isdraqoman.ncs new file mode 100644 index 000000000..26dd6b388 Binary files /dev/null and b/nwnds_module/ka_isdraqoman.ncs differ diff --git a/nwnds_module/ka_isdraqoman.nss b/nwnds_module/ka_isdraqoman.nss new file mode 100644 index 000000000..f3b39392c --- /dev/null +++ b/nwnds_module/ka_isdraqoman.nss @@ -0,0 +1,28 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_isdraqoman.nss +/* + + Detects is the PC is a Draqoman by class & the + presence of a Draqoman Amulet. + +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kiriani Agriviar +//:: Created On: +//::////////////////////////////////////////////// + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_BARD, oPC)==0)&& + (GetLevelByClass(CLASS_TYPE_ASSASSIN, oPC)==0)) +return FALSE; + +if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD) return FALSE; + +if (GetItemPossessedBy(oPC, "fac_itpnck_draqo") == OBJECT_INVALID) return FALSE; + +return TRUE; +} \ No newline at end of file diff --git a/nwnds_module/ka_istemplar.ncs b/nwnds_module/ka_istemplar.ncs new file mode 100644 index 000000000..6dd4c3d80 Binary files /dev/null and b/nwnds_module/ka_istemplar.ncs differ diff --git a/nwnds_module/ka_istemplar.nss b/nwnds_module/ka_istemplar.nss new file mode 100644 index 000000000..2c1c86b8b --- /dev/null +++ b/nwnds_module/ka_istemplar.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "FAC_ITPNCK_TYRTM") == OBJECT_INVALID) return FALSE; + +if ((GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)) +return FALSE; + +if (!(GetAbilityScore(oPC, ABILITY_INTELLIGENCE) >= 12)) return FALSE; + +if (!(GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_jadejozhal.dlg b/nwnds_module/ka_jadejozhal.dlg new file mode 100644 index 000000000..dd3ae2a17 Binary files /dev/null and b/nwnds_module/ka_jadejozhal.dlg differ diff --git a/nwnds_module/ka_jadejozhalsho.ncs b/nwnds_module/ka_jadejozhalsho.ncs new file mode 100644 index 000000000..55ba86fd8 Binary files /dev/null and b/nwnds_module/ka_jadejozhalsho.ncs differ diff --git a/nwnds_module/ka_jadejozhalsho.nss b/nwnds_module/ka_jadejozhalsho.nss new file mode 100644 index 000000000..f5de70928 --- /dev/null +++ b/nwnds_module/ka_jadejozhalsho.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("JadeJozhal"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_jandi.dlg b/nwnds_module/ka_jandi.dlg new file mode 100644 index 000000000..833361ea3 Binary files /dev/null and b/nwnds_module/ka_jandi.dlg differ diff --git a/nwnds_module/ka_jandistore.ncs b/nwnds_module/ka_jandistore.ncs new file mode 100644 index 000000000..9f302def4 Binary files /dev/null and b/nwnds_module/ka_jandistore.ncs differ diff --git a/nwnds_module/ka_jandistore.nss b/nwnds_module/ka_jandistore.nss new file mode 100644 index 000000000..1b606c114 --- /dev/null +++ b/nwnds_module/ka_jandistore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("STORE_BRILL"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_jewler_ondist.ncs b/nwnds_module/ka_jewler_ondist.ncs new file mode 100644 index 000000000..f9d616a6b Binary files /dev/null and b/nwnds_module/ka_jewler_ondist.ncs differ diff --git a/nwnds_module/ka_jewler_ondist.nss b/nwnds_module/ka_jewler_ondist.nss new file mode 100644 index 000000000..dd9f51627 --- /dev/null +++ b/nwnds_module/ka_jewler_ondist.nss @@ -0,0 +1,5 @@ +#include "wow_inc_forge" +void main() +{ + wow_Forge(); +} diff --git a/nwnds_module/ka_jumptoambroom.ncs b/nwnds_module/ka_jumptoambroom.ncs new file mode 100644 index 000000000..8aceb2017 Binary files /dev/null and b/nwnds_module/ka_jumptoambroom.ncs differ diff --git a/nwnds_module/ka_jumptoambroom.nss b/nwnds_module/ka_jumptoambroom.nss new file mode 100644 index 000000000..55d872745 --- /dev/null +++ b/nwnds_module/ka_jumptoambroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_AMBERROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_jumptohideou2.ncs b/nwnds_module/ka_jumptohideou2.ncs new file mode 100644 index 000000000..e7c63093c Binary files /dev/null and b/nwnds_module/ka_jumptohideou2.ncs differ diff --git a/nwnds_module/ka_jumptohideou2.nss b/nwnds_module/ka_jumptohideou2.nss new file mode 100644 index 000000000..155d6ee3d --- /dev/null +++ b/nwnds_module/ka_jumptohideou2.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("HIDEOUT2"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptohideout.ncs b/nwnds_module/ka_jumptohideout.ncs new file mode 100644 index 000000000..f55db239f Binary files /dev/null and b/nwnds_module/ka_jumptohideout.ncs differ diff --git a/nwnds_module/ka_jumptohideout.nss b/nwnds_module/ka_jumptohideout.nss new file mode 100644 index 000000000..3b482fb91 --- /dev/null +++ b/nwnds_module/ka_jumptohideout.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("HIDEOUT"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptohome.ncs b/nwnds_module/ka_jumptohome.ncs new file mode 100644 index 000000000..8a5b3b680 Binary files /dev/null and b/nwnds_module/ka_jumptohome.ncs differ diff --git a/nwnds_module/ka_jumptohome.nss b/nwnds_module/ka_jumptohome.nss new file mode 100644 index 000000000..dff63249a --- /dev/null +++ b/nwnds_module/ka_jumptohome.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("RUINEDHOME"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptohome2.ncs b/nwnds_module/ka_jumptohome2.ncs new file mode 100644 index 000000000..b1d07d25a Binary files /dev/null and b/nwnds_module/ka_jumptohome2.ncs differ diff --git a/nwnds_module/ka_jumptohome2.nss b/nwnds_module/ka_jumptohome2.nss new file mode 100644 index 000000000..84a2d1330 --- /dev/null +++ b/nwnds_module/ka_jumptohome2.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("RUINEDHOME2"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptolorroom.ncs b/nwnds_module/ka_jumptolorroom.ncs new file mode 100644 index 000000000..bc55de3e8 Binary files /dev/null and b/nwnds_module/ka_jumptolorroom.ncs differ diff --git a/nwnds_module/ka_jumptolorroom.nss b/nwnds_module/ka_jumptolorroom.nss new file mode 100644 index 000000000..78759e771 --- /dev/null +++ b/nwnds_module/ka_jumptolorroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_FIVEKNIVESROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_jumptomim2.ncs b/nwnds_module/ka_jumptomim2.ncs new file mode 100644 index 000000000..f269fd036 Binary files /dev/null and b/nwnds_module/ka_jumptomim2.ncs differ diff --git a/nwnds_module/ka_jumptomim2.nss b/nwnds_module/ka_jumptomim2.nss new file mode 100644 index 000000000..5c1fee0e6 --- /dev/null +++ b/nwnds_module/ka_jumptomim2.nss @@ -0,0 +1,33 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_MIMSEWER"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptorogroom.ncs b/nwnds_module/ka_jumptorogroom.ncs new file mode 100644 index 000000000..70edfad01 Binary files /dev/null and b/nwnds_module/ka_jumptorogroom.ncs differ diff --git a/nwnds_module/ka_jumptorogroom.nss b/nwnds_module/ka_jumptorogroom.nss new file mode 100644 index 000000000..5ce994a9b --- /dev/null +++ b/nwnds_module/ka_jumptorogroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_ROGANROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_jumptoscortow.ncs b/nwnds_module/ka_jumptoscortow.ncs new file mode 100644 index 000000000..6b1e8f13b Binary files /dev/null and b/nwnds_module/ka_jumptoscortow.ncs differ diff --git a/nwnds_module/ka_jumptoscortow.nss b/nwnds_module/ka_jumptoscortow.nss new file mode 100644 index 000000000..6ac463380 --- /dev/null +++ b/nwnds_module/ka_jumptoscortow.nss @@ -0,0 +1,33 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.2 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this script OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_SCORCHEDTOWER"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptoshrine.ncs b/nwnds_module/ka_jumptoshrine.ncs new file mode 100644 index 000000000..efe814816 Binary files /dev/null and b/nwnds_module/ka_jumptoshrine.ncs differ diff --git a/nwnds_module/ka_jumptoshrine.nss b/nwnds_module/ka_jumptoshrine.nss new file mode 100644 index 000000000..11a1a872c --- /dev/null +++ b/nwnds_module/ka_jumptoshrine.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("SHRINEROOM"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptoshrine2.ncs b/nwnds_module/ka_jumptoshrine2.ncs new file mode 100644 index 000000000..95eae24b6 Binary files /dev/null and b/nwnds_module/ka_jumptoshrine2.ncs differ diff --git a/nwnds_module/ka_jumptoshrine2.nss b/nwnds_module/ka_jumptoshrine2.nss new file mode 100644 index 000000000..071459f54 --- /dev/null +++ b/nwnds_module/ka_jumptoshrine2.nss @@ -0,0 +1,31 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("SHRINEROOM2"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_jumptoskoroom.ncs b/nwnds_module/ka_jumptoskoroom.ncs new file mode 100644 index 000000000..9ace545d8 Binary files /dev/null and b/nwnds_module/ka_jumptoskoroom.ncs differ diff --git a/nwnds_module/ka_jumptoskoroom.nss b/nwnds_module/ka_jumptoskoroom.nss new file mode 100644 index 000000000..8d76edc3d --- /dev/null +++ b/nwnds_module/ka_jumptoskoroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_SKONZROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_jumptourik.ncs b/nwnds_module/ka_jumptourik.ncs new file mode 100644 index 000000000..1a120c985 Binary files /dev/null and b/nwnds_module/ka_jumptourik.ncs differ diff --git a/nwnds_module/ka_jumptourik.nss b/nwnds_module/ka_jumptourik.nss new file mode 100644 index 000000000..867f3df9d --- /dev/null +++ b/nwnds_module/ka_jumptourik.nss @@ -0,0 +1,5 @@ +void main() +{ +AssignCommand(GetPCSpeaker(),ActionJumpToLocation(GetLocation(GetObjectByTag("WP_UrikStart")))); +} + diff --git a/nwnds_module/ka_junai.dlg b/nwnds_module/ka_junai.dlg new file mode 100644 index 000000000..9a905b427 Binary files /dev/null and b/nwnds_module/ka_junai.dlg differ diff --git a/nwnds_module/ka_junaistore.ncs b/nwnds_module/ka_junaistore.ncs new file mode 100644 index 000000000..87a5aa894 Binary files /dev/null and b/nwnds_module/ka_junaistore.ncs differ diff --git a/nwnds_module/ka_junaistore.nss b/nwnds_module/ka_junaistore.nss new file mode 100644 index 000000000..d0aeb317d --- /dev/null +++ b/nwnds_module/ka_junaistore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("TemplarShop"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_kiklikna.dlg b/nwnds_module/ka_kiklikna.dlg new file mode 100644 index 000000000..e552a4932 Binary files /dev/null and b/nwnds_module/ka_kiklikna.dlg differ diff --git a/nwnds_module/ka_kilari.dlg b/nwnds_module/ka_kilari.dlg new file mode 100644 index 000000000..baf3dd4cb Binary files /dev/null and b/nwnds_module/ka_kilari.dlg differ diff --git a/nwnds_module/ka_kilaristore.ncs b/nwnds_module/ka_kilaristore.ncs new file mode 100644 index 000000000..9deec606f Binary files /dev/null and b/nwnds_module/ka_kilaristore.ncs differ diff --git a/nwnds_module/ka_kilaristore.nss b/nwnds_module/ka_kilaristore.nss new file mode 100644 index 000000000..a3803e8ba --- /dev/null +++ b/nwnds_module/ka_kilaristore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("KilariStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_korrik.dlg b/nwnds_module/ka_korrik.dlg new file mode 100644 index 000000000..57c441073 Binary files /dev/null and b/nwnds_module/ka_korrik.dlg differ diff --git a/nwnds_module/ka_larz.dlg b/nwnds_module/ka_larz.dlg new file mode 100644 index 000000000..5995fc5b0 Binary files /dev/null and b/nwnds_module/ka_larz.dlg differ diff --git a/nwnds_module/ka_lostsoulschk1.ncs b/nwnds_module/ka_lostsoulschk1.ncs new file mode 100644 index 000000000..8db4111b7 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk1.ncs differ diff --git a/nwnds_module/ka_lostsoulschk1.nss b/nwnds_module/ka_lostsoulschk1.nss new file mode 100644 index 000000000..c2d0563f5 --- /dev/null +++ b/nwnds_module/ka_lostsoulschk1.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_lostsoulschk2.ncs b/nwnds_module/ka_lostsoulschk2.ncs new file mode 100644 index 000000000..1e4f8346d Binary files /dev/null and b/nwnds_module/ka_lostsoulschk2.ncs differ diff --git a/nwnds_module/ka_lostsoulschk2.nss b/nwnds_module/ka_lostsoulschk2.nss new file mode 100644 index 000000000..fc5eb116c --- /dev/null +++ b/nwnds_module/ka_lostsoulschk2.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 2)) + return FALSE; +if (GetItemPossessedBy(oPC, "QST_PORTEKSOUL") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_lostsoulschk3.ncs b/nwnds_module/ka_lostsoulschk3.ncs new file mode 100644 index 000000000..f3ea8e918 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk3.ncs differ diff --git a/nwnds_module/ka_lostsoulschk3.nss b/nwnds_module/ka_lostsoulschk3.nss new file mode 100644 index 000000000..3855082bf --- /dev/null +++ b/nwnds_module/ka_lostsoulschk3.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_lostsoulschk4.ncs b/nwnds_module/ka_lostsoulschk4.ncs new file mode 100644 index 000000000..6860594f4 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk4.ncs differ diff --git a/nwnds_module/ka_lostsoulschk4.nss b/nwnds_module/ka_lostsoulschk4.nss new file mode 100644 index 000000000..54f456abf --- /dev/null +++ b/nwnds_module/ka_lostsoulschk4.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 4)) + return FALSE; +if (GetItemPossessedBy(oPC, "QST_MYSTSOUL") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_lostsoulschk5.ncs b/nwnds_module/ka_lostsoulschk5.ncs new file mode 100644 index 000000000..8401b6942 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk5.ncs differ diff --git a/nwnds_module/ka_lostsoulschk5.nss b/nwnds_module/ka_lostsoulschk5.nss new file mode 100644 index 000000000..0c8f71fde --- /dev/null +++ b/nwnds_module/ka_lostsoulschk5.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 5)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_lostsoulschk6.ncs b/nwnds_module/ka_lostsoulschk6.ncs new file mode 100644 index 000000000..7495890a7 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk6.ncs differ diff --git a/nwnds_module/ka_lostsoulschk6.nss b/nwnds_module/ka_lostsoulschk6.nss new file mode 100644 index 000000000..a531330c5 --- /dev/null +++ b/nwnds_module/ka_lostsoulschk6.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 6)) + return FALSE; +if (GetItemPossessedBy(oPC, "QST_FARRAUKSOUL") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_lostsoulschk7.ncs b/nwnds_module/ka_lostsoulschk7.ncs new file mode 100644 index 000000000..d785faf72 Binary files /dev/null and b/nwnds_module/ka_lostsoulschk7.ncs differ diff --git a/nwnds_module/ka_lostsoulschk7.nss b/nwnds_module/ka_lostsoulschk7.nss new file mode 100644 index 000000000..495cedaf6 --- /dev/null +++ b/nwnds_module/ka_lostsoulschk7.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYLostSouls"); + +if (!(nInt == 7)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_marcus.dlg b/nwnds_module/ka_marcus.dlg new file mode 100644 index 000000000..1f1837c72 Binary files /dev/null and b/nwnds_module/ka_marcus.dlg differ diff --git a/nwnds_module/ka_marcusstore.ncs b/nwnds_module/ka_marcusstore.ncs new file mode 100644 index 000000000..85ac90f22 Binary files /dev/null and b/nwnds_module/ka_marcusstore.ncs differ diff --git a/nwnds_module/ka_marcusstore.nss b/nwnds_module/ka_marcusstore.nss new file mode 100644 index 000000000..c6b1b142a --- /dev/null +++ b/nwnds_module/ka_marcusstore.nss @@ -0,0 +1,14 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("MarcusStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_martosadoor.dlg b/nwnds_module/ka_martosadoor.dlg new file mode 100644 index 000000000..fa7ec433a Binary files /dev/null and b/nwnds_module/ka_martosadoor.dlg differ diff --git a/nwnds_module/ka_martosahunt.ncs b/nwnds_module/ka_martosahunt.ncs new file mode 100644 index 000000000..148c3ac7e Binary files /dev/null and b/nwnds_module/ka_martosahunt.ncs differ diff --git a/nwnds_module/ka_martosahunt.nss b/nwnds_module/ka_martosahunt.nss new file mode 100644 index 000000000..40490e63e --- /dev/null +++ b/nwnds_module/ka_martosahunt.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheDraqomen"); + +if (!(nInt == 3)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_meteor.dlg b/nwnds_module/ka_meteor.dlg new file mode 100644 index 000000000..b7c71760c Binary files /dev/null and b/nwnds_module/ka_meteor.dlg differ diff --git a/nwnds_module/ka_midnightroom.ncs b/nwnds_module/ka_midnightroom.ncs new file mode 100644 index 000000000..95f50abbf Binary files /dev/null and b/nwnds_module/ka_midnightroom.ncs differ diff --git a/nwnds_module/ka_midnightroom.nss b/nwnds_module/ka_midnightroom.nss new file mode 100644 index 000000000..33d2eff71 --- /dev/null +++ b/nwnds_module/ka_midnightroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_MIDNIGHTSANDSROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_mim.dlg b/nwnds_module/ka_mim.dlg new file mode 100644 index 000000000..1c2a51ba6 Binary files /dev/null and b/nwnds_module/ka_mim.dlg differ diff --git a/nwnds_module/ka_mimcheck1.ncs b/nwnds_module/ka_mimcheck1.ncs new file mode 100644 index 000000000..c6165e5d2 Binary files /dev/null and b/nwnds_module/ka_mimcheck1.ncs differ diff --git a/nwnds_module/ka_mimcheck1.nss b/nwnds_module/ka_mimcheck1.nss new file mode 100644 index 000000000..1a0a39ed4 --- /dev/null +++ b/nwnds_module/ka_mimcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "LostHeirloom") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ka_mimdoor.dlg b/nwnds_module/ka_mimdoor.dlg new file mode 100644 index 000000000..875d740a0 Binary files /dev/null and b/nwnds_module/ka_mimdoor.dlg differ diff --git a/nwnds_module/ka_mimsew1.dlg b/nwnds_module/ka_mimsew1.dlg new file mode 100644 index 000000000..c8be393f3 Binary files /dev/null and b/nwnds_module/ka_mimsew1.dlg differ diff --git a/nwnds_module/ka_mimsew2.dlg b/nwnds_module/ka_mimsew2.dlg new file mode 100644 index 000000000..8cef44e3d Binary files /dev/null and b/nwnds_module/ka_mimsew2.dlg differ diff --git a/nwnds_module/ka_mimsew3.dlg b/nwnds_module/ka_mimsew3.dlg new file mode 100644 index 000000000..b38d27dfa Binary files /dev/null and b/nwnds_module/ka_mimsew3.dlg differ diff --git a/nwnds_module/ka_mimsneck.ncs b/nwnds_module/ka_mimsneck.ncs new file mode 100644 index 000000000..4e5b80922 Binary files /dev/null and b/nwnds_module/ka_mimsneck.ncs differ diff --git a/nwnds_module/ka_mimsneck.nss b/nwnds_module/ka_mimsneck.nss new file mode 100644 index 000000000..eee4ba4fc --- /dev/null +++ b/nwnds_module/ka_mimsneck.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_ITNCK_MIM") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_nitaa.dlg b/nwnds_module/ka_nitaa.dlg new file mode 100644 index 000000000..0d5555a7b Binary files /dev/null and b/nwnds_module/ka_nitaa.dlg differ diff --git a/nwnds_module/ka_nora.dlg b/nwnds_module/ka_nora.dlg new file mode 100644 index 000000000..fba3f6d6d Binary files /dev/null and b/nwnds_module/ka_nora.dlg differ diff --git a/nwnds_module/ka_npcsitconvo.ncs b/nwnds_module/ka_npcsitconvo.ncs new file mode 100644 index 000000000..c6ec06b77 Binary files /dev/null and b/nwnds_module/ka_npcsitconvo.ncs differ diff --git a/nwnds_module/ka_npcsitconvo.nss b/nwnds_module/ka_npcsitconvo.nss new file mode 100644 index 000000000..8add13ca0 --- /dev/null +++ b/nwnds_module/ka_npcsitconvo.nss @@ -0,0 +1,36 @@ +//:://///////////////////////////////////////////// +//:: On Conversation +//:: speaksitting +//:: Created By: Hillary Skeryanc-Mann +//:: Created On: March 22, 2003 +//::////////////////////////////////////////////// +void main() +{ + ExecuteScript("prc_npc_conv", OBJECT_SELF); + ExecuteScript("nw_c2_default4", OBJECT_SELF); + + if(GetCommandable(OBJECT_SELF)){ + { + BeginConversation(); + } + ClearAllActions(); + string sMyTagName = GetTag(OBJECT_SELF); + string sChairTag = "CHAIR_" + sMyTagName; + string sFloorTag = "FLOOR_" + sMyTagName; + object oSitplace = GetNearestObject(); + if (GetTag (oSitplace) == sChairTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sChairTag, OBJECT_SELF, nChair); + ActionSit(oChair); + } + else if (GetTag (oSitplace) == sFloorTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sFloorTag, OBJECT_SELF, nChair); + ActionDoCommand( ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS,0.0,4000.0) ) ; + } + } +} diff --git a/nwnds_module/ka_npcsitconvo2.ncs b/nwnds_module/ka_npcsitconvo2.ncs new file mode 100644 index 000000000..bf37b22e0 Binary files /dev/null and b/nwnds_module/ka_npcsitconvo2.ncs differ diff --git a/nwnds_module/ka_npcsitconvo2.nss b/nwnds_module/ka_npcsitconvo2.nss new file mode 100644 index 000000000..4c83a6c49 --- /dev/null +++ b/nwnds_module/ka_npcsitconvo2.nss @@ -0,0 +1,33 @@ +//:://///////////////////////////////////////////// +//:: On Conversation +//:: speaksitting +//:: Created By: Hillary Skeryanc-Mann +//:: Created On: March 22, 2003 +//::////////////////////////////////////////////// +void main() +{ + if(GetCommandable(OBJECT_SELF)){ + { + BeginConversation(); + } + ClearAllActions(); + string sMyTagName = GetTag(OBJECT_SELF); + string sChairTag = "Seat"; + string sFloorTag = "FLOOR_" + sMyTagName; + object oSitplace = GetNearestObject(); + if (GetTag (oSitplace) == sChairTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sChairTag, OBJECT_SELF, nChair); + ActionSit(oChair); + } + else if (GetTag (oSitplace) == sFloorTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sFloorTag, OBJECT_SELF, nChair); + ActionDoCommand( ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS,0.0,4000.0) ) ; + } + } +} diff --git a/nwnds_module/ka_npcsitspawn.ncs b/nwnds_module/ka_npcsitspawn.ncs new file mode 100644 index 000000000..428144ace Binary files /dev/null and b/nwnds_module/ka_npcsitspawn.ncs differ diff --git a/nwnds_module/ka_npcsitspawn.nss b/nwnds_module/ka_npcsitspawn.nss new file mode 100644 index 000000000..7b81144a1 --- /dev/null +++ b/nwnds_module/ka_npcsitspawn.nss @@ -0,0 +1,95 @@ +//:://///////////////////////////////////////////// +//:: On Spawn In +//:: spawnsitting +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Altered By: Hillary Skeryanc-Mann +//:: Created On: Oct 25, 2001 +//:: Altered On: March 22, 2003 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + { + string sMyTagName = GetTag(OBJECT_SELF); + string sChairTag = "CHAIR_" + sMyTagName; + string sFloorTag = "FLOOR_" + sMyTagName; + object oSitplace = GetNearestObject(); + if (GetTag (oSitplace) == sChairTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sChairTag, OBJECT_SELF, nChair); + ActionSit(oChair); + } + else if (GetTag (oSitplace) == sFloorTag) + { + int nChair = 1; + object oChair; + oChair = GetNearestObjectByTag(sFloorTag, OBJECT_SELF, nChair); + ActionDoCommand( ActionPlayAnimation( ANIMATION_LOOPING_SIT_CROSS,0.0,4000.0) ) ; + } + } +} diff --git a/nwnds_module/ka_oberon.dlg b/nwnds_module/ka_oberon.dlg new file mode 100644 index 000000000..65dac9e6c Binary files /dev/null and b/nwnds_module/ka_oberon.dlg differ diff --git a/nwnds_module/ka_offdutyhooker.dlg b/nwnds_module/ka_offdutyhooker.dlg new file mode 100644 index 000000000..b4ea117cf Binary files /dev/null and b/nwnds_module/ka_offdutyhooker.dlg differ diff --git a/nwnds_module/ka_olaes.dlg b/nwnds_module/ka_olaes.dlg new file mode 100644 index 000000000..a218aeffc Binary files /dev/null and b/nwnds_module/ka_olaes.dlg differ diff --git a/nwnds_module/ka_oldmeg.dlg b/nwnds_module/ka_oldmeg.dlg new file mode 100644 index 000000000..d2b902a7a Binary files /dev/null and b/nwnds_module/ka_oldmeg.dlg differ diff --git a/nwnds_module/ka_onhuntquest1.ncs b/nwnds_module/ka_onhuntquest1.ncs new file mode 100644 index 000000000..a24c62811 Binary files /dev/null and b/nwnds_module/ka_onhuntquest1.ncs differ diff --git a/nwnds_module/ka_onhuntquest1.nss b/nwnds_module/ka_onhuntquest1.nss new file mode 100644 index 000000000..80af511a4 --- /dev/null +++ b/nwnds_module/ka_onhuntquest1.nss @@ -0,0 +1,17 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYhuntandgather1"); + +if (nInt < 1) + return FALSE; + +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYhuntandgather1"); + +if (nInt >= 2) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_preludechk1.ncs b/nwnds_module/ka_preludechk1.ncs new file mode 100644 index 000000000..00c38f444 Binary files /dev/null and b/nwnds_module/ka_preludechk1.ncs differ diff --git a/nwnds_module/ka_preludechk1.nss b/nwnds_module/ka_preludechk1.nss new file mode 100644 index 000000000..77bc6b8d9 --- /dev/null +++ b/nwnds_module/ka_preludechk1.nss @@ -0,0 +1,14 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} + + diff --git a/nwnds_module/ka_preludechk2.ncs b/nwnds_module/ka_preludechk2.ncs new file mode 100644 index 000000000..b4432d20b Binary files /dev/null and b/nwnds_module/ka_preludechk2.ncs differ diff --git a/nwnds_module/ka_preludechk2.nss b/nwnds_module/ka_preludechk2.nss new file mode 100644 index 000000000..fc6cbb2d1 --- /dev/null +++ b/nwnds_module/ka_preludechk2.nss @@ -0,0 +1,12 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt >= 3)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_preludechk3.ncs b/nwnds_module/ka_preludechk3.ncs new file mode 100644 index 000000000..697958cb2 Binary files /dev/null and b/nwnds_module/ka_preludechk3.ncs differ diff --git a/nwnds_module/ka_preludechk3.nss b/nwnds_module/ka_preludechk3.nss new file mode 100644 index 000000000..ea4e040f0 --- /dev/null +++ b/nwnds_module/ka_preludechk3.nss @@ -0,0 +1,12 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt >= 4)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_preludechk4.ncs b/nwnds_module/ka_preludechk4.ncs new file mode 100644 index 000000000..a4f34eaf0 Binary files /dev/null and b/nwnds_module/ka_preludechk4.ncs differ diff --git a/nwnds_module/ka_preludechk4.nss b/nwnds_module/ka_preludechk4.nss new file mode 100644 index 000000000..0b2c9d30f --- /dev/null +++ b/nwnds_module/ka_preludechk4.nss @@ -0,0 +1,12 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYThePrelude"); + +if (!(nInt == 6)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ka_preludereward.ncs b/nwnds_module/ka_preludereward.ncs new file mode 100644 index 000000000..20f36ff87 Binary files /dev/null and b/nwnds_module/ka_preludereward.ncs differ diff --git a/nwnds_module/ka_preludereward.nss b/nwnds_module/ka_preludereward.nss new file mode 100644 index 000000000..8990ca341 --- /dev/null +++ b/nwnds_module/ka_preludereward.nss @@ -0,0 +1,11 @@ +#include "nw_i0_tool" +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("forgedpreludeo", oPC); + +RewardPartyXP(3000, oPC, TRUE); + +} diff --git a/nwnds_module/ka_prihn.dlg b/nwnds_module/ka_prihn.dlg new file mode 100644 index 000000000..30efce5c8 Binary files /dev/null and b/nwnds_module/ka_prihn.dlg differ diff --git a/nwnds_module/ka_roganinn.dlg b/nwnds_module/ka_roganinn.dlg new file mode 100644 index 000000000..b7b0c0b72 Binary files /dev/null and b/nwnds_module/ka_roganinn.dlg differ diff --git a/nwnds_module/ka_roomvalet.dlg b/nwnds_module/ka_roomvalet.dlg new file mode 100644 index 000000000..05801857d Binary files /dev/null and b/nwnds_module/ka_roomvalet.dlg differ diff --git a/nwnds_module/ka_roomvalet10.dlg b/nwnds_module/ka_roomvalet10.dlg new file mode 100644 index 000000000..58b94bf03 Binary files /dev/null and b/nwnds_module/ka_roomvalet10.dlg differ diff --git a/nwnds_module/ka_roomvalet4.dlg b/nwnds_module/ka_roomvalet4.dlg new file mode 100644 index 000000000..3c410eb4a Binary files /dev/null and b/nwnds_module/ka_roomvalet4.dlg differ diff --git a/nwnds_module/ka_roomvalet7.dlg b/nwnds_module/ka_roomvalet7.dlg new file mode 100644 index 000000000..4f494da1f Binary files /dev/null and b/nwnds_module/ka_roomvalet7.dlg differ diff --git a/nwnds_module/ka_roomvalet8.dlg b/nwnds_module/ka_roomvalet8.dlg new file mode 100644 index 000000000..42e6c61ba Binary files /dev/null and b/nwnds_module/ka_roomvalet8.dlg differ diff --git a/nwnds_module/ka_roomvalet9.dlg b/nwnds_module/ka_roomvalet9.dlg new file mode 100644 index 000000000..045121fdf Binary files /dev/null and b/nwnds_module/ka_roomvalet9.dlg differ diff --git a/nwnds_module/ka_ropetoforest.dlg b/nwnds_module/ka_ropetoforest.dlg new file mode 100644 index 000000000..01b7c133d Binary files /dev/null and b/nwnds_module/ka_ropetoforest.dlg differ diff --git a/nwnds_module/ka_ruins_onenter.ncs b/nwnds_module/ka_ruins_onenter.ncs new file mode 100644 index 000000000..966e1936c Binary files /dev/null and b/nwnds_module/ka_ruins_onenter.ncs differ diff --git a/nwnds_module/ka_ruins_onenter.nss b/nwnds_module/ka_ruins_onenter.nss new file mode 100644 index 000000000..f3e3999b2 --- /dev/null +++ b/nwnds_module/ka_ruins_onenter.nss @@ -0,0 +1,127 @@ +// +// NESS V8.1 +// +// Spawn sample onEnter +// +// If you want to use pseudo-heartbeats and do not already have an area onEnter +// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to +// your existing onEnter handler. Note that you use this (and +// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb. +// + +#include "spawn_functions" +#include "tgdc_explore_inc" +#include "se_inc_resp_trap" +#include "ar_db_main" + +void main() +{ + //NC:EDIT + //added to enable defiling aura on NPC's + //7-3-06 + object oEntering = GetEnteringObject(); + object oArea = GetArea(oEntering); + SetLocalInt(GetArea(oEntering), "X2_L_WILD_MAGIC", 1); + //NC:EDIT + //added arsx area index to area + SetLocalInt(oArea,ARSX_AREA_INDEX,ARSX_IndexArea(oArea)); + //Heatstroke's Edit + //Added code to enable player exploration + PlayerExplore(oEntering, 0); + + // Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat + // script to execute, the heartbeat duration, and a delay for the first + // heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as + // if it were called like: + Spawn_OnAreaEnter( "spawn_sample_hb", 10.0, 0.0 ); + + //Spawn_OnAreaEnter(); + +//Kyri's Addition: +//The Following addition is for a set of specific zones on Clockwork Isle +//However, the tech involved can be adapted to other areas where traps are +//used. The following allows random traps to be placed in a given area on +//the ground, doors or objects. This is not a system of my own design. +//Credit for the system is as follows: +//:://////////////////////////////////////////////////////////////////////////// +//:: Name Sir Elric's Respawning Traps v2.7 +//:: FileName se_oea_rsp_trap +//:://////////////////////////////////////////////////////////////////////////// +/* + - Add to the OnEnterArea event of any area you want respawning traps + - Place either or both of the invisible objects tagged INVIS_TRAP_SPAWNER or + INVIS_TRAP_SPAWNER_RANDOM set them up to suit the area and your done. +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By : Sir Elric +//:: Created On : 19th June, 2006 +//:: Modified On : 19th December, 2007 +//:: Event Used : OnEnterArea +//:: Patch : 1.67 or above required +//:://////////////////////////////////////////////////////////////////////////// + + { + int bValid; + object oPC = GetEnteringObject(); + if(GetIsObjectValid(oPC) == FALSE) + oPC = OBJECT_SELF; + + object oArea = GetArea(oPC); + + if(GetLocalInt(oArea, "NO_TRAPS_TO_SET") == TRUE) + { + SE_Debug("[" + GetName(oArea) + "] Player has entered. No objects or doors are set for respawning traps in this area - return"); + return; + } + + if(GetIsPC(oPC) && GetLocalInt(oArea, "TRAPS_SET") == FALSE) + { + object oObject = GetFirstObjectInArea(); + while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "TRAP_ALWAYS") == TRUE) + { + bValid = TRUE; + ExecuteScript("se_respawn_trap", oObject); + } + else if(SE_GetIsASpawnerObject(oObject)) + { + bValid = TRUE; + DelayCommand(0.5, ExecuteScript("se_respawn_trap", oObject)); + } + oObject = GetNextObjectInArea(); + } + + if(bValid == TRUE) + { + SetLocalInt(oArea, "TRAPS_SET", TRUE); + SetLocalInt(oArea, "TRAP_RESPAWN_INITIATED", TRUE); + // If optional area timer is not set use the default SE_AREA_TIMER + float fTimer = GetLocalFloat(oArea, "TRAP_AREA_TIMER"); + if(fTimer == 0.0) + { + fTimer = SE_AREA_TIMER; + + SE_Debug("[" + GetName(oArea) + "] Optional area timer not set using the default " + + FloatToString(SE_AREA_TIMER, 2, 0) + " seconds"); + } + AssignCommand(oArea, DelayCommand(fTimer, DeleteLocalInt(oArea, "TRAPS_SET"))); + AssignCommand(oArea, DelayCommand(fTimer, DeleteLocalInt(oArea, "TRAP_RESPAWN_INITIATED"))); + SE_Debug("[" + GetName(oArea) + "] Player has entered setting traps"); + } + else + { + SetLocalInt(oArea, "NO_TRAPS_TO_SET", TRUE); + SE_Debug("[" + GetName(oArea) + "] Player has entered. No objects or doors are set for respawning traps in this area - return"); + } + } + else if(GetLocalInt(oArea, "TRAP_RESPAWN_INITIATED") == TRUE) + { + SE_Debug("[" + GetName(oArea) + "] Trap respawn timer already initiated"); + } + else + { + SE_Debug("[" + GetName(oArea) + "] Player has entered. Respawn timer has not yet been initiated"); + } +} +} diff --git a/nwnds_module/ka_sandstone.ncs b/nwnds_module/ka_sandstone.ncs new file mode 100644 index 000000000..5b113c41f Binary files /dev/null and b/nwnds_module/ka_sandstone.ncs differ diff --git a/nwnds_module/ka_sandstone.nss b/nwnds_module/ka_sandstone.nss new file mode 100644 index 000000000..0df376ffc --- /dev/null +++ b/nwnds_module/ka_sandstone.nss @@ -0,0 +1,9 @@ +void main() +{ +TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); + +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_SANDSTONEROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_sarkea.dlg b/nwnds_module/ka_sarkea.dlg new file mode 100644 index 000000000..cf1de40e2 Binary files /dev/null and b/nwnds_module/ka_sarkea.dlg differ diff --git a/nwnds_module/ka_selene.dlg b/nwnds_module/ka_selene.dlg new file mode 100644 index 000000000..6a849db95 Binary files /dev/null and b/nwnds_module/ka_selene.dlg differ diff --git a/nwnds_module/ka_selenerwd.ncs b/nwnds_module/ka_selenerwd.ncs new file mode 100644 index 000000000..29e70891e Binary files /dev/null and b/nwnds_module/ka_selenerwd.ncs differ diff --git a/nwnds_module/ka_selenerwd.nss b/nwnds_module/ka_selenerwd.nss new file mode 100644 index 000000000..3eed4ecde --- /dev/null +++ b/nwnds_module/ka_selenerwd.nss @@ -0,0 +1,22 @@ + #include "nw_i0_tool" +//:://///////////////////////////////////////////// +//:: FileName Ka_SeleneRwd.nss +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:33:01 AM +//::////////////////////////////////////////////// +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(300, oPC, FALSE); + +RewardPartyGP(300, oPC, FALSE); + +CreateItemOnObject("FAC_ITPNCK_DRAQO", oPC); + +CreateItemOnObject("FAC_KEY_DRAQOMAN", oPC); + +} diff --git a/nwnds_module/ka_sellblood.ncs b/nwnds_module/ka_sellblood.ncs new file mode 100644 index 000000000..40d07f800 Binary files /dev/null and b/nwnds_module/ka_sellblood.ncs differ diff --git a/nwnds_module/ka_sellblood.nss b/nwnds_module/ka_sellblood.nss new file mode 100644 index 000000000..93605d3f9 --- /dev/null +++ b/nwnds_module/ka_sellblood.nss @@ -0,0 +1,32 @@ +#include "nw_i0_tool" +object oItem; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_ASHENDRBLOOD")!= OBJECT_INVALID) + { + oItem = GetItemPossessedBy(oPC, "QST_ASHENDRBLOOD"); + + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + + RewardPartyGP(5000, oPC, FALSE); + + } +else + { + AssignCommand(GetObjectByTag("Justl"), ActionSpeakString("Now don't be tryin' to pull one over on ol' Justl. Just hand it over if ye be wantin' that ceramic.")); + + } + +} + diff --git a/nwnds_module/ka_setbaker0.ncs b/nwnds_module/ka_setbaker0.ncs new file mode 100644 index 000000000..5df1a6968 Binary files /dev/null and b/nwnds_module/ka_setbaker0.ncs differ diff --git a/nwnds_module/ka_setbaker0.nss b/nwnds_module/ka_setbaker0.nss new file mode 100644 index 000000000..f2166a436 --- /dev/null +++ b/nwnds_module/ka_setbaker0.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "baker", 0); + +} diff --git a/nwnds_module/ka_setbaker1.ncs b/nwnds_module/ka_setbaker1.ncs new file mode 100644 index 000000000..277fa4933 Binary files /dev/null and b/nwnds_module/ka_setbaker1.ncs differ diff --git a/nwnds_module/ka_setbaker1.nss b/nwnds_module/ka_setbaker1.nss new file mode 100644 index 000000000..2213606d6 --- /dev/null +++ b/nwnds_module/ka_setbaker1.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "baker", 1); + +} diff --git a/nwnds_module/ka_setclockstart.ncs b/nwnds_module/ka_setclockstart.ncs new file mode 100644 index 000000000..c137fad76 Binary files /dev/null and b/nwnds_module/ka_setclockstart.ncs differ diff --git a/nwnds_module/ka_setclockstart.nss b/nwnds_module/ka_setclockstart.nss new file mode 100644 index 000000000..99495deea --- /dev/null +++ b/nwnds_module/ka_setclockstart.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "clockworkstart", 1); + +} + diff --git a/nwnds_module/ka_sethunt0.ncs b/nwnds_module/ka_sethunt0.ncs new file mode 100644 index 000000000..15f52e6b4 Binary files /dev/null and b/nwnds_module/ka_sethunt0.ncs differ diff --git a/nwnds_module/ka_sethunt0.nss b/nwnds_module/ka_sethunt0.nss new file mode 100644 index 000000000..f2cfc3b47 --- /dev/null +++ b/nwnds_module/ka_sethunt0.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "hunt", 0); + +} diff --git a/nwnds_module/ka_setseleneappr.ncs b/nwnds_module/ka_setseleneappr.ncs new file mode 100644 index 000000000..5fddd19f6 Binary files /dev/null and b/nwnds_module/ka_setseleneappr.ncs differ diff --git a/nwnds_module/ka_setseleneappr.nss b/nwnds_module/ka_setseleneappr.nss new file mode 100644 index 000000000..7aed9b1fd --- /dev/null +++ b/nwnds_module/ka_setseleneappr.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "seleneapproves", 1); + +} diff --git a/nwnds_module/ka_shade.dlg b/nwnds_module/ka_shade.dlg new file mode 100644 index 000000000..5f905a2df Binary files /dev/null and b/nwnds_module/ka_shade.dlg differ diff --git a/nwnds_module/ka_shiral.dlg b/nwnds_module/ka_shiral.dlg new file mode 100644 index 000000000..3e9f34066 Binary files /dev/null and b/nwnds_module/ka_shiral.dlg differ diff --git a/nwnds_module/ka_shrinedoor.dlg b/nwnds_module/ka_shrinedoor.dlg new file mode 100644 index 000000000..3e73f7ed6 Binary files /dev/null and b/nwnds_module/ka_shrinedoor.dlg differ diff --git a/nwnds_module/ka_shubbystavern.ncs b/nwnds_module/ka_shubbystavern.ncs new file mode 100644 index 000000000..dda9d29e6 Binary files /dev/null and b/nwnds_module/ka_shubbystavern.ncs differ diff --git a/nwnds_module/ka_shubbystavern.nss b/nwnds_module/ka_shubbystavern.nss new file mode 100644 index 000000000..ea2076eec --- /dev/null +++ b/nwnds_module/ka_shubbystavern.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_SHUBBYROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_sign1.dlg b/nwnds_module/ka_sign1.dlg new file mode 100644 index 000000000..a20484b55 Binary files /dev/null and b/nwnds_module/ka_sign1.dlg differ diff --git a/nwnds_module/ka_siltchestloot.ncs b/nwnds_module/ka_siltchestloot.ncs new file mode 100644 index 000000000..abab6ca28 Binary files /dev/null and b/nwnds_module/ka_siltchestloot.ncs differ diff --git a/nwnds_module/ka_siltchestloot.nss b/nwnds_module/ka_siltchestloot.nss new file mode 100644 index 000000000..441e47878 --- /dev/null +++ b/nwnds_module/ka_siltchestloot.nss @@ -0,0 +1,32 @@ +void main() +{ + object oPlayer = GetLastUnlocked(); + object oKey = GetItemPossessedBy(oPlayer, "strangebonekey"); + DestroyObject(oKey); + + string sItem; + switch (d20()) + { + case 1: sItem = "robesofthearc"; break; + case 2: sItem = "robesofthedep"; break; + case 3: sItem = "imbueddrakeforge"; break; + case 4: sItem = "phandarashelm"; break; + case 5: sItem = "pyreenforgedplat"; break; + case 6: sItem = "rangerspride"; break; + case 7: sItem = "armoroftheoasis"; break; + case 8: sItem = "bardssong"; break; + case 9: sItem = "sanshirswall"; break; + case 10: sItem = "malifsbuckler"; break; + case 11: sItem = "villichimasgua"; break; + case 12: sItem = "beltoftheundying"; break; + case 13: sItem = "battlebracers"; break; + case 14: sItem = "jandorasbracers"; break; + case 15: sItem = "zephrynsgloves"; break; + case 16: sItem = "bootsofthedra"; break; + case 17: sItem = "bootsoftheearth"; break; + case 18: sItem = "bootsoftheblack"; break; + case 19: sItem = "necromancerscloa"; break; + case 20: sItem = "torakswrap"; break; + } + CreateItemOnObject(sItem); +} diff --git a/nwnds_module/ka_silverdunesro.ncs b/nwnds_module/ka_silverdunesro.ncs new file mode 100644 index 000000000..75fa33850 Binary files /dev/null and b/nwnds_module/ka_silverdunesro.ncs differ diff --git a/nwnds_module/ka_silverdunesro.nss b/nwnds_module/ka_silverdunesro.nss new file mode 100644 index 000000000..fc73fd357 --- /dev/null +++ b/nwnds_module/ka_silverdunesro.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_SILVERDUNESROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_silvervendor1.dlg b/nwnds_module/ka_silvervendor1.dlg new file mode 100644 index 000000000..a4a4648b2 Binary files /dev/null and b/nwnds_module/ka_silvervendor1.dlg differ diff --git a/nwnds_module/ka_silvervendor1.ncs b/nwnds_module/ka_silvervendor1.ncs new file mode 100644 index 000000000..da1514f10 Binary files /dev/null and b/nwnds_module/ka_silvervendor1.ncs differ diff --git a/nwnds_module/ka_silvervendor1.nss b/nwnds_module/ka_silvervendor1.nss new file mode 100644 index 000000000..a9fba4ed5 --- /dev/null +++ b/nwnds_module/ka_silvervendor1.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("SilverHand2"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_silvervendor2.dlg b/nwnds_module/ka_silvervendor2.dlg new file mode 100644 index 000000000..940e910f6 Binary files /dev/null and b/nwnds_module/ka_silvervendor2.dlg differ diff --git a/nwnds_module/ka_silvervendor2.ncs b/nwnds_module/ka_silvervendor2.ncs new file mode 100644 index 000000000..9dbc7e46a Binary files /dev/null and b/nwnds_module/ka_silvervendor2.ncs differ diff --git a/nwnds_module/ka_silvervendor2.nss b/nwnds_module/ka_silvervendor2.nss new file mode 100644 index 000000000..a236d5844 --- /dev/null +++ b/nwnds_module/ka_silvervendor2.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("SilverHand1"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_silvervendor3.dlg b/nwnds_module/ka_silvervendor3.dlg new file mode 100644 index 000000000..8e88cd92f Binary files /dev/null and b/nwnds_module/ka_silvervendor3.dlg differ diff --git a/nwnds_module/ka_silvervendor3.ncs b/nwnds_module/ka_silvervendor3.ncs new file mode 100644 index 000000000..4f51e7602 Binary files /dev/null and b/nwnds_module/ka_silvervendor3.ncs differ diff --git a/nwnds_module/ka_silvervendor3.nss b/nwnds_module/ka_silvervendor3.nss new file mode 100644 index 000000000..392dfbecb --- /dev/null +++ b/nwnds_module/ka_silvervendor3.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("SilverHandMystic"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_skonzinn.dlg b/nwnds_module/ka_skonzinn.dlg new file mode 100644 index 000000000..62c6ff1d4 Binary files /dev/null and b/nwnds_module/ka_skonzinn.dlg differ diff --git a/nwnds_module/ka_soulrewcha.ncs b/nwnds_module/ka_soulrewcha.ncs new file mode 100644 index 000000000..377302ba4 Binary files /dev/null and b/nwnds_module/ka_soulrewcha.ncs differ diff --git a/nwnds_module/ka_soulrewcha.nss b/nwnds_module/ka_soulrewcha.nss new file mode 100644 index 000000000..73fd098a6 --- /dev/null +++ b/nwnds_module/ka_soulrewcha.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewCHA +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Charisma +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_CHA03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_soulrewcon.ncs b/nwnds_module/ka_soulrewcon.ncs new file mode 100644 index 000000000..39175428e Binary files /dev/null and b/nwnds_module/ka_soulrewcon.ncs differ diff --git a/nwnds_module/ka_soulrewcon.nss b/nwnds_module/ka_soulrewcon.nss new file mode 100644 index 000000000..fd8d10f32 --- /dev/null +++ b/nwnds_module/ka_soulrewcon.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewCON +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Constitution +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_CON03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_soulrewdex.ncs b/nwnds_module/ka_soulrewdex.ncs new file mode 100644 index 000000000..e6157c727 Binary files /dev/null and b/nwnds_module/ka_soulrewdex.ncs differ diff --git a/nwnds_module/ka_soulrewdex.nss b/nwnds_module/ka_soulrewdex.nss new file mode 100644 index 000000000..e3b75163b --- /dev/null +++ b/nwnds_module/ka_soulrewdex.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewDEX +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Dexterity +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_DEX03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_soulrewint.ncs b/nwnds_module/ka_soulrewint.ncs new file mode 100644 index 000000000..1468b8fa0 Binary files /dev/null and b/nwnds_module/ka_soulrewint.ncs differ diff --git a/nwnds_module/ka_soulrewint.nss b/nwnds_module/ka_soulrewint.nss new file mode 100644 index 000000000..a24fb9c64 --- /dev/null +++ b/nwnds_module/ka_soulrewint.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewINT +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Intelligence +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_INT03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_soulrewrandom.ncs b/nwnds_module/ka_soulrewrandom.ncs new file mode 100644 index 000000000..cef80ae92 Binary files /dev/null and b/nwnds_module/ka_soulrewrandom.ncs differ diff --git a/nwnds_module/ka_soulrewrandom.nss b/nwnds_module/ka_soulrewrandom.nss new file mode 100644 index 000000000..a8a6b1f5a --- /dev/null +++ b/nwnds_module/ka_soulrewrandom.nss @@ -0,0 +1,40 @@ +//:://///////////////////////////////////////////// +//:: Filename KA_SoulRewRandom +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a random + magical item +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ +// Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + // Give the speaker the items + int nVeggie = d6(); + //% chance + if ((nVeggie > 0) && (nVeggie <= 1)) + CreateItemOnObject("AR_ITMCLK_TRAVIS", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 1) && (nVeggie <= 2)) + CreateItemOnObject("AR_ITMRNG_NIGHTF", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 3)) + CreateItemOnObject("AR_ITPRNG_RAGE", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 3) && (nVeggie <= 4)) + CreateItemOnObject("AR_ITPNCK_HOCEAN", GetPCSpeaker(), 1); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 5)) + CreateItemOnObject("AR_ITMNCK_GALIAN", GetPCSpeaker(), 1); + //% chance + else if (nVeggie > 5) + CreateItemOnObject("AR_ITMBLT_UNDYIN", GetPCSpeaker(), 1); + } diff --git a/nwnds_module/ka_soulrewstr.ncs b/nwnds_module/ka_soulrewstr.ncs new file mode 100644 index 000000000..7dd39488c Binary files /dev/null and b/nwnds_module/ka_soulrewstr.ncs differ diff --git a/nwnds_module/ka_soulrewstr.nss b/nwnds_module/ka_soulrewstr.nss new file mode 100644 index 000000000..f3e81576c --- /dev/null +++ b/nwnds_module/ka_soulrewstr.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewSTR +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Strength +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_STR03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_soulrewwis.ncs b/nwnds_module/ka_soulrewwis.ncs new file mode 100644 index 000000000..e32e3d30d Binary files /dev/null and b/nwnds_module/ka_soulrewwis.ncs differ diff --git a/nwnds_module/ka_soulrewwis.nss b/nwnds_module/ka_soulrewwis.nss new file mode 100644 index 000000000..87cf0b699 --- /dev/null +++ b/nwnds_module/ka_soulrewwis.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: Filename: KA_SoulRewWIS +/* + Quest: Lost Souls + + Rewards the PC with 1500 XP & a Master's + Amulet of Wisdom +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Kyriani Agriviar +//:: Created On: 10/10/2002 3:49:43 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +void main() +{ + // Give the speaker some XP + RewardPartyXP(1500, GetPCSpeaker()); + + // Give the speaker the items + CreateItemOnObject("AR_ITMNCK_WIS03", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/ka_supplychk1.ncs b/nwnds_module/ka_supplychk1.ncs new file mode 100644 index 000000000..bee0eba5b Binary files /dev/null and b/nwnds_module/ka_supplychk1.ncs differ diff --git a/nwnds_module/ka_supplychk1.nss b/nwnds_module/ka_supplychk1.nss new file mode 100644 index 000000000..315fb84f8 --- /dev/null +++ b/nwnds_module/ka_supplychk1.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYDetour"); + +if (!(nInt == 1)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_supplycrate.dlg b/nwnds_module/ka_supplycrate.dlg new file mode 100644 index 000000000..027fe1121 Binary files /dev/null and b/nwnds_module/ka_supplycrate.dlg differ diff --git a/nwnds_module/ka_tailor_store.ncs b/nwnds_module/ka_tailor_store.ncs new file mode 100644 index 000000000..789331d26 Binary files /dev/null and b/nwnds_module/ka_tailor_store.ncs differ diff --git a/nwnds_module/ka_tailor_store.nss b/nwnds_module/ka_tailor_store.nss new file mode 100644 index 000000000..2eb0c88eb --- /dev/null +++ b/nwnds_module/ka_tailor_store.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("STORE_CLOTHING2"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_takebread.ncs b/nwnds_module/ka_takebread.ncs new file mode 100644 index 000000000..30be6b02b Binary files /dev/null and b/nwnds_module/ka_takebread.ncs differ diff --git a/nwnds_module/ka_takebread.nss b/nwnds_module/ka_takebread.nss new file mode 100644 index 000000000..464081a72 --- /dev/null +++ b/nwnds_module/ka_takebread.nss @@ -0,0 +1,13 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_LARZBREAD"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takedoc.ncs b/nwnds_module/ka_takedoc.ncs new file mode 100644 index 000000000..f572dc78c Binary files /dev/null and b/nwnds_module/ka_takedoc.ncs differ diff --git a/nwnds_module/ka_takedoc.nss b/nwnds_module/ka_takedoc.nss new file mode 100644 index 000000000..3d02d785a --- /dev/null +++ b/nwnds_module/ka_takedoc.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_YEHINADOCS"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takedoc2.ncs b/nwnds_module/ka_takedoc2.ncs new file mode 100644 index 000000000..5dee48885 Binary files /dev/null and b/nwnds_module/ka_takedoc2.ncs differ diff --git a/nwnds_module/ka_takedoc2.nss b/nwnds_module/ka_takedoc2.nss new file mode 100644 index 000000000..51489d22f --- /dev/null +++ b/nwnds_module/ka_takedoc2.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "qst_highbureau01"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takeesutachar.ncs b/nwnds_module/ka_takeesutachar.ncs new file mode 100644 index 000000000..e584aa8d5 Binary files /dev/null and b/nwnds_module/ka_takeesutachar.ncs differ diff --git a/nwnds_module/ka_takeesutachar.nss b/nwnds_module/ka_takeesutachar.nss new file mode 100644 index 000000000..9bb13ccc4 --- /dev/null +++ b/nwnds_module/ka_takeesutachar.nss @@ -0,0 +1,14 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "esutascharm"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +CreateItemOnObject("clockworkislandt", oPC); + +} diff --git a/nwnds_module/ka_takeesutasymb.ncs b/nwnds_module/ka_takeesutasymb.ncs new file mode 100644 index 000000000..5f4b2f165 Binary files /dev/null and b/nwnds_module/ka_takeesutasymb.ncs differ diff --git a/nwnds_module/ka_takeesutasymb.nss b/nwnds_module/ka_takeesutasymb.nss new file mode 100644 index 000000000..9ccfb1aba --- /dev/null +++ b/nwnds_module/ka_takeesutasymb.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "esutasholysymbol"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takefarrauk.ncs b/nwnds_module/ka_takefarrauk.ncs new file mode 100644 index 000000000..cc75ef45b Binary files /dev/null and b/nwnds_module/ka_takefarrauk.ncs differ diff --git a/nwnds_module/ka_takefarrauk.nss b/nwnds_module/ka_takefarrauk.nss new file mode 100644 index 000000000..f1e51b3d8 --- /dev/null +++ b/nwnds_module/ka_takefarrauk.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.2 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="QST_FARRAUKSOUL") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +} diff --git a/nwnds_module/ka_takeiron.ncs b/nwnds_module/ka_takeiron.ncs new file mode 100644 index 000000000..008b4e7a4 Binary files /dev/null and b/nwnds_module/ka_takeiron.ncs differ diff --git a/nwnds_module/ka_takeiron.nss b/nwnds_module/ka_takeiron.nss new file mode 100644 index 000000000..b1802acb8 --- /dev/null +++ b/nwnds_module/ka_takeiron.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.2 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="stoleniron") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +} diff --git a/nwnds_module/ka_takemartosahe.ncs b/nwnds_module/ka_takemartosahe.ncs new file mode 100644 index 000000000..e91424b69 Binary files /dev/null and b/nwnds_module/ka_takemartosahe.ncs differ diff --git a/nwnds_module/ka_takemartosahe.nss b/nwnds_module/ka_takemartosahe.nss new file mode 100644 index 000000000..c6cc1bca1 --- /dev/null +++ b/nwnds_module/ka_takemartosahe.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "martosahelm"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takeportek.ncs b/nwnds_module/ka_takeportek.ncs new file mode 100644 index 000000000..c00f8495c Binary files /dev/null and b/nwnds_module/ka_takeportek.ncs differ diff --git a/nwnds_module/ka_takeportek.nss b/nwnds_module/ka_takeportek.nss new file mode 100644 index 000000000..5dc7502c4 --- /dev/null +++ b/nwnds_module/ka_takeportek.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.2 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="QST_PORTEKSOUL") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +} diff --git a/nwnds_module/ka_takeprelude.ncs b/nwnds_module/ka_takeprelude.ncs new file mode 100644 index 000000000..5155608cf Binary files /dev/null and b/nwnds_module/ka_takeprelude.ncs differ diff --git a/nwnds_module/ka_takeprelude.nss b/nwnds_module/ka_takeprelude.nss new file mode 100644 index 000000000..fa836bf8a --- /dev/null +++ b/nwnds_module/ka_takeprelude.nss @@ -0,0 +1,28 @@ +object oItem; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.1 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "RikusUskadasWintersPrelude")!= OBJECT_INVALID) + { + oItem = GetItemPossessedBy(oPC, "RikusUskadasWintersPrelude"); + + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + + } +else + { + FloatingTextStringOnCreature("You must give Justl the axe to progress this quest.", oPC); + + } + +} diff --git a/nwnds_module/ka_takesapphire.ncs b/nwnds_module/ka_takesapphire.ncs new file mode 100644 index 000000000..3834b7ec2 Binary files /dev/null and b/nwnds_module/ka_takesapphire.ncs differ diff --git a/nwnds_module/ka_takesapphire.nss b/nwnds_module/ka_takesapphire.nss new file mode 100644 index 000000000..6f528d431 --- /dev/null +++ b/nwnds_module/ka_takesapphire.nss @@ -0,0 +1,28 @@ +object oItem; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.1 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_LG_SAPPHIRE")!= OBJECT_INVALID) + { + oItem = GetItemPossessedBy(oPC, "QST_LG_SAPPHIRE"); + + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + + } +else + { + FloatingTextStringOnCreature("You must give Justl the gem to progress this quest.", oPC); + + } + +} diff --git a/nwnds_module/ka_takesblood.ncs b/nwnds_module/ka_takesblood.ncs new file mode 100644 index 000000000..cd582ed46 Binary files /dev/null and b/nwnds_module/ka_takesblood.ncs differ diff --git a/nwnds_module/ka_takesblood.nss b/nwnds_module/ka_takesblood.nss new file mode 100644 index 000000000..5129b71e8 --- /dev/null +++ b/nwnds_module/ka_takesblood.nss @@ -0,0 +1,28 @@ +object oItem; +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.1 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "NW_IT_MSMLMISC17")!= OBJECT_INVALID) + { + oItem = GetItemPossessedBy(oPC, "NW_IT_MSMLMISC17"); + + if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + + } +else + { + FloatingTextStringOnCreature("You must give Justl the blood to progress this quest.", oPC); + + } + +} diff --git a/nwnds_module/ka_takeselenepac.ncs b/nwnds_module/ka_takeselenepac.ncs new file mode 100644 index 000000000..df1225fe9 Binary files /dev/null and b/nwnds_module/ka_takeselenepac.ncs differ diff --git a/nwnds_module/ka_takeselenepac.nss b/nwnds_module/ka_takeselenepac.nss new file mode 100644 index 000000000..9a7c9363a --- /dev/null +++ b/nwnds_module/ka_takeselenepac.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_SELENEPACK"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} + diff --git a/nwnds_module/ka_takeshademess.ncs b/nwnds_module/ka_takeshademess.ncs new file mode 100644 index 000000000..ab4be475d Binary files /dev/null and b/nwnds_module/ka_takeshademess.ncs differ diff --git a/nwnds_module/ka_takeshademess.nss b/nwnds_module/ka_takeshademess.nss new file mode 100644 index 000000000..10f91f664 --- /dev/null +++ b/nwnds_module/ka_takeshademess.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_SHADEMESSAGE"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} + diff --git a/nwnds_module/ka_takeshinbook.ncs b/nwnds_module/ka_takeshinbook.ncs new file mode 100644 index 000000000..1b70bf429 Binary files /dev/null and b/nwnds_module/ka_takeshinbook.ncs differ diff --git a/nwnds_module/ka_takeshinbook.nss b/nwnds_module/ka_takeshinbook.nss new file mode 100644 index 000000000..2b629a230 --- /dev/null +++ b/nwnds_module/ka_takeshinbook.nss @@ -0,0 +1,13 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_ITBK_LASTSEA"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takeshomkey.ncs b/nwnds_module/ka_takeshomkey.ncs new file mode 100644 index 000000000..b1891a564 Binary files /dev/null and b/nwnds_module/ka_takeshomkey.ncs differ diff --git a/nwnds_module/ka_takeshomkey.nss b/nwnds_module/ka_takeshomkey.nss new file mode 100644 index 000000000..76e62f58b --- /dev/null +++ b/nwnds_module/ka_takeshomkey.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "shomkey"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takeshomvalua.ncs b/nwnds_module/ka_takeshomvalua.ncs new file mode 100644 index 000000000..f43052b83 Binary files /dev/null and b/nwnds_module/ka_takeshomvalua.ncs differ diff --git a/nwnds_module/ka_takeshomvalua.nss b/nwnds_module/ka_takeshomvalua.nss new file mode 100644 index 000000000..87c575af5 --- /dev/null +++ b/nwnds_module/ka_takeshomvalua.nss @@ -0,0 +1,20 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_SHOMLOOT"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} + diff --git a/nwnds_module/ka_takesmeteor.ncs b/nwnds_module/ka_takesmeteor.ncs new file mode 100644 index 000000000..ef642d78a Binary files /dev/null and b/nwnds_module/ka_takesmeteor.ncs differ diff --git a/nwnds_module/ka_takesmeteor.nss b/nwnds_module/ka_takesmeteor.nss new file mode 100644 index 000000000..78464ee60 --- /dev/null +++ b/nwnds_module/ka_takesmeteor.nss @@ -0,0 +1,13 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_METEORITEORE"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} + diff --git a/nwnds_module/ka_takespirit.ncs b/nwnds_module/ka_takespirit.ncs new file mode 100644 index 000000000..6a70d3b23 Binary files /dev/null and b/nwnds_module/ka_takespirit.ncs differ diff --git a/nwnds_module/ka_takespirit.nss b/nwnds_module/ka_takespirit.nss new file mode 100644 index 000000000..61395fb5f --- /dev/null +++ b/nwnds_module/ka_takespirit.nss @@ -0,0 +1,23 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.2 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetFirstItemInInventory(oPC); + +while (GetIsObjectValid(oItem)) + { + if (GetTag(oItem)=="QST_MYSTSOUL") DestroyObject(oItem); + + oItem = GetNextItemInInventory(oPC); + } + +} diff --git a/nwnds_module/ka_takestatue.ncs b/nwnds_module/ka_takestatue.ncs new file mode 100644 index 000000000..2928cd10a Binary files /dev/null and b/nwnds_module/ka_takestatue.ncs differ diff --git a/nwnds_module/ka_takestatue.nss b/nwnds_module/ka_takestatue.nss new file mode 100644 index 000000000..a2fe3be3b --- /dev/null +++ b/nwnds_module/ka_takestatue.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_ANCIENTSTAT"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_takesupplies.ncs b/nwnds_module/ka_takesupplies.ncs new file mode 100644 index 000000000..18a8530ab Binary files /dev/null and b/nwnds_module/ka_takesupplies.ncs differ diff --git a/nwnds_module/ka_takesupplies.nss b/nwnds_module/ka_takesupplies.nss new file mode 100644 index 000000000..d2ec51428 --- /dev/null +++ b/nwnds_module/ka_takesupplies.nss @@ -0,0 +1,13 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "CaravanSupplies"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_tala.dlg b/nwnds_module/ka_tala.dlg new file mode 100644 index 000000000..491595042 Binary files /dev/null and b/nwnds_module/ka_tala.dlg differ diff --git a/nwnds_module/ka_talastore.ncs b/nwnds_module/ka_talastore.ncs new file mode 100644 index 000000000..239688b85 Binary files /dev/null and b/nwnds_module/ka_talastore.ncs differ diff --git a/nwnds_module/ka_talastore.nss b/nwnds_module/ka_talastore.nss new file mode 100644 index 000000000..d485492fa --- /dev/null +++ b/nwnds_module/ka_talastore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("TalaStore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_telula.dlg b/nwnds_module/ka_telula.dlg new file mode 100644 index 000000000..8c3077861 Binary files /dev/null and b/nwnds_module/ka_telula.dlg differ diff --git a/nwnds_module/ka_telulastore.ncs b/nwnds_module/ka_telulastore.ncs new file mode 100644 index 000000000..a2332fe98 Binary files /dev/null and b/nwnds_module/ka_telulastore.ncs differ diff --git a/nwnds_module/ka_telulastore.nss b/nwnds_module/ka_telulastore.nss new file mode 100644 index 000000000..912dc4d75 --- /dev/null +++ b/nwnds_module/ka_telulastore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("IbodsSpells"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_tempcommand.dlg b/nwnds_module/ka_tempcommand.dlg new file mode 100644 index 000000000..53b19279b Binary files /dev/null and b/nwnds_module/ka_tempcommand.dlg differ diff --git a/nwnds_module/ka_templarhunt.ncs b/nwnds_module/ka_templarhunt.ncs new file mode 100644 index 000000000..7a6940235 Binary files /dev/null and b/nwnds_module/ka_templarhunt.ncs differ diff --git a/nwnds_module/ka_templarhunt.nss b/nwnds_module/ka_templarhunt.nss new file mode 100644 index 000000000..cb2421264 --- /dev/null +++ b/nwnds_module/ka_templarhunt.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheTemplars"); + +if (!(nInt == 8)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_testhide.ncs b/nwnds_module/ka_testhide.ncs new file mode 100644 index 000000000..61c2970a1 Binary files /dev/null and b/nwnds_module/ka_testhide.ncs differ diff --git a/nwnds_module/ka_testhide.nss b/nwnds_module/ka_testhide.nss new file mode 100644 index 000000000..697999116 --- /dev/null +++ b/nwnds_module/ka_testhide.nss @@ -0,0 +1,4 @@ +void main() +{ + SetLocalInt(GetPCSpeaker(), "WOW_EQUIP_HIDE", TRUE); +} diff --git a/nwnds_module/ka_thiefdoor.dlg b/nwnds_module/ka_thiefdoor.dlg new file mode 100644 index 000000000..3d4dcdfaa Binary files /dev/null and b/nwnds_module/ka_thiefdoor.dlg differ diff --git a/nwnds_module/ka_tiredtraveler.ncs b/nwnds_module/ka_tiredtraveler.ncs new file mode 100644 index 000000000..3d8077a04 Binary files /dev/null and b/nwnds_module/ka_tiredtraveler.ncs differ diff --git a/nwnds_module/ka_tiredtraveler.nss b/nwnds_module/ka_tiredtraveler.nss new file mode 100644 index 000000000..50bc61608 --- /dev/null +++ b/nwnds_module/ka_tiredtraveler.nss @@ -0,0 +1,9 @@ +void main() +{ +TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); + +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_TIREDROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/ka_tooknecklace.ncs b/nwnds_module/ka_tooknecklace.ncs new file mode 100644 index 000000000..d99c98da0 Binary files /dev/null and b/nwnds_module/ka_tooknecklace.ncs differ diff --git a/nwnds_module/ka_tooknecklace.nss b/nwnds_module/ka_tooknecklace.nss new file mode 100644 index 000000000..606ee90bb --- /dev/null +++ b/nwnds_module/ka_tooknecklace.nss @@ -0,0 +1,13 @@ +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oItem; +oItem = GetItemPossessedBy(oPC, "QST_ITNCK_MIM"); + +if (GetIsObjectValid(oItem)) + DestroyObject(oItem); + +} diff --git a/nwnds_module/ka_tourikva.ncs b/nwnds_module/ka_tourikva.ncs new file mode 100644 index 000000000..e5185b9bb Binary files /dev/null and b/nwnds_module/ka_tourikva.ncs differ diff --git a/nwnds_module/ka_tourikva.nss b/nwnds_module/ka_tourikva.nss new file mode 100644 index 000000000..4c6088706 --- /dev/null +++ b/nwnds_module/ka_tourikva.nss @@ -0,0 +1,6 @@ +void main() +{ + + AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC),ActionJumpToLocation(GetLocation(GetWaypointByTag("TOURIKVA")))); + DelayCommand(10.0,SetLocked(OBJECT_SELF,TRUE)); +} diff --git a/nwnds_module/ka_ucil.dlg b/nwnds_module/ka_ucil.dlg new file mode 100644 index 000000000..9621038ac Binary files /dev/null and b/nwnds_module/ka_ucil.dlg differ diff --git a/nwnds_module/ka_ucilstore.ncs b/nwnds_module/ka_ucilstore.ncs new file mode 100644 index 000000000..169cce1a1 Binary files /dev/null and b/nwnds_module/ka_ucilstore.ncs differ diff --git a/nwnds_module/ka_ucilstore.nss b/nwnds_module/ka_ucilstore.nss new file mode 100644 index 000000000..7a17e02e2 --- /dev/null +++ b/nwnds_module/ka_ucilstore.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("STORE_GRIKS"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/ka_urikva1.ncs b/nwnds_module/ka_urikva1.ncs new file mode 100644 index 000000000..b2f08eefc Binary files /dev/null and b/nwnds_module/ka_urikva1.ncs differ diff --git a/nwnds_module/ka_urikva1.nss b/nwnds_module/ka_urikva1.nss new file mode 100644 index 000000000..7d43f0d40 --- /dev/null +++ b/nwnds_module/ka_urikva1.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "urikva") == 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/ka_urikva3.ncs b/nwnds_module/ka_urikva3.ncs new file mode 100644 index 000000000..5e342cdb2 Binary files /dev/null and b/nwnds_module/ka_urikva3.ncs differ diff --git a/nwnds_module/ka_urikva3.nss b/nwnds_module/ka_urikva3.nss new file mode 100644 index 000000000..c1cd0468a --- /dev/null +++ b/nwnds_module/ka_urikva3.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "urikva") == 3)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/ka_urikva5.ncs b/nwnds_module/ka_urikva5.ncs new file mode 100644 index 000000000..e2be97bdf Binary files /dev/null and b/nwnds_module/ka_urikva5.ncs differ diff --git a/nwnds_module/ka_urikva5.nss b/nwnds_module/ka_urikva5.nss new file mode 100644 index 000000000..7394a42d5 --- /dev/null +++ b/nwnds_module/ka_urikva5.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "urikva") == 5)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/ka_urikva7.ncs b/nwnds_module/ka_urikva7.ncs new file mode 100644 index 000000000..2883d889e Binary files /dev/null and b/nwnds_module/ka_urikva7.ncs differ diff --git a/nwnds_module/ka_urikva7.nss b/nwnds_module/ka_urikva7.nss new file mode 100644 index 000000000..5fb3dff6e --- /dev/null +++ b/nwnds_module/ka_urikva7.nss @@ -0,0 +1,12 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "urikva") == 7)) + return FALSE; + + + + return TRUE; +} + diff --git a/nwnds_module/ka_urikvachest.dlg b/nwnds_module/ka_urikvachest.dlg new file mode 100644 index 000000000..dedf61312 Binary files /dev/null and b/nwnds_module/ka_urikvachest.dlg differ diff --git a/nwnds_module/ka_urikvachest2.dlg b/nwnds_module/ka_urikvachest2.dlg new file mode 100644 index 000000000..0a00eb7b6 Binary files /dev/null and b/nwnds_module/ka_urikvachest2.dlg differ diff --git a/nwnds_module/ka_urikvaitem1.ncs b/nwnds_module/ka_urikvaitem1.ncs new file mode 100644 index 000000000..0aca55060 Binary files /dev/null and b/nwnds_module/ka_urikvaitem1.ncs differ diff --git a/nwnds_module/ka_urikvaitem1.nss b/nwnds_module/ka_urikvaitem1.nss new file mode 100644 index 000000000..2c30800fe --- /dev/null +++ b/nwnds_module/ka_urikvaitem1.nss @@ -0,0 +1,11 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("magiclimejuice", oPC); + +CreateItemOnObject("elixirofhealth", oPC); + +} + diff --git a/nwnds_module/ka_urikvaitem2.ncs b/nwnds_module/ka_urikvaitem2.ncs new file mode 100644 index 000000000..1524dc0f3 Binary files /dev/null and b/nwnds_module/ka_urikvaitem2.ncs differ diff --git a/nwnds_module/ka_urikvaitem2.nss b/nwnds_module/ka_urikvaitem2.nss new file mode 100644 index 000000000..f925da1b5 --- /dev/null +++ b/nwnds_module/ka_urikvaitem2.nss @@ -0,0 +1,12 @@ +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_VASPELLBOOK", oPC); // Veiled Spellbook + +CreateItemOnObject("nw_wmgwn004", oPC); // Wand of Missiles + + +} + diff --git a/nwnds_module/ka_urikvajump1.ncs b/nwnds_module/ka_urikvajump1.ncs new file mode 100644 index 000000000..d8ac4530e Binary files /dev/null and b/nwnds_module/ka_urikvajump1.ncs differ diff --git a/nwnds_module/ka_urikvajump1.nss b/nwnds_module/ka_urikvajump1.nss new file mode 100644 index 000000000..caca6cad2 --- /dev/null +++ b/nwnds_module/ka_urikvajump1.nss @@ -0,0 +1,39 @@ +string sDeny; +void main() +{ + +object oPC = GetEnteringObject(); + +if (!GetIsPC(oPC)) return; + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYurikva"); + +if (nInt == 3) + { + sDeny="The Templar Commander seems to be out on business at the moment."; + + SendMessageToPC(oPC, sDeny); + + return; + } + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("WP_KRONOSQUEST"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/ka_vaaligchk.ncs b/nwnds_module/ka_vaaligchk.ncs new file mode 100644 index 000000000..c45899741 Binary files /dev/null and b/nwnds_module/ka_vaaligchk.ncs differ diff --git a/nwnds_module/ka_vaaligchk.nss b/nwnds_module/ka_vaaligchk.nss new file mode 100644 index 000000000..7134ed39a --- /dev/null +++ b/nwnds_module/ka_vaaligchk.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_aligntest +//::////////////////////////////////////////////// + #include "fincludes" +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/3/2005 9:39:28 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's class + if(GetLevelByClass(CLASS_TYPE_SORCERER, GetPCSpeaker()) >= 1) + return FALSE; + if(GetLevelByClass(CLASS_TYPE_BLACKGUARD, GetPCSpeaker()) >= 1) + return FALSE; + + // Make sure the player has the required feats + if(GetHasFeat(FEAT_TEMPLAR_DOMAIN_POWER, GetPCSpeaker())) + return FALSE; + + // Restrict based on the player's alignment + if(GetAlignmentGoodEvil(GetPCSpeaker()) == ALIGNMENT_EVIL) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/ka_vaaligchk2.ncs b/nwnds_module/ka_vaaligchk2.ncs new file mode 100644 index 000000000..a45fb4b05 Binary files /dev/null and b/nwnds_module/ka_vaaligchk2.ncs differ diff --git a/nwnds_module/ka_vaaligchk2.nss b/nwnds_module/ka_vaaligchk2.nss new file mode 100644 index 000000000..7d9eadd17 --- /dev/null +++ b/nwnds_module/ka_vaaligchk2.nss @@ -0,0 +1,24 @@ +//:://///////////////////////////////////////////// +//:: FileName ka_aligntest +//::////////////////////////////////////////////// + #include "fincludes" +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/3/2005 9:39:28 AM +//::////////////////////////////////////////////// + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_BLACKGUARD, oPC)!=0)) +return FALSE; + +if (GetHasFeat(FEAT_TEMPLAR_DOMAIN_POWER, oPC)) return FALSE; + +if (GetAlignmentGoodEvil(oPC) != ALIGNMENT_EVIL) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_vfx_catacombs.ncs b/nwnds_module/ka_vfx_catacombs.ncs new file mode 100644 index 000000000..32eea726f Binary files /dev/null and b/nwnds_module/ka_vfx_catacombs.ncs differ diff --git a/nwnds_module/ka_vfx_catacombs.nss b/nwnds_module/ka_vfx_catacombs.nss new file mode 100644 index 000000000..98bee8d4d --- /dev/null +++ b/nwnds_module/ka_vfx_catacombs.nss @@ -0,0 +1,23 @@ +// +// NESS V8.1 +// +// Spawn sample onEnter +// +// If you want to use pseudo-heartbeats and do not already have an area onEnter +// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to +// your existing onEnter handler. Note that you use this (and +// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb. +// + +#include "spawn_functions" + +void main() +{ + // Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat + // script to execute, the heartbeat duration, and a delay for the first + // heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as + // if it were called like: + Spawn_OnAreaEnter( "ds_cw_heartbeat", 10.0, 0.0 ); + + //Spawn_OnAreaEnter(); +} diff --git a/nwnds_module/ka_vorax.dlg b/nwnds_module/ka_vorax.dlg new file mode 100644 index 000000000..7f99abb24 Binary files /dev/null and b/nwnds_module/ka_vorax.dlg differ diff --git a/nwnds_module/ka_voraxevidence.dlg b/nwnds_module/ka_voraxevidence.dlg new file mode 100644 index 000000000..a130391aa Binary files /dev/null and b/nwnds_module/ka_voraxevidence.dlg differ diff --git a/nwnds_module/ka_wandering.dlg b/nwnds_module/ka_wandering.dlg new file mode 100644 index 000000000..1f65f89ab Binary files /dev/null and b/nwnds_module/ka_wandering.dlg differ diff --git a/nwnds_module/ka_wanderingstor.ncs b/nwnds_module/ka_wanderingstor.ncs new file mode 100644 index 000000000..8c06d119b Binary files /dev/null and b/nwnds_module/ka_wanderingstor.ncs differ diff --git a/nwnds_module/ka_wanderingstor.nss b/nwnds_module/ka_wanderingstor.nss new file mode 100644 index 000000000..55c938f0d --- /dev/null +++ b/nwnds_module/ka_wanderingstor.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("wanderingstore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_watervendor.dlg b/nwnds_module/ka_watervendor.dlg new file mode 100644 index 000000000..e87e9c272 Binary files /dev/null and b/nwnds_module/ka_watervendor.dlg differ diff --git a/nwnds_module/ka_watervendor.ncs b/nwnds_module/ka_watervendor.ncs new file mode 100644 index 000000000..938a4b5f7 Binary files /dev/null and b/nwnds_module/ka_watervendor.ncs differ diff --git a/nwnds_module/ka_watervendor.nss b/nwnds_module/ka_watervendor.nss new file mode 100644 index 000000000..bebd0069d --- /dev/null +++ b/nwnds_module/ka_watervendor.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("WaterVendor"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} \ No newline at end of file diff --git a/nwnds_module/ka_weis.dlg b/nwnds_module/ka_weis.dlg new file mode 100644 index 000000000..7ee40666c Binary files /dev/null and b/nwnds_module/ka_weis.dlg differ diff --git a/nwnds_module/ka_weisgivedoc.ncs b/nwnds_module/ka_weisgivedoc.ncs new file mode 100644 index 000000000..6a158d265 Binary files /dev/null and b/nwnds_module/ka_weisgivedoc.ncs differ diff --git a/nwnds_module/ka_weisgivedoc.nss b/nwnds_module/ka_weisgivedoc.nss new file mode 100644 index 000000000..24836a539 --- /dev/null +++ b/nwnds_module/ka_weisgivedoc.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("qst_yehinadocs", oPC); + +} + diff --git a/nwnds_module/ka_wendel.dlg b/nwnds_module/ka_wendel.dlg new file mode 100644 index 000000000..c42310a5e Binary files /dev/null and b/nwnds_module/ka_wendel.dlg differ diff --git a/nwnds_module/ka_wik.dlg b/nwnds_module/ka_wik.dlg new file mode 100644 index 000000000..21df038a8 Binary files /dev/null and b/nwnds_module/ka_wik.dlg differ diff --git a/nwnds_module/ka_yalla.dlg b/nwnds_module/ka_yalla.dlg new file mode 100644 index 000000000..28e651387 Binary files /dev/null and b/nwnds_module/ka_yalla.dlg differ diff --git a/nwnds_module/ka_yehinaapprove.ncs b/nwnds_module/ka_yehinaapprove.ncs new file mode 100644 index 000000000..d624d4077 Binary files /dev/null and b/nwnds_module/ka_yehinaapprove.ncs differ diff --git a/nwnds_module/ka_yehinaapprove.nss b/nwnds_module/ka_yehinaapprove.nss new file mode 100644 index 000000000..56aac075f --- /dev/null +++ b/nwnds_module/ka_yehinaapprove.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "yehinaapproves", 1); + +} + diff --git a/nwnds_module/ka_yehinachk.ncs b/nwnds_module/ka_yehinachk.ncs new file mode 100644 index 000000000..d65c31870 Binary files /dev/null and b/nwnds_module/ka_yehinachk.ncs differ diff --git a/nwnds_module/ka_yehinachk.nss b/nwnds_module/ka_yehinachk.nss new file mode 100644 index 000000000..638513258 --- /dev/null +++ b/nwnds_module/ka_yehinachk.nss @@ -0,0 +1,24 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_DRUID, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_SORCERER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_WIZARD, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_PALEMASTER, oPC)!=0)|| + (GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0)) +return FALSE; + +if (GetAbilityScore(oPC, ABILITY_INTELLIGENCE, TRUE) < 11) return FALSE; + +if (GetAlignmentLawChaos(oPC) != ALIGNMENT_LAWFUL) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_yehinagivedoc.ncs b/nwnds_module/ka_yehinagivedoc.ncs new file mode 100644 index 000000000..ef310e311 Binary files /dev/null and b/nwnds_module/ka_yehinagivedoc.ncs differ diff --git a/nwnds_module/ka_yehinagivedoc.nss b/nwnds_module/ka_yehinagivedoc.nss new file mode 100644 index 000000000..8c283ccd3 --- /dev/null +++ b/nwnds_module/ka_yehinagivedoc.nss @@ -0,0 +1,16 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +CreateItemOnObject("QST_HIGHBUREAU01", oPC); + +} + diff --git a/nwnds_module/ka_yehinarejects.ncs b/nwnds_module/ka_yehinarejects.ncs new file mode 100644 index 000000000..97226e2d0 Binary files /dev/null and b/nwnds_module/ka_yehinarejects.ncs differ diff --git a/nwnds_module/ka_yehinarejects.nss b/nwnds_module/ka_yehinarejects.nss new file mode 100644 index 000000000..a68fdede0 --- /dev/null +++ b/nwnds_module/ka_yehinarejects.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "yehinarejected") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ka_yehinarwd.ncs b/nwnds_module/ka_yehinarwd.ncs new file mode 100644 index 000000000..1cff4c096 Binary files /dev/null and b/nwnds_module/ka_yehinarwd.ncs differ diff --git a/nwnds_module/ka_yehinarwd.nss b/nwnds_module/ka_yehinarwd.nss new file mode 100644 index 000000000..c375b38a2 --- /dev/null +++ b/nwnds_module/ka_yehinarwd.nss @@ -0,0 +1,24 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +RewardPartyXP(300, oPC, FALSE); + +RewardPartyGP(300, oPC, FALSE); + +CreateItemOnObject("FAC_ITPNCK_TYRTM", oPC); + +CreateItemOnObject("FAC_KEY_TYRTEMP", oPC); + +CreateItemOnObject("fac_helm_tyrtmp", oPC); + +} diff --git a/nwnds_module/ka_yehinasetno.ncs b/nwnds_module/ka_yehinasetno.ncs new file mode 100644 index 000000000..56f10b618 Binary files /dev/null and b/nwnds_module/ka_yehinasetno.ncs differ diff --git a/nwnds_module/ka_yehinasetno.nss b/nwnds_module/ka_yehinasetno.nss new file mode 100644 index 000000000..447c0a72b --- /dev/null +++ b/nwnds_module/ka_yehinasetno.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +SetLocalInt(oPC, "yehinarejected", 1); + +} diff --git a/nwnds_module/ka_zanthos.dlg b/nwnds_module/ka_zanthos.dlg new file mode 100644 index 000000000..ed257bd7d Binary files /dev/null and b/nwnds_module/ka_zanthos.dlg differ diff --git a/nwnds_module/ka_zyph.dlg b/nwnds_module/ka_zyph.dlg new file mode 100644 index 000000000..f72c0ac74 Binary files /dev/null and b/nwnds_module/ka_zyph.dlg differ diff --git a/nwnds_module/kaisharga001.utc b/nwnds_module/kaisharga001.utc new file mode 100644 index 000000000..9cad2db79 Binary files /dev/null and b/nwnds_module/kaisharga001.utc differ diff --git a/nwnds_module/kaisharga002.utc b/nwnds_module/kaisharga002.utc new file mode 100644 index 000000000..bb2a85850 Binary files /dev/null and b/nwnds_module/kaisharga002.utc differ diff --git a/nwnds_module/kaishargahide.uti b/nwnds_module/kaishargahide.uti new file mode 100644 index 000000000..6032390e0 Binary files /dev/null and b/nwnds_module/kaishargahide.uti differ diff --git a/nwnds_module/kaishargatouch.uti b/nwnds_module/kaishargatouch.uti new file mode 100644 index 000000000..d01e8226d Binary files /dev/null and b/nwnds_module/kaishargatouch.uti differ diff --git a/nwnds_module/kank002.utc b/nwnds_module/kank002.utc new file mode 100644 index 000000000..375aee019 Binary files /dev/null and b/nwnds_module/kank002.utc differ diff --git a/nwnds_module/kankbite.uti b/nwnds_module/kankbite.uti new file mode 100644 index 000000000..2077a62fd Binary files /dev/null and b/nwnds_module/kankbite.uti differ diff --git a/nwnds_module/kano_swmp_east.are b/nwnds_module/kano_swmp_east.are new file mode 100644 index 000000000..d5efd4e6f Binary files /dev/null and b/nwnds_module/kano_swmp_east.are differ diff --git a/nwnds_module/kano_swmp_east.gic b/nwnds_module/kano_swmp_east.gic new file mode 100644 index 000000000..2638d065e Binary files /dev/null and b/nwnds_module/kano_swmp_east.gic differ diff --git a/nwnds_module/kano_swmp_east.git b/nwnds_module/kano_swmp_east.git new file mode 100644 index 000000000..ffb4c25c5 Binary files /dev/null and b/nwnds_module/kano_swmp_east.git differ diff --git a/nwnds_module/kano_swmp_lowfen.are b/nwnds_module/kano_swmp_lowfen.are new file mode 100644 index 000000000..ddc660dbb Binary files /dev/null and b/nwnds_module/kano_swmp_lowfen.are differ diff --git a/nwnds_module/kano_swmp_lowfen.gic b/nwnds_module/kano_swmp_lowfen.gic new file mode 100644 index 000000000..f6bb817be Binary files /dev/null and b/nwnds_module/kano_swmp_lowfen.gic differ diff --git a/nwnds_module/kano_swmp_lowfen.git b/nwnds_module/kano_swmp_lowfen.git new file mode 100644 index 000000000..eb39c96db Binary files /dev/null and b/nwnds_module/kano_swmp_lowfen.git differ diff --git a/nwnds_module/kano_swmp_mouth.are b/nwnds_module/kano_swmp_mouth.are new file mode 100644 index 000000000..d8f8ef1de Binary files /dev/null and b/nwnds_module/kano_swmp_mouth.are differ diff --git a/nwnds_module/kano_swmp_mouth.gic b/nwnds_module/kano_swmp_mouth.gic new file mode 100644 index 000000000..acf721546 Binary files /dev/null and b/nwnds_module/kano_swmp_mouth.gic differ diff --git a/nwnds_module/kano_swmp_mouth.git b/nwnds_module/kano_swmp_mouth.git new file mode 100644 index 000000000..25f987697 Binary files /dev/null and b/nwnds_module/kano_swmp_mouth.git differ diff --git a/nwnds_module/kano_swmp_west.are b/nwnds_module/kano_swmp_west.are new file mode 100644 index 000000000..7c7c5cca4 Binary files /dev/null and b/nwnds_module/kano_swmp_west.are differ diff --git a/nwnds_module/kano_swmp_west.gic b/nwnds_module/kano_swmp_west.gic new file mode 100644 index 000000000..f9dd7e318 Binary files /dev/null and b/nwnds_module/kano_swmp_west.gic differ diff --git a/nwnds_module/kano_swmp_west.git b/nwnds_module/kano_swmp_west.git new file mode 100644 index 000000000..acf03e3dd Binary files /dev/null and b/nwnds_module/kano_swmp_west.git differ diff --git a/nwnds_module/kemalok_keep_001.are b/nwnds_module/kemalok_keep_001.are new file mode 100644 index 000000000..173dfa827 Binary files /dev/null and b/nwnds_module/kemalok_keep_001.are differ diff --git a/nwnds_module/kemalok_keep_001.gic b/nwnds_module/kemalok_keep_001.gic new file mode 100644 index 000000000..17e94d16e Binary files /dev/null and b/nwnds_module/kemalok_keep_001.gic differ diff --git a/nwnds_module/kemalok_keep_001.git b/nwnds_module/kemalok_keep_001.git new file mode 100644 index 000000000..2785b99f4 Binary files /dev/null and b/nwnds_module/kemalok_keep_001.git differ diff --git a/nwnds_module/kemalok_keep_002.are b/nwnds_module/kemalok_keep_002.are new file mode 100644 index 000000000..9428d0705 Binary files /dev/null and b/nwnds_module/kemalok_keep_002.are differ diff --git a/nwnds_module/kemalok_keep_002.gic b/nwnds_module/kemalok_keep_002.gic new file mode 100644 index 000000000..9b7a44dd3 Binary files /dev/null and b/nwnds_module/kemalok_keep_002.gic differ diff --git a/nwnds_module/kemalok_keep_002.git b/nwnds_module/kemalok_keep_002.git new file mode 100644 index 000000000..2a5af84c5 Binary files /dev/null and b/nwnds_module/kemalok_keep_002.git differ diff --git a/nwnds_module/kemalok_keep_dkc.are b/nwnds_module/kemalok_keep_dkc.are new file mode 100644 index 000000000..6c329318e Binary files /dev/null and b/nwnds_module/kemalok_keep_dkc.are differ diff --git a/nwnds_module/kemalok_keep_dkc.gic b/nwnds_module/kemalok_keep_dkc.gic new file mode 100644 index 000000000..277857eff Binary files /dev/null and b/nwnds_module/kemalok_keep_dkc.gic differ diff --git a/nwnds_module/kemalok_keep_dkc.git b/nwnds_module/kemalok_keep_dkc.git new file mode 100644 index 000000000..6e5b6e86d Binary files /dev/null and b/nwnds_module/kemalok_keep_dkc.git differ diff --git a/nwnds_module/kemalok_ruins01.are b/nwnds_module/kemalok_ruins01.are new file mode 100644 index 000000000..7cdbe9a3d Binary files /dev/null and b/nwnds_module/kemalok_ruins01.are differ diff --git a/nwnds_module/kemalok_ruins01.gic b/nwnds_module/kemalok_ruins01.gic new file mode 100644 index 000000000..d3934a7a3 Binary files /dev/null and b/nwnds_module/kemalok_ruins01.gic differ diff --git a/nwnds_module/kemalok_ruins01.git b/nwnds_module/kemalok_ruins01.git new file mode 100644 index 000000000..aa426b14a Binary files /dev/null and b/nwnds_module/kemalok_ruins01.git differ diff --git a/nwnds_module/kemalok_ruins02.are b/nwnds_module/kemalok_ruins02.are new file mode 100644 index 000000000..6e479dbae Binary files /dev/null and b/nwnds_module/kemalok_ruins02.are differ diff --git a/nwnds_module/kemalok_ruins02.gic b/nwnds_module/kemalok_ruins02.gic new file mode 100644 index 000000000..fadf58b50 Binary files /dev/null and b/nwnds_module/kemalok_ruins02.gic differ diff --git a/nwnds_module/kemalok_ruins02.git b/nwnds_module/kemalok_ruins02.git new file mode 100644 index 000000000..c90fc48bd Binary files /dev/null and b/nwnds_module/kemalok_ruins02.git differ diff --git a/nwnds_module/kestrekel001.utc b/nwnds_module/kestrekel001.utc new file mode 100644 index 000000000..821b9ee65 Binary files /dev/null and b/nwnds_module/kestrekel001.utc differ diff --git a/nwnds_module/key_kronos.uti b/nwnds_module/key_kronos.uti new file mode 100644 index 000000000..284633ad4 Binary files /dev/null and b/nwnds_module/key_kronos.uti differ diff --git a/nwnds_module/key_silverspring.uti b/nwnds_module/key_silverspring.uti new file mode 100644 index 000000000..4bcf4fe67 Binary files /dev/null and b/nwnds_module/key_silverspring.uti differ diff --git a/nwnds_module/kirre001.utc b/nwnds_module/kirre001.utc new file mode 100644 index 000000000..36bf9d204 Binary files /dev/null and b/nwnds_module/kirre001.utc differ diff --git a/nwnds_module/kirre002.utc b/nwnds_module/kirre002.utc new file mode 100644 index 000000000..39d3cc55d Binary files /dev/null and b/nwnds_module/kirre002.utc differ diff --git a/nwnds_module/kirre003.utc b/nwnds_module/kirre003.utc new file mode 100644 index 000000000..b7364b289 Binary files /dev/null and b/nwnds_module/kirre003.utc differ diff --git a/nwnds_module/kit_heal_1_001.uti b/nwnds_module/kit_heal_1_001.uti new file mode 100644 index 000000000..faea4551f Binary files /dev/null and b/nwnds_module/kit_heal_1_001.uti differ diff --git a/nwnds_module/kit_heal_1_002.uti b/nwnds_module/kit_heal_1_002.uti new file mode 100644 index 000000000..1e4f67753 Binary files /dev/null and b/nwnds_module/kit_heal_1_002.uti differ diff --git a/nwnds_module/kit_heal_2_001.uti b/nwnds_module/kit_heal_2_001.uti new file mode 100644 index 000000000..b8d8330f4 Binary files /dev/null and b/nwnds_module/kit_heal_2_001.uti differ diff --git a/nwnds_module/kit_heal_2_002.uti b/nwnds_module/kit_heal_2_002.uti new file mode 100644 index 000000000..cc86107e4 Binary files /dev/null and b/nwnds_module/kit_heal_2_002.uti differ diff --git a/nwnds_module/kit_heal_2_003.uti b/nwnds_module/kit_heal_2_003.uti new file mode 100644 index 000000000..1329a0806 Binary files /dev/null and b/nwnds_module/kit_heal_2_003.uti differ diff --git a/nwnds_module/kit_heal_3_001.uti b/nwnds_module/kit_heal_3_001.uti new file mode 100644 index 000000000..a87bcf6a7 Binary files /dev/null and b/nwnds_module/kit_heal_3_001.uti differ diff --git a/nwnds_module/kit_heal_3_002.uti b/nwnds_module/kit_heal_3_002.uti new file mode 100644 index 000000000..14183deeb Binary files /dev/null and b/nwnds_module/kit_heal_3_002.uti differ diff --git a/nwnds_module/kit_heal_3_003.uti b/nwnds_module/kit_heal_3_003.uti new file mode 100644 index 000000000..06f888caa Binary files /dev/null and b/nwnds_module/kit_heal_3_003.uti differ diff --git a/nwnds_module/kit_heal_4_001.uti b/nwnds_module/kit_heal_4_001.uti new file mode 100644 index 000000000..0cc41ea54 Binary files /dev/null and b/nwnds_module/kit_heal_4_001.uti differ diff --git a/nwnds_module/kit_heal_4_002.uti b/nwnds_module/kit_heal_4_002.uti new file mode 100644 index 000000000..649922a0a Binary files /dev/null and b/nwnds_module/kit_heal_4_002.uti differ diff --git a/nwnds_module/kit_heal_4_003.uti b/nwnds_module/kit_heal_4_003.uti new file mode 100644 index 000000000..4dd0b3c8d Binary files /dev/null and b/nwnds_module/kit_heal_4_003.uti differ diff --git a/nwnds_module/kivit001.utc b/nwnds_module/kivit001.utc new file mode 100644 index 000000000..e7428271b Binary files /dev/null and b/nwnds_module/kivit001.utc differ diff --git a/nwnds_module/kivitclaw.uti b/nwnds_module/kivitclaw.uti new file mode 100644 index 000000000..5c76f0f02 Binary files /dev/null and b/nwnds_module/kivitclaw.uti differ diff --git a/nwnds_module/klar001.utc b/nwnds_module/klar001.utc new file mode 100644 index 000000000..01baa0258 Binary files /dev/null and b/nwnds_module/klar001.utc differ diff --git a/nwnds_module/klarhide001.uti b/nwnds_module/klarhide001.uti new file mode 100644 index 000000000..d5255dc73 Binary files /dev/null and b/nwnds_module/klarhide001.uti differ diff --git a/nwnds_module/kled.are b/nwnds_module/kled.are new file mode 100644 index 000000000..e296f922b Binary files /dev/null and b/nwnds_module/kled.are differ diff --git a/nwnds_module/kled.gic b/nwnds_module/kled.gic new file mode 100644 index 000000000..223bae2b4 Binary files /dev/null and b/nwnds_module/kled.gic differ diff --git a/nwnds_module/kled.git b/nwnds_module/kled.git new file mode 100644 index 000000000..d085cade7 Binary files /dev/null and b/nwnds_module/kled.git differ diff --git a/nwnds_module/kled_alehouse.are b/nwnds_module/kled_alehouse.are new file mode 100644 index 000000000..8e29a3c0c Binary files /dev/null and b/nwnds_module/kled_alehouse.are differ diff --git a/nwnds_module/kled_alehouse.gic b/nwnds_module/kled_alehouse.gic new file mode 100644 index 000000000..ce1edde1e Binary files /dev/null and b/nwnds_module/kled_alehouse.gic differ diff --git a/nwnds_module/kled_alehouse.git b/nwnds_module/kled_alehouse.git new file mode 100644 index 000000000..e2fa1257b Binary files /dev/null and b/nwnds_module/kled_alehouse.git differ diff --git a/nwnds_module/kled_anvilfoyer.are b/nwnds_module/kled_anvilfoyer.are new file mode 100644 index 000000000..bc534111f Binary files /dev/null and b/nwnds_module/kled_anvilfoyer.are differ diff --git a/nwnds_module/kled_anvilfoyer.gic b/nwnds_module/kled_anvilfoyer.gic new file mode 100644 index 000000000..0d62dffe9 Binary files /dev/null and b/nwnds_module/kled_anvilfoyer.gic differ diff --git a/nwnds_module/kled_anvilfoyer.git b/nwnds_module/kled_anvilfoyer.git new file mode 100644 index 000000000..e238a22e1 Binary files /dev/null and b/nwnds_module/kled_anvilfoyer.git differ diff --git a/nwnds_module/kled_healers.are b/nwnds_module/kled_healers.are new file mode 100644 index 000000000..46d2f5a0e Binary files /dev/null and b/nwnds_module/kled_healers.are differ diff --git a/nwnds_module/kled_healers.gic b/nwnds_module/kled_healers.gic new file mode 100644 index 000000000..0594955ec Binary files /dev/null and b/nwnds_module/kled_healers.gic differ diff --git a/nwnds_module/kled_healers.git b/nwnds_module/kled_healers.git new file mode 100644 index 000000000..9a8fd08df Binary files /dev/null and b/nwnds_module/kled_healers.git differ diff --git a/nwnds_module/kled_houseofsun.are b/nwnds_module/kled_houseofsun.are new file mode 100644 index 000000000..113f68c92 Binary files /dev/null and b/nwnds_module/kled_houseofsun.are differ diff --git a/nwnds_module/kled_houseofsun.gic b/nwnds_module/kled_houseofsun.gic new file mode 100644 index 000000000..191568248 Binary files /dev/null and b/nwnds_module/kled_houseofsun.gic differ diff --git a/nwnds_module/kled_houseofsun.git b/nwnds_module/kled_houseofsun.git new file mode 100644 index 000000000..6af6ebc4a Binary files /dev/null and b/nwnds_module/kled_houseofsun.git differ diff --git a/nwnds_module/kled_mines001.are b/nwnds_module/kled_mines001.are new file mode 100644 index 000000000..270604135 Binary files /dev/null and b/nwnds_module/kled_mines001.are differ diff --git a/nwnds_module/kled_mines001.gic b/nwnds_module/kled_mines001.gic new file mode 100644 index 000000000..6dcbf9cba Binary files /dev/null and b/nwnds_module/kled_mines001.gic differ diff --git a/nwnds_module/kled_mines001.git b/nwnds_module/kled_mines001.git new file mode 100644 index 000000000..e78f76fb2 Binary files /dev/null and b/nwnds_module/kled_mines001.git differ diff --git a/nwnds_module/kled_mines002.are b/nwnds_module/kled_mines002.are new file mode 100644 index 000000000..73b8fc5c3 Binary files /dev/null and b/nwnds_module/kled_mines002.are differ diff --git a/nwnds_module/kled_mines002.gic b/nwnds_module/kled_mines002.gic new file mode 100644 index 000000000..7be58efac Binary files /dev/null and b/nwnds_module/kled_mines002.gic differ diff --git a/nwnds_module/kled_mines002.git b/nwnds_module/kled_mines002.git new file mode 100644 index 000000000..ddf95acc8 Binary files /dev/null and b/nwnds_module/kled_mines002.git differ diff --git a/nwnds_module/kled_mines003.are b/nwnds_module/kled_mines003.are new file mode 100644 index 000000000..c72ab2ce4 Binary files /dev/null and b/nwnds_module/kled_mines003.are differ diff --git a/nwnds_module/kled_mines003.gic b/nwnds_module/kled_mines003.gic new file mode 100644 index 000000000..56263925b Binary files /dev/null and b/nwnds_module/kled_mines003.gic differ diff --git a/nwnds_module/kled_mines003.git b/nwnds_module/kled_mines003.git new file mode 100644 index 000000000..06e28cde2 Binary files /dev/null and b/nwnds_module/kled_mines003.git differ diff --git a/nwnds_module/kled_mines004.are b/nwnds_module/kled_mines004.are new file mode 100644 index 000000000..77780a14e Binary files /dev/null and b/nwnds_module/kled_mines004.are differ diff --git a/nwnds_module/kled_mines004.gic b/nwnds_module/kled_mines004.gic new file mode 100644 index 000000000..e6a29ad48 Binary files /dev/null and b/nwnds_module/kled_mines004.gic differ diff --git a/nwnds_module/kled_mines004.git b/nwnds_module/kled_mines004.git new file mode 100644 index 000000000..727c1e157 Binary files /dev/null and b/nwnds_module/kled_mines004.git differ diff --git a/nwnds_module/kled_nadies.are b/nwnds_module/kled_nadies.are new file mode 100644 index 000000000..14bb87c9a Binary files /dev/null and b/nwnds_module/kled_nadies.are differ diff --git a/nwnds_module/kled_nadies.gic b/nwnds_module/kled_nadies.gic new file mode 100644 index 000000000..23a1e2695 Binary files /dev/null and b/nwnds_module/kled_nadies.gic differ diff --git a/nwnds_module/kled_nadies.git b/nwnds_module/kled_nadies.git new file mode 100644 index 000000000..8b7833c57 Binary files /dev/null and b/nwnds_module/kled_nadies.git differ diff --git a/nwnds_module/kled_village.are b/nwnds_module/kled_village.are new file mode 100644 index 000000000..82998cacf Binary files /dev/null and b/nwnds_module/kled_village.are differ diff --git a/nwnds_module/kled_village.gic b/nwnds_module/kled_village.gic new file mode 100644 index 000000000..98e9dea85 Binary files /dev/null and b/nwnds_module/kled_village.gic differ diff --git a/nwnds_module/kled_village.git b/nwnds_module/kled_village.git new file mode 100644 index 000000000..a86997f37 Binary files /dev/null and b/nwnds_module/kled_village.git differ diff --git a/nwnds_module/kled_weaver.are b/nwnds_module/kled_weaver.are new file mode 100644 index 000000000..5baf1365b Binary files /dev/null and b/nwnds_module/kled_weaver.are differ diff --git a/nwnds_module/kled_weaver.gic b/nwnds_module/kled_weaver.gic new file mode 100644 index 000000000..836d034c9 Binary files /dev/null and b/nwnds_module/kled_weaver.gic differ diff --git a/nwnds_module/kled_weaver.git b/nwnds_module/kled_weaver.git new file mode 100644 index 000000000..127059432 Binary files /dev/null and b/nwnds_module/kled_weaver.git differ diff --git a/nwnds_module/kledsaltmines.are b/nwnds_module/kledsaltmines.are new file mode 100644 index 000000000..95240ac17 Binary files /dev/null and b/nwnds_module/kledsaltmines.are differ diff --git a/nwnds_module/kledsaltmines.gic b/nwnds_module/kledsaltmines.gic new file mode 100644 index 000000000..aae133012 Binary files /dev/null and b/nwnds_module/kledsaltmines.gic differ diff --git a/nwnds_module/kledsaltmines.git b/nwnds_module/kledsaltmines.git new file mode 100644 index 000000000..9637084a6 Binary files /dev/null and b/nwnds_module/kledsaltmines.git differ diff --git a/nwnds_module/krag_fire001.utc b/nwnds_module/krag_fire001.utc new file mode 100644 index 000000000..bf07135cb Binary files /dev/null and b/nwnds_module/krag_fire001.utc differ diff --git a/nwnds_module/krag_infusion.ncs b/nwnds_module/krag_infusion.ncs new file mode 100644 index 000000000..e4deb9795 Binary files /dev/null and b/nwnds_module/krag_infusion.ncs differ diff --git a/nwnds_module/krag_infusion.nss b/nwnds_module/krag_infusion.nss new file mode 100644 index 000000000..711bb1959 --- /dev/null +++ b/nwnds_module/krag_infusion.nss @@ -0,0 +1,175 @@ +//:: +//:: Fire_Infusion +//:: +//:: A pnp version of the Fire Krag's elemental infusion attack. +//:: +//:: Modified by: DM Heatstroke 02-07-12 +//:: + +/* +Elemental Infusion (Su): The victim of a krag’s bite must make +a Fortitude save ( DC 18) or become cursed with a painful and fast-spreading +elemental transformation. The creature suffers 1d6 +points of damage per round until it dies or is cured. The type of +damage varies by krag: acid damage for earth and silt; cold +damage for water; electricity damage for air and rain; and fire +damage for fire, magma, and sun. A remove curse or heal spell stops +the infusion. The save DC is Charisma-based. +*/ + +/* +I think those spells should be affected by this ability - duration will be decreased with every HB +SPELL_PROTECTION_FROM_ELEMENTS +SPELL_ELEMENTAL_SHIELD +SPELL_ENDURE_ELEMENTS +SPELL_ENERGY_BUFFER +SPELL_RESIST_ELEMENTS + +I'm almost sure this one is checked in MySavingThrow() +FEAT_DRAGON_IMMUNE_FIRE + +And I'm pretty sure creatures will die from damage, so do you really need that kill check? + +*/ + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +int GetIsImmuneToInfusion(object oTarget, int nDamage) +{ + if(nDamage == DAMAGE_TYPE_ACID) + { + return GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ACID_10, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ACID_9, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ACID_8, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ACID_7, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ACID_6, oTarget); + } + else if(nDamage == DAMAGE_TYPE_COLD) + { + return GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_COLD_10, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_COLD_9, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_COLD_8, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_COLD_7, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_COLD_6, oTarget); + } + else if(nDamage == DAMAGE_TYPE_ELECTRICAL) + { + return GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_10, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_9, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_8, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_7, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_ELECTRICAL_6, oTarget); + } + else if(nDamage == DAMAGE_TYPE_FIRE) + { + return GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_FIRE_10, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_FIRE_9, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_FIRE_8, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_FIRE_7, oTarget) + || GetHasFeat(FEAT_EPIC_ENERGY_RESISTANCE_FIRE_6, oTarget) + || GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oTarget); + } + return FALSE; +} + +void DoBurn(object oCaster, object oTarget, int nDamage, int nSaveType, int nVfx) +{ + if(!GetIsObjectValid(oTarget) || !GetIsObjectValid(oCaster)) + return; + + if(GetIsImmuneToInfusion(oTarget, nDamage)) + { + DeleteLocalInt(oTarget, "krags_infusion"); + return; + } + + if(GetLocalInt(oTarget,"krags_infusion")) + { + // Normally Elemental Infusion can only be removed by Remove Curse or Heal, not by + // making saving throws + if(GetGameDifficulty() < GAME_DIFFICULTY_CORE_RULES && GetIsPC(oTarget)) + { + if(MySavingThrow(SAVING_THROW_FORT, oTarget, 18, nSaveType)) + { + DeleteLocalInt(oTarget, "krags_infusion"); + SendMessageToPC(oTarget,"Recovered from Krag's Infusion."); + } + else + { + //Apply damage for this round + effect eBurn = EffectDamage(d6(), nDamage, DAMAGE_POWER_ENERGY); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBurn, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVfx), oTarget); + DelayCommand(6.0f, DoBurn(oCaster, oTarget, nDamage, nSaveType, nVfx)); + } + } + else//apply damage without saving throw + { + int nDam = d6(); + if((GetCurrentHitPoints(oTarget) - nDam) < -9) + { + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVfx), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + else + { + //Apply damage for this round + effect eBurn = EffectDamage(d6(), nDamage, DAMAGE_POWER_ENERGY); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBurn, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVfx), oTarget); + DelayCommand(6.0f, DoBurn(oCaster, oTarget, nDamage, nSaveType, nVfx)); + } + } + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + string sDamage = GetLocalString(oCaster, "KragType"); + + int nDamage, nSaveType, nVfx; + if(sDamage == "acid") + { + nDamage = DAMAGE_TYPE_ACID; + nSaveType = SAVING_THROW_TYPE_ACID; + nVfx = VFX_IMP_ACID_S; + } + else if(sDamage == "cold") + { + nDamage = DAMAGE_TYPE_COLD; + nSaveType = SAVING_THROW_TYPE_COLD; + nVfx = VFX_IMP_FROST_S; + } + else if(sDamage == "electricity") + { + nDamage = DAMAGE_TYPE_ELECTRICAL; + nSaveType = SAVING_THROW_TYPE_ELECTRICITY; + nVfx = VFX_IMP_LIGHTNING_S; + } + else //if(sDamage == "fire") + { + nDamage = DAMAGE_TYPE_FIRE; + nSaveType = SAVING_THROW_TYPE_FIRE; + nVfx = VFX_IMP_FLAME_S; + } + + if(!GetLocalInt(oTarget, "krags_infusion") && !GetIsImmuneToInfusion(oTarget, nDamage)) + { + if(!MySavingThrow(SAVING_THROW_FORT, oTarget, 18, nSaveType)) + { + SetLocalInt(oTarget, "krags_infusion", 1); + //Apply damage for first round + effect eBurn = EffectDamage(d6(), nDamage, DAMAGE_POWER_ENERGY); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBurn, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVfx), oTarget); + //start pseudo heartbeat + DelayCommand(6.0f, DoBurn(oCaster, oTarget, nDamage, nSaveType, nVfx)); + } + } +} diff --git a/nwnds_module/kragling_f001.utc b/nwnds_module/kragling_f001.utc new file mode 100644 index 000000000..2f0b11356 Binary files /dev/null and b/nwnds_module/kragling_f001.utc differ diff --git a/nwnds_module/krensharhide.uti b/nwnds_module/krensharhide.uti new file mode 100644 index 000000000..e3c3a8d7b Binary files /dev/null and b/nwnds_module/krensharhide.uti differ diff --git a/nwnds_module/krikiks_village.are b/nwnds_module/krikiks_village.are new file mode 100644 index 000000000..b162e5ae0 Binary files /dev/null and b/nwnds_module/krikiks_village.are differ diff --git a/nwnds_module/krikiks_village.gic b/nwnds_module/krikiks_village.gic new file mode 100644 index 000000000..3fe2c35e9 Binary files /dev/null and b/nwnds_module/krikiks_village.gic differ diff --git a/nwnds_module/krikiks_village.git b/nwnds_module/krikiks_village.git new file mode 100644 index 000000000..305c01f56 Binary files /dev/null and b/nwnds_module/krikiks_village.git differ diff --git a/nwnds_module/kt_c2_default4.ncs b/nwnds_module/kt_c2_default4.ncs new file mode 100644 index 000000000..3264b3ded Binary files /dev/null and b/nwnds_module/kt_c2_default4.ncs differ diff --git a/nwnds_module/kt_c2_default4.nss b/nwnds_module/kt_c2_default4.nss new file mode 100644 index 000000000..3d05820cb --- /dev/null +++ b/nwnds_module/kt_c2_default4.nss @@ -0,0 +1,103 @@ +//:://///////////////////////////////////////////// +//:: SetListeningPatterns + kill tasks +//:: kt_c2_default4 (nw_c2_default4) +//:: Copyright (c) 2001. +//::////////////////////////////////////////////// +/* +Determines the course of action to be taken +by the generic script after dialogue or a +shout is initiated. + +Also checks for completion of a Kill task. +*/ +//::////////////////////////////////////////////// +//:: Created By: Paul Rowland +//:: Created On: July 24, 2002 +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" +void main() +{ + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + object oIntruder; + + ////////// kill task code insert here//////////////////////// + + // On detecting a player that has entered dialog with the NPC (this), and + // has the 'Kill_task' variable atatched to itself equal '2', complete. Then + // reset variables, delete journal entry and award experience. + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if(GetLocalInt(oPC, "KILL_TASK_FLAG") == 2) + { + SetLocalInt(oPC, "KILL_TASK_FLAG", 0); + RemoveJournalQuestEntry("kt_journal_01", oPC); + GiveXPToCreature(oPC, 250); + GiveGoldToCreature(oPC, 75); + ActionSpeakString("Here is your reward."); + // If we grabed a copy of the creatures 'sTemplate' and 'lLocaction' when + // asigning the task, we could re-spawn the creature back by using the + // CreateObject() function. Creature managment is a bit out of scope for + // this example. + SetLocalString(oPC, "KILL_TASK_TARGET", ""); + } + + // On detecting a player that has entered dialog with the NPC (this), and + // has the 'Kill_task' variable atatched to itself equal '2', complete. Then + // reset variables, delete journal entry and award experience. + //object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if(GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 2) + { + SetLocalInt(oPC, "DELIVERY_TASK_FLAG", 0); + RemoveJournalQuestEntry("kt_journal_02", oPC); + RemoveJournalQuestEntry("kt_journal_03", oPC); + GiveXPToCreature(oPC, 100); + GiveGoldToCreature(oPC, 50); + ActionSpeakString("Here is your reward."); + // If we grabed a copy of the creatures 'sTemplate' and 'lLocaction' when + // asigning the task, we could re-spawn the creature back by using the + // CreateObject() function. Creature managment is a bit out of scope for + // this example. + SetLocalString(oPC, "DELIVERY_TASK_TARGET", ""); + SetLocalString(oPC, "DELIVERY_TASK_ITEM", ""); + } + + + ////////// kill task code end here//////////////////////// + + if (nMatch == -1 && GetCommandable(OBJECT_SELF)) + { + ClearAllActions(); + BeginConversation(); + } + else if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter)) + { + if(nMatch == 4) + { + oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER"); + } + else if (nMatch == 5) + { + oIntruder = GetLastHostileActor(oShouter); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedAttackTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedSpellTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = OBJECT_INVALID; + } + } + } + } + RespondToShout(oShouter, nMatch, oIntruder); + } + + + if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1004)); + } +} diff --git a/nwnds_module/kt_conver_01.ncs b/nwnds_module/kt_conver_01.ncs new file mode 100644 index 000000000..1fd86468d Binary files /dev/null and b/nwnds_module/kt_conver_01.ncs differ diff --git a/nwnds_module/kt_conver_01.nss b/nwnds_module/kt_conver_01.nss new file mode 100644 index 000000000..4e3085fcf --- /dev/null +++ b/nwnds_module/kt_conver_01.nss @@ -0,0 +1,153 @@ +//:://///////////////////////////////////////////// +//:: FileName kt_conver_01 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Paul Rowland +//:: Created On: 25/07/2002 18:51:59 +//:: +// ** If your Journal entry is called 'kt_journal_01', then the only change to +// ** this script should be the creature TAG's in the CASE statement to match the +// ** creatures in your module. +// ** The random number should reflect the number of TAG's in the list +// ** also. +//Journal entry notes: +//Under the 'Other Actions' tab, enter a Journal entry to the +//converstaion entitled 'Kill Tasks' and a tag of 'kt_journal_01'. +//The Journal tag must be the same name as the script on the creatures +//'OnDeath' script and the NPC's (this) 'OnConversation' script. +//For each creature Tag entry in the CASE statment below, a journal entry +//under the 'Kill tasks' category must exist, ie +//+ Kill Tasks +// [0001]- You have been asked to search the South and kill an Orc. +// [0002]- You have been asked to go into the Caves and kill a Goblin. +// [----]- etc. +// [0099]- You have completed the task, return for your reward +// +//The journal entry ID's must be the same as the number in the CASE statment. +//There dosn't seem to be a way of entering custom tokens or variables +//to a Journal via any of the Journal Functions supplied by Bioware. +// +//I have tried to keep this example as simple as possible, below are a list +//of improvements you can easily implement once you've got it up and running +//in your own module. +//Enhancement Notes: +// 1) Time expiriy on tasks +// Set up a counter in the OnHeartbeat{} of NPC (this), and check +// in the OnConversation() of NPC (this) when PC returns. +// 2) Fail task if PC dies +// Set 'KILL_TASK_FLAG' to zero in the OnDeath() of the PC. +// 3) Re-spawn the slain creature on completion of task. +// Grab a copy of the creatures 'sTemplate' and 'lLocation' below. +// Then use the CreateObject() function when the PC completes the +// task in the 'OnConversation()' of the NPC (this). +// The module where this example has been derived uses a MMORPG style +// 'creature management' script, and therefore is out of scope here. +// 4) Handle players of all levels, 1-20 +// add additional SWITCH blocks inside the CASE's of the existing SWITCH block +// allowing a choice of 4, one for each level group, 1-5, 6-10, 11-15 & 16 -20 +// Use the GetCharacterLevel(). +//::////////////////////////////////////////////// +void main() +{ + // set up local work variables + object oPC = GetPCSpeaker(); + int nHD = GetHitDice(oPC); + string sKillTarget, sKillName; + int nRandom; + int found = FALSE; // whats wrong with this language, no boolean!! + int loop = 0; + if (GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1) + { + ActionSpeakString("You already have a task."); + } + else + { + // keep re-rolling if creature TAG not found and try another , stop + // after 10 or so trys just incase no creatures at all exist on + // list, at least we tried + while (!found) + { + nRandom = d6(); + SetLocalString(oPC, "KILL_TASK_NPC", GetName(OBJECT_SELF)); + + // asign random kill target creature TAGs + if (nHD < 10) + { + switch(nRandom) + { + case 1: + sKillTarget = "GOLD_SCORP001"; + sKillName = "Gold Scorpion"; + break; + case 2: + sKillTarget = "DIRERAT_001"; + sKillName = "Dire Rat"; + break; + case 3: + sKillTarget = "MAGERA_001"; + sKillName = "Magera"; + break; + case 4: + sKillTarget = "GNTWOLFSPIDER001"; + sKillName = "Giant Wolf Spider"; + break; + case 5: + sKillTarget = "SKELETONGIANT001"; + sKillName = "Skeletal half-giant"; + break; + case 6: + sKillTarget = "SANDHOWLER001"; + sKillName = "Sandhowler"; + break; + case 7: + sKillTarget = "HUMANBANDIT_002"; + sKillName = "Psionic Bandit"; + break; + case 8: + sKillTarget = "AR_DAGGORAN_001"; + sKillName = "Daggoran"; + break; + case 9: + sKillTarget = "DARKSPIDER001"; + sKillName = "Dark Spider Warrior"; + break; + case 10: + sKillTarget = "HALFBANDIT_001"; + sKillName = "Halfling Bandit"; + break; + } + } // if + SetLocalString(oPC, "KILL_TASK_TARGET", sKillTarget); + + // check to see if we have a valid target, if not then creature + // dosn't exist in module, may have all been killed before + if(GetStringLength(GetName(GetObjectByTag(sKillTarget))) > 0) + { + found = TRUE; + } + // not found really, but must end looping, tried 10 different creatures, + // maybe the module designer forgot to put any in? + if ((loop > 10) || (nHD > 9)) + { + ActionSpeakString("I have no more tasks for you. Leave me alone."); + return; + } + loop++; + } + + + // acknowledge setting of task + if (GetLocalInt(oPC, "KILL_TASK_FLAG") == 1) + { + ActionSpeakString("You already have a task."); + } + else + { + ActionSpeakString("Your task is to kill a " + sKillName + " good luck and dont forget to return to me for your reward!"); + // set the kill task varable + SetLocalInt(oPC, "KILL_TASK_FLAG", 1); + // journal entry + AddJournalQuestEntry("kt_journal_01", nRandom, oPC); + } + } +} diff --git a/nwnds_module/kt_conver_02.ncs b/nwnds_module/kt_conver_02.ncs new file mode 100644 index 000000000..e27de20b8 Binary files /dev/null and b/nwnds_module/kt_conver_02.ncs differ diff --git a/nwnds_module/kt_conver_02.nss b/nwnds_module/kt_conver_02.nss new file mode 100644 index 000000000..7ddcc3f25 --- /dev/null +++ b/nwnds_module/kt_conver_02.nss @@ -0,0 +1,208 @@ +//:://///////////////////////////////////////////// +//:: FileName kt_conver_01 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Paul Rowland +//:: Created On: 25/07/2002 18:51:59 +//:: +// ** If your Journal entry is called 'kt_journal_01', then the only change to +// ** this script should be the creature TAG's in the CASE statement to match the +// ** creatures in your module. +// ** The random number should reflect the number of TAG's in the list +// ** also. +//Journal entry notes: +//Under the 'Other Actions' tab, enter a Journal entry to the +//converstaion entitled 'Kill Tasks' and a tag of 'kt_journal_01'. +//The Journal tag must be the same name as the script on the creatures +//'OnDeath' script and the NPC's (this) 'OnConversation' script. +//For each creature Tag entry in the CASE statment below, a journal entry +//under the 'Kill tasks' category must exist, ie +//+ Kill Tasks +// [0001]- You have been asked to search the South and kill an Orc. +// [0002]- You have been asked to go into the Caves and kill a Goblin. +// [----]- etc. +// [0099]- You have completed the task, return for your reward +// +//The journal entry ID's must be the same as the number in the CASE statment. +//There dosn't seem to be a way of entering custom tokens or variables +//to a Journal via any of the Journal Functions supplied by Bioware. +// +//I have tried to keep this example as simple as possible, below are a list +//of improvements you can easily implement once you've got it up and running +//in your own module. +//Enhancement Notes: +// 1) Time expiriy on tasks +// Set up a counter in the OnHeartbeat{} of NPC (this), and check +// in the OnConversation() of NPC (this) when PC returns. +// 2) Fail task if PC dies +// Set 'KILL_TASK_FLAG' to zero in the OnDeath() of the PC. +// 3) Re-spawn the slain creature on completion of task. +// Grab a copy of the creatures 'sTemplate' and 'lLocation' below. +// Then use the CreateObject() function when the PC completes the +// task in the 'OnConversation()' of the NPC (this). +// The module where this example has been derived uses a MMORPG style +// 'creature management' script, and therefore is out of scope here. +// 4) Handle players of all levels, 1-20 +// add additional SWITCH blocks inside the CASE's of the existing SWITCH block +// allowing a choice of 4, one for each level group, 1-5, 6-10, 11-15 & 16 -20 +// Use the GetCharacterLevel(). +//::////////////////////////////////////////////// +void main() +{ + // set up local work variables + object oPC = GetPCSpeaker(); + int nHD = GetHitDice(oPC); + string sDeliveryTarget; + int nRandom; + int found = FALSE; // whats wrong with this language, no boolean!! + int loop = 0; + if(GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1) + { + ActionSpeakString("You already have a task."); + } + else + { + // keep re-rolling if creature TAG not found and try another , stop + // after 10 or so trys just incase no creatures at all exist on + // list, at least we tried + while(!found) + { + nRandom = d6(); + SetLocalString(oPC, "DELIVERY_TASK_NPC", GetName(OBJECT_SELF)); + + // asign random kill target creature TAGs + if(nHD < 10) + { + switch(nRandom) + { + case 1: + sDeliveryTarget = "NPC_MORIAN"; // Morian the Veteran + break; // Sitting Lounge + case 2: + sDeliveryTarget = "NPC_MORIC"; // Moric the Caravan Guard + break; // Caravan Pub + case 3: + sDeliveryTarget = "NPC_DOND"; // Dond the Noble + break; // The Adventurer's Hall + case 4: + sDeliveryTarget = "NPC_BRAN"; // Bran the Courier + break; // Destiny's Shadow + case 5: + sDeliveryTarget = "NPC_KELL"; // Kell the Veteran + break; // Arena Foyer + case 6: + sDeliveryTarget = "NPC_ROLIN"; // Rolin + break; // Rolin's House + } + } // if + SetLocalString(oPC, "DELIVERY_TASK_TARGET", sDeliveryTarget); + + // check to see if we have a valid target, if not then creature + // dosn't exist in module, may have all been killed before + if(GetStringLength(GetName(GetObjectByTag(sDeliveryTarget))) > 0) + { + found = TRUE; + } + // not found really, but must end looping, tried 10 different creatures, + // maybe the module designer forgot to put any in? + if (loop > 10) + { + ActionSpeakString("I have no more tasks for you. Leave me alone."); + return; + } + loop++; + } + // journal entry + if(GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1) + { + //ActionSpeakString("You already have a task."); + } + else + { + AddJournalQuestEntry("kt_journal_02", nRandom, oPC); + } + + + string sDeliveryItem; + //int nRandom; + found = FALSE; // whats wrong with this language, no boolean!! + loop = 0; + + // keep re-rolling if creature TAG not found and try another , stop + // after 10 or so trys just incase no creatures at all exist on + // list, at least we tried + while (!found) + { + nRandom = d10(); + SetLocalString(oPC, "DELIVERY_TASK_NPC", GetName(OBJECT_SELF)); + + // asign random kill target creature TAGs + if(nHD < 10) + { + switch(nRandom) + { + case 1: + sDeliveryItem = "NW_IT_GEM001"; // Greenstone + break; + case 2: + sDeliveryItem = "NW_IT_GEM004"; // Phenalope + break; + case 3: + sDeliveryItem = "NW_CLOTH027"; // Adept's Tunic + break; + case 4: + sDeliveryItem = "NW_CLOTH006"; // Veteran's Outfit + break; + case 5: + sDeliveryItem = "NW_CLOTH012"; // Conjurer's Robe + break; + case 6: + sDeliveryItem = "NW_CLOTH011"; // Gladiator's Outfit + break; + case 7: + sDeliveryItem = "NW_IT_MSMLMISC11"; // Quartz Crystal + break; + case 8: + sDeliveryItem = "NW_IT_MMIDMISC05"; // Meat + break; + case 9: + sDeliveryItem = "NW_IT_MSMLMISC22"; // Top + break; + case 10: + sDeliveryItem = "NW_IT_TORCH001"; // Torch + break; + } + } // if + SetLocalString(oPC, "DELIVERY_TASK_ITEM", sDeliveryItem); + + // check to see if we have a valid target, if not then creature + // dosn't exist in module, may have all been killed before + //if(GetStringLength(GetName(GetObjectByTag(sDeliveryItem))) > 0){ + found = TRUE; + //} + // not found really, but must end looping, tried 10 different creatures, + // maybe the module designer forgot to put any in? + if ((loop > 10) || (nHD > 9)) + { + ActionSpeakString("I have no more tasks for you. Leave me alone."); + return; + } + loop++; + } + + // acknowledge setting of task + if (GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1) + { + ActionSpeakString("You already have a task."); + } + else + { + ActionSpeakString("Your task is to take a " + GetName(GetObjectByTag(sDeliveryItem)) + " to " + GetName(GetObjectByTag(sDeliveryTarget)) + " good luck and don't forget to return to me for your reward!"); + // set the kill task varable + SetLocalInt(oPC, "DELIVERY_TASK_FLAG", 1); + + // journal entry + AddJournalQuestEntry("kt_journal_03", nRandom, oPC); + } + } +} diff --git a/nwnds_module/kt_conver_03.ncs b/nwnds_module/kt_conver_03.ncs new file mode 100644 index 000000000..3055f7f84 Binary files /dev/null and b/nwnds_module/kt_conver_03.ncs differ diff --git a/nwnds_module/kt_conver_03.nss b/nwnds_module/kt_conver_03.nss new file mode 100644 index 000000000..8a3bed2aa --- /dev/null +++ b/nwnds_module/kt_conver_03.nss @@ -0,0 +1,85 @@ +//:://///////////////////////////////////////////// +//:: SetListeningPatterns + kill tasks +//:: kt_c2_default4 (nw_c2_default4) +//:: Copyright (c) 2001. +//::////////////////////////////////////////////// +/* +Determines the course of action to be taken +by the generic script after dialogue or a +shout is initiated. + +Also checks for completion of a Kill task. +*/ +//::////////////////////////////////////////////// +//:: Created By: Paul Rowland +//:: Created On: July 24, 2002 +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" +void main() +{ + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + object oIntruder; + + ////////// kill task code insert here//////////////////////// + + // On detecting a player that has entered dialog with the NPC (this), and + // has the 'Kill_task' variable atatched to itself equal '2', complete. Then + // reset variables, delete journal entry and award experience. + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if(GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1) + { + int nDeliveryFlag = GetLocalInt(oPC, "DELIVERY_TASK_FLAG"); + string sTagItem = GetLocalString(oPC, "DELIVERY_TASK_ITEM"); + object oItemToTake = GetItemPossessedBy(oPC, sTagItem); + string sTagSelf = GetTag(OBJECT_SELF); + string sTagTarget = GetLocalString(oPC, "DELIVERY_TASK_TARGET"); + + // check for correct kill task target and complete + if(sTagSelf == sTagTarget && nDeliveryFlag == 1 && GetIsObjectValid(oItemToTake) != 0) + { + SetLocalInt(oPC, "DELIVERY_TASK_FLAG", 2); + DestroyObject(oItemToTake); + AddJournalQuestEntry("kt_journal_02", 99, oPC); + AddJournalQuestEntry("kt_journal_03", 99, oPC); + ActionSpeakString("Thank you."); + } + } + + ////////// kill task code end here//////////////////////// + if (nMatch == -1 && GetCommandable(OBJECT_SELF)) + { + ClearAllActions(); + BeginConversation(); + } + else if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter)) + { + if(nMatch == 4) + { + oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER"); + } + else if (nMatch == 5) + { + oIntruder = GetLastHostileActor(oShouter); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedAttackTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedSpellTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = OBJECT_INVALID; + } + } + } + } + RespondToShout(oShouter, nMatch, oIntruder); + } + + if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1004)); + } +} diff --git a/nwnds_module/kt_hastask.ncs b/nwnds_module/kt_hastask.ncs new file mode 100644 index 000000000..aef8b0097 Binary files /dev/null and b/nwnds_module/kt_hastask.ncs differ diff --git a/nwnds_module/kt_hastask.nss b/nwnds_module/kt_hastask.nss new file mode 100644 index 000000000..b13e4a1b4 --- /dev/null +++ b/nwnds_module/kt_hastask.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); + if(GetLocalInt(oPC, "DELIVERY_TASK_FLAG") == 1 || GetLocalInt(oPC, "KILL_TASK_FLAG") == 1) + return TRUE; + + return FALSE; +} diff --git a/nwnds_module/kt_quittasks.ncs b/nwnds_module/kt_quittasks.ncs new file mode 100644 index 000000000..5f25ae86d Binary files /dev/null and b/nwnds_module/kt_quittasks.ncs differ diff --git a/nwnds_module/kt_quittasks.nss b/nwnds_module/kt_quittasks.nss new file mode 100644 index 000000000..385f26d6d --- /dev/null +++ b/nwnds_module/kt_quittasks.nss @@ -0,0 +1,9 @@ +void main() +{ + object oPC = GetPCSpeaker(); + DelayCommand(300.0,SetLocalInt(oPC, "KILL_TASK_FLAG", 0)); + DelayCommand(300.0,SetLocalInt(oPC, "DELIVERY_TASK_FLAG", 0)); + RemoveJournalQuestEntry("kt_journal_01", oPC); + RemoveJournalQuestEntry("kt_journal_02", oPC); + RemoveJournalQuestEntry("kt_journal_03", oPC); +} diff --git a/nwnds_module/ledger1.ncs b/nwnds_module/ledger1.ncs new file mode 100644 index 000000000..8c7935dc7 Binary files /dev/null and b/nwnds_module/ledger1.ncs differ diff --git a/nwnds_module/ledger1.nss b/nwnds_module/ledger1.nss new file mode 100644 index 000000000..8f2f288e9 --- /dev/null +++ b/nwnds_module/ledger1.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName ledger1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:23:52 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "LEDGER", 1); + +} diff --git a/nwnds_module/ledgerdone2.ncs b/nwnds_module/ledgerdone2.ncs new file mode 100644 index 000000000..797406d44 Binary files /dev/null and b/nwnds_module/ledgerdone2.ncs differ diff --git a/nwnds_module/ledgerdone2.nss b/nwnds_module/ledgerdone2.nss new file mode 100644 index 000000000..9364986ee --- /dev/null +++ b/nwnds_module/ledgerdone2.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName ledgerdone2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 11:06:56 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "LEDGER", 2); + +} diff --git a/nwnds_module/legendlore.uti b/nwnds_module/legendlore.uti new file mode 100644 index 000000000..8391320ce Binary files /dev/null and b/nwnds_module/legendlore.uti differ diff --git a/nwnds_module/leshay001.utc b/nwnds_module/leshay001.utc new file mode 100644 index 000000000..778f19304 Binary files /dev/null and b/nwnds_module/leshay001.utc differ diff --git a/nwnds_module/leshayhide.uti b/nwnds_module/leshayhide.uti new file mode 100644 index 000000000..03830620a Binary files /dev/null and b/nwnds_module/leshayhide.uti differ diff --git a/nwnds_module/lfiresnaketai.uti b/nwnds_module/lfiresnaketai.uti new file mode 100644 index 000000000..17f048f97 Binary files /dev/null and b/nwnds_module/lfiresnaketai.uti differ diff --git a/nwnds_module/lgearthelemhide.uti b/nwnds_module/lgearthelemhide.uti new file mode 100644 index 000000000..5eec75d51 Binary files /dev/null and b/nwnds_module/lgearthelemhide.uti differ diff --git a/nwnds_module/lgfireelemhide.uti b/nwnds_module/lgfireelemhide.uti new file mode 100644 index 000000000..cbb2780df Binary files /dev/null and b/nwnds_module/lgfireelemhide.uti differ diff --git a/nwnds_module/lgfireelemslam.uti b/nwnds_module/lgfireelemslam.uti new file mode 100644 index 000000000..739ce237d Binary files /dev/null and b/nwnds_module/lgfireelemslam.uti differ diff --git a/nwnds_module/lgmagelemhide.uti b/nwnds_module/lgmagelemhide.uti new file mode 100644 index 000000000..cc61c3257 Binary files /dev/null and b/nwnds_module/lgmagelemhide.uti differ diff --git a/nwnds_module/lgmagelemslam.uti b/nwnds_module/lgmagelemslam.uti new file mode 100644 index 000000000..f5c2af8a6 Binary files /dev/null and b/nwnds_module/lgmagelemslam.uti differ diff --git a/nwnds_module/lgrainelemhide.uti b/nwnds_module/lgrainelemhide.uti new file mode 100644 index 000000000..d9910ebef Binary files /dev/null and b/nwnds_module/lgrainelemhide.uti differ diff --git a/nwnds_module/lgrainelemslam.uti b/nwnds_module/lgrainelemslam.uti new file mode 100644 index 000000000..8e1bb0b98 Binary files /dev/null and b/nwnds_module/lgrainelemslam.uti differ diff --git a/nwnds_module/lgsiltelemhide.uti b/nwnds_module/lgsiltelemhide.uti new file mode 100644 index 000000000..9c17bed26 Binary files /dev/null and b/nwnds_module/lgsiltelemhide.uti differ diff --git a/nwnds_module/lgsiltelemslam.uti b/nwnds_module/lgsiltelemslam.uti new file mode 100644 index 000000000..bffd08249 Binary files /dev/null and b/nwnds_module/lgsiltelemslam.uti differ diff --git a/nwnds_module/lgsunelemhide.uti b/nwnds_module/lgsunelemhide.uti new file mode 100644 index 000000000..6060cba49 Binary files /dev/null and b/nwnds_module/lgsunelemhide.uti differ diff --git a/nwnds_module/lgsunelemslam.uti b/nwnds_module/lgsunelemslam.uti new file mode 100644 index 000000000..920ea734b Binary files /dev/null and b/nwnds_module/lgsunelemslam.uti differ diff --git a/nwnds_module/lgwaterelemhide.uti b/nwnds_module/lgwaterelemhide.uti new file mode 100644 index 000000000..54ae00110 Binary files /dev/null and b/nwnds_module/lgwaterelemhide.uti differ diff --git a/nwnds_module/lgwaterelemslam.uti b/nwnds_module/lgwaterelemslam.uti new file mode 100644 index 000000000..e99bc84bd Binary files /dev/null and b/nwnds_module/lgwaterelemslam.uti differ diff --git a/nwnds_module/lib_ps_spellhook.ncs b/nwnds_module/lib_ps_spellhook.ncs new file mode 100644 index 000000000..3b316dedb Binary files /dev/null and b/nwnds_module/lib_ps_spellhook.ncs differ diff --git a/nwnds_module/lib_ps_spellhook.nss b/nwnds_module/lib_ps_spellhook.nss new file mode 100644 index 000000000..f663ba75e --- /dev/null +++ b/nwnds_module/lib_ps_spellhook.nss @@ -0,0 +1,34 @@ +#include "lib_psionic" +//does any special pre-psionic hooking. +//can include anti-psionic area checks, +//power restrictions, etc. +//to prevent powers being used set bContinue to FALSE + +void main() +{ +//setting up variables. Do not modify this. +/***********************************************************************/ +/**/ int bContinue=TRUE; /**/ +/**/ object oPC=GetLocalObject(GetModule(), "Ps_Player"); /**/ +/**/ int nFeatID=GetLocalInt(GetModule(), "Ps_FeatID"); /**/ +/**/ /**/ +/**/ DeleteLocalInt(GetModule(), "Ps_FeatID"); /**/ +/**/ DeleteLocalObject(GetModule(), "Ps_Player"); /**/ +/***********************************************************************/ + + //Add statements here to change how psionics work + //examples: + //FloatingTextStringOnCreature("Psionic Used!", oPC); + //if(GetTag(GetArea(oPC))=="AntiPsionicArea") bContinue=FALSE; + //if(nFeatID==FEAT_PSIONIC_TELEKINESIS) FloatingTextStringOnCreature("Telekinesis Used!", oPC); + + + + + + //"return" value. Do not modify anything below here. +//------------------------------------------------------------------------------ + SetLocalInt(GetModule(), "Ps_HookReturn", bContinue); +} + + diff --git a/nwnds_module/lib_psionic.ncs b/nwnds_module/lib_psionic.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/lib_psionic.ncs differ diff --git a/nwnds_module/lib_psionic.nss b/nwnds_module/lib_psionic.nss new file mode 100644 index 000000000..f3139d6c7 --- /dev/null +++ b/nwnds_module/lib_psionic.nss @@ -0,0 +1,1301 @@ +//void main() {} + +const int PSIONIC_DISCIPLINE_PSYCHOKINESIS = 1; +const int PSIONIC_DISCIPLINE_PSYCHOMETABOLISM = 2; +const int PSIONIC_DISCIPLINE_PSYCHOPORTATION = 3; +const int PSIONIC_DISCIPLINE_TELEPATHY = 4; +const int PSIONIC_DISCIPLINE_CLAIRSENTIENCE = 5; +const int PSIONIC_DISCIPLINE_METAPSIONICS = 6; + + +const int FEAT_PSIONIC_DETONATE = 1200; +const int FEAT_PSIONIC_DISINTEGRATE = 1201; +const int FEAT_PSIONIC_PROJECT_FORCE = 1202; +const int FEAT_PSIONIC_TELEKINESIS = 1203; +const int FEAT_PSIONIC_ANIMATE_SHADOW = 1204; +const int FEAT_PSIONIC_BALLISTIC_ATTACK = 1205; +const int FEAT_PSIONIC_MOLECULAR_AGITATION = 1206; +const int FEAT_PSIONIC_COMPLETE_HEALING = 1207; +const int FEAT_PSIONIC_DEATH_FIELD = 1208; +const int FEAT_PSIONIC_LIFE_DRAINING = 1209; +const int FEAT_PSIONIC_METAMORPHOSIS = 1210; +const int FEAT_PSIONIC_DISPLACEMENT = 1211; +const int FEAT_PSIONIC_ADRENALINE_CONTROL = 1212; +const int FEAT_PSIONIC_BIOFEEDBACK = 1213; +const int FEAT_PSIONIC_CELL_ADJUSTMENT = 1214; +const int FEAT_PSIONIC_CHAMELEON_POWER = 1215; +const int FEAT_PSIONIC_ECTOPLASMIC_FORM = 1216; +const int FEAT_PSIONIC_ENHANCED_STRENGTH = 1217; +const int FEAT_PSIONIC_FLESH_ARMOR = 1218; +const int FEAT_PSIONIC_LEND_HEALTH = 1219; +const int FEAT_PSIONIC_REGENERATE = 1220; +const int FEAT_PSIONIC_ACCELERATE = 1221; +const int FEAT_PSIONIC_CAUSE_SLEEP = 1222; +const int FEAT_PSIONIC_PHOTOSYNTHESIS = 1223; +const int FEAT_PSIONIC_STRENGTH_OF_LAND = 1224; +const int FEAT_PSIONIC_BANISHMENT = 1225; +const int FEAT_PSIONIC_SUMMON_PLANAR_CREATURE = 1226; +const int FEAT_PSIONIC_SUMMON_PLANAR_ENERGY = 1227; +const int FEAT_PSIONIC_DIMENSION_DOOR = 1228; +const int FEAT_PSIONIC_TIME_SHIFT = 1229; +const int FEAT_PSIONIC_DOMINATION = 1230; +const int FEAT_PSIONIC_CONTACT = 1231; +const int FEAT_PSIONIC_MIND_WHIPE = 1232; +const int FEAT_PSIONIC_MASS_DOMINATION = 1233; +const int FEAT_PSIONIC_HALLUCINATIONS = 1234; +const int FEAT_PSIONIC_ATTRACTION = 1235; +const int FEAT_PSIONIC_AVERSION = 1236; +const int FEAT_PSIONIC_DAYDREAM = 1237; +const int FEAT_PSIONIC_INFLICT_PAIN = 1238; +const int FEAT_PSIONIC_SENSORY_SUPPRESSION = 1239; +const int FEAT_PSIONIC_SUPPRESS_FEAR = 1240; +const int FEAT_PSIONIC_MIND_THRUST = 1241; +const int FEAT_PSIONIC_EGO_WHIP = 1242; +const int FEAT_PSIONIC_ID_INSINUATION = 1243; +const int FEAT_PSIONIC_PSIONIC_BLAST = 1244; +const int FEAT_PSIONIC_PSYCHIC_CRUSH = 1245; +const int FEAT_PSIONIC_INTELLECT_FORTRESS = 1246; +const int FEAT_PSIONIC_MENTAL_BARRIER = 1247; +const int FEAT_PSIONIC_MIND_BLANK = 1248; +const int FEAT_PSIONIC_THOUGHT_SHIELD = 1249; +const int FEAT_PSIONIC_TOWER_OF_IRON_WILL = 1250; +const int FEAT_PSIONIC_TRUE_SIGHT = 1251; +const int FEAT_PSIONIC_COMBAT_MIND = 1252; +const int FEAT_PSIONIC_DANGER_SENSE = 1253; +const int FEAT_PSIONIC_SEE_INVISIBILITY = 1254; +const int FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE = 1255; +const int FEAT_PSIONIC_PSYCHIC_CLONE = 1256; +const int FEAT_PSIONIC_ULTRABLAST = 1257; +const int FEAT_PSIONIC_CANNIBALIZE = 1258; +const int FEAT_PSIONIC_PSYCHIC_DRAIN = 1259; +const int FEAT_PSIONIC_RECEPTACLE = 1260; +const int FEAT_PSIONIC_STASIS_FIELD = 1261; +const int FEAT_PSIONIC_WRENCH = 1262; +const int FEAT_PSIONIC_PSIONIC_VAMPIRISM = 1263; +const int FEAT_PSIONIC_PSIONIC_RESIDUE = 1264; +const int FEAT_PSIONIC_PSP_CHECK = 1265; +const int FEAT_PSIONIC_CATFALL = 1358; +const int FEAT_PSIONIC_ESP = 1359; +const int FEAT_PSIONIC_MIND_BLAST = 1360; +const int FEAT_PSIONIC_OBJECT_READING = 1361; +const int FEAT_PSIONIC_CONTROL_LIGHT = 1362; +const int FEAT_PSIONIC_CONTROL_WIND = 1363; +const int FEAT_PSIONIC_PSYCHIC_SURGERY = 1364; +const int FEAT_PSIONIC_TELEPORT = 1365; +const int FEAT_PSIONIC_CONVOCATION = 1366; +const int FEAT_PSIONIC_GROUP_TELEPORT = 1367; +const int FEAT_PSIONIC_CHEMICAL_SIMULATION = 1368; +const int FEAT_PSIONIC_CRISIS_OF_LIFE = 1369; +const int FEAT_PSIONIC_TRANSFORMATION = 1370; +const int FEAT_PSIONIC_INERTIAL_BARRIER = 1371; +const int FEAT_PSIONIC_MEGAKINESIS = 1372; +const int FEAT_PSIONIC_MASS_CONTACT = 1373; +const int FEAT_PSIONIC_COSMIC_AWARENESS = 1374; +const int FEAT_PSIONIC_EMPOWER = 1375; +const int FEAT_PSIONIC_PSYCHIC_BLADE = 1376; + + +const int FEAT_EXPANSIVE_MIND_1 = 1300; +const int FEAT_EXPANSIVE_MIND_2 = 1301; +const int FEAT_EXPANSIVE_MIND_3 = 1302; +const int FEAT_EXPANSIVE_MIND_4 = 1303; +const int FEAT_EXPANSIVE_MIND_5 = 1304; +const int FEAT_EPIC_EXPANSIVE_MIND_1 = 1305; +const int FEAT_EPIC_EXPANSIVE_MIND_2 = 1306; +const int FEAT_EPIC_EXPANSIVE_MIND_3 = 1307; +const int FEAT_EPIC_EXPANSIVE_MIND_4 = 1308; +const int FEAT_EPIC_EXPANSIVE_MIND_5 = 1309; +const int FEAT_PSYCHOKINESIS_EXPERTISE_1 = 1310; +const int FEAT_PSYCHOKINESIS_EXPERTISE_2 = 1311; +const int FEAT_PSYCHOMETABOLISM_EXPERTISE_1 = 1312; +const int FEAT_PSYCHOMETABILISM_EXPERTISE_2 = 1313; +const int FEAT_PSYCHOPORTATION_EXPERTISE_1 = 1314; +const int FEAT_PSYCHOPORTATION_EXPERTISE_2 = 1315; +const int FEAT_TELEPATHY_EXPERTISE_1 = 1316; +const int FEAT_TELEPATHY_EXPERTISE_2 = 1317; +const int FEAT_CLAIRSENTIENCE_EXPERTISE_1 = 1318; +const int FEAT_CLAIRSENTIENCE_EXPERTISE_2 = 1319; +const int FEAT_METAPSIONICS_EXPERTISE_1 = 1320; +const int FEAT_METAPSIONICS_EXPERTISE_2 = 1321; +const int FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_1 = 1322; +const int FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_2 = 1323; +const int FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_1 = 1324; +const int FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_2 = 1325; +const int FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_1 = 1326; +const int FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_2 = 1327; +const int FEAT_EPIC_TELEPATHY_EXPERTISE_1 = 1328; +const int FEAT_EPIC_TELEPATHY_EXPERTISE_2 = 1329; +const int FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_1 = 1330; +const int FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_2 = 1331; +const int FEAT_EPIC_METAPSIONICS_EXPERTISE_1 = 1332; +const int FEAT_EPIC_METAPSIONICS_EXPERTISE_2 = 1333; +const int FEAT_PSYCHOKINESIS_FOCUS_1 = 1334; +const int FEAT_PSYCHOKINESIS_FOCUS_2 = 1335; +const int FEAT_PSYCHOMETABOLISM_FOCUS_1 = 1336; +const int FEAT_PSYCHOMETABOLISM_FOCUS_2 = 1337; +const int FEAT_PSYCHOPORTATION_FOCUS_1 = 1338; +const int FEAT_PSYCHOPORTATION_FOCUS_2 = 1339; +const int FEAT_TELEPATHY_FOCUS_1 = 1340; +const int FEAT_TELEPATHY_FOCUS_2 = 1341; +const int FEAT_CLAIRSENTIENCE_FOCUS_1 = 1342; +const int FEAT_CLAIRSENTIENCE_FOCUS_2 = 1343; +const int FEAT_METAPSIONICS_FOCUS_1 = 1344; +const int FEAT_METAPSIONICS_FOCUS_2 = 1345; +const int FEAT_EPIC_PSYCHOKINESIS_FOCUS_1 = 1346; +const int FEAT_EPIC_PSYCHOKINESIS_FOCUS_2 = 1347; +const int FEAT_EPIC_PSYCHOMETABOLISM_FOCUS_1 = 1348; +const int FEAT_EPIC_PSYCHOMETABOLISM_FOCUS_2 = 1349; +const int FEAT_EPIC_PSYCHOPORTATION_FOCUS_1 = 1350; +const int FEAT_EPIC_PSYCHOPORTATION_FOCUS_2 = 1351; +const int FEAT_EPIC_TELEPATHY_FOCUS_1 = 1352; +const int FEAT_EPIC_TELEPATHY_FOCUS_2 = 1353; +const int FEAT_EPIC_CLAIRSENTIENCE_FOCUS_1 = 1354; +const int FEAT_EPIC_CLAIRSENTIENCE_FOCUS_2 = 1355; +const int FEAT_EPIC_METAPSIONICS_FOCUS_1 = 1356; +const int FEAT_EPIC_METAPSIONICS_FOCUS_2 = 1357; +const int FEAT_PSYCHOKINESIS_SPECIALTY = 1377; +const int FEAT_PSYCHOMETABOLISM_SPECIALTY = 1378; +const int FEAT_PSYCHOPORTATION_SPECIALTY = 1379; +const int FEAT_TELEPATHY_SPECIALTY = 1380; +const int FEAT_CLAIRSENTIENCE_SPECIALTY = 1381; +const int FEAT_METAPSIONICS_SPECIALTY = 1382; +const int FEAT_EPIC_PSYCHOKINESIS_SPECIALTY = 1383; +const int FEAT_EPIC_PSYCHOMETABOLISM_SPECIALTY = 1384; +const int FEAT_EPIC_PSYCHOPORTATION_SPECIALTY = 1385; +const int FEAT_EPIC_TELEPATHY_SPECIALTY = 1386; +const int FEAT_EPIC_CLAIRSENTIENCE_SPECIALTY = 1387; +const int FEAT_EPIC_METAPSIONICS_SPECIALTY = 1388; + + +const int SPELL_PSIONIC_DETONATE = 1000; +const int SPELL_PSIONIC_DISINTEGRATE = 1001; +const int SPELL_PSIONIC_PROJECT_FORCE = 1002; +const int SPELL_PSIONIC_TELEKINESIS = 1003; +const int SPELL_PSIONIC_ANIMATE_SHADOW = 1004; +const int SPELL_PSIONIC_BALLISTIC_ATTACK = 1005; +const int SPELL_PSIONIC_MOLECULAR_AGITATION = 1006; +const int SPELL_PSIONIC_COMPLETE_HEALING = 1007; +const int SPELL_PSIONIC_DEATH_FIELD = 1008; +const int SPELL_PSIONIC_LIFE_DRAINING = 1009; +const int SPELL_PSIONIC_METAMORPHOSIS = 1010; +const int SPELL_PSIONIC_DISPLACEMENT = 1011; +const int SPELL_PSIONIC_ADRENALINE_CONTROL = 1012; +const int SPELL_PSIONIC_BIOFEEDBACK = 1013; +const int SPELL_PSIONIC_CELL_ADJUSTMENT = 1014; +const int SPELL_PSIONIC_CHAMELEON_POWER = 1015; +const int SPELL_PSIONIC_ECTOPLASMIC_FORM = 1016; +const int SPELL_PSIONIC_ENHANCED_STRENGTH = 1017; +const int SPELL_PSIONIC_FLESH_ARMOR = 1018; +const int SPELL_PSIONIC_LEND_HEALTH = 1019; +const int SPELL_PSIONIC_REGENERATE = 1020; +const int SPELL_PSIONIC_ACCELERATE = 1021; +const int SPELL_PSIONIC_CAUSE_SLEEP = 1022; +const int SPELL_PSIONIC_PHOTOSYNTHESIS = 1023; +const int SPELL_PSIONIC_STRENGTH_OF_LAND = 1024; +const int SPELL_PSIONIC_BANISHMENT = 1025; +const int SPELL_PSIONIC_SUMMON_PLANAR_CREATURE = 1026; +const int SPELL_PSIONIC_SUMMON_PLANAR_ENERGY = 1027; +const int SPELL_PSIONIC_DIMENSION_DOOR = 1028; +const int SPELL_PSIONIC_TIME_SHIFT = 1029; +const int SPELL_PSIONIC_DOMINATION = 1030; +const int SPELL_PSIONIC_CONTACT = 1031; +const int SPELL_PSIONIC_MIND_WHIPE = 1032; +const int SPELL_PSIONIC_MASS_DOMINATION = 1033; +const int SPELL_PSIONIC_HALLUCINATIONS = 1034; +const int SPELL_PSIONIC_ATTRACTION = 1035; +const int SPELL_PSIONIC_AVERSION = 1036; +const int SPELL_PSIONIC_DAYDREAM = 1037; +const int SPELL_PSIONIC_INFLICT_PAIN = 1038; +const int SPELL_PSIONIC_SENSORY_SUPPRESSION = 1039; +const int SPELL_PSIONIC_SUPPRESS_FEAR = 1040; +const int SPELL_PSIONIC_MIND_THRUST = 1041; +const int SPELL_PSIONIC_EGO_WHIP = 1042; +const int SPELL_PSIONIC_ID_INSINUATION = 1043; +const int SPELL_PSIONIC_PSIONIC_BLAST = 1044; +const int SPELL_PSIONIC_PSYCHIC_CRUSH = 1045; +const int SPELL_PSIONIC_INTELLECT_FORTRESS = 1046; +const int SPELL_PSIONIC_MENTAL_BARRIER = 1047; +const int SPELL_PSIONIC_MIND_BLANK = 1048; +const int SPELL_PSIONIC_THOUGHT_SHIELD = 1049; +const int SPELL_PSIONIC_TOWER_OF_IRON_WILL = 1050; +const int SPELL_PSIONIC_TRUE_SIGHT = 1051; +const int SPELL_PSIONIC_COMBAT_MIND = 1052; +const int SPELL_PSIONIC_DANGER_SENSE = 1053; +const int SPELL_PSIONIC_SEE_INVISIBILITY = 1054; +const int SPELL_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE = 1055; +const int SPELL_PSIONIC_PSYCHIC_CLONE = 1056; +const int SPELL_PSIONIC_ULTRABLAST = 1057; +const int SPELL_PSIONIC_CANNIBALIZE = 1058; +const int SPELL_PSIONIC_PSYCHIC_DRAIN = 1059; +const int SPELL_PSIONIC_RECEPTACLE = 1060; +const int SPELL_PSIONIC_STASIS_FIELD = 1061; +const int SPELL_PSIONIC_WRENCH = 1062; +const int SPELL_PSIONIC_PSIONIC_VAMPIRISM = 1063; +const int SPELL_PSIONIC_PSIONIC_RESIDUE = 1064; +const int SPELL_PSIONIC_CATFALL = 1079; +const int SPELL_PSIONIC_ESP = 1080; +const int SPELL_PSIONIC_MIND_BLAST = 1081; +const int SPELL_PSIONIC_OBJECT_READING = 1082; +const int SPELL_PSIONIC_CONTROL_LIGHT = 1083; +const int SPELL_PSIONIC_CONTROL_WIND = 1086; +const int SPELL_PSIONIC_PSYCHIC_SURGERY = 1087; +const int SPELL_PSIONIC_TELEPORT = 1088; +const int SPELL_PSIONIC_CONVOCATION = 1089; +const int SPELL_PSIONIC_GROUP_TELEPORT = 1090; +const int SPELL_PSIONIC_CHEMICAL_SIMULATION = 1091; +const int SPELL_PSIONIC_CRISIS_OF_LIFE = 1092; +const int SPELL_PSIONIC_TRANSFORMATION = 1093; +const int SPELL_PSIONIC_INERTIAL_BARRIER = 1094; +const int SPELL_PSIONIC_MEGAKINESIS = 1095; +const int SPELL_PSIONIC_MASS_CONTACT = 1096; +const int SPELL_PSIONIC_COSMIC_AWARENESS = 1097; +const int SPELL_PSIONIC_EMPOWER = 1098; +const int SPELL_PSIONIC_PSYCHIC_BLADE = 1099; + +const int PSIONIC_ENH_NONE = 0x0000; +const int PSIONIC_ENH_MAGNIFY = 0x0001; +const int PSIONIC_ENH_PROLONG = 0x0010; +const int PSIONIC_ENH_HARNESS_SUBCONSCIOUS = 0x0100; +const int PSIONIC_ENH_MEDITATIVE_FOCUS = 0x1000; + +const int AOE_PSIONIC_DEATH_FIELD = 154; +const int AOE_PSIONIC_INTELLECT_FORTRESS = 121; + +const int CLASS_TYPE_PSIONICIST = 44; + + +//This is an ugly kludge to make expertise work with GetEnhancedEffect(). +//It's necessary because effects are reported as ints not floats. +const int EFFECT_SCALING_FACTOR=10; + + +//Makes sure psp totals and max are reported accurately. +//is necessary because of a lack of levelling up and login checks. +void PSPCheck(object oPC=OBJECT_SELF); + +//Does the power score rolling and PSP checking. +//Not to be confused with PSPCheck which just verifies accuracy. +//Returns TRUE if there are no problems. +//Returns FALSE if there is a power check failure +//or there aren't enough PSPs available. +int PowerCheck(object oPC, int nCost, int nPowerScore, int nFeatID, int bSuppressSpam=FALSE); + +//returns the Discipline ID (PSIONIC_DISCIPLINE_*) from nFeat. +//Note, nFeat must be one of FEAT_PSIONIC_* +//return value on error: -1 +int GetDiscipline(int nFeatID); + +//returns nCost modified by any appropriate expertise feats. +//Note, nFeat must be one of FEAT_PSIONIC_* +//return value on error is nCost, unmodified. +int GetModifiedPSPCost(int nCost, int nFeatID); + +//returns nPowerScore modified by any appropriate focus feats. +//Note, nFeat must be one of FEAT_PSIONIC_* +//return value on error is nPowerScore, unmodified. +int GetModifiedPowerScore(int nPowerScore, int nFeatID); + + +//removes the effects of a specific power from oTarg. +//is used to prevent stacking of powers that shouldn't. +void RemoveEffectsFrom(object oTarg, int nSpellID); + + +//returns the current PSPs of oPC +//may be innacurate if PSPCheck hasn't been called first +int GetPSP(object oPC); + + +//returns the maximum PSPs of oPC +//may be innacurate if PSPCheck hasn't been called first +int GetMaxPSP(object oPC); + +//sets the PSPs of oPC to nPSP +void SetPSP(object oPC, int nPSP); + + +//sets the maximum PSPs of oPC to nMaxPSP +//used internally, should not be used elsewhere. +void SetMaxPSP(object oPC, int nMaxPSP); + +//Psionic spellhooking +//returns TRUE if the psionic can continue, returns FALSE otherwise +//edit lib_ps_spellhook to make changes. +int PsionicSpellHook(object oPC, int nFeatID); + +//Returns oPC's effective Psionicist level when using +//the power associated with nFeatID. +//If nFeatID is not specified, or if no specialty feats are +//possessed by oPC then oPC's actual psionic level is returned. +int GetEffectivePsionicLevel(object oPC, int nFeatID=0); + +//returns the location that oPC has set as his teleport anchor +location GetTeleportAnchor(object oPC=OBJECT_SELF); + +//sets lHere as oPC's teleport anchor +void SetTeleportAnchor(location lHere, object oPC=OBJECT_SELF); + +//returns the current time, in seconds. +int GetRealTime(); + +//returns TRUE if oItem is a weapon-type +int GetIsWeapon(object oItem); + + +//Enable any psionic enhancement powers used by oPC +//returns a multiplier to the base cost +//should only be called within PowerCheck(), not in other scripts +int ProcessEnhancements(object oPC, int nFeatID); + +//Activate the enhancement nEnh where nEnh is one of PSIONIC_ENH_* +//it will take effect with the next power used +void SetEnhancement(object oPC, int nEnh); + +//return nDur modified by Enhancement: Prolong, if applicable +//returns nDur, unmodified otherwise +//Note: should only be called AFTER PowerCheck() +int GetEnhancedDuration(int nDur); + +//Return nEff modified by Enhancement: Magnify, if applicable +//returns nEff, unmodified otherwise +//Note: should only be called AFTER PowerCheck() +int GetEnhancedEffect(int nEff, int nFeatID=0); + +//Return nPS modified by Enhancement: Meditative Focus, if applicable +//returns nPS, unmodified otherwise +int GetEnhancedPowerScore(int nPS); + +//copy the enhancement flags from the caller to oTarget +//used primarily when creating persistent area effects. +void TransferEnhancements(object oTarget); + + +//sets off the trap, if any, on oTarget +void TriggerTrap(object oTarget); + + +/************************************************************* +* +* Implementations +* +**************************************************************/ + + +void PSPCheck(object oPC=OBJECT_SELF) +{ + int nPSPTotal=GetMaxPSP(oPC); + int nPSP=GetPSP(oPC); + int nPsionicistLevel=GetLevelByClass(CLASS_TYPE_PSIONICIST, oPC); // Check for Psionicist Class + int nWis=GetAbilityScore(oPC, ABILITY_WISDOM); + int nCon=GetAbilityScore(oPC, ABILITY_CONSTITUTION); + int nInt=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + int nPSPMax=(nWis-5)*2; + + if (nPsionicistLevel>1) + { + if (nWis>15) nPSPMax=nPSPMax+((nWis-5)*(nPsionicistLevel-1)); + else nPSPMax=nPSPMax+(10*(nPsionicistLevel-1)); + } + + if (nCon>15) nPSPMax=nPSPMax+(nCon-15); + if (nInt>15) nPSPMax=nPSPMax+(nInt-15); + + if (GetHasFeat(FEAT_EPIC_EXPANSIVE_MIND_5, oPC)) nPSPMax=nPSPMax+200; + else if (GetHasFeat(FEAT_EPIC_EXPANSIVE_MIND_4, oPC)) nPSPMax=nPSPMax+100; + else if (GetHasFeat(FEAT_EPIC_EXPANSIVE_MIND_3, oPC)) nPSPMax=nPSPMax+160; + else if (GetHasFeat(FEAT_EPIC_EXPANSIVE_MIND_2, oPC)) nPSPMax=nPSPMax+140; + else if (GetHasFeat(FEAT_EPIC_EXPANSIVE_MIND_1, oPC)) nPSPMax=nPSPMax+120; + else if (GetHasFeat(FEAT_EXPANSIVE_MIND_5, oPC)) nPSPMax=nPSPMax+100; + else if (GetHasFeat(FEAT_EXPANSIVE_MIND_4, oPC)) nPSPMax=nPSPMax+80; + else if (GetHasFeat(FEAT_EXPANSIVE_MIND_3, oPC)) nPSPMax=nPSPMax+60; + else if (GetHasFeat(FEAT_EXPANSIVE_MIND_2, oPC)) nPSPMax=nPSPMax+40; + else if (GetHasFeat(FEAT_EXPANSIVE_MIND_1, oPC)) nPSPMax=nPSPMax+20; + + + if (nPSPTotal!=nPSPMax) + { + SetMaxPSP(oPC, nPSPMax); + SetPSP(oPC, nPSP+nPSPMax-nPSPTotal); + } + +} + + +int PowerCheck(object oPC, int nCost, int nPowerScore, int nFeatID, int bSuppressSpam=FALSE) +{ + //pre-spell hooking + //to use edit lib_ps_spellhook + if (!PsionicSpellHook(oPC, nFeatID)) + return FALSE; + //end pre-spell hooking + + PSPCheck(oPC); + int nPSP=GetPSP(oPC); + int nMult=ProcessEnhancements(oPC, nFeatID); + int nRoll=d20(); + + nCost*=nMult; + + if (nFeatID!=FEAT_PSIONIC_RECEPTACLE) + nCost=GetModifiedPSPCost(nCost, nFeatID); + + nPowerScore=GetModifiedPowerScore(nPowerScore, nFeatID); + + + if (nPSP=3100 && nFeatID<=3106) || (nFeatID>=4862 && nFeatID<=4863) || (nFeatID>=4871 && nFeatID<=4872)) nDisc=1; + else if ((nFeatID>=3107 && nFeatID<=3124) || (nFeatID==4858) || (nFeatID>=4868 && nFeatID<=4870)) nDisc=2; + else if (nFeatID>=3125 && nFeatID<=3129 || (nFeatID>=4865 && nFeatID<=4867)) nDisc=3; + else if ((nFeatID>=3130 && nFeatID<=3150) || (nFeatID>=4859 && nFeatID<=4860) || (nFeatID==4873)) nDisc=4; + else if ((nFeatID>=3151 && nFeatID<=3155) || (nFeatID==4861) || (nFeatID>=4874)) nDisc=5; + else if ((nFeatID>=3156 && nFeatID<=3164) || (nFeatID==4864) || (nFeatID>=4875 && nFeatID<=4876)) nDisc=6; + + return nDisc; +} + + +int GetModifiedPSPCost(int nCost, int nFeatID) +{ + int nDisc=GetDiscipline(nFeatID); + + if (nDisc==-1) return nCost; + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOKINESIS) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOMETABOLISM) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_PSYCHOMETABILISM_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_PSYCHOMETABOLISM_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOPORTATION) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_TELEPATHY) + { + if (GetHasFeat(FEAT_EPIC_TELEPATHY_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_TELEPATHY_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_TELEPATHY_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_TELEPATHY_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_CLAIRSENTIENCE) + { + if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_METAPSIONICS) + { + if (GetHasFeat(FEAT_EPIC_METAPSIONICS_EXPERTISE_2)) + nCost=nCost - 2*nCost/5; + else if (GetHasFeat(FEAT_EPIC_METAPSIONICS_EXPERTISE_1)) + nCost=nCost - 3*nCost/10; + else if (GetHasFeat(FEAT_METAPSIONICS_EXPERTISE_2)) + nCost=nCost - nCost/5; + else if (GetHasFeat(FEAT_METAPSIONICS_EXPERTISE_1)) + nCost=nCost - nCost/10; + } + + return nCost; +} + +int GetModifiedPowerScore(int nPowerScore, int nFeatID) +{ + int nDisc=GetDiscipline(nFeatID); + + if (nDisc==-1) return nPowerScore; + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOKINESIS) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOMETABOLISM) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_PSYCHOMETABOLISM_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_PSYCHOMETABOLISM_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOPORTATION) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_TELEPATHY) + { + if (GetHasFeat(FEAT_EPIC_TELEPATHY_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_TELEPATHY_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_TELEPATHY_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_TELEPATHY_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_CLAIRSENTIENCE) + { + if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_METAPSIONICS) + { + if (GetHasFeat(FEAT_EPIC_METAPSIONICS_FOCUS_2)) + nPowerScore=nPowerScore+8; + else if (GetHasFeat(FEAT_EPIC_METAPSIONICS_FOCUS_1)) + nPowerScore=nPowerScore+6; + else if (GetHasFeat(FEAT_METAPSIONICS_FOCUS_2)) + nPowerScore=nPowerScore+4; + else if (GetHasFeat(FEAT_METAPSIONICS_FOCUS_1)) + nPowerScore=nPowerScore+2; + } + + return GetEnhancedPowerScore(nPowerScore); + +} + + +void RemoveEffectsFrom(object oTarg, int nSpellID) +{ + effect eEff=GetFirstEffect(oTarg); + + while(GetIsEffectValid(eEff)) + { + if(GetEffectSpellId(eEff)==nSpellID) + RemoveEffect(oTarg, eEff); + + eEff=GetNextEffect(oTarg); + } +} + + +int GetPSP(object oPC) +{ + int nPSP; + + if(GetIsPC(oPC)) + nPSP=GetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSP"); + + else + nPSP=GetLocalInt(oPC, "PSP"); + + return nPSP; +} + + +int GetMaxPSP(object oPC) +{ + int nMaxPSP; + + if(GetIsPC(oPC)) + nMaxPSP=GetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSPMax"); + + else + nMaxPSP=GetLocalInt(oPC, "PSPMax"); + + return nMaxPSP; +} + + +void SetPSP(object oPC, int nPSP) +{ + if(GetIsPC(oPC)) + SetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSP", nPSP); + + else + SetLocalInt(oPC, "PSP", nPSP); +} + + +void SetMaxPSP(object oPC, int nMaxPSP) +{ + if(GetIsPC(oPC)) + SetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSPMax", nMaxPSP); + + else + SetLocalInt(oPC, "PSPMax", nMaxPSP); +} + + +int PsionicSpellHook(object oPC, int nFeatID) +{ + int bRet; + + SetLocalObject(GetModule(), "Ps_Player", oPC); + SetLocalInt(GetModule(), "Ps_FeatID", nFeatID); + + SetLocalInt(GetModule(), "Ps_HookReturn", TRUE); + + ExecuteScript("lib_ps_spellhook", GetModule()); + + bRet=GetLocalInt(GetModule(), "Ps_HookReturn"); + DeleteLocalInt(GetModule(), "Ps_HookReturn"); + + return bRet; +} + +int GetEffectivePsionicLevel(object oPC, int nFeatID=0) +{ + + int nLevel=GetLevelByClass(CLASS_TYPE_PSIONICIST, oPC); + int nDisc=GetDiscipline(nFeatID); + + if (nDisc==-1) return nLevel; + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOKINESIS) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_SPECIALTY)) + nLevel=nLevel+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOMETABOLISM) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_PSYCHOMETABOLISM_SPECIALTY)) + nLevel=nLevel+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOPORTATION) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_SPECIALTY)) + nLevel=nLevel+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_TELEPATHY) + { + if (GetHasFeat(FEAT_EPIC_TELEPATHY_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_TELEPATHY_SPECIALTY)) + nLevel=nLevel+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_CLAIRSENTIENCE) + { + if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_SPECIALTY)) + nLevel=nLevel+2; + } + + else if (nDisc==PSIONIC_DISCIPLINE_METAPSIONICS) + { + if (GetHasFeat(FEAT_EPIC_METAPSIONICS_SPECIALTY)) + nLevel=nLevel+4; + else if (GetHasFeat(FEAT_METAPSIONICS_SPECIALTY)) + nLevel=nLevel+2; + } + + return nLevel; + +} + + +location GetTeleportAnchor(object oPC=OBJECT_SELF) +{ + location lLoc=GetLocalLocation(oPC, "PS_TeleportAnchor"); + + return lLoc; +} + + +void SetTeleportAnchor(location lHere, object oPC=OBJECT_SELF) +{ + SetLocalLocation(oPC, "PS_TeleportAnchor", lHere); +} + + +int GetRealTime() +{ + int SecondsPerMinute=60; + int MinutesPerHour=FloatToInt(HoursToSeconds(1)/60.0); + int HoursPerDay=24; + int DaysPerMonth=28; + int MonthsPerYear=12; + + int SecondsPerYear=MonthsPerYear*DaysPerMonth*HoursPerDay*MinutesPerHour*SecondsPerMinute; + int SecondsPerMonth=DaysPerMonth*HoursPerDay*MinutesPerHour*SecondsPerMinute; + int SecondsPerDay=HoursPerDay*MinutesPerHour*SecondsPerMinute; + int SecondsPerHour=MinutesPerHour*SecondsPerMinute; + + + //reduces the year to prevent overflow errors + return (GetCalendarYear()-1000)*SecondsPerYear + GetCalendarMonth()*SecondsPerMonth + + GetCalendarDay()*SecondsPerDay + GetTimeHour()*SecondsPerHour + +GetTimeMinute()*SecondsPerMinute + GetTimeSecond(); + +} + + +int GetIsWeapon(object oItem) +{ + //returns TRUE if oItem is a slashing or piercing weapon + int nItem = GetBaseItemType(oItem); + + if( (nItem == BASE_ITEM_BASTARDSWORD) + || (nItem == BASE_ITEM_BATTLEAXE) + || (nItem == BASE_ITEM_DOUBLEAXE) + || (nItem == BASE_ITEM_GREATAXE) + || (nItem == BASE_ITEM_GREATSWORD) + || (nItem == BASE_ITEM_HALBERD) + || (nItem == BASE_ITEM_HANDAXE) + || (nItem == BASE_ITEM_KAMA) + || (nItem == BASE_ITEM_KATANA) + || (nItem == BASE_ITEM_KUKRI) + || (nItem == BASE_ITEM_LONGSWORD) + || (nItem == BASE_ITEM_SCIMITAR) + || (nItem == BASE_ITEM_SCYTHE) + || (nItem == BASE_ITEM_SICKLE) + || (nItem == BASE_ITEM_TWOBLADEDSWORD) + || (nItem == BASE_ITEM_DWARVENWARAXE) + || (nItem == BASE_ITEM_THROWINGAXE) + || (nItem == BASE_ITEM_WHIP) + || (nItem == BASE_ITEM_ARROW) + || (nItem == BASE_ITEM_DAGGER) + || (nItem == BASE_ITEM_DART) + || (nItem == BASE_ITEM_RAPIER) + || (nItem == BASE_ITEM_SHORTSPEAR) + || (nItem == BASE_ITEM_SHORTSWORD) + || (nItem == BASE_ITEM_SHURIKEN) + || (nItem == BASE_ITEM_BULLET) + || (nItem == BASE_ITEM_BOLT) + || (nItem == BASE_ITEM_CLUB) + || (nItem == BASE_ITEM_DIREMACE) + || (nItem == BASE_ITEM_HEAVYCROSSBOW) + || (nItem == BASE_ITEM_HEAVYFLAIL) + || (nItem == BASE_ITEM_LIGHTCROSSBOW) + || (nItem == BASE_ITEM_LIGHTFLAIL) + || (nItem == BASE_ITEM_LIGHTHAMMER) + || (nItem == BASE_ITEM_LIGHTMACE) + || (nItem == BASE_ITEM_LONGBOW) + || (nItem == BASE_ITEM_MORNINGSTAR) + || (nItem == BASE_ITEM_QUARTERSTAFF) + || (nItem == BASE_ITEM_SHORTBOW) + || (nItem == BASE_ITEM_SLING) + || (nItem == BASE_ITEM_WARHAMMER) + || (nItem == BASE_ITEM_GLOVES) + ) + { + return TRUE; + } + + else return FALSE; +} + +int ProcessEnhancements(object oPC, int nFeatID) +{ + int nFlags=GetLocalInt(oPC, "PsionEnhFlags"); + int nMult=1; + + SetLocalInt(oPC, "PsionMagnify", FALSE); + SetLocalInt(oPC, "PsionProlong", FALSE); + SetLocalInt(oPC, "PsionFocus", FALSE); + SetLocalInt(oPC, "PsionHarness", FALSE); + + + if((nFlags & PSIONIC_ENH_MAGNIFY) > 0) + { + if(nFeatID==FEAT_PSIONIC_BALLISTIC_ATTACK + || nFeatID==FEAT_PSIONIC_PROJECT_FORCE + || nFeatID==FEAT_PSIONIC_MOLECULAR_AGITATION + || nFeatID==FEAT_PSIONIC_ADRENALINE_CONTROL + || nFeatID==FEAT_PSIONIC_DEATH_FIELD + || nFeatID==FEAT_PSIONIC_LIFE_DRAINING + || nFeatID==FEAT_PSIONIC_CELL_ADJUSTMENT + || nFeatID==FEAT_PSIONIC_CHAMELEON_POWER + || nFeatID==FEAT_PSIONIC_REGENERATE + || nFeatID==FEAT_PSIONIC_PHOTOSYNTHESIS + || nFeatID==FEAT_PSIONIC_STRENGTH_OF_LAND + || nFeatID==FEAT_PSIONIC_SUMMON_PLANAR_ENERGY + || nFeatID==FEAT_PSIONIC_CONTACT + || nFeatID==FEAT_PSIONIC_MIND_WHIPE + || nFeatID==FEAT_PSIONIC_INFLICT_PAIN + || nFeatID==FEAT_PSIONIC_EGO_WHIP + || nFeatID==FEAT_PSIONIC_INTELLECT_FORTRESS + || nFeatID==FEAT_PSIONIC_MENTAL_BARRIER + || nFeatID==FEAT_PSIONIC_COMBAT_MIND + || nFeatID==FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE + || nFeatID==FEAT_PSIONIC_PSIONIC_VAMPIRISM + || nFeatID==FEAT_PSIONIC_CATFALL + || nFeatID==FEAT_PSIONIC_ESP + || nFeatID==FEAT_PSIONIC_OBJECT_READING + || nFeatID==FEAT_PSIONIC_CHEMICAL_SIMULATION + || nFeatID==FEAT_PSIONIC_MASS_CONTACT) + { + SetLocalInt(oPC, "PsionMagnify", TRUE); + nMult+=2; + } + } + + if((nFlags & PSIONIC_ENH_PROLONG) > 0) + { + if(nFeatID==FEAT_PSIONIC_DEATH_FIELD + || nFeatID==FEAT_PSIONIC_TELEKINESIS + || (nFeatID>=3110 && nFeatID<=3113) + || (nFeatID>=3115 && nFeatID<=3110) + || (nFeatID>=3120 && nFeatID<=3125) + || (nFeatID>=3129 && nFeatID<=3131) + || nFeatID==FEAT_PSIONIC_MASS_DOMINATION + || (nFeatID>=3135 && nFeatID<=3156) + || nFeatID==FEAT_PSIONIC_STASIS_FIELD + || (nFeatID>=4858 && nFeatID<=4862) + || (nFeatID>=4870 && nFeatID<=4876)) + { + SetLocalInt(oPC, "PsionProlong", TRUE); + nMult+=2; + } + } + + if((nFlags & PSIONIC_ENH_MEDITATIVE_FOCUS) > 0) + { + SetLocalInt(oPC, "PsionFocus", TRUE); + nMult+=1; + } + + if((nFlags & PSIONIC_ENH_HARNESS_SUBCONSCIOUS) > 0) + { + SetLocalInt(oPC, "PsionHarness", TRUE); + nMult=0; + } + + SetLocalInt(oPC, "PsionEnhFlags", PSIONIC_ENH_NONE); + + return nMult; +} + + +void SetEnhancement(object oPC, int nEnh) +{ + int nFlags=GetLocalInt(oPC, "PsionEnhFlags"); + + if(nEnh==PSIONIC_ENH_NONE) SetLocalInt(oPC, "PsionEnhFlags", PSIONIC_ENH_NONE); + + else SetLocalInt(oPC, "PsionEnhFlags", nFlags|nEnh ); +} + + +int GetEnhancedDuration(int nDur) +{ + if(GetLocalInt(OBJECT_SELF, "PsionProlong")) nDur*=2; + + return nDur; +} + + +int GetEnhancedEffect(int nEff, int nFeatID=0) +{ + object oPC=(GetObjectType(OBJECT_SELF)==OBJECT_TYPE_AREA_OF_EFFECT) + ? GetAreaOfEffectCreator() : OBJECT_SELF; + int nDisc=GetDiscipline(nFeatID); + + if(GetLocalInt(OBJECT_SELF, "PsionMagnify")) nEff*=2; + + if (nDisc==-1) return nEff; + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOKINESIS) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOKINESIS_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_PSYCHOKINESIS_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOMETABOLISM) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOMETABOLISM_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_PSYCHOMETABILISM_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_PSYCHOMETABOLISM_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_PSYCHOPORTATION) + { + if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_PSYCHOPORTATION_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_PSYCHOPORTATION_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_TELEPATHY) + { + if (GetHasFeat(FEAT_EPIC_TELEPATHY_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_TELEPATHY_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_TELEPATHY_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_TELEPATHY_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_CLAIRSENTIENCE) + { + if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_CLAIRSENTIENCE_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_CLAIRSENTIENCE_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + else if (nDisc==PSIONIC_DISCIPLINE_METAPSIONICS) + { + if (GetHasFeat(FEAT_EPIC_METAPSIONICS_EXPERTISE_2, oPC)) + nEff=(nEff*7)/5; + else if (GetHasFeat(FEAT_EPIC_METAPSIONICS_EXPERTISE_1, oPC)) + nEff=(nEff*13)/10; + else if (GetHasFeat(FEAT_METAPSIONICS_EXPERTISE_2, oPC)) + nEff=(nEff*6)/5; + else if (GetHasFeat(FEAT_METAPSIONICS_EXPERTISE_1, oPC)) + nEff=(nEff*11)/10; + } + + return nEff; +} + + +int GetEnhancedPowerScore(int nPS) +{ + if(GetLocalInt(OBJECT_SELF, "PsionFocus")) nPS=100; + + return nPS; +} + + +void TransferEnhancements(object oTarget) +{ + SetLocalInt(oTarget, "PsionMagnify", GetLocalInt(OBJECT_SELF, "PsionMagnify")); + SetLocalInt(oTarget, "PsionProlong", GetLocalInt(OBJECT_SELF, "PsionProlong")); + SetLocalInt(oTarget, "PsionFocus", GetLocalInt(OBJECT_SELF, "PsionFocus")); + SetLocalInt(oTarget, "PsionHarness", GetLocalInt(OBJECT_SELF, "PsionHarness")); +} + + +void TriggerTrap(object oTarget) +{ + int nType; + effect eVis; + + if(!GetIsTrapped(oTarget)) return; + + nType=GetTrapBaseType(oTarget); + + if(nType<=3) //spike trap + { + eVis = EffectVisualEffect(253); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget)); + } + else if(nType<=7) //holy trap + { + eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget)); + } + else if(nType<=11) //tangle trap + { + //largely copied from nw_t1_tang* + int nDuration = 3+(nType-8); + location lTarget = GetLocation(oTarget); + effect eSlow = EffectSlow(); + eVis = EffectVisualEffect(VFX_IMP_SLOW); + + //Find first target in the size + object oTrapTarget = GetFirstObjectInShape(SHAPE_SPHERE, (nType<10?RADIUS_SIZE_SMALL:RADIUS_SIZE_MEDIUM), lTarget); + //Cycle through the objects in the radius + while (GetIsObjectValid(oTrapTarget)) + { + if(!ReflexSave(oTrapTarget, 20+5*(nType-8), SAVING_THROW_TYPE_TRAP, oTarget)) + { + //Apply slow effect and visual effect + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTrapTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSlow, oTrapTarget, RoundsToSeconds(nDuration)); + } + //Get next target in the shape. + oTrapTarget = GetNextObjectInShape(SHAPE_SPHERE, (nType<10?RADIUS_SIZE_SMALL:RADIUS_SIZE_MEDIUM), lTarget); + } + } + else if(nType<=15) //acid trap + { + eVis = EffectVisualEffect(VFX_IMP_ACID_S); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget)); + } + else if(nType<=19 || nType==45) //fire trap + { + //largely copied from nw_t1_fire* + location lTarget = GetLocation(oTarget); + int nDamage; + eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + effect eDam; + int nSaveDC = nType==45 ? 33 : 17+3*(nType-16); + + //Get first object in the target area + object oTrapTarget = GetFirstObjectInShape(SHAPE_SPHERE, (nType<10?RADIUS_SIZE_SMALL:RADIUS_SIZE_MEDIUM), lTarget); + //Cycle through the target area until all object have been targeted + while(GetIsObjectValid(oTrapTarget)) + { + if(!GetIsReactionTypeFriendly(oTrapTarget)) + { + //Roll damage + nDamage = d6(nType==16?5:(nType==17?8:(nType==10?15:(nType==19?25:50)))); + //Adjust the trap damage based on the feats of the target + if(!ReflexSave(oTrapTarget, nSaveDC, SAVING_THROW_TYPE_TRAP, oTarget)) + { + if (GetHasFeat(FEAT_IMPROVED_EVASION, oTrapTarget)) + { + nDamage /= 2; + } + } + else if (GetHasFeat(FEAT_EVASION, oTrapTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTrapTarget)) + { + nDamage = 0; + } + else + { + nDamage /= 2; + } + if (nDamage > 0) + { + //Set the damage effect + eDam = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTrapTarget); + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTrapTarget)); + } + } + //Get next target in shape + oTrapTarget = GetNextObjectInShape(SHAPE_SPHERE, (nType<10?RADIUS_SIZE_SMALL:RADIUS_SIZE_MEDIUM), lTarget); + } + } + else if(nType<=23 || nType==44) //electrical trap + { + + //largely copied from nw_i0_spells + object oTrapTarget; + effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oTarget, BODY_NODE_CHEST); + int nDamage = d6(nType==20?8:(nType==21?15:(nType==22?20:(nType==23?30:60)))); + int nSecondary= nType==44 ? 6 : 3+(nType-20); + effect eDam; + effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S); + location lTarget = GetLocation(oTarget); + int nSaveDC = nType==20?19:(nType==21?22:(nType==22?26:(nType==23?28:35))); + int nCount = 0; + + oTrapTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget); + while (GetIsObjectValid(oTrapTarget) && nCount <= nSecondary) + { + if(!GetIsReactionTypeFriendly(oTarget)) + { + //check to see that the original target is not hit again. + if(oTrapTarget != oTarget) + { + //Adjust the trap damage based on the feats of the target + if(!ReflexSave(oTrapTarget, nSaveDC, SAVING_THROW_TYPE_ELECTRICITY)) + { + if (GetHasFeat(FEAT_IMPROVED_EVASION, oTrapTarget)) + { + nDamage /= 2; + } + } + else if (GetHasFeat(FEAT_EVASION, oTrapTarget) || GetHasFeat(FEAT_IMPROVED_EVASION, oTrapTarget)) + { + nDamage = 0; + } + else + { + nDamage /= 2; + } + if (nDamage > 0) + { + //Set the damage effect + eDam = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL); + //Apply the VFX impact and damage effect + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTrapTarget)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTrapTarget); + //Connect the lightning stream from one target to another. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, oTrapTarget, 0.75); + //Set the last target as the new start for the lightning stream + eLightning = EffectBeam(VFX_BEAM_LIGHTNING, oTrapTarget, BODY_NODE_CHEST); + } + } + //Reset the damage + nDamage = d6(nType==20?8:(nType==21?15:(nType==22?20:(nType==23?30:60)))); + //Increment the count + nCount++; + } + //Get next target in the shape. + oTrapTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, lTarget); + } + } + else if(nType<=27) //gas trap + { + string sScript=(nType==24?"NW_T1_GasMinoC1":(nType==25?"NW_T1_GasAvgC1" + :(nType==25?"NW_T1_GasStrC1":"NW_T1_GasDeadC1"))); + eVis=EffectAreaOfEffect(AOE_PER_FOGACID, sScript, "****", "****"); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetLocation(oTarget), RoundsToSeconds(2)); + } + else if(nType<=31 || nType==46) //cold trap + { + eVis = EffectVisualEffect(VFX_IMP_FROST_S); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + else if(nType<=35) //negative trap + { + eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + else if(nType<=39 || nType==47) //sonic trap + { + //largely copied from nw_t1_sonc* + object oTrapTarget; + int nDamage; + effect eDam; + effect eStun = EffectStunned(); + effect eFNF = EffectVisualEffect(VFX_FNF_SOUND_BURST); + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eLink = EffectLinkEffects(eStun, eMind); + int nSaveDC = (nType==47?30:(11+3*(nType-36))); + location lTarget=GetLocation(oTarget); + //effect eDam; + //Apply the FNF to the spell location + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFNF, lTarget); + //Get the first target in the spell area + oTrapTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, GetLocation(GetEnteringObject())); + while (GetIsObjectValid(oTrapTarget)) + { + //Roll damage + nDamage = (nType==36?0:d4(nType==37?3:(nType==38?5:(nType==39?8:40)))); + //Make a Will roll to avoid being stunned + if(WillSave(oTrapTarget, nSaveDC, SAVING_THROW_TYPE_TRAP)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTrapTarget, RoundsToSeconds(nType-35)); + } + + //Apply the VFX impact and damage effect + if(nDamage>0) + { + eDam = EffectDamage(nDamage, DAMAGE_TYPE_SONIC); + DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam,oTrapTarget)); + } + //Get the next target in the spell area + oTrapTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, lTarget); + } + } + else if(nType<=43) + { + eVis = EffectVisualEffect(VFX_IMP_ACID_S); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + + SetTrapDisabled(oTarget); +} diff --git a/nwnds_module/lib_psionrest.ncs b/nwnds_module/lib_psionrest.ncs new file mode 100644 index 000000000..69d75e7df Binary files /dev/null and b/nwnds_module/lib_psionrest.ncs differ diff --git a/nwnds_module/lib_psionrest.nss b/nwnds_module/lib_psionrest.nss new file mode 100644 index 000000000..4281d346e --- /dev/null +++ b/nwnds_module/lib_psionrest.nss @@ -0,0 +1,22 @@ +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + object oWeap=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC); + object oHide=GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC); + + if(GetEffectivePsionicLevel(oPC)<=0) return; + + PSPCheck(oPC); + SetPSP(oPC, GetMaxPSP(oPC)); + + if(GetTag(oWeap)=="Ps_PsychBlade_it") + DestroyObject(oWeap); + + if(GetTag(oHide)=="Ps_CosAware_it") + DestroyObject(oHide); + + SetEnhancement(oPC, PSIONIC_ENH_NONE); + +} diff --git a/nwnds_module/lightdesertrobes.uti b/nwnds_module/lightdesertrobes.uti new file mode 100644 index 000000000..35f50a1b7 Binary files /dev/null and b/nwnds_module/lightdesertrobes.uti differ diff --git a/nwnds_module/lilara.dlg b/nwnds_module/lilara.dlg new file mode 100644 index 000000000..804e67a15 Binary files /dev/null and b/nwnds_module/lilara.dlg differ diff --git a/nwnds_module/limbo001.are b/nwnds_module/limbo001.are new file mode 100644 index 000000000..0277fad5f Binary files /dev/null and b/nwnds_module/limbo001.are differ diff --git a/nwnds_module/limbo001.gic b/nwnds_module/limbo001.gic new file mode 100644 index 000000000..b90f2ded1 Binary files /dev/null and b/nwnds_module/limbo001.gic differ diff --git a/nwnds_module/limbo001.git b/nwnds_module/limbo001.git new file mode 100644 index 000000000..9cefc5097 Binary files /dev/null and b/nwnds_module/limbo001.git differ diff --git a/nwnds_module/loc_ani_htbt.ncs b/nwnds_module/loc_ani_htbt.ncs new file mode 100644 index 000000000..43919d3ec Binary files /dev/null and b/nwnds_module/loc_ani_htbt.ncs differ diff --git a/nwnds_module/loc_ani_htbt.nss b/nwnds_module/loc_ani_htbt.nss new file mode 100644 index 000000000..c6857f63c --- /dev/null +++ b/nwnds_module/loc_ani_htbt.nss @@ -0,0 +1,96 @@ +//::////////////////////////////////////////////////// +//:: Heartbeat for herbivore/omnivore +//:: LOC_ANI_HTBT +//::////////////////////////////////////////////////// +/* + + Heavily edited. Probably will only work for herb/omnivores. + Note that if creatures have standard BW Waypoints, + special herb/omnivore AI is disabled. + +*/ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "loc_i0_generic" + +void main() +{ + // * if not runnning normal or better AI then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + // If we have the 'constant' waypoints flag set, walk to the next + // waypoint. + else if (GetWalkCondition(NW_WALK_FLAG_CONSTANT)) + { + WalkWayPoints(); + } + + // Check to see if we should be playing default animations + // - make sure we don't have any current targets + else if ( !GetIsObjectValid(GetAttemptedAttackTarget()) + && !GetIsObjectValid(GetAttemptedSpellTarget()) + // && !GetIsPostOrWalking()) + && !GetIsObjectValid(GetNearestSeenEnemy())) + { + if (GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) || GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) || + GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + // This handles special attacking/fleeing behavior + // for omnivores & herbivores. + DetermineSpecialBehavior(); + } + else if (!IsInConversation(OBJECT_SELF)) + { + if (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetIsEncounterCreature()) + { + PlayMobileAmbientAnimations(); + } + else if (GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)) + { + PlayImmobileAmbientAnimations(); + } + } + } + + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) + { + if(!GetIsPostOrWalking()) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) && !IsInConversation(OBJECT_SELF)) + { + if(!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) + { + if( GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) ) + { + PlayMobileAmbientAnimations(); + } + else if( GetIsEncounterCreature() ) + { + PlayMobileAmbientAnimations(); + } + else if( GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) ) + { + PlayImmobileAmbientAnimations(); + } + } + else + { + // DetermineCombatRound(); + } + } + else + { + DetermineSpecialBehavior(); + } + } + } + } +} diff --git a/nwnds_module/loc_endround.ncs b/nwnds_module/loc_endround.ncs new file mode 100644 index 000000000..699f7f5f8 Binary files /dev/null and b/nwnds_module/loc_endround.ncs differ diff --git a/nwnds_module/loc_endround.nss b/nwnds_module/loc_endround.nss new file mode 100644 index 000000000..42ba33985 --- /dev/null +++ b/nwnds_module/loc_endround.nss @@ -0,0 +1,31 @@ +//:://///////////////////////////////////////////// +//:: End of Combat Round script (for omni/herbivore) +//:: LOC_ENDROUND +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Calls the end of combat script every round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +#include "loc_i0_generic" + +void main() +{ + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(); + } + else if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) + { + DetermineCombatRound(); + } + if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1003)); + } +} + diff --git a/nwnds_module/loc_i0_generic.nss b/nwnds_module/loc_i0_generic.nss new file mode 100644 index 000000000..88238f399 --- /dev/null +++ b/nwnds_module/loc_i0_generic.nss @@ -0,0 +1,2116 @@ +//:://///////////////////////////////////////////// +//:: Generic Scripting Include v1.0 *modified* +//:: LOC_I0_GENERIC +//:: +//:: original title: NW_I0_GENERIC +//:: +//:: Modified to provide enhanced AI to herbivores +//:: and omnivores. See below for details. (line 77) +//:: +//:: Written for NWN v1.61 and using that version's +//:: "nw_i0_generic" as a base. +//:: +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// + +/* + + December 7 2002, Naomi Novik + Many functions removed to separate libraries: + + x0_i0_anims + PlayMobileAmbientAnimations_NonAvian + PlayMobileAmbientAnimations_Avian + (with PlayMobileAmbientAnimations changed to + just a call to one of these two) + PlayImmobileAmbientAnimations + + x0_i0_assoc + associate constants (NW_ASC_...) + GetPercentageHPLoss (only used in GetAssociateHealMaster) + SetAssociateState + GetAssociateState + ResetHenchmenState + AssociateCheck + GetAssociateHealMaster + GetFollowDistance + SetAssociateStartLocation + GetAssociateStartLocation + + x0_i0_behavior + behavior constants + SetBehaviorState + GetBehaviorState + + x0_i0_spawncond + OnSpawn condition constants + SetSpawnInCondition + GetSpawnInCondition + SetSpawnInLocals + SetListeningPatterns + + x0_i0_walkway + WalkWayPoints + RunNextCircuit + RunCircuit + CheckWayPoints + GetIsPostOrWalking + + x0_i0_talent + ALL the talent functions + + x0_i0_equip + Equipping functions + + x0_i0_match + Matching functions + + x0_i0_debug + MyPrintString + DebugPrintTalentId + newdebug + + x0_inc_generic + Pretty much everything else + + ***********************************************' + CHANGE SUMMARY + + January 12 2004: Following modifications done by end-user: + - incorporated new "DetermineSpecialBehaviour" function by + "fendis_khan" who fixed the NPC AI so that + herbivores and omnivores will behave more realistically + than Bioware's default. + - a number of enhancements were done to fendis' code, to + provide even more realism and possibly to account for + some nuances of the v1.60+ combat round engine + - meant to be compatible with the "smart animal pen" + script which I will include with this package + - note that your herb/omni creatures should ensure all + their scripts are recompiled to reference this include + since "DetermineSpecialBehaviour" can be called from + a number of events. better yet, just use the supplied + ERF and script templates! + - The "DetermineSpecialBehaviour" function begins at line 1800 + + February 6 2003: Commented out the Henchman RespondToShout because now using + the newer bkRespondToShout function in x0_i0_henchman + + + September 18 2002: DetermineCombatRound broken into smaller functions + 19 : Removed randomness from Talent system. You can't + have smart AI and random behavior. Only healing + has the possiblity of being random. + + I may want to add the possibility of getting a + random talent only in the Talent filter if + something fails (*) + + ******************************************** + WARNING THIS SCRIPT IS CHANGED AT YOUR PERIL + ******************************************** + + This is the master generic script and currently + handles all combat and some plot behavior + within NWN. If this script is tampered + with there is a chance of introducing game + breaking bugs. But other than that enjoy. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Sept 20, 2001 +//::////////////////////////////////////////////// + +//#include "x0_i0_assoc" - included in x0_inc_generic +//#include "x0_inc_generic" - included in x0_i0_talent +//#include "x0_i0_talent" - included in x0_i0_combat + +//#include "x0_i0_combat" - include in x0_i0_anims + +//#include "x0_i0_walkway" - include in x0_i0_anims +#include "x0_i0_behavior" +#include "x0_i0_anims" + + +/********************************************************************** + * CONSTANTS + **********************************************************************/ + +/********************************************************************** + * Flee and move constants + **********************************************************************/ + +int NW_GENERIC_FLEE_EXIT_FLEE = 0; +int NW_GENERIC_FLEE_EXIT_RETURN = 1; +int NW_GENERIC_FLEE_TELEPORT_FLEE = 2; +int NW_GENERIC_FLEE_TELEPORT_RETURN = 3; + +/********************************************************************** + * Shout constats + **********************************************************************/ + +// NOT USED +int NW_GENERIC_SHOUT_I_WAS_ATTACKED = 1; + +//IN OnDeath Script +int NW_GENERIC_SHOUT_I_AM_DEAD = 12; + +//IN TalentMeleeAttacked +int NW_GENERIC_SHOUT_BACK_UP_NEEDED = 13; + +int NW_GENERIC_SHOUT_BLOCKER = 2; + + +/********************************************************************** + * FUNCTION PROTOTYPES + **********************************************************************/ + +// * New Functions September - 2002 + + +// * The class-specific tactics have been broken out from DetermineCombatRound +// * for readability. This function determines the actual tactics each class +// * will use. +int chooseTactics(object oIntruder); + +// Adds all three of the class levels together. Used before +// GetHitDice became available +int GetCharacterLevel(object oTarget); + +//If using ambient sleep this will remove the effect +void RemoveAmbientSleep(); + +//Searches for the nearest locked object to the master +object GetLockedObject(object oMaster); + +/********************************************************************** + * DetermineCombatRound subfunctions + **********************************************************************/ + +// Used in DetermineCombatRound to keep a +// henchmen bashing doors. +int BashDoorCheck(object oIntruder = OBJECT_INVALID); + +// Determines which of a NPCs three classes to +// use in DetermineCombatRound +int DetermineClassToUse(); + + +/********************************************************************** + * Core AI Functions + **********************************************************************/ + +//:://///////////////////////////////////////////// +//:: DetermineCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function is the master function for the + generic include and is called from the main + script. This function is used in lieu of + any actual scripting. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// +void DetermineCombatRound(object oIntruder = OBJECT_INVALID, int nAI_Difficulty = 10); + +//:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +// Allows the listener to react in a manner +// consistant with the given shout but only to one +// combat shout per round +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +//NOTE ABOUT COMMONERS +// Commoners are universal cowards. If you attack anyone +// they will flee for 4 seconds away from the attacker. +// However to make the commoners into a mob, make a single +// commoner at least 10th level of the same faction. +// If that higher level commoner is attacked or killed then +// the commoners will attack the attacker. They will disperse again +// after some of them are killed. Should NOT make multi-class +// creatures using commoners. +// +//NOTE ABOUT BLOCKERS +// It should be noted that the Generic Script for On Dialogue +// attempts to get a local set on the shouter by itself. +// This object represents the LastOpenedBy object. It is this +// object that becomes the oIntruder within this function. +// +//NOTE ABOUT INTRUDERS +// The intruder object is for cases where a placable needs to +// pass a LastOpenedBy Object or a AttackMyAttacker +// needs to make his attacker the enemy of everyone. +void RespondToShout(object oShouter, int nShoutIndex, object oIntruder = OBJECT_INVALID); + + +//******** PLOT FUNCTIONS + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +void SetNPCWarningStatus(int nStatus = TRUE); + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +int GetNPCWarningStatus(); + +// * Presently Does not work with the current implementation +// * of encounter triggers! +// +// This function works in tandem with an encounter +// to spawn in guards to fight for the attacked +// NPC. MAKE SURE THE ENCOUNTER TAG IS SET TO: +// +// "ENC_" + NPC TAG +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +void SetSummonHelpIfAttacked(); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +// This function is used only because ActionDoCommand can +// only accept void functions. +void CreateSignPostNPC(string sTag, location lLocal); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +void ActivateFleeToExit(); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +int GetFleeToExit(); + +// Checks that an item was unlocked. +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 19, 2001 +void CheckIsUnlocked(object oLastObject); + +// This function is now just a wrapper around the functions +// PlayMobileAmbientAnimations_Nonavian() and +// PlayMobileAmbientAnimations_Avian(), in x0_i0_anims +void PlayMobileAmbientAnimations(); + +// Determines the special behavior used by the NPC. +// Generally all NPCs who you want to behave differently +// than the defualt behavior. +// For these behaviors, passing in a valid object will +// cause the creature to become hostile the the attacker. +void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID); + +// * Am I in a invisible or stealth state or sanctuary? +int InvisibleTrue(object oSelf = OBJECT_SELF); + +/********************************************************************** + * FUNCTION DEFINITIONS + **********************************************************************/ + +//:://///////////////////////////////////////////// +//:: AdjustBehaviorVariable +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +Overriding "behavior" variables. +If a variable has been stored on the creature it overrides the above +class defaults +*/ +//::////////////////////////////////////////////// +//:: Created By: +//:: Created On: +//::////////////////////////////////////////////// + +int AdjustBehaviorVariable(int nVar, string sVarName) +{ + int nPlace =GetLocalInt(OBJECT_SELF, sVarName); + if (nPlace > 0) + { + return nPlace; + } + return nVar; // * return the original value +} + +//:://///////////////////////////////////////////// +//:: InvisibleBecome +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + A more intelligent invisibility solution, + along the lines of the one used in + the various end-user AIs. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: June 14, 2003 +//::////////////////////////////////////////////// +int InvisibleBecome(object oSelf = OBJECT_SELF) +{ + int iDarkness = FALSE; + if(GetHasSpell(SPELL_DARKNESS) && GetHasSpell(SPELL_DARKVISION)) iDarkness = TRUE; + if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY) || GetHasSpell(SPELL_INVISIBILITY) || + GetHasSpell(SPELL_INVISIBILITY_SPHERE) || (iDarkness) || GetHasSpell(SPELL_SANCTUARY) + || GetHasSpell(SPELL_ETHEREALNESS) + || GetHasFeat(FEAT_HIDE_IN_PLAIN_SIGHT, oSelf) == TRUE) + { + + // * cannot already be invisible, otherwise what is the point + if(InvisibleTrue(oSelf) == FALSE) + { + // * this bit ported directly from Jasperre + // Can anyone see me? (has spell effects of X) + // * The point of this is to see if its even worthwhile to go invisbile + // * or will it be immediately dispeled. + object oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_TRUE_SEEING); + if(!GetIsObjectValid(oSeeMe)) + { + oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_SEE_INVISIBILITY); + // if(!GetIsObjectValid(oSeeMe)) + // { + // oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_INVISIBILITY_PURGE); + // } + } + + + if(!GetIsObjectValid(oSeeMe)) + { + int nDiff = GetCombatDifficulty(oSelf, TRUE); + //SpeakString(IntToString(nDiff)); + if (nDiff > -1) + { + + ClearActions(1001); + if (iDarkness==TRUE) + { + ActionCastSpellAtObject(SPELL_DARKVISION, oSelf); + ActionCastSpellAtObject(SPELL_DARKNESS, oSelf); + return TRUE; + } + if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY, oSelf) == TRUE) + { + ActionCastSpellAtObject(SPELL_IMPROVED_INVISIBILITY, oSelf); + return TRUE; + } + else + if (GetHasSpell(SPELL_INVISIBILITY, oSelf) == TRUE) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY, oSelf); + return TRUE; + } + else + if (GetHasSpell(SPELL_INVISIBILITY_SPHERE, oSelf) == TRUE) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY_SPHERE, oSelf); + return TRUE; + } + else + if (GetHasSpell(SPELL_ETHEREALNESS, oSelf) == TRUE) + { + ActionCastSpellAtObject(SPELL_ETHEREALNESS, oSelf); + return TRUE; + } + else + if (GetHasSpell(SPELL_SANCTUARY, oSelf) == TRUE) + { + ActionCastSpellAtObject(SPELL_SANCTUARY, oSelf); + return TRUE; + } + else + if (GetHasFeat(FEAT_HIDE_IN_PLAIN_SIGHT, oSelf)) + // * go into stealth mode + { + // SpeakString("Attempting stealth mode"); + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE); + WrapperActionAttack(GetNearestEnemy()); + return TRUE; + } + + } + } + }// is NOT invisible + } + return FALSE; +} + +//:://///////////////////////////////////////////// +//:: InvisibleTrue +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Returns TRUE if oSelf is hidden either + magically or via stealth + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 14, 2003 +//::////////////////////////////////////////////// + +int InvisibleTrue(object oSelf =OBJECT_SELF) +{ + if(GetHasEffect(EFFECT_TYPE_INVISIBILITY, oSelf) || GetHasEffect(EFFECT_TYPE_IMPROVEDINVISIBILITY, oSelf) + || (GetHasSpellEffect(SPELL_DARKNESS, oSelf) && GetHasSpellEffect(SPELL_DARKVISION, oSelf)) + || GetActionMode(oSelf, ACTION_MODE_STEALTH) || GetHasEffect(EFFECT_TYPE_SANCTUARY, oSelf) + || GetHasEffect(EFFECT_TYPE_ETHEREAL, oSelf)) + { + return TRUE; + + } + return FALSE; +} + +// * Returns true if a wizard or sorcerer and wearing armor +int GetShouldNotCastSpellsBecauseofArmor(object oTarget, int nClass) +{ + + if (GetArcaneSpellFailure(oTarget) > 5 && (nClass == CLASS_TYPE_SORCERER || nClass == CLASS_TYPE_WIZARD)) + { + return TRUE; + } + return FALSE; +} + + +//:://///////////////////////////////////////////// +//:: chooseTactics +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Separated this function out from DetermineCombatRound + for readibility +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: September 2002 +//::////////////////////////////////////////////// + +int chooseTactics(object oIntruder) +{ + + // SELF PRESERVATION: Always attempt to heal self first + if(TalentHealingSelf() == TRUE) return 99; //Use spells and potions + + // Next, try the special tactics routines + // specific to XP1 + if (SpecialTactics(oIntruder)) return 99; + + // * These constants in ChooseTactics routine + // * remember previous rounds choices + + int MEMORY_OFFENSE_MELEE = 0; + int MEMORY_DEFENSE_OTHERS = 1; + int MEMORY_DEFENSE_SELF = 2; + int MEMORY_OFFENSE_SPELL = 3; + + // * If defensive last round, try to be offensive this round + // * this is to prevent wasting time on multiple protections + int nPreviousMemory = GetLocalInt(OBJECT_SELF, "NW_L_MEMORY"); + + int nClass = DetermineClassToUse(); + + int nOffense, nCompassion, nMagic, nCrazy = 0; + + // * Defaulted high so unspecified classes will not be cowards + nOffense = 50; + + nCompassion = 25; + + // * Defaulted this high because non standard creatures + // * with spells should try and use them. + nMagic = 55; + + // * setup base BEHAVIOR + switch (nClass) + { + case CLASS_TYPE_COMMONER: + // Commoners should run away from fights + //SpawnScriptDebugger(); + nOffense = 0; nCompassion = 0; nMagic = 0; break; + case CLASS_TYPE_PALEMASTER: + case CLASS_TYPE_WIZARD: + case CLASS_TYPE_SORCERER: + // SpawnScriptDebugger(); + nOffense = 40; nCompassion = 40; nMagic = 100; break; + case CLASS_TYPE_BARD: + case CLASS_TYPE_HARPER: + case CLASS_TYPE_DRAGONDISCIPLE: + { + if(TalentBardSong() == TRUE) return 99; + nOffense = 40; nCompassion = 42; nMagic = 43; break; + } + case CLASS_TYPE_CLERIC: + case CLASS_TYPE_DRUID: + case CLASS_TYPE_SHIFTER: + { + nOffense = 40; + nCompassion = 45; + nMagic = 44; + // * Clerics shouldn't constantly cast spells + if (nPreviousMemory != MEMORY_OFFENSE_MELEE) + nMagic = Random(50) + 1; + break; + } + case CLASS_TYPE_PALADIN : + case CLASS_TYPE_RANGER : + nOffense = 40; nCompassion = 25; nMagic = Random(50) + 1; break; + case CLASS_TYPE_BARBARIAN: + { + // SpawnScriptDebugger(); + // * GetHasFeat(...) does not work correctly with no-leveled up + // * characters. So for now, only Xanos gets to do this. + string sTag = GetTag(OBJECT_SELF); + if (sTag == "x0_hen_xan" || sTag == "x2_hen_daelan") + { + if (GetHasFeatEffect(FEAT_BARBARIAN_RAGE) == FALSE) + { + + if (GetHasFeat(FEAT_BARBARIAN_RAGE) == TRUE) + { + ActionUseFeat(FEAT_BARBARIAN_RAGE, OBJECT_SELF); + return 99; + } + } + } + nOffense = 50; nCompassion = 25; nMagic = 20; break; + // * set high magic to use rage + // * suggestion don't give barbarians lots of magic or else they will fight oddly + } + case CLASS_TYPE_WEAPON_MASTER: + case CLASS_TYPE_ARCANE_ARCHER: + case CLASS_TYPE_BLACKGUARD: + case CLASS_TYPE_SHADOWDANCER: + case CLASS_TYPE_DWARVENDEFENDER: + case CLASS_TYPE_ASSASSIN: + case CLASS_TYPE_FIGHTER: + case CLASS_TYPE_ROGUE : //SpawnScriptDebugger(); + case CLASS_TYPE_MONK : + nOffense = 40; nCompassion = 0; nMagic = 0; break; + case CLASS_TYPE_UNDEAD: + nOffense = 40; nCompassion = 40; nMagic = 40; break; + case CLASS_TYPE_OUTSIDER: + { + nOffense = 40; nCompassion = 0; nMagic = 40; + if (GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD) + { + nCompassion = 40; + } + break; + } + case CLASS_TYPE_CONSTRUCT: + case CLASS_TYPE_ELEMENTAL: + nOffense = 40; nCompassion = 0; nMagic = 40; break; + case CLASS_TYPE_DRAGON: + nOffense = 40; nCompassion = 20; nMagic = 40; break; + default: + nOffense = 7; nCompassion = 7; nMagic = 7; break; + } + + + + // MyPrintString("Made it past the class-specific settings"); + + + // ************************************ + // * MODIFY BEHAVIOR FOR SPECIAL CASES + // ************************************ + if (GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD) + nCompassion = nCompassion - 20; + + // Randomize things a bit + nOffense = Random(10 + nCrazy) + nOffense; + nMagic = Random(10 + nCrazy) + nMagic; + nCompassion = Random(10 + nCrazy) + nCompassion; + + + + // * if your opponent is close to you, then increase offense + // * as casting defensive abilities when enemies are close + // * is generally not a good idea. + // * Dec 18 2002: If you have Combat Casting, you'll still be more + // * liable to use defensive abilities + if (GetIsObjectValid(oIntruder) && !GetHasFeat(FEAT_COMBAT_CASTING)) + { + if (GetDistanceToObject(oIntruder) <= 5.0) { + nOffense = nOffense + 20; + nMagic = nMagic - 20; + } + } + + // * If enemies are further away, more chance of doing magic + if (GetDistanceToObject(oIntruder) > 3.0) + nMagic = nMagic + 15; + + // * Dec 18 2002: Add your level to your magic rating + nMagic = nMagic + GetHitDice(OBJECT_SELF); + + + // ************************************** + // * CHOOSE TALENT TO USE + // ************************************** + + //SpawnScriptDebugger(); + + // * If defensive last round, try to be offensive this round + // * this is to prevent wasting time on multiple protections + if ((nPreviousMemory == MEMORY_DEFENSE_OTHERS) + || (nPreviousMemory == MEMORY_DEFENSE_SELF)) + { + nOffense = nOffense + 40; + } + + + // April 2003 + // If in rage should be almost no chance of doing magic + // * June 2003 + // * If has more than 5% chance of spell failure don't try casting + if (GetHasFeatEffect(FEAT_BARBARIAN_RAGE)== TRUE || GetShouldNotCastSpellsBecauseofArmor(OBJECT_SELF, nClass) == TRUE + || GetLocalInt(OBJECT_SELF, "X2_L_STOPCASTING") == 10) + { + nMagic = 0; + } + + + + + // ************** + // * JULY 12 2003 + // * Overriding "behavior" variables. + // * If a variable has been stored on the creature it overrides the above + // * class defaults + // * JULY 28 2003 + // * changed this so that its an additive process, not an overrwrite. + // * gives more flexiblity. + // ************** + nMagic = nMagic + AdjustBehaviorVariable(nMagic, "X2_L_BEH_MAGIC"); + nOffense = nOffense + AdjustBehaviorVariable(nOffense, "X2_L_BEH_OFFENSE"); + nCompassion = nCompassion + AdjustBehaviorVariable(nCompassion, "X2_L_BEH_COMPASSION"); + + + // * Dragon Disciple Breath + if (GetHasFeat(FEAT_DRAGON_DIS_BREATH) == TRUE && Random(100) > 50) + { + ClearActions(2000); + ActionCastSpellAtObject(690, GetNearestEnemy(), METAMAGIC_ANY, TRUE); + DecrementRemainingFeatUses(OBJECT_SELF, FEAT_DRAGON_DIS_BREATH); + return 99; + } + + + // * If invisbile of any sort, become Defensive and + // * magical to use any buffs you may have + // * This behavior variable setting should override all others + // * October 22 2003 - Lines 690 and 713 modified to only work if magic + // * setting has not been turned off. Nathyrra always going invisible + // * can be annoying. + if (InvisibleTrue(OBJECT_SELF) == TRUE && nMagic > 0) + { + // SpawnScriptDebugger(); + // * if wounded at all take this time to heal self + // * since I am invisible there is little danger from doing this + if (GetCurrentHitPoints(OBJECT_SELF) < GetMaxHitPoints(OBJECT_SELF)) + { + if(TalentHealingSelf(TRUE) == TRUE) return 99; + } + + nOffense = 7; + nMagic = 100; + + if (GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH) == TRUE) + { + nOffense = 100; // * if in stealth attempt sneak attacks + } + } + else + // ************** + // * JULY 14 2003 + // * Attempt To Go Invisible + // ************** + if (InvisibleBecome() == TRUE && nMagic > 0) + return 99; + + // PHYSICAL, NO OFFENSE + if (nOffense <= 5) + { + //SpawnScriptDebugger(); + //SpeakString("fleeing"); + if (TalentFlee(oIntruder) == TRUE) return 99; + } + + // protect others: MAGICAL, DEFENSE, COMPASSION + if ((nOffense<= 50) && (nMagic > 50) && (nCompassion > 50)) + { + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", MEMORY_DEFENSE_OTHERS); + if (TalentHeal() == TRUE) return 99; + if (TalentCureCondition() == TRUE) return 99; + if (TalentUseProtectionOthers() == TRUE) return 99; + if (TalentEnhanceOthers() == TRUE) return 99; + + // * Temporarily be non-compassionate to buff self + // * if we got to this point. + nCompassion = 0; + } + + // protectself: MAGICAL, DEFENSE, NO COMPASSION + if ((nOffense<= 50) && (nMagic > 50) && (nCompassion <=50)) + { + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", MEMORY_DEFENSE_SELF); + + /* Dec 19 2002: + Against spell-casters, cast protection spells more often + */ + int nClass = GetClassByPosition(1,oIntruder); + if (nClass == CLASS_TYPE_WIZARD || nClass == CLASS_TYPE_SORCERER + || nClass == CLASS_TYPE_CLERIC || nClass == CLASS_TYPE_DRUID) + { + if (TalentSelfProtectionMantleOrGlobe()) + return 99; + } + + if(TalentUseProtectionOnSelf() == TRUE) return 99; + if(TalentUseEnhancementOnSelf() == TRUE) return 99; + if(TalentPersistentAbilities() == TRUE) return 99; + // int TalentAdvancedBuff(float fDistance); + + //Used for Potions of Enhancement and Protection + if(TalentBuffSelf() == TRUE) return 99; + + if(TalentAdvancedProtectSelf() == TRUE) return 99; + if(TalentSummonAllies() == TRUE) return 99; + if(TalentSeeInvisible() == TRUE) return 99; + if(TalentMeleeAttacked(oIntruder) == TRUE) return 99; + if(TalentRangedAttackers(oIntruder) == TRUE) return 99; + if(TalentRangedEnemies(oIntruder) == TRUE) return 99; + + + } + + // MAGICAL, OFFENSE + if (nMagic > 50) + { + // // MyPrintString("in offensive spell"); + // SpawnScriptDebugger(); + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", MEMORY_OFFENSE_SPELL); + if (TalentUseTurning() == TRUE) return 99; + if (TalentSpellAttack(oIntruder) == TRUE) return 99; + } + + // If we got here, we're going to melee offense + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", MEMORY_OFFENSE_MELEE); + + // PHYSICAL, OFFENSE (if nothing else applies) + if (TryKiDamage(oIntruder) == TRUE) return 99; + if (TalentSneakAttack() == TRUE) return 99; + if (TalentDragonCombat(oIntruder)) {return 99;} + if (TalentMeleeAttack(oIntruder) == TRUE) return 99; + + + object oHostile = GetNearestSeenEnemy(); + + // * Feb 17 2003: This error could happen in the situation that someone + // * went into combat mode and their 'hostility' ended while going through ChooseTactics + if (GetIsObjectValid(oHostile) == TRUE) + { + + // * BK if it returns this it means the AI found nothing + // * Appropriate to do + //SpeakString("BUG!!!!!!!!!!!!!!!!!!!!!!!! (Let Brent Knowles know about this. Supply savegame) Nothing valid to do !!!!!!!!!!!!!!!!!!!!!"); + //SpeakString("BUG!! Magic " + IntToString(nMagic) + " Compassion " + IntToString(nCompassion) + " Offense " + IntToString(nOffense)); + } + return 1; + +} // * END of choosetactics + +//:://///////////////////////////////////////////// +//:: __InCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Tests to see if already running a determine + combatround this round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 11 2003 +//::////////////////////////////////////////////// +int __InCombatRound() +{ + + // * if just in attackaction, turn combat round off + // * if simply fighting it is okay to turn the combat round off + // * and try again because it doesn't hurt an attackaction + // * to be reiniated whereas it does break a spell + int nCurrentAction = GetCurrentAction(OBJECT_SELF); + if (nCurrentAction == ACTION_ATTACKOBJECT || nCurrentAction == ACTION_INVALID || nCurrentAction == ACTION_MOVETOPOINT) + { + return FALSE; + } + if (GetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND") == TRUE) + { + //SpeakString("DEBUG:: In Combat Round, busy."); + return TRUE; + } + return FALSE; +} +//:://///////////////////////////////////////////// +//:: __TurnCombatRoundOn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Will set the exclusion variable on whether + in combat or not. + This is to prevent multiple firings + of determinecombatround in one round +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 11 2003 +//::////////////////////////////////////////////// + +void __TurnCombatRoundOn(int bBool) +{ + if (bBool == TRUE) + { + SetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND", TRUE); + } + else + { + // * delay it turning off like an action + ActionDoCommand(SetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND", FALSE)); + } +} +//:://///////////////////////////////////////////// +//:: DetermineCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function is the master function for the + generic include and is called from the main + script. This function is used in lieu of + any actual scripting. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +void DetermineCombatRound(object oIntruder = OBJECT_INVALID, int nAI_Difficulty = 10) +{ + // MyPrintString("************** DETERMINE COMBAT ROUND START *************"); + // MyPrintString("************** " + GetTag(OBJECT_SELF) + " ************"); + + // ---------------------------------------------------------------------------------------- + // May 2003 + // Abort out of here, if petrified + // ---------------------------------------------------------------------------------------- + if (GetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE) + { + return; + } + + // ---------------------------------------------------------------------------------------- + // Oct 06/2003 - Georg Zoeller, + // Fix for ActionRandomWalk blocking the action queue under certain circumstances + // ---------------------------------------------------------------------------------------- + if (GetCurrentAction() == ACTION_RANDOMWALK) + { + ClearAllActions(); + } + + // ---------------------------------------------------------------------------------------- + // July 27/2003 - Georg Zoeller, + // Added to allow a replacement for determine combat round + // If a creature has a local string variable named X2_SPECIAL_COMBAT_AI_SCRIPT + // set, the script name specified in the variable gets run instead + // see x2_ai_behold for details: + // ---------------------------------------------------------------------------------------- + string sSpecialAI = GetLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT"); + if (sSpecialAI != "") + { + SetLocalObject(OBJECT_SELF,"X2_NW_I0_GENERIC_INTRUDER", oIntruder); + ExecuteScript(sSpecialAI, OBJECT_SELF); + if (GetLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK")) + { + DeleteLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK"); + return; + } + } + + + // ---------------------------------------------------------------------------------------- + // DetermineCombatRound: EVALUATIONS + // ---------------------------------------------------------------------------------------- + if(GetAssociateState(NW_ASC_IS_BUSY)) + { + return; + } + + if(BashDoorCheck(oIntruder)) {return;} + + // ---------------------------------------------------------------------------------------- + // BK: stop fighting if something bizarre that shouldn't happen, happens + // ---------------------------------------------------------------------------------------- + + if (bkEvaluationSanityCheck(oIntruder, GetFollowDistance()) == TRUE) + return; + + // ** Store HOw Difficult the combat is for this round + int nDiff = GetCombatDifficulty(); + SetLocalInt(OBJECT_SELF, "NW_L_COMBATDIFF", nDiff); + + // MyPrintString("COMBAT: " + IntToString(nDiff)); + + // ---------------------------------------------------------------------------------------- + // If no special target has been passed into the function + // then choose an appropriate target + // ---------------------------------------------------------------------------------------- + if (GetIsObjectValid(oIntruder) == FALSE) + oIntruder = bkAcquireTarget(); + + + if (GetIsDead(oIntruder) == TRUE) + { + // ---------------------------------------------------------------------------------------- + // If for some reason my target is dead, then leave + // the poor guy alone. Jeez. What kind of monster am I? + // ---------------------------------------------------------------------------------------- + return; + } + + // ---------------------------------------------------------------------------------------- + /* + JULY 11 2003 + If in combat round already (variable set) do not enter it again. + This is meant to prevent multiple calls to DetermineCombatRound + from happening during the *same* round. + + This variable is turned on at the start of this function call. + It is turned off at each "return" point for this function + */ + // ---------------------------------------------------------------------------------------- + if (__InCombatRound() == TRUE) + { + return; + } + + __TurnCombatRoundOn(TRUE); + + // ---------------------------------------------------------------------------------------- + // DetermineCombatRound: ACTIONS + // ---------------------------------------------------------------------------------------- + if(GetIsObjectValid(oIntruder)) + { + + if(TalentPersistentAbilities()) // * Will put up things like Auras quickly + { + __TurnCombatRoundOn(FALSE); + return; + } + + // ---------------------------------------------------------------------------------------- + // BK September 2002 + // If a succesful tactic has been chosen then + // exit this function directly + // ---------------------------------------------------------------------------------------- + + if (chooseTactics(oIntruder) == 99) + { + __TurnCombatRoundOn(FALSE); + return; + } + + // ---------------------------------------------------------------------------------------- + // This check is to make sure that people do not drop out of + // combat before they are supposed to. + // ---------------------------------------------------------------------------------------- + + object oNearEnemy = GetNearestSeenEnemy(); + DetermineCombatRound(oNearEnemy); + + return; + } + __TurnCombatRoundOn(FALSE); + + // ---------------------------------------------------------------------------------------- + // This is a call to the function which determines which + // way point to go back to. + // ---------------------------------------------------------------------------------------- + ClearAllActions(); + SetLocalObject(OBJECT_SELF, + "NW_GENERIC_LAST_ATTACK_TARGET", + OBJECT_INVALID); + WalkWayPoints(); +} + + + +//:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Allows the listener to react in a manner + consistant with the given shout but only to one + combat shout per round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// + +//NOTE ABOUT COMMONERS +/* + Commoners are universal cowards. If you attack anyone they will flee for 4 seconds away from the attacker. + However to make the commoners into a mob, make a single commoner at least 10th level of the same faction. + If that higher level commoner is attacked or killed then the commoners will attack the attacker. They will disperse again + after some of them are killed. Should NOT make multi-class creatures using commoners. +*/ +//NOTE ABOUT BLOCKERS +/* + It should be noted that the Generic Script for On Dialogue attempts to get a local set on the shouter by itself. + This object represents the LastOpenedBy object. It is this object that becomes the oIntruder within this function. +*/ + +//NOTE ABOUT INTRUDERS +/* + The intruder object is for cases where a placable needs to pass a LastOpenedBy Object or a AttackMyAttacker + needs to make his attacker the enemy of everyone. +*/ + +void RespondToShout(object oShouter, int nShoutIndex, object oIntruder = OBJECT_INVALID) +{ + + // Pausanias: Do not respond to shouts if you've surrendered. + int iSurrendered = GetLocalInt(OBJECT_SELF,"Generic_Surrender"); + if (iSurrendered) return; + + switch (nShoutIndex) + { + case 1://NW_GENERIC_SHOUT_I_WAS_ATTACKED: + { + object oTarget = oIntruder; + if(!GetIsObjectValid(oTarget)) + { + oTarget = GetLastHostileActor(oShouter); + } + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oTarget)) + { + if(!GetIsFriend(oTarget) && GetIsFriend(oShouter)) + { + RemoveAmbientSleep(); + //DetermineCombatRound(oTarget); + DetermineCombatRound(GetLastHostileActor(oShouter)); + } + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + else + { + DetermineCombatRound(oIntruder); + } + } + else + { + DetermineSpecialBehavior(); + } + } + break; + + case 2://NW_GENERIC_SHOUT_MOB_ATTACK: + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + + //Is friendly check to make sure that only like minded commoners attack. + if(GetIsFriend(oShouter)) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + //if(TalentMeleeAttack()) {return;} + } + else + { + DetermineSpecialBehavior(); + } + } + break; + + case 3://NW_GENERIC_SHOUT_I_AM_DEAD: + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + //Use I was attacked script above + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(GetLastHostileActor(oShouter))) + { + if(!GetIsFriend(GetLastHostileActor(oShouter)) && GetIsFriend(oShouter)) + { + DetermineCombatRound(GetLastHostileActor(oShouter)); + } + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + else + { + DetermineCombatRound(); + } + + } + else + { + DetermineSpecialBehavior(); + } + } + break; + //For this shout to work the object must shout the following + //string sHelp = "NW_BLOCKER_BLK_" + GetTag(OBJECT_SELF); + case 4: //BLOCKER OBJECT HAS BEEN DISTURBED + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oIntruder)) + { + SetIsTemporaryEnemy(oIntruder); + DetermineCombatRound(oIntruder); + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(oIntruder); + } + else + { + DetermineCombatRound(); + } + } + break; + + case 5: //ATTACK MY TARGET + { + AdjustReputation(oIntruder, OBJECT_SELF, -100); + if(GetIsFriend(oShouter)) + { + SetIsTemporaryEnemy(oIntruder); + ClearActions(CLEAR_NW_I0_GENERIC_834); + DetermineCombatRound(oIntruder); + } + } + break; + + case 6: //CALL_TO_ARMS + { + //This was once commented out. + DetermineCombatRound(); + } + break; + + //ASSOCIATE SHOUT RESPONSES ****************************************************************************** + + /* This was moved into X0_I0_HENCHMAN as bkRespondToHenchmenShout + case ASSOCIATE_COMMAND_ATTACKNEAREST: //Used to de-activate AGGRESSIVE DEFEND MODE + { + ResetHenchmenState(); + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + DetermineCombatRound(); + } + break; + + case ASSOCIATE_COMMAND_FOLLOWMASTER: //Only used to retreat, or break free from Stand Ground Mode + { + ResetHenchmenState(); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + DelayCommand(2.5, VoiceCanDo()); + + if(GetAssociateState(NW_ASC_AGGRESSIVE_STEALTH)) + { + //ActionUseSkill(SKILL_HIDE, OBJECT_SELF); + } + if(GetAssociateState(NW_ASC_AGGRESSIVE_SEARCH)) + { + ActionUseSkill(SKILL_SEARCH, OBJECT_SELF); + } + ActionForceFollowObject(GetMaster(), GetFollowDistance()); + SetAssociateState(NW_ASC_IS_BUSY); + DelayCommand(5.0, SetAssociateState(NW_ASC_IS_BUSY, FALSE)); + } + break; + + case ASSOCIATE_COMMAND_GUARDMASTER: //Used to activate AGGRESSIVE DEFEND MODE + { + ResetHenchmenState(); + DelayCommand(2.5, VoiceCanDo()); + //Companions will only attack the Masters Last Attacker + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + if(GetIsObjectValid(GetLastHostileActor(GetMaster()))) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + } + break; + + case ASSOCIATE_COMMAND_HEALMASTER: //Ignore current healing settings and heal me now + { + ResetHenchmenState(); + //SetCommandable(TRUE); + if(TalentCureCondition()) {DelayCommand(2.0, VoiceCanDo()); return;} + if(TalentHeal(TRUE)) {DelayCommand(2.0, VoiceCanDo()); return;} + DelayCommand(2.5, VoiceCannotDo()); + } + break; + + case ASSOCIATE_COMMAND_MASTERFAILEDLOCKPICK: //Check local for Re-try locked doors and + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(GetAssociateState(NW_ASC_RETRY_OPEN_LOCKS)) + { + int bValid = TRUE; + object oLastObject = GetLockedObject(GetMaster()); + int nSkill = GetSkillRank(SKILL_OPEN_LOCK) - GetAbilityModifier(ABILITY_DEXTERITY); + + if(GetIsObjectValid(oLastObject) && GetPlotFlag(oLastObject) == FALSE) + { + if(GetIsDoorActionPossible(oLastObject, DOOR_ACTION_KNOCK) || GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_KNOCK)) + { + ClarAllActions(); + VoiceCanDo(); + ActionCastSpellAtObject(SPELL_KNOCK, oLastObject); + ActionWait(1.0); + bValid = FALSE; + } + else if (GetIsDoorActionPossible(oLastObject, DOOR_ACTION_UNLOCK)|| GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_UNLOCK)) + { + ClarAllActions(); + VoicePicklock(); + ActionWait(1.0); + ActionUseSkill(SKILL_OPEN_LOCK,oLastObject); + bValid = FALSE; + } + else if(nSkill < 5 && GetAbilityScore(OBJECT_SELF, ABILITY_STRENGTH) >= 16 && GetSkillRank(SKILL_OPEN_LOCK) <= 0) + { + if(GetIsDoorActionPossible(oLastObject, DOOR_ACTION_BASH) || GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_BASH)) + { + ClarAllActions(); + VoiceCanDo(); + ActionEquipMostDamagingMelee(oLastObject); + WrapperActionAttack(oLastObject); + SetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH", oLastObject); + bValid = FALSE; + } + } + if(bValid == TRUE) + { + //ClarAllActions(); + VoiceCannotDo(); + } + else + { + ActionDoCommand(VoiceTaskComplete()); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERUNDERATTACK: //Check whether the master has you in AGGRESSIVE DEFEND MODE + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + //Check the henchmens current target + object oTarget = GetAttemptedAttackTarget(); + if(!GetIsObjectValid(oTarget)) + { + oTarget = GetAttemptedSpellTarget(); + if(!GetIsObjectValid(oTarget)) + { + if(GetAssociateState(NW_ASC_MODE_DEFEND_MASTER)) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + else + { + DetermineCombatRound(); + } + } + } + //Switch targets only if the target is not attacking the master and is greater than 6.0 from + //the master. + if(GetAttackTarget(oTarget) != GetMaster() && GetDistanceBetween(oTarget, GetMaster()) > 6.0) + { + if(GetAssociateState(NW_ASC_MODE_DEFEND_MASTER) && GetIsObjectValid(GetLastHostileActor(GetMaster()))) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + } + } + } + break; + + case ASSOCIATE_COMMAND_STANDGROUND: //No longer follow the master or guard him + { + SetAssociateState(NW_ASC_MODE_STAND_GROUND); + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE); + DelayCommand(2.0, VoiceCanDo()); + WrapperActionAttack(OBJECT_INVALID); + ClarAllActions(); + } + break; + + case ASSOCIATE_COMMAND_MASTERSAWTRAP: + { + int nCheck = 0; + if(!GetIsInCombat()) + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + object oTrap = GetLastTrapDetected(); + if(GetIsObjectValid(oTrap)) + { + int nTrapDC = GetTrapDisarmDC(oTrap); + int nSkill = GetSkillRank(SKILL_DISABLE_TRAP); + int nMod = GetAbilityModifier(ABILITY_DEXTERITY); + if((nSkill - nMod) > 0) + { + nSkill = nSkill + 20 - nTrapDC; + } + else + { + nSkill = 0; + nCheck = 1; + } + + if(GetCurrentAction(OBJECT_SELF) != ACTION_DISABLETRAP && nSkill > 0) + { + VoiceStop(); + if(GetHasSkill(SKILL_DISABLE_TRAP, OBJECT_SELF)) + { + ClarAllActions(); + ActionUseSkill(SKILL_DISABLE_TRAP, oTrap); + ActionDoCommand(SetCommandable(TRUE)); + ActionDoCommand(VoiceTaskComplete()); + SetCommandable(FALSE); + nCheck = 2; + } + } + else if(nCheck = 0 && + GetSkillRank(SKILL_DISABLE_TRAP) > 0 && + GetCurrentAction(OBJECT_SELF) != ACTION_DISABLETRAP) + { + VoiceCannotDo(); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERATTACKEDOTHER: + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(!GetAssociateState(NW_ASC_MODE_DEFEND_MASTER)) + { + if(!GetIsFighting(OBJECT_SELF)) + { + object oAttack = GetAttackTarget(GetMaster()); + if(GetIsObjectValid(oAttack) && GetObjectSeen(oAttack)) + { + ClarAllActions(); + DetermineCombatRound(oAttack); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERGOINGTOBEATTACKED: + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(!GetIsFighting(OBJECT_SELF)) + { + object oAttacker = GetGoingToBeAttackedBy(GetMaster()); + if(GetIsObjectValid(oAttacker) && GetObjectSeen(oAttacker)) + { + ClarAllActions(); + DetermineCombatRound(oAttacker); + } + } + } + } + break; + + case ASSOCIATE_COMMAND_LEAVEPARTY: + { + object oMaster = GetMaster(); + if(GetIsObjectValid(oMaster)) + { + ClarAllActions(); + if(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, GetMaster()) == OBJECT_SELF) + { + AddJournalQuestEntry("Henchman",50,GetMaster(),FALSE,FALSE,TRUE); + } + SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", oMaster); + RemoveHenchman(oMaster, OBJECT_SELF); + } + + } + break; */ + } +} + +//:://///////////////////////////////////////////// +//:: Set and Get NPC Warning Status +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function sets a local int on OBJECT_SELF + which will be checked in the On Attack, On + Damaged and On Disturbed scripts to check if + the offending party was a PC and was friendly. + The Get will return the status of the local. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +void SetNPCWarningStatus(int nStatus = TRUE) +{ + SetLocalInt(OBJECT_SELF, "NW_GENERIC_WARNING_STATUS", nStatus); +} + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +int GetNPCWarningStatus() +{ + return GetLocalInt(OBJECT_SELF, "NW_GENERIC_WARNING_STATUS"); +} + +//:://///////////////////////////////////////////// +//:: Set SummonHelpIfAttacked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function works in tandem with an encounter + to spawn in guards to fight for the attacked + NPC. MAKE SURE THE ENCOUNTER TAG IS SET TO: + + "ENC_" + NPC TAG +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +//Presently Does not work with the current implementation of encounter trigger +void SetSummonHelpIfAttacked() +{ + string sEncounter = "ENC_" + GetTag(OBJECT_SELF); + object oTrigger = GetObjectByTag(sEncounter); + + if(GetIsObjectValid(oTrigger)) + { + SetEncounterActive(TRUE, oTrigger); + } +} + +//************************************************************************************************************************************ +//************************************************************************************************************************************ +// +// ESCAPE FUNCTIONS +// +//************************************************************************************************************************************ +//************************************************************************************************************************************ + +//:://///////////////////////////////////////////// +//:: Set, Get Activate,Flee to Exit +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The target object flees to the specified + way point and then destroys itself, to be + respawned at a later point. For unkillable + sign post characters who are not meant to fight + back. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +//This function is used only because ActionDoCommand can only accept void functions +void CreateSignPostNPC(string sTag, location lLocal) +{ + CreateObject(OBJECT_TYPE_CREATURE, sTag, lLocal); +} + +void ActivateFleeToExit() +{ + object oExitWay = GetWaypointByTag("EXIT_" + GetTag(OBJECT_SELF)); + int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER"); + location lLocal = GetLocalLocation(OBJECT_SELF, "NW_GENERIC_START_POINT"); + float fDelay = 6.0; + string sTag = GetTag(OBJECT_SELF); + + if(nPlot & NW_FLAG_TELEPORT_RETURN || nPlot & NW_FLAG_TELEPORT_LEAVE) + { + effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + if(nPlot & NW_FLAG_TELEPORT_RETURN) + { + DelayCommand(fDelay, ActionDoCommand(CreateSignPostNPC(sTag, lLocal))); + } + ActionDoCommand(DestroyObject(OBJECT_SELF, 0.75)); + } + else + { + if(nPlot & NW_FLAG_ESCAPE_LEAVE) + { + ActionMoveToObject(oExitWay, TRUE); + ActionDoCommand(DestroyObject(OBJECT_SELF, 1.0)); + } + else if(nPlot & NW_FLAG_ESCAPE_RETURN) + { + ActionMoveToObject(oExitWay, TRUE); + DelayCommand(fDelay, ActionDoCommand(CreateSignPostNPC(sTag, lLocal))); + ActionDoCommand(DestroyObject(OBJECT_SELF, 1.0)); + } + } +} + +int GetFleeToExit() +{ + int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER"); + if(nPlot & NW_FLAG_ESCAPE_RETURN) + { + return TRUE; + } + else if(nPlot & NW_FLAG_ESCAPE_LEAVE) + { + return TRUE; + } + else if(nPlot & NW_FLAG_TELEPORT_RETURN) + { + return TRUE; + } + else if(nPlot & NW_FLAG_TELEPORT_LEAVE) + { + return TRUE; + } + return FALSE; +} + + + +//********************************** +//********************************** +//********************************** +// PRIVATE FUNCTIONS +//********************************** +//********************************** +//********************************** + +//This is experimental and has not been looked at closely. +void ExitAOESpellArea(object oAOEObject) +{ + ClearActions(CLEAR_NW_I0_GENERIC_ExitAOESpellArea); + ActionMoveAwayFromObject(oAOEObject, TRUE, 5.0); + AssignCommand(OBJECT_SELF, DetermineCombatRound()); +} + + +//:://///////////////////////////////////////////// +//:: Get Character Levels +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Returns the combined class levels of the + target. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 22, 2001 +//::////////////////////////////////////////////// + +int GetCharacterLevel(object oTarget) +{ + return GetHitDice(oTarget); +} + + + + +//:://///////////////////////////////////////////// +//:: Remove Ambient Sleep +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Checks if the NPC has sleep on them because + of ambient animations. Sleeping creatures + must make a DC 15 listen check. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Feb 27, 2002 +//::////////////////////////////////////////////// + +void RemoveAmbientSleep() +{ + if(GetHasEffect(EFFECT_TYPE_SLEEP)) + { + effect eSleep = GetFirstEffect(OBJECT_SELF); + while(GetIsEffectValid(eSleep)) + { + if(GetEffectCreator(eSleep) == OBJECT_SELF) + { + int nRoll = d20(); + nRoll += GetSkillRank(SKILL_LISTEN); + nRoll += GetAbilityModifier(ABILITY_WISDOM); + if(nRoll > 15) + { + RemoveEffect(OBJECT_SELF, eSleep); + } + } + eSleep = GetNextEffect(OBJECT_SELF); + } + } +} + + +//:://///////////////////////////////////////////// +//:: Get Locked Object +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Finds the closest locked object to the object + passed in up to a maximum of 10 objects. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: March 15, 2002 +//::////////////////////////////////////////////// + +object GetLockedObject(object oMaster) +{ + int nCnt = 1; + int bValid = TRUE; + object oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetLocation(oMaster), nCnt); + while (GetIsObjectValid(oLastObject) && bValid == TRUE) + { + //COMMENT THIS BACK IN WHEN DOOR ACTION WORKS ON PLACABLE. + + //object oItem = GetFirstItemInInventory(oLastObject); + if(GetLocked(oLastObject)) + { + return oLastObject; + } + nCnt++; + if(nCnt == 10) + { + bValid = FALSE; + } + oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetLocation(oMaster), nCnt); + } + return OBJECT_INVALID; +} + + + + + +//:://///////////////////////////////////////////// +//:: Check if an item is locked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Checks that an item was unlocked. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 19, 2001 +//::////////////////////////////////////////////// + +void CheckIsUnlocked(object oLastObject) +{ + if(GetLocked(oLastObject)) + { + ActionDoCommand(VoiceCuss()); + } + else + { + ActionDoCommand(VoiceCanDo()); + } +} + + +//:://///////////////////////////////////////////// +//:: Play Mobile Ambient Animations +//:: This function is now just a wrapper around +//:: code from x0_i0_anims. +//::////////////////////////////////////////////// +void PlayMobileAmbientAnimations() +{ + if(!GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) { + // not a bird + PlayMobileAmbientAnimations_NonAvian(); + } else { + // a bird + PlayMobileAmbientAnimations_Avian(); + } +} + +//:://///////////////////////////////////////////// +//:: Determine Special Behavior +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the special behavior used by the NPC. + Generally all NPCs who you want to behave differently + than the default behavior. + For these behaviors, passing in a valid object will + cause the creature to become hostile the the attacker. + + MODIFIED February 7 2003: + - Rearranged logic order a little so that the creatures + will actually randomwalk when not fighting + + MODIFIED January 12 2004: + - incorporates "fendis_khan" NPC AI fix so that + herbivores and omnivores will behave like they should + + REVISED January 15 2004: + - a number of enhancements made to fendis' original + code. now everything behaves really well. most + of my changes probably just had to be done to compensate + for the various combat engine changes in NWN 1.60. + still, the sum total benefit is that both herbivores + and omnivores should behave more realistically than before. + make sure all your creatures' script files are recompiled + to reference this new include, since this function + is called from many scripts other than heartbeat! + + REVISED February 25 2004: + - more enhancements made prior to submitting to Tony K + for inclusion in his Henchman/NPC Battle AI package + + REVISED March 06 2004: + - more changes and bugfixes. I think I'm done with this now. + Remember: *factions* for both Herbs and Omni's must be set + to one which is NOT initially hostile to PC's. + i.e. the default Bioware "Hostile" faction WILL NOT WORK. + This means that while Herbivores (deer) will work fine + "out of the box", Omnivores (boars) need their factions + changed. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 14, 2001 +//::////////////////////////////////////////////// + +void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID) +{ + object oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, 1, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + + // Omnivore behavior routine + if(GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE)) + { + // no current attacker and not currently in combat + if(!GetIsObjectValid(oIntruder) && (GetIsInCombat() == FALSE)) + { + // does not have a current target + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + // enemy creature nearby + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 13.0) + { + ClearAllActions(); + DetermineCombatRound(oTarget); + return; + } + int nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + + // neutral creature, too close + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or an "Animal Companion" + SetLocalInt(OBJECT_SELF, "lcTempEnemy", 8); + SetIsTemporaryEnemy(oTarget); + ClearAllActions(); + DetermineCombatRound(oTarget); + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, ++nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + } + if(!IsInConversation(OBJECT_SELF)) + { + // 25% chance of just standing around instead of constantly + // randWalking; i thought it looked odd seeing the animal(s) + // in a constant state of movement, was not realistic, + // at least according to my Nat. Geographic videos + if ( (d4() != 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + return; + } + else if ( (d4() == 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + ClearAllActions(); + return; + } + else + { + ClearAllActions(); + ActionRandomWalk(); + return; + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) // enter combat when attacked + { + // after a while (20-25 seconds), omnivore (boar) "gives up" + // chasing someone who didn't hurt it. but if the person fought back + // this condition won't run and the boar will fight to death + if(GetLocalInt(OBJECT_SELF, "lcTempEnemy") != FALSE && (GetLastDamager() == OBJECT_INVALID || GetLastDamager() != oTarget) ) + { + int nPatience = GetLocalInt(OBJECT_SELF, "lcTempEnemy"); + if (nPatience <= 1) + { + ClearAllActions(); + ClearPersonalReputation(oTarget); // reset reputation + DeleteLocalInt(OBJECT_SELF, "lcTempEnemy"); + return; + } + SetLocalInt(OBJECT_SELF, "lcTempEnemy", --nPatience); + } + ClearAllActions(); + DetermineCombatRound(oIntruder); + } + } + + // Herbivore behavior routine + else if(GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + // no current attacker & not currently in combat + if(!GetIsObjectValid(oIntruder) && (GetIsInCombat() == FALSE)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && // does not have a current target + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 13.0) // enemy creature, too close + { + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, 16.0); // flee from enemy + return; + } + int nTarget = 1; + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + while(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 7.0) // only consider close creatures + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0 && GetAssociateType(oTarget) != ASSOCIATE_TYPE_ANIMALCOMPANION) + { + // oTarget has neutral reputation, and is NOT a druid or ranger or Animal Companion + ClearAllActions(); + ActionMoveAwayFromObject(oTarget, TRUE, 16.0); // run away + return; + } + oTarget = GetNearestCreature(CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, OBJECT_SELF, ++nTarget, + CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_NEUTRAL); + } + if(!IsInConversation(OBJECT_SELF)) + { + + // 75% chance of randomWalking around, 25% chance of just standing there. more realistic + if ( (d4() != 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + return; + } + else if ( (d4() == 1) && (GetCurrentAction() == ACTION_RANDOMWALK) ) + { + ClearAllActions(); + return; + } + else + { + ClearAllActions(); + ActionRandomWalk(); + return; + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) // NEW BEHAVIOR - run away when attacked + { + ClearAllActions(); + ActionMoveAwayFromLocation(GetLocation(OBJECT_SELF), TRUE, 16.0); + } + } +} + + +//:://///////////////////////////////////////////// +//:: Bash Doors +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Used in DetermineCombatRound to keep a + henchmen bashing doors. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 4, 2002 +//::////////////////////////////////////////////// + +int BashDoorCheck(object oIntruder = OBJECT_INVALID) +{ + int bDoor = FALSE; + //This code is here to make sure that henchmen keep bashing doors and placables. + object oDoor = GetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + + // * MODIFICATION February 7 2003 BK + // * don't bash trapped doors. + if (GetIsTrapped(oDoor) ) return FALSE; + + if(GetIsObjectValid(oDoor)) + { + int nDoorMax = GetMaxHitPoints(oDoor); + int nDoorNow = GetCurrentHitPoints(oDoor); + int nCnt = GetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP"); + if(!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)) + || (!GetIsObjectValid(oIntruder) && !GetIsObjectValid(GetMaster()))) + { + if(GetLocked(oDoor)) + { + if(nDoorMax == nDoorNow) + { + nCnt++; + SetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP", nCnt); + } + if(nCnt <= 0) + { + bDoor = TRUE; + if(GetHasFeat(FEAT_IMPROVED_POWER_ATTACK)) + { + ActionUseFeat(FEAT_IMPROVED_POWER_ATTACK, oDoor); + } + else if(GetHasFeat(FEAT_POWER_ATTACK)) + { + ActionUseFeat(FEAT_POWER_ATTACK, oDoor); + } + else + { + WrapperActionAttack(oDoor); + } + } + } + } + if(bDoor == FALSE) + { + VoiceCuss(); + DeleteLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + DeleteLocalInt(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH_HP"); + } + } + return bDoor; +} + +//:://///////////////////////////////////////////// +//:: Determine Class to Use +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines which of a NPCs three classes to + use in DetermineCombatRound +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 4, 2002 +//::////////////////////////////////////////////// + +int DetermineClassToUse() +{ + int nClass; + int nTotal = GetHitDice(OBJECT_SELF); + float fTotal = IntToFloat(nTotal); + + int nState1 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(1))) / fTotal) * 100); + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(1)) + " %" + IntToString(nState1)); + + int nState2 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(2))) / fTotal) * 100) + nState1; + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(2)) + " %" + IntToString(nState2)); + + int nState3 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(3))) / fTotal) * 100) + nState2; + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(3)) + " %" + IntToString(nState3)); + + int nUseClass = d100(); + // MyPrintString("D100 Roll " + IntToString(nUseClass)); + + if(nUseClass <= nState1) + { + nClass = GetClassByPosition(1); + } + else if(nUseClass > nState1 && nUseClass <= nState2) + { + nClass = GetClassByPosition(2); + } + else + { + nClass = GetClassByPosition(3); + } + // MyPrintString(GetName(OBJECT_SELF) + " Return Class = " + IntToString(nClass)); + + return nClass; +} + + + +// void main() {} + diff --git a/nwnds_module/loc_onattacked.ncs b/nwnds_module/loc_onattacked.ncs new file mode 100644 index 000000000..b2d220435 Binary files /dev/null and b/nwnds_module/loc_onattacked.ncs differ diff --git a/nwnds_module/loc_onattacked.nss b/nwnds_module/loc_onattacked.nss new file mode 100644 index 000000000..2ae7f01fc --- /dev/null +++ b/nwnds_module/loc_onattacked.nss @@ -0,0 +1,61 @@ +//:://///////////////////////////////////////////// +//:: OnAttacked for herbivore/omnivore +//:: LOC_ONATTACKED +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +//:: +//:: Should use this for herbi/omnivores only! +//:: +/* + If already fighting then ignore, else determine + combat round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +#include "loc_i0_generic" + +void main() +{ + if(GetFleeToExit()) { + // Run away! + ActivateFleeToExit(); + } else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) { + // We give an attacker one warning before we attack + // This is not fully implemented yet + SetSpawnInCondition(NW_FLAG_SET_WARNINGS, FALSE); + + //Put a check in to see if this attacker was the last attacker + //Possibly change the GetNPCWarning function to make the check + } else { + object oAttacker = GetLastAttacker(); + if (!GetIsObjectValid(oAttacker)) { + // Don't do anything, invalid attacker + + } else if (!GetIsFighting(OBJECT_SELF)) { + // We're not fighting anyone else, so + // start fighting the attacker + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + SetSummonHelpIfAttacked(); + DetermineSpecialBehavior(oAttacker); + } else if (GetArea(oAttacker) == GetArea(OBJECT_SELF)) { + SetSummonHelpIfAttacked(); + DetermineCombatRound(oAttacker); + } + + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + //Shout that I was attacked + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + } + + + if(GetSpawnInCondition(NW_FLAG_ATTACK_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_ATTACKED)); + } +} diff --git a/nwnds_module/loc_ondamaged.ncs b/nwnds_module/loc_ondamaged.ncs new file mode 100644 index 000000000..77eaa8b35 Binary files /dev/null and b/nwnds_module/loc_ondamaged.ncs differ diff --git a/nwnds_module/loc_ondamaged.nss b/nwnds_module/loc_ondamaged.nss new file mode 100644 index 000000000..5ea631deb --- /dev/null +++ b/nwnds_module/loc_ondamaged.nss @@ -0,0 +1,77 @@ +//::////////////////////////////////////////////////// +//:: OnDamaged for herbivore/omnivore +//:: LOC_ONDAMAGED +//::////////////////////////////////////////////////// +/* + If already fighting then ignore, else determine + combat round + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "loc_i0_generic" + +void main() +{ + if(GetFleeToExit()) { + // We're supposed to run away, do nothing + } else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) { + // don't do anything? + } else { + object oDamager = GetLastDamager(); + if (!GetIsObjectValid(oDamager)) { + // don't do anything, we don't have a valid damager + } else if (!GetIsFighting(OBJECT_SELF)) { + // If we're not fighting, determine combat round + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + DetermineSpecialBehavior(oDamager); + } else { + if(!GetObjectSeen(oDamager) + && GetArea(OBJECT_SELF) == GetArea(oDamager)) { + // We don't see our attacker, go find them + ActionMoveToLocation(GetLocation(oDamager), TRUE); + ActionDoCommand(DetermineCombatRound()); + } else { + DetermineCombatRound(); + } + } + } else { + // We are fighting already -- consider switching if we've been + // attacked by a more powerful enemy + object oTarget = GetAttackTarget(); + if (!GetIsObjectValid(oTarget)) + oTarget = GetAttemptedAttackTarget(); + if (!GetIsObjectValid(oTarget)) + oTarget = GetAttemptedSpellTarget(); + + // If our target isn't valid + // or our damager has just dealt us 25% or more + // of our hp in damager + // or our damager is more than 2HD more powerful than our target + // switch to attack the damager. + if (!GetIsObjectValid(oTarget) + || ( + oTarget != oDamager + && ( + GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) + || (GetHitDice(oDamager) - 2) > GetHitDice(oTarget) + ) + ) + ) + { + // Switch targets + DetermineCombatRound(oDamager); + } + } + } + + // Send the user-defined event signal + if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED)); + } +} + diff --git a/nwnds_module/loc_percept.ncs b/nwnds_module/loc_percept.ncs new file mode 100644 index 000000000..480907694 Binary files /dev/null and b/nwnds_module/loc_percept.ncs differ diff --git a/nwnds_module/loc_percept.nss b/nwnds_module/loc_percept.nss new file mode 100644 index 000000000..d3df19544 --- /dev/null +++ b/nwnds_module/loc_percept.nss @@ -0,0 +1,153 @@ +//::////////////////////////////////////////////////// +//:: OnPerception for herbivore/omnivore +//:: LOC_PERCEPT +//::////////////////////////////////////////////////// +/* + Default OnPerception event handler for NPCs. + + Handles behavior when perceiving a creature for the + first time. + */ +//::////////////////////////////////////////////////// + +#include "loc_i0_generic" + +void main() +{ + + // * if not runnning normal or better Ai then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + object oPercep = GetLastPerceived(); + int bSeen = GetLastPerceptionSeen(); + int bHeard = GetLastPerceptionHeard(); + if (bHeard == FALSE) + { + // Has someone vanished in front of me? + bHeard = GetLastPerceptionVanished(); + } + + // This will cause the NPC to speak their one-liner + // conversation on perception even if they are already + // in combat. + if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION) + && GetIsPC(oPercep) + && bSeen) + { + SpeakOneLinerConversation(); + } + + // March 5 2003 Brent + // Had to add this section back in, since modifications were not taking this specific + // example into account -- it made invisibility basically useless. + //If the last perception event was hearing based or if someone vanished then go to search mode + if ((GetLastPerceptionVanished()) && GetIsEnemy(GetLastPerceived())) + { + object oGone = GetLastPerceived(); + if((GetAttemptedAttackTarget() == GetLastPerceived() || + GetAttemptedSpellTarget() == GetLastPerceived() || + GetAttackTarget() == GetLastPerceived()) && GetArea(GetLastPerceived()) != GetArea(OBJECT_SELF)) + { + ClearAllActions(); + DetermineCombatRound(); + } + } + + // This section has been heavily revised while keeping the + // pre-existing behavior: + // - If we're in combat, keep fighting. + // - If not and we've perceived an enemy, start to fight. + // Even if the perception event was a 'vanish', that's + // still what we do anyway, since that will keep us + // fighting any visible targets. + // - If we're not in combat and haven't perceived an enemy, + // see if the perception target is a PC and if we should + // speak our attention-getting one-liner. + if (GetIsInCombat(OBJECT_SELF)) + { + // don't do anything else, we're busy + } + // * BK FEB 2003 Only fight if you can see them. DO NOT RELY ON HEARING FOR ENEMY DETECTION + else if (GetIsEnemy(oPercep) && bSeen) + { + // We spotted an enemy and we're not already fighting + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(); + } else + { + SetFacingPoint(GetPosition(oPercep)); + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + DetermineCombatRound(); + } + } + } + else + { + if (bSeen) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + DetermineSpecialBehavior(); + } else if (GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION) + && GetIsPC(oPercep)) + { + // The NPC will speak their one-liner conversation + // This should probably be: + // SpeakOneLinerConversation(oPercep); + // instead, but leaving it as is for now. + ActionStartConversation(OBJECT_SELF); + } + } + else + // * July 14 2003: Some minor reactions based on invisible creatures being nearby + if (bHeard && GetIsEnemy(oPercep)) + { + // * don't want creatures wandering too far after noises + if (GetDistanceToObject(oPercep) <= 7.0) + { + if (GetHasSpell(SPELL_TRUE_SEEING) == TRUE) + { + ActionCastSpellAtObject(SPELL_TRUE_SEEING, OBJECT_SELF); + } + else + if (GetHasSpell(SPELL_SEE_INVISIBILITY) == TRUE) + { + ActionCastSpellAtObject(SPELL_SEE_INVISIBILITY, OBJECT_SELF); + } + else + if (GetHasSpell(SPELL_INVISIBILITY_PURGE) == TRUE) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY_PURGE, OBJECT_SELF); + } + else + { + ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.5); + ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.5); + ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD, 0.5); + } + } + } + + // activate ambient animations or walk waypoints if appropriate + if (!IsInConversation(OBJECT_SELF)) { + if (GetIsPostOrWalking()) { + WalkWayPoints(); + } else if (GetIsPC(oPercep) && + (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) + || GetIsEncounterCreature())) + { + SetAnimationCondition(NW_ANIM_FLAG_IS_ACTIVE); + } + } + } + + // Send the user-defined event if appropriate + if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT) && GetLastPerceptionSeen()) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_PERCEIVE)); + } +} + diff --git a/nwnds_module/loc_spawn_herb.ncs b/nwnds_module/loc_spawn_herb.ncs new file mode 100644 index 000000000..073f0c33e Binary files /dev/null and b/nwnds_module/loc_spawn_herb.ncs differ diff --git a/nwnds_module/loc_spawn_herb.nss b/nwnds_module/loc_spawn_herb.nss new file mode 100644 index 000000000..98980ee5c --- /dev/null +++ b/nwnds_module/loc_spawn_herb.nss @@ -0,0 +1,46 @@ +//::////////////////////////////////////////////////// +//:: LOC_SPAWN_HERB +//:: +//:: OnSpawn script for HERBIVORES (i.e. deer) only. +//:: +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/11/2002 +//::////////////////////////////////////////////////// + +#include "ms_name_inc" +#include "x0_i0_walkway" +#include "x0_i0_behavior" + +void main() +{ + SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL); + SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE); + + // ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** // + + // * Goes through and sets up which shouts the NPC will listen to. + // * + SetListeningPatterns(); + + // * Walk among a set of waypoints. + // * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk + // * among them in order. + // * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there + // * and return to it after combat. + // + // * Optional Parameters: + // * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // + // * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also + // * create waypoints with the tags "WN_" + NPC Tag + "_##" + // * and those will be walked at night. (The standard waypoints + // * will be walked during the day.) + // * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag. + WalkWayPoints(); + + ms_Nomenclature(OBJECT_SELF); + +} + diff --git a/nwnds_module/loc_spawn_omni.ncs b/nwnds_module/loc_spawn_omni.ncs new file mode 100644 index 000000000..f30e9852b Binary files /dev/null and b/nwnds_module/loc_spawn_omni.ncs differ diff --git a/nwnds_module/loc_spawn_omni.nss b/nwnds_module/loc_spawn_omni.nss new file mode 100644 index 000000000..4c6ba85a5 --- /dev/null +++ b/nwnds_module/loc_spawn_omni.nss @@ -0,0 +1,45 @@ +//::////////////////////////////////////////////////// +//:: LOC_SPAWN_OMNI +//:: +//:: OnSpawn script for OMNIVORES (i.e. boars) only. +//:: +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/11/2002 +//::////////////////////////////////////////////////// + +#include "ms_name_inc" +#include "x0_i0_walkway" +#include "x0_i0_behavior" + +void main() +{ + SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL); + SetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE); + + // ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** // + + // * Goes through and sets up which shouts the NPC will listen to. + // * + SetListeningPatterns(); + + // * Walk among a set of waypoints. + // * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk + // * among them in order. + // * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there + // * and return to it after combat. + // + // * Optional Parameters: + // * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // + // * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also + // * create waypoints with the tags "WN_" + NPC Tag + "_##" + // * and those will be walked at night. (The standard waypoints + // * will be walked during the day.) + // * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag. + WalkWayPoints(); + + ms_Nomenclature(OBJECT_SELF); +} + diff --git a/nwnds_module/lootabledoor.utd b/nwnds_module/lootabledoor.utd new file mode 100644 index 000000000..e0c6cf4fc Binary files /dev/null and b/nwnds_module/lootabledoor.utd differ diff --git a/nwnds_module/m_scorpsting001.uti b/nwnds_module/m_scorpsting001.uti new file mode 100644 index 000000000..4ad8d1da3 Binary files /dev/null and b/nwnds_module/m_scorpsting001.uti differ diff --git a/nwnds_module/m_scorpsting002.uti b/nwnds_module/m_scorpsting002.uti new file mode 100644 index 000000000..dafaf3f13 Binary files /dev/null and b/nwnds_module/m_scorpsting002.uti differ diff --git a/nwnds_module/m_scorpsting003.uti b/nwnds_module/m_scorpsting003.uti new file mode 100644 index 000000000..79ba1f145 Binary files /dev/null and b/nwnds_module/m_scorpsting003.uti differ diff --git a/nwnds_module/m_scorpsting004.uti b/nwnds_module/m_scorpsting004.uti new file mode 100644 index 000000000..7321c08d1 Binary files /dev/null and b/nwnds_module/m_scorpsting004.uti differ diff --git a/nwnds_module/m_scorpsting005.uti b/nwnds_module/m_scorpsting005.uti new file mode 100644 index 000000000..f24334904 Binary files /dev/null and b/nwnds_module/m_scorpsting005.uti differ diff --git a/nwnds_module/m_scorpsting006.uti b/nwnds_module/m_scorpsting006.uti new file mode 100644 index 000000000..b9742716c Binary files /dev/null and b/nwnds_module/m_scorpsting006.uti differ diff --git a/nwnds_module/magera_001.utc b/nwnds_module/magera_001.utc new file mode 100644 index 000000000..6b85d2505 Binary files /dev/null and b/nwnds_module/magera_001.utc differ diff --git a/nwnds_module/magera_002.utc b/nwnds_module/magera_002.utc new file mode 100644 index 000000000..b5cbea103 Binary files /dev/null and b/nwnds_module/magera_002.utc differ diff --git a/nwnds_module/magma_cleric.ncs b/nwnds_module/magma_cleric.ncs new file mode 100644 index 000000000..4e5ee45ee Binary files /dev/null and b/nwnds_module/magma_cleric.ncs differ diff --git a/nwnds_module/magma_cleric.nss b/nwnds_module/magma_cleric.nss new file mode 100644 index 000000000..d06294cb6 --- /dev/null +++ b/nwnds_module/magma_cleric.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they don't have Magma domain, unequip the item + if(!GetHasFeat(1153, oPC)) //Magma Domain Power Feat + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/magmagolemhide.uti b/nwnds_module/magmagolemhide.uti new file mode 100644 index 000000000..34a398003 Binary files /dev/null and b/nwnds_module/magmagolemhide.uti differ diff --git a/nwnds_module/magmagolemslam.uti b/nwnds_module/magmagolemslam.uti new file mode 100644 index 000000000..e0557e398 Binary files /dev/null and b/nwnds_module/magmagolemslam.uti differ diff --git a/nwnds_module/magminclothing.uti b/nwnds_module/magminclothing.uti new file mode 100644 index 000000000..09b4fb0eb Binary files /dev/null and b/nwnds_module/magminclothing.uti differ diff --git a/nwnds_module/magminhide.uti b/nwnds_module/magminhide.uti new file mode 100644 index 000000000..99b23277b Binary files /dev/null and b/nwnds_module/magminhide.uti differ diff --git a/nwnds_module/magminslam.uti b/nwnds_module/magminslam.uti new file mode 100644 index 000000000..1c65fe8af Binary files /dev/null and b/nwnds_module/magminslam.uti differ diff --git a/nwnds_module/magmintouch.uti b/nwnds_module/magmintouch.uti new file mode 100644 index 000000000..c4360121a Binary files /dev/null and b/nwnds_module/magmintouch.uti differ diff --git a/nwnds_module/malev_spirit001.utc b/nwnds_module/malev_spirit001.utc new file mode 100644 index 000000000..e1d4742aa Binary files /dev/null and b/nwnds_module/malev_spirit001.utc differ diff --git a/nwnds_module/malevolentspirit.uti b/nwnds_module/malevolentspirit.uti new file mode 100644 index 000000000..7cfbee4e5 Binary files /dev/null and b/nwnds_module/malevolentspirit.uti differ diff --git a/nwnds_module/mandragorachoke.uti b/nwnds_module/mandragorachoke.uti new file mode 100644 index 000000000..ecd017265 Binary files /dev/null and b/nwnds_module/mandragorachoke.uti differ diff --git a/nwnds_module/mandragorahide.uti b/nwnds_module/mandragorahide.uti new file mode 100644 index 000000000..f14e370b4 Binary files /dev/null and b/nwnds_module/mandragorahide.uti differ diff --git a/nwnds_module/md_bl_mast_claw.uti b/nwnds_module/md_bl_mast_claw.uti new file mode 100644 index 000000000..8b19f1e4f Binary files /dev/null and b/nwnds_module/md_bl_mast_claw.uti differ diff --git a/nwnds_module/md_bl_mast_sting.uti b/nwnds_module/md_bl_mast_sting.uti new file mode 100644 index 000000000..b6ebbbaed Binary files /dev/null and b/nwnds_module/md_bl_mast_sting.uti differ diff --git a/nwnds_module/mdfireelemslam.uti b/nwnds_module/mdfireelemslam.uti new file mode 100644 index 000000000..4043c4eda Binary files /dev/null and b/nwnds_module/mdfireelemslam.uti differ diff --git a/nwnds_module/mdmagelemhide.uti b/nwnds_module/mdmagelemhide.uti new file mode 100644 index 000000000..bbdda81ee Binary files /dev/null and b/nwnds_module/mdmagelemhide.uti differ diff --git a/nwnds_module/mdmagelemslam.uti b/nwnds_module/mdmagelemslam.uti new file mode 100644 index 000000000..733ac30ad Binary files /dev/null and b/nwnds_module/mdmagelemslam.uti differ diff --git a/nwnds_module/mdrainelemslam.uti b/nwnds_module/mdrainelemslam.uti new file mode 100644 index 000000000..59c44a88e Binary files /dev/null and b/nwnds_module/mdrainelemslam.uti differ diff --git a/nwnds_module/mdsiltelemslam.uti b/nwnds_module/mdsiltelemslam.uti new file mode 100644 index 000000000..21dc09995 Binary files /dev/null and b/nwnds_module/mdsiltelemslam.uti differ diff --git a/nwnds_module/mdsunelemhide.uti b/nwnds_module/mdsunelemhide.uti new file mode 100644 index 000000000..dfa018304 Binary files /dev/null and b/nwnds_module/mdsunelemhide.uti differ diff --git a/nwnds_module/mdsunelemslam.uti b/nwnds_module/mdsunelemslam.uti new file mode 100644 index 000000000..bb6de5a8f Binary files /dev/null and b/nwnds_module/mdsunelemslam.uti differ diff --git a/nwnds_module/mdwaterelemslam.uti b/nwnds_module/mdwaterelemslam.uti new file mode 100644 index 000000000..f2137121c Binary files /dev/null and b/nwnds_module/mdwaterelemslam.uti differ diff --git a/nwnds_module/melody1.ncs b/nwnds_module/melody1.ncs new file mode 100644 index 000000000..c2a952020 Binary files /dev/null and b/nwnds_module/melody1.ncs differ diff --git a/nwnds_module/melody1.nss b/nwnds_module/melody1.nss new file mode 100644 index 000000000..82d909009 --- /dev/null +++ b/nwnds_module/melody1.nss @@ -0,0 +1,51 @@ +#include "NW_I0_SPELLS" +#include "NW_I0_GENERIC" + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + + effect eImp = EffectVisualEffect(VFX_IMP_DAZED_S); + + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDaze = EffectDazed(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDaze,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + effect eVis2 = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + int nDrain = d2(); + effect eDrain = EffectNegativeLevel(nDrain); + effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink2 = EffectLinkEffects(eDrain,eDur); + eLink2 = SupernaturalEffect(eLink2); + + effect eHealing = EffectHeal(nDrain * 5); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + + if(GetIsEnemy(oTarget, oCaster)) + { + if ( GetHasEffect(EFFECT_TYPE_DAZED,oTarget) ) + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealing,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + } + } + } + else + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,RoundsToSeconds(10)); + } + } + } +} diff --git a/nwnds_module/melody2.ncs b/nwnds_module/melody2.ncs new file mode 100644 index 000000000..e59f08615 Binary files /dev/null and b/nwnds_module/melody2.ncs differ diff --git a/nwnds_module/melody2.nss b/nwnds_module/melody2.nss new file mode 100644 index 000000000..0ecc49015 --- /dev/null +++ b/nwnds_module/melody2.nss @@ -0,0 +1,61 @@ +#include "NW_I0_SPELLS" +#include "NW_I0_GENERIC" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + + effect eImp = EffectVisualEffect(VFX_IMP_DAZED_S); + + effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + effect eDaze = EffectDazed(); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink = EffectLinkEffects(eDaze,eVis); + eLink = EffectLinkEffects(eLink,eDur); + + effect eVis2 = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + + int nDrain; + effect eDrain; + effect eLink2; + effect eHealing; + + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + if ( GetHasEffect(EFFECT_TYPE_DAZED,oTarget) ) + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + nDrain = d2(); + eDrain = EffectNegativeLevel(nDrain); + + eLink2 = EffectLinkEffects(eDrain,eDur); + eLink2 = SupernaturalEffect(eLink2); + eHealing = EffectHeal(nDrain * 5); + + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eLink2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealing,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + } + } + } + else + { + if ( !MySavingThrow(SAVING_THROW_WILL,oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS,oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,RoundsToSeconds(10)); + } + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/melody3.ncs b/nwnds_module/melody3.ncs new file mode 100644 index 000000000..c506d59e5 Binary files /dev/null and b/nwnds_module/melody3.ncs differ diff --git a/nwnds_module/melody3.nss b/nwnds_module/melody3.nss new file mode 100644 index 000000000..0fc1df0a1 --- /dev/null +++ b/nwnds_module/melody3.nss @@ -0,0 +1,32 @@ +#include "NW_I0_SPELLS" +//#include "x2_inc_spellhook" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + effect eAOE; + int nEffectType; + + int bValid = FALSE; + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator(OBJECT_SELF)) + { + nEffectType = GetEffectType(eAOE); + if ( nEffectType == EFFECT_TYPE_DAZED ) + { + if(GetEffectSpellId(eAOE) == -1) + { + RemoveEffect(oTarget, eAOE); + bValid = TRUE; + } + } + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } +} diff --git a/nwnds_module/meortypropertie.uti b/nwnds_module/meortypropertie.uti new file mode 100644 index 000000000..62aa91e33 Binary files /dev/null and b/nwnds_module/meortypropertie.uti differ diff --git a/nwnds_module/merchantproperty.uti b/nwnds_module/merchantproperty.uti new file mode 100644 index 000000000..c6ee59f20 Binary files /dev/null and b/nwnds_module/merchantproperty.uti differ diff --git a/nwnds_module/metal_item.ncs b/nwnds_module/metal_item.ncs new file mode 100644 index 000000000..9c064176f Binary files /dev/null and b/nwnds_module/metal_item.ncs differ diff --git a/nwnds_module/metal_item.nss b/nwnds_module/metal_item.nss new file mode 100644 index 000000000..694ae3616 --- /dev/null +++ b/nwnds_module/metal_item.nss @@ -0,0 +1,26 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" + +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + + if((GetLevelByClass(CLASS_TYPE_DRUID,oPC) >= 1) || + (GetRacialType(oPC) == 30)) // Villichi can't use metal items. + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/mil_clothing667.uti b/nwnds_module/mil_clothing667.uti new file mode 100644 index 000000000..6fc839c61 Binary files /dev/null and b/nwnds_module/mil_clothing667.uti differ diff --git a/nwnds_module/mil_clothing668.uti b/nwnds_module/mil_clothing668.uti new file mode 100644 index 000000000..fdc0b9790 Binary files /dev/null and b/nwnds_module/mil_clothing668.uti differ diff --git a/nwnds_module/mil_tailor.dlg b/nwnds_module/mil_tailor.dlg new file mode 100644 index 000000000..cb3f1063d Binary files /dev/null and b/nwnds_module/mil_tailor.dlg differ diff --git a/nwnds_module/mmorpgspawner.utp b/nwnds_module/mmorpgspawner.utp new file mode 100644 index 000000000..7216b9486 Binary files /dev/null and b/nwnds_module/mmorpgspawner.utp differ diff --git a/nwnds_module/mocvendor.dlg b/nwnds_module/mocvendor.dlg new file mode 100644 index 000000000..6bd735e57 Binary files /dev/null and b/nwnds_module/mocvendor.dlg differ diff --git a/nwnds_module/module.ifo b/nwnds_module/module.ifo new file mode 100644 index 000000000..c2ec61123 Binary files /dev/null and b/nwnds_module/module.ifo differ diff --git a/nwnds_module/module.jrl b/nwnds_module/module.jrl new file mode 100644 index 000000000..92faf2f89 Binary files /dev/null and b/nwnds_module/module.jrl differ diff --git a/nwnds_module/monspiderhide.uti b/nwnds_module/monspiderhide.uti new file mode 100644 index 000000000..b9db2635c Binary files /dev/null and b/nwnds_module/monspiderhide.uti differ diff --git a/nwnds_module/monst_scorp001.utc b/nwnds_module/monst_scorp001.utc new file mode 100644 index 000000000..96138fd0f Binary files /dev/null and b/nwnds_module/monst_scorp001.utc differ diff --git a/nwnds_module/monst_scorp002.utc b/nwnds_module/monst_scorp002.utc new file mode 100644 index 000000000..5529c6a02 Binary files /dev/null and b/nwnds_module/monst_scorp002.utc differ diff --git a/nwnds_module/monst_scorp003.utc b/nwnds_module/monst_scorp003.utc new file mode 100644 index 000000000..c681b0e02 Binary files /dev/null and b/nwnds_module/monst_scorp003.utc differ diff --git a/nwnds_module/monst_scorp004.utc b/nwnds_module/monst_scorp004.utc new file mode 100644 index 000000000..8b346115a Binary files /dev/null and b/nwnds_module/monst_scorp004.utc differ diff --git a/nwnds_module/monst_scorp005.utc b/nwnds_module/monst_scorp005.utc new file mode 100644 index 000000000..9ca4c4bcd Binary files /dev/null and b/nwnds_module/monst_scorp005.utc differ diff --git a/nwnds_module/monst_scorp006.utc b/nwnds_module/monst_scorp006.utc new file mode 100644 index 000000000..17c81819b Binary files /dev/null and b/nwnds_module/monst_scorp006.utc differ diff --git a/nwnds_module/monst_spider001.utc b/nwnds_module/monst_spider001.utc new file mode 100644 index 000000000..de469c640 Binary files /dev/null and b/nwnds_module/monst_spider001.utc differ diff --git a/nwnds_module/monst_spider002.utc b/nwnds_module/monst_spider002.utc new file mode 100644 index 000000000..1677c8189 Binary files /dev/null and b/nwnds_module/monst_spider002.utc differ diff --git a/nwnds_module/monst_spider003.utc b/nwnds_module/monst_spider003.utc new file mode 100644 index 000000000..b7e4f87cc Binary files /dev/null and b/nwnds_module/monst_spider003.utc differ diff --git a/nwnds_module/monst_spider004.utc b/nwnds_module/monst_spider004.utc new file mode 100644 index 000000000..2773b05e6 Binary files /dev/null and b/nwnds_module/monst_spider004.utc differ diff --git a/nwnds_module/monst_spider005.utc b/nwnds_module/monst_spider005.utc new file mode 100644 index 000000000..759d4f2a7 Binary files /dev/null and b/nwnds_module/monst_spider005.utc differ diff --git a/nwnds_module/monst_spider006.utc b/nwnds_module/monst_spider006.utc new file mode 100644 index 000000000..5225b5068 Binary files /dev/null and b/nwnds_module/monst_spider006.utc differ diff --git a/nwnds_module/monstspiderbiteg.uti b/nwnds_module/monstspiderbiteg.uti new file mode 100644 index 000000000..89fa1b906 Binary files /dev/null and b/nwnds_module/monstspiderbiteg.uti differ diff --git a/nwnds_module/monstspiderbiteh.uti b/nwnds_module/monstspiderbiteh.uti new file mode 100644 index 000000000..9eb1839ee Binary files /dev/null and b/nwnds_module/monstspiderbiteh.uti differ diff --git a/nwnds_module/monstspiderbitel.uti b/nwnds_module/monstspiderbitel.uti new file mode 100644 index 000000000..36f2a9cc6 Binary files /dev/null and b/nwnds_module/monstspiderbitel.uti differ diff --git a/nwnds_module/monstspiderbitem.uti b/nwnds_module/monstspiderbitem.uti new file mode 100644 index 000000000..38b8d635f Binary files /dev/null and b/nwnds_module/monstspiderbitem.uti differ diff --git a/nwnds_module/monstspiderbites.uti b/nwnds_module/monstspiderbites.uti new file mode 100644 index 000000000..2202e021f Binary files /dev/null and b/nwnds_module/monstspiderbites.uti differ diff --git a/nwnds_module/monstspiderbitet.uti b/nwnds_module/monstspiderbitet.uti new file mode 100644 index 000000000..312d56ea2 Binary files /dev/null and b/nwnds_module/monstspiderbitet.uti differ diff --git a/nwnds_module/mordmagman01.are b/nwnds_module/mordmagman01.are new file mode 100644 index 000000000..d0564ce41 Binary files /dev/null and b/nwnds_module/mordmagman01.are differ diff --git a/nwnds_module/mordmagman01.gic b/nwnds_module/mordmagman01.gic new file mode 100644 index 000000000..5ffb51cb3 Binary files /dev/null and b/nwnds_module/mordmagman01.gic differ diff --git a/nwnds_module/mordmagman01.git b/nwnds_module/mordmagman01.git new file mode 100644 index 000000000..de8576161 Binary files /dev/null and b/nwnds_module/mordmagman01.git differ diff --git a/nwnds_module/mordmagman02.are b/nwnds_module/mordmagman02.are new file mode 100644 index 000000000..487a19a14 Binary files /dev/null and b/nwnds_module/mordmagman02.are differ diff --git a/nwnds_module/mordmagman02.gic b/nwnds_module/mordmagman02.gic new file mode 100644 index 000000000..8f0fe843d Binary files /dev/null and b/nwnds_module/mordmagman02.gic differ diff --git a/nwnds_module/mordmagman02.git b/nwnds_module/mordmagman02.git new file mode 100644 index 000000000..262db0a89 Binary files /dev/null and b/nwnds_module/mordmagman02.git differ diff --git a/nwnds_module/mordmagman03.are b/nwnds_module/mordmagman03.are new file mode 100644 index 000000000..8e44ae948 Binary files /dev/null and b/nwnds_module/mordmagman03.are differ diff --git a/nwnds_module/mordmagman03.gic b/nwnds_module/mordmagman03.gic new file mode 100644 index 000000000..8f0fe843d Binary files /dev/null and b/nwnds_module/mordmagman03.gic differ diff --git a/nwnds_module/mordmagman03.git b/nwnds_module/mordmagman03.git new file mode 100644 index 000000000..06842cceb Binary files /dev/null and b/nwnds_module/mordmagman03.git differ diff --git a/nwnds_module/mordmagman04.are b/nwnds_module/mordmagman04.are new file mode 100644 index 000000000..0fce9f808 Binary files /dev/null and b/nwnds_module/mordmagman04.are differ diff --git a/nwnds_module/mordmagman04.gic b/nwnds_module/mordmagman04.gic new file mode 100644 index 000000000..8f0fe843d Binary files /dev/null and b/nwnds_module/mordmagman04.gic differ diff --git a/nwnds_module/mordmagman04.git b/nwnds_module/mordmagman04.git new file mode 100644 index 000000000..5b2f5cc88 Binary files /dev/null and b/nwnds_module/mordmagman04.git differ diff --git a/nwnds_module/mordmagman05.are b/nwnds_module/mordmagman05.are new file mode 100644 index 000000000..7641175a9 Binary files /dev/null and b/nwnds_module/mordmagman05.are differ diff --git a/nwnds_module/mordmagman05.gic b/nwnds_module/mordmagman05.gic new file mode 100644 index 000000000..8f0fe843d Binary files /dev/null and b/nwnds_module/mordmagman05.gic differ diff --git a/nwnds_module/mordmagman05.git b/nwnds_module/mordmagman05.git new file mode 100644 index 000000000..304d9f8fc Binary files /dev/null and b/nwnds_module/mordmagman05.git differ diff --git a/nwnds_module/mordmagman06.are b/nwnds_module/mordmagman06.are new file mode 100644 index 000000000..1d50b1d4a Binary files /dev/null and b/nwnds_module/mordmagman06.are differ diff --git a/nwnds_module/mordmagman06.gic b/nwnds_module/mordmagman06.gic new file mode 100644 index 000000000..8f0fe843d Binary files /dev/null and b/nwnds_module/mordmagman06.gic differ diff --git a/nwnds_module/mordmagman06.git b/nwnds_module/mordmagman06.git new file mode 100644 index 000000000..43b6322a8 Binary files /dev/null and b/nwnds_module/mordmagman06.git differ diff --git a/nwnds_module/ms_name_inc.ncs b/nwnds_module/ms_name_inc.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ms_name_inc.ncs differ diff --git a/nwnds_module/ms_name_inc.nss b/nwnds_module/ms_name_inc.nss new file mode 100644 index 000000000..49aa6fbf4 --- /dev/null +++ b/nwnds_module/ms_name_inc.nss @@ -0,0 +1,151 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// Markshire's Nomenclature // +// // +// By Thrym of Markshire 5/21/06 // +// // +//////////////////////////////////////////////////////////////////////////////// +// // +// FUNCTION: // +// The Nomenclature is an include file placed in the spawn script // +// nw_c2_default9 designed to assign a name to a generic NPC who may // +// wander towns, roads, shops, etc. // +// // +// Utilizing both SetName and RandomName the system will name the NPC in // +// one of two ways ... // +// // +// "SET_NAME": By setting the variable "SET_NAME" on the NPC and // +// assigning it a string the creature will rename itself upon spawning. // +// This is handy for DM's and builders to create more precisely named // +// creatures for the palette and then generize them upon spawn. // +// // +// eg. Ancient White Dragon in the Creator becomes White Dragon on Spawn. // +// // +// "SET_NAME" = "RANDOM": By setting the same variable to the name "RANDOM" // +// the NPC then is given a random name generated by RACE and GENDER using // +// the RandomName function. // +// // +// eg. Male Dwarven Villager in the creator becomes Gloigan on spawn // +// this time and perhaps Rufus on the next spawned Villager. // +// // +// "NAME_TYPE": Setting this int variable to "1" will cause a Full Name // +// to be generated if the "SET_NAME" is set to "RANDOM". // +// // +// eg. Male Dwarven Villager becomes Gloigan Stonecutter or Rufus Mason. // +// // +//////////////////////////////////////////////////////////////////////////////// + +//void main (){} + +///// FUNCTION DECLARATIONS //////////////////////////////////////////////////// + +// Generates a Random First Name +// based on Race and Gender +// For all Standard PC Races and Animals +string ms_RandomFirstName(object oNPC = OBJECT_SELF); + +// Generates a Random Last Name +// based on Race For all +// Standard PC Races and Animals +string ms_RandomLastName(object oNPC = OBJECT_SELF); + +// Function designed to read the variable +// "SET_NAME" and assign a new name to the NPC +// If the variable is set to "RANDOM" a +// random name is assigned. +// A second variable can be assigned to +// have the random name be a random Full Name. +void ms_Nomenclature(object oNPC = OBJECT_SELF); + + +///// FUNCTIONS //////////////////////////////////////////////////////////////// + +void ms_Nomenclature(object oNPC = OBJECT_SELF) +{ + string sRandomName = GetLocalString(oNPC, "SET_NAME"); + string sTitle = GetLocalString(oNPC, "TITLE"); + string sPostfix = GetLocalString(oNPC, "POSTFIX"); + + if (sRandomName != "") + { + if (sRandomName == "RANDOM") + { + switch (GetLocalInt(oNPC, "NAME_TYPE")) + { + case 1: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + ms_RandomLastName(oNPC); break; + default: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC); break; + } + } + + SetName(oNPC, (sRandomName)); + return; + } +} + +string ms_RandomFirstName(object oNPC = OBJECT_SELF) +{ + int Gender = GetGender(oNPC); + int Race = GetRacialType(oNPC); + + string Name; + + switch (Race) + { + case RACIAL_TYPE_ANIMAL: Name = RandomName(0); break; + case RACIAL_TYPE_DWARF: + switch (Gender) + { default: Name = RandomName(2); break; + case GENDER_FEMALE: Name = RandomName(3); break; } break; + case RACIAL_TYPE_ELF: + switch (Gender) + { default: Name = RandomName(5); break; + case GENDER_FEMALE: Name = RandomName(6); break; } break; + case RACIAL_TYPE_GNOME: + switch (Gender) + { default: Name = RandomName(8); break; + case GENDER_FEMALE: Name = RandomName(9); break; } break; + case RACIAL_TYPE_HALFELF: + switch (Gender) + { default: Name = RandomName(11); break; + case GENDER_FEMALE: Name = RandomName(12); break; } break; + case RACIAL_TYPE_HALFLING: + switch (Gender) + { default: Name = RandomName(14); break; + case GENDER_FEMALE: Name = RandomName(15); break; } break; + case RACIAL_TYPE_HALFORC: + switch (Gender) + { default: Name = RandomName(17); break; + case GENDER_FEMALE: Name = RandomName(18); break; } break; + case RACIAL_TYPE_HUMAN: + switch (Gender) + { default: Name = RandomName(20); break; + case GENDER_FEMALE: Name = RandomName(21); break; } break; + default: + switch (Gender) + { default: Name = RandomName(-1); break; + case GENDER_FEMALE: Name = RandomName(0); break; } break; + } + + return Name; +} + +string ms_RandomLastName(object oNPC = OBJECT_SELF) +{ + int Race = GetRacialType(oNPC); + + string Name; + + switch (Race) + { + case RACIAL_TYPE_DWARF: Name = RandomName(4); break; + case RACIAL_TYPE_ELF: Name = RandomName(7); break; + case RACIAL_TYPE_GNOME: Name = RandomName(10); break; + case RACIAL_TYPE_HALFELF: Name = RandomName(13); break; + case RACIAL_TYPE_HALFLING: Name = RandomName(16); break; + case RACIAL_TYPE_HALFORC: Name = RandomName(19); break; + case RACIAL_TYPE_HUMAN: Name = RandomName(22); break; + default: Name = RandomName(1); break; + } + + return Name; +} diff --git a/nwnds_module/mustardjellyhide.uti b/nwnds_module/mustardjellyhide.uti new file mode 100644 index 000000000..fd2bd15cd Binary files /dev/null and b/nwnds_module/mustardjellyhide.uti differ diff --git a/nwnds_module/mustjellyslam.uti b/nwnds_module/mustjellyslam.uti new file mode 100644 index 000000000..1b396c2f5 Binary files /dev/null and b/nwnds_module/mustjellyslam.uti differ diff --git a/nwnds_module/mutdevourer001.utc b/nwnds_module/mutdevourer001.utc new file mode 100644 index 000000000..87aa5a466 Binary files /dev/null and b/nwnds_module/mutdevourer001.utc differ diff --git a/nwnds_module/mutdevourer002.utc b/nwnds_module/mutdevourer002.utc new file mode 100644 index 000000000..b89cd222f Binary files /dev/null and b/nwnds_module/mutdevourer002.utc differ diff --git a/nwnds_module/n01p01p00.are b/nwnds_module/n01p01p00.are new file mode 100644 index 000000000..a6da380b8 Binary files /dev/null and b/nwnds_module/n01p01p00.are differ diff --git a/nwnds_module/n01p01p00.gic b/nwnds_module/n01p01p00.gic new file mode 100644 index 000000000..cb8eb7816 Binary files /dev/null and b/nwnds_module/n01p01p00.gic differ diff --git a/nwnds_module/n01p01p00.git b/nwnds_module/n01p01p00.git new file mode 100644 index 000000000..937549ef2 Binary files /dev/null and b/nwnds_module/n01p01p00.git differ diff --git a/nwnds_module/n01p02p00.are b/nwnds_module/n01p02p00.are new file mode 100644 index 000000000..0e8e03bca Binary files /dev/null and b/nwnds_module/n01p02p00.are differ diff --git a/nwnds_module/n01p02p00.gic b/nwnds_module/n01p02p00.gic new file mode 100644 index 000000000..7995f1dcd Binary files /dev/null and b/nwnds_module/n01p02p00.gic differ diff --git a/nwnds_module/n01p02p00.git b/nwnds_module/n01p02p00.git new file mode 100644 index 000000000..5954e4799 Binary files /dev/null and b/nwnds_module/n01p02p00.git differ diff --git a/nwnds_module/n01p03p00.are b/nwnds_module/n01p03p00.are new file mode 100644 index 000000000..ce0552cb1 Binary files /dev/null and b/nwnds_module/n01p03p00.are differ diff --git a/nwnds_module/n01p03p00.gic b/nwnds_module/n01p03p00.gic new file mode 100644 index 000000000..205f59231 Binary files /dev/null and b/nwnds_module/n01p03p00.gic differ diff --git a/nwnds_module/n01p03p00.git b/nwnds_module/n01p03p00.git new file mode 100644 index 000000000..a474c5745 Binary files /dev/null and b/nwnds_module/n01p03p00.git differ diff --git a/nwnds_module/n01p04p00.are b/nwnds_module/n01p04p00.are new file mode 100644 index 000000000..bcb539254 Binary files /dev/null and b/nwnds_module/n01p04p00.are differ diff --git a/nwnds_module/n01p04p00.gic b/nwnds_module/n01p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n01p04p00.gic differ diff --git a/nwnds_module/n01p04p00.git b/nwnds_module/n01p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n01p04p00.git differ diff --git a/nwnds_module/n01p05p00.are b/nwnds_module/n01p05p00.are new file mode 100644 index 000000000..1553b8eca Binary files /dev/null and b/nwnds_module/n01p05p00.are differ diff --git a/nwnds_module/n01p05p00.gic b/nwnds_module/n01p05p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n01p05p00.gic differ diff --git a/nwnds_module/n01p05p00.git b/nwnds_module/n01p05p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n01p05p00.git differ diff --git a/nwnds_module/n01p06p00.are b/nwnds_module/n01p06p00.are new file mode 100644 index 000000000..ac2439c72 Binary files /dev/null and b/nwnds_module/n01p06p00.are differ diff --git a/nwnds_module/n01p06p00.gic b/nwnds_module/n01p06p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n01p06p00.gic differ diff --git a/nwnds_module/n01p06p00.git b/nwnds_module/n01p06p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n01p06p00.git differ diff --git a/nwnds_module/n01p07p00.are b/nwnds_module/n01p07p00.are new file mode 100644 index 000000000..293a1c3a9 Binary files /dev/null and b/nwnds_module/n01p07p00.are differ diff --git a/nwnds_module/n01p07p00.gic b/nwnds_module/n01p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n01p07p00.gic differ diff --git a/nwnds_module/n01p07p00.git b/nwnds_module/n01p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/n01p07p00.git differ diff --git a/nwnds_module/n02p03p00.are b/nwnds_module/n02p03p00.are new file mode 100644 index 000000000..aeb63d426 Binary files /dev/null and b/nwnds_module/n02p03p00.are differ diff --git a/nwnds_module/n02p03p00.gic b/nwnds_module/n02p03p00.gic new file mode 100644 index 000000000..6a0ede254 Binary files /dev/null and b/nwnds_module/n02p03p00.gic differ diff --git a/nwnds_module/n02p03p00.git b/nwnds_module/n02p03p00.git new file mode 100644 index 000000000..24c182f23 Binary files /dev/null and b/nwnds_module/n02p03p00.git differ diff --git a/nwnds_module/n02p04p00.are b/nwnds_module/n02p04p00.are new file mode 100644 index 000000000..66a052255 Binary files /dev/null and b/nwnds_module/n02p04p00.are differ diff --git a/nwnds_module/n02p04p00.gic b/nwnds_module/n02p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n02p04p00.gic differ diff --git a/nwnds_module/n02p04p00.git b/nwnds_module/n02p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n02p04p00.git differ diff --git a/nwnds_module/n02p05p00.are b/nwnds_module/n02p05p00.are new file mode 100644 index 000000000..384825dda Binary files /dev/null and b/nwnds_module/n02p05p00.are differ diff --git a/nwnds_module/n02p05p00.gic b/nwnds_module/n02p05p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n02p05p00.gic differ diff --git a/nwnds_module/n02p05p00.git b/nwnds_module/n02p05p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n02p05p00.git differ diff --git a/nwnds_module/n02p06p00.are b/nwnds_module/n02p06p00.are new file mode 100644 index 000000000..6496fb311 Binary files /dev/null and b/nwnds_module/n02p06p00.are differ diff --git a/nwnds_module/n02p06p00.gic b/nwnds_module/n02p06p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n02p06p00.gic differ diff --git a/nwnds_module/n02p06p00.git b/nwnds_module/n02p06p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/n02p06p00.git differ diff --git a/nwnds_module/n02p07p00.are b/nwnds_module/n02p07p00.are new file mode 100644 index 000000000..d6f9f0b79 Binary files /dev/null and b/nwnds_module/n02p07p00.are differ diff --git a/nwnds_module/n02p07p00.gic b/nwnds_module/n02p07p00.gic new file mode 100644 index 000000000..32e5baaec Binary files /dev/null and b/nwnds_module/n02p07p00.gic differ diff --git a/nwnds_module/n02p07p00.git b/nwnds_module/n02p07p00.git new file mode 100644 index 000000000..dcc301b3c Binary files /dev/null and b/nwnds_module/n02p07p00.git differ diff --git a/nwnds_module/n03p07p00.are b/nwnds_module/n03p07p00.are new file mode 100644 index 000000000..b84345895 Binary files /dev/null and b/nwnds_module/n03p07p00.are differ diff --git a/nwnds_module/n03p07p00.gic b/nwnds_module/n03p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/n03p07p00.gic differ diff --git a/nwnds_module/n03p07p00.git b/nwnds_module/n03p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/n03p07p00.git differ diff --git a/nwnds_module/namech_rogue001.utc b/nwnds_module/namech_rogue001.utc new file mode 100644 index 000000000..304d26385 Binary files /dev/null and b/nwnds_module/namech_rogue001.utc differ diff --git a/nwnds_module/namechbite.uti b/nwnds_module/namechbite.uti new file mode 100644 index 000000000..c1f3c3df7 Binary files /dev/null and b/nwnds_module/namechbite.uti differ diff --git a/nwnds_module/namechclaw.uti b/nwnds_module/namechclaw.uti new file mode 100644 index 000000000..86aa9bdb8 Binary files /dev/null and b/nwnds_module/namechclaw.uti differ diff --git a/nwnds_module/namechhide.uti b/nwnds_module/namechhide.uti new file mode 100644 index 000000000..2753b464a Binary files /dev/null and b/nwnds_module/namechhide.uti differ diff --git a/nwnds_module/namli.utc b/nwnds_module/namli.utc new file mode 100644 index 000000000..07df0ce60 Binary files /dev/null and b/nwnds_module/namli.utc differ diff --git a/nwnds_module/nbde_inc.nss b/nwnds_module/nbde_inc.nss new file mode 100644 index 000000000..673fd31df --- /dev/null +++ b/nwnds_module/nbde_inc.nss @@ -0,0 +1,747 @@ +//void main(){} + +//:://///////////////////////////////////////////// +//:: Natural Bioware Database Extension v1.0 +//:: nbde_inc +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Knat +//:: Created On: 8/2004 +//::////////////////////////////////////////////// +/* + +Natural Bioware Database Extension v1.0 +"Andale, Andale! EEEE-ha....!" + +----------------------------------------------------------------------------- +--- What is NBDE ? +----------------------------------------------------------------------------- + +NBDE is basically a wrapper for the standard bioware database system, +eliminating most of its restrictions. But even more important, it significantly +boosts both reading and writing speed. + +It will make your db scripts more secure and always keeps your database files +in the best possible shape. It furthermore reduces the amount of overhead in +your database and keeps it as slim as possible. + +there is no need to periodically use a pack utility, which further +reduces administrative tasks... + +and this all gets achieved with the use of this simple script. I recommend any +scripter to check this out if he plans to use biowares onboard database +functionality. It should also be very easy to convert already existing scripts. + +----------------------------------------------------------------------------- +--- Installation +----------------------------------------------------------------------------- + +Simply import nbde.erf and you are done. + +It includes the following stuff: + +Scripts: + + name: nbde_inc + main include script... + +Areas: + + name: _NBDE + special area. this is a 2x2 microset area holding the database vault container. + you can delete this area and move the container to another place if you want. + +Items: + + Custom > Special > Custom 4 + name: Database + special database item with the resref "nbde_database" + don't touch this item... + +----------------------------------------------------------------------------- +--- Eliminated Restrictions ? +----------------------------------------------------------------------------- + +Biowares database system mimics the interface of Local Variables. +Instead of SetLocalInt() you use SetCampaignInt(), GetLocalInt() turns into +GetCampaignInt(). This makes it very easy to use, even for novice scripters. +But the normal bioware database does not consequently implement this approach. +Several stumbling blocks, slight differences to normal Set-/GetLocal functions, +may lead to severe functional problems and hard to track bugs if you try to +achieve a bit more complex goals... + +>>> 32-Char sVarName Limitation: +-------------------------------- + +the sVarName parameter in the original functions only accepts strings with a +maximum length of 32 chars. it will simply cut the string if it exceeds this +limit... + +example: + +SetCampaignInt("MYDB", "PREFIX" + GetTag(oArea), 100); + +The second parameter is the sVarName one, with the 32 char limit. The above +statement is a bit risky, because GetTag(oArea) could return a string with a +maximum length of 32. "PREFIX" has a length of 6 chars, so any area with a +tag of length >26 could lead to unintended sVarNames. + +Same for this example: + +SetCampaignInt("MYDB", GetName(oPC) + GetPCPlayerName(oPC), 100); + +same problem. GetName() alone may return a string with a length >32, which +could again lead to a problematic sVarName. + +NBDE completely eliminates the 32-char sVarName limitation and enables the +scripter to use the full scope of dynamically concatenated sVarNames, +without the need of hashing systems or other workarounds, which generally +consume a bit of extra cpu time... + +>>> UNIQUE sVarName Limitation: +------------------------------- + +the sVarName parameter in the original functions MUST be unique across the +entire database, regardless of the variable type. + +example: + +SetCampaignInt("MYDB", "TEST", 10); +SetCampaignString("MYDB", "TEST", "ABCD"); + +the second line will OVERWRITE the former integer variable "TEST" with a string. +This means a GetCampaignInt("MYDB", "TEST") returns 0 + +using NBDE eliminates this limitation. +It works now similar to LocalVariables (the intended goal) + +NBDE conversion of the above example: + +NBDE_SetCampaignInt("MYDB", "TEST", 10); +NBDE_SetCampaignString("MYDB", "TEST", "ABCD"); + +second line will not overwrite the integer variable + +NBDE_GetCampaignInt("MYDB", "TEST") returns the correct 10 +NBDE_GetCampaignString("MYDB", "TEST") returns "ABCD" + +The original function set contains only one delete command, called +DeleteCampaignVariable(), because of the unique nature of sVarNames. + +NBDE contains one delete command for each variable type, to account for the +possible non uniqueness: + +NBDE_DeleteCampaignInt() +NBDE_DeleteCampaignFloat() +NBDE_DeleteCampaignString() +NBDE_DeleteCampaignVector() +NBDE_DeleteCampaignLocation() + +this again now works similar to the LocalVariables interface, which also +gives you a delete command for each variable type: + +aka DeleteLoaclInt(), DeleteLocalFloat(), DeleteLocalString(), + DeleteLocalVector(), DeleteLocalLocation() + +>>> Broken Locations: +--------------------- + +the original SetCampaignLocation/GetCampaignLocation functions are not very +reliable, because they are using the areas object-id for reference, which +is a runtime generated ID. stored locations in the database can get invalid +if you change the area layout in the toolset (e.g. deleting old areas, etc.) + +nbde location functions are 100% reliable, as long as you use unique TAGs for +your areas. I repeat, you need to use UNIQUE TAGS for your areas... + +----------------------------------------------------------------------------- +--- No need to pack the database +----------------------------------------------------------------------------- + +NWN's database files grow very large, very fast, because deleted entries get +only "flagged" as deleted. but they still reside in the dabase file physically. + +to stop this evergrowing database, you usually call an external "pack" +utility which reorganizes the database files (deletion of flagged entries, +index re-ordering, etc.) + +unfortunately, the only working pack utility is the one you find in the +/utils directory, called DataPack.exe . But some people reported problems +on large database files... (i never had problems with this tool, though) + +the good news is, you don't need to touch this utility ever, while using +this extension. NBDE will automatically keep all your database files as +compact/small as possible. + +no external maintenance needed... + +NBDE_Delete commands immediately shrink your database in size (physically +deleted records) after a flushing command (read more about that in a minute). + +attention: +there is a known problem in the linux version: + +The DestroyCampaignDatabase command doesnt always work in linux. i think +this relates to the different file systems used. + +you should be ok using the following rules for your database +names (sCampaignName parameter): + + - max length 16 chars + - only use alphanumeric chars and underscore + - NO space + + +----------------------------------------------------------------------------- +--- Usage +----------------------------------------------------------------------------- + +first, include nbde_inc to all scripts using this extension: + +#include "nbde_inc" + +You basically use it the same way you would use the original +database. just add the NBDE_ prefix infront of the function. + +original example: + +int n = GetCampaignInt("MYDB", "MYVAR"); + +nbde conversion: + +#include "nbde_inc" + +int n = NBDE_GetCampaignInt("MYDB", "MYVAR"); + +Important differences: + +Database Flushing: +------------------ + +writing to the database will not issue a physical write directly. +You need to "Flush" a database in order to physically write the contents of +a complete database to your HD. this sounds slow, but its not, because of +the large overhead of standard SetCampaign calls... +Writing out a single integer via SetCampaignInt takes roughly +100ms (0.1 seconds), writing out an object with 1000 integers via +SetCampaignObject takes roughly 150ms. that's the whole +magic behind the system. it basically just consolidates your writes.. + +original example: + +SetCampaignInt("MYDB", "MYVAR1", 10); +SetCampaignInt("MYDB", "MYVAR2", 20); +SetCampaignInt("MYDB", "MYVAR3", 30); +SetCampaignInt("MYDB", "MYVAR4", 40); +SetCampaignInt("MYDB", "MYVAR5", 50); + +nbde conversion: + +NBDE_SetCampaignInt("MYDB", "MYVAR1", 10); +NBDE_SetCampaignInt("MYDB", "MYVAR2", 20); +NBDE_SetCampaignInt("MYDB", "MYVAR3", 30); +NBDE_SetCampaignInt("MYDB", "MYVAR4", 40); +NBDE_SetCampaignInt("MYDB", "MYVAR5", 50); +NBDE_FlushCampaignDatabase("MYDB"); + +the original example takes roughly half a second (500ms), +the converted example only 100ms. + +you can gain a lot of speed and do things impossible with the original +database using the right flushing scheme. you can flush critical data asap +but you can get away flushing not so critical stuff only once every few +minutes, or during onClientLeave, or once an Area is out of players, and so on... + +keep in mind: you can loose data if the server crashes before +you flushed your database. + +delete function: +---------------- + +the original version only got one delete function, DeleteCampaignVariable. +That's because of the unique nature of sVarNames... +NBDE eliminates this restriction and therefore exposes one delete +function for each data-type. + +original example: + +DeleteCampaignVariable("MYDB", "MYVAR"); + +you need to know the datatype of "MYVAR" in order to correctly convert this +line to NBDE. lets assume it's an integer... + +nbde conversion: + +NBDE_DeleteCampaignInt("MYDB", "MYVAR"); + + +Unloading a Database: +--------------------- + +nbde databases are kept in memory. NBDE_UnloadCampaignDatabase() unloads +the database with the name sCampaignName from memory. + +useful to unload databases you don't need often. unloading/reloading is quite +fast, so don't hesitate to use this regulary... + + +*/ + +// database item name, used as sVarName parameter in Store-/RetrieveCampaignObject +const string NBDE_DATABASE_ITEM_VARNAME = "+++_DATABASE_ITEM_+++"; + +// database item resref, needed for auto-creation +const string NBDE_DATABASE_ITEM_RESREF = "nbde_database"; + +// database index prefix +// used to index a database via Get/SetLocalObject +const string NBDE_INDEX_PREFIX = "NBDE_DATABASE_"; + +// database vault tag +// this vault is usually a container +const string NBDE_VAULT_TAG = "NBDE_VAULT"; + +// prefixes used to store locations/vectors as strings +// this should eliminate collisions with normal strings +const string NBDE_LOC_PREFIX = "¥Æ¥"; +const string NBDE_VEC_PREFIX = "ø£ø"; + +// This stores an int out to the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Vastly improved writing speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +void NBDE_SetCampaignInt(string sCampaignName, string sVarname, int nInt, object oPlayer = OBJECT_INVALID); + +// This stores a float out to the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Vastly improved writing speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +void NBDE_SetCampaignFloat(string sCampaignName, string sVarname, float flFloat, object oPlayer = OBJECT_INVALID); + +// This stores a string out to the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Vastly improved writing speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +void NBDE_SetCampaignString(string sCampaignName, string sVarname, string sString, object oPlayer = OBJECT_INVALID); + +// This stores a location out to the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Vastly improved writing speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +// +// Original function is not very reliable, because it is using the areas object-id, which is +// a runtime generated ID. Stored locations may turn invalid in case you change the area layout in the toolset. +// (e.g. deleting old areas) +// +// This function is 100% reliable, as long as you use unique TAGs for your areas +void NBDE_SetCampaignLocation(string sCampaignName, string sVarname, location locLocation, object oPlayer = OBJECT_SELF); + +// This stores a vector out to the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Vastly improved writing speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +void NBDE_SetCampaignVector(string sCampaignName, string sVarname, vector vVector, object oPlayer = OBJECT_SELF); + +// This will read an int from the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Improved reading speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +int NBDE_GetCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will read a float from the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Improved reading speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +float NBDE_GetCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will read a string from the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Improved reading speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +string NBDE_GetCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will read a location from the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Improved reading speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +// +// Original function is not very reliable, because it is using the areas object-id, which is +// a runtime generated ID. Stored locations may turn invalid in case you change the area layout in the toolset. +// (e.g. deleting old areas) +// +// This function is 100% reliable, as long as you use unique TAGs for your areas +location NBDE_GetCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will read a vector from the specified campaign database +// The database name IS case sensitive and it must be the same for both set and get functions. +// If you want a variable to pertain to a specific player in the game, provide a player object. +// +// Improvements to original bioware function: +// Improved reading speed... +// There is no limit on the length of sVarname (original function is limited to 32 chars) +// sVarname must NOT be unique. you can use the same sVarname with a different data-type +vector NBDE_GetCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// this will remove an integer from the specified campaign database +// +// Improvements to original bioware function: +// This will physically delete the variable from the database, not only flagging it +// Database will shrink in size +// No need to pack your database ever +void NBDE_DeleteCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// this will remove a float from the specified campaign database +// +// Improvements to original bioware function: +// This will physically delete the variable from the database, not only flagging it +// Database will shrink in size +// No need to pack your database ever +void NBDE_DeleteCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will remove a string from the specified campaign database +// +// Improvements to original bioware function: +// This will physically delete the variable from the database, not only flagging it +// Database will shrink in size +// No need to pack your database ever +void NBDE_DeleteCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will remove a location from the specified campaign database +// +// Improvements to original bioware function: +// This will physically delete the variable from the database, not only flagging it +// Database will shrink in size +// No need to pack your database ever +void NBDE_DeleteCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will remove a vector from the specified campaign database +// +// Improvements to original bioware function: +// This will physically delete the variable from the database, not only flagging it +// Database will shrink in size +// No need to pack your database ever +void NBDE_DeleteCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID); + +// This will flush a database to disk with a SINGLE StoreCampaignObject() call +// +// Don't use this function in a rapid manner. +// Delay each call to this function by at least 1 second (using delaycommand) +// in order to eliminate possible spikes... +void NBDE_FlushCampaignDatabase(string sCampaignName); + +// NBDE databases are kept in memory. this commands unloads +// the database with the name sCampaignName from memory. +// +// Useful to unload databases you don't need often. +// Unloading/reloading is quite fast, so don't hesitate to use +// this regulary... +// +// Reloading happens automatically, btw... +void NBDE_UnloadCampaignDatabase(string sCampaignName); + + +// --------------------------- IMPLEMENTATION ---------------------------- +/* ----------------------------------------------------------------------- */ + +// everything not in here gets considered an illegal character +// - mixed up for additional security +const string HASH_INDEX = "#i!j$k%l{&M/n(o)p=q?r^¤Xs`Tu'v]AwBxCyDzE1F2-G3t;4I}5Y:J6_K7+Z[Lm9N\ l0kOjPhQ,gRfSeHdU8cVbWa."; + +const int HASH_PRIME = 3021377; + +// simple hash +// returns -1 if string contains illegal character +int NBDE_Hash(string sData) +{ + int nLen = GetStringLength(sData); + int i, nHash, nChar; + for(i=0;i>27)) ^ nChar; + } + return nHash % HASH_PRIME; +} + +// serialize location to padded string +string NBDE_LocationToString(location lLoc) +{ + // serialization garbage... more or less "redo if it screws" code + string sLoc = IntToString(FloatToInt(GetPositionFromLocation(lLoc).x*100)); + sLoc = (GetStringLength(sLoc) < 5) ? sLoc + GetStringLeft(" ",5 - GetStringLength(sLoc)) : GetStringLeft(sLoc,5); + sLoc += IntToString(FloatToInt(GetPositionFromLocation(lLoc).y*100)); + sLoc = (GetStringLength(sLoc) < 10) ? sLoc + GetStringLeft(" ",10 - GetStringLength(sLoc)) : GetStringLeft(sLoc,10); + sLoc += IntToString(FloatToInt(GetPositionFromLocation(lLoc).z*100)); + sLoc = (GetStringLength(sLoc) < 15) ? sLoc + GetStringLeft(" ",15 - GetStringLength(sLoc)) : GetStringLeft(sLoc,15); + sLoc += IntToString(FloatToInt(GetFacingFromLocation(lLoc)*100)); + sLoc = (GetStringLength(sLoc) < 20) ? sLoc + GetStringLeft(" ",20 - GetStringLength(sLoc)) : GetStringLeft(sLoc,20); + sLoc += GetTag(GetAreaFromLocation(lLoc)); + sLoc = (GetStringLength(sLoc) < 52) ? sLoc + GetStringLeft(" ",52 - GetStringLength(sLoc)) : GetStringLeft(sLoc,52); + return sLoc; +} + +// de-serialize string to location +location NBDE_StringToLocation(string sLoc) +{ + // fast de-serialize code using padded strings + vector vVec; + // build vector + vVec.x = StringToFloat(GetStringLeft(sLoc,5)) / 100; + vVec.y = StringToFloat(GetSubString(sLoc,5,5)) / 100; + vVec.z = StringToFloat(GetSubString(sLoc,10,5)) / 100;; + int nPad = FindSubString(GetSubString(sLoc, 20,32)," "); + // build & return location + return Location(GetObjectByTag((nPad != -1) ? GetSubString(sLoc, 20,nPad) : GetSubString(sLoc, 20,32)), vVec, StringToFloat(GetSubString(sLoc,15,5)) / 100); +} + +// serialize vector to padded string +string NBDE_VectorToString(vector vVec) +{ + // serialization garbage... more or less "redo if it screws" code + string sVec = IntToString(FloatToInt(vVec.x*100)); + sVec = (GetStringLength(sVec) < 5) ? sVec + GetStringLeft(" ",5 - GetStringLength(sVec)) : GetStringLeft(sVec,5); + sVec += IntToString(FloatToInt(vVec.y*100)); + sVec = (GetStringLength(sVec) < 10) ? sVec + GetStringLeft(" ",10 - GetStringLength(sVec)) : GetStringLeft(sVec,10); + sVec += IntToString(FloatToInt(vVec.z*100)); + sVec = (GetStringLength(sVec) < 15) ? sVec + GetStringLeft(" ",15 - GetStringLength(sVec)) : GetStringLeft(sVec,15); + return sVec; +} + +vector NBDE_StringToVector(string sVec) +{ + // fast de-serialize code using padded strings + vector vVec; + vVec.x = StringToFloat(GetStringLeft(sVec,5)) / 100; + vVec.y = StringToFloat(GetSubString(sVec,5,5)) / 100; + vVec.z = StringToFloat(GetSubString(sVec,10,5)) / 100; + return vVec; +} + +// returns player key with hopefully safe delimiter +string NBDE_GetPlayerKey(object oPC) +{ + return GetName(oPC)+"¤"+GetPCPlayerName(oPC); +} + +// returns database object for the specified campaign database +// +// - auto-creates database object in case it doesn't exist +// - builds index for fast access +// +// you usually don't need to use this function directly... +object NBDE_GetCampaignDatabaseObject(string sCampaignName) +{ + // get database item + object oDatabase = GetLocalObject(GetObjectByTag(NBDE_VAULT_TAG), NBDE_INDEX_PREFIX + sCampaignName); + // retrieve/create database if not indexed already + if(!GetIsObjectValid(oDatabase)) + { + // get database vault object + // this container holds all database objects/items + object oVault = GetObjectByTag(NBDE_VAULT_TAG); + // check for valid vault + if(!GetIsObjectValid(oVault)) + { + WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object"); + return OBJECT_INVALID; + } + // one time load + oDatabase = RetrieveCampaignObject(sCampaignName, NBDE_DATABASE_ITEM_VARNAME, GetLocation(oVault), oVault); + // not found ? create it + if(!GetIsObjectValid(oDatabase)) oDatabase = CreateItemOnObject(NBDE_DATABASE_ITEM_RESREF, oVault); + // check for valid database object + if(!GetIsObjectValid(oDatabase)) + { + WriteTimestampedLogEntry("NBDE> Error: unable to create '"+sCampaignName+"' database object"); + return OBJECT_INVALID; + } + // index item for fast access + SetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName, oDatabase); + } + return oDatabase; +} + +// this will flush (aka write to disk) the specified campaign database in one big swoop +// +// don't use this function in a rapid manner. +// delay each subsequent call to this function by at least 1 second (using delaycommand) +// this way you completely eliminate cpu-spikes, no matter how many database +// you flush. +void NBDE_FlushCampaignDatabase(string sCampaignName) +{ + // get database vault, it holds all database items + object oVault = GetObjectByTag(NBDE_VAULT_TAG); + if(GetIsObjectValid(oVault)) + { + // get database item + object oDatabase = GetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName); + // store the whole database via one single StoreCampaignObject call + // all variables on the item get stored with the item + if(GetIsObjectValid(oDatabase)) + { + // delete database on each flush to keep it compact and clean + DestroyCampaignDatabase(sCampaignName); + // store database + StoreCampaignObject(sCampaignName, NBDE_DATABASE_ITEM_VARNAME , oDatabase); + } + // database not loaded, no need to flush... + } + else // vault container missing + WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object"); +} + +void NBDE_UnloadCampaignDatabase(string sCampaignName) +{ + // get database vault, it holds all database items + object oVault = GetObjectByTag(NBDE_VAULT_TAG); + if(GetIsObjectValid(oVault)) + { + // get database item + object oDatabase = GetLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName); + if(GetIsObjectValid(oDatabase)) + { + // delete index + DeleteLocalObject(oVault, NBDE_INDEX_PREFIX + sCampaignName); + // delete database object + DestroyObject(oDatabase); + } + // database not loaded, do nothing + } + else // vault container missing + WriteTimestampedLogEntry("NBDE> Error: unable to locate '"+NBDE_VAULT_TAG+"' vault container object"); +} + +void NBDE_SetCampaignInt(string sCampaignName, string sVarname, int nInt, object oPlayer = OBJECT_INVALID) +{ + SetLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, nInt ); +} + +void NBDE_SetCampaignFloat(string sCampaignName, string sVarname, float fFloat, object oPlayer = OBJECT_INVALID) +{ + SetLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, fFloat); +} + +void NBDE_SetCampaignString(string sCampaignName, string sVarname, string sString, object oPlayer = OBJECT_INVALID) +{ + SetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname, sString); +} + +void NBDE_SetCampaignLocation(string sCampaignName, string sVarname, location locLocation, object oPlayer = OBJECT_SELF) +{ + SetLocalString( NBDE_GetCampaignDatabaseObject(sCampaignName) , + NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname , + NBDE_LocationToString(locLocation) ); +} + +void NBDE_SetCampaignVector(string sCampaignName, string sVarname, vector vVector, object oPlayer = OBJECT_SELF) +{ + SetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname , + NBDE_VectorToString(vVector) ); +} + +int NBDE_GetCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + return GetLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname ); +} + +float NBDE_GetCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + return GetLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname ); +} + +string NBDE_GetCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + return GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname ); +} + +location NBDE_GetCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + return NBDE_StringToLocation( GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname) ); +} + +vector NBDE_GetCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + return NBDE_StringToVector( GetLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName), + NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname) ); +} + +void NBDE_DeleteCampaignInt(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + DeleteLocalInt(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname); +} + +void NBDE_DeleteCampaignFloat(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + DeleteLocalFloat(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname); +} + +void NBDE_DeleteCampaignString(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname); +} + +void NBDE_DeleteCampaignLocation(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + NBDE_LOC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname); +} + +void NBDE_DeleteCampaignVector(string sCampaignName, string sVarname, object oPlayer = OBJECT_INVALID) +{ + DeleteLocalString(NBDE_GetCampaignDatabaseObject(sCampaignName) , + NBDE_VEC_PREFIX + ((GetIsObjectValid(oPlayer)) ? NBDE_GetPlayerKey(oPlayer) : "") + sVarname); +} + + diff --git a/nwnds_module/nc_dlg_grayport.dlg b/nwnds_module/nc_dlg_grayport.dlg new file mode 100644 index 000000000..d56e6edf2 Binary files /dev/null and b/nwnds_module/nc_dlg_grayport.dlg differ diff --git a/nwnds_module/nc_dlg_isaarak.ncs b/nwnds_module/nc_dlg_isaarak.ncs new file mode 100644 index 000000000..fbec3b97d Binary files /dev/null and b/nwnds_module/nc_dlg_isaarak.ncs differ diff --git a/nwnds_module/nc_dlg_isaarak.nss b/nwnds_module/nc_dlg_isaarak.nss new file mode 100644 index 000000000..e94aaa5c6 --- /dev/null +++ b/nwnds_module/nc_dlg_isaarak.nss @@ -0,0 +1,21 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_AARAKOCRA ) + return FALSE; + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return FALSE; + + + // If we make it this far, we have passed all tests. + return TRUE; +} + + diff --git a/nwnds_module/nc_dlg_isaasimar.ncs b/nwnds_module/nc_dlg_isaasimar.ncs new file mode 100644 index 000000000..33086389b Binary files /dev/null and b/nwnds_module/nc_dlg_isaasimar.ncs differ diff --git a/nwnds_module/nc_dlg_isaasimar.nss b/nwnds_module/nc_dlg_isaasimar.nss new file mode 100644 index 000000000..8b922ba93 --- /dev/null +++ b/nwnds_module/nc_dlg_isaasimar.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_AASIMAR ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isairgen.ncs b/nwnds_module/nc_dlg_isairgen.ncs new file mode 100644 index 000000000..fbe703562 Binary files /dev/null and b/nwnds_module/nc_dlg_isairgen.ncs differ diff --git a/nwnds_module/nc_dlg_isairgen.nss b/nwnds_module/nc_dlg_isairgen.nss new file mode 100644 index 000000000..1d691b569 --- /dev/null +++ b/nwnds_module/nc_dlg_isairgen.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_AIR_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isbelgoi.ncs b/nwnds_module/nc_dlg_isbelgoi.ncs new file mode 100644 index 000000000..46cfbe3bb Binary files /dev/null and b/nwnds_module/nc_dlg_isbelgoi.ncs differ diff --git a/nwnds_module/nc_dlg_isbelgoi.nss b/nwnds_module/nc_dlg_isbelgoi.nss new file mode 100644 index 000000000..57de3f1a3 --- /dev/null +++ b/nwnds_module/nc_dlg_isbelgoi.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_BELGOI ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/nc_dlg_isdwarf.ncs b/nwnds_module/nc_dlg_isdwarf.ncs new file mode 100644 index 000000000..92538b4fe Binary files /dev/null and b/nwnds_module/nc_dlg_isdwarf.ncs differ diff --git a/nwnds_module/nc_dlg_isdwarf.nss b/nwnds_module/nc_dlg_isdwarf.nss new file mode 100644 index 000000000..3afdddcb6 --- /dev/null +++ b/nwnds_module/nc_dlg_isdwarf.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_DS_DWARF ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/nc_dlg_iseargen.ncs b/nwnds_module/nc_dlg_iseargen.ncs new file mode 100644 index 000000000..fadcfd26b Binary files /dev/null and b/nwnds_module/nc_dlg_iseargen.ncs differ diff --git a/nwnds_module/nc_dlg_iseargen.nss b/nwnds_module/nc_dlg_iseargen.nss new file mode 100644 index 000000000..be8d74773 --- /dev/null +++ b/nwnds_module/nc_dlg_iseargen.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_EARTH_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_iself.ncs b/nwnds_module/nc_dlg_iself.ncs new file mode 100644 index 000000000..e6d626ac3 Binary files /dev/null and b/nwnds_module/nc_dlg_iself.ncs differ diff --git a/nwnds_module/nc_dlg_iself.nss b/nwnds_module/nc_dlg_iself.nss new file mode 100644 index 000000000..206dc6e7c --- /dev/null +++ b/nwnds_module/nc_dlg_iself.nss @@ -0,0 +1,17 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_DS_ELF ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + diff --git a/nwnds_module/nc_dlg_isfiregen.ncs b/nwnds_module/nc_dlg_isfiregen.ncs new file mode 100644 index 000000000..dd76c7c14 Binary files /dev/null and b/nwnds_module/nc_dlg_isfiregen.ncs differ diff --git a/nwnds_module/nc_dlg_isfiregen.nss b/nwnds_module/nc_dlg_isfiregen.nss new file mode 100644 index 000000000..91ba294e3 --- /dev/null +++ b/nwnds_module/nc_dlg_isfiregen.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_FIRE_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isflayer.ncs b/nwnds_module/nc_dlg_isflayer.ncs new file mode 100644 index 000000000..b669cf19a Binary files /dev/null and b/nwnds_module/nc_dlg_isflayer.ncs differ diff --git a/nwnds_module/nc_dlg_isflayer.nss b/nwnds_module/nc_dlg_isflayer.nss new file mode 100644 index 000000000..d67987d79 --- /dev/null +++ b/nwnds_module/nc_dlg_isflayer.nss @@ -0,0 +1,18 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_ILLITHID ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + + diff --git a/nwnds_module/nc_dlg_isgith.ncs b/nwnds_module/nc_dlg_isgith.ncs new file mode 100644 index 000000000..c8e2e3ec6 Binary files /dev/null and b/nwnds_module/nc_dlg_isgith.ncs differ diff --git a/nwnds_module/nc_dlg_isgith.nss b/nwnds_module/nc_dlg_isgith.nss new file mode 100644 index 000000000..cc40f07df --- /dev/null +++ b/nwnds_module/nc_dlg_isgith.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_GITH ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isgithyan.ncs b/nwnds_module/nc_dlg_isgithyan.ncs new file mode 100644 index 000000000..bfd979e6b Binary files /dev/null and b/nwnds_module/nc_dlg_isgithyan.ncs differ diff --git a/nwnds_module/nc_dlg_isgithyan.nss b/nwnds_module/nc_dlg_isgithyan.nss new file mode 100644 index 000000000..52758bddf --- /dev/null +++ b/nwnds_module/nc_dlg_isgithyan.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_GITHYANKI ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/nc_dlg_isgithzer.ncs b/nwnds_module/nc_dlg_isgithzer.ncs new file mode 100644 index 000000000..96f7176a5 Binary files /dev/null and b/nwnds_module/nc_dlg_isgithzer.ncs differ diff --git a/nwnds_module/nc_dlg_isgithzer.nss b/nwnds_module/nc_dlg_isgithzer.nss new file mode 100644 index 000000000..fd08d5d0f --- /dev/null +++ b/nwnds_module/nc_dlg_isgithzer.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_GITHZERAI ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/nc_dlg_ishfelf.ncs b/nwnds_module/nc_dlg_ishfelf.ncs new file mode 100644 index 000000000..2dc196956 Binary files /dev/null and b/nwnds_module/nc_dlg_ishfelf.ncs differ diff --git a/nwnds_module/nc_dlg_ishfelf.nss b/nwnds_module/nc_dlg_ishfelf.nss new file mode 100644 index 000000000..60c1c3379 --- /dev/null +++ b/nwnds_module/nc_dlg_ishfelf.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_DS_HALFELF ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + diff --git a/nwnds_module/nc_dlg_ishgiant.ncs b/nwnds_module/nc_dlg_ishgiant.ncs new file mode 100644 index 000000000..a61aa957a Binary files /dev/null and b/nwnds_module/nc_dlg_ishgiant.ncs differ diff --git a/nwnds_module/nc_dlg_ishgiant.nss b/nwnds_module/nc_dlg_ishgiant.nss new file mode 100644 index 000000000..e6c21051f --- /dev/null +++ b/nwnds_module/nc_dlg_ishgiant.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_DS_HALFGIANT ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_ishobbit.ncs b/nwnds_module/nc_dlg_ishobbit.ncs new file mode 100644 index 000000000..8568fedf7 Binary files /dev/null and b/nwnds_module/nc_dlg_ishobbit.ncs differ diff --git a/nwnds_module/nc_dlg_ishobbit.nss b/nwnds_module/nc_dlg_ishobbit.nss new file mode 100644 index 000000000..4d92c3aa3 --- /dev/null +++ b/nwnds_module/nc_dlg_ishobbit.nss @@ -0,0 +1,18 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_HALFLING ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + + diff --git a/nwnds_module/nc_dlg_iskirre.ncs b/nwnds_module/nc_dlg_iskirre.ncs new file mode 100644 index 000000000..a4fd5a84a Binary files /dev/null and b/nwnds_module/nc_dlg_iskirre.ncs differ diff --git a/nwnds_module/nc_dlg_iskirre.nss b/nwnds_module/nc_dlg_iskirre.nss new file mode 100644 index 000000000..95cb9f329 --- /dev/null +++ b/nwnds_module/nc_dlg_iskirre.nss @@ -0,0 +1,13 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ +object oPC=GetPCSpeaker(); +string sSubRace=GetStringLowerCase(GetSubRace(oPC)); + int iResult; + iResult= sSubRace==AR_SUBRACE_KIRRE ? TRUE: FALSE; + return iResult; +} + + diff --git a/nwnds_module/nc_dlg_iskreen.ncs b/nwnds_module/nc_dlg_iskreen.ncs new file mode 100644 index 000000000..baccbea49 Binary files /dev/null and b/nwnds_module/nc_dlg_iskreen.ncs differ diff --git a/nwnds_module/nc_dlg_iskreen.nss b/nwnds_module/nc_dlg_iskreen.nss new file mode 100644 index 000000000..d46d5f257 --- /dev/null +++ b/nwnds_module/nc_dlg_iskreen.nss @@ -0,0 +1,21 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_THRIKREEN && + GetRacialType(oPC) != RACIAL_TYPE_JEZ && + GetRacialType(oPC) != RACIAL_TYPE_TONDI && + GetRacialType(oPC) != RACIAL_TYPE_TOKSA && + GetRacialType(oPC) != RACIAL_TYPE_JHOL && + GetRacialType(oPC) != RACIAL_TYPE_TKEECH && + GetRacialType(oPC) != RACIAL_TYPE_JERAL ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_ismaggen.ncs b/nwnds_module/nc_dlg_ismaggen.ncs new file mode 100644 index 000000000..0419b5243 Binary files /dev/null and b/nwnds_module/nc_dlg_ismaggen.ncs differ diff --git a/nwnds_module/nc_dlg_ismaggen.nss b/nwnds_module/nc_dlg_ismaggen.nss new file mode 100644 index 000000000..8ed24d3d5 --- /dev/null +++ b/nwnds_module/nc_dlg_ismaggen.nss @@ -0,0 +1,14 @@ +#include "ar_inc_pcspawn" + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_MAGMA_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_ismul.ncs b/nwnds_module/nc_dlg_ismul.ncs new file mode 100644 index 000000000..af96c050c Binary files /dev/null and b/nwnds_module/nc_dlg_ismul.ncs differ diff --git a/nwnds_module/nc_dlg_ismul.nss b/nwnds_module/nc_dlg_ismul.nss new file mode 100644 index 000000000..f4735b8b9 --- /dev/null +++ b/nwnds_module/nc_dlg_ismul.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_MUL ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_ispterran.ncs b/nwnds_module/nc_dlg_ispterran.ncs new file mode 100644 index 000000000..f4985e1ab Binary files /dev/null and b/nwnds_module/nc_dlg_ispterran.ncs differ diff --git a/nwnds_module/nc_dlg_ispterran.nss b/nwnds_module/nc_dlg_ispterran.nss new file mode 100644 index 000000000..a68a97218 --- /dev/null +++ b/nwnds_module/nc_dlg_ispterran.nss @@ -0,0 +1,14 @@ +#include "ar_inc_pcspawn" + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_PTERRAN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_israingen.ncs b/nwnds_module/nc_dlg_israingen.ncs new file mode 100644 index 000000000..36603cd97 Binary files /dev/null and b/nwnds_module/nc_dlg_israingen.ncs differ diff --git a/nwnds_module/nc_dlg_israingen.nss b/nwnds_module/nc_dlg_israingen.nss new file mode 100644 index 000000000..102ebe963 --- /dev/null +++ b/nwnds_module/nc_dlg_israingen.nss @@ -0,0 +1,14 @@ +#include "ar_inc_pcspawn" + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_RAIN_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isreggeld.ncs b/nwnds_module/nc_dlg_isreggeld.ncs new file mode 100644 index 000000000..3da9b18b5 Binary files /dev/null and b/nwnds_module/nc_dlg_isreggeld.ncs differ diff --git a/nwnds_module/nc_dlg_isreggeld.nss b/nwnds_module/nc_dlg_isreggeld.nss new file mode 100644 index 000000000..48772128a --- /dev/null +++ b/nwnds_module/nc_dlg_isreggeld.nss @@ -0,0 +1,14 @@ +#include "ar_inc_pcspawn" + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_REGGELID ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_issiltgen.ncs b/nwnds_module/nc_dlg_issiltgen.ncs new file mode 100644 index 000000000..e93721262 Binary files /dev/null and b/nwnds_module/nc_dlg_issiltgen.ncs differ diff --git a/nwnds_module/nc_dlg_issiltgen.nss b/nwnds_module/nc_dlg_issiltgen.nss new file mode 100644 index 000000000..a038444b8 --- /dev/null +++ b/nwnds_module/nc_dlg_issiltgen.nss @@ -0,0 +1,18 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_SILT_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + + diff --git a/nwnds_module/nc_dlg_issungen.ncs b/nwnds_module/nc_dlg_issungen.ncs new file mode 100644 index 000000000..d119be7b6 Binary files /dev/null and b/nwnds_module/nc_dlg_issungen.ncs differ diff --git a/nwnds_module/nc_dlg_issungen.nss b/nwnds_module/nc_dlg_issungen.nss new file mode 100644 index 000000000..36bbb6793 --- /dev/null +++ b/nwnds_module/nc_dlg_issungen.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_SUN_GEN ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_istari.ncs b/nwnds_module/nc_dlg_istari.ncs new file mode 100644 index 000000000..09cad2c7c Binary files /dev/null and b/nwnds_module/nc_dlg_istari.ncs differ diff --git a/nwnds_module/nc_dlg_istari.nss b/nwnds_module/nc_dlg_istari.nss new file mode 100644 index 000000000..201336631 --- /dev/null +++ b/nwnds_module/nc_dlg_istari.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_TARI ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isthrax.ncs b/nwnds_module/nc_dlg_isthrax.ncs new file mode 100644 index 000000000..20300a9f5 Binary files /dev/null and b/nwnds_module/nc_dlg_isthrax.ncs differ diff --git a/nwnds_module/nc_dlg_isthrax.nss b/nwnds_module/nc_dlg_isthrax.nss new file mode 100644 index 000000000..9f7abded1 --- /dev/null +++ b/nwnds_module/nc_dlg_isthrax.nss @@ -0,0 +1,13 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ +object oPC=GetPCSpeaker(); +string sSubRace=GetStringLowerCase(GetSubRace(oPC)); + int iResult; + iResult= sSubRace==AR_SUBRACE_THRAX ? TRUE: FALSE; + return iResult; +} + + diff --git a/nwnds_module/nc_dlg_istieflin.ncs b/nwnds_module/nc_dlg_istieflin.ncs new file mode 100644 index 000000000..0d3bf0e95 Binary files /dev/null and b/nwnds_module/nc_dlg_istieflin.ncs differ diff --git a/nwnds_module/nc_dlg_istieflin.nss b/nwnds_module/nc_dlg_istieflin.nss new file mode 100644 index 000000000..7e4bd0267 --- /dev/null +++ b/nwnds_module/nc_dlg_istieflin.nss @@ -0,0 +1,18 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_TIEFLING ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + + diff --git a/nwnds_module/nc_dlg_isundead.ncs b/nwnds_module/nc_dlg_isundead.ncs new file mode 100644 index 000000000..528f471f8 Binary files /dev/null and b/nwnds_module/nc_dlg_isundead.ncs differ diff --git a/nwnds_module/nc_dlg_isundead.nss b/nwnds_module/nc_dlg_isundead.nss new file mode 100644 index 000000000..32aa5b64f --- /dev/null +++ b/nwnds_module/nc_dlg_isundead.nss @@ -0,0 +1,18 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_UNDEAD ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + + + diff --git a/nwnds_module/nc_dlg_isvilichi.ncs b/nwnds_module/nc_dlg_isvilichi.ncs new file mode 100644 index 000000000..076afe113 Binary files /dev/null and b/nwnds_module/nc_dlg_isvilichi.ncs differ diff --git a/nwnds_module/nc_dlg_isvilichi.nss b/nwnds_module/nc_dlg_isvilichi.nss new file mode 100644 index 000000000..a74b9328d --- /dev/null +++ b/nwnds_module/nc_dlg_isvilichi.nss @@ -0,0 +1,13 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ +object oPC=GetPCSpeaker(); +string sSubRace=GetStringLowerCase(GetSubRace(oPC)); + int iResult; + iResult= sSubRace==AR_SUBRACE_VILLICHI ? TRUE: FALSE; + return iResult; +} + + diff --git a/nwnds_module/nc_dlg_iswatgen.ncs b/nwnds_module/nc_dlg_iswatgen.ncs new file mode 100644 index 000000000..6012c01eb Binary files /dev/null and b/nwnds_module/nc_dlg_iswatgen.ncs differ diff --git a/nwnds_module/nc_dlg_iswatgen.nss b/nwnds_module/nc_dlg_iswatgen.nss new file mode 100644 index 000000000..9659d30cf --- /dev/null +++ b/nwnds_module/nc_dlg_iswatgen.nss @@ -0,0 +1,15 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_WATER_GEN ) // Water Genasi + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_dlg_isyuanti.ncs b/nwnds_module/nc_dlg_isyuanti.ncs new file mode 100644 index 000000000..8b36c5cbb Binary files /dev/null and b/nwnds_module/nc_dlg_isyuanti.ncs differ diff --git a/nwnds_module/nc_dlg_isyuanti.nss b/nwnds_module/nc_dlg_isyuanti.nss new file mode 100644 index 000000000..8b6f3a33e --- /dev/null +++ b/nwnds_module/nc_dlg_isyuanti.nss @@ -0,0 +1,16 @@ +#include "ar_inc_pcspawn" + + +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // The PC must be one of the listed races. + if ( GetRacialType(oPC) != RACIAL_TYPE_PURE_YUAN && // Yuan-Ti Pureblood + GetRacialType(oPC) != RACIAL_TYPE_ABOM_YUAN ) // Yuan-Ti Abomination + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} diff --git a/nwnds_module/nc_inc_levelup.nss b/nwnds_module/nc_inc_levelup.nss new file mode 100644 index 000000000..5f85d935b --- /dev/null +++ b/nwnds_module/nc_inc_levelup.nss @@ -0,0 +1,550 @@ +#include "fincludes" +#include "ar_inc_massbuff" +#include "prc_feat_const" + +const string NC_RESPONSE_RELEVEL_CLASS = "You are not allowed to multi-class with the chosen class. Please Re-level.."; +const string NC_RESPONSE_RELEVEL_DOMAIN = "Illegal Domain combination taken. Please Re-level.."; +const string NC_RESPONSE_RELEVEL_TEMPLAR_DOMAIN = "Illegal Templar Domain combination taken. Please Re-level.." ; +const string NC_RESPONSE_RELEVEL_NONELEMENTAL_DOMAIN = "Incorrect Non-Elemental Domain Combination Please Re-level.."; +const string NC_RESPONSE_RELEVEL_ELEMENTAL_DOMAIN = "Incorrect Elemental Domain combination. Please Re-level.."; +const string NC_RESPONSE_CHECK_TEMPLAR = "Checking Templar Domains"; +const string NC_RESPONSE_CHECK_CLERIC = "Checking Cleric Domains.."; +const string NC_RESPONSE_CHECK_PALADIN = "Checking multi-class Paladin.."; +const string NC_RESPONSE_CHECK_DEFILER = "Checking multi-class Defiler.."; +const string NC_RESPONSE_CECK_CLERIC = "Checking multi-class Cleric.."; +const string NC_RESPONSE_CHECK_DRUID = "Checking Multi-class Druid.."; +const string NC_RESPONSE_TEMPLAR_DOMAIN_CORRECT = "Correct Templar Domain combination taken."; +const string NC_RESPONSE_FOUND_TEMPLAR_DOMAIN = "Templar Domain chosen..."; +const string NC_RESPONSE_FOUND_CLERIC = "Cleric/Templar Class Found."; +const string NC_RESPONSE_FOUND_PALADIN = "Paladin Class Found."; +const string NC_RESPONSE_FOUND_DEFILER = "Defiler Class Found."; +const string NC_RESPONSE_FOUND_DRUID = "Druid Class Found."; +const string NC_RESPONSE_FOUND_TEMPLAR ="Templar Class Found"; +const string NC_RESPONSE_CLERIC_SYMBOL = "You are more in-line with your element and able to transform into your element three times per day."; +const string NC_RESPONSE_CHECK_SUBRACE = "Checking for class restrictions for your race.."; + + +const string SUBRACE_BELGOI="belgoi"; +const string SUBRACE_THRAX="thrax"; +const string SUBRACE_YUANTI="yuan-ti"; +const string SUBRACE_ILLITHID="illithid"; +const string SUBRACE_REGGLID="regglid"; +const string SUBRACE_KIRRE="kirre"; +const string NC_RESPONSE_RELEVEL_SUBRACE="You cannot take this class due to racial restrictions"; + +const int CLASS_TYPE_GLADIATOR =61; +//const int CLASS_TYPE_PSION=60; +//The level that a cleric recives their holy symbol. +const int AR_CLERIC_SYMBOL_LEVEL = 30; + +//check race restricted classes +//returns true if oPC's race is restricted from taking nCLASS +//nCLASS= CLASS_TYPE_* +int NC_RaceRestrictedClass(object oPC,int nCLASS); + +//give the cleric symbol by elemental domain +void NC_GiveClericSymbol(object oPC); + +//Delevels and relevels the pc +void NC_DelevelPC(object oPC); + +//check for cleric domains +int NC_CheckClericElementalDomains(object oPC); + +//checks for correct templar domains +int NC_TemplarCheck(object oPC); + +//Returns true if oPC has taken levels in nClas : CLASS_TYPE_* +int NC_GetHasClass(int nCLASS, object oPC); + +//Returns true if correct classes have been chosen +int NC_CheckClassRestrictions(object oPC); + +//returns ture if 2 non-elemental domains are chosen +int NC_CheckClericBasicDomains(object oPC); + +//returns true if oPC has chosen any of the Templar Domain feats +int NC_GetIsTemplar(object oPC); + +//Sends message to oPC +void NC_SendMessage(object oPC,string NC_RESPONSE,int nRed=TRUE); + +int NC_CheckClericElementalDomains(object oPC) +{ + int nReturn, nCount; + if(GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_MAGMA_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_SUN_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_SILT_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_RAIN_DOMAIN_POWER, oPC)) nCount++; + if(nCount == 1) nReturn = TRUE;//can only have one elemental domain + return nReturn; +} + +int NC_CheckClericBasicDomains(object oPC) +{ + int nReturn, nCount; + if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_DEATH_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_DESTRUCTION_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_EVIL_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_GOOD_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_HEALING_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_KNOWLEDGE_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_LUCK_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_MAGIC_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_PLANT_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_PROTECTION_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_STRENGTH_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_TRAVEL_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_TRICKERY_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_WAR_DOMAIN_POWER, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_DARKNESS, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_STORM, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_METAL, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_PORTAL, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_FORCE, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_SLIME, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_TYRANNY, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_DOMINATION, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_SPIDER, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_UNDEATH, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_TIME, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_DWARF, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_CHARM, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_ELF, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_FAMILY, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_FATE, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_GNOME, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_ILLUSION, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_HATRED, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_HALFLING, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_NOBILITY, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_OCEAN, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_ORC, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_RENEWAL, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_RETRIBUTION, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_RUNE, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_SPELLS, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_SCALEYKIND, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_BLIGHTBRINGER, oPC)) nCount++; + if(GetHasFeat(FEAT_DOMAIN_POWER_DRAGON, oPC)) nCount++; + if(nCount > 0) nReturn = TRUE; + return nReturn; +} + +void NC_RelevelPC(object oPC) +{ + int nXP = GetXP(oPC); + int nHD = GetHitDice(oPC); + int nNewXP = ((nHD * (nHD - 1) * 500) - 1); + SetXP(oPC, nNewXP); + DelayCommand(1.0, SetXP(oPC, nXP)); + +} + +void NC_GiveClericSymbol(object oPC) +{ + string sResRef; + if(GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) sResRef = "airsymbol"; + if(GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) sResRef = "earthsymbol"; + if(GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) sResRef = "firesymbol"; + if(GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) sResRef = "watersymbol"; + if(GetHasFeat(FEAT_MAGMA_DOMAIN_POWER, oPC)) sResRef = "magmasymbol"; + if(GetHasFeat(FEAT_SILT_DOMAIN_POWER, oPC)) sResRef = "siltsymbol"; + if(GetHasFeat(FEAT_SUN_DOMAIN_POWER, oPC)) sResRef = "sunsymbol"; + if(GetHasFeat(FEAT_RAIN_DOMAIN_POWER, oPC)) sResRef = "rainsymbol"; + + if(GetLevelByClass(CLASS_TYPE_CLERIC,oPC)>=AR_CLERIC_SYMBOL_LEVEL) + { + object oItem = GetItemPossessedBy(oPC,sResRef); + + if(!GetIsObjectValid(oItem)) + { + CreateItemOnObject(sResRef, oPC); + NC_SendMessage(oPC,NC_RESPONSE_CLERIC_SYMBOL); + } + } +} + + +int NC_TemplarCheck(object oPC) +{ + NC_SendMessage(oPC, NC_RESPONSE_CHECK_TEMPLAR); + int nReturn; + if(GetHasFeat(FEAT_TEMPLAR_DOMAIN_POWER, oPC)) + { + if(GetHasFeat(FEAT_DREGOTH_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_HAMANU_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_NIBENAY_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_ORONIS_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_THEOBA_DOMAIN_POWER, oPC)) + { + NC_SendMessage(oPC, NC_RESPONSE_TEMPLAR_DOMAIN_CORRECT); + nReturn = FALSE; + } + else + { + NC_SendMessage(oPC, NC_RESPONSE_RELEVEL_TEMPLAR_DOMAIN,TRUE); + nReturn = TRUE; + } + return nReturn; + } + else + { + nReturn = TRUE; + NC_SendMessage(oPC, NC_RESPONSE_RELEVEL_TEMPLAR_DOMAIN,TRUE); + return nReturn; + } + } + +int NC_GetHasClass(int nCLASS, object oPC) + { + + if (GetLevelByClass(nCLASS, oPC)>=1) + { + return TRUE; + } + else + { + return FALSE; + } + } + +int NC_CheckClassRestrictions(object oPC) + { + if (NC_GetHasClass(CLASS_TYPE_PALADIN,oPC)) + { + NC_SendMessage(oPC, NC_RESPONSE_FOUND_PALADIN); + NC_SendMessage(oPC, NC_RESPONSE_CHECK_PALADIN); + if (NC_GetHasClass(CLASS_TYPE_BARD,oPC) || + NC_GetHasClass(CLASS_TYPE_HARPER,oPC) || + NC_GetHasClass(CLASS_TYPE_SORCERER,oPC) || + NC_GetHasClass(CLASS_TYPE_BLACKGUARD,oPC) || + NC_GetHasClass(CLASS_TYPE_ASSASSIN,oPC) || + NC_GetHasClass(CLASS_TYPE_PALE_MASTER,oPC) || + NC_RaceRestrictedClass(oPC,CLASS_TYPE_PALADIN)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_SORCERER, oPC)) + { + NC_SendMessage(oPC, NC_RESPONSE_FOUND_DEFILER ); + NC_SendMessage(oPC, NC_RESPONSE_CHECK_DEFILER ); + + if (NC_GetHasClass(CLASS_TYPE_BLACKGUARD, oPC) || + NC_GetHasClass(CLASS_TYPE_DRUID, oPC) || + NC_GetHasClass(CLASS_TYPE_WIZARD, oPC) || + NC_GetHasClass(CLASS_TYPE_DIVINE_CHAMPION, oPC) || + NC_GetHasClass(CLASS_TYPE_SHIFTER, oPC) || + NC_GetHasClass(CLASS_TYPE_RANGER, oPC) || + NC_RaceRestrictedClass(oPC,CLASS_TYPE_SORCERER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + else if(NC_GetHasClass(CLASS_TYPE_CLERIC,oPC)) + { + if (GetHasFeat(FEAT_MAGMA_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_SUN_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_SILT_DOMAIN_POWER, oPC)) + { + return FALSE; + } + else + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + } +return FALSE; + } + + else if (NC_GetHasClass(CLASS_TYPE_DRUID, oPC)) + { + NC_SendMessage(oPC, NC_RESPONSE_FOUND_DRUID); + NC_SendMessage(oPC, NC_RESPONSE_CHECK_DRUID); + if (NC_GetHasClass(CLASS_TYPE_SORCERER, oPC) || + NC_GetHasClass(CLASS_TYPE_HARPER, oPC) || + NC_GetHasClass(CLASS_TYPE_PALEMASTER, oPC) || + NC_GetHasClass(CLASS_TYPE_HARPER, oPC) || + NC_GetHasClass(CLASS_TYPE_ASSASSIN, oPC) || + NC_GetHasClass(CLASS_TYPE_BLACKGUARD, oPC) || + NC_RaceRestrictedClass(oPC,CLASS_TYPE_DRUID)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_HARPER, oPC)) + { + NC_SendMessage(oPC, NC_RESPONSE_FOUND_DRUID); + NC_SendMessage(oPC, NC_RESPONSE_CHECK_DRUID); + if (NC_GetHasClass(CLASS_TYPE_DRUID, oPC) || + NC_GetHasClass(CLASS_TYPE_SHIFTER, oPC) || + NC_GetHasClass(CLASS_TYPE_PALADIN, oPC) || + NC_GetHasClass(CLASS_TYPE_DIVINE_CHAMPION, oPC) || + NC_RaceRestrictedClass(oPC,CLASS_TYPE_HARPER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_SHIFTER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_SHIFTER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_WIZARD, oPC)) + { + if (NC_RaceRestrictedClass(oPC,CLASS_TYPE_WIZARD)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_BARD, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_BARD)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_FIGHTER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_FIGHTER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_MONK, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_MONK)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_BARBARIAN, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_BARBARIAN)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_ASSASSIN, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_ASSASSIN)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_ARCANE_ARCHER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_ARCANE_ARCHER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_BLACKGUARD, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_BLACKGUARD)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_DIVINE_CHAMPION, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_DIVINE_CHAMPION)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_DRAGONDISCIPLE)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_DWARVEN_DEFENDER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_DWARVEN_DEFENDER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_PALEMASTER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_PALEMASTER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_ROGUE, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_ROGUE)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_SHADOWDANCER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_SHADOWDANCER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + else if (NC_GetHasClass(CLASS_TYPE_WEAPON_MASTER, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_WEAPON_MASTER)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } +/* else if (NC_GetHasClass(CLASS_TYPE_PSION, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_PSION)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } */ //No more 2e Psions - DMH + else if (NC_GetHasClass(CLASS_TYPE_GLADIATOR, oPC)) + { + if(NC_RaceRestrictedClass(oPC,CLASS_TYPE_GLADIATOR)) + { + NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_CLASS,TRUE); + return TRUE; + } + return FALSE; + } + return FALSE; +} + +int NC_GetIsTemplar(object oPC) +{ + if(GetHasFeat(FEAT_TEMPLAR_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_DREGOTH_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_HAMANU_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_NIBENAY_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_ORONIS_DOMAIN_POWER, oPC) || + GetHasFeat(FEAT_THEOBA_DOMAIN_POWER, oPC)) + { + NC_SendMessage(oPC,NC_RESPONSE_FOUND_TEMPLAR_DOMAIN); + return TRUE; + } + else + { + return FALSE; + } + +} + +void NC_SendMessage(object oPC,string NC_RESPONSE,int nRed=FALSE) +{ +string sColor = "white"; + + if(nRed=TRUE) + { + sColor = "lightred"; + } + + ColorToOne(oPC,NC_RESPONSE, sColor); +} + +int NC_RaceRestrictedClass(object oPC,int nCLASS,) +{ + string sSubRace = GetSubRace(oPC); + sSubRace = GetStringLowerCase(sSubRace); + int nReturn=FALSE; + + if(sSubRace==SUBRACE_BELGOI) + { + if(nCLASS == CLASS_TYPE_PALADIN)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_SHIFTER)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_DRUID)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_BARD)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_WIZARD)nReturn=TRUE; + } + + if(sSubRace==SUBRACE_THRAX) + { + if(nCLASS == CLASS_TYPE_PALADIN)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_BARD)nReturn=TRUE; + } + if(sSubRace==SUBRACE_YUANTI) + { + if(nCLASS == CLASS_TYPE_PALADIN)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_SHIFTER)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_DRUID)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_WIZARD)nReturn=TRUE; + } + + if(sSubRace==SUBRACE_ILLITHID) + { + if(nCLASS == CLASS_TYPE_PALADIN)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_SHIFTER)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_DRUID)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_BARD)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_RANGER)nReturn=TRUE; + } + if(sSubRace==SUBRACE_REGGLID) + { + if(nCLASS == CLASS_TYPE_PALADIN)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_SHIFTER)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_DRUID)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_BARD)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_WIZARD)nReturn=TRUE; + } + if(sSubRace==SUBRACE_KIRRE) + { + if(nCLASS == CLASS_TYPE_SORCERER)nReturn=TRUE; + if(nCLASS == CLASS_TYPE_BARD)nReturn=TRUE; + } + if(nReturn)NC_SendMessage(oPC,NC_RESPONSE_RELEVEL_SUBRACE); + return nReturn; +} + +//void main(){} diff --git a/nwnds_module/neaura.ncs b/nwnds_module/neaura.ncs new file mode 100644 index 000000000..8d0d800c8 Binary files /dev/null and b/nwnds_module/neaura.ncs differ diff --git a/nwnds_module/neaura.nss b/nwnds_module/neaura.nss new file mode 100644 index 000000000..86587a558 --- /dev/null +++ b/nwnds_module/neaura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_CIRCGOOD,"neaura1","neaura2","neaura3"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/neaura1.ncs b/nwnds_module/neaura1.ncs new file mode 100644 index 000000000..9d9de9923 Binary files /dev/null and b/nwnds_module/neaura1.ncs differ diff --git a/nwnds_module/neaura1.nss b/nwnds_module/neaura1.nss new file mode 100644 index 000000000..07a98148f --- /dev/null +++ b/nwnds_module/neaura1.nss @@ -0,0 +1,39 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eDrain = EffectNegativeLevel(2); + effect eDeath = EffectDeath(); + effect eBoost = EffectTurnResistanceIncrease(4); + eBoost = EffectLinkEffects(eBoost,EffectRegenerate(5,6.0)); + object oTarget = GetEnteringObject(); + int nRace = GetRacialType(oTarget); + if ( GetLocalInt(oTarget,"NEAura") ) + return; + if(GetIsEnemy(oTarget, oCaster)) + { + if ( nRace != RACIAL_TYPE_UNDEAD ) + { + if ( GetHitDice(oTarget) <= 2 ) + { + location lWight = GetLocation(oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + CreateObject(OBJECT_TYPE_CREATURE,"nw_wight",lWight); + return; + } + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + } + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBoost,oTarget); + } + SetLocalInt(oTarget,"NEAura",1); +} diff --git a/nwnds_module/neaura2.ncs b/nwnds_module/neaura2.ncs new file mode 100644 index 000000000..272e124b9 Binary files /dev/null and b/nwnds_module/neaura2.ncs differ diff --git a/nwnds_module/neaura2.nss b/nwnds_module/neaura2.nss new file mode 100644 index 000000000..95cf8ea12 --- /dev/null +++ b/nwnds_module/neaura2.nss @@ -0,0 +1,48 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eVis2 = EffectVisualEffect(VFX_IMP_HOLY_AID); + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eDrain = EffectNegativeLevel(2); + effect eDeath = EffectDeath(); + effect eBoost = EffectTurnResistanceIncrease(4); + eBoost = EffectLinkEffects(eBoost,EffectRegenerate(5,6.0)); + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if ( GetLocalInt(oTarget,"NEAura") ) + { + oTarget = GetNextInPersistentObject(); + break; + } + int nRace = GetRacialType(oTarget); + if(GetIsEnemy(oTarget, oCaster)) + { + if ( nRace != RACIAL_TYPE_UNDEAD ) + { + if ( GetHitDice(oTarget) <= 2 ) + { + location lWight = GetLocation(oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + CreateObject(OBJECT_TYPE_CREATURE,"nw_wight",lWight); + } + else + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDrain,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + } + } + if ( nRace == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eBoost,oTarget); + } + SetLocalInt(oTarget,"NEAura",1); + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/neaura3.ncs b/nwnds_module/neaura3.ncs new file mode 100644 index 000000000..2f80c5a83 Binary files /dev/null and b/nwnds_module/neaura3.ncs differ diff --git a/nwnds_module/neaura3.nss b/nwnds_module/neaura3.nss new file mode 100644 index 000000000..e0e37788f --- /dev/null +++ b/nwnds_module/neaura3.nss @@ -0,0 +1,70 @@ + +//:://///////////////////////////////////////////// +//:: Grease: On Exit +//:: NW_S0_GreaseB.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Creatures entering the zone of grease must make + a reflex save or fall down. Those that make + their save have their movement reduced by 1/2. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 1, 2001 +//::////////////////////////////////////////////// + +#include "NW_I0_SPELLS" +//#include "x2_inc_spellhook" + +void main() +{ + //Declare major variables + //Get the object that is exiting the AOE + object oTarget = GetExitingObject(); + int bValid = FALSE; + int bRegen = FALSE; + int bTurn = FALSE; + effect eAOE; + int nEffectType; + object oPC = GetFirstPC(); +// SendMessageToPC(oPC,"neaura3: OBJECT_SELF = " + GetName(OBJECT_SELF) + +// " Creator = " + GetName(GetAreaOfEffectCreator(OBJECT_SELF)) ); + + if(GetLocalInt(oTarget,"NEAura")) + { + //Search through the valid effects on the target. + eAOE = GetFirstEffect(oTarget); + while (GetIsEffectValid(eAOE) && bValid == FALSE) + { +// SendMessageToPC(oPC,"EffectCreator is "+ GetName(GetEffectCreator(eAOE))); + + if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator(OBJECT_SELF)) + { + nEffectType = GetEffectType(eAOE); + if ( (nEffectType == EFFECT_TYPE_REGENERATE) || + (nEffectType == EFFECT_TYPE_TURN_RESISTANCE_INCREASE) || + (nEffectType == EFFECT_TYPE_NEGATIVELEVEL) ) + { + //If the effect was created by the Acid_Fog then remove it + if(GetEffectSpellId(eAOE) == -1) + { + RemoveEffect(oTarget, eAOE); + if ( nEffectType == EFFECT_TYPE_NEGATIVELEVEL ) + bValid = TRUE; + if ( nEffectType == EFFECT_TYPE_TURN_RESISTANCE_INCREASE ) + bTurn = TRUE; + if ( nEffectType == EFFECT_TYPE_REGENERATE ) + bRegen = TRUE; + if ( bTurn && bRegen ) + bValid = TRUE; + + } + } + } + //Get next effect on the target + eAOE = GetNextEffect(oTarget); + } + SetLocalInt(oTarget,"NEAura",0); + } +} diff --git a/nwnds_module/necrophidius.utc b/nwnds_module/necrophidius.utc new file mode 100644 index 000000000..448a898e5 Binary files /dev/null and b/nwnds_module/necrophidius.utc differ diff --git a/nwnds_module/necrophidiusbite.uti b/nwnds_module/necrophidiusbite.uti new file mode 100644 index 000000000..b388e0684 Binary files /dev/null and b/nwnds_module/necrophidiusbite.uti differ diff --git a/nwnds_module/neo_otyugh_bite.uti b/nwnds_module/neo_otyugh_bite.uti new file mode 100644 index 000000000..f510669b1 Binary files /dev/null and b/nwnds_module/neo_otyugh_bite.uti differ diff --git a/nwnds_module/neo_otyugh_slam.ncs b/nwnds_module/neo_otyugh_slam.ncs new file mode 100644 index 000000000..7a48999fd Binary files /dev/null and b/nwnds_module/neo_otyugh_slam.ncs differ diff --git a/nwnds_module/neo_otyugh_slam.nss b/nwnds_module/neo_otyugh_slam.nss new file mode 100644 index 000000000..9865b9b3e --- /dev/null +++ b/nwnds_module/neo_otyugh_slam.nss @@ -0,0 +1,69 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg1 = EffectDamage(d10(1)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + effect eGrabDmg2 = EffectDamage(d8(1)+nCreSTR, DAMAGE_TYPE_PIERCING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1d10 bludgeoning damage + 1d8 piercing damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg1, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg2, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the neo-otyugh's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The neo-otyugh tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The neo-otyugh is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/neo_otyugh_slam.uti b/nwnds_module/neo_otyugh_slam.uti new file mode 100644 index 000000000..37e8eb058 Binary files /dev/null and b/nwnds_module/neo_otyugh_slam.uti differ diff --git a/nwnds_module/nibenay_cw.are b/nwnds_module/nibenay_cw.are new file mode 100644 index 000000000..29b1aa761 Binary files /dev/null and b/nwnds_module/nibenay_cw.are differ diff --git a/nwnds_module/nibenay_cw.gic b/nwnds_module/nibenay_cw.gic new file mode 100644 index 000000000..68ef2e986 Binary files /dev/null and b/nwnds_module/nibenay_cw.gic differ diff --git a/nwnds_module/nibenay_cw.git b/nwnds_module/nibenay_cw.git new file mode 100644 index 000000000..4cd94b854 Binary files /dev/null and b/nwnds_module/nibenay_cw.git differ diff --git a/nwnds_module/nightcrawlerhid.uti b/nwnds_module/nightcrawlerhid.uti new file mode 100644 index 000000000..6ed65d383 Binary files /dev/null and b/nwnds_module/nightcrawlerhid.uti differ diff --git a/nwnds_module/nightmare_gore.uti b/nwnds_module/nightmare_gore.uti new file mode 100644 index 000000000..4013cacf3 Binary files /dev/null and b/nwnds_module/nightmare_gore.uti differ diff --git a/nwnds_module/nightmare_hide.uti b/nwnds_module/nightmare_hide.uti new file mode 100644 index 000000000..0ccab3d0a Binary files /dev/null and b/nwnds_module/nightmare_hide.uti differ diff --git a/nwnds_module/nightmarebeast.utc b/nwnds_module/nightmarebeast.utc new file mode 100644 index 000000000..b6e76c1de Binary files /dev/null and b/nwnds_module/nightmarebeast.utc differ diff --git a/nwnds_module/nightmarefang.uti b/nwnds_module/nightmarefang.uti new file mode 100644 index 000000000..e3a1abd92 Binary files /dev/null and b/nwnds_module/nightmarefang.uti differ diff --git a/nwnds_module/nightwalker001.utc b/nwnds_module/nightwalker001.utc new file mode 100644 index 000000000..b0467d9ae Binary files /dev/null and b/nwnds_module/nightwalker001.utc differ diff --git a/nwnds_module/noledger.ncs b/nwnds_module/noledger.ncs new file mode 100644 index 000000000..3fcbf8d77 Binary files /dev/null and b/nwnds_module/noledger.ncs differ diff --git a/nwnds_module/noledger.nss b/nwnds_module/noledger.nss new file mode 100644 index 000000000..1f64f1f31 --- /dev/null +++ b/nwnds_module/noledger.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName noledger +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:30:10 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "LEDGER") != 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/npc_arelia.utc b/nwnds_module/npc_arelia.utc new file mode 100644 index 000000000..5deb0d806 Binary files /dev/null and b/nwnds_module/npc_arelia.utc differ diff --git a/nwnds_module/npc_arenaguard02.utc b/nwnds_module/npc_arenaguard02.utc new file mode 100644 index 000000000..7bc24f236 Binary files /dev/null and b/nwnds_module/npc_arenaguard02.utc differ diff --git a/nwnds_module/npc_arenaguard1.utc b/nwnds_module/npc_arenaguard1.utc new file mode 100644 index 000000000..5158e42ad Binary files /dev/null and b/nwnds_module/npc_arenaguard1.utc differ diff --git a/nwnds_module/npc_aristphanale.utc b/nwnds_module/npc_aristphanale.utc new file mode 100644 index 000000000..4cf128cd2 Binary files /dev/null and b/nwnds_module/npc_aristphanale.utc differ diff --git a/nwnds_module/npc_arkanos.utc b/nwnds_module/npc_arkanos.utc new file mode 100644 index 000000000..2b5b9ddcc Binary files /dev/null and b/nwnds_module/npc_arkanos.utc differ diff --git a/nwnds_module/npc_augustus.utc b/nwnds_module/npc_augustus.utc new file mode 100644 index 000000000..345335b68 Binary files /dev/null and b/nwnds_module/npc_augustus.utc differ diff --git a/nwnds_module/npc_bar_goldlion.utc b/nwnds_module/npc_bar_goldlion.utc new file mode 100644 index 000000000..7a545c09a Binary files /dev/null and b/nwnds_module/npc_bar_goldlion.utc differ diff --git a/nwnds_module/npc_barley.utc b/nwnds_module/npc_barley.utc new file mode 100644 index 000000000..02f0b661a Binary files /dev/null and b/nwnds_module/npc_barley.utc differ diff --git a/nwnds_module/npc_bartholomeu.utc b/nwnds_module/npc_bartholomeu.utc new file mode 100644 index 000000000..74a0f068b Binary files /dev/null and b/nwnds_module/npc_bartholomeu.utc differ diff --git a/nwnds_module/npc_belet.utc b/nwnds_module/npc_belet.utc new file mode 100644 index 000000000..e10f8e65d Binary files /dev/null and b/nwnds_module/npc_belet.utc differ diff --git a/nwnds_module/npc_belgoi_tradr.utc b/nwnds_module/npc_belgoi_tradr.utc new file mode 100644 index 000000000..6ff7f2a82 Binary files /dev/null and b/nwnds_module/npc_belgoi_tradr.utc differ diff --git a/nwnds_module/npc_berrek.utc b/nwnds_module/npc_berrek.utc new file mode 100644 index 000000000..91bdb7716 Binary files /dev/null and b/nwnds_module/npc_berrek.utc differ diff --git a/nwnds_module/npc_berren_guard.utc b/nwnds_module/npc_berren_guard.utc new file mode 100644 index 000000000..56d2c6732 Binary files /dev/null and b/nwnds_module/npc_berren_guard.utc differ diff --git a/nwnds_module/npc_berren_sgt.utc b/nwnds_module/npc_berren_sgt.utc new file mode 100644 index 000000000..b0e58e005 Binary files /dev/null and b/nwnds_module/npc_berren_sgt.utc differ diff --git a/nwnds_module/npc_berren_sntry.utc b/nwnds_module/npc_berren_sntry.utc new file mode 100644 index 000000000..7a795937e Binary files /dev/null and b/nwnds_module/npc_berren_sntry.utc differ diff --git a/nwnds_module/npc_bhors.utc b/nwnds_module/npc_bhors.utc new file mode 100644 index 000000000..6e7fa4946 Binary files /dev/null and b/nwnds_module/npc_bhors.utc differ diff --git a/nwnds_module/npc_blackjack.utc b/nwnds_module/npc_blackjack.utc new file mode 100644 index 000000000..2718f816f Binary files /dev/null and b/nwnds_module/npc_blackjack.utc differ diff --git a/nwnds_module/npc_bran.utc b/nwnds_module/npc_bran.utc new file mode 100644 index 000000000..f6ca688dd Binary files /dev/null and b/nwnds_module/npc_bran.utc differ diff --git a/nwnds_module/npc_briela.utc b/nwnds_module/npc_briela.utc new file mode 100644 index 000000000..45168375d Binary files /dev/null and b/nwnds_module/npc_briela.utc differ diff --git a/nwnds_module/npc_brill.utc b/nwnds_module/npc_brill.utc new file mode 100644 index 000000000..828fe06a1 Binary files /dev/null and b/nwnds_module/npc_brill.utc differ diff --git a/nwnds_module/npc_brimly.utc b/nwnds_module/npc_brimly.utc new file mode 100644 index 000000000..d3508db21 Binary files /dev/null and b/nwnds_module/npc_brimly.utc differ diff --git a/nwnds_module/npc_brin.utc b/nwnds_module/npc_brin.utc new file mode 100644 index 000000000..1b642f056 Binary files /dev/null and b/nwnds_module/npc_brin.utc differ diff --git a/nwnds_module/npc_brother.utc b/nwnds_module/npc_brother.utc new file mode 100644 index 000000000..72e581126 Binary files /dev/null and b/nwnds_module/npc_brother.utc differ diff --git a/nwnds_module/npc_cael.utc b/nwnds_module/npc_cael.utc new file mode 100644 index 000000000..54561fe0d Binary files /dev/null and b/nwnds_module/npc_cael.utc differ diff --git a/nwnds_module/npc_captreynolds.utc b/nwnds_module/npc_captreynolds.utc new file mode 100644 index 000000000..f0bb48651 Binary files /dev/null and b/nwnds_module/npc_captreynolds.utc differ diff --git a/nwnds_module/npc_chantelle.utc b/nwnds_module/npc_chantelle.utc new file mode 100644 index 000000000..b8856fcec Binary files /dev/null and b/nwnds_module/npc_chantelle.utc differ diff --git a/nwnds_module/npc_chesia.utc b/nwnds_module/npc_chesia.utc new file mode 100644 index 000000000..b55617fe6 Binary files /dev/null and b/nwnds_module/npc_chesia.utc differ diff --git a/nwnds_module/npc_chikchak.utc b/nwnds_module/npc_chikchak.utc new file mode 100644 index 000000000..e829a05bd Binary files /dev/null and b/nwnds_module/npc_chikchak.utc differ diff --git a/nwnds_module/npc_chirl.utc b/nwnds_module/npc_chirl.utc new file mode 100644 index 000000000..8f924a42b Binary files /dev/null and b/nwnds_module/npc_chirl.utc differ diff --git a/nwnds_module/npc_cobalte.utc b/nwnds_module/npc_cobalte.utc new file mode 100644 index 000000000..cb9450073 Binary files /dev/null and b/nwnds_module/npc_cobalte.utc differ diff --git a/nwnds_module/npc_commoner001.utc b/nwnds_module/npc_commoner001.utc new file mode 100644 index 000000000..3244d4978 Binary files /dev/null and b/nwnds_module/npc_commoner001.utc differ diff --git a/nwnds_module/npc_commoner002.utc b/nwnds_module/npc_commoner002.utc new file mode 100644 index 000000000..d167c22f9 Binary files /dev/null and b/nwnds_module/npc_commoner002.utc differ diff --git a/nwnds_module/npc_commoner003.utc b/nwnds_module/npc_commoner003.utc new file mode 100644 index 000000000..9cb8c0fba Binary files /dev/null and b/nwnds_module/npc_commoner003.utc differ diff --git a/nwnds_module/npc_commoner004.utc b/nwnds_module/npc_commoner004.utc new file mode 100644 index 000000000..4397c25bd Binary files /dev/null and b/nwnds_module/npc_commoner004.utc differ diff --git a/nwnds_module/npc_commoner005.utc b/nwnds_module/npc_commoner005.utc new file mode 100644 index 000000000..b0352fd18 Binary files /dev/null and b/nwnds_module/npc_commoner005.utc differ diff --git a/nwnds_module/npc_commoner006.utc b/nwnds_module/npc_commoner006.utc new file mode 100644 index 000000000..1465abbc5 Binary files /dev/null and b/nwnds_module/npc_commoner006.utc differ diff --git a/nwnds_module/npc_commoner007.utc b/nwnds_module/npc_commoner007.utc new file mode 100644 index 000000000..a8d9518c4 Binary files /dev/null and b/nwnds_module/npc_commoner007.utc differ diff --git a/nwnds_module/npc_commoner008.utc b/nwnds_module/npc_commoner008.utc new file mode 100644 index 000000000..92cdaf6c6 Binary files /dev/null and b/nwnds_module/npc_commoner008.utc differ diff --git a/nwnds_module/npc_commoner009.utc b/nwnds_module/npc_commoner009.utc new file mode 100644 index 000000000..3867ba301 Binary files /dev/null and b/nwnds_module/npc_commoner009.utc differ diff --git a/nwnds_module/npc_commoner010.utc b/nwnds_module/npc_commoner010.utc new file mode 100644 index 000000000..cb610a420 Binary files /dev/null and b/nwnds_module/npc_commoner010.utc differ diff --git a/nwnds_module/npc_commoner011.utc b/nwnds_module/npc_commoner011.utc new file mode 100644 index 000000000..f7513cff1 Binary files /dev/null and b/nwnds_module/npc_commoner011.utc differ diff --git a/nwnds_module/npc_commoner012.utc b/nwnds_module/npc_commoner012.utc new file mode 100644 index 000000000..32ac235b7 Binary files /dev/null and b/nwnds_module/npc_commoner012.utc differ diff --git a/nwnds_module/npc_daaku.utc b/nwnds_module/npc_daaku.utc new file mode 100644 index 000000000..75b95f34b Binary files /dev/null and b/nwnds_module/npc_daaku.utc differ diff --git a/nwnds_module/npc_dariya.utc b/nwnds_module/npc_dariya.utc new file mode 100644 index 000000000..391125c10 Binary files /dev/null and b/nwnds_module/npc_dariya.utc differ diff --git a/nwnds_module/npc_delaila.utc b/nwnds_module/npc_delaila.utc new file mode 100644 index 000000000..0b4aab12a Binary files /dev/null and b/nwnds_module/npc_delaila.utc differ diff --git a/nwnds_module/npc_delia.utc b/nwnds_module/npc_delia.utc new file mode 100644 index 000000000..a8a74bcd2 Binary files /dev/null and b/nwnds_module/npc_delia.utc differ diff --git a/nwnds_module/npc_dimitri.utc b/nwnds_module/npc_dimitri.utc new file mode 100644 index 000000000..6396205dd Binary files /dev/null and b/nwnds_module/npc_dimitri.utc differ diff --git a/nwnds_module/npc_djall.utc b/nwnds_module/npc_djall.utc new file mode 100644 index 000000000..21b6a23fb Binary files /dev/null and b/nwnds_module/npc_djall.utc differ diff --git a/nwnds_module/npc_dond.utc b/nwnds_module/npc_dond.utc new file mode 100644 index 000000000..e8b53ea17 Binary files /dev/null and b/nwnds_module/npc_dond.utc differ diff --git a/nwnds_module/npc_draxos.utc b/nwnds_module/npc_draxos.utc new file mode 100644 index 000000000..e00dcf84f Binary files /dev/null and b/nwnds_module/npc_draxos.utc differ diff --git a/nwnds_module/npc_dukkaro.utc b/nwnds_module/npc_dukkaro.utc new file mode 100644 index 000000000..edc4360ad Binary files /dev/null and b/nwnds_module/npc_dukkaro.utc differ diff --git a/nwnds_module/npc_dw_barkeep.utc b/nwnds_module/npc_dw_barkeep.utc new file mode 100644 index 000000000..774702374 Binary files /dev/null and b/nwnds_module/npc_dw_barkeep.utc differ diff --git a/nwnds_module/npc_ephanie.utc b/nwnds_module/npc_ephanie.utc new file mode 100644 index 000000000..72d60a679 Binary files /dev/null and b/nwnds_module/npc_ephanie.utc differ diff --git a/nwnds_module/npc_esuta.utc b/nwnds_module/npc_esuta.utc new file mode 100644 index 000000000..7dffc2868 Binary files /dev/null and b/nwnds_module/npc_esuta.utc differ diff --git a/nwnds_module/npc_farreli.utc b/nwnds_module/npc_farreli.utc new file mode 100644 index 000000000..37a197c51 Binary files /dev/null and b/nwnds_module/npc_farreli.utc differ diff --git a/nwnds_module/npc_flin.utc b/nwnds_module/npc_flin.utc new file mode 100644 index 000000000..a69a50f6e Binary files /dev/null and b/nwnds_module/npc_flin.utc differ diff --git a/nwnds_module/npc_friedla.utc b/nwnds_module/npc_friedla.utc new file mode 100644 index 000000000..d4663d0b5 Binary files /dev/null and b/nwnds_module/npc_friedla.utc differ diff --git a/nwnds_module/npc_frugirry.utc b/nwnds_module/npc_frugirry.utc new file mode 100644 index 000000000..35a36dad7 Binary files /dev/null and b/nwnds_module/npc_frugirry.utc differ diff --git a/nwnds_module/npc_gaff.utc b/nwnds_module/npc_gaff.utc new file mode 100644 index 000000000..95afadb09 Binary files /dev/null and b/nwnds_module/npc_gaff.utc differ diff --git a/nwnds_module/npc_gald.utc b/nwnds_module/npc_gald.utc new file mode 100644 index 000000000..cd8fba7d4 Binary files /dev/null and b/nwnds_module/npc_gald.utc differ diff --git a/nwnds_module/npc_geary01.utc b/nwnds_module/npc_geary01.utc new file mode 100644 index 000000000..99312a670 Binary files /dev/null and b/nwnds_module/npc_geary01.utc differ diff --git a/nwnds_module/npc_geary02.utc b/nwnds_module/npc_geary02.utc new file mode 100644 index 000000000..be453a034 Binary files /dev/null and b/nwnds_module/npc_geary02.utc differ diff --git a/nwnds_module/npc_gelrade.utc b/nwnds_module/npc_gelrade.utc new file mode 100644 index 000000000..98fe0d048 Binary files /dev/null and b/nwnds_module/npc_gelrade.utc differ diff --git a/nwnds_module/npc_gerrof.utc b/nwnds_module/npc_gerrof.utc new file mode 100644 index 000000000..feda5bda3 Binary files /dev/null and b/nwnds_module/npc_gerrof.utc differ diff --git a/nwnds_module/npc_gimpy.utc b/nwnds_module/npc_gimpy.utc new file mode 100644 index 000000000..b195ebbe7 Binary files /dev/null and b/nwnds_module/npc_gimpy.utc differ diff --git a/nwnds_module/npc_grik.utc b/nwnds_module/npc_grik.utc new file mode 100644 index 000000000..2f0916ece Binary files /dev/null and b/nwnds_module/npc_grik.utc differ diff --git a/nwnds_module/npc_guute.utc b/nwnds_module/npc_guute.utc new file mode 100644 index 000000000..2fa5e93b0 Binary files /dev/null and b/nwnds_module/npc_guute.utc differ diff --git a/nwnds_module/npc_hakkimo.utc b/nwnds_module/npc_hakkimo.utc new file mode 100644 index 000000000..4868f2e7c Binary files /dev/null and b/nwnds_module/npc_hakkimo.utc differ diff --git a/nwnds_module/npc_hamir.utc b/nwnds_module/npc_hamir.utc new file mode 100644 index 000000000..b2de26ccd Binary files /dev/null and b/nwnds_module/npc_hamir.utc differ diff --git a/nwnds_module/npc_hedia.utc b/nwnds_module/npc_hedia.utc new file mode 100644 index 000000000..eed7063f2 Binary files /dev/null and b/nwnds_module/npc_hedia.utc differ diff --git a/nwnds_module/npc_hoplin.utc b/nwnds_module/npc_hoplin.utc new file mode 100644 index 000000000..e687fce79 Binary files /dev/null and b/nwnds_module/npc_hoplin.utc differ diff --git a/nwnds_module/npc_hortsef.utc b/nwnds_module/npc_hortsef.utc new file mode 100644 index 000000000..67398549b Binary files /dev/null and b/nwnds_module/npc_hortsef.utc differ diff --git a/nwnds_module/npc_horus.utc b/nwnds_module/npc_horus.utc new file mode 100644 index 000000000..bad266abe Binary files /dev/null and b/nwnds_module/npc_horus.utc differ diff --git a/nwnds_module/npc_hs_dancer.utc b/nwnds_module/npc_hs_dancer.utc new file mode 100644 index 000000000..90d4d0b8c Binary files /dev/null and b/nwnds_module/npc_hs_dancer.utc differ diff --git a/nwnds_module/npc_hunar.utc b/nwnds_module/npc_hunar.utc new file mode 100644 index 000000000..c0d24fe57 Binary files /dev/null and b/nwnds_module/npc_hunar.utc differ diff --git a/nwnds_module/npc_ianto_guard1.utc b/nwnds_module/npc_ianto_guard1.utc new file mode 100644 index 000000000..f8f88b17b Binary files /dev/null and b/nwnds_module/npc_ianto_guard1.utc differ diff --git a/nwnds_module/npc_ianto_guard2.utc b/nwnds_module/npc_ianto_guard2.utc new file mode 100644 index 000000000..77d988a6a Binary files /dev/null and b/nwnds_module/npc_ianto_guard2.utc differ diff --git a/nwnds_module/npc_ibod.utc b/nwnds_module/npc_ibod.utc new file mode 100644 index 000000000..4fe02c3c1 Binary files /dev/null and b/nwnds_module/npc_ibod.utc differ diff --git a/nwnds_module/npc_ikka.utc b/nwnds_module/npc_ikka.utc new file mode 100644 index 000000000..57e988106 Binary files /dev/null and b/nwnds_module/npc_ikka.utc differ diff --git a/nwnds_module/npc_innkeeper.utc b/nwnds_module/npc_innkeeper.utc new file mode 100644 index 000000000..c3cba524b Binary files /dev/null and b/nwnds_module/npc_innkeeper.utc differ diff --git a/nwnds_module/npc_jacob.utc b/nwnds_module/npc_jacob.utc new file mode 100644 index 000000000..04abaee0b Binary files /dev/null and b/nwnds_module/npc_jacob.utc differ diff --git a/nwnds_module/npc_jagra.utc b/nwnds_module/npc_jagra.utc new file mode 100644 index 000000000..6affbbfea Binary files /dev/null and b/nwnds_module/npc_jagra.utc differ diff --git a/nwnds_module/npc_jameson.utc b/nwnds_module/npc_jameson.utc new file mode 100644 index 000000000..ac68bb505 Binary files /dev/null and b/nwnds_module/npc_jameson.utc differ diff --git a/nwnds_module/npc_jandi.utc b/nwnds_module/npc_jandi.utc new file mode 100644 index 000000000..51ab1ea11 Binary files /dev/null and b/nwnds_module/npc_jandi.utc differ diff --git a/nwnds_module/npc_jariel.utc b/nwnds_module/npc_jariel.utc new file mode 100644 index 000000000..da7e31389 Binary files /dev/null and b/nwnds_module/npc_jariel.utc differ diff --git a/nwnds_module/npc_jaryx.utc b/nwnds_module/npc_jaryx.utc new file mode 100644 index 000000000..da282de9f Binary files /dev/null and b/nwnds_module/npc_jaryx.utc differ diff --git a/nwnds_module/npc_jeeva.utc b/nwnds_module/npc_jeeva.utc new file mode 100644 index 000000000..4803cdb33 Binary files /dev/null and b/nwnds_module/npc_jeeva.utc differ diff --git a/nwnds_module/npc_jib.utc b/nwnds_module/npc_jib.utc new file mode 100644 index 000000000..b3c3b3196 Binary files /dev/null and b/nwnds_module/npc_jib.utc differ diff --git a/nwnds_module/npc_jogodin.utc b/nwnds_module/npc_jogodin.utc new file mode 100644 index 000000000..382a762a9 Binary files /dev/null and b/nwnds_module/npc_jogodin.utc differ diff --git a/nwnds_module/npc_joshia.utc b/nwnds_module/npc_joshia.utc new file mode 100644 index 000000000..81b82fc2e Binary files /dev/null and b/nwnds_module/npc_joshia.utc differ diff --git a/nwnds_module/npc_junli.utc b/nwnds_module/npc_junli.utc new file mode 100644 index 000000000..ae7e971d2 Binary files /dev/null and b/nwnds_module/npc_junli.utc differ diff --git a/nwnds_module/npc_jurgan.utc b/nwnds_module/npc_jurgan.utc new file mode 100644 index 000000000..085b08e39 Binary files /dev/null and b/nwnds_module/npc_jurgan.utc differ diff --git a/nwnds_module/npc_justl.utc b/nwnds_module/npc_justl.utc new file mode 100644 index 000000000..8d86ca1d8 Binary files /dev/null and b/nwnds_module/npc_justl.utc differ diff --git a/nwnds_module/npc_kaia.utc b/nwnds_module/npc_kaia.utc new file mode 100644 index 000000000..78797b1ef Binary files /dev/null and b/nwnds_module/npc_kaia.utc differ diff --git a/nwnds_module/npc_kaima.utc b/nwnds_module/npc_kaima.utc new file mode 100644 index 000000000..4eeb68d53 Binary files /dev/null and b/nwnds_module/npc_kaima.utc differ diff --git a/nwnds_module/npc_kaisharga_tr.utc b/nwnds_module/npc_kaisharga_tr.utc new file mode 100644 index 000000000..cf094e050 Binary files /dev/null and b/nwnds_module/npc_kaisharga_tr.utc differ diff --git a/nwnds_module/npc_kalka.utc b/nwnds_module/npc_kalka.utc new file mode 100644 index 000000000..6500de031 Binary files /dev/null and b/nwnds_module/npc_kalka.utc differ diff --git a/nwnds_module/npc_karlen.utc b/nwnds_module/npc_karlen.utc new file mode 100644 index 000000000..6f460ad5b Binary files /dev/null and b/nwnds_module/npc_karlen.utc differ diff --git a/nwnds_module/npc_kell.utc b/nwnds_module/npc_kell.utc new file mode 100644 index 000000000..8887f2f8c Binary files /dev/null and b/nwnds_module/npc_kell.utc differ diff --git a/nwnds_module/npc_kersing.utc b/nwnds_module/npc_kersing.utc new file mode 100644 index 000000000..06cf32783 Binary files /dev/null and b/nwnds_module/npc_kersing.utc differ diff --git a/nwnds_module/npc_kiklikna.utc b/nwnds_module/npc_kiklikna.utc new file mode 100644 index 000000000..1db21a22f Binary files /dev/null and b/nwnds_module/npc_kiklikna.utc differ diff --git a/nwnds_module/npc_kilari.utc b/nwnds_module/npc_kilari.utc new file mode 100644 index 000000000..659095bca Binary files /dev/null and b/nwnds_module/npc_kilari.utc differ diff --git a/nwnds_module/npc_kilgrasta.utc b/nwnds_module/npc_kilgrasta.utc new file mode 100644 index 000000000..cdbdab026 Binary files /dev/null and b/nwnds_module/npc_kilgrasta.utc differ diff --git a/nwnds_module/npc_kjaghi.utc b/nwnds_module/npc_kjaghi.utc new file mode 100644 index 000000000..682ab4c50 Binary files /dev/null and b/nwnds_module/npc_kjaghi.utc differ diff --git a/nwnds_module/npc_klarg.utc b/nwnds_module/npc_klarg.utc new file mode 100644 index 000000000..2bcad0a23 Binary files /dev/null and b/nwnds_module/npc_klarg.utc differ diff --git a/nwnds_module/npc_kledguard.utc b/nwnds_module/npc_kledguard.utc new file mode 100644 index 000000000..33d791029 Binary files /dev/null and b/nwnds_module/npc_kledguard.utc differ diff --git a/nwnds_module/npc_koria.utc b/nwnds_module/npc_koria.utc new file mode 100644 index 000000000..e121b812d Binary files /dev/null and b/nwnds_module/npc_koria.utc differ diff --git a/nwnds_module/npc_korrik.utc b/nwnds_module/npc_korrik.utc new file mode 100644 index 000000000..8d7a88047 Binary files /dev/null and b/nwnds_module/npc_korrik.utc differ diff --git a/nwnds_module/npc_larak.utc b/nwnds_module/npc_larak.utc new file mode 100644 index 000000000..2e8cdbba8 Binary files /dev/null and b/nwnds_module/npc_larak.utc differ diff --git a/nwnds_module/npc_larz.utc b/nwnds_module/npc_larz.utc new file mode 100644 index 000000000..0b38ed9ac Binary files /dev/null and b/nwnds_module/npc_larz.utc differ diff --git a/nwnds_module/npc_laus.utc b/nwnds_module/npc_laus.utc new file mode 100644 index 000000000..ab8a8b10e Binary files /dev/null and b/nwnds_module/npc_laus.utc differ diff --git a/nwnds_module/npc_lemli.utc b/nwnds_module/npc_lemli.utc new file mode 100644 index 000000000..4b687362e Binary files /dev/null and b/nwnds_module/npc_lemli.utc differ diff --git a/nwnds_module/npc_leston.utc b/nwnds_module/npc_leston.utc new file mode 100644 index 000000000..beaec713e Binary files /dev/null and b/nwnds_module/npc_leston.utc differ diff --git a/nwnds_module/npc_lilara.utc b/nwnds_module/npc_lilara.utc new file mode 100644 index 000000000..f948d5358 Binary files /dev/null and b/nwnds_module/npc_lilara.utc differ diff --git a/nwnds_module/npc_logan.utc b/nwnds_module/npc_logan.utc new file mode 100644 index 000000000..5fddd5fae Binary files /dev/null and b/nwnds_module/npc_logan.utc differ diff --git a/nwnds_module/npc_lorae.utc b/nwnds_module/npc_lorae.utc new file mode 100644 index 000000000..f9fb49ed1 Binary files /dev/null and b/nwnds_module/npc_lorae.utc differ diff --git a/nwnds_module/npc_magda.utc b/nwnds_module/npc_magda.utc new file mode 100644 index 000000000..2ed3c9a84 Binary files /dev/null and b/nwnds_module/npc_magda.utc differ diff --git a/nwnds_module/npc_marcus.utc b/nwnds_module/npc_marcus.utc new file mode 100644 index 000000000..23ba72fcc Binary files /dev/null and b/nwnds_module/npc_marcus.utc differ diff --git a/nwnds_module/npc_marris.utc b/nwnds_module/npc_marris.utc new file mode 100644 index 000000000..0b6702d8e Binary files /dev/null and b/nwnds_module/npc_marris.utc differ diff --git a/nwnds_module/npc_martosa.utc b/nwnds_module/npc_martosa.utc new file mode 100644 index 000000000..b6364c7b6 Binary files /dev/null and b/nwnds_module/npc_martosa.utc differ diff --git a/nwnds_module/npc_martosa001.utc b/nwnds_module/npc_martosa001.utc new file mode 100644 index 000000000..01dd80226 Binary files /dev/null and b/nwnds_module/npc_martosa001.utc differ diff --git a/nwnds_module/npc_mayz.utc b/nwnds_module/npc_mayz.utc new file mode 100644 index 000000000..6c3a77ffc Binary files /dev/null and b/nwnds_module/npc_mayz.utc differ diff --git a/nwnds_module/npc_melocine.utc b/nwnds_module/npc_melocine.utc new file mode 100644 index 000000000..66975faa8 Binary files /dev/null and b/nwnds_module/npc_melocine.utc differ diff --git a/nwnds_module/npc_mikhail.utc b/nwnds_module/npc_mikhail.utc new file mode 100644 index 000000000..15cb144db Binary files /dev/null and b/nwnds_module/npc_mikhail.utc differ diff --git a/nwnds_module/npc_mila.utc b/nwnds_module/npc_mila.utc new file mode 100644 index 000000000..48a58293c Binary files /dev/null and b/nwnds_module/npc_mila.utc differ diff --git a/nwnds_module/npc_mim.utc b/nwnds_module/npc_mim.utc new file mode 100644 index 000000000..adf25a456 Binary files /dev/null and b/nwnds_module/npc_mim.utc differ diff --git a/nwnds_module/npc_minerva.utc b/nwnds_module/npc_minerva.utc new file mode 100644 index 000000000..4424fb06b Binary files /dev/null and b/nwnds_module/npc_minerva.utc differ diff --git a/nwnds_module/npc_minna.utc b/nwnds_module/npc_minna.utc new file mode 100644 index 000000000..ccce69819 Binary files /dev/null and b/nwnds_module/npc_minna.utc differ diff --git a/nwnds_module/npc_morian.utc b/nwnds_module/npc_morian.utc new file mode 100644 index 000000000..56cc68630 Binary files /dev/null and b/nwnds_module/npc_morian.utc differ diff --git a/nwnds_module/npc_moric.utc b/nwnds_module/npc_moric.utc new file mode 100644 index 000000000..1601ff5ff Binary files /dev/null and b/nwnds_module/npc_moric.utc differ diff --git a/nwnds_module/npc_mort.utc b/nwnds_module/npc_mort.utc new file mode 100644 index 000000000..0c004d280 Binary files /dev/null and b/nwnds_module/npc_mort.utc differ diff --git a/nwnds_module/npc_naamo.utc b/nwnds_module/npc_naamo.utc new file mode 100644 index 000000000..7c8282e66 Binary files /dev/null and b/nwnds_module/npc_naamo.utc differ diff --git a/nwnds_module/npc_nadie.utc b/nwnds_module/npc_nadie.utc new file mode 100644 index 000000000..d5d02d43f Binary files /dev/null and b/nwnds_module/npc_nadie.utc differ diff --git a/nwnds_module/npc_nather.utc b/nwnds_module/npc_nather.utc new file mode 100644 index 000000000..8f393cc0f Binary files /dev/null and b/nwnds_module/npc_nather.utc differ diff --git a/nwnds_module/npc_nicha.utc b/nwnds_module/npc_nicha.utc new file mode 100644 index 000000000..16a418381 Binary files /dev/null and b/nwnds_module/npc_nicha.utc differ diff --git a/nwnds_module/npc_nils.utc b/nwnds_module/npc_nils.utc new file mode 100644 index 000000000..498d955fa Binary files /dev/null and b/nwnds_module/npc_nils.utc differ diff --git a/nwnds_module/npc_nina.utc b/nwnds_module/npc_nina.utc new file mode 100644 index 000000000..0857ee4f1 Binary files /dev/null and b/nwnds_module/npc_nina.utc differ diff --git a/nwnds_module/npc_nitaa.utc b/nwnds_module/npc_nitaa.utc new file mode 100644 index 000000000..2081df4b1 Binary files /dev/null and b/nwnds_module/npc_nitaa.utc differ diff --git a/nwnds_module/npc_nomadtrader.utc b/nwnds_module/npc_nomadtrader.utc new file mode 100644 index 000000000..0c14e5893 Binary files /dev/null and b/nwnds_module/npc_nomadtrader.utc differ diff --git a/nwnds_module/npc_nora.utc b/nwnds_module/npc_nora.utc new file mode 100644 index 000000000..78f3731c2 Binary files /dev/null and b/nwnds_module/npc_nora.utc differ diff --git a/nwnds_module/npc_notuka.utc b/nwnds_module/npc_notuka.utc new file mode 100644 index 000000000..b239f208a Binary files /dev/null and b/nwnds_module/npc_notuka.utc differ diff --git a/nwnds_module/npc_oberon.utc b/nwnds_module/npc_oberon.utc new file mode 100644 index 000000000..ac6fa7d16 Binary files /dev/null and b/nwnds_module/npc_oberon.utc differ diff --git a/nwnds_module/npc_olaes.utc b/nwnds_module/npc_olaes.utc new file mode 100644 index 000000000..455e2ae54 Binary files /dev/null and b/nwnds_module/npc_olaes.utc differ diff --git a/nwnds_module/npc_oldmeg.utc b/nwnds_module/npc_oldmeg.utc new file mode 100644 index 000000000..b3647f2fd Binary files /dev/null and b/nwnds_module/npc_oldmeg.utc differ diff --git a/nwnds_module/npc_oldwendel.utc b/nwnds_module/npc_oldwendel.utc new file mode 100644 index 000000000..777bb9bd7 Binary files /dev/null and b/nwnds_module/npc_oldwendel.utc differ diff --git a/nwnds_module/npc_olina.utc b/nwnds_module/npc_olina.utc new file mode 100644 index 000000000..2e2ab077d Binary files /dev/null and b/nwnds_module/npc_olina.utc differ diff --git a/nwnds_module/npc_pa.utc b/nwnds_module/npc_pa.utc new file mode 100644 index 000000000..9a761ac6f Binary files /dev/null and b/nwnds_module/npc_pa.utc differ diff --git a/nwnds_module/npc_parik.utc b/nwnds_module/npc_parik.utc new file mode 100644 index 000000000..7d73c9bd1 Binary files /dev/null and b/nwnds_module/npc_parik.utc differ diff --git a/nwnds_module/npc_periam.utc b/nwnds_module/npc_periam.utc new file mode 100644 index 000000000..1adfa7a46 Binary files /dev/null and b/nwnds_module/npc_periam.utc differ diff --git a/nwnds_module/npc_phobos.utc b/nwnds_module/npc_phobos.utc new file mode 100644 index 000000000..4e6c59a1a Binary files /dev/null and b/nwnds_module/npc_phobos.utc differ diff --git a/nwnds_module/npc_plute.utc b/nwnds_module/npc_plute.utc new file mode 100644 index 000000000..9fe95dd89 Binary files /dev/null and b/nwnds_module/npc_plute.utc differ diff --git a/nwnds_module/npc_prata.utc b/nwnds_module/npc_prata.utc new file mode 100644 index 000000000..2f2726328 Binary files /dev/null and b/nwnds_module/npc_prata.utc differ diff --git a/nwnds_module/npc_prihn.utc b/nwnds_module/npc_prihn.utc new file mode 100644 index 000000000..0321d4b44 Binary files /dev/null and b/nwnds_module/npc_prihn.utc differ diff --git a/nwnds_module/npc_qualthas.utc b/nwnds_module/npc_qualthas.utc new file mode 100644 index 000000000..b443a8e6f Binary files /dev/null and b/nwnds_module/npc_qualthas.utc differ diff --git a/nwnds_module/npc_rainkin.utc b/nwnds_module/npc_rainkin.utc new file mode 100644 index 000000000..bcb09bf05 Binary files /dev/null and b/nwnds_module/npc_rainkin.utc differ diff --git a/nwnds_module/npc_renny.utc b/nwnds_module/npc_renny.utc new file mode 100644 index 000000000..5bba605ab Binary files /dev/null and b/nwnds_module/npc_renny.utc differ diff --git a/nwnds_module/npc_rodon.utc b/nwnds_module/npc_rodon.utc new file mode 100644 index 000000000..d60dacb49 Binary files /dev/null and b/nwnds_module/npc_rodon.utc differ diff --git a/nwnds_module/npc_rogan.utc b/nwnds_module/npc_rogan.utc new file mode 100644 index 000000000..fe1f390b0 Binary files /dev/null and b/nwnds_module/npc_rogan.utc differ diff --git a/nwnds_module/npc_rolin.utc b/nwnds_module/npc_rolin.utc new file mode 100644 index 000000000..cf6346af7 Binary files /dev/null and b/nwnds_module/npc_rolin.utc differ diff --git a/nwnds_module/npc_rv_goldlion1.utc b/nwnds_module/npc_rv_goldlion1.utc new file mode 100644 index 000000000..f6a538fca Binary files /dev/null and b/nwnds_module/npc_rv_goldlion1.utc differ diff --git a/nwnds_module/npc_rv_goldlion2.utc b/nwnds_module/npc_rv_goldlion2.utc new file mode 100644 index 000000000..b414c69ec Binary files /dev/null and b/nwnds_module/npc_rv_goldlion2.utc differ diff --git a/nwnds_module/npc_rv_shubby.utc b/nwnds_module/npc_rv_shubby.utc new file mode 100644 index 000000000..2698b29ea Binary files /dev/null and b/nwnds_module/npc_rv_shubby.utc differ diff --git a/nwnds_module/npc_rv_sildunes.utc b/nwnds_module/npc_rv_sildunes.utc new file mode 100644 index 000000000..becdae230 Binary files /dev/null and b/nwnds_module/npc_rv_sildunes.utc differ diff --git a/nwnds_module/npc_samin.utc b/nwnds_module/npc_samin.utc new file mode 100644 index 000000000..24470a94a Binary files /dev/null and b/nwnds_module/npc_samin.utc differ diff --git a/nwnds_module/npc_sarkea.utc b/nwnds_module/npc_sarkea.utc new file mode 100644 index 000000000..920cb113d Binary files /dev/null and b/nwnds_module/npc_sarkea.utc differ diff --git a/nwnds_module/npc_sarrick.utc b/nwnds_module/npc_sarrick.utc new file mode 100644 index 000000000..77df0dd4c Binary files /dev/null and b/nwnds_module/npc_sarrick.utc differ diff --git a/nwnds_module/npc_selene.utc b/nwnds_module/npc_selene.utc new file mode 100644 index 000000000..b0bce71ad Binary files /dev/null and b/nwnds_module/npc_selene.utc differ diff --git a/nwnds_module/npc_shade.utc b/nwnds_module/npc_shade.utc new file mode 100644 index 000000000..7726e6d7d Binary files /dev/null and b/nwnds_module/npc_shade.utc differ diff --git a/nwnds_module/npc_shiral.utc b/nwnds_module/npc_shiral.utc new file mode 100644 index 000000000..93c65869b Binary files /dev/null and b/nwnds_module/npc_shiral.utc differ diff --git a/nwnds_module/npc_sinifa.utc b/nwnds_module/npc_sinifa.utc new file mode 100644 index 000000000..051c9c372 Binary files /dev/null and b/nwnds_module/npc_sinifa.utc differ diff --git a/nwnds_module/npc_ss_antteno.utc b/nwnds_module/npc_ss_antteno.utc new file mode 100644 index 000000000..d445ef8bf Binary files /dev/null and b/nwnds_module/npc_ss_antteno.utc differ diff --git a/nwnds_module/npc_ss_basettu.utc b/nwnds_module/npc_ss_basettu.utc new file mode 100644 index 000000000..0631739d5 Binary files /dev/null and b/nwnds_module/npc_ss_basettu.utc differ diff --git a/nwnds_module/npc_ss_bernardi.utc b/nwnds_module/npc_ss_bernardi.utc new file mode 100644 index 000000000..38a102a7b Binary files /dev/null and b/nwnds_module/npc_ss_bernardi.utc differ diff --git a/nwnds_module/npc_ss_birdini.utc b/nwnds_module/npc_ss_birdini.utc new file mode 100644 index 000000000..a67de7c34 Binary files /dev/null and b/nwnds_module/npc_ss_birdini.utc differ diff --git a/nwnds_module/npc_ss_cantrel.utc b/nwnds_module/npc_ss_cantrel.utc new file mode 100644 index 000000000..40b60f19d Binary files /dev/null and b/nwnds_module/npc_ss_cantrel.utc differ diff --git a/nwnds_module/npc_ss_castien.utc b/nwnds_module/npc_ss_castien.utc new file mode 100644 index 000000000..6c50a567d Binary files /dev/null and b/nwnds_module/npc_ss_castien.utc differ diff --git a/nwnds_module/npc_ss_cleric.utc b/nwnds_module/npc_ss_cleric.utc new file mode 100644 index 000000000..73b2a56b2 Binary files /dev/null and b/nwnds_module/npc_ss_cleric.utc differ diff --git a/nwnds_module/npc_ss_connak.utc b/nwnds_module/npc_ss_connak.utc new file mode 100644 index 000000000..7d96c4e69 Binary files /dev/null and b/nwnds_module/npc_ss_connak.utc differ diff --git a/nwnds_module/npc_ss_darcass.utc b/nwnds_module/npc_ss_darcass.utc new file mode 100644 index 000000000..16b29ac4c Binary files /dev/null and b/nwnds_module/npc_ss_darcass.utc differ diff --git a/nwnds_module/npc_ss_devdan.utc b/nwnds_module/npc_ss_devdan.utc new file mode 100644 index 000000000..c7d395202 Binary files /dev/null and b/nwnds_module/npc_ss_devdan.utc differ diff --git a/nwnds_module/npc_ss_dowler.utc b/nwnds_module/npc_ss_dowler.utc new file mode 100644 index 000000000..2e77c8e55 Binary files /dev/null and b/nwnds_module/npc_ss_dowler.utc differ diff --git a/nwnds_module/npc_ss_elpidio.utc b/nwnds_module/npc_ss_elpidio.utc new file mode 100644 index 000000000..d0c8682fd Binary files /dev/null and b/nwnds_module/npc_ss_elpidio.utc differ diff --git a/nwnds_module/npc_ss_elred.utc b/nwnds_module/npc_ss_elred.utc new file mode 100644 index 000000000..80dc2ecc9 Binary files /dev/null and b/nwnds_module/npc_ss_elred.utc differ diff --git a/nwnds_module/npc_ss_feno.utc b/nwnds_module/npc_ss_feno.utc new file mode 100644 index 000000000..a85af2575 Binary files /dev/null and b/nwnds_module/npc_ss_feno.utc differ diff --git a/nwnds_module/npc_ss_giullis.utc b/nwnds_module/npc_ss_giullis.utc new file mode 100644 index 000000000..de43fbfb7 Binary files /dev/null and b/nwnds_module/npc_ss_giullis.utc differ diff --git a/nwnds_module/npc_ss_gormar.utc b/nwnds_module/npc_ss_gormar.utc new file mode 100644 index 000000000..73505110d Binary files /dev/null and b/nwnds_module/npc_ss_gormar.utc differ diff --git a/nwnds_module/npc_ss_grisim.utc b/nwnds_module/npc_ss_grisim.utc new file mode 100644 index 000000000..108e6272c Binary files /dev/null and b/nwnds_module/npc_ss_grisim.utc differ diff --git a/nwnds_module/npc_ss_guard001.utc b/nwnds_module/npc_ss_guard001.utc new file mode 100644 index 000000000..d99841d13 Binary files /dev/null and b/nwnds_module/npc_ss_guard001.utc differ diff --git a/nwnds_module/npc_ss_guard002.utc b/nwnds_module/npc_ss_guard002.utc new file mode 100644 index 000000000..a5673af3d Binary files /dev/null and b/nwnds_module/npc_ss_guard002.utc differ diff --git a/nwnds_module/npc_ss_hayrk.utc b/nwnds_module/npc_ss_hayrk.utc new file mode 100644 index 000000000..3e73d308b Binary files /dev/null and b/nwnds_module/npc_ss_hayrk.utc differ diff --git a/nwnds_module/npc_ss_inchel.utc b/nwnds_module/npc_ss_inchel.utc new file mode 100644 index 000000000..e8e2e1c0c Binary files /dev/null and b/nwnds_module/npc_ss_inchel.utc differ diff --git a/nwnds_module/npc_ss_iyrand.utc b/nwnds_module/npc_ss_iyrand.utc new file mode 100644 index 000000000..e09fc9b8f Binary files /dev/null and b/nwnds_module/npc_ss_iyrand.utc differ diff --git a/nwnds_module/npc_ss_janha.utc b/nwnds_module/npc_ss_janha.utc new file mode 100644 index 000000000..1dd0540b5 Binary files /dev/null and b/nwnds_module/npc_ss_janha.utc differ diff --git a/nwnds_module/npc_ss_jaylin.utc b/nwnds_module/npc_ss_jaylin.utc new file mode 100644 index 000000000..232edeb5f Binary files /dev/null and b/nwnds_module/npc_ss_jaylin.utc differ diff --git a/nwnds_module/npc_ss_kakalin.utc b/nwnds_module/npc_ss_kakalin.utc new file mode 100644 index 000000000..f4d2d275b Binary files /dev/null and b/nwnds_module/npc_ss_kakalin.utc differ diff --git a/nwnds_module/npc_ss_katar.utc b/nwnds_module/npc_ss_katar.utc new file mode 100644 index 000000000..933fb90c3 Binary files /dev/null and b/nwnds_module/npc_ss_katar.utc differ diff --git a/nwnds_module/npc_ss_kelvhan.utc b/nwnds_module/npc_ss_kelvhan.utc new file mode 100644 index 000000000..8bf6d048c Binary files /dev/null and b/nwnds_module/npc_ss_kelvhan.utc differ diff --git a/nwnds_module/npc_ss_lavan.utc b/nwnds_module/npc_ss_lavan.utc new file mode 100644 index 000000000..211944196 Binary files /dev/null and b/nwnds_module/npc_ss_lavan.utc differ diff --git a/nwnds_module/npc_ss_lensa.utc b/nwnds_module/npc_ss_lensa.utc new file mode 100644 index 000000000..498007071 Binary files /dev/null and b/nwnds_module/npc_ss_lensa.utc differ diff --git a/nwnds_module/npc_ss_locklin.utc b/nwnds_module/npc_ss_locklin.utc new file mode 100644 index 000000000..f17896b54 Binary files /dev/null and b/nwnds_module/npc_ss_locklin.utc differ diff --git a/nwnds_module/npc_ss_lyklor.utc b/nwnds_module/npc_ss_lyklor.utc new file mode 100644 index 000000000..2306fd980 Binary files /dev/null and b/nwnds_module/npc_ss_lyklor.utc differ diff --git a/nwnds_module/npc_ss_merchant.utc b/nwnds_module/npc_ss_merchant.utc new file mode 100644 index 000000000..2c1767173 Binary files /dev/null and b/nwnds_module/npc_ss_merchant.utc differ diff --git a/nwnds_module/npc_ss_mogon.utc b/nwnds_module/npc_ss_mogon.utc new file mode 100644 index 000000000..0935fe170 Binary files /dev/null and b/nwnds_module/npc_ss_mogon.utc differ diff --git a/nwnds_module/npc_ss_mystic.utc b/nwnds_module/npc_ss_mystic.utc new file mode 100644 index 000000000..b10d11324 Binary files /dev/null and b/nwnds_module/npc_ss_mystic.utc differ diff --git a/nwnds_module/npc_ss_patalan.utc b/nwnds_module/npc_ss_patalan.utc new file mode 100644 index 000000000..d320ec304 Binary files /dev/null and b/nwnds_module/npc_ss_patalan.utc differ diff --git a/nwnds_module/npc_ss_quaar.utc b/nwnds_module/npc_ss_quaar.utc new file mode 100644 index 000000000..644092304 Binary files /dev/null and b/nwnds_module/npc_ss_quaar.utc differ diff --git a/nwnds_module/npc_ss_revalor.utc b/nwnds_module/npc_ss_revalor.utc new file mode 100644 index 000000000..4bf9d2352 Binary files /dev/null and b/nwnds_module/npc_ss_revalor.utc differ diff --git a/nwnds_module/npc_ss_rothom.utc b/nwnds_module/npc_ss_rothom.utc new file mode 100644 index 000000000..dfd36254b Binary files /dev/null and b/nwnds_module/npc_ss_rothom.utc differ diff --git a/nwnds_module/npc_ss_rowlyn.utc b/nwnds_module/npc_ss_rowlyn.utc new file mode 100644 index 000000000..e410e39ce Binary files /dev/null and b/nwnds_module/npc_ss_rowlyn.utc differ diff --git a/nwnds_module/npc_ss_ryfom.utc b/nwnds_module/npc_ss_ryfom.utc new file mode 100644 index 000000000..9109f3ad0 Binary files /dev/null and b/nwnds_module/npc_ss_ryfom.utc differ diff --git a/nwnds_module/npc_ss_sundstr.utc b/nwnds_module/npc_ss_sundstr.utc new file mode 100644 index 000000000..43d401e15 Binary files /dev/null and b/nwnds_module/npc_ss_sundstr.utc differ diff --git a/nwnds_module/npc_ss_tacktar.utc b/nwnds_module/npc_ss_tacktar.utc new file mode 100644 index 000000000..86a075653 Binary files /dev/null and b/nwnds_module/npc_ss_tacktar.utc differ diff --git a/nwnds_module/npc_ss_targen.utc b/nwnds_module/npc_ss_targen.utc new file mode 100644 index 000000000..c311edca0 Binary files /dev/null and b/nwnds_module/npc_ss_targen.utc differ diff --git a/nwnds_module/npc_ss_torami.utc b/nwnds_module/npc_ss_torami.utc new file mode 100644 index 000000000..dc4eec6c8 Binary files /dev/null and b/nwnds_module/npc_ss_torami.utc differ diff --git a/nwnds_module/npc_ss_toramund.utc b/nwnds_module/npc_ss_toramund.utc new file mode 100644 index 000000000..5ff3076c6 Binary files /dev/null and b/nwnds_module/npc_ss_toramund.utc differ diff --git a/nwnds_module/npc_ss_travara.utc b/nwnds_module/npc_ss_travara.utc new file mode 100644 index 000000000..611000f19 Binary files /dev/null and b/nwnds_module/npc_ss_travara.utc differ diff --git a/nwnds_module/npc_ss_vulwin.utc b/nwnds_module/npc_ss_vulwin.utc new file mode 100644 index 000000000..9a3f1ed00 Binary files /dev/null and b/nwnds_module/npc_ss_vulwin.utc differ diff --git a/nwnds_module/npc_stagdrunk.utc b/nwnds_module/npc_stagdrunk.utc new file mode 100644 index 000000000..8f6e33a37 Binary files /dev/null and b/nwnds_module/npc_stagdrunk.utc differ diff --git a/nwnds_module/npc_statue.ncs b/nwnds_module/npc_statue.ncs new file mode 100644 index 000000000..4a432101a Binary files /dev/null and b/nwnds_module/npc_statue.ncs differ diff --git a/nwnds_module/npc_statue.nss b/nwnds_module/npc_statue.nss new file mode 100644 index 000000000..48cdd28a2 --- /dev/null +++ b/nwnds_module/npc_statue.nss @@ -0,0 +1,32 @@ +//:: Name: NPC Statues +//:: FileName: npc_statue +// Used to make a sort of "living statue" prop to +// add a bit of eerie ambience to an area. +// 1. Create a custom NPC +// 2. Place whatever you wish in its inventory-- +// torches/light items recommended +// 3. Remove all scripts from NPC +// 4. Place this script in OnSpawn +// 5. Place NPC in area +// +// Created By: Todmaerin +// Created On: 6/23/02 +void main() +{ + // Target NPC + object oTarget = OBJECT_SELF; + + // Don't want this wearing off now, do we? + int nDurationType = DURATION_TYPE_PERMANENT; + + // Declare effect1, the paralyze. + effect eEffect1 = EffectParalyze(); + + // Declare effect2, the stoneskin visual + effect eEffect2 = EffectVisualEffect (VFX_DUR_PROT_STONESKIN); + + // now apply it, and keep it. + ApplyEffectToObject (nDurationType, eEffect1, oTarget); + ApplyEffectToObject (nDurationType, eEffect2, oTarget); + SetPlotFlag(oTarget, TRUE); +} diff --git a/nwnds_module/npc_strabo.utc b/nwnds_module/npc_strabo.utc new file mode 100644 index 000000000..368872640 Binary files /dev/null and b/nwnds_module/npc_strabo.utc differ diff --git a/nwnds_module/npc_tal.utc b/nwnds_module/npc_tal.utc new file mode 100644 index 000000000..fc80c8f52 Binary files /dev/null and b/nwnds_module/npc_tal.utc differ diff --git a/nwnds_module/npc_tala.utc b/nwnds_module/npc_tala.utc new file mode 100644 index 000000000..5ab14b1b7 Binary files /dev/null and b/nwnds_module/npc_tala.utc differ diff --git a/nwnds_module/npc_targ.utc b/nwnds_module/npc_targ.utc new file mode 100644 index 000000000..71d12e869 Binary files /dev/null and b/nwnds_module/npc_targ.utc differ diff --git a/nwnds_module/npc_tarill.utc b/nwnds_module/npc_tarill.utc new file mode 100644 index 000000000..9222d9c54 Binary files /dev/null and b/nwnds_module/npc_tarill.utc differ diff --git a/nwnds_module/npc_tavenvalet.utc b/nwnds_module/npc_tavenvalet.utc new file mode 100644 index 000000000..1c883dd98 Binary files /dev/null and b/nwnds_module/npc_tavenvalet.utc differ diff --git a/nwnds_module/npc_tekanthis.utc b/nwnds_module/npc_tekanthis.utc new file mode 100644 index 000000000..968af17e8 Binary files /dev/null and b/nwnds_module/npc_tekanthis.utc differ diff --git a/nwnds_module/npc_telula.utc b/nwnds_module/npc_telula.utc new file mode 100644 index 000000000..96642861a Binary files /dev/null and b/nwnds_module/npc_telula.utc differ diff --git a/nwnds_module/npc_tempjunai.utc b/nwnds_module/npc_tempjunai.utc new file mode 100644 index 000000000..f957c1aee Binary files /dev/null and b/nwnds_module/npc_tempjunai.utc differ diff --git a/nwnds_module/npc_templarweis.utc b/nwnds_module/npc_templarweis.utc new file mode 100644 index 000000000..e3aafd78a Binary files /dev/null and b/nwnds_module/npc_templarweis.utc differ diff --git a/nwnds_module/npc_tempyehina.utc b/nwnds_module/npc_tempyehina.utc new file mode 100644 index 000000000..f889c335e Binary files /dev/null and b/nwnds_module/npc_tempyehina.utc differ diff --git a/nwnds_module/npc_teren.utc b/nwnds_module/npc_teren.utc new file mode 100644 index 000000000..ad2ee280f Binary files /dev/null and b/nwnds_module/npc_teren.utc differ diff --git a/nwnds_module/npc_teth.utc b/nwnds_module/npc_teth.utc new file mode 100644 index 000000000..9f4f95c33 Binary files /dev/null and b/nwnds_module/npc_teth.utc differ diff --git a/nwnds_module/npc_thander.utc b/nwnds_module/npc_thander.utc new file mode 100644 index 000000000..69eedca4b Binary files /dev/null and b/nwnds_module/npc_thander.utc differ diff --git a/nwnds_module/npc_theor.utc b/nwnds_module/npc_theor.utc new file mode 100644 index 000000000..88feba5dc Binary files /dev/null and b/nwnds_module/npc_theor.utc differ diff --git a/nwnds_module/npc_thrane.utc b/nwnds_module/npc_thrane.utc new file mode 100644 index 000000000..43994379a Binary files /dev/null and b/nwnds_module/npc_thrane.utc differ diff --git a/nwnds_module/npc_thrar.utc b/nwnds_module/npc_thrar.utc new file mode 100644 index 000000000..60de22ef5 Binary files /dev/null and b/nwnds_module/npc_thrar.utc differ diff --git a/nwnds_module/npc_tigra.utc b/nwnds_module/npc_tigra.utc new file mode 100644 index 000000000..d66004198 Binary files /dev/null and b/nwnds_module/npc_tigra.utc differ diff --git a/nwnds_module/npc_tindra.utc b/nwnds_module/npc_tindra.utc new file mode 100644 index 000000000..d37c5d7ba Binary files /dev/null and b/nwnds_module/npc_tindra.utc differ diff --git a/nwnds_module/npc_tora.utc b/nwnds_module/npc_tora.utc new file mode 100644 index 000000000..1c71ae46e Binary files /dev/null and b/nwnds_module/npc_tora.utc differ diff --git a/nwnds_module/npc_traabi.utc b/nwnds_module/npc_traabi.utc new file mode 100644 index 000000000..096668211 Binary files /dev/null and b/nwnds_module/npc_traabi.utc differ diff --git a/nwnds_module/npc_trakon.utc b/nwnds_module/npc_trakon.utc new file mode 100644 index 000000000..2e0817e22 Binary files /dev/null and b/nwnds_module/npc_trakon.utc differ diff --git a/nwnds_module/npc_trici.utc b/nwnds_module/npc_trici.utc new file mode 100644 index 000000000..14772543a Binary files /dev/null and b/nwnds_module/npc_trici.utc differ diff --git a/nwnds_module/npc_tsarla.utc b/nwnds_module/npc_tsarla.utc new file mode 100644 index 000000000..66e44026c Binary files /dev/null and b/nwnds_module/npc_tsarla.utc differ diff --git a/nwnds_module/npc_tyrguard001.utc b/nwnds_module/npc_tyrguard001.utc new file mode 100644 index 000000000..456bc2114 Binary files /dev/null and b/nwnds_module/npc_tyrguard001.utc differ diff --git a/nwnds_module/npc_tyrguardcapt.utc b/nwnds_module/npc_tyrguardcapt.utc new file mode 100644 index 000000000..08f9539bf Binary files /dev/null and b/nwnds_module/npc_tyrguardcapt.utc differ diff --git a/nwnds_module/npc_tyrjailer001.utc b/nwnds_module/npc_tyrjailer001.utc new file mode 100644 index 000000000..a83206863 Binary files /dev/null and b/nwnds_module/npc_tyrjailer001.utc differ diff --git a/nwnds_module/npc_tyrsoldier01.utc b/nwnds_module/npc_tyrsoldier01.utc new file mode 100644 index 000000000..a218415d3 Binary files /dev/null and b/nwnds_module/npc_tyrsoldier01.utc differ diff --git a/nwnds_module/npc_tyrtowncrier.utc b/nwnds_module/npc_tyrtowncrier.utc new file mode 100644 index 000000000..5b6b8a137 Binary files /dev/null and b/nwnds_module/npc_tyrtowncrier.utc differ diff --git a/nwnds_module/npc_ucil.utc b/nwnds_module/npc_ucil.utc new file mode 100644 index 000000000..682a13a5c Binary files /dev/null and b/nwnds_module/npc_ucil.utc differ diff --git a/nwnds_module/npc_ula.utc b/nwnds_module/npc_ula.utc new file mode 100644 index 000000000..3b21b295e Binary files /dev/null and b/nwnds_module/npc_ula.utc differ diff --git a/nwnds_module/npc_umiautus.utc b/nwnds_module/npc_umiautus.utc new file mode 100644 index 000000000..72ed52ac9 Binary files /dev/null and b/nwnds_module/npc_umiautus.utc differ diff --git a/nwnds_module/npc_ur_kreel.utc b/nwnds_module/npc_ur_kreel.utc new file mode 100644 index 000000000..b6a2537f6 Binary files /dev/null and b/nwnds_module/npc_ur_kreel.utc differ diff --git a/nwnds_module/npc_ur_kronos.utc b/nwnds_module/npc_ur_kronos.utc new file mode 100644 index 000000000..2eed3043e Binary files /dev/null and b/nwnds_module/npc_ur_kronos.utc differ diff --git a/nwnds_module/npc_ur_maddox.utc b/nwnds_module/npc_ur_maddox.utc new file mode 100644 index 000000000..d19e2dd0f Binary files /dev/null and b/nwnds_module/npc_ur_maddox.utc differ diff --git a/nwnds_module/npc_ur_morgana.utc b/nwnds_module/npc_ur_morgana.utc new file mode 100644 index 000000000..0cf223e3a Binary files /dev/null and b/nwnds_module/npc_ur_morgana.utc differ diff --git a/nwnds_module/npc_ur_templar01.utc b/nwnds_module/npc_ur_templar01.utc new file mode 100644 index 000000000..72c2fb40f Binary files /dev/null and b/nwnds_module/npc_ur_templar01.utc differ diff --git a/nwnds_module/npc_ur_tmp_gd01.utc b/nwnds_module/npc_ur_tmp_gd01.utc new file mode 100644 index 000000000..6b93eef24 Binary files /dev/null and b/nwnds_module/npc_ur_tmp_gd01.utc differ diff --git a/nwnds_module/npc_ur_tmplr_grd.utc b/nwnds_module/npc_ur_tmplr_grd.utc new file mode 100644 index 000000000..da338049e Binary files /dev/null and b/nwnds_module/npc_ur_tmplr_grd.utc differ diff --git a/nwnds_module/npc_urikguard001.utc b/nwnds_module/npc_urikguard001.utc new file mode 100644 index 000000000..e5f31fed2 Binary files /dev/null and b/nwnds_module/npc_urikguard001.utc differ diff --git a/nwnds_module/npc_urikguard002.utc b/nwnds_module/npc_urikguard002.utc new file mode 100644 index 000000000..940451cd1 Binary files /dev/null and b/nwnds_module/npc_urikguard002.utc differ diff --git a/nwnds_module/npc_urikguard003.utc b/nwnds_module/npc_urikguard003.utc new file mode 100644 index 000000000..fb9e61fc9 Binary files /dev/null and b/nwnds_module/npc_urikguard003.utc differ diff --git a/nwnds_module/npc_vaster.utc b/nwnds_module/npc_vaster.utc new file mode 100644 index 000000000..463355b8e Binary files /dev/null and b/nwnds_module/npc_vaster.utc differ diff --git a/nwnds_module/npc_verik.utc b/nwnds_module/npc_verik.utc new file mode 100644 index 000000000..164e45b53 Binary files /dev/null and b/nwnds_module/npc_verik.utc differ diff --git a/nwnds_module/npc_vorax.utc b/nwnds_module/npc_vorax.utc new file mode 100644 index 000000000..a9402d419 Binary files /dev/null and b/nwnds_module/npc_vorax.utc differ diff --git a/nwnds_module/npc_westmore.utc b/nwnds_module/npc_westmore.utc new file mode 100644 index 000000000..7a2da36f0 Binary files /dev/null and b/nwnds_module/npc_westmore.utc differ diff --git a/nwnds_module/npc_widow_hendel.utc b/nwnds_module/npc_widow_hendel.utc new file mode 100644 index 000000000..cb36d6a69 Binary files /dev/null and b/nwnds_module/npc_widow_hendel.utc differ diff --git a/nwnds_module/npc_wik.utc b/nwnds_module/npc_wik.utc new file mode 100644 index 000000000..d62fc2c56 Binary files /dev/null and b/nwnds_module/npc_wik.utc differ diff --git a/nwnds_module/npc_xia.utc b/nwnds_module/npc_xia.utc new file mode 100644 index 000000000..f47dce4f8 Binary files /dev/null and b/nwnds_module/npc_xia.utc differ diff --git a/nwnds_module/npc_yalla.utc b/nwnds_module/npc_yalla.utc new file mode 100644 index 000000000..0ab21c402 Binary files /dev/null and b/nwnds_module/npc_yalla.utc differ diff --git a/nwnds_module/npc_yt_trader01.utc b/nwnds_module/npc_yt_trader01.utc new file mode 100644 index 000000000..7a0a30153 Binary files /dev/null and b/nwnds_module/npc_yt_trader01.utc differ diff --git a/nwnds_module/npc_zanthos.utc b/nwnds_module/npc_zanthos.utc new file mode 100644 index 000000000..36b0d1840 Binary files /dev/null and b/nwnds_module/npc_zanthos.utc differ diff --git a/nwnds_module/npc_zimalan.utc b/nwnds_module/npc_zimalan.utc new file mode 100644 index 000000000..e64967136 Binary files /dev/null and b/nwnds_module/npc_zimalan.utc differ diff --git a/nwnds_module/npc_zul.utc b/nwnds_module/npc_zul.utc new file mode 100644 index 000000000..85a2e4da3 Binary files /dev/null and b/nwnds_module/npc_zul.utc differ diff --git a/nwnds_module/npc_zyph.utc b/nwnds_module/npc_zyph.utc new file mode 100644 index 000000000..e14ee6bf6 Binary files /dev/null and b/nwnds_module/npc_zyph.utc differ diff --git a/nwnds_module/nvstalkhide.uti b/nwnds_module/nvstalkhide.uti new file mode 100644 index 000000000..8267e9307 Binary files /dev/null and b/nwnds_module/nvstalkhide.uti differ diff --git a/nwnds_module/nw_ch_aca.ncs b/nwnds_module/nw_ch_aca.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/nw_ch_aca.ncs differ diff --git a/nwnds_module/nw_ch_aca.nss b/nwnds_module/nw_ch_aca.nss new file mode 100644 index 000000000..8dbf3f240 --- /dev/null +++ b/nwnds_module/nw_ch_aca.nss @@ -0,0 +1,4 @@ +void main() +{ + +} diff --git a/nwnds_module/nw_i0_generic.nss b/nwnds_module/nw_i0_generic.nss new file mode 100644 index 000000000..881a6f9fb --- /dev/null +++ b/nwnds_module/nw_i0_generic.nss @@ -0,0 +1,2021 @@ +//:://///////////////////////////////////////////// +//:: Generic Scripting Include v1.0 +//:: NW_I0_GENERIC +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + + December 7 2002, Naomi Novik + Many functions removed to separate libraries: + + x0_i0_anims + PlayMobileAmbientAnimations_NonAvian + PlayMobileAmbientAnimations_Avian + (with PlayMobileAmbientAnimations changed to + just a call to one of these two) + PlayImmobileAmbientAnimations + + x0_i0_assoc + associate constants (NW_ASC_...) + GetPercentageHPLoss (only used in GetAssociateHealMaster) + SetAssociateState + GetAssociateState + ResetHenchmenState + AssociateCheck + GetAssociateHealMaster + GetFollowDistance + SetAssociateStartLocation + GetAssociateStartLocation + + x0_i0_behavior + behavior constants + SetBehaviorState + GetBehaviorState + + x0_i0_spawncond + OnSpawn condition constants + SetSpawnInCondition + GetSpawnInCondition + SetSpawnInLocals + SetListeningPatterns + + x0_i0_walkway + WalkWayPoints + RunNextCircuit + RunCircuit + CheckWayPoints + GetIsPostOrWalking + + x0_i0_talent + ALL the talent functions + + x0_i0_equip + Equipping functions + + x0_i0_match + Matching functions + + x0_i0_debug + MyPrintString + DebugPrintTalentId + newdebug + + x0_inc_generic + Pretty much everything else + + ***********************************************' + CHANGE SUMMARY + + + February 6 2003: Commented out the Henchman RespondToShout because now using + the newer bkRespondToShout function in x0_i0_henchman + + + September 18 2002: DetermineCombatRound broken into smaller functions + 19 : Removed randomness from Talent system. You can't + have smart AI and random behavior. Only healing + has the possiblity of being random. + + I may want to add the possibility of getting a + random talent only in the Talent filter if + something fails (*) + + + ******************************************** + WARNING THIS SCRIPT IS CHANGED AT YOUR PERIL + ******************************************** + + This is the master generic script and currently + handles all combat and some plot behavior + within NWN. If this script is tampered + with there is a chance of introducing game + breaking bugs. But other than that enjoy. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Sept 20, 2001 +//::////////////////////////////////////////////// + +//#include "x0_i0_assoc" - included in x0_inc_generic +//#include "x0_inc_generic" - included in x0_i0_talent +//#include "x0_i0_talent" - included in x0_i0_combat + +//#include "x0_i0_combat" - include in x0_i0_anims + +//#include "x0_i0_walkway" - include in x0_i0_anims +#include "x0_i0_behavior" +#include "x0_i0_anims" + + +/********************************************************************** + * CONSTANTS + **********************************************************************/ + +/********************************************************************** + * Flee and move constants + **********************************************************************/ + +const int NW_GENERIC_FLEE_EXIT_FLEE = 0; +const int NW_GENERIC_FLEE_EXIT_RETURN = 1; +const int NW_GENERIC_FLEE_TELEPORT_FLEE = 2; +const int NW_GENERIC_FLEE_TELEPORT_RETURN = 3; + +/********************************************************************** + * Shout constants + **********************************************************************/ + +// NOT USED +const int NW_GENERIC_SHOUT_I_WAS_ATTACKED = 1; + +//IN OnDeath Script +const int NW_GENERIC_SHOUT_I_AM_DEAD = 12; + +//IN TalentMeleeAttacked +const int NW_GENERIC_SHOUT_BACK_UP_NEEDED = 13; + +const int NW_GENERIC_SHOUT_BLOCKER = 2; + +/********************************************************************** + * chooseTactics constants + **********************************************************************/ + +const int chooseTactics_MEMORY_OFFENSE_MELEE = 0; +const int chooseTactics_MEMORY_DEFENSE_OTHERS = 1; +const int chooseTactics_MEMORY_DEFENSE_SELF = 2; +const int chooseTactics_MEMORY_OFFENSE_SPELL = 3; + + +/********************************************************************** + * FUNCTION PROTOTYPES + **********************************************************************/ + +// * New Functions September - 2002 + + +// * The class-specific tactics have been broken out from DetermineCombatRound +// * for readability. This function determines the actual tactics each class +// * will use. +int chooseTactics(object oIntruder); + +// Adds all three of the class levels together. Used before +// GetHitDice became available +int GetCharacterLevel(object oTarget); + +//If using ambient sleep this will remove the effect +void RemoveAmbientSleep(); + +//Searches for the nearest locked object to the master +object GetLockedObject(object oMaster); + +/********************************************************************** + * DetermineCombatRound subfunctions + **********************************************************************/ + +// Used in DetermineCombatRound to keep a +// henchmen bashing doors. +int BashDoorCheck(object oIntruder = OBJECT_INVALID); + +// Determines which of a NPCs three classes to +// use in DetermineCombatRound +int DetermineClassToUse(); + + +/********************************************************************** + * Core AI Functions + **********************************************************************/ + +//:://///////////////////////////////////////////// +//:: DetermineCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function is the master function for the + generic include and is called from the main + script. This function is used in lieu of + any actual scripting. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// +void DetermineCombatRound(object oIntruder = OBJECT_INVALID, int nAI_Difficulty = 10); + +//:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +// Allows the listener to react in a manner +// consistant with the given shout but only to one +// combat shout per round +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +//NOTE ABOUT COMMONERS +// Commoners are universal cowards. If you attack anyone +// they will flee for 4 seconds away from the attacker. +// However to make the commoners into a mob, make a single +// commoner at least 10th level of the same faction. +// If that higher level commoner is attacked or killed then +// the commoners will attack the attacker. They will disperse again +// after some of them are killed. Should NOT make multi-class +// creatures using commoners. +// +//NOTE ABOUT BLOCKERS +// It should be noted that the Generic Script for On Dialogue +// attempts to get a local set on the shouter by itself. +// This object represents the LastOpenedBy object. It is this +// object that becomes the oIntruder within this function. +// +//NOTE ABOUT INTRUDERS +// The intruder object is for cases where a placable needs to +// pass a LastOpenedBy Object or a AttackMyAttacker +// needs to make his attacker the enemy of everyone. +void RespondToShout(object oShouter, int nShoutIndex, object oIntruder = OBJECT_INVALID); + + +//******** PLOT FUNCTIONS + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +void SetNPCWarningStatus(int nStatus = TRUE); + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +int GetNPCWarningStatus(); + +// * Presently Does not work with the current implementation +// * of encounter triggers! +// +// This function works in tandem with an encounter +// to spawn in guards to fight for the attacked +// NPC. MAKE SURE THE ENCOUNTER TAG IS SET TO: +// +// "ENC_" + NPC TAG +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +void SetSummonHelpIfAttacked(); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +// This function is used only because ActionDoCommand can +// only accept void functions. +void CreateSignPostNPC(string sTag, location lLocal); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +void ActivateFleeToExit(); + +// The target object flees to the specified +// way point and then destroys itself, to be +// respawned at a later point. For unkillable +// sign post characters who are not meant to fight +// back. +int GetFleeToExit(); + +// Checks that an item was unlocked. +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 19, 2001 +void CheckIsUnlocked(object oLastObject); + +// This function is now just a wrapper around the functions +// PlayMobileAmbientAnimations_Nonavian() and +// PlayMobileAmbientAnimations_Avian(), in x0_i0_anims +void PlayMobileAmbientAnimations(); + +// Determines the special behavior used by the NPC. +// Generally all NPCs who you want to behave differently +// than the defualt behavior. +// For these behaviors, passing in a valid object will +// cause the creature to become hostile the the attacker. +void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID); + +// * Am I in a invisible or stealth state or sanctuary? +int InvisibleTrue(object oSelf = OBJECT_SELF); + +/********************************************************************** + * FUNCTION DEFINITIONS + **********************************************************************/ + +//:://///////////////////////////////////////////// +//:: AdjustBehaviorVariable +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +Overriding "behavior" variables. +If a variable has been stored on the creature it overrides the above +class defaults +*/ +//::////////////////////////////////////////////// +//:: Created By: +//:: Created On: +//::////////////////////////////////////////////// + +int AdjustBehaviorVariable(int nVar, string sVarName) +{ + int nPlace =GetLocalInt(OBJECT_SELF, sVarName); + if (nPlace > 0) + { + return nPlace; + } + //return nVar; // * return the original value + return 0; +} + +//:://///////////////////////////////////////////// +//:: InvisibleBecome +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + A more intelligent invisibility solution, + along the lines of the one used in + the various end-user AIs. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: June 14, 2003 +//::////////////////////////////////////////////// +int InvisibleBecome(object oSelf = OBJECT_SELF) +{ + int iDarkness = FALSE; + if(GetHasSpell(SPELL_DARKNESS) && GetHasSpell(SPELL_DARKVISION)) iDarkness = TRUE; + if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY) || GetHasSpell(SPELL_INVISIBILITY) || + GetHasSpell(SPELL_INVISIBILITY_SPHERE) || (iDarkness) || GetHasSpell(SPELL_SANCTUARY) + || GetHasSpell(SPELL_ETHEREALNESS) + || GetHasFeat(FEAT_HIDE_IN_PLAIN_SIGHT, oSelf) == TRUE) + { + + // * cannot already be invisible, otherwise what is the point + if(InvisibleTrue(oSelf) == FALSE) + { + // * this bit ported directly from Jasperre + // Can anyone see me? (has spell effects of X) + // * The point of this is to see if its even worthwhile to go invisbile + // * or will it be immediately dispeled. + object oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_TRUE_SEEING); + if(!GetIsObjectValid(oSeeMe)) + { + oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_SEE_INVISIBILITY); + // if(!GetIsObjectValid(oSeeMe)) + // { + // oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT, SPELL_INVISIBILITY_PURGE); + // } + } + + + if(!GetIsObjectValid(oSeeMe)) + { + int nDiff = GetCombatDifficulty(oSelf, TRUE); + //SpeakString(IntToString(nDiff)); + if (nDiff > -1) + { + + ClearActions(1001); + if (iDarkness==TRUE) + { + ActionCastSpellAtObject(SPELL_DARKVISION, oSelf); + ActionCastSpellAtObject(SPELL_DARKNESS, oSelf); + return TRUE; + } +// if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY, oSelf) == TRUE) + if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY, oSelf)) + { + ActionCastSpellAtObject(SPELL_IMPROVED_INVISIBILITY, oSelf); + return TRUE; + } + else +// if (GetHasSpell(SPELL_INVISIBILITY, oSelf) == TRUE) + if (GetHasSpell(SPELL_INVISIBILITY, oSelf)) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY, oSelf); + return TRUE; + } + else +// if (GetHasSpell(SPELL_INVISIBILITY_SPHERE, oSelf) == TRUE) + if (GetHasSpell(SPELL_INVISIBILITY_SPHERE, oSelf)) + { + ActionCastSpellAtObject(SPELL_INVISIBILITY_SPHERE, oSelf); + return TRUE; + } + else +// if (GetHasSpell(SPELL_ETHEREALNESS, oSelf) == TRUE) + if (GetHasSpell(SPELL_ETHEREALNESS, oSelf)) + { + ActionCastSpellAtObject(SPELL_ETHEREALNESS, oSelf); + return TRUE; + } + else +// if (GetHasSpell(SPELL_SANCTUARY, oSelf) == TRUE) + if (GetHasSpell(SPELL_SANCTUARY, oSelf)) + { + ActionCastSpellAtObject(SPELL_SANCTUARY, oSelf); + return TRUE; + } + else + if (GetHasFeat(FEAT_HIDE_IN_PLAIN_SIGHT, oSelf)) + // * go into stealth mode + { + // SpeakString("Attempting stealth mode"); + SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE); + WrapperActionAttack(GetNearestEnemy()); + return TRUE; + } + + } + } + }// is NOT invisible + } + return FALSE; +} + +//:://///////////////////////////////////////////// +//:: InvisibleTrue +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + Returns TRUE if oSelf is hidden either + magically or via stealth + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 14, 2003 +//::////////////////////////////////////////////// + +int InvisibleTrue(object oSelf =OBJECT_SELF) +{ + if(GetHasEffect(EFFECT_TYPE_INVISIBILITY, oSelf) || GetHasEffect(EFFECT_TYPE_IMPROVEDINVISIBILITY, oSelf) + || (GetHasSpellEffect(SPELL_DARKNESS, oSelf) && GetHasSpellEffect(SPELL_DARKVISION, oSelf)) + || GetActionMode(oSelf, ACTION_MODE_STEALTH) || GetHasEffect(EFFECT_TYPE_SANCTUARY, oSelf) + || GetHasEffect(EFFECT_TYPE_ETHEREAL, oSelf)) + { + return TRUE; + + } + return FALSE; +} + +// * Returns true if a wizard or sorcerer and wearing armor +int GetShouldNotCastSpellsBecauseofArmor(object oTarget, int nClass) +{ + + if (GetArcaneSpellFailure(oTarget) > 15 && (nClass == CLASS_TYPE_SORCERER || nClass == CLASS_TYPE_WIZARD)) + { + return TRUE; + } + return FALSE; +} + + +//:://///////////////////////////////////////////// +//:: chooseTactics +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Separated this function out from DetermineCombatRound + for readibility +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: September 2002 +//::////////////////////////////////////////////// + +int chooseTactics(object oIntruder) +{ + + // SELF PRESERVATION: Always attempt to heal self first + if(TalentHealingSelf() == TRUE) return 99; //Use spells and potions + + // Next, try the special tactics routines + // specific to XP1 + if (SpecialTactics(oIntruder)) return 99; + + // * These constants in ChooseTactics routine + // * remember previous rounds choices + + //moved to top of script, made into real constants + //int MEMORY_OFFENSE_MELEE = 0; + //int MEMORY_DEFENSE_OTHERS = 1; + //int MEMORY_DEFENSE_SELF = 2; + //int MEMORY_OFFENSE_SPELL = 3; + + // * If defensive last round, try to be offensive this round + // * this is to prevent wasting time on multiple protections + int nPreviousMemory = GetLocalInt(OBJECT_SELF, "NW_L_MEMORY"); + + int nClass = DetermineClassToUse(); + + //This does not seem to be used, so no point declaring it... + //int nCrazy = 0; + + // * Defaulted high so unspecified classes will not be cowards + int nOffense = 50; + + int nCompassion = 25; + + // * Defaulted this high because non standard creatures + // * with spells should try and use them. + int nMagic = 55; + + // * setup base BEHAVIOR + switch (nClass) + { + case CLASS_TYPE_COMMONER: + // Commoners should run away from fights + //SpawnScriptDebugger(); + nOffense = 0; nCompassion = 0; nMagic = 0; break; + case CLASS_TYPE_PALEMASTER: + case CLASS_TYPE_WIZARD: + case CLASS_TYPE_SORCERER: + // SpawnScriptDebugger(); + nOffense = 40; nCompassion = 40; nMagic = 100; break; + case CLASS_TYPE_BARD: + case CLASS_TYPE_HARPER: + case CLASS_TYPE_DRAGONDISCIPLE: + { + if(TalentBardSong() == TRUE) return 99; + nOffense = 40; nCompassion = 42; nMagic = 43; break; + } + case CLASS_TYPE_CLERIC: + case CLASS_TYPE_DRUID: + case CLASS_TYPE_SHIFTER: + { + nOffense = 40; + nCompassion = 45; + nMagic = 44; + // * Clerics shouldn't constantly cast spells + if (nPreviousMemory != chooseTactics_MEMORY_OFFENSE_MELEE) + nMagic = Random(50) + 1; + break; + } + case CLASS_TYPE_PALADIN : + case CLASS_TYPE_RANGER : + nOffense = 40; nCompassion = 25; nMagic = Random(50) + 1; break; + case CLASS_TYPE_BARBARIAN: + { + // SpawnScriptDebugger(); + // * GetHasFeat(...) does not work correctly with no-leveled up + // * characters. So for now, only Xanos gets to do this. + string sTag = GetTag(OBJECT_SELF); + if (sTag == "x0_hen_xan" || sTag == "x2_hen_daelan") + { + if (GetHasFeatEffect(FEAT_BARBARIAN_RAGE) == FALSE) + { + + if (GetHasFeat(FEAT_BARBARIAN_RAGE) == TRUE) + { + ActionUseFeat(FEAT_BARBARIAN_RAGE, OBJECT_SELF); + return 99; + } + } + } + nOffense = 50; nCompassion = 25; nMagic = 20; break; + // * set high magic to use rage + // * suggestion don't give barbarians lots of magic or else they will fight oddly + } + case CLASS_TYPE_WEAPON_MASTER: + case CLASS_TYPE_ARCANE_ARCHER: + case CLASS_TYPE_BLACKGUARD: + case CLASS_TYPE_SHADOWDANCER: + case CLASS_TYPE_DWARVENDEFENDER: + case CLASS_TYPE_ASSASSIN: + case CLASS_TYPE_FIGHTER: + case CLASS_TYPE_ROGUE : //SpawnScriptDebugger(); + case CLASS_TYPE_MONK : + nOffense = 40; nCompassion = 0; nMagic = 0; break; + case CLASS_TYPE_UNDEAD: + nOffense = 40; nCompassion = 40; nMagic = 40; break; + case CLASS_TYPE_OUTSIDER: + { + nOffense = 40; nMagic = 40; + if (GetAlignmentGoodEvil(OBJECT_SELF) == ALIGNMENT_GOOD) + { + nCompassion = 40; + } + else nCompassion = 0; + break; + } + case CLASS_TYPE_CONSTRUCT: + case CLASS_TYPE_ELEMENTAL: + nOffense = 40; nCompassion = 0; nMagic = 40; break; + case CLASS_TYPE_DRAGON: + nOffense = 40; nCompassion = 20; nMagic = 40; break; + default: + nOffense = 50; nCompassion = 25; nMagic = 55; break; + } + + //really minor optimization - since this bit doesn't rely on the variables set + //below, might as well check it before we do all those calculations + // * Dragon Disciple Breath + if (GetHasFeat(FEAT_DRAGON_DIS_BREATH) && Random(100) > 50) + { + ClearActions(2000); + ActionCastSpellAtObject(690, GetNearestEnemy(), METAMAGIC_ANY, TRUE); + DecrementRemainingFeatUses(OBJECT_SELF, FEAT_DRAGON_DIS_BREATH); + return 99; + } + + + // MyPrintString("Made it past the class-specific settings"); + + + // ************************************ + // * MODIFY BEHAVIOR FOR SPECIAL CASES + // ************************************ + if (GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD) + nCompassion = nCompassion - 20; + + // Randomize things a bit + //seems that nCrazy is always 0, so might as well comment them out + nOffense = Random(10 /*+ nCrazy*/) + nOffense; + nMagic = Random(10 /*+ nCrazy*/) + nMagic; + nCompassion = Random(10 /*+ nCrazy*/) + nCompassion; + + + + // * if your opponent is close to you, then increase offense + // * as casting defensive abilities when enemies are close + // * is generally not a good idea. + // * Dec 18 2002: If you have Combat Casting, you'll still be more + // * liable to use defensive abilities + if (GetIsObjectValid(oIntruder) && !GetHasFeat(FEAT_COMBAT_CASTING)) + { + if (GetDistanceToObject(oIntruder) <= 5.0) { + nOffense = nOffense + 20; + nMagic = nMagic - 20; + } + } + + // * If enemies are further away, more chance of doing magic + if (GetDistanceToObject(oIntruder) > 3.0) + nMagic = nMagic + 15; + + // * Dec 18 2002: Add your level to your magic rating + nMagic = nMagic + GetHitDice(OBJECT_SELF); + + + // ************************************** + // * CHOOSE TALENT TO USE + // ************************************** + + //SpawnScriptDebugger(); + + // * If defensive last round, try to be offensive this round + // * this is to prevent wasting time on multiple protections + if ((nPreviousMemory == chooseTactics_MEMORY_DEFENSE_OTHERS) + || (nPreviousMemory == chooseTactics_MEMORY_DEFENSE_SELF)) + { + nOffense = nOffense + 40; + } + + + // April 2003 + // If in rage should be almost no chance of doing magic + // * June 2003 + // * If has more than 5% chance of spell failure don't try casting + // 5% chance changed to 15% + if (GetHasFeatEffect(FEAT_BARBARIAN_RAGE)== TRUE || GetShouldNotCastSpellsBecauseofArmor(OBJECT_SELF, nClass) == TRUE + || GetLocalInt(OBJECT_SELF, "X2_L_STOPCASTING") == 10) + { + nMagic = 0; + } + + + + + // ************** + // * JULY 12 2003 + // * Overriding "behavior" variables. + // * If a variable has been stored on the creature it overrides the above + // * class defaults + // * JULY 28 2003 + // * changed this so that its an additive process, not an overrwrite. + // * gives more flexiblity. + // ************** + nMagic = nMagic + AdjustBehaviorVariable(nMagic, "X2_L_BEH_MAGIC"); + nOffense = nOffense + AdjustBehaviorVariable(nOffense, "X2_L_BEH_OFFENSE"); + nCompassion = nCompassion + AdjustBehaviorVariable(nCompassion, "X2_L_BEH_COMPASSION"); + + + // * If invisbile of any sort, become Defensive and + // * magical to use any buffs you may have + // * This behavior variable setting should override all others + // * October 22 2003 - Lines 690 and 713 modified to only work if magic + // * setting has not been turned off. Nathyrra always going invisible + // * can be annoying. + if (InvisibleTrue(OBJECT_SELF) == TRUE && nMagic > 0) + { + // SpawnScriptDebugger(); + // * if wounded at all take this time to heal self + // * since I am invisible there is little danger from doing this + if (GetCurrentHitPoints(OBJECT_SELF) < GetMaxHitPoints(OBJECT_SELF)) + { + if(TalentHealingSelf(TRUE) == TRUE) return 99; + } + + nOffense = 7; + nMagic = 100; + + if (GetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH) == TRUE) + { + nOffense = 100; // * if in stealth attempt sneak attacks + } + } + else + // ************** + // * JULY 14 2003 + // * Attempt To Go Invisible + // ************** + if (InvisibleBecome() == TRUE && nMagic > 0) + return 99; + + // PHYSICAL, NO OFFENSE + if (nOffense <= 5) + { + //SpawnScriptDebugger(); + //SpeakString("fleeing"); + if (TalentFlee(oIntruder) == TRUE) return 99; + } + + // protect others: MAGICAL, DEFENSE, COMPASSION + if ((nOffense<= 50) && (nMagic > 50) && (nCompassion > 50)) + { + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", chooseTactics_MEMORY_DEFENSE_OTHERS); + if (TalentHeal() == TRUE) return 99; + if (TalentCureCondition() == TRUE) return 99; + if (TalentUseProtectionOthers() == TRUE) return 99; + if (TalentEnhanceOthers() == TRUE) return 99; + + // * Temporarily be non-compassionate to buff self + // * if we got to this point. + nCompassion = 0; + } + + // protectself: MAGICAL, DEFENSE, NO COMPASSION + if ((nOffense<= 50) && (nMagic > 50) && (nCompassion <=50)) + { + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", chooseTactics_MEMORY_DEFENSE_SELF); + + /* Dec 19 2002: + Against spell-casters, cast protection spells more often + */ + int nClass = GetClassByPosition(1,oIntruder); + if (nClass == CLASS_TYPE_WIZARD || nClass == CLASS_TYPE_SORCERER + || nClass == CLASS_TYPE_CLERIC || nClass == CLASS_TYPE_DRUID) + { + if (TalentSelfProtectionMantleOrGlobe()) + return 99; + } + + if(TalentUseProtectionOnSelf() == TRUE) return 99; + if(TalentUseEnhancementOnSelf() == TRUE) return 99; + if(TalentPersistentAbilities() == TRUE) return 99; + // int TalentAdvancedBuff(float fDistance); + + //Used for Potions of Enhancement and Protection + if(TalentBuffSelf() == TRUE) return 99; + + if(TalentAdvancedProtectSelf() == TRUE) return 99; + if(TalentSummonAllies() == TRUE) return 99; + if(TalentSeeInvisible() == TRUE) return 99; + if(TalentMeleeAttacked(oIntruder) == TRUE) return 99; + if(TalentRangedAttackers(oIntruder) == TRUE) return 99; + if(TalentRangedEnemies(oIntruder) == TRUE) return 99; + + + } + + // MAGICAL, OFFENSE + if (nMagic > 50) + { + // // MyPrintString("in offensive spell"); + // SpawnScriptDebugger(); + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", chooseTactics_MEMORY_OFFENSE_SPELL); + if (TalentUseTurning() == TRUE) return 99; + if (TalentSpellAttack(oIntruder) == TRUE) return 99; + } + + // If we got here, we're going to melee offense + SetLocalInt(OBJECT_SELF, "NW_L_MEMORY", chooseTactics_MEMORY_OFFENSE_MELEE); + + // PHYSICAL, OFFENSE (if nothing else applies) + if (TryKiDamage(oIntruder) == TRUE) return 99; + if (TalentSneakAttack() == TRUE) return 99; + if (TalentDragonCombat(oIntruder)) {return 99;} + if (TalentMeleeAttack(oIntruder) == TRUE) return 99; + + + object oHostile = GetNearestSeenEnemy(); + + // * Feb 17 2003: This error could happen in the situation that someone + // * went into combat mode and their 'hostility' ended while going through ChooseTactics + if (GetIsObjectValid(oHostile) == TRUE) + { + + // * BK if it returns this it means the AI found nothing + // * Appropriate to do + //SpeakString("BUG!!!!!!!!!!!!!!!!!!!!!!!! (Let Brent Knowles know about this. Supply savegame) Nothing valid to do !!!!!!!!!!!!!!!!!!!!!"); + //SpeakString("BUG!! Magic " + IntToString(nMagic) + " Compassion " + IntToString(nCompassion) + " Offense " + IntToString(nOffense)); + } + return 1; + +} // * END of choosetactics + +//:://///////////////////////////////////////////// +//:: __InCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Tests to see if already running a determine + combatround this round. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 11 2003 +//::////////////////////////////////////////////// +int __InCombatRound() +{ + + // * if just in attackaction, turn combat round off + // * if simply fighting it is okay to turn the combat round off + // * and try again because it doesn't hurt an attackaction + // * to be reiniated whereas it does break a spell + int nCurrentAction = GetCurrentAction(OBJECT_SELF); + if (nCurrentAction == ACTION_ATTACKOBJECT || nCurrentAction == ACTION_INVALID || nCurrentAction == ACTION_MOVETOPOINT) + { + return FALSE; + } + if (GetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND") == TRUE) + { + //SpeakString("DEBUG:: In Combat Round, busy."); + return TRUE; + } + return FALSE; +} +//:://///////////////////////////////////////////// +//:: __TurnCombatRoundOn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Will set the exclusion variable on whether + in combat or not. + This is to prevent multiple firings + of determinecombatround in one round +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: July 11 2003 +//::////////////////////////////////////////////// + +void __TurnCombatRoundOn(int bBool) +{ + if (bBool == TRUE) + { + SetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND", TRUE); + } + else + { + // * delay it turning off like an action + ActionDoCommand(SetLocalInt(OBJECT_SELF, "X2_L_MUTEXCOMBATROUND", FALSE)); + } +} +//:://///////////////////////////////////////////// +//:: DetermineCombatRound +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function is the master function for the + generic include and is called from the main + script. This function is used in lieu of + any actual scripting. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +void DetermineCombatRound(object oIntruder = OBJECT_INVALID, int nAI_Difficulty = 10) +{ + // MyPrintString("************** DETERMINE COMBAT ROUND START *************"); + // MyPrintString("************** " + GetTag(OBJECT_SELF) + " ************"); + + // ---------------------------------------------------------------------------------------- + // May 2003 + // Abort out of here, if petrified + // ---------------------------------------------------------------------------------------- + if (GetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE) + { + return; + } + + // ---------------------------------------------------------------------------------------- + // Oct 06/2003 - Georg Zoeller, + // Fix for ActionRandomWalk blocking the action queue under certain circumstances + // ---------------------------------------------------------------------------------------- + if (GetCurrentAction() == ACTION_RANDOMWALK) + { + ClearAllActions(); + } + + // ---------------------------------------------------------------------------------------- + // July 27/2003 - Georg Zoeller, + // Added to allow a replacement for determine combat round + // If a creature has a local string variable named X2_SPECIAL_COMBAT_AI_SCRIPT + // set, the script name specified in the variable gets run instead + // see x2_ai_behold for details: + // ---------------------------------------------------------------------------------------- + string sSpecialAI = GetLocalString(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT"); + if (sSpecialAI != "") + { + SetLocalObject(OBJECT_SELF,"X2_NW_I0_GENERIC_INTRUDER", oIntruder); + ExecuteScript(sSpecialAI, OBJECT_SELF); + if (GetLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK")) + { + DeleteLocalInt(OBJECT_SELF,"X2_SPECIAL_COMBAT_AI_SCRIPT_OK"); + return; + } + } + + + // ---------------------------------------------------------------------------------------- + // DetermineCombatRound: EVALUATIONS + // ---------------------------------------------------------------------------------------- + if(GetAssociateState(NW_ASC_IS_BUSY)) + { + return; + } + + if(BashDoorCheck(oIntruder)) {return;} + + // ---------------------------------------------------------------------------------------- + // BK: stop fighting if something bizarre that shouldn't happen, happens + // ---------------------------------------------------------------------------------------- + + if (bkEvaluationSanityCheck(oIntruder, GetFollowDistance()) == TRUE) + return; + + // ** Store HOw Difficult the combat is for this round + int nDiff = GetCombatDifficulty(); + SetLocalInt(OBJECT_SELF, "NW_L_COMBATDIFF", nDiff); + + // MyPrintString("COMBAT: " + IntToString(nDiff)); + + // ---------------------------------------------------------------------------------------- + // If no special target has been passed into the function + // then choose an appropriate target + // ---------------------------------------------------------------------------------------- + if (GetIsObjectValid(oIntruder) == FALSE) + oIntruder = bkAcquireTarget(); + + + if (GetIsDead(oIntruder) == TRUE) + { + // ---------------------------------------------------------------------------------------- + // If for some reason my target is dead, then leave + // the poor guy alone. Jeez. What kind of monster am I? + // ---------------------------------------------------------------------------------------- + return; + } + + // ---------------------------------------------------------------------------------------- + /* + JULY 11 2003 + If in combat round already (variable set) do not enter it again. + This is meant to prevent multiple calls to DetermineCombatRound + from happening during the *same* round. + + This variable is turned on at the start of this function call. + It is turned off at each "return" point for this function + */ + // ---------------------------------------------------------------------------------------- + if (__InCombatRound() == TRUE) + { + return; + } + + __TurnCombatRoundOn(TRUE); + + // ---------------------------------------------------------------------------------------- + // DetermineCombatRound: ACTIONS + // ---------------------------------------------------------------------------------------- + if(GetIsObjectValid(oIntruder)) + { + + if(TalentPersistentAbilities()) // * Will put up things like Auras quickly + { + __TurnCombatRoundOn(FALSE); + return; + } + + // ---------------------------------------------------------------------------------------- + // BK September 2002 + // If a succesful tactic has been chosen then + // exit this function directly + // ---------------------------------------------------------------------------------------- + + if (chooseTactics(oIntruder) == 99) + { + __TurnCombatRoundOn(FALSE); + return; + } + + // ---------------------------------------------------------------------------------------- + // This check is to make sure that people do not drop out of + // combat before they are supposed to. + // ---------------------------------------------------------------------------------------- + + object oNearEnemy = GetNearestSeenEnemy(); + DetermineCombatRound(oNearEnemy); + + return; + } + __TurnCombatRoundOn(FALSE); + + // ---------------------------------------------------------------------------------------- + // This is a call to the function which determines which + // way point to go back to. + // ---------------------------------------------------------------------------------------- + ClearActions(CLEAR_NW_I0_GENERIC_658); + SetLocalObject(OBJECT_SELF, + "NW_GENERIC_LAST_ATTACK_TARGET", + OBJECT_INVALID); + WalkWayPoints(); +} + + + +//:://///////////////////////////////////////////// +//:: Respond To Shouts +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Allows the listener to react in a manner + consistant with the given shout but only to one + combat shout per round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// + +//NOTE ABOUT COMMONERS +/* + Commoners are universal cowards. If you attack anyone they will flee for 4 seconds away from the attacker. + However to make the commoners into a mob, make a single commoner at least 10th level of the same faction. + If that higher level commoner is attacked or killed then the commoners will attack the attacker. They will disperse again + after some of them are killed. Should NOT make multi-class creatures using commoners. +*/ +//NOTE ABOUT BLOCKERS +/* + It should be noted that the Generic Script for On Dialogue attempts to get a local set on the shouter by itself. + This object represents the LastOpenedBy object. It is this object that becomes the oIntruder within this function. +*/ + +//NOTE ABOUT INTRUDERS +/* + The intruder object is for cases where a placable needs to pass a LastOpenedBy Object or a AttackMyAttacker + needs to make his attacker the enemy of everyone. +*/ + +void RespondToShout(object oShouter, int nShoutIndex, object oIntruder = OBJECT_INVALID) +{ + + // Pausanias: Do not respond to shouts if you've surrendered. + int iSurrendered = GetLocalInt(OBJECT_SELF,"Generic_Surrender"); + if (iSurrendered) return; + + switch (nShoutIndex) + { + case 1://NW_GENERIC_SHOUT_I_WAS_ATTACKED: + { + object oTarget = oIntruder; + if(!GetIsObjectValid(oTarget)) + { + oTarget = GetLastHostileActor(oShouter); + } + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oTarget)) + { + if(!GetIsFriend(oTarget) && GetIsFriend(oShouter)) + { + RemoveAmbientSleep(); + //DetermineCombatRound(oTarget); + DetermineCombatRound(GetLastHostileActor(oShouter)); + } + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + else + { + DetermineCombatRound(oIntruder); + } + } + else + { + DetermineSpecialBehavior(); + } + } + break; + + case 2://NW_GENERIC_SHOUT_MOB_ATTACK: + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + + //Is friendly check to make sure that only like minded commoners attack. + if(GetIsFriend(oShouter)) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + //if(TalentMeleeAttack()) {return;} + } + else + { + DetermineSpecialBehavior(); + } + } + break; + + case 3://NW_GENERIC_SHOUT_I_AM_DEAD: + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + //Use I was attacked script above + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(GetLastHostileActor(oShouter))) + { + if(!GetIsFriend(GetLastHostileActor(oShouter)) && GetIsFriend(oShouter)) + { + DetermineCombatRound(GetLastHostileActor(oShouter)); + } + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(GetLastHostileActor(oShouter)); + } + else + { + DetermineCombatRound(); + } + + } + else + { + DetermineSpecialBehavior(); + } + } + break; + //For this shout to work the object must shout the following + //string sHelp = "NW_BLOCKER_BLK_" + GetTag(OBJECT_SELF); + case 4: //BLOCKER OBJECT HAS BEEN DISTURBED + { + if(!GetLevelByClass(CLASS_TYPE_COMMONER)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(GetIsObjectValid(oIntruder)) + { + SetIsTemporaryEnemy(oIntruder); + DetermineCombatRound(oIntruder); + } + } + } + else if (GetLevelByClass(CLASS_TYPE_COMMONER, oShouter) >= 10) + { + WrapperActionAttack(oIntruder); + } + else + { + DetermineCombatRound(); + } + } + break; + + case 5: //ATTACK MY TARGET + { + AdjustReputation(oIntruder, OBJECT_SELF, -100); + if(GetIsFriend(oShouter)) + { + SetIsTemporaryEnemy(oIntruder); + ClearActions(CLEAR_NW_I0_GENERIC_834); + DetermineCombatRound(oIntruder); + } + } + break; + + case 6: //CALL_TO_ARMS + { + //This was once commented out. + DetermineCombatRound(); + } + break; + + //ASSOCIATE SHOUT RESPONSES ****************************************************************************** + + /* This was moved into X0_I0_HENCHMAN as bkRespondToHenchmenShout + case ASSOCIATE_COMMAND_ATTACKNEAREST: //Used to de-activate AGGRESSIVE DEFEND MODE + { + ResetHenchmenState(); + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + DetermineCombatRound(); + } + break; + + case ASSOCIATE_COMMAND_FOLLOWMASTER: //Only used to retreat, or break free from Stand Ground Mode + { + ResetHenchmenState(); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + DelayCommand(2.5, VoiceCanDo()); + + if(GetAssociateState(NW_ASC_AGGRESSIVE_STEALTH)) + { + //ActionUseSkill(SKILL_HIDE, OBJECT_SELF); + } + if(GetAssociateState(NW_ASC_AGGRESSIVE_SEARCH)) + { + ActionUseSkill(SKILL_SEARCH, OBJECT_SELF); + } + ActionForceFollowObject(GetMaster(), GetFollowDistance()); + SetAssociateState(NW_ASC_IS_BUSY); + DelayCommand(5.0, SetAssociateState(NW_ASC_IS_BUSY, FALSE)); + } + break; + + case ASSOCIATE_COMMAND_GUARDMASTER: //Used to activate AGGRESSIVE DEFEND MODE + { + ResetHenchmenState(); + DelayCommand(2.5, VoiceCanDo()); + //Companions will only attack the Masters Last Attacker + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER); + SetAssociateState(NW_ASC_MODE_STAND_GROUND, FALSE); + if(GetIsObjectValid(GetLastHostileActor(GetMaster()))) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + } + break; + + case ASSOCIATE_COMMAND_HEALMASTER: //Ignore current healing settings and heal me now + { + ResetHenchmenState(); + //SetCommandable(TRUE); + if(TalentCureCondition()) {DelayCommand(2.0, VoiceCanDo()); return;} + if(TalentHeal(TRUE)) {DelayCommand(2.0, VoiceCanDo()); return;} + DelayCommand(2.5, VoiceCannotDo()); + } + break; + + case ASSOCIATE_COMMAND_MASTERFAILEDLOCKPICK: //Check local for Re-try locked doors and + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(GetAssociateState(NW_ASC_RETRY_OPEN_LOCKS)) + { + int bValid = TRUE; + object oLastObject = GetLockedObject(GetMaster()); + int nSkill = GetSkillRank(SKILL_OPEN_LOCK) - GetAbilityModifier(ABILITY_DEXTERITY); + + if(GetIsObjectValid(oLastObject) && GetPlotFlag(oLastObject) == FALSE) + { + if(GetIsDoorActionPossible(oLastObject, DOOR_ACTION_KNOCK) || GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_KNOCK)) + { + ClarAllActions(); + VoiceCanDo(); + ActionCastSpellAtObject(SPELL_KNOCK, oLastObject); + ActionWait(1.0); + bValid = FALSE; + } + else if (GetIsDoorActionPossible(oLastObject, DOOR_ACTION_UNLOCK)|| GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_UNLOCK)) + { + ClarAllActions(); + VoicePicklock(); + ActionWait(1.0); + ActionUseSkill(SKILL_OPEN_LOCK,oLastObject); + bValid = FALSE; + } + else if(nSkill < 5 && GetAbilityScore(OBJECT_SELF, ABILITY_STRENGTH) >= 16 && GetSkillRank(SKILL_OPEN_LOCK) <= 0) + { + if(GetIsDoorActionPossible(oLastObject, DOOR_ACTION_BASH) || GetIsPlaceableObjectActionPossible(oLastObject, PLACEABLE_ACTION_BASH)) + { + ClarAllActions(); + VoiceCanDo(); + ActionEquipMostDamagingMelee(oLastObject); + WrapperActionAttack(oLastObject); + SetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH", oLastObject); + bValid = FALSE; + } + } + if(bValid == TRUE) + { + //ClarAllActions(); + VoiceCannotDo(); + } + else + { + ActionDoCommand(VoiceTaskComplete()); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERUNDERATTACK: //Check whether the master has you in AGGRESSIVE DEFEND MODE + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + //Check the henchmens current target + object oTarget = GetAttemptedAttackTarget(); + if(!GetIsObjectValid(oTarget)) + { + oTarget = GetAttemptedSpellTarget(); + if(!GetIsObjectValid(oTarget)) + { + if(GetAssociateState(NW_ASC_MODE_DEFEND_MASTER)) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + else + { + DetermineCombatRound(); + } + } + } + //Switch targets only if the target is not attacking the master and is greater than 6.0 from + //the master. + if(GetAttackTarget(oTarget) != GetMaster() && GetDistanceBetween(oTarget, GetMaster()) > 6.0) + { + if(GetAssociateState(NW_ASC_MODE_DEFEND_MASTER) && GetIsObjectValid(GetLastHostileActor(GetMaster()))) + { + DetermineCombatRound(GetLastHostileActor(GetMaster())); + } + } + } + } + break; + + case ASSOCIATE_COMMAND_STANDGROUND: //No longer follow the master or guard him + { + SetAssociateState(NW_ASC_MODE_STAND_GROUND); + SetAssociateState(NW_ASC_MODE_DEFEND_MASTER, FALSE); + DelayCommand(2.0, VoiceCanDo()); + WrapperActionAttack(OBJECT_INVALID); + ClarAllActions(); + } + break; + + case ASSOCIATE_COMMAND_MASTERSAWTRAP: + { + int nCheck = 0; + if(!GetIsInCombat()) + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + object oTrap = GetLastTrapDetected(); + if(GetIsObjectValid(oTrap)) + { + int nTrapDC = GetTrapDisarmDC(oTrap); + int nSkill = GetSkillRank(SKILL_DISABLE_TRAP); + int nMod = GetAbilityModifier(ABILITY_DEXTERITY); + if((nSkill - nMod) > 0) + { + nSkill = nSkill + 20 - nTrapDC; + } + else + { + nSkill = 0; + nCheck = 1; + } + + if(GetCurrentAction(OBJECT_SELF) != ACTION_DISABLETRAP && nSkill > 0) + { + VoiceStop(); + if(GetHasSkill(SKILL_DISABLE_TRAP, OBJECT_SELF)) + { + ClarAllActions(); + ActionUseSkill(SKILL_DISABLE_TRAP, oTrap); + ActionDoCommand(SetCommandable(TRUE)); + ActionDoCommand(VoiceTaskComplete()); + SetCommandable(FALSE); + nCheck = 2; + } + } + else if(nCheck = 0 && + GetSkillRank(SKILL_DISABLE_TRAP) > 0 && + GetCurrentAction(OBJECT_SELF) != ACTION_DISABLETRAP) + { + VoiceCannotDo(); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERATTACKEDOTHER: + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(!GetAssociateState(NW_ASC_MODE_DEFEND_MASTER)) + { + if(!GetIsFighting(OBJECT_SELF)) + { + object oAttack = GetAttackTarget(GetMaster()); + if(GetIsObjectValid(oAttack) && GetObjectSeen(oAttack)) + { + ClarAllActions(); + DetermineCombatRound(oAttack); + } + } + } + } + } + break; + + case ASSOCIATE_COMMAND_MASTERGOINGTOBEATTACKED: + { + if(!GetAssociateState(NW_ASC_MODE_STAND_GROUND)) + { + if(!GetIsFighting(OBJECT_SELF)) + { + object oAttacker = GetGoingToBeAttackedBy(GetMaster()); + if(GetIsObjectValid(oAttacker) && GetObjectSeen(oAttacker)) + { + ClarAllActions(); + DetermineCombatRound(oAttacker); + } + } + } + } + break; + + case ASSOCIATE_COMMAND_LEAVEPARTY: + { + object oMaster = GetMaster(); + if(GetIsObjectValid(oMaster)) + { + ClarAllActions(); + if(GetAssociate(ASSOCIATE_TYPE_HENCHMAN, GetMaster()) == OBJECT_SELF) + { + AddJournalQuestEntry("Henchman",50,GetMaster(),FALSE,FALSE,TRUE); + } + SetLocalObject(OBJECT_SELF,"NW_L_FORMERMASTER", oMaster); + RemoveHenchman(oMaster, OBJECT_SELF); + } + + } + break; */ + } +} + +//:://///////////////////////////////////////////// +//:: Set and Get NPC Warning Status +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function sets a local int on OBJECT_SELF + which will be checked in the On Attack, On + Damaged and On Disturbed scripts to check if + the offending party was a PC and was friendly. + The Get will return the status of the local. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +void SetNPCWarningStatus(int nStatus = TRUE) +{ + SetLocalInt(OBJECT_SELF, "NW_GENERIC_WARNING_STATUS", nStatus); +} + +// NPCs who have warning status set to TRUE will allow +// one 'free' attack by PCs from a non-hostile faction. +int GetNPCWarningStatus() +{ + return GetLocalInt(OBJECT_SELF, "NW_GENERIC_WARNING_STATUS"); +} + +//:://///////////////////////////////////////////// +//:: Set SummonHelpIfAttacked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This function works in tandem with an encounter + to spawn in guards to fight for the attacked + NPC. MAKE SURE THE ENCOUNTER TAG IS SET TO: + + "ENC_" + NPC TAG +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +//Presently Does not work with the current implementation of encounter trigger +void SetSummonHelpIfAttacked() +{ + string sEncounter = "ENC_" + GetTag(OBJECT_SELF); + object oTrigger = GetObjectByTag(sEncounter); + + if(GetIsObjectValid(oTrigger)) + { + SetEncounterActive(TRUE, oTrigger); + } +} + +//************************************************************************************************************************************ +//************************************************************************************************************************************ +// +// ESCAPE FUNCTIONS +// +//************************************************************************************************************************************ +//************************************************************************************************************************************ + +//:://///////////////////////////////////////////// +//:: Set, Get Activate,Flee to Exit +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + The target object flees to the specified + way point and then destroys itself, to be + respawned at a later point. For unkillable + sign post characters who are not meant to fight + back. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 29, 2001 +//::////////////////////////////////////////////// + +//This function is used only because ActionDoCommand can only accept void functions +void CreateSignPostNPC(string sTag, location lLocal) +{ + CreateObject(OBJECT_TYPE_CREATURE, sTag, lLocal); +} + +void ActivateFleeToExit() +{ + //minor optimizations - only grab these variables when actually needed + //can make for larger code, but it's faster + //object oExitWay = GetWaypointByTag("EXIT_" + GetTag(OBJECT_SELF)); + //location lLocal = GetLocalLocation(OBJECT_SELF, "NW_GENERIC_START_POINT"); + //string sTag = GetTag(OBJECT_SELF); + + //I suppose having this as a variable made it easier to change at one point.... + //but it never changes, and is only used twice, so we don't need it + //float fDelay = 6.0; + + int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER"); + + if(nPlot & NW_FLAG_TELEPORT_RETURN || nPlot & NW_FLAG_TELEPORT_LEAVE) + { + effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + if(nPlot & NW_FLAG_TELEPORT_RETURN) + { + location lLocal = GetLocalLocation(OBJECT_SELF, "NW_GENERIC_START_POINT"); + string sTag = GetTag(OBJECT_SELF); + DelayCommand(6.0, ActionDoCommand(CreateSignPostNPC(sTag, lLocal))); + } + ActionDoCommand(DestroyObject(OBJECT_SELF, 0.75)); + } + else + { + if(nPlot & NW_FLAG_ESCAPE_LEAVE) + { + object oExitWay = GetWaypointByTag("EXIT_" + GetTag(OBJECT_SELF)); + ActionMoveToObject(oExitWay, TRUE); + ActionDoCommand(DestroyObject(OBJECT_SELF, 1.0)); + } + else if(nPlot & NW_FLAG_ESCAPE_RETURN) + { + string sTag = GetTag(OBJECT_SELF); + object oExitWay = GetWaypointByTag("EXIT_" + sTag); + ActionMoveToObject(oExitWay, TRUE); + location lLocal = GetLocalLocation(OBJECT_SELF, "NW_GENERIC_START_POINT"); + DelayCommand(6.0, ActionDoCommand(CreateSignPostNPC(sTag, lLocal))); + ActionDoCommand(DestroyObject(OBJECT_SELF, 1.0)); + } + } +} + +int GetFleeToExit() +{ + int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER"); + if(nPlot & NW_FLAG_ESCAPE_RETURN) + { + return TRUE; + } + else if(nPlot & NW_FLAG_ESCAPE_LEAVE) + { + return TRUE; + } + else if(nPlot & NW_FLAG_TELEPORT_RETURN) + { + return TRUE; + } + else if(nPlot & NW_FLAG_TELEPORT_LEAVE) + { + return TRUE; + } + return FALSE; +} + + + +//********************************** +//********************************** +//********************************** +// PRIVATE FUNCTIONS +//********************************** +//********************************** +//********************************** + +//This is experimental and has not been looked at closely. +void ExitAOESpellArea(object oAOEObject) +{ + ClearActions(CLEAR_NW_I0_GENERIC_ExitAOESpellArea); + ActionMoveAwayFromObject(oAOEObject, TRUE, 5.0); + AssignCommand(OBJECT_SELF, DetermineCombatRound()); +} + + +//:://///////////////////////////////////////////// +//:: Get Character Levels +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Returns the combined class levels of the + target. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 22, 2001 +//::////////////////////////////////////////////// + +int GetCharacterLevel(object oTarget) +{ + return GetHitDice(oTarget); +} + + + + +//:://///////////////////////////////////////////// +//:: Remove Ambient Sleep +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Checks if the NPC has sleep on them because + of ambient animations. Sleeping creatures + must make a DC 15 listen check. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Feb 27, 2002 +//::////////////////////////////////////////////// + +void RemoveAmbientSleep() +{ + if(GetHasEffect(EFFECT_TYPE_SLEEP)) + { + effect eSleep = GetFirstEffect(OBJECT_SELF); + while(GetIsEffectValid(eSleep)) + { + if(GetEffectCreator(eSleep) == OBJECT_SELF) + { + int nRoll = d20(); + nRoll += GetSkillRank(SKILL_LISTEN); + nRoll += GetAbilityModifier(ABILITY_WISDOM); + if(nRoll > 15) + { + RemoveEffect(OBJECT_SELF, eSleep); + } + } + eSleep = GetNextEffect(OBJECT_SELF); + } + } +} + + +//:://///////////////////////////////////////////// +//:: Get Locked Object +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Finds the closest locked object to the object + passed in up to a maximum of 10 objects. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: March 15, 2002 +//::////////////////////////////////////////////// + +object GetLockedObject(object oMaster) +{ + int nCnt = 1; + int bValid = TRUE; + object oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetLocation(oMaster), nCnt); + while (GetIsObjectValid(oLastObject) && bValid == TRUE) + { + //COMMENT THIS BACK IN WHEN DOOR ACTION WORKS ON PLACABLE. + + //object oItem = GetFirstItemInInventory(oLastObject); + if(GetLocked(oLastObject)) + { + return oLastObject; + } + nCnt++; + if(nCnt == 10) + { + bValid = FALSE; + } + oLastObject = GetNearestObjectToLocation(OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, GetLocation(oMaster), nCnt); + } + return OBJECT_INVALID; +} + + + + + +//:://///////////////////////////////////////////// +//:: Check if an item is locked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Checks that an item was unlocked. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 19, 2001 +//::////////////////////////////////////////////// + +void CheckIsUnlocked(object oLastObject) +{ + if(GetLocked(oLastObject)) + { + ActionDoCommand(VoiceCuss()); + } + else + { + ActionDoCommand(VoiceCanDo()); + } +} + + +//:://///////////////////////////////////////////// +//:: Play Mobile Ambient Animations +//:: This function is now just a wrapper around +//:: code from x0_i0_anims. +//::////////////////////////////////////////////// +void PlayMobileAmbientAnimations() +{ + if(!GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) { + // not a bird + PlayMobileAmbientAnimations_NonAvian(); + } else { + // a bird + PlayMobileAmbientAnimations_Avian(); + } +} + +//:://///////////////////////////////////////////// +//:: Determine Special Behavior +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the special behavior used by the NPC. + Generally all NPCs who you want to behave differently + than the defualt behavior. + For these behaviors, passing in a valid object will + cause the creature to become hostile the the attacker. + + MODIFIED February 7 2003: + - Rearranged logic order a little so that the creatures + will actually randomwalk when not fighting +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 14, 2001 +//::////////////////////////////////////////////// + +void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID) +{ + object oTarget = GetNearestSeenEnemy(); + if(GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE)) + { + int bAttack = FALSE; + if(!GetIsObjectValid(oIntruder)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 8.0) + { + if(!GetIsFriend(oTarget)) + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0) + { + SetIsTemporaryEnemy(oTarget, OBJECT_SELF, FALSE, 20.0); + bAttack = TRUE; + DetermineCombatRound(oTarget); + } + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) + { + bAttack = TRUE; + DetermineCombatRound(oIntruder); + } + + // * if not attacking, the wander + if (bAttack == FALSE) + { + ClearActions(CLEAR_NW_I0_GENERIC_DetermineSpecialBehavior1); + ActionRandomWalk(); + return; + } + } + else if(GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && + !GetIsObjectValid(GetAttemptedSpellTarget()) && + !GetIsObjectValid(GetAttackTarget())) + { + if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 6.0) + { + if(!GetIsFriend(oTarget)) + { + if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0) + { + TalentFlee(oTarget); + } + } + } + } + else if(!IsInConversation(OBJECT_SELF)) + { + ClearActions(CLEAR_NW_I0_GENERIC_DetermineSpecialBehavior2); + ActionRandomWalk(); + return; + } + } +} + +//:://///////////////////////////////////////////// +//:: Bash Doors +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Used in DetermineCombatRound to keep a + henchmen bashing doors. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 4, 2002 +//::////////////////////////////////////////////// + +int BashDoorCheck(object oIntruder = OBJECT_INVALID) +{ + int bDoor = FALSE; + //This code is here to make sure that henchmen keep bashing doors and placables. + object oDoor = GetLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + + // * MODIFICATION February 7 2003 BK + // * don't bash trapped doors. + if (GetIsTrapped(oDoor) ) return FALSE; + + if(GetIsObjectValid(oDoor)) + { + int nDoorMax = GetMaxHitPoints(oDoor); + int nDoorNow = GetCurrentHitPoints(oDoor); + int nCnt = GetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP"); + if(!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)) + || (!GetIsObjectValid(oIntruder) && !GetIsObjectValid(GetMaster()))) + { + if(GetLocked(oDoor)) + { + if(nDoorMax == nDoorNow) + { + nCnt++; + SetLocalInt(OBJECT_SELF,"NW_GENERIC_DOOR_TO_BASH_HP", nCnt); + } + if(nCnt <= 0) + { + bDoor = TRUE; + if(GetHasFeat(FEAT_IMPROVED_POWER_ATTACK)) + { + ActionUseFeat(FEAT_IMPROVED_POWER_ATTACK, oDoor); + } + else if(GetHasFeat(FEAT_POWER_ATTACK)) + { + ActionUseFeat(FEAT_POWER_ATTACK, oDoor); + } + else + { + WrapperActionAttack(oDoor); + } + } + } + } + if(bDoor == FALSE) + { + VoiceCuss(); + DeleteLocalObject(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH"); + DeleteLocalInt(OBJECT_SELF, "NW_GENERIC_DOOR_TO_BASH_HP"); + } + } + return bDoor; +} + +//:://///////////////////////////////////////////// +//:: Determine Class to Use +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines which of a NPCs three classes to + use in DetermineCombatRound +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: April 4, 2002 +//::////////////////////////////////////////////// + +int DetermineClassToUse() +{ + int nClass; + int nTotal = GetHitDice(OBJECT_SELF); + + //this is silly... +/* + float fTotal = IntToFloat(nTotal); + int nState1 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(1))) / fTotal) * 100); + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(1)) + " %" + IntToString(nState1)); + + int nState2 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(2))) / fTotal) * 100) + nState1; + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(2)) + " %" + IntToString(nState2)); + + int nState3 = FloatToInt((IntToFloat(GetLevelByClass(GetClassByPosition(3))) / fTotal) * 100) + nState2; + // MyPrintString(GetTag(OBJECT_SELF) + "Class: " + IntToString(GetClassByPosition(3)) + " %" + IntToString(nState3)); +*/ + int nClass1 = GetClassByPosition(1); + int nClass2 = GetClassByPosition(2); + + int nState1 = GetLevelByClass(nClass1) * 100 / nTotal; + int nState2 = GetLevelByClass(nClass2) * 100 / nTotal; +// int nState3 = GetLevelByClass(GetClassByPosition(3)) * 100 / nTotal; + + int nUseClass = d100(); + // MyPrintString("D100 Roll " + IntToString(nUseClass)); + + if(nUseClass <= nState1) + { + nClass = nClass1; + } + else if(nUseClass > nState1 && nUseClass <= nState2) + { + nClass = nClass2; + } + else + { + nClass = GetClassByPosition(3); + } + // MyPrintString(GetName(OBJECT_SELF) + " Return Class = " + IntToString(nClass)); + + return nClass; +} + + + +/* DO NOT CLOSE THIS TOP COMMENT! + This main() function is here only for compilation testing. +void main() {} +/* */ diff --git a/nwnds_module/nw_o2_bookshelf.ncs b/nwnds_module/nw_o2_bookshelf.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/nw_o2_bookshelf.ncs differ diff --git a/nwnds_module/nw_o2_bookshelf.nss b/nwnds_module/nw_o2_bookshelf.nss new file mode 100644 index 000000000..4ee0643e4 --- /dev/null +++ b/nwnds_module/nw_o2_bookshelf.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: General Treasure Spawn Script BOOK +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Spawns in general purpose treasure, usable + by all classes. -DISABLED- +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: February 26 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" + +void main() + +{ /* + if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0) + { + return; + } + object oLastOpener = GetLastOpener(); + GenerateBookTreasure(oLastOpener, OBJECT_SELF); + SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); + ShoutDisturbed(); + + */ +} + + diff --git a/nwnds_module/nw_s1_summtanar.ncs b/nwnds_module/nw_s1_summtanar.ncs new file mode 100644 index 000000000..5fb60a511 Binary files /dev/null and b/nwnds_module/nw_s1_summtanar.ncs differ diff --git a/nwnds_module/nw_s1_summtanar.nss b/nwnds_module/nw_s1_summtanar.nss new file mode 100644 index 000000000..7faf6b3d7 --- /dev/null +++ b/nwnds_module/nw_s1_summtanar.nss @@ -0,0 +1,109 @@ +//:://///////////////////////////////////////////// +//:: Summon Tanarri +//:: NW_S0_SummSlaad +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Modified for the few Demons on Athas. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Aug 14, 2001 +//::////////////////////////////////////////////// +//:: VFX Pass By: Preston W, On: June 25, 2001 + +#include "bp_t_randloc" + +int DEBUG = FALSE; + +void main() +{ + //Declare major variables + string sTag = GetTag(OBJECT_SELF); + int nNum; + string sRes; + effect eSummon; + + + if(sTag=="NW_S_SUCCUBUS") + { + if(d100()<=30) + { + nNum = 1; + sRes = "DS_VROCK001"; + } + } + + if( (sTag=="DS_BABAU_001") || + (sTag=="DS_BABAU_002") || + (sTag=="DS_BABAU_003") ) + { + if(d100()<=40) + { + nNum = 1; + sRes = "DS_BABAU_001"; + } + } + + + if(sTag=="DS_DRETCH001") + { + if(d100()<=35) + { + nNum = 1; + sRes = "DS_DRETCH001"; + } + } + + if( (sTag=="NW_DMVROCK") || + (sTag=="DS_VROCK001") ) + { + switch(Random(2)) + { + case 0: + nNum = d10(2); + sRes = "DS_DRETCH001"; + break; + + case 1: + if(d100()<=35) + { + nNum = 1; + sRes = "DS_VROCK001"; + } + break; + } + + + } + + + if(DEBUG) + { + SendMessageToAllDMs(sTag + " >> " + IntToString(nNum) + " >> " + sRes); + } + + object oCreature; + if(sRes!="") + { + int i; + //ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_HORRID_WILTING),GetSpellTargetLocation()); + for (i = 0; i < nNum; i++) + { + effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD); + oCreature = CreateObject(OBJECT_TYPE_CREATURE,sRes,RndLoc(GetSpellTargetLocation(),5,DIMENSION_HEMISPHERE),FALSE); + ChangeFaction(oCreature,OBJECT_SELF); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eVis,GetLocation(oCreature)); + //eSummon = EffectSummonCreature(sRes,VFX_FNF_SUMMON_MONSTER_3); + //ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, RndLoc(GetSpellTargetLocation(),5,DIMENSION_HEMISPHERE), HoursToSeconds(24)); + } + } +} + + +//Declare major variables + //effect eSummon = EffectSummonCreature("NW_S_SUCCUBUS",VFX_FNF_SUMMON_MONSTER_3); + //effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3); + //Apply the VFX impact and summon effect + //ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation()); + //ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(24)); diff --git a/nwnds_module/nw_s3_actitem01.ncs b/nwnds_module/nw_s3_actitem01.ncs new file mode 100644 index 000000000..ad472dedc Binary files /dev/null and b/nwnds_module/nw_s3_actitem01.ncs differ diff --git a/nwnds_module/nw_s3_actitem01.nss b/nwnds_module/nw_s3_actitem01.nss new file mode 100644 index 000000000..02575a9c4 --- /dev/null +++ b/nwnds_module/nw_s3_actitem01.nss @@ -0,0 +1,32 @@ +//:://///////////////////////////////////////////// +//:: Actuvate Item Script +//:: NW_S3_ActItem01 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This fires the event on the module that allows + for items to have special powers. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 19, 2001 +//::////////////////////////////////////////////// +//:: Modified by The DMFI Team to handle activation of DMFI Wands & Widgets + +void main() +{ + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + location lLocal = GetSpellTargetLocation(); + + if (GetStringLeft(GetTag(oItem), 5) == "dmfi_" || + GetStringLeft(GetTag(oItem), 8) == "hlslang_") + { + SetLocalObject(OBJECT_SELF, "dmfi_item", oItem); + SetLocalObject(OBJECT_SELF, "dmfi_target", oTarget); + SetLocalLocation(OBJECT_SELF, "dmfi_location", lLocal); + ExecuteScript("dmfi_activate", OBJECT_SELF); + return; + } + SignalEvent(GetModule(), EventActivateItem(oItem, lLocal, oTarget)); +} diff --git a/nwnds_module/nwn2case007.utp b/nwnds_module/nwn2case007.utp new file mode 100644 index 000000000..f61a54f12 Binary files /dev/null and b/nwnds_module/nwn2case007.utp differ diff --git a/nwnds_module/oasis6.are b/nwnds_module/oasis6.are new file mode 100644 index 000000000..e4ca4fb4b Binary files /dev/null and b/nwnds_module/oasis6.are differ diff --git a/nwnds_module/oasis6.gic b/nwnds_module/oasis6.gic new file mode 100644 index 000000000..9a657f4f2 Binary files /dev/null and b/nwnds_module/oasis6.gic differ diff --git a/nwnds_module/oasis6.git b/nwnds_module/oasis6.git new file mode 100644 index 000000000..18402d253 Binary files /dev/null and b/nwnds_module/oasis6.git differ diff --git a/nwnds_module/obretrieverhide.uti b/nwnds_module/obretrieverhide.uti new file mode 100644 index 000000000..bae6a9aca Binary files /dev/null and b/nwnds_module/obretrieverhide.uti differ diff --git a/nwnds_module/obsgolemhide.uti b/nwnds_module/obsgolemhide.uti new file mode 100644 index 000000000..86d15c0b9 Binary files /dev/null and b/nwnds_module/obsgolemhide.uti differ diff --git a/nwnds_module/obsgolemslam.uti b/nwnds_module/obsgolemslam.uti new file mode 100644 index 000000000..d1d2a5363 Binary files /dev/null and b/nwnds_module/obsgolemslam.uti differ diff --git a/nwnds_module/obsiminoclaw.uti b/nwnds_module/obsiminoclaw.uti new file mode 100644 index 000000000..76127505e Binary files /dev/null and b/nwnds_module/obsiminoclaw.uti differ diff --git a/nwnds_module/obsminohide.uti b/nwnds_module/obsminohide.uti new file mode 100644 index 000000000..4f4ae4645 Binary files /dev/null and b/nwnds_module/obsminohide.uti differ diff --git a/nwnds_module/od_qstbldlttr03.ncs b/nwnds_module/od_qstbldlttr03.ncs new file mode 100644 index 000000000..369a53168 Binary files /dev/null and b/nwnds_module/od_qstbldlttr03.ncs differ diff --git a/nwnds_module/od_qstbldlttr03.nss b/nwnds_module/od_qstbldlttr03.nss new file mode 100644 index 000000000..7a0251f4f --- /dev/null +++ b/nwnds_module/od_qstbldlttr03.nss @@ -0,0 +1,259 @@ +//:://///////////////////////////////////////////// +//:: Quest Script: Bloodletter pt. 3 +//:: OD_QstBldlttr03.nss +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + + TODO: Quest info here. + +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 28, 2012 +//::////////////////////////////////////////////// + + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void PartyGold(object oPC); + +void main() +{ + + 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + // initialise local variables + int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); + object oPC = GetLastKiller(); + while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + string sTagSelf = GetTag(OBJECT_SELF); + string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); + // PartyGold(oPC); Mindless undead = no ceramic. + AddJournalQuestEntry ("DeadsRevenge", 2, oPC); + AddJournalQuestEntry ("rottedparchment", 1, oPC); + + // check for correct kill task target and complete + if(sTagSelf == sTagTarget && nKillFlag == 1) { + SetLocalInt(oPC, "KILL_TASK_FLAG", 2); + AddJournalQuestEntry("kt_journal_01", 99, oPC); + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// + } +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } \ No newline at end of file diff --git a/nwnds_module/old_ironroad.are b/nwnds_module/old_ironroad.are new file mode 100644 index 000000000..3474eabe9 Binary files /dev/null and b/nwnds_module/old_ironroad.are differ diff --git a/nwnds_module/old_ironroad.gic b/nwnds_module/old_ironroad.gic new file mode 100644 index 000000000..170075411 Binary files /dev/null and b/nwnds_module/old_ironroad.gic differ diff --git a/nwnds_module/old_ironroad.git b/nwnds_module/old_ironroad.git new file mode 100644 index 000000000..fe3167d5c Binary files /dev/null and b/nwnds_module/old_ironroad.git differ diff --git a/nwnds_module/olm_ablath.dlg b/nwnds_module/olm_ablath.dlg new file mode 100644 index 000000000..7edac72f7 Binary files /dev/null and b/nwnds_module/olm_ablath.dlg differ diff --git a/nwnds_module/olm_ablath_cv.ncs b/nwnds_module/olm_ablath_cv.ncs new file mode 100644 index 000000000..e9fa5c3e7 Binary files /dev/null and b/nwnds_module/olm_ablath_cv.ncs differ diff --git a/nwnds_module/olm_ablath_cv.nss b/nwnds_module/olm_ablath_cv.nss new file mode 100644 index 000000000..8ba02ca50 --- /dev/null +++ b/nwnds_module/olm_ablath_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_ablath", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_alfala.dlg b/nwnds_module/olm_alfala.dlg new file mode 100644 index 000000000..f4c0a46a3 Binary files /dev/null and b/nwnds_module/olm_alfala.dlg differ diff --git a/nwnds_module/olm_alfala_cv.ncs b/nwnds_module/olm_alfala_cv.ncs new file mode 100644 index 000000000..62dd9f843 Binary files /dev/null and b/nwnds_module/olm_alfala_cv.ncs differ diff --git a/nwnds_module/olm_alfala_cv.nss b/nwnds_module/olm_alfala_cv.nss new file mode 100644 index 000000000..aa381d80d --- /dev/null +++ b/nwnds_module/olm_alfala_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_alfala", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_altaruk.dlg b/nwnds_module/olm_altaruk.dlg new file mode 100644 index 000000000..61e6a50f0 Binary files /dev/null and b/nwnds_module/olm_altaruk.dlg differ diff --git a/nwnds_module/olm_altaruk_cv.ncs b/nwnds_module/olm_altaruk_cv.ncs new file mode 100644 index 000000000..e24b61f72 Binary files /dev/null and b/nwnds_module/olm_altaruk_cv.ncs differ diff --git a/nwnds_module/olm_altaruk_cv.nss b/nwnds_module/olm_altaruk_cv.nss new file mode 100644 index 000000000..d6d3d5fe8 --- /dev/null +++ b/nwnds_module/olm_altaruk_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_altaruk", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_altotoalt.dlg b/nwnds_module/olm_altotoalt.dlg new file mode 100644 index 000000000..9bbc64f5c Binary files /dev/null and b/nwnds_module/olm_altotoalt.dlg differ diff --git a/nwnds_module/olm_altotogipw1.dlg b/nwnds_module/olm_altotogipw1.dlg new file mode 100644 index 000000000..cb6de9170 Binary files /dev/null and b/nwnds_module/olm_altotogipw1.dlg differ diff --git a/nwnds_module/olm_alttoalto.dlg b/nwnds_module/olm_alttoalto.dlg new file mode 100644 index 000000000..9117ec26d Binary files /dev/null and b/nwnds_module/olm_alttoalto.dlg differ diff --git a/nwnds_module/olm_alttodef.dlg b/nwnds_module/olm_alttodef.dlg new file mode 100644 index 000000000..376d3f208 Binary files /dev/null and b/nwnds_module/olm_alttodef.dlg differ diff --git a/nwnds_module/olm_arkhold.dlg b/nwnds_module/olm_arkhold.dlg new file mode 100644 index 000000000..ead07aefd Binary files /dev/null and b/nwnds_module/olm_arkhold.dlg differ diff --git a/nwnds_module/olm_arkhold_cv.ncs b/nwnds_module/olm_arkhold_cv.ncs new file mode 100644 index 000000000..a2e40a23c Binary files /dev/null and b/nwnds_module/olm_arkhold_cv.ncs differ diff --git a/nwnds_module/olm_arkhold_cv.nss b/nwnds_module/olm_arkhold_cv.nss new file mode 100644 index 000000000..83bc1f20f --- /dev/null +++ b/nwnds_module/olm_arkhold_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_arkhold", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_balic.dlg b/nwnds_module/olm_balic.dlg new file mode 100644 index 000000000..8eb520851 Binary files /dev/null and b/nwnds_module/olm_balic.dlg differ diff --git a/nwnds_module/olm_balic_cv.ncs b/nwnds_module/olm_balic_cv.ncs new file mode 100644 index 000000000..8a881789e Binary files /dev/null and b/nwnds_module/olm_balic_cv.ncs differ diff --git a/nwnds_module/olm_balic_cv.nss b/nwnds_module/olm_balic_cv.nss new file mode 100644 index 000000000..6b53a72a6 --- /dev/null +++ b/nwnds_module/olm_balic_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_balic", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_barrtoec.dlg b/nwnds_module/olm_barrtoec.dlg new file mode 100644 index 000000000..04c8a9fe9 Binary files /dev/null and b/nwnds_module/olm_barrtoec.dlg differ diff --git a/nwnds_module/olm_bitter_we_cv.ncs b/nwnds_module/olm_bitter_we_cv.ncs new file mode 100644 index 000000000..c7916c115 Binary files /dev/null and b/nwnds_module/olm_bitter_we_cv.ncs differ diff --git a/nwnds_module/olm_bitter_we_cv.nss b/nwnds_module/olm_bitter_we_cv.nss new file mode 100644 index 000000000..a70c82a3f --- /dev/null +++ b/nwnds_module/olm_bitter_we_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_bitter_well", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_bitter_well.dlg b/nwnds_module/olm_bitter_well.dlg new file mode 100644 index 000000000..a4d1b2a23 Binary files /dev/null and b/nwnds_module/olm_bitter_well.dlg differ diff --git a/nwnds_module/olm_bleak_tow_cv.ncs b/nwnds_module/olm_bleak_tow_cv.ncs new file mode 100644 index 000000000..03e7db306 Binary files /dev/null and b/nwnds_module/olm_bleak_tow_cv.ncs differ diff --git a/nwnds_module/olm_bleak_tow_cv.nss b/nwnds_module/olm_bleak_tow_cv.nss new file mode 100644 index 000000000..3f27fbd19 --- /dev/null +++ b/nwnds_module/olm_bleak_tow_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_bleak_tower", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_bleak_tower.dlg b/nwnds_module/olm_bleak_tower.dlg new file mode 100644 index 000000000..e73ff7d57 Binary files /dev/null and b/nwnds_module/olm_bleak_tower.dlg differ diff --git a/nwnds_module/olm_bodach.dlg b/nwnds_module/olm_bodach.dlg new file mode 100644 index 000000000..4b3134617 Binary files /dev/null and b/nwnds_module/olm_bodach.dlg differ diff --git a/nwnds_module/olm_bodach1.dlg b/nwnds_module/olm_bodach1.dlg new file mode 100644 index 000000000..7d0bc0ac5 Binary files /dev/null and b/nwnds_module/olm_bodach1.dlg differ diff --git a/nwnds_module/olm_bodach_cv.ncs b/nwnds_module/olm_bodach_cv.ncs new file mode 100644 index 000000000..d7c31d206 Binary files /dev/null and b/nwnds_module/olm_bodach_cv.ncs differ diff --git a/nwnds_module/olm_bodach_cv.nss b/nwnds_module/olm_bodach_cv.nss new file mode 100644 index 000000000..0ae7de6b8 --- /dev/null +++ b/nwnds_module/olm_bodach_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_bodach", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_borys_cit.dlg b/nwnds_module/olm_borys_cit.dlg new file mode 100644 index 000000000..498d41873 Binary files /dev/null and b/nwnds_module/olm_borys_cit.dlg differ diff --git a/nwnds_module/olm_borys_cit_cv.ncs b/nwnds_module/olm_borys_cit_cv.ncs new file mode 100644 index 000000000..1b582e1c6 Binary files /dev/null and b/nwnds_module/olm_borys_cit_cv.ncs differ diff --git a/nwnds_module/olm_borys_cit_cv.nss b/nwnds_module/olm_borys_cit_cv.nss new file mode 100644 index 000000000..5b62c4750 --- /dev/null +++ b/nwnds_module/olm_borys_cit_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_borys_cit", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_break_sh_cv.ncs b/nwnds_module/olm_break_sh_cv.ncs new file mode 100644 index 000000000..c8460b6e3 Binary files /dev/null and b/nwnds_module/olm_break_sh_cv.ncs differ diff --git a/nwnds_module/olm_break_sh_cv.nss b/nwnds_module/olm_break_sh_cv.nss new file mode 100644 index 000000000..48e97054b --- /dev/null +++ b/nwnds_module/olm_break_sh_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_break_shore", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_break_shore.dlg b/nwnds_module/olm_break_shore.dlg new file mode 100644 index 000000000..2524b64f9 Binary files /dev/null and b/nwnds_module/olm_break_shore.dlg differ diff --git a/nwnds_module/olm_cromlin.dlg b/nwnds_module/olm_cromlin.dlg new file mode 100644 index 000000000..8e73a8c12 Binary files /dev/null and b/nwnds_module/olm_cromlin.dlg differ diff --git a/nwnds_module/olm_cromlin_cv.ncs b/nwnds_module/olm_cromlin_cv.ncs new file mode 100644 index 000000000..c2d969326 Binary files /dev/null and b/nwnds_module/olm_cromlin_cv.ncs differ diff --git a/nwnds_module/olm_cromlin_cv.nss b/nwnds_module/olm_cromlin_cv.nss new file mode 100644 index 000000000..bb1251bd6 --- /dev/null +++ b/nwnds_module/olm_cromlin_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_cromlin", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_deftoalt.dlg b/nwnds_module/olm_deftoalt.dlg new file mode 100644 index 000000000..b77739e72 Binary files /dev/null and b/nwnds_module/olm_deftoalt.dlg differ diff --git a/nwnds_module/olm_draj.dlg b/nwnds_module/olm_draj.dlg new file mode 100644 index 000000000..6d5d669ef Binary files /dev/null and b/nwnds_module/olm_draj.dlg differ diff --git a/nwnds_module/olm_draj_cv.ncs b/nwnds_module/olm_draj_cv.ncs new file mode 100644 index 000000000..bbaf8d682 Binary files /dev/null and b/nwnds_module/olm_draj_cv.ncs differ diff --git a/nwnds_module/olm_draj_cv.nss b/nwnds_module/olm_draj_cv.nss new file mode 100644 index 000000000..13ca1988e --- /dev/null +++ b/nwnds_module/olm_draj_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_draj", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_ectobarr.dlg b/nwnds_module/olm_ectobarr.dlg new file mode 100644 index 000000000..539b972fc Binary files /dev/null and b/nwnds_module/olm_ectobarr.dlg differ diff --git a/nwnds_module/olm_ectospy.dlg b/nwnds_module/olm_ectospy.dlg new file mode 100644 index 000000000..91296a4c6 Binary files /dev/null and b/nwnds_module/olm_ectospy.dlg differ diff --git a/nwnds_module/olm_ectotgw.dlg b/nwnds_module/olm_ectotgw.dlg new file mode 100644 index 000000000..5a661ed9a Binary files /dev/null and b/nwnds_module/olm_ectotgw.dlg differ diff --git a/nwnds_module/olm_ectotgwn.dlg b/nwnds_module/olm_ectotgwn.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn.dlg differ diff --git a/nwnds_module/olm_ectotgwn1.dlg b/nwnds_module/olm_ectotgwn1.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn1.dlg differ diff --git a/nwnds_module/olm_ectotgwn2.dlg b/nwnds_module/olm_ectotgwn2.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn2.dlg differ diff --git a/nwnds_module/olm_ectotgwn3.dlg b/nwnds_module/olm_ectotgwn3.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn3.dlg differ diff --git a/nwnds_module/olm_ectotgwn4.dlg b/nwnds_module/olm_ectotgwn4.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn4.dlg differ diff --git a/nwnds_module/olm_ectotgwn5.dlg b/nwnds_module/olm_ectotgwn5.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_ectotgwn5.dlg differ diff --git a/nwnds_module/olm_ectotgwn6.dlg b/nwnds_module/olm_ectotgwn6.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ectotgwn6.dlg differ diff --git a/nwnds_module/olm_fort_amb_cv.ncs b/nwnds_module/olm_fort_amb_cv.ncs new file mode 100644 index 000000000..bcbbf1bd9 Binary files /dev/null and b/nwnds_module/olm_fort_amb_cv.ncs differ diff --git a/nwnds_module/olm_fort_amb_cv.nss b/nwnds_module/olm_fort_amb_cv.nss new file mode 100644 index 000000000..5d1be1329 --- /dev/null +++ b/nwnds_module/olm_fort_amb_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_amber", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_amber.dlg b/nwnds_module/olm_fort_amber.dlg new file mode 100644 index 000000000..d581d082d Binary files /dev/null and b/nwnds_module/olm_fort_amber.dlg differ diff --git a/nwnds_module/olm_fort_but1.dlg b/nwnds_module/olm_fort_but1.dlg new file mode 100644 index 000000000..358f9197d Binary files /dev/null and b/nwnds_module/olm_fort_but1.dlg differ diff --git a/nwnds_module/olm_fort_but2.dlg b/nwnds_module/olm_fort_but2.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_fort_but2.dlg differ diff --git a/nwnds_module/olm_fort_butcher.dlg b/nwnds_module/olm_fort_butcher.dlg new file mode 100644 index 000000000..e8013eb88 Binary files /dev/null and b/nwnds_module/olm_fort_butcher.dlg differ diff --git a/nwnds_module/olm_fort_cour.dlg b/nwnds_module/olm_fort_cour.dlg new file mode 100644 index 000000000..ce8f78099 Binary files /dev/null and b/nwnds_module/olm_fort_cour.dlg differ diff --git a/nwnds_module/olm_fort_cour_cv.ncs b/nwnds_module/olm_fort_cour_cv.ncs new file mode 100644 index 000000000..3d8a34be0 Binary files /dev/null and b/nwnds_module/olm_fort_cour_cv.ncs differ diff --git a/nwnds_module/olm_fort_cour_cv.nss b/nwnds_module/olm_fort_cour_cv.nss new file mode 100644 index 000000000..cb4758d2d --- /dev/null +++ b/nwnds_module/olm_fort_cour_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_cour", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_ebon.dlg b/nwnds_module/olm_fort_ebon.dlg new file mode 100644 index 000000000..e30edeb6e Binary files /dev/null and b/nwnds_module/olm_fort_ebon.dlg differ diff --git a/nwnds_module/olm_fort_ebon_cv.ncs b/nwnds_module/olm_fort_ebon_cv.ncs new file mode 100644 index 000000000..3525cb636 Binary files /dev/null and b/nwnds_module/olm_fort_ebon_cv.ncs differ diff --git a/nwnds_module/olm_fort_ebon_cv.nss b/nwnds_module/olm_fort_ebon_cv.nss new file mode 100644 index 000000000..014592ef3 --- /dev/null +++ b/nwnds_module/olm_fort_ebon_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_ebon", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_firs_cv.ncs b/nwnds_module/olm_fort_firs_cv.ncs new file mode 100644 index 000000000..9900a0fc2 Binary files /dev/null and b/nwnds_module/olm_fort_firs_cv.ncs differ diff --git a/nwnds_module/olm_fort_firs_cv.nss b/nwnds_module/olm_fort_firs_cv.nss new file mode 100644 index 000000000..ce9c8e8d4 --- /dev/null +++ b/nwnds_module/olm_fort_firs_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_first", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_first.dlg b/nwnds_module/olm_fort_first.dlg new file mode 100644 index 000000000..18df0ccf6 Binary files /dev/null and b/nwnds_module/olm_fort_first.dlg differ diff --git a/nwnds_module/olm_fort_fyra.dlg b/nwnds_module/olm_fort_fyra.dlg new file mode 100644 index 000000000..4a2721772 Binary files /dev/null and b/nwnds_module/olm_fort_fyra.dlg differ diff --git a/nwnds_module/olm_fort_fyra_cv.ncs b/nwnds_module/olm_fort_fyra_cv.ncs new file mode 100644 index 000000000..470b8f0d4 Binary files /dev/null and b/nwnds_module/olm_fort_fyra_cv.ncs differ diff --git a/nwnds_module/olm_fort_fyra_cv.nss b/nwnds_module/olm_fort_fyra_cv.nss new file mode 100644 index 000000000..9006f4d4b --- /dev/null +++ b/nwnds_module/olm_fort_fyra_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_fyra", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_glam.dlg b/nwnds_module/olm_fort_glam.dlg new file mode 100644 index 000000000..4f29b2844 Binary files /dev/null and b/nwnds_module/olm_fort_glam.dlg differ diff --git a/nwnds_module/olm_fort_glam_cv.ncs b/nwnds_module/olm_fort_glam_cv.ncs new file mode 100644 index 000000000..7b53b58ef Binary files /dev/null and b/nwnds_module/olm_fort_glam_cv.ncs differ diff --git a/nwnds_module/olm_fort_glam_cv.nss b/nwnds_module/olm_fort_glam_cv.nss new file mode 100644 index 000000000..ba0cf492b --- /dev/null +++ b/nwnds_module/olm_fort_glam_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_glam", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_glamis.dlg b/nwnds_module/olm_fort_glamis.dlg new file mode 100644 index 000000000..60c14cff3 Binary files /dev/null and b/nwnds_module/olm_fort_glamis.dlg differ diff --git a/nwnds_module/olm_fort_harb_cv.ncs b/nwnds_module/olm_fort_harb_cv.ncs new file mode 100644 index 000000000..b3fffeb66 Binary files /dev/null and b/nwnds_module/olm_fort_harb_cv.ncs differ diff --git a/nwnds_module/olm_fort_harb_cv.nss b/nwnds_module/olm_fort_harb_cv.nss new file mode 100644 index 000000000..bf9f15124 --- /dev/null +++ b/nwnds_module/olm_fort_harb_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_harbeth", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_harbeth.dlg b/nwnds_module/olm_fort_harbeth.dlg new file mode 100644 index 000000000..3eb86b0fc Binary files /dev/null and b/nwnds_module/olm_fort_harbeth.dlg differ diff --git a/nwnds_module/olm_fort_ian_cv.ncs b/nwnds_module/olm_fort_ian_cv.ncs new file mode 100644 index 000000000..fd8366219 Binary files /dev/null and b/nwnds_module/olm_fort_ian_cv.ncs differ diff --git a/nwnds_module/olm_fort_ian_cv.nss b/nwnds_module/olm_fort_ian_cv.nss new file mode 100644 index 000000000..9d9c9d284 --- /dev/null +++ b/nwnds_module/olm_fort_ian_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_ianto", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_ianto.dlg b/nwnds_module/olm_fort_ianto.dlg new file mode 100644 index 000000000..a1fbc95f9 Binary files /dev/null and b/nwnds_module/olm_fort_ianto.dlg differ diff --git a/nwnds_module/olm_fort_inix.dlg b/nwnds_module/olm_fort_inix.dlg new file mode 100644 index 000000000..b862f042a Binary files /dev/null and b/nwnds_module/olm_fort_inix.dlg differ diff --git a/nwnds_module/olm_fort_inix_cv.ncs b/nwnds_module/olm_fort_inix_cv.ncs new file mode 100644 index 000000000..ff2602852 Binary files /dev/null and b/nwnds_module/olm_fort_inix_cv.ncs differ diff --git a/nwnds_module/olm_fort_inix_cv.nss b/nwnds_module/olm_fort_inix_cv.nss new file mode 100644 index 000000000..7d768b7a9 --- /dev/null +++ b/nwnds_module/olm_fort_inix_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_inix", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_iron.dlg b/nwnds_module/olm_fort_iron.dlg new file mode 100644 index 000000000..e41372577 Binary files /dev/null and b/nwnds_module/olm_fort_iron.dlg differ diff --git a/nwnds_module/olm_fort_iron1.dlg b/nwnds_module/olm_fort_iron1.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_fort_iron1.dlg differ diff --git a/nwnds_module/olm_fort_iron_cv.ncs b/nwnds_module/olm_fort_iron_cv.ncs new file mode 100644 index 000000000..d491d4760 Binary files /dev/null and b/nwnds_module/olm_fort_iron_cv.ncs differ diff --git a/nwnds_module/olm_fort_iron_cv.nss b/nwnds_module/olm_fort_iron_cv.nss new file mode 100644 index 000000000..21c1974b1 --- /dev/null +++ b/nwnds_module/olm_fort_iron_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_iron", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_isus.dlg b/nwnds_module/olm_fort_isus.dlg new file mode 100644 index 000000000..ba6dfaed6 Binary files /dev/null and b/nwnds_module/olm_fort_isus.dlg differ diff --git a/nwnds_module/olm_fort_isus_cv.ncs b/nwnds_module/olm_fort_isus_cv.ncs new file mode 100644 index 000000000..8178536b3 Binary files /dev/null and b/nwnds_module/olm_fort_isus_cv.ncs differ diff --git a/nwnds_module/olm_fort_isus_cv.nss b/nwnds_module/olm_fort_isus_cv.nss new file mode 100644 index 000000000..a9d20144a --- /dev/null +++ b/nwnds_module/olm_fort_isus_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_isus", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_kalv_cv.ncs b/nwnds_module/olm_fort_kalv_cv.ncs new file mode 100644 index 000000000..ca59b21dd Binary files /dev/null and b/nwnds_module/olm_fort_kalv_cv.ncs differ diff --git a/nwnds_module/olm_fort_kalv_cv.nss b/nwnds_module/olm_fort_kalv_cv.nss new file mode 100644 index 000000000..d973ab4fc --- /dev/null +++ b/nwnds_module/olm_fort_kalv_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_kalvis", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_kalvis.dlg b/nwnds_module/olm_fort_kalvis.dlg new file mode 100644 index 000000000..2ddff589c Binary files /dev/null and b/nwnds_module/olm_fort_kalvis.dlg differ diff --git a/nwnds_module/olm_fort_mel.dlg b/nwnds_module/olm_fort_mel.dlg new file mode 100644 index 000000000..29c74090d Binary files /dev/null and b/nwnds_module/olm_fort_mel.dlg differ diff --git a/nwnds_module/olm_fort_mel_cv.ncs b/nwnds_module/olm_fort_mel_cv.ncs new file mode 100644 index 000000000..bd15b700b Binary files /dev/null and b/nwnds_module/olm_fort_mel_cv.ncs differ diff --git a/nwnds_module/olm_fort_mel_cv.nss b/nwnds_module/olm_fort_mel_cv.nss new file mode 100644 index 000000000..5a2b316a9 --- /dev/null +++ b/nwnds_module/olm_fort_mel_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_mel", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_melidor.dlg b/nwnds_module/olm_fort_melidor.dlg new file mode 100644 index 000000000..394ff86da Binary files /dev/null and b/nwnds_module/olm_fort_melidor.dlg differ diff --git a/nwnds_module/olm_fort_sand_cv.ncs b/nwnds_module/olm_fort_sand_cv.ncs new file mode 100644 index 000000000..94c8254f2 Binary files /dev/null and b/nwnds_module/olm_fort_sand_cv.ncs differ diff --git a/nwnds_module/olm_fort_sand_cv.nss b/nwnds_module/olm_fort_sand_cv.nss new file mode 100644 index 000000000..043028f5d --- /dev/null +++ b/nwnds_module/olm_fort_sand_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_sandol", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_sandol.dlg b/nwnds_module/olm_fort_sandol.dlg new file mode 100644 index 000000000..abfa41298 Binary files /dev/null and b/nwnds_module/olm_fort_sandol.dlg differ diff --git a/nwnds_module/olm_fort_sko_cv.ncs b/nwnds_module/olm_fort_sko_cv.ncs new file mode 100644 index 000000000..655fbe153 Binary files /dev/null and b/nwnds_module/olm_fort_sko_cv.ncs differ diff --git a/nwnds_module/olm_fort_sko_cv.nss b/nwnds_module/olm_fort_sko_cv.nss new file mode 100644 index 000000000..9f6a16fb8 --- /dev/null +++ b/nwnds_module/olm_fort_sko_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_skonz", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_skonz.dlg b/nwnds_module/olm_fort_skonz.dlg new file mode 100644 index 000000000..836162565 Binary files /dev/null and b/nwnds_module/olm_fort_skonz.dlg differ diff --git a/nwnds_module/olm_fort_skonz1.dlg b/nwnds_module/olm_fort_skonz1.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_fort_skonz1.dlg differ diff --git a/nwnds_module/olm_fort_tham_cv.ncs b/nwnds_module/olm_fort_tham_cv.ncs new file mode 100644 index 000000000..d2bd82a95 Binary files /dev/null and b/nwnds_module/olm_fort_tham_cv.ncs differ diff --git a/nwnds_module/olm_fort_tham_cv.nss b/nwnds_module/olm_fort_tham_cv.nss new file mode 100644 index 000000000..47af354b1 --- /dev/null +++ b/nwnds_module/olm_fort_tham_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_thamo", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_thamo.dlg b/nwnds_module/olm_fort_thamo.dlg new file mode 100644 index 000000000..b390b0401 Binary files /dev/null and b/nwnds_module/olm_fort_thamo.dlg differ diff --git a/nwnds_module/olm_fort_thet_cv.ncs b/nwnds_module/olm_fort_thet_cv.ncs new file mode 100644 index 000000000..31c8bd2c0 Binary files /dev/null and b/nwnds_module/olm_fort_thet_cv.ncs differ diff --git a/nwnds_module/olm_fort_thet_cv.nss b/nwnds_module/olm_fort_thet_cv.nss new file mode 100644 index 000000000..2361c4b8a --- /dev/null +++ b/nwnds_module/olm_fort_thet_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_fort_thetis", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_fort_thetis.dlg b/nwnds_module/olm_fort_thetis.dlg new file mode 100644 index 000000000..b549344a6 Binary files /dev/null and b/nwnds_module/olm_fort_thetis.dlg differ diff --git a/nwnds_module/olm_ftamtogsw5.dlg b/nwnds_module/olm_ftamtogsw5.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_ftamtogsw5.dlg differ diff --git a/nwnds_module/olm_gdetogdw.dlg b/nwnds_module/olm_gdetogdw.dlg new file mode 100644 index 000000000..c2224d7ca Binary files /dev/null and b/nwnds_module/olm_gdetogdw.dlg differ diff --git a/nwnds_module/olm_gdetotgc.dlg b/nwnds_module/olm_gdetotgc.dlg new file mode 100644 index 000000000..8c515d2fe Binary files /dev/null and b/nwnds_module/olm_gdetotgc.dlg differ diff --git a/nwnds_module/olm_gdtotgwn.dlg b/nwnds_module/olm_gdtotgwn.dlg new file mode 100644 index 000000000..24af470f4 Binary files /dev/null and b/nwnds_module/olm_gdtotgwn.dlg differ diff --git a/nwnds_module/olm_gdwtogde.dlg b/nwnds_module/olm_gdwtogde.dlg new file mode 100644 index 000000000..9510cbf8a Binary files /dev/null and b/nwnds_module/olm_gdwtogde.dlg differ diff --git a/nwnds_module/olm_giptoalto.dlg b/nwnds_module/olm_giptoalto.dlg new file mode 100644 index 000000000..f034b1065 Binary files /dev/null and b/nwnds_module/olm_giptoalto.dlg differ diff --git a/nwnds_module/olm_giptogip1.dlg b/nwnds_module/olm_giptogip1.dlg new file mode 100644 index 000000000..33e6f190e Binary files /dev/null and b/nwnds_module/olm_giptogip1.dlg differ diff --git a/nwnds_module/olm_giptogip2.dlg b/nwnds_module/olm_giptogip2.dlg new file mode 100644 index 000000000..ceb54b64e Binary files /dev/null and b/nwnds_module/olm_giptogip2.dlg differ diff --git a/nwnds_module/olm_giptogip3.dlg b/nwnds_module/olm_giptogip3.dlg new file mode 100644 index 000000000..5256d3244 Binary files /dev/null and b/nwnds_module/olm_giptogip3.dlg differ diff --git a/nwnds_module/olm_giptogip4.dlg b/nwnds_module/olm_giptogip4.dlg new file mode 100644 index 000000000..33e6f190e Binary files /dev/null and b/nwnds_module/olm_giptogip4.dlg differ diff --git a/nwnds_module/olm_giptogip5.dlg b/nwnds_module/olm_giptogip5.dlg new file mode 100644 index 000000000..68019cdde Binary files /dev/null and b/nwnds_module/olm_giptogip5.dlg differ diff --git a/nwnds_module/olm_giptogip6.dlg b/nwnds_module/olm_giptogip6.dlg new file mode 100644 index 000000000..5256d3244 Binary files /dev/null and b/nwnds_module/olm_giptogip6.dlg differ diff --git a/nwnds_module/olm_gitctowdwp.dlg b/nwnds_module/olm_gitctowdwp.dlg new file mode 100644 index 000000000..2fdeb4da7 Binary files /dev/null and b/nwnds_module/olm_gitctowdwp.dlg differ diff --git a/nwnds_module/olm_giustenal.dlg b/nwnds_module/olm_giustenal.dlg new file mode 100644 index 000000000..939ac7bc5 Binary files /dev/null and b/nwnds_module/olm_giustenal.dlg differ diff --git a/nwnds_module/olm_giustenal_cv.ncs b/nwnds_module/olm_giustenal_cv.ncs new file mode 100644 index 000000000..bdb43bbcb Binary files /dev/null and b/nwnds_module/olm_giustenal_cv.ncs differ diff --git a/nwnds_module/olm_giustenal_cv.nss b/nwnds_module/olm_giustenal_cv.nss new file mode 100644 index 000000000..e6c69f5b2 --- /dev/null +++ b/nwnds_module/olm_giustenal_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_giustenal", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_gsw2togsw1.dlg b/nwnds_module/olm_gsw2togsw1.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw2togsw1.dlg differ diff --git a/nwnds_module/olm_gsw2togsw3.dlg b/nwnds_module/olm_gsw2togsw3.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw2togsw3.dlg differ diff --git a/nwnds_module/olm_gsw3togsw4.dlg b/nwnds_module/olm_gsw3togsw4.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw3togsw4.dlg differ diff --git a/nwnds_module/olm_gsw4togsw3.dlg b/nwnds_module/olm_gsw4togsw3.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw4togsw3.dlg differ diff --git a/nwnds_module/olm_gsw4togsw5.dlg b/nwnds_module/olm_gsw4togsw5.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw4togsw5.dlg differ diff --git a/nwnds_module/olm_gsw5toftam.dlg b/nwnds_module/olm_gsw5toftam.dlg new file mode 100644 index 000000000..ae398cc77 Binary files /dev/null and b/nwnds_module/olm_gsw5toftam.dlg differ diff --git a/nwnds_module/olm_gsw5togsw4.dlg b/nwnds_module/olm_gsw5togsw4.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw5togsw4.dlg differ diff --git a/nwnds_module/olm_gsw5togsw6.dlg b/nwnds_module/olm_gsw5togsw6.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw5togsw6.dlg differ diff --git a/nwnds_module/olm_gsw6togsw5.dlg b/nwnds_module/olm_gsw6togsw5.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gsw6togsw5.dlg differ diff --git a/nwnds_module/olm_gsw6togswde.dlg b/nwnds_module/olm_gsw6togswde.dlg new file mode 100644 index 000000000..b30fda893 Binary files /dev/null and b/nwnds_module/olm_gsw6togswde.dlg differ diff --git a/nwnds_module/olm_gswdetogsw6.dlg b/nwnds_module/olm_gswdetogsw6.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gswdetogsw6.dlg differ diff --git a/nwnds_module/olm_gswt1togsw2.dlg b/nwnds_module/olm_gswt1togsw2.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_gswt1togsw2.dlg differ diff --git a/nwnds_module/olm_gulg.dlg b/nwnds_module/olm_gulg.dlg new file mode 100644 index 000000000..9fbd61f67 Binary files /dev/null and b/nwnds_module/olm_gulg.dlg differ diff --git a/nwnds_module/olm_gulg_cv.ncs b/nwnds_module/olm_gulg_cv.ncs new file mode 100644 index 000000000..27bcb64bf Binary files /dev/null and b/nwnds_module/olm_gulg_cv.ncs differ diff --git a/nwnds_module/olm_gulg_cv.nss b/nwnds_module/olm_gulg_cv.nss new file mode 100644 index 000000000..3efb127fc --- /dev/null +++ b/nwnds_module/olm_gulg_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_gulg", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_hid_vill_cv.ncs b/nwnds_module/olm_hid_vill_cv.ncs new file mode 100644 index 000000000..db9fa5228 Binary files /dev/null and b/nwnds_module/olm_hid_vill_cv.ncs differ diff --git a/nwnds_module/olm_hid_vill_cv.nss b/nwnds_module/olm_hid_vill_cv.nss new file mode 100644 index 000000000..3c0709d3d --- /dev/null +++ b/nwnds_module/olm_hid_vill_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_hid_village", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_hid_village.dlg b/nwnds_module/olm_hid_village.dlg new file mode 100644 index 000000000..7c2f5a322 Binary files /dev/null and b/nwnds_module/olm_hid_village.dlg differ diff --git a/nwnds_module/olm_hiddinvill.dlg b/nwnds_module/olm_hiddinvill.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_hiddinvill.dlg differ diff --git a/nwnds_module/olm_ianto1.dlg b/nwnds_module/olm_ianto1.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_ianto1.dlg differ diff --git a/nwnds_module/olm_kalidnay.dlg b/nwnds_module/olm_kalidnay.dlg new file mode 100644 index 000000000..83f2708b7 Binary files /dev/null and b/nwnds_module/olm_kalidnay.dlg differ diff --git a/nwnds_module/olm_kalidnay_cv.ncs b/nwnds_module/olm_kalidnay_cv.ncs new file mode 100644 index 000000000..fa0e39f88 Binary files /dev/null and b/nwnds_module/olm_kalidnay_cv.ncs differ diff --git a/nwnds_module/olm_kalidnay_cv.nss b/nwnds_module/olm_kalidnay_cv.nss new file mode 100644 index 000000000..76be68861 --- /dev/null +++ b/nwnds_module/olm_kalidnay_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_kalidnay", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_kled.dlg b/nwnds_module/olm_kled.dlg new file mode 100644 index 000000000..95083901c Binary files /dev/null and b/nwnds_module/olm_kled.dlg differ diff --git a/nwnds_module/olm_kled_cv.ncs b/nwnds_module/olm_kled_cv.ncs new file mode 100644 index 000000000..8aeac28d7 Binary files /dev/null and b/nwnds_module/olm_kled_cv.ncs differ diff --git a/nwnds_module/olm_kled_cv.nss b/nwnds_module/olm_kled_cv.nss new file mode 100644 index 000000000..605971737 --- /dev/null +++ b/nwnds_module/olm_kled_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_kled", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_kledstokled.dlg b/nwnds_module/olm_kledstokled.dlg new file mode 100644 index 000000000..4a3fe6724 Binary files /dev/null and b/nwnds_module/olm_kledstokled.dlg differ diff --git a/nwnds_module/olm_kledtosalt.dlg b/nwnds_module/olm_kledtosalt.dlg new file mode 100644 index 000000000..67b3af350 Binary files /dev/null and b/nwnds_module/olm_kledtosalt.dlg differ diff --git a/nwnds_module/olm_kledtoshift.dlg b/nwnds_module/olm_kledtoshift.dlg new file mode 100644 index 000000000..45b084f41 Binary files /dev/null and b/nwnds_module/olm_kledtoshift.dlg differ diff --git a/nwnds_module/olm_last_port.dlg b/nwnds_module/olm_last_port.dlg new file mode 100644 index 000000000..98431db51 Binary files /dev/null and b/nwnds_module/olm_last_port.dlg differ diff --git a/nwnds_module/olm_last_port_cv.ncs b/nwnds_module/olm_last_port_cv.ncs new file mode 100644 index 000000000..475a9a242 Binary files /dev/null and b/nwnds_module/olm_last_port_cv.ncs differ diff --git a/nwnds_module/olm_last_port_cv.nss b/nwnds_module/olm_last_port_cv.nss new file mode 100644 index 000000000..827574a45 --- /dev/null +++ b/nwnds_module/olm_last_port_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_last_port", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_makla.dlg b/nwnds_module/olm_makla.dlg new file mode 100644 index 000000000..4b7a34f05 Binary files /dev/null and b/nwnds_module/olm_makla.dlg differ diff --git a/nwnds_module/olm_makla_cv.ncs b/nwnds_module/olm_makla_cv.ncs new file mode 100644 index 000000000..6d69eeb6e Binary files /dev/null and b/nwnds_module/olm_makla_cv.ncs differ diff --git a/nwnds_module/olm_makla_cv.nss b/nwnds_module/olm_makla_cv.nss new file mode 100644 index 000000000..002a25331 --- /dev/null +++ b/nwnds_module/olm_makla_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_makla", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_n_led.dlg b/nwnds_module/olm_n_led.dlg new file mode 100644 index 000000000..a351c1bf0 Binary files /dev/null and b/nwnds_module/olm_n_led.dlg differ diff --git a/nwnds_module/olm_n_led_cv.ncs b/nwnds_module/olm_n_led_cv.ncs new file mode 100644 index 000000000..4247eb5ef Binary files /dev/null and b/nwnds_module/olm_n_led_cv.ncs differ diff --git a/nwnds_module/olm_n_led_cv.nss b/nwnds_module/olm_n_led_cv.nss new file mode 100644 index 000000000..874481ed4 --- /dev/null +++ b/nwnds_module/olm_n_led_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_n_led", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_nctotgrs.dlg b/nwnds_module/olm_nctotgrs.dlg new file mode 100644 index 000000000..32dd1e6ba Binary files /dev/null and b/nwnds_module/olm_nctotgrs.dlg differ diff --git a/nwnds_module/olm_nctotgw.dlg b/nwnds_module/olm_nctotgw.dlg new file mode 100644 index 000000000..5a661ed9a Binary files /dev/null and b/nwnds_module/olm_nctotgw.dlg differ diff --git a/nwnds_module/olm_nibenay.dlg b/nwnds_module/olm_nibenay.dlg new file mode 100644 index 000000000..958f03171 Binary files /dev/null and b/nwnds_module/olm_nibenay.dlg differ diff --git a/nwnds_module/olm_nibenay_cv.ncs b/nwnds_module/olm_nibenay_cv.ncs new file mode 100644 index 000000000..892ecb2c5 Binary files /dev/null and b/nwnds_module/olm_nibenay_cv.ncs differ diff --git a/nwnds_module/olm_nibenay_cv.nss b/nwnds_module/olm_nibenay_cv.nss new file mode 100644 index 000000000..1886ef209 --- /dev/null +++ b/nwnds_module/olm_nibenay_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_nibenay", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_north_ledopo.dlg b/nwnds_module/olm_north_ledopo.dlg new file mode 100644 index 000000000..d0afceefa Binary files /dev/null and b/nwnds_module/olm_north_ledopo.dlg differ diff --git a/nwnds_module/olm_oasis1.dlg b/nwnds_module/olm_oasis1.dlg new file mode 100644 index 000000000..021eebc3f Binary files /dev/null and b/nwnds_module/olm_oasis1.dlg differ diff --git a/nwnds_module/olm_oasis1_cv.ncs b/nwnds_module/olm_oasis1_cv.ncs new file mode 100644 index 000000000..004f09db4 Binary files /dev/null and b/nwnds_module/olm_oasis1_cv.ncs differ diff --git a/nwnds_module/olm_oasis1_cv.nss b/nwnds_module/olm_oasis1_cv.nss new file mode 100644 index 000000000..2cbac7f48 --- /dev/null +++ b/nwnds_module/olm_oasis1_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis1", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis2.dlg b/nwnds_module/olm_oasis2.dlg new file mode 100644 index 000000000..d17ab6586 Binary files /dev/null and b/nwnds_module/olm_oasis2.dlg differ diff --git a/nwnds_module/olm_oasis2_cv.ncs b/nwnds_module/olm_oasis2_cv.ncs new file mode 100644 index 000000000..6e4ca8a5d Binary files /dev/null and b/nwnds_module/olm_oasis2_cv.ncs differ diff --git a/nwnds_module/olm_oasis2_cv.nss b/nwnds_module/olm_oasis2_cv.nss new file mode 100644 index 000000000..ff64783c5 --- /dev/null +++ b/nwnds_module/olm_oasis2_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis2", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis3.dlg b/nwnds_module/olm_oasis3.dlg new file mode 100644 index 000000000..021eebc3f Binary files /dev/null and b/nwnds_module/olm_oasis3.dlg differ diff --git a/nwnds_module/olm_oasis3_cv.ncs b/nwnds_module/olm_oasis3_cv.ncs new file mode 100644 index 000000000..2f3384132 Binary files /dev/null and b/nwnds_module/olm_oasis3_cv.ncs differ diff --git a/nwnds_module/olm_oasis3_cv.nss b/nwnds_module/olm_oasis3_cv.nss new file mode 100644 index 000000000..20f8c5fdd --- /dev/null +++ b/nwnds_module/olm_oasis3_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis3", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis4.dlg b/nwnds_module/olm_oasis4.dlg new file mode 100644 index 000000000..021eebc3f Binary files /dev/null and b/nwnds_module/olm_oasis4.dlg differ diff --git a/nwnds_module/olm_oasis4_cv.ncs b/nwnds_module/olm_oasis4_cv.ncs new file mode 100644 index 000000000..2ae38ebd8 Binary files /dev/null and b/nwnds_module/olm_oasis4_cv.ncs differ diff --git a/nwnds_module/olm_oasis4_cv.nss b/nwnds_module/olm_oasis4_cv.nss new file mode 100644 index 000000000..c4ccca261 --- /dev/null +++ b/nwnds_module/olm_oasis4_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis4", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis5.dlg b/nwnds_module/olm_oasis5.dlg new file mode 100644 index 000000000..121e15690 Binary files /dev/null and b/nwnds_module/olm_oasis5.dlg differ diff --git a/nwnds_module/olm_oasis5_cv.ncs b/nwnds_module/olm_oasis5_cv.ncs new file mode 100644 index 000000000..54b25b4d9 Binary files /dev/null and b/nwnds_module/olm_oasis5_cv.ncs differ diff --git a/nwnds_module/olm_oasis5_cv.nss b/nwnds_module/olm_oasis5_cv.nss new file mode 100644 index 000000000..dbc549dbd --- /dev/null +++ b/nwnds_module/olm_oasis5_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis5", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis6.dlg b/nwnds_module/olm_oasis6.dlg new file mode 100644 index 000000000..021eebc3f Binary files /dev/null and b/nwnds_module/olm_oasis6.dlg differ diff --git a/nwnds_module/olm_oasis6_cv.ncs b/nwnds_module/olm_oasis6_cv.ncs new file mode 100644 index 000000000..ad3d47c69 Binary files /dev/null and b/nwnds_module/olm_oasis6_cv.ncs differ diff --git a/nwnds_module/olm_oasis6_cv.nss b/nwnds_module/olm_oasis6_cv.nss new file mode 100644 index 000000000..7c9415d3a --- /dev/null +++ b/nwnds_module/olm_oasis6_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_oasis6", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_oasis6b.dlg b/nwnds_module/olm_oasis6b.dlg new file mode 100644 index 000000000..27e466692 Binary files /dev/null and b/nwnds_module/olm_oasis6b.dlg differ diff --git a/nwnds_module/olm_ogo.dlg b/nwnds_module/olm_ogo.dlg new file mode 100644 index 000000000..6c2a8b0da Binary files /dev/null and b/nwnds_module/olm_ogo.dlg differ diff --git a/nwnds_module/olm_ogo_cv.ncs b/nwnds_module/olm_ogo_cv.ncs new file mode 100644 index 000000000..174b086c6 Binary files /dev/null and b/nwnds_module/olm_ogo_cv.ncs differ diff --git a/nwnds_module/olm_ogo_cv.nss b/nwnds_module/olm_ogo_cv.nss new file mode 100644 index 000000000..649e27f00 --- /dev/null +++ b/nwnds_module/olm_ogo_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_ogo", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_out_19.dlg b/nwnds_module/olm_out_19.dlg new file mode 100644 index 000000000..e20f3eaf6 Binary files /dev/null and b/nwnds_module/olm_out_19.dlg differ diff --git a/nwnds_module/olm_out_19_cv.ncs b/nwnds_module/olm_out_19_cv.ncs new file mode 100644 index 000000000..d2351fa06 Binary files /dev/null and b/nwnds_module/olm_out_19_cv.ncs differ diff --git a/nwnds_module/olm_out_19_cv.nss b/nwnds_module/olm_out_19_cv.nss new file mode 100644 index 000000000..7900946a8 --- /dev/null +++ b/nwnds_module/olm_out_19_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_out_19", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_passgithcave.ncs b/nwnds_module/olm_passgithcave.ncs new file mode 100644 index 000000000..ca0d5a948 Binary files /dev/null and b/nwnds_module/olm_passgithcave.ncs differ diff --git a/nwnds_module/olm_passgithcave.nss b/nwnds_module/olm_passgithcave.nss new file mode 100644 index 000000000..aea382c8a --- /dev/null +++ b/nwnds_module/olm_passgithcave.nss @@ -0,0 +1,22 @@ +void main() +{ + +//object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN); +object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE); + +if (IsInConversation(OBJECT_SELF) || GetIsInCombat()) return; + +if (GetLocalInt(oPC, "PASSED_GITH_CAVE") < 0) + return; + +object oTarget; +object oSpawn; +location lTarget; +oTarget = GetWaypointByTag("wp_plc_githcave"); + +lTarget = GetLocation(oTarget); + +oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "olm_plc_githcave", lTarget); + +} + diff --git a/nwnds_module/olm_prist_tow.dlg b/nwnds_module/olm_prist_tow.dlg new file mode 100644 index 000000000..101ed995b Binary files /dev/null and b/nwnds_module/olm_prist_tow.dlg differ diff --git a/nwnds_module/olm_prist_tow_cv.ncs b/nwnds_module/olm_prist_tow_cv.ncs new file mode 100644 index 000000000..055e2dbea Binary files /dev/null and b/nwnds_module/olm_prist_tow_cv.ncs differ diff --git a/nwnds_module/olm_prist_tow_cv.nss b/nwnds_module/olm_prist_tow_cv.nss new file mode 100644 index 000000000..1268c7ad2 --- /dev/null +++ b/nwnds_module/olm_prist_tow_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_prist_tow", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_raam.dlg b/nwnds_module/olm_raam.dlg new file mode 100644 index 000000000..2a07c00c4 Binary files /dev/null and b/nwnds_module/olm_raam.dlg differ diff --git a/nwnds_module/olm_raam_cv.ncs b/nwnds_module/olm_raam_cv.ncs new file mode 100644 index 000000000..f32517faf Binary files /dev/null and b/nwnds_module/olm_raam_cv.ncs differ diff --git a/nwnds_module/olm_raam_cv.nss b/nwnds_module/olm_raam_cv.nss new file mode 100644 index 000000000..0834ab433 --- /dev/null +++ b/nwnds_module/olm_raam_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_raam", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_ring_mount.dlg b/nwnds_module/olm_ring_mount.dlg new file mode 100644 index 000000000..3b15a356a Binary files /dev/null and b/nwnds_module/olm_ring_mount.dlg differ diff --git a/nwnds_module/olm_s_led.dlg b/nwnds_module/olm_s_led.dlg new file mode 100644 index 000000000..c41554a7b Binary files /dev/null and b/nwnds_module/olm_s_led.dlg differ diff --git a/nwnds_module/olm_s_led_cv.ncs b/nwnds_module/olm_s_led_cv.ncs new file mode 100644 index 000000000..52ae6426a Binary files /dev/null and b/nwnds_module/olm_s_led_cv.ncs differ diff --git a/nwnds_module/olm_s_led_cv.nss b/nwnds_module/olm_s_led_cv.nss new file mode 100644 index 000000000..64b91cd9c --- /dev/null +++ b/nwnds_module/olm_s_led_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_s_led", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_salt_view.dlg b/nwnds_module/olm_salt_view.dlg new file mode 100644 index 000000000..de7690a1a Binary files /dev/null and b/nwnds_module/olm_salt_view.dlg differ diff --git a/nwnds_module/olm_salt_view_cv.ncs b/nwnds_module/olm_salt_view_cv.ncs new file mode 100644 index 000000000..3339fc5e2 Binary files /dev/null and b/nwnds_module/olm_salt_view_cv.ncs differ diff --git a/nwnds_module/olm_salt_view_cv.nss b/nwnds_module/olm_salt_view_cv.nss new file mode 100644 index 000000000..2c7d2cbaf --- /dev/null +++ b/nwnds_module/olm_salt_view_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_salt_view", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_samarah.dlg b/nwnds_module/olm_samarah.dlg new file mode 100644 index 000000000..f63894e41 Binary files /dev/null and b/nwnds_module/olm_samarah.dlg differ diff --git a/nwnds_module/olm_samarah_cv.ncs b/nwnds_module/olm_samarah_cv.ncs new file mode 100644 index 000000000..d0b347d36 Binary files /dev/null and b/nwnds_module/olm_samarah_cv.ncs differ diff --git a/nwnds_module/olm_samarah_cv.nss b/nwnds_module/olm_samarah_cv.nss new file mode 100644 index 000000000..babf62fbd --- /dev/null +++ b/nwnds_module/olm_samarah_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_samarah", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_shazlim.dlg b/nwnds_module/olm_shazlim.dlg new file mode 100644 index 000000000..185e80ae3 Binary files /dev/null and b/nwnds_module/olm_shazlim.dlg differ diff --git a/nwnds_module/olm_shazlim_cv.ncs b/nwnds_module/olm_shazlim_cv.ncs new file mode 100644 index 000000000..27c833568 Binary files /dev/null and b/nwnds_module/olm_shazlim_cv.ncs differ diff --git a/nwnds_module/olm_shazlim_cv.nss b/nwnds_module/olm_shazlim_cv.nss new file mode 100644 index 000000000..56b8c62b1 --- /dev/null +++ b/nwnds_module/olm_shazlim_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_shazlim", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_shifttokled.dlg b/nwnds_module/olm_shifttokled.dlg new file mode 100644 index 000000000..e60467bd5 Binary files /dev/null and b/nwnds_module/olm_shifttokled.dlg differ diff --git a/nwnds_module/olm_shifttospy.dlg b/nwnds_module/olm_shifttospy.dlg new file mode 100644 index 000000000..e53c9ff56 Binary files /dev/null and b/nwnds_module/olm_shifttospy.dlg differ diff --git a/nwnds_module/olm_silver_sp.dlg b/nwnds_module/olm_silver_sp.dlg new file mode 100644 index 000000000..12249b22c Binary files /dev/null and b/nwnds_module/olm_silver_sp.dlg differ diff --git a/nwnds_module/olm_silver_sp_cv.ncs b/nwnds_module/olm_silver_sp_cv.ncs new file mode 100644 index 000000000..e346a9b63 Binary files /dev/null and b/nwnds_module/olm_silver_sp_cv.ncs differ diff --git a/nwnds_module/olm_silver_sp_cv.nss b/nwnds_module/olm_silver_sp_cv.nss new file mode 100644 index 000000000..af3621b24 --- /dev/null +++ b/nwnds_module/olm_silver_sp_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_silver_sp", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_smug_rest.dlg b/nwnds_module/olm_smug_rest.dlg new file mode 100644 index 000000000..d9a67a86e Binary files /dev/null and b/nwnds_module/olm_smug_rest.dlg differ diff --git a/nwnds_module/olm_smug_rest_cv.ncs b/nwnds_module/olm_smug_rest_cv.ncs new file mode 100644 index 000000000..5c475135b Binary files /dev/null and b/nwnds_module/olm_smug_rest_cv.ncs differ diff --git a/nwnds_module/olm_smug_rest_cv.nss b/nwnds_module/olm_smug_rest_cv.nss new file mode 100644 index 000000000..24cbc68f1 --- /dev/null +++ b/nwnds_module/olm_smug_rest_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_smug_rest", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_south_ledopo.dlg b/nwnds_module/olm_south_ledopo.dlg new file mode 100644 index 000000000..9c9a46e06 Binary files /dev/null and b/nwnds_module/olm_south_ledopo.dlg differ diff --git a/nwnds_module/olm_spytoec.dlg b/nwnds_module/olm_spytoec.dlg new file mode 100644 index 000000000..c2f37f12d Binary files /dev/null and b/nwnds_module/olm_spytoec.dlg differ diff --git a/nwnds_module/olm_spytoshift.dlg b/nwnds_module/olm_spytoshift.dlg new file mode 100644 index 000000000..d6d0088d9 Binary files /dev/null and b/nwnds_module/olm_spytoshift.dlg differ diff --git a/nwnds_module/olm_spytotra1.dlg b/nwnds_module/olm_spytotra1.dlg new file mode 100644 index 000000000..fd06505af Binary files /dev/null and b/nwnds_module/olm_spytotra1.dlg differ diff --git a/nwnds_module/olm_ssotoolm.dlg b/nwnds_module/olm_ssotoolm.dlg new file mode 100644 index 000000000..7d0bc0ac5 Binary files /dev/null and b/nwnds_module/olm_ssotoolm.dlg differ diff --git a/nwnds_module/olm_ssototgrs.dlg b/nwnds_module/olm_ssototgrs.dlg new file mode 100644 index 000000000..bb9b107d9 Binary files /dev/null and b/nwnds_module/olm_ssototgrs.dlg differ diff --git a/nwnds_module/olm_ssotouktr.dlg b/nwnds_module/olm_ssotouktr.dlg new file mode 100644 index 000000000..2e2063c18 Binary files /dev/null and b/nwnds_module/olm_ssotouktr.dlg differ diff --git a/nwnds_module/olm_suns_home.dlg b/nwnds_module/olm_suns_home.dlg new file mode 100644 index 000000000..0369eae60 Binary files /dev/null and b/nwnds_module/olm_suns_home.dlg differ diff --git a/nwnds_module/olm_suns_home_cv.ncs b/nwnds_module/olm_suns_home_cv.ncs new file mode 100644 index 000000000..56c37463c Binary files /dev/null and b/nwnds_module/olm_suns_home_cv.ncs differ diff --git a/nwnds_module/olm_suns_home_cv.nss b/nwnds_module/olm_suns_home_cv.nss new file mode 100644 index 000000000..225324083 --- /dev/null +++ b/nwnds_module/olm_suns_home_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_suns_home", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tarelon.dlg b/nwnds_module/olm_tarelon.dlg new file mode 100644 index 000000000..396b5a452 Binary files /dev/null and b/nwnds_module/olm_tarelon.dlg differ diff --git a/nwnds_module/olm_tarelon_cv.ncs b/nwnds_module/olm_tarelon_cv.ncs new file mode 100644 index 000000000..1f07671ad Binary files /dev/null and b/nwnds_module/olm_tarelon_cv.ncs differ diff --git a/nwnds_module/olm_tarelon_cv.nss b/nwnds_module/olm_tarelon_cv.nss new file mode 100644 index 000000000..ec2a5bbec --- /dev/null +++ b/nwnds_module/olm_tarelon_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tarelon", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tbastotbdd.dlg b/nwnds_module/olm_tbastotbdd.dlg new file mode 100644 index 000000000..627712a28 Binary files /dev/null and b/nwnds_module/olm_tbastotbdd.dlg differ diff --git a/nwnds_module/olm_tbastotbgs.dlg b/nwnds_module/olm_tbastotbgs.dlg new file mode 100644 index 000000000..d470da023 Binary files /dev/null and b/nwnds_module/olm_tbastotbgs.dlg differ diff --git a/nwnds_module/olm_tbcbtotbdd.dlg b/nwnds_module/olm_tbcbtotbdd.dlg new file mode 100644 index 000000000..627712a28 Binary files /dev/null and b/nwnds_module/olm_tbcbtotbdd.dlg differ diff --git a/nwnds_module/olm_tbddtotbas.dlg b/nwnds_module/olm_tbddtotbas.dlg new file mode 100644 index 000000000..202b1ecb0 Binary files /dev/null and b/nwnds_module/olm_tbddtotbas.dlg differ diff --git a/nwnds_module/olm_tbddtotbcb.dlg b/nwnds_module/olm_tbddtotbcb.dlg new file mode 100644 index 000000000..5feb847e0 Binary files /dev/null and b/nwnds_module/olm_tbddtotbcb.dlg differ diff --git a/nwnds_module/olm_tbgptotbgs.dlg b/nwnds_module/olm_tbgptotbgs.dlg new file mode 100644 index 000000000..d470da023 Binary files /dev/null and b/nwnds_module/olm_tbgptotbgs.dlg differ diff --git a/nwnds_module/olm_tbgptotfts.dlg b/nwnds_module/olm_tbgptotfts.dlg new file mode 100644 index 000000000..2f48ef0c7 Binary files /dev/null and b/nwnds_module/olm_tbgptotfts.dlg differ diff --git a/nwnds_module/olm_tbgstotbas.dlg b/nwnds_module/olm_tbgstotbas.dlg new file mode 100644 index 000000000..202b1ecb0 Binary files /dev/null and b/nwnds_module/olm_tbgstotbas.dlg differ diff --git a/nwnds_module/olm_tbgstotbgp.dlg b/nwnds_module/olm_tbgstotbgp.dlg new file mode 100644 index 000000000..d9ab905d1 Binary files /dev/null and b/nwnds_module/olm_tbgstotbgp.dlg differ diff --git a/nwnds_module/olm_tblgdtotbls.dlg b/nwnds_module/olm_tblgdtotbls.dlg new file mode 100644 index 000000000..e41a1abc6 Binary files /dev/null and b/nwnds_module/olm_tblgdtotbls.dlg differ diff --git a/nwnds_module/olm_tblstotblgd.dlg b/nwnds_module/olm_tblstotblgd.dlg new file mode 100644 index 000000000..05a680676 Binary files /dev/null and b/nwnds_module/olm_tblstotblgd.dlg differ diff --git a/nwnds_module/olm_tftstotbgpe.dlg b/nwnds_module/olm_tftstotbgpe.dlg new file mode 100644 index 000000000..a457c7c06 Binary files /dev/null and b/nwnds_module/olm_tftstotbgpe.dlg differ diff --git a/nwnds_module/olm_tfttotfts.dlg b/nwnds_module/olm_tfttotfts.dlg new file mode 100644 index 000000000..de649201f Binary files /dev/null and b/nwnds_module/olm_tfttotfts.dlg differ diff --git a/nwnds_module/olm_tfttotgdc.dlg b/nwnds_module/olm_tfttotgdc.dlg new file mode 100644 index 000000000..6fc52343f Binary files /dev/null and b/nwnds_module/olm_tfttotgdc.dlg differ diff --git a/nwnds_module/olm_tfttsotftn.dlg b/nwnds_module/olm_tfttsotftn.dlg new file mode 100644 index 000000000..75fb9ce60 Binary files /dev/null and b/nwnds_module/olm_tfttsotftn.dlg differ diff --git a/nwnds_module/olm_tg_spyre.dlg b/nwnds_module/olm_tg_spyre.dlg new file mode 100644 index 000000000..dfff859bc Binary files /dev/null and b/nwnds_module/olm_tg_spyre.dlg differ diff --git a/nwnds_module/olm_tg_spyre1.dlg b/nwnds_module/olm_tg_spyre1.dlg new file mode 100644 index 000000000..dee28461b Binary files /dev/null and b/nwnds_module/olm_tg_spyre1.dlg differ diff --git a/nwnds_module/olm_tg_spyre1_cv.ncs b/nwnds_module/olm_tg_spyre1_cv.ncs new file mode 100644 index 000000000..c6c78c2aa Binary files /dev/null and b/nwnds_module/olm_tg_spyre1_cv.ncs differ diff --git a/nwnds_module/olm_tg_spyre1_cv.nss b/nwnds_module/olm_tg_spyre1_cv.nss new file mode 100644 index 000000000..bfc32aeab --- /dev/null +++ b/nwnds_module/olm_tg_spyre1_cv.nss @@ -0,0 +1,9 @@ +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tg_spyre1", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tg_spyre2_cv.ncs b/nwnds_module/olm_tg_spyre2_cv.ncs new file mode 100644 index 000000000..2eceee8de Binary files /dev/null and b/nwnds_module/olm_tg_spyre2_cv.ncs differ diff --git a/nwnds_module/olm_tg_spyre2_cv.nss b/nwnds_module/olm_tg_spyre2_cv.nss new file mode 100644 index 000000000..766fe134a --- /dev/null +++ b/nwnds_module/olm_tg_spyre2_cv.nss @@ -0,0 +1,10 @@ + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tg_spyre", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tgbstosso.dlg b/nwnds_module/olm_tgbstosso.dlg new file mode 100644 index 000000000..36238d58e Binary files /dev/null and b/nwnds_module/olm_tgbstosso.dlg differ diff --git a/nwnds_module/olm_tgbstotgrs.dlg b/nwnds_module/olm_tgbstotgrs.dlg new file mode 100644 index 000000000..32dd1e6ba Binary files /dev/null and b/nwnds_module/olm_tgbstotgrs.dlg differ diff --git a/nwnds_module/olm_tgctogd.dlg b/nwnds_module/olm_tgctogd.dlg new file mode 100644 index 000000000..9510cbf8a Binary files /dev/null and b/nwnds_module/olm_tgctogd.dlg differ diff --git a/nwnds_module/olm_tgctotsp.dlg b/nwnds_module/olm_tgctotsp.dlg new file mode 100644 index 000000000..92cd2adc9 Binary files /dev/null and b/nwnds_module/olm_tgctotsp.dlg differ diff --git a/nwnds_module/olm_tgdctotft.dlg b/nwnds_module/olm_tgdctotft.dlg new file mode 100644 index 000000000..f7c2a7a47 Binary files /dev/null and b/nwnds_module/olm_tgdctotft.dlg differ diff --git a/nwnds_module/olm_tgrstonc.dlg b/nwnds_module/olm_tgrstonc.dlg new file mode 100644 index 000000000..6abf0ddf2 Binary files /dev/null and b/nwnds_module/olm_tgrstonc.dlg differ diff --git a/nwnds_module/olm_tgrstotgbs.dlg b/nwnds_module/olm_tgrstotgbs.dlg new file mode 100644 index 000000000..00b7f11b9 Binary files /dev/null and b/nwnds_module/olm_tgrstotgbs.dlg differ diff --git a/nwnds_module/olm_tgwntoec.dlg b/nwnds_module/olm_tgwntoec.dlg new file mode 100644 index 000000000..911817704 Binary files /dev/null and b/nwnds_module/olm_tgwntoec.dlg differ diff --git a/nwnds_module/olm_tgwntogd.dlg b/nwnds_module/olm_tgwntogd.dlg new file mode 100644 index 000000000..9510cbf8a Binary files /dev/null and b/nwnds_module/olm_tgwntogd.dlg differ diff --git a/nwnds_module/olm_tgwtoec.dlg b/nwnds_module/olm_tgwtoec.dlg new file mode 100644 index 000000000..bb17fb8b2 Binary files /dev/null and b/nwnds_module/olm_tgwtoec.dlg differ diff --git a/nwnds_module/olm_tgwtonc.dlg b/nwnds_module/olm_tgwtonc.dlg new file mode 100644 index 000000000..6abf0ddf2 Binary files /dev/null and b/nwnds_module/olm_tgwtonc.dlg differ diff --git a/nwnds_module/olm_tm_palace.dlg b/nwnds_module/olm_tm_palace.dlg new file mode 100644 index 000000000..2b4b3f759 Binary files /dev/null and b/nwnds_module/olm_tm_palace.dlg differ diff --git a/nwnds_module/olm_tm_palace_cv.ncs b/nwnds_module/olm_tm_palace_cv.ncs new file mode 100644 index 000000000..ec2d60040 Binary files /dev/null and b/nwnds_module/olm_tm_palace_cv.ncs differ diff --git a/nwnds_module/olm_tm_palace_cv.nss b/nwnds_module/olm_tm_palace_cv.nss new file mode 100644 index 000000000..217aa7ff9 --- /dev/null +++ b/nwnds_module/olm_tm_palace_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tm_palace", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tmtntovlss.dlg b/nwnds_module/olm_tmtntovlss.dlg new file mode 100644 index 000000000..75e2aa336 Binary files /dev/null and b/nwnds_module/olm_tmtntovlss.dlg differ diff --git a/nwnds_module/olm_tmttotmsp.dlg b/nwnds_module/olm_tmttotmsp.dlg new file mode 100644 index 000000000..9adb85088 Binary files /dev/null and b/nwnds_module/olm_tmttotmsp.dlg differ diff --git a/nwnds_module/olm_tmttotspn.dlg b/nwnds_module/olm_tmttotspn.dlg new file mode 100644 index 000000000..106c1b312 Binary files /dev/null and b/nwnds_module/olm_tmttotspn.dlg differ diff --git a/nwnds_module/olm_trade1tospy.dlg b/nwnds_module/olm_trade1tospy.dlg new file mode 100644 index 000000000..e53c9ff56 Binary files /dev/null and b/nwnds_module/olm_trade1tospy.dlg differ diff --git a/nwnds_module/olm_tspntotmt.dlg b/nwnds_module/olm_tspntotmt.dlg new file mode 100644 index 000000000..12b4ad1cf Binary files /dev/null and b/nwnds_module/olm_tspntotmt.dlg differ diff --git a/nwnds_module/olm_tspntotsps.dlg b/nwnds_module/olm_tspntotsps.dlg new file mode 100644 index 000000000..92cd2adc9 Binary files /dev/null and b/nwnds_module/olm_tspntotsps.dlg differ diff --git a/nwnds_module/olm_tspstotspn.dlg b/nwnds_module/olm_tspstotspn.dlg new file mode 100644 index 000000000..106c1b312 Binary files /dev/null and b/nwnds_module/olm_tspstotspn.dlg differ diff --git a/nwnds_module/olm_tsptotc.dlg b/nwnds_module/olm_tsptotc.dlg new file mode 100644 index 000000000..8ea81a193 Binary files /dev/null and b/nwnds_module/olm_tsptotc.dlg differ diff --git a/nwnds_module/olm_tyr.dlg b/nwnds_module/olm_tyr.dlg new file mode 100644 index 000000000..25b0bcdbc Binary files /dev/null and b/nwnds_module/olm_tyr.dlg differ diff --git a/nwnds_module/olm_tyr_cv.ncs b/nwnds_module/olm_tyr_cv.ncs new file mode 100644 index 000000000..3040f508f Binary files /dev/null and b/nwnds_module/olm_tyr_cv.ncs differ diff --git a/nwnds_module/olm_tyr_cv.nss b/nwnds_module/olm_tyr_cv.nss new file mode 100644 index 000000000..07e1a6a5c --- /dev/null +++ b/nwnds_module/olm_tyr_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tyr", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tyr_field_cv.ncs b/nwnds_module/olm_tyr_field_cv.ncs new file mode 100644 index 000000000..9be8ee586 Binary files /dev/null and b/nwnds_module/olm_tyr_field_cv.ncs differ diff --git a/nwnds_module/olm_tyr_field_cv.nss b/nwnds_module/olm_tyr_field_cv.nss new file mode 100644 index 000000000..ba83ad7dc --- /dev/null +++ b/nwnds_module/olm_tyr_field_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tyr_fields", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tyr_fields.dlg b/nwnds_module/olm_tyr_fields.dlg new file mode 100644 index 000000000..6ae208c12 Binary files /dev/null and b/nwnds_module/olm_tyr_fields.dlg differ diff --git a/nwnds_module/olm_tyr_im_cv.ncs b/nwnds_module/olm_tyr_im_cv.ncs new file mode 100644 index 000000000..6cb3cb2a0 Binary files /dev/null and b/nwnds_module/olm_tyr_im_cv.ncs differ diff --git a/nwnds_module/olm_tyr_im_cv.nss b/nwnds_module/olm_tyr_im_cv.nss new file mode 100644 index 000000000..d7f35fc7a --- /dev/null +++ b/nwnds_module/olm_tyr_im_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tyr_iron_m", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_tyr_iron_m.dlg b/nwnds_module/olm_tyr_iron_m.dlg new file mode 100644 index 000000000..0a30effcb Binary files /dev/null and b/nwnds_module/olm_tyr_iron_m.dlg differ diff --git a/nwnds_module/olm_tyr_se.dlg b/nwnds_module/olm_tyr_se.dlg new file mode 100644 index 000000000..6ae208c12 Binary files /dev/null and b/nwnds_module/olm_tyr_se.dlg differ diff --git a/nwnds_module/olm_tyr_se1.dlg b/nwnds_module/olm_tyr_se1.dlg new file mode 100644 index 000000000..0b4fc34d1 Binary files /dev/null and b/nwnds_module/olm_tyr_se1.dlg differ diff --git a/nwnds_module/olm_tyr_se2.dlg b/nwnds_module/olm_tyr_se2.dlg new file mode 100644 index 000000000..3c5b70032 Binary files /dev/null and b/nwnds_module/olm_tyr_se2.dlg differ diff --git a/nwnds_module/olm_tyr_valley.dlg b/nwnds_module/olm_tyr_valley.dlg new file mode 100644 index 000000000..68e897e70 Binary files /dev/null and b/nwnds_module/olm_tyr_valley.dlg differ diff --git a/nwnds_module/olm_tyrftowdb.dlg b/nwnds_module/olm_tyrftowdb.dlg new file mode 100644 index 000000000..bbd919fe6 Binary files /dev/null and b/nwnds_module/olm_tyrftowdb.dlg differ diff --git a/nwnds_module/olm_tyrrtoolm.dlg b/nwnds_module/olm_tyrrtoolm.dlg new file mode 100644 index 000000000..7d0bc0ac5 Binary files /dev/null and b/nwnds_module/olm_tyrrtoolm.dlg differ diff --git a/nwnds_module/olm_tyrrtoolm_cv.ncs b/nwnds_module/olm_tyrrtoolm_cv.ncs new file mode 100644 index 000000000..9cd88ee6b Binary files /dev/null and b/nwnds_module/olm_tyrrtoolm_cv.ncs differ diff --git a/nwnds_module/olm_tyrrtoolm_cv.nss b/nwnds_module/olm_tyrrtoolm_cv.nss new file mode 100644 index 000000000..8020731a0 --- /dev/null +++ b/nwnds_module/olm_tyrrtoolm_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_tyrrtoolm", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_ukt1toukt2.dlg b/nwnds_module/olm_ukt1toukt2.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt1toukt2.dlg differ diff --git a/nwnds_module/olm_ukt2toukt1.dlg b/nwnds_module/olm_ukt2toukt1.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt2toukt1.dlg differ diff --git a/nwnds_module/olm_ukt2toukt3.dlg b/nwnds_module/olm_ukt2toukt3.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt2toukt3.dlg differ diff --git a/nwnds_module/olm_ukt3toukt2.dlg b/nwnds_module/olm_ukt3toukt2.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt3toukt2.dlg differ diff --git a/nwnds_module/olm_ukt3toukt4.dlg b/nwnds_module/olm_ukt3toukt4.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt3toukt4.dlg differ diff --git a/nwnds_module/olm_ukt3toukt5.dlg b/nwnds_module/olm_ukt3toukt5.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt3toukt5.dlg differ diff --git a/nwnds_module/olm_ukt4toukt3.dlg b/nwnds_module/olm_ukt4toukt3.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt4toukt3.dlg differ diff --git a/nwnds_module/olm_ukt5toukt3.dlg b/nwnds_module/olm_ukt5toukt3.dlg new file mode 100644 index 000000000..27d3a2fc0 Binary files /dev/null and b/nwnds_module/olm_ukt5toukt3.dlg differ diff --git a/nwnds_module/olm_ukttosso.dlg b/nwnds_module/olm_ukttosso.dlg new file mode 100644 index 000000000..25e0cb439 Binary files /dev/null and b/nwnds_module/olm_ukttosso.dlg differ diff --git a/nwnds_module/olm_urfields1.dlg b/nwnds_module/olm_urfields1.dlg new file mode 100644 index 000000000..c163bd457 Binary files /dev/null and b/nwnds_module/olm_urfields1.dlg differ diff --git a/nwnds_module/olm_urfields2.dlg b/nwnds_module/olm_urfields2.dlg new file mode 100644 index 000000000..7d0bc0ac5 Binary files /dev/null and b/nwnds_module/olm_urfields2.dlg differ diff --git a/nwnds_module/olm_urik.dlg b/nwnds_module/olm_urik.dlg new file mode 100644 index 000000000..53e6db11e Binary files /dev/null and b/nwnds_module/olm_urik.dlg differ diff --git a/nwnds_module/olm_urik_cv.ncs b/nwnds_module/olm_urik_cv.ncs new file mode 100644 index 000000000..88bbfcbb4 Binary files /dev/null and b/nwnds_module/olm_urik_cv.ncs differ diff --git a/nwnds_module/olm_urik_cv.nss b/nwnds_module/olm_urik_cv.nss new file mode 100644 index 000000000..6a35889da --- /dev/null +++ b/nwnds_module/olm_urik_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_urik", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_urtradrt5.dlg b/nwnds_module/olm_urtradrt5.dlg new file mode 100644 index 000000000..b7c15842e Binary files /dev/null and b/nwnds_module/olm_urtradrt5.dlg differ diff --git a/nwnds_module/olm_vlsstovlsw.dlg b/nwnds_module/olm_vlsstovlsw.dlg new file mode 100644 index 000000000..66ac12931 Binary files /dev/null and b/nwnds_module/olm_vlsstovlsw.dlg differ diff --git a/nwnds_module/olm_vlstotmts.dlg b/nwnds_module/olm_vlstotmts.dlg new file mode 100644 index 000000000..9adb85088 Binary files /dev/null and b/nwnds_module/olm_vlstotmts.dlg differ diff --git a/nwnds_module/olm_vlswtovlss.dlg b/nwnds_module/olm_vlswtovlss.dlg new file mode 100644 index 000000000..75e2aa336 Binary files /dev/null and b/nwnds_module/olm_vlswtovlss.dlg differ diff --git a/nwnds_module/olm_walis.dlg b/nwnds_module/olm_walis.dlg new file mode 100644 index 000000000..ef4dc45bc Binary files /dev/null and b/nwnds_module/olm_walis.dlg differ diff --git a/nwnds_module/olm_walis_cv.ncs b/nwnds_module/olm_walis_cv.ncs new file mode 100644 index 000000000..de19f99db Binary files /dev/null and b/nwnds_module/olm_walis_cv.ncs differ diff --git a/nwnds_module/olm_walis_cv.nss b/nwnds_module/olm_walis_cv.nss new file mode 100644 index 000000000..63717cb7c --- /dev/null +++ b/nwnds_module/olm_walis_cv.nss @@ -0,0 +1,18 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "olm_walis", TRUE, FALSE); +} + diff --git a/nwnds_module/olm_wdbctowdb.dlg b/nwnds_module/olm_wdbctowdb.dlg new file mode 100644 index 000000000..0fb4cc274 Binary files /dev/null and b/nwnds_module/olm_wdbctowdb.dlg differ diff --git a/nwnds_module/olm_wdbctowdb1.dlg b/nwnds_module/olm_wdbctowdb1.dlg new file mode 100644 index 000000000..0fb4cc274 Binary files /dev/null and b/nwnds_module/olm_wdbctowdb1.dlg differ diff --git a/nwnds_module/olm_wdbtors.dlg b/nwnds_module/olm_wdbtors.dlg new file mode 100644 index 000000000..a3d1672f7 Binary files /dev/null and b/nwnds_module/olm_wdbtors.dlg differ diff --git a/nwnds_module/olm_wdbtotyrf.dlg b/nwnds_module/olm_wdbtotyrf.dlg new file mode 100644 index 000000000..8d6cefaff Binary files /dev/null and b/nwnds_module/olm_wdbtotyrf.dlg differ diff --git a/nwnds_module/olm_wdbtowdbc.dlg b/nwnds_module/olm_wdbtowdbc.dlg new file mode 100644 index 000000000..1f847cbb2 Binary files /dev/null and b/nwnds_module/olm_wdbtowdbc.dlg differ diff --git a/nwnds_module/olm_wdbtowdbc1.dlg b/nwnds_module/olm_wdbtowdbc1.dlg new file mode 100644 index 000000000..e1a4c9374 Binary files /dev/null and b/nwnds_module/olm_wdbtowdbc1.dlg differ diff --git a/nwnds_module/olm_wdbtowdwp.dlg b/nwnds_module/olm_wdbtowdwp.dlg new file mode 100644 index 000000000..bba18d8c5 Binary files /dev/null and b/nwnds_module/olm_wdbtowdwp.dlg differ diff --git a/nwnds_module/olm_wdwptowdb.dlg b/nwnds_module/olm_wdwptowdb.dlg new file mode 100644 index 000000000..0fb4cc274 Binary files /dev/null and b/nwnds_module/olm_wdwptowdb.dlg differ diff --git a/nwnds_module/olm_yaramuke.dlg b/nwnds_module/olm_yaramuke.dlg new file mode 100644 index 000000000..445fb8e5d Binary files /dev/null and b/nwnds_module/olm_yaramuke.dlg differ diff --git a/nwnds_module/oncinderspawn.ncs b/nwnds_module/oncinderspawn.ncs new file mode 100644 index 000000000..c8fc81d94 Binary files /dev/null and b/nwnds_module/oncinderspawn.ncs differ diff --git a/nwnds_module/oncinderspawn.nss b/nwnds_module/oncinderspawn.nss new file mode 100644 index 000000000..d2f55be23 --- /dev/null +++ b/nwnds_module/oncinderspawn.nss @@ -0,0 +1,75 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + +// effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); +// eVis = SupernaturalEffect(eVis); +// eVis = ExtraordinaryEffect(eVis); +// ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + + effect eVis2 = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE); + eVis2 = SupernaturalEffect(eVis2); + eVis2 = ExtraordinaryEffect(eVis2); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis2,OBJECT_SELF); + + effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_COLD); + eShield = SupernaturalEffect(eShield); + eShield = ExtraordinaryEffect(eShield); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eShield,OBJECT_SELF); + +} diff --git a/nwnds_module/ondam.ncs b/nwnds_module/ondam.ncs new file mode 100644 index 000000000..8c87e56ef Binary files /dev/null and b/nwnds_module/ondam.ncs differ diff --git a/nwnds_module/ondam.nss b/nwnds_module/ondam.nss new file mode 100644 index 000000000..c208e9cf1 --- /dev/null +++ b/nwnds_module/ondam.nss @@ -0,0 +1,56 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_ondamage +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnDamaged script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + #include "nw_i0_generic" + +void main() +{ + //-------------------------------------------------------------------------- + // GZ: 2003-10-16 + // Make Plot Creatures Ignore Attacks + //-------------------------------------------------------------------------- + if (GetPlotFlag(OBJECT_SELF)) + { + return; + } + + //-------------------------------------------------------------------------- + // Execute old NWN default AI code + //-------------------------------------------------------------------------- + ExecuteScript("nw_c2_default6", OBJECT_SELF); + +{ + +{ + object oSpawn; + object oSelf = OBJECT_SELF; + + // Get the creature who triggered this event. + object oPC = GetLastHostileActor(); + + // Only fire once. + if ( GetLocalInt(OBJECT_SELF, "DO_ONCE") ) + return; + SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE); + + // Have us say something. + SpeakString("GUARDS, COME QUICK!"); + + // Spawn some critters. + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_GUARD001", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_GUARD001", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); +} +} +} diff --git a/nwnds_module/ondam_2.ncs b/nwnds_module/ondam_2.ncs new file mode 100644 index 000000000..78d9ef3f0 Binary files /dev/null and b/nwnds_module/ondam_2.ncs differ diff --git a/nwnds_module/ondam_2.nss b/nwnds_module/ondam_2.nss new file mode 100644 index 000000000..7cda0971f --- /dev/null +++ b/nwnds_module/ondam_2.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_ondamage +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnDamaged script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + #include "nw_i0_generic" + +void main() +{ + //-------------------------------------------------------------------------- + // GZ: 2003-10-16 + // Make Plot Creatures Ignore Attacks + //-------------------------------------------------------------------------- + if (GetPlotFlag(OBJECT_SELF)) + { + return; + } + + //-------------------------------------------------------------------------- + // Execute old NWN default AI code + //-------------------------------------------------------------------------- + ExecuteScript("nw_c2_default6", OBJECT_SELF); + +{ + +{ + object oSpawn; + object oSelf = OBJECT_SELF; + + // Get the creature who triggered this event. + object oPC = GetLastHostileActor(); + + // Only fire once. + if ( GetLocalInt(OBJECT_SELF, "DO_ONCE") ) + return; + SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE); + + // Have us say something. + SpeakString("GUARDS, COME QUICK!"); + + // Spawn some critters. + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_FENO", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_GOMAR", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_KATAR", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); + + oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NPC_SS_LYKLOR", GetLocation(oSelf)); + AssignCommand(oSpawn, DetermineCombatRound(oPC)); +} +} +} diff --git a/nwnds_module/ondeath_ancghast.ncs b/nwnds_module/ondeath_ancghast.ncs new file mode 100644 index 000000000..21989fee6 Binary files /dev/null and b/nwnds_module/ondeath_ancghast.ncs differ diff --git a/nwnds_module/ondeath_ancghast.nss b/nwnds_module/ondeath_ancghast.nss new file mode 100644 index 000000000..b72ac92b1 --- /dev/null +++ b/nwnds_module/ondeath_ancghast.nss @@ -0,0 +1,256 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_AncGhast +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Ancient Ghast's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 07 2012 +//::////////////////////////////////////////////// + + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void PartyGold(object oPC); + +void main() +{ + + 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + // initialise local variables + int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); + object oPC = GetLastKiller(); + while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + string sTagSelf = GetTag(OBJECT_SELF); + string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); + PartyGold(oPC); //Mindless undead = no ceramic. + AddJournalQuestEntry ("DeadsRevenge", 2, oPC); + AddJournalQuestEntry ("rottedparchment", 1, oPC); + + // check for correct kill task target and complete + if(sTagSelf == sTagTarget && nKillFlag == 1) { + SetLocalInt(oPC, "KILL_TASK_FLAG", 2); + AddJournalQuestEntry("kt_journal_01", 99, oPC); + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// + } +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_farrauk.ncs b/nwnds_module/ondeath_farrauk.ncs new file mode 100644 index 000000000..7e42eceb4 Binary files /dev/null and b/nwnds_module/ondeath_farrauk.ncs differ diff --git a/nwnds_module/ondeath_farrauk.nss b/nwnds_module/ondeath_farrauk.nss new file mode 100644 index 000000000..d385ab2c2 --- /dev/null +++ b/nwnds_module/ondeath_farrauk.nss @@ -0,0 +1,261 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Farrauk +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Farrauk's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: May 15 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "LostSouls") == 5) + { + AddJournalQuestEntry ("LostSouls", 6, oPC); + CreateItemOnObject("QST_FARRAUKSOUL", oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledDruid", 1); + SpeakString("The forest will eat you alive meat sack!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_ganglead.ncs b/nwnds_module/ondeath_ganglead.ncs new file mode 100644 index 000000000..e93cec099 Binary files /dev/null and b/nwnds_module/ondeath_ganglead.ncs differ diff --git a/nwnds_module/ondeath_ganglead.nss b/nwnds_module/ondeath_ganglead.nss new file mode 100644 index 000000000..df8fbf04b --- /dev/null +++ b/nwnds_module/ondeath_ganglead.nss @@ -0,0 +1,265 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_GangLead +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Gang Leader's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 06 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "TheTemplars") == 3) + { + AddJournalQuestEntry ("TheTemplars", 4, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledThugs", 1); + SpeakString("Damn all templar lackies! Argh!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_grignar.ncs b/nwnds_module/ondeath_grignar.ncs new file mode 100644 index 000000000..a6a6626ab Binary files /dev/null and b/nwnds_module/ondeath_grignar.ncs differ diff --git a/nwnds_module/ondeath_grignar.nss b/nwnds_module/ondeath_grignar.nss new file mode 100644 index 000000000..c9d2b159c --- /dev/null +++ b/nwnds_module/ondeath_grignar.nss @@ -0,0 +1,263 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Grignar +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Grignar's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: March 12 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables + +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); + +object oPC = GetLastKiller(); + +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); + +PartyGold(oPC); + +SpeakString("Curse you! They left me to die! They should starve!", TALKVOLUME_TALK); + +CreateItemOnObject("AR_KEY_STOREROOM", oPC); + +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d100(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_hejbrute.ncs b/nwnds_module/ondeath_hejbrute.ncs new file mode 100644 index 000000000..73dd47263 Binary files /dev/null and b/nwnds_module/ondeath_hejbrute.ncs differ diff --git a/nwnds_module/ondeath_hejbrute.nss b/nwnds_module/ondeath_hejbrute.nss new file mode 100644 index 000000000..c1b8b65d8 --- /dev/null +++ b/nwnds_module/ondeath_hejbrute.nss @@ -0,0 +1,266 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_HejBrute +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Hej-Kin Brute's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 06 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "HejkinRaiders") == 1) + { + AddJournalQuestEntry ("HejkinRaiders", 2, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledhejkin", 1); + SpeakString("*You recover the stolen Iron Shipment*", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +CreateItemOnObject("QST_STOLENIRON", 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_kimzahn.ncs b/nwnds_module/ondeath_kimzahn.ncs new file mode 100644 index 000000000..b7fa0ec6b Binary files /dev/null and b/nwnds_module/ondeath_kimzahn.ncs differ diff --git a/nwnds_module/ondeath_kimzahn.nss b/nwnds_module/ondeath_kimzahn.nss new file mode 100644 index 000000000..ec46d8381 --- /dev/null +++ b/nwnds_module/ondeath_kimzahn.nss @@ -0,0 +1,261 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Kimzahn +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Kimzahn's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 19 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "ds_hermitquest") == 2) + { + AddJournalQuestEntry ("ds_hermitquest", 3, oPC); + } +} + SpeakString("Y-you, The flames shall consume you!...", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d100(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_laskchf.ncs b/nwnds_module/ondeath_laskchf.ncs new file mode 100644 index 000000000..11119a6c9 Binary files /dev/null and b/nwnds_module/ondeath_laskchf.ncs differ diff --git a/nwnds_module/ondeath_laskchf.nss b/nwnds_module/ondeath_laskchf.nss new file mode 100644 index 000000000..fa8738d06 --- /dev/null +++ b/nwnds_module/ondeath_laskchf.nss @@ -0,0 +1,256 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_LaskChf +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Lask Chieftan's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 03 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +AddJournalQuestEntry ("p001", 2, oPC); + +CreateItemOnObject("QST_LASKCHFHEAD", oPC); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_martosa.ncs b/nwnds_module/ondeath_martosa.ncs new file mode 100644 index 000000000..2e99a0954 Binary files /dev/null and b/nwnds_module/ondeath_martosa.ncs differ diff --git a/nwnds_module/ondeath_martosa.nss b/nwnds_module/ondeath_martosa.nss new file mode 100644 index 000000000..936857931 --- /dev/null +++ b/nwnds_module/ondeath_martosa.nss @@ -0,0 +1,261 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Martosa +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Martosa's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 19 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "TheDraqomen") == 3) + { + AddJournalQuestEntry ("TheDraqomen", 4, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledThugs", 1); + SpeakString("Damn that bitch Selene! Argh!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_portek.ncs b/nwnds_module/ondeath_portek.ncs new file mode 100644 index 000000000..a1176595a Binary files /dev/null and b/nwnds_module/ondeath_portek.ncs differ diff --git a/nwnds_module/ondeath_portek.nss b/nwnds_module/ondeath_portek.nss new file mode 100644 index 000000000..9a68f739e --- /dev/null +++ b/nwnds_module/ondeath_portek.nss @@ -0,0 +1,260 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Portek +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Portek the Banshee's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 17 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "LostSouls") == 1) + { + AddJournalQuestEntry ("LostSouls", 2, oPC); + CreateItemOnObject("qst_porteksoul", oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledDruid", 1); + SpeakString("Noooo... my booze!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_rgwraith.ncs b/nwnds_module/ondeath_rgwraith.ncs new file mode 100644 index 000000000..ccd1bf07a Binary files /dev/null and b/nwnds_module/ondeath_rgwraith.ncs differ diff --git a/nwnds_module/ondeath_rgwraith.nss b/nwnds_module/ondeath_rgwraith.nss new file mode 100644 index 000000000..9764c7a65 --- /dev/null +++ b/nwnds_module/ondeath_rgwraith.nss @@ -0,0 +1,259 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_RegWraith +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Regretful Wraith's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 06 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +AddJournalQuestEntry ("rottedparchment", 4, oPC); +AddJournalQuestEntry ("jt_bloodletter", 1, oPC); +SpeakString("Thank you, I am now free from these cursed bonds. I beg of you, stop those who disturbed my rest! Take this key and track them down...you...must hurry...they must not release the full power of the Bloodletter...", TALKVOLUME_TALK); + +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_rumagon.ncs b/nwnds_module/ondeath_rumagon.ncs new file mode 100644 index 000000000..a7c6b6063 Binary files /dev/null and b/nwnds_module/ondeath_rumagon.ncs differ diff --git a/nwnds_module/ondeath_rumagon.nss b/nwnds_module/ondeath_rumagon.nss new file mode 100644 index 000000000..178c4a751 --- /dev/null +++ b/nwnds_module/ondeath_rumagon.nss @@ -0,0 +1,305 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Rumagon +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Rumagon's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: May 23 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void dsoCreateItemOnObject(string sItemTemplate, object oTarget = OBJECT_SELF, int nStackSize = 1) + { + // Make sure it's a blueprint by trimming to 16 and lowercasing it + // SpeakString("Will create item "+sItemTemplate+" stack "+IntToString(nStackSize)); + sItemTemplate = GetSubString(sItemTemplate, 0, 16); + sItemTemplate = GetStringLowerCase(sItemTemplate); + //SpeakString("Attempting to create item "+sItemTemplate+" stack "+IntToString(nStackSize)); + object oItem = CreateItemOnObject(sItemTemplate, oTarget, nStackSize); + } + + + +void main() +{ +{ +// initialise local variables +string sItem; +int nStackSize = 1; +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "jt_bloodletter") == 3) + { + AddJournalQuestEntry ("jt_bloodletter", 4, oPC); + } +} + SpeakString("Y-you never find The Bloodletter you...fool...", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + object oLastOpener = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC); + object oChest = GetNearestObjectByTag("BloodletterChest"); + if ((GetFirstItemInInventory(oChest) == OBJECT_INVALID) && (GetLocalInt(oLastOpener, "nGotBloodletter") != 1)){ + SetLocalInt(oLastOpener, "nGotBloodletter", 1); + // GenerateHighWeapon(oLastOpener,oChest); + int nRandom = d20(); + switch (nRandom) + { + case 1: sItem = "at_itpclk_ruby"; break; // Sister Ruby's Shawl + case 2: sItem = "ar_wswpgs_fire03"; break; // Imbued Greatsword + case 3: sItem = "ar_itmclk_lust"; break; // Defilers Lust + case 4: sItem = "ar_itmbts_speed"; break; // Sandals of Speed + case 5: sItem = "ar_helm_divcasq"; break; // Divine Casque + case 6: sItem = "ar_itmglv_defile"; break; // Defiler's Guantlets + case 7: sItem = "ar_wbwmsh_hearts"; break; // Heartseeker Bow + case 8: sItem = "ar_wamar_hrtskr"; nStackSize = 99; break; // 99 Heartseeker Arrows + case 9: sItem = "ar_apmdbp_isteel"; break; // Imbued Steel Breastplate + case 10: sItem = "ar_amhvhp_antiqu"; break; // Antique Plate Mail + case 11: sItem = "ar_helm_antique"; break; // Antique Helm + case 12: sItem = "ar_itmbts_shadow"; break; // Shadow Boots + case 13: sItem = "ar_waxpwk_imbued"; break; // Imbued Widow's Knife + case 14: sItem = "ar_wblmhl_numbsk"; break; // Numbskull + case 15: sItem = "ar_amclrb_underw"; break; // Robes of the Underworld + case 16: sItem = "ar_itmblt_champ"; break; // Champion's Buckle + case 17: sItem = "ar_wplmsc_moon"; break; // Scythe of the Moon + case 18: sItem = "ar_waxmgr_winpre"; break; // Winter's Prelude + case 19: sItem = "ar_itpglv_master"; break; // Villichi Master Gauntlets + case 20: sItem = "ar_itmglv_wizard"; break; // Preserver's Gloves + + } + dsoCreateItemOnObject(sItem,oChest,nStackSize); + SetLocked(oChest,TRUE); +} + +} + 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_sarrick.ncs b/nwnds_module/ondeath_sarrick.ncs new file mode 100644 index 000000000..87894617f Binary files /dev/null and b/nwnds_module/ondeath_sarrick.ncs differ diff --git a/nwnds_module/ondeath_sarrick.nss b/nwnds_module/ondeath_sarrick.nss new file mode 100644 index 000000000..68fe0c626 --- /dev/null +++ b/nwnds_module/ondeath_sarrick.nss @@ -0,0 +1,260 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Sarrick +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Sarrick the Theif's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 19 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "TheTemplars") == 8) + { + AddJournalQuestEntry ("TheTemplars", 9, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledThugs", 1); + SpeakString("Damn you templar lackies! Argh!!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/ondeath_sligboss.ncs b/nwnds_module/ondeath_sligboss.ncs new file mode 100644 index 000000000..15099d489 Binary files /dev/null and b/nwnds_module/ondeath_sligboss.ncs differ diff --git a/nwnds_module/ondeath_sligboss.nss b/nwnds_module/ondeath_sligboss.nss new file mode 100644 index 000000000..0377d67d8 --- /dev/null +++ b/nwnds_module/ondeath_sligboss.nss @@ -0,0 +1,265 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_SligBoss +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Slig Warrior's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 06 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "rottedparchment") == 1) + { + AddJournalQuestEntry ("rottedparchment", 2, oPC); + } +} +aSetPLocalInt(GetLastKiller(), "nKilledThugs", 1); + SpeakString("Argrgrgrhgh!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_tarek.ncs b/nwnds_module/ondeath_tarek.ncs new file mode 100644 index 000000000..ec1179eb0 Binary files /dev/null and b/nwnds_module/ondeath_tarek.ncs differ diff --git a/nwnds_module/ondeath_tarek.nss b/nwnds_module/ondeath_tarek.nss new file mode 100644 index 000000000..8e9cb83d1 --- /dev/null +++ b/nwnds_module/ondeath_tarek.nss @@ -0,0 +1,256 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Tarek +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + The Tarek Berzerker's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 06 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); +void ClearSlot(int iSlotID); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +AddJournalQuestEntry ("rottedparchment", 3, oPC); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + + } diff --git a/nwnds_module/ondeath_theor.ncs b/nwnds_module/ondeath_theor.ncs new file mode 100644 index 000000000..d15099606 Binary files /dev/null and b/nwnds_module/ondeath_theor.ncs differ diff --git a/nwnds_module/ondeath_theor.nss b/nwnds_module/ondeath_theor.nss new file mode 100644 index 000000000..5ee10f1aa --- /dev/null +++ b/nwnds_module/ondeath_theor.nss @@ -0,0 +1,261 @@ +//:://///////////////////////////////////////////// +//:: Name: OnDeath_Theor +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Kimzahn's OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: March 05 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" +#include "nw_j_assassin" + +void PartyGold(object oPC); + +void main() +{ +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } + if (!GetIsPC(oPC)) return; +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +{ + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "jt_banditleader") == 1) + { + AddJournalQuestEntry ("jt_banditleader", 2, oPC); + } +} + SpeakString("AARRRGHGHHH!!!!!", TALKVOLUME_TALK); +// check for correct kill task 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 ( !MySavingThrow(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 nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} + + void PartyGold(object oPC) + { + int nHD = GetHitDice(OBJECT_SELF); + int nGold = ((nHD - 3) * 4) + d100(); + + // This code shows how you can cycle through all the party members of the first PC + object oPartyMember = GetFirstFactionMember(oPC, TRUE); + int nMembers = 0; + while (GetIsObjectValid(oPartyMember) == TRUE) + { + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + + if (nMembers < 1) + nMembers = 1; + int nShare = (nGold / nMembers); + + oPartyMember = GetFirstFactionMember(oPC, TRUE); + while (GetIsObjectValid(oPartyMember) == TRUE) + { + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); + } + } diff --git a/nwnds_module/onent_wmts.ncs b/nwnds_module/onent_wmts.ncs new file mode 100644 index 000000000..affd670bd Binary files /dev/null and b/nwnds_module/onent_wmts.ncs differ diff --git a/nwnds_module/onent_wmts.nss b/nwnds_module/onent_wmts.nss new file mode 100644 index 000000000..8de4d25d8 --- /dev/null +++ b/nwnds_module/onent_wmts.nss @@ -0,0 +1,7 @@ +void main() +{ + object oPC = GetEnteringObject(); + if(!GetIsPC(oPC)) return; + + SetObjectVisualTransform(oPC, OBJECT_VISUAL_TRANSFORM_SCALE, 0.5f); +} diff --git a/nwnds_module/onent_wmts2.ncs b/nwnds_module/onent_wmts2.ncs new file mode 100644 index 000000000..7ba42b054 Binary files /dev/null and b/nwnds_module/onent_wmts2.ncs differ diff --git a/nwnds_module/onent_wmts2.nss b/nwnds_module/onent_wmts2.nss new file mode 100644 index 000000000..2dc4964f3 --- /dev/null +++ b/nwnds_module/onent_wmts2.nss @@ -0,0 +1,35 @@ +#include "spawn_functions" +#include "tgdc_explore_inc" +#include "ar_db_main" + + +void main() +{ + object oEntering = GetEnteringObject(); + string sTag = GetTag(oEntering); + + SetObjectVisualTransform(oEntering, OBJECT_VISUAL_TRANSFORM_SCALE, 0.5f); + + //NC:EDIT + //added to enable defiling aura on NPC's + //7-3-06 + object oArea = GetArea(oEntering); + SetLocalInt(oArea, "X2_L_WILD_MAGIC", 1); + //NC:EDIT + + //NC:EDIT + // added arsx area index to area + SetLocalInt(oArea,ARSX_AREA_INDEX,ARSX_IndexArea(oArea)); + + //Heatstroke's Edit + //Added code to enable player exploration + PlayerExplore(oEntering, 0); + + // Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat + // script to execute, the heartbeat duration, and a delay for the first + // heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as + // if it were called like: + Spawn_OnAreaEnter( "spawn_sample_hb", 6.0, 0.0 ); + +} + diff --git a/nwnds_module/onexit_wmts.ncs b/nwnds_module/onexit_wmts.ncs new file mode 100644 index 000000000..35c0aa061 Binary files /dev/null and b/nwnds_module/onexit_wmts.ncs differ diff --git a/nwnds_module/onexit_wmts.nss b/nwnds_module/onexit_wmts.nss new file mode 100644 index 000000000..2a5ceb42c --- /dev/null +++ b/nwnds_module/onexit_wmts.nss @@ -0,0 +1,41 @@ +#include "spawn_main" + +void CleanUpArea() +{ + if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0) + { + object oItem = GetFirstObjectInArea(); + int iObjectType; + while (GetIsObjectValid(oItem)) + { + iObjectType = GetObjectType(oItem); + switch(iObjectType) + { + case OBJECT_TYPE_PLACEABLE: + if (GetTag(oItem) == "Body Bag") + DestroyObject(oItem); + break; + case OBJECT_TYPE_ITEM: + DestroyObject(oItem); + break; + } + oItem = GetNextObjectInArea(); + } + } +} + +void main() +{ + object oPC = GetExitingObject(); + if(!GetIsPC(oPC)) return; + + SetObjectVisualTransform(oPC, OBJECT_VISUAL_TRANSFORM_SCALE, 1.0f); + + Spawn_OnAreaExit(); + if(GetLocalInt(OBJECT_SELF, SPAWN_PCS_IN_AREA) == 0) DelayCommand(300.0, CleanUpArea()); + //NC:EDIT + //Added to enable Defiling Aura for NPC's + object oEntering = GetExitingObject(); + SetLocalInt(GetArea(oEntering), "X2_L_WILD_MAGIC", 0); +} + diff --git a/nwnds_module/onheart_chkwpn.ncs b/nwnds_module/onheart_chkwpn.ncs new file mode 100644 index 000000000..698cbfb0e Binary files /dev/null and b/nwnds_module/onheart_chkwpn.ncs differ diff --git a/nwnds_module/onheart_chkwpn.nss b/nwnds_module/onheart_chkwpn.nss new file mode 100644 index 000000000..e647c99c0 --- /dev/null +++ b/nwnds_module/onheart_chkwpn.nss @@ -0,0 +1,202 @@ +//:://///////////////////////////////////////////// +//:: Weapon Check Guard v 1.0 +//:: On Heartbeat +//:: onheart_chkwpn +//::////////////////////////////////////////////// +/* +Guard will warn player with weapon in hand to put it away. +After a few warnings the guard will attack the offending player. +*/ +//::////////////////////////////////////////////// +//:: Created By: David "The Shadowlord" Corrales +//:: Created On: August 20 2002 +//::////////////////////////////////////////////// +//Edited by Dante -- clean up and ClearAllActions + +#include "NW_I0_GENERIC" + +//VARIABLES START - EDIT AT OWN PLEASURE + +float WARN_DISTANCE = 20.0;//Distance in which to spot player +float ANGER_DUR = 120.0; //Length of time (sec) that will remain angry at the pc +//END OF VARIABLES + +void main() +{ + ExecuteScript("prc_npc_hb", OBJECT_SELF); + int nMsg; + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF); + + if(oPC != OBJECT_INVALID && (GetDistanceBetween(OBJECT_SELF, oPC) < WARN_DISTANCE) && GetObjectSeen(oPC) && !GetIsEnemy(oPC)) + { + if(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC) != OBJECT_INVALID) + { + if(GetLocalObject(OBJECT_SELF, "LastOffender") == oPC) + { + if(GetLocalInt(OBJECT_SELF,"OffenseCount") == 2) + { + nMsg = d4(); + string ATTACK_MSG; + switch (nMsg) + { + case 1: ATTACK_MSG = "You where warned!!! Attack!!!"; break; + case 2: ATTACK_MSG = "That's it kank dung!!!"; break; + case 3: ATTACK_MSG = "I'll pry your weapon from your dead hand!!!"; break; + case 4: ATTACK_MSG = "Templars attack!!!"; break; + } + SpeakString(ATTACK_MSG); + SetIsTemporaryEnemy(oPC,OBJECT_SELF,TRUE,ANGER_DUR); + AssignCommand(OBJECT_SELF, ClearAllActions()); + AssignCommand(OBJECT_SELF, ActionAttack(oPC)); + } + else if(GetLocalInt(OBJECT_SELF, "OffenseCount") == 1) + { + nMsg = d4(); + string WARNING3; + switch (nMsg) + { + case 1: WARNING3 = "I will not tell you again! Put it away!"; break; + case 2: WARNING3 = "Disarm or die insolent kank!"; break; + case 3: WARNING3 = "Are you deaf slave? Disarm or die!"; break; + case 4: WARNING3 = "Comply or die!"; break; + } + ClearAllActions(); + AssignCommand(OBJECT_SELF, ActionMoveToObject(oPC, TRUE)); + SetLocalInt(OBJECT_SELF, "OffenseCount", 2); + SpeakString(WARNING3); + } + else + { + nMsg = d4(); + string WARNING2; + switch (nMsg) + { + case 1: WARNING2 = "I said put away your weapon!"; break; + case 2: WARNING2 = "Put away your weapon! You risk death!"; break; + case 3: WARNING2 = "Put away your weapon or I'll cut you!"; break; + case 4: WARNING2 = "Obey my command and sheath your arms!"; break; + } + SetLocalInt(OBJECT_SELF, "OffenseCount", 1); + SpeakString(WARNING2); + } + } + else + { + nMsg = d4(); + string WARNING1; + switch (nMsg) + { + case 1: WARNING1 = "This is not a combat zone, put away your weapon."; break; + case 2: WARNING1 = "Secure your arms."; break; + case 3: WARNING1 = "Exposed weapons are not allowed here"; break; + case 4: WARNING1 = "Carrying a weapon in Tyr will get you hurt"; break; + } + SetLocalInt(OBJECT_SELF, "OffenseCount", 0); + SpeakString(WARNING1); + SetLocalObject(OBJECT_SELF, "LastOffender", oPC); + } + } + else + { + if(GetLocalObject(OBJECT_SELF, "LastOffender") != OBJECT_INVALID) + { + nMsg = d4(); + string COMPLY_REPLY; + switch (nMsg) + { + case 1: COMPLY_REPLY = "Smart move slave."; break; + case 2: COMPLY_REPLY = "Thats more like it, I guess I wont bust your head."; break; + case 3: COMPLY_REPLY = "Thats better."; break; + case 4: COMPLY_REPLY = "Lets not see anymore of that."; break; + } + SpeakString(COMPLY_REPLY); + } + DeleteLocalObject(OBJECT_SELF, "LastOffender"); + SetLocalInt(OBJECT_SELF, "OffenseCount", 0); + } + } + + if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY)) + { + if(TalentAdvancedBuff(40.0)) + { + SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE); + return; + } + } + + if(GetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING)) + { + int nDay = FALSE; + if(GetIsDay() || GetIsDawn()) + { + nDay = TRUE; + } + if(GetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT") != nDay) + { + if(nDay == TRUE) + { + SetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", TRUE); + } + else + { + SetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", FALSE); + } + WalkWayPoints(); + } + } + + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) + { + if(!GetIsPostOrWalking()) + { + if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + if(!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) + { + if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) && !IsInConversation(OBJECT_SELF)) + { + if(GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) + { + PlayMobileAmbientAnimations(); + } + else if(GetIsEncounterCreature() && + !GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) + { + PlayMobileAmbientAnimations(); + } + else if(GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) && + !GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))) + { + PlayImmobileAmbientAnimations(); + } + } + else + { + DetermineSpecialBehavior(); + } + } + else + { + //DetermineCombatRound(); + } + } + } + } + else + { + if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT)) + { + effect eVis = EffectVisualEffect(VFX_IMP_SLEEP); + if(d10() > 6) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + } + } + } + + if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1001)); + } +} diff --git a/nwnds_module/onhit_split.ncs b/nwnds_module/onhit_split.ncs new file mode 100644 index 000000000..0327554e7 Binary files /dev/null and b/nwnds_module/onhit_split.ncs differ diff --git a/nwnds_module/onhit_split.nss b/nwnds_module/onhit_split.nss new file mode 100644 index 000000000..6175bdc91 --- /dev/null +++ b/nwnds_module/onhit_split.nss @@ -0,0 +1,141 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT6 +//:: Default OnDamaged handler +/* +If already fighting then ignore, else determine +combat round +*/ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// +/* Modified by Seth and Ursul for oozes. +* +* Seths Script did not check for base weapon slashing damage, only "additional" slashing damage. +* This was because "GetDamageDealtByType" appears to not reflect base weapon damage. +*/ + +#include "nw_i0_generic" + + +// Return TRUE if weapon does slashing damage +// Uses Get2DAString + +int GetDoesSlashingDamage(object oWeapon) + { + int nBaseItemNumber = GetBaseItemType(oWeapon); + int nBaseWeaponType = StringToInt(Get2DAString("baseitems","WeaponType",nBaseItemNumber)); + + SpeakString("Item Number " + IntToString(nBaseItemNumber), TALKVOLUME_SILENT_TALK); + SpeakString("Type " +IntToString(nBaseWeaponType), TALKVOLUME_SILENT_TALK); + + return (nBaseWeaponType); + } + +void checkSplit() + { + object oAttacker = GetLastDamager(); + object oWeapon = GetLastWeaponUsed (oAttacker); + int nSlashing = GetDoesSlashingDamage(oWeapon); + + int nCurrentHP = GetCurrentHitPoints(); // Creatures current HPs + int nDamageToExisting = nCurrentHP / 2; + int nDamageToNew = GetMaxHitPoints() - nCurrentHP; + + effect eDamageExisting = EffectDamage(nDamageToExisting,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_NORMAL); + effect eDamageNew = EffectDamage(nDamageToNew,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_NORMAL); + + // 3 = Axe, 4 = sword + if ((nSlashing == 3) || (nSlashing == 4)) + { + if (nCurrentHP > 10) + { + + DelayCommand(0.75,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect + (VFX_IMP_LIGHTNING_S),GetLocation(OBJECT_SELF))); + + DelayCommand(1.25,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect + (VFX_IMP_BREACH),GetLocation(OBJECT_SELF))); + object oNew = CreateObject(OBJECT_TYPE_CREATURE, GetResRef(OBJECT_SELF),GetLocation(OBJECT_SELF)); + + DelayCommand(0.75,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect + (VFX_IMP_LIGHTNING_S),GetLocation(oNew))); + + DelayCommand(1.25,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect + (VFX_IMP_BREACH),GetLocation(oNew))); + + DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamageExisting, OBJECT_SELF,0.0)); + DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamageNew, oNew,0.0)); + + } // end if CurrentHP + } // end if Slashing + + } // end function + + +void main() + { + if(GetFleeToExit()) + { + // We're supposed to run away, do nothing + } else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) + { + // don't do anything? + } else + { + object oDamager = GetLastDamager(); + + //Check to see if Jelly should split due to slashing damage. + checkSplit(); + +if (!GetIsObjectValid(oDamager)) { +// don't do anything, we don't have a valid damager +} else if (!GetIsFighting(OBJECT_SELF)) { +// If we're not fighting, determine combat round +if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { +DetermineSpecialBehavior(oDamager); +} else { +if(!GetObjectSeen(oDamager) +&& GetArea(OBJECT_SELF) == GetArea(oDamager)) { +// We don't see our attacker, go find them +ActionMoveToLocation(GetLocation(oDamager), TRUE); +ActionDoCommand(DetermineCombatRound()); +} else { +DetermineCombatRound(); +} +} +} else { +// We are fighting already -- consider switching if we've been +// attacked by a more powerful enemy +object oTarget = GetAttackTarget(); +if (!GetIsObjectValid(oTarget)) +oTarget = GetAttemptedAttackTarget(); +if (!GetIsObjectValid(oTarget)) +oTarget = GetAttemptedSpellTarget(); +// If our target isn't valid +// or our damager has just dealt us 25% or more +// of our hp in damager +// or our damager is more than 2HD more powerful than our target +// switch to attack the damager. +if (!GetIsObjectValid(oTarget) +|| ( +oTarget != oDamager +&& ( +GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) +|| (GetHitDice(oDamager) - 2) > GetHitDice(oTarget) +) +) +) +{ +// Switch targets +DetermineCombatRound(oDamager); +} +} +} +// Send the user-defined event signal +if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT)) +{ +SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED)); +} +} diff --git a/nwnds_module/onperc_grignar.ncs b/nwnds_module/onperc_grignar.ncs new file mode 100644 index 000000000..6fec205cd Binary files /dev/null and b/nwnds_module/onperc_grignar.ncs differ diff --git a/nwnds_module/onperc_grignar.nss b/nwnds_module/onperc_grignar.nss new file mode 100644 index 000000000..198df271d --- /dev/null +++ b/nwnds_module/onperc_grignar.nss @@ -0,0 +1,35 @@ +//:://///////////////////////////////////////////// +//:: Name: OnPerc_Grignar +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Grignar's On Perception script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: March 12 2012 +//::////////////////////////////////////////////// + + +void main() +{ + ExecuteScript("prc_npc_percep", OBJECT_SELF); + ExecuteScript("nw_c2_default2", OBJECT_SELF); + + { + + object oPC = GetLastPerceived(); + if (!GetIsPC(oPC)) return; + + if (!GetLastPerceptionSeen()) return; + + int nInt; + nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYjt_takeout"); + + if (!(nInt < 2)) + return; + + ActionSpeakString("You! I can smell Belet and his miner filth on you! I shall feast on your bones and they shall starve!"); + + } +} diff --git a/nwnds_module/onperc_kimzahn.ncs b/nwnds_module/onperc_kimzahn.ncs new file mode 100644 index 000000000..07f72afc0 Binary files /dev/null and b/nwnds_module/onperc_kimzahn.ncs differ diff --git a/nwnds_module/onperc_kimzahn.nss b/nwnds_module/onperc_kimzahn.nss new file mode 100644 index 000000000..646b40ec0 --- /dev/null +++ b/nwnds_module/onperc_kimzahn.nss @@ -0,0 +1,33 @@ +//:://///////////////////////////////////////////// +//:: Name: OnPerc_Kimzahn +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Kimzahn's On Perception script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: February 18 2012 +//::////////////////////////////////////////////// + + +void main() +{ + ExecuteScript("prc_npc_percep", OBJECT_SELF); + ExecuteScript("nw_c2_default2", OBJECT_SELF); + + object oSeen = GetLastPerceived(); + int nCount2 = GetLocalInt(OBJECT_SELF,"SaidMyLine2"); + + nCount2 ++; + if (nCount2==1) + { + if (GetIsPC(oSeen)) + { + ActionSpeakString("I don't know who you are but I will not allow you to prevent me from destroying this vile Orb!"); + SetLocalInt(OBJECT_SELF,"SaidMyLine2",nCount2); + ActionWait(3.5); + ActionSpeakString(""); + } + } +} diff --git a/nwnds_module/onperc_martosa.ncs b/nwnds_module/onperc_martosa.ncs new file mode 100644 index 000000000..8eeb62a5f Binary files /dev/null and b/nwnds_module/onperc_martosa.ncs differ diff --git a/nwnds_module/onperc_martosa.nss b/nwnds_module/onperc_martosa.nss new file mode 100644 index 000000000..db0f8097b --- /dev/null +++ b/nwnds_module/onperc_martosa.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Name: OnPerc_Martosa +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Martosa the Thug's On Perception script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 19 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_battlecry_" +//////////////////////////// + + +void main() +{ + ExecuteScript("prc_npc_percep", OBJECT_SELF); + ExecuteScript("nw_c2_default2", OBJECT_SELF); + ActionSpeakString("An intruder! Get'em boys!"); + + // Necromancy 101 /// + DoBattleCry(); + ///////////////////// +} diff --git a/nwnds_module/onperc_sarrick.ncs b/nwnds_module/onperc_sarrick.ncs new file mode 100644 index 000000000..f6da61e0d Binary files /dev/null and b/nwnds_module/onperc_sarrick.ncs differ diff --git a/nwnds_module/onperc_sarrick.nss b/nwnds_module/onperc_sarrick.nss new file mode 100644 index 000000000..800b53fa0 --- /dev/null +++ b/nwnds_module/onperc_sarrick.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Name: OnPerc_Sarrick +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Sarrick the Theif's On Perception script +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 19 2012 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_battlecry_" +//////////////////////////// + + +void main() +{ + ExecuteScript("prc_npc_percep", OBJECT_SELF); + ExecuteScript("nw_c2_default2", OBJECT_SELF); + ActionSpeakString("Lookie what we've got here. Take them out!"); + + // Necromancy 101 /// + DoBattleCry(); + ///////////////////// +} diff --git a/nwnds_module/onrest.ncs b/nwnds_module/onrest.ncs new file mode 100644 index 000000000..aa0c1a43f Binary files /dev/null and b/nwnds_module/onrest.ncs differ diff --git a/nwnds_module/onrest.nss b/nwnds_module/onrest.nss new file mode 100644 index 000000000..3da7d0154 --- /dev/null +++ b/nwnds_module/onrest.nss @@ -0,0 +1,8 @@ +void main() +{ + object oPC=GetLastPCRested(); + + if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED) + ExecuteScript("lib_psionrest", GetLastPCRested()); + +} diff --git a/nwnds_module/onspawn_ab.ncs b/nwnds_module/onspawn_ab.ncs new file mode 100644 index 000000000..59fa10037 Binary files /dev/null and b/nwnds_module/onspawn_ab.ncs differ diff --git a/nwnds_module/onspawn_ab.nss b/nwnds_module/onspawn_ab.nss new file mode 100644 index 000000000..85c83b049 --- /dev/null +++ b/nwnds_module/onspawn_ab.nss @@ -0,0 +1,93 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + //modify to try fix aura effects. + //NC:EDIT + int nAOD = GetTag(OBJECT_SELF)=="AngelofDecay" ? TRUE : FALSE; + if(nAOD)ExecuteScript("rotaura",OBJECT_SELF); + int nPrism = GetTag(OBJECT_SELF)=="Prismasaurus" ? TRUE : FALSE; + if(nPrism)ExecuteScript("prism_aura",OBJECT_SELF); + int nDreamV = GetTag(OBJECT_SELF)=="DreamVestige" ? TRUE : FALSE; + if(nDreamV)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nCryptC = GetTag(OBJECT_SELF)=="CryptChanter" ? TRUE : FALSE; + if(nCryptC)ExecuteScript("DrainingMelody",OBJECT_SELF); + int nHunefer = GetTag(OBJECT_SELF)=="Hunefer" ? TRUE : FALSE; + if(nHunefer)ExecuteScript("fear2_aura",OBJECT_SELF); + int nPlagueBlight = GetTag(OBJECT_SELF)=="PlagueBlight" ? TRUE : FALSE; + if(nPlagueBlight)ExecuteScript("plagueaura",OBJECT_SELF); + int nBDrinker = GetTag(OBJECT_SELF)=="ar_brdrinker_001" ? TRUE : FALSE; + if(nBDrinker)ExecuteScript("airlessaura",OBJECT_SELF); + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + 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 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); + } + +} diff --git a/nwnds_module/onspawn_elvawen.ncs b/nwnds_module/onspawn_elvawen.ncs new file mode 100644 index 000000000..012ab05e3 Binary files /dev/null and b/nwnds_module/onspawn_elvawen.ncs differ diff --git a/nwnds_module/onspawn_elvawen.nss b/nwnds_module/onspawn_elvawen.nss new file mode 100644 index 000000000..33ee864a1 --- /dev/null +++ b/nwnds_module/onspawn_elvawen.nss @@ -0,0 +1,103 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 2003-07-28: Georg Zoeller: + + If you set a integer 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + + effect eFx1 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT); + effect eFx2 = EffectUltravision(); + effect eFx3 = EffectSeeInvisible(); + + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFx1,OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFx2,OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFx3,OBJECT_SELF); + + // 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 )); + } + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + + + /*effect eShield = EffectDamageShield(0,DAMAGE_BONUS_2d6,DAMAGE_TYPE_FIRE); + eShield = SupernaturalEffect(eShield); + eShield = ExtraordinaryEffect(eShield); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShield,OBJECT_SELF,HoursToSeconds(100)); + + effect eRegen = EffectRegenerate(30,6.0); + eRegen = SupernaturalEffect(eRegen); + eRegen = ExtraordinaryEffect(eRegen); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,OBJECT_SELF,HoursToSeconds(100)); */ + + 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 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); + } + +} diff --git a/nwnds_module/onspawn_flsnake1.ncs b/nwnds_module/onspawn_flsnake1.ncs new file mode 100644 index 000000000..bb9b6c7c8 Binary files /dev/null and b/nwnds_module/onspawn_flsnake1.ncs differ diff --git a/nwnds_module/onspawn_flsnake1.nss b/nwnds_module/onspawn_flsnake1.nss new file mode 100644 index 000000000..584cbbd36 --- /dev/null +++ b/nwnds_module/onspawn_flsnake1.nss @@ -0,0 +1,94 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + + + /*effect eShield = EffectDamageShield(0,DAMAGE_BONUS_1d6,DAMAGE_TYPE_FIRE); + eShield = SupernaturalEffect(eShield); + eShield = ExtraordinaryEffect(eShield); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShield,OBJECT_SELF,HoursToSeconds(100)); + + effect eRegen = EffectRegenerate(30,6.0); + eRegen = SupernaturalEffect(eRegen); + eRegen = ExtraordinaryEffect(eRegen); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,OBJECT_SELF,HoursToSeconds(100));*/ + + 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 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); + } + +} diff --git a/nwnds_module/onspawn_ghost.ncs b/nwnds_module/onspawn_ghost.ncs new file mode 100644 index 000000000..1c89a14c6 Binary files /dev/null and b/nwnds_module/onspawn_ghost.ncs differ diff --git a/nwnds_module/onspawn_ghost.nss b/nwnds_module/onspawn_ghost.nss new file mode 100644 index 000000000..36e2a1f9b --- /dev/null +++ b/nwnds_module/onspawn_ghost.nss @@ -0,0 +1,83 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,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 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); + } + +} diff --git a/nwnds_module/onspawn_glowblue.ncs b/nwnds_module/onspawn_glowblue.ncs new file mode 100644 index 000000000..867bd23da Binary files /dev/null and b/nwnds_module/onspawn_glowblue.ncs differ diff --git a/nwnds_module/onspawn_glowblue.nss b/nwnds_module/onspawn_glowblue.nss new file mode 100644 index 000000000..b12afa7ad --- /dev/null +++ b/nwnds_module/onspawn_glowblue.nss @@ -0,0 +1,95 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_LIGHT_BLUE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + + /* + effect eShield = EffectDamageShield(0,DAMAGE_BONUS_2d6,DAMAGE_TYPE_FIRE); + eShield = SupernaturalEffect(eShield); + eShield = ExtraordinaryEffect(eShield); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eShield,OBJECT_SELF,HoursToSeconds(100)); + + effect eRegen = EffectRegenerate(30,6.0); + eRegen = SupernaturalEffect(eRegen); + eRegen = ExtraordinaryEffect(eRegen); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,OBJECT_SELF,HoursToSeconds(100)); + */ + + 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 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); + } + +} diff --git a/nwnds_module/onspawn_iceskin.ncs b/nwnds_module/onspawn_iceskin.ncs new file mode 100644 index 000000000..9ba25089f Binary files /dev/null and b/nwnds_module/onspawn_iceskin.ncs differ diff --git a/nwnds_module/onspawn_iceskin.nss b/nwnds_module/onspawn_iceskin.nss new file mode 100644 index 000000000..ba65436a6 --- /dev/null +++ b/nwnds_module/onspawn_iceskin.nss @@ -0,0 +1,87 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + //modify to try fix on atropal aura effects. + //NC:EDIT + int nWwight = GetTag(OBJECT_SELF)=="Winterwight" ? TRUE : FALSE; + if(nWwight)ExecuteScript("ww_aura",OBJECT_SELF); + int nBBorn = GetTag(OBJECT_SELF)=="BLEAKBORN001" ? TRUE : FALSE; + if(nBBorn)ExecuteScript("bleakaura",OBJECT_SELF); + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_ICESKIN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,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 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); + } +} diff --git a/nwnds_module/onspawn_shadow.ncs b/nwnds_module/onspawn_shadow.ncs new file mode 100644 index 000000000..bf462562f Binary files /dev/null and b/nwnds_module/onspawn_shadow.ncs differ diff --git a/nwnds_module/onspawn_shadow.nss b/nwnds_module/onspawn_shadow.nss new file mode 100644 index 000000000..1bac8a1ba --- /dev/null +++ b/nwnds_module/onspawn_shadow.nss @@ -0,0 +1,96 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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 + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + // 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 )); + } + + /* 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); + } + //modify to try fix on Various Aura effects. + //NC:EDIT + int nAtropal = GetTag(OBJECT_SELF)=="ATROPAL001" ? TRUE : FALSE; + if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF); + int nNWalker = GetTag(OBJECT_SELF)=="Nightwalker" ? TRUE : FALSE; + if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nNCrawler = GetTag(OBJECT_SELF)=="Nightcrawler" ? TRUE : FALSE; + if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nVoidWraith = GetTag(OBJECT_SELF)=="Voidwraith" ? TRUE : FALSE; + if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF); + int AtropalScion = GetTag(OBJECT_SELF)=="AtropalScion" ? TRUE : FALSE; + if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF); + int nGhoul = GetTag(OBJECT_SELF)=="GHOUL001" ? TRUE : FALSE; + if(nGhoul)ExecuteScript("ghoul_stench",OBJECT_SELF); + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,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 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); + } +} + diff --git a/nwnds_module/onspawndancer.ncs b/nwnds_module/onspawndancer.ncs new file mode 100644 index 000000000..d6a1201b3 Binary files /dev/null and b/nwnds_module/onspawndancer.ncs differ diff --git a/nwnds_module/onspawndancer.nss b/nwnds_module/onspawndancer.nss new file mode 100644 index 000000000..ec5f1d52b --- /dev/null +++ b/nwnds_module/onspawndancer.nss @@ -0,0 +1,29 @@ +void main() +{ + +object oPC = GetLastPerceived(); + +if (!GetIsPC(oPC)) return; + +if (!GetLastPerceptionSeen()) return; +ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_BOW,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_BOW,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_BOW,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT,1.0); +ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0); +ActionPlayAnimation(ANIMATION_FIREFORGET_BOW,1.0); +} diff --git a/nwnds_module/onspwn_guards.ncs b/nwnds_module/onspwn_guards.ncs new file mode 100644 index 000000000..661fe796f Binary files /dev/null and b/nwnds_module/onspwn_guards.ncs differ diff --git a/nwnds_module/onspwn_guards.nss b/nwnds_module/onspwn_guards.nss new file mode 100644 index 000000000..bb9b803b4 --- /dev/null +++ b/nwnds_module/onspwn_guards.nss @@ -0,0 +1,109 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 2003-07-28: Georg Zoeller: + + If you set a integer 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + +#include "ms_name_inc" +#include "x2_inc_switches" +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + /* 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 nSkinColor; + nSkinColor = Random(12); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(20)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + ms_Nomenclature(OBJECT_SELF); + DelayCommand(1.0f, ms_Nomenclature(OBJECT_SELF)); + // AssignCommand(OBJECT_SELF, ActionRandomWalk()); +} diff --git a/nwnds_module/onyxsentarmor.uti b/nwnds_module/onyxsentarmor.uti new file mode 100644 index 000000000..f8d548c55 Binary files /dev/null and b/nwnds_module/onyxsentarmor.uti differ diff --git a/nwnds_module/oo_bw_reloot.ncs b/nwnds_module/oo_bw_reloot.ncs new file mode 100644 index 000000000..24282ebbf Binary files /dev/null and b/nwnds_module/oo_bw_reloot.ncs differ diff --git a/nwnds_module/oo_bw_reloot.nss b/nwnds_module/oo_bw_reloot.nss new file mode 100644 index 000000000..b8f73247e --- /dev/null +++ b/nwnds_module/oo_bw_reloot.nss @@ -0,0 +1,135 @@ +// create loot for random encounter areas, +// mostly healing potions, kits, etc. +// +// -Brian Watson + +void main() +{ + int nTreas = GetLocalInt(OBJECT_SELF, "nTreasure"); + + if (nTreas == 0) + { + // set default var's + int nHD = 1; + int nStack = 1; + string sBP; + int nItem; + + // determine who opened this container + object oOpener = GetLastOpenedBy(); + if (!GetIsObjectValid(oOpener)) + { + oOpener = GetLastKiller(); + } + if (GetIsObjectValid(oOpener)) + { + nHD = GetHitDice(oOpener); + } + + // randomize level for variable item generation (-9 to +9 HD) + int nLevelAdj = (d10(2) - 11); + int nModHD = nHD + nLevelAdj; + + // determine stack size + nStack = (d6() - 3); + if (nStack < 1) nStack = 1; // 1 to 3, with 1 most likely + + // determine random treasure + int nRandom = d100(); + if (nRandom <= 40) // 40% chance of healing kit + { + if (nModHD < 5) + { + sBP = "nw_it_medkit001"; // +1 + } + else if (nModHD < 15) + { + sBP = "nw_it_medkit002"; // +3 + } + else if (nModHD < 25) + { + sBP = "nw_it_medkit003"; // +6 + } + else + { + sBP = "nw_it_medkit004"; // +10 + } + } + else if (nRandom <= 80) // 40% chance of healing potion + { + if (nModHD < 0) + { + sBP = "nw_it_mpotion001"; // cure light + } + else if (nModHD < 10) + { + sBP = "nw_it_mpotion020"; // cure moderate + } + else if (nModHD < 20) + { + sBP = "nw_it_mpotion002"; // cure serious + } + else + { + sBP = "nw_it_mpotion003"; // cure critical + } + } + else if (nRandom <= 90) // 10% chance of ANY standard potion + { + nItem = (d20() + d6() - 1); // # from 1-25 determines potion + if (nItem < 24) + { + if (nItem < 10) + { + sBP = ("nw_it_mpotion00" + IntToString(nItem)); + } + else + { + sBP = ("nw_it_mpotion0" + IntToString(nItem)); + } + } + else if (nItem == 24) + { + sBP = "x2_it_mpotion001"; + } + else if (nItem == 25) + { + sBP = "x2_it_mpotion002"; + } + else + { + sBP = "nw_it_mpotion002"; // default to cure serious wounds + } + } + else // 10% chance of flask/grenade weapon + { + if (nModHD <= 20) // smaller reward + { + nItem = d8(); + if (nItem == 8) nItem = 5; // no item 8 + + sBP = ("x1_wmgrenade00" + IntToString(nItem)); + } + else // a bomb! + { + nRandom = d10(); + if (nRandom < 6) // 50% chance of + { + sBP = "x2_it_acidbomb"; // acid bomb + } + else // 50% chance of + { + sBP = "x2_it_firebomb"; // fire bomb + } + } + } + + if (sBP != "") // valid blueprint determined + { + CreateItemOnObject(sBP, OBJECT_SELF, nStack); + + // don't do this again + SetLocalInt(OBJECT_SELF, "nTreasure", 1); + } + } +} diff --git a/nwnds_module/oo_bw_reloot2.ncs b/nwnds_module/oo_bw_reloot2.ncs new file mode 100644 index 000000000..dc38740ab Binary files /dev/null and b/nwnds_module/oo_bw_reloot2.ncs differ diff --git a/nwnds_module/oo_bw_reloot2.nss b/nwnds_module/oo_bw_reloot2.nss new file mode 100644 index 000000000..cfc26dc40 --- /dev/null +++ b/nwnds_module/oo_bw_reloot2.nss @@ -0,0 +1,205 @@ +// create loot for random encounter areas, +// mostly healing potions, kits, etc. +// +// -Brian Watson + +void main() +{ + int nTreas = GetLocalInt(OBJECT_SELF, "nTreasure"); + + if (nTreas == 0) + { + // set default var's + int nHD = 1; + int nStack = 1; + string sBP; + int nItem; + + // determine who opened this container + object oOpener = GetLastOpenedBy(); + if (!GetIsObjectValid(oOpener)) + { + oOpener = GetLastKiller(); + } + if (GetIsObjectValid(oOpener)) + { + nHD = GetHitDice(oOpener); + } + + // randomize level for variable item generation (-9 to +9 HD) + int nLevelAdj = (d10(2) - 11); + int nModHD = nHD + nLevelAdj; + + // detemine random treasure item + int nRandom = d100(); // 10% chance of nothing + if (nRandom <= 40) // 40% chance of gold + { + sBP = "nw_it_gold001"; + + int nGoldHD = nModHD; + if (nGoldHD < 1) nGoldHD = 1; + + nStack = d20(nGoldHD); // 1-20 gp per modified character level + } + else if (nRandom <= 70) // 30% chance of gems + { + int nRandGem; + int nRandType = d3(); // 1-3 + + if (nModHD < 6) // common gems + { + if (nRandType == 1) nRandGem = d4(); // 1-4 + else if (nRandType == 2) nRandGem = 7; + else nRandGem = (13 + d2()); // 14-15 + + nStack = (d6(2) - 4); // common, 1-8 gems instead + } + else if (nModHD < 15) // rare + { + if (nRandType == 1) nRandGem = 10; + else if (nRandType == 2) nRandGem = 11; + else nRandGem = 13; + + nStack = (d6() - 3); // rare, 1-3 (66% chance of 1) + } + else if (nModHD < 23) + { + if (nRandType == 1) nRandGem = 5; + else if (nRandType == 2) nRandGem = 8; + else nRandGem = 9; + + nStack = (d6() - 4); // rare, 1-2 (83% chance of 1) + } + else + { + if (nRandType == 1) nRandGem = 6; + else if (nRandType == 2) nRandGem = 12; + else nRandGem = 5; + } + + string sBaseBP = "nw_it_gem00"; + if (nRandGem > 9) + { + sBaseBP = "nw_it_gem0"; + } + sBP = (sBaseBP + IntToString(nRandGem)); + } + else if (nRandom <= 90) // 20% chance of jewelry + { + nStack = (d6() - 3); + + if (nModHD < 3) + { + sBP = "nw_it_mring021"; // copper ring + } + else if (nModHD < 8) + { + sBP = "nw_it_mneck020"; // copper necklace + } + else if (nModHD < 13) + { + sBP = "nw_it_mring022"; // silver ring + } + else if (nModHD < 18) + { + sBP = "nw_it_mneck021"; // silver necklace + + } + else if (nModHD < 23) + { + sBP = "nw_it_mring023"; // gold ring + } + else + { + sBP = "nw_it_mneck022"; // gold necklace + } + } + + if (sBP != "") // valid blueprint determined, create treasure + { + if (nStack < 1) nStack = 1; + + CreateItemOnObject(sBP, OBJECT_SELF, nStack); + } + + // determine random healing item + nRandom = d100(); // 10% chance of nothing + if (nRandom <= 40) // 40% chance of healing kit + { + if (nModHD < 5) + { + sBP = "nw_it_medkit001"; // +1 + } + else if (nModHD < 15) + { + sBP = "nw_it_medkit002"; // +3 + } + else if (nModHD < 25) + { + sBP = "nw_it_medkit003"; // +6 + } + else + { + sBP = "nw_it_medkit004"; // +10 + } + } + else if (nRandom <= 80) // 40% chance of healing potion + { + if (nModHD < 0) + { + sBP = "nw_it_mpotion001"; // cure light + } + else if (nModHD < 10) + { + sBP = "nw_it_mpotion020"; // cure moderate + } + else if (nModHD < 20) + { + sBP = "nw_it_mpotion002"; // cure serious + } + else + { + sBP = "nw_it_mpotion003"; // cure critical + } + } + else if (nRandom <= 90) // 10% chance of ANY standard potion + { + nItem = (d20() + d6() - 1); // # from 1-25 determines potion + if (nItem < 24) + { + if (nItem < 10) + { + sBP = ("nw_it_mpotion00" + IntToString(nItem)); + } + else + { + sBP = ("nw_it_mpotion0" + IntToString(nItem)); + } + } + else if (nItem == 24) + { + sBP = "x2_it_mpotion001"; + } + else if (nItem == 25) + { + sBP = "x2_it_mpotion002"; + } + else + { + sBP = "nw_it_mpotion002"; // default to cure serious wounds + } + } + + if (sBP != "") // valid blueprint determined, create healing item + { + // determine stack size for healing/potion item + nStack = (d6() - 3); + if (nStack < 1) nStack = 1; // 1 to 3, with 1 most likely (66%) + + CreateItemOnObject(sBP, OBJECT_SELF, nStack); + } + + // don't do this again + SetLocalInt(OBJECT_SELF, "nTreasure", 1); + } +} diff --git a/nwnds_module/oots_belkar.utc b/nwnds_module/oots_belkar.utc new file mode 100644 index 000000000..64f7fddb1 Binary files /dev/null and b/nwnds_module/oots_belkar.utc differ diff --git a/nwnds_module/oots_durkon.utc b/nwnds_module/oots_durkon.utc new file mode 100644 index 000000000..d45532765 Binary files /dev/null and b/nwnds_module/oots_durkon.utc differ diff --git a/nwnds_module/oots_elan.utc b/nwnds_module/oots_elan.utc new file mode 100644 index 000000000..b32849ecf Binary files /dev/null and b/nwnds_module/oots_elan.utc differ diff --git a/nwnds_module/oots_haley.utc b/nwnds_module/oots_haley.utc new file mode 100644 index 000000000..f66356955 Binary files /dev/null and b/nwnds_module/oots_haley.utc differ diff --git a/nwnds_module/oots_roy.utc b/nwnds_module/oots_roy.utc new file mode 100644 index 000000000..21bec045b Binary files /dev/null and b/nwnds_module/oots_roy.utc differ diff --git a/nwnds_module/oots_thog.utc b/nwnds_module/oots_thog.utc new file mode 100644 index 000000000..c6c146ea2 Binary files /dev/null and b/nwnds_module/oots_thog.utc differ diff --git a/nwnds_module/oots_vaarsuvius.utc b/nwnds_module/oots_vaarsuvius.utc new file mode 100644 index 000000000..f45fc4d83 Binary files /dev/null and b/nwnds_module/oots_vaarsuvius.utc differ diff --git a/nwnds_module/oozecrystal_001.utc b/nwnds_module/oozecrystal_001.utc new file mode 100644 index 000000000..82a12874b Binary files /dev/null and b/nwnds_module/oozecrystal_001.utc differ diff --git a/nwnds_module/openearthstore.ncs b/nwnds_module/openearthstore.ncs new file mode 100644 index 000000000..e7e20e17a Binary files /dev/null and b/nwnds_module/openearthstore.ncs differ diff --git a/nwnds_module/openearthstore.nss b/nwnds_module/openearthstore.nss new file mode 100644 index 000000000..6aa47eda1 --- /dev/null +++ b/nwnds_module/openearthstore.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +object oTarget; +oTarget = GetObjectByTag("EarthMerchant"); + +OpenStore(oTarget, oPC, 0, 0); + +} diff --git a/nwnds_module/openlilara.ncs b/nwnds_module/openlilara.ncs new file mode 100644 index 000000000..c97323b36 Binary files /dev/null and b/nwnds_module/openlilara.ncs differ diff --git a/nwnds_module/openlilara.nss b/nwnds_module/openlilara.nss new file mode 100644 index 000000000..c3b40ccc1 --- /dev/null +++ b/nwnds_module/openlilara.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("lilarastore"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/openscrollshop.ncs b/nwnds_module/openscrollshop.ncs new file mode 100644 index 000000000..853b4bb32 Binary files /dev/null and b/nwnds_module/openscrollshop.ncs differ diff --git a/nwnds_module/openscrollshop.nss b/nwnds_module/openscrollshop.nss new file mode 100644 index 000000000..33854d999 --- /dev/null +++ b/nwnds_module/openscrollshop.nss @@ -0,0 +1,12 @@ +void main() +{ + object oStore = GetNearestObjectByTag("ScrollShop"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/openstore003.ncs b/nwnds_module/openstore003.ncs new file mode 100644 index 000000000..a02d3248f Binary files /dev/null and b/nwnds_module/openstore003.ncs differ diff --git a/nwnds_module/openstore003.nss b/nwnds_module/openstore003.nss new file mode 100644 index 000000000..1b9a292b8 --- /dev/null +++ b/nwnds_module/openstore003.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("MOCVENDOR"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/orb.ncs b/nwnds_module/orb.ncs new file mode 100644 index 000000000..caf6ecb0d Binary files /dev/null and b/nwnds_module/orb.ncs differ diff --git a/nwnds_module/orb.nss b/nwnds_module/orb.nss new file mode 100644 index 000000000..10111e5a3 --- /dev/null +++ b/nwnds_module/orb.nss @@ -0,0 +1,92 @@ + +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +oTarget = GetObjectByTag("orb"); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +int nInt; +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget)); + +oTarget = GetObjectByTag("orb"); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE), GetLocation(oTarget)); + +oTarget = GetObjectByTag("orb"); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DESTRUCTION), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DESTRUCTION), GetLocation(oTarget)); + +oTarget = GetObjectByTag("orb"); + +//Visual effects can't be applied to waypoints, so if it is a WP +//apply to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_STORM), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget)); + +string sDeny; + +if (!GetIsPC(oPC)) return; + +if (GetItemPossessedBy(oPC, "PH_KEY_DEADHEART")== OBJECT_INVALID) + { + sDeny="A booming voice resonates thru your head, Begone!"; + + SendMessageToPC(oPC, sDeny); + + return; + } + +location lTarget; +oTarget = GetWaypointByTag("DST_FromMorgue"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); + +oTarget = oPC; + +//Visual effects can't be applied to waypoints, so if it is a WP +//the VFX will be applied to the WP's location instead + +nInt = GetObjectType(oTarget); + +if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); +else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); + +} + diff --git a/nwnds_module/orbofancients.ncs b/nwnds_module/orbofancients.ncs new file mode 100644 index 000000000..fa10c1488 Binary files /dev/null and b/nwnds_module/orbofancients.ncs differ diff --git a/nwnds_module/orbofancients.nss b/nwnds_module/orbofancients.nss new file mode 100644 index 000000000..f82b9e9f3 --- /dev/null +++ b/nwnds_module/orbofancients.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName orbofancients +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/9/02 6:37:25 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "OrboftheAncients")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/otis.dlg b/nwnds_module/otis.dlg new file mode 100644 index 000000000..82436c059 Binary files /dev/null and b/nwnds_module/otis.dlg differ diff --git a/nwnds_module/otyughbite.uti b/nwnds_module/otyughbite.uti new file mode 100644 index 000000000..b4e2cc45c Binary files /dev/null and b/nwnds_module/otyughbite.uti differ diff --git a/nwnds_module/otyughslam.uti b/nwnds_module/otyughslam.uti new file mode 100644 index 000000000..5a25dae8b Binary files /dev/null and b/nwnds_module/otyughslam.uti differ diff --git a/nwnds_module/owlbearbite.uti b/nwnds_module/owlbearbite.uti new file mode 100644 index 000000000..e0edba5c1 Binary files /dev/null and b/nwnds_module/owlbearbite.uti differ diff --git a/nwnds_module/p001q001_action.ncs b/nwnds_module/p001q001_action.ncs new file mode 100644 index 000000000..210a475b4 Binary files /dev/null and b/nwnds_module/p001q001_action.ncs differ diff --git a/nwnds_module/p001q001_action.nss b/nwnds_module/p001q001_action.nss new file mode 100644 index 000000000..34942074a --- /dev/null +++ b/nwnds_module/p001q001_action.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName at_beletqset2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 1:37:34 AM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "nJustlQuest", 1); + +} diff --git a/nwnds_module/p00p00p00.are b/nwnds_module/p00p00p00.are new file mode 100644 index 000000000..954a1e70b Binary files /dev/null and b/nwnds_module/p00p00p00.are differ diff --git a/nwnds_module/p00p00p00.gic b/nwnds_module/p00p00p00.gic new file mode 100644 index 000000000..ac38c689b Binary files /dev/null and b/nwnds_module/p00p00p00.gic differ diff --git a/nwnds_module/p00p00p00.git b/nwnds_module/p00p00p00.git new file mode 100644 index 000000000..bdc519245 Binary files /dev/null and b/nwnds_module/p00p00p00.git differ diff --git a/nwnds_module/p00p01p00.are b/nwnds_module/p00p01p00.are new file mode 100644 index 000000000..6e8265cb0 Binary files /dev/null and b/nwnds_module/p00p01p00.are differ diff --git a/nwnds_module/p00p01p00.gic b/nwnds_module/p00p01p00.gic new file mode 100644 index 000000000..8566fa8cd Binary files /dev/null and b/nwnds_module/p00p01p00.gic differ diff --git a/nwnds_module/p00p01p00.git b/nwnds_module/p00p01p00.git new file mode 100644 index 000000000..e173d5fc1 Binary files /dev/null and b/nwnds_module/p00p01p00.git differ diff --git a/nwnds_module/p00p02p00.are b/nwnds_module/p00p02p00.are new file mode 100644 index 000000000..4a2237a3f Binary files /dev/null and b/nwnds_module/p00p02p00.are differ diff --git a/nwnds_module/p00p02p00.gic b/nwnds_module/p00p02p00.gic new file mode 100644 index 000000000..7995f1dcd Binary files /dev/null and b/nwnds_module/p00p02p00.gic differ diff --git a/nwnds_module/p00p02p00.git b/nwnds_module/p00p02p00.git new file mode 100644 index 000000000..f541e7c9d Binary files /dev/null and b/nwnds_module/p00p02p00.git differ diff --git a/nwnds_module/p00p03p00.are b/nwnds_module/p00p03p00.are new file mode 100644 index 000000000..e76dbd79d Binary files /dev/null and b/nwnds_module/p00p03p00.are differ diff --git a/nwnds_module/p00p03p00.gic b/nwnds_module/p00p03p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p00p03p00.gic differ diff --git a/nwnds_module/p00p03p00.git b/nwnds_module/p00p03p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p00p03p00.git differ diff --git a/nwnds_module/p00p04p00.are b/nwnds_module/p00p04p00.are new file mode 100644 index 000000000..5af4049b5 Binary files /dev/null and b/nwnds_module/p00p04p00.are differ diff --git a/nwnds_module/p00p04p00.gic b/nwnds_module/p00p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p00p04p00.gic differ diff --git a/nwnds_module/p00p04p00.git b/nwnds_module/p00p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p00p04p00.git differ diff --git a/nwnds_module/p00p05p00.are b/nwnds_module/p00p05p00.are new file mode 100644 index 000000000..cfb705da2 Binary files /dev/null and b/nwnds_module/p00p05p00.are differ diff --git a/nwnds_module/p00p05p00.gic b/nwnds_module/p00p05p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p00p05p00.gic differ diff --git a/nwnds_module/p00p05p00.git b/nwnds_module/p00p05p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p00p05p00.git differ diff --git a/nwnds_module/p00p06p00.are b/nwnds_module/p00p06p00.are new file mode 100644 index 000000000..39a76ccaf Binary files /dev/null and b/nwnds_module/p00p06p00.are differ diff --git a/nwnds_module/p00p06p00.gic b/nwnds_module/p00p06p00.gic new file mode 100644 index 000000000..a9371b087 Binary files /dev/null and b/nwnds_module/p00p06p00.gic differ diff --git a/nwnds_module/p00p06p00.git b/nwnds_module/p00p06p00.git new file mode 100644 index 000000000..fe6921149 Binary files /dev/null and b/nwnds_module/p00p06p00.git differ diff --git a/nwnds_module/p00p07p00.are b/nwnds_module/p00p07p00.are new file mode 100644 index 000000000..ad181695d Binary files /dev/null and b/nwnds_module/p00p07p00.are differ diff --git a/nwnds_module/p00p07p00.gic b/nwnds_module/p00p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p00p07p00.gic differ diff --git a/nwnds_module/p00p07p00.git b/nwnds_module/p00p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p00p07p00.git differ diff --git a/nwnds_module/p01n01p00.are b/nwnds_module/p01n01p00.are new file mode 100644 index 000000000..f2f499dba Binary files /dev/null and b/nwnds_module/p01n01p00.are differ diff --git a/nwnds_module/p01n01p00.gic b/nwnds_module/p01n01p00.gic new file mode 100644 index 000000000..8b32051f8 Binary files /dev/null and b/nwnds_module/p01n01p00.gic differ diff --git a/nwnds_module/p01n01p00.git b/nwnds_module/p01n01p00.git new file mode 100644 index 000000000..7f5fb41be Binary files /dev/null and b/nwnds_module/p01n01p00.git differ diff --git a/nwnds_module/p01n02p00.are b/nwnds_module/p01n02p00.are new file mode 100644 index 000000000..4979b4a7d Binary files /dev/null and b/nwnds_module/p01n02p00.are differ diff --git a/nwnds_module/p01n02p00.gic b/nwnds_module/p01n02p00.gic new file mode 100644 index 000000000..b71b5dadf Binary files /dev/null and b/nwnds_module/p01n02p00.gic differ diff --git a/nwnds_module/p01n02p00.git b/nwnds_module/p01n02p00.git new file mode 100644 index 000000000..150273bc8 Binary files /dev/null and b/nwnds_module/p01n02p00.git differ diff --git a/nwnds_module/p01n03p00.are b/nwnds_module/p01n03p00.are new file mode 100644 index 000000000..41c3aad4b Binary files /dev/null and b/nwnds_module/p01n03p00.are differ diff --git a/nwnds_module/p01n03p00.gic b/nwnds_module/p01n03p00.gic new file mode 100644 index 000000000..d7038505e Binary files /dev/null and b/nwnds_module/p01n03p00.gic differ diff --git a/nwnds_module/p01n03p00.git b/nwnds_module/p01n03p00.git new file mode 100644 index 000000000..48502523e Binary files /dev/null and b/nwnds_module/p01n03p00.git differ diff --git a/nwnds_module/p01n04p00.are b/nwnds_module/p01n04p00.are new file mode 100644 index 000000000..269e53cd5 Binary files /dev/null and b/nwnds_module/p01n04p00.are differ diff --git a/nwnds_module/p01n04p00.gic b/nwnds_module/p01n04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01n04p00.gic differ diff --git a/nwnds_module/p01n04p00.git b/nwnds_module/p01n04p00.git new file mode 100644 index 000000000..ce1453184 Binary files /dev/null and b/nwnds_module/p01n04p00.git differ diff --git a/nwnds_module/p01p00p00.are b/nwnds_module/p01p00p00.are new file mode 100644 index 000000000..ce8c43217 Binary files /dev/null and b/nwnds_module/p01p00p00.are differ diff --git a/nwnds_module/p01p00p00.gic b/nwnds_module/p01p00p00.gic new file mode 100644 index 000000000..12e344da3 Binary files /dev/null and b/nwnds_module/p01p00p00.gic differ diff --git a/nwnds_module/p01p00p00.git b/nwnds_module/p01p00p00.git new file mode 100644 index 000000000..be4b1d475 Binary files /dev/null and b/nwnds_module/p01p00p00.git differ diff --git a/nwnds_module/p01p01p00.are b/nwnds_module/p01p01p00.are new file mode 100644 index 000000000..48a9f3a5c Binary files /dev/null and b/nwnds_module/p01p01p00.are differ diff --git a/nwnds_module/p01p01p00.gic b/nwnds_module/p01p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01p01p00.gic differ diff --git a/nwnds_module/p01p01p00.git b/nwnds_module/p01p01p00.git new file mode 100644 index 000000000..13deed691 Binary files /dev/null and b/nwnds_module/p01p01p00.git differ diff --git a/nwnds_module/p01p02p00.are b/nwnds_module/p01p02p00.are new file mode 100644 index 000000000..839d9a25d Binary files /dev/null and b/nwnds_module/p01p02p00.are differ diff --git a/nwnds_module/p01p02p00.gic b/nwnds_module/p01p02p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01p02p00.gic differ diff --git a/nwnds_module/p01p02p00.git b/nwnds_module/p01p02p00.git new file mode 100644 index 000000000..48d61118e Binary files /dev/null and b/nwnds_module/p01p02p00.git differ diff --git a/nwnds_module/p01p03p00.are b/nwnds_module/p01p03p00.are new file mode 100644 index 000000000..c455a921f Binary files /dev/null and b/nwnds_module/p01p03p00.are differ diff --git a/nwnds_module/p01p03p00.gic b/nwnds_module/p01p03p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01p03p00.gic differ diff --git a/nwnds_module/p01p03p00.git b/nwnds_module/p01p03p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p01p03p00.git differ diff --git a/nwnds_module/p01p04p00.are b/nwnds_module/p01p04p00.are new file mode 100644 index 000000000..8022aa116 Binary files /dev/null and b/nwnds_module/p01p04p00.are differ diff --git a/nwnds_module/p01p04p00.gic b/nwnds_module/p01p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01p04p00.gic differ diff --git a/nwnds_module/p01p04p00.git b/nwnds_module/p01p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p01p04p00.git differ diff --git a/nwnds_module/p01p05p00.are b/nwnds_module/p01p05p00.are new file mode 100644 index 000000000..c4944ca5a Binary files /dev/null and b/nwnds_module/p01p05p00.are differ diff --git a/nwnds_module/p01p05p00.gic b/nwnds_module/p01p05p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p01p05p00.gic differ diff --git a/nwnds_module/p01p05p00.git b/nwnds_module/p01p05p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p01p05p00.git differ diff --git a/nwnds_module/p01p06p00.are b/nwnds_module/p01p06p00.are new file mode 100644 index 000000000..5d36423f9 Binary files /dev/null and b/nwnds_module/p01p06p00.are differ diff --git a/nwnds_module/p01p06p00.gic b/nwnds_module/p01p06p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p01p06p00.gic differ diff --git a/nwnds_module/p01p06p00.git b/nwnds_module/p01p06p00.git new file mode 100644 index 000000000..fdf107b4c Binary files /dev/null and b/nwnds_module/p01p06p00.git differ diff --git a/nwnds_module/p01p07p00.are b/nwnds_module/p01p07p00.are new file mode 100644 index 000000000..c8e6550a0 Binary files /dev/null and b/nwnds_module/p01p07p00.are differ diff --git a/nwnds_module/p01p07p00.gic b/nwnds_module/p01p07p00.gic new file mode 100644 index 000000000..5a3721d1f Binary files /dev/null and b/nwnds_module/p01p07p00.gic differ diff --git a/nwnds_module/p01p07p00.git b/nwnds_module/p01p07p00.git new file mode 100644 index 000000000..96d755d1f Binary files /dev/null and b/nwnds_module/p01p07p00.git differ diff --git a/nwnds_module/p02n01p00.are b/nwnds_module/p02n01p00.are new file mode 100644 index 000000000..6ae83db64 Binary files /dev/null and b/nwnds_module/p02n01p00.are differ diff --git a/nwnds_module/p02n01p00.gic b/nwnds_module/p02n01p00.gic new file mode 100644 index 000000000..ba8a2b5dc Binary files /dev/null and b/nwnds_module/p02n01p00.gic differ diff --git a/nwnds_module/p02n01p00.git b/nwnds_module/p02n01p00.git new file mode 100644 index 000000000..b43aa7068 Binary files /dev/null and b/nwnds_module/p02n01p00.git differ diff --git a/nwnds_module/p02n02p00.are b/nwnds_module/p02n02p00.are new file mode 100644 index 000000000..9b016b6e9 Binary files /dev/null and b/nwnds_module/p02n02p00.are differ diff --git a/nwnds_module/p02n02p00.gic b/nwnds_module/p02n02p00.gic new file mode 100644 index 000000000..712328463 Binary files /dev/null and b/nwnds_module/p02n02p00.gic differ diff --git a/nwnds_module/p02n02p00.git b/nwnds_module/p02n02p00.git new file mode 100644 index 000000000..d0eb24fa7 Binary files /dev/null and b/nwnds_module/p02n02p00.git differ diff --git a/nwnds_module/p02n03p00.are b/nwnds_module/p02n03p00.are new file mode 100644 index 000000000..7dccb3632 Binary files /dev/null and b/nwnds_module/p02n03p00.are differ diff --git a/nwnds_module/p02n03p00.gic b/nwnds_module/p02n03p00.gic new file mode 100644 index 000000000..f3ab90b85 Binary files /dev/null and b/nwnds_module/p02n03p00.gic differ diff --git a/nwnds_module/p02n03p00.git b/nwnds_module/p02n03p00.git new file mode 100644 index 000000000..7847c6702 Binary files /dev/null and b/nwnds_module/p02n03p00.git differ diff --git a/nwnds_module/p02n04p00.are b/nwnds_module/p02n04p00.are new file mode 100644 index 000000000..db9d20c1a Binary files /dev/null and b/nwnds_module/p02n04p00.are differ diff --git a/nwnds_module/p02n04p00.gic b/nwnds_module/p02n04p00.gic new file mode 100644 index 000000000..7f2f141fc Binary files /dev/null and b/nwnds_module/p02n04p00.gic differ diff --git a/nwnds_module/p02n04p00.git b/nwnds_module/p02n04p00.git new file mode 100644 index 000000000..a1d7a90ea Binary files /dev/null and b/nwnds_module/p02n04p00.git differ diff --git a/nwnds_module/p02p00p00.are b/nwnds_module/p02p00p00.are new file mode 100644 index 000000000..296ad0f7e Binary files /dev/null and b/nwnds_module/p02p00p00.are differ diff --git a/nwnds_module/p02p00p00.gic b/nwnds_module/p02p00p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p02p00p00.gic differ diff --git a/nwnds_module/p02p00p00.git b/nwnds_module/p02p00p00.git new file mode 100644 index 000000000..ddb35d117 Binary files /dev/null and b/nwnds_module/p02p00p00.git differ diff --git a/nwnds_module/p02p01p00.are b/nwnds_module/p02p01p00.are new file mode 100644 index 000000000..0c6bba85a Binary files /dev/null and b/nwnds_module/p02p01p00.are differ diff --git a/nwnds_module/p02p01p00.gic b/nwnds_module/p02p01p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p02p01p00.gic differ diff --git a/nwnds_module/p02p01p00.git b/nwnds_module/p02p01p00.git new file mode 100644 index 000000000..dbcb366dd Binary files /dev/null and b/nwnds_module/p02p01p00.git differ diff --git a/nwnds_module/p02p02p00.are b/nwnds_module/p02p02p00.are new file mode 100644 index 000000000..642eeb29c Binary files /dev/null and b/nwnds_module/p02p02p00.are differ diff --git a/nwnds_module/p02p02p00.gic b/nwnds_module/p02p02p00.gic new file mode 100644 index 000000000..e215a5e5c Binary files /dev/null and b/nwnds_module/p02p02p00.gic differ diff --git a/nwnds_module/p02p02p00.git b/nwnds_module/p02p02p00.git new file mode 100644 index 000000000..c99aea374 Binary files /dev/null and b/nwnds_module/p02p02p00.git differ diff --git a/nwnds_module/p02p03p00.are b/nwnds_module/p02p03p00.are new file mode 100644 index 000000000..4e1ccb3a0 Binary files /dev/null and b/nwnds_module/p02p03p00.are differ diff --git a/nwnds_module/p02p03p00.gic b/nwnds_module/p02p03p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p02p03p00.gic differ diff --git a/nwnds_module/p02p03p00.git b/nwnds_module/p02p03p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p02p03p00.git differ diff --git a/nwnds_module/p02p04p00.are b/nwnds_module/p02p04p00.are new file mode 100644 index 000000000..6cd4f5914 Binary files /dev/null and b/nwnds_module/p02p04p00.are differ diff --git a/nwnds_module/p02p04p00.gic b/nwnds_module/p02p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p02p04p00.gic differ diff --git a/nwnds_module/p02p04p00.git b/nwnds_module/p02p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p02p04p00.git differ diff --git a/nwnds_module/p02p05p00.are b/nwnds_module/p02p05p00.are new file mode 100644 index 000000000..5c9605ae0 Binary files /dev/null and b/nwnds_module/p02p05p00.are differ diff --git a/nwnds_module/p02p05p00.gic b/nwnds_module/p02p05p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p02p05p00.gic differ diff --git a/nwnds_module/p02p05p00.git b/nwnds_module/p02p05p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p02p05p00.git differ diff --git a/nwnds_module/p02p06p00.are b/nwnds_module/p02p06p00.are new file mode 100644 index 000000000..1be59cf1d Binary files /dev/null and b/nwnds_module/p02p06p00.are differ diff --git a/nwnds_module/p02p06p00.gic b/nwnds_module/p02p06p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p02p06p00.gic differ diff --git a/nwnds_module/p02p06p00.git b/nwnds_module/p02p06p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p02p06p00.git differ diff --git a/nwnds_module/p02p07p00.are b/nwnds_module/p02p07p00.are new file mode 100644 index 000000000..9375e02d8 Binary files /dev/null and b/nwnds_module/p02p07p00.are differ diff --git a/nwnds_module/p02p07p00.gic b/nwnds_module/p02p07p00.gic new file mode 100644 index 000000000..0a367496e Binary files /dev/null and b/nwnds_module/p02p07p00.gic differ diff --git a/nwnds_module/p02p07p00.git b/nwnds_module/p02p07p00.git new file mode 100644 index 000000000..1294ffb6a Binary files /dev/null and b/nwnds_module/p02p07p00.git differ diff --git a/nwnds_module/p03n01p00.are b/nwnds_module/p03n01p00.are new file mode 100644 index 000000000..80ce0698e Binary files /dev/null and b/nwnds_module/p03n01p00.are differ diff --git a/nwnds_module/p03n01p00.gic b/nwnds_module/p03n01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p03n01p00.gic differ diff --git a/nwnds_module/p03n01p00.git b/nwnds_module/p03n01p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p03n01p00.git differ diff --git a/nwnds_module/p03n02p00.are b/nwnds_module/p03n02p00.are new file mode 100644 index 000000000..c1e561800 Binary files /dev/null and b/nwnds_module/p03n02p00.are differ diff --git a/nwnds_module/p03n02p00.gic b/nwnds_module/p03n02p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p03n02p00.gic differ diff --git a/nwnds_module/p03n02p00.git b/nwnds_module/p03n02p00.git new file mode 100644 index 000000000..01decd9be Binary files /dev/null and b/nwnds_module/p03n02p00.git differ diff --git a/nwnds_module/p03n03p00.are b/nwnds_module/p03n03p00.are new file mode 100644 index 000000000..2fdc2212e Binary files /dev/null and b/nwnds_module/p03n03p00.are differ diff --git a/nwnds_module/p03n03p00.gic b/nwnds_module/p03n03p00.gic new file mode 100644 index 000000000..fc60e9c5f Binary files /dev/null and b/nwnds_module/p03n03p00.gic differ diff --git a/nwnds_module/p03n03p00.git b/nwnds_module/p03n03p00.git new file mode 100644 index 000000000..58dee6632 Binary files /dev/null and b/nwnds_module/p03n03p00.git differ diff --git a/nwnds_module/p03n04p00.are b/nwnds_module/p03n04p00.are new file mode 100644 index 000000000..f43a73c0b Binary files /dev/null and b/nwnds_module/p03n04p00.are differ diff --git a/nwnds_module/p03n04p00.gic b/nwnds_module/p03n04p00.gic new file mode 100644 index 000000000..080f8914c Binary files /dev/null and b/nwnds_module/p03n04p00.gic differ diff --git a/nwnds_module/p03n04p00.git b/nwnds_module/p03n04p00.git new file mode 100644 index 000000000..c55ca0a5b Binary files /dev/null and b/nwnds_module/p03n04p00.git differ diff --git a/nwnds_module/p03p00p00.are b/nwnds_module/p03p00p00.are new file mode 100644 index 000000000..5ea363d4b Binary files /dev/null and b/nwnds_module/p03p00p00.are differ diff --git a/nwnds_module/p03p00p00.gic b/nwnds_module/p03p00p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p03p00p00.gic differ diff --git a/nwnds_module/p03p00p00.git b/nwnds_module/p03p00p00.git new file mode 100644 index 000000000..8c1cbd4ac Binary files /dev/null and b/nwnds_module/p03p00p00.git differ diff --git a/nwnds_module/p03p01p00.are b/nwnds_module/p03p01p00.are new file mode 100644 index 000000000..608c95f9e Binary files /dev/null and b/nwnds_module/p03p01p00.are differ diff --git a/nwnds_module/p03p01p00.gic b/nwnds_module/p03p01p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p03p01p00.gic differ diff --git a/nwnds_module/p03p01p00.git b/nwnds_module/p03p01p00.git new file mode 100644 index 000000000..2763c8fb4 Binary files /dev/null and b/nwnds_module/p03p01p00.git differ diff --git a/nwnds_module/p03p02p00.are b/nwnds_module/p03p02p00.are new file mode 100644 index 000000000..ce9e02ec9 Binary files /dev/null and b/nwnds_module/p03p02p00.are differ diff --git a/nwnds_module/p03p02p00.gic b/nwnds_module/p03p02p00.gic new file mode 100644 index 000000000..3c6a31a18 Binary files /dev/null and b/nwnds_module/p03p02p00.gic differ diff --git a/nwnds_module/p03p02p00.git b/nwnds_module/p03p02p00.git new file mode 100644 index 000000000..fac4fcd0e Binary files /dev/null and b/nwnds_module/p03p02p00.git differ diff --git a/nwnds_module/p03p03p00.are b/nwnds_module/p03p03p00.are new file mode 100644 index 000000000..85d92e497 Binary files /dev/null and b/nwnds_module/p03p03p00.are differ diff --git a/nwnds_module/p03p03p00.gic b/nwnds_module/p03p03p00.gic new file mode 100644 index 000000000..b2e7b65dd Binary files /dev/null and b/nwnds_module/p03p03p00.gic differ diff --git a/nwnds_module/p03p03p00.git b/nwnds_module/p03p03p00.git new file mode 100644 index 000000000..b500fa314 Binary files /dev/null and b/nwnds_module/p03p03p00.git differ diff --git a/nwnds_module/p03p04p00.are b/nwnds_module/p03p04p00.are new file mode 100644 index 000000000..64a8ca511 Binary files /dev/null and b/nwnds_module/p03p04p00.are differ diff --git a/nwnds_module/p03p04p00.gic b/nwnds_module/p03p04p00.gic new file mode 100644 index 000000000..cf0556a4d Binary files /dev/null and b/nwnds_module/p03p04p00.gic differ diff --git a/nwnds_module/p03p04p00.git b/nwnds_module/p03p04p00.git new file mode 100644 index 000000000..0b8405399 Binary files /dev/null and b/nwnds_module/p03p04p00.git differ diff --git a/nwnds_module/p03p05p00.are b/nwnds_module/p03p05p00.are new file mode 100644 index 000000000..2d3593490 Binary files /dev/null and b/nwnds_module/p03p05p00.are differ diff --git a/nwnds_module/p03p05p00.gic b/nwnds_module/p03p05p00.gic new file mode 100644 index 000000000..32e5baaec Binary files /dev/null and b/nwnds_module/p03p05p00.gic differ diff --git a/nwnds_module/p03p05p00.git b/nwnds_module/p03p05p00.git new file mode 100644 index 000000000..46450bf20 Binary files /dev/null and b/nwnds_module/p03p05p00.git differ diff --git a/nwnds_module/p03p06p00.are b/nwnds_module/p03p06p00.are new file mode 100644 index 000000000..e72153a37 Binary files /dev/null and b/nwnds_module/p03p06p00.are differ diff --git a/nwnds_module/p03p06p00.gic b/nwnds_module/p03p06p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p03p06p00.gic differ diff --git a/nwnds_module/p03p06p00.git b/nwnds_module/p03p06p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p03p06p00.git differ diff --git a/nwnds_module/p03p07p00.are b/nwnds_module/p03p07p00.are new file mode 100644 index 000000000..7a5c3ab94 Binary files /dev/null and b/nwnds_module/p03p07p00.are differ diff --git a/nwnds_module/p03p07p00.gic b/nwnds_module/p03p07p00.gic new file mode 100644 index 000000000..42f97d41e Binary files /dev/null and b/nwnds_module/p03p07p00.gic differ diff --git a/nwnds_module/p03p07p00.git b/nwnds_module/p03p07p00.git new file mode 100644 index 000000000..6c671fba6 Binary files /dev/null and b/nwnds_module/p03p07p00.git differ diff --git a/nwnds_module/p04n01p00.are b/nwnds_module/p04n01p00.are new file mode 100644 index 000000000..c58ec327c Binary files /dev/null and b/nwnds_module/p04n01p00.are differ diff --git a/nwnds_module/p04n01p00.gic b/nwnds_module/p04n01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p04n01p00.gic differ diff --git a/nwnds_module/p04n01p00.git b/nwnds_module/p04n01p00.git new file mode 100644 index 000000000..f32352f48 Binary files /dev/null and b/nwnds_module/p04n01p00.git differ diff --git a/nwnds_module/p04n02p00.are b/nwnds_module/p04n02p00.are new file mode 100644 index 000000000..dbb3c64d2 Binary files /dev/null and b/nwnds_module/p04n02p00.are differ diff --git a/nwnds_module/p04n02p00.gic b/nwnds_module/p04n02p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p04n02p00.gic differ diff --git a/nwnds_module/p04n02p00.git b/nwnds_module/p04n02p00.git new file mode 100644 index 000000000..fb0761d23 Binary files /dev/null and b/nwnds_module/p04n02p00.git differ diff --git a/nwnds_module/p04n03p00.are b/nwnds_module/p04n03p00.are new file mode 100644 index 000000000..91a61abb4 Binary files /dev/null and b/nwnds_module/p04n03p00.are differ diff --git a/nwnds_module/p04n03p00.gic b/nwnds_module/p04n03p00.gic new file mode 100644 index 000000000..f65ee6545 Binary files /dev/null and b/nwnds_module/p04n03p00.gic differ diff --git a/nwnds_module/p04n03p00.git b/nwnds_module/p04n03p00.git new file mode 100644 index 000000000..1a3218594 Binary files /dev/null and b/nwnds_module/p04n03p00.git differ diff --git a/nwnds_module/p04n04p00.are b/nwnds_module/p04n04p00.are new file mode 100644 index 000000000..cbb89aaeb Binary files /dev/null and b/nwnds_module/p04n04p00.are differ diff --git a/nwnds_module/p04n04p00.gic b/nwnds_module/p04n04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p04n04p00.gic differ diff --git a/nwnds_module/p04n04p00.git b/nwnds_module/p04n04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p04n04p00.git differ diff --git a/nwnds_module/p04p00p00.are b/nwnds_module/p04p00p00.are new file mode 100644 index 000000000..05e3eb888 Binary files /dev/null and b/nwnds_module/p04p00p00.are differ diff --git a/nwnds_module/p04p00p00.gic b/nwnds_module/p04p00p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p04p00p00.gic differ diff --git a/nwnds_module/p04p00p00.git b/nwnds_module/p04p00p00.git new file mode 100644 index 000000000..31900219b Binary files /dev/null and b/nwnds_module/p04p00p00.git differ diff --git a/nwnds_module/p04p01p00.are b/nwnds_module/p04p01p00.are new file mode 100644 index 000000000..02003fcf4 Binary files /dev/null and b/nwnds_module/p04p01p00.are differ diff --git a/nwnds_module/p04p01p00.gic b/nwnds_module/p04p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p04p01p00.gic differ diff --git a/nwnds_module/p04p01p00.git b/nwnds_module/p04p01p00.git new file mode 100644 index 000000000..c30908282 Binary files /dev/null and b/nwnds_module/p04p01p00.git differ diff --git a/nwnds_module/p04p02p00.are b/nwnds_module/p04p02p00.are new file mode 100644 index 000000000..9f7134d6e Binary files /dev/null and b/nwnds_module/p04p02p00.are differ diff --git a/nwnds_module/p04p02p00.gic b/nwnds_module/p04p02p00.gic new file mode 100644 index 000000000..39706f7d5 Binary files /dev/null and b/nwnds_module/p04p02p00.gic differ diff --git a/nwnds_module/p04p02p00.git b/nwnds_module/p04p02p00.git new file mode 100644 index 000000000..9d7343746 Binary files /dev/null and b/nwnds_module/p04p02p00.git differ diff --git a/nwnds_module/p04p03p00.are b/nwnds_module/p04p03p00.are new file mode 100644 index 000000000..ab3bc9bc9 Binary files /dev/null and b/nwnds_module/p04p03p00.are differ diff --git a/nwnds_module/p04p03p00.gic b/nwnds_module/p04p03p00.gic new file mode 100644 index 000000000..3d49dab96 Binary files /dev/null and b/nwnds_module/p04p03p00.gic differ diff --git a/nwnds_module/p04p03p00.git b/nwnds_module/p04p03p00.git new file mode 100644 index 000000000..b53ce69fe Binary files /dev/null and b/nwnds_module/p04p03p00.git differ diff --git a/nwnds_module/p04p04p00.are b/nwnds_module/p04p04p00.are new file mode 100644 index 000000000..165c9d179 Binary files /dev/null and b/nwnds_module/p04p04p00.are differ diff --git a/nwnds_module/p04p04p00.gic b/nwnds_module/p04p04p00.gic new file mode 100644 index 000000000..4eb9ef4b9 Binary files /dev/null and b/nwnds_module/p04p04p00.gic differ diff --git a/nwnds_module/p04p04p00.git b/nwnds_module/p04p04p00.git new file mode 100644 index 000000000..192eadd0d Binary files /dev/null and b/nwnds_module/p04p04p00.git differ diff --git a/nwnds_module/p04p05p00.are b/nwnds_module/p04p05p00.are new file mode 100644 index 000000000..ebbb62c4e Binary files /dev/null and b/nwnds_module/p04p05p00.are differ diff --git a/nwnds_module/p04p05p00.gic b/nwnds_module/p04p05p00.gic new file mode 100644 index 000000000..1cf80b86d Binary files /dev/null and b/nwnds_module/p04p05p00.gic differ diff --git a/nwnds_module/p04p05p00.git b/nwnds_module/p04p05p00.git new file mode 100644 index 000000000..79a669711 Binary files /dev/null and b/nwnds_module/p04p05p00.git differ diff --git a/nwnds_module/p04p06p00.are b/nwnds_module/p04p06p00.are new file mode 100644 index 000000000..ce4984e45 Binary files /dev/null and b/nwnds_module/p04p06p00.are differ diff --git a/nwnds_module/p04p06p00.gic b/nwnds_module/p04p06p00.gic new file mode 100644 index 000000000..37c08b253 Binary files /dev/null and b/nwnds_module/p04p06p00.gic differ diff --git a/nwnds_module/p04p06p00.git b/nwnds_module/p04p06p00.git new file mode 100644 index 000000000..ea9edef99 Binary files /dev/null and b/nwnds_module/p04p06p00.git differ diff --git a/nwnds_module/p04p07p00.are b/nwnds_module/p04p07p00.are new file mode 100644 index 000000000..97d68e56e Binary files /dev/null and b/nwnds_module/p04p07p00.are differ diff --git a/nwnds_module/p04p07p00.gic b/nwnds_module/p04p07p00.gic new file mode 100644 index 000000000..8d811f8b4 Binary files /dev/null and b/nwnds_module/p04p07p00.gic differ diff --git a/nwnds_module/p04p07p00.git b/nwnds_module/p04p07p00.git new file mode 100644 index 000000000..6e6384762 Binary files /dev/null and b/nwnds_module/p04p07p00.git differ diff --git a/nwnds_module/p05n01p00.are b/nwnds_module/p05n01p00.are new file mode 100644 index 000000000..7785d4ce2 Binary files /dev/null and b/nwnds_module/p05n01p00.are differ diff --git a/nwnds_module/p05n01p00.gic b/nwnds_module/p05n01p00.gic new file mode 100644 index 000000000..ddfcc055d Binary files /dev/null and b/nwnds_module/p05n01p00.gic differ diff --git a/nwnds_module/p05n01p00.git b/nwnds_module/p05n01p00.git new file mode 100644 index 000000000..cfabfbe3b Binary files /dev/null and b/nwnds_module/p05n01p00.git differ diff --git a/nwnds_module/p05n02p00.are b/nwnds_module/p05n02p00.are new file mode 100644 index 000000000..7feb5597c Binary files /dev/null and b/nwnds_module/p05n02p00.are differ diff --git a/nwnds_module/p05n02p00.gic b/nwnds_module/p05n02p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p05n02p00.gic differ diff --git a/nwnds_module/p05n02p00.git b/nwnds_module/p05n02p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p05n02p00.git differ diff --git a/nwnds_module/p05n03p00.are b/nwnds_module/p05n03p00.are new file mode 100644 index 000000000..9813ac686 Binary files /dev/null and b/nwnds_module/p05n03p00.are differ diff --git a/nwnds_module/p05n03p00.gic b/nwnds_module/p05n03p00.gic new file mode 100644 index 000000000..7f9270343 Binary files /dev/null and b/nwnds_module/p05n03p00.gic differ diff --git a/nwnds_module/p05n03p00.git b/nwnds_module/p05n03p00.git new file mode 100644 index 000000000..1208ef41a Binary files /dev/null and b/nwnds_module/p05n03p00.git differ diff --git a/nwnds_module/p05n04p00.are b/nwnds_module/p05n04p00.are new file mode 100644 index 000000000..4506805b5 Binary files /dev/null and b/nwnds_module/p05n04p00.are differ diff --git a/nwnds_module/p05n04p00.gic b/nwnds_module/p05n04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p05n04p00.gic differ diff --git a/nwnds_module/p05n04p00.git b/nwnds_module/p05n04p00.git new file mode 100644 index 000000000..70d565ad7 Binary files /dev/null and b/nwnds_module/p05n04p00.git differ diff --git a/nwnds_module/p05p00p00.are b/nwnds_module/p05p00p00.are new file mode 100644 index 000000000..521c1f5ec Binary files /dev/null and b/nwnds_module/p05p00p00.are differ diff --git a/nwnds_module/p05p00p00.gic b/nwnds_module/p05p00p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p05p00p00.gic differ diff --git a/nwnds_module/p05p00p00.git b/nwnds_module/p05p00p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p05p00p00.git differ diff --git a/nwnds_module/p05p01p00.are b/nwnds_module/p05p01p00.are new file mode 100644 index 000000000..e7405c1c5 Binary files /dev/null and b/nwnds_module/p05p01p00.are differ diff --git a/nwnds_module/p05p01p00.gic b/nwnds_module/p05p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p05p01p00.gic differ diff --git a/nwnds_module/p05p01p00.git b/nwnds_module/p05p01p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p05p01p00.git differ diff --git a/nwnds_module/p05p02p00.are b/nwnds_module/p05p02p00.are new file mode 100644 index 000000000..318961594 Binary files /dev/null and b/nwnds_module/p05p02p00.are differ diff --git a/nwnds_module/p05p02p00.gic b/nwnds_module/p05p02p00.gic new file mode 100644 index 000000000..243ca0dc1 Binary files /dev/null and b/nwnds_module/p05p02p00.gic differ diff --git a/nwnds_module/p05p02p00.git b/nwnds_module/p05p02p00.git new file mode 100644 index 000000000..a53705c09 Binary files /dev/null and b/nwnds_module/p05p02p00.git differ diff --git a/nwnds_module/p05p03p00.are b/nwnds_module/p05p03p00.are new file mode 100644 index 000000000..910f66da8 Binary files /dev/null and b/nwnds_module/p05p03p00.are differ diff --git a/nwnds_module/p05p03p00.gic b/nwnds_module/p05p03p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p05p03p00.gic differ diff --git a/nwnds_module/p05p03p00.git b/nwnds_module/p05p03p00.git new file mode 100644 index 000000000..e1a5794d0 Binary files /dev/null and b/nwnds_module/p05p03p00.git differ diff --git a/nwnds_module/p05p04p00.are b/nwnds_module/p05p04p00.are new file mode 100644 index 000000000..2063bf183 Binary files /dev/null and b/nwnds_module/p05p04p00.are differ diff --git a/nwnds_module/p05p04p00.gic b/nwnds_module/p05p04p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p05p04p00.gic differ diff --git a/nwnds_module/p05p04p00.git b/nwnds_module/p05p04p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p05p04p00.git differ diff --git a/nwnds_module/p05p05p00.are b/nwnds_module/p05p05p00.are new file mode 100644 index 000000000..2c17ced16 Binary files /dev/null and b/nwnds_module/p05p05p00.are differ diff --git a/nwnds_module/p05p05p00.gic b/nwnds_module/p05p05p00.gic new file mode 100644 index 000000000..8069de4ad Binary files /dev/null and b/nwnds_module/p05p05p00.gic differ diff --git a/nwnds_module/p05p05p00.git b/nwnds_module/p05p05p00.git new file mode 100644 index 000000000..74c0f2517 Binary files /dev/null and b/nwnds_module/p05p05p00.git differ diff --git a/nwnds_module/p05p06p00.are b/nwnds_module/p05p06p00.are new file mode 100644 index 000000000..9c0f15930 Binary files /dev/null and b/nwnds_module/p05p06p00.are differ diff --git a/nwnds_module/p05p06p00.gic b/nwnds_module/p05p06p00.gic new file mode 100644 index 000000000..3f2ff9b9e Binary files /dev/null and b/nwnds_module/p05p06p00.gic differ diff --git a/nwnds_module/p05p06p00.git b/nwnds_module/p05p06p00.git new file mode 100644 index 000000000..46071d573 Binary files /dev/null and b/nwnds_module/p05p06p00.git differ diff --git a/nwnds_module/p05p07p00.are b/nwnds_module/p05p07p00.are new file mode 100644 index 000000000..ac36940d3 Binary files /dev/null and b/nwnds_module/p05p07p00.are differ diff --git a/nwnds_module/p05p07p00.gic b/nwnds_module/p05p07p00.gic new file mode 100644 index 000000000..1fb43ea81 Binary files /dev/null and b/nwnds_module/p05p07p00.gic differ diff --git a/nwnds_module/p05p07p00.git b/nwnds_module/p05p07p00.git new file mode 100644 index 000000000..b46f476f2 Binary files /dev/null and b/nwnds_module/p05p07p00.git differ diff --git a/nwnds_module/p06n01p00.are b/nwnds_module/p06n01p00.are new file mode 100644 index 000000000..593dad36f Binary files /dev/null and b/nwnds_module/p06n01p00.are differ diff --git a/nwnds_module/p06n01p00.gic b/nwnds_module/p06n01p00.gic new file mode 100644 index 000000000..c1ee178ad Binary files /dev/null and b/nwnds_module/p06n01p00.gic differ diff --git a/nwnds_module/p06n01p00.git b/nwnds_module/p06n01p00.git new file mode 100644 index 000000000..1a236687c Binary files /dev/null and b/nwnds_module/p06n01p00.git differ diff --git a/nwnds_module/p06n02p00.are b/nwnds_module/p06n02p00.are new file mode 100644 index 000000000..1d2acb92f Binary files /dev/null and b/nwnds_module/p06n02p00.are differ diff --git a/nwnds_module/p06n02p00.gic b/nwnds_module/p06n02p00.gic new file mode 100644 index 000000000..76335ef47 Binary files /dev/null and b/nwnds_module/p06n02p00.gic differ diff --git a/nwnds_module/p06n02p00.git b/nwnds_module/p06n02p00.git new file mode 100644 index 000000000..21f4833dc Binary files /dev/null and b/nwnds_module/p06n02p00.git differ diff --git a/nwnds_module/p06n03p00.are b/nwnds_module/p06n03p00.are new file mode 100644 index 000000000..5090cbef1 Binary files /dev/null and b/nwnds_module/p06n03p00.are differ diff --git a/nwnds_module/p06n03p00.gic b/nwnds_module/p06n03p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p06n03p00.gic differ diff --git a/nwnds_module/p06n03p00.git b/nwnds_module/p06n03p00.git new file mode 100644 index 000000000..8c1cbd4ac Binary files /dev/null and b/nwnds_module/p06n03p00.git differ diff --git a/nwnds_module/p06n04p00.are b/nwnds_module/p06n04p00.are new file mode 100644 index 000000000..c6002132a Binary files /dev/null and b/nwnds_module/p06n04p00.are differ diff --git a/nwnds_module/p06n04p00.gic b/nwnds_module/p06n04p00.gic new file mode 100644 index 000000000..32e5baaec Binary files /dev/null and b/nwnds_module/p06n04p00.gic differ diff --git a/nwnds_module/p06n04p00.git b/nwnds_module/p06n04p00.git new file mode 100644 index 000000000..2ad9cf762 Binary files /dev/null and b/nwnds_module/p06n04p00.git differ diff --git a/nwnds_module/p06p00p00.are b/nwnds_module/p06p00p00.are new file mode 100644 index 000000000..43f556d93 Binary files /dev/null and b/nwnds_module/p06p00p00.are differ diff --git a/nwnds_module/p06p00p00.gic b/nwnds_module/p06p00p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p06p00p00.gic differ diff --git a/nwnds_module/p06p00p00.git b/nwnds_module/p06p00p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p06p00p00.git differ diff --git a/nwnds_module/p06p01p00.are b/nwnds_module/p06p01p00.are new file mode 100644 index 000000000..60b076fe9 Binary files /dev/null and b/nwnds_module/p06p01p00.are differ diff --git a/nwnds_module/p06p01p00.gic b/nwnds_module/p06p01p00.gic new file mode 100644 index 000000000..9eb90dedc Binary files /dev/null and b/nwnds_module/p06p01p00.gic differ diff --git a/nwnds_module/p06p01p00.git b/nwnds_module/p06p01p00.git new file mode 100644 index 000000000..8fd325865 Binary files /dev/null and b/nwnds_module/p06p01p00.git differ diff --git a/nwnds_module/p06p02p00.are b/nwnds_module/p06p02p00.are new file mode 100644 index 000000000..52a6debad Binary files /dev/null and b/nwnds_module/p06p02p00.are differ diff --git a/nwnds_module/p06p02p00.gic b/nwnds_module/p06p02p00.gic new file mode 100644 index 000000000..4650f0068 Binary files /dev/null and b/nwnds_module/p06p02p00.gic differ diff --git a/nwnds_module/p06p02p00.git b/nwnds_module/p06p02p00.git new file mode 100644 index 000000000..8a755bfe8 Binary files /dev/null and b/nwnds_module/p06p02p00.git differ diff --git a/nwnds_module/p06p03p00.are b/nwnds_module/p06p03p00.are new file mode 100644 index 000000000..77bc4597a Binary files /dev/null and b/nwnds_module/p06p03p00.are differ diff --git a/nwnds_module/p06p03p00.gic b/nwnds_module/p06p03p00.gic new file mode 100644 index 000000000..3c36a1b78 Binary files /dev/null and b/nwnds_module/p06p03p00.gic differ diff --git a/nwnds_module/p06p03p00.git b/nwnds_module/p06p03p00.git new file mode 100644 index 000000000..1cec6e75b Binary files /dev/null and b/nwnds_module/p06p03p00.git differ diff --git a/nwnds_module/p06p04p00.are b/nwnds_module/p06p04p00.are new file mode 100644 index 000000000..82c65f94d Binary files /dev/null and b/nwnds_module/p06p04p00.are differ diff --git a/nwnds_module/p06p04p00.gic b/nwnds_module/p06p04p00.gic new file mode 100644 index 000000000..58c22e249 Binary files /dev/null and b/nwnds_module/p06p04p00.gic differ diff --git a/nwnds_module/p06p04p00.git b/nwnds_module/p06p04p00.git new file mode 100644 index 000000000..9400e8e5b Binary files /dev/null and b/nwnds_module/p06p04p00.git differ diff --git a/nwnds_module/p06p05p00.are b/nwnds_module/p06p05p00.are new file mode 100644 index 000000000..7f351db60 Binary files /dev/null and b/nwnds_module/p06p05p00.are differ diff --git a/nwnds_module/p06p05p00.gic b/nwnds_module/p06p05p00.gic new file mode 100644 index 000000000..1d6a7e649 Binary files /dev/null and b/nwnds_module/p06p05p00.gic differ diff --git a/nwnds_module/p06p05p00.git b/nwnds_module/p06p05p00.git new file mode 100644 index 000000000..472ccdeb2 Binary files /dev/null and b/nwnds_module/p06p05p00.git differ diff --git a/nwnds_module/p06p06p00.are b/nwnds_module/p06p06p00.are new file mode 100644 index 000000000..11fc8d961 Binary files /dev/null and b/nwnds_module/p06p06p00.are differ diff --git a/nwnds_module/p06p06p00.gic b/nwnds_module/p06p06p00.gic new file mode 100644 index 000000000..a65c4673d Binary files /dev/null and b/nwnds_module/p06p06p00.gic differ diff --git a/nwnds_module/p06p06p00.git b/nwnds_module/p06p06p00.git new file mode 100644 index 000000000..2da65ebc9 Binary files /dev/null and b/nwnds_module/p06p06p00.git differ diff --git a/nwnds_module/p06p07p00.are b/nwnds_module/p06p07p00.are new file mode 100644 index 000000000..e82173b8e Binary files /dev/null and b/nwnds_module/p06p07p00.are differ diff --git a/nwnds_module/p06p07p00.gic b/nwnds_module/p06p07p00.gic new file mode 100644 index 000000000..c87aeb19d Binary files /dev/null and b/nwnds_module/p06p07p00.gic differ diff --git a/nwnds_module/p06p07p00.git b/nwnds_module/p06p07p00.git new file mode 100644 index 000000000..80da8541b Binary files /dev/null and b/nwnds_module/p06p07p00.git differ diff --git a/nwnds_module/p07n01p00.are b/nwnds_module/p07n01p00.are new file mode 100644 index 000000000..145ee6382 Binary files /dev/null and b/nwnds_module/p07n01p00.are differ diff --git a/nwnds_module/p07n01p00.gic b/nwnds_module/p07n01p00.gic new file mode 100644 index 000000000..d141742f7 Binary files /dev/null and b/nwnds_module/p07n01p00.gic differ diff --git a/nwnds_module/p07n01p00.git b/nwnds_module/p07n01p00.git new file mode 100644 index 000000000..b9b9dd200 Binary files /dev/null and b/nwnds_module/p07n01p00.git differ diff --git a/nwnds_module/p07n02p00.are b/nwnds_module/p07n02p00.are new file mode 100644 index 000000000..e457c02d1 Binary files /dev/null and b/nwnds_module/p07n02p00.are differ diff --git a/nwnds_module/p07n02p00.gic b/nwnds_module/p07n02p00.gic new file mode 100644 index 000000000..205f59231 Binary files /dev/null and b/nwnds_module/p07n02p00.gic differ diff --git a/nwnds_module/p07n02p00.git b/nwnds_module/p07n02p00.git new file mode 100644 index 000000000..067f9703b Binary files /dev/null and b/nwnds_module/p07n02p00.git differ diff --git a/nwnds_module/p07n03p00.are b/nwnds_module/p07n03p00.are new file mode 100644 index 000000000..96cd5fc9d Binary files /dev/null and b/nwnds_module/p07n03p00.are differ diff --git a/nwnds_module/p07n03p00.gic b/nwnds_module/p07n03p00.gic new file mode 100644 index 000000000..2b7ec7b38 Binary files /dev/null and b/nwnds_module/p07n03p00.gic differ diff --git a/nwnds_module/p07n03p00.git b/nwnds_module/p07n03p00.git new file mode 100644 index 000000000..8dfe50726 Binary files /dev/null and b/nwnds_module/p07n03p00.git differ diff --git a/nwnds_module/p07n04p00.are b/nwnds_module/p07n04p00.are new file mode 100644 index 000000000..4ddbd1cc0 Binary files /dev/null and b/nwnds_module/p07n04p00.are differ diff --git a/nwnds_module/p07n04p00.gic b/nwnds_module/p07n04p00.gic new file mode 100644 index 000000000..7f0378669 Binary files /dev/null and b/nwnds_module/p07n04p00.gic differ diff --git a/nwnds_module/p07n04p00.git b/nwnds_module/p07n04p00.git new file mode 100644 index 000000000..fa289fcf9 Binary files /dev/null and b/nwnds_module/p07n04p00.git differ diff --git a/nwnds_module/p07p00p00.are b/nwnds_module/p07p00p00.are new file mode 100644 index 000000000..95e15d859 Binary files /dev/null and b/nwnds_module/p07p00p00.are differ diff --git a/nwnds_module/p07p00p00.gic b/nwnds_module/p07p00p00.gic new file mode 100644 index 000000000..8a4cc25e8 Binary files /dev/null and b/nwnds_module/p07p00p00.gic differ diff --git a/nwnds_module/p07p00p00.git b/nwnds_module/p07p00p00.git new file mode 100644 index 000000000..3407b8cd8 Binary files /dev/null and b/nwnds_module/p07p00p00.git differ diff --git a/nwnds_module/p07p01p00.are b/nwnds_module/p07p01p00.are new file mode 100644 index 000000000..8f92cba54 Binary files /dev/null and b/nwnds_module/p07p01p00.are differ diff --git a/nwnds_module/p07p01p00.gic b/nwnds_module/p07p01p00.gic new file mode 100644 index 000000000..0ecef3a3f Binary files /dev/null and b/nwnds_module/p07p01p00.gic differ diff --git a/nwnds_module/p07p01p00.git b/nwnds_module/p07p01p00.git new file mode 100644 index 000000000..2af9a6668 Binary files /dev/null and b/nwnds_module/p07p01p00.git differ diff --git a/nwnds_module/p07p02p00.are b/nwnds_module/p07p02p00.are new file mode 100644 index 000000000..a235962ce Binary files /dev/null and b/nwnds_module/p07p02p00.are differ diff --git a/nwnds_module/p07p02p00.gic b/nwnds_module/p07p02p00.gic new file mode 100644 index 000000000..b3161e1ec Binary files /dev/null and b/nwnds_module/p07p02p00.gic differ diff --git a/nwnds_module/p07p02p00.git b/nwnds_module/p07p02p00.git new file mode 100644 index 000000000..a7922c803 Binary files /dev/null and b/nwnds_module/p07p02p00.git differ diff --git a/nwnds_module/p07p03p00.are b/nwnds_module/p07p03p00.are new file mode 100644 index 000000000..ffbee382e Binary files /dev/null and b/nwnds_module/p07p03p00.are differ diff --git a/nwnds_module/p07p03p00.gic b/nwnds_module/p07p03p00.gic new file mode 100644 index 000000000..fbf85b5b4 Binary files /dev/null and b/nwnds_module/p07p03p00.gic differ diff --git a/nwnds_module/p07p03p00.git b/nwnds_module/p07p03p00.git new file mode 100644 index 000000000..fb68f251b Binary files /dev/null and b/nwnds_module/p07p03p00.git differ diff --git a/nwnds_module/p07p04p00.are b/nwnds_module/p07p04p00.are new file mode 100644 index 000000000..8dcd7a9a0 Binary files /dev/null and b/nwnds_module/p07p04p00.are differ diff --git a/nwnds_module/p07p04p00.gic b/nwnds_module/p07p04p00.gic new file mode 100644 index 000000000..eb7666d22 Binary files /dev/null and b/nwnds_module/p07p04p00.gic differ diff --git a/nwnds_module/p07p04p00.git b/nwnds_module/p07p04p00.git new file mode 100644 index 000000000..4d8943961 Binary files /dev/null and b/nwnds_module/p07p04p00.git differ diff --git a/nwnds_module/p07p05p00.are b/nwnds_module/p07p05p00.are new file mode 100644 index 000000000..03ba5f83d Binary files /dev/null and b/nwnds_module/p07p05p00.are differ diff --git a/nwnds_module/p07p05p00.gic b/nwnds_module/p07p05p00.gic new file mode 100644 index 000000000..104884a9b Binary files /dev/null and b/nwnds_module/p07p05p00.gic differ diff --git a/nwnds_module/p07p05p00.git b/nwnds_module/p07p05p00.git new file mode 100644 index 000000000..90487a9c3 Binary files /dev/null and b/nwnds_module/p07p05p00.git differ diff --git a/nwnds_module/p07p06p00.are b/nwnds_module/p07p06p00.are new file mode 100644 index 000000000..1a3cc84f3 Binary files /dev/null and b/nwnds_module/p07p06p00.are differ diff --git a/nwnds_module/p07p06p00.gic b/nwnds_module/p07p06p00.gic new file mode 100644 index 000000000..de9af975f Binary files /dev/null and b/nwnds_module/p07p06p00.gic differ diff --git a/nwnds_module/p07p06p00.git b/nwnds_module/p07p06p00.git new file mode 100644 index 000000000..d8fcef2f1 Binary files /dev/null and b/nwnds_module/p07p06p00.git differ diff --git a/nwnds_module/p07p07p00.are b/nwnds_module/p07p07p00.are new file mode 100644 index 000000000..91f9dff7e Binary files /dev/null and b/nwnds_module/p07p07p00.are differ diff --git a/nwnds_module/p07p07p00.gic b/nwnds_module/p07p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p07p07p00.gic differ diff --git a/nwnds_module/p07p07p00.git b/nwnds_module/p07p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p07p07p00.git differ diff --git a/nwnds_module/p08n01p00.are b/nwnds_module/p08n01p00.are new file mode 100644 index 000000000..3d760c9b4 Binary files /dev/null and b/nwnds_module/p08n01p00.are differ diff --git a/nwnds_module/p08n01p00.gic b/nwnds_module/p08n01p00.gic new file mode 100644 index 000000000..3d34c4df3 Binary files /dev/null and b/nwnds_module/p08n01p00.gic differ diff --git a/nwnds_module/p08n01p00.git b/nwnds_module/p08n01p00.git new file mode 100644 index 000000000..eb50ae1ca Binary files /dev/null and b/nwnds_module/p08n01p00.git differ diff --git a/nwnds_module/p08n02p00.are b/nwnds_module/p08n02p00.are new file mode 100644 index 000000000..a3ec55c9f Binary files /dev/null and b/nwnds_module/p08n02p00.are differ diff --git a/nwnds_module/p08n02p00.gic b/nwnds_module/p08n02p00.gic new file mode 100644 index 000000000..a509c8b43 Binary files /dev/null and b/nwnds_module/p08n02p00.gic differ diff --git a/nwnds_module/p08n02p00.git b/nwnds_module/p08n02p00.git new file mode 100644 index 000000000..0ff07ede8 Binary files /dev/null and b/nwnds_module/p08n02p00.git differ diff --git a/nwnds_module/p08n03p00.are b/nwnds_module/p08n03p00.are new file mode 100644 index 000000000..cd6b5fdb5 Binary files /dev/null and b/nwnds_module/p08n03p00.are differ diff --git a/nwnds_module/p08n03p00.gic b/nwnds_module/p08n03p00.gic new file mode 100644 index 000000000..e85e8c383 Binary files /dev/null and b/nwnds_module/p08n03p00.gic differ diff --git a/nwnds_module/p08n03p00.git b/nwnds_module/p08n03p00.git new file mode 100644 index 000000000..a6c37a083 Binary files /dev/null and b/nwnds_module/p08n03p00.git differ diff --git a/nwnds_module/p08n04p00.are b/nwnds_module/p08n04p00.are new file mode 100644 index 000000000..0eafab21f Binary files /dev/null and b/nwnds_module/p08n04p00.are differ diff --git a/nwnds_module/p08n04p00.gic b/nwnds_module/p08n04p00.gic new file mode 100644 index 000000000..b5bc825da Binary files /dev/null and b/nwnds_module/p08n04p00.gic differ diff --git a/nwnds_module/p08n04p00.git b/nwnds_module/p08n04p00.git new file mode 100644 index 000000000..adc1e6b46 Binary files /dev/null and b/nwnds_module/p08n04p00.git differ diff --git a/nwnds_module/p08p00p00.are b/nwnds_module/p08p00p00.are new file mode 100644 index 000000000..72b50df97 Binary files /dev/null and b/nwnds_module/p08p00p00.are differ diff --git a/nwnds_module/p08p00p00.gic b/nwnds_module/p08p00p00.gic new file mode 100644 index 000000000..7995f1dcd Binary files /dev/null and b/nwnds_module/p08p00p00.gic differ diff --git a/nwnds_module/p08p00p00.git b/nwnds_module/p08p00p00.git new file mode 100644 index 000000000..7218b784a Binary files /dev/null and b/nwnds_module/p08p00p00.git differ diff --git a/nwnds_module/p08p01p00.are b/nwnds_module/p08p01p00.are new file mode 100644 index 000000000..eee80fc4e Binary files /dev/null and b/nwnds_module/p08p01p00.are differ diff --git a/nwnds_module/p08p01p00.gic b/nwnds_module/p08p01p00.gic new file mode 100644 index 000000000..32e5baaec Binary files /dev/null and b/nwnds_module/p08p01p00.gic differ diff --git a/nwnds_module/p08p01p00.git b/nwnds_module/p08p01p00.git new file mode 100644 index 000000000..9abb81b80 Binary files /dev/null and b/nwnds_module/p08p01p00.git differ diff --git a/nwnds_module/p08p02p00.are b/nwnds_module/p08p02p00.are new file mode 100644 index 000000000..080d673e0 Binary files /dev/null and b/nwnds_module/p08p02p00.are differ diff --git a/nwnds_module/p08p02p00.gic b/nwnds_module/p08p02p00.gic new file mode 100644 index 000000000..7995f1dcd Binary files /dev/null and b/nwnds_module/p08p02p00.gic differ diff --git a/nwnds_module/p08p02p00.git b/nwnds_module/p08p02p00.git new file mode 100644 index 000000000..92140af35 Binary files /dev/null and b/nwnds_module/p08p02p00.git differ diff --git a/nwnds_module/p08p03p00.are b/nwnds_module/p08p03p00.are new file mode 100644 index 000000000..1c47b8455 Binary files /dev/null and b/nwnds_module/p08p03p00.are differ diff --git a/nwnds_module/p08p03p00.gic b/nwnds_module/p08p03p00.gic new file mode 100644 index 000000000..e507b29a4 Binary files /dev/null and b/nwnds_module/p08p03p00.gic differ diff --git a/nwnds_module/p08p03p00.git b/nwnds_module/p08p03p00.git new file mode 100644 index 000000000..0c3b33604 Binary files /dev/null and b/nwnds_module/p08p03p00.git differ diff --git a/nwnds_module/p08p04p00.are b/nwnds_module/p08p04p00.are new file mode 100644 index 000000000..64c3446b6 Binary files /dev/null and b/nwnds_module/p08p04p00.are differ diff --git a/nwnds_module/p08p04p00.gic b/nwnds_module/p08p04p00.gic new file mode 100644 index 000000000..c29e61e0a Binary files /dev/null and b/nwnds_module/p08p04p00.gic differ diff --git a/nwnds_module/p08p04p00.git b/nwnds_module/p08p04p00.git new file mode 100644 index 000000000..86a153731 Binary files /dev/null and b/nwnds_module/p08p04p00.git differ diff --git a/nwnds_module/p08p05p00.are b/nwnds_module/p08p05p00.are new file mode 100644 index 000000000..7dc3198e7 Binary files /dev/null and b/nwnds_module/p08p05p00.are differ diff --git a/nwnds_module/p08p05p00.gic b/nwnds_module/p08p05p00.gic new file mode 100644 index 000000000..c59c5f6d4 Binary files /dev/null and b/nwnds_module/p08p05p00.gic differ diff --git a/nwnds_module/p08p05p00.git b/nwnds_module/p08p05p00.git new file mode 100644 index 000000000..5fcd06c41 Binary files /dev/null and b/nwnds_module/p08p05p00.git differ diff --git a/nwnds_module/p08p06p00.are b/nwnds_module/p08p06p00.are new file mode 100644 index 000000000..9495d0441 Binary files /dev/null and b/nwnds_module/p08p06p00.are differ diff --git a/nwnds_module/p08p06p00.gic b/nwnds_module/p08p06p00.gic new file mode 100644 index 000000000..d373ba387 Binary files /dev/null and b/nwnds_module/p08p06p00.gic differ diff --git a/nwnds_module/p08p06p00.git b/nwnds_module/p08p06p00.git new file mode 100644 index 000000000..6aeb23e89 Binary files /dev/null and b/nwnds_module/p08p06p00.git differ diff --git a/nwnds_module/p08p07p00.are b/nwnds_module/p08p07p00.are new file mode 100644 index 000000000..8a45e249a Binary files /dev/null and b/nwnds_module/p08p07p00.are differ diff --git a/nwnds_module/p08p07p00.gic b/nwnds_module/p08p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p08p07p00.gic differ diff --git a/nwnds_module/p08p07p00.git b/nwnds_module/p08p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p08p07p00.git differ diff --git a/nwnds_module/p09n02p00.are b/nwnds_module/p09n02p00.are new file mode 100644 index 000000000..91df6146f Binary files /dev/null and b/nwnds_module/p09n02p00.are differ diff --git a/nwnds_module/p09n02p00.gic b/nwnds_module/p09n02p00.gic new file mode 100644 index 000000000..38adfac56 Binary files /dev/null and b/nwnds_module/p09n02p00.gic differ diff --git a/nwnds_module/p09n02p00.git b/nwnds_module/p09n02p00.git new file mode 100644 index 000000000..264b62c22 Binary files /dev/null and b/nwnds_module/p09n02p00.git differ diff --git a/nwnds_module/p09n03p00.are b/nwnds_module/p09n03p00.are new file mode 100644 index 000000000..238a69c96 Binary files /dev/null and b/nwnds_module/p09n03p00.are differ diff --git a/nwnds_module/p09n03p00.gic b/nwnds_module/p09n03p00.gic new file mode 100644 index 000000000..fc631b164 Binary files /dev/null and b/nwnds_module/p09n03p00.gic differ diff --git a/nwnds_module/p09n03p00.git b/nwnds_module/p09n03p00.git new file mode 100644 index 000000000..97a5bf8ee Binary files /dev/null and b/nwnds_module/p09n03p00.git differ diff --git a/nwnds_module/p09n04p00.are b/nwnds_module/p09n04p00.are new file mode 100644 index 000000000..00c4932c4 Binary files /dev/null and b/nwnds_module/p09n04p00.are differ diff --git a/nwnds_module/p09n04p00.gic b/nwnds_module/p09n04p00.gic new file mode 100644 index 000000000..8166b730e Binary files /dev/null and b/nwnds_module/p09n04p00.gic differ diff --git a/nwnds_module/p09n04p00.git b/nwnds_module/p09n04p00.git new file mode 100644 index 000000000..d0ab7574a Binary files /dev/null and b/nwnds_module/p09n04p00.git differ diff --git a/nwnds_module/p09p00p00.are b/nwnds_module/p09p00p00.are new file mode 100644 index 000000000..181c9b23b Binary files /dev/null and b/nwnds_module/p09p00p00.are differ diff --git a/nwnds_module/p09p00p00.gic b/nwnds_module/p09p00p00.gic new file mode 100644 index 000000000..1dfe2eb9b Binary files /dev/null and b/nwnds_module/p09p00p00.gic differ diff --git a/nwnds_module/p09p00p00.git b/nwnds_module/p09p00p00.git new file mode 100644 index 000000000..5972138fe Binary files /dev/null and b/nwnds_module/p09p00p00.git differ diff --git a/nwnds_module/p09p01p00.are b/nwnds_module/p09p01p00.are new file mode 100644 index 000000000..0537da7aa Binary files /dev/null and b/nwnds_module/p09p01p00.are differ diff --git a/nwnds_module/p09p01p00.gic b/nwnds_module/p09p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p09p01p00.gic differ diff --git a/nwnds_module/p09p01p00.git b/nwnds_module/p09p01p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p09p01p00.git differ diff --git a/nwnds_module/p09p02p00.are b/nwnds_module/p09p02p00.are new file mode 100644 index 000000000..fe887a2c2 Binary files /dev/null and b/nwnds_module/p09p02p00.are differ diff --git a/nwnds_module/p09p02p00.gic b/nwnds_module/p09p02p00.gic new file mode 100644 index 000000000..a0bb04c94 Binary files /dev/null and b/nwnds_module/p09p02p00.gic differ diff --git a/nwnds_module/p09p02p00.git b/nwnds_module/p09p02p00.git new file mode 100644 index 000000000..51e3b4f34 Binary files /dev/null and b/nwnds_module/p09p02p00.git differ diff --git a/nwnds_module/p09p03p00.are b/nwnds_module/p09p03p00.are new file mode 100644 index 000000000..b98d46db7 Binary files /dev/null and b/nwnds_module/p09p03p00.are differ diff --git a/nwnds_module/p09p03p00.gic b/nwnds_module/p09p03p00.gic new file mode 100644 index 000000000..374d9f6cf Binary files /dev/null and b/nwnds_module/p09p03p00.gic differ diff --git a/nwnds_module/p09p03p00.git b/nwnds_module/p09p03p00.git new file mode 100644 index 000000000..df8378daa Binary files /dev/null and b/nwnds_module/p09p03p00.git differ diff --git a/nwnds_module/p09p04p00.are b/nwnds_module/p09p04p00.are new file mode 100644 index 000000000..2e82fd091 Binary files /dev/null and b/nwnds_module/p09p04p00.are differ diff --git a/nwnds_module/p09p04p00.gic b/nwnds_module/p09p04p00.gic new file mode 100644 index 000000000..33299b8ef Binary files /dev/null and b/nwnds_module/p09p04p00.gic differ diff --git a/nwnds_module/p09p04p00.git b/nwnds_module/p09p04p00.git new file mode 100644 index 000000000..41ac26cde Binary files /dev/null and b/nwnds_module/p09p04p00.git differ diff --git a/nwnds_module/p09p05p00.are b/nwnds_module/p09p05p00.are new file mode 100644 index 000000000..1edf2a1a9 Binary files /dev/null and b/nwnds_module/p09p05p00.are differ diff --git a/nwnds_module/p09p05p00.gic b/nwnds_module/p09p05p00.gic new file mode 100644 index 000000000..e14061957 Binary files /dev/null and b/nwnds_module/p09p05p00.gic differ diff --git a/nwnds_module/p09p05p00.git b/nwnds_module/p09p05p00.git new file mode 100644 index 000000000..22beb4548 Binary files /dev/null and b/nwnds_module/p09p05p00.git differ diff --git a/nwnds_module/p09p06p00.are b/nwnds_module/p09p06p00.are new file mode 100644 index 000000000..99c254867 Binary files /dev/null and b/nwnds_module/p09p06p00.are differ diff --git a/nwnds_module/p09p06p00.gic b/nwnds_module/p09p06p00.gic new file mode 100644 index 000000000..5b04ed6a6 Binary files /dev/null and b/nwnds_module/p09p06p00.gic differ diff --git a/nwnds_module/p09p06p00.git b/nwnds_module/p09p06p00.git new file mode 100644 index 000000000..a27204a82 Binary files /dev/null and b/nwnds_module/p09p06p00.git differ diff --git a/nwnds_module/p09p07p00.are b/nwnds_module/p09p07p00.are new file mode 100644 index 000000000..e1420c40a Binary files /dev/null and b/nwnds_module/p09p07p00.are differ diff --git a/nwnds_module/p09p07p00.gic b/nwnds_module/p09p07p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p09p07p00.gic differ diff --git a/nwnds_module/p09p07p00.git b/nwnds_module/p09p07p00.git new file mode 100644 index 000000000..d9dafd00a Binary files /dev/null and b/nwnds_module/p09p07p00.git differ diff --git a/nwnds_module/p10n03p00.are b/nwnds_module/p10n03p00.are new file mode 100644 index 000000000..04fed2398 Binary files /dev/null and b/nwnds_module/p10n03p00.are differ diff --git a/nwnds_module/p10n03p00.gic b/nwnds_module/p10n03p00.gic new file mode 100644 index 000000000..4eede52b4 Binary files /dev/null and b/nwnds_module/p10n03p00.gic differ diff --git a/nwnds_module/p10n03p00.git b/nwnds_module/p10n03p00.git new file mode 100644 index 000000000..5c080376d Binary files /dev/null and b/nwnds_module/p10n03p00.git differ diff --git a/nwnds_module/p10n04p00.are b/nwnds_module/p10n04p00.are new file mode 100644 index 000000000..9018ad042 Binary files /dev/null and b/nwnds_module/p10n04p00.are differ diff --git a/nwnds_module/p10n04p00.gic b/nwnds_module/p10n04p00.gic new file mode 100644 index 000000000..36447de7f Binary files /dev/null and b/nwnds_module/p10n04p00.gic differ diff --git a/nwnds_module/p10n04p00.git b/nwnds_module/p10n04p00.git new file mode 100644 index 000000000..c44307e35 Binary files /dev/null and b/nwnds_module/p10n04p00.git differ diff --git a/nwnds_module/p10p00p00.are b/nwnds_module/p10p00p00.are new file mode 100644 index 000000000..b151c2d89 Binary files /dev/null and b/nwnds_module/p10p00p00.are differ diff --git a/nwnds_module/p10p00p00.gic b/nwnds_module/p10p00p00.gic new file mode 100644 index 000000000..71bef9a17 Binary files /dev/null and b/nwnds_module/p10p00p00.gic differ diff --git a/nwnds_module/p10p00p00.git b/nwnds_module/p10p00p00.git new file mode 100644 index 000000000..fee74f495 Binary files /dev/null and b/nwnds_module/p10p00p00.git differ diff --git a/nwnds_module/p10p01p00.are b/nwnds_module/p10p01p00.are new file mode 100644 index 000000000..594db8973 Binary files /dev/null and b/nwnds_module/p10p01p00.are differ diff --git a/nwnds_module/p10p01p00.gic b/nwnds_module/p10p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p10p01p00.gic differ diff --git a/nwnds_module/p10p01p00.git b/nwnds_module/p10p01p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p10p01p00.git differ diff --git a/nwnds_module/p10p02p00.are b/nwnds_module/p10p02p00.are new file mode 100644 index 000000000..ad5d46ab7 Binary files /dev/null and b/nwnds_module/p10p02p00.are differ diff --git a/nwnds_module/p10p02p00.gic b/nwnds_module/p10p02p00.gic new file mode 100644 index 000000000..9602e5a04 Binary files /dev/null and b/nwnds_module/p10p02p00.gic differ diff --git a/nwnds_module/p10p02p00.git b/nwnds_module/p10p02p00.git new file mode 100644 index 000000000..70224b884 Binary files /dev/null and b/nwnds_module/p10p02p00.git differ diff --git a/nwnds_module/p10p03p00.are b/nwnds_module/p10p03p00.are new file mode 100644 index 000000000..9ba739cc0 Binary files /dev/null and b/nwnds_module/p10p03p00.are differ diff --git a/nwnds_module/p10p03p00.gic b/nwnds_module/p10p03p00.gic new file mode 100644 index 000000000..d10f5191b Binary files /dev/null and b/nwnds_module/p10p03p00.gic differ diff --git a/nwnds_module/p10p03p00.git b/nwnds_module/p10p03p00.git new file mode 100644 index 000000000..75e1ee62e Binary files /dev/null and b/nwnds_module/p10p03p00.git differ diff --git a/nwnds_module/p10p04p00.are b/nwnds_module/p10p04p00.are new file mode 100644 index 000000000..f1a08a954 Binary files /dev/null and b/nwnds_module/p10p04p00.are differ diff --git a/nwnds_module/p10p04p00.gic b/nwnds_module/p10p04p00.gic new file mode 100644 index 000000000..22da95c59 Binary files /dev/null and b/nwnds_module/p10p04p00.gic differ diff --git a/nwnds_module/p10p04p00.git b/nwnds_module/p10p04p00.git new file mode 100644 index 000000000..015007aa2 Binary files /dev/null and b/nwnds_module/p10p04p00.git differ diff --git a/nwnds_module/p10p05p00.are b/nwnds_module/p10p05p00.are new file mode 100644 index 000000000..680ecd3da Binary files /dev/null and b/nwnds_module/p10p05p00.are differ diff --git a/nwnds_module/p10p05p00.gic b/nwnds_module/p10p05p00.gic new file mode 100644 index 000000000..17504f3bd Binary files /dev/null and b/nwnds_module/p10p05p00.gic differ diff --git a/nwnds_module/p10p05p00.git b/nwnds_module/p10p05p00.git new file mode 100644 index 000000000..a37b74bcf Binary files /dev/null and b/nwnds_module/p10p05p00.git differ diff --git a/nwnds_module/p10p06p00.are b/nwnds_module/p10p06p00.are new file mode 100644 index 000000000..102551d4b Binary files /dev/null and b/nwnds_module/p10p06p00.are differ diff --git a/nwnds_module/p10p06p00.gic b/nwnds_module/p10p06p00.gic new file mode 100644 index 000000000..27c759026 Binary files /dev/null and b/nwnds_module/p10p06p00.gic differ diff --git a/nwnds_module/p10p06p00.git b/nwnds_module/p10p06p00.git new file mode 100644 index 000000000..96d5205f5 Binary files /dev/null and b/nwnds_module/p10p06p00.git differ diff --git a/nwnds_module/p10p07p00.are b/nwnds_module/p10p07p00.are new file mode 100644 index 000000000..66a8e4c38 Binary files /dev/null and b/nwnds_module/p10p07p00.are differ diff --git a/nwnds_module/p10p07p00.gic b/nwnds_module/p10p07p00.gic new file mode 100644 index 000000000..8d811f8b4 Binary files /dev/null and b/nwnds_module/p10p07p00.gic differ diff --git a/nwnds_module/p10p07p00.git b/nwnds_module/p10p07p00.git new file mode 100644 index 000000000..4c13ff999 Binary files /dev/null and b/nwnds_module/p10p07p00.git differ diff --git a/nwnds_module/p11n03p00.are b/nwnds_module/p11n03p00.are new file mode 100644 index 000000000..24707c155 Binary files /dev/null and b/nwnds_module/p11n03p00.are differ diff --git a/nwnds_module/p11n03p00.gic b/nwnds_module/p11n03p00.gic new file mode 100644 index 000000000..1c7516954 Binary files /dev/null and b/nwnds_module/p11n03p00.gic differ diff --git a/nwnds_module/p11n03p00.git b/nwnds_module/p11n03p00.git new file mode 100644 index 000000000..1722840dd Binary files /dev/null and b/nwnds_module/p11n03p00.git differ diff --git a/nwnds_module/p11n04p00.are b/nwnds_module/p11n04p00.are new file mode 100644 index 000000000..2112e5666 Binary files /dev/null and b/nwnds_module/p11n04p00.are differ diff --git a/nwnds_module/p11n04p00.gic b/nwnds_module/p11n04p00.gic new file mode 100644 index 000000000..e7a9083d9 Binary files /dev/null and b/nwnds_module/p11n04p00.gic differ diff --git a/nwnds_module/p11n04p00.git b/nwnds_module/p11n04p00.git new file mode 100644 index 000000000..3c018a6cc Binary files /dev/null and b/nwnds_module/p11n04p00.git differ diff --git a/nwnds_module/p11p00p00.are b/nwnds_module/p11p00p00.are new file mode 100644 index 000000000..f8b87e20f Binary files /dev/null and b/nwnds_module/p11p00p00.are differ diff --git a/nwnds_module/p11p00p00.gic b/nwnds_module/p11p00p00.gic new file mode 100644 index 000000000..983b7ab86 Binary files /dev/null and b/nwnds_module/p11p00p00.gic differ diff --git a/nwnds_module/p11p00p00.git b/nwnds_module/p11p00p00.git new file mode 100644 index 000000000..f7feac57e Binary files /dev/null and b/nwnds_module/p11p00p00.git differ diff --git a/nwnds_module/p11p01p00.are b/nwnds_module/p11p01p00.are new file mode 100644 index 000000000..b2f97c135 Binary files /dev/null and b/nwnds_module/p11p01p00.are differ diff --git a/nwnds_module/p11p01p00.gic b/nwnds_module/p11p01p00.gic new file mode 100644 index 000000000..46ecda080 Binary files /dev/null and b/nwnds_module/p11p01p00.gic differ diff --git a/nwnds_module/p11p01p00.git b/nwnds_module/p11p01p00.git new file mode 100644 index 000000000..01b84e5b7 Binary files /dev/null and b/nwnds_module/p11p01p00.git differ diff --git a/nwnds_module/p11p02p00.are b/nwnds_module/p11p02p00.are new file mode 100644 index 000000000..817ff0a6a Binary files /dev/null and b/nwnds_module/p11p02p00.are differ diff --git a/nwnds_module/p11p02p00.gic b/nwnds_module/p11p02p00.gic new file mode 100644 index 000000000..004b78521 Binary files /dev/null and b/nwnds_module/p11p02p00.gic differ diff --git a/nwnds_module/p11p02p00.git b/nwnds_module/p11p02p00.git new file mode 100644 index 000000000..5a0643334 Binary files /dev/null and b/nwnds_module/p11p02p00.git differ diff --git a/nwnds_module/p11p03p00.are b/nwnds_module/p11p03p00.are new file mode 100644 index 000000000..ae9432831 Binary files /dev/null and b/nwnds_module/p11p03p00.are differ diff --git a/nwnds_module/p11p03p00.gic b/nwnds_module/p11p03p00.gic new file mode 100644 index 000000000..97b36e651 Binary files /dev/null and b/nwnds_module/p11p03p00.gic differ diff --git a/nwnds_module/p11p03p00.git b/nwnds_module/p11p03p00.git new file mode 100644 index 000000000..3c9aeb4e8 Binary files /dev/null and b/nwnds_module/p11p03p00.git differ diff --git a/nwnds_module/p11p05p00.are b/nwnds_module/p11p05p00.are new file mode 100644 index 000000000..aa5707bee Binary files /dev/null and b/nwnds_module/p11p05p00.are differ diff --git a/nwnds_module/p11p05p00.gic b/nwnds_module/p11p05p00.gic new file mode 100644 index 000000000..9ddefc68b Binary files /dev/null and b/nwnds_module/p11p05p00.gic differ diff --git a/nwnds_module/p11p05p00.git b/nwnds_module/p11p05p00.git new file mode 100644 index 000000000..3c2acb6e9 Binary files /dev/null and b/nwnds_module/p11p05p00.git differ diff --git a/nwnds_module/p11p06p00.are b/nwnds_module/p11p06p00.are new file mode 100644 index 000000000..5659d6eb0 Binary files /dev/null and b/nwnds_module/p11p06p00.are differ diff --git a/nwnds_module/p11p06p00.gic b/nwnds_module/p11p06p00.gic new file mode 100644 index 000000000..a9ac9984b Binary files /dev/null and b/nwnds_module/p11p06p00.gic differ diff --git a/nwnds_module/p11p06p00.git b/nwnds_module/p11p06p00.git new file mode 100644 index 000000000..ba4d469af Binary files /dev/null and b/nwnds_module/p11p06p00.git differ diff --git a/nwnds_module/p11p07p00.are b/nwnds_module/p11p07p00.are new file mode 100644 index 000000000..60ed09338 Binary files /dev/null and b/nwnds_module/p11p07p00.are differ diff --git a/nwnds_module/p11p07p00.gic b/nwnds_module/p11p07p00.gic new file mode 100644 index 000000000..3e9665d4c Binary files /dev/null and b/nwnds_module/p11p07p00.gic differ diff --git a/nwnds_module/p11p07p00.git b/nwnds_module/p11p07p00.git new file mode 100644 index 000000000..05101a257 Binary files /dev/null and b/nwnds_module/p11p07p00.git differ diff --git a/nwnds_module/p12n03p00.are b/nwnds_module/p12n03p00.are new file mode 100644 index 000000000..364e0a5ab Binary files /dev/null and b/nwnds_module/p12n03p00.are differ diff --git a/nwnds_module/p12n03p00.gic b/nwnds_module/p12n03p00.gic new file mode 100644 index 000000000..0138a70f4 Binary files /dev/null and b/nwnds_module/p12n03p00.gic differ diff --git a/nwnds_module/p12n03p00.git b/nwnds_module/p12n03p00.git new file mode 100644 index 000000000..1695bd728 Binary files /dev/null and b/nwnds_module/p12n03p00.git differ diff --git a/nwnds_module/p12n04p00.are b/nwnds_module/p12n04p00.are new file mode 100644 index 000000000..043494f5b Binary files /dev/null and b/nwnds_module/p12n04p00.are differ diff --git a/nwnds_module/p12n04p00.gic b/nwnds_module/p12n04p00.gic new file mode 100644 index 000000000..d141742f7 Binary files /dev/null and b/nwnds_module/p12n04p00.gic differ diff --git a/nwnds_module/p12n04p00.git b/nwnds_module/p12n04p00.git new file mode 100644 index 000000000..2aa7d0cb5 Binary files /dev/null and b/nwnds_module/p12n04p00.git differ diff --git a/nwnds_module/p12p05p00.are b/nwnds_module/p12p05p00.are new file mode 100644 index 000000000..708359c36 Binary files /dev/null and b/nwnds_module/p12p05p00.are differ diff --git a/nwnds_module/p12p05p00.gic b/nwnds_module/p12p05p00.gic new file mode 100644 index 000000000..947612dbd Binary files /dev/null and b/nwnds_module/p12p05p00.gic differ diff --git a/nwnds_module/p12p05p00.git b/nwnds_module/p12p05p00.git new file mode 100644 index 000000000..65fc4558b Binary files /dev/null and b/nwnds_module/p12p05p00.git differ diff --git a/nwnds_module/p12p06p00.are b/nwnds_module/p12p06p00.are new file mode 100644 index 000000000..efa04ee7c Binary files /dev/null and b/nwnds_module/p12p06p00.are differ diff --git a/nwnds_module/p12p06p00.gic b/nwnds_module/p12p06p00.gic new file mode 100644 index 000000000..3569fa751 Binary files /dev/null and b/nwnds_module/p12p06p00.gic differ diff --git a/nwnds_module/p12p06p00.git b/nwnds_module/p12p06p00.git new file mode 100644 index 000000000..1290f2ba9 Binary files /dev/null and b/nwnds_module/p12p06p00.git differ diff --git a/nwnds_module/p12p07p00.are b/nwnds_module/p12p07p00.are new file mode 100644 index 000000000..945eab7a6 Binary files /dev/null and b/nwnds_module/p12p07p00.are differ diff --git a/nwnds_module/p12p07p00.gic b/nwnds_module/p12p07p00.gic new file mode 100644 index 000000000..837ded3f6 Binary files /dev/null and b/nwnds_module/p12p07p00.gic differ diff --git a/nwnds_module/p12p07p00.git b/nwnds_module/p12p07p00.git new file mode 100644 index 000000000..c53e222d9 Binary files /dev/null and b/nwnds_module/p12p07p00.git differ diff --git a/nwnds_module/p13p05p00.are b/nwnds_module/p13p05p00.are new file mode 100644 index 000000000..d48558482 Binary files /dev/null and b/nwnds_module/p13p05p00.are differ diff --git a/nwnds_module/p13p05p00.gic b/nwnds_module/p13p05p00.gic new file mode 100644 index 000000000..8f6f364f0 Binary files /dev/null and b/nwnds_module/p13p05p00.gic differ diff --git a/nwnds_module/p13p05p00.git b/nwnds_module/p13p05p00.git new file mode 100644 index 000000000..7a1188ce2 Binary files /dev/null and b/nwnds_module/p13p05p00.git differ diff --git a/nwnds_module/p13p06p00.are b/nwnds_module/p13p06p00.are new file mode 100644 index 000000000..10623ebff Binary files /dev/null and b/nwnds_module/p13p06p00.are differ diff --git a/nwnds_module/p13p06p00.gic b/nwnds_module/p13p06p00.gic new file mode 100644 index 000000000..efd98c6e2 Binary files /dev/null and b/nwnds_module/p13p06p00.gic differ diff --git a/nwnds_module/p13p06p00.git b/nwnds_module/p13p06p00.git new file mode 100644 index 000000000..ac4b1596f Binary files /dev/null and b/nwnds_module/p13p06p00.git differ diff --git a/nwnds_module/p13p07p00.are b/nwnds_module/p13p07p00.are new file mode 100644 index 000000000..39fd2eddf Binary files /dev/null and b/nwnds_module/p13p07p00.are differ diff --git a/nwnds_module/p13p07p00.gic b/nwnds_module/p13p07p00.gic new file mode 100644 index 000000000..4d45cc3c7 Binary files /dev/null and b/nwnds_module/p13p07p00.gic differ diff --git a/nwnds_module/p13p07p00.git b/nwnds_module/p13p07p00.git new file mode 100644 index 000000000..b88aa275c Binary files /dev/null and b/nwnds_module/p13p07p00.git differ diff --git a/nwnds_module/p14p06p00.are b/nwnds_module/p14p06p00.are new file mode 100644 index 000000000..af7f631b2 Binary files /dev/null and b/nwnds_module/p14p06p00.are differ diff --git a/nwnds_module/p14p06p00.gic b/nwnds_module/p14p06p00.gic new file mode 100644 index 000000000..51728f2c0 Binary files /dev/null and b/nwnds_module/p14p06p00.gic differ diff --git a/nwnds_module/p14p06p00.git b/nwnds_module/p14p06p00.git new file mode 100644 index 000000000..4b5b493cf Binary files /dev/null and b/nwnds_module/p14p06p00.git differ diff --git a/nwnds_module/p14p07p00.are b/nwnds_module/p14p07p00.are new file mode 100644 index 000000000..5294d3265 Binary files /dev/null and b/nwnds_module/p14p07p00.are differ diff --git a/nwnds_module/p14p07p00.gic b/nwnds_module/p14p07p00.gic new file mode 100644 index 000000000..854332bd5 Binary files /dev/null and b/nwnds_module/p14p07p00.gic differ diff --git a/nwnds_module/p14p07p00.git b/nwnds_module/p14p07p00.git new file mode 100644 index 000000000..656b10824 Binary files /dev/null and b/nwnds_module/p14p07p00.git differ diff --git a/nwnds_module/p15p06p00.are b/nwnds_module/p15p06p00.are new file mode 100644 index 000000000..e467c1acb Binary files /dev/null and b/nwnds_module/p15p06p00.are differ diff --git a/nwnds_module/p15p06p00.gic b/nwnds_module/p15p06p00.gic new file mode 100644 index 000000000..00a45fa14 Binary files /dev/null and b/nwnds_module/p15p06p00.gic differ diff --git a/nwnds_module/p15p06p00.git b/nwnds_module/p15p06p00.git new file mode 100644 index 000000000..f2ef63003 Binary files /dev/null and b/nwnds_module/p15p06p00.git differ diff --git a/nwnds_module/p15p07p00.are b/nwnds_module/p15p07p00.are new file mode 100644 index 000000000..16da8402c Binary files /dev/null and b/nwnds_module/p15p07p00.are differ diff --git a/nwnds_module/p15p07p00.gic b/nwnds_module/p15p07p00.gic new file mode 100644 index 000000000..1ddba14c1 Binary files /dev/null and b/nwnds_module/p15p07p00.gic differ diff --git a/nwnds_module/p15p07p00.git b/nwnds_module/p15p07p00.git new file mode 100644 index 000000000..f7bfb71c2 Binary files /dev/null and b/nwnds_module/p15p07p00.git differ diff --git a/nwnds_module/p16p06p00.are b/nwnds_module/p16p06p00.are new file mode 100644 index 000000000..9894b1a1b Binary files /dev/null and b/nwnds_module/p16p06p00.are differ diff --git a/nwnds_module/p16p06p00.gic b/nwnds_module/p16p06p00.gic new file mode 100644 index 000000000..6e73e6592 Binary files /dev/null and b/nwnds_module/p16p06p00.gic differ diff --git a/nwnds_module/p16p06p00.git b/nwnds_module/p16p06p00.git new file mode 100644 index 000000000..0dc82058b Binary files /dev/null and b/nwnds_module/p16p06p00.git differ diff --git a/nwnds_module/p16p07p00.are b/nwnds_module/p16p07p00.are new file mode 100644 index 000000000..db303c303 Binary files /dev/null and b/nwnds_module/p16p07p00.are differ diff --git a/nwnds_module/p16p07p00.gic b/nwnds_module/p16p07p00.gic new file mode 100644 index 000000000..574f236a3 Binary files /dev/null and b/nwnds_module/p16p07p00.gic differ diff --git a/nwnds_module/p16p07p00.git b/nwnds_module/p16p07p00.git new file mode 100644 index 000000000..a91d29ca3 Binary files /dev/null and b/nwnds_module/p16p07p00.git differ diff --git a/nwnds_module/p17p05p00.are b/nwnds_module/p17p05p00.are new file mode 100644 index 000000000..27c121d7e Binary files /dev/null and b/nwnds_module/p17p05p00.are differ diff --git a/nwnds_module/p17p05p00.gic b/nwnds_module/p17p05p00.gic new file mode 100644 index 000000000..170dc19d1 Binary files /dev/null and b/nwnds_module/p17p05p00.gic differ diff --git a/nwnds_module/p17p05p00.git b/nwnds_module/p17p05p00.git new file mode 100644 index 000000000..ba2d65a78 Binary files /dev/null and b/nwnds_module/p17p05p00.git differ diff --git a/nwnds_module/p17p06p00.are b/nwnds_module/p17p06p00.are new file mode 100644 index 000000000..c5e9a4360 Binary files /dev/null and b/nwnds_module/p17p06p00.are differ diff --git a/nwnds_module/p17p06p00.gic b/nwnds_module/p17p06p00.gic new file mode 100644 index 000000000..96f346c0c Binary files /dev/null and b/nwnds_module/p17p06p00.gic differ diff --git a/nwnds_module/p17p06p00.git b/nwnds_module/p17p06p00.git new file mode 100644 index 000000000..9789a15ac Binary files /dev/null and b/nwnds_module/p17p06p00.git differ diff --git a/nwnds_module/p17p07p00.are b/nwnds_module/p17p07p00.are new file mode 100644 index 000000000..78d2509f4 Binary files /dev/null and b/nwnds_module/p17p07p00.are differ diff --git a/nwnds_module/p17p07p00.gic b/nwnds_module/p17p07p00.gic new file mode 100644 index 000000000..5b4fa894e Binary files /dev/null and b/nwnds_module/p17p07p00.gic differ diff --git a/nwnds_module/p17p07p00.git b/nwnds_module/p17p07p00.git new file mode 100644 index 000000000..3c674a67d Binary files /dev/null and b/nwnds_module/p17p07p00.git differ diff --git a/nwnds_module/p18p05p00.are b/nwnds_module/p18p05p00.are new file mode 100644 index 000000000..06ffdc543 Binary files /dev/null and b/nwnds_module/p18p05p00.are differ diff --git a/nwnds_module/p18p05p00.gic b/nwnds_module/p18p05p00.gic new file mode 100644 index 000000000..157d10ef1 Binary files /dev/null and b/nwnds_module/p18p05p00.gic differ diff --git a/nwnds_module/p18p05p00.git b/nwnds_module/p18p05p00.git new file mode 100644 index 000000000..10682e8b1 Binary files /dev/null and b/nwnds_module/p18p05p00.git differ diff --git a/nwnds_module/pakubrazibite.uti b/nwnds_module/pakubrazibite.uti new file mode 100644 index 000000000..d9f3e8b65 Binary files /dev/null and b/nwnds_module/pakubrazibite.uti differ diff --git a/nwnds_module/percepgive40gold.ncs b/nwnds_module/percepgive40gold.ncs new file mode 100644 index 000000000..696545690 Binary files /dev/null and b/nwnds_module/percepgive40gold.ncs differ diff --git a/nwnds_module/percepgive40gold.nss b/nwnds_module/percepgive40gold.nss new file mode 100644 index 000000000..ab214f8c1 --- /dev/null +++ b/nwnds_module/percepgive40gold.nss @@ -0,0 +1,73 @@ +//:://///////////////////////////////////////////// +//:: Default On Percieve +//:: NW_C2_DEFAULT2 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Checks to see if the perceived target is an + enemy and if so fires the Determine Combat + Round function +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" + +void main() +{ + //This is the equivalent of a force conversation bubble, should only be used if you want an NPC + //to say something while he is already engaged in combat. + if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION) && GetIsPC(GetLastPerceived()) && GetLastPerceptionSeen()) + { + SpeakOneLinerConversation(); + } + //If the last perception event was hearing based or if someone vanished then go to search mode + if ((GetLastPerceptionVanished()) && GetIsEnemy(GetLastPerceived())) + { + object oGone = GetLastPerceived(); + if((GetAttemptedAttackTarget() == GetLastPerceived() || + GetAttemptedSpellTarget() == GetLastPerceived() || + GetAttackTarget() == GetLastPerceived()) && GetArea(GetLastPerceived()) != GetArea(OBJECT_SELF)) + { + ClearAllActions(); + DetermineCombatRound(); + } + } + //Do not bother checking the last target seen if already fighting + else if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget())) + { + //Check if the last percieved creature was actually seen + if(GetLastPerceptionSeen()) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(); + } + else if(GetIsEnemy(GetLastPerceived())) + { + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) + { + SetFacingPoint(GetPosition(GetLastPerceived())); + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + DetermineCombatRound(); + } + } + //Linked up to the special conversation check to initiate a special one-off conversation + //to get the PCs attention + else if(GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION) && GetIsPC(GetLastPerceived())) + { + ActionStartConversation(OBJECT_SELF); + } + } + } + if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT) && GetLastPerceptionSeen()) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1002)); + } + object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); +if((GetGold(OBJECT_SELF)< 40) && ((GetLocalInt(oPC,"gotgold")) != 1 )) + {GiveGoldToCreature(OBJECT_SELF, 40); + SetLocalInt(oPC,"gotgold",1);} +} diff --git a/nwnds_module/ph_adepravedmind.are b/nwnds_module/ph_adepravedmind.are new file mode 100644 index 000000000..c3303452c Binary files /dev/null and b/nwnds_module/ph_adepravedmind.are differ diff --git a/nwnds_module/ph_adepravedmind.gic b/nwnds_module/ph_adepravedmind.gic new file mode 100644 index 000000000..78519afeb Binary files /dev/null and b/nwnds_module/ph_adepravedmind.gic differ diff --git a/nwnds_module/ph_adepravedmind.git b/nwnds_module/ph_adepravedmind.git new file mode 100644 index 000000000..37640d753 Binary files /dev/null and b/nwnds_module/ph_adepravedmind.git differ diff --git a/nwnds_module/ph_burning_cacti.are b/nwnds_module/ph_burning_cacti.are new file mode 100644 index 000000000..d034c4207 Binary files /dev/null and b/nwnds_module/ph_burning_cacti.are differ diff --git a/nwnds_module/ph_burning_cacti.gic b/nwnds_module/ph_burning_cacti.gic new file mode 100644 index 000000000..0d904a332 Binary files /dev/null and b/nwnds_module/ph_burning_cacti.gic differ diff --git a/nwnds_module/ph_burning_cacti.git b/nwnds_module/ph_burning_cacti.git new file mode 100644 index 000000000..8b863c9c7 Binary files /dev/null and b/nwnds_module/ph_burning_cacti.git differ diff --git a/nwnds_module/ph_citadel_mind.are b/nwnds_module/ph_citadel_mind.are new file mode 100644 index 000000000..c2ab246b0 Binary files /dev/null and b/nwnds_module/ph_citadel_mind.are differ diff --git a/nwnds_module/ph_citadel_mind.gic b/nwnds_module/ph_citadel_mind.gic new file mode 100644 index 000000000..273aaf497 Binary files /dev/null and b/nwnds_module/ph_citadel_mind.gic differ diff --git a/nwnds_module/ph_citadel_mind.git b/nwnds_module/ph_citadel_mind.git new file mode 100644 index 000000000..02587a398 Binary files /dev/null and b/nwnds_module/ph_citadel_mind.git differ diff --git a/nwnds_module/ph_deadheartlair.are b/nwnds_module/ph_deadheartlair.are new file mode 100644 index 000000000..45f8caa98 Binary files /dev/null and b/nwnds_module/ph_deadheartlair.are differ diff --git a/nwnds_module/ph_deadheartlair.gic b/nwnds_module/ph_deadheartlair.gic new file mode 100644 index 000000000..2e9b369b5 Binary files /dev/null and b/nwnds_module/ph_deadheartlair.gic differ diff --git a/nwnds_module/ph_deadheartlair.git b/nwnds_module/ph_deadheartlair.git new file mode 100644 index 000000000..2f4522ae2 Binary files /dev/null and b/nwnds_module/ph_deadheartlair.git differ diff --git a/nwnds_module/ph_hiddenoasis.are b/nwnds_module/ph_hiddenoasis.are new file mode 100644 index 000000000..ef0880a02 Binary files /dev/null and b/nwnds_module/ph_hiddenoasis.are differ diff --git a/nwnds_module/ph_hiddenoasis.gic b/nwnds_module/ph_hiddenoasis.gic new file mode 100644 index 000000000..1ee246397 Binary files /dev/null and b/nwnds_module/ph_hiddenoasis.gic differ diff --git a/nwnds_module/ph_hiddenoasis.git b/nwnds_module/ph_hiddenoasis.git new file mode 100644 index 000000000..2c5eb6a90 Binary files /dev/null and b/nwnds_module/ph_hiddenoasis.git differ diff --git a/nwnds_module/ph_jademanor.are b/nwnds_module/ph_jademanor.are new file mode 100644 index 000000000..d792180c4 Binary files /dev/null and b/nwnds_module/ph_jademanor.are differ diff --git a/nwnds_module/ph_jademanor.gic b/nwnds_module/ph_jademanor.gic new file mode 100644 index 000000000..45ed2ca71 Binary files /dev/null and b/nwnds_module/ph_jademanor.gic differ diff --git a/nwnds_module/ph_jademanor.git b/nwnds_module/ph_jademanor.git new file mode 100644 index 000000000..3916b4e7a Binary files /dev/null and b/nwnds_module/ph_jademanor.git differ diff --git a/nwnds_module/ph_key_aldarath.uti b/nwnds_module/ph_key_aldarath.uti new file mode 100644 index 000000000..76f41099d Binary files /dev/null and b/nwnds_module/ph_key_aldarath.uti differ diff --git a/nwnds_module/ph_key_deadheart.uti b/nwnds_module/ph_key_deadheart.uti new file mode 100644 index 000000000..9b0932cd4 Binary files /dev/null and b/nwnds_module/ph_key_deadheart.uti differ diff --git a/nwnds_module/ph_key_depraved.uti b/nwnds_module/ph_key_depraved.uti new file mode 100644 index 000000000..d23e8d81f Binary files /dev/null and b/nwnds_module/ph_key_depraved.uti differ diff --git a/nwnds_module/ph_key_jademanor.uti b/nwnds_module/ph_key_jademanor.uti new file mode 100644 index 000000000..b2cf17d7b Binary files /dev/null and b/nwnds_module/ph_key_jademanor.uti differ diff --git a/nwnds_module/ph_key_josten.uti b/nwnds_module/ph_key_josten.uti new file mode 100644 index 000000000..8be5d6940 Binary files /dev/null and b/nwnds_module/ph_key_josten.uti differ diff --git a/nwnds_module/ph_key_oakheart.uti b/nwnds_module/ph_key_oakheart.uti new file mode 100644 index 000000000..198eec023 Binary files /dev/null and b/nwnds_module/ph_key_oakheart.uti differ diff --git a/nwnds_module/ph_key_obsidian.uti b/nwnds_module/ph_key_obsidian.uti new file mode 100644 index 000000000..c3844437b Binary files /dev/null and b/nwnds_module/ph_key_obsidian.uti differ diff --git a/nwnds_module/ph_key_s_estate.uti b/nwnds_module/ph_key_s_estate.uti new file mode 100644 index 000000000..2d2d2f61e Binary files /dev/null and b/nwnds_module/ph_key_s_estate.uti differ diff --git a/nwnds_module/ph_oakenheart.are b/nwnds_module/ph_oakenheart.are new file mode 100644 index 000000000..e0ec7f037 Binary files /dev/null and b/nwnds_module/ph_oakenheart.are differ diff --git a/nwnds_module/ph_oakenheart.gic b/nwnds_module/ph_oakenheart.gic new file mode 100644 index 000000000..20482f8d1 Binary files /dev/null and b/nwnds_module/ph_oakenheart.gic differ diff --git a/nwnds_module/ph_oakenheart.git b/nwnds_module/ph_oakenheart.git new file mode 100644 index 000000000..cfb884806 Binary files /dev/null and b/nwnds_module/ph_oakenheart.git differ diff --git a/nwnds_module/ph_southestate.are b/nwnds_module/ph_southestate.are new file mode 100644 index 000000000..67bf0b610 Binary files /dev/null and b/nwnds_module/ph_southestate.are differ diff --git a/nwnds_module/ph_southestate.gic b/nwnds_module/ph_southestate.gic new file mode 100644 index 000000000..f18443aed Binary files /dev/null and b/nwnds_module/ph_southestate.gic differ diff --git a/nwnds_module/ph_southestate.git b/nwnds_module/ph_southestate.git new file mode 100644 index 000000000..6fb59aea2 Binary files /dev/null and b/nwnds_module/ph_southestate.git differ diff --git a/nwnds_module/ph_spid_bite001.uti b/nwnds_module/ph_spid_bite001.uti new file mode 100644 index 000000000..391261d51 Binary files /dev/null and b/nwnds_module/ph_spid_bite001.uti differ diff --git a/nwnds_module/ph_spid_bite002.uti b/nwnds_module/ph_spid_bite002.uti new file mode 100644 index 000000000..fb51f5b8f Binary files /dev/null and b/nwnds_module/ph_spid_bite002.uti differ diff --git a/nwnds_module/ph_spid_bite003.uti b/nwnds_module/ph_spid_bite003.uti new file mode 100644 index 000000000..5c302cc3d Binary files /dev/null and b/nwnds_module/ph_spid_bite003.uti differ diff --git a/nwnds_module/phasespider001.utc b/nwnds_module/phasespider001.utc new file mode 100644 index 000000000..15bb5523d Binary files /dev/null and b/nwnds_module/phasespider001.utc differ diff --git a/nwnds_module/phasespider002.utc b/nwnds_module/phasespider002.utc new file mode 100644 index 000000000..c2acbf098 Binary files /dev/null and b/nwnds_module/phasespider002.utc differ diff --git a/nwnds_module/phasespider003.utc b/nwnds_module/phasespider003.utc new file mode 100644 index 000000000..e4c7c3a76 Binary files /dev/null and b/nwnds_module/phasespider003.utc differ diff --git a/nwnds_module/pl_bird001.utp b/nwnds_module/pl_bird001.utp new file mode 100644 index 000000000..0b5aaa36d Binary files /dev/null and b/nwnds_module/pl_bird001.utp differ diff --git a/nwnds_module/placeablepalcus.itp b/nwnds_module/placeablepalcus.itp new file mode 100644 index 000000000..3b7cca018 Binary files /dev/null and b/nwnds_module/placeablepalcus.itp differ diff --git a/nwnds_module/placeablerespawn.utp b/nwnds_module/placeablerespawn.utp new file mode 100644 index 000000000..7e7b2f878 Binary files /dev/null and b/nwnds_module/placeablerespawn.utp differ diff --git a/nwnds_module/plague_blight.ncs b/nwnds_module/plague_blight.ncs new file mode 100644 index 000000000..9fd04ad3b Binary files /dev/null and b/nwnds_module/plague_blight.ncs differ diff --git a/nwnds_module/plague_blight.nss b/nwnds_module/plague_blight.nss new file mode 100644 index 000000000..b152ac2ea --- /dev/null +++ b/nwnds_module/plague_blight.nss @@ -0,0 +1,93 @@ +#include "NW_I0_SPELLS" + +void DoConDamage(object oTarget) +{ + int nDam = d4(); + int nKillEm = FALSE; + if ( (!GetIsPC( oTarget ) ) || ( GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES ) ) + { + nKillEm = 1; + } + + int nTargetAbility = GetAbilityScore(oTarget, ABILITY_CONSTITUTION); + if ( ( (nTargetAbility - nDam) < 3) && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + + + +} +int DoPlague(object oTarget, float fDelay) +{ + + int nRoll = MySavingThrow(SAVING_THROW_FORT,oTarget,15,SAVING_THROW_TYPE_DISEASE); + + if ( nRoll == 0 ) + { + SetLocalInt(oTarget,"LastRoundSuccess",0); + DelayCommand(fDelay,DoConDamage(oTarget)); + return TRUE; + } + if ( nRoll == 1 ) + { + if ( GetLocalInt(oTarget,"LastRoundSuccess") ) + { + DelayCommand(fDelay,SendMessageToPC(oTarget,"Recovered from Gangrenous Touch")); + DelayCommand(fDelay,SetLocalInt(oTarget,"PB_Plague",0)); + return FALSE; + } + SetLocalInt(oTarget,"LastRoundSuccess",1); + return TRUE; + } + DelayCommand(fDelay,SetLocalInt(oTarget,"PB_Plague",0)); + return FALSE; +} + + +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + + if ( GetLocalInt(oTarget,"PB_Plague") ) + { + SendMessageToPC(oOrigin,"Creature already has this effect."); + return; + } + int nDelay = 0; + + if ( MySavingThrow(SAVING_THROW_FORT,oTarget,15,SAVING_THROW_TYPE_DISEASE) ) + return; + + SetLocalInt(oTarget,"PB_Plague",1); +// effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); +// ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE) ) + { + SendMessageToPC(oOrigin,"Target is immune to disease"); + SendMessageToPC(oTarget,"Immune to disease"); + return; + } + + SetLocalInt(oTarget,"LastRoundSuccess",0); + SendMessageToPC(oTarget,"You've contracted Gangrenous Touch."); + while ( DoPlague(oTarget,RoundsToSeconds(nDelay)) && nDelay < 10 ) + { + nDelay++; + } +} + + + diff --git a/nwnds_module/plagueaura.ncs b/nwnds_module/plagueaura.ncs new file mode 100644 index 000000000..08b972dfa Binary files /dev/null and b/nwnds_module/plagueaura.ncs differ diff --git a/nwnds_module/plagueaura.nss b/nwnds_module/plagueaura.nss new file mode 100644 index 000000000..77a4d995d --- /dev/null +++ b/nwnds_module/plagueaura.nss @@ -0,0 +1,8 @@ +void main() +{ + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_MOB_TYRANT_FOG,"plagueaura1","plagueaura2","rotaura2"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/plagueaura1.ncs b/nwnds_module/plagueaura1.ncs new file mode 100644 index 000000000..37c631414 Binary files /dev/null and b/nwnds_module/plagueaura1.ncs differ diff --git a/nwnds_module/plagueaura1.nss b/nwnds_module/plagueaura1.nss new file mode 100644 index 000000000..57a94e4fc --- /dev/null +++ b/nwnds_module/plagueaura1.nss @@ -0,0 +1,37 @@ +#include "NW_I0_SPELLS" +void DoStrDamage(object oTarget) +{ + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH,d6()); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStr,oTarget); +} + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetEnteringObject(); + + effect eNaus = EffectDazed(); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + eNaus = EffectLinkEffects(eNaus,eVis2); + eNaus = EffectLinkEffects(eNaus,eDur); + + + effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S); + + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + return; + + if(GetIsEnemy(oTarget, oCaster)) + { + if (!MySavingThrow(SAVING_THROW_FORT, oTarget, 15, SAVING_THROW_TYPE_NONE,oCaster)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eNaus,oTarget,RoundsToSeconds(1)); + DelayCommand(0.1,DoStrDamage(oTarget)); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + } +} diff --git a/nwnds_module/plagueaura2.ncs b/nwnds_module/plagueaura2.ncs new file mode 100644 index 000000000..a65ff84f7 Binary files /dev/null and b/nwnds_module/plagueaura2.ncs differ diff --git a/nwnds_module/plagueaura2.nss b/nwnds_module/plagueaura2.nss new file mode 100644 index 000000000..0f33b9491 --- /dev/null +++ b/nwnds_module/plagueaura2.nss @@ -0,0 +1,40 @@ +#include "NW_I0_SPELLS" +void DoStrDamage(object oTarget) +{ + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH,d6()); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eStr,oTarget); +} + +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + + effect eNaus = EffectDazed(); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + eNaus = EffectLinkEffects(eNaus,eVis2); + eNaus = EffectLinkEffects(eNaus,eDur); + + effect eVis = EffectVisualEffect(VFX_IMP_DAZED_S); + + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + break; + if (!MySavingThrow(SAVING_THROW_FORT, oTarget, 15, SAVING_THROW_TYPE_NONE,oCaster)) + { + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eNaus,oTarget,RoundsToSeconds(1)); + DelayCommand(0.1,DoStrDamage(oTarget)); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/plagueblight001.utc b/nwnds_module/plagueblight001.utc new file mode 100644 index 000000000..c594e1af3 Binary files /dev/null and b/nwnds_module/plagueblight001.utc differ diff --git a/nwnds_module/plagueblighthide.uti b/nwnds_module/plagueblighthide.uti new file mode 100644 index 000000000..43a92fcf8 Binary files /dev/null and b/nwnds_module/plagueblighthide.uti differ diff --git a/nwnds_module/plagueblightslam.uti b/nwnds_module/plagueblightslam.uti new file mode 100644 index 000000000..e27f9fdd9 Binary files /dev/null and b/nwnds_module/plagueblightslam.uti differ diff --git a/nwnds_module/poison_1d8_dam.ncs b/nwnds_module/poison_1d8_dam.ncs new file mode 100644 index 000000000..b86add13f Binary files /dev/null and b/nwnds_module/poison_1d8_dam.ncs differ diff --git a/nwnds_module/poison_1d8_dam.nss b/nwnds_module/poison_1d8_dam.nss new file mode 100644 index 000000000..dd980c27a --- /dev/null +++ b/nwnds_module/poison_1d8_dam.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: Poison 1d8 Damage +//:: Poison_1d8_Dam +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + Poison causes 1d8 damage. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: January 14, 2012 +//::////////////////////////////////////////////// + +void main() +{ + object oTarget = OBJECT_SELF; + int oDamage = (d8(1)); + effect eVenom = EffectDamage(oDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVenom, oTarget); +} diff --git a/nwnds_module/poison_2d4_con.ncs b/nwnds_module/poison_2d4_con.ncs new file mode 100644 index 000000000..a765525ba Binary files /dev/null and b/nwnds_module/poison_2d4_con.ncs differ diff --git a/nwnds_module/poison_2d4_con.nss b/nwnds_module/poison_2d4_con.nss new file mode 100644 index 000000000..fa447f1fd --- /dev/null +++ b/nwnds_module/poison_2d4_con.nss @@ -0,0 +1,24 @@ +//::////////////////////////////////////////////// +//:: Poison: 2d4 Constitution damage +//:: poison_2d4_con +//::////////////////////////////////////////////// +/** @file + This is one of the scripts that implement causing + poison ability damage using the ApplyAbilityDamage() + wrapper. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: 01.11.2012 +//::////////////////////////////////////////////// + +#include "inc_abil_damage" + +void main() +{ + object oTarget = OBJECT_SELF; + int nDamage = d4(2); + int nAbility = ABILITY_CONSTITUTION; + + ApplyAbilityDamage(oTarget, nAbility, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f); +} diff --git a/nwnds_module/poison_2d4_str.ncs b/nwnds_module/poison_2d4_str.ncs new file mode 100644 index 000000000..b06999624 Binary files /dev/null and b/nwnds_module/poison_2d4_str.ncs differ diff --git a/nwnds_module/poison_2d4_str.nss b/nwnds_module/poison_2d4_str.nss new file mode 100644 index 000000000..8d69e1bb1 --- /dev/null +++ b/nwnds_module/poison_2d4_str.nss @@ -0,0 +1,24 @@ +//::////////////////////////////////////////////// +//:: Poison: 2d4 Strength damage +//:: poison_2d4_str +//::////////////////////////////////////////////// +/** @file + This is one of the scripts that implement causing + poison ability damage using the ApplyAbilityDamage() + wrapper. +*/ +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: 01.11.2012 +//::////////////////////////////////////////////// + +#include "inc_abil_damage" + +void main() +{ + object oTarget = OBJECT_SELF; + int nDamage = d4(2); + int nAbility = ABILITY_STRENGTH; + + ApplyAbilityDamage(oTarget, nAbility, nDamage, DURATION_TYPE_TEMPORARY, TRUE, -1.0f); +} diff --git a/nwnds_module/pot_asticleswine.uti b/nwnds_module/pot_asticleswine.uti new file mode 100644 index 000000000..3e7c96235 Binary files /dev/null and b/nwnds_module/pot_asticleswine.uti differ diff --git a/nwnds_module/pot_bloodberry.uti b/nwnds_module/pot_bloodberry.uti new file mode 100644 index 000000000..af6d1a041 Binary files /dev/null and b/nwnds_module/pot_bloodberry.uti differ diff --git a/nwnds_module/pot_blueberry.uti b/nwnds_module/pot_blueberry.uti new file mode 100644 index 000000000..62d7fd3e5 Binary files /dev/null and b/nwnds_module/pot_blueberry.uti differ diff --git a/nwnds_module/pot_brownwine.uti b/nwnds_module/pot_brownwine.uti new file mode 100644 index 000000000..b0e50471f Binary files /dev/null and b/nwnds_module/pot_brownwine.uti differ diff --git a/nwnds_module/pot_broy.uti b/nwnds_module/pot_broy.uti new file mode 100644 index 000000000..0f4523a33 Binary files /dev/null and b/nwnds_module/pot_broy.uti differ diff --git a/nwnds_module/pot_bulisberry.uti b/nwnds_module/pot_bulisberry.uti new file mode 100644 index 000000000..910df8ae4 Binary files /dev/null and b/nwnds_module/pot_bulisberry.uti differ diff --git a/nwnds_module/pot_cherry.uti b/nwnds_module/pot_cherry.uti new file mode 100644 index 000000000..48d0c59c4 Binary files /dev/null and b/nwnds_module/pot_cherry.uti differ diff --git a/nwnds_module/pot_coconut.uti b/nwnds_module/pot_coconut.uti new file mode 100644 index 000000000..4c52753be Binary files /dev/null and b/nwnds_module/pot_coconut.uti differ diff --git a/nwnds_module/pot_crimelix.uti b/nwnds_module/pot_crimelix.uti new file mode 100644 index 000000000..23356ae96 Binary files /dev/null and b/nwnds_module/pot_crimelix.uti differ diff --git a/nwnds_module/pot_crimess.uti b/nwnds_module/pot_crimess.uti new file mode 100644 index 000000000..6f7031b1d Binary files /dev/null and b/nwnds_module/pot_crimess.uti differ diff --git a/nwnds_module/pot_deccan.uti b/nwnds_module/pot_deccan.uti new file mode 100644 index 000000000..0ec310a5c Binary files /dev/null and b/nwnds_module/pot_deccan.uti differ diff --git a/nwnds_module/pot_dranja.uti b/nwnds_module/pot_dranja.uti new file mode 100644 index 000000000..f19453cbe Binary files /dev/null and b/nwnds_module/pot_dranja.uti differ diff --git a/nwnds_module/pot_elvenwine.uti b/nwnds_module/pot_elvenwine.uti new file mode 100644 index 000000000..9eef27390 Binary files /dev/null and b/nwnds_module/pot_elvenwine.uti differ diff --git a/nwnds_module/pot_fenberry.uti b/nwnds_module/pot_fenberry.uti new file mode 100644 index 000000000..eaba8cf35 Binary files /dev/null and b/nwnds_module/pot_fenberry.uti differ diff --git a/nwnds_module/pot_goatmilk.uti b/nwnds_module/pot_goatmilk.uti new file mode 100644 index 000000000..246c4f559 Binary files /dev/null and b/nwnds_module/pot_goatmilk.uti differ diff --git a/nwnds_module/pot_grapes.uti b/nwnds_module/pot_grapes.uti new file mode 100644 index 000000000..56295f25b Binary files /dev/null and b/nwnds_module/pot_grapes.uti differ diff --git a/nwnds_module/pot_guava.uti b/nwnds_module/pot_guava.uti new file mode 100644 index 000000000..510161adc Binary files /dev/null and b/nwnds_module/pot_guava.uti differ diff --git a/nwnds_module/pot_gulgapple.uti b/nwnds_module/pot_gulgapple.uti new file mode 100644 index 000000000..796d8cde2 Binary files /dev/null and b/nwnds_module/pot_gulgapple.uti differ diff --git a/nwnds_module/pot_heartberry.uti b/nwnds_module/pot_heartberry.uti new file mode 100644 index 000000000..1c8aa5a08 Binary files /dev/null and b/nwnds_module/pot_heartberry.uti differ diff --git a/nwnds_module/pot_holynectar.uti b/nwnds_module/pot_holynectar.uti new file mode 100644 index 000000000..be296f79b Binary files /dev/null and b/nwnds_module/pot_holynectar.uti differ diff --git a/nwnds_module/pot_honeyale.uti b/nwnds_module/pot_honeyale.uti new file mode 100644 index 000000000..aa2d2ec64 Binary files /dev/null and b/nwnds_module/pot_honeyale.uti differ diff --git a/nwnds_module/pot_javonectar.uti b/nwnds_module/pot_javonectar.uti new file mode 100644 index 000000000..f4546c3df Binary files /dev/null and b/nwnds_module/pot_javonectar.uti differ diff --git a/nwnds_module/pot_justlsale.uti b/nwnds_module/pot_justlsale.uti new file mode 100644 index 000000000..713e5560b Binary files /dev/null and b/nwnds_module/pot_justlsale.uti differ diff --git a/nwnds_module/pot_kiwi.uti b/nwnds_module/pot_kiwi.uti new file mode 100644 index 000000000..9aee400a1 Binary files /dev/null and b/nwnds_module/pot_kiwi.uti differ diff --git a/nwnds_module/pot_klickwin.uti b/nwnds_module/pot_klickwin.uti new file mode 100644 index 000000000..2d3777e99 Binary files /dev/null and b/nwnds_module/pot_klickwin.uti differ diff --git a/nwnds_module/pot_kolatea.uti b/nwnds_module/pot_kolatea.uti new file mode 100644 index 000000000..4684a2e7f Binary files /dev/null and b/nwnds_module/pot_kolatea.uti differ diff --git a/nwnds_module/pot_kulinav.uti b/nwnds_module/pot_kulinav.uti new file mode 100644 index 000000000..36c6bd72c Binary files /dev/null and b/nwnds_module/pot_kulinav.uti differ diff --git a/nwnds_module/pot_lemon.uti b/nwnds_module/pot_lemon.uti new file mode 100644 index 000000000..1036f9b90 Binary files /dev/null and b/nwnds_module/pot_lemon.uti differ diff --git a/nwnds_module/pot_malach.uti b/nwnds_module/pot_malach.uti new file mode 100644 index 000000000..f312909cc Binary files /dev/null and b/nwnds_module/pot_malach.uti differ diff --git a/nwnds_module/pot_milkwine.uti b/nwnds_module/pot_milkwine.uti new file mode 100644 index 000000000..4c13a02f7 Binary files /dev/null and b/nwnds_module/pot_milkwine.uti differ diff --git a/nwnds_module/pot_mulberry.uti b/nwnds_module/pot_mulberry.uti new file mode 100644 index 000000000..c9055131e Binary files /dev/null and b/nwnds_module/pot_mulberry.uti differ diff --git a/nwnds_module/pot_opaka.uti b/nwnds_module/pot_opaka.uti new file mode 100644 index 000000000..bdf217b53 Binary files /dev/null and b/nwnds_module/pot_opaka.uti differ diff --git a/nwnds_module/pot_palmwine.uti b/nwnds_module/pot_palmwine.uti new file mode 100644 index 000000000..2a12d31bd Binary files /dev/null and b/nwnds_module/pot_palmwine.uti differ diff --git a/nwnds_module/pot_peach.uti b/nwnds_module/pot_peach.uti new file mode 100644 index 000000000..6ba8e5e58 Binary files /dev/null and b/nwnds_module/pot_peach.uti differ diff --git a/nwnds_module/pot_plum.uti b/nwnds_module/pot_plum.uti new file mode 100644 index 000000000..da5ba8ed8 Binary files /dev/null and b/nwnds_module/pot_plum.uti differ diff --git a/nwnds_module/pot_portwine.uti b/nwnds_module/pot_portwine.uti new file mode 100644 index 000000000..d6aec42e6 Binary files /dev/null and b/nwnds_module/pot_portwine.uti differ diff --git a/nwnds_module/pot_potwitchbrew.uti b/nwnds_module/pot_potwitchbrew.uti new file mode 100644 index 000000000..ae0133ff5 Binary files /dev/null and b/nwnds_module/pot_potwitchbrew.uti differ diff --git a/nwnds_module/pot_pulque.uti b/nwnds_module/pot_pulque.uti new file mode 100644 index 000000000..0826b5036 Binary files /dev/null and b/nwnds_module/pot_pulque.uti differ diff --git a/nwnds_module/pot_pynia.uti b/nwnds_module/pot_pynia.uti new file mode 100644 index 000000000..53148929b Binary files /dev/null and b/nwnds_module/pot_pynia.uti differ diff --git a/nwnds_module/pot_raspberry.uti b/nwnds_module/pot_raspberry.uti new file mode 100644 index 000000000..513f4f8ba Binary files /dev/null and b/nwnds_module/pot_raspberry.uti differ diff --git a/nwnds_module/pot_redwine.uti b/nwnds_module/pot_redwine.uti new file mode 100644 index 000000000..600174401 Binary files /dev/null and b/nwnds_module/pot_redwine.uti differ diff --git a/nwnds_module/pot_s_bloodberry.uti b/nwnds_module/pot_s_bloodberry.uti new file mode 100644 index 000000000..6b70579dd Binary files /dev/null and b/nwnds_module/pot_s_bloodberry.uti differ diff --git a/nwnds_module/pot_s_blueberry.uti b/nwnds_module/pot_s_blueberry.uti new file mode 100644 index 000000000..35736d063 Binary files /dev/null and b/nwnds_module/pot_s_blueberry.uti differ diff --git a/nwnds_module/pot_s_cherry.uti b/nwnds_module/pot_s_cherry.uti new file mode 100644 index 000000000..760a7bf14 Binary files /dev/null and b/nwnds_module/pot_s_cherry.uti differ diff --git a/nwnds_module/pot_s_coconut.uti b/nwnds_module/pot_s_coconut.uti new file mode 100644 index 000000000..bd67bfec4 Binary files /dev/null and b/nwnds_module/pot_s_coconut.uti differ diff --git a/nwnds_module/pot_s_crimelix.uti b/nwnds_module/pot_s_crimelix.uti new file mode 100644 index 000000000..ca1881c55 Binary files /dev/null and b/nwnds_module/pot_s_crimelix.uti differ diff --git a/nwnds_module/pot_s_crimess.uti b/nwnds_module/pot_s_crimess.uti new file mode 100644 index 000000000..eba0b77dd Binary files /dev/null and b/nwnds_module/pot_s_crimess.uti differ diff --git a/nwnds_module/pot_s_dranja.uti b/nwnds_module/pot_s_dranja.uti new file mode 100644 index 000000000..7268eedac Binary files /dev/null and b/nwnds_module/pot_s_dranja.uti differ diff --git a/nwnds_module/pot_s_fenberry.uti b/nwnds_module/pot_s_fenberry.uti new file mode 100644 index 000000000..70b57c6fe Binary files /dev/null and b/nwnds_module/pot_s_fenberry.uti differ diff --git a/nwnds_module/pot_s_grapes.uti b/nwnds_module/pot_s_grapes.uti new file mode 100644 index 000000000..082a045a5 Binary files /dev/null and b/nwnds_module/pot_s_grapes.uti differ diff --git a/nwnds_module/pot_s_guava.uti b/nwnds_module/pot_s_guava.uti new file mode 100644 index 000000000..db8a21171 Binary files /dev/null and b/nwnds_module/pot_s_guava.uti differ diff --git a/nwnds_module/pot_s_gulgapple.uti b/nwnds_module/pot_s_gulgapple.uti new file mode 100644 index 000000000..8f0cdcef4 Binary files /dev/null and b/nwnds_module/pot_s_gulgapple.uti differ diff --git a/nwnds_module/pot_s_heartberry.uti b/nwnds_module/pot_s_heartberry.uti new file mode 100644 index 000000000..7b24b0652 Binary files /dev/null and b/nwnds_module/pot_s_heartberry.uti differ diff --git a/nwnds_module/pot_s_holynectar.uti b/nwnds_module/pot_s_holynectar.uti new file mode 100644 index 000000000..dbe21aeb0 Binary files /dev/null and b/nwnds_module/pot_s_holynectar.uti differ diff --git a/nwnds_module/pot_s_kiwi.uti b/nwnds_module/pot_s_kiwi.uti new file mode 100644 index 000000000..8ff5c3faa Binary files /dev/null and b/nwnds_module/pot_s_kiwi.uti differ diff --git a/nwnds_module/pot_s_kulinav.uti b/nwnds_module/pot_s_kulinav.uti new file mode 100644 index 000000000..2441c6c2a Binary files /dev/null and b/nwnds_module/pot_s_kulinav.uti differ diff --git a/nwnds_module/pot_s_malach.uti b/nwnds_module/pot_s_malach.uti new file mode 100644 index 000000000..54c52f91e Binary files /dev/null and b/nwnds_module/pot_s_malach.uti differ diff --git a/nwnds_module/pot_s_mulberry.uti b/nwnds_module/pot_s_mulberry.uti new file mode 100644 index 000000000..ef2ca7a6d Binary files /dev/null and b/nwnds_module/pot_s_mulberry.uti differ diff --git a/nwnds_module/pot_s_opaka.uti b/nwnds_module/pot_s_opaka.uti new file mode 100644 index 000000000..75fd051ce Binary files /dev/null and b/nwnds_module/pot_s_opaka.uti differ diff --git a/nwnds_module/pot_s_peach.uti b/nwnds_module/pot_s_peach.uti new file mode 100644 index 000000000..009af9714 Binary files /dev/null and b/nwnds_module/pot_s_peach.uti differ diff --git a/nwnds_module/pot_s_plum.uti b/nwnds_module/pot_s_plum.uti new file mode 100644 index 000000000..75a4ca8e3 Binary files /dev/null and b/nwnds_module/pot_s_plum.uti differ diff --git a/nwnds_module/pot_s_pynia.uti b/nwnds_module/pot_s_pynia.uti new file mode 100644 index 000000000..67607ec93 Binary files /dev/null and b/nwnds_module/pot_s_pynia.uti differ diff --git a/nwnds_module/pot_s_raspberry.uti b/nwnds_module/pot_s_raspberry.uti new file mode 100644 index 000000000..362da0eff Binary files /dev/null and b/nwnds_module/pot_s_raspberry.uti differ diff --git a/nwnds_module/pot_s_siannan.uti b/nwnds_module/pot_s_siannan.uti new file mode 100644 index 000000000..ed574ad6e Binary files /dev/null and b/nwnds_module/pot_s_siannan.uti differ diff --git a/nwnds_module/pot_s_strawberry.uti b/nwnds_module/pot_s_strawberry.uti new file mode 100644 index 000000000..f8ddc5da5 Binary files /dev/null and b/nwnds_module/pot_s_strawberry.uti differ diff --git a/nwnds_module/pot_s_taslberry.uti b/nwnds_module/pot_s_taslberry.uti new file mode 100644 index 000000000..c2f0ed286 Binary files /dev/null and b/nwnds_module/pot_s_taslberry.uti differ diff --git a/nwnds_module/pot_s_tulaqberry.uti b/nwnds_module/pot_s_tulaqberry.uti new file mode 100644 index 000000000..0c2149137 Binary files /dev/null and b/nwnds_module/pot_s_tulaqberry.uti differ diff --git a/nwnds_module/pot_s_vhalberry.uti b/nwnds_module/pot_s_vhalberry.uti new file mode 100644 index 000000000..7e6742c6f Binary files /dev/null and b/nwnds_module/pot_s_vhalberry.uti differ diff --git a/nwnds_module/pot_s_zzgresh.uti b/nwnds_module/pot_s_zzgresh.uti new file mode 100644 index 000000000..4bb7f788d Binary files /dev/null and b/nwnds_module/pot_s_zzgresh.uti differ diff --git a/nwnds_module/pot_sapwine.uti b/nwnds_module/pot_sapwine.uti new file mode 100644 index 000000000..fa8a65763 Binary files /dev/null and b/nwnds_module/pot_sapwine.uti differ diff --git a/nwnds_module/pot_scupperwine.uti b/nwnds_module/pot_scupperwine.uti new file mode 100644 index 000000000..e79d46d6f Binary files /dev/null and b/nwnds_module/pot_scupperwine.uti differ diff --git a/nwnds_module/pot_siannan.uti b/nwnds_module/pot_siannan.uti new file mode 100644 index 000000000..0571506bb Binary files /dev/null and b/nwnds_module/pot_siannan.uti differ diff --git a/nwnds_module/pot_spicedmead.uti b/nwnds_module/pot_spicedmead.uti new file mode 100644 index 000000000..9f7e8697b Binary files /dev/null and b/nwnds_module/pot_spicedmead.uti differ diff --git a/nwnds_module/pot_spicedwine.uti b/nwnds_module/pot_spicedwine.uti new file mode 100644 index 000000000..8cdd525a6 Binary files /dev/null and b/nwnds_module/pot_spicedwine.uti differ diff --git a/nwnds_module/pot_spinachjuice.uti b/nwnds_module/pot_spinachjuice.uti new file mode 100644 index 000000000..3c4308206 Binary files /dev/null and b/nwnds_module/pot_spinachjuice.uti differ diff --git a/nwnds_module/pot_strawberry.uti b/nwnds_module/pot_strawberry.uti new file mode 100644 index 000000000..81b8abe9b Binary files /dev/null and b/nwnds_module/pot_strawberry.uti differ diff --git a/nwnds_module/pot_taslberry.uti b/nwnds_module/pot_taslberry.uti new file mode 100644 index 000000000..6f75af292 Binary files /dev/null and b/nwnds_module/pot_taslberry.uti differ diff --git a/nwnds_module/pot_tulaqberry.uti b/nwnds_module/pot_tulaqberry.uti new file mode 100644 index 000000000..f1d5692a0 Binary files /dev/null and b/nwnds_module/pot_tulaqberry.uti differ diff --git a/nwnds_module/pot_vhalberry.uti b/nwnds_module/pot_vhalberry.uti new file mode 100644 index 000000000..31bc4411f Binary files /dev/null and b/nwnds_module/pot_vhalberry.uti differ diff --git a/nwnds_module/pot_witchsbrew.uti b/nwnds_module/pot_witchsbrew.uti new file mode 100644 index 000000000..36e2138d0 Binary files /dev/null and b/nwnds_module/pot_witchsbrew.uti differ diff --git a/nwnds_module/pot_zzgresh.uti b/nwnds_module/pot_zzgresh.uti new file mode 100644 index 000000000..2728c96a2 Binary files /dev/null and b/nwnds_module/pot_zzgresh.uti differ diff --git a/nwnds_module/prairelemhide.uti b/nwnds_module/prairelemhide.uti new file mode 100644 index 000000000..051bcfb9a Binary files /dev/null and b/nwnds_module/prairelemhide.uti differ diff --git a/nwnds_module/prairelemslam.uti b/nwnds_module/prairelemslam.uti new file mode 100644 index 000000000..51357f145 Binary files /dev/null and b/nwnds_module/prairelemslam.uti differ diff --git a/nwnds_module/prc_alterations.nss b/nwnds_module/prc_alterations.nss new file mode 100644 index 000000000..40abb8128 --- /dev/null +++ b/nwnds_module/prc_alterations.nss @@ -0,0 +1,91 @@ +//:://///////////////////////////////////////////// +//:: Include nexus +//:: prc_alterations +//:://///////////////////////////////////////////// +/* + This is the original include file for the PRC Spell Engine. + + Various spells, components and designs within this system have + been contributed by many individuals within and without the PRC. + + + These days, it serves to gather links to almost all the PRC + includes to one file. Should probably get sorted out someday, + since this slows compilation. On the other hand, it may be + necessary, since the custom compiler can't seem to handle + the most twisted include loops. + Related TODO to any C++ experts: Add #DEFINE support to nwnnsscomp + + Also, this file contains misceallenous functions that haven't + got a better home. +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + + +//return a location that PCs will never be able to access +location PRC_GetLimbo(); + +//int GetSkill(object oObject, int nSkill, int bSynergy = FALSE, int bSize = FALSE, int bAbilityMod = TRUE, int bEffect = TRUE, int bArmor = TRUE, int bShield = TRUE, int bFeat = TRUE); + +////////////////////////////////////////////////// +/* Constants */ +////////////////////////////////////////////////// + +// const int ERROR_CODE_5_FIX_YET_ANOTHER_TIME = 1; + +////////////////////////////////////////////////// +/* Include section */ +////////////////////////////////////////////////// + +// Generic includes + +#include "inc_abil_damage" + +////////////////////////////////////////////////// +/* Function Definitions */ +////////////////////////////////////////////////// + +//return a location that PCs will never be able to access +location PRC_GetLimbo() +{ + int i = 0; + location lLimbo; + + while (1) + { + object oLimbo = GetObjectByTag("Limbo", i++); + + if (oLimbo == OBJECT_INVALID) { + PrintString("PRC ERROR: no Limbo area! (did you import the latest PRC .ERF file?)"); + return lLimbo; + } + + if (GetName(oLimbo) == "Limbo" && GetArea(oLimbo) == OBJECT_INVALID) + { + vector vLimbo = Vector(0.0f, 0.0f, 0.0f); + lLimbo = Location(oLimbo, vLimbo, 0.0f); + } + } + return lLimbo; //never reached +} + +//Also serves as a store of all item creation feats +int GetItemCreationFeatCount() +{ + return(GetHasFeat(FEAT_CRAFT_WONDROUS) + + GetHasFeat(FEAT_CRAFT_STAFF) + + GetHasFeat(FEAT_CRAFT_ARMS_ARMOR) + + GetHasFeat(FEAT_FORGE_RING) + + GetHasFeat(FEAT_CRAFT_ROD) + + GetHasFeat(FEAT_CRAFT_CONSTRUCT) + + GetHasFeat(FEAT_SCRIBE_SCROLL) + + GetHasFeat(FEAT_BREW_POTION) + + GetHasFeat(FEAT_CRAFT_WAND) + + GetHasFeat(FEAT_ATTUNE_GEM) + + GetHasFeat(FEAT_CRAFT_SKULL_TALISMAN) + + GetHasFeat(FEAT_INSCRIBE_RUNE) + //+ GetHasFeat(?) + ); +} + diff --git a/nwnds_module/prc_amagsys_gain.ncs b/nwnds_module/prc_amagsys_gain.ncs new file mode 100644 index 000000000..e3061fc79 Binary files /dev/null and b/nwnds_module/prc_amagsys_gain.ncs differ diff --git a/nwnds_module/prc_amagsys_gain.nss b/nwnds_module/prc_amagsys_gain.nss new file mode 100644 index 000000000..77b418bdb --- /dev/null +++ b/nwnds_module/prc_amagsys_gain.nss @@ -0,0 +1,556 @@ +//::////////////////////////////////////////////// +//:: Alternate magic system gain evaluation script +//:: prc_amagsys_gain +//::////////////////////////////////////////////// +/** @file + This file determines if the given character + has gained new spells / powers / utterances / + whathaveyou since the last time it was run. + If so, it starts the relevant selection + conversations. + + Add new classes to their respective magic + user type block, or if such doesn't exist + yet for the system the class belongs to, + make a new block for them at the end of main(). + + + @author Ornedan + @date Created - 2006.12.14 + */ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "inc_dynconv" +#include "psi_inc_psifunc" +#include "inc_newspellbook" +#include "true_inc_trufunc" +#include "tob_inc_tobfunc" +#include "shd_inc_shdfunc" +#include "inv_inc_invfunc" + +////////////////////////////////////////////////// +/* Function prototypes */ +////////////////////////////////////////////////// + +void CheckSpellbooks(object oPC); +void CheckPsionics(object oPC); +void CheckInvocations(object oPC); +void CheckToB(object oPC); +void CheckShadow(object oPC); +void CheckTruenaming(object oPC); +int CheckMissingPowers(object oPC, int nClass); +int CheckMissingSpells(object oPC, int nClass, int nMinLevel, int nMaxLevel); +int CheckMissingUtterances(object oPC, int nClass, int nLexicon); +int CheckMissingManeuvers(object oPC, int nClass); +int CheckMissingMysteries(object oPC, int nClass); +int CheckMissingInvocations(object oPC, int nClass); +void AMSCompatibilityCheck(object oPC); + +////////////////////////////////////////////////// +/* Function definitions */ +////////////////////////////////////////////////// + +void main() +{ + object oPC = OBJECT_SELF; + + // Sanity checks - Shifted or polymorphed characters may have their hide fucked up, and might be missing access to their hide-feats + // @todo Shifting probably doesn't do this anymore, could be ditchable - Ornedan, 20061214 + if(GetLocalInt(oPC, "nPCShifted")) + return; + effect eTest = GetFirstEffect(oPC); + while(GetIsEffectValid(eTest)) + { + if(GetEffectType(eTest) == EFFECT_TYPE_POLYMORPH) + return; + eTest = GetNextEffect(oPC); + } + + DelayCommand(0.0f, CheckSpellbooks(oPC)); +} + +// Handle new spellbooks +void CheckSpellbooks(object oPC) +{ + if(!GetPRCSwitch(PRC_BARD_DISALLOW_NEWSPELLBOOK) && CheckMissingSpells(oPC, CLASS_TYPE_BARD, 0, 6)) + return; + if(!GetPRCSwitch(PRC_SORC_DISALLOW_NEWSPELLBOOK) && CheckMissingSpells(oPC, CLASS_TYPE_SORCERER, 0, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_SUEL_ARCHANAMACH, 1, 5)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_FAVOURED_SOUL, 0, 9)) + return; +// if(CheckMissingSpells(oPC, CLASS_TYPE_MYSTIC, 0, 9)) +// return; + if(CheckMissingSpells(oPC, CLASS_TYPE_WARMAGE, 0, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_DREAD_NECROMANCER, 1, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_HEXBLADE, 1, 4)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_DUSKBLADE, 0, 5)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_JUSTICEWW, 1, 4)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_KNIGHT_WEAVE, 1, 6)) + return; +// if(CheckMissingSpells(oPC, CLASS_TYPE_WITCH, 0, 9)) +// return; + if(CheckMissingSpells(oPC, CLASS_TYPE_SUBLIME_CHORD, 4, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_ARCHIVIST, 0, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_BEGUILER, 0, 9)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_HARPER, 1, 3)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_TEMPLAR, 0, 9)) +// return; + if(CheckMissingSpells(oPC, CLASS_TYPE_ASSASSIN, 1, 4)) + return; + if(CheckMissingSpells(oPC, CLASS_TYPE_CELEBRANT_SHARESS, 1, 4)) + return; + + DelayCommand(0.0f, CheckPsionics(oPC)); +} + +// Handle psionics +void CheckPsionics(object oPC) +{ + if(CheckMissingPowers(oPC, CLASS_TYPE_PSION)) + return; + if(CheckMissingPowers(oPC, CLASS_TYPE_WILDER)) + return; + if(CheckMissingPowers(oPC, CLASS_TYPE_PSYWAR)) + return; + if(CheckMissingPowers(oPC, CLASS_TYPE_PSYCHIC_ROGUE)) + return; + if(CheckMissingPowers(oPC, CLASS_TYPE_FIST_OF_ZUOKEN)) + return; + if(CheckMissingPowers(oPC, CLASS_TYPE_WARMIND)) + return; + //expanded knowledge + if(CheckMissingPowers(oPC, -1)) + return; + //epic expanded knowledge + if(CheckMissingPowers(oPC, -2)) + return; + + DelayCommand(0.0f, CheckInvocations(oPC)); +} + +// Handle Invocations +void CheckInvocations(object oPC) +{ + if(CheckMissingInvocations(oPC, CLASS_TYPE_DRAGONFIRE_ADEPT)) + return; + if(CheckMissingInvocations(oPC, CLASS_TYPE_WARLOCK)) + return; + if(CheckMissingInvocations(oPC, CLASS_TYPE_DRAGON_SHAMAN)) + return; + //extra invocations + if(CheckMissingInvocations(oPC, CLASS_TYPE_INVALID)) + return; + //epic extra invocations + if(CheckMissingInvocations(oPC, -2)) + return; + + DelayCommand(0.0f, CheckToB(oPC)); +} + +// Handle Tome of Battle +void CheckToB(object oPC) +{ + if(CheckMissingManeuvers(oPC, CLASS_TYPE_CRUSADER)) + return; + if(CheckMissingManeuvers(oPC, CLASS_TYPE_SWORDSAGE)) + return; + if(CheckMissingManeuvers(oPC, CLASS_TYPE_WARBLADE)) + return; + + DelayCommand(0.0f, CheckShadow(oPC)); +} + +// Handle Shadowcasting +void CheckShadow(object oPC) +{ + if(CheckMissingMysteries(oPC, CLASS_TYPE_SHADOWCASTER)) + return; + if(CheckMissingMysteries(oPC, CLASS_TYPE_SHADOWSMITH)) + return; + + DelayCommand(0.0f, CheckTruenaming(oPC)); +} + +// Handle Truenaming - Three different Lexicons to check +void CheckTruenaming(object oPC) +{ + if(CheckMissingUtterances(oPC, CLASS_TYPE_TRUENAMER, LEXICON_EVOLVING_MIND)) + return; + if(CheckMissingUtterances(oPC, CLASS_TYPE_TRUENAMER, LEXICON_CRAFTED_TOOL)) + return; + if(CheckMissingUtterances(oPC, CLASS_TYPE_TRUENAMER, LEXICON_PERFECTED_MAP)) + return; + + if(!GetIsDM(oPC)) + DelayCommand(0.0f, AMSCompatibilityCheck(oPC)); +} + +int CheckMissingPowers(object oPC, int nClass) +{ + int nLevel = GetLevelByClass(nClass, oPC); + if(!nLevel && nClass != -1 && nClass != -2) + return FALSE; + else if(nClass == -1 && !GetHasFeat(FEAT_EXPANDED_KNOWLEDGE_1)) + return FALSE; + else if(nClass == -2 && !GetHasFeat(FEAT_EPIC_EXPANDED_KNOWLEDGE_1)) + return FALSE; + + int nCurrentPowers = GetPowerCount(oPC, nClass); + int nMaxPowers = GetMaxPowerCount(oPC, nClass); + + if(nCurrentPowers < nMaxPowers) + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "nClass", nClass); + StartDynamicConversation("psi_powconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + return FALSE; +} + +int CheckMissingInvocations(object oPC, int nClass) +{ + int nLevel = GetLevelByClass(nClass, oPC); + if(!nLevel && (nClass == CLASS_TYPE_DRAGONFIRE_ADEPT || nClass == CLASS_TYPE_WARLOCK || nClass == CLASS_TYPE_DRAGON_SHAMAN)) + return FALSE; + else if(nClass == CLASS_TYPE_INVALID && !GetHasFeat(FEAT_EXTRA_INVOCATION_I)) + return FALSE; + else if(nClass == -2 && !GetHasFeat(FEAT_EPIC_EXTRA_INVOCATION_I)) + return FALSE; + + int nCurrentInvocations = GetInvocationCount(oPC, nClass); + if(DEBUG) DoDebug("Current Invocations: " + IntToString(nCurrentInvocations)); + int nMaxInvocations = GetMaxInvocationCount(oPC, nClass); + if(DEBUG) DoDebug("Max Invocations: " + IntToString(nMaxInvocations)); + + if(nCurrentInvocations < nMaxInvocations) + { + // Mark the class for which the PC is to gain invocations and start the conversation + SetLocalInt(oPC, "nClass", nClass); + StartDynamicConversation("inv_invokeconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + return FALSE; +} + +void AddSpellsForLevel(int nClass, int nLevel) +{ + object oPC = OBJECT_SELF; + object oSkin = GetPCSkin(oPC); + object oToken = GetHideToken(oPC); + string sFile = GetFileForClass(nClass); + string sSpellbook; + int nSpellbookType = GetSpellbookTypeForClass(nClass); + if(nSpellbookType == SPELLBOOK_TYPE_SPONTANEOUS) + sSpellbook = "Spellbook"+IntToString(nClass); + else + sSpellbook = "Spellbook_Known_"+IntToString(nClass)+"_"+IntToString(nLevel); + + // Create spells known persistant array if it is missing + int nSize = array_get_size(oToken, sSpellbook); + if (nSize < 0) + { + array_create(oToken, sSpellbook); + nSize = 0; + } + + //check for learnable spells + object oToken_Class = GetObjectByTag("SpellLvl_" + IntToString(nClass) + "_Level_" + IntToString(nLevel)); + int nSpells_Total = array_get_size(oToken_Class, "Lkup"); + int i; + for(i = 0; i < nSpells_Total; i++) + { + int nSpellbookID = array_get_int(oToken_Class, "Lkup", i); + if(Get2DAString(sFile, "AL", nSpellbookID) != "1") + { + array_set_int(oToken, sSpellbook, nSize, nSpellbookID); + nSize++; + if(nSpellbookType == SPELLBOOK_TYPE_SPONTANEOUS) + { + int nIPFeatID = StringToInt(Get2DACache(sFile, "IPFeatID", nSpellbookID)); + int nFeatID = StringToInt(Get2DACache(sFile, "FeatID", nSpellbookID)); + AddSpellUse(oPC, nSpellbookID, nClass, sFile, "NewSpellbookMem_" + IntToString(nClass), nSpellbookType, oSkin, nFeatID, nIPFeatID); + } + } + } +} + +int CheckMissingSpells(object oPC, int nClass, int nMinLevel, int nMaxLevel) +{ + int nLevel; + //Raks cast as sorcs + if(nClass == CLASS_TYPE_SORCERER && GetRacialType(oPC) == RACIAL_TYPE_RAKSHASA) + nLevel = GetLevelByClass(CLASS_TYPE_OUTSIDER, oPC); +// else if(nClass == CLASS_TYPE_SORCERER && GetRacialType(oPC) == RACIAL_TYPE_BOZAK) //Bozaks cast as sorcs +// nLevel = GetLevelByClass(CLASS_TYPE_DRAGON, oPC); + else if(nClass == CLASS_TYPE_SORCERER && GetRacialType(oPC) == RACIAL_TYPE_DRIDER) //Driders cast as sorcs + nLevel = GetLevelByClass(CLASS_TYPE_ABERRATION, oPC); + else + nLevel = nClass == CLASS_TYPE_SUBLIME_CHORD ? GetLevelByClass(nClass, oPC) : GetSpellslotLevel(nClass, oPC); + + if (DEBUG) DoDebug("CheckMissingSpells 1 Class: " + IntToString(nClass)); + if (DEBUG) DoDebug("CheckMissingSpells 1 Level: " + IntToString(nLevel)); + + if(!nLevel) + return FALSE; + if(nClass == CLASS_TYPE_BARD || nClass == CLASS_TYPE_SORCERER) + { + if((GetLevelByClass(nClass, oPC) == nLevel) //no PrC + && !(GetHasFeat(FEAT_DRACONIC_GRACE, oPC) || GetHasFeat(FEAT_DRACONIC_BREATH, oPC))) //no Draconic feats that apply + return FALSE; + } + else if(nClass == CLASS_TYPE_ARCHIVIST) + { + int nLastGainLevel = GetPersistantLocalInt(oPC, "LastSpellGainLevel"); + nLevel = GetLevelByClass(CLASS_TYPE_ARCHIVIST, oPC); + + if(nLastGainLevel < nLevel) + { + if(nLevel == 1) + { + //count the number of available at 1st level spells + int nSpellsAvailable = 3 + GetAbilityModifier(ABILITY_INTELLIGENCE, oPC); + SetLocalInt(oPC, "LrnLvlUp", nSpellsAvailable); + } + else if(nLevel > 1) + //add additional 2 spells form cleric list + SetLocalInt(oPC, "LrnLvlUp", 2); + + SetLocalInt(oPC, "SpellGainClass", CLASS_TYPE_ARCHIVIST); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, TRUE, FALSE, oPC); + + return TRUE; + } + //add cleric spells known for level 0 + else if(persistant_array_get_size(oPC, "Spellbook_Known_"+IntToString(CLASS_TYPE_ARCHIVIST)+"_0") < 5) // TODO: replace with GetSpellKnownCurrentCount + { + ActionDoCommand(AddSpellsForLevel(CLASS_TYPE_ARCHIVIST, 0)); + } + else + return FALSE; + } + + if (DEBUG) DoDebug("CheckMissingSpells 2 Class: " + IntToString(nClass)); + if (DEBUG) DoDebug("CheckMissingSpells 2 Level: " + IntToString(nLevel)); + + int i; + for(i = nMinLevel; i <= nMaxLevel; i++) + { + int nMaxSpells = GetSpellKnownMaxCount(nLevel, i, nClass, oPC); + if(nMaxSpells > 0) + { + int nCurrentSpells = GetSpellKnownCurrentCount(oPC, i, nClass); + int nSpellsAvailable = GetSpellUnknownCurrentCount(oPC, i, nClass); + + if(nCurrentSpells < nMaxSpells && nSpellsAvailable > 0) + { + if(GetSpellbookTypeForClass(nClass) == SPELLBOOK_TYPE_SPONTANEOUS && bKnowsAllClassSpells(nClass)) + { + ActionDoCommand(AddSpellsForLevel(nClass, i)); + } + else + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "SpellGainClass", nClass); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + SetLocalInt(oPC, "SpellbookMaxSpelllevel", nMaxLevel); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + } + } + } + //Advanced Learning check + nLevel = GetLevelByClass(nClass, oPC); + int nALSpells = GetPersistantLocalInt(oPC, "AdvancedLearning_"+IntToString(nClass)); + if(nClass == CLASS_TYPE_BEGUILER && nALSpells < (nLevel+1)/4)//one every 4 levels starting at 3. + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "SpellGainClass", CLASS_TYPE_BEGUILER); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + SetLocalInt(oPC, "AdvancedLearning", 1); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + return TRUE; + } + else if(nClass == CLASS_TYPE_DREAD_NECROMANCER && nALSpells < nLevel/4)//one every 4 levels + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "SpellGainClass", CLASS_TYPE_DREAD_NECROMANCER); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + SetLocalInt(oPC, "AdvancedLearning", 1); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + return TRUE; + } + else if(nClass == CLASS_TYPE_WARMAGE) + { + if((nLevel >= 40 && nALSpells < 9) ||// :/ + (nLevel >= 36 && nLevel < 40 && nALSpells < 8) || + (nLevel >= 32 && nLevel < 36 && nALSpells < 7) || + (nLevel >= 28 && nLevel < 32 && nALSpells < 6) || + (nLevel >= 24 && nLevel < 28 && nALSpells < 5) || + (nLevel >= 16 && nLevel < 24 && nALSpells < 4) || + (nLevel >= 11 && nLevel < 16 && nALSpells < 3) || + (nLevel >= 6 && nLevel < 11 && nALSpells < 2) || + (nLevel >= 3 && nLevel < 6 && nALSpells < 1)) + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "SpellGainClass", CLASS_TYPE_WARMAGE); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + SetLocalInt(oPC, "AdvancedLearning", 1); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + return TRUE; + } + } + else if(nClass == CLASS_TYPE_NIGHTSTALKER && nALSpells < (nLevel+1)/6)//one every 6 levels starting at 5th + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "SpellGainClass", CLASS_TYPE_NIGHTSTALKER); + SetLocalInt(oPC, "SpellbookMinSpelllevel", nMinLevel); + SetLocalInt(oPC, "AdvancedLearning", 1); + StartDynamicConversation("prc_s_spellgain", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + return TRUE; + } + + return FALSE; +} + +int CheckMissingUtterances(object oPC, int nClass, int nLexicon) +{ + int nLevel = GetLevelByClass(nClass, oPC); + if(!nLevel) + return FALSE; + + int nCurrentUtterances = GetUtteranceCount(oPC, nClass, nLexicon); + int nMaxUtterances = GetMaxUtteranceCount(oPC, nClass, nLexicon); + if(DEBUG) DoDebug("CheckMissingUtterances(" + IntToString(nClass) + ", " + IntToString(nLexicon) + ", " + GetName(oPC) + ") = " + IntToString(nCurrentUtterances) + ", " + IntToString(nMaxUtterances)); + + if(nCurrentUtterances < nMaxUtterances) + { + // Mark the class for which the PC is to gain Utterances and start the conversation + SetLocalInt(oPC, "nClass", nClass); + StartDynamicConversation("true_utterconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + return FALSE; +} + +int CheckMissingManeuvers(object oPC, int nClass) +{ + int nLevel = GetLevelByClass(nClass, oPC); + if(!nLevel) + return FALSE; + + int nCurrentManeuvers = GetManeuverCount(oPC, nClass, MANEUVER_TYPE_MANEUVER); + int nMaxManeuvers = GetMaxManeuverCount(oPC, nClass, MANEUVER_TYPE_MANEUVER); + int nCurrentStances = GetManeuverCount(oPC, nClass, MANEUVER_TYPE_STANCE); + int nMaxStances = GetMaxManeuverCount(oPC, nClass, MANEUVER_TYPE_STANCE); + + if(nCurrentManeuvers < nMaxManeuvers || nCurrentStances < nMaxStances) + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "nClass", nClass); + StartDynamicConversation("tob_moveconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + return FALSE; +} + +int CheckMissingMysteries(object oPC, int nClass) +{ + int nLevel = GetLevelByClass(nClass, oPC); + if(!nLevel) + return FALSE; + + int nCurrentMysteries = GetMysteryCount(oPC, nClass); + int nMaxMysteries = GetMaxMysteryCount(oPC, nClass); + + if(nCurrentMysteries < nMaxMysteries) + { + // Mark the class for which the PC is to gain powers and start the conversation + SetLocalInt(oPC, "nClass", nClass); + StartDynamicConversation("shd_mystconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + return TRUE; + } + return FALSE; +} + +//AMS Compatibility functions - xwarren: +void CopyAMSArray(object oHideToken, object oAMSToken, int nClass, string sArray, int nMin, int nMax, int nLoopSize = 100) +{ + string sFile = GetFileForClass(nClass); + int i = nMin; + while(i < nMin + nLoopSize && i < nMax) + { + int nSpellbookID = array_get_int(oHideToken, sArray, i); + int nSpell = StringToInt(Get2DACache(sFile, "RealSpellID", nSpellbookID)); + if(DEBUG) DoDebug("Copying spell "+IntToString(nSpell)); + array_set_int(oAMSToken, sArray, i, nSpell); + i++; + } + if(i < nMax) + DelayCommand(0.0, CopyAMSArray(oHideToken, oAMSToken, nClass, sArray, i, nMax)); +} + +void DoBuckUpAMS(object oPC, int nClass, string sSpellbook, object oHideToken, object oAMSToken) +{ + if(DEBUG) DoDebug("Creating buck-up copy of "+sSpellbook); + if(array_exists(oAMSToken, sSpellbook)) + array_delete(oAMSToken, sSpellbook); + array_create(oAMSToken, sSpellbook); + int nSize = array_get_size(oHideToken, sSpellbook); + DelayCommand(0.0, CopyAMSArray(oHideToken, oAMSToken, nClass, sSpellbook, 0, nSize)); +} + +void AMSCompatibilityCheck(object oPC) +{ + //Get an extra hide token with amagsys info + object oAMSToken = GetHideToken(oPC, TRUE); + object oHideToken = GetHideToken(oPC); + + int i; + for(i = 1; i <= 3; i++) + { + int nClass = GetClassByPosition(i, oPC); + string sSpellbook; + int nSpellbookType = GetSpellbookTypeForClass(nClass); + if(nSpellbookType == SPELLBOOK_TYPE_SPONTANEOUS) + { + sSpellbook = "Spellbook"+IntToString(nClass); + int nSize1 = array_get_size(oHideToken, sSpellbook); + int nSize2 = array_get_size(oAMSToken, sSpellbook); + if(nSize1 > nSize2) + DelayCommand(0.1f, DoBuckUpAMS(oPC, nClass, sSpellbook, oHideToken, oAMSToken)); + } + else if(nSpellbookType == SPELLBOOK_TYPE_PREPARED) + { + int j; + for(j = 0; j <= 9; j++) + { + sSpellbook = "Spellbook_Known_"+IntToString(nClass)+"_"+IntToString(j); + int nSize1 = array_get_size(oHideToken, sSpellbook); + int nSize2 = array_get_size(oAMSToken, sSpellbook); + if(nSize1 > nSize2) + DelayCommand(0.1f, DoBuckUpAMS(oPC, nClass, sSpellbook, oHideToken, oAMSToken)); + } + } + } +} \ No newline at end of file diff --git a/nwnds_module/prc_brittlebn.uti b/nwnds_module/prc_brittlebn.uti new file mode 100644 index 000000000..91046a4fe Binary files /dev/null and b/nwnds_module/prc_brittlebn.uti differ diff --git a/nwnds_module/prc_ilr.ncs b/nwnds_module/prc_ilr.ncs new file mode 100644 index 000000000..718b03c22 Binary files /dev/null and b/nwnds_module/prc_ilr.ncs differ diff --git a/nwnds_module/prc_ilr.nss b/nwnds_module/prc_ilr.nss new file mode 100644 index 000000000..9774de5a4 --- /dev/null +++ b/nwnds_module/prc_ilr.nss @@ -0,0 +1,297 @@ +//PRC Compatible ILR script +//Version : 0.7 +//Written by: Silvercloud (scl.vcs-online.com) and Ornedan +//Heavily modified from: script by Zanth (of the Legends of Cormyr server: http://www.legendsofcormyr.com/) +//Usage: Needs to be in onequip script event of your module +// +// This script uses valuebased ILR checking (which takes into account PRC items), that can be +// overridden by usage of the "ilr_custom_override" variable (integer) on an item. +// +// Additionally it allows for you to set a deity variable called "ilr_deity" (string) so that +// only if the player has that Deity name in his deity field will he be able to equip the item. +// +// And lastly you can forbid by type of item versus deity as well (which you will need to script +// by hand) and i have included an example of forbidding short swords to akadi worshippers +// +// Note: you do NOT need to set the module to item level restrictions on, you just have to put this +// script in the onequip script under module properties. +// +// 0.4 note: should now properly unequip. +// 0.5 note: cheat prevention added with thanks to Evergrey. +// 0.6 note: changed the values in the file to reflect bioware 2da and ignore projectiles. +// 0.7 note: added plot item checking (switch) +// +// It should be quite easy to add your own checks to this script. +// Just add your own restriction block to the main() and make your own +// testing function that returns an itemRestriction structure. - Ornedan +// +// Handling Projectiles - Due to bioware engine auto-equipping feature on projectiles +// you could end up with an endless loop,by default the script now ignores +// projectiles for ILR (since any single projectile would never amount to more than 300 coins +// anyway, it makes sense to ignore it) +// Use the switch to determine behaviour if you want it changed - Silvercloud + +//---------------------SWITCHES-------------------------\\ + +// Set this to true if you want to completely ignore IRL checking for projectiles. +const int IGNORE_PROJECTILES = TRUE; +const int CHECK_PLOT_ITEMS = TRUE; + + +//-------------------END SWITCHES------------------------\\ + +//These two constants are the variables you would set on an item to set it to either override +//the value based ilr with this level or deity worshipped item only . +const string ILR_VARIABLE_NAME = "ilr_custom_override"; +const string ITEM_DEITY_NAME = "ilr_deity"; + + +// A structure for passing data around the functions here. +struct itemRestriction{ +// This determines whether the wielder is allowed to wield the item +// Values to use: +// -1 Item use forbidden by this test, stop further testing. +// 0 Item use allowed by this test, pass to next test. +// 1 Item use allowed by this test, stop further testing. +int nAllow; +// Message to send to the equipping PC. This is ignored if nAllow is 0. +string sMessage; +}; + + +void actionForceUnequipItem(object oItem, object oPlayer, string sMessage); +int GetIsInstanceOfPRCItem(string sResRef); +struct itemRestriction GetDeityRestriction(string sDeity, object oItem, object oPC); +struct itemRestriction GetItemLevelRestriction(object oItem, object oPC); + + +void main() +{ + object oPC = GetPCItemLastEquippedBy(); + object oItem = GetPCItemLastEquipped(); + int iTyp = GetBaseItemType(oItem); + // Handle special PRC class items + string sResRef = GetResRef(oItem); + if(GetIsInstanceOfPRCItem(sResRef)) return; + if (IGNORE_PROJECTILES) + { + if(iTyp == BASE_ITEM_ARROW)return; + if(iTyp == BASE_ITEM_BOLT)return; + if(iTyp == BASE_ITEM_BULLET)return; + if(iTyp == BASE_ITEM_DART)return; + if(iTyp == BASE_ITEM_SHURIKEN)return; + if(iTyp == BASE_ITEM_THROWINGAXE)return; + } + + + // DMs get to equip whatever they like + if(!GetIsDM(oPC) && GetIsPC(oPC)) + { + struct itemRestriction Result; + + // Example restriction block + /* + dataType Foo = GetData(oPC); + Result = GetSomeRestriction(foo, oItem, oPC); + + switch(Result.nAllow){ + case -1: actionForceUnequipItem(oItem, oPC, Result.sMessage); + case 0: break; + + case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage); + return; + } + */ + + + // Handle deity restriction + string sDeity = GetDeity(oPC); + Result = GetDeityRestriction(sDeity, oItem, oPC); + + switch(Result.nAllow){ + case -1: actionForceUnequipItem(oItem, oPC, (Result.sMessage != "" ? Result.sMessage : sDeity + " does not allow you to wield " + GetName(oItem))); + case 0: break; + + case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage); + return; + } + + + // Handle restriction by item level + Result = GetItemLevelRestriction(oItem, oPC); + switch(Result.nAllow){ + case -1: actionForceUnequipItem(oItem, oPC, Result.sMessage); + case 0: break; + + case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage); + return; + } + } +} + + + + +/* Makes the player unequip the given item and sends any non-empty sMessage to +* them. +*/ +void actionForceUnequipItem(object oItem, object oPlayer, string sMessage = "") +{ + if(sMessage != "") SendMessageToPC(oPlayer, sMessage); + //Brute force unequip makes it virtually impossible to bypass and cheat. + DelayCommand(0.5, AssignCommand(oPlayer, ActionUnequipItem(oItem))); + DelayCommand(0.8, AssignCommand(oPlayer, ActionUnequipItem(oItem))); + DelayCommand(1.1, AssignCommand(oPlayer, ActionUnequipItem(oItem))); + DelayCommand(1.4, AssignCommand(oPlayer, ActionUnequipItem(oItem))); +} + + +/* This checks to see if the resref of the given item matches with +* the resref of one of the special PRC class items. +*/ +int GetIsInstanceOfPRCItem(string sResRef) +{ + if(sResRef == "base_prc_skin") return TRUE; + if(sResRef == "pnp_shft_tstpkup") return TRUE; + if(sResRef == "listenerhide") return TRUE; + if(sResRef == "shifterhide") return TRUE; + if(sResRef == "lichamulet") return TRUE; + if(sResRef == "soul_gem") return TRUE; + if(sResRef == "platinumarmor4") return TRUE; + if(sResRef == "platinumarmor6") return TRUE; + if(sResRef == "platinumarmor8") return TRUE; + if(sResRef == "wp_arr_imbue_1") return TRUE; + if(sResRef == "runescarreddagge") return TRUE; + if(sResRef == "codi_mw_katana") return TRUE; + if(sResRef == "codi_mw_short") return TRUE; + + return FALSE; +} + + +/* Checks to see whether the deity lets the player use the item. +* Returned results: +* -1 The deity forbids the use of the item. The player cannot wield +* it, no matter what. +* 0 The deity does not care one way or another. Other limitations +* apply as normal. +* 1 The deity helps the player wield the item. They can wield it +* even if they normally could not. +*/ +struct itemRestriction GetDeityRestriction(string sDeity, object oItem, object oPC) +{ + struct itemRestriction Result; + Result.nAllow = 0; + Result.sMessage = ""; //In case there is a special message. + + sDeity = GetStringLowerCase(sDeity); + + + /* Do your checks here */ + + //example of forbidding short swords to akadi worshippers + /* + if(sDeity == "akadi" && GetBaseItemType(oItem) == BASE_ITEM_SHORTSWORD) + { + Result.nAllow = -1; + Result.sMessage = "Akadi forbids the use of this type of item." + } + */ + + + + // See if the item is limited to followers of a single deity only + // and if so, whether the player follows said deity + string sItemDeity = GetStringLowerCase(GetLocalString(oItem, ITEM_DEITY_NAME)); + if(sItemDeity != "") + { + if(sItemDeity != sDeity) + { + Result.nAllow = -1; + Result.sMessage = "This item is restricted to followers of " + sItemDeity + "."; + } + } + + return Result; +} + + +struct itemRestriction GetItemLevelRestriction(object oItem, object oPC) +{ + struct itemRestriction Result; + Result.nAllow = 0; + Result.sMessage = ""; + + int iItemLevel = 1; + int iClassLevel = GetLevelByPosition(1,oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC); + + if(GetLocalInt(oItem, ILR_VARIABLE_NAME)) + { + iItemLevel = GetLocalInt(oItem, ILR_VARIABLE_NAME); + } + else + { + + int iGPValue = GetGoldPieceValue(oItem); + + // Code to check for plotitem and restrict it by its internal value: + // only runs if set (=default) + if (CHECK_PLOT_ITEMS) + { + if (GetPlotFlag(oItem) == TRUE) + { + SetPlotFlag(oItem, FALSE); + int iGPValue = GetGoldPieceValue(oItem); + SetPlotFlag(oItem, TRUE); + } + } + + if (iGPValue > 4000000) iItemLevel = 40; + else if (iGPValue > 3800000) iItemLevel = 39; + else if (iGPValue > 3600000) iItemLevel = 38; + else if (iGPValue > 3400000) iItemLevel = 37; + else if (iGPValue > 3200000) iItemLevel = 36; + else if (iGPValue > 3000000) iItemLevel = 35; + else if (iGPValue > 2800000) iItemLevel = 34; + else if (iGPValue > 2600000) iItemLevel = 33; + else if (iGPValue > 2400000) iItemLevel = 32; + else if (iGPValue > 2200000) iItemLevel = 31; + else if (iGPValue > 2000000) iItemLevel = 30; + else if (iGPValue > 1800000) iItemLevel = 29; + else if (iGPValue > 1600000) iItemLevel = 28; + else if (iGPValue > 1400000) iItemLevel = 27; + else if (iGPValue > 1200000) iItemLevel = 26; + else if (iGPValue > 1000000) iItemLevel = 25; + else if (iGPValue > 750000) iItemLevel = 24; + else if (iGPValue > 500000) iItemLevel = 23; + else if (iGPValue > 250000) iItemLevel = 22; + else if (iGPValue > 130000) iItemLevel = 21; + else if (iGPValue > 110000) iItemLevel = 20; + else if (iGPValue > 90000) iItemLevel = 19; + else if (iGPValue > 75000) iItemLevel = 18; + else if (iGPValue > 65000) iItemLevel = 17; + else if (iGPValue > 50000) iItemLevel = 16; + else if (iGPValue > 40000) iItemLevel = 15; + else if (iGPValue > 35000) iItemLevel = 14; + else if (iGPValue > 30000) iItemLevel = 13; + else if (iGPValue > 25000) iItemLevel = 12; + else if (iGPValue > 19500) iItemLevel = 11; + else if (iGPValue > 15000) iItemLevel = 10; + else if (iGPValue > 12000) iItemLevel = 9; + else if (iGPValue > 9000) iItemLevel = 8; + else if (iGPValue > 6500) iItemLevel = 7; + else if (iGPValue > 5000) iItemLevel = 6; + else if (iGPValue > 3500) iItemLevel = 5; + else if (iGPValue > 2500) iItemLevel = 4; + else if (iGPValue > 1500) iItemLevel = 3; + else if (iGPValue > 1000) iItemLevel = 2; + } + + if (iItemLevel > iClassLevel) + { + Result.nAllow = -1; + Result.sMessage = "You are not high enough level to equip " + GetName(oItem) + ", you must be at least level: " + IntToString(iItemLevel) + "."; + } + + return Result; +} diff --git a/nwnds_module/prc_maze_01.are b/nwnds_module/prc_maze_01.are new file mode 100644 index 000000000..7ca966489 Binary files /dev/null and b/nwnds_module/prc_maze_01.are differ diff --git a/nwnds_module/prc_maze_01.gic b/nwnds_module/prc_maze_01.gic new file mode 100644 index 000000000..10bea2292 Binary files /dev/null and b/nwnds_module/prc_maze_01.gic differ diff --git a/nwnds_module/prc_maze_01.git b/nwnds_module/prc_maze_01.git new file mode 100644 index 000000000..6f65bc2a4 Binary files /dev/null and b/nwnds_module/prc_maze_01.git differ diff --git a/nwnds_module/prc_pwondeath.ncs b/nwnds_module/prc_pwondeath.ncs new file mode 100644 index 000000000..55cd9573e Binary files /dev/null and b/nwnds_module/prc_pwondeath.ncs differ diff --git a/nwnds_module/prc_pwondeath.nss b/nwnds_module/prc_pwondeath.nss new file mode 100644 index 000000000..1b2496064 --- /dev/null +++ b/nwnds_module/prc_pwondeath.nss @@ -0,0 +1,17 @@ +/** + * Custom PW OnDeath script to be used with the PRC and pwfxp system. + * Created by: fluffyamoeba + * Created on: 2007-11-14 + * + * Usage: put in your PW's module. + * + * This script is executed by nw_c2_default7 (the default NPC OnDeath script) + * if using the PRC. + */ + +// calls the pwfxp script. + +void main () +{ +ExecuteScript("pwfxp", OBJECT_SELF); +} diff --git a/nwnds_module/prc_racial_const.ncs b/nwnds_module/prc_racial_const.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/prc_racial_const.ncs differ diff --git a/nwnds_module/prc_racial_const.nss b/nwnds_module/prc_racial_const.nss new file mode 100644 index 000000000..0dca5bf53 --- /dev/null +++ b/nwnds_module/prc_racial_const.nss @@ -0,0 +1,318 @@ +// Racialtypes + +//Darksun races + +const int RACIAL_TYPE_DS_DWARF = 0; +const int RACIAL_TYPE_DS_ELF = 1; +const int RACIAL_TYPE_MUL = 2; +const int RACIAL_TYPE_DS_HALFLING = 3; +const int RACIAL_TYPE_DS_HALFELF = 4; +const int RACIAL_TYPE_DS_HALFGIANT = 5; +const int RACIAL_TYPE_DRAY1 = 21; +const int RACIAL_TYPE_DRAY2 = 22; +const int RACIAL_TYPE_VILLICHI = 30; +const int RACIAL_TYPE_GITH = 31; +const int RACIAL_TYPE_AARAKOCRA = 32; +const int RACIAL_TYPE_MAGMA_GEN = 33; +const int RACIAL_TYPE_RAIN_GEN = 34; +const int RACIAL_TYPE_SILT_GEN = 35; +const int RACIAL_TYPE_SUN_GEN = 36; +const int RACIAL_TYPE_BELGOI = 37; +const int RACIAL_TYPE_REGGELID = 38; +const int RACIAL_TYPE_PTERRAN = 39; +const int RACIAL_TYPE_THRIKREEN = 40; +const int RACIAL_TYPE_TARI = 41; +const int RACIAL_TYPE_TAREK = 42; +const int RACIAL_TYPE_JEZ = 43; +const int RACIAL_TYPE_TONDI = 44; +const int RACIAL_TYPE_TOKSA = 45; +const int RACIAL_TYPE_JHOL = 46; +const int RACIAL_TYPE_TKEECH = 47; +const int RACIAL_TYPE_JERAL = 48; + +//Dragonlance Races +const int RACIAL_TYPE_BAAZ = 999; +const int RACIAL_TYPE_BOZAK = 999; +const int RACIAL_TYPE_DARK_DWARF = 999; +const int RACIAL_TYPE_GULLY_DWARF = 999; +const int RACIAL_TYPE_IRDA = 999; +const int RACIAL_TYPE_KAGONESTI_ELF = 999; +const int RACIAL_TYPE_KAPAK = 999; +const int RACIAL_TYPE_KENDER = 999; +const int RACIAL_TYPE_KRYNN_HOGRE = 999; +const int RACIAL_TYPE_KRYNN_MINOTAUR = 999; +const int RACIAL_TYPE_SILVANESTI_ELF = 999; +const int RACIAL_TYPE_TINK_GNOME = 999; + +//Eberron Races +const int RACIAL_TYPE_WARFORGED_CHARGER = 145; +const int RACIAL_TYPE_SHIFTER = 146; +const int RACIAL_TYPE_CHANGELING = 147; +const int RACIAL_TYPE_KALASHTAR = 148; +const int RACIAL_TYPE_WARFORGED = 149; +const int RACIAL_TYPE_ZAKYA_RAKSHASA = 150; + +//Greyhawk Races +const int RACIAL_TYPE_DERRO = 172; + +//Planescape Races +const int RACIAL_TYPE_BARIAUR = 207; +const int RACIAL_TYPE_BLADELING = 195; +const int RACIAL_TYPE_CHAOND = 196; +const int RACIAL_TYPE_NATHRI = 237; +const int RACIAL_TYPE_TULADHARA = 197; +const int RACIAL_TYPE_ZENYRTHRI = 206; + +//Ravenloft Races +const int RACIAL_TYPE_HVISTANI = 146; +const int RACIAL_TYPE_VISTANI = 147; + +//Rokugan/Kara-Tur Races +const int RACIAL_TYPE_KOROBKURU = 245; +const int RACIAL_TYPE_NEZUMI = 246; +const int RACIAL_TYPE_SPIRIT_FOLK = 243; +const int RACIAL_TYPE_TASLOI = 140; + +//Spelljammer Races +const int RACIAL_TYPE_SCRO = 182; +const int RACIAL_TYPE_XIXCHIL = 181; + +// DMG +const int RACIAL_TYPE_PLANT = 52; + +//Draconic Races +const int RACIAL_TYPE_DRAGONBORN = 128; +const int RACIAL_TYPE_SPELLSCALE = 129; + +//Fey-type Races +const int RACIAL_TYPE_BRALANI = 159; +const int RACIAL_TYPE_BROWNIE = 53; +const int RACIAL_TYPE_GRIG = 133; +const int RACIAL_TYPE_NIXIE = 134; +const int RACIAL_TYPE_NYMPH = 135; +const int RACIAL_TYPE_PIXIE = 226; +const int RACIAL_TYPE_SATYR = 136; + +//Outsider Races +const int RACIAL_TYPE_ASURA = 80; +const int RACIAL_TYPE_AZER = 227; +const int RACIAL_TYPE_BUOMMANS = 238; +const int RACIAL_TYPE_DJINNI = 81; +const int RACIAL_TYPE_EFREETI = 82; +const int RACIAL_TYPE_FORMIAN = 232; +const int RACIAL_TYPE_GITHYANKI = 222; +const int RACIAL_TYPE_GITHZERAI = 223; +const int RACIAL_TYPE_GLOAMING = 83; +const int RACIAL_TYPE_HOUND_ARCHON = 84; +const int RACIAL_TYPE_KHAASTA = 94; +const int RACIAL_TYPE_JANNI = 85; +const int RACIAL_TYPE_MEPHIT_AIR = 86; +const int RACIAL_TYPE_MEPHIT_EARTH = 87; +const int RACIAL_TYPE_MEPHIT_FIRE = 88; +const int RACIAL_TYPE_MEPHIT_WATER = 89; +const int RACIAL_TYPE_MEPHLING_AIR = 90; +const int RACIAL_TYPE_MEPHLING_EARTH = 91; +const int RACIAL_TYPE_MEPHLING_FIRE = 92; +const int RACIAL_TYPE_MEPHLING_WATER = 93; +const int RACIAL_TYPE_NERAPHIM = 235; +const int RACIAL_TYPE_RAKSHASA = 224; +const int RACIAL_TYPE_SALAMANDER = 95; +const int RACIAL_TYPE_SHADE = 210; +const int RACIAL_TYPE_SPIKER = 239; +const int RACIAL_TYPE_WILDREN = 240; +const int RACIAL_TYPE_NAZTHARUNE_RAKSHASA = 96; + +//Planetouched Races +const int RACIAL_TYPE_AASIMAR = 198; +const int RACIAL_TYPE_AIR_GEN = 199; +const int RACIAL_TYPE_EARTH_GEN = 200; +const int RACIAL_TYPE_FEYRI = 201; +const int RACIAL_TYPE_FIRE_GEN = 202; +const int RACIAL_TYPE_MORTIF = 132; +const int RACIAL_TYPE_TANARUKK = 203; +const int RACIAL_TYPE_TIEFLING = 204; +const int RACIAL_TYPE_WATER_GEN = 205; +const int RACIAL_TYPE_SHADOWSWYFT = 236; + +//Serpent Kingdom and Reptillian Races +const int RACIAL_TYPE_ABOM_YUAN = 228; +const int RACIAL_TYPE_ASABI = 241; +const int RACIAL_TYPE_ASABI_STINGTAIL = 242; +const int RACIAL_TYPE_KUOTOA = 67; +const int RACIAL_TYPE_LIZARDFOLK = 219; +const int RACIAL_TYPE_LIZARDKING = 68; +const int RACIAL_TYPE_MEDUSA = 69; +const int RACIAL_TYPE_OPHIDIAN = 70; +const int RACIAL_TYPE_POISON_DUSK = 248; +const int RACIAL_TYPE_PURE_YUAN = 220; +const int RACIAL_TYPE_SAHUAGIN = 71; +const int RACIAL_TYPE_SK_YUANTI = 233; +const int RACIAL_TYPE_TREN = 72; +const int RACIAL_TYPE_VILETOOTH_LIZARDFOLK = 112; + +//Underdark Races +const int RACIAL_TYPE_ARANEA = 74; +const int RACIAL_TYPE_BEHOLDER = 75; +const int RACIAL_TYPE_DRIDER = 50; +const int RACIAL_TYPE_GRIMLOCK = 77; +const int RACIAL_TYPE_ILLITHID = 225; +const int RACIAL_TYPE_IMASKARI = 230; +const int RACIAL_TYPE_SLYTH = 78; +const int RACIAL_TYPE_TROGLODYTE = 234; +const int RACIAL_TYPE_UMBER_HULK = 79; + +//Other Monsterous Races +const int RACIAL_TYPE_CENTAUR = 208; +const int RACIAL_TYPE_CATFOLK = 209; +const int RACIAL_TYPE_DIABOLUS = 113; +const int RACIAL_TYPE_DIOPSID = 114; +const int RACIAL_TYPE_DRAGONKIN = 58; +const int RACIAL_TYPE_ETTERCAP = 73; +const int RACIAL_TYPE_FIRENEWT = 59; +const int RACIAL_TYPE_GARGOYLE = 185; +const int RACIAL_TYPE_KIRLANAN = 60; +const int RACIAL_TYPE_LUPIN = 186; +const int RACIAL_TYPE_PTERAFOLK = 61; +const int RACIAL_TYPE_RAPTORAN = 130; +const int RACIAL_TYPE_SAURIAL_BLADEBACK = 62; +const int RACIAL_TYPE_SAURIAL_FINHEAD = 63; +const int RACIAL_TYPE_SAURIAL_FLYER = 64; +const int RACIAL_TYPE_SAURIAL_HORNHEAD = 65; +const int RACIAL_TYPE_TORTLE = 118; +const int RACIAL_TYPE_VOLODNI = 131; +const int RACIAL_TYPE_WEMIC = 51; + +// XPH +const int RACIAL_TYPE_DROMITE = 249; +const int RACIAL_TYPE_ELAN = 250; +const int RACIAL_TYPE_MAENADS = 252; +const int RACIAL_TYPE_PH_HALFGIANT = 251; +const int RACIAL_TYPE_XEPH = 253; + +//Unapproachable East +const int RACIAL_TYPE_HAGSPAWN = 58; +const int RACIAL_TYPE_TAER = 59; + +//Races of the Wild +const int RACIAL_TYPE_KILLOREN = 244; + +// Underdark +const int RACIAL_TYPE_CHITINE = 76; + +//Frostburn +const int RACIAL_TYPE_NEANDERTHAL = 61; +const int RACIAL_TYPE_FROST_FOLK = 62; +const int RACIAL_TYPE_ULDRA = 63; + +//Magic of Incarnum +const int RACIAL_TYPE_AZURIN = 130; +const int RACIAL_TYPE_DUSKLING = 129; +const int RACIAL_TYPE_RILKAN = 128; +const int RACIAL_TYPE_SKARN = 127; + +//Races of Destiny +const int RACIAL_TYPE_ILLUMIAN = 120; +const int RACIAL_TYPE_MONGRELFOLK = 121; +const int RACIAL_TYPE_SHARAKIM = 122; +const int RACIAL_TYPE_UNDERFOLK = 123; +const int RACIAL_TYPE_SKULK = 124; +const int RACIAL_TYPE_DOPPELGANGER = 125; + +//Races of Stone +const int RACIAL_TYPE_GOLIATH = 55; +const int RACIAL_TYPE_FERAL_GARGUN = 56; +const int RACIAL_TYPE_STONECHILD = 57; + +//Sandstorm +const int RACIAL_TYPE_ASHERATI = 115; +const int RACIAL_TYPE_BHUKA = 116; +const int RACIAL_TYPE_MARRULURK = 117; +const int RACIAL_TYPE_CRUCIAN = 118; +const int RACIAL_TYPE_MARRUSAULT = 119; + +//Stormwrack +const int RACIAL_TYPE_DARFELLAN = 117; +const int RACIAL_TYPE_HADOZEE = 180; + +//Champions of Ruin +const int RACIAL_TYPE_KRINTH = 54; +const int RACIAL_TYPE_EXTAMINAAR = 64; + +// Tome of Magic +const int RACIAL_TYPE_KARSITE = 65; + +/* Standard Races */ + +//Human +const int RACIAL_TYPE_SILVERBROW_HUMAN = 110; + +//Elf +const int RACIAL_TYPE_AQELF = 161; +const int RACIAL_TYPE_AVARIEL = 162; +const int RACIAL_TYPE_DROW_FEMALE = 163; +const int RACIAL_TYPE_DROW_MALE = 164; +const int RACIAL_TYPE_FORESTLORD_ELF = 107; +const int RACIAL_TYPE_HALFDROW = 183; +const int RACIAL_TYPE_SNOW_ELF = 165; +const int RACIAL_TYPE_STAR_ELF = 160; +const int RACIAL_TYPE_SUN_ELF = 166; +const int RACIAL_TYPE_WILD_ELF = 167; +const int RACIAL_TYPE_WOOD_ELF = 168; + +//Dwarf +const int RACIAL_TYPE_ARC_DWARF = 151; +const int RACIAL_TYPE_DREAM_DWARF = 157; +const int RACIAL_TYPE_FIREBLOOD_DWARF = 106; +const int RACIAL_TYPE_FROST_DWARF = 158; +const int RACIAL_TYPE_GOLD_DWARF = 152; +const int RACIAL_TYPE_DUERGAR = 153; +const int RACIAL_TYPE_GLACIER_DWARF = 154; +const int RACIAL_TYPE_URDINNIR = 155; +const int RACIAL_TYPE_WILD_DWARF = 156; + +//Gnome +const int RACIAL_TYPE_CHAOS_GNOME = 177; +const int RACIAL_TYPE_DEEP_GNOME = 174; +const int RACIAL_TYPE_FIRE_GNOME = 173; +const int RACIAL_TYPE_FOR_GNOME = 175; +const int RACIAL_TYPE_ICE_GNOME = 178; +const int RACIAL_TYPE_ROCK_GNOME = 176; +const int RACIAL_TYPE_STONEHUNTER_GNOME = 105; +const int RACIAL_TYPE_SVIRFNEBLIN = 174; +const int RACIAL_TYPE_WHISPER_GNOME = 179; + +//Halfling +const int RACIAL_TYPE_DEEP_HALFLING = 194; +const int RACIAL_TYPE_GHOSTWISE_HALFLING = 190; +const int RACIAL_TYPE_GLIMMERSKIN_HALFING = 109; +const int RACIAL_TYPE_JARREN = 189; +const int RACIAL_TYPE_SHOAL_HALFLING = 188; +const int RACIAL_TYPE_STRONGHEART_HALFLING = 192; +const int RACIAL_TYPE_TALLFELLOW_HALFLING = 193; +const int RACIAL_TYPE_TUNDRA_HALFLING = 191; + +//Goblin +const int RACIAL_TYPE_BLUE_GOBLIN = 143; +const int RACIAL_TYPE_DEKANTER = 142; +const int RACIAL_TYPE_GOBLIN = 213; +const int RACIAL_TYPE_SNOW_GOBLIN = 141; + +//"Greenskin" Races +const int RACIAL_TYPE_BUGBEAR = 217; +const int RACIAL_TYPE_FLIND = 211; +const int RACIAL_TYPE_FROSTBLOOD_ORC = 108; +const int RACIAL_TYPE_GNOLL = 216; +const int RACIAL_TYPE_GRAYORC = 184; +const int RACIAL_TYPE_HALFOGRE = 229; +const int RACIAL_TYPE_HOBGOBLIN = 221; +const int RACIAL_TYPE_KOBOLD = 215; +const int RACIAL_TYPE_MINOTAUR = 218; +const int RACIAL_TYPE_OGRE = 212; +const int RACIAL_TYPE_OMAGE = 211; +const int RACIAL_TYPE_OROG = 187; +const int RACIAL_TYPE_ORC = 214; +const int RACIAL_TYPE_SUNSCORCH_HOBGOBLIN = 111; +const int RACIAL_TYPE_TROLL = 231; +const int RACIAL_TYPE_VARAG = 232; + + diff --git a/nwnds_module/prc_viper.utc b/nwnds_module/prc_viper.utc new file mode 100644 index 000000000..201b2be94 Binary files /dev/null and b/nwnds_module/prc_viper.utc differ diff --git a/nwnds_module/preai_default1.ncs b/nwnds_module/preai_default1.ncs new file mode 100644 index 000000000..24d66befd Binary files /dev/null and b/nwnds_module/preai_default1.ncs differ diff --git a/nwnds_module/preai_default1.nss b/nwnds_module/preai_default1.nss new file mode 100644 index 000000000..8fa6ec377 --- /dev/null +++ b/nwnds_module/preai_default1.nss @@ -0,0 +1,104 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT1 +/* + Default OnHeartbeat script for NPCs. + + This script causes NPCs to perform default animations + while not otherwise engaged. + + This script duplicates the behavior of the default + script and just cleans up the code and removes + redundant conditional checks. + + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + // * if not runnning normal or better Ai then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + // Buff ourselves up right away if we should + if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY)) + { + // This will return TRUE if an enemy was within 40.0 m + // and we buffed ourselves up instantly to respond -- + // simulates a spellcaster with protections enabled + // already. + if(TalentAdvancedBuff(40.0)) + { + // This is a one-shot deal + SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE); + + // This return means we skip sending the user-defined + // heartbeat signal in this one case. + return; + } + } + + + if(GetHasEffect(EFFECT_TYPE_SLEEP)) + { + // If we're asleep and this is the result of sleeping + // at night, apply the floating 'z's visual effect + // every so often + + if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT)) + { + effect eVis = EffectVisualEffect(VFX_IMP_SLEEP); + if(d10() > 6) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF); + } + } + } + + // If we have the 'constant' waypoints flag set, walk to the next + // waypoint. + else if ( GetWalkCondition(NW_WALK_FLAG_CONSTANT) ) + { + WalkWayPoints(); + } + + // Check to see if we should be playing default animations + // - make sure we don't have any current targets + else if ( !GetIsObjectValid(GetAttemptedAttackTarget()) + && !GetIsObjectValid(GetAttemptedSpellTarget()) + // && !GetIsPostOrWalking()) + && !GetIsObjectValid(GetNearestSeenEnemy())) + { + if (GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) || GetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE) || + GetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE)) + { + // This handles special attacking/fleeing behavior + // for omnivores & herbivores. + DetermineSpecialBehavior(); + } + else if (!IsInConversation(OBJECT_SELF)) + { + if (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetIsEncounterCreature()) + { + PlayMobileAmbientAnimations(); + } + else if (GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS)) + { + PlayImmobileAmbientAnimations(); + } + } + } + + // Send the user-defined event signal if specified + if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT)); + } +} + diff --git a/nwnds_module/preai_default2.ncs b/nwnds_module/preai_default2.ncs new file mode 100644 index 000000000..3f30222d1 Binary files /dev/null and b/nwnds_module/preai_default2.ncs differ diff --git a/nwnds_module/preai_default2.nss b/nwnds_module/preai_default2.nss new file mode 100644 index 000000000..aa179b00e --- /dev/null +++ b/nwnds_module/preai_default2.nss @@ -0,0 +1,119 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT2 +/* + Default OnPerception event handler for NPCs. + + Handles behavior when perceiving a creature for the + first time. + */ +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ +// * if not runnning normal or better Ai then exit for performance reasons + // * if not runnning normal or better Ai then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + object oPercep = GetLastPerceived(); + int bSeen = GetLastPerceptionSeen(); + + // This will cause the NPC to speak their one-liner + // conversation on perception even if they are already + // in combat. + if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION) + && GetIsPC(oPercep) + && bSeen) + { + SpeakOneLinerConversation(); + } + + // March 5 2003 Brent + // Had to add this section back in, since modifications were not taking this specific + // example into account -- it made invisibility basically useless. + //If the last perception event was hearing based or if someone vanished then go to search mode + if ((GetLastPerceptionVanished()) && GetIsEnemy(oPercep)) + { + //object oGone = GetLastPerceived(); + if((GetAttemptedAttackTarget() == oPercep || + GetAttemptedSpellTarget() == oPercep || + GetAttackTarget() == oPercep) && GetArea(oPercep) != GetArea(OBJECT_SELF)) + { + //SpeakString("dude...like disappeared."); + ClearAllActions(); + DetermineCombatRound(); + } + } + + // This section has been heavily revised while keeping the + // pre-existing behavior: + // - If we're in combat, keep fighting. + // - If not and we've perceived an enemy, start to fight. + // Even if the perception event was a 'vanish', that's + // still what we do anyway, since that will keep us + // fighting any visible targets. + // - If we're not in combat and haven't perceived an enemy, + // see if the perception target is a PC and if we should + // speak our attention-getting one-liner. + if (GetIsFighting(OBJECT_SELF)) { + // don't do anything else, we're busy + //MyPrintString("GetIsFighting: TRUE"); + + } + // * BK FEB 2003 Only fight if you can see them. DO NOT RELY ON HEARING FOR ENEMY DETECTION + else if (GetIsEnemy(oPercep) && bSeen) { + //MyPrintString("GetIsEnemy: TRUE"); + // We spotted an enemy and we're not already fighting + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + //MyPrintString("DetermineSpecialBehavior"); + DetermineSpecialBehavior(); + } else { + //MyPrintString("DetermineCombatRound"); + SetFacingPoint(GetPosition(oPercep)); + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + DetermineCombatRound(); + } + } + } else { + if (bSeen) { + //MyPrintString("GetLastPerceptionSeen: TRUE"); + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + DetermineSpecialBehavior(); + } else if (GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION) + && GetIsPC(oPercep)) + { + // The NPC will speak their one-liner conversation + // This should probably be: + // SpeakOneLinerConversation(oPercep); + // instead, but leaving it as is for now. + //ActionStartConversation(OBJECT_SELF); + } + } + + // activate ambient animations or walk waypoints if appropriate + if (!IsInConversation(OBJECT_SELF)) { + if (GetIsPostOrWalking()) { + WalkWayPoints(); + } else if (GetIsPC(oPercep) && + (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) + || GetIsEncounterCreature())) + { + SetAnimationCondition(NW_ANIM_FLAG_IS_ACTIVE); + } + } + } + + // Send the user-defined event if appropriate + if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT) && bSeen) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_PERCEIVE)); + } +} + + + + diff --git a/nwnds_module/preai_default3.ncs b/nwnds_module/preai_default3.ncs new file mode 100644 index 000000000..0374e93e1 Binary files /dev/null and b/nwnds_module/preai_default3.ncs differ diff --git a/nwnds_module/preai_default3.nss b/nwnds_module/preai_default3.nss new file mode 100644 index 000000000..d83da060d --- /dev/null +++ b/nwnds_module/preai_default3.nss @@ -0,0 +1,67 @@ +//:://///////////////////////////////////////////// +//:: Default: End of Combat Round +//:: NW_C2_DEFAULT3 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Calls the end of combat script every round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +#include "NW_I0_GENERIC" +void main() +{ + if((GetIsDead(GetLastAttacker()) == TRUE) && (GetIsPC(GetLastAttacker()) == TRUE) && (GetAbilityScore(OBJECT_SELF,ABILITY_INTELLIGENCE) > 9) && (d6() > 5)) + +{ + + +int nMsg = d8(); + +string sMsg; + +switch (nMsg) + +{ + +case 1: sMsg = "Wimp."; break; + +case 2: sMsg = "Pathetic."; break; + +case 3: sMsg = "You are worthless and weak."; break; + +case 4: sMsg = "Wimp."; break; + +case 5: sMsg = "Waste of water."; break; + +case 6: sMsg = "I didnt even break a sweat."; break; + +case 7: sMsg = "Ha Ha!"; break; + +case 8: sMsg = "Insect."; break; + +} + +SpeakString(sMsg, TALKVOLUME_TALK); + + +} + + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(); + } + else if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) + { + DetermineCombatRound(); + } + if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1003)); + } +} + + diff --git a/nwnds_module/preai_default4.ncs b/nwnds_module/preai_default4.ncs new file mode 100644 index 000000000..498cea100 Binary files /dev/null and b/nwnds_module/preai_default4.ncs differ diff --git a/nwnds_module/preai_default4.nss b/nwnds_module/preai_default4.nss new file mode 100644 index 000000000..b1779ecc1 --- /dev/null +++ b/nwnds_module/preai_default4.nss @@ -0,0 +1,90 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT4 +/* + Default OnConversation event handler for NPCs. + + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + // * if petrified, jump out + if (GetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE) + { + return; + } + + // * If dead, exit directly. + if (GetIsDead(OBJECT_SELF) == TRUE) + { + return; + } + + // See if what we just 'heard' matches any of our + // predefined patterns + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + + if (nMatch == -1) + { + // Not a match -- start an ordinary conversation + if (GetCommandable(OBJECT_SELF)) + { + ClearActions(CLEAR_NW_C2_DEFAULT4_29); + BeginConversation(); + } + else + // * July 31 2004 + // * If only charmed then allow conversation + // * so you can have a better chance of convincing + // * people of lowering prices + if (GetHasEffect(EFFECT_TYPE_CHARMED) == TRUE) + { + ClearActions(CLEAR_NW_C2_DEFAULT4_29); + BeginConversation(); + } + } + // Respond to shouts from friendly non-PCs only + else if (GetIsObjectValid(oShouter) + && !GetIsPC(oShouter) + && GetIsFriend(oShouter)) + { + object oIntruder = OBJECT_INVALID; + // Determine the intruder if any + if(nMatch == 4) + { + oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER"); + } + else if (nMatch == 5) + { + oIntruder = GetLastHostileActor(oShouter); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedAttackTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = GetAttemptedSpellTarget(); + if(!GetIsObjectValid(oIntruder)) + { + oIntruder = OBJECT_INVALID; + } + } + } + } + + // Actually respond to the shout + RespondToShout(oShouter, nMatch, oIntruder); + } + + // Send the user-defined event if appropriate + if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DIALOGUE)); + } +} diff --git a/nwnds_module/preai_default5.ncs b/nwnds_module/preai_default5.ncs new file mode 100644 index 000000000..1309db31c Binary files /dev/null and b/nwnds_module/preai_default5.ncs differ diff --git a/nwnds_module/preai_default5.nss b/nwnds_module/preai_default5.nss new file mode 100644 index 000000000..890998108 --- /dev/null +++ b/nwnds_module/preai_default5.nss @@ -0,0 +1,58 @@ +//:://///////////////////////////////////////////// +//:: Default On Attacked +//:: NW_C2_DEFAULT5 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + If already fighting then ignore, else determine + combat round +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 16, 2001 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + if(GetFleeToExit()) { + // Run away! + ActivateFleeToExit(); + } else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) { + // We give an attacker one warning before we attack + // This is not fully implemented yet + SetSpawnInCondition(NW_FLAG_SET_WARNINGS, FALSE); + + //Put a check in to see if this attacker was the last attacker + //Possibly change the GetNPCWarning function to make the check + } else { + object oAttacker = GetLastAttacker(); + if (!GetIsObjectValid(oAttacker)) { + // Don't do anything, invalid attacker + + } else if (!GetIsFighting(OBJECT_SELF)) { + // We're not fighting anyone else, so + // start fighting the attacker + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + SetSummonHelpIfAttacked(); + DetermineSpecialBehavior(oAttacker); + } else if (GetArea(oAttacker) == GetArea(OBJECT_SELF)) { + SetSummonHelpIfAttacked(); + DetermineCombatRound(oAttacker); + } + + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + //Shout that I was attacked + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + } + + + if(GetSpawnInCondition(NW_FLAG_ATTACK_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_ATTACKED)); + } +} diff --git a/nwnds_module/preai_default6.ncs b/nwnds_module/preai_default6.ncs new file mode 100644 index 000000000..ff0952868 Binary files /dev/null and b/nwnds_module/preai_default6.ncs differ diff --git a/nwnds_module/preai_default6.nss b/nwnds_module/preai_default6.nss new file mode 100644 index 000000000..35829f24f --- /dev/null +++ b/nwnds_module/preai_default6.nss @@ -0,0 +1,75 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT6 +//:: Default OnDamaged handler +/* + If already fighting then ignore, else determine + combat round + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + if(GetFleeToExit()) { + // We're supposed to run away, do nothing + } else if (GetSpawnInCondition(NW_FLAG_SET_WARNINGS)) { + // don't do anything? + } else { + object oDamager = GetLastDamager(); + if (!GetIsObjectValid(oDamager)) { + // don't do anything, we don't have a valid damager + } else if (!GetIsFighting(OBJECT_SELF)) { + // If we're not fighting, determine combat round + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + DetermineSpecialBehavior(oDamager); + } else { + if(!GetObjectSeen(oDamager) + && GetArea(OBJECT_SELF) == GetArea(oDamager)) { + // We don't see our attacker, go find them + ActionMoveToLocation(GetLocation(oDamager), TRUE); + ActionDoCommand(DetermineCombatRound()); + } else { + DetermineCombatRound(); + } + } + } else { + // We are fighting already -- consider switching if we've been + // attacked by a more powerful enemy + object oTarget = GetAttackTarget(); + if (!GetIsObjectValid(oTarget)) + oTarget = GetAttemptedAttackTarget(); + if (!GetIsObjectValid(oTarget)) + oTarget = GetAttemptedSpellTarget(); + + // If our target isn't valid + // or our damager has just dealt us 25% or more + // of our hp in damager + // or our damager is more than 2HD more powerful than our target + // switch to attack the damager. + if (!GetIsObjectValid(oTarget) + || ( + oTarget != oDamager + && ( + GetTotalDamageDealt() > (GetMaxHitPoints(OBJECT_SELF) / 4) + || (GetHitDice(oDamager) - 2) > GetHitDice(oTarget) + ) + ) + ) + { + // Switch targets + DetermineCombatRound(oDamager); + } + } + } + + // Send the user-defined event signal + if(GetSpawnInCondition(NW_FLAG_DAMAGED_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DAMAGED)); + } +} diff --git a/nwnds_module/preai_default7.ncs b/nwnds_module/preai_default7.ncs new file mode 100644 index 000000000..fc7aa6bc3 Binary files /dev/null and b/nwnds_module/preai_default7.ncs differ diff --git a/nwnds_module/preai_default7.nss b/nwnds_module/preai_default7.nss new file mode 100644 index 000000000..b22b58dfb --- /dev/null +++ b/nwnds_module/preai_default7.nss @@ -0,0 +1,234 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT7 +/* + Default OnDeath event handler for NPCs. + + Adjusts killer's alignment if appropriate and + alerts allies to our death. + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// +#include "x0_i0_spawncond" +#include "ar_db_main" + +void ClearSlot(int iSlotID); +void PartyGold(object oPC); + +void main() +{ + // added to index the creature death + object oKiller = GetLastKiller(); + object oDead = OBJECT_SELF; + SetLocalInt(oKiller,"ARSX_LAST_CR_KILL",ARSX_LogKill(OBJECT_SELF,oKiller)); + //end indexing + + if ((d100() > 99) && (GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) > 10)) + { + string sMsg; + switch (d20()) + { + case 1: sMsg = "I see dead people..."; break; + case 2: sMsg = "For the first time in my life I feel...cold..."; break; + case 3: sMsg = "Water..."; break; + case 4: sMsg = "Dont let them bury me. I'm not dead!"; break; + case 5: sMsg = "I surrender!"; break; + case 6: sMsg = "No, it cant be!"; break; + case 7: sMsg = "Tell my children I love them..."; break; + case 8: sMsg = "I curse your soul!"; break; + case 9: sMsg = "I shall return!"; break; + case 10: sMsg = "Oh tell me God, must I damn my brother to love you?"; break; + case 11: sMsg = "I've had worse."; break; + case 12: sMsg = "But... I am invincible!"; break; + case 13: sMsg = "It's so dark."; break; + case 14: sMsg = "Help."; break; + case 15: sMsg = "Mommy."; break; + case 16: sMsg = "Avenge me!"; break; + case 17: { + sMsg = "My ghost will haunt you!"; + CreateObject(OBJECT_TYPE_CREATURE, "shfiend001", GetLocation(OBJECT_SELF)); + } + break; + case 18: sMsg = "Doh!"; break; + case 19: sMsg = "Wait, I lagged!"; break; + case 20: sMsg = "Medic!"; break; + } + SpeakString(sMsg, TALKVOLUME_TALK); + } + + int iSlotID; + for (iSlotID = 0; iSlotID < NUM_INVENTORY_SLOTS; iSlotID++) + { + ClearSlot(iSlotID); + } + // Destroy all inventory items + object oItem = GetFirstItemInInventory(); + while (GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + oItem = GetNextItemInInventory(); + } + + //Get the object that killed the monster + object oPC = GetLastKiller(); + //Get the master of the object, if it was a pet + if(GetIsPC(GetMaster(oPC))) + oPC = GetMaster(oPC); + + //Determine how much gold and experience is awarded. + PartyGold(oPC); + + //Check to see if this was a kill task monster + if((GetTag(OBJECT_SELF) == GetLocalString(oPC, "KILL_TASK_TARGET")) && (GetLocalInt(oPC, "KILL_TASK_FLAG") == 1)) + { + //Set the kill task variable to complete + SetLocalInt(oPC, "KILL_TASK_FLAG", 2); + //Set the journal to complete + AddJournalQuestEntry("kt_journal_01", 99, oPC); + } + + int nClass = GetLevelByClass(CLASS_TYPE_COMMONER); + int nAlign = GetAlignmentGoodEvil(OBJECT_SELF); + + // If we're a good/neutral commoner, + // adjust the killer's alignment evil + if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL)) + { + object oKiller = GetLastKiller(); + AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5); + } + + // Call to allies to let them know we're dead + SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK); + + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + // NOTE: the OnDeath user-defined event does not + // trigger reliably and should probably be removed + if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(1007)); + } +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ + //Get the area the kill was made in + object oArea = GetArea(OBJECT_SELF); + //Initialize the amount of players in a party + int nMembers = 0; + //Determine how many members of the party are in that area + object oPartyMember = GetFirstFactionMember(oPC); + if(GetIsObjectValid(oPartyMember)) + { + while(GetIsObjectValid(oPartyMember)) + { + if((GetArea(oPartyMember) == oArea) && (GetIsPC(oPartyMember))) + nMembers++; + oPartyMember = GetNextFactionMember(oPC); + } + + //Get the hit dice of the monster + int nMRating = GetHitDice(OBJECT_SELF); + //Get the hit dice of the killer + int nPRating = GetHitDice(oPC); + if(nPRating == 0) + { + nMRating = 0; + nPRating = 1; + } + + //Get an amount of gold in relation to the challenge rating of the monster + int nGold = d4(nMRating); + //These monster types don't have gold + if(GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ANIMAL || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_BEAST || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_CONSTRUCT || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ELEMENTAL || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_ABERRATION || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_MAGICAL_BEAST || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_OUTSIDER || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD || + GetRacialType(OBJECT_SELF) == RACIAL_TYPE_VERMIN) + { + nGold = 0; + } + else + { + //Split the gold among the party members in the area + nGold /= nMembers; + } + + //Initialize a default amount of experience + int nXP = (100 + (nMRating * 5)); + if((nMRating - nPRating) < -6) + { + nXP = 0; + } + + //Modify the experience + nXP = ((nXP * nMRating) / nPRating); + + //Start exp loop + oPartyMember = GetFirstFactionMember(oPC); + if(GetIsObjectValid(oPartyMember)) + { + //Initialize a variable for the loop to determine the party members challenge rating + int nPartyRating; + int nXPTemp = 0; + //Loop baby + while (GetIsObjectValid(oPartyMember)) + { + if((GetArea(oPartyMember) == oArea) && (GetIsPC(oPartyMember))) + { + if(nGold > 0) + GiveGoldToCreature(oPartyMember, nGold); + + nPartyRating = GetHitDice(oPartyMember); + if(nPRating >= nPartyRating) + { + if((nPRating - nPartyRating) > 6) + nXPTemp = 0; + else + nXPTemp = ((nXP * nPartyRating) / nPRating); + } + else + { + if((nPartyRating - nPRating) > 6) + nXPTemp = 0; + else + { + if(nPartyRating == 0) + { + nPartyRating = 0; + nXP = 0; + } + nXPTemp = ((nXP * nPRating) / nPartyRating); + } + } + if((nMRating - nPartyRating) < -6) + { + nXPTemp = 0; + } + if(nXPTemp > 0) + GiveXPToCreature(oPartyMember, nXPTemp); + } + oPartyMember = GetNextFactionMember(oPC); + } + } + } +} diff --git a/nwnds_module/preai_default8.ncs b/nwnds_module/preai_default8.ncs new file mode 100644 index 000000000..c5a66048e Binary files /dev/null and b/nwnds_module/preai_default8.ncs differ diff --git a/nwnds_module/preai_default8.nss b/nwnds_module/preai_default8.nss new file mode 100644 index 000000000..918242070 --- /dev/null +++ b/nwnds_module/preai_default8.nss @@ -0,0 +1,28 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT8 +/* + Default OnDisturbed event handler for NPCs. + */ +//::////////////////////////////////////////////////// +//:: Copyright (c) 2002 Floodgate Entertainment +//:: Created By: Naomi Novik +//:: Created On: 12/22/2002 +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + object oTarget = GetLastDisturbed(); + + // If we've been disturbed and are not already fighting, + // attack our disturber. + if (GetIsObjectValid(oTarget) && !GetIsFighting(OBJECT_SELF)) { + DetermineCombatRound(oTarget); + } + + // Send the disturbed flag if appropriate. + if(GetSpawnInCondition(NW_FLAG_DISTURBED_EVENT)) { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DISTURBED)); + } +} diff --git a/nwnds_module/preai_default9.ncs b/nwnds_module/preai_default9.ncs new file mode 100644 index 000000000..bfff35d0a Binary files /dev/null and b/nwnds_module/preai_default9.ncs differ diff --git a/nwnds_module/preai_default9.nss b/nwnds_module/preai_default9.nss new file mode 100644 index 000000000..9175fcce3 --- /dev/null +++ b/nwnds_module/preai_default9.nss @@ -0,0 +1,88 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" +#include "DS_LOOT" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) +SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY); //troy added this +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + //GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + if (d20() > 18) + TrashLoot(); + + if (GetHitDice(OBJECT_SELF) > 50) { + Loot(); + } else { + + if (d100() > 98) + Loot(); + } + + +} + + diff --git a/nwnds_module/preai_defaulta.ncs b/nwnds_module/preai_defaulta.ncs new file mode 100644 index 000000000..f869d4669 Binary files /dev/null and b/nwnds_module/preai_defaulta.ncs differ diff --git a/nwnds_module/preai_defaulta.nss b/nwnds_module/preai_defaulta.nss new file mode 100644 index 000000000..7220af90e --- /dev/null +++ b/nwnds_module/preai_defaulta.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: Default: On Rested +//:: NW_C2_DEFAULTA +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just rested. +*/ +//::////////////////////////////////////////////// +//:: Created By: Don Moar +//:: Created On: April 28, 2002 +//::////////////////////////////////////////////// +void main() +{ + // enter desired behaviour here + + return; + +} diff --git a/nwnds_module/preai_defaultb.ncs b/nwnds_module/preai_defaultb.ncs new file mode 100644 index 000000000..a8da22a5a Binary files /dev/null and b/nwnds_module/preai_defaultb.ncs differ diff --git a/nwnds_module/preai_defaultb.nss b/nwnds_module/preai_defaultb.nss new file mode 100644 index 000000000..0bcec086f --- /dev/null +++ b/nwnds_module/preai_defaultb.nss @@ -0,0 +1,142 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spell Cast At +//:: NW_C2_DEFAULTB +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This determines if the spell just cast at the + target is harmful or not. + + GZ 2003-Oct-02 : - New AoE Behavior AI. Will use + Dispel Magic against AOES + - Flying Creatures will ignore + Grease + +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Dec 6, 2001 +//:: Last Modified On: 2003-Oct-13 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" +#include "x2_i0_spells" +void main() +{ + object oCaster = GetLastSpellCaster(); + + + if(GetLastSpellHarmful()) + { + SetCommandable(TRUE); + + // ------------------------------------------------------------------ + // If I was hurt by someone in my own faction + // Then clear any hostile feelings I have against them + // After all, we're all just trying to do our job here + // if we singe some eyebrow hair, oh well. + // ------------------------------------------------------------------ + if (GetFactionEqual(oCaster, OBJECT_SELF) == TRUE) + { + ClearPersonalReputation(oCaster, OBJECT_SELF); + ClearAllActions(TRUE); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(OBJECT_INVALID))); + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + return; + } + + int bAttack = TRUE; + // ------------------------------------------------------------------ + // GZ, 2003-Oct-02 + // Try to do something smart if we are subject to an AoE Spell. + // ------------------------------------------------------------------ + if (MatchAreaOfEffectSpell(GetLastSpell()) == TRUE) + { + int nAI = (GetBestAOEBehavior(GetLastSpell())); // from x2_i0_spells + switch (nAI) + { + case X2_SPELL_AOEBEHAVIOR_DISPEL_L: + case X2_SPELL_AOEBEHAVIOR_DISPEL_N: + case X2_SPELL_AOEBEHAVIOR_DISPEL_M: + case X2_SPELL_AOEBEHAVIOR_DISPEL_G: + case X2_SPELL_AOEBEHAVIOR_DISPEL_C: + bAttack = FALSE; + ActionCastSpellAtLocation(nAI, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + break; + + case X2_SPELL_AOEBEHAVIOR_FLEE: + ClearActions(CLEAR_NW_C2_DEFAULTB_GUSTWIND); + oCaster = GetLastSpellCaster(); + ActionForceMoveToObject(oCaster, TRUE, 2.0); + DelayCommand(1.2, ActionDoCommand(DetermineCombatRound(oCaster))); + bAttack = FALSE; + break; + + case X2_SPELL_AOEBEHAVIOR_IGNORE: + // well ... nothing + break; + + case X2_SPELL_AOEBEHAVIOR_GUST: + ActionCastSpellAtLocation(SPELL_GUST_OF_WIND, GetLocation(OBJECT_SELF)); + ActionDoCommand(SetCommandable(TRUE)); + SetCommandable(FALSE); + bAttack = FALSE; + break; + } + + } + // --------------------------------------------------------------------- + // Not an area of effect spell, but another hostile spell. + // If we're not already fighting someone else, + // attack the caster. + // --------------------------------------------------------------------- + if( !GetIsFighting(OBJECT_SELF) && bAttack) + { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) + { + DetermineSpecialBehavior(oCaster); + } + else + { + DetermineCombatRound(oCaster); + } + } + + // We were attacked, so yell for help + SetCommandable(TRUE); + //Shout Attack my target, only works with the On Spawn In setup + SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); + + //Shout that I was attacked + SpeakString("NSpeakSW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + } + else + { + // --------------------------------------------------------------------- + // July 14, 2003 BK + // If there is a valid enemy nearby and a NON HARMFUL spell has been + // cast on me I should call DetermineCombatRound + // I may be invisible and casting spells on myself to buff myself up + // --------------------------------------------------------------------- + object oEnemy =GetNearestEnemy(); + if (GetIsObjectValid(oEnemy) == TRUE) + { + // SpeakString("keep me in combat"); + DetermineCombatRound(oEnemy); + } + } + + // Send the user-defined event as appropriate + if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_SPELL_CAST_AT)); + } + + +} diff --git a/nwnds_module/preai_defaultd.ncs b/nwnds_module/preai_defaultd.ncs new file mode 100644 index 000000000..f869d4669 Binary files /dev/null and b/nwnds_module/preai_defaultd.ncs differ diff --git a/nwnds_module/preai_defaultd.nss b/nwnds_module/preai_defaultd.nss new file mode 100644 index 000000000..fbaad70be --- /dev/null +++ b/nwnds_module/preai_defaultd.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: Default: On User Defined +//:: NW_C2_DEFAULTD +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + on a user defined event. +*/ +//::////////////////////////////////////////////// +//:: Created By: Don Moar +//:: Created On: April 28, 2002 +//::////////////////////////////////////////////// +void main() +{ + // enter desired behaviour here + + return; + +} diff --git a/nwnds_module/preai_defaulte.ncs b/nwnds_module/preai_defaulte.ncs new file mode 100644 index 000000000..fa6e93649 Binary files /dev/null and b/nwnds_module/preai_defaulte.ncs differ diff --git a/nwnds_module/preai_defaulte.nss b/nwnds_module/preai_defaulte.nss new file mode 100644 index 000000000..d697fb75e --- /dev/null +++ b/nwnds_module/preai_defaulte.nss @@ -0,0 +1,49 @@ +//:://///////////////////////////////////////////// +//:: Default On Blocked +//:: NW_C2_DEFAULTE +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + This will cause blocked creatures to open + or smash down doors depending on int and + str. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 23, 2001 +//::////////////////////////////////////////////// + +void main() +{ + object oDoor = GetBlockingDoor(); + if (GetObjectType(oDoor) == OBJECT_TYPE_CREATURE) + { + // * Increment number of times blocked + /*SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED", GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") + 1); + if (GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") > 3) + { + SpeakString("Blocked by creature"); + SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED",0); + ClearAllActions(); + object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + if (GetIsObjectValid(oEnemy) == TRUE) + { + ActionEquipMostDamagingRanged(oEnemy); + ActionAttack(oEnemy); + } + return; + } */ + return; + } + if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5) + { + if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 ) + { + DoDoorAction(oDoor, DOOR_ACTION_OPEN); + } + else if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_BASH)) + { + DoDoorAction(oDoor, DOOR_ACTION_BASH); + } + } +} diff --git a/nwnds_module/prearthelemhide.uti b/nwnds_module/prearthelemhide.uti new file mode 100644 index 000000000..e500adb0c Binary files /dev/null and b/nwnds_module/prearthelemhide.uti differ diff --git a/nwnds_module/prearthelemslam.uti b/nwnds_module/prearthelemslam.uti new file mode 100644 index 000000000..4cf1941e1 Binary files /dev/null and b/nwnds_module/prearthelemslam.uti differ diff --git a/nwnds_module/prfireelemhide.uti b/nwnds_module/prfireelemhide.uti new file mode 100644 index 000000000..3e4a14712 Binary files /dev/null and b/nwnds_module/prfireelemhide.uti differ diff --git a/nwnds_module/prfireelemslam.uti b/nwnds_module/prfireelemslam.uti new file mode 100644 index 000000000..2db85f396 Binary files /dev/null and b/nwnds_module/prfireelemslam.uti differ diff --git a/nwnds_module/pridemane001.utc b/nwnds_module/pridemane001.utc new file mode 100644 index 000000000..41e06afd0 Binary files /dev/null and b/nwnds_module/pridemane001.utc differ diff --git a/nwnds_module/pridemane002.utc b/nwnds_module/pridemane002.utc new file mode 100644 index 000000000..3444c5789 Binary files /dev/null and b/nwnds_module/pridemane002.utc differ diff --git a/nwnds_module/pridemane003.utc b/nwnds_module/pridemane003.utc new file mode 100644 index 000000000..31f2007ad Binary files /dev/null and b/nwnds_module/pridemane003.utc differ diff --git a/nwnds_module/pridemanehide001.uti b/nwnds_module/pridemanehide001.uti new file mode 100644 index 000000000..32dfb499b Binary files /dev/null and b/nwnds_module/pridemanehide001.uti differ diff --git a/nwnds_module/pridemanetouch01.uti b/nwnds_module/pridemanetouch01.uti new file mode 100644 index 000000000..d3a7dfc6e Binary files /dev/null and b/nwnds_module/pridemanetouch01.uti differ diff --git a/nwnds_module/prism_aura.ncs b/nwnds_module/prism_aura.ncs new file mode 100644 index 000000000..f3296124c Binary files /dev/null and b/nwnds_module/prism_aura.ncs differ diff --git a/nwnds_module/prism_aura.nss b/nwnds_module/prism_aura.nss new file mode 100644 index 000000000..f8990c6c1 --- /dev/null +++ b/nwnds_module/prism_aura.nss @@ -0,0 +1,16 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_ELECTRICAL,"prism_aura1","prism_aura2","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); + + effect eConceal = EffectConcealment(50); + eConceal = SupernaturalEffect(eConceal); + eConceal = ExtraordinaryEffect(eConceal); + + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eConceal,OBJECT_SELF); + + +} diff --git a/nwnds_module/prism_aura1.ncs b/nwnds_module/prism_aura1.ncs new file mode 100644 index 000000000..e4c60af38 Binary files /dev/null and b/nwnds_module/prism_aura1.ncs differ diff --git a/nwnds_module/prism_aura1.nss b/nwnds_module/prism_aura1.nss new file mode 100644 index 000000000..b33413ba7 --- /dev/null +++ b/nwnds_module/prism_aura1.nss @@ -0,0 +1,135 @@ +#include "nw_i0_spells" + +void DoPrismatic(object oTarget, object oCaster); +int ApplyPrismaticEffect(int nEffect, object oTarget, object oCaster); + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + if ( oTarget == oCaster ) + return; + + if ( GetIsEnemy(oTarget,oCaster) ) + { + DoPrismatic(oTarget,oCaster); + } + +} + +void DoPrismatic(object oTarget, object oCaster) +{ + float fDelay = 0.0; + int nCasterLevel = GetHitDice(oCaster); + int nHD = GetHitDice(oTarget); + int nVisual = 0; + effect eVisual; + if (nHD <= 8) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), oTarget, RoundsToSeconds(nCasterLevel)); + } + //Determine if 1 or 2 effects are going to be applied + int nRandom = d8(); + if(nRandom == 8) + { + //Get the visual effect + nVisual = ApplyPrismaticEffect(Random(7) + 1, oTarget,oCaster); + nVisual = ApplyPrismaticEffect(Random(7) + 1, oTarget,oCaster); + } + else + { + //Get the visual effect + nVisual = ApplyPrismaticEffect(nRandom, oTarget,oCaster); + } + //Set the visual effect + if(nVisual != 0) + { + eVisual = EffectVisualEffect(nVisual); + //Apply the visual effect + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget)); + } +} + +int ApplyPrismaticEffect(int nEffect, object oTarget, object oCaster) +{ + int nDC = 49; + int nDamage; + effect ePrism; + effect eVis; + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink; + int nVis; + float fDelay = 0.0; + //Based on the random number passed in, apply the appropriate effect and set the visual to + //the correct constant + switch(nEffect) + { + case 1://fire + nDamage = 20; + nVis = VFX_IMP_FLAME_S; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 2: //Acid + nDamage = 40; + nVis = VFX_IMP_ACID_L; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ACID,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_ACID); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 3: //Electricity + nDamage = 80; + nVis = VFX_IMP_LIGHTNING_S; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 4: //Poison + { + effect ePoison = EffectPoison(POISON_BEBILITH_VENOM); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePoison, oTarget)); + } + break; + case 5: //Paralyze + { + effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED); + if (MySavingThrow(SAVING_THROW_FORT, oTarget, nDC,SAVING_THROW_TYPE_NONE,oCaster) == 0) + { + ePrism = EffectParalyze(); + eLink = EffectLinkEffects(eDur, ePrism); + eLink = EffectLinkEffects(eLink, eDur2); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10))); + } + } + break; + case 6: //Confusion + { + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + ePrism = EffectConfused(); + eLink = EffectLinkEffects(eMind, ePrism); + eLink = EffectLinkEffects(eLink, eDur); + + if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oCaster, fDelay)) + { + nVis = VFX_IMP_CONFUSION_S; + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10))); + } + } + break; + case 7: //Death + { + if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oCaster, fDelay)) + { + //nVis = VFX_IMP_DEATH; + ePrism = EffectDeath(); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + } + } + break; + } + return nVis; +} + + diff --git a/nwnds_module/prism_aura2.ncs b/nwnds_module/prism_aura2.ncs new file mode 100644 index 000000000..d6146c25b Binary files /dev/null and b/nwnds_module/prism_aura2.ncs differ diff --git a/nwnds_module/prism_aura2.nss b/nwnds_module/prism_aura2.nss new file mode 100644 index 000000000..f48705038 --- /dev/null +++ b/nwnds_module/prism_aura2.nss @@ -0,0 +1,136 @@ +#include "nw_i0_spells" + +void DoPrismatic(object oTarget, object oCaster); +int ApplyPrismaticEffect(int nEffect, object oTarget, object oCaster); + +void main() +{ + object oCaster = GetAreaOfEffectCreator(); + object oTarget = GetFirstInPersistentObject(); + + while ( GetIsObjectValid(oTarget ) ) + { + if ( GetIsEnemy(oTarget,oCaster) ) + { + DoPrismatic(oTarget,oCaster); + } + oTarget = GetNextInPersistentObject(); + } +} + + +void DoPrismatic(object oTarget, object oCaster) +{ + float fDelay = 0.0; + int nCasterLevel = GetHitDice(oCaster); + int nHD = GetHitDice(oTarget); + int nVisual = 0; + effect eVisual; + if (nHD <= 8) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectBlindness(), oTarget, RoundsToSeconds(nCasterLevel)); + } + //Determine if 1 or 2 effects are going to be applied + int nRandom = d8(); + if(nRandom == 8) + { + //Get the visual effect + nVisual = ApplyPrismaticEffect(Random(7) + 1, oTarget,oCaster); + nVisual = ApplyPrismaticEffect(Random(7) + 1, oTarget,oCaster); + } + else + { + //Get the visual effect + nVisual = ApplyPrismaticEffect(nRandom, oTarget,oCaster); + } + //Set the visual effect + if(nVisual != 0) + { + eVisual = EffectVisualEffect(nVisual); + //Apply the visual effect + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oTarget)); + } +} + +int ApplyPrismaticEffect(int nEffect, object oTarget, object oCaster) +{ + int nDC = 49; + int nDamage; + effect ePrism; + effect eVis; + effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + effect eLink; + int nVis; + float fDelay = 0.0; + //Based on the random number passed in, apply the appropriate effect and set the visual to + //the correct constant + switch(nEffect) + { + case 1://fire + nDamage = 20; + nVis = VFX_IMP_FLAME_S; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_FIRE,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 2: //Acid + nDamage = 40; + nVis = VFX_IMP_ACID_L; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ACID,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_ACID); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 3: //Electricity + nDamage = 80; + nVis = VFX_IMP_LIGHTNING_S; + nDamage = GetReflexAdjustedDamage(nDamage, oTarget, nDC,SAVING_THROW_TYPE_ELECTRICITY,oCaster); + ePrism = EffectDamage(nDamage, DAMAGE_TYPE_ELECTRICAL); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + break; + case 4: //Poison + { + effect ePoison = EffectPoison(POISON_BEBILITH_VENOM); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePoison, oTarget)); + } + break; + case 5: //Paralyze + { + effect eDur2 = EffectVisualEffect(VFX_DUR_PARALYZED); + if (MySavingThrow(SAVING_THROW_FORT, oTarget, nDC,SAVING_THROW_TYPE_NONE,oCaster) == 0) + { + ePrism = EffectParalyze(); + eLink = EffectLinkEffects(eDur, ePrism); + eLink = EffectLinkEffects(eLink, eDur2); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10))); + } + } + break; + case 6: //Confusion + { + effect eMind = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + ePrism = EffectConfused(); + eLink = EffectLinkEffects(eMind, ePrism); + eLink = EffectLinkEffects(eLink, eDur); + + if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oCaster, fDelay)) + { + nVis = VFX_IMP_CONFUSION_S; + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(10))); + } + } + break; + case 7: //Death + { + if (!/*Will Save*/ MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, oCaster, fDelay)) + { + //nVis = VFX_IMP_DEATH; + ePrism = EffectDeath(); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, ePrism, oTarget)); + } + } + break; + } + return nVis; +} + + diff --git a/nwnds_module/prismasaurus001.utc b/nwnds_module/prismasaurus001.utc new file mode 100644 index 000000000..5ab18195d Binary files /dev/null and b/nwnds_module/prismasaurus001.utc differ diff --git a/nwnds_module/prismasaurusbite.uti b/nwnds_module/prismasaurusbite.uti new file mode 100644 index 000000000..5273995be Binary files /dev/null and b/nwnds_module/prismasaurusbite.uti differ diff --git a/nwnds_module/prismasaurushide.uti b/nwnds_module/prismasaurushide.uti new file mode 100644 index 000000000..afafbe13d Binary files /dev/null and b/nwnds_module/prismasaurushide.uti differ diff --git a/nwnds_module/prismasaurusslam.uti b/nwnds_module/prismasaurusslam.uti new file mode 100644 index 000000000..150a6d8b4 Binary files /dev/null and b/nwnds_module/prismasaurusslam.uti differ diff --git a/nwnds_module/prwaterelemhide.uti b/nwnds_module/prwaterelemhide.uti new file mode 100644 index 000000000..b40406258 Binary files /dev/null and b/nwnds_module/prwaterelemhide.uti differ diff --git a/nwnds_module/prwaterelemslam.uti b/nwnds_module/prwaterelemslam.uti new file mode 100644 index 000000000..bb5a721d0 Binary files /dev/null and b/nwnds_module/prwaterelemslam.uti differ diff --git a/nwnds_module/ps_accelerate.ncs b/nwnds_module/ps_accelerate.ncs new file mode 100644 index 000000000..e2d9663b8 Binary files /dev/null and b/nwnds_module/ps_accelerate.ncs differ diff --git a/nwnds_module/ps_accelerate.nss b/nwnds_module/ps_accelerate.nss new file mode 100644 index 000000000..c778dde79 --- /dev/null +++ b/nwnds_module/ps_accelerate.nss @@ -0,0 +1,30 @@ +/************************************ +* Accelerate * +* * +* Cost: 20 * +* Power Score: Con -2 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=20; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + effect eVis=EffectVisualEffect(VFX_IMP_HASTE); + effect eLink=EffectLinkEffects(EffectHaste(), EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ACCELERATE); + int nDuration=nLevel; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ACCELERATE)) return; + + nDuration=GetEnhancedDuration(nDuration); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + +} diff --git a/nwnds_module/ps_adrcontrol.ncs b/nwnds_module/ps_adrcontrol.ncs new file mode 100644 index 000000000..5f864f430 Binary files /dev/null and b/nwnds_module/ps_adrcontrol.ncs differ diff --git a/nwnds_module/ps_adrcontrol.nss b/nwnds_module/ps_adrcontrol.nss new file mode 100644 index 000000000..5a53e5e46 --- /dev/null +++ b/nwnds_module/ps_adrcontrol.nss @@ -0,0 +1,33 @@ +/************************************ +* Adrenaline Control * +* * +* Cost: 12 * +* Power Score: Con -2 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + effect eVis=EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ADRENALINE_CONTROL); + int nDuration=nLevel; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ADRENALINE_CONTROL)) return; + + effect eLink=EffectLinkEffects(EffectAbilityIncrease(ABILITY_STRENGTH, GetEnhancedEffect(d4(), FEAT_PSIONIC_ADRENALINE_CONTROL)), EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(EffectAbilityIncrease(ABILITY_DEXTERITY, GetEnhancedEffect(d4(), FEAT_PSIONIC_ADRENALINE_CONTROL)), eLink); + eLink=EffectLinkEffects(EffectAbilityIncrease(ABILITY_CONSTITUTION, GetEnhancedEffect(d4(), FEAT_PSIONIC_ADRENALINE_CONTROL)), eLink); + eLink=ExtraordinaryEffect(eLink); + nDuration=GetEnhancedDuration(nDuration); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + +} diff --git a/nwnds_module/ps_amltlt_bodgod.uti b/nwnds_module/ps_amltlt_bodgod.uti new file mode 100644 index 000000000..13599c2cf Binary files /dev/null and b/nwnds_module/ps_amltlt_bodgod.uti differ diff --git a/nwnds_module/ps_animshadow.ncs b/nwnds_module/ps_animshadow.ncs new file mode 100644 index 000000000..c2e652d66 Binary files /dev/null and b/nwnds_module/ps_animshadow.ncs differ diff --git a/nwnds_module/ps_animshadow.nss b/nwnds_module/ps_animshadow.nss new file mode 100644 index 000000000..92a098c47 --- /dev/null +++ b/nwnds_module/ps_animshadow.nss @@ -0,0 +1,37 @@ +/************************************ +* Animate Shadow * +* * +* Cost: 16 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ANIMATE_SHADOW); + effect eSummon; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ANIMATE_SHADOW)) return; + + if (nLevel <= 9) + { + eSummon = EffectSummonCreature("NW_S_SHADOW",VFX_FNF_SUMMON_UNDEAD); + } + else if ((nLevel >= 10) && (nLevel <= 14)) + { + eSummon = EffectSummonCreature("NW_S_SHFIEND",VFX_FNF_SUMMON_UNDEAD); + } + else if ((nLevel >= 15)) + { + eSummon = EffectSummonCreature("NW_S_SHADLORD",VFX_FNF_SUMMON_UNDEAD); + } + + + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(24)); + +} diff --git a/nwnds_module/ps_attract.ncs b/nwnds_module/ps_attract.ncs new file mode 100644 index 000000000..c32b436f9 Binary files /dev/null and b/nwnds_module/ps_attract.ncs differ diff --git a/nwnds_module/ps_attract.nss b/nwnds_module/ps_attract.nss new file mode 100644 index 000000000..336384a8b --- /dev/null +++ b/nwnds_module/ps_attract.nss @@ -0,0 +1,35 @@ +/************************************ +* Attraction * +* * +* Cost: 12 * +* Power Score: Wis -4 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_IMP_CHARM); + effect eLink=EffectLinkEffects(EffectCharmed(), EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ATTRACTION); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ATTRACTION)) return; + + int nDuration=GetEnhancedDuration(nLevel+1); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_ATTRACTION, FALSE)); + + if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } + +} diff --git a/nwnds_module/ps_aversion.ncs b/nwnds_module/ps_aversion.ncs new file mode 100644 index 000000000..a16fb79b6 Binary files /dev/null and b/nwnds_module/ps_aversion.ncs differ diff --git a/nwnds_module/ps_aversion.nss b/nwnds_module/ps_aversion.nss new file mode 100644 index 000000000..c865324f7 --- /dev/null +++ b/nwnds_module/ps_aversion.nss @@ -0,0 +1,35 @@ +/************************************ +* Aversion * +* * +* Cost: 12 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eLink=EffectLinkEffects(eVis, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectFrightened()); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_AVERSION); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_AVERSION)) return; + + int nDuration=GetEnhancedDuration(2+nLevel); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PSIONIC_AVERSION)); + + if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } + +} diff --git a/nwnds_module/ps_balatk.ncs b/nwnds_module/ps_balatk.ncs new file mode 100644 index 000000000..9c3ddb80b Binary files /dev/null and b/nwnds_module/ps_balatk.ncs differ diff --git a/nwnds_module/ps_balatk.nss b/nwnds_module/ps_balatk.nss new file mode 100644 index 000000000..c2b1baf8b --- /dev/null +++ b/nwnds_module/ps_balatk.nss @@ -0,0 +1,31 @@ +/************************************ +* Ballistic Attack * +* * +* Cost: 5 * +* Power Score: Con -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_BALLISTIC_ATTACK); + effect eVis=EffectVisualEffect(VFX_COM_BLOOD_SPARK_LARGE); + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_BALLISTIC_ATTACK)) return; + + effect eLink=EffectLinkEffects(eVis,EffectVisualEffect(VFX_COM_HIT_FROST)); + eLink=EffectLinkEffects(eLink, EffectDamage(GetEnhancedEffect(d6()+nLevel, FEAT_PSIONIC_BALLISTIC_ATTACK), DAMAGE_TYPE_BLUDGEONING, (nLevel/7))); + eLink=ExtraordinaryEffect(eLink); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_BALLISTIC_ATTACK)); + + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget)); + + +} diff --git a/nwnds_module/ps_banish.ncs b/nwnds_module/ps_banish.ncs new file mode 100644 index 000000000..e8cb61327 Binary files /dev/null and b/nwnds_module/ps_banish.ncs differ diff --git a/nwnds_module/ps_banish.nss b/nwnds_module/ps_banish.nss new file mode 100644 index 000000000..95a834a40 --- /dev/null +++ b/nwnds_module/ps_banish.nss @@ -0,0 +1,64 @@ +/************************************ +* Banishment * +* * +* Cost: 25 * +* Power Score: Int -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=25; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-1; + effect eVis=EffectVisualEffect(VFX_IMP_EVIL_HELP); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_DISPEL)); + effect eVis2=EffectVisualEffect(VFX_IMP_GOOD_HELP); + eVis2=EffectLinkEffects(eVis2,EffectVisualEffect(VFX_IMP_DISPEL)); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_BANISHMENT); + int nDuration=1+nLevel/2; + object oTarget=GetSpellTargetObject(); + object oBanArea=GetObjectByTag("AR_Banishment"); + int nBanIndex=GetLocalInt(oBanArea, "BanIndex")+1; + if (nBanIndex>=37) nBanIndex=1; + location lDest=GetLocation(GetWaypointByTag("Banish_WP_"+IntToString(nBanIndex))); + location lHere=GetLocation(oTarget); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE, oPC); + + if(oTarget==oPC) + { + FloatingTextStringOnCreature("You cannot banish yourself.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if(GetIsDM(oTarget)) + { + FloatingTextStringOnCreature("You cannot banish the Dungeon Master.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oPC, 8.0); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_BANISHMENT)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_BANISHMENT, FALSE)); + + if (GetIsReactionTypeHostile(oPC, oTarget) + && ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + return; + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lHere); + AssignCommand(oTarget, ClearAllActions()); + AssignCommand(oTarget, JumpToLocation(lDest)); + SetLocalInt(oBanArea, "BanIndex", nBanIndex); + + nDuration=GetEnhancedDuration(nDuration); + + DelayCommand(RoundsToSeconds(nDuration), AssignCommand(oTarget, ClearAllActions())); + DelayCommand(RoundsToSeconds(nDuration)+0.3, AssignCommand(oTarget, JumpToLocation(lHere))); + DelayCommand(RoundsToSeconds(nDuration), ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis2, lHere)); + +} diff --git a/nwnds_module/ps_biofeedbk.ncs b/nwnds_module/ps_biofeedbk.ncs new file mode 100644 index 000000000..7d3d3a8a5 Binary files /dev/null and b/nwnds_module/ps_biofeedbk.ncs differ diff --git a/nwnds_module/ps_biofeedbk.nss b/nwnds_module/ps_biofeedbk.nss new file mode 100644 index 000000000..47497e0f8 --- /dev/null +++ b/nwnds_module/ps_biofeedbk.nss @@ -0,0 +1,31 @@ +/************************************ +* Biofeedback * +* * +* Cost: 10 * +* Power Score: Con -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=10; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + effect eVis=EffectVisualEffect(VFX_IMP_DEATH_WARD); + effect eLink=EffectACIncrease(1, AC_NATURAL_BONUS); + eLink=EffectLinkEffects(eLink, EffectDamageReduction(5, DAMAGE_POWER_PLUS_TWENTY)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_BIOFEEDBACK); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_BIOFEEDBACK)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_BIOFEEDBACK); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_cani2.ncs b/nwnds_module/ps_cani2.ncs new file mode 100644 index 000000000..371335e27 Binary files /dev/null and b/nwnds_module/ps_cani2.ncs differ diff --git a/nwnds_module/ps_cani2.nss b/nwnds_module/ps_cani2.nss new file mode 100644 index 000000000..5aac37326 --- /dev/null +++ b/nwnds_module/ps_cani2.nss @@ -0,0 +1,21 @@ +#include "lib_psionic" + +void main() +{ + object oPC=GetLocalObject(GetModule(), "Cani"); + int nPSP=GetPSP(oPC); + int nPSPMax=GetMaxPSP(oPC); + effect eVis=EffectVisualEffect(VFX_FNF_PWSTUN); + effect eLink=EffectAbilityDecrease(ABILITY_CONSTITUTION, 1); + eLink=ExtraordinaryEffect(eLink); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, HoursToSeconds(24)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + nPSP=nPSP+16; + if (nPSP>nPSPMax) nPSP=nPSPMax; + SetPSP(oPC, nPSP); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + + DeleteLocalObject(GetModule(), "Cani"); + +} diff --git a/nwnds_module/ps_cannibal.ncs b/nwnds_module/ps_cannibal.ncs new file mode 100644 index 000000000..1249df7bb Binary files /dev/null and b/nwnds_module/ps_cannibal.ncs differ diff --git a/nwnds_module/ps_cannibal.nss b/nwnds_module/ps_cannibal.nss new file mode 100644 index 000000000..5cff3210e --- /dev/null +++ b/nwnds_module/ps_cannibal.nss @@ -0,0 +1,37 @@ +/************************************ +* Cannibalize * +* * +* Cost: 0 * +* Power Score: Con * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=0; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION); + int nCon=GetAbilityScore(oPC, ABILITY_CONSTITUTION); + + if (nCon==3) + { + FloatingTextStringOnCreature("You do not have enough constitution.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CANNIBALIZE, TRUE)) return; + + if (GetIsImmune(oPC, IMMUNITY_TYPE_ABILITY_DECREASE)) + { + FloatingTextStringOnCreature("You are immune to the draining effects of this power.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + SetLocalObject(GetModule(), "Cani", oPC); + ExecuteScript("ps_cani2", GetModule()); + +} diff --git a/nwnds_module/ps_catfall.ncs b/nwnds_module/ps_catfall.ncs new file mode 100644 index 000000000..1288dcaa5 Binary files /dev/null and b/nwnds_module/ps_catfall.ncs differ diff --git a/nwnds_module/ps_catfall.nss b/nwnds_module/ps_catfall.nss new file mode 100644 index 000000000..2a6023ad8 --- /dev/null +++ b/nwnds_module/ps_catfall.nss @@ -0,0 +1,31 @@ +/************************************ +* Catfall * +* * +* Cost: 8 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=8; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + effect eVis=EffectVisualEffect(VFX_IMP_HASTE); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_HOLY_AID)); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CATFALL); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CATFALL)) return; + + effect eLink=EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_TUMBLE, GetEnhancedEffect(5, FEAT_PSIONIC_CATFALL))); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_causeslp.ncs b/nwnds_module/ps_causeslp.ncs new file mode 100644 index 000000000..627a6d840 Binary files /dev/null and b/nwnds_module/ps_causeslp.ncs differ diff --git a/nwnds_module/ps_causeslp.nss b/nwnds_module/ps_causeslp.nss new file mode 100644 index 000000000..79603e969 --- /dev/null +++ b/nwnds_module/ps_causeslp.nss @@ -0,0 +1,71 @@ +/************************************ +* Cause Sleep * +* * +* Cost: 11 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +void Zzzz(object oSleeper) +{ + effect eChk=GetFirstEffect(oSleeper); + int bSleepFound=FALSE; + + while(GetIsEffectValid(eChk)) + { + if (GetEffectType(eChk)==EFFECT_TYPE_SLEEP) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oSleeper); + DelayCommand(4.0, Zzzz(oSleeper)); + return; + } + + eChk=GetNextEffect(oSleeper); + } + +} + + + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=11; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eLink=EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_IMP_SLEEP)); + eLink=EffectLinkEffects(eLink, EffectSleep()); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CAUSE_SLEEP); + object oTarget=GetSpellTargetObject(); + int nTargRace=GetRacialType(oTarget); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This being never sleeps.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CAUSE_SLEEP)) return; + + int nDuration=GetEnhancedDuration(3+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PSIONIC_CAUSE_SLEEP)); + + if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + AssignCommand(oTarget, PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, IntToFloat(nDuration))); + DelayCommand(4.0, Zzzz(oTarget)); + } + + else ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_WILL_SAVING_THROW_USE), oTarget); + +} diff --git a/nwnds_module/ps_celladj.ncs b/nwnds_module/ps_celladj.ncs new file mode 100644 index 000000000..88b5ed643 Binary files /dev/null and b/nwnds_module/ps_celladj.ncs differ diff --git a/nwnds_module/ps_celladj.nss b/nwnds_module/ps_celladj.nss new file mode 100644 index 000000000..c655a52ec --- /dev/null +++ b/nwnds_module/ps_celladj.nss @@ -0,0 +1,36 @@ +/************************************ +* Cell Adjustment * +* * +* Cost: 12 * +* Power Score: Con -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + effect eVis=EffectVisualEffect(VFX_IMP_HEALING_S); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CELL_ADJUSTMENT); + object oTarget=GetSpellTargetObject(); + effect eChk=GetFirstEffect(oTarget); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CELL_ADJUSTMENT)) return; + + effect eLink=EffectHeal(GetEnhancedEffect(d8()+2*nLevel, FEAT_PSIONIC_CELL_ADJUSTMENT)); + eLink=EffectLinkEffects(eLink, eVis); + + while (GetIsEffectValid(eChk)) + { + if (GetEffectType(eChk)==EFFECT_TYPE_DISEASE) + RemoveEffect(oTarget, eChk); + + eChk=GetNextEffect(oTarget); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); +} diff --git a/nwnds_module/ps_champwr.ncs b/nwnds_module/ps_champwr.ncs new file mode 100644 index 000000000..a08f63903 Binary files /dev/null and b/nwnds_module/ps_champwr.ncs differ diff --git a/nwnds_module/ps_champwr.nss b/nwnds_module/ps_champwr.nss new file mode 100644 index 000000000..bb0932b31 --- /dev/null +++ b/nwnds_module/ps_champwr.nss @@ -0,0 +1,30 @@ +/************************************ +* Chameleon Power * +* * +* Cost: 12 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + effect eVis=EffectVisualEffect(VFX_IMP_REMOVE_CONDITION); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CHAMELEON_POWER); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CHAMELEON_POWER)) return; + + effect eLink=EffectVisualEffect(VFX_DUR_GHOSTLY_PULSE); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_HIDE, GetEnhancedEffect(10, FEAT_PSIONIC_CHAMELEON_POWER))); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_MOVE_SILENTLY, GetEnhancedEffect(10, FEAT_PSIONIC_CHAMELEON_POWER))); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_chemsim_a.ncs b/nwnds_module/ps_chemsim_a.ncs new file mode 100644 index 000000000..472e8c71d Binary files /dev/null and b/nwnds_module/ps_chemsim_a.ncs differ diff --git a/nwnds_module/ps_chemsim_a.nss b/nwnds_module/ps_chemsim_a.nss new file mode 100644 index 000000000..c934a0138 --- /dev/null +++ b/nwnds_module/ps_chemsim_a.nss @@ -0,0 +1,47 @@ +/************************************ +* Chemical Simulation, Acid * +* * +* Cost: 9 * +* Power Score: Con -3 * +* * +************************************/ + +#include "lib_psionic" + +void AcidBurn(object oTarget, object oCaster, int nRoundsLeft, int nMult) +{ + effect eVis=EffectVisualEffect(VFX_IMP_ACID_S); + int nLevel=GetEffectivePsionicLevel(oCaster, FEAT_PSIONIC_CHEMICAL_SIMULATION); + int nDamage=(nMult*d6(nRoundsLeft))/EFFECT_SCALING_FACTOR; + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION, oCaster); + + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_ACID, oCaster)) + nDamage=nDamage/2; + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_ACID), oTarget); + + nRoundsLeft--; + if(nRoundsLeft>0) DelayCommand(6.0, AcidBurn(oTarget, oCaster, nRoundsLeft, nMult)); +} + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=9; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + effect eVis=EffectVisualEffect(VFX_IMP_ACID_S); + int nDuration=4; + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CHEMICAL_SIMULATION)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_CHEMICAL_SIMULATION)); + + if(TouchAttackMelee(oTarget)) + { + AcidBurn(oTarget, oPC, nDuration, GetEnhancedEffect(EFFECT_SCALING_FACTOR, FEAT_PSIONIC_CHEMICAL_SIMULATION)); + } + +} diff --git a/nwnds_module/ps_chemsim_p.ncs b/nwnds_module/ps_chemsim_p.ncs new file mode 100644 index 000000000..79fb96aa7 Binary files /dev/null and b/nwnds_module/ps_chemsim_p.ncs differ diff --git a/nwnds_module/ps_chemsim_p.nss b/nwnds_module/ps_chemsim_p.nss new file mode 100644 index 000000000..319b3c6de --- /dev/null +++ b/nwnds_module/ps_chemsim_p.nss @@ -0,0 +1,43 @@ +/************************************ +* Chemical Simulation, Poison * +* * +* Cost: 9 * +* Power Score: Con -3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=9; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + int nPType; + effect eLink; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CHEMICAL_SIMULATION); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CHEMICAL_SIMULATION)) return; + + //get poison type, based on DC. + //At the highest levels there's a 1 in 3 chance + //to get a different poison. + if (nDC<18) nPType=POISON_ARSENIC; //(Con:1/2d8) DC:13 + else if (nDC<22) nPType=POISON_DARK_REAVER_POWDER; //(Con:2d6/2d6) DC:18 + else if (nDC<26) nPType=POISON_BEBILITH_VENOM; //(Con:1d6/2d6) DC:20 + else if (nDC<30) nPType=POISON_BLACK_LOTUS_EXTRACT; //(Con:3d6/3d6) DC:20 + else if (nDC<35 || d6()<3) nPType=44; //(Con:2d6/2d6) DC:26 + else nPType=POISON_COLOSSAL_SPIDER_VENOM; //(Str:2d8/2d8) DC:35 + + eLink=EffectPoison(nPType); + eLink=ExtraordinaryEffect(eLink); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_CHEMICAL_SIMULATION)); + + if(TouchAttackMelee(oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget); + } +} diff --git a/nwnds_module/ps_clair.ncs b/nwnds_module/ps_clair.ncs new file mode 100644 index 000000000..58c4ed7d7 Binary files /dev/null and b/nwnds_module/ps_clair.ncs differ diff --git a/nwnds_module/ps_clair.nss b/nwnds_module/ps_clair.nss new file mode 100644 index 000000000..5c9650bd9 --- /dev/null +++ b/nwnds_module/ps_clair.nss @@ -0,0 +1,32 @@ +/************************************ +* Clairvoyance/Clairaudience * +* * +* Cost: 6 * +* Power Score: Wis -1 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=6; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-1; + effect eVis=EffectVisualEffect(VFX_IMP_MAGICAL_VISION); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE)) return; + + effect eLink=EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_SPOT, GetEnhancedEffect(10, FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE))); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_LISTEN, GetEnhancedEffect(10, FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE))); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_SEARCH, GetEnhancedEffect(10, FEAT_PSIONIC_CLAIRVOYANCE_CLAIRAUDIENCE))); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_cmbtmind.ncs b/nwnds_module/ps_cmbtmind.ncs new file mode 100644 index 000000000..b8f13c1de Binary files /dev/null and b/nwnds_module/ps_cmbtmind.ncs differ diff --git a/nwnds_module/ps_cmbtmind.nss b/nwnds_module/ps_cmbtmind.nss new file mode 100644 index 000000000..72d164e8f --- /dev/null +++ b/nwnds_module/ps_cmbtmind.nss @@ -0,0 +1,35 @@ +/************************************ +* Combat Mind * +* * +* Cost: 9 * +* Power Score: Int -2 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=9; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-2; + effect eVis=EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_COMBAT_MIND); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_COMBAT_MIND)) return; + + effect eLink=EffectLinkEffects(EffectACIncrease(GetEnhancedEffect(2, FEAT_PSIONIC_COMBAT_MIND)), EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(EffectSavingThrowIncrease(SAVING_THROW_ALL, GetEnhancedEffect(2, FEAT_PSIONIC_COMBAT_MIND)), eLink); + eLink=EffectLinkEffects(EffectAttackIncrease(GetEnhancedEffect(2, FEAT_PSIONIC_COMBAT_MIND)), eLink); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_COMBAT_MIND); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_COMBAT_MIND, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + +} diff --git a/nwnds_module/ps_cntrlwind.ncs b/nwnds_module/ps_cntrlwind.ncs new file mode 100644 index 000000000..40452e39e Binary files /dev/null and b/nwnds_module/ps_cntrlwind.ncs differ diff --git a/nwnds_module/ps_cntrlwind.nss b/nwnds_module/ps_cntrlwind.nss new file mode 100644 index 000000000..04e8f402a --- /dev/null +++ b/nwnds_module/ps_cntrlwind.nss @@ -0,0 +1,69 @@ +/************************************ +* Control Wind * +* * +* Cost: 26 * +* Power Score: Con -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=26; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-4; + effect eVis=EffectVisualEffect(VFX_FNF_LOS_NORMAL_20); + effect eLink=EffectKnockdown(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_IMP_PULSE_WIND)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CONTROL_WIND); + object oTarget=GetSpellTargetObject(); + location lLoc; + if(GetIsObjectValid(oTarget)) lLoc=GetLocation(oTarget); + else lLoc=GetSpellTargetLocation(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + float fDelay; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CONTROL_WIND)) return; + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lLoc); + + + oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_AREA_OF_EFFECT); + + while (GetIsObjectValid(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_CONTROL_WIND, TRUE)); + fDelay = GetDistanceBetweenLocations(lLoc, GetLocation(oTarget))/20; + + if (GetObjectType(oTarget) == OBJECT_TYPE_AREA_OF_EFFECT) + { + DestroyObject(oTarget); + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(3))); + if (!GetIsImmune(oTarget, IMMUNITY_TYPE_KNOCKDOWN)) + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneParalyze(), oTarget, RoundsToSeconds(3))); + } + + } + + else if ((GetObjectType(oTarget)==OBJECT_TYPE_DOOR) || (GetObjectType(oTarget)==OBJECT_TYPE_PLACEABLE)) + { + if (GetLocked(oTarget) == FALSE) + { + if (GetIsOpen(oTarget) == FALSE) AssignCommand(oTarget, ActionOpenDoor(oTarget)); + else AssignCommand(oTarget, ActionCloseDoor(oTarget)); + } + + } + oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE |OBJECT_TYPE_AREA_OF_EFFECT); + } + +} diff --git a/nwnds_module/ps_compheal.ncs b/nwnds_module/ps_compheal.ncs new file mode 100644 index 000000000..272a86f17 Binary files /dev/null and b/nwnds_module/ps_compheal.ncs differ diff --git a/nwnds_module/ps_compheal.nss b/nwnds_module/ps_compheal.nss new file mode 100644 index 000000000..655436b6f --- /dev/null +++ b/nwnds_module/ps_compheal.nss @@ -0,0 +1,71 @@ +/************************************ +* Complete Healing * +* * +* Cost: 30 * +* Power Score: Con * +* * +*************************************/ + +#include "lib_psionic" + +void RemoveIllEffects(object oPC) +{ + effect eEff = GetFirstEffect(oPC); + + + while(GetIsEffectValid(eEff)) + { + int nEffType=GetEffectType(eEff); + + if (nEffType == EFFECT_TYPE_ABILITY_DECREASE || + nEffType == EFFECT_TYPE_AC_DECREASE || + nEffType == EFFECT_TYPE_ATTACK_DECREASE || + nEffType == EFFECT_TYPE_DAMAGE_DECREASE || + nEffType == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE || + nEffType == EFFECT_TYPE_SAVING_THROW_DECREASE || + nEffType == EFFECT_TYPE_SKILL_DECREASE || + nEffType == EFFECT_TYPE_BLINDNESS || + nEffType == EFFECT_TYPE_DEAF || + nEffType == EFFECT_TYPE_DISEASE || + nEffType == EFFECT_TYPE_POISON || + nEffType == EFFECT_TYPE_PARALYZE || + nEffType == EFFECT_TYPE_CHARMED || + nEffType == EFFECT_TYPE_DOMINATED || + nEffType == EFFECT_TYPE_DAZED || + nEffType == EFFECT_TYPE_CONFUSED || + nEffType == EFFECT_TYPE_FRIGHTENED || + nEffType == EFFECT_TYPE_SLOW || + nEffType == EFFECT_TYPE_STUNNED) + { + RemoveEffect(oPC, eEff); + } + + eEff=GetNextEffect(oPC); + } +} + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=30; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION); + effect eVis=EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION); + effect eLink=EffectHeal(GetMaxHitPoints(oPC)-GetCurrentHitPoints(oPC)); + eLink=EffectLinkEffects(eLink, eVis); + + if (GetIsInCombat(oPC)) + { + SendMessageToPC(oPC, "You cannot use this power while fighting"); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_COMPLETE_HEALING)) return; + + AssignCommand(oPC, ClearAllActions()); + DelayCommand(0.6, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 9.4))); + DelayCommand(0.7, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneParalyze(), oPC, 9.4)); + DelayCommand(10.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oPC)); + DelayCommand(10.0, RemoveIllEffects(oPC)); + +} diff --git a/nwnds_module/ps_contact.ncs b/nwnds_module/ps_contact.ncs new file mode 100644 index 000000000..5bfc799a6 Binary files /dev/null and b/nwnds_module/ps_contact.ncs differ diff --git a/nwnds_module/ps_contact.nss b/nwnds_module/ps_contact.nss new file mode 100644 index 000000000..0821b591a --- /dev/null +++ b/nwnds_module/ps_contact.nss @@ -0,0 +1,45 @@ +/************************************ +* Contact * +* * +* Cost: 3 * +* Power Score: Wis * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=3; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM); + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CONTACT); + object oTarget=GetSpellTargetObject(); + int nDC=16+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CONTACT)) return; + + effect eLink=EffectSavingThrowDecrease(SAVING_THROW_WILL, GetEnhancedEffect(nLevel/2, FEAT_PSIONIC_CONTACT), SAVING_THROW_TYPE_MIND_SPELLS); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(4+nLevel*2); + + if( GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS) || + (GetLevelByClass(60, oTarget)>=1 && WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC))) + { + return; + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_convocation.ncs b/nwnds_module/ps_convocation.ncs new file mode 100644 index 000000000..31729d350 Binary files /dev/null and b/nwnds_module/ps_convocation.ncs differ diff --git a/nwnds_module/ps_convocation.nss b/nwnds_module/ps_convocation.nss new file mode 100644 index 000000000..53a3ea574 --- /dev/null +++ b/nwnds_module/ps_convocation.nss @@ -0,0 +1,42 @@ +/************************************ +* Convocation * +* * +* Cost: 10 * +* Power Score: Wis -2 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=10; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + object oTarget=GetSpellTargetObject(); + location lDest=GetLocation(oPC); + effect eVis=EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + vector vOrigin=GetPositionFromLocation(GetLocation(oTarget)); + vector vDest=GetPositionFromLocation(lDest); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CONVOCATION); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM); + int bIsHostile=GetIsEnemy(oPC, oTarget); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CONVOCATION)) return; + + vOrigin=Vector(vOrigin.x+2.0, vOrigin.y-0.2, vOrigin.z); + vDest=Vector(vDest.x+2.0, vDest.y-0.2, vDest.z); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PSIONIC_CONVOCATION, bIsHostile)); + + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, Location(GetArea(oPC), vOrigin, 0.0), 0.8); + DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, Location(GetArea(oPC), vDest, 0.0), 0.7)); + + if(GetFactionEqual(oTarget, oPC) + || !ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + DelayCommand(0.8, AssignCommand(oTarget, JumpToLocation(lDest))); + } + +} diff --git a/nwnds_module/ps_cosmicaware.ncs b/nwnds_module/ps_cosmicaware.ncs new file mode 100644 index 000000000..edcb37dfa Binary files /dev/null and b/nwnds_module/ps_cosmicaware.ncs differ diff --git a/nwnds_module/ps_cosmicaware.nss b/nwnds_module/ps_cosmicaware.nss new file mode 100644 index 000000000..91e78db9b --- /dev/null +++ b/nwnds_module/ps_cosmicaware.nss @@ -0,0 +1,53 @@ +/************************************ +* Cosmic Awareness * +* * +* Cost: 20 * +* Power Score: Wis -6 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=20; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-6; + effect eVis=EffectVisualEffect(VFX_DUR_PROT_PREMONITION); + eVis=EffectLinkEffects(EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20), eVis); + eVis=EffectLinkEffects(EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT), eVis); + eVis=EffectLinkEffects(EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), eVis); + effect eLink=EffectTrueSeeing(); + eLink=EffectLinkEffects(eLink, eVis); + eLink=EffectLinkEffects(EffectImmunity(IMMUNITY_TYPE_TRAP), eLink); + eLink=EffectLinkEffects(EffectImmunity(IMMUNITY_TYPE_SNEAK_ATTACK), eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_COSMIC_AWARENESS); + object oHide=GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_COSMIC_AWARENESS)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + if(GetIsObjectValid(oHide) && GetResRef(oHide)!="" ) + { + AddItemProperty(DURATION_TYPE_TEMPORARY, + ItemPropertySpellImmunitySchool(SPELL_SCHOOL_ILLUSION), oHide, TurnsToSeconds(nDuration)); + } + + else + { + oHide=CreateItemOnObject("ps_cosaware_it", oPC); + DelayCommand(0.2, AssignCommand(oPC, ClearAllActions())); + DelayCommand(0.2, AssignCommand(oPC, ActionEquipItem(oHide, INVENTORY_SLOT_CARMOUR))); + DelayCommand(0.2, AddItemProperty(DURATION_TYPE_TEMPORARY, + ItemPropertySpellImmunitySchool(SPELL_SCHOOL_ILLUSION), oHide, TurnsToSeconds(nDuration))); + DestroyObject(oHide, TurnsToSeconds(nDuration)); + } + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_COSMIC_AWARENESS, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_crisislife.ncs b/nwnds_module/ps_crisislife.ncs new file mode 100644 index 000000000..e8d74787e Binary files /dev/null and b/nwnds_module/ps_crisislife.ncs differ diff --git a/nwnds_module/ps_crisislife.nss b/nwnds_module/ps_crisislife.nss new file mode 100644 index 000000000..d1bcacbea --- /dev/null +++ b/nwnds_module/ps_crisislife.nss @@ -0,0 +1,68 @@ +/************************************ +* Crisis Of Life * +* * +* Cost: 36 * +* Power Score: Con -5 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=36; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-5; + effect eVis1=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eVis2=EffectVisualEffect(VFX_IMP_RAISE_DEAD); + object oTarget=GetSpellTargetObject(); + int nTargRace=GetRacialType(oTarget); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CRISIS_OF_LIFE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD + || nTargRace==RACIAL_TYPE_ELEMENTAL || nTargRace==RACIAL_TYPE_OOZE) + { + FloatingTextStringOnCreature("This power only affects creatures with hearts", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CRISIS_OF_LIFE)) return; + + if(GetIsDead(oTarget) && GetIsPC(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_CRISIS_OF_LIFE, FALSE)); + + if(d100()<=70) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oTarget); + DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectDazed(), oTarget, 10.0)); + } + + else + { + FloatingTextStringOnCreature("You were unable to shock the patient's heart into starting.", oPC, FALSE); + } + } + + + else if(TouchAttackMelee(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_CRISIS_OF_LIFE)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oTarget); + + if(!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_DEATH, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget); + } + + else + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectStunned(), oTarget, 6.0); + } + } + + +} diff --git a/nwnds_module/ps_ctrlt_dark.ncs b/nwnds_module/ps_ctrlt_dark.ncs new file mode 100644 index 000000000..355813597 Binary files /dev/null and b/nwnds_module/ps_ctrlt_dark.ncs differ diff --git a/nwnds_module/ps_ctrlt_dark.nss b/nwnds_module/ps_ctrlt_dark.nss new file mode 100644 index 000000000..ab5694f1a --- /dev/null +++ b/nwnds_module/ps_ctrlt_dark.nss @@ -0,0 +1,32 @@ +/************************************ +* Control Light (Darken) * +* * +* Cost: 12 * +* Power Score: Int * +* * +************************************/ +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + effect eVis=EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eLink=EffectAreaOfEffect(AOE_PER_DARKNESS); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CONTROL_LIGHT); + object oTarget=GetSpellTargetObject(); + location lLoc; + if(GetIsObjectValid(oTarget)) lLoc=GetLocation(oTarget); + else lLoc=GetSpellTargetLocation(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CONTROL_LIGHT)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eLink, lLoc, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_ctrlt_light.ncs b/nwnds_module/ps_ctrlt_light.ncs new file mode 100644 index 000000000..89d4356cf Binary files /dev/null and b/nwnds_module/ps_ctrlt_light.ncs differ diff --git a/nwnds_module/ps_ctrlt_light.nss b/nwnds_module/ps_ctrlt_light.nss new file mode 100644 index 000000000..a86ec0d19 --- /dev/null +++ b/nwnds_module/ps_ctrlt_light.nss @@ -0,0 +1,31 @@ +/************************************ +* Control Light (Brighten) * +* * +* Cost: 12 * +* Power Score: Int * +* * +************************************/ +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + effect eLink=EffectVisualEffect(VFX_DUR_LIGHT_WHITE_20); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_CONTROL_LIGHT); + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_CONTROL_LIGHT)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + if(GetIsObjectValid(oTarget)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration)); + else + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eLink, GetSpellTargetLocation(), HoursToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_daydream.ncs b/nwnds_module/ps_daydream.ncs new file mode 100644 index 000000000..5607186c8 Binary files /dev/null and b/nwnds_module/ps_daydream.ncs differ diff --git a/nwnds_module/ps_daydream.nss b/nwnds_module/ps_daydream.nss new file mode 100644 index 000000000..44f0b5898 --- /dev/null +++ b/nwnds_module/ps_daydream.nss @@ -0,0 +1,38 @@ +/************************************ +* Daydream * +* * +* Cost: 9 * +* Power Score: Wis * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=9; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM); + effect eVis=EffectVisualEffect(VFX_DUR_SANCTUARY); + effect eLink=EffectConfused(); + eLink=EffectLinkEffects(eLink, eVis); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DAYDREAM); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DAYDREAM)) return; + + int nDuration=GetEnhancedDuration(4+nLevel); + + SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PSIONIC_DAYDREAM)); + + if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_CONFUSION_S), oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + + } + +} diff --git a/nwnds_module/ps_deathfld.ncs b/nwnds_module/ps_deathfld.ncs new file mode 100644 index 000000000..b387e92ef Binary files /dev/null and b/nwnds_module/ps_deathfld.ncs differ diff --git a/nwnds_module/ps_deathfld.nss b/nwnds_module/ps_deathfld.nss new file mode 100644 index 000000000..f5a91b841 --- /dev/null +++ b/nwnds_module/ps_deathfld.nss @@ -0,0 +1,35 @@ +/************************************ +* Death Field * +* * +* Cost: 40 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=40; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + effect eVis=EffectVisualEffect(VFX_IMP_DISEASE_S); + eVis=EffectLinkEffects(eVis, EffectDamage(GetCurrentHitPoints(oPC)/2, DAMAGE_TYPE_NEGATIVE)); + effect eLink=EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_AURA_DISEASE)); + eLink=EffectLinkEffects(eLink, EffectAreaOfEffect(AOE_PSIONIC_DEATH_FIELD)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DEATH_FIELD); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DEATH_FIELD)) return; + + int nDuration=GetEnhancedDuration(2+nLevel/2); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + TransferEnhancements(GetNearestObject(OBJECT_TYPE_AREA_OF_EFFECT)); + +} diff --git a/nwnds_module/ps_deathfld_ent.ncs b/nwnds_module/ps_deathfld_ent.ncs new file mode 100644 index 000000000..1d274ab64 Binary files /dev/null and b/nwnds_module/ps_deathfld_ent.ncs differ diff --git a/nwnds_module/ps_deathfld_ent.nss b/nwnds_module/ps_deathfld_ent.nss new file mode 100644 index 000000000..72d579d4d --- /dev/null +++ b/nwnds_module/ps_deathfld_ent.nss @@ -0,0 +1,73 @@ +/************************************ +* Death Field onEnter script * +* * +* Inflicts 1d6 damage per 2 levels * +* of the Psionicist. * +* * +*************************************/ + +#include "lib_psionic" + +void DeathField(object oTarget, object oPC) +{ + string sVarName=GetName(oPC)+"Field"; + int nState=GetLocalInt(oTarget, sVarName); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DEATH_FIELD); + int nDamage; + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION); + + //apply damage + if(nState==1) + { + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DEATH_FIELD, TRUE)); + nDamage=GetEnhancedEffect(d6((nLevel/2 > 10)?10:nLevel/2), FEAT_PSIONIC_DEATH_FIELD); + + if (GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nDamage), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE), oTarget); + } + + else if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY), oTarget); + } + + else + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage/2, DAMAGE_TYPE_NEGATIVE), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY), oTarget); + } + + DelayCommand(6.0, DeathField(oTarget, oPC)); + } + + else if(nState==-1) DeleteLocalInt(oTarget, sVarName); + +} + + +void main() +{ + object oPC=GetAreaOfEffectCreator(); + object oTarget=GetEnteringObject(); + string sVarName=GetName(oPC)+"Field"; + int nState=GetLocalInt(oTarget, sVarName); + + if (oTarget==oPC) return; + + //if in a neutral state, set the field to active and start the damage recurring + if(nState==0) + { + SetLocalInt(oTarget, sVarName, 1); + DeathField(oTarget, oPC); + } + + //if oTarget has gone out and back in the field before the timer has reset, + //reactivate the field but don't call another death field instance + else if(nState==-1) + SetLocalInt(oTarget, sVarName, 1); + +} diff --git a/nwnds_module/ps_deathfld_exit.ncs b/nwnds_module/ps_deathfld_exit.ncs new file mode 100644 index 000000000..7469ff195 Binary files /dev/null and b/nwnds_module/ps_deathfld_exit.ncs differ diff --git a/nwnds_module/ps_deathfld_exit.nss b/nwnds_module/ps_deathfld_exit.nss new file mode 100644 index 000000000..fb0d59b40 --- /dev/null +++ b/nwnds_module/ps_deathfld_exit.nss @@ -0,0 +1,20 @@ +/************************************ +* Death Field onExit script * +* * +* Removes recurring damage * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=GetAreaOfEffectCreator(); + object oTarget=GetExitingObject(); + string sVarName=GetName(oPC)+"Field"; + + if (oTarget==oPC) return; + + SetLocalInt(oTarget, sVarName, -1); + +} diff --git a/nwnds_module/ps_deathfld_hb.ncs b/nwnds_module/ps_deathfld_hb.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/ps_deathfld_hb.ncs differ diff --git a/nwnds_module/ps_deathfld_hb.nss b/nwnds_module/ps_deathfld_hb.nss new file mode 100644 index 000000000..b6a3f34ac --- /dev/null +++ b/nwnds_module/ps_deathfld_hb.nss @@ -0,0 +1,49 @@ +/************************************ +* Death Field Heartbeat script * +* * +* Inflicts 1d6 damage per 2 levels * +* of the Psionicist. * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + + //Deprecated. Script retained only for compatibility. + +/* + object oPC=GetAreaOfEffectCreator(); + object oTarget=GetFirstInPersistentObject(); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DEATH_FIELD); + int nDamage; + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION); + + while(GetIsObjectValid(oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DEATH_FIELD, TRUE)); + nDamage=(nLevel/2 > 10)?GetEnhancedEffect(d6(10), FEAT_PSIONIC_DEATH_FIELD):GetEnhancedEffect(d6(nLevel/2), FEAT_PSIONIC_DEATH_FIELD); + + if (oTarget!=oPC && GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nDamage), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE), oTarget); + } + + else if (oTarget!=oPC && !FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY), oTarget); + } + + else if (oTarget!=oPC) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage/2, DAMAGE_TYPE_NEGATIVE), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY), oTarget); + } + + oTarget=GetNextInPersistentObject(); + } +*/ +} diff --git a/nwnds_module/ps_detonate.ncs b/nwnds_module/ps_detonate.ncs new file mode 100644 index 000000000..08ed6a3a6 Binary files /dev/null and b/nwnds_module/ps_detonate.ncs differ diff --git a/nwnds_module/ps_detonate.nss b/nwnds_module/ps_detonate.nss new file mode 100644 index 000000000..1a2731e8b --- /dev/null +++ b/nwnds_module/ps_detonate.nss @@ -0,0 +1,71 @@ +/************************************ +* Detonate * +* * +* Cost: 18 * +* Power Score: Con -3 * +* * +************************************/ + +#include "lib_psionic" +#include "nw_i0_spells" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=18; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + effect eVis=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_DUST_EXPLOSION)); + effect eLink=EffectDeath(TRUE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DETONATE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION); + object oTarget=GetSpellTargetObject(); + location lTargLoc=GetLocation(oTarget); + int nHP=GetCurrentHitPoints(oTarget); + eLink=EffectLinkEffects(eLink, EffectDamage(nHP)); + eLink=ExtraordinaryEffect(eLink); + + + if ((GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) && !(GetRacialType(oTarget)==RACIAL_TYPE_UNDEAD || GetRacialType(oTarget)==RACIAL_TYPE_CONSTRUCT)) + { + FloatingTextStringOnCreature("Only inanimate objects and non-living creatures are affected by this ability", oPC, FALSE); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DETONATE)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DETONATE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC) && !GetPlotFlag(oTarget)) + { + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); + + oTarget=GetFirstObjectInShape(SHAPE_SPHERE, 3.0, lTargLoc, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + eVis=EffectVisualEffect(VFX_COM_BLOOD_SPARK_MEDIUM); + float fDelay; + + while (GetIsObjectValid(oTarget)) + { + if (!ReflexSave(oTarget, nDC)) + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d10(), DAMAGE_TYPE_BLUDGEONING), oTarget)); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DETONATE))); + } + + else + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d10()/2, DAMAGE_TYPE_BLUDGEONING), oTarget)); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DETONATE))); + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, 3.0, lTargLoc, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + } +} diff --git a/nwnds_module/ps_dimblade.ncs b/nwnds_module/ps_dimblade.ncs new file mode 100644 index 000000000..e3d23c778 Binary files /dev/null and b/nwnds_module/ps_dimblade.ncs differ diff --git a/nwnds_module/ps_dimblade.nss b/nwnds_module/ps_dimblade.nss new file mode 100644 index 000000000..5331e956f --- /dev/null +++ b/nwnds_module/ps_dimblade.nss @@ -0,0 +1,86 @@ +/************************************ +* Dimensional Blade * +* * +* Cost: 16 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +//returns TRUE if oItem is a slashing or piercing weapon +int GetIsSlashingOrPiercing(object oItem) +{ + int nItem = GetBaseItemType(oItem); + + if( (nItem == BASE_ITEM_BASTARDSWORD) + || (nItem == BASE_ITEM_BATTLEAXE) + || (nItem == BASE_ITEM_DOUBLEAXE) + || (nItem == BASE_ITEM_GREATAXE) + || (nItem == BASE_ITEM_GREATSWORD) + || (nItem == BASE_ITEM_HALBERD) + || (nItem == BASE_ITEM_HANDAXE) + || (nItem == BASE_ITEM_KAMA) + || (nItem == BASE_ITEM_KATANA) + || (nItem == BASE_ITEM_KUKRI) + || (nItem == BASE_ITEM_LONGSWORD) + || (nItem == BASE_ITEM_SCIMITAR) + || (nItem == BASE_ITEM_SCYTHE) + || (nItem == BASE_ITEM_SICKLE) + || (nItem == BASE_ITEM_TWOBLADEDSWORD) + || (nItem == BASE_ITEM_DWARVENWARAXE) + || (nItem == BASE_ITEM_THROWINGAXE) + || (nItem == BASE_ITEM_WHIP) + || (nItem == BASE_ITEM_ARROW) + || (nItem == BASE_ITEM_DAGGER) + || (nItem == BASE_ITEM_DART) + || (nItem == BASE_ITEM_RAPIER) + || (nItem == BASE_ITEM_SHORTSPEAR) + || (nItem == BASE_ITEM_SHORTSWORD) + || (nItem == BASE_ITEM_SHURIKEN) ) + { + return TRUE; + } + + else return FALSE; +} + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_EMPOWER); + effect eVis=EffectVisualEffect(VFX_IMP_RESTORATION_LESSER); + itemproperty ipEnhance=ItemPropertyKeen(); + object oTarget=GetSpellTargetObject(); + object oCreatureTarget=oPC; + if(GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + oCreatureTarget=oTarget; + oTarget=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + } + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_EMPOWER)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + if(GetIsObjectValid(oTarget)) + { + if(!GetIsSlashingOrPiercing(oTarget) + || GetItemHasItemProperty(oTarget, ITEM_PROPERTY_KEEN) + || !GetIsWeapon(oTarget)) + { + FloatingTextStringOnCreature("You cannot empower this item.", oPC, FALSE); + } + + else + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_EMPOWER, FALSE)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCreatureTarget); + AddItemProperty(DURATION_TYPE_TEMPORARY, ipEnhance, oTarget, HoursToSeconds(nDuration)); + } + } +} diff --git a/nwnds_module/ps_dimdoor.ncs b/nwnds_module/ps_dimdoor.ncs new file mode 100644 index 000000000..f5fc7de1b Binary files /dev/null and b/nwnds_module/ps_dimdoor.ncs differ diff --git a/nwnds_module/ps_dimdoor.nss b/nwnds_module/ps_dimdoor.nss new file mode 100644 index 000000000..a592aa0a3 --- /dev/null +++ b/nwnds_module/ps_dimdoor.nss @@ -0,0 +1,36 @@ +/************************************ +* Dimension Door * +* * +* Cost: 6 * +* Power Score: Wis -1 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=6; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-1; + object oTarget=GetSpellTargetObject(); + location lDest; + if (GetIsObjectValid(oTarget)) lDest=GetLocation(oTarget); + else lDest=GetSpellTargetLocation(); + effect eVis=EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + vector vOrigin=GetPositionFromLocation(GetLocation(oPC)); + vector vDest=GetPositionFromLocation(lDest); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DIMENSION_DOOR)) return; + + vOrigin=Vector(vOrigin.x+2.0, vOrigin.y-0.2, vOrigin.z); + vDest=Vector(vDest.x+2.0, vDest.y-0.2, vDest.z); + + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, Location(GetArea(oPC), vOrigin, 0.0), 0.8); + DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, Location(GetArea(oPC), vDest, 0.0), 0.7)); + DelayCommand(0.8, AssignCommand(oPC, JumpToLocation(lDest))); + DelayCommand(1.0, AssignCommand(oPC, ClearAllActions())); + + +} diff --git a/nwnds_module/ps_disint.ncs b/nwnds_module/ps_disint.ncs new file mode 100644 index 000000000..8831de786 Binary files /dev/null and b/nwnds_module/ps_disint.ncs differ diff --git a/nwnds_module/ps_disint.nss b/nwnds_module/ps_disint.nss new file mode 100644 index 000000000..58d6eee6b --- /dev/null +++ b/nwnds_module/ps_disint.nss @@ -0,0 +1,73 @@ +/************************************ +* Disintegrate * +* * +* Cost: 40 * +* Power Score: Con -6 * +* * +************************************/ + +#include "lib_psionic" + +void DestroyAllItems(object oTarg); + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=40; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + effect eVis=EffectVisualEffect(VFX_IMP_BREACH); + effect eLink=EffectVisualEffect(447); //VFX_BEAM_DISINTEGRATE + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DISINTEGRATE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM); + int nDamage=d6(nLevel/2); + object oTarget=GetSpellTargetObject(); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DISINTEGRATE)) return; + + location lWhere=GetLocation(oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 0.9); + DelayCommand(0.6, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lWhere)); + + DelayCommand(0.1, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DISINTEGRATE, TRUE))); + + if(!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_DEATH, oPC) && !GetPlotFlag(oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneImmobilize(), oTarget, 1.0); + DelayCommand(0.4, DestroyAllItems(oTarget)); + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(2*GetMaxHitPoints(oTarget)), oTarget)); + + if (GetIsPC(oTarget) || GetTag(oTarget)=="PsychicClone") + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oTarget)); + else DelayCommand(0.7, DestroyObject(oTarget)); + } + + else + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneImmobilize(), oTarget, 0.8); + + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + nDamage=nDamage/2; + } + + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage), oTarget)); + } +} + +void DestroyAllItems(object oTarg) +{ + if(!GetHasInventory(oTarg)) return; + + object oItem=GetFirstItemInInventory(oTarg); + + while(GetIsObjectValid(oItem)) + { + DestroyObject(oItem, 0.3); + oItem=GetNextItemInInventory(oTarg); + } + + TakeGoldFromCreature(GetGold(oTarg), oTarg, TRUE); +} + + diff --git a/nwnds_module/ps_displace.ncs b/nwnds_module/ps_displace.ncs new file mode 100644 index 000000000..9be69e72e Binary files /dev/null and b/nwnds_module/ps_displace.ncs differ diff --git a/nwnds_module/ps_displace.nss b/nwnds_module/ps_displace.nss new file mode 100644 index 000000000..e885a70d7 --- /dev/null +++ b/nwnds_module/ps_displace.nss @@ -0,0 +1,32 @@ +/************************************ +* Displacement * +* * +* Cost: 12 * +* Power Score: Con -3 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + effect eVis=EffectVisualEffect(448); //VFX_DUR_PROT_ACIDSHIELD + effect eLink=EffectConcealment(50); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DISPLACEMENT); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DISPLACEMENT)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_DISPLACEMENT, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_dngrsense.ncs b/nwnds_module/ps_dngrsense.ncs new file mode 100644 index 000000000..a16c9e28f Binary files /dev/null and b/nwnds_module/ps_dngrsense.ncs differ diff --git a/nwnds_module/ps_dngrsense.nss b/nwnds_module/ps_dngrsense.nss new file mode 100644 index 000000000..d2ba42c80 --- /dev/null +++ b/nwnds_module/ps_dngrsense.nss @@ -0,0 +1,32 @@ +/************************************ +* Danger Sense * +* * +* Cost: 7 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=7; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_IMP_SUPER_HEROISM); + effect eLink=EffectImmunity(IMMUNITY_TYPE_SNEAK_ATTACK); + eLink=EffectLinkEffects(EffectImmunity(IMMUNITY_TYPE_TRAP), eLink); + eLink=EffectLinkEffects(EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DANGER_SENSE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DANGER_SENSE)) return; + + int nDuration=GetEnhancedDuration(4+nLevel); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + +} diff --git a/nwnds_module/ps_dominate.ncs b/nwnds_module/ps_dominate.ncs new file mode 100644 index 000000000..451fb2625 Binary files /dev/null and b/nwnds_module/ps_dominate.ncs differ diff --git a/nwnds_module/ps_dominate.nss b/nwnds_module/ps_dominate.nss new file mode 100644 index 000000000..22e62c701 --- /dev/null +++ b/nwnds_module/ps_dominate.nss @@ -0,0 +1,43 @@ +/************************************ +* Domination * +* * +* Cost: 14 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=14; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_DOMINATE_S)); + effect eLink=EffectDominated(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_DOMINATION); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_DOMINATION)) return; + + int nDuration=GetEnhancedDuration(3+nLevel); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DOMINATION, FALSE)); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_ectoform.ncs b/nwnds_module/ps_ectoform.ncs new file mode 100644 index 000000000..78bb9df65 Binary files /dev/null and b/nwnds_module/ps_ectoform.ncs differ diff --git a/nwnds_module/ps_ectoform.nss b/nwnds_module/ps_ectoform.nss new file mode 100644 index 000000000..d1c736511 --- /dev/null +++ b/nwnds_module/ps_ectoform.nss @@ -0,0 +1,32 @@ +/************************************ +* Ectoplasmic Form * +* * +* Cost: 18 * +* Power Score: Con -4 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=18; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-4; + effect eVis=EffectVisualEffect(VFX_DUR_GHOST_SMOKE); + effect eLink=EffectCutsceneGhost(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectEthereal()); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ECTOPLASMIC_FORM); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ECTOPLASMIC_FORM)) return; + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_ECTOPLASMIC_FORM, FALSE)); + + int nDuration=GetEnhancedDuration(nLevel+5); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_egowhip.ncs b/nwnds_module/ps_egowhip.ncs new file mode 100644 index 000000000..621c329af Binary files /dev/null and b/nwnds_module/ps_egowhip.ncs differ diff --git a/nwnds_module/ps_egowhip.nss b/nwnds_module/ps_egowhip.nss new file mode 100644 index 000000000..254d1f0d6 --- /dev/null +++ b/nwnds_module/ps_egowhip.nss @@ -0,0 +1,45 @@ +/************************************ +* Ego Whip * +* * +* Cost: 4 * +* Power Score: Wis -3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=4; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_BEAM_FIRE_LASH); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_EGO_WHIP); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_EGO_WHIP)) return; + + effect eLink=EffectSavingThrowDecrease(SAVING_THROW_ALL, GetEnhancedEffect(5, FEAT_PSIONIC_EGO_WHIP)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectAttackDecrease(GetEnhancedEffect(5, FEAT_PSIONIC_EGO_WHIP))); + eLink=EffectLinkEffects(eLink, EffectSkillDecrease(SKILL_ALL_SKILLS, GetEnhancedEffect(5, FEAT_PSIONIC_EGO_WHIP))); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(1+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_EGO_WHIP, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 1.6); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_empower.ncs b/nwnds_module/ps_empower.ncs new file mode 100644 index 000000000..ca6500288 Binary files /dev/null and b/nwnds_module/ps_empower.ncs differ diff --git a/nwnds_module/ps_empower.nss b/nwnds_module/ps_empower.nss new file mode 100644 index 000000000..f5f4cecec --- /dev/null +++ b/nwnds_module/ps_empower.nss @@ -0,0 +1,54 @@ +/************************************ +* Empower * +* * +* Cost: 16 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_EMPOWER); + effect eVis=EffectVisualEffect(VFX_IMP_RESTORATION_LESSER); + int nBonus=nLevel/4; + itemproperty ipEnhance=ItemPropertyEnhancementBonus(nBonus); + object oTarget=GetSpellTargetObject(); + object oCreatureTarget=oPC; + if(GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + oCreatureTarget=oTarget; + oTarget=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + } + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_EMPOWER)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + if(GetIsObjectValid(oTarget)) + { + if(GetItemHasItemProperty(oTarget, ITEM_PROPERTY_ENHANCEMENT_BONUS) + || !GetIsWeapon(oTarget)) + { + FloatingTextStringOnCreature("You cannot empower this item.", oPC, FALSE); + } + + else + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_EMPOWER, FALSE)); + + if(GetBaseItemType(oTarget)==BASE_ITEM_GLOVES) + ipEnhance=ItemPropertyAttackBonus(nBonus); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCreatureTarget); + AddItemProperty(DURATION_TYPE_TEMPORARY, ipEnhance, oTarget, HoursToSeconds(nDuration)); + AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyVisualEffect(ITEM_VISUAL_HOLY), oTarget, HoursToSeconds(nDuration)); + + } + } +} diff --git a/nwnds_module/ps_enh_harness.ncs b/nwnds_module/ps_enh_harness.ncs new file mode 100644 index 000000000..a36ba112a Binary files /dev/null and b/nwnds_module/ps_enh_harness.ncs differ diff --git a/nwnds_module/ps_enh_harness.nss b/nwnds_module/ps_enh_harness.nss new file mode 100644 index 000000000..e067c322a --- /dev/null +++ b/nwnds_module/ps_enh_harness.nss @@ -0,0 +1,18 @@ +/************************************ +* Harness Subconscious * +* (Enhancement) * +* Multiplier: x0 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_ELECTRICITY); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetEnhancement(oPC, PSIONIC_ENH_HARNESS_SUBCONSCIOUS); +} + diff --git a/nwnds_module/ps_enh_magnify.ncs b/nwnds_module/ps_enh_magnify.ncs new file mode 100644 index 000000000..8f6cc6cfa Binary files /dev/null and b/nwnds_module/ps_enh_magnify.ncs differ diff --git a/nwnds_module/ps_enh_magnify.nss b/nwnds_module/ps_enh_magnify.nss new file mode 100644 index 000000000..947de6344 --- /dev/null +++ b/nwnds_module/ps_enh_magnify.nss @@ -0,0 +1,18 @@ +/************************************ +* Magnify * +* (Enhancement) * +* Multiplier: x3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_COLD); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetEnhancement(oPC, PSIONIC_ENH_MAGNIFY); +} + diff --git a/nwnds_module/ps_enh_medfocus.ncs b/nwnds_module/ps_enh_medfocus.ncs new file mode 100644 index 000000000..e899e59f2 Binary files /dev/null and b/nwnds_module/ps_enh_medfocus.ncs differ diff --git a/nwnds_module/ps_enh_medfocus.nss b/nwnds_module/ps_enh_medfocus.nss new file mode 100644 index 000000000..0a62bf25a --- /dev/null +++ b/nwnds_module/ps_enh_medfocus.nss @@ -0,0 +1,18 @@ +/************************************ +* Meditative Focus * +* (Enhancement) * +* Multiplier: x2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_NATURE); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetEnhancement(oPC, PSIONIC_ENH_MEDITATIVE_FOCUS); +} + diff --git a/nwnds_module/ps_enh_prolong.ncs b/nwnds_module/ps_enh_prolong.ncs new file mode 100644 index 000000000..b2f06e748 Binary files /dev/null and b/nwnds_module/ps_enh_prolong.ncs differ diff --git a/nwnds_module/ps_enh_prolong.nss b/nwnds_module/ps_enh_prolong.nss new file mode 100644 index 000000000..294555fda --- /dev/null +++ b/nwnds_module/ps_enh_prolong.nss @@ -0,0 +1,18 @@ +/************************************ +* Prolong * +* (Enhancement) * +* Multiplier: x3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_SONIC); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetEnhancement(oPC, PSIONIC_ENH_PROLONG); +} + diff --git a/nwnds_module/ps_enhstr.ncs b/nwnds_module/ps_enhstr.ncs new file mode 100644 index 000000000..7449a8751 Binary files /dev/null and b/nwnds_module/ps_enhstr.ncs differ diff --git a/nwnds_module/ps_enhstr.nss b/nwnds_module/ps_enhstr.nss new file mode 100644 index 000000000..26889e518 --- /dev/null +++ b/nwnds_module/ps_enhstr.nss @@ -0,0 +1,39 @@ +/************************************ +* Enhanced Strength * +* * +* Cost: 18-Str * +* Power Score: Wis -1 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=18-GetAbilityScore(oPC, ABILITY_STRENGTH); + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-1; + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_ODD); + effect eLink=EffectAbilityIncrease(ABILITY_STRENGTH, 18-GetAbilityScore(oPC, ABILITY_STRENGTH)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_BLUR)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ENHANCED_STRENGTH); + + if(GetAbilityScore(oPC, ABILITY_STRENGTH)>=18) + { + FloatingTextStringOnCreature("You are too strong to benefit from this power.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ENHANCED_STRENGTH)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_esp.ncs b/nwnds_module/ps_esp.ncs new file mode 100644 index 000000000..e3c7073b7 Binary files /dev/null and b/nwnds_module/ps_esp.ncs differ diff --git a/nwnds_module/ps_esp.nss b/nwnds_module/ps_esp.nss new file mode 100644 index 000000000..f8fead8fb --- /dev/null +++ b/nwnds_module/ps_esp.nss @@ -0,0 +1,31 @@ +/************************************ +* ESP * +* * +* Cost: 6 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=6; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + effect eVis=EffectVisualEffect(VFX_IMP_SILENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ESP); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ESP)) return; + + effect eLink=EffectSkillIncrease(SKILL_BLUFF, GetEnhancedEffect(10, FEAT_PSIONIC_ESP)); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_INTIMIDATE, GetEnhancedEffect(10, FEAT_PSIONIC_ESP))); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_PERSUADE, GetEnhancedEffect(10, FEAT_PSIONIC_ESP))); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(5+nLevel); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_flsharmr.ncs b/nwnds_module/ps_flsharmr.ncs new file mode 100644 index 000000000..1799d526d Binary files /dev/null and b/nwnds_module/ps_flsharmr.ncs differ diff --git a/nwnds_module/ps_flsharmr.nss b/nwnds_module/ps_flsharmr.nss new file mode 100644 index 000000000..40bf6aec0 --- /dev/null +++ b/nwnds_module/ps_flsharmr.nss @@ -0,0 +1,35 @@ +/************************************ +* Flesh Armor * +* * +* Cost: 12 * +* Power Score: Con -2 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_FLESH_ARMOR); + effect eVis=EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + int nBonus=2+nLevel/2; + if (nLevel>=10) nBonus=7; + effect eLink=EffectACIncrease(nBonus, AC_NATURAL_BONUS); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_FLESH_ARMOR)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_FLESH_ARMOR); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_FLESH_ARMOR, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_group_tp.ncs b/nwnds_module/ps_group_tp.ncs new file mode 100644 index 000000000..8798bba66 Binary files /dev/null and b/nwnds_module/ps_group_tp.ncs differ diff --git a/nwnds_module/ps_group_tp.nss b/nwnds_module/ps_group_tp.nss new file mode 100644 index 000000000..c104a2f46 --- /dev/null +++ b/nwnds_module/ps_group_tp.nss @@ -0,0 +1,43 @@ +/************************************ +* Group Teleport * +* * +* Cost: 32 * +* Power Score: Wis -5 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=32; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-5; + location lDest=GetTeleportAnchor(oPC); + effect eVis=EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_GROUP_TELEPORT); + object oGroupee=GetFirstFactionMember(oPC, FALSE); + + if(!GetIsObjectValid(GetAreaFromLocation(lDest))) + { + FloatingTextStringOnCreature("No valid teleport anchor has been set.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_GROUP_TELEPORT)) return; + + while(GetIsObjectValid(oGroupee)) + { + if(GetDistanceToObject(oGroupee)>=0.0 && GetDistanceToObject(oGroupee)<5.0) + { + DelayCommand(1.8, AssignCommand(oGroupee, JumpToLocation(lDest))); + } + + oGroupee=GetNextFactionMember(oPC, FALSE); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + DelayCommand(1.8, AssignCommand(oPC, JumpToLocation(lDest))); +} diff --git a/nwnds_module/ps_hallucinate.ncs b/nwnds_module/ps_hallucinate.ncs new file mode 100644 index 000000000..57cb03284 Binary files /dev/null and b/nwnds_module/ps_hallucinate.ncs differ diff --git a/nwnds_module/ps_hallucinate.nss b/nwnds_module/ps_hallucinate.nss new file mode 100644 index 000000000..ade7315db --- /dev/null +++ b/nwnds_module/ps_hallucinate.nss @@ -0,0 +1,45 @@ +/************************************ +* Hallucinations * +* * +* Cost: 20 * +* Power Score: Int -3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=20; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-3; + effect eVis=EffectVisualEffect(VFX_IMP_SONIC); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_DEATH)); + effect eLink=EffectDeath(); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_HALLUCINATIONS); + int nDamage = d6(3); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_HALLUCINATIONS)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_HALLUCINATIONS, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS, oPC)) return; + + else if(!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); + + else ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage), oTarget); + +} diff --git a/nwnds_module/ps_idinsin.ncs b/nwnds_module/ps_idinsin.ncs new file mode 100644 index 000000000..572d5ef10 Binary files /dev/null and b/nwnds_module/ps_idinsin.ncs differ diff --git a/nwnds_module/ps_idinsin.nss b/nwnds_module/ps_idinsin.nss new file mode 100644 index 000000000..102ea060f --- /dev/null +++ b/nwnds_module/ps_idinsin.nss @@ -0,0 +1,44 @@ +/************************************ +* Id Insinuation * +* * +* Cost: 5 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_BEAM_MIND); + effect eLink=EffectStunned(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_IMP_STUN)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ID_INSINUATION); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ID_INSINUATION)) return; + + int nDuration=GetEnhancedDuration(4); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_ID_INSINUATION, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, 1.6); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_inertbarr.ncs b/nwnds_module/ps_inertbarr.ncs new file mode 100644 index 000000000..fcdf059d1 Binary files /dev/null and b/nwnds_module/ps_inertbarr.ncs differ diff --git a/nwnds_module/ps_inertbarr.nss b/nwnds_module/ps_inertbarr.nss new file mode 100644 index 000000000..8d5b18f66 --- /dev/null +++ b/nwnds_module/ps_inertbarr.nss @@ -0,0 +1,33 @@ +/************************************ +* Inertial Barrier * +* * +* Cost: 7 * +* Power Score: Con -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=7; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + effect eVis=EffectVisualEffect(VFX_DUR_GLOBE_MINOR); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + effect eLink=EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 20); + eLink=EffectLinkEffects(eVis, eLink); + eLink=EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 20), eLink); + eLink=EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 30), eLink); + eLink=EffectLinkEffects(EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 30), eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_INERTIAL_BARRIER); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_INERTIAL_BARRIER)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_infpain.ncs b/nwnds_module/ps_infpain.ncs new file mode 100644 index 000000000..d912a8d0c Binary files /dev/null and b/nwnds_module/ps_infpain.ncs differ diff --git a/nwnds_module/ps_infpain.nss b/nwnds_module/ps_infpain.nss new file mode 100644 index 000000000..990000ebc --- /dev/null +++ b/nwnds_module/ps_infpain.nss @@ -0,0 +1,45 @@ +/************************************ +* Inflict Pain * +* * +* Cost: 8 * +* Power Score: Con -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=8; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-4; + effect eVis=EffectVisualEffect(VFX_IMP_SILENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_INFLICT_PAIN); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_INFLICT_PAIN)) return; + + effect eLink=EffectAttackDecrease(GetEnhancedEffect(4, FEAT_PSIONIC_INFLICT_PAIN)); + eLink=EffectLinkEffects(eLink, EffectDamageDecrease(GetEnhancedEffect(4, FEAT_PSIONIC_INFLICT_PAIN))); + eLink=EffectLinkEffects(eLink, EffectACDecrease(GetEnhancedEffect(4, FEAT_PSIONIC_INFLICT_PAIN))); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(2+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_INFLICT_PAIN, TRUE)); + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_FIREFORGET_SPASM, 1.7)); + } +} diff --git a/nwnds_module/ps_intfort_ent.ncs b/nwnds_module/ps_intfort_ent.ncs new file mode 100644 index 000000000..cc650346d Binary files /dev/null and b/nwnds_module/ps_intfort_ent.ncs differ diff --git a/nwnds_module/ps_intfort_ent.nss b/nwnds_module/ps_intfort_ent.nss new file mode 100644 index 000000000..0f4df4adf --- /dev/null +++ b/nwnds_module/ps_intfort_ent.nss @@ -0,0 +1,29 @@ +/************************************ +* Intellect Fortress onEnter script * +* * +* Provides +1/2-lvls save vs mind * +* spells to all friendly creatures. * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=GetAreaOfEffectCreator(); + object oTarget=GetEnteringObject(); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_INTELLECT_FORTRESS); + int nDuration=GetEnhancedDuration(nLevel); + effect eVis=EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE); + effect eLink=EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + eLink=EffectLinkEffects(eLink, EffectSavingThrowIncrease(SAVING_THROW_ALL, GetEnhancedEffect(nLevel/2, FEAT_PSIONIC_INTELLECT_FORTRESS), SAVING_THROW_TYPE_MIND_SPELLS)); + eLink=ExtraordinaryEffect(eLink); + + if (!GetIsFriend(oTarget, oPC)) return; + + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + + +} diff --git a/nwnds_module/ps_intfort_exit.ncs b/nwnds_module/ps_intfort_exit.ncs new file mode 100644 index 000000000..ec1d499e5 Binary files /dev/null and b/nwnds_module/ps_intfort_exit.ncs differ diff --git a/nwnds_module/ps_intfort_exit.nss b/nwnds_module/ps_intfort_exit.nss new file mode 100644 index 000000000..a9b21f095 --- /dev/null +++ b/nwnds_module/ps_intfort_exit.nss @@ -0,0 +1,29 @@ +/************************************ +* Intellect Fortress onExit script * +* * +* Removes Int fortress effect. * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=GetAreaOfEffectCreator(); + object oTarget=GetExitingObject(); + effect eChk=GetFirstEffect(oTarget); + + if (!GetIsFriend(oTarget, oPC)) return; + + while (GetIsEffectValid(eChk)) + { + if (GetEffectType(eChk)==EFFECT_TYPE_SAVING_THROW_INCREASE && GetEffectSubType(eChk)==SUBTYPE_EXTRAORDINARY && GetEffectCreator(eChk)==oPC) + { + RemoveEffect(oTarget, eChk); + break; + } + + eChk=GetNextEffect(oTarget); + } + +} diff --git a/nwnds_module/ps_intfrtrss.ncs b/nwnds_module/ps_intfrtrss.ncs new file mode 100644 index 000000000..32d487530 Binary files /dev/null and b/nwnds_module/ps_intfrtrss.ncs differ diff --git a/nwnds_module/ps_intfrtrss.nss b/nwnds_module/ps_intfrtrss.nss new file mode 100644 index 000000000..e6bad6a97 --- /dev/null +++ b/nwnds_module/ps_intfrtrss.nss @@ -0,0 +1,33 @@ +/************************************ +* Intellect Fortress * +* * +* Cost: 4 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=4; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_INTELLECT_FORTRESS); + effect eVis=EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_INTELLECT_FORTRESS)) return; + + effect eLink=EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE); + eLink=EffectLinkEffects(eLink, EffectSavingThrowIncrease(SAVING_THROW_ALL, GetEnhancedEffect(nLevel/2, FEAT_PSIONIC_INTELLECT_FORTRESS), SAVING_THROW_TYPE_MIND_SPELLS)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_AURA_COLD)); + eLink=EffectLinkEffects(eLink, EffectAreaOfEffect(AOE_PSIONIC_INTELLECT_FORTRESS)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + TransferEnhancements(GetNearestObject(OBJECT_TYPE_AREA_OF_EFFECT)); +} diff --git a/nwnds_module/ps_lend10.ncs b/nwnds_module/ps_lend10.ncs new file mode 100644 index 000000000..5ba3cbf02 Binary files /dev/null and b/nwnds_module/ps_lend10.ncs differ diff --git a/nwnds_module/ps_lend10.nss b/nwnds_module/ps_lend10.nss new file mode 100644 index 000000000..a36863a8b --- /dev/null +++ b/nwnds_module/ps_lend10.nss @@ -0,0 +1,32 @@ +/************************************ +* Lend Health 10% * +* * +* Cost: 5 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + int nHP=GetCurrentHitPoints(oPC)/10; + effect eLink1=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + eLink1=EffectLinkEffects(eLink1, EffectDamage(nHP)); + effect eLink2=EffectVisualEffect(VFX_IMP_HEALING_L); + eLink2=EffectLinkEffects(eLink2, EffectHeal(nHP)); + object oTarget=GetSpellTargetObject(); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_LEND_HEALTH)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_LEND_HEALTH, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oTarget); + + +} diff --git a/nwnds_module/ps_lend25.ncs b/nwnds_module/ps_lend25.ncs new file mode 100644 index 000000000..96af0e82e Binary files /dev/null and b/nwnds_module/ps_lend25.ncs differ diff --git a/nwnds_module/ps_lend25.nss b/nwnds_module/ps_lend25.nss new file mode 100644 index 000000000..28770d386 --- /dev/null +++ b/nwnds_module/ps_lend25.nss @@ -0,0 +1,32 @@ +/************************************ +* Lend Health 25% * +* * +* Cost: 5 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + int nHP=GetCurrentHitPoints(oPC)/4; + effect eLink1=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + eLink1=EffectLinkEffects(eLink1, EffectDamage(nHP)); + effect eLink2=EffectVisualEffect(VFX_IMP_HEALING_L); + eLink2=EffectLinkEffects(eLink2, EffectHeal(nHP)); + object oTarget=GetSpellTargetObject(); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_LEND_HEALTH)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_LEND_HEALTH, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oTarget); + + +} diff --git a/nwnds_module/ps_lend50.ncs b/nwnds_module/ps_lend50.ncs new file mode 100644 index 000000000..26d01c756 Binary files /dev/null and b/nwnds_module/ps_lend50.ncs differ diff --git a/nwnds_module/ps_lend50.nss b/nwnds_module/ps_lend50.nss new file mode 100644 index 000000000..b4e2b60af --- /dev/null +++ b/nwnds_module/ps_lend50.nss @@ -0,0 +1,31 @@ +/************************************ +* Lend Health 50% * +* * +* Cost: 5 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + int nHP=GetCurrentHitPoints(oPC)/2; + effect eLink1=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + eLink1=EffectLinkEffects(eLink1, EffectDamage(nHP)); + effect eLink2=EffectVisualEffect(VFX_IMP_HEALING_L); + eLink2=EffectLinkEffects(eLink2, EffectHeal(nHP)); + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_LEND_HEALTH)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_LEND_HEALTH, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oTarget); + + +} diff --git a/nwnds_module/ps_lend80.ncs b/nwnds_module/ps_lend80.ncs new file mode 100644 index 000000000..e7d45bbba Binary files /dev/null and b/nwnds_module/ps_lend80.ncs differ diff --git a/nwnds_module/ps_lend80.nss b/nwnds_module/ps_lend80.nss new file mode 100644 index 000000000..45935812f --- /dev/null +++ b/nwnds_module/ps_lend80.nss @@ -0,0 +1,32 @@ +/************************************ +* Lend Health 80% * +* * +* Cost: 5 * +* Power Score: Con -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-1; + int nHP=GetCurrentHitPoints(oPC)*4/5; + effect eLink1=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + eLink1=EffectLinkEffects(eLink1, EffectDamage(nHP)); + effect eLink2=EffectVisualEffect(VFX_IMP_HEALING_L); + eLink2=EffectLinkEffects(eLink2, EffectHeal(nHP)); + object oTarget=GetSpellTargetObject(); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_LEND_HEALTH)) return; + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_LEND_HEALTH, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oTarget); + + +} diff --git a/nwnds_module/ps_lifedrn.ncs b/nwnds_module/ps_lifedrn.ncs new file mode 100644 index 000000000..0dda5cd76 Binary files /dev/null and b/nwnds_module/ps_lifedrn.ncs differ diff --git a/nwnds_module/ps_lifedrn.nss b/nwnds_module/ps_lifedrn.nss new file mode 100644 index 000000000..41e384194 --- /dev/null +++ b/nwnds_module/ps_lifedrn.nss @@ -0,0 +1,46 @@ +/************************************ +* Life Draining * +* * +* Cost: 9 * +* Power Score: Con -3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=11; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-3; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_LIFE_DRAINING); + effect eVis1=EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + effect eVis2=EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION, oPC); + int nTargRace=GetRacialType(oTarget); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_LIFE_DRAINING)) return; + + int nDamage = GetEnhancedEffect(d6()+nLevel, FEAT_PSIONIC_LIFE_DRAINING); + effect eLink1=EffectHeal(nDamage); + eLink1=EffectLinkEffects(eLink1, eVis1); + effect eLink2=EffectDamage(nDamage); + eLink2=EffectLinkEffects(eLink2, eVis2); + + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_LIFE_DRAINING, TRUE)); + + if (nTargRace==RACIAL_TYPE_UNDEAD) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oPC); + } + + else if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink2, oTarget); + } + +} diff --git a/nwnds_module/ps_masscontact.ncs b/nwnds_module/ps_masscontact.ncs new file mode 100644 index 000000000..2c1821a8e Binary files /dev/null and b/nwnds_module/ps_masscontact.ncs differ diff --git a/nwnds_module/ps_masscontact.nss b/nwnds_module/ps_masscontact.nss new file mode 100644 index 000000000..80e1aad15 --- /dev/null +++ b/nwnds_module/ps_masscontact.nss @@ -0,0 +1,58 @@ +/************************************ +* Mass Contact * +* * +* Cost: 12 * +* Power Score: Wis -1 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=12; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-1; + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MASS_CONTACT); + object oTarget=GetSpellTargetObject(); + location lLoc=(GetIsObjectValid(oTarget))? + GetLocation(oTarget) : GetSpellTargetLocation(); + int nDC=16+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MASS_CONTACT)) return; + + effect eLink=EffectSavingThrowDecrease(SAVING_THROW_WILL, GetEnhancedEffect(nLevel/2, FEAT_PSIONIC_MASS_CONTACT), SAVING_THROW_TYPE_MIND_SPELLS); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(4+nLevel*2); + + + oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, + OBJECT_TYPE_CREATURE); + + while (GetIsObjectValid(oTarget)) + { + nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD + || GetIsImmune(oTarget, IMMUNITY_TYPE_MIND_SPELLS) + || (GetEffectivePsionicLevel(oTarget)>=1 + && WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC))) + + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + + else if(!GetFactionEqual(oPC, oTarget)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } + + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, + OBJECT_TYPE_CREATURE); + } + + +} diff --git a/nwnds_module/ps_massdom.ncs b/nwnds_module/ps_massdom.ncs new file mode 100644 index 000000000..1c1975932 Binary files /dev/null and b/nwnds_module/ps_massdom.ncs differ diff --git a/nwnds_module/ps_massdom.nss b/nwnds_module/ps_massdom.nss new file mode 100644 index 000000000..d404f60c0 --- /dev/null +++ b/nwnds_module/ps_massdom.nss @@ -0,0 +1,139 @@ +/************************************ +* Mass Domination * +* * +* Cost: 36 * +* Power Score: Wis -6 * +* * +************************************/ + +#include "lib_psionic" +#include "x0_inc_henai" + +void DominationSimulation(object oSlave=OBJECT_SELF); +int GetDominatedCount(object oPC=OBJECT_SELF); + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=36; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-6; + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DOMINATED); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_DOMINATE_S)); + effect eLink=EffectCurse(0,0,0,1,0,0); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MASS_DOMINATION); + object oTarget=GetSpellTargetObject(); + location lTargLoc=GetLocation(oTarget); + if (!GetIsObjectValid(oTarget)) + lTargLoc=GetSpellTargetLocation(); + oTarget=GetFirstObjectInShape(SHAPE_SPHERE, 4.0, lTargLoc, TRUE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + int nDominatedTot=GetDominatedCount(oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MASS_DOMINATION)) return; + + int nDuration=GetEnhancedDuration(3+nLevel); + + SetMaxHenchmen(GetMaxHenchmen()+(3-nDominatedTot)); + DelayCommand(RoundsToSeconds(nDuration)+0.3, SetMaxHenchmen(GetMaxHenchmen()-(3-nDominatedTot))); + + while (GetIsObjectValid(oTarget) && nDominatedTot<3) + { + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_DOMINATION, TRUE)); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC) && !(nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + && !(GetFactionEqual(oTarget, oPC))) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + nDominatedTot++; + + AddHenchman(oPC, oTarget); + DelayCommand(0.1, AssignCommand(oTarget, ClearAllActions())); + DelayCommand(1.0, DominationSimulation(oTarget)); + DelayCommand(RoundsToSeconds(nDuration), RemoveHenchman(oPC, oTarget)); + DelayCommand(RoundsToSeconds(nDuration)+0.5, SetIsTemporaryEnemy(oPC, oTarget)); + + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, 4.0, lTargLoc, TRUE); + } +} + + +void DominationSimulation(object oSlave=OBJECT_SELF) +{ + object oMaster=GetMaster(oSlave); + if (!GetIsPC(oMaster)) oMaster=GetMaster(oMaster); + + if (!GetIsObjectValid(oMaster)) + { + AssignCommand(oSlave, ClearAllActions()); + DelayCommand(0.2, AssignCommand(oSlave, DetermineCombatRound())); + return; + } + object oMasterFighting=GetLastHostileActor(oMaster); + + int bMasterFighting=GetIsInCombat(oMaster); + int bSlaveFighting=GetIsInCombat(oSlave); + + if (!bSlaveFighting) + { + + if (GetAttackTarget(oMasterFighting)==oMaster) + { + AssignCommand(oSlave, ClearAllActions()); + DelayCommand(0.2, AssignCommand(oSlave, ActionAttack(oMasterFighting))); + DelayCommand(0.3, AssignCommand(oSlave, HenchmenCombatRound(oMasterFighting))); + } + + else + { + AssignCommand(oSlave, ClearAllActions()); + DelayCommand(0.2, AssignCommand(oSlave, ActionForceFollowObject(oMaster, 1.8))); + } + } + + else if (GetDistanceBetween(oSlave, GetAttackTarget(oSlave)) >= 20.0) + { + ClearAllActions(); + } + + DelayCommand(3.0, DominationSimulation(oSlave)); + +} + +int GetDominatedCount(object oPC=OBJECT_SELF) +{ + object oGroupee=GetFirstFactionMember(oPC, FALSE); + effect eEff; + int nDomCount=0; + + while(GetIsObjectValid(oGroupee)) + { + eEff=GetFirstEffect(oGroupee); + + while(GetIsEffectValid(eEff)) + { + if(GetEffectCreator(eEff)==oPC + && GetEffectSpellId(eEff)==SPELL_PSIONIC_MASS_DOMINATION + && GetEffectType(eEff)==EFFECT_TYPE_CURSE ) + { + nDomCount++; + break; + } + + eEff=GetNextEffect(oGroupee); + } + + oGroupee=GetNextFactionMember(oPC, FALSE); + } + + return nDomCount; +} + + diff --git a/nwnds_module/ps_megakinesis.ncs b/nwnds_module/ps_megakinesis.ncs new file mode 100644 index 000000000..861a3141e Binary files /dev/null and b/nwnds_module/ps_megakinesis.ncs differ diff --git a/nwnds_module/ps_megakinesis.nss b/nwnds_module/ps_megakinesis.nss new file mode 100644 index 000000000..91e0626ce --- /dev/null +++ b/nwnds_module/ps_megakinesis.nss @@ -0,0 +1,108 @@ +/************************************ +* Megakinesis * +* * +* Cost: 30 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=30; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis1=EffectVisualEffect(VFX_FNF_BLINDDEAF); + effect eVis2=EffectVisualEffect(VFX_IMP_MAGBLUE); + effect eLink=EffectCutsceneImmobilize(); + eLink=EffectLinkEffects(EffectVisualEffect(VFX_DUR_PARALYZE_HOLD), eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MEGAKINESIS); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM); + object oTarget=GetSpellTargetObject(); + location lLoc=(GetIsObjectValid(oTarget))? + GetLocation(oTarget) : GetSpellTargetLocation(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MEGAKINESIS)) return; + + int nDuration=GetEnhancedDuration(4+nLevel/2); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis1, lLoc); + + oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, + OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE + | OBJECT_TYPE_ITEM); + + while (GetIsObjectValid(oTarget)) + { + if (GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + if(GetIsEnemy(oPC, oTarget)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_MEGAKINESIS)); + + if (!ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC) && !GetIsDM(oTarget)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_DOOR) + { + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, ActionCloseDoor(oTarget)); + + else if (!GetLocked(oTarget)) + AssignCommand(oTarget, ActionOpenDoor(oTarget)); + + else if (!GetPlotFlag(oTarget) && GetLockUnlockDC(oTarget)<=nDC+15) + { + AssignCommand(oTarget, ActionOpenDoor(oTarget)); + AssignCommand(oTarget, ActionUnlockObject(oTarget)); + TriggerTrap(oTarget); + } + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_PLACEABLE) + { + + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_CLOSE)); + + else if (GetLocked(oTarget) && !GetPlotFlag(oTarget) + && GetLockUnlockDC(oTarget)<=nDC+15) + { + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_OPEN)); + AssignCommand(oTarget, ActionUnlockObject(oTarget)); + TriggerTrap(oTarget); + } + + else if (!GetLocked(oTarget) && GetHasInventory(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_OPEN)); + + else + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + + if(!GetIsObjectValid(GetItemPossessor(oTarget))) + { + CopyItem(oTarget, oPC, TRUE); + DestroyObject(oTarget, 0.2); + } + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, + OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE + | OBJECT_TYPE_ITEM); + + } + +} diff --git a/nwnds_module/ps_mentbarr.ncs b/nwnds_module/ps_mentbarr.ncs new file mode 100644 index 000000000..857e32ded Binary files /dev/null and b/nwnds_module/ps_mentbarr.ncs differ diff --git a/nwnds_module/ps_mentbarr.nss b/nwnds_module/ps_mentbarr.nss new file mode 100644 index 000000000..186eeaa30 --- /dev/null +++ b/nwnds_module/ps_mentbarr.nss @@ -0,0 +1,31 @@ +/************************************ +* Mental Barrier * +* * +* Cost: 3 * +* Power Score: Wis -2 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=3; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MENTAL_BARRIER); + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MENTAL_BARRIER)) return; + + effect eLink=EffectSavingThrowIncrease(SAVING_THROW_WILL, GetEnhancedEffect(nLevel, FEAT_PSIONIC_MENTAL_BARRIER)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_MENTAL_BARRIER, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_metabear.ncs b/nwnds_module/ps_metabear.ncs new file mode 100644 index 000000000..a61aa12de Binary files /dev/null and b/nwnds_module/ps_metabear.ncs differ diff --git a/nwnds_module/ps_metabear.nss b/nwnds_module/ps_metabear.nss new file mode 100644 index 000000000..d9bdcbf28 --- /dev/null +++ b/nwnds_module/ps_metabear.nss @@ -0,0 +1,33 @@ +/************************************ +* Metamorphosis (Bear) * +* * +* Cost: 25 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=25; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_METAMORPHOSIS); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_BROWN_BEAR); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_METAMORPHOSIS)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_METAMORPHOSIS, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_metahulk.ncs b/nwnds_module/ps_metahulk.ncs new file mode 100644 index 000000000..6c90e6f7a Binary files /dev/null and b/nwnds_module/ps_metahulk.ncs differ diff --git a/nwnds_module/ps_metahulk.nss b/nwnds_module/ps_metahulk.nss new file mode 100644 index 000000000..b321445eb --- /dev/null +++ b/nwnds_module/ps_metahulk.nss @@ -0,0 +1,33 @@ +/************************************ +* Metamorphosis (Umber Hulk) * +* * +* Cost: 25 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=25; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_METAMORPHOSIS); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_UMBER_HULK); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_METAMORPHOSIS)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_METAMORPHOSIS, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_metaspider.ncs b/nwnds_module/ps_metaspider.ncs new file mode 100644 index 000000000..ec6841839 Binary files /dev/null and b/nwnds_module/ps_metaspider.ncs differ diff --git a/nwnds_module/ps_metaspider.nss b/nwnds_module/ps_metaspider.nss new file mode 100644 index 000000000..18a8bbc23 --- /dev/null +++ b/nwnds_module/ps_metaspider.nss @@ -0,0 +1,34 @@ +/************************************ +* Metamorphosis (Spider) * +* * +* Cost: 25 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=25; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_METAMORPHOSIS); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_GIANT_SPIDER); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectMovementSpeedIncrease(50)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_METAMORPHOSIS)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_METAMORPHOSIS, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_metatroll.ncs b/nwnds_module/ps_metatroll.ncs new file mode 100644 index 000000000..52e82b7ab Binary files /dev/null and b/nwnds_module/ps_metatroll.ncs differ diff --git a/nwnds_module/ps_metatroll.nss b/nwnds_module/ps_metatroll.nss new file mode 100644 index 000000000..922eda871 --- /dev/null +++ b/nwnds_module/ps_metatroll.nss @@ -0,0 +1,33 @@ +/************************************ +* Metamorphosis (Troll) * +* * +* Cost: 25 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=25; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_METAMORPHOSIS); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_TROLL); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_METAMORPHOSIS)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_METAMORPHOSIS, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_mndblank.ncs b/nwnds_module/ps_mndblank.ncs new file mode 100644 index 000000000..c09441be8 Binary files /dev/null and b/nwnds_module/ps_mndblank.ncs differ diff --git a/nwnds_module/ps_mndblank.nss b/nwnds_module/ps_mndblank.nss new file mode 100644 index 000000000..304901639 --- /dev/null +++ b/nwnds_module/ps_mndblank.nss @@ -0,0 +1,32 @@ +/************************************ +* Mind Blank * +* * +* Cost: 0 * +* Power Score: Wis * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=0; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MIND_BLANK); + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_MIND); + effect eLink=EffectImmunity(IMMUNITY_TYPE_CHARM); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_DOMINATE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MIND_BLANK)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_MIND_BLANK, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_mndblast.ncs b/nwnds_module/ps_mndblast.ncs new file mode 100644 index 000000000..a220371cc Binary files /dev/null and b/nwnds_module/ps_mndblast.ncs differ diff --git a/nwnds_module/ps_mndblast.nss b/nwnds_module/ps_mndblast.nss new file mode 100644 index 000000000..7debd2f38 --- /dev/null +++ b/nwnds_module/ps_mndblast.nss @@ -0,0 +1,52 @@ +/************************************ +* Mind Blast * +* * +* Cost: 21 * +* Power Score: Wis -5 * +* * +************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=21; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-5; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MIND_BLAST); + effect eVis=EffectVisualEffect(VFX_IMP_DAZED_S); + effect eLink=EffectDazed(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + object oTarget=GetSpellTargetObject(); + location lTargLoc=GetLocation(oTarget); + if (!GetIsObjectValid(oTarget)) + lTargLoc=GetSpellTargetLocation(); + oTarget=GetFirstObjectInShape(SHAPE_SPELLCONE, 15.0, lTargLoc, TRUE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM); + int nTargRace=GetRacialType(oTarget); + float fDelay; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MIND_BLAST)) return; + + int nDuration=GetEnhancedDuration(d4(2)); + + while (GetIsObjectValid(oTarget)) + { + nTargRace=GetRacialType(oTarget); + + if ((oTarget!=oPC) && !(nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + && (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC))) + { + fDelay=GetDistanceBetween(oPC, oTarget)/20; + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration))); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_MIND_BLAST))); + } + + oTarget=GetNextObjectInShape(SHAPE_SPELLCONE, 15.0, lTargLoc, TRUE); + } + + +} diff --git a/nwnds_module/ps_mndthrust.ncs b/nwnds_module/ps_mndthrust.ncs new file mode 100644 index 000000000..b9101d9cd Binary files /dev/null and b/nwnds_module/ps_mndthrust.ncs differ diff --git a/nwnds_module/ps_mndthrust.nss b/nwnds_module/ps_mndthrust.nss new file mode 100644 index 000000000..bdc7d0c72 --- /dev/null +++ b/nwnds_module/ps_mndthrust.nss @@ -0,0 +1,44 @@ +/************************************ +* Mind Thrust * +* * +* Cost: 2 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=2; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + effect eVis=EffectVisualEffect(VFX_IMP_DAZED_S); + effect eLink=EffectSilence(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectSpellFailure()); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MIND_THRUST); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MIND_THRUST)) return; + + int nDuration=GetEnhancedDuration(1+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_MIND_THRUST, TRUE)); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } +} diff --git a/nwnds_module/ps_mndwhipe.ncs b/nwnds_module/ps_mndwhipe.ncs new file mode 100644 index 000000000..c6db6c130 Binary files /dev/null and b/nwnds_module/ps_mndwhipe.ncs differ diff --git a/nwnds_module/ps_mndwhipe.nss b/nwnds_module/ps_mndwhipe.nss new file mode 100644 index 000000000..9391e33ce --- /dev/null +++ b/nwnds_module/ps_mndwhipe.nss @@ -0,0 +1,44 @@ +/************************************ +* Mind Whipe * +* * +* Cost: 16 * +* Power Score: Int -6 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MIND_WHIPE); + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MIND_WHIPE)) return; + + effect eLink=EffectAbilityDecrease(ABILITY_INTELLIGENCE, GetEnhancedEffect(2, FEAT_PSIONIC_MIND_WHIPE)); + eLink=EffectLinkEffects(eLink, EffectAbilityDecrease(ABILITY_WISDOM, GetEnhancedEffect(2, FEAT_PSIONIC_MIND_WHIPE))); + eLink=EffectLinkEffects(eLink, EffectNegativeLevel(GetEnhancedEffect(2, FEAT_PSIONIC_MIND_WHIPE))); + eLink=ExtraordinaryEffect(eLink); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_MIND_WHIPE, TRUE)); + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget); + } + +} diff --git a/nwnds_module/ps_molecagit.ncs b/nwnds_module/ps_molecagit.ncs new file mode 100644 index 000000000..4210cb8b6 Binary files /dev/null and b/nwnds_module/ps_molecagit.ncs differ diff --git a/nwnds_module/ps_molecagit.nss b/nwnds_module/ps_molecagit.nss new file mode 100644 index 000000000..26f034063 --- /dev/null +++ b/nwnds_module/ps_molecagit.nss @@ -0,0 +1,60 @@ +/************************************ +* Molecular Agitation * +* * +* Cost: 19 * +* Power Score: Wis * +* * +************************************/ + +#include "lib_psionic" + +void MolecularAgitation(object oTarget, object oPC, int nRound, int nMult) +{ + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_MOLECULAR_AGITATION); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nDamage; + effect eVis=EffectVisualEffect(VFX_COM_HIT_FIRE); + effect eLink; + + if(nRound==1) nDamage=nMult*nLevel/2; + else if(nRound==2) nDamage=nMult*d4(nLevel/2); + else if(nRound>=3) nDamage=nMult*d6(nLevel/2); + + if (FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_FIRE, oPC)) + nDamage=nDamage/2; + + eLink=EffectDamage(nDamage/EFFECT_SCALING_FACTOR, DAMAGE_TYPE_FIRE); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); + + if (nRound<4) DelayCommand(6.0, MolecularAgitation(oTarget, oPC, nRound+1, nMult)); + else DeleteLocalInt(oTarget, "MolecAgi"); + +} + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=19; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM); + effect eVis=EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD); + object oTarget=GetSpellTargetObject(); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_MOLECULAR_AGITATION)) return; + + if (GetLocalInt(oTarget, "MolecAgi")) + { + FloatingTextStringOnCreature("This target is already under the effects of molecular agitation.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_MOLECULAR_AGITATION, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + SetLocalInt(oTarget, "MolecAgi", TRUE); + MolecularAgitation(oTarget, oPC, 1, GetEnhancedEffect(EFFECT_SCALING_FACTOR, SPELL_PSIONIC_MOLECULAR_AGITATION)); + +} diff --git a/nwnds_module/ps_objread.ncs b/nwnds_module/ps_objread.ncs new file mode 100644 index 000000000..549f8e2e9 Binary files /dev/null and b/nwnds_module/ps_objread.ncs differ diff --git a/nwnds_module/ps_objread.nss b/nwnds_module/ps_objread.nss new file mode 100644 index 000000000..67a21079f --- /dev/null +++ b/nwnds_module/ps_objread.nss @@ -0,0 +1,30 @@ +/************************************ +* Object Reading * +* * +* Cost: 8 * +* Power Score: Int -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=8; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-2; + effect eVis=EffectVisualEffect(VFX_IMP_MAGICAL_VISION); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_OBJECT_READING); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_OBJECT_READING)) return; + + effect eLink=EffectSkillIncrease(SKILL_APPRAISE, GetEnhancedEffect(10, FEAT_PSIONIC_OBJECT_READING)); + eLink=EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_LORE, GetEnhancedEffect(10, FEAT_PSIONIC_OBJECT_READING))); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(5+nLevel); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_photosynth.ncs b/nwnds_module/ps_photosynth.ncs new file mode 100644 index 000000000..8d8d88de2 Binary files /dev/null and b/nwnds_module/ps_photosynth.ncs differ diff --git a/nwnds_module/ps_photosynth.nss b/nwnds_module/ps_photosynth.nss new file mode 100644 index 000000000..4005d0143 --- /dev/null +++ b/nwnds_module/ps_photosynth.nss @@ -0,0 +1,51 @@ +/************************************ +* Photosynthesis * +* * +* Cost: 11 * +* Power Score: Con * +* * +*************************************/ + +#include "lib_psionic" + +void Photosynthesis(object oPC, int nDuration, int nMult, int nTimeStamp, int nRound=1) +{ + int nHP=nMult*3; + + if(nTimeStamp!=GetLocalInt(oPC, "PhotoTime")) return; + + if(GetWeather(GetArea(oPC))==WEATHER_RAIN || GetWeather(GetArea(oPC))==WEATHER_SNOW) + nHP=nMult*1; + + if(!GetIsAreaInterior(GetArea(oPC)) + && GetIsAreaAboveGround(GetArea(oPC))==AREA_ABOVEGROUND + && GetIsDay()) + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHP/EFFECT_SCALING_FACTOR), oPC); + + if(nRound<=nDuration) + DelayCommand(3.0, Photosynthesis(oPC, nDuration, nMult, nTimeStamp, nRound+1)); + else + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), oPC, 1.0); +} + + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=11; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION); + effect eVis=EffectVisualEffect(VFX_IMP_HOLY_AID); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PHOTOSYNTHESIS); + int nTimeStamp=GetRealTime(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PHOTOSYNTHESIS)) return; + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_PHOTOSYNTHESIS, FALSE)); + + //added to prevent multiple instances from stacking + SetLocalInt(oPC, "PhotoTime", nTimeStamp); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + Photosynthesis(oPC, GetEnhancedDuration(nLevel*2), GetEnhancedEffect(EFFECT_SCALING_FACTOR, FEAT_PSIONIC_PHOTOSYNTHESIS), nTimeStamp); +} diff --git a/nwnds_module/ps_plnrg_fire.ncs b/nwnds_module/ps_plnrg_fire.ncs new file mode 100644 index 000000000..1530a7ac0 Binary files /dev/null and b/nwnds_module/ps_plnrg_fire.ncs differ diff --git a/nwnds_module/ps_plnrg_fire.nss b/nwnds_module/ps_plnrg_fire.nss new file mode 100644 index 000000000..bef6a76b3 --- /dev/null +++ b/nwnds_module/ps_plnrg_fire.nss @@ -0,0 +1,55 @@ +/************************************ +* Summon Planar Energy (Fire) * +* * +* Cost: 16 * +* Power Score: Int * +* * +************************************/ + +#include "lib_psionic" +#include "nw_i0_spells" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY); + effect eVis1=EffectVisualEffect(494); //VFX_FNF_DRAGBREATHGROUND + effect eVis2=EffectVisualEffect(VFX_COM_HIT_FIRE); + object oTarget=GetSpellTargetObject(); + location lTargLoc=GetLocation(oTarget); + if (!GetIsObjectValid(oTarget)) + lTargLoc=GetSpellTargetLocation(); + oTarget=GetFirstObjectInShape(SHAPE_SPHERE, 4.0, lTargLoc, TRUE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE); + float fDelay; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return; + + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis1, lTargLoc); + + while (GetIsObjectValid(oTarget)) + { + if (!ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_FIRE)) + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetEnhancedEffect(d8(3), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY), DAMAGE_TYPE_FIRE), oTarget)); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY))); + } + + else + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetEnhancedEffect(d8(3), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)/2, DAMAGE_TYPE_FIRE), oTarget)); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY))); + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, 4.0, lTargLoc, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + +} diff --git a/nwnds_module/ps_plnrg_neg.ncs b/nwnds_module/ps_plnrg_neg.ncs new file mode 100644 index 000000000..4d6ae42d3 Binary files /dev/null and b/nwnds_module/ps_plnrg_neg.ncs differ diff --git a/nwnds_module/ps_plnrg_neg.nss b/nwnds_module/ps_plnrg_neg.nss new file mode 100644 index 000000000..46f953dde --- /dev/null +++ b/nwnds_module/ps_plnrg_neg.nss @@ -0,0 +1,43 @@ +/************************************ +* Summon Planar Energy (Negative) * +* * +* Cost: 16 * +* Power Score: Int * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY); + effect eVis=EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE); + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return; + + effect eLink=EffectDamage(GetEnhancedEffect(d12(3), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY), DAMAGE_TYPE_NEGATIVE); + + if (GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD) + { + eLink=EffectHeal(GetEnhancedEffect(d12(3), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)); + eVis=EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget)); + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY)); + + if (!GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD && + !FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE, oPC)) + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectNegativeLevel(GetEnhancedEffect(1, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)), oTarget); + + + + +} diff --git a/nwnds_module/ps_plnrg_pos.ncs b/nwnds_module/ps_plnrg_pos.ncs new file mode 100644 index 000000000..24f8ce9b6 Binary files /dev/null and b/nwnds_module/ps_plnrg_pos.ncs differ diff --git a/nwnds_module/ps_plnrg_pos.nss b/nwnds_module/ps_plnrg_pos.nss new file mode 100644 index 000000000..e35270f77 --- /dev/null +++ b/nwnds_module/ps_plnrg_pos.nss @@ -0,0 +1,31 @@ +/************************************ +* Summon Planar Energy (Positive) * +* * +* Cost: 16 * +* Power Score: Int * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY); + effect eVis=EffectVisualEffect(VFX_COM_HIT_DIVINE); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE); + int nDamage=(GetRacialType(oTarget)==IP_CONST_RACIALTYPE_UNDEAD?2*d12(3):d12(3)); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return; + + effect eLink=EffectDamage(GetEnhancedEffect(nDamage, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY), DAMAGE_TYPE_POSITIVE); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget); + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY)); + + +} diff --git a/nwnds_module/ps_plnrg_salt.ncs b/nwnds_module/ps_plnrg_salt.ncs new file mode 100644 index 000000000..96dd56457 Binary files /dev/null and b/nwnds_module/ps_plnrg_salt.ncs differ diff --git a/nwnds_module/ps_plnrg_salt.nss b/nwnds_module/ps_plnrg_salt.nss new file mode 100644 index 000000000..a09761d4e --- /dev/null +++ b/nwnds_module/ps_plnrg_salt.nss @@ -0,0 +1,58 @@ +/************************************ +* Summon Planar Energy (Salt) * +* * +* Cost: 16 * +* Power Score: Int * +* * +************************************/ + +#include "lib_psionic" +#include "nw_i0_spells" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY); + effect eVis1=EffectVisualEffect(VFX_FNF_HORRID_WILTING); + effect eVis2=EffectVisualEffect(VFX_COM_HIT_SONIC); + object oTarget=GetSpellTargetObject(); + location lTargLoc=GetLocation(oTarget); + if (!GetIsObjectValid(oTarget)) + lTargLoc=GetSpellTargetLocation(); + oTarget=GetFirstObjectInShape(SHAPE_SPHERE, 3.0, lTargLoc, TRUE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE); + float fDelay; + int nDuration=5+nLevel; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return; + + + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis1, lTargLoc); + + while (GetIsObjectValid(oTarget)) + { + if (!ReflexSave(oTarget, nDC)) + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetEnhancedEffect(d4(4), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)), oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectAbilityDecrease(ABILITY_STRENGTH, GetEnhancedEffect(4, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)), oTarget, RoundsToSeconds(nDuration))); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY))); + } + + else + { + fDelay=GetRandomDelay(0.2, 0.8); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetEnhancedEffect(d4(4), FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)/2), oTarget)); + DelayCommand(fDelay, SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY))); + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, 3.0, lTargLoc, FALSE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE); + } + + +} diff --git a/nwnds_module/ps_plnrg_water.ncs b/nwnds_module/ps_plnrg_water.ncs new file mode 100644 index 000000000..9b657892a Binary files /dev/null and b/nwnds_module/ps_plnrg_water.ncs differ diff --git a/nwnds_module/ps_plnrg_water.nss b/nwnds_module/ps_plnrg_water.nss new file mode 100644 index 000000000..ef2eb6b43 --- /dev/null +++ b/nwnds_module/ps_plnrg_water.nss @@ -0,0 +1,52 @@ +/************************************ +* Summon Planar Energy (Water) * +* * +* Cost: 16 * +* Power Score: Int * +* * +************************************/ + +#include "lib_psionic" + + +void Drown(object oTarget, object oPC) +{ + effect eVis=EffectVisualEffect(VFX_IMP_FROST_S); + int nDamage=GetMaxHitPoints(oTarget)/4; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY); + int nDC=14+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE); + + if(nDamage<1) nDamage=1; + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + AssignCommand(oTarget, PlayAnimation(ANIMATION_FIREFORGET_SPASM)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage), oTarget); + DelayCommand(6.0, Drown(oTarget, oPC)); + } +} + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE); + object oTarget=GetSpellTargetObject(); + int nTargRace=GetRacialType(oTarget); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_ENERGY)) return; + + if ( GetObjectType(oTarget)!=OBJECT_TYPE_CREATURE + || nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD + || nTargRace==RACIAL_TYPE_ELEMENTAL || nTargRace==RACIAL_TYPE_OOZE ) + { + FloatingTextStringOnCreature("This power only affects creatures that breathe.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUMMON_PLANAR_ENERGY)); + Drown(oTarget, oPC); + +} diff --git a/nwnds_module/ps_projforce.ncs b/nwnds_module/ps_projforce.ncs new file mode 100644 index 000000000..ac8d8ff5f Binary files /dev/null and b/nwnds_module/ps_projforce.ncs differ diff --git a/nwnds_module/ps_projforce.nss b/nwnds_module/ps_projforce.nss new file mode 100644 index 000000000..d7803f7d7 --- /dev/null +++ b/nwnds_module/ps_projforce.nss @@ -0,0 +1,90 @@ +/************************************ +* Project Force * +* * +* Cost: 10 * +* Power Score: Con -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=10; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + effect eVis=EffectVisualEffect(VFX_FNF_LOS_NORMAL_10); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_FNF_SCREEN_BUMP)); + effect eLink=EffectKnockdown(); + eLink=EffectLinkEffects(eVis, eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PROJECT_FORCE); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_CONSTITUTION); + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PROJECT_FORCE)) return; + + if (GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_PROJECT_FORCE)); + + if (!ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetEnhancedEffect(d6()+1, FEAT_PSIONIC_PROJECT_FORCE), DAMAGE_TYPE_BLUDGEONING), oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(GetEnhancedEffect(3, FEAT_PSIONIC_PROJECT_FORCE))); + if (!GetIsImmune(oTarget, IMMUNITY_TYPE_KNOCKDOWN)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneParalyze(), oTarget, RoundsToSeconds(GetEnhancedEffect(3, FEAT_PSIONIC_PROJECT_FORCE))); + } + + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_DOOR) + { + nDC=20+nLevel/2+GetAbilityModifier(ABILITY_CONSTITUTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, ActionCloseDoor(oTarget)); + + else if (!GetLocked(oTarget)) + AssignCommand(oTarget, ActionOpenDoor(oTarget)); + + else if (!GetPlotFlag(oTarget) && GetLockUnlockDC(oTarget)<=nDC+5) + { + AssignCommand(oTarget, ActionOpenDoor(oTarget)); + AssignCommand(oTarget, ActionUnlockObject(oTarget)); + TriggerTrap(oTarget); + } + + else + FloatingTextStringOnCreature("*locked*", oPC, FALSE); + + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_PLACEABLE) + { + nDC=20+nLevel/2+GetAbilityModifier(ABILITY_CONSTITUTION); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_CLOSE)); + + else if (!GetPlotFlag(oTarget) && GetLocked(oTarget) + && GetLockUnlockDC(oTarget)<=nDC) + { + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_OPEN)); + AssignCommand(oTarget, ActionUnlockObject(oTarget)); + TriggerTrap(oTarget); + } + + else if (GetLocked(oTarget)) + FloatingTextStringOnCreature("*locked*", oPC, FALSE); + + else if (GetHasInventory(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_OPEN)); + + else + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + } + +} diff --git a/nwnds_module/ps_psdrn2.ncs b/nwnds_module/ps_psdrn2.ncs new file mode 100644 index 000000000..dbfa7f5cb Binary files /dev/null and b/nwnds_module/ps_psdrn2.ncs differ diff --git a/nwnds_module/ps_psdrn2.nss b/nwnds_module/ps_psdrn2.nss new file mode 100644 index 000000000..424d579b2 --- /dev/null +++ b/nwnds_module/ps_psdrn2.nss @@ -0,0 +1,26 @@ +#include "lib_psionic" + +void main() +{ + object oPC=GetLocalObject(GetModule(), "PsychicDrainer"); + object oTarget=GetLocalObject(GetModule(), "PsychicDrainee"); + int nPSP=GetPSP(oPC); + int nPSPMax=GetMaxPSP(oPC); + effect eVis1=EffectVisualEffect(VFX_IMP_HEAD_MIND); + effect eVis2=EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eLink=EffectAbilityDecrease(ABILITY_CONSTITUTION, 1); + eLink=EffectLinkEffects(eLink, EffectAbilityDecrease(ABILITY_WISDOM, 1)); + eLink=EffectLinkEffects(eLink, EffectAbilityDecrease(ABILITY_INTELLIGENCE, 1)); + eLink=ExtraordinaryEffect(eLink); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(24)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + nPSP=nPSP+30; + if (nPSP>nPSPMax) nPSP=nPSPMax; + SetPSP(oPC, nPSP); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + + DeleteLocalObject(GetModule(), "PsychicDrainer"); + DeleteLocalObject(GetModule(), "PsychicDraine"); +} diff --git a/nwnds_module/ps_psionblst.ncs b/nwnds_module/ps_psionblst.ncs new file mode 100644 index 000000000..040b6b801 Binary files /dev/null and b/nwnds_module/ps_psionblst.ncs differ diff --git a/nwnds_module/ps_psionblst.nss b/nwnds_module/ps_psionblst.nss new file mode 100644 index 000000000..0f10492a3 --- /dev/null +++ b/nwnds_module/ps_psionblst.nss @@ -0,0 +1,48 @@ +/************************************ +* Psionic Blast * +* * +* Cost: 10 * +* Power Score: Wis -5 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=10; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-5; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PSIONIC_BLAST); + object oTarget=GetSpellTargetObject(); + effect eVis=EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY); + effect eLink=EffectSlow(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_IMP_SLOW)); + eLink=ExtraordinaryEffect(eLink); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + int nDamage=GetCurrentHitPoints(oTarget)/5; + if (nDamage<1) nDamage=1; + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSIONIC_BLAST)) return; + + int nDuration=GetEnhancedDuration(1+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_PSIONIC_BLAST, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage), oTarget); + } +} diff --git a/nwnds_module/ps_psionresidu.ncs b/nwnds_module/ps_psionresidu.ncs new file mode 100644 index 000000000..43b4b244a Binary files /dev/null and b/nwnds_module/ps_psionresidu.ncs differ diff --git a/nwnds_module/ps_psionresidu.nss b/nwnds_module/ps_psionresidu.nss new file mode 100644 index 000000000..897082750 --- /dev/null +++ b/nwnds_module/ps_psionresidu.nss @@ -0,0 +1,52 @@ +/************************************ +* Psionic Residue * +* * +* Cost: 4 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + + +//time between uses in seconds +int TIME_BETWEEN_USES=30; + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=4; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_DUR_PROTECTION_EVIL_MAJOR); + eVis=EffectLinkEffects(eVis,EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS)); + int nCurrentTime=GetRealTime(); + int nLastUsed=GetLocalInt(oPC, "ResidueUsed")==0 + ? nCurrentTime-7*TIME_BETWEEN_USES + : GetLocalInt(oPC, "ResidueUsed"); + int nInterval=nCurrentTime-nLastUsed; + int nPSP; + int nPSPMax; + int nPSPGain=(nInterval/TIME_BETWEEN_USES > 7) + ? d8(7) : d8(nInterval/TIME_BETWEEN_USES); + + if (nIntervalnPSPMax) nPSP=nPSPMax; + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetLocalInt(oPC, "ResidueUsed", nCurrentTime); + SetPSP(oPC, nPSP); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + +} diff --git a/nwnds_module/ps_psionvamp.ncs b/nwnds_module/ps_psionvamp.ncs new file mode 100644 index 000000000..705d74a46 Binary files /dev/null and b/nwnds_module/ps_psionvamp.ncs differ diff --git a/nwnds_module/ps_psionvamp.nss b/nwnds_module/ps_psionvamp.nss new file mode 100644 index 000000000..c35c97239 --- /dev/null +++ b/nwnds_module/ps_psionvamp.nss @@ -0,0 +1,76 @@ +/************************************ +* Psionic Vampirism * +* * +* Cost: 0 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + PSPCheck(oPC); + int nPSP=GetPSP(oPC); + int nCost=0; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_IMP_STUN); + object oTarget=GetSpellTargetObject(); + PSPCheck(oTarget); + int nTargPSP=GetPSP(oTarget); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PSIONIC_VAMPIRISM); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSIONIC_VAMPIRISM, TRUE)) return; + + int nDamage=(nLevel>20)?d6(20):d6(nLevel); + nDamage=GetEnhancedEffect(nDamage, FEAT_PSIONIC_PSIONIC_VAMPIRISM); + + if (GetIsDead(oTarget)) + { + FloatingTextStringOnCreature("This creature is dead.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + + if (GetTag(oTarget)=="PsychicClone" || oPC==oTarget) + { + FloatingTextStringOnCreature("You cannot drain yourself.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + else if (nTargPSP==0) + { + FloatingTextStringOnCreature("This creature has no psionic ability", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + else if (nTargPSP=20) + AddItemProperty(DURATION_TYPE_TEMPORARY, + ItemPropertyOnHitProps(IP_CONST_ONHIT_STUN, nDC, + IP_CONST_ONHIT_DURATION_50_PERCENT_2_ROUNDS), oBlade, TurnsToSeconds(nDuration)); + + if(nLevel>=10) + AddItemProperty(DURATION_TYPE_TEMPORARY, + ItemPropertyMassiveCritical(IP_CONST_DAMAGEBONUS_2d6), oBlade, TurnsToSeconds(nDuration)); + + DestroyObject(oBlade, TurnsToSeconds(nDuration)); + SetLocalInt(oBlade, "BladeExpiration", nCurrentTime+FloatToInt(TurnsToSeconds(nDuration))); +} + diff --git a/nwnds_module/ps_psychblade_it.ncs b/nwnds_module/ps_psychblade_it.ncs new file mode 100644 index 000000000..e1f8a61cf Binary files /dev/null and b/nwnds_module/ps_psychblade_it.ncs differ diff --git a/nwnds_module/ps_psychblade_it.nss b/nwnds_module/ps_psychblade_it.nss new file mode 100644 index 000000000..0fbb17e47 --- /dev/null +++ b/nwnds_module/ps_psychblade_it.nss @@ -0,0 +1,27 @@ +#include "x2_inc_switches" +#include "lib_psionic" + +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + if (nEvent ==X2_ITEM_EVENT_UNEQUIP) + { + + oPC = GetPCItemLastUnequippedBy(); + oItem = GetPCItemLastUnequipped(); + + DestroyObject(oItem); + } + + else if ( nEvent ==X2_ITEM_EVENT_ONHITCAST) + { + oItem = GetSpellCastItem(); + + if(GetRealTime()>=GetLocalInt(oItem, "BladeExpiration")) + DestroyObject(oItem); + } + +} diff --git a/nwnds_module/ps_psychcln_hb.ncs b/nwnds_module/ps_psychcln_hb.ncs new file mode 100644 index 000000000..58b8e3372 Binary files /dev/null and b/nwnds_module/ps_psychcln_hb.ncs differ diff --git a/nwnds_module/ps_psychcln_hb.nss b/nwnds_module/ps_psychcln_hb.nss new file mode 100644 index 000000000..5be290eba --- /dev/null +++ b/nwnds_module/ps_psychcln_hb.nss @@ -0,0 +1,30 @@ + +void main() +{ + object oItem=GetLocalObject(OBJECT_SELF, "Weapon1"); + if(GetItemPossessor(oItem)!=OBJECT_SELF) DestroyObject(oItem); + oItem=GetLocalObject(OBJECT_SELF, "Weapon2"); + if(GetItemPossessor(oItem)!=OBJECT_SELF) DestroyObject(oItem); + + if(GetIsDead(OBJECT_SELF) || !GetIsObjectValid(GetMaster())) + { + object oItem; + int nSlot; + + for(nSlot=0; nSlot<=17; nSlot++) + { + oItem=GetItemInSlot(nSlot, OBJECT_SELF); + if (GetIsObjectValid(oItem)) DestroyObject(oItem, 0.1); + } + + AssignCommand(OBJECT_SELF, SetIsDestroyable(TRUE)); + + DestroyObject(OBJECT_SELF, 0.4); + + } + else + { + DelayCommand(3.0, ExecuteScript("ps_psychcln_hb", OBJECT_SELF)); + } + +} diff --git a/nwnds_module/ps_psychclone.ncs b/nwnds_module/ps_psychclone.ncs new file mode 100644 index 000000000..ec126f29f Binary files /dev/null and b/nwnds_module/ps_psychclone.ncs differ diff --git a/nwnds_module/ps_psychclone.nss b/nwnds_module/ps_psychclone.nss new file mode 100644 index 000000000..32cc8ef51 --- /dev/null +++ b/nwnds_module/ps_psychclone.nss @@ -0,0 +1,62 @@ +/************************************ +* Psychic Clone * +* * +* Cost: 50 * +* Power Score: Wis -8 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=50; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-8; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PSYCHIC_CLONE); + effect eVis=EffectVisualEffect(VFX_FNF_DISPEL); + object oParty=GetFirstFactionMember(oPC, FALSE); + + + while (GetIsObjectValid(oParty)) + { + if (GetTag(oParty)=="PsychicClone" && GetName(oParty)==GetName(oPC)) + { + FloatingTextStringOnCreature("You can only have one active clone of yourself.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + oParty=GetNextFactionMember(oPC, FALSE); + } + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSYCHIC_CLONE)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC)); + + object oClone = CopyObject(oPC, GetLocation(oPC), OBJECT_INVALID, "PsychicClone"); + int nGold = GetGold(oClone); + int nHP = GetMaxHitPoints(oClone); + object oItem=GetFirstItemInInventory(oClone); + + TakeGoldFromCreature(nGold, oClone, TRUE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHP), oClone); + + while(GetIsObjectValid(oItem)) + { + DestroyObject(oItem, 0.1); + oItem=GetNextItemInInventory(oClone); + } + + oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oClone); + SetLocalObject(oClone, "Weapon1", oItem); + oItem=GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oClone); + SetLocalObject(oClone, "Weapon2", oItem); + + DelayCommand(3.0, ExecuteScript("ps_psychcln_hb", oClone)); + DelayCommand(0.2, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneDominated(), oClone, TurnsToSeconds(nDuration))); + +} diff --git a/nwnds_module/ps_psychcrush.ncs b/nwnds_module/ps_psychcrush.ncs new file mode 100644 index 000000000..6b01e99cf Binary files /dev/null and b/nwnds_module/ps_psychcrush.ncs differ diff --git a/nwnds_module/ps_psychcrush.nss b/nwnds_module/ps_psychcrush.nss new file mode 100644 index 000000000..a736b5f37 --- /dev/null +++ b/nwnds_module/ps_psychcrush.nss @@ -0,0 +1,47 @@ +/************************************ +* Psychic Crush * +* * +* Cost: 7 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=7; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_IMP_DOMINATE_S); + effect eLink=EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE); + eLink=EffectLinkEffects(eLink, EffectSpellFailure(65)); + eLink=EffectLinkEffects(eLink, EffectMissChance(65)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PSYCHIC_CRUSH); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSYCHIC_CRUSH)) return; + + int nDuration=GetEnhancedDuration(1+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_PSYCHIC_CRUSH, TRUE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMissChance(65), oTarget, RoundsToSeconds(nDuration)); + + } +} diff --git a/nwnds_module/ps_psychdrain.ncs b/nwnds_module/ps_psychdrain.ncs new file mode 100644 index 000000000..36be66b8e Binary files /dev/null and b/nwnds_module/ps_psychdrain.ncs differ diff --git a/nwnds_module/ps_psychdrain.nss b/nwnds_module/ps_psychdrain.nss new file mode 100644 index 000000000..1602ef49e --- /dev/null +++ b/nwnds_module/ps_psychdrain.nss @@ -0,0 +1,74 @@ +/************************************ +* Psychic Drain * +* * +* Cost: 10 * +* Power Score: Wis -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=10; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-6; + object oTarget=GetSpellTargetObject(); + int nLastDrained=GetLocalInt(oTarget, "PsDrained")==0?GetRealTime()-60 + :GetLocalInt(oTarget, "PsDrained"); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSYCHIC_DRAIN, TRUE)) return; + + int nPSP=GetPSP(oPC); + + if (GetIsDead(oTarget)) + { + FloatingTextStringOnCreature("This creature is dead.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + } + + else if(GetIsImmune(oTarget, IMMUNITY_TYPE_ABILITY_DECREASE)) + { + FloatingTextStringOnCreature("This creature is immune to your attempts to drain them.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + } + + else if (!GetFactionEqual(oPC, oTarget)) + { + FloatingTextStringOnCreature("This ability only works on willing victims who are in your party.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + } + + else if (GetAbilityScore(oTarget, ABILITY_WISDOM)<=4 || GetAbilityScore(oTarget, ABILITY_INTELLIGENCE)<=4 + || GetAbilityScore(oTarget, ABILITY_CONSTITUTION)<=4) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oTarget, 8.0); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SLEEP), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + } + + else if (nLastDrained>GetRealTime()) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oTarget, 6.0); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oTarget); + FloatingTextStringOnCreature("You cannot drain this target any further right now.", oPC, FALSE); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + } + + + else + { + SetLocalObject(GetModule(), "PsychicDrainer", oPC); + SetLocalObject(GetModule(), "PsychicDrainee", oTarget); + + SetLocalInt(oTarget, "PsDrained", GetRealTime()+30); + + ExecuteScript("ps_psdrn2", GetModule()); + } + +} diff --git a/nwnds_module/ps_psychsurg.ncs b/nwnds_module/ps_psychsurg.ncs new file mode 100644 index 000000000..af2ca790c Binary files /dev/null and b/nwnds_module/ps_psychsurg.ncs differ diff --git a/nwnds_module/ps_psychsurg.nss b/nwnds_module/ps_psychsurg.nss new file mode 100644 index 000000000..1dd1fab51 --- /dev/null +++ b/nwnds_module/ps_psychsurg.nss @@ -0,0 +1,49 @@ +/************************************ +* Psychic Surgery * +* * +* Cost: 15 * +* Power Score: Wis -5 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + object oTarget=GetSpellTargetObject(); + int nCost=15; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-5; + effect eVis=EffectVisualEffect(VFX_IMP_SONIC); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_HEALING_M)); + effect eRem=GetFirstEffect(oTarget); + int nType; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_PSYCHIC_SURGERY); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_PSYCHIC_SURGERY)) return; + + while (GetIsEffectValid(eRem)) + { + nType=GetEffectType(eRem); + + if (nType==EFFECT_TYPE_CHARMED || nType==EFFECT_TYPE_CONFUSED + || nType==EFFECT_TYPE_DAZED || nType==EFFECT_TYPE_DOMINATED + || nType==EFFECT_TYPE_FRIGHTENED || nType==EFFECT_TYPE_SLEEP + || nType==EFFECT_TYPE_STUNNED + || ( (nType==EFFECT_TYPE_SPELL_FAILURE || nType==EFFECT_TYPE_SLOW + || nType==EFFECT_TYPE_NEGATIVELEVEL || nType==EFFECT_TYPE_SAVING_THROW_DECREASE + || nType==EFFECT_TYPE_AC_DECREASE || nType==EFFECT_TYPE_ATTACK_DECREASE + || nType==EFFECT_TYPE_SKILL_DECREASE || nType==EFFECT_TYPE_BLINDNESS + || nType==EFFECT_TYPE_DAMAGE_DECREASE || nType==EFFECT_TYPE_DEAF) + && GetEffectSubType(eRem)==SUBTYPE_EXTRAORDINARY)) + { + RemoveEffect(oTarget, eRem); + break; + } + + eRem=GetNextEffect(oTarget); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + +} diff --git a/nwnds_module/ps_receptacle.ncs b/nwnds_module/ps_receptacle.ncs new file mode 100644 index 000000000..78d5d5233 Binary files /dev/null and b/nwnds_module/ps_receptacle.ncs differ diff --git a/nwnds_module/ps_receptacle.nss b/nwnds_module/ps_receptacle.nss new file mode 100644 index 000000000..0ea741d8c --- /dev/null +++ b/nwnds_module/ps_receptacle.nss @@ -0,0 +1,53 @@ +/************************************ +* Receptacle * +* * +* Cost: (Gem Value)/100 * +* Power Score: Wis -5 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + object oTarget=GetSpellTargetObject(); + string sResRef=GetResRef(oTarget); + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-5; + effect eVis=EffectVisualEffect(VFX_IMP_SILENCE); + int nStackSize=GetItemStackSize(oTarget); + int nCost=GetGoldPieceValue(oTarget)/nStackSize/100; + + if(GetBaseItemType(oTarget)!=BASE_ITEM_GEM) + { + FloatingTextStringOnCreature("You can only store psionic strength in gems.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + else if(nCost<1) + { + FloatingTextStringOnCreature("This gem is not pure enough to store psionic strength.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_RECEPTACLE)) return; + + if (nStackSize==1) DestroyObject(oTarget); + + else + { + nStackSize--; + SetItemStackSize(oTarget, nStackSize); + } + + object oNewGem=CreateItemOnObject("ps_receptacle_it", oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + DelayCommand(0.2, SetLocalInt(oNewGem, "PSPStored", nCost)); + DelayCommand(0.2, SetLocalString(oNewGem, "OldGemType", sResRef)); + + SendMessageToPC(oPC, IntToString(nCost)+" psionic strength points stored."); + +} + diff --git a/nwnds_module/ps_receptacle_it.ncs b/nwnds_module/ps_receptacle_it.ncs new file mode 100644 index 000000000..5c116e5ee Binary files /dev/null and b/nwnds_module/ps_receptacle_it.ncs differ diff --git a/nwnds_module/ps_receptacle_it.nss b/nwnds_module/ps_receptacle_it.nss new file mode 100644 index 000000000..c5e9c720c --- /dev/null +++ b/nwnds_module/ps_receptacle_it.nss @@ -0,0 +1,36 @@ +#include "lib_psionic" +#include "x2_inc_switches" + +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oItem; + object oPC; + int nPSP; + int nPSPMax; + effect eVis=EffectVisualEffect(VFX_IMP_SILENCE); + + + if (nEvent == X2_ITEM_EVENT_ACTIVATE) + { + oItem=GetItemActivated(); + oPC=GetItemActivator(); + nPSP=GetPSP(oPC); + nPSPMax=GetMaxPSP(oPC); + int nBoost=GetLocalInt(oItem, "PSPStored"); + string sResRef=GetLocalString(oItem, "OldGemType"); + + nPSP=nPSP+nBoost; + if (nPSP>nPSPMax) nPSP=nPSPMax; + + + SetPSP(oPC, nPSP); + SendMessageToPC(oPC, "Remaining Psionic Strength Points: "+IntToString(nPSP)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + if(d20()>1) CreateItemOnObject(sResRef, oPC, 1); + else FloatingTextStringOnCreature("Your gem has shattered.", oPC, FALSE); + + DestroyObject(oItem, 0.2); + } +} diff --git a/nwnds_module/ps_regen.ncs b/nwnds_module/ps_regen.ncs new file mode 100644 index 000000000..2330448d1 Binary files /dev/null and b/nwnds_module/ps_regen.ncs differ diff --git a/nwnds_module/ps_regen.nss b/nwnds_module/ps_regen.nss new file mode 100644 index 000000000..bf1cdb17c --- /dev/null +++ b/nwnds_module/ps_regen.nss @@ -0,0 +1,29 @@ +/************************************ +* Regenerate * +* * +* Cost: 24 * +* Power Score: Con -4 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=24; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-4; + effect eVis=EffectVisualEffect(VFX_DUR_PARALYZED); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_REGENERATE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_REGENERATE)) return; + + effect eLink=EffectRegenerate(GetEnhancedEffect(2, FEAT_PSIONIC_REGENERATE), 6.0); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_REGENERATE, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} diff --git a/nwnds_module/ps_seeinvis.ncs b/nwnds_module/ps_seeinvis.ncs new file mode 100644 index 000000000..01d19032c Binary files /dev/null and b/nwnds_module/ps_seeinvis.ncs differ diff --git a/nwnds_module/ps_seeinvis.nss b/nwnds_module/ps_seeinvis.nss new file mode 100644 index 000000000..353cd0841 --- /dev/null +++ b/nwnds_module/ps_seeinvis.nss @@ -0,0 +1,30 @@ +/************************************ +* See Invisibility * +* * +* Cost: 9 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=9; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_IMP_MAGICAL_VISION); + effect eLink=EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectSeeInvisible()); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SEE_INVISIBILITY); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SEE_INVISIBILITY)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_senssupp.ncs b/nwnds_module/ps_senssupp.ncs new file mode 100644 index 000000000..778a53140 Binary files /dev/null and b/nwnds_module/ps_senssupp.ncs differ diff --git a/nwnds_module/ps_senssupp.nss b/nwnds_module/ps_senssupp.nss new file mode 100644 index 000000000..b6805fd3d --- /dev/null +++ b/nwnds_module/ps_senssupp.nss @@ -0,0 +1,43 @@ +/************************************ +* Sensory Suppression * +* * +* Cost: 8 * +* Power Score: Int -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=8; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SENSORY_SUPPRESSION); + object oTarget=GetSpellTargetObject(); + effect eVis=EffectVisualEffect(VFX_IMP_BLIND_DEAF_M); + effect eLink=EffectBlindness(); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectDeaf()); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_INTELLIGENCE, oPC); + int nTargRace=GetRacialType(oTarget); + + if (nTargRace==RACIAL_TYPE_CONSTRUCT || nTargRace==RACIAL_TYPE_UNDEAD ) + { + FloatingTextStringOnCreature("This power only affects creatures with minds", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SENSORY_SUPPRESSION)) return; + + int nDuration=GetEnhancedDuration(2+nLevel/2); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SENSORY_SUPPRESSION, TRUE)); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_stasis.ncs b/nwnds_module/ps_stasis.ncs new file mode 100644 index 000000000..129f0672a Binary files /dev/null and b/nwnds_module/ps_stasis.ncs differ diff --git a/nwnds_module/ps_stasis.nss b/nwnds_module/ps_stasis.nss new file mode 100644 index 000000000..41be15fcb --- /dev/null +++ b/nwnds_module/ps_stasis.nss @@ -0,0 +1,28 @@ +/************************************ +* Stasis Field * +* * +* Cost: 45 * +* Power Score: Int -8 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=45; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-8; + effect eVis=EffectVisualEffect(VFX_FNF_TIME_STOP); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_STASIS_FIELD); + effect eLink=EffectTimeStop(); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_STASIS_FIELD)) return; + + int nDuration=GetEnhancedDuration(1+nLevel/10); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + DelayCommand(0.75, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration))); + +} diff --git a/nwnds_module/ps_strofland.ncs b/nwnds_module/ps_strofland.ncs new file mode 100644 index 000000000..8bb07e1c2 Binary files /dev/null and b/nwnds_module/ps_strofland.ncs differ diff --git a/nwnds_module/ps_strofland.nss b/nwnds_module/ps_strofland.nss new file mode 100644 index 000000000..365f7ac0c --- /dev/null +++ b/nwnds_module/ps_strofland.nss @@ -0,0 +1,37 @@ +/************************************ +* Strength of the Land * +* * +* Cost: 18 * +* Power Score: Con -2 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=18; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-2; + effect eVis=EffectVisualEffect(VFX_IMP_AC_BONUS); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eVis=EffectLinkEffects(eVis, EffectVisualEffect(VFX_IMP_TORNADO)); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_STRENGTH_OF_LAND); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_STRENGTH_OF_LAND)) return; + + effect eLink=EffectTemporaryHitpoints(GetEnhancedEffect(25, FEAT_PSIONIC_STRENGTH_OF_LAND)); + eLink=EffectLinkEffects(eLink, EffectAttackIncrease(GetEnhancedEffect(3, FEAT_PSIONIC_STRENGTH_OF_LAND))); + eLink=EffectLinkEffects(eLink, EffectDamageIncrease(GetEnhancedEffect(3, FEAT_PSIONIC_STRENGTH_OF_LAND))); + eLink=EffectLinkEffects(eLink, EffectSpellResistanceIncrease(GetEnhancedEffect(5, FEAT_PSIONIC_STRENGTH_OF_LAND))); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_STRENGTH_OF_LAND); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_STRENGTH_OF_LAND, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_stunstrike.ncs b/nwnds_module/ps_stunstrike.ncs new file mode 100644 index 000000000..13cba5831 Binary files /dev/null and b/nwnds_module/ps_stunstrike.ncs differ diff --git a/nwnds_module/ps_stunstrike.nss b/nwnds_module/ps_stunstrike.nss new file mode 100644 index 000000000..9f8ce4199 --- /dev/null +++ b/nwnds_module/ps_stunstrike.nss @@ -0,0 +1,50 @@ +/************************************ +* Stunning Strike * +* * +* Cost: 16 * +* Power Score: Wis -2 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_EMPOWER); + effect eVis=EffectVisualEffect(VFX_IMP_RESTORATION_LESSER); + int nDC=(nLevel/4)-3<6?(nLevel/4)-3:6; //see nwscript.nss for IP_CONST_ONHIT_SAVEDC_* + itemproperty ipEnhance=ItemPropertyOnHitProps(IP_CONST_ONHIT_STUN, nDC, + IP_CONST_ONHIT_DURATION_50_PERCENT_2_ROUNDS); + + object oTarget=GetSpellTargetObject(); + object oCreatureTarget=oPC; + if(GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + oCreatureTarget=oTarget; + oTarget=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + } + + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_EMPOWER)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + if(GetIsObjectValid(oTarget)) + { + if(GetItemHasItemProperty(oTarget, ITEM_PROPERTY_ON_HIT_PROPERTIES) + || !GetIsWeapon(oTarget)) + { + FloatingTextStringOnCreature("You cannot empower this item.", oPC, FALSE); + } + + else + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_EMPOWER, FALSE)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oCreatureTarget); + AddItemProperty(DURATION_TYPE_TEMPORARY, ipEnhance, oTarget, HoursToSeconds(nDuration)); + } + } +} diff --git a/nwnds_module/ps_sumplnrcrtr.ncs b/nwnds_module/ps_sumplnrcrtr.ncs new file mode 100644 index 000000000..339cf3b79 Binary files /dev/null and b/nwnds_module/ps_sumplnrcrtr.ncs differ diff --git a/nwnds_module/ps_sumplnrcrtr.nss b/nwnds_module/ps_sumplnrcrtr.nss new file mode 100644 index 000000000..d319fccdb --- /dev/null +++ b/nwnds_module/ps_sumplnrcrtr.nss @@ -0,0 +1,71 @@ +/************************************ +* Summon Planar Creature * +* * +* Cost: 15 * +* Power Score: Int -4 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=15; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-4; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUMMON_PLANAR_CREATURE); + int nRoll=d6()+nLevel; + effect eSummon; + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUMMON_PLANAR_CREATURE)) return; + + if (nRoll<=4) + eSummon = EffectSummonCreature("NW_S_CLANTERN", VFX_FNF_SUMMON_CELESTIAL, 2.5); + else if (nRoll<=7) + eSummon = EffectSummonCreature("NW_S_IMP",VFX_FNF_SUMMON_GATE , 2.5); + else if (nRoll<=10) + eSummon = EffectSummonCreature("NW_S_SLAADRED", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==11) + eSummon = EffectSummonCreature("NW_S_SUCCUBUS",VFX_FNF_SUMMON_GATE, 2.5); + else if (nRoll==12) + eSummon = EffectSummonCreature("NW_S_CHOUND", VFX_FNF_SUMMON_CELESTIAL, 2.5); + else if (nRoll==13) + eSummon = EffectSummonCreature("NW_S_SLAADGRN",VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==14) + eSummon = EffectSummonCreature("NW_S_EARTHHUGE", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==15) + eSummon = EffectSummonCreature("NW_S_AIRHUGE", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==16) + eSummon = EffectSummonCreature("NW_S_FIREHUGE", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==17) + eSummon = EffectSummonCreature("NW_S_WATERHUGE", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==18) + eSummon = EffectSummonCreature("NW_S_VROCK", VFX_FNF_SUMMON_GATE, 2.5); + else if (nRoll==19) + eSummon = EffectSummonCreature("NW_S_CTRUMPET", VFX_FNF_SUMMON_CELESTIAL, 2.5); + else if (nRoll==20) + eSummon = EffectSummonCreature("NW_S_EARTHGREAT", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==21) + eSummon = EffectSummonCreature("NW_S_AIRGREAT", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==22) + eSummon = EffectSummonCreature("NW_S_FIREGREAT", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==23) + eSummon = EffectSummonCreature("NW_S_WATERGREAT", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==24) + eSummon = EffectSummonCreature("NW_S_SLAADDETH", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==25) + eSummon = EffectSummonCreature("NW_S_EARTHELDER", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==26) + eSummon = EffectSummonCreature("NW_S_AIRELDER", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==27) + eSummon = EffectSummonCreature("NW_S_FIREELDER", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll==28) + eSummon = EffectSummonCreature("NW_S_WATERELDER", VFX_FNF_SUMMON_MONSTER_3, 1.0); + else if (nRoll<28 && nRoll%2==1) + eSummon = EffectSummonCreature("NW_S_BALOR", VFX_FNF_SUMMON_GATE, 3.0); + else + eSummon = EffectSummonCreature("X2_S_MUMMYWARR", VFX_FNF_SUMMON_EPIC_UNDEAD, 1.0); + + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(24)); + +} diff --git a/nwnds_module/ps_suppfear.ncs b/nwnds_module/ps_suppfear.ncs new file mode 100644 index 000000000..82cc31395 Binary files /dev/null and b/nwnds_module/ps_suppfear.ncs differ diff --git a/nwnds_module/ps_suppfear.nss b/nwnds_module/ps_suppfear.nss new file mode 100644 index 000000000..498ba6c35 --- /dev/null +++ b/nwnds_module/ps_suppfear.nss @@ -0,0 +1,42 @@ +/************************************ +* Suppress Fear * +* * +* Cost: 5 * +* Power Score: Wis * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=5; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM); + effect eVis=EffectVisualEffect(VFX_IMP_HEALING_M); + object oTarget=GetSpellTargetObject(); + effect eLink=GetFirstEffect(oTarget); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_SUPPRESS_FEAR); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_SUPPRESS_FEAR)) return; + + int nDuration=GetEnhancedDuration(3+nLevel); + + while (GetIsEffectValid(eLink)) + { + if (GetEffectType(eLink)==EFFECT_TYPE_FRIGHTENED) + RemoveEffect(oTarget, eLink); + + eLink=GetNextEffect(oTarget); + } + + eLink=EffectImmunity(IMMUNITY_TYPE_FEAR); + eLink=ExtraordinaryEffect(eLink); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_SUPPRESS_FEAR, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + + +} diff --git a/nwnds_module/ps_telekinesis.ncs b/nwnds_module/ps_telekinesis.ncs new file mode 100644 index 000000000..65d025d43 Binary files /dev/null and b/nwnds_module/ps_telekinesis.ncs differ diff --git a/nwnds_module/ps_telekinesis.nss b/nwnds_module/ps_telekinesis.nss new file mode 100644 index 000000000..54c6bd2e2 --- /dev/null +++ b/nwnds_module/ps_telekinesis.nss @@ -0,0 +1,85 @@ +/************************************ +* Telekinesis * +* * +* Cost: 8 * +* Power Score: Wis -3 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=8; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + effect eVis=EffectVisualEffect(VFX_DUR_PARALYZE_HOLD); + effect eLink=EffectCutsceneImmobilize(); + eLink=EffectLinkEffects(eVis, eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TELEKINESIS); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM); + object oTarget=GetSpellTargetObject(); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TELEKINESIS)) return; + + int nDuration=GetEnhancedDuration(4+nLevel/2); + + if (GetObjectType(oTarget)==OBJECT_TYPE_CREATURE) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_TELEKINESIS)); + + if (!ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC) && !GetIsDM(oTarget)) + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_DOOR) + { + eVis=EffectVisualEffect(VFX_IMP_MAGBLUE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, ActionCloseDoor(oTarget)); + + else if (!GetLocked(oTarget)) + AssignCommand(oTarget, ActionOpenDoor(oTarget)); + + else + FloatingTextStringOnCreature("*locked*", oPC, FALSE); + + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_PLACEABLE) + { + eVis=EffectVisualEffect(VFX_IMP_MAGBLUE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + if(GetIsOpen(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_CLOSE)); + + else if (GetLocked(oTarget)) + FloatingTextStringOnCreature("*locked*", oPC, FALSE); + + else if (GetHasInventory(oTarget)) + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_OPEN)); + + else + AssignCommand(oTarget, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + } + + else if (GetObjectType(oTarget)==OBJECT_TYPE_ITEM) + { + eVis=EffectVisualEffect(VFX_IMP_MAGBLUE); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget)); + + if(!GetIsObjectValid(GetItemPossessor(oTarget))) + { + CopyItem(oTarget, oPC, TRUE); + DestroyObject(oTarget, 0.2); + } + + } + + +} diff --git a/nwnds_module/ps_teleport.ncs b/nwnds_module/ps_teleport.ncs new file mode 100644 index 000000000..e7681d15e Binary files /dev/null and b/nwnds_module/ps_teleport.ncs differ diff --git a/nwnds_module/ps_teleport.nss b/nwnds_module/ps_teleport.nss new file mode 100644 index 000000000..c8c4da857 --- /dev/null +++ b/nwnds_module/ps_teleport.nss @@ -0,0 +1,33 @@ +/************************************ +* Teleport * +* * +* Cost: 16 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + location lDest=GetTeleportAnchor(oPC); + effect eVis=EffectVisualEffect(VFX_IMP_DEATH); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TELEPORT); + + if(!GetIsObjectValid(GetAreaFromLocation(lDest))) + { + FloatingTextStringOnCreature("No valid teleport anchor has been set.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TELEPORT)) return; + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + DelayCommand(1.2, AssignCommand(oPC, JumpToLocation(lDest))); + +} diff --git a/nwnds_module/ps_tf_balor.ncs b/nwnds_module/ps_tf_balor.ncs new file mode 100644 index 000000000..aca245c56 Binary files /dev/null and b/nwnds_module/ps_tf_balor.ncs differ diff --git a/nwnds_module/ps_tf_balor.nss b/nwnds_module/ps_tf_balor.nss new file mode 100644 index 000000000..480aaebd8 --- /dev/null +++ b/nwnds_module/ps_tf_balor.nss @@ -0,0 +1,34 @@ +/************************************ +* Transformation (Balor) * +* * +* Cost: 32 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=32; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TRANSFORMATION); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + int nMorph=POLYMORPH_TYPE_BALOR; + effect eLink=EffectPolymorph(nMorph); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TRANSFORMATION)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TRANSFORMATION, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_tf_dragon.ncs b/nwnds_module/ps_tf_dragon.ncs new file mode 100644 index 000000000..def3fbbbe Binary files /dev/null and b/nwnds_module/ps_tf_dragon.ncs differ diff --git a/nwnds_module/ps_tf_dragon.nss b/nwnds_module/ps_tf_dragon.nss new file mode 100644 index 000000000..d9cf7da7a --- /dev/null +++ b/nwnds_module/ps_tf_dragon.nss @@ -0,0 +1,33 @@ +/************************************ +* Transformation (Red Dragon) * +* * +* Cost: 32 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=32; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TRANSFORMATION); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_RED_DRAGON); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TRANSFORMATION)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TRANSFORMATION, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_tf_fgiant.ncs b/nwnds_module/ps_tf_fgiant.ncs new file mode 100644 index 000000000..9bc76b4d7 Binary files /dev/null and b/nwnds_module/ps_tf_fgiant.ncs differ diff --git a/nwnds_module/ps_tf_fgiant.nss b/nwnds_module/ps_tf_fgiant.nss new file mode 100644 index 000000000..07b56269a --- /dev/null +++ b/nwnds_module/ps_tf_fgiant.nss @@ -0,0 +1,35 @@ +/************************************ +* Transformation (Frost Giant) * +* * +* Cost: 32 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=32; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TRANSFORMATION); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + int nMorph=(GetGender(oPC)==GENDER_FEMALE)?POLYMORPH_TYPE_JNAH_GIANT_FEMAL + : POLYMORPH_TYPE_JNAH_GIANT_MALE; + effect eLink=EffectPolymorph(nMorph); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TRANSFORMATION)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TRANSFORMATION, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_tf_golem.ncs b/nwnds_module/ps_tf_golem.ncs new file mode 100644 index 000000000..5871865bf Binary files /dev/null and b/nwnds_module/ps_tf_golem.ncs differ diff --git a/nwnds_module/ps_tf_golem.nss b/nwnds_module/ps_tf_golem.nss new file mode 100644 index 000000000..65d530262 --- /dev/null +++ b/nwnds_module/ps_tf_golem.nss @@ -0,0 +1,33 @@ +/************************************ +* Transformation (Iron Golem) * +* * +* Cost: 32 * +* Power Score: Con -6 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=32; + int nPowerScore=GetAbilityScore(oPC, ABILITY_CONSTITUTION)-6; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TRANSFORMATION); + effect eVis=EffectVisualEffect(VFX_IMP_POLYMORPH); + effect eLink=EffectPolymorph(POLYMORPH_TYPE_IRON_GOLEM); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TRANSFORMATION)) return; + + int nDuration=GetEnhancedDuration(nLevel/2); + + RemoveEffectsFrom(oPC, SPELL_PSIONIC_ENHANCED_STRENGTH); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TRANSFORMATION, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_thtshield.ncs b/nwnds_module/ps_thtshield.ncs new file mode 100644 index 000000000..f49aeb882 Binary files /dev/null and b/nwnds_module/ps_thtshield.ncs differ diff --git a/nwnds_module/ps_thtshield.nss b/nwnds_module/ps_thtshield.nss new file mode 100644 index 000000000..dce6f5b45 --- /dev/null +++ b/nwnds_module/ps_thtshield.nss @@ -0,0 +1,33 @@ +/************************************ +* Thought Shield * +* * +* Cost: 1 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=1; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_THOUGHT_SHIELD); + effect eVis=EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE); + effect eLink=EffectImmunity(IMMUNITY_TYPE_CONFUSED); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_DAZED)); + eLink=EffectLinkEffects(eLink, EffectImmunity(IMMUNITY_TYPE_STUN)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_THOUGHT_SHIELD)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_THOUGHT_SHIELD, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_timeshift.ncs b/nwnds_module/ps_timeshift.ncs new file mode 100644 index 000000000..ddd6414a7 Binary files /dev/null and b/nwnds_module/ps_timeshift.ncs differ diff --git a/nwnds_module/ps_timeshift.nss b/nwnds_module/ps_timeshift.nss new file mode 100644 index 000000000..2bc076cc4 --- /dev/null +++ b/nwnds_module/ps_timeshift.nss @@ -0,0 +1,41 @@ +/************************************ +* Time Shift * +* * +* Cost: 16 * +* Power Score: Int -2 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_INTELLIGENCE)-2; + effect eVis=EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MAJOR); + effect eLink=EffectCutsceneGhost(); + eLink=EffectLinkEffects(eLink, EffectEthereal()); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_ACID, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_DIVINE, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_MAGICAL, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_POSITIVE, 100)); + eLink=EffectLinkEffects(eLink, EffectDamageImmunityIncrease(DAMAGE_TYPE_SONIC, 100)); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TIME_SHIFT); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TIME_SHIFT)) return; + + int nDuration=GetEnhancedDuration(3); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TIME_SHIFT, FALSE)); + + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, RoundsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_tp_anchor.ncs b/nwnds_module/ps_tp_anchor.ncs new file mode 100644 index 000000000..88b4f2a60 Binary files /dev/null and b/nwnds_module/ps_tp_anchor.ncs differ diff --git a/nwnds_module/ps_tp_anchor.nss b/nwnds_module/ps_tp_anchor.nss new file mode 100644 index 000000000..e6b693d86 --- /dev/null +++ b/nwnds_module/ps_tp_anchor.nss @@ -0,0 +1,25 @@ +/************************************ +* Teleport Anchor * +* * +* Cost: 1 * +* Power Score: Wis +1 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=1; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)+1; + location lLoc=GetLocation(oPC); + effect eVis=EffectVisualEffect(VFX_IMP_HEAD_FIRE); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TELEPORT)) return; + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + SetTeleportAnchor(lLoc, oPC); + +} diff --git a/nwnds_module/ps_tp_boomerang.ncs b/nwnds_module/ps_tp_boomerang.ncs new file mode 100644 index 000000000..211c5e55c Binary files /dev/null and b/nwnds_module/ps_tp_boomerang.ncs differ diff --git a/nwnds_module/ps_tp_boomerang.nss b/nwnds_module/ps_tp_boomerang.nss new file mode 100644 index 000000000..c1c2b2103 --- /dev/null +++ b/nwnds_module/ps_tp_boomerang.nss @@ -0,0 +1,35 @@ +/************************************ +* Boomerang Teleport * +* * +* Cost: 16 * +* Power Score: Wis -3 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=16; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-3; + location lDest=GetTeleportAnchor(oPC); + location lLoc=GetLocation(oPC); + effect eVis=EffectVisualEffect(VFX_IMP_DEATH); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TELEPORT); + + if(!GetIsObjectValid(GetAreaFromLocation(lDest))) + { + FloatingTextStringOnCreature("No valid teleport anchor has been set.", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TELEPORT)) return; + + SetTeleportAnchor(lLoc, oPC); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + DelayCommand(1.2, AssignCommand(oPC, JumpToLocation(lDest))); +} + diff --git a/nwnds_module/ps_truesight.ncs b/nwnds_module/ps_truesight.ncs new file mode 100644 index 000000000..44b6e0734 Binary files /dev/null and b/nwnds_module/ps_truesight.ncs differ diff --git a/nwnds_module/ps_truesight.nss b/nwnds_module/ps_truesight.nss new file mode 100644 index 000000000..2eeb8ad5c --- /dev/null +++ b/nwnds_module/ps_truesight.nss @@ -0,0 +1,32 @@ +/************************************ +* True Sight * +* * +* Cost: 15 * +* Power Score: Wis -4 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=15; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + effect eVis=EffectVisualEffect(VFX_DUR_PROT_PREMONITION); + effect eLink=EffectTrueSeeing(); + eLink=EffectLinkEffects(eLink, eVis); + eLink=EffectLinkEffects(EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), eLink); + eLink=ExtraordinaryEffect(eLink); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TRUE_SIGHT); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TRUE_SIGHT)) return; + + int nDuration=GetEnhancedDuration(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TRUE_SIGHT, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); + +} diff --git a/nwnds_module/ps_twrirnwill.ncs b/nwnds_module/ps_twrirnwill.ncs new file mode 100644 index 000000000..2c91b0914 Binary files /dev/null and b/nwnds_module/ps_twrirnwill.ncs differ diff --git a/nwnds_module/ps_twrirnwill.nss b/nwnds_module/ps_twrirnwill.nss new file mode 100644 index 000000000..7e2daf9f2 --- /dev/null +++ b/nwnds_module/ps_twrirnwill.nss @@ -0,0 +1,31 @@ +/************************************ +* Tower of Iron Will * +* * +* Cost: 6 * +* Power Score: Wis -2 * +* * +*************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=6; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-2; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_TOWER_OF_IRON_WILL); + effect eVis=EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY); + effect eLink=EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE)); + eLink=EffectLinkEffects(eLink, eVis); + eLink=ExtraordinaryEffect(eLink); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_TOWER_OF_IRON_WILL)) return; + + int nDuration=GetEnhancedEffect(nLevel); + + SignalEvent(oPC, EventSpellCastAt(oPC, SPELL_PSIONIC_TOWER_OF_IRON_WILL, FALSE)); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, TurnsToSeconds(nDuration)); +} + diff --git a/nwnds_module/ps_ultrablast.ncs b/nwnds_module/ps_ultrablast.ncs new file mode 100644 index 000000000..a8effa850 Binary files /dev/null and b/nwnds_module/ps_ultrablast.ncs differ diff --git a/nwnds_module/ps_ultrablast.nss b/nwnds_module/ps_ultrablast.nss new file mode 100644 index 000000000..e6f064594 --- /dev/null +++ b/nwnds_module/ps_ultrablast.nss @@ -0,0 +1,46 @@ +/************************************ +* Ultrablast * +* * +* Cost: 75 * +* Power Score: Wis -10 * +* * +*************************************/ + +#include "lib_psionic" + + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=75; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-10; + effect eVis=EffectVisualEffect(VFX_FNF_SOUND_BURST); + effect eLink=EffectDeath(); + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_ULTRABLAST); + location lHere=GetLocation(oPC); + int nDC=10+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + object oTarget=GetFirstObjectInShape(SHAPE_SPHERE, 10.0, lHere); + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_ULTRABLAST)) return; + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPC); + + while(GetIsObjectValid(oTarget)) + { + if(!GetFactionEqual(oTarget, oPC) && !(GetRacialType(oTarget)==RACIAL_TYPE_CONSTRUCT || GetRacialType(oTarget)==RACIAL_TYPE_UNDEAD)) + { + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_ULTRABLAST)); + + if (!WillSave(oTarget, nDC, SAVING_THROW_TYPE_MIND_SPELLS, oPC)) + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eLink, oTarget)); + + else + { + DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d6(3)), oTarget)); + } + } + + oTarget=GetNextObjectInShape(SHAPE_SPHERE, 10.0, lHere); + } + +} diff --git a/nwnds_module/ps_wrench.ncs b/nwnds_module/ps_wrench.ncs new file mode 100644 index 000000000..1f0c887ca Binary files /dev/null and b/nwnds_module/ps_wrench.ncs differ diff --git a/nwnds_module/ps_wrench.nss b/nwnds_module/ps_wrench.nss new file mode 100644 index 000000000..64a0c4c45 --- /dev/null +++ b/nwnds_module/ps_wrench.nss @@ -0,0 +1,47 @@ +/************************************ +* Wrench * +* * +* Cost: 15 * +* Power Score: Wis -4 * +* * +************************************/ + +#include "lib_psionic" + +void main() +{ + object oPC=OBJECT_SELF; + int nCost=15; + int nPowerScore=GetAbilityScore(oPC, ABILITY_WISDOM)-4; + int nLevel=GetEffectivePsionicLevel(oPC, FEAT_PSIONIC_WRENCH); + effect eVis=EffectVisualEffect(VFX_IMP_DISPEL); + object oTarget=GetSpellTargetObject(); + int nDC=12+(nLevel>30?15:nLevel/2)+GetAbilityModifier(ABILITY_WISDOM, oPC); + + if (GetRacialType(oTarget)!=RACIAL_TYPE_UNDEAD && GetRacialType(oTarget)!=RACIAL_TYPE_OUTSIDER + && GetRacialType(oTarget)!=RACIAL_TYPE_ELEMENTAL) + { + FloatingTextStringOnCreature("This power only affects extraplanar creatures and undead", oPC, FALSE); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(292), oPC); + return; + } + + if (!PowerCheck(oPC, nCost, nPowerScore, FEAT_PSIONIC_WRENCH)) return; + + effect eLink=EffectTurnResistanceDecrease(GetEnhancedEffect(nLevel/2, FEAT_PSIONIC_WRENCH)); + eLink=EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE)); + eLink=EffectLinkEffects(eLink, EffectACDecrease(GetEnhancedEffect(d6(2), FEAT_PSIONIC_WRENCH))); + eLink=EffectLinkEffects(eLink, EffectSpellResistanceDecrease(GetEnhancedEffect(d6(2), FEAT_PSIONIC_WRENCH))); + eLink=EffectLinkEffects(eLink, EffectSavingThrowDecrease(SAVING_THROW_ALL, GetEnhancedEffect(d6(2), FEAT_PSIONIC_WRENCH))); + eLink=ExtraordinaryEffect(eLink); + int nDuration=GetEnhancedDuration(1+nLevel); + + SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_PSIONIC_WRENCH, TRUE)); + + if (!FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NONE, oPC)) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)); + } + +} diff --git a/nwnds_module/psidspiderbi.uti b/nwnds_module/psidspiderbi.uti new file mode 100644 index 000000000..519e6503a Binary files /dev/null and b/nwnds_module/psidspiderbi.uti differ diff --git a/nwnds_module/psurlon_hide01.uti b/nwnds_module/psurlon_hide01.uti new file mode 100644 index 000000000..13832f749 Binary files /dev/null and b/nwnds_module/psurlon_hide01.uti differ diff --git a/nwnds_module/psurlon_hide02.uti b/nwnds_module/psurlon_hide02.uti new file mode 100644 index 000000000..fadc62727 Binary files /dev/null and b/nwnds_module/psurlon_hide02.uti differ diff --git a/nwnds_module/puddingbrown001.utc b/nwnds_module/puddingbrown001.utc new file mode 100644 index 000000000..3ed2ca643 Binary files /dev/null and b/nwnds_module/puddingbrown001.utc differ diff --git a/nwnds_module/puddingdun001.utc b/nwnds_module/puddingdun001.utc new file mode 100644 index 000000000..82e57bff4 Binary files /dev/null and b/nwnds_module/puddingdun001.utc differ diff --git a/nwnds_module/puddingwhite001.utc b/nwnds_module/puddingwhite001.utc new file mode 100644 index 000000000..91ca56fe8 Binary files /dev/null and b/nwnds_module/puddingwhite001.utc differ diff --git a/nwnds_module/pwfxp.ncs b/nwnds_module/pwfxp.ncs new file mode 100644 index 000000000..1e027046d Binary files /dev/null and b/nwnds_module/pwfxp.ncs differ diff --git a/nwnds_module/pwfxp.nss b/nwnds_module/pwfxp.nss new file mode 100644 index 000000000..b9f06f01d --- /dev/null +++ b/nwnds_module/pwfxp.nss @@ -0,0 +1,479 @@ +//PRC racial pack compatible PWFXP script +// +//PRC Version: 3.1e +//Written by: Silvercloud (scl.vcs-online.com) & Ornedan +// Modified by fluffyamoeba for 3.x versions of the PRC +/* + +changes: 2007-11-14 + +- pwfxp_prc_race now reads the 2da cache directly. + +- the race LA is done entirely through this script. DO NOT set PRC_XP_USE_SIMPLE_LA + or the XP penalty will be applied twice + +- if using this with the supplied prc_pwondeath script, you don't need to make any + changes to nw_c2_default7 (the OnDeath script) + +- prc_racial_const no longer used + +================= + +Include added for prc races: pwfxp_prc_race, modify this file if you want to +adjust ECLs (the subrace constants in pwfxp_def is removed). + +Main function for determining ECL rewritten to hook into getECLMod. + +package includes prc_racial_const for completeness, but you do not have to over- +write the one in your world per se (for example if you have more races). + +have fun, + +Silvercloud + + +//:://///////////////////////////////////////////// +//:: XP Distribution Script by Knat +//:: pwfxp v1.70 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// + + + IMPORTANT: see pwfxp_def modifier definition script... + + check this link in case you want to discuss this script: + http://www.thefold.org/nuke/modules.php?name=Forums&file=viewforum&f=69 + + This is a more sophisticated XP distribution script geared towards PWs. + It comes with two dozen XP modifiers to fine tune XP output and + is losely based on the old but solid TTV XP script. + + here is a small example of features, all modifiers are scalable: + + - independent XP modifier for every single level. this breaks nwns linear + XP progression and enables you to define your own progression function. + you can give out fast xp early and let players slow down at any rate you want. + or model your own progression function with the manipulation of two constants + + - PCs suffer XP reduction if their level is not close enough to the average + party level. level 1 grouping with level 10 is probably not a good idea... + + - PCs suffer XP reduction if their level is not close enough to the CR of the killed MOB + (both directions independent now) + + - Adjustable & cached ECL modifiers, easy to sync with any subrace scripts + + - Group bonus. groups receive a small XP bonus (or big, if you wish) to encourage teamplay + + - Groupmembers need to be within minimum distance to the killed MOB if they want to receive XP + + - associates get a share of the xp, but you can set a different divisor for each associate type + e.g.: henchman soak up more XP then animal companions + + - several counter exploit mechanisms included + + - many more, see the constants... + + - easy to add new modifiers.. + + all in all, this is pushing the nwn XP system more close to what you get in a MMORPG. You can + make it very hard to level or easy as hell, with good control of group impact and flexible + boundaries. + + system went through extensive beta tests at www.thefold.org - thanks to all the great + players and staff there... + + ------------------------------------------------------------------------------------------ + --- USAGE --- --- USAGE --- --- USAGE --- --- USAGE --- --- USAGE ------------------------ + ------------------------------------------------------------------------------------------ + + just add the following line to the onDeath script of your creatures (default: nw_c2_default7): + + ExecuteScript("pwfxp",OBJECT_SELF); + + Don't forget to set the XP-Scale slider to 0 (module properties) + + *note* if using your own prc_pwondeath script add this to that script instead. + + ATTENTION: HOW TO REMOVE THE DOUBLE XP MESSAGE ! + + put this code above the pwfxp execution in your onDeath script + + // safety mechanism in case creature kills itself + if(GetLastKiller() == OBJECT_SELF) return; + + put this code near the bottom of your onDeath script to remove the double-xp message + thanks to spider661/Sotae for this catch... + + // resurrect & self kill to bypass bioware xp message + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(10000, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY), OBJECT_SELF); + + ------------------------------------------------------------------------------------------ + + changelog: + + v1.7 update (3/2004) + + - added PWFXP_MAXIMUM_XP constant due to user request... + + v1.62 update (2/2004) + + - fixed documentation error. using the wrong info could lead to divide by zero error + + if you want to eliminate mob CR < PC-Level reduction: + set PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION to PWFXP_CR_MAX and + PWFXP_CR_LESSTHAN_PCLEVEL_NOXP to PWFXP_CR_MAX + 1 + + if you want to eliminate mob CR > PC-Level reduction: + set PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION to PWFXP_CR_MAX and + PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP to PWFXP_CR_MAX + 1 + + if you want to eliminate Average Party Level reduction: + set PWFXP_APL_REDUCTION to 40 and + PWFXP_APL_NOXP to 41 + + thanx to tribble for the catch + + v1.61 update(1/2004) + + - fixed minor naming convention error + + v1.6 update(1/2004) + + - improved XP divisor. you can now distinct between animal companion, + familiar, dominated, summoned and henchman. you can set a different + xp divisor for each of them. (default: henchman has max reduction impact followed + by dominated, summoned, familiars, animal companion) + + see PWFXP_XP_DIVISOR_* constants + + - added PWFXP_USE_TOTAL_XP_TO_COMPUTE_PCLEVEL constant + pc level gets computed based on the total XP instead of + using GetLevelBy functions if set to TRUE. this way players ready to levelup + can't bunker XP to gain better XP bonuses/modifiers. + + - removed dumb debug fragments, no more svirfneblin invasions... + thanks to Beowulf for the catch... + + v1.5 update(12/2003) + + - improved ECL modifier: added caching to decrease cpu use + improved parser + + v1.4 update(12/2003) + + - removed constant PWFXP_CR_REDUCTION and PWFXP_CR_NOXP + + - added 4 new constants instead to distinct between.. + PC-Level > CR + PC-Level < CR + ..cases: + + PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION + PWFXP_CR_LESSTHAN_PCLEVEL_NOXP + PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION + PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP + + - added PWFXP_USE_SETXP constant + + - split the script up. now all constants are isolated in their own + definiton file (pwfxp_def). easier to update that way... + + v1.3 update (12/2003) + + - added PWFXP_LEVEL_MODIFIERS. this removes the linear xp output... read more below + + v1.2 update (10/2003) + + - killer gets excluded from distance check now if he *is* a PC. + he gets XP even if his spell kills something far away (e.g. long range spells, + damage over time spells. maybe traps, not tested so far. this does not include NPCs) + every other groupmember gets still checked for distance... + [thanks to telstar for the report/request...] + + v1.1 initial full release (10/2003) + + - fine tuned and slightly optimized code + - added debug toggle + + v1.0 beta (8/2003): + + - distance check should now work correctly + + - minimum XP award (see new PWFXP_MINIMUM_XP constant) + + - henchman, familiars, animal companions, summoned creatures and other NPCs in a player + group now take away XP. see PWFXP_XP_DIVISOR_PC and PWFXP_XP_DIVISOR_NPC constants + + - made it easier to manage ECL modifiers. see PWFXP_ECL_MODIFIERS string constant + +*/ +//::////////////////////////////////////////////// +//:: Created By: LasCivious & Knat +//:: Created On: 7/2003 +//::////////////////////////////////////////////// + +#include "pwfxp_def" +#include "pwfxp_prc_race" + + +int PWFXP_GetLevel(object oPC) +{ + // we need to use a derivation of the base xp formular to compute the + // pc level based on total XP. + // + // base XP formula (x = pc level, t = total xp): + // + // t = x * (x-1) * 500 + // + // need to use some base math.. + // transform for pq formula use (remove brackets with x inside and zero right side) + // + // x^2 - x - (t / 500) = 0 + // + // use pq formula to solve it [ x^2 + px + q = 0, p = -1, q = -(t/500) ]... + // + // that's our new formular to get the level based on total xp: + // level = 0.5 + sqrt(0.25 + (t/500)) + // + if(PWFXP_USE_TOTAL_XP_TO_COMPUTE_PCLEVEL) // use total XP to compute PC level + return FloatToInt(0.5 + sqrt(0.25 + ( IntToFloat(GetXP(oPC)) / 500 ))); + else // use total class level to compute PC level + return GetLevelByPosition(1,oPC) + GetLevelByPosition(2,oPC) + GetLevelByPosition(3,oPC); +} + + + +// see PWFXP_ECL_MODIFIERS constant description +float PWFXP_GetECLModifier(object oPC) +{ + // get current + int nHD = GetHitDice(oPC); + + // get last PC HD from cache + int nECLHitDice = GetLocalInt(oPC,"PWFXP_ECL_HITDICE"); + + // last PC HD = current PC HD ? get ECL modifier from cache and return... + if(nECLHitDice == nHD) return GetLocalFloat(oPC,"PWFXP_ECL_MODIFIER"); + + // recompute ECL modifier and cache it + // this code section will run only in the case of two circumstances: + // + // 1. first time kill + // 2. pc hitdice change (e.g. levelup) + float fECLMod; + fECLMod = IntToFloat(nHD) / (IntToFloat(nHD) + IntToFloat(GetECLMod(oPC))); + SetLocalFloat(oPC,"PWFXP_ECL_MODIFIER", fECLMod); + SetLocalInt(oPC,"PWFXP_ECL_HITDICE",nHD); + return fECLMod; +} +// see PWFXP_LEVEL_MODIFIER constant description +float PWFXP_GetLevelModifier(int nLevel) +{ + return StringToFloat(GetSubString( PWFXP_LEVEL_MODIFIERS, (nLevel - 1) * 7, 6)); +} + +// see PWFXP_APL_REDUCTION & PWFXP_APL_NOXP constant description +float PWFXP_GetLevelDistanceModifier(float fLevelDistance) +{ + if( fLevelDistance >= PWFXP_APL_NOXP ) + { + // level distance greater than maximum allowed > no XP award at all + return 0.0; // -100% + } + else if(fLevelDistance >= PWFXP_APL_REDUCTION) + { + // level distance greater than reduction limit ? reduce xp + return 1 - ((fLevelDistance - PWFXP_APL_REDUCTION) * PWFXP_APL_MODIFIER); + } + return 1.0; +} + +// see PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION, PWFXP_CR_LESSTHAN_PCLEVEL_NOXP +// PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION, PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP +// constant description +float PWFXP_GetCRDistanceModifier(float fCRDistance) +{ + // PC level > creature CR ? + if(fCRDistance < 0.0) + { + fCRDistance = fabs(fCRDistance); + if( fCRDistance >= PWFXP_CR_LESSTHAN_PCLEVEL_NOXP ) + { + // level distance greater than maximum allowed > no XP award at all + return 0.0; // -100% + } + else if(fCRDistance >= PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION) + { + // level distance greater than reduction limit ? reduce xp + return 1 - ((fCRDistance - PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION) * PWFXP_CR_LESSTHAN_PCLEVEL_MODIFIER); + } + } + else + { + fCRDistance = fabs(fCRDistance); + if( fCRDistance >= PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP ) + { + // level distance greater than maximum allowed > no XP award at all + return 0.0; // -100% + } + else if(fCRDistance >= PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION) + { + // level distance greater than reduction limit ? reduce xp + return 1 - ((fCRDistance - PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION) * PWFXP_CR_GREATERTHAN_PCLEVEL_MODIFIER); + } + } + return 1.0; +} + +// see PWFXP_KILLINGBLOW_MODIFIER constant description +float PWFXP_GetMiscModifier(object oPC, object oKiller) +{ + if(oPC == oKiller && PWFXP_KILLINGBLOW_MODIFIER != 0.0) + { + return 1 + PWFXP_KILLINGBLOW_MODIFIER; + } + return 1.0; +} + +// see PWFXP_GROUPBONUS_MODIFIER constant description +float PWFXP_GetGroupBonusModifier(int nGroupSize) +{ + return 1 + ((nGroupSize-1) * PWFXP_GROUPBONUS_MODIFIER); +} + +// see PWFXP_XP_DIVISOR_* constants +float PWFXP_GetAssociateDivisor(object oCreature) +{ + switch(GetAssociateType(oCreature)) + { + case ASSOCIATE_TYPE_ANIMALCOMPANION: return PWFXP_XP_DIVISOR_ANIMALCOMPANION; + case ASSOCIATE_TYPE_DOMINATED: return PWFXP_XP_DIVISOR_DOMINATED; + case ASSOCIATE_TYPE_FAMILIAR: return PWFXP_XP_DIVISOR_FAMILIAR; + case ASSOCIATE_TYPE_HENCHMAN: return PWFXP_XP_DIVISOR_HENCHMAN; + case ASSOCIATE_TYPE_SUMMONED: return PWFXP_XP_DIVISOR_SUMMONED; + default: return PWFXP_XP_DIVISOR_UNKNOWN; + } + return 1.0; +} + +// see PWFXP_MAXIMUM_DISTANCE_TO_GROUP constant description +int PWFXP_CheckDistance(object oDead, object oGroupMbr) +{ + return ( GetDistanceBetween(oDead, oGroupMbr) <= PWFXP_MAXIMUM_DISTANCE_TO_GROUP ) && ( GetArea(oDead) == GetArea(oGroupMbr) ); +} + +// see PWFXP_USE_SETXP constant description +void PWFXP_GiveXP(object oPC, int nXP) +{ + if(PWFXP_USE_SETXP) + SetXP(oPC, GetXP(oPC) + nXP); + else + GiveXPToCreature(oPC, nXP); +} + +void main() +{ + object oDead = OBJECT_SELF; + object oKiller = GetLastKiller(); + + // only continue if killer is valid and not from same faction... + if ((oKiller==OBJECT_INVALID) || (GetFactionEqual(oKiller, oDead))) return; + + // average party level, xp divisor + float fAvgLevel, fDivisor; + // groupsize, only PCs count + int nGroupSize; + + // get some basic group data like average PC level , PC group size, and XP divisor + object oGroupMbr = GetFirstFactionMember(oKiller, FALSE); + while(oGroupMbr != OBJECT_INVALID) + { + if( PWFXP_CheckDistance(oDead, oGroupMbr) || oGroupMbr == oKiller) + { + if(GetIsPC(oGroupMbr)) + { + nGroupSize++; + // add pc divisor + fDivisor += PWFXP_XP_DIVISOR_PC; + fAvgLevel += IntToFloat(PWFXP_GetLevel(oGroupMbr)); + } + else + fDivisor += PWFXP_GetAssociateDivisor(oGroupMbr); // add npc divisor + } + oGroupMbr = GetNextFactionMember(oKiller, FALSE); + } + + if(nGroupSize == 0) + { + // NPC (Minion) killed something without a PC (Master) near enough to get XP + return; + } + + // calculate average partylevel + fAvgLevel /= IntToFloat(nGroupSize); + + // modifiers + float fLevelModifier, fDistanceModifier, fCRModifier, fMiscModifier, fFinalModifier, fECLModifier, fGroupBonusModifier; + // groupmember level + float fMbrLevel; + // get creature CR + float fCR = GetChallengeRating(oDead); + // reduce CR if greater then maximum CR cap + if(fCR > PWFXP_CR_MAX) fCR = PWFXP_CR_MAX; // cap CR + // multiply CR with global XP modifier + float fModCR = fCR * PWFXP_GLOBAL_MODIFIER; + + // calculate modifiers for each PC individually + oGroupMbr = GetFirstFactionMember(oKiller, TRUE); + while(oGroupMbr != OBJECT_INVALID) + { + fMbrLevel = IntToFloat(PWFXP_GetLevel(oGroupMbr)); + if( PWFXP_CheckDistance(oDead, oGroupMbr) || oGroupMbr == oKiller) + { + // get global level modifier + fLevelModifier = PWFXP_GetLevelModifier(FloatToInt(fMbrLevel)); + // get PC-level distance to average group-level and compute modifier + fDistanceModifier = PWFXP_GetLevelDistanceModifier(fabs(fAvgLevel - fMbrLevel)); + // get PC-level distance to CR of dead creature and compute modifier + fCRModifier = PWFXP_GetCRDistanceModifier(fCR - fMbrLevel); + // get misc modifiers (right now only 10% for killing blow dealer) + fMiscModifier = PWFXP_GetMiscModifier(oGroupMbr, oKiller); + // get group bonus modifier + fGroupBonusModifier = PWFXP_GetGroupBonusModifier(nGroupSize); + // get subrace ECL modifier + fECLModifier = PWFXP_GetECLModifier(oGroupMbr); + // calculate final modifier + fFinalModifier = fLevelModifier * fDistanceModifier * fCRModifier * fMiscModifier * fGroupBonusModifier * fECLModifier; + + // debug + if(PWFXP_DEBUG) + SendMessageToPC(oGroupMbr,GetName(oGroupMbr)+"'s XP Base: "+IntToString(FloatToInt(fModCR / fDivisor))+ + " / Modifiers: LVL [" + IntToString(FloatToInt((fLevelModifier-1)*100)) + + "%] APD ["+IntToString(FloatToInt((fDistanceModifier-1)*100)) + + "%] CRD ["+IntToString((fCR-fMbrLevel) < 0.0) + "/" + IntToString(FloatToInt((fCRModifier-1)*100))+ + "%] MSC ["+IntToString(FloatToInt((fMiscModifier-1)*100))+ + "%] GRP ["+IntToString(FloatToInt((fGroupBonusModifier-1)*100))+ + "%] ECL ["+IntToString(FloatToInt((fECLModifier-1)*100))+ + "%] GRS ["+IntToString(nGroupSize)+ + "] DIV ["+GetSubString(FloatToString(fDivisor),6,5) + + "] FIN ["+IntToString(FloatToInt((fFinalModifier-1)*100))+ + "%]"); + + + int nXP = FloatToInt((fModCR / fDivisor) * fFinalModifier); + + // award minimum/maximum xp if needed + if(nXP < PWFXP_MINIMUM_XP) + nXP = PWFXP_MINIMUM_XP; + else if(nXP > PWFXP_MAXIMUM_XP) + nXP = PWFXP_MAXIMUM_XP; + + // misc checks for reasons the party member might not get XP would go here (eg. if they are dead) + + if(nXP > 0) PWFXP_GiveXP(oGroupMbr, nXP); + } + oGroupMbr = GetNextFactionMember(oKiller, TRUE); + } +} diff --git a/nwnds_module/pwfxp_def.nss b/nwnds_module/pwfxp_def.nss new file mode 100644 index 000000000..d1425fed7 --- /dev/null +++ b/nwnds_module/pwfxp_def.nss @@ -0,0 +1,274 @@ +//:://///////////////////////////////////////////// +//:: XP Distribution Script by Knat +//:: pwfxp +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +//void main(){} +// note: default values are geared towards a LOW xp setting... +// with easy leveling early (level 1-5) and very hard xp gain later on (lvl 30+) +// all default values should be epic-level compatible + + +// this will modify global xp output similar to the module xp-slider +// higher value = more xp +// PC needs to kill a combined CR of (PC-LEVEL * 1000) / PWFXP_GLOBAL_MODIFIER +// on average to gain a level. use this as a rule of thumb and base to calculate +// the more advanced modifiers +// +// e.g. a level 10 needs to kill 100 CR-10 mobs to level (aprox.) using default 10.0 global modifier +// he will only need 50 CR-10 mobs if you set it to 20.0 +// setting this to 1000.0 = he only needs one CR-10 mob to level +// +// you can further scale the leveling progress more precisely with the PWFXP_LEVEL_MODIFIERS constant +// just continue to read my comments... +const float PWFXP_GLOBAL_MODIFIER = 10.0; + +// displays one-line XP status info after each kill +// useful while you fine tune the system. +// and check the readme.txt in case you want to remove +// the double-xp message from bioware... +const int PWFXP_DEBUG = TRUE; + +// NEW & experimental: +// system will use the SetXP function instead of GiveXPToCreature if you set this to TRUE +// this should bypass any "possible" bioware xp modification, like multiclass penalties. +// i did not really test this so far, it's just some rumor i picked up from the +// bioboards. choose whatever you feel better with... +const int PWFXP_USE_SETXP = TRUE; + +// NEW: +// pc level gets computed based on the total XP instead of +// using GetLevelBy functions if set to TRUE. this way players ready to levelup +// can't bunker XP to gain better XP bonuses. a level 2 player with +// 3500 total XP (thus, ready to levelup) gets considered +// level 3 by the XP script if you set this switch to TRUE +// +// setting this to FALSE will use the old way of GetLevelByPosition. +// i highly recommend the new way to counter XP (and probably more) exploits... +const int PWFXP_USE_TOTAL_XP_TO_COMPUTE_PCLEVEL = TRUE; + +// this is where you apply your subrace ECL modifiers +// add them to the constant in this form "(ECL Modifier)-(Subrace)|...next|...etc" +// COMMENTED OUT as it is no longer used in the calculations. +//const string PWFXP_ECL_MODIFIERS = "1-ARCTIC DWARF|1-HALF OGRE|1-GITHYANKI|1-GITZERAI|1-OROG|1-GNOLL|1-LIZARDFOLK|1-AASIMAR|1-TIEFLING|1-HOBGOLBIN|1-GRAY DWARF|2-DROW MALE|2-DROW FEMALE|2-DEEP GNOME SVIRFNEBLIN|2-AVARIEL|2-MINOTAUR|2-BUGBEAR|2-FEY'RI|2-TANARUKK|3-OGRE|3-YUANTI PURE|3-AZER|4-PIXIE|4-ILLITHID|5-TROLL|6-RAKSHASHA"; + +// NEW: +// +// you can add a modifier to change XP output for every single level (including epic levels) +// this also enables you to break the linear nature of NWNs default XP output. +// you can change it to: logarithmic, exponential or any other non-linear +// mathematical function using the PWFXP_LEVEL_MODIFIERS table +// +// you can make the first few levels an easy catch but make the last a pain to reach.... very flexible now +// +// default setting: +// +// level 1 = 1000% xp bonus +// level 2 = 500% xp bonus +// level 3 = 300% xp bonus +// level 4 = 200% xp bonus +// level 5 = 100% xp bonus +// +// level 6 - 10 = no xp change + +// level 11 = -15% xp penalty +// level 12 = -15% +// level 13 = -20% +// level 14 = -20% +// level 15 = -25% +// level 16 = -25% +// level 17 = -30% +// level 18 = -30% +// level 19 = -35% +// level 20 = -35% +// +// level 21 = -40% xp penalty +// level 22 = -45% +// level 23 = -50% +// level 24 = -55% +// level 25 = -60% +// level 26 = -65% +// level 27 = -70% +// level 28 = -80% +// level 29 = -90% +// +// level 30 = -91% xp penalty +// level 31 = -91% +// level 32 = -92% +// level 33 = -92% +// level 34 = -93% +// level 35 = -93% +// level 36 = -94% +// level 37 = -94% +// level 38 = -95% +// level 39 = -96% +// +// these settings make it easy first but very tough at later levels. +// the pc would need to kill 100 level 10 creatures to level from 10 to 11, but +// several thousand CR 40 creatures to level from 39 to 40, with the above settings. +// (not counting group bonus or other advanced modifiers) +// +// modifier explanation: +// +// a value of 1 (01.000) means no xp change. +// +// the actual xp bonus/penalty in % = (modifier - 1) * 100 +// +// use value < 1.0 to reduce the xp +// e.g. 00.500 = -50% +// 00.010 = -99% +// 00.001 = -99.9% +// +// attention: syntax !! +// always pad with 0. each number must be 6 chars long +// otherwise the parser will fail and your players get 0xp +// i use very simplistic parsing to optimize cpu use... +// +// the first number modifies level 1, the last number level 40 +// +// LEVEL-----01--|--02--|--03--|--04--|--05--|--06--|--07--|--08--|--09--|--10--|--11--|--12--|--13--|--14--|--15--|--16--|--17--|--18--|--19--|--20--|--21--|--22--|--23--|--24--|--25--|--26--|--27--|--28--|--29--|--30--|--31--|--32--|--33--|--34--|--35--|--36--|--37--|--38--|--39--|--40--| +const string PWFXP_LEVEL_MODIFIERS = "11.000|06.000|04.000|01.000|01.000|01.000|01.000|01.000|01.000|01.000|00.850|00.850|00.800|00.800|00.750|00.750|00.700|00.700|00.650|00.650|00.600|00.550|00.500|00.450|00.400|00.350|00.300|00.200|00.100|00.090|00.090|00.080|00.080|00.070|00.070|00.060|00.060|00.050|00.040|00.040"; + +// small bonus for killing blow dealer +const float PWFXP_KILLINGBLOW_MODIFIER = 1.5; // 0% + +// PC level gets compared to the average party level. +// APL = Average Party Level +// +// +// attention: the below example was from version 1.1 +// most if not all constants have been changed (scalar for example is 100% now and thus fully linear) +// +// example uses below values +// const float PWFXP_APL_REDUCTION = 2.0; +// const float PWFXP_APL_NOXP = 4.0; +// const float PWFXP_SCALAR = 0.5 +// +// XP gets reduced if PC-level > APL + APL_REDUCTION +// XP reduction is based on SCALAR, be careful if you change this +// right now its 0 - 50% (scalar 0.5) for delta 2 (APL_REDUCTION) .. delta 4 (APL_NOXP) +// delta = abs(APL - PC Level) +// this means it will switch from 50% reduction to 100% reduction in one leap in case the PC level +// is greater then APL + APL_NOXP. +// i did this for a better granularity for the given default values but +// you can freely change APL_REDUCTION and/or APL_NOXP. XP reduction gets auto-adjusted to the maximum +// of SCALAR (50% default). +// +// XP gets reduced to zero if PC-level > APL + APL_NOXP +// +// Example (using default values): +// PC A = level 7 +// PC B = level 3 +// PC C = level 1 +// +// average party level (APL) = 3.66 +// +// Distance PC A = abs(PClevel - AveragePartyLevel) = abs(7 - 3.66) = 3.34 +// PC-A has a final distance of 1.34 (3.34 - APL_REDUCTION) +// XP reduction = (SCALAR / (APL_NOXP - APL_REDUCTION)) * 1.34 = (0.5 / 2) * 1.34 = 33.5% XP reduction +// +// Distance PC B = abs(PClevel - AveragePartyLevel) = abs(3 - 3.66) = 0.66 +// PC-A has a final distance of -1.34 (0.66 - APL_REDUCTION) +// no XP reduction +// +// Distance PC C = abs(PClevel - AveragePartyLevel) = abs(1 - 3.66) = 2.66 +// PC-A has a final distanceof 0.66 (2.66 - APL_REDUCTION) +// XP reduction = (SCALAR / (APL_NOXP - APL_REDUCTION)) * 0.66 = (0.5 / 2) * 0.66 = 16.5% XP reduction +// +// those PCs with the biggest impact to the average party level receive the biggest XP reduction +// (in the above case PC A) +// +// set _REDUCTION to 40 and _NOXP to 41 if you don't want any APL reduction +// +// changed default to a bit less harsh values +const float PWFXP_APL_REDUCTION = 3.0; // levels +const float PWFXP_APL_NOXP = 6.0; + +// NEW: +// these 4 constants works like the APL constants above but it compares +// PC level vs challenge rating of the dead creature +// +// you can distinct two different cases now: +// +// PC level > CR of the creature (CR + PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION) +// PC level < CR of the creature (CR + PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION) +// +// math is the same as the APL example above, just exchange +// AveragePartyLevel with CR of dead creature and use +// PWFXP_CR_*_PCLEVEL_REDUCTION and PWFXP_CR_*_PCLEVEL_NOXP as the constants +// +// set _REDUCTION to CR_MAX and _NOXP to CR_MAX+1 if you don't want any cr reduction +// +// reduction constants for PCs fighting mobs with a CR below their level +const float PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION = 3.0; +const float PWFXP_CR_LESSTHAN_PCLEVEL_NOXP = 10.0; + +// note: default setting only penalize PCs if they try to kill something +// that should be *impossible* for their level. +// a 40 level epic PC will be able to kill CR 60 creatures without +// penalty and a large low-level group of players will be able to +// kill a much higher CR creature without penalty...(a group of lvl5 players killing +// a CR 20 creature won't receive any penalty. penalty will start to kick in if they try +// to kill a creature with a CR > 25 +// you can use this to counter low-level XP exploits. e.g. a level 40 player +// could mangle a mob down to 1 HP. then a low level comes in and deals the final +// blow -> classical xp exploit... +// default settings make sure that nothing can get out of hand, but you can make +// this harsher if you want (but keep in mind that creatures can have a higher +// CR than the players maximum level, like CR 60) +// +// set _REDUCTION to CR_MAX and _NOXP to CR_MAX+1 if you don't want any cr reduction +// +// reduction constants for PCs fighting mobs with a CR above their level +const float PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION = 20.0; +const float PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP = 30.0; + +// described above +const float PWFXP_SCALAR = 1.0; + +// maximum CR cap +// this stops creatures with sky-high CRs from giving godly XP +const float PWFXP_CR_MAX = 60.0; + +// groups get a small xp bonus +// formular is groupsize-1 * modifier +// with a default value of 0.1 (10%) a party of 4 receives 30% XP bonus +// this should encourage grouping +// set it to 0.0 if you dont like that... +const float PWFXP_GROUPBONUS_MODIFIER = 0.1; + +// groub members need to be within this distance to the dead creature +// if they want to get any XP during fights +const float PWFXP_MAXIMUM_DISTANCE_TO_GROUP = 30.0; // meters + +// safety mechanism +// minimum XP for a kill +const int PWFXP_MINIMUM_XP = 0; + +// safety mechanism +// maximum XP for a kill +const int PWFXP_MAXIMUM_XP = 1000; + +// UPDATED: +// these constants determine how XP division works +// you can now distinct between animal companion, +// familiars, dominated, summoned and henchman. you can set a different +// xp divisor for each of them. (default: henchman has max reduction impact followed +// by dominated, summoned, familiars, animal companion) +// e.g.: a group with two PCs + 1 FAMILIAR + 1 SUMMONED CREATURE +// gets a total XP divisor of 2.5 (using default values). +// if they kill a 1000XP mob, both PCs only receive 400 XP +const float PWFXP_XP_DIVISOR_PC = 1.0; +const float PWFXP_XP_DIVISOR_DOMINATED = 0.5; +const float PWFXP_XP_DIVISOR_HENCHMAN = 0.5; +const float PWFXP_XP_DIVISOR_SUMMONED = 0.3; +const float PWFXP_XP_DIVISOR_ANIMALCOMPANION = 0.1; +const float PWFXP_XP_DIVISOR_FAMILIAR = 0.1; +// used in case i can't determine the associate type +const float PWFXP_XP_DIVISOR_UNKNOWN = 0.5; + +// don't change these +float PWFXP_APL_MODIFIER = PWFXP_SCALAR / (PWFXP_APL_NOXP - PWFXP_APL_REDUCTION); +float PWFXP_CR_LESSTHAN_PCLEVEL_MODIFIER = PWFXP_SCALAR / (PWFXP_CR_LESSTHAN_PCLEVEL_NOXP - PWFXP_CR_LESSTHAN_PCLEVEL_REDUCTION); +float PWFXP_CR_GREATERTHAN_PCLEVEL_MODIFIER = PWFXP_SCALAR / (PWFXP_CR_GREATERTHAN_PCLEVEL_NOXP - PWFXP_CR_GREATERTHAN_PCLEVEL_REDUCTION); + diff --git a/nwnds_module/pwfxp_prc_race.nss b/nwnds_module/pwfxp_prc_race.nss new file mode 100644 index 000000000..05e241f2f --- /dev/null +++ b/nwnds_module/pwfxp_prc_race.nss @@ -0,0 +1,16 @@ +// written by fluffyamoeba 09-07-06 +// actually gets the LA modifier, not ECL +// gets the LA from ecl.2da (actually the 2da cache) +// used to hand out XP adjusted for LA + +int GetECLMod(object oCreature); + +#include "inc_utility" + +int GetECLMod(object oCreature) +{ + int nRace = GetRacialType(oCreature); //note this is not MyPRCGetRacialType becuase we want to include subraces too + int nLA = 0; + nLA = StringToInt(Get2DACache("ECL", "LA", nRace)); + return nLA; +} diff --git a/nwnds_module/pwrespawner.utp b/nwnds_module/pwrespawner.utp new file mode 100644 index 000000000..438904dfd Binary files /dev/null and b/nwnds_module/pwrespawner.utp differ diff --git a/nwnds_module/qn_onhit.ncs b/nwnds_module/qn_onhit.ncs new file mode 100644 index 000000000..1613f3154 Binary files /dev/null and b/nwnds_module/qn_onhit.ncs differ diff --git a/nwnds_module/qn_onhit.nss b/nwnds_module/qn_onhit.nss new file mode 100644 index 000000000..375d15ce8 --- /dev/null +++ b/nwnds_module/qn_onhit.nss @@ -0,0 +1,643 @@ +//:://///////////////////////////////////////////// +//:: qn_onhit +//::////////////////////////////////////////////// +/* +Touch Attacks (Creature Slam) Workaround: + -5 Damage + +20 Attack + OnHit Cast Spell: Unique Power (Level 1) + +TAG must be named the same as the script "qn_onhit" !!! + +To use create a claw/slam/bite give it whatever damage + you would like then change the TAG to the name of the +script. + +Give it the OnHit Cast Spell: Unique Power (OnHit Level 1). + +Assign the appropriate variable below. Example: Wraith +would be SPECIAL_ATTACK int 16. + +I didn't use NWNs touch attack script... its too flawed. Higher + level undead can Touch you more than once a round, so I made + a workaround claw/slam noted at the very begning to make it +more D&D based. +20 to attack may seem like alot but you have +to figure that Incorporeal Undead are touching you which might +I add in 90% of the cases is very easy. + +Of course you don't have to use this method - its optional. +*/ +//::////////////////////////////////////////////// +//:: Created By: Q-Necron +//::////////////////////////////////////////////// +#include "x2_inc_switches" +#include "x2_inc_spellhook" + +//Belker +void SmokeClaw(object oTarget, int nDC, int nRounds); + +//Burn +void Burn(object oTarget, int nDamage); + +//Spawn Undead +void SpawnUndead(object oTarget, string sRESREF, location lDeadPC); + +//Drain Ability: +void NegativeAbility(object oTarget, int nAbility, int nDrain); + +//Drain Ability or Death: +void NegativeOrDeath(object oTarget, int nAbility, int nDrain, string sRESREF, int bSpawn); + +//Living Check +int GetIsLiving(object oTarget); + +void main() +{ + //Make sure it fires correctly. + if(GetUserDefinedItemEventNumber() == X2_ITEM_EVENT_ONHITCAST && + GetLocalInt(OBJECT_SELF, "SPECIAL_ATTACK") != 0) + { + object oTarget = GetAttemptedAttackTarget(); + int nAbility; + int nAppearance = GetAppearanceType(OBJECT_SELF); + int nCharisma = GetAbilityModifier(ABILITY_CHARISMA, OBJECT_SELF); + int nConstitution = GetAbilityModifier(ABILITY_CONSTITUTION, OBJECT_SELF); + int nDamage; + int nDC; + int nDrain; + int nHD = GetHitDice(OBJECT_SELF); + int nPower; + int nTempHP; + int nType; + int nSpecial = GetLocalInt(OBJECT_SELF, "SPECIAL_ATTACK"); + int bSave = TRUE; + int bSpawn = FALSE; + int bSpectre = FALSE; + int bStirge = FALSE; + int nStrength = GetAbilityModifier(ABILITY_STRENGTH, OBJECT_SELF); + int bTempHP = FALSE; + int bWight = FALSE; + effect eDamage; + effect eTempHP; + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + string sRESREF; + + //Determine special attack. + switch(nSpecial) + { + //Allip + case 1: + nAbility = ABILITY_WISDOM; + nDrain = d4(1); + bSave = FALSE; + bTempHP = TRUE; + nTempHP = 5; + break; + + //Cockatrice + case 2: + nDC = 10 + (nHD / 2) + nConstitution; + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_ALL, OBJECT_SELF) == 0) + { + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectPetrify(), oTarget, RoundsToSeconds(nHD * 2)); + } + return; + break; + + //Succubus + case 3: + if(GetIsLiving(oTarget) == FALSE){return;} + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectNegativeLevel(1), oTarget)); + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectConfused(), oTarget, RoundsToSeconds(12))); + return; + break; + + //Rake + case 4: + if(GetHasFeatEffect(FEAT_KNOCKDOWN, oTarget) == TRUE || + GetHasFeatEffect(FEAT_IMPROVED_KNOCKDOWN, oTarget) == TRUE) + { + //Determine creature appearance. + switch(nAppearance) + { + //Dire Tiger + case APPEARANCE_TYPE_CAT_CAT_DIRE: + nDamage = d4(2) + 4; + nType = DAMAGE_TYPE_SLASHING; + nPower = DAMAGE_POWER_NORMAL; + break; + + //Androsphinx + case APPEARANCE_TYPE_SPHINX: + nDamage = d4(2) + 3; + nType = DAMAGE_TYPE_SLASHING; + nPower = DAMAGE_POWER_NORMAL; + break; + + //Mountain Lion + case APPEARANCE_TYPE_CAT_COUGAR: + nDamage = d3(1) + 1; + nType = DAMAGE_TYPE_SLASHING; + nPower = DAMAGE_POWER_NORMAL; + break; + + //Lion + case APPEARANCE_TYPE_CAT_LION: + nDamage = d4(1) + 2; + nType = DAMAGE_TYPE_SLASHING; + nPower = DAMAGE_POWER_NORMAL; + break; + } + + //Set damage. + eDamage = EffectDamage(nDamage, nType, nPower); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); + } + return; + break; + + //Fire Elemental + case 5: + nDC = 10 + (nHD / 2) + nConstitution; + if(nHD <= 7){nDamage = d6(1);}//------------------ Medium + else if(nHD >= 8 && nHD <= 15){nDamage = d6(2);}// Large + else{nDamage = d8(2);}//-------------------------- Huge + //Reflex Save + if(ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_FIRE, OBJECT_SELF) == 0) + { + //Apply burn. + DelayCommand(3.0f, Burn(oTarget, nDamage)); + } + return; + break; + + //Water Elemental + case 6: + if(GetHasSpellEffect(SPELL_DARKFIRE, oTarget) == TRUE || + GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD, oTarget) == TRUE || + GetHasSpellEffect(SPELL_FLAME_WEAPON, oTarget) == TRUE && + d20(1) + nHD > 11 + GetHitDice(oTarget))//Dispel Check + { + object oLeft = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oTarget); + object oRight = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DISPEL); + itemproperty ipDamage = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGEBONUS_1d6); + itemproperty ipVis = ItemPropertyVisualEffect(ITEM_VISUAL_FIRE); + + //Elemental Shield + effect eEffect = GetFirstEffect(oTarget); + while(GetIsEffectValid(eEffect)) + { + if(GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD, oTarget) == TRUE) + { + RemoveEffect(oTarget, eEffect); + } + eEffect = GetNextEffect(oTarget); + } + + //Prevents stacking + IPRemoveMatchingItemProperties(oLeft, GetItemPropertyType(ipDamage), DURATION_TYPE_TEMPORARY); + IPRemoveMatchingItemProperties(oLeft, GetItemPropertyType(ipVis), DURATION_TYPE_TEMPORARY); + IPRemoveMatchingItemProperties(oRight, GetItemPropertyType(ipDamage), DURATION_TYPE_TEMPORARY); + IPRemoveMatchingItemProperties(oRight, GetItemPropertyType(ipVis), DURATION_TYPE_TEMPORARY); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + } + return; + break; + + //Ghoul, Ghast & Mohrg Paralysis + case 7: + nDC = 10 + (nHD / 2) + nCharisma; + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_ALL, OBJECT_SELF) == 0) + { + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oTarget, RoundsToSeconds(nHD * 2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PARALYZE_HOLD), oTarget, RoundsToSeconds(nHD * 2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PARALYZED), oTarget, RoundsToSeconds(nHD * 2)); + } + return; + break; + + //Trample + case 8: + nDC = 10 + (nHD / 2) + nStrength; +// if(!MySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC)) + if(ReflexSave(oTarget, nDC, SAVING_THROW_TYPE_ALL, OBJECT_SELF) == 0) + { + //Determine creature appearance. + switch(nAppearance) + { + case APPEARANCE_TYPE_GORGON: + nDamage = d8(1) + 7; + break; + + case APPEARANCE_TYPE_BEETLE_STAG: + nDamage = d8(2) + 3; + break; + } + + //Set damage. + eDamage = EffectDamage(nDamage, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); + + //Set Local Int + SetLocalInt(OBJECT_SELF, "SPECIAL_ATTACK", 0); + } + return; + break; + + //Rend + case 9: + if(d2(1) == 1) + { + //Determine creature appearance. + switch(nAppearance) + { + case APPEARANCE_TYPE_GREY_RENDER: + case APPEARANCE_TYPE_TROLL: + case APPEARANCE_TYPE_TROLL_CHIEFTAIN: + case APPEARANCE_TYPE_TROLL_SHAMAN: + nDamage = d6(2) + 9; + nType = DAMAGE_TYPE_SLASHING; + nPower = DAMAGE_POWER_NORMAL; + break; + } + + //Set damage. + eDamage = EffectDamage(nDamage, nType, nPower); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); + } + return; + break; + + //Gelatinous Cube + case 10: + nDC = 10 + (nHD / 2) + nConstitution; + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_ALL, OBJECT_SELF) == 0) + { + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oTarget, RoundsToSeconds(nHD * 2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PARALYZE_HOLD), oTarget, RoundsToSeconds(nHD * 2)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_GLOW_GREEN), oTarget, RoundsToSeconds(nHD * 2)); + } + return; + break; + + //Belker Claw + case 11: + nDC = 10 + (nHD / 2) + nConstitution; + //Smoke Claw + SmokeClaw(oTarget, nDC, d3(2)); + return; + break; + + //Shadow & Greater Shadow + case 12: + nAbility = ABILITY_STRENGTH; + nDC = 10 + (nHD / 2) + nCharisma; + bSave = FALSE; + bSpawn = TRUE; + sRESREF = "shadow01"; + //Determine creature appearance. + switch(nAppearance) + { + //1d6 Strength Drain + case APPEARANCE_TYPE_SHADOW: + nDrain = d6(1); + break; + + //1d8 Strength Drain + case APPEARANCE_TYPE_SHADOW_FIEND: + nDrain = d8(1); + break; + } + break; + + //Spectre + case 13: + nDC = 10 + (nHD / 2) + nCharisma; + bSpectre = TRUE; + bTempHP = TRUE; + nTempHP = 5; + break; + + //Stirge + case 14: + nAbility = ABILITY_CONSTITUTION; + nDrain = 1; + bStirge = TRUE; + bTempHP = TRUE; + nTempHP = 1; + eVis = EffectVisualEffect(VFX_IMP_HEAD_EVIL); + break; + + //Wight + case 15: + nDC = 10 + (nHD / 2) + nCharisma; + bWight = TRUE; + bTempHP = TRUE; + nTempHP = 5; + break; + + //Wraith + case 16: + nAbility = ABILITY_CONSTITUTION; + nDC = 10 + (nHD / 2) + nCharisma; + nDrain = d6(1); + bSpawn = TRUE; + sRESREF = "wraith01"; + bTempHP = TRUE; + nTempHP = 5; + break; + + //Dread Wraith + case 17: + nAbility = ABILITY_CONSTITUTION; + nDC = 10 + (nHD / 2) + nCharisma; + nDrain = d8(1); + bSpawn = TRUE; + sRESREF = "wraith01"; + bTempHP = TRUE; + nTempHP = 5; + break; + + //Icegaunt + case 18: + nAbility = ABILITY_CONSTITUTION; + nDC = 10 + (nHD / 2) + nCharisma; + nDrain = d4(1); + bTempHP = TRUE; + nTempHP = 5; + break; + + //Cinderspawn + case 19: + nAbility = ABILITY_CHARISMA; + nDC = 10 + (nHD / 2) + nCharisma; + nDrain = d6(1); + bTempHP = TRUE; + nTempHP = 5; + break; + + //Sword Wraith + case 20: + nAbility = ABILITY_STRENGTH; + nDrain = 1; + bSave = FALSE; + break; + + //Voidwraith + case 21: + nAbility = ABILITY_CONSTITUTION; + nDC = 10 + (nHD / 2) + nCharisma; + nDrain = d2(1); + bTempHP = TRUE; + nTempHP = 5; + break; + } + + //Constructs & Undead + if(GetIsLiving(oTarget) == FALSE){return;} + + //Bone Ring + if(GetTag(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oTarget)) == "r_bone" || + GetTag(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oTarget)) == "r_bone") + { + //Priceless... + bSave = TRUE; + } + + //Spectre + if(bSpectre == TRUE) + { + nDrain = 2; + //Fotitude Save! + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) == 1){nDrain = 1;} + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectNegativeLevel(nDrain), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Does the touch grant temporary HP? + if(bTempHP == TRUE) + { + eTempHP = SupernaturalEffect(EffectTemporaryHitpoints(nTempHP)); + //Temporary HitPoints + if(GetCurrentHitPoints(OBJECT_SELF) < (GetMaxHitPoints(OBJECT_SELF) * 2)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTempHP, OBJECT_SELF); + } + } + return; + } + + //Stirge + if(bStirge == TRUE) + { + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, RoundsToSeconds(nHD))); + + //Does the touch grant temporary HP? + if(bTempHP == TRUE) + { + eTempHP = SupernaturalEffect(EffectTemporaryHitpoints(nTempHP)); + //Temporary HitPoints. + if(GetCurrentHitPoints(OBJECT_SELF) < (GetMaxHitPoints(OBJECT_SELF) * 2)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTempHP, OBJECT_SELF); + } + } + return; + } + + //Wight + if(bWight == TRUE) + { + //Fotitude Save! + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) == 0) + { + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectNegativeLevel(1), oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Does the touch grant temporary HP? + if(bTempHP == TRUE) + { + eTempHP = SupernaturalEffect(EffectTemporaryHitpoints(nTempHP)); + //Temporary HitPoints + if(GetCurrentHitPoints(OBJECT_SELF) < (GetMaxHitPoints(OBJECT_SELF) * 2)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTempHP, OBJECT_SELF); + } + } + } + return; + } + + //Aw no save... + if(bSave == FALSE) + { + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(0.1, NegativeOrDeath(oTarget, nAbility, nDrain, sRESREF, bSpawn)); + + //Does the touch grant temporary HP? + if(bTempHP == TRUE) + { + eTempHP = SupernaturalEffect(EffectTemporaryHitpoints(nTempHP)); + //Temporary HitPoints. + if(GetCurrentHitPoints(OBJECT_SELF) < (GetMaxHitPoints(OBJECT_SELF) * 2)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTempHP, OBJECT_SELF); + } + } + } + //Save. + else + { + //Fotitude Save! + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_NEGATIVE) == 0) + { + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); + DelayCommand(0.1, NegativeOrDeath(oTarget, nAbility, nDrain, sRESREF, bSpawn)); + + //Does the touch grant temporary HP? + if(bTempHP == TRUE) + { + eTempHP = SupernaturalEffect(EffectTemporaryHitpoints(nTempHP)); + //Temporary HitPoints + if(GetCurrentHitPoints(OBJECT_SELF) < (GetMaxHitPoints(OBJECT_SELF) * 2)) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTempHP, OBJECT_SELF); + } + } + } + } + } +} + +//------------------------------------------------------------------------------ +// Burn +//------------------------------------------------------------------------------ +void Burn(object oTarget, int nDamage) +{ + effect eBurn = EffectDamage(nDamage, DAMAGE_TYPE_FIRE); + effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBurn, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); +} + +//------------------------------------------------------------------------------ +// Spawn Undead +//------------------------------------------------------------------------------ +void SpawnUndead(object oTarget, string sRESREF, location lDeadPC) +{ + //Is the PC still dead? + if(GetIsDead(oTarget) == TRUE) + { + //Create undead. + CreateObject(OBJECT_TYPE_CREATURE, sRESREF, lDeadPC); + } + else + { + //Set Local Int + SetLocalInt(OBJECT_SELF, "DO_ONCE", 0); + } +} + +//------------------------------------------------------------------------------ +// Drain Ability: +//------------------------------------------------------------------------------ +void NegativeAbility(object oTarget, int nAbility, int nDrain) +{ + //Ablity Drain. + effect eDrain = EffectAbilityDecrease(nAbility, nDrain); + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget); +} + +//------------------------------------------------------------------------------ +// Drain Ability or Death: +//------------------------------------------------------------------------------ +void NegativeOrDeath(object oTarget, int nAbility, int nDrain, string sRESREF, int bSpawn) +{ + //Get PC's ability. + int nAbilityScore = GetAbilityScore(oTarget, nAbility); + + //Current ability vs drain. + if(nAbilityScore - nDrain <= 0 && GetIsPC(oTarget) == TRUE) + { + effect eDeath = EffectDeath(); + location lDeadPC = GetLocation(oTarget); + + //Apply effects + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDeath, oTarget); + + //Get the killers RESREF and spawn another of its type. + if(bSpawn == TRUE && GetLocalInt(OBJECT_SELF, "DO_ONCE") != 1) + { + DelayCommand(RoundsToSeconds(d3(2)), SpawnUndead(oTarget, sRESREF, lDeadPC)); + + //Set Local Int + SetLocalInt(OBJECT_SELF, "DO_ONCE", 1); + } + } + else + { + //Ability Drain. + DelayCommand(0.1, NegativeAbility(oTarget, nAbility, nDrain)); + } +} + +//------------------------------------------------------------------------------ +// Living Check +//------------------------------------------------------------------------------ +int GetIsLiving(object oTarget) +{ + int bAlive; + + //Constructs & Undead + if(GetRacialType(oTarget) == RACIAL_TYPE_CONSTRUCT || + GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD) + { + return bAlive = FALSE; + } + else + { + return bAlive = TRUE; + } +} + +//------------------------------------------------------------------------------ +// Smoke Claw +//------------------------------------------------------------------------------ +void SmokeClaw(object oTarget, int nDC, int nRounds) +{ + //Fortitude Save + if(FortitudeSave(oTarget, nDC, SAVING_THROW_TYPE_ALL, OBJECT_SELF) == 0) + { + nRounds--; + effect eDamage = EffectDamage(d4(3)); + effect eVis = EffectVisualEffect(VFX_IMP_SILENCE); + + //Apply effects. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); + + //Smoke Claw + if(nRounds != 0) + { + SmokeClaw(oTarget, nDC, nRounds); + } + } +} diff --git a/nwnds_module/qst_ancientstat.uti b/nwnds_module/qst_ancientstat.uti new file mode 100644 index 000000000..e813222f5 Binary files /dev/null and b/nwnds_module/qst_ancientstat.uti differ diff --git a/nwnds_module/qst_arrowcrate.uti b/nwnds_module/qst_arrowcrate.uti new file mode 100644 index 000000000..c558b9ae6 Binary files /dev/null and b/nwnds_module/qst_arrowcrate.uti differ diff --git a/nwnds_module/qst_ashendrblood.uti b/nwnds_module/qst_ashendrblood.uti new file mode 100644 index 000000000..f261374d4 Binary files /dev/null and b/nwnds_module/qst_ashendrblood.uti differ diff --git a/nwnds_module/qst_balicislemap.uti b/nwnds_module/qst_balicislemap.uti new file mode 100644 index 000000000..379c6e6d1 Binary files /dev/null and b/nwnds_module/qst_balicislemap.uti differ diff --git a/nwnds_module/qst_balictckt.uti b/nwnds_module/qst_balictckt.uti new file mode 100644 index 000000000..c11f23179 Binary files /dev/null and b/nwnds_module/qst_balictckt.uti differ diff --git a/nwnds_module/qst_banditheart.uti b/nwnds_module/qst_banditheart.uti new file mode 100644 index 000000000..e56ae1656 Binary files /dev/null and b/nwnds_module/qst_banditheart.uti differ diff --git a/nwnds_module/qst_bluelotus.uti b/nwnds_module/qst_bluelotus.uti new file mode 100644 index 000000000..8e516a72a Binary files /dev/null and b/nwnds_module/qst_bluelotus.uti differ diff --git a/nwnds_module/qst_caravansup.uti b/nwnds_module/qst_caravansup.uti new file mode 100644 index 000000000..ce5dcafb2 Binary files /dev/null and b/nwnds_module/qst_caravansup.uti differ diff --git a/nwnds_module/qst_clckwrkmap.uti b/nwnds_module/qst_clckwrkmap.uti new file mode 100644 index 000000000..b48be6e82 Binary files /dev/null and b/nwnds_module/qst_clckwrkmap.uti differ diff --git a/nwnds_module/qst_clckwrkscrl.uti b/nwnds_module/qst_clckwrkscrl.uti new file mode 100644 index 000000000..e9c9e0050 Binary files /dev/null and b/nwnds_module/qst_clckwrkscrl.uti differ diff --git a/nwnds_module/qst_clockwrktckt.uti b/nwnds_module/qst_clockwrktckt.uti new file mode 100644 index 000000000..4dad317b5 Binary files /dev/null and b/nwnds_module/qst_clockwrktckt.uti differ diff --git a/nwnds_module/qst_cloie.uti b/nwnds_module/qst_cloie.uti new file mode 100644 index 000000000..5c6fc07f3 Binary files /dev/null and b/nwnds_module/qst_cloie.uti differ diff --git a/nwnds_module/qst_cromlintckt.uti b/nwnds_module/qst_cromlintckt.uti new file mode 100644 index 000000000..8aa9b4c9c Binary files /dev/null and b/nwnds_module/qst_cromlintckt.uti differ diff --git a/nwnds_module/qst_driedfish.uti b/nwnds_module/qst_driedfish.uti new file mode 100644 index 000000000..b4acb613a Binary files /dev/null and b/nwnds_module/qst_driedfish.uti differ diff --git a/nwnds_module/qst_ear_halfling.uti b/nwnds_module/qst_ear_halfling.uti new file mode 100644 index 000000000..fdf8bea83 Binary files /dev/null and b/nwnds_module/qst_ear_halfling.uti differ diff --git a/nwnds_module/qst_ear_matthias.uti b/nwnds_module/qst_ear_matthias.uti new file mode 100644 index 000000000..182dda573 Binary files /dev/null and b/nwnds_module/qst_ear_matthias.uti differ diff --git a/nwnds_module/qst_ear_templar.uti b/nwnds_module/qst_ear_templar.uti new file mode 100644 index 000000000..5969cfa19 Binary files /dev/null and b/nwnds_module/qst_ear_templar.uti differ diff --git a/nwnds_module/qst_earthrelic.uti b/nwnds_module/qst_earthrelic.uti new file mode 100644 index 000000000..d319be203 Binary files /dev/null and b/nwnds_module/qst_earthrelic.uti differ diff --git a/nwnds_module/qst_elixirhealth.uti b/nwnds_module/qst_elixirhealth.uti new file mode 100644 index 000000000..19423edfd Binary files /dev/null and b/nwnds_module/qst_elixirhealth.uti differ diff --git a/nwnds_module/qst_esutacharm.uti b/nwnds_module/qst_esutacharm.uti new file mode 100644 index 000000000..a367a7580 Binary files /dev/null and b/nwnds_module/qst_esutacharm.uti differ diff --git a/nwnds_module/qst_esutasymbol.uti b/nwnds_module/qst_esutasymbol.uti new file mode 100644 index 000000000..e73c83fd1 Binary files /dev/null and b/nwnds_module/qst_esutasymbol.uti differ diff --git a/nwnds_module/qst_farrauksoul.uti b/nwnds_module/qst_farrauksoul.uti new file mode 100644 index 000000000..ed0bd9e84 Binary files /dev/null and b/nwnds_module/qst_farrauksoul.uti differ diff --git a/nwnds_module/qst_gearysbrace.uti b/nwnds_module/qst_gearysbrace.uti new file mode 100644 index 000000000..826aaba9e Binary files /dev/null and b/nwnds_module/qst_gearysbrace.uti differ diff --git a/nwnds_module/qst_githchfhead.uti b/nwnds_module/qst_githchfhead.uti new file mode 100644 index 000000000..c5c305b04 Binary files /dev/null and b/nwnds_module/qst_githchfhead.uti differ diff --git a/nwnds_module/qst_glassphere.uti b/nwnds_module/qst_glassphere.uti new file mode 100644 index 000000000..cc9156813 Binary files /dev/null and b/nwnds_module/qst_glassphere.uti differ diff --git a/nwnds_module/qst_goldenkey1.uti b/nwnds_module/qst_goldenkey1.uti new file mode 100644 index 000000000..d0116ee9f Binary files /dev/null and b/nwnds_module/qst_goldenkey1.uti differ diff --git a/nwnds_module/qst_goldenkey2.uti b/nwnds_module/qst_goldenkey2.uti new file mode 100644 index 000000000..0e707e12f Binary files /dev/null and b/nwnds_module/qst_goldenkey2.uti differ diff --git a/nwnds_module/qst_goldenkey3.uti b/nwnds_module/qst_goldenkey3.uti new file mode 100644 index 000000000..389056e88 Binary files /dev/null and b/nwnds_module/qst_goldenkey3.uti differ diff --git a/nwnds_module/qst_helm_martosa.uti b/nwnds_module/qst_helm_martosa.uti new file mode 100644 index 000000000..35848614a Binary files /dev/null and b/nwnds_module/qst_helm_martosa.uti differ diff --git a/nwnds_module/qst_highbureau01.uti b/nwnds_module/qst_highbureau01.uti new file mode 100644 index 000000000..3e0f5052f Binary files /dev/null and b/nwnds_module/qst_highbureau01.uti differ diff --git a/nwnds_module/qst_historytyr1.uti b/nwnds_module/qst_historytyr1.uti new file mode 100644 index 000000000..fc006e5e9 Binary files /dev/null and b/nwnds_module/qst_historytyr1.uti differ diff --git a/nwnds_module/qst_historytyr2.uti b/nwnds_module/qst_historytyr2.uti new file mode 100644 index 000000000..966fc4d5a Binary files /dev/null and b/nwnds_module/qst_historytyr2.uti differ diff --git a/nwnds_module/qst_huntpamphlet.uti b/nwnds_module/qst_huntpamphlet.uti new file mode 100644 index 000000000..0c4b393d0 Binary files /dev/null and b/nwnds_module/qst_huntpamphlet.uti differ diff --git a/nwnds_module/qst_itbk_clkwrk1.uti b/nwnds_module/qst_itbk_clkwrk1.uti new file mode 100644 index 000000000..5f549e3b0 Binary files /dev/null and b/nwnds_module/qst_itbk_clkwrk1.uti differ diff --git a/nwnds_module/qst_itbk_clkwrk2.uti b/nwnds_module/qst_itbk_clkwrk2.uti new file mode 100644 index 000000000..ea018e4e3 Binary files /dev/null and b/nwnds_module/qst_itbk_clkwrk2.uti differ diff --git a/nwnds_module/qst_itbk_fortome.uti b/nwnds_module/qst_itbk_fortome.uti new file mode 100644 index 000000000..f12e2e9fb Binary files /dev/null and b/nwnds_module/qst_itbk_fortome.uti differ diff --git a/nwnds_module/qst_itbk_jaryx.uti b/nwnds_module/qst_itbk_jaryx.uti new file mode 100644 index 000000000..ce9b8d8c8 Binary files /dev/null and b/nwnds_module/qst_itbk_jaryx.uti differ diff --git a/nwnds_module/qst_itbk_lastsea.uti b/nwnds_module/qst_itbk_lastsea.uti new file mode 100644 index 000000000..3d6e5a062 Binary files /dev/null and b/nwnds_module/qst_itbk_lastsea.uti differ diff --git a/nwnds_module/qst_itblt_kings.uti b/nwnds_module/qst_itblt_kings.uti new file mode 100644 index 000000000..5b9e6941e Binary files /dev/null and b/nwnds_module/qst_itblt_kings.uti differ diff --git a/nwnds_module/qst_itmnck_brave.uti b/nwnds_module/qst_itmnck_brave.uti new file mode 100644 index 000000000..cd8422821 Binary files /dev/null and b/nwnds_module/qst_itmnck_brave.uti differ diff --git a/nwnds_module/qst_itmnck_fierc.uti b/nwnds_module/qst_itmnck_fierc.uti new file mode 100644 index 000000000..58f4727d3 Binary files /dev/null and b/nwnds_module/qst_itmnck_fierc.uti differ diff --git a/nwnds_module/qst_itmnck_wise.uti b/nwnds_module/qst_itmnck_wise.uti new file mode 100644 index 000000000..7d63a6381 Binary files /dev/null and b/nwnds_module/qst_itmnck_wise.uti differ diff --git a/nwnds_module/qst_itnck_arist.uti b/nwnds_module/qst_itnck_arist.uti new file mode 100644 index 000000000..35a3189ba Binary files /dev/null and b/nwnds_module/qst_itnck_arist.uti differ diff --git a/nwnds_module/qst_itnck_clock1.uti b/nwnds_module/qst_itnck_clock1.uti new file mode 100644 index 000000000..6c672641a Binary files /dev/null and b/nwnds_module/qst_itnck_clock1.uti differ diff --git a/nwnds_module/qst_itnck_clock2.uti b/nwnds_module/qst_itnck_clock2.uti new file mode 100644 index 000000000..323d47a43 Binary files /dev/null and b/nwnds_module/qst_itnck_clock2.uti differ diff --git a/nwnds_module/qst_itnck_clock3.uti b/nwnds_module/qst_itnck_clock3.uti new file mode 100644 index 000000000..0407ee386 Binary files /dev/null and b/nwnds_module/qst_itnck_clock3.uti differ diff --git a/nwnds_module/qst_itnck_justl.uti b/nwnds_module/qst_itnck_justl.uti new file mode 100644 index 000000000..087e022df Binary files /dev/null and b/nwnds_module/qst_itnck_justl.uti differ diff --git a/nwnds_module/qst_itnck_mim.uti b/nwnds_module/qst_itnck_mim.uti new file mode 100644 index 000000000..4d2cb984f Binary files /dev/null and b/nwnds_module/qst_itnck_mim.uti differ diff --git a/nwnds_module/qst_kalakstear.uti b/nwnds_module/qst_kalakstear.uti new file mode 100644 index 000000000..de5104237 Binary files /dev/null and b/nwnds_module/qst_kalakstear.uti differ diff --git a/nwnds_module/qst_kankleash.uti b/nwnds_module/qst_kankleash.uti new file mode 100644 index 000000000..3bd29edce Binary files /dev/null and b/nwnds_module/qst_kankleash.uti differ diff --git a/nwnds_module/qst_larzbread.uti b/nwnds_module/qst_larzbread.uti new file mode 100644 index 000000000..536a00dd0 Binary files /dev/null and b/nwnds_module/qst_larzbread.uti differ diff --git a/nwnds_module/qst_laskchfhead.uti b/nwnds_module/qst_laskchfhead.uti new file mode 100644 index 000000000..a13b76f56 Binary files /dev/null and b/nwnds_module/qst_laskchfhead.uti differ diff --git a/nwnds_module/qst_lg_sapphire.uti b/nwnds_module/qst_lg_sapphire.uti new file mode 100644 index 000000000..2de63a559 Binary files /dev/null and b/nwnds_module/qst_lg_sapphire.uti differ diff --git a/nwnds_module/qst_meteoriteore.uti b/nwnds_module/qst_meteoriteore.uti new file mode 100644 index 000000000..b875df05c Binary files /dev/null and b/nwnds_module/qst_meteoriteore.uti differ diff --git a/nwnds_module/qst_mystsoul.uti b/nwnds_module/qst_mystsoul.uti new file mode 100644 index 000000000..d94e785a7 Binary files /dev/null and b/nwnds_module/qst_mystsoul.uti differ diff --git a/nwnds_module/qst_nadiewardstn.uti b/nwnds_module/qst_nadiewardstn.uti new file mode 100644 index 000000000..29db9fe2d Binary files /dev/null and b/nwnds_module/qst_nadiewardstn.uti differ diff --git a/nwnds_module/qst_obsorb02.uti b/nwnds_module/qst_obsorb02.uti new file mode 100644 index 000000000..b8b3b6d01 Binary files /dev/null and b/nwnds_module/qst_obsorb02.uti differ diff --git a/nwnds_module/qst_officialdocs.uti b/nwnds_module/qst_officialdocs.uti new file mode 100644 index 000000000..fa20152df Binary files /dev/null and b/nwnds_module/qst_officialdocs.uti differ diff --git a/nwnds_module/qst_oobsorb01.uti b/nwnds_module/qst_oobsorb01.uti new file mode 100644 index 000000000..e500d30ef Binary files /dev/null and b/nwnds_module/qst_oobsorb01.uti differ diff --git a/nwnds_module/qst_orbancients.uti b/nwnds_module/qst_orbancients.uti new file mode 100644 index 000000000..6ee14d50f Binary files /dev/null and b/nwnds_module/qst_orbancients.uti differ diff --git a/nwnds_module/qst_phoboshead.uti b/nwnds_module/qst_phoboshead.uti new file mode 100644 index 000000000..f5d5f8ead Binary files /dev/null and b/nwnds_module/qst_phoboshead.uti differ diff --git a/nwnds_module/qst_porteksoul.uti b/nwnds_module/qst_porteksoul.uti new file mode 100644 index 000000000..147d129b0 Binary files /dev/null and b/nwnds_module/qst_porteksoul.uti differ diff --git a/nwnds_module/qst_puzzlebox.uti b/nwnds_module/qst_puzzlebox.uti new file mode 100644 index 000000000..937336386 Binary files /dev/null and b/nwnds_module/qst_puzzlebox.uti differ diff --git a/nwnds_module/qst_queensack.uti b/nwnds_module/qst_queensack.uti new file mode 100644 index 000000000..15be07acc Binary files /dev/null and b/nwnds_module/qst_queensack.uti differ diff --git a/nwnds_module/qst_queensvenom.uti b/nwnds_module/qst_queensvenom.uti new file mode 100644 index 000000000..505d19489 Binary files /dev/null and b/nwnds_module/qst_queensvenom.uti differ diff --git a/nwnds_module/qst_redkankwine.uti b/nwnds_module/qst_redkankwine.uti new file mode 100644 index 000000000..e04e86786 Binary files /dev/null and b/nwnds_module/qst_redkankwine.uti differ diff --git a/nwnds_module/qst_scrlbinding.uti b/nwnds_module/qst_scrlbinding.uti new file mode 100644 index 000000000..5c1d1bd70 Binary files /dev/null and b/nwnds_module/qst_scrlbinding.uti differ diff --git a/nwnds_module/qst_sealeddocs.uti b/nwnds_module/qst_sealeddocs.uti new file mode 100644 index 000000000..7e3d3b9d0 Binary files /dev/null and b/nwnds_module/qst_sealeddocs.uti differ diff --git a/nwnds_module/qst_selenepack.uti b/nwnds_module/qst_selenepack.uti new file mode 100644 index 000000000..e3b838446 Binary files /dev/null and b/nwnds_module/qst_selenepack.uti differ diff --git a/nwnds_module/qst_shademessage.uti b/nwnds_module/qst_shademessage.uti new file mode 100644 index 000000000..f3ec5e9fd Binary files /dev/null and b/nwnds_module/qst_shademessage.uti differ diff --git a/nwnds_module/qst_shomloot.uti b/nwnds_module/qst_shomloot.uti new file mode 100644 index 000000000..2bf2b7f2c Binary files /dev/null and b/nwnds_module/qst_shomloot.uti differ diff --git a/nwnds_module/qst_silvrchalice.uti b/nwnds_module/qst_silvrchalice.uti new file mode 100644 index 000000000..b3446e036 Binary files /dev/null and b/nwnds_module/qst_silvrchalice.uti differ diff --git a/nwnds_module/qst_smithhammer.uti b/nwnds_module/qst_smithhammer.uti new file mode 100644 index 000000000..220e1c6d4 Binary files /dev/null and b/nwnds_module/qst_smithhammer.uti differ diff --git a/nwnds_module/qst_stoleniron.uti b/nwnds_module/qst_stoleniron.uti new file mode 100644 index 000000000..888b7ffb7 Binary files /dev/null and b/nwnds_module/qst_stoleniron.uti differ diff --git a/nwnds_module/qst_urikdocs.uti b/nwnds_module/qst_urikdocs.uti new file mode 100644 index 000000000..ae99137ef Binary files /dev/null and b/nwnds_module/qst_urikdocs.uti differ diff --git a/nwnds_module/qst_vaspellbook.uti b/nwnds_module/qst_vaspellbook.uti new file mode 100644 index 000000000..a0345259f Binary files /dev/null and b/nwnds_module/qst_vaspellbook.uti differ diff --git a/nwnds_module/qst_wrixwardstn.uti b/nwnds_module/qst_wrixwardstn.uti new file mode 100644 index 000000000..4dd27838f Binary files /dev/null and b/nwnds_module/qst_wrixwardstn.uti differ diff --git a/nwnds_module/qst_wswgs_krill.uti b/nwnds_module/qst_wswgs_krill.uti new file mode 100644 index 000000000..7b3f2b35f Binary files /dev/null and b/nwnds_module/qst_wswgs_krill.uti differ diff --git a/nwnds_module/qst_yehinadocs.uti b/nwnds_module/qst_yehinadocs.uti new file mode 100644 index 000000000..caf78971b Binary files /dev/null and b/nwnds_module/qst_yehinadocs.uti differ diff --git a/nwnds_module/raaig_touch.ncs b/nwnds_module/raaig_touch.ncs new file mode 100644 index 000000000..b15c2ad3c Binary files /dev/null and b/nwnds_module/raaig_touch.ncs differ diff --git a/nwnds_module/raaig_touch.nss b/nwnds_module/raaig_touch.nss new file mode 100644 index 000000000..5cb8e7b68 --- /dev/null +++ b/nwnds_module/raaig_touch.nss @@ -0,0 +1,55 @@ +//:: +//:: A pnp version of the Raaig's diseased touch. +//:: +//:: 50/50 chance to do either Red Ache or Filth Fever OnHit +//:: +//:: Modified by: DM Heatstroke 01-07-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +const int DISEASE_CONTAGION_FILTH_FEVER = 22; +const int DISEASE_CONTAGION_RED_ACHE = 24; + +void DoDisease(object oTarget, object oCaster) +{ // Get Ability Damage + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + int nRandom = d2(); + effect eDisease = EffectDisease(DISEASE_CONTAGION_FILTH_FEVER); + + if (nRandom == 1) + { + effect eDisease = EffectDisease(DISEASE_CONTAGION_RED_ACHE); + //SpeakString("Switched to Red Ache - Silent Shout", TALKVOLUME_SILENT_SHOUT); + //SpeakString("Switched to Red Ache", TALKVOLUME_TALK); + } + + + // Get oCaster's Touch DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nDiseaseDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nDiseaseDC, SAVING_THROW_TYPE_DISEASE, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisease, oTarget); + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE) ) + { + SendMessageToPC(oTarget,"Immune to disease."); + return; + } + + DelayCommand(0.1,DoDisease(oTarget,oCaster)); + +} diff --git a/nwnds_module/raaigclaw001.uti b/nwnds_module/raaigclaw001.uti new file mode 100644 index 000000000..f4b1ed630 Binary files /dev/null and b/nwnds_module/raaigclaw001.uti differ diff --git a/nwnds_module/race_skin.ncs b/nwnds_module/race_skin.ncs new file mode 100644 index 000000000..0d5f82a7c Binary files /dev/null and b/nwnds_module/race_skin.ncs differ diff --git a/nwnds_module/race_skin.nss b/nwnds_module/race_skin.nss new file mode 100644 index 000000000..4517492f1 --- /dev/null +++ b/nwnds_module/race_skin.nss @@ -0,0 +1,1226 @@ +// race_skin +// Handle skin and other mods for races. +// This file is where various content users can customize races. + +#include "prc_inc_natweap" +#include "inc_dynconv" +//#include "inc_nwnx_funcs" +#include "moi_inc_moifunc" + +void main() +{ + object oPC = OBJECT_SELF; + object oSkin = GetPCSkin(oPC); + int bFuncs = GetPRCSwitch(PRC_NWNX_FUNCS); + itemproperty ipIP; + + SetCompositeBonus(oSkin, "DieDieDie_Taunt", 50, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER, SKILL_TAUNT); + SetCompositeBonus(oSkin, "DieDieDie_Parry", 50, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER, SKILL_PARRY); + int nTumble = GetSkillRank(SKILL_TUMBLE, oPC, TRUE); + int nSpellCraft = GetSkillRank(SKILL_SPELLCRAFT, oPC); + if (nTumble >= 5) + { + int nPen = nTumble/5; + SetCompositeBonus(oSkin, "TumbleCheat", nPen, ITEM_PROPERTY_DECREASED_AC, IP_CONST_ACMODIFIERTYPE_DODGE); + } + if (nSpellCraft >= 5) + { + int nPen = nSpellCraft/5; + SetCompositeBonus(oSkin, "SpellcraftCheat_F", nPen, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_FORTITUDE); + SetCompositeBonus(oSkin, "SpellcraftCheat_W", nPen, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_WILL); + SetCompositeBonus(oSkin, "SpellcraftCheat_R", nPen, ITEM_PROPERTY_DECREASED_SAVING_THROWS, IP_CONST_SAVEBASETYPE_REFLEX); + //ApplyEffectToObject(DURATION_TYPE_PERMANENT, ExtraordinaryEffect(EffectSavingThrowDecrease(SAVING_THROW_ALL, nPen, SAVING_THROW_TYPE_SPELL)), oPC); + } + + //immunity to cold + if(GetHasFeat(FEAT_IMM_COLD)) + { + ipIP =ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_COLD,IP_CONST_DAMAGEIMMUNITY_100_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to acid + if(GetHasFeat(FEAT_IMMUNE_ACID)) + { + ipIP =ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGEIMMUNITY_100_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to electricity + if(GetHasFeat(FEAT_IMMUNE_ELECTRICITY)) + { + ipIP =ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_ELECTRICAL,IP_CONST_DAMAGEIMMUNITY_100_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to phantasms + //only immunity to wierd and phatasmal killer + if(GetHasFeat(FEAT_IMM_PHANT)) + { + ipIP = ItemPropertySpellImmunitySpecific(SPELL_WEIRD); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_PHANTASMAL_KILLER); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to detection. NEEDS TESTING!!! +//tested and doesnt work (means you cant cast these on yourself) +//removed untill a solution is found + if(GetHasFeat(FEAT_NONDETECTION)) + { +/* + ipIP = ItemPropertySpellImmunitySpecific(SPELL_SEE_INVISIBILITY); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_TRUE_SEEING); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_DARKVISION); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); +*/ + } + + //immunity to artificial poisons + //replaced with immunity to all poisons + if(GetHasFeat(FEAT_IMM_APOI)) + { + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to disease + if(GetHasFeat(FEAT_IMMUNE_DISEASE)) + { + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DISEASE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //improved fortification - immunity to critical hits + if(GetHasFeat(FEAT_IMPROVED_FORTIFICATION)) + { + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //Plant racial type immunities - sleep, paralysis, poison, mind-affecting, criticals + if(GetHasFeat(FEAT_PLANT_IMM)) + { + //effect eSleepImmune = ExtraordinaryEffect(EffectImmunity(IMMUNITY_TYPE_SLEEP)); + //AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSleepImmune, oPC)); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_MINDSPELLS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_CRITICAL_HITS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //Living Construct type immunities - sleep, paralysis, poison, disease, energy drain + if(GetHasFeat(FEAT_LIVING_CONSTRUCT)) + { + //effect eSleepImmune = ExtraordinaryEffect(EffectImmunity(IMMUNITY_TYPE_SLEEP)); + //AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSleepImmune, oPC)); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_PARALYSIS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_POISON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_DISEASE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + + ipIP =ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //natural armor 1-10 + // Note: This bonus will be Dodge bonus no matter what IP_CONST you specify. + int nAC; + if(GetHasFeat(FEAT_NATARM_19)) nAC = 19; + else if(GetHasFeat(FEAT_NATARM_18)) nAC = 18; + else if(GetHasFeat(FEAT_NATARM_17)) nAC = 17; + else if(GetHasFeat(FEAT_NATARM_16)) nAC = 16; + else if(GetHasFeat(FEAT_NATARM_15)) nAC = 15; + else if(GetHasFeat(FEAT_NATARM_14)) nAC = 14; + else if(GetHasFeat(FEAT_NATARM_13)) nAC = 13; + else if(GetHasFeat(FEAT_NATARM_12)) nAC = 12; + else if(GetHasFeat(FEAT_NATARM_11)) nAC = 11; + else if(GetHasFeat(FEAT_NATARM_10)) nAC = 10; + else if(GetHasFeat(FEAT_NATARM_9)) nAC = 9; + else if(GetHasFeat(FEAT_NATARM_8)) nAC = 8; + else if(GetHasFeat(FEAT_NATARM_7)) nAC = 7; + else if(GetHasFeat(FEAT_NATARM_6)) nAC = 6; + else if(GetHasFeat(FEAT_NATARM_5)) nAC = 5; + else if(GetHasFeat(FEAT_NATARM_4)) nAC = 4; + else if(GetHasFeat(FEAT_NATARM_3)) nAC = 3; + else if(GetHasFeat(FEAT_NATARM_2)) nAC = 2; + else if(GetHasFeat(FEAT_NATARM_1)) nAC = 1; + + if(nAC) SetCompositeBonus(oSkin, "RacialNaturalArmor", nAC, ITEM_PROPERTY_AC_BONUS); + + + //immunity to breathing-targetted spells + if(GetHasFeat(FEAT_BREATHLESS)) + { + ipIP = ItemPropertySpellImmunitySpecific(SPELL_DROWN); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_MASS_DROWN); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_CLOUDKILL); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_ACID_FOG); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_STINKING_CLOUD); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to charm + if(GetHasFeat(FEAT_IMMUNE_CHARM) || GetRacialType(OBJECT_SELF) == RACIAL_TYPE_DOPPELGANGER) + { + ipIP = ItemPropertySpellImmunitySpecific(SPELL_CHARM_PERSON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_CHARM_MONSTER); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_CHARM_PERSON_OR_ANIMAL); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to confusion + if(GetHasFeat(FEAT_IMMUNE_CONFUSION)) + { + ipIP = ItemPropertySpellImmunitySpecific(SPELL_CONFUSION); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //immunity to drowning + //water gensasi and aquatic elves can breath water, so can some Spirit Folk + if(GetHasFeat(FEAT_WATER_BREATHING) || GetHasFeat(FEAT_BONUS_RIVER) || GetHasFeat(FEAT_BONUS_SEA)) + { + ipIP = ItemPropertySpellImmunitySpecific(SPELL_DROWN); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP = ItemPropertySpellImmunitySpecific(SPELL_MASS_DROWN ); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //Bamboo Spirit Folk Bonuses + if(GetHasFeat(FEAT_BONUS_BAMBOO)) + { + ipIP = ItemPropertyBonusFeat(IP_CONST_FEAT_TRACKLESS_STEP); + if(bFuncs && !PRC_Funcs_GetFeatKnown(oPC, FEAT_TRACKLESS_STEP)) + PRC_Funcs_AddFeat(oPC, FEAT_TRACKLESS_STEP); + else + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + SetCompositeBonus(oSkin, "Bamboo_Spirit_Lore", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + //Mountain Spirit Folk Bonuses + if(GetHasFeat(FEAT_BONUS_MOUNTAIN)) + { + SetCompositeBonus(oSkin, "SpiritFolk_Climb", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + SetCompositeBonus(oSkin, "SpiritFolk_Balance", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_BALANCE); + SetCompositeBonus(oSkin, "SpiritFolk_Jump", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_JUMP); + SetCompositeBonus(oSkin, "SpiritFolk_Tumble", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_TUMBLE); + } + + //Azer Heat Damage +1 (armed and unarmed) + if (GetHasFeat(FEAT_AZER_HEAT, oPC)) + { + if (GetLocalInt(oPC, "ONEQUIP") == 1) + { + object oItem = GetItemLastUnequipped(); + SetCompositeDamageBonusT(oItem, "AzerFlameDamage", 0, IP_CONST_DAMAGETYPE_FIRE); + } + else + { + ExecuteScript("race_azer_flame", oPC); + } + } +/* Bioware reads size based on appearance + //-1AC, -1 ATT, -4hide + if(GetHasFeat(FEAT_LARGE)) + { + SetCompositeBonus(oSkin, "RacialSize_AC", 1, ITEM_PROPERTY_DECREASED_AC); + SetCompositeBonus(oSkin, "RacialSize_Attack", 1, ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER); + SetCompositeBonus(oSkin, "RacialSize_SkillHide", 4, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER, SKILL_HIDE); + } + + //-2AC, -2 ATT, -8hide + else if(GetHasFeat(FEAT_HUGE)) + { + SetCompositeBonus(oSkin, "RacialSize_AC", 2, ITEM_PROPERTY_DECREASED_AC); + SetCompositeBonus(oSkin, "RacialSize_Attack", 2, ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER); + SetCompositeBonus(oSkin, "RacialSize_SkillHide", 8, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER, SKILL_HIDE); + } + + //+2AC, +2 ATT, +8hide + else if(GetHasFeat(FEAT_TINY)) + { + SetCompositeBonus(oSkin, "RacialSize_AC", 2, ITEM_PROPERTY_AC_BONUS); + SetCompositeBonus(oSkin, "RacialSize_Attack", 2, ITEM_PROPERTY_ATTACK_BONUS); + SetCompositeBonus(oSkin, "RacialSize_SkillHide", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } +*/ + //regeneration 5PH/round + if(GetHasFeat(FEAT_REGEN5)) + { + SetCompositeBonus(oSkin, "RacialRegeneration_5", 5, ITEM_PROPERTY_REGENERATION); + } + + if(GetHasFeat(FEAT_UNEARTHLY_GRACE)) + { + int nGrace = GetAbilityModifier(ABILITY_CHARISMA, oPC); + SetCompositeBonus(oSkin, "UnearthlyGraceAC", nGrace, ITEM_PROPERTY_AC_BONUS); + SetCompositeBonus(oSkin, "UnearthlyGraceSave", nGrace, ITEM_PROPERTY_SAVING_THROW_BONUS, SAVING_THROW_ALL); + } + if(GetRacialType(oPC) == RACIAL_TYPE_TAREK) // NWN Dark Sun + { + SetCompositeBonus(oSkin, "Tarek_Intim", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_INTIMIDATE); + SetCompositeBonus(oSkin, "Tarek_Persuade", -2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE); + SetCompositeBonus(oSkin, "Tarek_Perform", -2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERFORM); + SetCompositeBonus(oSkin, "Tarek_Hide", -4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_AARAKOCRA) // NWN Dark Sun + { + SetCompositeBonus(oSkin, "Aarakocra_Spot", 6, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + } + if(GetRacialType(oPC) == RACIAL_TYPE_TARI) // NWN Dark Sun + { + SetCompositeBonus(oSkin, "Tari_Listen", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + SetCompositeBonus(oSkin, "Tari_Search", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_SEARCH); + SetCompositeBonus(oSkin, "Tari_Spot", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + SetCompositeBonus(oSkin, "Tari_Reflex", 2, ITEM_PROPERTY_SAVING_THROW_BONUS, SAVING_THROW_REFLEX); + } + if(GetRacialType(oPC) == RACIAL_TYPE_GITH) // NWN Dark Sun + { + SetCompositeBonus(oSkin, "Gith_Jump", 10, ITEM_PROPERTY_SKILL_BONUS, SKILL_JUMP); + SetCompositeBonus(oSkin, "Gith_Hide", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + SetCompositeBonus(oSkin, "Gith_MvSil", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + } + if(GetRacialType(oPC) == RACIAL_TYPE_KRINTH) + { + SetCompositeBonus(oSkin, "KrinthSave", 1, ITEM_PROPERTY_SAVING_THROW_BONUS, SAVING_THROW_ALL); + } + if(GetRacialType(oPC) == RACIAL_TYPE_HADOZEE) + { + SetCompositeBonus(oSkin, "Hadozee_Climb", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + SetCompositeBonus(oSkin, "Hadozee_Balance", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_BALANCE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_BHUKA) + { + SetCompositeBonus(oSkin, "Bhuka_Lore", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_SKARN) + { + SetCompositeBonus(oSkin, "Skarn_Climb", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + SetCompositeBonus(oSkin, "Skarn_Intim", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_INTIMIDATE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_FERAL_GARGUN) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_CHITINE) + { + SetCompositeBonus(oSkin, "Chitine_Climb", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + } + if(GetRacialType(oPC) == RACIAL_TYPE_TAER) + { + SetCompositeBonus(oSkin, "Taer_Climb", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + } + if(GetRacialType(oPC) == RACIAL_TYPE_RILKAN) + { + int nLore = 1 + GetShapedMeldsCount(oPC)/2; + SetCompositeBonus(oSkin, "Rilkan_Racial_Knowledge", nLore, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_NEANDERTHAL) + { + SetCompositeBonus(oSkin, "Neander_L", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + SetCompositeBonus(oSkin, "Neander_S", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + } + if(GetRacialType(oPC) == RACIAL_TYPE_ULDRA) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_5); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + SetCompositeBonus(oSkin, "Uldra_Lore", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_EXTAMINAAR) + { + SetCompositeBonus(oSkin, "Extaminaar_C", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + SetCompositeBonus(oSkin, "Extaminaar_T", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_TUMBLE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_SKULK) + { + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + int nArmorType = GetBaseAC(oItem); + //if not light armor, then remove racial bonuses + if(GetBaseAC(oItem) > 4) + { + SetCompositeBonus(oSkin, "Skulk_H", 0, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + SetCompositeBonus(oSkin, "Skulk_M", 0, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + } + else + { + SetCompositeBonus(oSkin, "Skulk_H", 15, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + SetCompositeBonus(oSkin, "Skulk_M", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + } + } + if(GetRacialType(oPC) == RACIAL_TYPE_DOPPELGANGER) + { + SetCompositeBonus(oSkin, "Doppel_B", 10, ITEM_PROPERTY_SKILL_BONUS, SKILL_BLUFF); + SetCompositeBonus(oSkin, "Doppel_SM", 8, ITEM_PROPERTY_SKILL_BONUS, SKILL_SENSE_MOTIVE); + SetCompositeBonus(oSkin, "Doppel_I", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_INTIMIDATE); + SetCompositeBonus(oSkin, "Doppel_P", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_MONGRELFOLK) + { + SetCompositeBonus(oSkin, "Mongrel_A", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_APPRAISE); + SetCompositeBonus(oSkin, "Mongrel_C", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_CLIMB); + SetCompositeBonus(oSkin, "Mongrel_J", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_JUMP); + SetCompositeBonus(oSkin, "Mongrel_L", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + SetCompositeBonus(oSkin, "Mongrel_MS",1, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + SetCompositeBonus(oSkin, "Mongrel_SR",1, ITEM_PROPERTY_SKILL_BONUS, SKILL_SEARCH); + SetCompositeBonus(oSkin, "Mongrel_SP",1, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + SetCompositeBonus(oSkin, "Mongrel_H", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + SetCompositeBonus(oSkin, "Mongrel_P", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_PICK_POCKET); + SetCompositeBonus(oSkin, "Mongrel_U", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_USE_MAGIC_DEVICE); + } + + + //fire resistance 5 + if(GetHasFeat(FEAT_RESIST_FIRE5)) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_5); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + if(GetRacialType(oPC) == RACIAL_TYPE_UNDERFOLK) + { + SetCompositeBonus(oSkin, "Under_S", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + } + + //fire resistance 10 + if(GetHasFeat(FEAT_RESIST_FIRE_10)) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_10); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //cold resistance 10 + if(GetHasFeat(FEAT_RESIST_COLD_10)) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_10); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + // Very Heroic, +2 to all saving throws + if(GetHasFeat(FEAT_VERYHEROIC)) + { + SetCompositeBonus(oSkin, "VeryHeroic", 2, ITEM_PROPERTY_SAVING_THROW_BONUS, SAVING_THROW_ALL); + } + + // Skill Affinity, +2 to jump + if(GetHasFeat(FEAT_SA_JUMP)) + { + SetCompositeBonus(oSkin, "SA_Jump", 2, ITEM_PROPERTY_SKILL_BONUS, 28); + } + + // Skill Affinity, +2 to bluff + if(GetHasFeat(FEAT_SA_BLUFF)) + { + SetCompositeBonus(oSkin, "SA_Bluff", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_BLUFF); + } + + // Improved Skill Affinity, +4 to bluff + if(GetHasFeat(FEAT_SA_BLUFF_4)) + { + SetCompositeBonus(oSkin, "SA_Bluff_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_BLUFF); + } + + // Skill Affinity, +2 to intimidate + if(GetHasFeat(FEAT_SA_INTIMIDATE)) + { + SetCompositeBonus(oSkin, "SA_Intimidate", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_INTIMIDATE); + } + + // Skill Affinity, +2 to balance + if(GetHasFeat(FEAT_SA_BALANCE)) + { + SetCompositeBonus(oSkin, "SA_Balance", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_BALANCE); + } + + // Skill Affinity, +4 to jump + if(GetHasFeat(FEAT_SA_JUMP_4)) + { + SetCompositeBonus(oSkin, "SA_Jump_4", 4, ITEM_PROPERTY_SKILL_BONUS, 28); + } + + // Leap, +5 to Jump + if(GetHasFeat(FEAT_LEAP)) + { + SetCompositeBonus(oSkin, "Leap", 5, ITEM_PROPERTY_SKILL_BONUS, 28); + } + + // Thri-Kreen Leap + if(GetHasFeat(1176)) // FEAT_KREEN_LEAP + { + SetCompositeBonus(oSkin, "TKLeap", 30, ITEM_PROPERTY_SKILL_BONUS, 28); + } + + // Skill Affinity, +4 to spot + if(GetHasFeat(FEAT_SA_SPOT_4)) + { + SetCompositeBonus(oSkin, "SA_Spot_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + } + + // Skill Affinity, +4 to spot + if(GetHasFeat(FEAT_KEEN_SIGHT)) + { + SetCompositeBonus(oSkin, "Keen_Sight", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + } + + // Skill Affinity, +4 to listen + if(GetHasFeat(FEAT_SA_LISTEN_4)) + { + SetCompositeBonus(oSkin, "SA_Listen_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + } + + // Skill Affinity, +4 to perform + if(GetHasFeat(FEAT_SA_PERFORM_4)) + { + SetCompositeBonus(oSkin, "SA_Perform_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERFORM); + } + + // Skill Affinity, +2 to perform + if(GetHasFeat(FEAT_SA_PERFORM)) + { + SetCompositeBonus(oSkin, "SA_Perform", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERFORM); + } + + // Skill Affinity, +2 to open locks + if(GetHasFeat(FEAT_SA_OPEN)) + { + SetCompositeBonus(oSkin, "SA_Open_Lock", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_OPEN_LOCK); + } + + // Skill Affinity, +2 to sleight of hand/Pickpocket + if(GetHasFeat(FEAT_SA_PICKPOCKET)) + { + SetCompositeBonus(oSkin, "SA_Pickpocket", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PICK_POCKET); + } + + + // Minotaur bonuses due to scent + if(GetHasFeat(FEAT_MINOT_SCENT)) + { + SetCompositeBonus(oSkin, "Minot_Scent_Spot", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + SetCompositeBonus(oSkin, "Minot_Scent_Search", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_SEARCH); + SetCompositeBonus(oSkin, "Minot_Scent_Listen", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + } + + // Kender Bonuses + if(GetHasFeat(FEAT_KENDERBLUFF)) + { + SetCompositeBonus(oSkin, "Kender_Bonus_Bluff", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_BLUFF); + } + + // -4 to concentration + if(GetHasFeat(FEAT_LACKOFFOCUS)) + { + SetCompositeBonus(oSkin, "LackofFocus", 4, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER, SKILL_CONCENTRATION); + } + + // Gully Dwarf Liabilities + if(GetHasFeat(FEAT_COWARDPITY)) + { + SetCompositeBonus(oSkin, "Gully_Trait_Persuade", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE); + SetCompositeBonus(oSkin, "Gully_Trait_Fear", 4, ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC, SPELL_FEAR); + } + + // Skill Affinity, +2 to move silently + if(GetHasFeat(FEAT_SA_MOVE)) + { + SetCompositeBonus(oSkin, "SA_Move", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + } + + // Skill Affinity, +4 to move silently + if(GetHasFeat(FEAT_SA_MOVE4)) + { + SetCompositeBonus(oSkin, "SA_Move_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_MOVE_SILENTLY); + } + + // Skill Affinity, +2 to craft armor + if(GetHasFeat(FEAT_SA_CRFTARM)) + { + SetCompositeBonus(oSkin, "SA_Craft_Armor", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_ARMOR); + } + + // Skill Affinity, +2 to craft weapon + if(GetHasFeat(FEAT_SA_CRFTWEAP)) + { + SetCompositeBonus(oSkin, "SA_Craft_Weapon", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_WEAPON); + } + + // Skill Affinity, +2 to craft trap + if(GetHasFeat(FEAT_SA_CRFTTRAP)) + { + SetCompositeBonus(oSkin, "SA_Craft_Trap", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_TRAP); + } + + // Skill Affinity, +2 to hide + if(GetHasFeat(FEAT_SA_HIDE)) + { + SetCompositeBonus(oSkin, "SA_Hide", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + + // Skill Affinity, +4 to hide + // for forest gnomes since they get +4 or +8 in the woods. + //also for Volodni, which only get hide bonuses in the forest + if(GetHasFeat(FEAT_SA_HIDEF)) + { + SetCompositeBonus(oSkin, "SA_Hide_Forest", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + + // Skill Affinity, +4 to hide + // for troglodytes since they get +4 or +8 underground. + if(GetHasFeat(FEAT_SA_HIDE_TROG)) + { + SetCompositeBonus(oSkin, "SA_Hide_UndrGrnd", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + + // Skill Affinity, +5 to hide + // for grigs, as they get +5 in the woods. + if(GetHasFeat(FEAT_SA_HIDEF_5)) + { + SetCompositeBonus(oSkin, "SA_Hide_Forest", 5, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + + + // Skill Affinity, +4 to hide + // for forest gnomes since they get +4 or +8 in the woods. + if(GetHasFeat(FEAT_SA_HIDE4)) + { + SetCompositeBonus(oSkin, "SA_Hide_4", 4, ITEM_PROPERTY_SKILL_BONUS, SKILL_HIDE); + } + + // Skill Affinity, +2 to appraise + // dwarves and deep halfings get racial +2 to appraise checks. + if(GetHasFeat(FEAT_SA_APPRAISE)) + { + SetCompositeBonus(oSkin, "SA_Appraise", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_APPRAISE); + } + + // Skill Affinity, +6 to animal empathy + if(GetHasFeat(FEAT_SA_ANIMAL_EMP_6)) + { + SetCompositeBonus(oSkin, "SA_AnimalEmpathy_6", 6, ITEM_PROPERTY_SKILL_BONUS, SKILL_ANIMAL_EMPATHY); + } + + // Skill Affinity, +2 to animal empathy + if(GetHasFeat(FEAT_SA_ANIMAL_EMP)) + { + SetCompositeBonus(oSkin, "SA_AnimalEmpathy_2", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_ANIMAL_EMPATHY); + } + + // Skill Affinity, +2 to persuade + if(GetHasFeat(FEAT_SA_PERSUADE)) + { + SetCompositeBonus(oSkin, "SA_Persuade", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE); + } + + // Skill Affinity, +2 to sense motive + if(GetHasFeat(FEAT_SA_SENSE_MOTIVE)) + { + SetCompositeBonus(oSkin, "SA_SenseMotive", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_SENSE_MOTIVE); + } + + // Skill Affinity, +2 to tumble + if(GetHasFeat(FEAT_SA_TUMBLE)) + { + SetCompositeBonus(oSkin, "SA_Tumble", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_TUMBLE); + } + + // PSA to Lore and Spellcraft + if(GetHasFeat(FEAT_PSA_LORESPELL)) + { + SetCompositeBonus(oSkin, "PSA_Lorespell_Lore", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + SetCompositeBonus(oSkin, "PSA_Lorespell_Spell", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPELLCRAFT); + } + + //+2 to save vs mind-affecting + if(GetHasFeat(FEAT_BONUS_MIND_2)) + { + ipIP = ItemPropertyBonusSavingThrowVsX(IP_CONST_SAVEVS_MINDAFFECTING, 2); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + // Skill Penalty, -2 to persuade + if(GetHasFeat(FEAT_MINUS_PERSUADE_2)) + { + SetCompositeBonus(oSkin, "Minus_Persuade", -2, ITEM_PROPERTY_SKILL_BONUS, SKILL_PERSUADE); + } + + // Skill Penalty, -2 to Listen + if(GetHasFeat(FEAT_POORHEARING)) + { + SetCompositeBonus(oSkin, "Poor_Listen", -2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + } + + //damage reduction 5/+1 + if(GetHasFeat(FEAT_DAM_RED5)) + { + ipIP =ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_5_HP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage reduction 10/+1 + if(GetHasFeat(FEAT_DAM_RED10)) + { + ipIP =ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_10_HP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage reduction 15/+1 + if(GetHasFeat(FEAT_DAM_RED15)) + { + ipIP =ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_15_HP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage reduction 5/+3 + if(GetHasFeat(FEAT_LESSER_FEY_DR)) + { + ipIP =ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_3, IP_CONST_DAMAGESOAK_5_HP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage reduction 10/+3 + if(GetHasFeat(FEAT_FEY_DR)) + { + ipIP =ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_3, IP_CONST_DAMAGESOAK_10_HP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage vulnerability cold 50% + if(GetHasFeat(FEAT_VULN_COLD)) + { + ipIP = ItemPropertyDamageVulnerability(DAMAGE_TYPE_COLD, IP_CONST_DAMAGEVULNERABILITY_50_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage vulnerability fire 50% + if(GetHasFeat(FEAT_VULN_FIRE)) + { + ipIP = ItemPropertyDamageVulnerability(DAMAGE_TYPE_FIRE, IP_CONST_DAMAGEVULNERABILITY_50_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //damage immunity 50% Piercing + if(GetHasFeat(FEAT_PARTIAL_PIERCE_IMMUNE)) + { + ipIP = ItemPropertyDamageImmunity(DAMAGE_TYPE_PIERCING, IP_CONST_DAMAGEIMMUNITY_50_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //Svirfneblin dodge bonus (+4) + if(GetHasFeat(FEAT_SVIRFNEBLIN_DODGE)) + { + SetCompositeBonus(oSkin, "Svirf_Dodge", 4, ITEM_PROPERTY_AC_BONUS); + } + + if(GetHasFeat(FEAT_CRAFTGUILD)) + { + SetCompositeBonus(oSkin, "SA_Craft_GuildA", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_ARMOR); + SetCompositeBonus(oSkin, "SA_Craft_GuildW", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_WEAPON); + SetCompositeBonus(oSkin, "SA_Craft_GuildT", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_TRAP); + } + else if(GetHasFeat(FEAT_TECHGUILD)) + { + SetCompositeBonus(oSkin, "SA_Tech_GuildA", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_ARMOR); + SetCompositeBonus(oSkin, "SA_Tech_GuildW", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_WEAPON); + SetCompositeBonus(oSkin, "SA_Tech_GuildT", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_CRAFT_TRAP); + SetCompositeBonus(oSkin, "SA_Tech_GuildL", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + else if(GetHasFeat(FEAT_SAGEGUILD)) + { + SetCompositeBonus(oSkin, "SA_Sage_Guild", 2, ITEM_PROPERTY_SKILL_BONUS, SKILL_LORE); + } + + //"cheat" ac boosts to Warforged armor so it stacks properly + if(GetHasFeat(FEAT_COMPOSITE_PLATING) && + !(GetHasFeat(FEAT_MITHRIL_PLATING) || GetHasFeat(FEAT_ADAMANTINE_PLATING) + || GetHasFeat(FEAT_IRONWOOD_PLATING) || GetHasFeat(FEAT_UNARMORED_BODY))) + SetCompositeBonus(oSkin, "CompositePlating", 2, ITEM_PROPERTY_AC_BONUS); + if(GetHasFeat(FEAT_MITHRIL_PLATING)) + SetCompositeBonus(oSkin, "MithrilPlating", 3, ITEM_PROPERTY_AC_BONUS); + + //Subdual to elements + //implemented as resist 1/- for heat and cold + if(GetHasFeat(FEAT_SUBDUAL_ELEMENTS)) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE, IP_CONST_DAMAGERESIST_1); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_COLD, IP_CONST_DAMAGERESIST_1); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + //Subdual DR 1/- + //implemented as resist 1/- for slash/pierce/blud + if(GetHasFeat(FEAT_SUBDUAL)) + { + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_SLASHING, IP_CONST_DAMAGERESIST_1); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_PIERCING, IP_CONST_DAMAGERESIST_1); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + ipIP =ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_BLUDGEONING, IP_CONST_DAMAGERESIST_1); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + } + + ///Buommans vow of silence - moved to prc_feats.nss + /*if(GetHasFeat(FEAT_VOWOFSILENCE)) + { + int nHasSilence = FALSE; + effect eTest = GetFirstEffect(oPC); + while(GetIsEffectValid(eTest) && !nHasSilence) + { + if(GetEffectType(eTest) == EFFECT_TYPE_SILENCE + && GetEffectDurationType(eTest) == DURATION_TYPE_PERMANENT + && GetEffectCreator(eTest) == oPC + && GetEffectSubType(eTest) == SUBTYPE_SUPERNATURAL) + { + nHasSilence == TRUE; + } + eTest = GetNextEffect(oPC); + } + if(!nHasSilence) + { + effect eSilence = EffectSilence(); + eSilence = SupernaturalEffect(eSilence); + AssignCommand(oPC, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSilence, oPC)); + } + }*/ + + //Wemic + // Skill Bonus, +8 to jump + if(GetHasFeat(FEAT_WEMIC_JUMP_8)) + { + SetCompositeBonus(oSkin, "WEMIC_JUMP_8", 8, ITEM_PROPERTY_SKILL_BONUS, 28); + } + + // Metal hide - Bladeling armor restriction + if(GetHasFeat(FEAT_METAL_HIDE)) + { + if(GetLocalInt(oPC, "ONEQUIP") == 2) + { + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + int nArmorType = GetBaseAC(oItem); + //if not light armor, then force unequip + if(GetBaseAC(oItem) > 4) + AssignCommand(oPC, ActionUnequipItem(oItem)); + + if(DEBUG) DoDebug("race_skin (Bladeling) - Armor type: " + IntToString(GetBaseAC(oItem))); + } + } + + //Warforged armor restrictions + if(GetIsWarforged(oPC)) + { + ExecuteScript("race_warforged", oPC); + } + + if(GetHasFeat(FEAT_SHIFTER_INSTINCTS)) + { + SetCompositeBonus(oSkin, "ShifterInstinctSpot", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_SPOT); + SetCompositeBonus(oSkin, "ShifterInstinctSenseMotive", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_SENSE_MOTIVE); + SetCompositeBonus(oSkin, "ShifterInstinctListen", 1, ITEM_PROPERTY_SKILL_BONUS, SKILL_LISTEN); + } + + if(GetHasFeat(FEAT_DRAGON_TRAINING)) + SetCompositeBonus(oSkin, "RacialDragonTrsining", 4, ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP, RACIAL_TYPE_DRAGON); + + //natural weapons + //replace with a feat check + int nRace = GetRacialType(oPC); + if(nRace==RACIAL_TYPE_MINOTAUR || nRace==RACIAL_TYPE_KRYNN_MINOTAUR) + { + string sResRef = "prc_mino_gore_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_TROLL) + { + string sResRef = "prc_troll_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_RAKSHASA) + { + string sResRef = "prc_raks_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_LIZARDFOLK) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6m_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_TROGLODYTE) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6m_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_TANARUKK) + { + string sResRef = "prc_tana_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_WEMIC) + { + string sResRef = "prc_claw_1d6l_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_ILLITHID) + { + string sResRef = "prc_ill_tent_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 4); + } + else if(nRace==RACIAL_TYPE_CENTAUR) + { + string sResRef = "prc_cent_hoof_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_ASABI) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_DRAGONKIN) + { + //primary weapon + string sResRef = "prc_claw_1d6l_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_KHAASTA) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_NEZUMI) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_POISON_DUSK) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_HOUND_ARCHON) + { + string sResRef = "prc_hdarc_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_hdarc_slam_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 1); + } + else if(nRace==RACIAL_TYPE_BLADELING) + { + int nSize = PRCGetCreatureSize(oPC); + //primary weapon + string sResRef = "prc_claw_1d6m_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_DRIDER) + { + int nSize = PRCGetCreatureSize(oPC); + //secondary weapon + string sResRef = "prc_drid_bite_"; + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_TAER) + { + AddNaturalSecondaryWeapon(oPC, "prc_troll_bite_m"); + AddNaturalPrimaryWeapon(oPC, "prc_cent_hoof_s", 2); + } + else if(nRace==RACIAL_TYPE_BAAZ) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_KAPAK) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_WARFORGED) + { + string sResRef; + int nSize = PRCGetCreatureSize(oPC); + //primary weapon + sResRef = "prc_warf_slam_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 1); + } + else if(nRace==RACIAL_TYPE_WARFORGED_CHARGER) + { + string sResRef; + int nSize = PRCGetCreatureSize(oPC)+1; + //primary weapon + sResRef = "prc_warf_slam_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if( nRace == RACIAL_TYPE_DRAY1 || // NWN Dark Sun + nRace == RACIAL_TYPE_DRAY2 ) + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon - cheating since it needs 1d4l + sResRef = "prc_claw_1d6l_"; + nSize--; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_PTERRAN) // NWN Dark Sun + { + string sResRef = "prc_lizf_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon - cheating since it needs 1d4l + sResRef = "prc_claw_1d6l_"; + nSize--; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_GITH) // NWN Dark Sun + { + // Set primary weapon 1d4 @ Medium + string sResRef = "prc_claw_1d6l_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_TAREK) // NWN Dark Sun + { + // Set primary weapon 1d4 @ Medium + string sResRef = "ds_tarek_slam_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_BELGOI) // NWN Dark Sun + { + // Set primary weapon 1d4 @ Medium + string sResRef = "ds_belgoi_claw_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_TARI) // NWN Dark Sun + { + // Set secondary creature weapon 1d3 @ Small + string sResRef = "ds_tari_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace == RACIAL_TYPE_AARAKOCRA) // NWN Dark Sun + { + // Set secondary creature weapon 1d3 @ Medium + string sResRef = "ds_aarak_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + // Set primary creature weapon 1d3 @ Medium + sResRef = "ds_aarak_claw_"; + nSize--; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace == RACIAL_TYPE_THRIKREEN || // NWN Dark Sun + nRace == RACIAL_TYPE_JEZ || + nRace == RACIAL_TYPE_TONDI || + nRace == RACIAL_TYPE_TOKSA || + nRace == RACIAL_TYPE_JHOL || + nRace == RACIAL_TYPE_TKEECH || + nRace == RACIAL_TYPE_JERAL) + { + // Set secondary creature weapon 1d4 @ Medium + string sResRef = "ds_kreen_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + // Set primary creature weapon 1d4 @ Medium + sResRef = "ds_kreen_claw_"; + nSize--; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 4); + } + + else if(nRace==RACIAL_TYPE_NAZTHARUNE_RAKSHASA) + { + string sResRef; + int nSize = PRCGetCreatureSize(oPC); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_SATYR) + { + string sResRef = "prc_cent_hoof_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + } + else if(nRace==RACIAL_TYPE_VILETOOTH_LIZARDFOLK) + { + string sResRef = "prc_vtth_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6m_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + else if(nRace==RACIAL_TYPE_FERAL_GARGUN) + { + string sResRef = "prc_claw_1d6m_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + } + + //Draconian on-death effects + if(nRace == RACIAL_TYPE_BOZAK) + { + ExecuteScript("race_deaththroes", oPC); + if(GetCreatureWingType(oPC) != CREATURE_WING_TYPE_NONE) + return; + else SetCreatureWingType(PRC_WING_TYPE_DRAGON_BRONZE, oPC); + } + if(nRace == RACIAL_TYPE_BAAZ) + { + ExecuteScript("race_deaththroes", oPC); + if(GetCreatureWingType(oPC) != CREATURE_WING_TYPE_NONE) + return; + else SetCreatureWingType(PRC_WING_TYPE_DRAGON_BRASS, oPC); + } + if(nRace == RACIAL_TYPE_KAPAK) + { + ExecuteScript("race_deaththroes", oPC); + if(GetCreatureWingType(oPC) != CREATURE_WING_TYPE_NONE) + return; + else SetCreatureWingType(PRC_WING_TYPE_DRAGON_COPPER, oPC); + } + + //Check only if not polymorphed or shifted + if(!GetIsPolyMorphedOrShifted(oPC)) + { + //Enforce female Nymphs + if(nRace == RACIAL_TYPE_NYMPH && GetGender(oPC) != GENDER_FEMALE) + SetCreatureAppearanceType(oPC, 126); + + //Shifter traits + if(GetHasFeat(FEAT_SHIFTER_SHIFTING)) + { + int nNumTraits = 0; + nNumTraits += GetHasFeat(FEAT_SHIFTER_WILDHUNT) + + GetHasFeat(FEAT_SHIFTER_RAZORCLAW) + + GetHasFeat(FEAT_SHIFTER_LONGTOOTH) + + GetHasFeat(FEAT_SHIFTER_LONGSTRIDE) + + GetHasFeat(FEAT_SHIFTER_BEASTHIDE) + + GetHasFeat(FEAT_SHIFTER_DREAMSIGHT) + + GetHasFeat(FEAT_SHIFTER_GOREBRUTE); + if(GetHasFeat(FEAT_EXTRA_SHIFTER_TRAIT)) + nNumTraits--; + + if(!nNumTraits) + StartDynamicConversation("race_shfttrt_con", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + } + + //Tinker Gnome guilds + if(GetHasFeat(FEAT_LIFEPATH) && + !(GetHasFeat(FEAT_CRAFTGUILD) || GetHasFeat(FEAT_TECHGUILD) || GetHasFeat(FEAT_SAGEGUILD))) + StartDynamicConversation("race_lifepthconv", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + + //Spirit Folk heritages + if(GetRacialType(oPC) == RACIAL_TYPE_SPIRIT_FOLK && + !(GetHasFeat(FEAT_BONUS_BAMBOO) || GetHasFeat(FEAT_BONUS_RIVER) || GetHasFeat(FEAT_BONUS_SEA) || GetHasFeat(FEAT_BONUS_MOUNTAIN))) + StartDynamicConversation("race_spiritfkcon", oPC, DYNCONV_EXIT_NOT_ALLOWED, FALSE, TRUE, oPC); + } + + // Movement Speed bonuses + if (GetRacialType(oPC) == RACIAL_TYPE_CENTAUR) + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectMovementSpeedIncrease(66), oPC); +} \ No newline at end of file diff --git a/nwnds_module/race_sla.ncs b/nwnds_module/race_sla.ncs new file mode 100644 index 000000000..9ec2c3873 Binary files /dev/null and b/nwnds_module/race_sla.ncs differ diff --git a/nwnds_module/race_sla.nss b/nwnds_module/race_sla.nss new file mode 100644 index 000000000..df62971e0 --- /dev/null +++ b/nwnds_module/race_sla.nss @@ -0,0 +1,389 @@ +/** + * @file + * Spellscript for a range of racial SLAs. + * + * Racial SLAs that use DoRacialSLA() are all grouped in this file. + */ + +#include "inc_newspellbook" +#include "prc_inc_core" +#include "psi_inc_ppoints" + +void ClearLocals() +{ + DeleteLocalInt(OBJECT_SELF, PRC_CASTERLEVEL_OVERRIDE); + DeleteLocalInt(OBJECT_SELF, PRC_DC_TOTAL_OVERRIDE); +} + +void main() +{ + int nRace = GetRacialType(OBJECT_SELF); + int nHD = GetHitDice(OBJECT_SELF); + int nCasterLvl = nHD, nDC, nSpell; + + switch(GetSpellId()){ + case SPELL_URDINNIR_STONESKIN: + { + nCasterLvl = 4; + nSpell = SPELL_STONESKIN; + break; + } + case SPELL_RACE_DARKNESS: + { + nCasterLvl = nRace == RACIAL_TYPE_OMAGE ? 9 : 3; + nSpell = SPELL_DARKNESS; + break; + } + case SPELL_RACE_DAZE: + { + nCasterLvl = 3; + nSpell = SPELL_DAZE; + break; + } + case SPELL_RACE_LIGHT: + { + nSpell = SPELL_LIGHT; + break; + } + case SPELL_SVIRF_BLINDDEAF: + { + // 10 + Spell level (2) + Racial bonus (4) + Cha Mod + nDC = 16 + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = SPELL_BLINDNESS_AND_DEAFNESS; + break; + } + case SPELL_ILLITHID_CHARM_MONSTER: + { + nCasterLvl = 8; + nSpell = SPELL_CHARM_MONSTER; + break; + } + case SPELL_RACE_CHARM_PERSON: + { + if (nRace == RACIAL_TYPE_PURE_YUAN) { nCasterLvl = 3; } + else if (nRace == RACIAL_TYPE_NIXIE) { nCasterLvl = 4; } + else if (nRace == RACIAL_TYPE_BRALANI) { nCasterLvl = 6; } + else if (nRace == RACIAL_TYPE_OMAGE) { nCasterLvl = 9; } + nSpell = SPELL_CHARM_PERSON; + break; + } + case SPELL_FEYRI_ENERVATION: + { + nSpell = SPELL_ENERVATION; + break; + } + case SPELL_RACE_ENTANGLE: + { + nCasterLvl = 3; + if(nRace == RACIAL_TYPE_PIXIE) + nCasterLvl = 8; + else if(nRace == RACIAL_TYPE_GRIG) + nCasterLvl = 9; + nSpell = SPELL_ENTANGLE; + break; + } + case SPELL_RACE_FEAR: + { + nCasterLvl = 3; + nSpell = SPELL_FEAR; + break; + } + case SPELL_RACE_CLAIR: + { + nSpell = SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE; + break; + } + case SPELL_RACE_NEUTRALIZE_POISON: + { + nSpell = SPELL_NEUTRALIZE_POISON; + break; + } + case SPELL_PIXIE_CONFUSION: + { + nCasterLvl = 8; + nSpell = SPELL_CONFUSION; + break; + } + case SPELL_PIXIE_IMPINVIS: + case SPELL_DUERGAR_INVIS: + { + nCasterLvl = 8; + if(nRace == RACIAL_TYPE_GRIG) + nCasterLvl = 9; + else if(nRace == RACIAL_TYPE_DUERGAR) + nCasterLvl = (nHD * 2); + nSpell = SPELL_INVISIBILITY; + break; + } + case SPELL_PIXIE_DISPEL: + { + nCasterLvl = 8; + nSpell = SPELL_DISPEL_MAGIC; + break; + } + case SPELL_RACE_CHILLTOUCH: + { + if(nRace == RACIAL_TYPE_MORTIF) + nCasterLvl = (nHD)+2; + else if(nRace == RACIAL_TYPE_ZAKYA_RAKSHASA) + nCasterLvl = 7; + nSpell = SPELL_CHILL_TOUCH; + break; + } + case SPELL_RACE_SILENCE: + { + nSpell = SPELL_SILENCE; + break; + } + case SPELL_RACE_MAGE_HAND: + { + nSpell = SPELL_MAGE_HAND; + break; + } + case SPELL_ZAKYA_VAMPIRIC_TOUCH: + { + nCasterLvl = 7; + nSpell = SPELL_VAMPIRIC_TOUCH; + break; + } + case SPELL_GRIG_PYROTECHNICS_FIREWORKS: + { + nCasterLvl = 9; + nSpell = SPELL_PYROTECHNICS_FIREWORKS; + break; + } + case SPELL_GRIG_PYROTECHNICS_SMOKE: + { + nCasterLvl = 9; + nSpell = SPELL_PYROTECHNICS_SMOKE; + break; + } + case SPELL_BRALANI_LIGHTNING_BOLT: + { + nCasterLvl = 6; + nSpell = SPELL_LIGHTNING_BOLT; + break; + } + case SPELL_BRALANI_CURE_SERIOUS_WOUNDS: + { + nCasterLvl = 6; + nSpell = SPELL_CURE_SERIOUS_WOUNDS; + break; + } + case SPELL_BRALANI_GUST_OF_WIND: + { + nCasterLvl = 6; + nSpell = SPELL_GUST_OF_WIND; + break; + } + case SPELL_BRALANI_MIRROR_IMAGE: + { + nCasterLvl = 6; + nSpell = SPELL_MIRROR_IMAGE; + break; + } + case SPELL_IRDA_FLARE: + { + nSpell = SPELL_FLARE; + break; + } + case SPELL_HOUND_DETECTEVIL: + { + nSpell = SPELL_DETECT_EVIL; + break; + } + case SPELL_HOUND_AID: + { + nCasterLvl = 6; + nSpell = SPELL_AID; + break; + } + case SPELL_HOUND_CONTFLAME: + { + nCasterLvl = 6; + nSpell = SPELL_CONTINUAL_FLAME; + break; + } + case SPELL_HOUND_TELEPORT: + { + nCasterLvl = 6; + nSpell = SPELL_GREATER_TELEPORT_SELF; + DelayCommand(1.0f, ClearLocals()); + break; + } + case SPELL_ZENYTH_TRUE_STRIKE: + { + nSpell = SPELL_TRUE_STRIKE; + break; + } + case SPELL_RACIAL_CIRCLE_VS_GOOD: + { + nSpell = SPELL_MAGIC_CIRCLE_AGAINST_GOOD; + break; + } + case SPELL_RACIAL_CIRCLE_VS_EVIL: + { + nSpell = SPELL_MAGIC_CIRCLE_AGAINST_EVIL; + break; + } + case SPELL_RACIAL_CIRCLE_VS_LAW: + { + nSpell = SPELL_MAGIC_CIRCLE_AGAINST_LAW; + break; + } + case SPELL_RACIAL_CIRCLE_VS_CHAOS: + { + nSpell = SPELL_MAGIC_CIRCLE_AGAINST_CHAOS; + break; + } + case SPELL_NATHRI_EXPEDITIOUS_RETREAT: + { + nSpell = SPELL_EXPEDITIOUS_RETREAT; + break; + } + case SPELL_NYMPH_DIMDOOR_SELF: + { + nCasterLvl = 7; + nSpell = SPELL_DIMENSION_DOOR_SELF; + DelayCommand(1.0f, ClearLocals()); + break; + } + case SPELL_NYMPH_DIMDOOR_PARTY: + { + nCasterLvl = 7; + nSpell = SPELL_DIMENSION_DOOR_PARTY; + DelayCommand(1.0f, ClearLocals()); + break; + } + case SPELL_NYMPH_DIMDOOR_DIST_SELF: + { + nCasterLvl = 7; + nSpell = SPELL_DIMENSION_DOOR_DIRDIST_SELF; + DelayCommand(1.0f, ClearLocals()); + break; + } + case SPELL_NYMPH_DIMDOOR_DIST_PARTY: + { + nCasterLvl = 7; + nSpell = SPELL_DIMENSION_DOOR_DIRDIST_PARTY; + DelayCommand(1.0f, ClearLocals()); + break; + } + case SPELL_DRIDER_DETECTGOOD: + { + nSpell = SPELL_DETECT_GOOD; + break; + } + case SPELL_DRIDER_DETECTLAW: + { + nSpell = SPELL_DETECT_LAW; + break; + } + case SPELL_RACE_BLUR: + { + if(nRace == RACIAL_TYPE_GITHYANKI) + nCasterLvl = 3; + else if(nRace == RACIAL_TYPE_BRALANI) + nCasterLvl = 6; + nSpell = SPELL_BLUR; + break; + } + case 1965://Faerie fire + { + nSpell = SPELL_FAERIE_FIRE; + break; + } + case 3494: // Magic Stone for Stonechild + { + nCasterLvl = 3; + nSpell = SPELL_MAGIC_STONE; + break; + } + case 3804: // Uldra Ray of Frost + { + nDC = 10 + GetAbilityModifier(ABILITY_WISDOM); + nCasterLvl = GetHitDice(OBJECT_SELF); + nSpell = SPELL_RAY_OF_FROST; + break; + } + case 3805: // Uldra Touch of Fatigue + { + nDC = 10 + GetAbilityModifier(ABILITY_WISDOM); + nCasterLvl = GetHitDice(OBJECT_SELF); + nSpell = SPELL_TOUCH_FATIGUE; + break; + } + case 3826: // Extaminaar Charm Animal + { + nCasterLvl = GetHitDice(OBJECT_SELF); + nSpell = SPELL_CHARM_PERSON_OR_ANIMAL; + break; + } + case 887: // Villichi Intertial Armor + { + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nSpell = SPELL_MAGE_ARMOR; + break; + } + case 888: // Villichi Precognition, Defensive + { + LosePowerPoints(OBJECT_SELF, 1, FALSE); + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nSpell = POWER_DEFPRECOG; + break; + } + case 889: // Villichi Biofeedback + { + LosePowerPoints(OBJECT_SELF, 1, FALSE); + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nSpell = POWER_BIOFEEDBACK; + break; + } + case 890: // Villichi Cloud Mind + { + LosePowerPoints(OBJECT_SELF, 1, FALSE); + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nDC = 10 + nCasterLvl + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = POWER_CLOUD_MIND; + break; + } + case 891: // Belgoi Attraction + { + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nDC = 10 + nCasterLvl + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = SPELL_CHARM_MONSTER; + break; + } + case 892: // Belgoi Brain Lock + { + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nDC = 10 + nCasterLvl + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = SPELL_HOLD_MONSTER; + break; + } + case 893: // Belgoi Ego Whip + { + LosePowerPoints(OBJECT_SELF, 1, FALSE); + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nDC = 10 + nCasterLvl + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = POWER_EGOWHIP; + break; + } + case 894: // Belgoi Empty Mind + { + LosePowerPoints(OBJECT_SELF, 1, FALSE); + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nSpell = POWER_EMPTYMIND; + break; + } + case 895: // Belgoi Dominate + { + nCasterLvl = GetHitDice(OBJECT_SELF) / 2; + nDC = 12 + nCasterLvl + GetAbilityModifier(ABILITY_CHARISMA); + nSpell = SPELL_DOMINATE_MONSTER; + break; + } + } + + DoRacialSLA(nSpell, nCasterLvl, nDC); +} diff --git a/nwnds_module/raided_caravan01.are b/nwnds_module/raided_caravan01.are new file mode 100644 index 000000000..d2755f312 Binary files /dev/null and b/nwnds_module/raided_caravan01.are differ diff --git a/nwnds_module/raided_caravan01.gic b/nwnds_module/raided_caravan01.gic new file mode 100644 index 000000000..193fbc8ba Binary files /dev/null and b/nwnds_module/raided_caravan01.gic differ diff --git a/nwnds_module/raided_caravan01.git b/nwnds_module/raided_caravan01.git new file mode 100644 index 000000000..c82ecae15 Binary files /dev/null and b/nwnds_module/raided_caravan01.git differ diff --git a/nwnds_module/randomencounters.utp b/nwnds_module/randomencounters.utp new file mode 100644 index 000000000..b5e9ca2a0 Binary files /dev/null and b/nwnds_module/randomencounters.utp differ diff --git a/nwnds_module/re_common2_spawn.ncs b/nwnds_module/re_common2_spawn.ncs new file mode 100644 index 000000000..6556e5aba Binary files /dev/null and b/nwnds_module/re_common2_spawn.ncs differ diff --git a/nwnds_module/re_common2_spawn.nss b/nwnds_module/re_common2_spawn.nss new file mode 100644 index 000000000..c5005c469 --- /dev/null +++ b/nwnds_module/re_common2_spawn.nss @@ -0,0 +1,113 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" +#include "ms_name_inc" + +//Spawns NPC in with female clothing. + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + //Randomizes NPC's Appearance + object oNPC = OBJECT_SELF; + string sTag = GetTag(oNPC); + +/* int nPheno; + nPheno = Random(4)+1; + if (nPheno == 3) + SetPhenoType(2, oNPC); + if (nPheno == 4) + SetPhenoType(40, oNPC); */ + + int nSkinColor; + nSkinColor = Random(40)+1; + SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinColor); + + int nHeadNumber; + nHeadNumber = Random(31)+1; + if (sTag != "child") + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, oNPC); + + int nHairColor; + nHairColor = Random(45)+1; + SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairColor); + + int nResult = 6+d6(); + string sItem; + sItem = "comclothes" + IntToString(nResult); + DelayCommand(1.0f, ActionEquipItem(CreateItemOnObject(sItem), INVENTORY_SLOT_CHEST)); + SetLocalInt(OBJECT_SELF, "iDialogue", Random(10) + 1); + SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + //Calls the Random Name Generator + ms_Nomenclature(OBJECT_SELF); + + +} + + diff --git a/nwnds_module/re_common_blkd.ncs b/nwnds_module/re_common_blkd.ncs new file mode 100644 index 000000000..8fab3a986 Binary files /dev/null and b/nwnds_module/re_common_blkd.ncs differ diff --git a/nwnds_module/re_common_blkd.nss b/nwnds_module/re_common_blkd.nss new file mode 100644 index 000000000..ccd4207ae --- /dev/null +++ b/nwnds_module/re_common_blkd.nss @@ -0,0 +1,32 @@ +//:://///////////////////////////////////////////// +//:: Default On Blocked +//:: re_common_blkd +//:: Copyright (c) 2001 Bioware Corp. +// modifications by Carlo +//::////////////////////////////////////////////// +/* + This will cause blocked creatures to open + doors, or failing that clear their action queue. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Nov 23, 2001 +//::////////////////////////////////////////////// +void main() +{ + object oDoor = GetBlockingDoor(); + // * Increment number of times blocked + SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED", GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") + 1); + if (GetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED") > 1) + { + SetLocalInt(OBJECT_SELF, "X2_NUMTIMES_BLOCKED",0); + ClearAllActions(); + } + if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5) + { + if(GetIsDoorActionPossible(oDoor, DOOR_ACTION_OPEN) && GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 7 ) + { + DoDoorAction(oDoor, DOOR_ACTION_OPEN); + } + } +} diff --git a/nwnds_module/re_common_spawn.ncs b/nwnds_module/re_common_spawn.ncs new file mode 100644 index 000000000..c3039d0f7 Binary files /dev/null and b/nwnds_module/re_common_spawn.ncs differ diff --git a/nwnds_module/re_common_spawn.nss b/nwnds_module/re_common_spawn.nss new file mode 100644 index 000000000..d29e58ef8 --- /dev/null +++ b/nwnds_module/re_common_spawn.nss @@ -0,0 +1,116 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" +#include "ms_name_inc" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + //Randomizes NPC's Appearance + object oNPC = OBJECT_SELF; + string sTag = GetTag(oNPC); + +/* int nPheno; + nPheno = Random(4)+1; + if (nPheno == 3) + SetPhenoType(2, oNPC); + if (nPheno == 4) + SetPhenoType(40, oNPC); */ + + int nSkinColor; + nSkinColor = Random(20); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(12)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + //Randomizes Clothing + int nResult = d6(); + string sItem; + sItem = "comclothes" + IntToString(nResult); + DelayCommand(1.0f, ActionEquipItem(CreateItemOnObject(sItem), INVENTORY_SLOT_CHEST)); + SetLocalInt(OBJECT_SELF, "iDialogue", Random(10) + 1); + //SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + //Calls the Random Name Generator + ms_Nomenclature(OBJECT_SELF); + + + +} + + diff --git a/nwnds_module/re_commoner0.ncs b/nwnds_module/re_commoner0.ncs new file mode 100644 index 000000000..785592768 Binary files /dev/null and b/nwnds_module/re_commoner0.ncs differ diff --git a/nwnds_module/re_commoner0.nss b/nwnds_module/re_commoner0.nss new file mode 100644 index 000000000..0a59d498b --- /dev/null +++ b/nwnds_module/re_commoner0.nss @@ -0,0 +1,96 @@ +//////////////////////////////////////////////////// +/* +Custom Random Commoner Table for use with the BESIE +Random Encounter Package by Ray Miller +*/ +//////////////////////////////////////////////////// + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +int END; +int iWeight; +int iCounter1; +int iCounter2; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// case 0:sChoice = "RESREF"; // Creature resref goes between the " marks. +// iWeight = 10; // This is the number of times this mob should be considered for the likelyhood of appearing. +// break; + + case 0:sChoice = "npc_commoner009"; // Commoner - Human Female 01 + iWeight = 10; + break; + + case 1:sChoice = "npc_commoner010"; // Commoner - Human Female 02 + iWeight = 10; + break; + + case 2:sChoice = "npc_commoner011"; // Commoner - Human Male 01 + iWeight = 10; + break; + + case 3:sChoice = "npc_commoner012"; // Commoner - Human Male 02 + iWeight = 10; + break; + + case 4:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 5; + break; + + case 5:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 6; + break; + + case 6:sChoice = "npc_commoner005"; // Commoner - Elf Female 01 + iWeight = 4; + break; + + case 7:sChoice = "npc_commoner006"; // Commoner - Elf Male 01 + iWeight = 5; + break; + + case 8:sChoice = "npc_commoner007"; // Commoner - Half-elf Female 01 + iWeight = 7; + break; + + case 9:sChoice = "npc_commoner008"; // Commoner - Half-elf Male 01 + iWeight = 8; + break; + + case 10:sChoice = "npc_commoner001"; // Commoner - Human Boy 01 + iWeight = 5; + break; + + case 11:sChoice = "npc_commoner002"; // Commoner - Human Girl 01 + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_commoner1.ncs b/nwnds_module/re_commoner1.ncs new file mode 100644 index 000000000..2b17e4879 Binary files /dev/null and b/nwnds_module/re_commoner1.ncs differ diff --git a/nwnds_module/re_commoner1.nss b/nwnds_module/re_commoner1.nss new file mode 100644 index 000000000..f9acaadf1 --- /dev/null +++ b/nwnds_module/re_commoner1.nss @@ -0,0 +1,93 @@ +//////////////////////////////////////////////////// +/* +Custom Random Commoner Table for use with the BESIE +Random Encounter Package by Ray Miller +*/ +//////////////////////////////////////////////////// + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +int END; +int iWeight; +int iCounter1; +int iCounter2; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// case 0:sChoice = "RESREF"; // Creature resref goes between the " marks. +// iWeight = 10; // This is the number of times this mob should be considered for the likelyhood of appearing. +// break; + + case 0:sChoice = "npc_commoner009"; // Commoner - Human Female 01 + iWeight = 10; + break; + + case 1:sChoice = "npc_commoner010"; // Commoner - Human Female 02 + iWeight = 10; + break; + + case 2:sChoice = "npc_commoner011"; // Commoner - Human Male 01 + iWeight = 10; + break; + + case 3:sChoice = "npc_commoner012"; // Commoner - Human Male 02 + iWeight = 10; + break; + + case 4:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 5; + break; + + case 5:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 6; + break; + + case 6:sChoice = "npc_commoner005"; // Commoner - Elf Female 01 + iWeight = 4; + break; + + case 7:sChoice = "npc_commoner006"; // Commoner - Elf Male 01 + iWeight = 5; + break; + + case 8:sChoice = "npc_commoner007"; // Commoner - Half-elf Female 01 + iWeight = 7; + break; + + case 9:sChoice = "npc_commoner008"; // Commoner - Half-elf Male 01 + iWeight = 8; + break; + + case 10:sChoice = "npc_commoner001"; // Commoner - Human Boy 01 + iWeight = 5; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_commoner2.ncs b/nwnds_module/re_commoner2.ncs new file mode 100644 index 000000000..8437a1710 Binary files /dev/null and b/nwnds_module/re_commoner2.ncs differ diff --git a/nwnds_module/re_commoner2.nss b/nwnds_module/re_commoner2.nss new file mode 100644 index 000000000..b644c6f3b --- /dev/null +++ b/nwnds_module/re_commoner2.nss @@ -0,0 +1,94 @@ +//////////////////////////////////////////////////// +/* +Custom Random Commoner Table for use with the BESIE +Random Encounter Package by Ray Miller + +Kled Commoners & guards. + +*/ +//////////////////////////////////////////////////// + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +int END; +int iWeight; +int iCounter1; +int iCounter2; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// case 0:sChoice = "RESREF"; // Creature resref goes between the " marks. +// iWeight = 10; // This is the number of times this mob should be considered for the likelyhood of appearing. +// break; + + case 0:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 8; + break; + + case 1:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 10; + break; + + case 2:sChoice = "npc_kledguard"; // Kled Guard + iWeight = 2; + break; + + case 3:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 8; + break; + + case 4:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 10; + break; + + case 5:sChoice = "npc_kledguard"; // Kled Guard + iWeight = 2; + break; + + case 6:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 8; + break; + + case 7:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 10; + break; + + case 8:sChoice = "npc_kledguard"; // Kled Guard + iWeight = 2; + break; + + case 9:sChoice = "npc_commoner003"; // Commoner - Dwarf Female 01 + iWeight = 8; + break; + + case 10:sChoice = "npc_commoner004"; // Commoner - Dwarf Male 01 + iWeight = 10; + break; +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_commonspwnrhb.ncs b/nwnds_module/re_commonspwnrhb.ncs new file mode 100644 index 000000000..cfb4f6d0d Binary files /dev/null and b/nwnds_module/re_commonspwnrhb.ncs differ diff --git a/nwnds_module/re_commonspwnrhb.nss b/nwnds_module/re_commonspwnrhb.nss new file mode 100644 index 000000000..db627e8c0 --- /dev/null +++ b/nwnds_module/re_commonspwnrhb.nss @@ -0,0 +1,139 @@ +//:://///////////////////////////////////////////// +//:: FileName re_mmorpghb.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE Commoner Spawner tool, part of the BESIE +Random Encounter System by Ray Miller. +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 9-2-02 +//::////////////////////////////////////////////// + +#include "re_rndenc" +void DoFacing(object oSource) +{ +object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oSource, 1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC); +vector vTarget = GetPositionFromLocation(GetLocation(oTarget)); +vector vSource = GetPositionFromLocation(GetLocation(oSource)); +AssignCommand(oSource, SetFacingPoint(vTarget)); +if(oSource == GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oTarget, 1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC)) + { + if(GetTag(oTarget) == "Patron" + || GetTag(oTarget) == "Citizen" + || GetTag(oTarget) == "Commoner" + || GetLocalObject(oTarget, "re_oRandomEncounterSpawner") == OBJECT_SELF) + { + if(!GetIsPC(oTarget)) AssignCommand(oTarget, SetFacingPoint(vSource)); + } + } +} + +void main() +{ + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "Commoner Spawner"); + } + if(GetLocalInt(GetModule(), "re_disableCommonerSpawner") || GetLocalInt(GetArea(OBJECT_SELF), "re_disableCommonerSpawner") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + object oCreature; + object oAmIASpawn; + object oArea = GetArea(OBJECT_SELF); + int iCounter1; + int iCounter2; + int iCounterSpawn; + int bTimeIn; + int bSpawn; + int iSpawnRadius = GetFortitudeSavingThrow(OBJECT_SELF) * 5; + int iTableNumber = GetReflexSavingThrow(OBJECT_SELF); + int iMaxSpawns = GetWillSavingThrow(OBJECT_SELF); + int iSpawnAmount; + string sBuild; + string sCustom = "nil"; + string sTemplate = "re_commoner" + IntToString(iTableNumber); + if(!GetLocalInt(OBJECT_SELF, "re_bCommonerSpawner")) SetLocalInt(OBJECT_SELF, "bCommonerSpawner", TRUE); + if(!GetLocalInt(OBJECT_SELF, "bFirstRun")) + { + if(GetStringLeft(GetTag(OBJECT_SELF), 3) == "re_") + { + for(iCounter1 = 3; iCounter1 <= GetStringLength(GetTag(OBJECT_SELF)); iCounter1++) + { + if(sCustom != "nil" + && (GetSubString(GetTag(OBJECT_SELF), iCounter1, 1) == "0" || StringToInt(GetSubString(GetTag(OBJECT_SELF), iCounter1, 1)) > 0)) + { + sBuild = sBuild + GetSubString(GetTag(OBJECT_SELF), iCounter1, 1); + } + else if(sCustom != "nil") + { + if(sCustom == "b") SetLocalInt(OBJECT_SELF, "re_iBegin", StringToInt(sBuild)); + if(sCustom == "e") SetLocalInt(OBJECT_SELF, "re_iEnd", StringToInt(sBuild)); + sCustom = "nil"; + sBuild = ""; + } + if(GetSubString(GetTag(OBJECT_SELF), iCounter1, 1) == "b" || GetSubString(GetTag(OBJECT_SELF), iCounter1, 1) == "e") + { + sCustom = GetSubString(GetTag(OBJECT_SELF), iCounter1, 1); + } + } + } + SetLocalInt(OBJECT_SELF, "bFirstRun", TRUE); + } + if(GetLocalInt(OBJECT_SELF, "re_iBegin") > 23) SetLocalInt(OBJECT_SELF, "re_iBegin", 23); + if(GetLocalInt(OBJECT_SELF, "re_iEnd") > 23) SetLocalInt(OBJECT_SELF, "re_iEnd", 23); + int iStartTime = GetLocalInt(OBJECT_SELF, "re_iBegin"); + int iStopTime = GetLocalInt(OBJECT_SELF, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + bTimeIn = TRUE; + else bTimeIn = FALSE; + if(iMaxSpawns < 0)iMaxSpawns = 1; + oAmIASpawn = GetFirstObjectInArea(oArea); + while(GetIsObjectValid(oAmIASpawn)) + { + if(GetIsPC(oAmIASpawn) && !GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oAmIASpawn))) bSpawn = TRUE; + if(GetLocalObject(oAmIASpawn, "re_oRandomEncounterSpawner") == OBJECT_SELF && bTimeIn) + { + iCounterSpawn++; + + //This is so the CleanHouse function doesn't clean up the commoners. + if(GetLocalInt(oAmIASpawn, "re_bRandomEncounter")) DeleteLocalInt(oAmIASpawn, "re_bRandomEncounter"); + + int iShouldIWalk = Random(100) + 1; + if(Random(100) + 1 < GetMaxHitPoints(OBJECT_SELF) && !GetIsInCombat(oAmIASpawn) && !IsInConversation(oAmIASpawn) && !GetIsPC(oAmIASpawn)) + { + ClearAllActions(); + RandomWalk2(GetLocation(OBJECT_SELF), iSpawnRadius, oAmIASpawn); + } + if(!GetIsInCombat(oAmIASpawn) && !IsInConversation(oAmIASpawn) && !GetIsPC(oAmIASpawn)) AssignCommand(oAmIASpawn, ActionDoCommand(DoFacing(oAmIASpawn))); + } + if(GetLocalObject(oAmIASpawn, "re_oRandomEncounterSpawner") == OBJECT_SELF && (!bTimeIn || GetLocalInt(OBJECT_SELF, "re_bDespawn"))) + { + if(!GetIsInCombat(oAmIASpawn) && !IsInConversation(oAmIASpawn) && !GetIsPC(oAmIASpawn)) DestroyObject(oAmIASpawn); + } + oAmIASpawn = GetNextObjectInArea(oArea); + } + if(!bSpawn) SetLocalInt(OBJECT_SELF, "re_bDespawn", TRUE); + else DeleteLocalInt(OBJECT_SELF, "re_bDespawn"); + if(iCounterSpawn < iMaxSpawns && bSpawn && bTimeIn) + { + //This is to prevent a Too Many Instructions error that occurs if more than 23 spawns are generated + //in a single loop. + if(iMaxSpawns - iCounterSpawn > 20) iSpawnAmount = 20; + else iSpawnAmount = iMaxSpawns - iCounterSpawn; + for(iCounter2 = 1; iCounter2 <= iSpawnAmount; iCounter2++) + { + oCreature = RandomEncounter(100.0, OBJECT_SELF, sTemplate, 0, 1, 1, iSpawnRadius, 360); + DelayCommand(2.0, DoFacing(oCreature)); + } + } + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); +} diff --git a/nwnds_module/re_custom1.ncs b/nwnds_module/re_custom1.ncs new file mode 100644 index 000000000..d63ca5a04 Binary files /dev/null and b/nwnds_module/re_custom1.ncs differ diff --git a/nwnds_module/re_custom1.nss b/nwnds_module/re_custom1.nss new file mode 100644 index 000000000..164e4ab03 --- /dev/null +++ b/nwnds_module/re_custom1.nss @@ -0,0 +1,145 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 1 - Western Dunes 10-15th lvl + +*/ +//////////////////////////////////////////////////// + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + case 0:sChoice = "ar_gith_001"; // Creature ResRef goes between the " marks. + fCR = 1.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 8; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; + + case 1:sChoice = "ar_gith_002"; //Gith Warrior + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 2:sChoice = "ar_gith_003"; //Gith Archer + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 3:sChoice = "ar_gith_004"; //Gith Psion + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 4:sChoice = "ar_gith_005"; //Gith Raider + fCR = 15.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 5:sChoice = "ar_gith_006"; //Gith Scout + fCR = 14.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 6:sChoice = "ar_gith_007"; //Gith Shaman + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 7:sChoice = "barbscorpion_001"; //Barbed Scorpion + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 8:sChoice = "beasthead001"; //Beasthead Giant - Ape + fCR = 14.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 9:sChoice = "beasthead002"; //Beasthead Giant - Lion + fCR = 17.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 10:sChoice = "beasthead003"; //Beasthead Giant - Bear + fCR = 17.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 11:sChoice = "beasthead003"; //Beasthead Giant - Wolf + fCR = 17.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 12:sChoice = "ds_gaj_001"; //Gaj + fCR = 11.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 1; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom10.ncs b/nwnds_module/re_custom10.ncs new file mode 100644 index 000000000..57f24e7e3 Binary files /dev/null and b/nwnds_module/re_custom10.ncs differ diff --git a/nwnds_module/re_custom10.nss b/nwnds_module/re_custom10.nss new file mode 100644 index 000000000..700542960 --- /dev/null +++ b/nwnds_module/re_custom10.nss @@ -0,0 +1,181 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 10 - Undead CR 0 - CR 5 + +Areas Used in: +Dead's Revenge +Tyr - Southern Expanse - Graveyard + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "skeletondwarf001"; // Skeleton, Dwarf + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 1:sChoice = "blight001"; // Blight + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 2:sChoice = "skeletonhuman001"; // Skeleton, Human + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 3:sChoice = "zombie003"; // Zombie, Human + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 4:sChoice = "zombie002"; // Zombie, Mul + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 5:sChoice = "skeletonhgiant"; // Skeleton, Half-Giant + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 6:sChoice = "ghoul001"; // Ghoul + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 7:sChoice = "ar_shadowrat001"; // Shadow Rat, Common + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 8:sChoice = "shadow003"; // Shadow, Lesser + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 9:sChoice = "ar_shadowrat002"; // Shadow Rat, Dire + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 10:sChoice = "tombmote001"; // Tomb Mote + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 11:sChoice = "bonebat001"; // Bonebat + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 12:sChoice = "ghast001"; // Ghast + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 13:sChoice = "ioramh001"; // Ioramh + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 14:sChoice = "deathlock001"; // Deathlock + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom11.ncs b/nwnds_module/re_custom11.ncs new file mode 100644 index 000000000..a69ef7520 Binary files /dev/null and b/nwnds_module/re_custom11.ncs differ diff --git a/nwnds_module/re_custom11.nss b/nwnds_module/re_custom11.nss new file mode 100644 index 000000000..95bf0e52d --- /dev/null +++ b/nwnds_module/re_custom11.nss @@ -0,0 +1,193 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 11 - Fire Subtype Creatures + +Areas Used in: +Pit of Fire + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "elem_fire_el001"; // [AR] Fire Elemental, Elder + fCR = 37.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 1:sChoice = "elem_fire_gr001"; // [AR] Fire Elemental, Greater + fCR = 32.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 2:sChoice = "elem_fire_hg001"; // [AR] Fire Elemental, Huge + fCR = 25.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 3:sChoice = "elem_fire_lg001"; // [AR] Fire Elemental, Large + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 4:sChoice = "elem_fire_md001"; // [AR] Fire Elemental, Medium + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 5:sChoice = "elem_fire_sm001"; // [AR] Fire Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 6:sChoice = "golemmagma001"; // Golem: Magma + fCR = 16.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 7:sChoice = "golemmagma002"; // Golem: Magma, Greater + fCR = 27.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 8:sChoice = "ar_firebat_001"; // Firebat + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 9:sChoice = "ar_magmin001"; // Magmin + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 10:sChoice = "ar_magmin002"; // Magmin, Greater + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 11:sChoice = "ar_flamsnake002"; // Flame Snake, Lesser + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 12:sChoice = "ar_flamsnake003"; // Flame Snake, Minor + fCR = 0.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 13:sChoice = "ar_hellhound001"; // Hell Hound [AR] + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 14:sChoice = "ar_mepfire001"; // Mephit, Fire + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 15:sChoice = "ar_mepmagma001"; // Mephit, Magma + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 16:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom12.ncs b/nwnds_module/re_custom12.ncs new file mode 100644 index 000000000..b181e5bde Binary files /dev/null and b/nwnds_module/re_custom12.ncs differ diff --git a/nwnds_module/re_custom12.nss b/nwnds_module/re_custom12.nss new file mode 100644 index 000000000..f4d71a22f --- /dev/null +++ b/nwnds_module/re_custom12.nss @@ -0,0 +1,147 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 12 - Hamanu's Half-giants / Sands of Time + +Areas Used in: +Sands of Time +Ravines + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "halfgiant002"; // Half-Giant - Soldier + fCR = 43.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 1:sChoice = "halfgiant004"; // Half-Giant - Veteran + fCR = 40.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 2:sChoice = "halfgiant003"; // Half-Giant - Hurler + fCR = 43.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 3:sChoice = "halfgiant001"; // Half-Giant - Stalker + fCR = 41.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 4:sChoice = "halfgiant006"; // Half-Giant - Cleric + fCR = 47.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 5:sChoice = "halfgiant005"; // Half-Giant - Shamaness + fCR = 40.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 6:sChoice = "golemobsidian001"; // Golem: Obsidian + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 7:sChoice = "golemobsidian002"; // Golem: Obsidian, Greater + fCR = 25.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 8:sChoice = "ar_aerservant001"; // Aerial Servant + fCR = 18.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 9:sChoice = "ar_aerservant002"; // Aerial Servant, Large + fCR = 37.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom13.ncs b/nwnds_module/re_custom13.ncs new file mode 100644 index 000000000..350a4ce58 Binary files /dev/null and b/nwnds_module/re_custom13.ncs differ diff --git a/nwnds_module/re_custom13.nss b/nwnds_module/re_custom13.nss new file mode 100644 index 000000000..5aa237c39 --- /dev/null +++ b/nwnds_module/re_custom13.nss @@ -0,0 +1,174 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 13 - Hamanu's Half-giants / Grotto of Dreams + +Areas Used in: +Grotto of Dreams + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "halfgiant002"; // Half-Giant - Soldier + fCR = 43.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 1:sChoice = "halfgiant004"; // Half-Giant - Veteran + fCR = 40.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 2:sChoice = "halfgiant003"; // Half-Giant - Hurler + fCR = 43.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 3:sChoice = "halfgiant001"; // Half-Giant - Stalker + fCR = 41.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 4:sChoice = "halfgiant006"; // Half-Giant - Cleric + fCR = 47.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 5:sChoice = "halfgiant005"; // Half-Giant - Shamaness + fCR = 40.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 6:sChoice = "elem_rain_el001"; // Rain Paraelemental, Elder + fCR = 36.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 7:sChoice = "elem_rain_gr001"; // Rain Paraelemental, Greater + fCR = 32.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 8:sChoice = "elem_rain_hg001"; // Rain Paraelemental, Huge + fCR = 17.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 9:sChoice = "drake_water001"; // Drake, Water + fCR = 16.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 10:sChoice = "athasianbear001"; // Bear, Athasian + fCR = 19.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 11:sChoice = "ar_aviarag_003"; // Aviarag, Elder + fCR = 24.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 12:sChoice = "ar_aerservant001"; // Aerial Servant + fCR = 18.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 13:sChoice = "ar_aerservant001"; // Aerial Servant, Large + fCR = 37.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom14.ncs b/nwnds_module/re_custom14.ncs new file mode 100644 index 000000000..e36761a67 Binary files /dev/null and b/nwnds_module/re_custom14.ncs differ diff --git a/nwnds_module/re_custom14.nss b/nwnds_module/re_custom14.nss new file mode 100644 index 000000000..fa8c5172b --- /dev/null +++ b/nwnds_module/re_custom14.nss @@ -0,0 +1,109 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 14 - Antloids! + +Areas Used in: +Great Alluvial Sand Wastes - Northern Expanse (2) +Great Alluvial Sand Wastes - Antloid Cave + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "antloid002"; // Antloid Worker + fCR = 3.0; + iMinNum = 2; + iMaxNum = 10; + iWeight = 16; + break; + + case 1:sChoice = "antloid003"; // Antloid Soldier + fCR = 7.0; + iMinNum = 2; + iMaxNum = 10; + iWeight = 8; + break; + + case 2:sChoice = "antloid004"; // Antloid Dynamis + fCR = 6.0; + iMinNum = 2; + iMaxNum = 8; + iWeight = 4; + break; + + case 3:sChoice = "puddingdun001"; // Pudding, Dun + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 4:sChoice = "puddingbrown001"; // Pudding, Brown + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom15.ncs b/nwnds_module/re_custom15.ncs new file mode 100644 index 000000000..1c6538ece Binary files /dev/null and b/nwnds_module/re_custom15.ncs differ diff --git a/nwnds_module/re_custom15.nss b/nwnds_module/re_custom15.nss new file mode 100644 index 000000000..4cfd52ee3 --- /dev/null +++ b/nwnds_module/re_custom15.nss @@ -0,0 +1,123 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 15 - Gith Caverns + +Areas Used in: +Gith Caverns + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "ar_gith_001"; // Gith, Common + fCR = 1.0; + iMinNum = 1; + iMaxNum = 20; + iWeight = 16; + break; + + case 1:sChoice = "ar_gith_002"; // Gith, Warrior + fCR = 6.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 2:sChoice = "ar_gith_003"; // Gith, Archer + fCR = 6.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 3:sChoice = "ar_gith_004"; // Gith, Psion + fCR = 7.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 4:sChoice = "ar_gith_007"; // Gith, Shaman + fCR = 10.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 5:sChoice = "ar_gith_005"; // Gith, Raider + fCR = 15.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 6:sChoice = "ar_gith_006"; // Gith, Scout + fCR = 14.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom16.ncs b/nwnds_module/re_custom16.ncs new file mode 100644 index 000000000..080e0b8cc Binary files /dev/null and b/nwnds_module/re_custom16.ncs differ diff --git a/nwnds_module/re_custom16.nss b/nwnds_module/re_custom16.nss new file mode 100644 index 000000000..d859ec0f1 --- /dev/null +++ b/nwnds_module/re_custom16.nss @@ -0,0 +1,327 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 16 - The Ringing Mountains + +Areas Used in: +The Ringing Mountains + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "ar_gith_001"; // Gith, Common + fCR = 1.0; + iMinNum = 2; + iMaxNum = 10; + iWeight = 4; + break; + + case 1:sChoice = "ar_gith_002"; // Gith, Warrior + fCR = 6.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 2; + break; + + case 2:sChoice = "ar_gith_003"; // Gith, Archer + fCR = 6.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 2; + break; + + case 3:sChoice = "ar_gith_005"; // Gith, Raider + fCR = 15.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 4:sChoice = "ar_gith_006"; // Gith, Scout + fCR = 14.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 5:sChoice = "ar_eagle001"; // Eagle + fCR = 1.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "ds_strine001"; // Strine + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 8; + break; + + case 7:sChoice = "blkmastyrial_001"; // Mastyrial, Black + fCR = 7.0; + iMinNum = 5; + iMaxNum = 20; + iWeight = 8; + break; + + case 8:sChoice = "ar_sout_001"; // So-Ut (Rampager) + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 9:sChoice = "tarek_001"; // Tarek + fCR = 5.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 10:sChoice = "ar_mepair001"; // Mephit, Air + fCR = 5.0; + iMinNum = 1; + iMaxNum = 12; + iWeight = 4; + break; + + case 11:sChoice = "xerichou002"; // Xerichou, Greater + fCR = 10.0; + iMinNum = 2; + iMaxNum = 9; + iWeight = 4; + break; + + case 12:sChoice = "drake_earth001"; // Drake, Earth + fCR = 19.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 13:sChoice = "elem_air_sm001"; // [AR] Air Elemental, Small + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 14:sChoice = "elem_air_md001"; // [AR] Air Elemental, Medium + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 15:sChoice = "elem_air_lg001"; // [AR] Air Elemental, Large + fCR = 13.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 16:sChoice = "elem_air_hg001"; // [AR] Air Elemental, Huge + fCR = 25.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 17:sChoice = "ar_bloodhawk_001"; // Bloodhawk + fCR = 1.0; + iMinNum = 6; + iMaxNum = 11; + iWeight = 8; + break; + + case 18:sChoice = "ar_brdrinker_001"; // Breathdrinker + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 19:sChoice = "ar_chimera001"; // Chimera [AR] + fCR = 9.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 20:sChoice = "crystalspider002"; // Crystal Spider, Greater + fCR = 22.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 21:sChoice = "ar_ettin001"; // Ettin [AR] + fCR = 11.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 4; + break; + + case 22:sChoice = "ar_braxat_001"; // Braxat + fCR = 14.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 23:sChoice = "ar_braxat_002"; // Braxat Preserver + fCR = 24.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 24:sChoice = "ar_braxat_002"; // Braxat Preserver + fCR = 24.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 25:sChoice = "ar_hawk002"; // Hawk, Dire + fCR = 6.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 26:sChoice = "ar_rocklizard001"; // Lizard, Rock-Horned + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 27:sChoice = "shardspider001"; // Shard Spider + fCR = 7.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 28:sChoice = "takis001"; // Takis + fCR = 5.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 29:sChoice = "tembo001"; // Tembo + fCR = 6.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 8; + break; + + case 30:sChoice = "tembo002"; // Tembo, Greater + fCR = 9.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 31:sChoice = "tigone001"; // Tigone + fCR = 5.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 32:sChoice = "windwalker001"; // Wind Walker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 33:sChoice = "windwalker001"; // Wind Walker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 34:sChoice = "ds_ztal001"; // Z'tal + fCR = 2.0; + iMinNum = 4; + iMaxNum = 10; + iWeight = 16; + break; + + case 35:sChoice = "ar_zhackal_001"; // Zhackal + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom17.ncs b/nwnds_module/re_custom17.ncs new file mode 100644 index 000000000..137f9f2ca Binary files /dev/null and b/nwnds_module/re_custom17.ncs differ diff --git a/nwnds_module/re_custom17.nss b/nwnds_module/re_custom17.nss new file mode 100644 index 000000000..df5deced7 --- /dev/null +++ b/nwnds_module/re_custom17.nss @@ -0,0 +1,159 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 17 - The Ringing Mountains - River Cave + +Areas Used in: +The Ringing Mountains - River Cave + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "elem_water_sm001"; // [AR] Water Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 1:sChoice = "elem_water_md001"; // [AR] Water Elemental, Medium + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 2:sChoice = "elem_water_lg001"; // [AR] Water Elemental, Large + fCR = 8.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 3:sChoice = "elem_water_hg001"; // [AR] Water Elemental, Huge + fCR = 17.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 4:sChoice = "elem_water_gr001"; // [AR] Water Elemental, Greater + fCR = 22.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 5:sChoice = "elem_water_el001"; // [AR] Water Elemental, Elder + fCR = 24.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "drake_water001"; // Drake, Water + fCR = 16.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 7:sChoice = "ar_mepwater001"; // Mephit, Water + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 8:sChoice = "slimeolive001"; // Olive Slime + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 9:sChoice = "ar_anglerooze001"; // Ooze, Angler + fCR = 3.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 10:sChoice = "oozecrystal_001"; // Ooze, Crystal + fCR = 2.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 11:sChoice = "ar_algoid001"; // Algoid, Large + fCR = 7.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom18.ncs b/nwnds_module/re_custom18.ncs new file mode 100644 index 000000000..e005e543a Binary files /dev/null and b/nwnds_module/re_custom18.ncs differ diff --git a/nwnds_module/re_custom18.nss b/nwnds_module/re_custom18.nss new file mode 100644 index 000000000..8c9aedd3e --- /dev/null +++ b/nwnds_module/re_custom18.nss @@ -0,0 +1,124 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 18 - The Great Alluvial Sand Wastes - Red Sands + +Areas Used in: +The Great Alluvial Sand Wastes - Red Sands + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "dunereaper001"; // [AR] Dune Reaper, Drone + fCR = 9.0; + iMinNum = 2; + iMaxNum = 15; + iWeight = 8; + break; + + case 1:sChoice = "dunestalker_001"; // Dune Stalker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 2:sChoice = "dunereaper002"; // [AR] Dune Reaper, Warrior + fCR = 10.0; + iMinNum = 2; + iMaxNum = 15; + iWeight = 4; + break; + + case 3:sChoice = "ar_defiler_001"; // Defiler, Apprentice + fCR = 7.0; + iMinNum = 2; + iMaxNum = 3; + iWeight = 2; + break; + + case 4:sChoice = "elem_fire_sm001"; // [AR] Fire Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 5:sChoice = "elem_fire_md001"; // [AR] Fire Elemental, Medium + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "elem_fire_lg001"; // [AR] Fire Elemental, Large + fCR = 10.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom19.ncs b/nwnds_module/re_custom19.ncs new file mode 100644 index 000000000..46655568f Binary files /dev/null and b/nwnds_module/re_custom19.ncs differ diff --git a/nwnds_module/re_custom19.nss b/nwnds_module/re_custom19.nss new file mode 100644 index 000000000..59f7962c4 --- /dev/null +++ b/nwnds_module/re_custom19.nss @@ -0,0 +1,138 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 19 - The Great Alluvial Sand Wastes - Blood Sands + +Areas Used in: +The Great Alluvial Sand Wastes - Blood Sands + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "dunereaper001"; // [AR] Dune Reaper, Drone + fCR = 9.0; + iMinNum = 2; + iMaxNum = 15; + iWeight = 8; + break; + + case 1:sChoice = "dunestalker_001"; // Dune Stalker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 2:sChoice = "dunereaper002"; // [AR] Dune Reaper, Warrior + fCR = 10.0; + iMinNum = 2; + iMaxNum = 15; + iWeight = 4; + break; + + case 3:sChoice = "ar_defiler_001"; // Defiler, Apprentice + fCR = 7.0; + iMinNum = 2; + iMaxNum = 3; + iWeight = 2; + break; + + case 4:sChoice = "elvenraider001"; // Elven Raider + fCR = 10.0; + iMinNum = 2; + iMaxNum = 3; + iWeight = 4; + break; + + case 5:sChoice = "blkmastyrial_001"; // Mastyrial, Black + fCR = 8.0; + iMinNum = 5; + iMaxNum = 15; + iWeight = 8; + break; + + case 6:sChoice = "elem_fire_lg001"; // [AR] Fire Elemental, Large + fCR = 10.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 7:sChoice = "elem_fire_sm001"; // [AR] Fire Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 8:sChoice = "elem_fire_md001"; // [AR] Fire Elemental, Medium + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom2.ncs b/nwnds_module/re_custom2.ncs new file mode 100644 index 000000000..4b0fa6ff4 Binary files /dev/null and b/nwnds_module/re_custom2.ncs differ diff --git a/nwnds_module/re_custom2.nss b/nwnds_module/re_custom2.nss new file mode 100644 index 000000000..16884fb76 --- /dev/null +++ b/nwnds_module/re_custom2.nss @@ -0,0 +1,357 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 2 - Desert Civilzed 5-10th lvl + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "tarek_001"; // Tarek + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 1:sChoice = "humanbandit_001"; //Human Bandit - Shortsword + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 2:sChoice = "halfbandit_001"; //Halfling Bandit - Daggers + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 3:sChoice = "humanbandit_002"; //Human Bandit - Psion + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 4:sChoice = "dunebandit_002"; //Dune Bandit - Longbow + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 5:sChoice = "dunebandit_003"; //Dune Bandit - Mystic Theurge + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 6:sChoice = "dunebandit_001"; //Dune Bandit - Longsword + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 7:sChoice = "banditguard_002"; //Bandit Guard - Greataxe + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 8:sChoice = "banditguard_003"; //Bandit Guard - Trikal + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 9:sChoice = "banditguard_001"; //Bandit Guard, Mul - Short Swords + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 10:sChoice = "magera_001"; //Magera + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 11:sChoice = "slig002"; //Slig, Common + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 12:sChoice = "anakore1"; //Anakore + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 13:sChoice = "belgoi001"; //Belgoi + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 14:sChoice = "bulette"; //Bulette + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 15:sChoice = "kestrekel001"; //Kes'trekel, Small + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 16:sChoice = "ar_gulgslaver004"; //Gulgan Slaver - Human + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 17:sChoice = "ar_gulgslaver003"; //Gulgan Slaver - Half-Elf + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 18:sChoice = "monst_spider003"; //Monstrous Spider, Medium + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 19:sChoice = "ar_defiler_001"; //Defiler, Apprentice + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 20:sChoice = "tagster001"; //Tagster + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 21:sChoice = "ds_siltspider001"; //Silt Spider + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 22:sChoice = "monst_spider004"; //Monstrous Spider, Large + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 23:sChoice = "monst_spider001"; //Monstrous Spider, Tiny + fCR = 0.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 24:sChoice = "ar_daggoran_001"; //Daggoran + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 25:sChoice = "ar_c_jathlagak"; //Jalath'gak + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 26:sChoice = "ankheg001"; //Ankheg + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 27:sChoice = "ds_dunecrab001"; //Dunecrab + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 28:sChoice = "ds_dunecrab002"; //Dunecrab, Greater + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 29:sChoice = "ar_mandragora001"; //Mandragora + fCR = 3.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 30:sChoice = "ar_ssurran_001"; //Ssurran, Common + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 31:sChoice = "ar_ssurran_002"; //Ssurran, Raider + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 32:sChoice = "ar_bladehood001"; //Blade Hood + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 33:sChoice = "ar_lion001"; //Lion, Female + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 34:sChoice = "ar_lion002"; //Lion, Male + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 35:sChoice = "sandhowler001"; //Sand Howler + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 36:sChoice = "dunestalker_001"; //Dune Stalker + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 37:sChoice = "ds_g_lizard001"; //Lizard, Giant + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 38:sChoice = "monst_scorp002"; //Monstrous Scorpion, Small + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 39:sChoice = "ar_rocklizard001"; //Lizard, Rock-Horned + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 40:sChoice = "ar_bloodhawk_001"; //Bloodhawk + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 41:sChoice = "desertviper_001"; //Desert Viper, Small + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom20.ncs b/nwnds_module/re_custom20.ncs new file mode 100644 index 000000000..5a7ff8b52 Binary files /dev/null and b/nwnds_module/re_custom20.ncs differ diff --git a/nwnds_module/re_custom20.nss b/nwnds_module/re_custom20.nss new file mode 100644 index 000000000..bcd446898 --- /dev/null +++ b/nwnds_module/re_custom20.nss @@ -0,0 +1,89 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 20 - The Great Alluvial Sand Wastes - Blood Sands - Mastyrial Lair + +Areas Used in: +The Great Alluvial Sand Wastes - Blood Sands - Mastyrial Lair + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "blkmastyrial_001"; // Mastyrial, Black + fCR = 7.0; + iMinNum = 5; + iMaxNum = 20; + iWeight = 8; + break; + + case 1:sChoice = "blkmastyrial_002"; // Mastyrial, Black - Medium + fCR = 8.0; + iMinNum = 2; + iMaxNum = 10; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom21.ncs b/nwnds_module/re_custom21.ncs new file mode 100644 index 000000000..26dbe0f53 Binary files /dev/null and b/nwnds_module/re_custom21.ncs differ diff --git a/nwnds_module/re_custom21.nss b/nwnds_module/re_custom21.nss new file mode 100644 index 000000000..c07e9bf5b --- /dev/null +++ b/nwnds_module/re_custom21.nss @@ -0,0 +1,340 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 21 - The Forest Ridge + +Areas Used in: +The Forest Ridge + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "halfhunter001"; // Feral Halfling Hunter + fCR = 20.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 4; + break; + + case 1:sChoice = "halfranger001"; // Feral Halfling Ranger + fCR = 15.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 8; + break; + + case 2:sChoice = "half_rg_druid001"; // Feral Halfling Rouge / Druid + fCR = 18.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 3:sChoice = "ar_ape001"; // Ape, Dire + fCR = 5.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 4:sChoice = "ar_aranea001"; // Aranea + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 5:sChoice = "assassinvine001"; // Assassin Vine - Horizontal + fCR = 3.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 6:sChoice = "assassinvine002"; // Assassin Vine - Vertical + fCR = 3.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 7:sChoice = "ar_bear001"; // Bear, Black + fCR = 3.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 16; + break; + + case 8:sChoice = "ar_ettercap001"; // Ettercap [AR] + fCR = 6.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 9:sChoice = "ar_hawk002"; // Hawk, Dire + fCR = 6.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 10:sChoice = "ar_krenshar001"; // Krenshar [AR] + fCR = 3.0; + iMinNum = 2; + iMaxNum = 10; + iWeight = 4; + break; + + case 11:sChoice = "ar_leopard001"; // Leopard + fCR = 3.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 12:sChoice = "monst_spider001"; // Monstrous Spider, Tiny [AR] + fCR = 0.33; + iMinNum = 8; + iMaxNum = 16; + iWeight = 16; + break; + + case 13:sChoice = "monst_spider002"; // Monstrous Spider, Small [AR] + fCR = 1.0; + iMinNum = 1; + iMaxNum = 11; + iWeight = 16; + break; + + case 14:sChoice = "monst_spider003"; // Monstrous Spider, Medium [AR] + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 16; + break; + + case 15:sChoice = "monst_spider004"; // Monstrous Spider, Large [AR] + fCR = 8.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 16:sChoice = "ar_owlbear_001"; // Owlbear + fCR = 5.0; + iMinNum = 1; + iMaxNum = 8; + iWeight = 4; + break; + + case 17:sChoice = "ar_pseudodrag001"; // Psuedodragon + fCR = 1.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 18:sChoice = "ar_tiger002"; // Tiger + fCR = 6.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 19:sChoice = "ar_tiger001"; // Tiger, Dire + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 20:sChoice = "ar_tiger003"; // Tiger, Legendary + fCR = 27.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 21:sChoice = "ar_tiger003"; // Tiger, Legendary + fCR = 27.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 22:sChoice = "ar_raven001"; // Raven + fCR = 0.16; + iMinNum = 1; + iMaxNum = 1; + iWeight = 16; + break; + + case 23:sChoice = "puddingdun001"; // Pudding, Dun + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 24:sChoice = "shardspider001"; // Shard Spider + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 25:sChoice = "ds_aprig001"; // Aprig + fCR = 0.5; + iMinNum = 2; + iMaxNum = 20; + iWeight = 16; + break; + + case 26:sChoice = "ar_axebeak001"; // Axebeak + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 27:sChoice = "ar_hawk001"; // Hawk + fCR = 1.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 28:sChoice = "ds_idfiend001"; // Id Fiend + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 29:sChoice = "kirre001"; // Kirre + fCR = 8.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 30:sChoice = "kirre002"; // Kirre, Greater + fCR = 14.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 31:sChoice = "kirre003"; // Kirre, Legendary + fCR = 25.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 32:sChoice = "kivit001"; // Kivit + fCR = 1.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 33:sChoice = "sitak"; // Sitak + fCR = 1.0; + iMinNum = 1; + iMaxNum = 12; + iWeight = 4; + break; + + case 34:sChoice = "ds_athsloth001"; // Sloth, Athasian + fCR = 11.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 35:sChoice = "takis001"; // Takis + fCR = 5.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 36:sChoice = "tigone001"; // Tigone + fCR = 5.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 37:sChoice = "ar_zhackal_001"; // Zhackal + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom22.ncs b/nwnds_module/re_custom22.ncs new file mode 100644 index 000000000..2d9db4e0e Binary files /dev/null and b/nwnds_module/re_custom22.ncs differ diff --git a/nwnds_module/re_custom22.nss b/nwnds_module/re_custom22.nss new file mode 100644 index 000000000..f3ba00889 --- /dev/null +++ b/nwnds_module/re_custom22.nss @@ -0,0 +1,123 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 22 - Spiders! + +Areas Used in: +UnderTyr - The Web + + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "monst_spider004"; // Monstrous Spider, Large [AR] + fCR = 4.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + + case 1:sChoice = "monst_spider003"; // Monstrous Spider, Medium [AR] + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 16; + break; + + case 2:sChoice = "monst_spider002"; // Monstrous Spider, Small [AR] + fCR = 1.0; + iMinNum = 1; + iMaxNum = 11; + iWeight = 16; + break; + + case 3:sChoice = "monst_spider001"; // Monstrous Spider, Tiny [AR] + fCR = 0.33; + iMinNum = 8; + iMaxNum = 16; + iWeight = 16; + break; + + case 4:sChoice = "ar_aranea001"; // Aranea + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 5:sChoice = "ar_ettercap001"; // Ettercap [AR] + fCR = 6.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 6:sChoice = "gntwolfspider001"; // Wolf Spider, Giant + fCR = 5.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom23.ncs b/nwnds_module/re_custom23.ncs new file mode 100644 index 000000000..6b5042bbb Binary files /dev/null and b/nwnds_module/re_custom23.ncs differ diff --git a/nwnds_module/re_custom23.nss b/nwnds_module/re_custom23.nss new file mode 100644 index 000000000..1707fb961 --- /dev/null +++ b/nwnds_module/re_custom23.nss @@ -0,0 +1,154 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 23 - Vermin CR 0 - CR 5 + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "crp_twigblight"; // Twig Blight + fCR = 0.5; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 1:sChoice = "direrat_001"; // Rat, Dire + fCR = 1.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 16; + break; + + case 2:sChoice = "wrab001"; // Wrab + fCR = 1.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 3:sChoice = "ar_gianttick001"; // Tick, Giant + fCR = 2.0; + iMinNum = 3; + iMaxNum = 6; + iWeight = 8; + break; + + case 4:sChoice = "zep_oliveslimes"; // Olive Slime + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 5:sChoice = "direrat_002"; // Rat, Dire - Greater + fCR = 3.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 8; + break; + + case 6:sChoice = "monst_spider003"; // Monstrous Spider, Medium [AR] + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 16; + break; + + case 7:sChoice = "monst_spider002"; // Monstrous Spider, Small [AR] + fCR = 1.0; + iMinNum = 1; + iMaxNum = 11; + iWeight = 16; + break; + + case 8:sChoice = "monst_spider001"; // Monstrous Spider, Tiny [AR] + fCR = 0.33; + iMinNum = 8; + iMaxNum = 16; + iWeight = 16; + break; + + case 9:sChoice = "ar_bladehood001"; // Blade Hood + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 10:sChoice = "ar_rat001"; // Rat, Common + fCR = 0.16; + iMinNum = 1; + iMaxNum = 6; + iWeight = 16; + break; + + case 11:sChoice = "gold_scorp001"; // Gold Scorpion + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom24.ncs b/nwnds_module/re_custom24.ncs new file mode 100644 index 000000000..359e2d005 Binary files /dev/null and b/nwnds_module/re_custom24.ncs differ diff --git a/nwnds_module/re_custom24.nss b/nwnds_module/re_custom24.nss new file mode 100644 index 000000000..193fe0aa6 --- /dev/null +++ b/nwnds_module/re_custom24.nss @@ -0,0 +1,151 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 24 - Crimson Ruins: LVL 20+ + +Areas Used in: +Crimson Ruins - 1st Floor + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + + case 0:sChoice = "ar_lask003"; // Lask Patriarch + fCR = 27.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 1:sChoice = "cloaker001"; // Cloaker + fCR = 11.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 2:sChoice = "ar_mepfire001"; // Mephit, Fire + fCR = 4.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 3:sChoice = "ar_bloodsent001"; // Bloodstone Sentinel + fCR = 12.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 4:sChoice = "ar_ebonsent001"; // Ebony Sentinel + fCR = 16.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 5:sChoice = "ar_onyxsent001"; // Onyx Sentinel + fCR = 8.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 4; + break; + + case 6:sChoice = "ar_skyrossent001"; // Skyros Sentinel + fCR = 5.0; + iMinNum = 3; + iMaxNum = 8; + iWeight = 4; + break; + + case 7:sChoice = "necrophidius"; // Necrophidius + fCR = 7.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 8:sChoice = "barbscorpion_001"; // Barbed Scorpion + fCR = 9.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 16; + break; + + case 9:sChoice = "crimscorpion_001"; // Crimson Scorpion + fCR = 18.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 10:sChoice = "crimscorpion_002"; // Black Touched Crimson Scorpion + fCR = 23.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom25.ncs b/nwnds_module/re_custom25.ncs new file mode 100644 index 000000000..07772f977 Binary files /dev/null and b/nwnds_module/re_custom25.ncs differ diff --git a/nwnds_module/re_custom25.nss b/nwnds_module/re_custom25.nss new file mode 100644 index 000000000..3845807e9 --- /dev/null +++ b/nwnds_module/re_custom25.nss @@ -0,0 +1,104 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 25 - Scaled Altaruk Guards + +Areas Used in: +Altaruk + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + + case 0:sChoice = "ar_altguard_001"; // Altaruk Guard + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 1:sChoice = "ar_altguard_002"; // Altaruk Guard + fCR = 16.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 2:sChoice = "ar_altguard_003"; // Altaruk Guard + fCR = 23.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 3:sChoice = "ar_altguard_004"; // Altaruk Guard + fCR = 32.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom26.ncs b/nwnds_module/re_custom26.ncs new file mode 100644 index 000000000..f7cc9ae64 Binary files /dev/null and b/nwnds_module/re_custom26.ncs differ diff --git a/nwnds_module/re_custom26.nss b/nwnds_module/re_custom26.nss new file mode 100644 index 000000000..8eb60c90d --- /dev/null +++ b/nwnds_module/re_custom26.nss @@ -0,0 +1,419 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 26 - Non-Water Elementals: All + +Areas Used in: +Drake's Demise + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + + case 0:sChoice = "elem_air_sm001"; // [AR] Air Elemental, Small + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 1:sChoice = "elem_air_md001"; // [AR] Air Elemental, Medium + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 2:sChoice = "elem_air_lg001"; // [AR] Air Elemental, Large + fCR = 16.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 3:sChoice = "elem_air_hg001"; // [AR] Air Elemental, Huge + fCR = 30.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 4:sChoice = "elem_air_gr001"; // [AR] Air Elemental, Greater + fCR = 40.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 5:sChoice = "elem_air_el001"; // [AR] Air Elemental, Elder + fCR = 45.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 6:sChoice = "elem_air_pr001"; // [AR] Air Elemental, Primal + fCR = 60.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 7:sChoice = "elem_earth_sm001"; // [AR] Earth Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 8:sChoice = "elem_earth_lg001"; // [AR] Earth Elemental, Medium + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 9:sChoice = "elem_air_lg001"; // [AR] Earth Elemental, Large + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 10:sChoice = "elem_earth_hg001"; // [AR] Earth Elemental, Huge + fCR = 17.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 11:sChoice = "elem_earth_gr001"; // [AR] Earth Elemental, Greater + fCR = 22.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 12:sChoice = "elem_earth_el001"; // [AR] Earth Elemental, Elder + fCR = 25.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 13:sChoice = "elem_earth_pr001"; // [AR] Earth Elemental, Primal + fCR = 53.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 14:sChoice = "elem_fire_sm001"; // [AR] Fire Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 15:sChoice = "elem_fire_md001"; // [AR] Fire Elemental, Medium + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 16:sChoice = "elem_fire_lg001"; // [AR] Fire Elemental, Large + fCR = 11.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 17:sChoice = "elem_fire_hg001"; // [AR] Fire Elemental, Huge + fCR = 30.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 18:sChoice = "elem_fire_gr001"; // [AR] Fire Elemental, Greater + fCR = 40.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 19:sChoice = "elem_fire_el001"; // [AR] Fire Elemental, Elder + fCR = 45.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 20:sChoice = "elem_fire_pr001"; // [AR] Fire Elemental, Primal + fCR = 72.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 21:sChoice = "elem_magma_sm001"; // [AR] Magma Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 22:sChoice = "elem_magma_md001"; // [AR] Magma Elemental, Medium + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 23:sChoice = "elem_magma_lg001"; // [AR] Magma Elemental, Large + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 24:sChoice = "elem_magma_hg001"; // [AR] Magma Elemental, Huge + fCR = 17.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 25:sChoice = "elem_magma_gr001"; // [AR] Magma Elemental, Greater + fCR = 22.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 26:sChoice = "elem_magma_el001"; // [AR] Magma Elemental, Elder + fCR = 24.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + /*case 27:sChoice = "elem_magma_pr001"; // [AR] Magma Elemental, Primal + fCR = 24.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; */ + + case 28:sChoice = "elem_silt_sm001"; // [AR] Silt Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 29:sChoice = "elem_silt_md001"; // [AR] Silt Elemental, Medium + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 30:sChoice = "elem_silt_lg001"; // [AR] Silt Elemental, Large + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 31:sChoice = "elem_silt_hg001"; // [AR] Silt Elemental, Huge + fCR = 15.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 32:sChoice = "elem_silt_gr001"; // [AR] Silt Elemental, Greater + fCR = 19.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 33:sChoice = "elem_silt_el001"; // [AR] Silt Elemental, Elder + fCR = 21.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 34:sChoice = "elem_sun_sm001"; // [AR] Sun Elemental, Small + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 35:sChoice = "elem_sun_md001"; // [AR] Sun Elemental, Medium + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 36:sChoice = "elem_sun_lg001"; // [AR] Sun Elemental, Large + fCR = 15.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 37:sChoice = "elem_sun_hg001"; // [AR] Sun Elemental, Huge + fCR = 30.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 38:sChoice = "elem_sun_gr001"; // [AR] Sun Elemental, Greater + fCR = 39.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 39:sChoice = "elem_sun_el001"; // [AR] Sun Elemental, Elder + fCR = 44.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 40:sChoice = "ar_belker001"; // Belker [AR] + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 41:sChoice = "ar_brdrinker_001"; // Breathdrinker + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 42:sChoice = "crystalspider001"; // Crystal Spider + fCR = 11.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 43:sChoice = "crystalspider002"; // Crystal Spider, Greater + fCR = 18.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 44:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 45:sChoice = "grueildriss001"; // Grue, Ildriss + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 46:sChoice = "windwalker001"; // Wind Walker + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 47:sChoice = "ar_aerservant001"; // Aerial Servant + fCR = 18.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 48:sChoice = "ar_aerservant002"; // Aerial Servant, Large + fCR = 37.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom27.ncs b/nwnds_module/re_custom27.ncs new file mode 100644 index 000000000..39bd43faf Binary files /dev/null and b/nwnds_module/re_custom27.ncs differ diff --git a/nwnds_module/re_custom27.nss b/nwnds_module/re_custom27.nss new file mode 100644 index 000000000..5afebd659 --- /dev/null +++ b/nwnds_module/re_custom27.nss @@ -0,0 +1,138 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 27 - The Spyre + +Areas Used in: +The Spyre Tower + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + + case 0:sChoice = "ar_defiler_001"; // Defiler, Apprentice + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 1:sChoice = "ar_defiler_002"; // Defiler, Journeyman + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 2:sChoice = "ar_salamander002"; // Salamander, Flamebrother + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 3:sChoice = "ar_skyrossent001"; // Marble Sentinel, Skyros + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 16; + break; + + case 4:sChoice = "elem_earth_sm001"; // [AR] Earth Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 5:sChoice = "elem_fire_sm001"; // [AR] Fire Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 6:sChoice = "elem_silt_sm001"; // [AR] Silt Elemental, Small + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 7:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 8:sChoice = "grueildriss001"; // Grue, Ildriss + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom28.ncs b/nwnds_module/re_custom28.ncs new file mode 100644 index 000000000..66fd2651a Binary files /dev/null and b/nwnds_module/re_custom28.ncs differ diff --git a/nwnds_module/re_custom28.nss b/nwnds_module/re_custom28.nss new file mode 100644 index 000000000..f99b256b8 --- /dev/null +++ b/nwnds_module/re_custom28.nss @@ -0,0 +1,131 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 28 - Cold Fire Depths (Half-Elemental Ogres) + +Areas Used in: +Cold Fire Depths + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + + case 0:sChoice = "ds_chasmheart01"; // Chasm-Heart Clan + fCR = 8.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 1:sChoice = "ds_chasmheart02"; // Chasm-Heart Clan Brute + fCR = 16.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 2:sChoice = "ds_flamewalker01"; // Flame-Walker Clan + fCR = 8.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 12; + break; + + case 3:sChoice = "ds_flamewalker02"; // Flame-Walker Clan Pyro + fCR = 13.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 4:sChoice = "ds_glacierflow01"; // Glacier-Flow Clan + fCR = 8.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 12; + break; + + case 5:sChoice = "ds_glacierflow02"; // Glacier-Flow Clan Scoundrel + fCR = 14.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 7:sChoice = "grueildriss001"; // Grue, Ildriss + fCR = 5.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom3.ncs b/nwnds_module/re_custom3.ncs new file mode 100644 index 000000000..e8e319852 Binary files /dev/null and b/nwnds_module/re_custom3.ncs differ diff --git a/nwnds_module/re_custom3.nss b/nwnds_module/re_custom3.nss new file mode 100644 index 000000000..99672aea8 --- /dev/null +++ b/nwnds_module/re_custom3.nss @@ -0,0 +1,321 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 3 - Desert Wilderness 5-10th lvl + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "tarek_001"; // Tarek + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 1:sChoice = "ar_amphis001"; // Amphisbaena + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 2:sChoice = "ar_flamsnake_001"; // Flame Snake, Minor + fCR = 0.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 3:sChoice = "ar_owlbear_001"; // Owlbear + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 4:sChoice = "ar_axebeak001"; // Axe Beak + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 5:sChoice = "ar_wolfspider001"; // Wolf-Spider + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 6:sChoice = "ds_ztal001"; // Z'tal + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 7:sChoice = "magera_001"; //Magera + fCR = 6.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 8:sChoice = "slig002"; //Slig, Common + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 9:sChoice = "anakore1"; //Anakore + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 10:sChoice = "belgoi001"; //Belgoi + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 11:sChoice = "bulette"; //Bulette + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 12:sChoice = "kestrekel001"; //Kes'trekel, Small + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 13:sChoice = "ar_defiler_001"; //Defiler, Apprentice + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 14:sChoice = "tagster001"; //Tagster + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 15:sChoice = "ds_siltspider001"; //Silt Spider + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 16:sChoice = "monst_spider004"; //Monstrous Spider, Large + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 17:sChoice = "monst_spider001"; //Monstrous Spider, Tiny + fCR = 0.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 18:sChoice = "ar_daggoran_001"; //Daggoran + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 19:sChoice = "ar_c_jathlagak"; //Jalath'gak + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 20:sChoice = "ankheg001"; //Ankheg + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 21:sChoice = "ds_dunecrab001"; //Dunecrab + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 22:sChoice = "ds_dunecrab002"; //Dunecrab, Greater + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 23:sChoice = "ar_mandragora001"; //Mandragora + fCR = 3.5; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 24:sChoice = "ar_ssurran_001"; //Ssurran, Common + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 25:sChoice = "ar_ssurran_002"; //Ssurran, Raider + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 26:sChoice = "ar_bladehood001"; //Blade Hood + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 27:sChoice = "ar_lion001"; //Lion, Female + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 28:sChoice = "ar_lion002"; //Lion, Male + fCR = 5.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 29:sChoice = "sandhowler001"; //Sand Howler + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 30:sChoice = "dunestalker_001"; //Dune Stalker + fCR = 7.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 31:sChoice = "ds_g_lizard001"; //Lizard, Giant + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 32:sChoice = "monst_scorp002"; //Monstrous Scorpion, Small + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 33:sChoice = "ar_rocklizard001"; //Lizard, Rock-Horned + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 34:sChoice = "ar_bloodhawk_001"; //Bloodhawk + fCR = 3.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 35:sChoice = "desertviper_001"; //Desert Viper, Small + fCR = 4.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 3; + break; + + case 36:sChoice = "monst_scorp003"; //Monstrous Scorpion, Medium + fCR = 2.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom4.ncs b/nwnds_module/re_custom4.ncs new file mode 100644 index 000000000..e57acaac4 Binary files /dev/null and b/nwnds_module/re_custom4.ncs differ diff --git a/nwnds_module/re_custom4.nss b/nwnds_module/re_custom4.nss new file mode 100644 index 000000000..914c79b8a --- /dev/null +++ b/nwnds_module/re_custom4.nss @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 4 - Dark Spider Lair + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "darkspider002"; // Dark Spider, Defiler + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 1; + break; + + case 1:sChoice = "darkspider003"; // Dark Spider, Psion + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 2:sChoice = "darkspider001"; // Dark Spider, Warrior + fCR = 9.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} \ No newline at end of file diff --git a/nwnds_module/re_custom5.ncs b/nwnds_module/re_custom5.ncs new file mode 100644 index 000000000..fa300b442 Binary files /dev/null and b/nwnds_module/re_custom5.ncs differ diff --git a/nwnds_module/re_custom5.nss b/nwnds_module/re_custom5.nss new file mode 100644 index 000000000..689baf2db --- /dev/null +++ b/nwnds_module/re_custom5.nss @@ -0,0 +1,126 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 5 - Tyr Fields + (CR 3) area + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "humanbandit_001"; // Bandit, Human - Short Sword + fCR = 3.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 16; + break; + + case 1:sChoice = "humanbandit_002"; // Bandit, Human - Psionic + fCR = 3.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 2:sChoice = "halfbandit_001"; // Bandit, Halfling - Daggers + fCR = 3.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 3:sChoice = "slig002"; // Slig, Common + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 4:sChoice = "gold_scorp001"; // Gold Scorpion + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 5:sChoice = "monst_scorp001"; // Monstrous Scorpion, Tiny + fCR = 0.25; + iMinNum = 2; + iMaxNum = 8; + iWeight = 16; + break; + + case 6:sChoice = "monst_spider001"; // Monstrous Spider, Tiny + fCR = 0.25; + iMinNum = 2; + iMaxNum = 8; + iWeight = 16; + break; + + case 7:sChoice = "desertviper_001"; // Desert Viper, Small + fCR = 0.5; + iMinNum = 1; + iMaxNum = 2; + iWeight = 16; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom6.ncs b/nwnds_module/re_custom6.ncs new file mode 100644 index 000000000..76cf9e0be Binary files /dev/null and b/nwnds_module/re_custom6.ncs differ diff --git a/nwnds_module/re_custom6.nss b/nwnds_module/re_custom6.nss new file mode 100644 index 000000000..4d5ac3dfd --- /dev/null +++ b/nwnds_module/re_custom6.nss @@ -0,0 +1,105 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 6 - Tyr - Warrens (night time) + (CR 4-5) area + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "warrensthug001"; // Thug, Human - Shortsword + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 16; + break; + + case 1:sChoice = "direrat_001"; // Dire Rat + fCR = 1.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 2:sChoice = "halfbandit_001"; // Bandit, Halfling - Daggers + fCR = 3.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 3:sChoice = "slig002"; // Slig, Common + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 4:sChoice = "gold_scorp001"; // Gold Scorpion + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom7.ncs b/nwnds_module/re_custom7.ncs new file mode 100644 index 000000000..ef9b7f47d Binary files /dev/null and b/nwnds_module/re_custom7.ncs differ diff --git a/nwnds_module/re_custom7.nss b/nwnds_module/re_custom7.nss new file mode 100644 index 000000000..9e993b097 --- /dev/null +++ b/nwnds_module/re_custom7.nss @@ -0,0 +1,330 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 7 - Underground / Sewers CR 0 - CR 5 + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "crp_twigblight"; // Twig Blight + fCR = 0.5; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 1:sChoice = "ar_shadowasp001"; // Shadow Asp + fCR = 0.5; + iMinNum = 1; + iMaxNum = 6; + iWeight = 2; + break; + + case 2:sChoice = "direrat_001"; // Rat, Dire + fCR = 1.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 16; + break; + + case 3:sChoice = "skeletonhuman001"; // Skeleton, Human + fCR = 1.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 8; + break; + + case 4:sChoice = "skeletondwarf001"; // Skeleton, Dwarf + fCR = 1.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 5:sChoice = "wrab001"; // Wrab + fCR = 1.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "ar_gianttick001"; // Tick, Giant + fCR = 2.0; + iMinNum = 3; + iMaxNum = 6; + iWeight = 8; + break; + + case 7:sChoice = "vilstrak001"; // Vilstrak + fCR = 2.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 4; + break; + + case 8:sChoice = "skeletonhgiant"; // Skeleton, Half-Giant + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 9:sChoice = "ar_ethfilcher001"; // Ethereal Filcher + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 10:sChoice = "slimeolive001"; // Olive Slime + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 11:sChoice = "ar_shadowrat001"; // Shadow Rat, Common + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + + case 12:sChoice = "elem_earth_sm001"; // [AR] Earth Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 13:sChoice = "antloid002"; // Antloid Worker + fCR = 3.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 14:sChoice = "cr_hejkin001"; // Hej-Kin, Warrior + fCR = 3.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 4; + break; + + case 15:sChoice = "ar_anglerooze001"; // Ooze, Angler + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 16:sChoice = "ar_shadowrat002"; // Shadow Rat, Dire + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 17:sChoice = "direrat_002"; // Rat, Dire - Greater + fCR = 3.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 8; + break; + + case 18:sChoice = "shadow003"; // Shadow, Lesser + fCR = 3.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 8; + break; + + case 19:sChoice = "ar_mepearth001"; // Mephit, Earth + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 20:sChoice = "shadow001"; // Shadow + fCR = 4.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + + case 21:sChoice = "slithertrack001"; // Slithering Tracker + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 22:sChoice = "ar_mepsalt001"; // Mephit, Salt + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 23:sChoice = "ar_amphis001"; // Amphisibaena + fCR = 4.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 24:sChoice = "ar_mepooze001"; // Mephit, Ooze + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 25:sChoice = "stunjelly001"; // Stunjelly + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 26:sChoice = "tchowb_001"; // T'Chowb + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 27:sChoice = "jellymustard001"; // Jelly, Mustard + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 28:sChoice = "magera_001"; // Magera, Common + fCR = 5.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 29:sChoice = "ar_pakubrazi_001"; // Pakubrazi + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 30:sChoice = "ar_bladehood001"; // Blade Hood + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 31:sChoice = "elem_earth_md001"; // [AR] Earth Elemental, Medium + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 32:sChoice = "ar_rat001"; // Rat, Common + fCR = 0.16; + iMinNum = 1; + iMaxNum = 6; + iWeight = 16; + break; + + case 33:sChoice = "ghast001"; // Ghast + fCR = 5.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 4; + break; + + case 34:sChoice = "tarek_001"; // Tarek + fCR = 5.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 35:sChoice = "ar_leechgiant"; // Leech, Giant + fCR = 1.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 8; + break; + + case 36:sChoice = "oozecrystal_001"; // Ooze, Crystal + fCR = 4.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom8.ncs b/nwnds_module/re_custom8.ncs new file mode 100644 index 000000000..7b3c2653a Binary files /dev/null and b/nwnds_module/re_custom8.ncs differ diff --git a/nwnds_module/re_custom8.nss b/nwnds_module/re_custom8.nss new file mode 100644 index 000000000..3d0ea77d3 --- /dev/null +++ b/nwnds_module/re_custom8.nss @@ -0,0 +1,148 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 8 - Underground / Hej-Kin Lairs CR 0 - CR 5 + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "vilstrak001"; // Vilstrak + fCR = 2.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 4; + break; + + case 1:sChoice = "elem_earth_sm001"; // [AR] Earth Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 2:sChoice = "antloid002"; // Antloid Worker + fCR = 3.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 8; + break; + + case 3:sChoice = "cr_hejkin001"; // Hej-Kin, Warrior + fCR = 3.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 16; + break; + + case 4:sChoice = "direrat_002"; // Rat, Dire - Greater + fCR = 3.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 8; + break; + + case 5:sChoice = "ar_mepearth001"; // Mephit, Earth + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 6:sChoice = "ar_mepsalt001"; // Mephit, Salt + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 7:sChoice = "ar_mepooze001"; // Mephit, Ooze + fCR = 4.0; + iMinNum = 1; + iMaxNum = 6; + iWeight = 4; + break; + + case 8:sChoice = "elem_earth_md001"; // [AR] Earth Elemental, Medium + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 9:sChoice = "ar_rat001"; // Rat, Common + fCR = 0.16; + iMinNum = 1; + iMaxNum = 6; + iWeight = 16; + break; + + case 10:sChoice = "direrat_001"; // Rat, Dire + fCR = 1.0; + iMinNum = 2; + iMaxNum = 6; + iWeight = 8; + break; + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom9.ncs b/nwnds_module/re_custom9.ncs new file mode 100644 index 000000000..14167e4e8 Binary files /dev/null and b/nwnds_module/re_custom9.ncs differ diff --git a/nwnds_module/re_custom9.nss b/nwnds_module/re_custom9.nss new file mode 100644 index 000000000..ff689a0c3 --- /dev/null +++ b/nwnds_module/re_custom9.nss @@ -0,0 +1,210 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Athas Reborn +Table 9 - Underground / Sewers CR 6 - CR 10 + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// =========================================================================================================================================== +// Encounter Weights +// Very Rare = 2 +// Rare = 4 +// Uncommon = 8 +// Common = 16 +//============================================================================================================================================ +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "ar_dagslime_001"; // Dagolar Slime + fCR = 6.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 1:sChoice = "ar_otyugh_001"; // Otyugh + fCR = 6.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 2:sChoice = "hejkin001"; // Hej-Kin, Preserver + fCR = 6.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 3:sChoice = "antloid004"; // Antloid Dynamis + fCR = 6.0; + iMinNum = 1; + iMaxNum = 10; + iWeight = 4; + break; + + case 4:sChoice = "ar_tyrslime_001"; // Tyrian Slime + fCR = 6.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 5:sChoice = "shadowmastiff001"; // Shadow Mastiff + fCR = 6.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 6:sChoice = "zombie003"; // Zombie, Human + fCR = 6.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 7:sChoice = "ar_algoid001"; // Algoid, Large + fCR = 7.0; + iMinNum = 3; + iMaxNum = 6; + iWeight = 4; + break; + + case 8:sChoice = "antloid003"; // Antloid Soldier + fCR = 2.0; + iMinNum = 7; + iMaxNum = 10; + iWeight = 8; + break; + + case 9:sChoice = "puddingdun001"; // Pudding, Dun + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 10:sChoice = "ar_bladehood002"; // Blade Hood, Greater + fCR = 8.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 11:sChoice = "ar_tyrslime_002"; // Tyrian Slime, Large + fCR = 9.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + + case 12:sChoice = "ar_brdrinker_001"; // Breathdrinker + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 13:sChoice = "dagslime_002"; // Dagolar Slime, Large + fCR = 10.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 14:sChoice = "ghast002"; // Ghast, Greater + fCR = 10.0; + iMinNum = 2; + iMaxNum = 4; + iWeight = 2; + break; + + case 15:sChoice = "xerichou002"; // Xerichou, Greater + fCR = 10.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 4; + break; + + case 16:sChoice = "xerichou001"; // Xerichou + fCR = 5.0; + iMinNum = 2; + iMaxNum = 8; + iWeight = 8; + break; + + case 17:sChoice = "ar_defiler_001"; // Defiler, Apprentice + fCR = 7.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 2; + break; + + case 18:sChoice = "warrensthug001"; // Thug, Human - Shortsword + fCR = 7.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 16; + break; + + case 19:sChoice = "direrat_003"; // Rat, Dire - Elder + fCR = 6.0; + iMinNum = 1; + iMaxNum = 10; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom96.ncs b/nwnds_module/re_custom96.ncs new file mode 100644 index 000000000..ea8b15af6 Binary files /dev/null and b/nwnds_module/re_custom96.ncs differ diff --git a/nwnds_module/re_custom96.nss b/nwnds_module/re_custom96.nss new file mode 100644 index 000000000..5a8890641 --- /dev/null +++ b/nwnds_module/re_custom96.nss @@ -0,0 +1,121 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 96 - Plains: All + +Areas Used in: +Crimson Savannah + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "pridemane001"; // Pridemane + fCR = 14.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 1:sChoice = "pridemane002"; // Pridemane, Ranger + fCR = 26.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 2:sChoice = "pridemane003"; // Pridemane, Barbarian + fCR = 24.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 3:sChoice = "ar_kreen_003"; // Thri-kreen, Druid + fCR = 13.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 4:sChoice = "ar_kreen_002"; // Thri-kreen, Ranger + fCR = 12.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 4; + break; + + case 5:sChoice = "bulette"; // Bulette + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 6:sChoice = "ar_chimera001"; // Chimera [AR] + fCR = 10.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + + case 7:sChoice = "ar_dragonne001"; // Dragonne + fCR = 8.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 8; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom97.ncs b/nwnds_module/re_custom97.ncs new file mode 100644 index 000000000..299a56449 Binary files /dev/null and b/nwnds_module/re_custom97.ncs differ diff --git a/nwnds_module/re_custom97.nss b/nwnds_module/re_custom97.nss new file mode 100644 index 000000000..4b6742201 --- /dev/null +++ b/nwnds_module/re_custom97.nss @@ -0,0 +1,177 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 97 - Undead - CR 10-30 + +Areas Used in: +Crimson Ruins - 1st Sublevel + +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "angelofdecay001"; // Angel of Decay + fCR = 32.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 1:sChoice = "ashen001"; // Ashen + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 2:sChoice = "thinkzombie003"; // Thinking Zombie, Mul - Epic DwD + fCR = 32.0; + iMinNum = 2; + iMaxNum = 3; + iWeight = 2; + break; + + case 3:sChoice = "blaspheme001"; // Blaspheme + fCR = 20.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 4:sChoice = "slaughterwight01"; // Slaughter Wight + fCR = 20.0; + iMinNum = 1; + iMaxNum = 10; + iWeight = 2; + break; + + case 5:sChoice = "dreamvestige001"; // Dream Vestige + fCR = 23.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 6:sChoice = "tliz001"; // T'liz + fCR = 37.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 7:sChoice = "ar_wraith002"; // Wraith, Dread + fCR = 23.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 8:sChoice = "boneclaw001"; // Boneclaw + fCR = 16.0; + iMinNum = 1; + iMaxNum = 11; + iWeight = 4; + break; + + case 9:sChoice = "wheep001"; // Wheep + fCR = 12.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 2; + break; + + case 10:sChoice = "shadow002"; // Shadow, Greater + fCR = 13.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 11:sChoice = "ar_shadowasp001"; // Shadow Asp + fCR = 0.5; + iMinNum = 3; + iMaxNum = 12; + iWeight = 2; + break; + + case 12:sChoice = "ashen002"; // Ashen, Evolved + fCR = 24.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 13:sChoice = "hulkcorpse001"; // Hulking Corpse + fCR = 17.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 14:sChoice = "ar_visage003"; // Visage, Evolved Greater + fCR = 36.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + + case 15:sChoice = "thinkzombie003"; // Visage, Evolved Greater + fCR = 31.0; + iMinNum = 0; + iMaxNum = 0; + iWeight = 2; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom98.ncs b/nwnds_module/re_custom98.ncs new file mode 100644 index 000000000..ebac1198f Binary files /dev/null and b/nwnds_module/re_custom98.ncs differ diff --git a/nwnds_module/re_custom98.nss b/nwnds_module/re_custom98.nss new file mode 100644 index 000000000..4da7c61da --- /dev/null +++ b/nwnds_module/re_custom98.nss @@ -0,0 +1,383 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 98 - Underground: All +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "dunestalker_001"; // Dune Stalker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 1:sChoice = "intdevourer001"; // Intellect Devourer + fCR = 10.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 2:sChoice = "ar_brdrinker001"; // Breathdrinker + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 3:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 4:sChoice = "grueildriss001"; // Grue, Ildriss + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 5:sChoice = "ar_aerservant001"; // Aerial Servant + fCR = 18.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "crp_teigblight"; // Twig Blight + fCR = 0.5; + iMinNum = 1; + iMaxNum = 10; + iWeight = 2; + break; + + case 7:sChoice = "ar_algoid001"; // Algoid, Large + fCR = 7.0; + iMinNum = 3; + iMaxNum = 6; + iWeight = 4; + break; + + case 8:sChoice = "ar_amphis001"; // Amphisibaena + fCR = 4.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 9:sChoice = "puddingbrown001"; // Pudding, Brown + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 10:sChoice = "puddingdun001"; // Pudding, Dun + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 11:sChoice = "jellymustard001"; // Jelly, Mustard + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 12:sChoice = "zep_oliveslimes"; // Olive Slime + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 13:sChoice = "slithertrack001"; // Slithering Tracker + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 14:sChoice = "sluggiant001"; // Giant Slug + fCR = 11.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 16; + break; + + case 15:sChoice = "ar_gianttick001"; // Tick, Giant + fCR = 2.0; + iMinNum = 3; + iMaxNum = 12; + iWeight = 4; + break; + + case 16:sChoice = "vilstrak001"; // Vilstrak + fCR = 2.0; + iMinNum = 2; + iMaxNum = 20; + iWeight = 4; + break; + + case 17:sChoice = "windwalker001"; // Windwalker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 2; + break; + + case 18:sChoice = "necrophidius"; // Necrophidius + fCR = 7.0; + iMinNum = 1; + iMaxNum = 5; + iWeight = 2; + break; + + case 19:sChoice = "cr_hejkin001"; // Hej-Kin, Warrior + fCR = 3.0; + iMinNum = 2; + iMaxNum = 5; + iWeight = 4; + break; + + case 20:sChoice = "hejkin001"; // Hej-Kin, Preserver + fCR = 6.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 21:sChoice = "ar_shadowasp001"; // Shadow Asp + fCR = 0.5; + iMinNum = 3; + iMaxNum = 12; + iWeight = 2; + break; + + case 22:sChoice = "elem_earth_sm001"; // Earth Elemental, Small + fCR = 3.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 23:sChoice = "elem_earth_md001"; // Earth Elemental, Medium + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 24:sChoice = "elem_earth_lg001"; // Earth Elemental, Large + fCR = 8.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 25:sChoice = "elem_earth_hg001"; // Earth Elemental, Huge + fCR = 17.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 26:sChoice = "direrat_001"; // Rat, Dire + fCR = 0.3; + iMinNum = 11; + iMaxNum = 20; + iWeight = 16; + break; + + case 27:sChoice = "tarek_001"; // Tarek + fCR = 5.0; + iMinNum = 1; + iMaxNum = 12; + iWeight = 8; + break; + + case 28:sChoice = "magera_001"; // Magera + fCR = 5.0; + iMinNum = 2; + iMaxNum = 8; + iWeight = 8; + break; + + case 29:sChoice = "magera_002"; // Magera Fighter + fCR = 11.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 30:sChoice = "ar_pakubrazi_001"; // Pakubrazi + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 31:sChoice = "ds_idfiend001"; // Id Fiend + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 32:sChoice = "elem_earth_gr001"; // Earth Elemental, Greater + fCR = 22.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 33:sChoice = "elem_earth_el001"; // Earth Elemental, Elder + fCR = 25.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 34:sChoice = "ar_bladehood001"; // Blade Hood + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 35:sChoice = "ar_bladehood002"; // Blade Hood, Greater + fCR = 8.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 36:sChoice = "ar_anglerooze001"; // Ooze, Angler + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 37:sChoice = "ar_dagslime_001"; // Dagolar Slime + fCR = 6.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 38:sChoice = "ar_dagslime_003"; // Dagolar Slime, Elder + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 39:sChoice = "ar_dagslime_002"; // Dagolar Slime, Large + fCR = 10.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 40:sChoice = "ar_tyrslime_001"; // Tyrian Slime + fCR = 6.0; + iMinNum = 1; + iMaxNum = 3; + iWeight = 4; + break; + + case 41:sChoice = "ar_tyrslime_003"; // Tyrian Slime, Elder + fCR = 11.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 42:sChoice = "ar_tyrslime_002"; // Tyrian Slime, Large + fCR = 9.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 43:sChoice = "cloaker001"; // Cloaker + fCR = 10.0; + iMinNum = 1; + iMaxNum = 12; + iWeight = 2; + break; + + case 44:sChoice = "ar_otyugh_001"; // Otyugh + fCR = 6.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 8; + break; + + case 45:sChoice = "ar_umberhulk001"; // Umberhulk + fCR = 10.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_custom99.ncs b/nwnds_module/re_custom99.ncs new file mode 100644 index 000000000..95df580b5 Binary files /dev/null and b/nwnds_module/re_custom99.ncs differ diff --git a/nwnds_module/re_custom99.nss b/nwnds_module/re_custom99.nss new file mode 100644 index 000000000..2467f9556 --- /dev/null +++ b/nwnds_module/re_custom99.nss @@ -0,0 +1,313 @@ +//////////////////////////////////////////////////// +/* +Custom Random Encounter Table for use with the BESIE +Random Encounter Package by Ray Miller + +Table 99 - Arena - All +*/ +//////////////////////////////////////////////////// + + +void main() +{ +int iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); +float fMinCR = GetLocalFloat(OBJECT_SELF, "re_fMinCR"); +float fMaxCR = GetLocalFloat(OBJECT_SELF, "re_fMaxCR"); +int END; +int iCounter1; +int iCounter2; +int iMaxNum; +int iMinNum; +int iWeight; +float fCR; +string sChoice; +object oMod = GetModule(); +while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//DO NOT EDIT ABOVE THIS LINE///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM ENCOUNTER TABLE BELOW://///////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/* case 0:sChoice = "tarek_001"; // Creature ResRef goes between the " marks. + fCR = 6.0; // Set this to the challenge rating of the creature as shown on the creature pallette. + iMinNum = 0; // + iMaxNum = 0; // If these are left at zero then an appropriate number of creatures will be spawned based on the CR. + iWeight = 4; // This is the number of times this mob should be considered for the likelyhood of appearing. + break; +*/ + case 0:sChoice = "nightmarebeast"; // Nightmare Beast + fCR = 32.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 1:sChoice = "intdevourer001"; // Intellect Devourer + fCR = 10.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 2:sChoice = "ar_brdrinker001"; // Breathdrinker + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 3:sChoice = "grueharginn001"; // Grue, Harginn + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 4:sChoice = "grueildriss001"; // Grue, Ildriss + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 5:sChoice = "ar_aerservant001"; // Aerial Servant + fCR = 18.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 6:sChoice = "ar_aerservant002"; // Aerial Servant, Large + fCR = 37.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 7:sChoice = "ar_algoid001"; // Algoid, Large + fCR = 7.0; + iMinNum = 3; + iMaxNum = 6; + iWeight = 4; + break; + + case 8:sChoice = "ar_amphis001"; // Amphisibaena + fCR = 4.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 9:sChoice = "puddingbrown001"; // Pudding, Brown + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 10:sChoice = "puddingdun001"; // Pudding, Dun + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 11:sChoice = "jellymustard001"; // Jelly, Mustard + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 12:sChoice = "slimeolive001"; // Olive Slime + fCR = 2.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 13:sChoice = "slithertrack001"; // Slithering Tracker + fCR = 4.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 14:sChoice = "sluggiant001"; // Giant Slug + fCR = 11.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 16; + break; + + case 15:sChoice = "ar_gianttick001"; // Tick, Giant + fCR = 2.0; + iMinNum = 3; + iMaxNum = 12; + iWeight = 4; + break; + + case 16:sChoice = "vilstrak001"; // Vilstrak + fCR = 2.0; + iMinNum = 2; + iMaxNum = 20; + iWeight = 4; + break; + + case 17:sChoice = "windwalker001"; // Windwalker + fCR = 7.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 2; + break; + + case 18:sChoice = "ar_flamsnake_001"; // Flame Snake, Minor + fCR = 0.5; + iMinNum = 4; + iMaxNum = 12; + iWeight = 8; + break; + + case 19:sChoice = "ar_flamsnake_002"; // Flame Snake, Lesser + fCR = 9.0; + iMinNum = 1; + iMaxNum = 9; + iWeight = 4; + break; + + case 20:sChoice = "ar_flamsnake_003"; // Flame Snake, Greater + fCR = 20.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 2; + break; + + case 21:sChoice = "ar_shadowasp001"; // Shadow Asp + fCR = 0.5; + iMinNum = 3; + iMaxNum = 12; + iWeight = 2; + break; + + case 22:sChoice = "drake_earth001"; // Drake, Earth + fCR = 19.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 23:sChoice = "drake_fire001"; // Drake, Fire + fCR = 15.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 24:sChoice = "drake_air001"; // Drake, Air + fCR = 23.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 25:sChoice = "drake_water001"; // Drake, Water + fCR = 16.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 2; + break; + + case 26:sChoice = "direrat_001"; // Rat, Dire + fCR = 0.3; + iMinNum = 11; + iMaxNum = 20; + iWeight = 16; + break; + + case 27:sChoice = "tarek_001"; // Tarek + fCR = 5.0; + iMinNum = 1; + iMaxNum = 12; + iWeight = 8; + break; + + case 28:sChoice = "magera_001"; // Magera + fCR = 5.0; + iMinNum = 2; + iMaxNum = 8; + iWeight = 8; + break; + + case 29:sChoice = "magera_002"; // Magera Fighter + fCR = 11.0; + iMinNum = 1; + iMaxNum = 4; + iWeight = 4; + break; + + case 30:sChoice = "ar_pakubrazi_001"; // Pakubrazi + fCR = 5.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 31:sChoice = "ds_idfiend001"; // Id Fiend + fCR = 9.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + + case 32:sChoice = "athasianbear001"; // Bear, Athasian + fCR = 19.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 33:sChoice = "bulette"; //Bulette + fCR = 10.0; + iMinNum = 1; + iMaxNum = 2; + iWeight = 4; + break; + + case 34:sChoice = "ar_lask002"; //Lask, Barbarian + fCR = 7.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 8; + break; + + case 35:sChoice = "ar_lask003"; //Lask, Epic Cleric + fCR = 27.0; + iMinNum = 1; + iMaxNum = 1; + iWeight = 4; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM ENCOUNTER TABLE! DO NOT EDIT BELOW THIS LINE////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + for(iCounter2 = 1; iCounter2 <= iWeight; iCounter2++) + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iVarNum), iMaxNum); + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iVarNum), iMinNum); + iVarNum++; + } + } + iCounter1++; + } +SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); +} diff --git a/nwnds_module/re_cv_commoner.dlg b/nwnds_module/re_cv_commoner.dlg new file mode 100644 index 000000000..6b0ab280b Binary files /dev/null and b/nwnds_module/re_cv_commoner.dlg differ diff --git a/nwnds_module/re_dancer_spawn.ncs b/nwnds_module/re_dancer_spawn.ncs new file mode 100644 index 000000000..d90c09f7a Binary files /dev/null and b/nwnds_module/re_dancer_spawn.ncs differ diff --git a/nwnds_module/re_dancer_spawn.nss b/nwnds_module/re_dancer_spawn.nss new file mode 100644 index 000000000..c3abf1798 --- /dev/null +++ b/nwnds_module/re_dancer_spawn.nss @@ -0,0 +1,109 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: RE_DANCER_SPAWN +//:: Copyright (c) 2012 Athas Reborn +//::////////////////////////////////////////////// +/* + OnSpawn Routine for Hairy Spider dancers. +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" +#include "ms_name_inc" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + //Randomizes NPC's Appearance + object oNPC = OBJECT_SELF; + string sTag = GetTag(oNPC); + +/* int nPheno; + nPheno = Random(4)+1; + if (nPheno == 3) + SetPhenoType(2, oNPC); + if (nPheno == 4) + SetPhenoType(40, oNPC); */ + + int nSkinColor; + nSkinColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_SKIN, nSkinColor); + + int nKeephead = GetLocalInt(OBJECT_SELF,"AR_KEEPHEAD"); + int nHeadNumber; + nHeadNumber = Random(12)+1; + if (nKeephead != 1) + { + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, OBJECT_SELF); + } + + int nHairColor; + nHairColor = Random(15); + SetColor(OBJECT_SELF, COLOR_CHANNEL_HAIR, nHairColor); + + //SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + + //Calls the Random Name Generator + ms_Nomenclature(OBJECT_SELF); + + + +} + + diff --git a/nwnds_module/re_levspawnerhb.ncs b/nwnds_module/re_levspawnerhb.ncs new file mode 100644 index 000000000..000e52e54 Binary files /dev/null and b/nwnds_module/re_levspawnerhb.ncs differ diff --git a/nwnds_module/re_levspawnerhb.nss b/nwnds_module/re_levspawnerhb.nss new file mode 100644 index 000000000..c06ff7dcf --- /dev/null +++ b/nwnds_module/re_levspawnerhb.nss @@ -0,0 +1,109 @@ +//::///////////////////////////////////////////////////////////////// +//:: FileName re_spawnerhb +//:: Copyright (c) 2001 Bioware Corp. +//::///////////////////////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE RES tool, part of the BESIE Random +Encounter package by Ray Miller. +*/ +//::///////////////////////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 9-2-02 +//::///////////////////////////////////////////////////////////////// +#include "re_rndenc" +void main() +{ +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// +//Set this parameter to FALSE if you wish +//your encounter distances to be constant +int RandomDistance = TRUE; +///////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////// +/* +If you want a PW RES tool to start and stop spawning +creatures at particular game times, set the following variables +to the appropriate times and save the script under a different +name. You could also set the local integers "re_iBegin" and +"re_iEnd" on the spawner externally if you wanted. +*/ +int StartTime = 0; +int StopTime = 0; +/////////////////////////////////////////////////////////// + + float fChanceOfEncounter; + if(StartTime || StopTime) + { + SetLocalInt(OBJECT_SELF, "re_iBegin", StartTime); + SetLocalInt(OBJECT_SELF, "re_iEnd", StopTime); + } + if(GetLocalInt(OBJECT_SELF, "re_iBegin") > 23) SetLocalInt(OBJECT_SELF, "re_iBegin", 23); + if(GetLocalInt(OBJECT_SELF, "re_iEnd") > 23) SetLocalInt(OBJECT_SELF, "re_iEnd", 23); + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "PW RES"); + } + if(GetLocalInt(GetModule(), "re_disablePWRES") || GetLocalInt(GetArea(OBJECT_SELF), "re_disablePWRES") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + int iStartTime = GetLocalInt(OBJECT_SELF, "re_iBegin"); + int iStopTime = GetLocalInt(OBJECT_SELF, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + fChanceOfEncounter = IntToFloat(GetMaxHitPoints(OBJECT_SELF)) / 100; + else fChanceOfEncounter = 0.0; + int iFaction; + int iCounterX; + object oEncounterObject; + object oArea = GetArea(OBJECT_SELF); + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + if(GetArea(oPC) == oArea) + { + string sLeader = GetPCPlayerName(GetFactionLeader(oPC)) + GetName(GetFactionLeader(oPC)); + if(!GetLocalInt(OBJECT_SELF, "i" + sLeader)) + { + iFaction++; + SetLocalString(OBJECT_SELF, "sFaction" + IntToString(iFaction), sLeader); + } + SetLocalInt(OBJECT_SELF, "i" + sLeader, GetLocalInt(OBJECT_SELF, "i" + sLeader) + 1); + SetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(GetLocalInt(OBJECT_SELF, "i" + sLeader)), oPC); + } + oPC = GetNextPC(); + } + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + if(!iFaction) return; + string sLeader = GetLocalString(OBJECT_SELF, "sFaction" + IntToString(Random(iFaction) + 1)); + int iMember = Random(GetLocalInt(OBJECT_SELF, "i" + sLeader)) + 1; + oEncounterObject = GetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(iMember)); + for(iCounterX = 1; iCounterX <= iFaction; iCounterX++) + { + DeleteLocalInt(OBJECT_SELF, "i" + GetLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX))); + DeleteLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX)); + } + string sTemplate = GetTag(OBJECT_SELF); + int iNumberOfParties; + int iMinDistance = RandomDistance; + int iLevel = GetFortitudeSavingThrow(OBJECT_SELF); + int iCheckDistance = GetReflexSavingThrow(OBJECT_SELF); + int iMaxDistance = GetWillSavingThrow(OBJECT_SELF); + + // Return if the resting variable is set by the re_onrest script. + if(GetLocalInt(oEncounterObject, "re_resting")) return; + + if(!iMaxDistance) + { + iMaxDistance = 1; + } + if(GetStringLeft(sTemplate, 3) != "re_") + sTemplate = "random"; + fChanceOfEncounter = IntToFloat(iFaction) * fChanceOfEncounter; + RandomEncounter(fChanceOfEncounter, oEncounterObject, sTemplate, 0, 0, iMinDistance, iMaxDistance, 360, 0, iCheckDistance, iLevel, 0); +} diff --git a/nwnds_module/re_mmorpghb.ncs b/nwnds_module/re_mmorpghb.ncs new file mode 100644 index 000000000..ef345d01d Binary files /dev/null and b/nwnds_module/re_mmorpghb.ncs differ diff --git a/nwnds_module/re_mmorpghb.nss b/nwnds_module/re_mmorpghb.nss new file mode 100644 index 000000000..3ddfc90c7 --- /dev/null +++ b/nwnds_module/re_mmorpghb.nss @@ -0,0 +1,153 @@ +//:://///////////////////////////////////////////// +//:: FileName re_mmorpghb.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE RES tool, part of the BESIE Random Encounter +package by Ray Miller. +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 9-2-02 +//::////////////////////////////////////////////// + +#include "re_rndenc" +void main() +{ +/////////////////////////////////////////////////////////// +/* +if you don't want a DM possessed NPC to produce spawns, +insert the following code into your module OnClientEnter +handler. + +note: this code is contained in the script "re_oncliententer" + +if(GetIsDM(GetEnteringObject())) SetLocalInt(GetModule(), "re_" + GetName(GetEnteringObject()), TRUE); +else DeleteLocalInt(GetModule(), "re_" + GetName(GetEnteringObject())); +*/ +/////////////////////////////////////////////////////////// +/* +If you want a MMORPG Spawner to start and stop spawning +creatures at particular game times, set the following variables +to the appropriate times and save the script under a different +name. You could also set the local integers "re_iBegin" and +"re_iEnd" on the spawner externally if you wanted. +*/ +int StartTime = 0; +int StopTime = 0; +/////////////////////////////////////////////////////////// + + int bTimeIn; + if(StartTime || StopTime) + { + SetLocalInt(OBJECT_SELF, "re_iBegin", StartTime); + SetLocalInt(OBJECT_SELF, "re_iEnd", StopTime); + } + if(GetLocalInt(OBJECT_SELF, "re_iBegin") > 23) SetLocalInt(OBJECT_SELF, "re_iBegin", 23); + if(GetLocalInt(OBJECT_SELF, "re_iEnd") > 23) SetLocalInt(OBJECT_SELF, "re_iEnd", 23); + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "MMORPG Spawner"); + } + if(GetLocalInt(GetModule(), "re_disableMMORPG") || GetLocalInt(GetArea(OBJECT_SELF), "re_disableMMORPG") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + int iStartTime = GetLocalInt(OBJECT_SELF, "re_iBegin"); + int iStopTime = GetLocalInt(OBJECT_SELF, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + bTimeIn = TRUE; + else bTimeIn = FALSE; + string sTemplate; + object oCreature; + object oAmIASpawn; + object oArea = GetArea(OBJECT_SELF); + int iTreasure; + int iType; + int bSpawnOne; + int iCounterPC; + int iCounterParty; + int iCounterSpawn; + int iSpawnRadius = GetFortitudeSavingThrow(OBJECT_SELF) * 5; + int iEncounterLevel = GetReflexSavingThrow(OBJECT_SELF); + int iMaxSpawns = GetWillSavingThrow(OBJECT_SELF); + float fZeroTest; + float fPCFactor; + float fChanceOfSpawn; + float fChallengeFactor; + float fFactor; + if(!iMaxSpawns) return; + if(!iEncounterLevel) + { + oAmIASpawn = GetFirstObjectInArea(oArea); + while(GetIsObjectValid(oAmIASpawn)) + { + if(GetIsPC(oAmIASpawn)) + { + iCounterPC++; + if(GetFactionLeader(oAmIASpawn) == oAmIASpawn) + { + iCounterParty++; + } + iEncounterLevel = iEncounterLevel + GetLevelByPosition(1, oAmIASpawn) + GetLevelByPosition(2, oAmIASpawn) + GetLevelByPosition(3, oAmIASpawn); + if(GetIsObjectValid(GetHenchman(oAmIASpawn))) + { + iEncounterLevel = iEncounterLevel + GetLevelByPosition(1, GetHenchman(oAmIASpawn)) + GetLevelByPosition(2, GetHenchman(oAmIASpawn)) + GetLevelByPosition(3, GetHenchman(oAmIASpawn)); + } + } + oAmIASpawn = GetNextObjectInArea(oArea); + } + if(iCounterParty < 1) iCounterParty = 1; + iEncounterLevel = FloatToInt(IntToFloat(iEncounterLevel) / IntToFloat(iCounterParty)); + } + if(iMaxSpawns < 0)iMaxSpawns = 1; + + //This code was removed in v1.8. I'm not sure why I was doing things this way. + //if(GetStringLeft(GetTag(OBJECT_SELF), 3) == "re_") + // { + sTemplate = GetTag(OBJECT_SELF); + // } + //else + // { + // sTemplate = "random"; + // } + oAmIASpawn = GetFirstObjectInArea(oArea); + while(GetIsObjectValid(oAmIASpawn)) + { + if(GetLocalInt(oAmIASpawn, "re_bRandomEncounter") && GetLocalObject(oAmIASpawn, "re_oRandomEncounterSpawner") == OBJECT_SELF) + { + iCounterSpawn++; + if(!bTimeIn && !GetIsInCombat(oAmIASpawn) && !IsInConversation(oAmIASpawn)) DestroyObject(oAmIASpawn); + if(!iEncounterLevel) SetLocalInt(oAmIASpawn, "re_iRandomEncounterLifeTime", 450); + else SetLocalInt(oAmIASpawn, "re_iRandomEncounterLifeTime", 900); + int iShouldIWalk = Random(100) + 1; + if(Random(100) + 1 < GetMaxHitPoints(OBJECT_SELF) && !GetIsInCombat(oAmIASpawn) && !GetIsPC(oAmIASpawn)) + { + ClearAllActions(); + RandomWalk2(GetLocation(OBJECT_SELF), iSpawnRadius, oAmIASpawn); + } + } + if(GetIsPC(oAmIASpawn) && !GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oAmIASpawn))) bSpawnOne = TRUE; + oAmIASpawn = GetNextObjectInArea(oArea); + } + if(bSpawnOne && bTimeIn && iCounterSpawn < iMaxSpawns) + { + if(iCounterPC > iMaxSpawns / 4) iCounterPC = iMaxSpawns / 4; + //The following two lines were put in place with v1.8 because of some rare div by zero reports. This is + //the only place where this spawner could generate this error. I suspect it has to do with the presence + //of a dm possessed creature, or something of that nature. At any rate, this should eliminate the error. + fZeroTest = (IntToFloat(iMaxSpawns) - ((IntToFloat(iCounterPC) / (IntToFloat(iMaxSpawns) * 0.25)) * IntToFloat(iCounterSpawn))); + if(fZeroTest == 0.0) return; + + fPCFactor = IntToFloat(iMaxSpawns) / fZeroTest; + fChanceOfSpawn = ((100.0 - ((IntToFloat(iCounterSpawn) / IntToFloat(iMaxSpawns)) * 100.0)) * fPCFactor); + oCreature = RandomEncounter(fChanceOfSpawn, OBJECT_SELF, sTemplate, 0, 1, 1, iSpawnRadius, 360, 0, 0, iEncounterLevel, 5); + } + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); +} diff --git a/nwnds_module/re_nightspawnhb.ncs b/nwnds_module/re_nightspawnhb.ncs new file mode 100644 index 000000000..72dfbae5b Binary files /dev/null and b/nwnds_module/re_nightspawnhb.ncs differ diff --git a/nwnds_module/re_nightspawnhb.nss b/nwnds_module/re_nightspawnhb.nss new file mode 100644 index 000000000..c2f65bf15 --- /dev/null +++ b/nwnds_module/re_nightspawnhb.nss @@ -0,0 +1,111 @@ +//::///////////////////////////////////////////////////////////////// +//:: FileName re_nightspawnhb +//:: Copyright (c) 2001 Bioware Corp. +//::///////////////////////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE RES tool, part of the BESIE Random +Encounter package by Ray Miller. + +Modifed to only spawn @ night : by DM Heatstroke 02/11/2021 + +*/ +//::///////////////////////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 9-2-02 +//::///////////////////////////////////////////////////////////////// +#include "re_rndenc" +void main() +{ +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// +//Set this parameter to FALSE if you wish +//your encounter distances to be constant +int RandomDistance = TRUE; +/////////////////////////////////////////////////////////// +/* +If you want a BESIE RES tool to start and stop spawning +creatures at particular game times, set the following variables +to the appropriate times and save the script under a different +name. You could also set the local integers "re_iBegin" and +"re_iEnd" on the spawner externally if you wanted. +*/ +int StartTime = 18; +int StopTime = 5; +/////////////////////////////////////////////////////////// + + float fChanceOfEncounter; + if(StartTime || StopTime) + { + SetLocalInt(OBJECT_SELF, "re_iBegin", StartTime); + SetLocalInt(OBJECT_SELF, "re_iEnd", StopTime); + } + if(GetLocalInt(OBJECT_SELF, "re_iBegin") > 23) SetLocalInt(OBJECT_SELF, "re_iBegin", 23); + if(GetLocalInt(OBJECT_SELF, "re_iEnd") > 23) SetLocalInt(OBJECT_SELF, "re_iEnd", 23); + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "BESIE RES"); + } + if(GetLocalInt(GetModule(), "re_disableBESIERES") || GetLocalInt(GetArea(OBJECT_SELF), "re_disableBESIERES") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + int iStartTime = GetLocalInt(OBJECT_SELF, "re_iBegin"); + int iStopTime = GetLocalInt(OBJECT_SELF, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + fChanceOfEncounter = IntToFloat(GetMaxHitPoints(OBJECT_SELF)) / 100; + else fChanceOfEncounter = 0.0; + int iFaction; + int iCounterX; + object oEncounterObject; + object oArea = GetArea(OBJECT_SELF); + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + if(GetArea(oPC) == oArea) + { + string sLeader = GetPCPlayerName(GetFactionLeader(oPC)) + GetName(GetFactionLeader(oPC)); + if(!GetLocalInt(OBJECT_SELF, "i" + sLeader)) + { + iFaction++; + SetLocalString(OBJECT_SELF, "sFaction" + IntToString(iFaction), sLeader); + } + SetLocalInt(OBJECT_SELF, "i" + sLeader, GetLocalInt(OBJECT_SELF, "i" + sLeader) + 1); + SetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(GetLocalInt(OBJECT_SELF, "i" + sLeader)), oPC); + } + oPC = GetNextPC(); + } + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + if(!iFaction) return; + string sLeader = GetLocalString(OBJECT_SELF, "sFaction" + IntToString(Random(iFaction) + 1)); + int iMember = Random(GetLocalInt(OBJECT_SELF, "i" + sLeader)) + 1; + oEncounterObject = GetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(iMember)); + for(iCounterX = 1; iCounterX <= iFaction; iCounterX++) + { + DeleteLocalInt(OBJECT_SELF, "i" + GetLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX))); + DeleteLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX)); + } + string sTemplate = GetTag(OBJECT_SELF); + int iNumberOfParties; + int iMinDistance = RandomDistance+10; + int iDifficulty = GetFortitudeSavingThrow(OBJECT_SELF); + int iCheckDistance = GetReflexSavingThrow(OBJECT_SELF); + int iMaxDistance = GetWillSavingThrow(OBJECT_SELF)+10; + + // Return if the resting variable is set by the re_onrest script. + if(GetLocalInt(oEncounterObject, "re_resting")) return; + + if(!iMaxDistance) + { + iMaxDistance = 1; + } + if(GetStringLeft(sTemplate, 3) != "re_") + sTemplate = "random"; + fChanceOfEncounter = IntToFloat(iFaction) * fChanceOfEncounter; + RandomEncounter(fChanceOfEncounter, oEncounterObject, sTemplate, 0, 0, iMinDistance, iMaxDistance, 360, 0, iCheckDistance, 0, iDifficulty); +} diff --git a/nwnds_module/re_onactivate.ncs b/nwnds_module/re_onactivate.ncs new file mode 100644 index 000000000..6ab6ebb84 Binary files /dev/null and b/nwnds_module/re_onactivate.ncs differ diff --git a/nwnds_module/re_onactivate.nss b/nwnds_module/re_onactivate.nss new file mode 100644 index 000000000..67dfd402f --- /dev/null +++ b/nwnds_module/re_onactivate.nss @@ -0,0 +1,8 @@ +void main() +{ +//BESIE Widget +if(GetTag(GetItemActivated()) == "BESIEWidget") + { + AssignCommand(GetItemActivator(), ActionStartConversation(GetItemActivator(), "re_widget", TRUE)); + } +} diff --git a/nwnds_module/re_or.ncs b/nwnds_module/re_or.ncs new file mode 100644 index 000000000..659939401 Binary files /dev/null and b/nwnds_module/re_or.ncs differ diff --git a/nwnds_module/re_or.nss b/nwnds_module/re_or.nss new file mode 100644 index 000000000..80f0c585b --- /dev/null +++ b/nwnds_module/re_or.nss @@ -0,0 +1,59 @@ +//:://///////////////////////////////////////////// +//:: Name re_or.nss +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +This script is intended to be executed by +"re_onrest". It should not be executed alone +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 1-6-03 +//::////////////////////////////////////////////// +#include "re_rndenc" +void main() +{ +object oPC = OBJECT_SELF; +if(GetLocalInt(oPC, "re_resting")) + { + object oArea = GetArea(oPC); + int iMinDistance = 1; + int iMaxDistance = 5; + struct RndEncProperties strProps = GetRndEncProperties(oArea); + if(!strProps.bInitialized) strProps = GetRndEncProperties(GetModule()); + if(!strProps.bInitialized) + { + SetRndEncProperties(GetModule()); + strProps = GetRndEncProperties(GetModule()); + } + //If a friendly creature is awake and within 20 meters, then increase + //the distance at which the encounter can spawn. + int iCounter1 = 1; + object oPlayer = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oPC, iCounter1); + while(GetIsObjectValid(oPlayer) && GetDistanceToObject(oPlayer) <= 20.0) + { + iCounter1++; + if(GetIsFriend(oPlayer, oPC)) + { + iMinDistance = 6; + iMaxDistance = 12; + } + oPlayer = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oPC, iCounter1); + } + //The purpose of the following local int is to cause the spawns + //to be facing the PC who generated the encounter. + SetLocalInt(oPC, "re_Facing", TRUE); + + object oEncounter = RandomEncounter(IntToFloat(strProps.iChanceOnRest), oPC, strProps.sCreatureTable, 0, 0, iMinDistance, iMaxDistance, 360, 0, 0, 0, strProps.iDifficulty); + /*if(GetIsObjectValid(oEncounter)) + { + //DeleteLocalInt(oPC, "re_resting"); + effect eEffect = GetFirstEffect(oPC); + while(GetIsEffectValid(eEffect)) + { + if(GetEffectType(eEffect) == EFFECT_TYPE_BLINDNESS && GetEffectCreator(eEffect) == GetModule()) RemoveEffect(oPC, eEffect); + eEffect = GetNextEffect(oPC); + } + }*/ + } +} diff --git a/nwnds_module/re_placespawnhb.ncs b/nwnds_module/re_placespawnhb.ncs new file mode 100644 index 000000000..a90a5c47a Binary files /dev/null and b/nwnds_module/re_placespawnhb.ncs differ diff --git a/nwnds_module/re_placespawnhb.nss b/nwnds_module/re_placespawnhb.nss new file mode 100644 index 000000000..751a3164f --- /dev/null +++ b/nwnds_module/re_placespawnhb.nss @@ -0,0 +1,44 @@ +void main() +{ +if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "Placeable Spawner"); + } +if(GetLocalInt(GetModule(), "re_disablePlaceableSpawner") || GetLocalInt(GetArea(OBJECT_SELF), "re_disablePlaceableSpawner") || GetLocalInt(OBJECT_SELF, "re_disable")) return; +int iStartTime = GetFortitudeSavingThrow(OBJECT_SELF); +int iStopTime = GetReflexSavingThrow(OBJECT_SELF); +int iID = GetWillSavingThrow(OBJECT_SELF); +int iChanceOfSpawn = GetMaxHitPoints(OBJECT_SELF); +int iHappens = Random(10000) + 1; +object oObject; +string sTemplate = GetTag(OBJECT_SELF); +if(!GetLocalInt(OBJECT_SELF, "re_bFirstRun")) + { + iHappens = 0; + SetLocalInt(OBJECT_SELF, "re_bFirstRun", TRUE); + } +if(iStartTime > 23) iStartTime = 23; +if(iStopTime > 23) iStopTime = 23; +if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) +|| (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + { + if(!GetIsObjectValid(GetLocalObject(OBJECT_SELF, "re_oObject"))) + { + if(iChanceOfSpawn >= iHappens) + { + oObject = CreateObject(OBJECT_TYPE_PLACEABLE, sTemplate, GetLocation(OBJECT_SELF)); + SetLocalInt(oObject, "re_iID", iID); + SetLocalObject(OBJECT_SELF, "re_oObject", oObject); + } + } + } +else + { + if(GetIsObjectValid(GetLocalObject(OBJECT_SELF, "re_oObject"))) + { + DestroyObject(GetLocalObject(OBJECT_SELF, "re_oObject")); + DeleteLocalObject(OBJECT_SELF, "re_oObject"); + } + } +} diff --git a/nwnds_module/re_pwrespawnerhb.ncs b/nwnds_module/re_pwrespawnerhb.ncs new file mode 100644 index 000000000..6c75c7be4 Binary files /dev/null and b/nwnds_module/re_pwrespawnerhb.ncs differ diff --git a/nwnds_module/re_pwrespawnerhb.nss b/nwnds_module/re_pwrespawnerhb.nss new file mode 100644 index 000000000..61b870bd1 --- /dev/null +++ b/nwnds_module/re_pwrespawnerhb.nss @@ -0,0 +1,235 @@ +//::///////////////////////////////////////////////////////////////// +//:: FileName re_spawnerhb +//:: Copyright (c) 2001 Bioware Corp. +//::///////////////////////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE Persistent World Respawner tool, part +of the BESIE Random Encounter System. +*/ +//::///////////////////////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 3-30-03 +//::///////////////////////////////////////////////////////////////// + +#include "re_rndenc" + +void main() +{ +// DEFINE VARIABLES + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "PW Respawner"); + } + if(GetLocalInt(GetModule(), "re_disablePWRespawner") || GetLocalInt(GetArea(OBJECT_SELF), "re_disablePWRespawner") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + int iRespawnTime = GetReflexSavingThrow(OBJECT_SELF); + int iLevel = GetFortitudeSavingThrow(OBJECT_SELF); + int iSpawnerNumber = GetWillSavingThrow(OBJECT_SELF); + int iCounter1; + int iCounter2 = 1; + int iCounter3; + float fChanceOfEncounter = IntToFloat(GetMaxHitPoints(OBJECT_SELF)) / 100; + string sTemplate = GetTag(OBJECT_SELF); + string sMatchString; + object oArea = GetArea(OBJECT_SELF); + object oCreature; + object oSpawner; + if(iSpawnerNumber > 99) iSpawnerNumber = 99; + if(iSpawnerNumber < 10) sMatchString = "PWS0" + IntToString(iSpawnerNumber); + else sMatchString = "PWS" + IntToString(iSpawnerNumber); + +// IF THIS IS THE FIRST RUN THEN INITIALIZE EACH SPAWN POINT BY PARSING THE TAG FOR SWITCHES AND SETTING +// LOCAL VARIABLES. + if(!GetLocalInt(OBJECT_SELF, "re_bFirstRun")) + { + SetLocalInt(OBJECT_SELF, "re_bFirstRun", TRUE); + SetLocalInt(OBJECT_SELF, "re_bSpawnNow", TRUE); + fChanceOfEncounter = 100.00; + object oObject = GetFirstObjectInArea(oArea); + string sCustom = "nil"; + string sBuild; + while(GetIsObjectValid(oObject)) + { + if(GetStringLeft(GetTag(oObject), 5) == sMatchString) + { + iCounter1++; + SetLocalObject(OBJECT_SELF, "re_oPWWaypoint" + IntToString(iCounter1), oObject); + for(iCounter3 = 5; iCounter3 <= GetStringLength(GetTag(oObject)); iCounter3++) + { + if(sCustom != "nil" + && (GetSubString(GetTag(oObject), iCounter3, 1) == "0" || StringToInt(GetSubString(GetTag(oObject), iCounter3, 1)) > 0)) + { + sBuild = sBuild + GetSubString(GetTag(oObject), iCounter3, 1); + } + else if(sCustom != "nil") + { + if(sCustom == "s") SetLocalInt(oObject, "re_bSwitch" + sBuild, TRUE); + if(sCustom == "b") + { + int iBegin = StringToInt(sBuild); + if(iBegin > 23) iBegin = 23; + if(iBegin < 0) iBegin = 0; //Don't think this is necessary, but... safety first! + SetLocalInt(oObject, "re_iBegin", iBegin); + } + if(sCustom == "e") + { + int iEnd = StringToInt(sBuild); + if(iEnd > 23) iEnd = 23; + if(iEnd < 0) iEnd = 0; + SetLocalInt(oObject, "re_iEnd", iEnd); + } + if(sCustom == "t") + { + SetLocalInt(oObject, "re_iTerritory", StringToInt(sBuild)); + if(GetLocalInt(oObject, "re_iTerritory") < 30) SetLocalInt(oObject, "re_iTerritory", 30); + } + sCustom = "nil"; + sBuild = ""; + } + if(GetSubString(GetTag(oObject), iCounter3, 1) == "s" + || GetSubString(GetTag(oObject), iCounter3, 1) == "t" + || GetSubString(GetTag(oObject), iCounter3, 1) == "b" + || GetSubString(GetTag(oObject), iCounter3, 1) == "e") + { + sCustom = GetSubString(GetTag(oObject), iCounter3, 1); + } + } + } + oObject = GetNextObjectInArea(oArea); + } + SetLocalInt(OBJECT_SELF, "re_iTotalSpawnpoints", iCounter1); + } + +// CYCLE THROUGH THE SPAWN POINTS. + for(iCounter2 = 1; iCounter2 <= GetLocalInt(OBJECT_SELF, "re_iTotalSpawnpoints"); iCounter2++) + { + oSpawner = GetLocalObject(OBJECT_SELF, "re_oPWWaypoint" + IntToString(iCounter2)); + oCreature = GetLocalObject(oSpawner, "re_oLastRandomEncounterSpawned"); + int bTimeIn = TRUE; + struct RndEncProperties stEncProperties = GetRndEncProperties(oSpawner); + if(!stEncProperties.bInitialized) stEncProperties = GetRndEncProperties(GetArea(OBJECT_SELF)); + if(!stEncProperties.bInitialized) stEncProperties = GetRndEncProperties(GetModule()); + if(!iLevel) SetRndEncProperties(oSpawner, stEncProperties.iDifficulty, FALSE, stEncProperties.sCreatureTable, stEncProperties.iLifeTime, stEncProperties.iMph, stEncProperties.iEncounterType, stEncProperties.bConflict, stEncProperties.iChanceOnRest, stEncProperties.bLOSCheck); + else SetRndEncProperties(oSpawner, stEncProperties.iDifficulty, TRUE, stEncProperties.sCreatureTable, stEncProperties.iLifeTime, stEncProperties.iMph, stEncProperties.iEncounterType, stEncProperties.bConflict, stEncProperties.iChanceOnRest, stEncProperties.bLOSCheck); + if(GetLocalInt(oSpawner, "re_iBegin") || GetLocalInt(oSpawner, "re_iEnd")) + { + int iStartTime = GetLocalInt(oSpawner, "re_iBegin"); + int iStopTime = GetLocalInt(oSpawner, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + bTimeIn = TRUE; + else bTimeIn = FALSE; + } + if(GetLocalInt(oSpawner, "re_bDay")) + { + if(GetIsDusk() || GetIsNight()) + { + DeleteLocalInt(oSpawner, "re_bDay"); + if(GetLocalInt(oSpawner, "re_bSwitch6")) fChanceOfEncounter = 100.0; + } + } + else + { + if(GetIsDawn() || GetIsDay()) + { + SetLocalInt(oSpawner, "re_bDay", TRUE); + if(GetLocalInt(oSpawner, "re_bSwitch5")) fChanceOfEncounter = 100.0; + } + } + // If the creature is dead or not valid then attempt to spawn him. + if(!GetIsObjectValid(oCreature) || GetIsDead(oCreature)) + { + if(!GetLocalInt(oSpawner, "re_TimeOfDeath")) SetLocalInt(oSpawner, "re_TimeOfDeath", GetTimeInSeconds()); + if((GetTimeInSeconds() - GetLocalInt(oSpawner, "re_TimeOfDeath")) / 60 >= iRespawnTime || GetLocalInt(OBJECT_SELF, "re_bSpawnNow")) + { + if((!GetLocalInt(oSpawner, "re_bSwitch5") && !GetLocalInt(oSpawner, "re_bSwitch6") && bTimeIn) + || (GetLocalInt(oSpawner, "re_bSwitch5") && (GetIsDawn() || GetIsDay()) && bTimeIn) + || (GetLocalInt(oSpawner, "re_bSwitch6") && (GetIsDusk() || GetIsNight()) && bTimeIn)) + { + oCreature = RandomEncounter(fChanceOfEncounter, oSpawner, sTemplate, 0, 1, 0, 0, 0, 0, 0, iLevel, 5); + if(GetIsObjectValid(oCreature)) + { + if(GetLocalInt(oSpawner, "re_bSwitch2")) AssignCommand(oCreature, ActionRandomWalk()); + if(GetLocalInt(oSpawner, "re_bSwitch3")) AssignCommand(oCreature, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 4000.0)); + AssignCommand(oCreature, SetFacing(GetFacing(oSpawner))); + DeleteLocalInt(oSpawner, "re_TimeOfDeath"); + DeleteLocalInt(oCreature, "re_bRandomEncounter"); //This is so this creature isn't destroyed by the CleanHouse() function + } + } + } + } + else + { + location lLocation = GetLocation(oSpawner); + location lCreature = GetLocation(oCreature); + vector vLocation = GetPositionFromLocation(lLocation); + vector vCreature = GetPositionFromLocation(lCreature); + object oAttacker = GetLastHostileActor(oCreature); + location lAttacker = GetLocation(oAttacker); + + // Send the creature home if the territory switch is set and the creature is out of his territory + // and not in combat and not DM controlled. + if(GetLocalInt(oSpawner, "re_iTerritory") && GetDistanceBetweenLocations(lLocation, lCreature) > IntToFloat(GetLocalInt(oSpawner, "re_iTerritory"))) + { + if(!GetIsObjectValid(oAttacker) + || (!GetIsInCombat(oAttacker) && !GetIsPC(oCreature) && GetDistanceBetweenLocations(lLocation, lAttacker) > IntToFloat(GetLocalInt(oSpawner, "re_iTerritory")))) + { + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, JumpToLocation(lLocation)); + AssignCommand(oCreature, SetFacing(GetFacing(oSpawner))); + } + } + + // Things to do if creature is valid, alive, not in combat, and not DM controlled. + if(!GetIsInCombat(oCreature) && !GetIsPC(oCreature)) + { + float fDamage = IntToFloat(GetMaxHitPoints(oCreature) - GetCurrentHitPoints(oCreature)) / 5.0; + if(fDamage < 1.0 && fDamage > 0.0) fDamage = 1.0; + int iDamage = FloatToInt(fDamage); + if(GetLocalInt(oSpawner, "re_bSwitch5") && (GetIsDusk() || GetIsNight()) + || GetLocalInt(oSpawner, "re_bSwitch6") && (GetIsDawn() || GetIsDay()) + || !bTimeIn) + { + DestroyObject(oCreature); + } + if(vLocation.x != vCreature.x || vLocation.y != vCreature.y || GetFacing(oCreature) != GetFacing(oSpawner)) + { + if(!GetLocalInt(oSpawner, "re_bSwitch1")) + { + if(!GetLocalInt(oSpawner, "re_bSwitch2") || GetDistanceBetweenLocations(lLocation, lCreature) >= 15.0) + { + //AssignCommand(oCreature, ClearAllActions()); + if(GetLocalInt(oSpawner, "re_iTerritory")) AssignCommand(oCreature, ActionMoveToLocation(lLocation)); + else AssignCommand(oCreature, ActionMoveToLocation(lLocation)); + AssignCommand(oCreature, ActionDoCommand(SetFacing(GetFacing(oSpawner)))); + if(GetLocalInt(oSpawner, "re_bSwitch3")) AssignCommand(oCreature, ActionDoCommand(PlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 4000.0))); + } + } + } + if(lLocation == lCreature && GetFacing(oCreature) != GetFacing(oSpawner)) AssignCommand(oCreature, ActionDoCommand(SetFacing(GetFacing(oSpawner)))); + if(!GetLocalInt(oSpawner, "re_bSwitch4") && iDamage) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iDamage), oCreature); + if(GetLocalInt(oSpawner, "re_bSwitch2")) AssignCommand(oCreature, ActionDoCommand(ActionRandomWalk())); + if(GetLocalInt(oSpawner, "re_bSwitch3")) + { + if(GetLocalInt(oSpawner, "re_bSwitch1")) + { + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, PlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 4000.0)); + } + else if(lLocation == lCreature) + { + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, PlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 4000.0)); + } + } + } + } + } + if(GetLocalInt(OBJECT_SELF, "re_bSpawnNow")) DeleteLocalInt(OBJECT_SELF, "re_bSpawnNow"); +} diff --git a/nwnds_module/re_rndenc.nss b/nwnds_module/re_rndenc.nss new file mode 100644 index 000000000..0efb6a77d --- /dev/null +++ b/nwnds_module/re_rndenc.nss @@ -0,0 +1,895 @@ +//:://///////////////////////////////////////////// +//:: Name re_rndenc +//:: FileName re_rndenc.nss +//:: Copyright (c) 2002 Raymond Miller +//::////////////////////////////////////////////// +/* +This script creates functions called RandomEncounter(), +CleanHouse(), and SetRndEncProperties() for use in the NWN +scripting language. This script is meant to be used as an #include +and is part of the BESIE Random Encounter package by Ray Miller +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 7/6/2002 +//::////////////////////////////////////////////// + +// Encounter Type Constants +int ENCOUNTER_TYPE_AREA = 3; +int ENCOUNTER_TYPE_PARTY = 1; +int ENCOUNTER_TYPE_IND = 2; +int ENCOUNTER_TYPE_TOTALPARTYLEVELS = 4; + +struct RndEncProperties + { + int bInitialized; + int iDifficulty; + int bConsiderCR; + string sCreatureTable; + int iLifeTime; + int iMph; + int iEncounterType; + int bConflict; + int iChanceOnRest; + int bLOSCheck; + }; + +// FUNCTION DECLARATIONS + +// Sets properties for random encounters that are likely to seldom change +// - oObject: The object that holds these properties. +// - iDifficulty: 1 to 10 +// - bConsiderCR: If TRUE takes CR of creature into consideration when +// choosing an encounter. +// - sCreatureTable: "re_***" - where *** is a string of letter and/or numbers to indicate to the function what type +// of creatures to spawn. They are as follows: +// a - animals +// c - construct +// d - dragon +// e - elemental +// g - giant +// h - humanoid +// i - insect +// m - miscellaneous +// p - planar +// u - undead +// b - bandit +// x1 through x### - These are for custom encounter tables. +// t1 through t### - These are for treasure tables. +// - iLifeTime: Time in seconds before unengaged encounters decay. +// - Mph: Should equal the Minutes Per Hour setting of the Module. +// - iEncounterType: +// ENCOUNTER_TYPE_PARTY - Takes into consideration the average level of the entire party of the PC who is to +// receive the encounter when choosing an encounter of appropriate difficulty level. +// ENCOUNTER_TYPE_TOTALPARTYLEVELS (default) - Takes into consideration the TOTAL of all the levels of the PC's party who +// currently reside in the same area as the PC to receive the encounter. +// ENCOUNTER_TYPE_AREA - Takes into consideration the levels off all PCs and henchmen within a 20m radius of the PC +// who is to receive the encounter. +// ENCOUNTER_TYPE_IND - Takes into consideration only the levels of the individual PC who is to receive the encounter. +// - bConflict: If set to TRUE then random encounters can occur during combat. +// - iChanceOnRest: The chance of a random encounter occuring when a PC rests (only matters on Area Object and the "re_onrest" +// script must be placed in PlayerOnRest handler of the module object). +// - bLOSCheck: Dependant upon a broken scripting function. (future use!) +// Note: This function is best called by the OnModuleLoad or OnAreaLoad handler. +void SetRndEncProperties(object oObject = OBJECT_SELF, int iDifficulty = 4, int bConsiderCR = TRUE, string sCreatureTable = "re_ceghimpubt0", int iLifeTime = 180, int iMph = 2, int iEncounterType = 4, int bConflict = FALSE, int iChanceOnRest = 20, int bLOSCheck = FALSE); + +// Returns the structure "RndEncProperties" containing all the Random Encounter Properties set on oObject. +// The elements of the structure are as follows: +// - bInitialized: TRUE if properties have been set on this object. +// - iDifficulty: 1 to 10 +// - bConsiderCR: If TRUE, takes CR of creature into consideration when +// choosing an encounter. +// - sCreatureTable: "re_***" - where *** is a string of letter and/or numbers to indicate to the function what type +// of creatures to spawn. They are as follows: +// a - animals +// c - construct +// d - dragon +// e - elemental +// g - giant +// h - humanoid +// i - insect +// m - miscellaneous +// p - planar +// u - undead +// b - bandit +// x1 through x### - These are for custom encounter tables. +// t1 through t### - These are for treasure tables. +// - iLifeTime: Time in seconds before unengaged encounters decay. +// - iMph: Should equal the Minutes Per Hour setting of the Module. +// - iEncounterType: +// ENCOUNTER_TYPE_PARTY - Takes into consideration the average level of the entire party of the PC who is to +// receive the encounter when choosing an encounter of appropriate difficulty level. +// ENCOUNTER_TYPE_TOTALPARTYLEVELS (default) - Takes into consideration the TOTAL of all the levels of the PC's party who +// currently reside in the same area as the PC to receive the encounter. +// ENCOUNTER_TYPE_AREA - Takes into consideration the levels off all PCs and henchmen within a 20m radius of the PC +// who is to receive the encounter. +// ENCOUNTER_TYPE_IND - Takes into consideration only the levels of the individual PC who is to receive the encounter. +// - bConflict: If TRUE then random encounters can occur during combat. +// - iChanceOnRest: The chance of a random encounter occuring when a PC rests (only matters on Area Object and the "re_onrest" +// script must be placed in PlayerOnRest handler of the module object). +// - bLOSCheck: Dependant upon a broken scripting function. (future use!) +struct RndEncProperties GetRndEncProperties(object oObject); + +// Generates the likelihood of a random encounter. +// - fChanceOfEncounter: Odds of encounter spawning when funciton is called. Accurate to two +// decimal places. .01 to 100.00 percent chance. +// - oEncounterObject: The object about which the encounter will spawn, whose levels (if a player) +// will be considered when determining an appropriate creature. +// - sTemplate: When used as the sCreatureTable parameter in the SetRndEncProperties() +// function this parameter has higher priority. It can also be set to the tag of a +// specific creature, or to "random" to use the default table set by SetRndEncProperties() +// - iMinNumberOfCreatures: If > 0, a random number of creatures between this and iMaxNumberOfCreatures +// will spawn. If set to 0, then exactly the number of creatures set by iMaxNumberOfCreatures will +// spawn. +// - iMaxNumberOfCreatures: If this and iMinNumberOfCreatures is set to 0 then the number of Creatures +// spawned will be determined by the CR of the creature spawned compared to the levels of the player(s). +// - iMinEncounterDistance: If set to 0, encounter distance will always be at the number set by iMaxEncounterDistance. +// - iMaxEncounterDistance: Farthest distance the encounter can be from oEncounterObject. +// - iOrientation: 0 to 360. Counterclockwise representing the angle from facing where the encounter will spawn. +// a value of 0 will spawn the encounter directly in front of oEncounterObject. 360 will generate a random angle. +// - iTolerance: The number of degrees by which the angle can randomly be off from iOrientation. +// - iCheckDistance: The distance a PC has to move before a Random Encounter check can be made against him. If the PC has +// not covered this much distance, then a call to the RandomEncounter() function for this PC will yield +// OBJECT_INVALID. +// - iLevelOverride: Use this to force the function to base the encounter on a character level other than that +// determined by oEncounterObject. +// - iDifficulty: Overrides the difficulty setting determined by the SetRndEncProperties() function. +object RandomEncounter(float fChanceOfEncounter = 100.0, object oEncounterObject = OBJECT_SELF, string sTemplate = "random", int iMinNumberOfCreatures = 0, int iMaxNumberOfCreatures = 0, int iMinEncounterDistance = 1, int iMaxEncounterDistance = 15, int iOrientation = 360, int iTolerance = 0, int iCheckDistance = 0, int iLevelOverride = 0, int iDifficulty = 0); + +// Used to "clean up" an area that has become littered by random encounters. +// - bDestroyPlotItems - Tells the function whether or not to destroy items with their plot flags set. If set to TRUE, +// plot items will be destroyed just like any other item. +// - oArea - The area to clean up. +// - iSpawnOverride - Overrides the default (set by the SetRndEncProperties() function) time to destroy random encounter +// creatures who are not engaged by PCs. +// - iItemOverride - Overrides the default time of 30 minutes after which to destroy items dropped by PCs +// Note: Only works if the "re_moditemdrop" script included with the BESIE Random Encounter package +// is placed in the module OnItemUnacquire handler. +// - iBodyBagOverride - Overrides the default time of 5 minutes after which to destroy loot that was dropped by creatures +// who were killed. +// NOTE: If there is bDestroyPlotItems is FALSE and there is a plot item or items inside a container or body bag, the container +// and all non-plot items will decay but the plot item(s) will be left. +// NOTE: A value of zero assigned to the override parameters will cause the function to use the default value for that parameter. +void CleanHouse(int bDestroyPlotItems = FALSE, object oArea = OBJECT_SELF, int iSpawnOverride = 0, int iItemOverride = 0, int iBodyBagOverride = 0); + +// Returns the game's calander time in seconds since time zero. +// - iMph: Minutes Per Hour. This should match the module's setting. +int GetTimeInSeconds(int iMph = 2); + +// Causes oCreature to walk to a randomly determined location. +// - lCenter: The center of a circle in which random destinations can be generated. +// - iDistance: The distance from lCenter in which to randomly generate destinations. +// - oCreature: The creature to perform the random walk. +// Note: Unlike the default RandomWalk function, this function does not persist until a ClearAllActions is called. Instead this +// function generates a single random desitination and the move to that destination is added to the creatures action que only once +// per call. +location RandomWalk2(location lCenter, int iDistance = 20, object oCreature = OBJECT_SELF); + +void SetRndEncProperties(object oObject = OBJECT_SELF, int iDifficulty = 4, int bConsiderCR = TRUE, string sCreatureTable = "re_ceghimpubt0", int iLifeTime = 180, int iMph = 2, int iEncounterType = 4, int bConflict = TRUE, int iChanceOnRest = 20, int bLOSCheck = FALSE) +{ + SetLocalInt(oObject, "re_bInitialized", TRUE); + SetLocalInt(oObject, "re_iDifficulty", iDifficulty); + SetLocalInt(oObject, "re_bConsiderCR", bConsiderCR); + SetLocalString(oObject, "re_sCreatureTable", sCreatureTable); + SetLocalInt(oObject, "re_iLifeTime", iLifeTime); + SetLocalInt(oObject, "re_iMph", iMph); + SetLocalInt(oObject, "re_iEncounterType", iEncounterType); + SetLocalInt(oObject, "re_bConflict", bConflict); + SetLocalInt(oObject, "re_iChanceOnRest", iChanceOnRest); + SetLocalInt(oObject, "re_bLOSCheck", bLOSCheck); +} + +struct RndEncProperties GetRndEncProperties(object oObject = OBJECT_SELF) +{ + if(oObject == GetModule() && !GetLocalInt(GetModule(), "re_bInitialized")) SetRndEncProperties(GetModule()); + struct RndEncProperties strProps; + strProps.bInitialized = GetLocalInt(oObject, "re_bInitialized"); + strProps.iDifficulty = GetLocalInt(oObject, "re_iDifficulty"); + strProps.bConsiderCR = GetLocalInt(oObject, "re_bConsiderCR"); + strProps.sCreatureTable = GetLocalString(oObject, "re_sCreatureTable"); + strProps.iLifeTime = GetLocalInt(oObject, "re_iLifeTime"); + strProps.iMph = GetLocalInt(oObject, "re_iMph"); + strProps.iEncounterType = GetLocalInt(oObject, "re_iEncounterType"); + strProps.bConflict = GetLocalInt(oObject, "re_bConflict"); + strProps.iChanceOnRest = GetLocalInt(oObject, "re_iChanceOnRest"); + strProps.bLOSCheck = GetLocalInt(oObject, "re_bLOSCheck"); + return strProps; +} + +#include "re_table" +object RandomEncounter(float fChanceOfEncounter = 100.0, object oEncounterObject = OBJECT_SELF, string sTemplate = "random", int iMinNumberOfCreatures = 0, int iMaxNumberOfCreatures = 0, int iMinEncounterDistance = 1, int iMaxEncounterDistance = 15, int iOrientation = 360, int iTolerance = 0, int iCheckDistance = 0, int iLevelOverride = 0, int iDifficulty = 0) +{ +// IF PROPERTIES ARE NOT SET ON MODULE OBJECT THEN SET THEM WITH DEFAULTS + if(!GetLocalInt(GetModule(), "re_bInitialized")) + { + SetRndEncProperties(GetModule()); + } + +// DETERMINE IF ENCOUNTER HAPPENS + //Has the player moved farther than the CheckDistance? + float fTravelDistance; + if(GetIsPC(oEncounterObject)) + { + if(!GetLocalInt(oEncounterObject, "re_bOldLocationSet")) + { + SetLocalInt(oEncounterObject, "re_bOldLocationSet", TRUE); + SetLocalLocation(oEncounterObject, "re_lOldLocation", GetLocation(oEncounterObject)); + if(iCheckDistance) return OBJECT_INVALID; + } + if(GetDistanceBetweenLocations(GetLocation(oEncounterObject), GetLocalLocation(oEncounterObject, "re_lOldLocation")) < 0.0) + { + SetLocalLocation(oEncounterObject, "re_lOldLocation", GetLocation(oEncounterObject)); + if(iCheckDistance) return OBJECT_INVALID; + } + fTravelDistance = GetDistanceBetweenLocations(GetLocation(oEncounterObject), GetLocalLocation(oEncounterObject, "re_lOldLocation")); + SetLocalFloat(oEncounterObject, "re_fTravelDistance", GetLocalFloat(oEncounterObject, "re_fTravelDistance") + fTravelDistance); + SetLocalLocation(oEncounterObject, "re_lOldLocation", GetLocation(oEncounterObject)); + if(GetLocalFloat(oEncounterObject, "re_fTravelDistance") >= IntToFloat(iCheckDistance)) DeleteLocalFloat(oEncounterObject, "re_fTravelDistance"); + else return OBJECT_INVALID; + } + // The following two lines allow for a chance of encounter with a precision of up to + // two decimal places. ie. 100.00. An encounter can have as little as a 0.01 chance + // of occuring. + int iHappens = Random(10000)+1; + int iChanceOfEncounter = FloatToInt(fChanceOfEncounter * 100); + if(iChanceOfEncounter < iHappens) + { + return OBJECT_INVALID; + } + //Are encounters disabled for this player? + if(GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oEncounterObject))) + { + return OBJECT_INVALID; + } + //Are random encounters disabled altogether? + if(GetLocalInt(GetModule(), "re_disable")) + { + return OBJECT_INVALID; + } + //Is the player in combat with bConflict equal to false? + object oHolder; + int iCounter7 = 1; // Used in checking for nearby enemies. + if(GetLocalInt(oEncounterObject, "re_bInitialized")) oHolder = oEncounterObject; + else if(GetLocalInt(GetArea(oEncounterObject), "re_bInitialized")) oHolder = GetArea(oEncounterObject); + else oHolder = GetModule(); + int bConflict = GetLocalInt(oHolder, "re_bConflict"); + if(!bConflict && GetIsPC(oEncounterObject)) + { + if(GetIsInCombat(oEncounterObject)) return OBJECT_INVALID; + object oNearest = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oEncounterObject, iCounter7); + while(GetIsObjectValid(oNearest) && GetDistanceToObject(oNearest) < 35.0) + { + if(GetIsEnemy(oNearest) && (GetIsInCombat(oNearest) || GetObjectSeen(oNearest))) return OBJECT_INVALID; + iCounter7++; + oNearest = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oEncounterObject, iCounter7); + } + } + //Are any nearby party members in a conversation? + object oAmIAPC; + oAmIAPC = GetFirstObjectInShape(SHAPE_SPHERE, 35.0, GetLocation(oEncounterObject), FALSE, OBJECT_TYPE_CREATURE); + if(GetIsObjectValid(oAmIAPC)) + { + while(GetIsObjectValid(oAmIAPC)) + { + if(GetIsPC(oAmIAPC)) + { + if(GetFactionEqual(oEncounterObject, oAmIAPC)) + { + if(IsInConversation(oAmIAPC)) + { + return OBJECT_INVALID; + } + } + } + oAmIAPC = GetNextObjectInShape(SHAPE_SPHERE, 25.0, GetLocation(oEncounterObject), FALSE, OBJECT_TYPE_CREATURE); + } + } + +// DECLARE AND INITIALIZE VARIABLES + object oMod = GetModule(); + int iMph; + if(!iDifficulty) iDifficulty = GetLocalInt(oHolder, "re_iDifficulty"); + int bConsiderCR = GetLocalInt(oHolder, "re_bConsiderCR"); + if(GetStringLowerCase(sTemplate) == "random") sTemplate = GetLocalString(GetModule(), "re_sCreatureTable"); + int iLifeTime = GetLocalInt(oHolder, "re_iLifeTime"); + if(!GetLocalInt(oHolder, "re_iMph")) iMph = 2; + else iMph = GetLocalInt(oHolder, "re_iMph"); + int bLOSCheck = GetLocalInt(oHolder, "re_bLOSCheck"); + int iEncounterType = GetLocalInt(oHolder, "re_iEncounterType"); + int iCounter1 = 1; // Used to count the creatures when spawning them. + int iCounter2 = 1; // Used in loop to set difficulty level. + int iCounter3 = 1; // Used in loop to check line of sight float fEncounterDistance (future use!). + int iCounter4;// Used in determining the PC to spawn the encounter if the encounter object passed is an area or the module. + int iCounter5; // Used in determining treasure table. + int iCounter6; // Used in giving treasure. + int iNumberOfCreatures; + int iEncounterDistance; + int iFacingSameWay; + int iLevels; + int iTableNumber; + int bNumberByLevel = FALSE; + int bNoEncounter = FALSE; + int bComplete1 = FALSE; + int bComplete2 = FALSE; + int bTreasure; + float fMinCR; + float fMaxCR; + float fEncounterDistance; + float fNewEncounterDistance; + float fCreatureFacing; + float fEncounterAngle; + float fEncounterVector; + float fAngleOffset; + float fLevels; + float fDifficulty = 0.167; + string sBuild; + string sTreasure = sTemplate; + vector vEncounterVector; + vector vVectorOffset; + vector vCreatureVector; + object oObject; + object oCreature; + object oArea; + if(oEncounterObject == GetModule()) + { + oAmIAPC = GetFirstPC(); + while(GetIsObjectValid(oAmIAPC)) + { + if(!GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oAmIAPC))) + { + SetLocalObject(oMod, "re_oEncounterObject" + IntToString(iCounter4), oAmIAPC); + iCounter4++; + } + oAmIAPC = GetNextPC(); + } + oEncounterObject = GetLocalObject(oMod, "re_oEncounterObject" + IntToString(Random(iCounter4))); + } + else if(GetObjectType(oEncounterObject) == 0 && oEncounterObject != GetModule()) + { + oArea = oEncounterObject; + oAmIAPC = GetFirstObjectInArea(oArea); + while(GetIsObjectValid(oAmIAPC)) + { + if(GetIsPC(oAmIAPC) && !GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oAmIAPC))) + { + SetLocalObject(oArea, "re_oEncounterObject" + IntToString(iCounter4), oAmIAPC); + iCounter4++; + } + oAmIAPC = GetNextObjectInArea(oArea); + } + oEncounterObject = GetLocalObject(oArea, "re_oEncounterObject" + IntToString(Random(iCounter4))); + } + else + { + oArea = GetArea(oEncounterObject); + } + if(!GetIsPC(oEncounterObject)) + iEncounterType = ENCOUNTER_TYPE_AREA; + location lCreatureLocation; + vector vEncounterObjectVector = GetPosition(oEncounterObject); + int iMin = 60; + int iHr = iMin * iMph; + int iDay = iHr * 24; + int iMth = iDay * 28; + int iYr = iMth * 12; + if(iDifficulty > 10) + { + iDifficulty = 10; + } + if(iDifficulty == 0) + { + iDifficulty = GetGameDifficulty() * 2; + } + while(iCounter2 <= iDifficulty) + { + fDifficulty = fDifficulty * 1.5; + iCounter2++; + } + +// ERROR CORRECTION + if(iMaxNumberOfCreatures < iMinNumberOfCreatures) + { + iMaxNumberOfCreatures = iMinNumberOfCreatures; + } + if(iMaxEncounterDistance < iMinEncounterDistance) + { + iMaxEncounterDistance = iMinEncounterDistance; + } + if(!GetIsPC(oEncounterObject)) + { + iEncounterType = ENCOUNTER_TYPE_AREA; + } + +// CHECK TO SEE IF PC IS RESTING VIA THE BESIE "re_onrest" SCRIPT AND IF SO +// REMOVE RESTING EFFECTS. + if(GetIsPC(oEncounterObject) && GetLocalInt(oEncounterObject, "re_resting")) + { + DeleteLocalInt(oEncounterObject, "re_resting"); + effect eEffect = GetFirstEffect(oEncounterObject); + while(GetIsEffectValid(eEffect)) + { + if(GetEffectType(eEffect) == EFFECT_TYPE_BLINDNESS && GetEffectCreator(eEffect) == GetModule()) RemoveEffect(oEncounterObject, eEffect); + if(GetEffectType(eEffect) == VFX_IMP_SLEEP && GetEffectCreator(eEffect) == GetModule()) RemoveEffect(oEncounterObject, eEffect); + eEffect = GetNextEffect(oEncounterObject); + } + } + +// DETERMINE THE ANGLE OFFSET OF THE SPAWN + if(iOrientation == 360) + { + fEncounterAngle = IntToFloat(Random(360)); + } + else + { + fEncounterAngle = GetFacingFromLocation(GetLocation(oEncounterObject)) + IntToFloat(iOrientation); + fEncounterAngle = (fEncounterAngle + (IntToFloat(iTolerance) * 0.5)) - (IntToFloat(Random(iTolerance))); + } + +// DETERMINE THE DISTANCE FROM THE SPAWNING OBJECT + if(iMinEncounterDistance == 0) + { + iMinEncounterDistance = iMaxEncounterDistance; + fEncounterDistance = IntToFloat(iMaxEncounterDistance); + } + else + { + fEncounterDistance = IntToFloat(iMinEncounterDistance + Random((iMaxEncounterDistance - iMinEncounterDistance) + 1)); + } + iEncounterDistance = FloatToInt(fEncounterDistance); + +// DETERMINE THE FACING OF THE SPAWN + if(GetLocalInt(oEncounterObject, "re_Facing")) + { + fCreatureFacing = fEncounterAngle + 180.0; + iFacingSameWay = TRUE; + DeleteLocalInt(oEncounterObject, "re_Facing"); + } + else + { + fCreatureFacing = IntToFloat(Random(360)); + iFacingSameWay = Random(2); // Note: If there is more than one creature there is a 50% chance they will all be facing the same direction + } + +// DETERMINE TOTAL CHARACTER LEVELS TO CONSIDER WHEN CHOOSING A CREATURE +// AND/OR DETERMINING THE NUMBER OF CREATURES TO SPAWN. + // If the variable iEncounterType is AREA, this routine + // determines the total character levels + // based upon the character levels of all PCs + // in a 20 meter radius around the object that spawned + // the encounter. + // Later on the total character levels will be compared to + // the challenge rating of the creature spawned, and a number + // of creatures will be determined from that comparison. + if(iEncounterType == ENCOUNTER_TYPE_AREA) + { + oAmIAPC = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, GetLocation(oEncounterObject), FALSE, OBJECT_TYPE_CREATURE); + while(GetIsObjectValid(oAmIAPC)) + { + if(GetIsPC(oAmIAPC)) + { + iLevels = iLevels + GetLevelByPosition(1, oAmIAPC) + GetLevelByPosition(2, oAmIAPC) + GetLevelByPosition(3, oAmIAPC); + if(GetIsObjectValid(GetHenchman(oAmIAPC))) + { + iLevels = iLevels + GetLevelByPosition(1, GetHenchman(oAmIAPC)) + GetLevelByPosition(2, GetHenchman(oAmIAPC)) + GetLevelByPosition(3, GetHenchman(oAmIAPC)); + } + } + oAmIAPC = GetNextObjectInShape(SHAPE_SPHERE, 20.0, GetLocation(oEncounterObject), FALSE, OBJECT_TYPE_CREATURE); + } + } + else if(iEncounterType == ENCOUNTER_TYPE_PARTY) + { + iLevels = GetFactionAverageLevel(oEncounterObject); + } + else if(iEncounterType == ENCOUNTER_TYPE_TOTALPARTYLEVELS) + { + oObject = GetFirstFactionMember(oEncounterObject); + while(GetIsObjectValid(oObject)) + { + if(GetArea(oObject) == GetArea(oEncounterObject)) + { + iLevels = iLevels + GetLevelByPosition(1, oObject) + GetLevelByPosition(2, oObject) + GetLevelByPosition(3, oObject); + } + oObject = GetNextFactionMember(oEncounterObject); + } + } + else + { + // If the variable iEncounterType is set to IND, this + // routine determines the total character levels based upon the + // character level of the object that spawned the encounter. + // if the object that spawned the encounter is NOT a PC then + // the number of creatures spawned will be one. This shouldn't + // happen since the the encounter type sets itself to AREA if + // the encounter object is a placeable. + if(GetIsPC(oEncounterObject)) + { + iLevels = GetLevelByPosition(1, oEncounterObject) + GetLevelByPosition(2, oEncounterObject) + GetLevelByPosition(3, oEncounterObject); + } + } + // Modify the float representing the total levels by the difficulty level. + if(iLevelOverride) + { + iLevels = iLevelOverride; + } + fLevels = IntToFloat(iLevels) * fDifficulty; + +// CHOOSE A CREATURE TO SPAWN + if(GetStringLowerCase(sTemplate) == "random" || GetStringLowerCase(GetStringLeft(sTemplate, 3)) == "re_") + { + if(GetStringLowerCase(GetStringLeft(sTemplate, 3)) == "re_") + { + sTemplate = GetStringRight(sTemplate, GetStringLength(sTemplate) - 3); + } + if(fLevels < 0.25) + { + fMaxCR = 0.25; + } + else + { + fMaxCR = fLevels; + } + fMinCR = IntToFloat(FloatToInt(fMaxCR * 0.3)); + //If there is a definative number of creatures to spawn passed to + //the RandomEncounter function when it is called, then do not + //allow as much play in the low end, and a little more in the + // high end challange ratings. + if(iMinNumberOfCreatures == 0 && iMaxNumberOfCreatures > 1) + { + fMinCR = IntToFloat(FloatToInt(fMaxCR * 0.4)); + fMaxCR = fMaxCR * 1.2; + fMinCR = IntToFloat(FloatToInt(fMinCR)); + } + if(iMinNumberOfCreatures == 0 && iMaxNumberOfCreatures == 1) + { + fMinCR = IntToFloat(FloatToInt(fMaxCR * 0.6)); + fMaxCR = fMaxCR * 1.2; + fMinCR = IntToFloat(FloatToInt(fMinCR));// Round off the CR. + } + if(GetLocalInt(oHolder, "re_bConsiderCR") == FALSE) + { + fMaxCR = 9999.0; + fMinCR = 0.0; + } + sTemplate = GetRndEncCreature(fMinCR, fMaxCR, sTemplate); + if(sTemplate == "") return OBJECT_INVALID; + } + +// DETERMINE IF CREATURE IS TO HAVE TREASURE AND WHAT TABLES TO USE + if(GetLocalString(oMod, "re_s2DATreasure") != "") + { + sTreasure = GetLocalString(oMod, "re_s2DATreasure"); + DeleteLocalString(oMod, "re_s2DATreasure"); + } + for(iCounter5 = 0; iCounter5 <= GetStringLength(sTreasure); iCounter5++) + { + if(bTreasure + && (GetSubString(sTreasure, iCounter5, 1) == "0" || StringToInt(GetSubString(sTreasure, iCounter5, 1)) > 0)) + { + sBuild = sBuild + GetSubString(sTreasure, iCounter5, 1); + } + else if(bTreasure) + { + iTableNumber++; + SetLocalString(OBJECT_SELF, "re_sTreasureTable" + IntToString(iTableNumber), sBuild); + bTreasure = FALSE; + sBuild = ""; + } + if(GetStringLowerCase(GetSubString(sTreasure, iCounter5, 1)) == "t") + { + bTreasure = TRUE; + } + } + +// DETERMINE LOCATION AND SPAWN ONE CREATURE + // NOTE: Line Of Sight checks have a bug. Bioware says they are looking + // into the bug. I have spent an ungodly amount of hours trying to come + // up with an acceptable work-around to the Line Of Sight functionality + // of Get**ObjectInShape(). Unless somebody else can come up with a working + // LOS check, I have no choice but to disregard LOS checks until they are + // fixed. + // + // if(LOSCheck = TRUE) + // { + // + // } + // + // note: one creature is spawned in now so its challange rating can be + // used to determine if more are needed. (if that option is set) + vEncounterVector = AngleToVector(fEncounterAngle); + vVectorOffset = vEncounterVector * fEncounterDistance; + vCreatureVector = vEncounterObjectVector + vVectorOffset; + lCreatureLocation = Location(oArea, vCreatureVector, fCreatureFacing); + oCreature = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lCreatureLocation, FALSE); + +// VERIFY THE RESREF OF THE SPAWNED CREATURE AGAINST THE TEMPLATE AND RETURN AN ERROR IF THEY DO NOT MATCH + if(GetStringLowerCase(GetResRef(oCreature)) != GetStringLowerCase(sTemplate)) + { + string sError = "BESIE Error: " + sTemplate + " does not match the blueprint of a valid creature object!"; + DestroyObject(oCreature); + if(GetIsPC(oEncounterObject)) SendMessageToPC(oEncounterObject, sError); + else + { + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + if(GetArea(oPC) == GetArea(oEncounterObject)) SendMessageToPC(oPC, sError); + oPC = GetNextPC(); + } + } + SendMessageToAllDMs(sError); + WriteTimestampedLogEntry(sError); + return OBJECT_INVALID; + } + +// DETERMINE THE NUMBER OF ADDITIONAL CREATURES TO SPAWN. + // If the min and max number of creatures in the function call are zero + // then get the min and max number from the local variables in the module + // object. + if(iMinNumberOfCreatures == 0 && iMaxNumberOfCreatures == 0) + { + iMinNumberOfCreatures = GetLocalInt(oMod, "re_iMinNumberOfCreatures"); + iMaxNumberOfCreatures = GetLocalInt(oMod, "re_iMaxNumberOfCreatures"); + } + // Now that we are done with these local integers, we need to clean reset + // them to their defaults so we don't accidentally use old numbers later. + SetLocalInt(oMod, "re_iMinNumberOfCreatures", 0); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures", 0); + if(iMinNumberOfCreatures == 0 && iMaxNumberOfCreatures != 0) + { + iNumberOfCreatures = iMaxNumberOfCreatures; + } + if(iMinNumberOfCreatures != 0 && iMaxNumberOfCreatures != 0) + { + iNumberOfCreatures = iMinNumberOfCreatures + Random((iMaxNumberOfCreatures - iMinNumberOfCreatures) + 1); + } + if(iMinNumberOfCreatures == 0 && iMaxNumberOfCreatures == 0) + { + // This is the routine that sets the number of creatures to spawn + // based on their challenge rating and the total character levels. + // It chooses a random number between one half (truncated) and 120 + // percent (1 for every 4) of the number of creatures ideal for the + // difficulty level set. + iMaxNumberOfCreatures = FloatToInt(fLevels / GetChallengeRating(oCreature)); + iMinNumberOfCreatures = FloatToInt(IntToFloat(iMaxNumberOfCreatures) * 0.5); + iMaxNumberOfCreatures = FloatToInt(IntToFloat(iMaxNumberOfCreatures) * 1.25); + + //These lines were added with the v1.7 release because I noticed a situation where characters of + //up to level 4 would still spawn orcs, goblins and other < CR1 creatures but they would + //spawn a rediculous amount of them because of the low CR/LV ratio. This is just to eliminate + //that. + if(iMinNumberOfCreatures > 8) iMinNumberOfCreatures = 8; + if(iMaxNumberOfCreatures > 9) iMaxNumberOfCreatures = 9; + + iNumberOfCreatures = iMinNumberOfCreatures + Random((iMaxNumberOfCreatures - iMinNumberOfCreatures) + 1); + if((iNumberOfCreatures < 1) && (iLevels > 0)) + { + iNumberOfCreatures = 1; + } + } + +// SPAWN THOSE SUCKERS! + while(iCounter1 <= iNumberOfCreatures) + { + // Stick some labels on the creature for record keeping and reference (future use!) + SetLocalInt(oCreature, "re_bRandomEncounter", TRUE); + SetLocalObject(oCreature, "re_oRandomEncounterSpawner", oEncounterObject); + SetLocalInt(oCreature, "re_iRandomEncounterCounter", 1); + SetLocalInt(oCreature, "re_iRandomEncounterSpawnTime", (GetCalendarYear() * iYr) + (GetCalendarMonth() * iMth) + (GetCalendarDay()* iDay) + (GetTimeHour()* iHr) + (GetTimeMinute() * iMin) + GetTimeSecond()); + SetLocalInt(oCreature, "re_iRandomEncounterLifeTime", iLifeTime); + /*------------------------- + This routine was removed in v1.8 because the standard treasure tables were removed and replaced + with a routine that simply awards an appropriate amount of coin. + if(!GetLocalInt(GetModule(), "re_standardtable") + || (GetLocalInt(GetModule(), "re_standardtable") && iCounter1 < 4)) + // The preceding if statement looks for a local variable set by the + // standard treasure table included with BESIE. If this variable is + // set then it halts execution of the treasure script after the first + // 3 creatures. This prevents a Too Many Instructions error. + { + DeleteLocalInt(GetModule(), "re_standardtable"); //delete standard table int so as not to interfere with custom scripts. + */ + // Give treasure to the creature if any tables are set. + for(iCounter6 = 1; iCounter6 <= iTableNumber; iCounter6++) + { + ExecuteScript("re_treasure" + GetLocalString(OBJECT_SELF, "re_sTreasureTable" + IntToString(iCounter6)), oCreature); + } + //} + if(iCounter1 < iNumberOfCreatures) + { + oCreature = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lCreatureLocation, FALSE); + } + iCounter1++; + // Determine the facing of the next creature + if(iFacingSameWay == FALSE) + { + fCreatureFacing = IntToFloat(Random(360)); + lCreatureLocation = Location(oArea, vCreatureVector, fCreatureFacing); + } + } + // Stick a lable on the spawning object for record keeping and reference (future use?) + SetLocalObject(oEncounterObject, "re_oLastRandomEncounterSpawned", oCreature); + return oCreature; +} + + + +void CleanHouse(int bDestroyPlotItems = FALSE, object oArea = OBJECT_SELF, int iSpawnOverride = 0, int iItemOverride = 0, int iBodyBagOverride = 0) +{ +// GET THE TIME SCALE FOR THE MODULE + int iMph; + if(!GetLocalInt(GetModule(), "re_iMph")) + { + iMph = 2; + } + else + { + iMph = GetLocalInt(GetModule(), "re_iMph"); + } + +// DECLARE AND INTIALIZE VARIABLES + int iMin = 60; + int iHr = iMin * iMph; + int iDay = iHr * 24; + int iMth = iDay * 28; + int iYr = iMth * 12; + int bShouldIKillHim = TRUE; + int iLifeTime; + int iItemLifeTime; + int iBodyBagLifeTime; + int iPresentTime = (GetCalendarYear() * iYr) + (GetCalendarMonth() * iMth) + (GetCalendarDay() * iDay) + (GetTimeHour() * iHr) + (GetTimeMinute() * iMin) + GetTimeSecond(); + object oObject; + + +// GET EACH OBJECT IN THE AREA AND TEST FOR VALIDITY + //The following assignment uses a peculiar property of the GetArea() function in that if the GetArea() function + //is called on an area then the area is returned. So the oArea parameter of the CleanHouse function can be set + //to an area or an object within that area and the function will work. (unless and/or until this is changed). + object oAmIASpawn = GetFirstObjectInArea(GetArea(oArea)); + while(GetIsObjectValid(oAmIASpawn)) + { + // IS IT A BODY BAG? + if(GetTag(oAmIASpawn) == "BodyBag" && !GetLocalInt(oAmIASpawn, "re_bDroppedItem")) + { + SetLocalInt(oAmIASpawn, "re_bDroppedItem", TRUE); + SetLocalInt(oAmIASpawn, "re_iDropTime", iPresentTime); + object oItem = GetFirstItemInInventory(oAmIASpawn); + while(GetIsObjectValid(oItem)) + { + if(GetLocalInt(oItem, "bItemForGold")) DestroyObject(oItem); + oItem = GetNextItemInInventory(oAmIASpawn); + } + } + // IS IT A DROPPED ITEM? + if(GetLocalInt(oAmIASpawn, "re_bDroppedItem")) + { + // HAS IT BEEN AROUND TOO LONG? + if(iItemOverride) + { + iItemLifeTime = iItemOverride; + } + else + { + iItemLifeTime = 1800; + } + if(iBodyBagOverride) + { + iBodyBagLifeTime = iBodyBagOverride; + } + else + { + iBodyBagLifeTime = 300; + } + if((iPresentTime - GetLocalInt(oAmIASpawn, "re_iDropTime") > iItemLifeTime && GetTag(oAmIASpawn) != "BodyBag") || (iPresentTime - GetLocalInt(oAmIASpawn, "re_iDropTime") > iBodyBagLifeTime && GetTag(oAmIASpawn) == "BodyBag"))// && !GetPlotFlag(oAmIASpawn)) + { + if(GetHasInventory(oAmIASpawn)) + { + oObject = GetFirstItemInInventory(oAmIASpawn); + while(GetIsObjectValid(oObject)) + { + if(!GetPlotFlag(oObject) || bDestroyPlotItems) + { + DestroyObject(oObject, 0.0); + } + oObject = GetNextItemInInventory(oAmIASpawn); + } + } + if(!GetPlotFlag(oAmIASpawn) || bDestroyPlotItems) + { + DestroyObject(oAmIASpawn, 0.0); + } + } + } + // IS HE IS A RANDOM ENCOUNTER? + if(GetLocalInt(oAmIASpawn, "re_bRandomEncounter")) + { + // HAS HE BEEN AROUND TOO LONG? + if(iSpawnOverride) + { + iLifeTime = iSpawnOverride; + } + else + { + iLifeTime = GetLocalInt(oAmIASpawn, "re_iRandomEncounterLifeTime"); + } + if(iPresentTime - GetLocalInt(oAmIASpawn, "re_iRandomEncounterSpawnTime") > iLifeTime) + { + // IS HE IN COMBAT? + if(!GetIsInCombat(oAmIASpawn)) + { + // GET EACH PC AND TEST IF THE CREATURE SEES HIM + // Note: this is because the creature might be charmed + // or influenced not to attack the PCs by other means. + object oPC = GetFirstPC(); + if(GetIsObjectValid(oPC)) + { + while(GetIsObjectValid(oPC)) + { + if(GetObjectSeen(oPC, oAmIASpawn)) + { + bShouldIKillHim = FALSE; + } + oPC = GetNextPC(); + } + } + // IF THE CREATURE HAS PASSED ALL OF THESE CHECKS, DESTROY HIM. + if(bShouldIKillHim) + { + if(!GetIsPC(oAmIASpawn)) //This is prevent despawning of creatures while possessed by a DM. + { + DestroyObject(oAmIASpawn, 0.0); + } + } + } + } + } + oAmIASpawn = GetNextObjectInArea(oArea); + } +} + +//GET TIME IN SECONDS FUNCTION +int GetTimeInSeconds(int iMph = 2) +{ + if(!iMph) iMph = GetLocalInt(GetModule(), "re_iMph"); + int iMin = 60; + int iHr = iMin * iMph; + int iDay = iHr * 24; + int iMth = iDay * 28; + int iYr = iMth * 12; + int iPresentTime = (GetCalendarYear() * iYr) + (GetCalendarMonth() * iMth) + (GetCalendarDay() * iDay) + (GetTimeHour() * iHr) + (GetTimeMinute() * iMin) + GetTimeSecond(); + return iPresentTime; +} + +location RandomWalk2(location lCenter, int iDistance = 20, object oCreature = OBJECT_SELF) +{ + vector vVector; + vector vVectorOffset; + vector vFinalVector; + location lLocation; + object oArea = GetAreaFromLocation(lCenter); + object oWaypoint; + int nLocationValid = 0; + float fDistanceToDoor; + object oDoor; + // determine location of invisible object to be used as target of ActionMoveToLocation command + // if object is too near a door, location will be changed + while (nLocationValid != 1) + { + // determine random location of invisible object to be placed as target of walk command + float fAngle = IntToFloat(Random(360)); + float fDistance = IntToFloat(Random(iDistance) + 1); + vVector = AngleToVector(fAngle); + vVectorOffset = vVector * fDistance; + vFinalVector = GetPositionFromLocation(lCenter) + vVectorOffset; + lLocation = Location(oArea, vFinalVector, fAngle); + // check distance for nearest door, set LocationValid flag if beyond 1 meter + oWaypoint = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLocation); + oDoor = GetNearestObject(OBJECT_TYPE_DOOR, oWaypoint); + fDistanceToDoor = GetDistanceBetween (oWaypoint, oDoor); + if (fDistanceToDoor > 1.0) + nLocationValid = 1; // terminates loop with current oWaypoint if door further away than 1 meter + } + lLocation = GetLocation(oWaypoint); + AssignCommand(oCreature, ActionDoCommand(ActionMoveToLocation(lLocation))); + DestroyObject(oWaypoint); + return lLocation; +} diff --git a/nwnds_module/re_sc_dialogue1.ncs b/nwnds_module/re_sc_dialogue1.ncs new file mode 100644 index 000000000..8ba5ff6b9 Binary files /dev/null and b/nwnds_module/re_sc_dialogue1.ncs differ diff --git a/nwnds_module/re_sc_dialogue1.nss b/nwnds_module/re_sc_dialogue1.nss new file mode 100644 index 000000000..28f41eb4d --- /dev/null +++ b/nwnds_module/re_sc_dialogue1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue10.ncs b/nwnds_module/re_sc_dialogue10.ncs new file mode 100644 index 000000000..613094b13 Binary files /dev/null and b/nwnds_module/re_sc_dialogue10.ncs differ diff --git a/nwnds_module/re_sc_dialogue10.nss b/nwnds_module/re_sc_dialogue10.nss new file mode 100644 index 000000000..ee273afce --- /dev/null +++ b/nwnds_module/re_sc_dialogue10.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 10)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue2.ncs b/nwnds_module/re_sc_dialogue2.ncs new file mode 100644 index 000000000..e303bbc55 Binary files /dev/null and b/nwnds_module/re_sc_dialogue2.ncs differ diff --git a/nwnds_module/re_sc_dialogue2.nss b/nwnds_module/re_sc_dialogue2.nss new file mode 100644 index 000000000..d68308d49 --- /dev/null +++ b/nwnds_module/re_sc_dialogue2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue3.ncs b/nwnds_module/re_sc_dialogue3.ncs new file mode 100644 index 000000000..55675f6ef Binary files /dev/null and b/nwnds_module/re_sc_dialogue3.ncs differ diff --git a/nwnds_module/re_sc_dialogue3.nss b/nwnds_module/re_sc_dialogue3.nss new file mode 100644 index 000000000..953995d27 --- /dev/null +++ b/nwnds_module/re_sc_dialogue3.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue4.ncs b/nwnds_module/re_sc_dialogue4.ncs new file mode 100644 index 000000000..7b8b6aac1 Binary files /dev/null and b/nwnds_module/re_sc_dialogue4.ncs differ diff --git a/nwnds_module/re_sc_dialogue4.nss b/nwnds_module/re_sc_dialogue4.nss new file mode 100644 index 000000000..d83699764 --- /dev/null +++ b/nwnds_module/re_sc_dialogue4.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 4)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue5.ncs b/nwnds_module/re_sc_dialogue5.ncs new file mode 100644 index 000000000..e54a3d55b Binary files /dev/null and b/nwnds_module/re_sc_dialogue5.ncs differ diff --git a/nwnds_module/re_sc_dialogue5.nss b/nwnds_module/re_sc_dialogue5.nss new file mode 100644 index 000000000..4ae301219 --- /dev/null +++ b/nwnds_module/re_sc_dialogue5.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 5)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue6.ncs b/nwnds_module/re_sc_dialogue6.ncs new file mode 100644 index 000000000..9897ace4b Binary files /dev/null and b/nwnds_module/re_sc_dialogue6.ncs differ diff --git a/nwnds_module/re_sc_dialogue6.nss b/nwnds_module/re_sc_dialogue6.nss new file mode 100644 index 000000000..07b7055ed --- /dev/null +++ b/nwnds_module/re_sc_dialogue6.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 6)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue7.ncs b/nwnds_module/re_sc_dialogue7.ncs new file mode 100644 index 000000000..7d41ef879 Binary files /dev/null and b/nwnds_module/re_sc_dialogue7.ncs differ diff --git a/nwnds_module/re_sc_dialogue7.nss b/nwnds_module/re_sc_dialogue7.nss new file mode 100644 index 000000000..1dea13cbd --- /dev/null +++ b/nwnds_module/re_sc_dialogue7.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 7)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue8.ncs b/nwnds_module/re_sc_dialogue8.ncs new file mode 100644 index 000000000..01460317f Binary files /dev/null and b/nwnds_module/re_sc_dialogue8.ncs differ diff --git a/nwnds_module/re_sc_dialogue8.nss b/nwnds_module/re_sc_dialogue8.nss new file mode 100644 index 000000000..7667505b9 --- /dev/null +++ b/nwnds_module/re_sc_dialogue8.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 8)) + { + return FALSE; + } + SetCustomToken(2112, GetLocalString(OBJECT_SELF, "sName")); + return TRUE; +} diff --git a/nwnds_module/re_sc_dialogue9.ncs b/nwnds_module/re_sc_dialogue9.ncs new file mode 100644 index 000000000..c4dcd14de Binary files /dev/null and b/nwnds_module/re_sc_dialogue9.ncs differ diff --git a/nwnds_module/re_sc_dialogue9.nss b/nwnds_module/re_sc_dialogue9.nss new file mode 100644 index 000000000..883a4e3ae --- /dev/null +++ b/nwnds_module/re_sc_dialogue9.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dialogue1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 5/16/2003 9:32:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(OBJECT_SELF, "iDialogue") == 9)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/re_spawn_merch.ncs b/nwnds_module/re_spawn_merch.ncs new file mode 100644 index 000000000..b19b3a7ff Binary files /dev/null and b/nwnds_module/re_spawn_merch.ncs differ diff --git a/nwnds_module/re_spawn_merch.nss b/nwnds_module/re_spawn_merch.nss new file mode 100644 index 000000000..f341b7c63 --- /dev/null +++ b/nwnds_module/re_spawn_merch.nss @@ -0,0 +1,103 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + //Randomizes NPC's Appearance + object oNPC = OBJECT_SELF; + string sTag = GetTag(oNPC); + + int nPheno; + nPheno = Random(4)+1; + if (nPheno == 4) + SetPhenoType(PHENOTYPE_BIG, oNPC); + + int nSkinColor; + nSkinColor = Random(15)+1; + SetColor(oNPC, COLOR_CHANNEL_SKIN, nSkinColor); + + int nHeadNumber; + nHeadNumber = Random(12)+1; + SetCreatureBodyPart(CREATURE_PART_HEAD, nHeadNumber, oNPC); + + int nHairColor; + nHairColor = Random(15)+1; + SetColor(oNPC, COLOR_CHANNEL_HAIR, nHairColor); + + //Randomizes Clothing + int nResult = d6(); + string sItem; + sItem = "comclothes" + IntToString(nResult); + DelayCommand(1.0f, ActionEquipItem(CreateItemOnObject(sItem), INVENTORY_SLOT_CHEST)); + //SetLocalString(OBJECT_SELF, "sName", RandomName()); + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + //WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature + +} + + diff --git a/nwnds_module/re_spawnerhb.ncs b/nwnds_module/re_spawnerhb.ncs new file mode 100644 index 000000000..f8d423e05 Binary files /dev/null and b/nwnds_module/re_spawnerhb.ncs differ diff --git a/nwnds_module/re_spawnerhb.nss b/nwnds_module/re_spawnerhb.nss new file mode 100644 index 000000000..d3fe192cd --- /dev/null +++ b/nwnds_module/re_spawnerhb.nss @@ -0,0 +1,108 @@ +//::///////////////////////////////////////////////////////////////// +//:: FileName re_spawnerhb +//:: Copyright (c) 2001 Bioware Corp. +//::///////////////////////////////////////////////////////////////// +/* +This script is used in the heartbeat of the +BESIE RES tool, part of the BESIE Random +Encounter package by Ray Miller. +*/ +//::///////////////////////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 9-2-02 +//::///////////////////////////////////////////////////////////////// +#include "re_rndenc" +void main() +{ +///////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// +//Set this parameter to FALSE if you wish +//your encounter distances to be constant +int RandomDistance = TRUE; +/////////////////////////////////////////////////////////// +/* +If you want a BESIE RES tool to start and stop spawning +creatures at particular game times, set the following variables +to the appropriate times and save the script under a different +name. You could also set the local integers "re_iBegin" and +"re_iEnd" on the spawner externally if you wanted. +*/ +int StartTime = 0; +int StopTime = 0; +/////////////////////////////////////////////////////////// + + float fChanceOfEncounter; + if(StartTime || StopTime) + { + SetLocalInt(OBJECT_SELF, "re_iBegin", StartTime); + SetLocalInt(OBJECT_SELF, "re_iEnd", StopTime); + } + if(GetLocalInt(OBJECT_SELF, "re_iBegin") > 23) SetLocalInt(OBJECT_SELF, "re_iBegin", 23); + if(GetLocalInt(OBJECT_SELF, "re_iEnd") > 23) SetLocalInt(OBJECT_SELF, "re_iEnd", 23); + if(!GetLocalInt(OBJECT_SELF, "re_BESIE")) + { + SetLocalInt(OBJECT_SELF, "re_BESIE", TRUE); + SetLocalString(OBJECT_SELF, "re_ToolType", "BESIE RES"); + } + if(GetLocalInt(GetModule(), "re_disableBESIERES") || GetLocalInt(GetArea(OBJECT_SELF), "re_disableBESIERES") || GetLocalInt(OBJECT_SELF, "re_disable")) + { + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + return; + } + int iStartTime = GetLocalInt(OBJECT_SELF, "re_iBegin"); + int iStopTime = GetLocalInt(OBJECT_SELF, "re_iEnd"); + if((iStartTime <= iStopTime && (GetTimeHour() >= iStartTime && GetTimeHour() < iStopTime)) + || (iStartTime >= iStopTime && (GetTimeHour() >= iStartTime || GetTimeHour() < iStopTime))) + fChanceOfEncounter = IntToFloat(GetMaxHitPoints(OBJECT_SELF)) / 100; + else fChanceOfEncounter = 0.0; + int iFaction; + int iCounterX; + object oEncounterObject; + object oArea = GetArea(OBJECT_SELF); + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + if(GetArea(oPC) == oArea) + { + string sLeader = GetPCPlayerName(GetFactionLeader(oPC)) + GetName(GetFactionLeader(oPC)); + if(!GetLocalInt(OBJECT_SELF, "i" + sLeader)) + { + iFaction++; + SetLocalString(OBJECT_SELF, "sFaction" + IntToString(iFaction), sLeader); + } + SetLocalInt(OBJECT_SELF, "i" + sLeader, GetLocalInt(OBJECT_SELF, "i" + sLeader) + 1); + SetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(GetLocalInt(OBJECT_SELF, "i" + sLeader)), oPC); + } + oPC = GetNextPC(); + } + if(!GetIsObjectValid(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner"))) SetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner", OBJECT_SELF); + if(GetLocalObject(GetArea(OBJECT_SELF), "re_oHouseCleaner") == OBJECT_SELF) CleanHouse(); + if(!iFaction) return; + string sLeader = GetLocalString(OBJECT_SELF, "sFaction" + IntToString(Random(iFaction) + 1)); + int iMember = Random(GetLocalInt(OBJECT_SELF, "i" + sLeader)) + 1; + oEncounterObject = GetLocalObject(OBJECT_SELF, "o" + sLeader + IntToString(iMember)); + for(iCounterX = 1; iCounterX <= iFaction; iCounterX++) + { + DeleteLocalInt(OBJECT_SELF, "i" + GetLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX))); + DeleteLocalString(OBJECT_SELF, "sFaction" + IntToString(iCounterX)); + } + string sTemplate = GetTag(OBJECT_SELF); + int iNumberOfParties; + int iMinDistance = RandomDistance+10; + int iDifficulty = GetFortitudeSavingThrow(OBJECT_SELF); + int iCheckDistance = GetReflexSavingThrow(OBJECT_SELF); + int iMaxDistance = GetWillSavingThrow(OBJECT_SELF)+10; + + // Return if the resting variable is set by the re_onrest script. + if(GetLocalInt(oEncounterObject, "re_resting")) return; + + if(!iMaxDistance) + { + iMaxDistance = 1; + } + if(GetStringLeft(sTemplate, 3) != "re_") + sTemplate = "random"; + fChanceOfEncounter = IntToFloat(iFaction) * fChanceOfEncounter; + RandomEncounter(fChanceOfEncounter, oEncounterObject, sTemplate, 0, 0, iMinDistance, iMaxDistance, 360, 0, iCheckDistance, 0, iDifficulty); +} diff --git a/nwnds_module/re_table.nss b/nwnds_module/re_table.nss new file mode 100644 index 000000000..1f674c570 --- /dev/null +++ b/nwnds_module/re_table.nss @@ -0,0 +1,1923 @@ +//:://///////////////////////////////////////////// +//:: Name +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +This script represents the standard encounter table +for the BESIE Random Encounter System By Ray Miller. +It is meant to be used as an include, and will not +compile on its own. +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: God knows. I wrote this months ago! +//::////////////////////////////////////////////// + + +string GetRndEncCreature(float fMinCR = 0.0, float fMaxCR = 9999.0, string sCreatureTable = "") +{ +// IF NOT INITIALIZED THEN DO SO + /*if(!GetLocalInt(GetModule(), "re_bInitialized")) + { + SetRndEncProperties(); + }*/ + +// DECLARE AND INTIALIZE VARIABLES + object oMod = GetModule(); + string sChoice = "nil"; + string sBuild; + int bCustom; + int iCounter1; + int iCounter2 = 0; + int iCounter3; + int iVarNum; + float fCR; + if (fMinCR > 18.0) fMinCR = 18.0; + sCreatureTable = GetStringLowerCase(sCreatureTable); + if(GetStringLeft(sCreatureTable, 8) == "commoner") sCreatureTable = "z" + GetStringRight(sCreatureTable, GetStringLength(sCreatureTable) - 8); + +/* The following code was added with v1.8. It checks to see if the template contains the string '2da' +if so it checks to ensure the tag name matches the file name of a 2DA file by looking for the 'TableLength' +parameter on Row 0. If it is present, a check is made to ensure that the parameter is correct. If so, the +standard or 'old style' table will be ignored and this routine will draw an encounter from the 2da file. */ + if(GetStringLeft(sCreatureTable, 3) == "2da") + { + string s2DAMatch = "re_" + GetStringRight(GetStringLowerCase(sCreatureTable), GetStringLength(sCreatureTable) - 4); + int iTableLength = StringToInt(Get2DAString(s2DAMatch, "TableLength", 0)); + if(iTableLength && Get2DAString(s2DAMatch, "ResRef", iTableLength) != "" && Get2DAString(s2DAMatch, "ResRef", iTableLength + 1) == "") + { + int iRnd = Random(iTableLength) + 1; + string sTreasure = Get2DAString(s2DAMatch, "Treasure", iRnd); + int iMinimum = StringToInt(Get2DAString(s2DAMatch, "Minimum", iRnd)); + int iMaximum = StringToInt(Get2DAString(s2DAMatch, "Maximum", iRnd)); + if(!iMinimum && !iMaximum) iMaximum = 1; + SetLocalInt(oMod, "re_iMinNumberOfCreatures", iMinimum); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures", iMaximum); + string sCreature = Get2DAString(s2DAMatch, "ResRef", iRnd); + if(sTreasure != "") SetLocalString(GetModule(), "re_s2DATreasure", sTreasure); + return sCreature; + } + else + { + string sError = "BESIE error: 2DA Table " + s2DAMatch + " is not present or is invalid!"; + object oPC = GetFirstPC(); + SendMessageToAllDMs(sError); + while(GetIsObjectValid(oPC)) + { + SendMessageToPC(oPC, sError); + oPC = GetNextPC(); + } + WriteTimestampedLogEntry(sError); + return ""; + } + } + +// PICK RANDOM ABERRATION + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "n") + { + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_BATTDEVOUR"; + fCR = 11.0; + break; + + case 1:sChoice = "X2_BEHOLDER001"; + fCR = 11.0; + break; + + case 2:sChoice = "X2_BEHOLDER003"; + fCR = 15.0; + break; + + case 3:sChoice = "X2_DRIDER001"; + fCR = 6.0; + break; + + case 4:sChoice = "X2_DRIDER002"; + fCR = 10.0; + break; + + case 5:sChoice = "X2_DRIDER003"; + fCR = 17.0; + break; + + case 6:sChoice = "X2_DRIDER004"; + fCR = 23.0; + break; + + case 7:sChoice = "X2_DRIDER005"; + fCR = 28.0; + break; + + case 8:sChoice = "X2_FDRIDER002"; + fCR = 7.0; + break; + + case 9:sChoice = "X2_DRIDERW01"; + fCR = 8.0; + break; + + case 10:sChoice = "NW_ETTERCAP"; + fCR = 5.0; + break; + + case 11:sChoice = "X2_BEHOLDER002"; + fCR = 3.0; + break; + + case 12:sChoice = "X2_FDRIDER001"; + fCR = 6.0; + break; + + case 13:sChoice = "NW_HORROR"; + fCR = 5.0; + break; + + case 14:sChoice = "NW_DEVOUR"; + fCR = 7.0; + break; + + case 15:sChoice = "X2_MINDFLAYER001"; + fCR = 9.0; + break; + + case 16:sChoice = "X2_MINDFDARKENER"; + fCR = 16.0; + break; + + case 17:sChoice = "X2_MINDFVENERATR"; + fCR = 20.0; + break; + + case 18:sChoice = "X2_MINDFLAYER002"; + fCR = 19.0; + break; + + case 19:sChoice = "NW_UMBERHULK"; + fCR = 9.0; + break; + + case 20:sChoice = "NW_WILLOWISP"; + fCR = 8.0; + break; + + case 21:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && sChoice != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } + + +// PICK RANDOM ANIMAL + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "a") + { + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_BEARDIREBOSS"; + fCR = 15.0; + break; + + case 1:sChoice = "NW_BEARBLCK"; + fCR = 2.0; + break; + + case 2:sChoice = "NW_BEARBRWN"; + fCR = 5.0; + break; + + case 3:sChoice = "NW_BEARDIRE"; + fCR = 9.0; + break; + + case 4:sChoice = "NW_BEARKODIAK"; + fCR = 6.0; + break; + + case 5:sChoice = "NW_BEARPOLAR"; + fCR = 6.0; + break; + + case 6:sChoice = "NW_BEASTMALAR001"; + fCR = 7.0; + break; + + case 7:sChoice = "NW_DIREWOLF"; + fCR = 5.0; + break; + + case 8:sChoice = "NW_WOLFDIREBOSS"; + fCR = 11.0; + break; + + case 9:sChoice = "NW_WOLFWINT"; + fCR = 5.0; + break; + + case 10:sChoice = "NW_WOLF"; + fCR = 1.0; + break; + + case 11:sChoice = "NW_WORG"; + fCR = 3.0; + break; + + case 12:sChoice = "NW_COUGAR"; + fCR = 2.0; + break; + + case 13:sChoice = "NW_CRAGCAT"; + fCR = 2.0; + break; + + case 14:sChoice = "NW_DIRETIGER"; + fCR = 11.0; + break; + + case 15:sChoice = "NW_JAGUAR"; + fCR = 3.0; + break; + + case 16:sChoice = "NW_CAT"; + fCR = 2.0; + break; + + case 17:sChoice = "NW_LION"; + fCR = 3.0; + break; + + case 18:sChoice = "NW_PANTHER"; + fCR = 2.0; + break; + + case 19:sChoice = "NW_BADGER"; + fCR = 0.5; + break; + + case 20:sChoice = "NW_BOAR"; + fCR = 2.0; + break; + + case 21:sChoice = "NW_DIREBADG"; + fCR = 3.0; + break; + + case 22:sChoice = "NW_BOARDIRE"; + fCR = 5.0; + break; + + case 23:sChoice = "NW_RAT001"; + fCR = 0.12; + break; + + case 24:sChoice = "NW_RATDIRE001"; + fCR = 0.33; + break; + + case 25:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && sChoice != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM CONSTRUCT + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "c") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_BATHORROR"; + fCR = 13.0; + break; + + case 1:sChoice = "NW_GolBone"; + fCR = 11.0; + break; + + case 2:sChoice = "NW_GolClay"; + fCR = 10.0; + break; + + case 3:sChoice = "NW_GOLFLESH"; + fCR = 8.0; + break; + + case 4:sChoice = "NW_HELMHORR"; + fCR = 11.0; + break; + + case 5:sChoice = "NW_GOLIRON"; + fCR = 16.0; + break; + + case 6:sChoice = "NW_MINOGON"; + fCR = 8.0; + break; + + case 7:sChoice = "NW_SHGUARD"; + fCR = 13.0; + break; + + case 8:sChoice = "NW_GOLSTONE"; + fCR = 12.0; + break; + + case 9:sChoice = "X2_GOLEM002"; + fCR = 32.0; + break; + + case 10:sChoice = "nw_goldmflesh001"; + fCR = 25.0; + break; + + case 11:sChoice = "X2_GOLIRON_HUGE"; + fCR = 21.0; + break; + + case 12:sChoice = "X2_GOLEM001"; + fCR = 35.0; + break; + + case 13:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && sChoice != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM DRAGON + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "d") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_DRGBLACK001"; + fCR = 13.0; + break; + + case 1:sChoice = "NW_DRGBLUE001"; + fCR = 14.0; + break; + + case 2:sChoice = "NW_DRGGREEN001"; + fCR = 14.0; + break; + + case 3:sChoice = "NW_DRGRED001"; + fCR = 15.0; + break; + + case 4:sChoice = "NW_DRGWHITE001"; + fCR = 12.0; + break; + + case 5:sChoice = "NW_DRGBLACK002"; + fCR = 17.0; + break; + + case 6:sChoice = "NW_DRGBLUE002"; + fCR = 18.0; + break; + + case 7:sChoice = "NW_DRGGREEN002"; + fCR = 18.0; + break; + + case 8:sChoice = "NW_DRGRED002"; + fCR = 19.0; + break; + + case 9:sChoice = "NW_DRGWHITE002"; + fCR = 16.0; + break; + + case 10:sChoice = "NW_DRGBLACK003"; + fCR = 21.0; + break; + + case 11:sChoice = "NW_DRGBLUE003"; + fCR = 23.0; + break; + + case 12:sChoice = "NW_DRGGREEN003"; + fCR = 23.0; + break; + + case 13:sChoice = "NW_DRGRED003"; + fCR = 25.0; + break; + + case 14:sChoice = "NW_HALFDRA001"; + fCR = 13.0; + break; + + case 15:sChoice = "X2_DRAGONSHAD001"; + fCR = 22.0; + break; + + case 16:sChoice = "X2_DRAGONPRIS001"; + fCR = 37.0; + break; + + case 17:sChoice = "X0_WYRMLING_BLK"; + fCR = 3.0; + break; + + case 18:sChoice = "X0_WYRMLING_BLU"; + fCR = 5.0; + break; + + case 19:sChoice = "X0_WYRMLING_GRN"; + fCR = 4.0; + break; + + case 20:sChoice = "X0_WYRMLING_RED"; + fCR = 5.0; + break; + + case 21:sChoice = "X0_WYRMLING_WHT"; + fCR = 3.0; + break; + + case 22:sChoice = ""; + fCR = 0.0; + break; + + } + if(fCR >= fMinCR && fCR <= fMaxCR && sChoice != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM ELEMENTAL + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "e") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_AIR"; + fCR = 4.0; + break; + + case 1:sChoice = "NW_Earth"; + fCR = 4.0; + break; + + case 2:sChoice = "NW_AIRELDER"; + fCR = 20.0; + break; + + case 3:sChoice = "NW_EARTHELD"; + fCR = 17.0; + break; + + case 4:sChoice = "NW_FIREELDER"; + fCR = 17.0; + break; + + case 5:sChoice = "NW_WATELDER"; + fCR = 16.0; + break; + + case 6:sChoice = "NW_FIRE"; + fCR = 3.0; + break; + + case 7:sChoice = "NW_AIRGREAT"; + fCR = 18.0; + break; + + case 8:sChoice = "NW_EARTHGREAT"; + fCR = 15.0; + break; + + case 9:sChoice = "NW_FIREGREAT"; + fCR = 15.0; + break; + + case 10:sChoice = "NW_WATERGREAT"; + fCR = 14.0; + break; + + case 11:sChoice = "NW_AIRHUGE"; + fCR = 13.0; + break; + + case 12:sChoice = "NW_EARTHHUGE"; + fCR = 11.0; + break; + + case 13:sChoice = "NW_FIREHUGE"; + fCR = 12.0; + break; + + case 14:sChoice = "NW_WATERHUGE"; + fCR = 11.0; + break; + + case 15:sChoice = "NW_INVSTALK"; + fCR = 6.0; + break; + + case 16:sChoice = "NW_WATER"; + fCR = 4.0; + break; + + case 17:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM GIANT + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "g") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_ETTIN"; + fCR = 8.0; + break; + + case 1:sChoice = "NW_GNTHILL"; + fCR = 10.0; + break; + + case 2:sChoice ="NW_GNTMOUNT"; + fCR = 10.0; + break; + + case 3:sChoice = "NW_GNTFIRE"; + fCR = 12.0; + break; + + case 4:sChoice = "NW_GNTFROST"; + fCR = 10.0; + break; + + case 5:sChoice = "NW_OGRE01"; + fCR = 3.0; + break; + + case 6:sChoice = "NW_OGRE02"; + fCR = 3.0; + break; + + case 7:sChoice = "NW_OGRECHIEF01"; + fCR = 6.0; + break; + + case 8:sChoice = "NW_OGRECHIEF02"; + fCR = 6.0; + break; + + case 9:sChoice = "nw_ogreboss"; + fCR = 9.0; + break; + + case 10:sChoice = "NW_OGREMAGEBOSS"; + fCR = 21.0; + break; + + case 11:sChoice = "NW_OGREMAGE01"; + fCR = 5.0; + break; + + case 12:sChoice = "NW_OGREMAGE02"; + fCR = 5.0; + break; + + case 13:sChoice = "NW_TROLL"; + fCR = 5.0; + break; + + case 14:sChoice = "NW_TROLLCHIEF"; + fCR = 8.0; + break; + + case 15:sChoice = "NW_TROLLBOSS"; + fCR = 9.0; + break; + + case 16:sChoice = "NW_TROLLWIZ"; + fCR = 8.0; + break; + + case 17:sChoice = "X0_GNTFIREFEM"; + fCR = 10.0; + break; + + case 18:sChoice = "X0_GNTFROSTFEM"; + fCR = 9.0; + break; + + case 19:sChoice = ""; + fCR = 0.0; + break; + + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM HUMANOID + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "h") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_BUGBEARA"; + fCR = 2.0; + break; + + case 1:sChoice = "NW_BUGBEARB"; + fCR = 2.0; + break; + + case 2:sChoice = "nw_bugbearboss"; + fCR = 10.0; + break; + + case 3:sChoice = "NW_BUGCHIEFA"; + fCR = 5.0; + break; + + case 4:sChoice = "NW_BUGCHIEFB"; + fCR = 5.0; + break; + + case 5:sChoice = "NW_BUGWIZA"; + fCR = 4.0; + break; + + case 6:sChoice = "NW_BUGWIZB"; + fCR = 4.0; + break; + + case 7:sChoice = "NW_GRIG"; + fCR = 2.0; + break; + + case 8:sChoice = "NW_PIXIE"; + fCR = 2.0; + break; + + case 9:sChoice = "NW_GOBLINA"; + fCR = 0.25; + break; + + case 10:sChoice = "NW_GOBLINB"; + fCR = 0.25; + break; + + case 11:sChoice = "NW_GOBLINBOSS"; + fCR = 11.0; + break; + + case 12:sChoice = "NW_GOBCHIEFA"; + fCR = 4.0; + break; + + case 13:sChoice = "NW_GOBCHIEFB"; + fCR = 3.0; + break; + + case 14:sChoice = "NW_GOBWIZA"; + fCR = 3.0; + break; + + case 15:sChoice = "NW_GOBWIZB"; + fCR = 3.0; + break; + + case 16:sChoice = "NW_OLDCHIEFA"; + fCR = 4.0; + break; + + case 17:sChoice = "NW_OLDCHIEFB"; + fCR = 4.0; + break; + + case 19:sChoice = "NW_OLDMAGEA"; + fCR = 4.0; + break; + + case 20:sChoice = "NW_OLDMAGEB"; + fCR = 4.0; + break; + + case 21:sChoice = "NW_OLDWARB"; + fCR = 2.0; + break; + + case 22:sChoice = "NW_OLDWARRA"; + fCR = 2.0; + break; + + case 23:sChoice = "NW_YUAN_TI001"; + fCR = 5.0; + break; + + case 24:sChoice = "NW_YUAN_TI003"; + fCR = 6.0; + break; + + case 25:sChoice = "NW_YUAN_TI002"; + fCR = 5.0; + break; + + case 26:sChoice = "NW_MINOTAUR"; + fCR = 4.0; + break; + + case 27:sChoice = "NW_MinChief"; + fCR = 8.0; + break; + + case 28:sChoice = "NW_MINOTAURBOSS"; + fCR = 14.0; + break; + + case 29:sChoice = "NW_MINWIZ"; + fCR = 9.0; + break; + + case 30:sChoice = "NW_ORCA"; + fCR = 0.25; + break; + + case 31:sChoice = "NW_ORCB"; + fCR = 0.25; + break; + + case 32:sChoice = "NW_OrcChiefA"; + fCR = 3.0; + break; + + case 33:sChoice = "NW_ORCCHIEFB"; + fCR = 3.0; + break; + + case 34:sChoice = "nw_orcboss"; + fCR = 10.0; + break; + + case 35:sChoice = "NW_ORCWIZA"; + fCR = 4.0; + break; + + case 36:sChoice = "NW_ORCWIZB"; + fCR = 4.0; + break; + + case 37:sChoice = "NW_KOBOLD001"; + fCR = 0.33; + break; + + case 38:sChoice = "NW_KOBOLD002"; + fCR = 0.33; + break; + + case 39:sChoice = "NW_KOBOLD004"; + fCR = 2.0; + break; + + case 40:sChoice = "NW_KOBOLD006"; + fCR = 2.0; + break; + + case 41:sChoice = "NW_KOBOLD005"; + fCR = 2.0; + break; + + case 42:sChoice = "NW_KOBOLD003"; + fCR = 2.0; + break; + + case 43:sChoice = "NW_GNOLL001"; + fCR = 1.0; + break; + + case 44:sChoice = "NW_GNOLL002"; + fCR = 3.0; + break; + + case 45:sChoice = "NW_HOBGOBLIN001"; + fCR = 0.33; + break; + + case 46:sChoice = "NW_HOBGOBLIN002"; + fCR = 2.0; + break; + + case 47:sChoice = "X0_ASABI_CHIEF"; + fCR = 6.0; + break; + + case 48:sChoice = "X0_ASABI_SHAMAN"; + fCR = 5.0; + break; + + case 49:sChoice = "X0_ASABI_WARRIOR"; + fCR = 2.0; + break; + + case 50:sChoice = "X0_MEDUSA"; + fCR = 6.0; + break; + + case 51:sChoice = "X0_STINGER"; + fCR = 3.0; + break; + + case 52:sChoice = "X0_STINGER_CHIEF"; + fCR = 7.0; + break; + + case 53:sChoice = "X0_STINGER_MAGE"; + fCR = 5.0; + break; + + case 54:sChoice = "X0_STINGER_WAR"; + fCR = 5.0; + break; + + case 55:sChoice = "nw_seahag"; + fCR = 4.0; + break; + + case 56:sChoice = ""; + fCR = 4.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM INSECT + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "i") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_BTLBOMB"; + fCR = 3.0; + break; + + case 1:sChoice = "NW_BTLFIRE"; + fCR = 0.25; + break; + + case 2:sChoice = "nw_beetleboss"; + fCR = 16.0; + break; + + case 3:sChoice = "NW_BTLFIRE02"; + fCR = 3.0; + break; + + case 4:sChoice = "NW_BTLSTAG"; + fCR = 7.0; + break; + + case 5:sChoice = "NW_BTLSTINK"; + fCR = 3.0; + break; + + case 6:sChoice = "NW_SPIDDIRE"; + fCR = 7.0; + break; + + case 7:sChoice = "NW_SPIDGIANT"; + fCR = 3.0; + break; + + case 8:sChoice = "NW_SPIDPHASE"; + fCR = 3.0; + break; + + case 9:sChoice = "NW_SPIDERBOSS"; + fCR = 14.0; + break; + + case 10:sChoice = "NW_SPIDSWRD"; + fCR = 4.0; + break; + + case 11:sChoice = "NW_SPIDWRA"; + fCR = 4.0; + break; + + case 12:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM MISCELLANEOUS + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "m") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "X0_BASILISK"; + fCR = 5.0; + break; + + case 1:sChoice = "X0_COCKATRICE"; + fCR = 5.0; + break; + + case 2:sChoice = "X2_HARPY001"; + fCR = 3.0; + break; + + case 3:sChoice = "NW_GRAYREND"; + fCR = 8.0; + break; + + case 4:sChoice = "X2_DEEPROTHE001"; + fCR = 1.0; + break; + + case 5:sChoice = "X0_GORGON"; + fCR = 7.0; + break; + + case 6:sChoice = "NW_KRENSHAR"; + fCR = 2.0; + break; + + case 7:sChoice = "NW_STIRGE"; + fCR = 0.33; + break; + + case 8:sChoice = "X0_MANTICORE"; + fCR = 6.0; + break; + + case 9:sChoice = "X2_GELCUBE"; + fCR = 3.0; + break; + + case 10:sChoice = ""; + fCR = 5.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM PLANAR + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "p") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_DEMON"; + fCR = 15.0; + break; + + case 1:sChoice = "NW_HALFFND001"; + fCR = 8.0; + break; + + case 2:sChoice = "NW_HELLHOUND"; + fCR = 4.0; + break; + + case 3:sChoice = "NW_BEASTXVIM"; + fCR = 5.0; + break; + + case 4:sChoice = "NW_RAKSHASA"; + fCR = 7.0; + break; + + case 5:sChoice = "NW_SHMASTIF"; + fCR = 4.0; + break; + + case 6:sChoice = "NW_DMSUCUBUS"; + fCR = 7.0; + break; + + case 7:sChoice = "NW_DMVROCK"; + fCR = 10.0; + break; + + case 8:sChoice = "NW_MEPAIR"; + fCR = 3.0; + break; + + case 9:sChoice = "NW_MEPDUST"; + fCR = 3.0; + break; + + case 10:sChoice = "NW_MEPEARTH"; + fCR = 3.0; + break; + + case 11:sChoice = "NW_MEPFIRE"; + fCR = 3.0; + break; + + case 12:sChoice = "NW_MEPICE"; + fCR = 3.0; + break; + + case 13:sChoice = "NW_IMP"; + fCR = 3.0; + break; + + case 14:sChoice = "NW_MEPMAGMA"; + fCR = 3.0; + break; + + case 15:sChoice = "NW_MEPOOZE"; + fCR = 3.0; + break; + + case 16:sChoice = "NW_DMQUASIT"; + fCR = 3.0; + break; + + case 17:sChoice = "NW_MEPSALT"; + fCR = 3.0; + break; + + case 19:sChoice = "NW_MEPSTEAM"; + fCR = 3.0; + break; + + case 20:sChoice = "NW_MEPWATER"; + fCR = 3.0; + break; + + case 21:sChoice = "NW_TIEFLING02"; + fCR = 0.5; + break; + + case 22:sChoice = "NW_SLAADBL"; + fCR = 7.0; + break; + + case 23:sChoice = "NW_SLAADDETH"; + fCR = 15.0; + break; + + case 24:sChoice = "NW_SLAADDTHBOSS"; + fCR = 15.0; + break; + + case 25:sChoice = "NW_SLAADGRAY"; + fCR = 10.0; + break; + + case 26:sChoice = "NW_SLAADGRYBOSS"; + fCR = 11.0; + break; + + case 27:sChoice = "NW_SLAADGRN"; + fCR = 9.0; + break; + + case 28:sChoice = "NW_SLAADRED"; + fCR = 6.0; + break; + + case 29:sChoice = "X2_SPIDERDEMO001"; + fCR = 12.0; + break; + + case 30:sChoice = "x2_erinyes"; + fCR = 8.0; + break; + + case 31:sChoice = "X2_PITFIEND001"; + fCR = 15.0; + break; + + case 32:sChoice = "X0_FORM_MYRMARCH"; + fCR = 11.0; + break; + + case 33:sChoice = "X0_FORM_QUEEN"; + fCR = 20.0; + break; + + case 34:sChoice = "X0_FORM_TASKMAST"; + fCR = 7.0; + break; + + case 35:sChoice = "X0_FORM_WARRIOR"; + fCR = 4.0; + break; + + case 36:sChoice = "X0_FORM_WORKER"; + fCR = 1.0; + break; + + case 37:sChoice = "X2_SLAADBLACK001"; + fCR = 30.0; + break; + + case 38:sChoice = "X2_SLAADWHITE001"; + fCR = 25.0; + break; + + case 39:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM SHAPECHANGER + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "s") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_ARANEA"; + fCR = 3.0; + break; + + case 1:sChoice = "NW_WERECAT"; + fCR = 5.0; + break; + + case 2:sChoice = "NW_WERERAT001"; + fCR = 0.5; + break; + + case 3:sChoice = "NW_WEREWOLF"; + fCR = 2.0; + break; + + case 4:sChoice = "NW_WERERAT"; + fCR = 0.5; + break; + + case 5:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM UNDEAD + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "u") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_GHAST"; + fCR = 4.0; + break; + + case 1:sChoice = "NW_GHOUL"; + fCR = 2.0; + break; + + case 2:sChoice = "NW_GHOULLORD"; + fCR = 5.0; + break; + + case 3:sChoice = "NW_GHOULBOSS"; + fCR = 10.0; + break; + + case 4:sChoice = "NW_MUMCLERIC"; + fCR = 10.0; + break; + + case 5:sChoice = "NW_MUMMY"; + fCR = 5.0; + break; + + case 6:sChoice = "NW_MUMMYBOSS"; + fCR = 11.0; + break; + + case 7:sChoice = "NW_MUMFIGHT"; + fCR = 10.0; + break; + + case 8:sChoice = "NW_ZOMBWARR02"; + fCR = 19.0; + break; + + case 9:sChoice = "NW_Bodak"; + fCR = 9.0; + break; + + case 10:sChoice = "NW_CURST004"; + fCR = 6.0; + break; + + case 11:sChoice = "NW_CURST003"; + fCR = 5.0; + break; + + case 12:sChoice = "NW_CURST002"; + fCR = 6.0; + break; + + case 13:sChoice = "NW_CURST001"; + fCR = 5.0; + break; + + case 14:sChoice = "NW_DOOMKGHT"; + fCR = 10.0; + break; + + case 15:sChoice = "NW_DOOMKGHTBOSS"; + fCR = 15.0; + break; + + case 16:sChoice = "NW_LICH001"; + fCR = 28.0; + break; + + case 17:sChoice = "NW_LICH003"; + fCR = 17.0; + break; + + case 19:sChoice = "NW_LICHBOSS"; + fCR = 21.0; + break; + + case 20:sChoice = "NW_MOHRG"; + fCR = 12.0; + break; + + case 21:sChoice = "NW_REVENANT001"; + fCR = 7.0; + break; + + case 22:sChoice = "NW_SKELDEVOUR"; + fCR = 13.0; + break; + + case 23:sChoice = "NW_VAMPIRE"; + fCR = 6.0; + break; + + case 24:sChoice = "NW_VAMPIRE003"; + fCR = 16.0; + break; + + case 25:sChoice = "NW_VAMPIRE004"; + fCR = 13.0; + break; + + case 26:sChoice = "NW_VAMPIRE002"; + fCR = 13.0; + break; + + case 27:sChoice = "NW_VAMPIRE001"; + fCR = 12.0; + break; + + case 28:sChoice = "NW_WIGHT"; + fCR = 4.0; + break; + + case 29:sChoice = "NW_VAMPIRE_SHAD"; + fCR = 3.0; + break; + + case 30:sChoice = "NW_SHADOW"; + fCR = 3.0; + break; + + case 31:sChoice = "NW_SHFIEND"; + fCR = 7.0; + break; + + case 32:sChoice = "NW_SKELETON"; + fCR = 0.5; + break; + + case 33:sChoice = "NW_SKELCHIEF"; + fCR = 7.0; + break; + + case 34:sChoice = "NW_SKELMAGE"; + fCR = 4.0; + break; + + case 35:sChoice = "NW_SKELPRIEST"; + fCR = 4.0; + break; + + case 36:sChoice = "NW_SKELWARR01"; + fCR = 6.0; + break; + + case 37:sChoice = "NW_SKELWARR02"; + fCR = 6.0; + break; + + case 38:sChoice = "NW_ALLIP"; + fCR = 3.0; + break; + + case 39:sChoice = "NW_SPECTRE"; + fCR = 6.0; + break; + + case 40:sChoice = "NW_WRAITH"; + fCR = 5.0; + break; + + case 41:sChoice = "NW_ZOMBTYRANT"; + fCR = 3.0; + break; + + case 42:sChoice = "NW_ZOMBIE01"; + fCR = 1.0; + break; + + case 43:sChoice = "NW_ZOMBIE02"; + fCR = 1.0; + break; + + case 44:sChoice = "NW_ZOMBIEBOSS"; + fCR = 8.0; + break; + + case 45:sChoice = "NW_ZOMBWARR01"; + fCR = 4.0; + break; + + case 47:sChoice = "X2_SPIDERDEMO001"; + fCR = 12.0; + break; + + case 48:sChoice = "x2_erinyes"; + fCR = 8.0; + break; + + case 49:sChoice = "X2_PITFIEND001"; + fCR = 15.0; + break; + + case 50:sChoice = "X0_FORM_MYRMARCH"; + fCR = 11.0; + break; + + case 51:sChoice = "X0_FORM_QUEEN"; + fCR = 20.0; + break; + + case 52:sChoice = "X0_FORM_TASKMAST"; + fCR = 7.0; + break; + + case 53:sChoice = "X0_FORM_WARRIOR"; + fCR = 4.0; + break; + + case 54:sChoice = "X0_FORM_WORKER"; + fCR = 1.0; + break; + + case 55:sChoice = "X2_SLAADBLACK001"; + fCR = 30.0; + break; + + case 56:sChoice = "X2_SLAADWHITE001"; + fCR = 25.0; + break; + + case 57:sChoice = "X2_MINDFLAYER003"; + fCR = 18.0; + break; + + case 58:sChoice = "X2_DEMILICH001"; + fCR = 24.0; + break; + + case 59:sChoice = "X2_DRACOLICH001"; + fCR = 43.0; + break; + + case 60:sChoice = ""; + fCR = 0.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } +// PICK RANDOM BANDIT + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(GetSubString(sCreatureTable, iCounter1, 1) == "b") + { + iCounter2 = 0; //Reset the counter + sChoice = "nil"; //Reset sChoice + while(sChoice != "") + { + switch(iCounter2) + { + case 0:sChoice = "NW_DUECLER001"; + fCR = 1.0; + break; + + case 1:sChoice = "NW_DUECLER005"; + fCR = 5.0; + break; + + case 2:sChoice = "NW_DUECLER010"; + fCR = 8.0; + break; + + case 3:sChoice = "NW_DUECLER015"; + fCR = 10.0; + break; + + case 4:sChoice = "NW_DUECLER020"; + fCR = 15.0; + break; + + case 5:sChoice = "NW_DUEMAGE001"; + fCR = 1.0; + break; + + case 6:sChoice = "NW_DUEMAGE005"; + fCR = 4.0; + break; + + case 7:sChoice = "NW_DUEMAGE010"; + fCR = 7.0; + break; + + case 8:sChoice = "NW_DUEMAGE015"; + fCR = 11.0; + break; + + case 9:sChoice = "NW_DUEMAGE020"; + fCR = 14.0; + break; + + case 10:sChoice = "NW_DUEROGUE001"; + fCR = 1.0; + break; + + case 11:sChoice = "NW_DUEROGUE005"; + fCR = 4.0; + break; + + case 12:sChoice = "NW_DUEROGUE010"; + fCR = 7.0; + break; + + case 13:sChoice = "NW_DUEROGUE015"; + fCR = 10.0; + break; + + case 14:sChoice = "NW_DUEROGUE020"; + fCR = 13.0; + break; + + case 15:sChoice = "NW_DUEFIGHT001"; + fCR = 1.0; + break; + + case 16:sChoice = "NW_DUEFIGHT005"; + fCR = 4.0; + break; + + case 17:sChoice = "NW_DUEFIGHT010"; + fCR = 7.0; + break; + + case 19:sChoice = "NW_DUEFIGHT015"; + fCR = 11.0; + break; + + case 20:sChoice = "NW_DUEFIGHT020"; + fCR = 14.0; + break; + + case 21:sChoice = "NW_DWARFMERC001"; + fCR = 0.5; + break; + + case 22:sChoice = "NW_DWARFMERC002"; + fCR = 2.0; + break; + + case 23:sChoice = "NW_DWARFMERC003"; + fCR = 4.0; + break; + + case 24:sChoice = "NW_DWARFMERC004"; + fCR = 7.0; + break; + + case 25:sChoice = "NW_DWARFMERC005"; + fCR = 9.0; + break; + + case 26:sChoice = "NW_DWARFMERC006"; + fCR = 13.0; + break; + + case 27:sChoice = "NW_DROWROGUE001"; + fCR = 1.0; + break; + + case 28:sChoice = "NW_DROWROGUE005"; + fCR = 3.0; + break; + + case 29:sChoice = "NW_DROWROGUE010"; + fCR = 7.0; + break; + + case 30:sChoice = "NW_DROWROGUE015"; + fCR = 10.0; + break; + + case 31:sChoice = "NW_DROWROGUE020"; + fCR = 13.0; + break; + + case 33:sChoice = "NW_DROWMAGE001"; + fCR = 1.0; + break; + + case 34:sChoice = "NW_DROWMAGE005"; + fCR = 4.0; + break; + + case 35:sChoice = "NW_DROWMAGE010"; + fCR = 7.0; + break; + + case 36:sChoice = "NW_DROWMAGE015"; + fCR = 11.0; + break; + + case 37:sChoice = "NW_DROWMAGE020"; + fCR = 15.0; + break; + + case 38:sChoice = "NW_DROWFIGHT001"; + fCR = 1.0; + break; + + case 39:sChoice = "NW_DROWFIGHT005"; + fCR = 4.0; + break; + + case 40:sChoice = "NW_DROWFIGHT010"; + fCR = 8.0; + break; + + case 41:sChoice = "NW_DROWFIGHT015"; + fCR = 11.0; + break; + + case 42:sChoice = "NW_DROWFIGHT020"; + fCR = 15.0; + break; + + case 43:sChoice = "NW_DROWCLER001"; + fCR = 1.0; + break; + + case 44:sChoice = "NW_DROWCLER005"; + fCR = 4.0; + break; + + case 45:sChoice = "NW_DROWCLER010"; + fCR = 8.0; + break; + + case 46:sChoice = "NW_DROWCLER015"; + fCR = 12.0; + break; + + case 47:sChoice = "NW_DROWCLER020"; + fCR = 16.0; + break; + + case 48:sChoice = "NW_HALFMERC001"; + fCR = 1.0; + break; + + case 49:sChoice = "NW_HALFMERC002"; + fCR = 3.0; + break; + + case 50:sChoice = "NW_HALFMERC003"; + fCR = 5.0; + break; + + case 51:sChoice = "NW_HALFMERC004"; + fCR = 7.0; + break; + + case 52:sChoice = "NW_HALFMERC005"; + fCR = 10.0; + break; + + case 53:sChoice = "NW_HALFMERC006"; + fCR = 13.0; + break; + + case 54:sChoice = "NW_BANDIT006"; + fCR = 7.0; + break; + + case 55:sChoice = "NW_BANDIT001"; + fCR = 0.5; + break; + + case 56:sChoice = "NW_BANDIT002"; + fCR = 0.5; + break; + + case 57:sChoice = "NW_BANDIT007"; + fCR = 11.0; + break; + + case 58:sChoice = "NW_BANDIT004"; + fCR = 3.0; + break; + + case 59:sChoice = "NW_BANDIT005"; + fCR = 4.0; + break; + + case 60:sChoice = "NW_BANDIT003"; + fCR = 1.0; + break; + + case 61:sChoice = "NW_GYPSY006"; + fCR = 11.0; + break; + + case 62:sChoice = "NW_GYPSY005"; + fCR = 8.0; + break; + + case 63:sChoice = "NW_GYPSY004"; + fCR = 4.0; + break; + + case 64:sChoice = "NW_GYPSY007"; + fCR = 10.0; + break; + + case 65:sChoice = "NW_GYPSY002"; + fCR = 0.5; + break; + + case 66:sChoice = "NW_GYPSY001"; + fCR = 0.5; + break; + + case 67:sChoice = "NW_GYPSY003"; + fCR = 4.0; + break; + + case 68:sChoice = "NW_HUMANMERC005"; + fCR = 12.0; + break; + + case 69:sChoice = "NW_HUMANMERC006"; + fCR = 15.0; + break; + + case 70:sChoice = "NW_HUMANMERC001"; + fCR = 2.0; + break; + + case 71:sChoice = "NW_HUMANMERC002"; + fCR = 3.0; + break; + + case 72:sChoice = "NW_HUMANMERC003"; + fCR = 6.0; + break; + + case 73:sChoice = "NW_HUMANMERC004"; + fCR = 9.0; + break; + + case 74:sChoice = ""; + fCR = 12.0; + break; + } + if(fCR >= fMinCR && fCR <= fMaxCR && GetStringLowerCase(sChoice) != "") + { + SetLocalString(oMod, "re_sCreatureList" + IntToString(iVarNum), sChoice); + iVarNum++; + } + iCounter2++; + } + } + } + +// PICK RANDOM CREATURE FROM CUSTOM TABLE + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(bCustom + && (GetSubString(sCreatureTable, iCounter1, 1) == "0" || StringToInt(GetSubString(sCreatureTable, iCounter1, 1)) > 0)) + { + sBuild = sBuild + GetSubString(sCreatureTable, iCounter1, 1); + } + else if(bCustom) + { + SetLocalInt(OBJECT_SELF, "re_iVarNum", iVarNum); + SetLocalFloat(OBJECT_SELF, "re_fMinCR", fMinCR); + SetLocalFloat(OBJECT_SELF, "re_fMaxCR", fMaxCR); + ExecuteScript("re_custom" + sBuild, OBJECT_SELF); + iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); + DeleteLocalInt(OBJECT_SELF, "re_iVarNum"); + DeleteLocalFloat(OBJECT_SELF, "re_fMinCR"); + DeleteLocalFloat(OBJECT_SELF, "re_fMaxCR"); + bCustom = FALSE; + sBuild = ""; + } + if(GetSubString(sCreatureTable, iCounter1, 1) == "x") + { + bCustom = TRUE; + } + } + +// PICK RANDOM CREATURE FROM COMMONER TABLE (For the commoner spawner) + for(iCounter1 = 0; iCounter1 <= GetStringLength(sCreatureTable); iCounter1++) + { + if(bCustom + && (GetSubString(sCreatureTable, iCounter1, 1) == "0" || StringToInt(GetSubString(sCreatureTable, iCounter1, 1)) > 0)) + { + sBuild = sBuild + GetSubString(sCreatureTable, iCounter1, 1); + } + else if(bCustom) + { + ExecuteScript("re_commoner" + sBuild, OBJECT_SELF); + iVarNum = GetLocalInt(OBJECT_SELF, "re_iVarNum"); + DeleteLocalInt(OBJECT_SELF, "re_iVarNum"); + bCustom = FALSE; + sBuild = ""; + } + if(GetSubString(sCreatureTable, iCounter1, 1) == "z") + { + bCustom = TRUE; + } + } + + + +// SELECT THE RANDOM CREATURE + if(!iVarNum) return ""; + int iRnd = Random(iVarNum); + string sCreature = GetLocalString(oMod, "re_sCreatureList" + IntToString(iRnd)); + // Copy the Min and Max number of creatures from the corresponding simulated "array" to the + // root variable in the module object. + SetLocalInt(oMod, "re_iMinNumberOfCreatures", GetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iRnd))); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures", GetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iRnd))); + // Reset the local module variables that store min and max number of creatures + // so we don't use old numbers at a later time. + for(iCounter3 = 1; iCounter3 <= iVarNum; iCounter3++) + { + SetLocalInt(oMod, "re_iMinNumberOfCreatures" + IntToString(iCounter3), 0); + SetLocalInt(oMod, "re_iMaxNumberOfCreatures" + IntToString(iCounter3), 0); + } + return sCreature; +} diff --git a/nwnds_module/re_treasure0.ncs b/nwnds_module/re_treasure0.ncs new file mode 100644 index 000000000..803af3c7a Binary files /dev/null and b/nwnds_module/re_treasure0.ncs differ diff --git a/nwnds_module/re_treasure0.nss b/nwnds_module/re_treasure0.nss new file mode 100644 index 000000000..a61818616 --- /dev/null +++ b/nwnds_module/re_treasure0.nss @@ -0,0 +1,60 @@ +//:://///////////////////////////////////////////// +//:: Name re_treasure0 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* +The purpose of re_treasure# scripts are to generate +random treasure on a creature created via the BESIE +Random Encounter System by Ray Miller. These scripts +are called via an ExecuteScript() function from within +"re_rndenc". The object executing this script is passed +as the creature to be given treasure, so this creature +can be refered to as OBJECT_SELF. +*/ +//::////////////////////////////////////////////// +//:: Created By: Ray Miller +//:: Created On: 10/27/02 +//:://////////////////////////////////////////////////////////////////////////// +/* +This is the standard treasure script for the BESIE Random Encounter System +By Ray Miller. Prior to v1.8 This script executed a series of functions to +bestow treasure upon creatures generated by the system. The problem was that +there were to many function which looped too many times and would sometimes cause +the spawner to abort with a "too many instructions error". So now we just use it +to bestow money. + +Please note that the amount of treasure that should be rewarded for an encounter +or in a module is very subjective. Some will consider this amount far too generous +and some too greedy. +*/ +//////////////////////////////////////////////////////////////////////////////// + +#include "ar_db_const" +#include "ar_inc_pcspawn" + +void main() +{ + if(d100()>66) return; + object oCreature = OBJECT_SELF; + object oMarker; + if (GetRacialType(oCreature) == RACIAL_TYPE_ANIMAL || + GetRacialType(oCreature) == RACIAL_TYPE_CONSTRUCT || + GetRacialType(oCreature) == RACIAL_TYPE_OOZE || + GetRacialType(oCreature) == RACIAL_TYPE_BEAST || + GetRacialType(oCreature) == RACIAL_TYPE_PLANT || + GetRacialType(oCreature) == RACIAL_TYPE_VERMIN) return; + float fChallengeFactor = GetChallengeRating(oCreature) * 20.0; + float fFactor = IntToFloat(Random(5) + 2); + int iTreasure = FloatToInt(fChallengeFactor / fFactor); + int iType = GetRacialType(oCreature); + CreateItemOnObject("NW_IT_GOLD001", oCreature, iTreasure); + if(iType == RACIAL_TYPE_UNDEAD || iType == RACIAL_TYPE_ABERRATION) + oMarker = CreateItemOnObject("NW_IT_MSMLMISC21", oCreature, 1); + else if(iType == RACIAL_TYPE_CONSTRUCT || + iType == RACIAL_TYPE_ELEMENTAL || + iType == RACIAL_TYPE_OUTSIDER) + oMarker = CreateItemOnObject("NW_IT_MSMLMISC11", oCreature, 1); + else + oMarker = CreateItemOnObject("NW_IT_MMIDMISC05", oCreature, 1); + SetLocalInt(oMarker, "bItemForGold", TRUE); +} diff --git a/nwnds_module/re_treasure1.ncs b/nwnds_module/re_treasure1.ncs new file mode 100644 index 000000000..3c1dbbd14 Binary files /dev/null and b/nwnds_module/re_treasure1.ncs differ diff --git a/nwnds_module/re_treasure1.nss b/nwnds_module/re_treasure1.nss new file mode 100644 index 000000000..00bb8e4ea --- /dev/null +++ b/nwnds_module/re_treasure1.nss @@ -0,0 +1,289 @@ +//////////////////////////////////////////////////// +/* +Custom treasure table template for use with the +BESIE Random Encounter Package by Ray Miller +*/ +//////////////////////////////////////////////////// +void main() +{ +object oCreature = OBJECT_SELF; +float fRunningChance; +float Chance = 0.0; +int iCounter = 1; +int Class; +int END; +while(!END) + { + switch(iCounter) + { +//////////////////////////////////////////////////////////////////////////// +/*////////////////////////////////////////////////////////////////////////// +The following table represents the chance of a creature having an item from +this treasure table based upon its class. Remark in the class type and edit +the chance accordingly. +*/////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +//case 1:Class = CLASS_TYPE_ABERRATION; Chance = 100.0; break; +//case 2:Class = CLASS_TYPE_ANIMAL; Chance = 100.0; break; +//case 3:Class = CLASS_TYPE_BARBARIAN; Chance = 100.0; break; +//case 4:Class = CLASS_TYPE_BARD; Chance = 100.0; break; +//case 5:Class = CLASS_TYPE_BEAST; Chance = 100.0; break; +//case 6:Class = CLASS_TYPE_CLERIC; Chance = 100.0; break; +//case 7:Class = CLASS_TYPE_COMMONER; Chance = 100.0; break; +//case 8:Class = CLASS_TYPE_CONSTRUCT; Chance = 100.0; break; +//case 9:Class = CLASS_TYPE_DRAGON; Chance = 100.0; break; +//case 10:Class = CLASS_TYPE_DRUID; Chance = 100.0; break; +//case 11:Class = CLASS_TYPE_ELEMENTAL; Chance = 100.0; break; +//case 12:Class = CLASS_TYPE_FEY; Chance = 100.0; break; +//case 13:Class = CLASS_TYPE_FIGHTER; Chance = 100.0; break; +//case 14:Class = CLASS_TYPE_GIANT; Chance = 100.0; break; +//case 15:Class = CLASS_TYPE_HUMANOID; Chance = 100.0; break; +//case 16:Class = CLASS_TYPE_MAGICAL_BEAST; Chance = 100.0; break; +//case 17:Class = CLASS_TYPE_MONK; Chance = 100.0; break; +//case 18:Class = CLASS_TYPE_MONSTROUS; Chance = 100.0; break; +//case 19:Class = CLASS_TYPE_OUTSIDER; Chance = 100.0; break; +//case 20:Class = CLASS_TYPE_PALADIN; Chance = 100.0; break; +//case 21:Class = CLASS_TYPE_RANGER; Chance = 100.0; break; +//case 22:Class = CLASS_TYPE_ROGUE; Chance = 100.0; break; +//case 23:Class = CLASS_TYPE_SHAPECHANGER; Chance = 100.0; break; +//case 24:Class = CLASS_TYPE_SORCERER; Chance = 100.0; break; +//case 25:Class = CLASS_TYPE_UNDEAD; Chance = 100.0; break; +//case 26:Class = CLASS_TYPE_VERMIN; Chance = 100.0; break; +//case 27:Class = CLASS_TYPE_WIZARD; Chance = 100.0; break; +//////////////////////////////////////////////////////////////////////////// +/* END OF TABLE +*/////////////////////////////////////////////////////////////////////////// + case 28:END = TRUE; + default:break; + } + if(GetLevelByClass(Class) && Chance > fRunningChance) fRunningChance = Chance; + iCounter++; + } +Chance = fRunningChance; +if(Random(10000) <= FloatToInt(Chance * 100.0)) + { + float fChance; + float fMinCR; + float fMaxCR; + int END = FALSE; + int iCounter1; + int iCounter2; + int iMaxNum; + int iMinNum; + string sIfIs; + string sChoice; + while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM TREASURE TABLE BELOW://////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + case 0:sChoice = "";// Treasure resref goes between the " marks. + sIfIs = ""; // Only give this treasure to a creature with this TAG (TAG not RESREF. This allows us to be more specific since the creature already exists when this script is called). + fMinCR = 0.0; // Only give this treasure to a creature whose challenge rating is between these two values. + fMaxCR = 0.0; // Leave them at 0.0 if you wish them not to be considered. + fChance = 0.5; // Set this to the percentage chance of the creature having this item. This is accurate to one one thousandth (0.001). + iMinNum = 1; // + iMaxNum = 1; // The minimum and maximum numbers of this treasure item to randomly give. + break; + + case 1:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 2:sChoice = ""; + sIfIs = ""; + fMinCR =0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 3:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 4:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 5:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 6:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 7:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 8:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 9:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 10:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 11:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 12:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 13:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 14:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 15:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 16:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 17:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 18:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 19:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + + case 20:sChoice = ""; + sIfIs = ""; + fMinCR = 0.0; + fMaxCR = 0.0; + fChance = 0.0; + iMinNum = 1; + iMaxNum = 1; + break; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM TREASURE TABLE! DO NOT EDIT BELOW THIS LINE/////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if((sIfIs == "" || sIfIs == GetTag(oCreature)) + && (fMinCR == 0.0 || (fMinCR != 0.0 && GetChallengeRating(oCreature) >= fMinCR)) + && (fMaxCR == 0.0 || (fMaxCR != 0.0 && GetChallengeRating(oCreature) <= fMaxCR)) + && Random(10000) + 1 <= FloatToInt(fChance * 100.0)) + { + CreateItemOnObject(sChoice, oCreature, Random((iMaxNum + 1) - iMinNum) + iMinNum); + } + iCounter1++; + } + } +} diff --git a/nwnds_module/re_treasure99.ncs b/nwnds_module/re_treasure99.ncs new file mode 100644 index 000000000..0a323a6f7 Binary files /dev/null and b/nwnds_module/re_treasure99.ncs differ diff --git a/nwnds_module/re_treasure99.nss b/nwnds_module/re_treasure99.nss new file mode 100644 index 000000000..37267ec21 --- /dev/null +++ b/nwnds_module/re_treasure99.nss @@ -0,0 +1,114 @@ +//////////////////////////////////////////////////// +/* +Custom treasure table template for use with the +BESIE Random Encounter Package by Ray Miller + +Table 99 - Quest items + +*/ +//////////////////////////////////////////////////// +void main() +{ +object oCreature = OBJECT_SELF; +float fRunningChance; +float Chance = 0.0; +int iCounter = 1; +int Class; +int END; +while(!END) + { + switch(iCounter) + { +//////////////////////////////////////////////////////////////////////////// +/*////////////////////////////////////////////////////////////////////////// +The following table represents the chance of a creature having an item from +this treasure table based upon its class. Remark in the class type and edit +the chance accordingly. +*/////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// +//case 1:Class = CLASS_TYPE_ABERRATION; Chance = 100.0; break; +//case 2:Class = CLASS_TYPE_ANIMAL; Chance = 100.0; break; +//case 3:Class = CLASS_TYPE_BARBARIAN; Chance = 100.0; break; +//case 4:Class = CLASS_TYPE_BARD; Chance = 100.0; break; +//case 5:Class = CLASS_TYPE_BEAST; Chance = 100.0; break; +//case 6:Class = CLASS_TYPE_CLERIC; Chance = 100.0; break; +//case 7:Class = CLASS_TYPE_COMMONER; Chance = 100.0; break; +//case 8:Class = CLASS_TYPE_CONSTRUCT; Chance = 100.0; break; +//case 9:Class = CLASS_TYPE_DRAGON; Chance = 100.0; break; +//case 10:Class = CLASS_TYPE_DRUID; Chance = 100.0; break; +//case 11:Class = CLASS_TYPE_ELEMENTAL; Chance = 100.0; break; +//case 12:Class = CLASS_TYPE_FEY; Chance = 100.0; break; +//case 13:Class = CLASS_TYPE_FIGHTER; Chance = 100.0; break; +//case 14:Class = CLASS_TYPE_GIANT; Chance = 100.0; break; +//case 15:Class = CLASS_TYPE_HUMANOID; Chance = 100.0; break; +//case 16:Class = CLASS_TYPE_MAGICAL_BEAST; Chance = 100.0; break; +//case 17:Class = CLASS_TYPE_MONK; Chance = 100.0; break; +//case 18:Class = CLASS_TYPE_MONSTROUS; Chance = 100.0; break; +//case 19:Class = CLASS_TYPE_OUTSIDER; Chance = 100.0; break; +//case 20:Class = CLASS_TYPE_PALADIN; Chance = 100.0; break; +//case 21:Class = CLASS_TYPE_RANGER; Chance = 100.0; break; +//case 22:Class = CLASS_TYPE_ROGUE; Chance = 100.0; break; +//case 23:Class = CLASS_TYPE_SHAPECHANGER; Chance = 100.0; break; +//case 24:Class = CLASS_TYPE_SORCERER; Chance = 100.0; break; +//case 25:Class = CLASS_TYPE_UNDEAD; Chance = 100.0; break; +//case 26:Class = CLASS_TYPE_VERMIN; Chance = 100.0; break; +//case 27:Class = CLASS_TYPE_WIZARD; Chance = 100.0; break; +//////////////////////////////////////////////////////////////////////////// +/* END OF TABLE +*/////////////////////////////////////////////////////////////////////////// + case 28:END = TRUE; + default:break; + } + if(GetLevelByClass(Class) && Chance > fRunningChance) fRunningChance = Chance; + iCounter++; + } +Chance = fRunningChance; +if(Random(10000) <= FloatToInt(Chance * 100.0)) + { + float fChance; + float fMinCR; + float fMaxCR; + int END = FALSE; + int iCounter1; + int iCounter2; + int iMaxNum; + int iMinNum; + string sIfIs; + string sChoice; + while(!END) + { + sChoice = ""; + switch(iCounter1) + { +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//CUSTOM TREASURE TABLE BELOW://////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + case 0:sChoice = "ar_key_spyre"; // Treasure resref goes between the " marks. + sIfIs = "AR_DEFILER_002"; // Only give this treasure to a creature with this TAG (TAG not RESREF. This allows us to be more specific since the creature already exists when this script is called). + fMinCR = 0.0; // Only give this treasure to a creature whose challenge rating is between these two values. + fMaxCR = 0.0; // Leave them at 0.0 if you wish them not to be considered. + fChance = 50.0; // Set this to the percentage chance of the creature having this item. This is accurate to one one thousandth (0.001). + iMinNum = 1; // + iMaxNum = 1; // The minimum and maximum numbers of this treasure item to randomly give. + break; + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//END OF CUSTOM TREASURE TABLE! DO NOT EDIT BELOW THIS LINE/////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + default:END = TRUE; + break; + } + if((sIfIs == "" || sIfIs == GetTag(oCreature)) + && (fMinCR == 0.0 || (fMinCR != 0.0 && GetChallengeRating(oCreature) >= fMinCR)) + && (fMaxCR == 0.0 || (fMaxCR != 0.0 && GetChallengeRating(oCreature) <= fMaxCR)) + && Random(10000) + 1 <= FloatToInt(fChance * 100.0)) + { + CreateItemOnObject(sChoice, oCreature, Random((iMaxNum + 1) - iMinNum) + iMinNum); + } + iCounter1++; + } + } +} diff --git a/nwnds_module/re_widget.dlg b/nwnds_module/re_widget.dlg new file mode 100644 index 000000000..1f7407689 Binary files /dev/null and b/nwnds_module/re_widget.dlg differ diff --git a/nwnds_module/re_widget1.ncs b/nwnds_module/re_widget1.ncs new file mode 100644 index 000000000..38c223ada Binary files /dev/null and b/nwnds_module/re_widget1.ncs differ diff --git a/nwnds_module/re_widget1.nss b/nwnds_module/re_widget1.nss new file mode 100644 index 000000000..fe5f77eec --- /dev/null +++ b/nwnds_module/re_widget1.nss @@ -0,0 +1,44 @@ +#include "re_rndenc" +int StartingConditional() +{ +object oPC = GetPCSpeaker(); +object oObject = GetFirstObjectInArea(GetArea(oPC)); +string sToken; +struct RndEncProperties strProps = GetRndEncProperties(GetArea(oPC)); +if(!strProps.bInitialized) + { + sToken = sToken + "Area properties not set. Using module properties:\n"; + strProps = GetRndEncProperties(GetModule()); + } +else sToken = sToken + "Area Properties:\n"; +sToken = sToken + "Difficulty: " + IntToString(strProps.iDifficulty) ++ "\nConsider CR: " + IntToString(strProps.bConsiderCR) ++ "\nCreature Table: " + strProps.sCreatureTable ++ "\nCreature Decay Time: " + IntToString(strProps.iLifeTime) ++ "\nEncounter Type: "; +if(strProps.iEncounterType == 1) sToken = sToken + "(1)PARTY"; +if(strProps.iEncounterType == 2) sToken = sToken + "(2)INDIVIDUAL"; +if(strProps.iEncounterType == 3) sToken = sToken + "(3)AREA"; +if(strProps.iEncounterType == 4) sToken = sToken + "(4)TOTAL PARTY LEVELS"; +sToken = sToken + "\nEnc During Conflict: " + IntToString(strProps.bConflict) ++ "\nChance On Rest: " + IntToString(strProps.iChanceOnRest); +sToken = sToken + "\n\nArea Spawners:\n"; +while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "re_BESIE")) + { + sToken = sToken + GetName(oObject) + " - " + GetTag(oObject) + " - "; + if(GetLocalInt(oObject, "re_iBegin") + || GetLocalInt(oObject, "re_iEnd")) + { + sToken = sToken + "B" + IntToString(GetLocalInt(oObject, "re_iBegin")) + " E" + IntToString(GetLocalInt(oObject, "re_iEnd")) + " - "; + } + if(GetLocalInt(oObject, "re_disable")) sToken = sToken + "Disabled"; + else sToken = sToken + "Enabled"; + sToken = sToken + "\n\n"; + } + oObject = GetNextObjectInArea(GetArea(oPC)); + } +SetCustomToken(2112, sToken); +return TRUE; +} diff --git a/nwnds_module/re_widget10.ncs b/nwnds_module/re_widget10.ncs new file mode 100644 index 000000000..69f626a9a Binary files /dev/null and b/nwnds_module/re_widget10.ncs differ diff --git a/nwnds_module/re_widget10.nss b/nwnds_module/re_widget10.nss new file mode 100644 index 000000000..79dc461e6 --- /dev/null +++ b/nwnds_module/re_widget10.nss @@ -0,0 +1,6 @@ +void main() +{ +int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex"); +object oObject = GetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter)); +DeleteLocalInt(oObject, "re_disable"); +} diff --git a/nwnds_module/re_widget11.ncs b/nwnds_module/re_widget11.ncs new file mode 100644 index 000000000..09d8b0ce9 Binary files /dev/null and b/nwnds_module/re_widget11.ncs differ diff --git a/nwnds_module/re_widget11.nss b/nwnds_module/re_widget11.nss new file mode 100644 index 000000000..2ba7c3974 --- /dev/null +++ b/nwnds_module/re_widget11.nss @@ -0,0 +1,6 @@ +void main() +{ +int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex"); +object oObject = GetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter)); +SetLocalInt(oObject, "re_disable", TRUE); +} diff --git a/nwnds_module/re_widget12.ncs b/nwnds_module/re_widget12.ncs new file mode 100644 index 000000000..6cf668435 Binary files /dev/null and b/nwnds_module/re_widget12.ncs differ diff --git a/nwnds_module/re_widget12.nss b/nwnds_module/re_widget12.nss new file mode 100644 index 000000000..1a509b8e1 --- /dev/null +++ b/nwnds_module/re_widget12.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ + object oPC = GetPCSpeaker(); + object oArea = GetArea(oPC); + int iResult; + object oObject = GetFirstObjectInArea(oArea); + while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "re_bRandomEncounter")) iResult = TRUE; + oObject = GetNextObjectInArea(oArea); + } + return iResult; +} diff --git a/nwnds_module/re_widget13.ncs b/nwnds_module/re_widget13.ncs new file mode 100644 index 000000000..84c85045d Binary files /dev/null and b/nwnds_module/re_widget13.ncs differ diff --git a/nwnds_module/re_widget13.nss b/nwnds_module/re_widget13.nss new file mode 100644 index 000000000..06dbe7f4d --- /dev/null +++ b/nwnds_module/re_widget13.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetPCSpeaker(); +object oArea = GetArea(oPC); +object oObject = GetFirstObjectInArea(oArea); +while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "re_bRandomEncounter") && !GetIsInCombat(oObject) && !IsInConversation(oObject)) DestroyObject(oObject); + oObject = GetNextObjectInArea(oArea); + } +} diff --git a/nwnds_module/re_widget14.ncs b/nwnds_module/re_widget14.ncs new file mode 100644 index 000000000..0c007129f Binary files /dev/null and b/nwnds_module/re_widget14.ncs differ diff --git a/nwnds_module/re_widget14.nss b/nwnds_module/re_widget14.nss new file mode 100644 index 000000000..0f670e6cd --- /dev/null +++ b/nwnds_module/re_widget14.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + int iResult; + object oTarget = GetItemActivatedTarget(); + iResult = GetIsPC(oTarget) && GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oTarget)); + return iResult; +} diff --git a/nwnds_module/re_widget15.ncs b/nwnds_module/re_widget15.ncs new file mode 100644 index 000000000..a34c119d4 Binary files /dev/null and b/nwnds_module/re_widget15.ncs differ diff --git a/nwnds_module/re_widget15.nss b/nwnds_module/re_widget15.nss new file mode 100644 index 000000000..c519f5c2d --- /dev/null +++ b/nwnds_module/re_widget15.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + int iResult; + object oTarget = GetItemActivatedTarget(); + iResult = GetIsPC(oTarget) && !GetLocalInt(GetModule(), "re_" + GetPCPlayerName(oTarget)); + return iResult; +} diff --git a/nwnds_module/re_widget16.ncs b/nwnds_module/re_widget16.ncs new file mode 100644 index 000000000..c148d9d46 Binary files /dev/null and b/nwnds_module/re_widget16.ncs differ diff --git a/nwnds_module/re_widget16.nss b/nwnds_module/re_widget16.nss new file mode 100644 index 000000000..a2d144c76 --- /dev/null +++ b/nwnds_module/re_widget16.nss @@ -0,0 +1,4 @@ +void main() +{ +DeleteLocalInt(GetModule(), "re_" + GetPCPlayerName(GetPCSpeaker())); +} diff --git a/nwnds_module/re_widget17.ncs b/nwnds_module/re_widget17.ncs new file mode 100644 index 000000000..44a1750f4 Binary files /dev/null and b/nwnds_module/re_widget17.ncs differ diff --git a/nwnds_module/re_widget17.nss b/nwnds_module/re_widget17.nss new file mode 100644 index 000000000..3e0a8feaf --- /dev/null +++ b/nwnds_module/re_widget17.nss @@ -0,0 +1,4 @@ +void main() +{ +SetLocalInt(GetModule(), "re_" + GetPCPlayerName(GetPCSpeaker()), TRUE); +} diff --git a/nwnds_module/re_widget18.ncs b/nwnds_module/re_widget18.ncs new file mode 100644 index 000000000..5ba6cfad9 Binary files /dev/null and b/nwnds_module/re_widget18.ncs differ diff --git a/nwnds_module/re_widget18.nss b/nwnds_module/re_widget18.nss new file mode 100644 index 000000000..c3e2dac53 --- /dev/null +++ b/nwnds_module/re_widget18.nss @@ -0,0 +1,11 @@ +void main() +{ +object oPC = GetPCSpeaker(); +object oArea = GetArea(oPC); +object oObject = GetFirstObjectInArea(oArea); +while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "re_bRandomEncounter") && !IsInConversation(oObject)) DestroyObject(oObject); + oObject = GetNextObjectInArea(oArea); + } +} diff --git a/nwnds_module/re_widget19.ncs b/nwnds_module/re_widget19.ncs new file mode 100644 index 000000000..18f098692 Binary files /dev/null and b/nwnds_module/re_widget19.ncs differ diff --git a/nwnds_module/re_widget19.nss b/nwnds_module/re_widget19.nss new file mode 100644 index 000000000..fb38b63b8 --- /dev/null +++ b/nwnds_module/re_widget19.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + int iResult; + object oTarget = GetItemActivatedTarget(); + iResult = GetIsPC(oTarget) && !GetIsDM(oTarget); + return iResult; +} diff --git a/nwnds_module/re_widget2.ncs b/nwnds_module/re_widget2.ncs new file mode 100644 index 000000000..427d6ffd7 Binary files /dev/null and b/nwnds_module/re_widget2.ncs differ diff --git a/nwnds_module/re_widget2.nss b/nwnds_module/re_widget2.nss new file mode 100644 index 000000000..9e9cf366c --- /dev/null +++ b/nwnds_module/re_widget2.nss @@ -0,0 +1,21 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); +int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex"); +object oObject = GetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter)); +string sToken; +int bReturn; +sToken = sToken + "Tool Type: " + GetLocalString(oObject, "re_ToolType") + "\n" + + "Name: " + GetName(oObject) + "\n" + + "Tag: " + GetTag(oObject) + "\n"; +if(GetLocalInt(oObject, "re_iBegin") || GetLocalInt(oObject, "re_iEnd")) + { + sToken = sToken + "Begin Time: " + IntToString(GetLocalInt(oObject, "re_iBegin")) + "\n" + + "End Time: " + IntToString(GetLocalInt(oObject, "re_iEnd")) + "\n"; + } +if(GetLocalInt(oObject, "re_disable")) sToken = sToken + "State: Disabled"; +else sToken = sToken + "State: Enabled"; +sToken = sToken + "\n"; +SetCustomToken(2112, sToken); +return TRUE; +} diff --git a/nwnds_module/re_widget20.ncs b/nwnds_module/re_widget20.ncs new file mode 100644 index 000000000..09fa85350 Binary files /dev/null and b/nwnds_module/re_widget20.ncs differ diff --git a/nwnds_module/re_widget20.nss b/nwnds_module/re_widget20.nss new file mode 100644 index 000000000..1e13698d9 --- /dev/null +++ b/nwnds_module/re_widget20.nss @@ -0,0 +1,6 @@ +#include "re_rndenc" +void main() +{ +object oPC = GetItemActivatedTarget(); +RandomEncounter(100.0, oPC, "random", 0, 0, 0, 5, 360); +} diff --git a/nwnds_module/re_widget21.ncs b/nwnds_module/re_widget21.ncs new file mode 100644 index 000000000..e7d2215ae Binary files /dev/null and b/nwnds_module/re_widget21.ncs differ diff --git a/nwnds_module/re_widget21.nss b/nwnds_module/re_widget21.nss new file mode 100644 index 000000000..e6ef86265 --- /dev/null +++ b/nwnds_module/re_widget21.nss @@ -0,0 +1,6 @@ +int StartingConditional() +{ + int iResult; + iResult = GetLocalInt(GetModule(), "re_disable"); + return iResult; +} diff --git a/nwnds_module/re_widget22.ncs b/nwnds_module/re_widget22.ncs new file mode 100644 index 000000000..a513c8fd9 Binary files /dev/null and b/nwnds_module/re_widget22.ncs differ diff --git a/nwnds_module/re_widget22.nss b/nwnds_module/re_widget22.nss new file mode 100644 index 000000000..23ee84c49 --- /dev/null +++ b/nwnds_module/re_widget22.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + int iResult; + iResult = !GetLocalInt(GetModule(), "re_disable"); + return iResult; +} + diff --git a/nwnds_module/re_widget23.ncs b/nwnds_module/re_widget23.ncs new file mode 100644 index 000000000..02a560387 Binary files /dev/null and b/nwnds_module/re_widget23.ncs differ diff --git a/nwnds_module/re_widget23.nss b/nwnds_module/re_widget23.nss new file mode 100644 index 000000000..5d4bc8dc2 --- /dev/null +++ b/nwnds_module/re_widget23.nss @@ -0,0 +1,4 @@ +void main() +{ +DeleteLocalInt(GetModule(), "re_disable"); +} diff --git a/nwnds_module/re_widget24.ncs b/nwnds_module/re_widget24.ncs new file mode 100644 index 000000000..712550b08 Binary files /dev/null and b/nwnds_module/re_widget24.ncs differ diff --git a/nwnds_module/re_widget24.nss b/nwnds_module/re_widget24.nss new file mode 100644 index 000000000..df85816e0 --- /dev/null +++ b/nwnds_module/re_widget24.nss @@ -0,0 +1,4 @@ +void main() +{ +SetLocalInt(GetModule(), "re_disable", TRUE); +} diff --git a/nwnds_module/re_widget25.ncs b/nwnds_module/re_widget25.ncs new file mode 100644 index 000000000..c166af40c Binary files /dev/null and b/nwnds_module/re_widget25.ncs differ diff --git a/nwnds_module/re_widget25.nss b/nwnds_module/re_widget25.nss new file mode 100644 index 000000000..7eb2c67fd --- /dev/null +++ b/nwnds_module/re_widget25.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + string sToken; + sToken = "\nBESIE is currently "; + if(GetLocalInt(GetModule(), "re_disable")) sToken = sToken + "disabled"; + else sToken = sToken + "enabled"; + SetCustomToken(2112, sToken); + return TRUE; +} diff --git a/nwnds_module/re_widget3.ncs b/nwnds_module/re_widget3.ncs new file mode 100644 index 000000000..f9bf496fe Binary files /dev/null and b/nwnds_module/re_widget3.ncs differ diff --git a/nwnds_module/re_widget3.nss b/nwnds_module/re_widget3.nss new file mode 100644 index 000000000..41b382888 --- /dev/null +++ b/nwnds_module/re_widget3.nss @@ -0,0 +1,19 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); +object oArea = GetArea(oPC); +object oObject = GetFirstObjectInArea(oArea); +int iCounter; +while(GetIsObjectValid(oObject)) + { + if(GetLocalInt(oObject, "re_BESIE")) + { + iCounter = iCounter + 1; + SetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter), oObject); + } + oObject = GetNextObjectInArea(oArea); + } +SetLocalInt(GetModule(), "re_iAreaTool", iCounter); +SetLocalInt(GetModule(), "re_AreaToolIndex", 1); +return iCounter; +} diff --git a/nwnds_module/re_widget4.ncs b/nwnds_module/re_widget4.ncs new file mode 100644 index 000000000..558d6501f Binary files /dev/null and b/nwnds_module/re_widget4.ncs differ diff --git a/nwnds_module/re_widget4.nss b/nwnds_module/re_widget4.nss new file mode 100644 index 000000000..c5e86a19e --- /dev/null +++ b/nwnds_module/re_widget4.nss @@ -0,0 +1,7 @@ +int StartingConditional() +{ + int iResult; + int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex") + 1; + iResult = iCounter <= GetLocalInt(GetModule(), "re_iAreaTool"); + return iResult; +} diff --git a/nwnds_module/re_widget5.ncs b/nwnds_module/re_widget5.ncs new file mode 100644 index 000000000..c35c32868 Binary files /dev/null and b/nwnds_module/re_widget5.ncs differ diff --git a/nwnds_module/re_widget5.nss b/nwnds_module/re_widget5.nss new file mode 100644 index 000000000..c5697daef --- /dev/null +++ b/nwnds_module/re_widget5.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ + int iResult; + int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex") - 1; + iResult = iCounter > 0; + return iResult; +} + diff --git a/nwnds_module/re_widget6.ncs b/nwnds_module/re_widget6.ncs new file mode 100644 index 000000000..ff34f7eb8 Binary files /dev/null and b/nwnds_module/re_widget6.ncs differ diff --git a/nwnds_module/re_widget6.nss b/nwnds_module/re_widget6.nss new file mode 100644 index 000000000..e42352565 --- /dev/null +++ b/nwnds_module/re_widget6.nss @@ -0,0 +1,5 @@ +void main() +{ +int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex") + 1; +SetLocalInt(GetModule(), "re_AreaToolIndex", iCounter); +} diff --git a/nwnds_module/re_widget7.ncs b/nwnds_module/re_widget7.ncs new file mode 100644 index 000000000..9fd22ac05 Binary files /dev/null and b/nwnds_module/re_widget7.ncs differ diff --git a/nwnds_module/re_widget7.nss b/nwnds_module/re_widget7.nss new file mode 100644 index 000000000..b2d4be264 --- /dev/null +++ b/nwnds_module/re_widget7.nss @@ -0,0 +1,5 @@ +void main() +{ +int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex") - 1; +SetLocalInt(GetModule(), "re_AreaToolIndex", iCounter); +} diff --git a/nwnds_module/re_widget8.ncs b/nwnds_module/re_widget8.ncs new file mode 100644 index 000000000..8ea7eacc4 Binary files /dev/null and b/nwnds_module/re_widget8.ncs differ diff --git a/nwnds_module/re_widget8.nss b/nwnds_module/re_widget8.nss new file mode 100644 index 000000000..cd08b6480 --- /dev/null +++ b/nwnds_module/re_widget8.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ + int iResult; + int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex"); + object oObject = GetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter)); + iResult = GetLocalInt(oObject, "re_disable"); + return iResult; +} diff --git a/nwnds_module/re_widget9.ncs b/nwnds_module/re_widget9.ncs new file mode 100644 index 000000000..6a9abe832 Binary files /dev/null and b/nwnds_module/re_widget9.ncs differ diff --git a/nwnds_module/re_widget9.nss b/nwnds_module/re_widget9.nss new file mode 100644 index 000000000..16746d67e --- /dev/null +++ b/nwnds_module/re_widget9.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ + int iResult; + int iCounter = GetLocalInt(GetModule(), "re_AreaToolIndex"); + object oObject = GetLocalObject(GetModule(), "re_oAreaTool" + IntToString(iCounter)); + iResult = !GetLocalInt(oObject, "re_disable"); + return iResult; +} diff --git a/nwnds_module/refuge_settlemnt.are b/nwnds_module/refuge_settlemnt.are new file mode 100644 index 000000000..4f824e4c1 Binary files /dev/null and b/nwnds_module/refuge_settlemnt.are differ diff --git a/nwnds_module/refuge_settlemnt.gic b/nwnds_module/refuge_settlemnt.gic new file mode 100644 index 000000000..665449856 Binary files /dev/null and b/nwnds_module/refuge_settlemnt.gic differ diff --git a/nwnds_module/refuge_settlemnt.git b/nwnds_module/refuge_settlemnt.git new file mode 100644 index 000000000..d76b7051b Binary files /dev/null and b/nwnds_module/refuge_settlemnt.git differ diff --git a/nwnds_module/ring_mnts_001.are b/nwnds_module/ring_mnts_001.are new file mode 100644 index 000000000..053df3933 Binary files /dev/null and b/nwnds_module/ring_mnts_001.are differ diff --git a/nwnds_module/ring_mnts_001.gic b/nwnds_module/ring_mnts_001.gic new file mode 100644 index 000000000..ce880179f Binary files /dev/null and b/nwnds_module/ring_mnts_001.gic differ diff --git a/nwnds_module/ring_mnts_001.git b/nwnds_module/ring_mnts_001.git new file mode 100644 index 000000000..0a4ad6f53 Binary files /dev/null and b/nwnds_module/ring_mnts_001.git differ diff --git a/nwnds_module/ring_mnts_002.are b/nwnds_module/ring_mnts_002.are new file mode 100644 index 000000000..25b0066a2 Binary files /dev/null and b/nwnds_module/ring_mnts_002.are differ diff --git a/nwnds_module/ring_mnts_002.gic b/nwnds_module/ring_mnts_002.gic new file mode 100644 index 000000000..511212669 Binary files /dev/null and b/nwnds_module/ring_mnts_002.gic differ diff --git a/nwnds_module/ring_mnts_002.git b/nwnds_module/ring_mnts_002.git new file mode 100644 index 000000000..8e69856f2 Binary files /dev/null and b/nwnds_module/ring_mnts_002.git differ diff --git a/nwnds_module/ring_mnts_airshr.are b/nwnds_module/ring_mnts_airshr.are new file mode 100644 index 000000000..c47d3cead Binary files /dev/null and b/nwnds_module/ring_mnts_airshr.are differ diff --git a/nwnds_module/ring_mnts_airshr.gic b/nwnds_module/ring_mnts_airshr.gic new file mode 100644 index 000000000..9659d4a12 Binary files /dev/null and b/nwnds_module/ring_mnts_airshr.gic differ diff --git a/nwnds_module/ring_mnts_airshr.git b/nwnds_module/ring_mnts_airshr.git new file mode 100644 index 000000000..50300e2ed Binary files /dev/null and b/nwnds_module/ring_mnts_airshr.git differ diff --git a/nwnds_module/ring_mnts_rvcave.are b/nwnds_module/ring_mnts_rvcave.are new file mode 100644 index 000000000..5dfc42c82 Binary files /dev/null and b/nwnds_module/ring_mnts_rvcave.are differ diff --git a/nwnds_module/ring_mnts_rvcave.gic b/nwnds_module/ring_mnts_rvcave.gic new file mode 100644 index 000000000..d305efd24 Binary files /dev/null and b/nwnds_module/ring_mnts_rvcave.gic differ diff --git a/nwnds_module/ring_mnts_rvcave.git b/nwnds_module/ring_mnts_rvcave.git new file mode 100644 index 000000000..66b77ddee Binary files /dev/null and b/nwnds_module/ring_mnts_rvcave.git differ diff --git a/nwnds_module/ring_mount_key.ncs b/nwnds_module/ring_mount_key.ncs new file mode 100644 index 000000000..464fc5b02 Binary files /dev/null and b/nwnds_module/ring_mount_key.ncs differ diff --git a/nwnds_module/ring_mount_key.nss b/nwnds_module/ring_mount_key.nss new file mode 100644 index 000000000..bfc7a88aa --- /dev/null +++ b/nwnds_module/ring_mount_key.nss @@ -0,0 +1,21 @@ +// Put this script OnExit. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetExitingObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Only fire once per PC. + if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) ) + return; + SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE); + + // Set a local integer. + SetLocalInt(oPC, "ring_mount_pass", 1); +} + diff --git a/nwnds_module/ring_mount_key1.ncs b/nwnds_module/ring_mount_key1.ncs new file mode 100644 index 000000000..76df9b91f Binary files /dev/null and b/nwnds_module/ring_mount_key1.ncs differ diff --git a/nwnds_module/ring_mount_key1.nss b/nwnds_module/ring_mount_key1.nss new file mode 100644 index 000000000..4eae5091e --- /dev/null +++ b/nwnds_module/ring_mount_key1.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // Check a local variable. + if ( GetLocalInt(oPC, "ring_mount_pass") != 1 ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/ring_mount_key2.ncs b/nwnds_module/ring_mount_key2.ncs new file mode 100644 index 000000000..9b84b9b52 Binary files /dev/null and b/nwnds_module/ring_mount_key2.ncs differ diff --git a/nwnds_module/ring_mount_key2.nss b/nwnds_module/ring_mount_key2.nss new file mode 100644 index 000000000..53ef722f2 --- /dev/null +++ b/nwnds_module/ring_mount_key2.nss @@ -0,0 +1,13 @@ +int StartingConditional() +{ + // Get the PC who is involved in this conversation + object oPC = GetPCSpeaker(); + + // Check a local variable. + if ( GetLocalInt(oPC, "ring_mount_pass") == 1 ) + return FALSE; + + // If we make it this far, we have passed all tests. + return TRUE; +} + diff --git a/nwnds_module/rockgolemhide.uti b/nwnds_module/rockgolemhide.uti new file mode 100644 index 000000000..74bebf84d Binary files /dev/null and b/nwnds_module/rockgolemhide.uti differ diff --git a/nwnds_module/rockgolemslam.uti b/nwnds_module/rockgolemslam.uti new file mode 100644 index 000000000..da73e71c8 Binary files /dev/null and b/nwnds_module/rockgolemslam.uti differ diff --git a/nwnds_module/rogueguildent.ncs b/nwnds_module/rogueguildent.ncs new file mode 100644 index 000000000..8ad58ecec Binary files /dev/null and b/nwnds_module/rogueguildent.ncs differ diff --git a/nwnds_module/rogueguildent.nss b/nwnds_module/rogueguildent.nss new file mode 100644 index 000000000..dab7ec9ab --- /dev/null +++ b/nwnds_module/rogueguildent.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName rogueguildent +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 9:51:35 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's class + int iPassed = 0; + if(GetLevelByClass(CLASS_TYPE_ROGUE, GetPCSpeaker()) >= 3) + iPassed = 1; + if(iPassed == 0) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/rotaura.ncs b/nwnds_module/rotaura.ncs new file mode 100644 index 000000000..4699d1319 Binary files /dev/null and b/nwnds_module/rotaura.ncs differ diff --git a/nwnds_module/rotaura.nss b/nwnds_module/rotaura.nss new file mode 100644 index 000000000..d22c8d4df --- /dev/null +++ b/nwnds_module/rotaura.nss @@ -0,0 +1,11 @@ +void main() +{ +// object oPC = GetFirstPC(); +// SendMessageToPC(oPC,"Running rotaura OBJECT_SELF = " + GetName(OBJECT_SELF)); + + //Set and apply AOE object + effect eAOE = EffectAreaOfEffect(AOE_PER_GREASE,"rotaura1","rotaura3","rotaura2"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100)); +} diff --git a/nwnds_module/rotaura1.ncs b/nwnds_module/rotaura1.ncs new file mode 100644 index 000000000..6f8fac0de Binary files /dev/null and b/nwnds_module/rotaura1.ncs differ diff --git a/nwnds_module/rotaura1.nss b/nwnds_module/rotaura1.nss new file mode 100644 index 000000000..859641791 --- /dev/null +++ b/nwnds_module/rotaura1.nss @@ -0,0 +1,45 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eNaus = EffectDazed(); + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + effect eHeal = EffectHeal(5); + object oTarget = GetEnteringObject(); + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + return; +/* if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE ) ) + { + eVis = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + return; + }*/ + if(GetIsEnemy(oTarget, oCaster)) + { + int nDam = d6(5); + nDam = GetReflexAdjustedDamage(nDam, oTarget, 24, SAVING_THROW_TYPE_NONE, oCaster); + if ( nDam > 0 ) + { + effect eDam = EffectDamage(nDam); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + if (!MySavingThrow(SAVING_THROW_WILL, oTarget, 24, SAVING_THROW_TYPE_NONE,oCaster)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eNaus,oTarget,RoundsToSeconds(1)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis2,oTarget,RoundsToSeconds(1)); + } + int nFlag = GetLocalInt(oCaster,"AURA_STATE"); + if ( nFlag == 0 ) + { + SetLocalInt(oCaster,"AURA_STATE",1); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + } + } + } +} diff --git a/nwnds_module/rotaura2.ncs b/nwnds_module/rotaura2.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/rotaura2.ncs differ diff --git a/nwnds_module/rotaura2.nss b/nwnds_module/rotaura2.nss new file mode 100644 index 000000000..8dbf3f240 --- /dev/null +++ b/nwnds_module/rotaura2.nss @@ -0,0 +1,4 @@ +void main() +{ + +} diff --git a/nwnds_module/rotaura3.ncs b/nwnds_module/rotaura3.ncs new file mode 100644 index 000000000..c6da76658 Binary files /dev/null and b/nwnds_module/rotaura3.ncs differ diff --git a/nwnds_module/rotaura3.nss b/nwnds_module/rotaura3.nss new file mode 100644 index 000000000..bb6d43ced --- /dev/null +++ b/nwnds_module/rotaura3.nss @@ -0,0 +1,49 @@ +#include "NW_I0_SPELLS" +void main() +{ + //Declare major variables + object oCaster = GetAreaOfEffectCreator(); + effect eNaus = EffectDazed(); + effect eVis = EffectVisualEffect(VFX_IMP_DISEASE_S); + effect eVis2 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_NEGATIVE); + effect eVis3 = EffectVisualEffect(VFX_IMP_HEALING_S); + effect eVis4 = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE); + effect eHeal = EffectHeal(5); + object oTarget = GetFirstInPersistentObject(); + while(GetIsObjectValid(oTarget)) + { + if(GetIsEnemy(oTarget, oCaster)) + { + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD )) + break; +/* if ( GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE ) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis4,oTarget); + break; + } */ + int nDam = d6(5); + nDam = GetReflexAdjustedDamage(nDam, oTarget, 24, SAVING_THROW_TYPE_NONE,oCaster); + if ( nDam > 0 ) + { + effect eDam = EffectDamage(nDam); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDam,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + if (!MySavingThrow(SAVING_THROW_WILL, oTarget, 24, SAVING_THROW_TYPE_NONE,oCaster)) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eNaus,oTarget,RoundsToSeconds(1)); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis2,oTarget,RoundsToSeconds(1)); + } + int nFlag = GetLocalInt(oCaster,"AURA_STATE"); + if ( nFlag == 0 ) + { + SetLocalInt(oCaster,"AURA_STATE",1); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oCaster); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster); + } + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/rs_cave.are b/nwnds_module/rs_cave.are new file mode 100644 index 000000000..5dbb9fc78 Binary files /dev/null and b/nwnds_module/rs_cave.are differ diff --git a/nwnds_module/rs_cave.gic b/nwnds_module/rs_cave.gic new file mode 100644 index 000000000..37d79b7fa Binary files /dev/null and b/nwnds_module/rs_cave.gic differ diff --git a/nwnds_module/rs_cave.git b/nwnds_module/rs_cave.git new file mode 100644 index 000000000..74607a0ef Binary files /dev/null and b/nwnds_module/rs_cave.git differ diff --git a/nwnds_module/rs_cavern.are b/nwnds_module/rs_cavern.are new file mode 100644 index 000000000..e3fc350c9 Binary files /dev/null and b/nwnds_module/rs_cavern.are differ diff --git a/nwnds_module/rs_cavern.gic b/nwnds_module/rs_cavern.gic new file mode 100644 index 000000000..fec38917d Binary files /dev/null and b/nwnds_module/rs_cavern.gic differ diff --git a/nwnds_module/rs_cavern.git b/nwnds_module/rs_cavern.git new file mode 100644 index 000000000..efbbabb20 Binary files /dev/null and b/nwnds_module/rs_cavern.git differ diff --git a/nwnds_module/rs_gerrofshouse.are b/nwnds_module/rs_gerrofshouse.are new file mode 100644 index 000000000..1e76f5728 Binary files /dev/null and b/nwnds_module/rs_gerrofshouse.are differ diff --git a/nwnds_module/rs_gerrofshouse.gic b/nwnds_module/rs_gerrofshouse.gic new file mode 100644 index 000000000..d9577fd67 Binary files /dev/null and b/nwnds_module/rs_gerrofshouse.gic differ diff --git a/nwnds_module/rs_gerrofshouse.git b/nwnds_module/rs_gerrofshouse.git new file mode 100644 index 000000000..b95fd30e5 Binary files /dev/null and b/nwnds_module/rs_gerrofshouse.git differ diff --git a/nwnds_module/rs_meetingcenter.are b/nwnds_module/rs_meetingcenter.are new file mode 100644 index 000000000..838208675 Binary files /dev/null and b/nwnds_module/rs_meetingcenter.are differ diff --git a/nwnds_module/rs_meetingcenter.gic b/nwnds_module/rs_meetingcenter.gic new file mode 100644 index 000000000..ccd0f4640 Binary files /dev/null and b/nwnds_module/rs_meetingcenter.gic differ diff --git a/nwnds_module/rs_meetingcenter.git b/nwnds_module/rs_meetingcenter.git new file mode 100644 index 000000000..1f34ce9dd Binary files /dev/null and b/nwnds_module/rs_meetingcenter.git differ diff --git a/nwnds_module/rs_widowshouse.are b/nwnds_module/rs_widowshouse.are new file mode 100644 index 000000000..687168db4 Binary files /dev/null and b/nwnds_module/rs_widowshouse.are differ diff --git a/nwnds_module/rs_widowshouse.gic b/nwnds_module/rs_widowshouse.gic new file mode 100644 index 000000000..b58429a43 Binary files /dev/null and b/nwnds_module/rs_widowshouse.gic differ diff --git a/nwnds_module/rs_widowshouse.git b/nwnds_module/rs_widowshouse.git new file mode 100644 index 000000000..245cd1223 Binary files /dev/null and b/nwnds_module/rs_widowshouse.git differ diff --git a/nwnds_module/ruinedminds001.are b/nwnds_module/ruinedminds001.are new file mode 100644 index 000000000..2135ed2e5 Binary files /dev/null and b/nwnds_module/ruinedminds001.are differ diff --git a/nwnds_module/ruinedminds001.gic b/nwnds_module/ruinedminds001.gic new file mode 100644 index 000000000..47674a94c Binary files /dev/null and b/nwnds_module/ruinedminds001.gic differ diff --git a/nwnds_module/ruinedminds001.git b/nwnds_module/ruinedminds001.git new file mode 100644 index 000000000..c9e0aa320 Binary files /dev/null and b/nwnds_module/ruinedminds001.git differ diff --git a/nwnds_module/ruve001.utc b/nwnds_module/ruve001.utc new file mode 100644 index 000000000..af6cdbc9e Binary files /dev/null and b/nwnds_module/ruve001.utc differ diff --git a/nwnds_module/ruve002.utc b/nwnds_module/ruve002.utc new file mode 100644 index 000000000..d431b18a6 Binary files /dev/null and b/nwnds_module/ruve002.utc differ diff --git a/nwnds_module/sagesstaff.uti b/nwnds_module/sagesstaff.uti new file mode 100644 index 000000000..19ad9e1be Binary files /dev/null and b/nwnds_module/sagesstaff.uti differ diff --git a/nwnds_module/salamander_tail.ncs b/nwnds_module/salamander_tail.ncs new file mode 100644 index 000000000..5608d09e6 Binary files /dev/null and b/nwnds_module/salamander_tail.ncs differ diff --git a/nwnds_module/salamander_tail.nss b/nwnds_module/salamander_tail.nss new file mode 100644 index 000000000..58db9123d --- /dev/null +++ b/nwnds_module/salamander_tail.nss @@ -0,0 +1,70 @@ +// Constriction Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(2)+nCreSTR, DAMAGE_TYPE_BLUDGEONING); + effect eFireDmg = EffectDamage(d6(1), DAMAGE_TYPE_FIRE); + int nSTR_Target; + int nSTR_Creature; + +// Huge & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_HUGE || + GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 2d6+STR Modifier bludgeoning damage & 1d6 Fire Damage + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eFireDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Black Mastyrial TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The salamander tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The salamander is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Black +// Mastyrial entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/salamander_tail.uti b/nwnds_module/salamander_tail.uti new file mode 100644 index 000000000..ecf64517e Binary files /dev/null and b/nwnds_module/salamander_tail.uti differ diff --git a/nwnds_module/saltdrakebite.uti b/nwnds_module/saltdrakebite.uti new file mode 100644 index 000000000..f8d0b1eb4 Binary files /dev/null and b/nwnds_module/saltdrakebite.uti differ diff --git a/nwnds_module/saltgolemhide.uti b/nwnds_module/saltgolemhide.uti new file mode 100644 index 000000000..8080a7e3f Binary files /dev/null and b/nwnds_module/saltgolemhide.uti differ diff --git a/nwnds_module/saltgolemslam.uti b/nwnds_module/saltgolemslam.uti new file mode 100644 index 000000000..88d817582 Binary files /dev/null and b/nwnds_module/saltgolemslam.uti differ diff --git a/nwnds_module/sandhowler001.utc b/nwnds_module/sandhowler001.utc new file mode 100644 index 000000000..5f3bbd63f Binary files /dev/null and b/nwnds_module/sandhowler001.utc differ diff --git a/nwnds_module/sandwyvern001.utc b/nwnds_module/sandwyvern001.utc new file mode 100644 index 000000000..5b6b09c05 Binary files /dev/null and b/nwnds_module/sandwyvern001.utc differ diff --git a/nwnds_module/sandwyvern002.utc b/nwnds_module/sandwyvern002.utc new file mode 100644 index 000000000..49b9a4d42 Binary files /dev/null and b/nwnds_module/sandwyvern002.utc differ diff --git a/nwnds_module/sc_001.ncs b/nwnds_module/sc_001.ncs new file mode 100644 index 000000000..79cc1a4e4 Binary files /dev/null and b/nwnds_module/sc_001.ncs differ diff --git a/nwnds_module/sc_001.nss b/nwnds_module/sc_001.nss new file mode 100644 index 000000000..f6a77dfaa --- /dev/null +++ b/nwnds_module/sc_001.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_001 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 4:54:01 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "QST_OFFICIALDOCS")) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nIbodQuest") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_002.ncs b/nwnds_module/sc_002.ncs new file mode 100644 index 000000000..c4171ef13 Binary files /dev/null and b/nwnds_module/sc_002.ncs differ diff --git a/nwnds_module/sc_002.nss b/nwnds_module/sc_002.nss new file mode 100644 index 000000000..f1e46bad9 --- /dev/null +++ b/nwnds_module/sc_002.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_002 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 2:54:23 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "QST_GOLDENKEY1")) + return FALSE; + if(!CheckPartyForItem(GetPCSpeaker(), "QST_GOLDENKEY2")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_003.ncs b/nwnds_module/sc_003.ncs new file mode 100644 index 000000000..e927c4cce Binary files /dev/null and b/nwnds_module/sc_003.ncs differ diff --git a/nwnds_module/sc_003.nss b/nwnds_module/sc_003.nss new file mode 100644 index 000000000..dad3c281d --- /dev/null +++ b/nwnds_module/sc_003.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_003 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 3:40:39 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "AR_KEY_BLUE")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_005.ncs b/nwnds_module/sc_005.ncs new file mode 100644 index 000000000..2b8f51c46 Binary files /dev/null and b/nwnds_module/sc_005.ncs differ diff --git a/nwnds_module/sc_005.nss b/nwnds_module/sc_005.nss new file mode 100644 index 000000000..61672d8eb --- /dev/null +++ b/nwnds_module/sc_005.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_005 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:01:48 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFirstTimeTalked") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_006.ncs b/nwnds_module/sc_006.ncs new file mode 100644 index 000000000..fba75e61a Binary files /dev/null and b/nwnds_module/sc_006.ncs differ diff --git a/nwnds_module/sc_006.nss b/nwnds_module/sc_006.nss new file mode 100644 index 000000000..a647808bc --- /dev/null +++ b/nwnds_module/sc_006.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_006 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:04:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFirstTimeTalked") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_007.ncs b/nwnds_module/sc_007.ncs new file mode 100644 index 000000000..5f950101c Binary files /dev/null and b/nwnds_module/sc_007.ncs differ diff --git a/nwnds_module/sc_007.nss b/nwnds_module/sc_007.nss new file mode 100644 index 000000000..695a7c154 --- /dev/null +++ b/nwnds_module/sc_007.nss @@ -0,0 +1,23 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_007 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:06:41 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "QST_DRIEDFISH")) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nTriciQuest") == 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_009.ncs b/nwnds_module/sc_009.ncs new file mode 100644 index 000000000..aad2c269a Binary files /dev/null and b/nwnds_module/sc_009.ncs differ diff --git a/nwnds_module/sc_009.nss b/nwnds_module/sc_009.nss new file mode 100644 index 000000000..7f924711e --- /dev/null +++ b/nwnds_module/sc_009.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_009 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:32:05 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFirstTimeTalked") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_010.ncs b/nwnds_module/sc_010.ncs new file mode 100644 index 000000000..8a33475f4 Binary files /dev/null and b/nwnds_module/sc_010.ncs differ diff --git a/nwnds_module/sc_010.nss b/nwnds_module/sc_010.nss new file mode 100644 index 000000000..fdd14969c --- /dev/null +++ b/nwnds_module/sc_010.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_010 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 1:40:58 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFirstTimeTalked") == 4)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_aristqcheck1.ncs b/nwnds_module/sc_aristqcheck1.ncs new file mode 100644 index 000000000..f9dd58d1e Binary files /dev/null and b/nwnds_module/sc_aristqcheck1.ncs differ diff --git a/nwnds_module/sc_aristqcheck1.nss b/nwnds_module/sc_aristqcheck1.nss new file mode 100644 index 000000000..02d4ee84d --- /dev/null +++ b/nwnds_module/sc_aristqcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_aristnecklace") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_aristqcheck2.ncs b/nwnds_module/sc_aristqcheck2.ncs new file mode 100644 index 000000000..4d8a6a89d Binary files /dev/null and b/nwnds_module/sc_aristqcheck2.ncs differ diff --git a/nwnds_module/sc_aristqcheck2.nss b/nwnds_module/sc_aristqcheck2.nss new file mode 100644 index 000000000..ad60ff2d0 --- /dev/null +++ b/nwnds_module/sc_aristqcheck2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_aristnecklace") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_aristqcheck3.ncs b/nwnds_module/sc_aristqcheck3.ncs new file mode 100644 index 000000000..cd5a68a1b Binary files /dev/null and b/nwnds_module/sc_aristqcheck3.ncs differ diff --git a/nwnds_module/sc_aristqcheck3.nss b/nwnds_module/sc_aristqcheck3.nss new file mode 100644 index 000000000..090d8d1af --- /dev/null +++ b/nwnds_module/sc_aristqcheck3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_aristnecklace") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_atdrunkgroom.ncs b/nwnds_module/sc_atdrunkgroom.ncs new file mode 100644 index 000000000..66a1bb004 Binary files /dev/null and b/nwnds_module/sc_atdrunkgroom.ncs differ diff --git a/nwnds_module/sc_atdrunkgroom.nss b/nwnds_module/sc_atdrunkgroom.nss new file mode 100644 index 000000000..c65a2b660 --- /dev/null +++ b/nwnds_module/sc_atdrunkgroom.nss @@ -0,0 +1,7 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("WP_DRUNKGIANTROOM"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); +} diff --git a/nwnds_module/sc_atemushroom.ncs b/nwnds_module/sc_atemushroom.ncs new file mode 100644 index 000000000..c49d6290b Binary files /dev/null and b/nwnds_module/sc_atemushroom.ncs differ diff --git a/nwnds_module/sc_atemushroom.nss b/nwnds_module/sc_atemushroom.nss new file mode 100644 index 000000000..b9d321166 --- /dev/null +++ b/nwnds_module/sc_atemushroom.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_atemushroom +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 10:48:55 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nAteMushroom") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_attoabmine.ncs b/nwnds_module/sc_attoabmine.ncs new file mode 100644 index 000000000..307fa2d8c Binary files /dev/null and b/nwnds_module/sc_attoabmine.ncs differ diff --git a/nwnds_module/sc_attoabmine.nss b/nwnds_module/sc_attoabmine.nss new file mode 100644 index 000000000..69fae072d --- /dev/null +++ b/nwnds_module/sc_attoabmine.nss @@ -0,0 +1,8 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("wp_abmine02"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); + +} diff --git a/nwnds_module/sc_attocoldf01.ncs b/nwnds_module/sc_attocoldf01.ncs new file mode 100644 index 000000000..194e5b8d2 Binary files /dev/null and b/nwnds_module/sc_attocoldf01.ncs differ diff --git a/nwnds_module/sc_attocoldf01.nss b/nwnds_module/sc_attocoldf01.nss new file mode 100644 index 000000000..68ce42af2 --- /dev/null +++ b/nwnds_module/sc_attocoldf01.nss @@ -0,0 +1,8 @@ +void main() +{ +object oPC = GetPCSpeaker(); + object oWayPoint = GetWaypointByTag("wp_coldfire01"); + location lLoc = GetLocation(oWayPoint); + AssignCommand(oPC,JumpToLocation(lLoc)); + +} diff --git a/nwnds_module/sc_belet2qcheck1.ncs b/nwnds_module/sc_belet2qcheck1.ncs new file mode 100644 index 000000000..ab26f23cd Binary files /dev/null and b/nwnds_module/sc_belet2qcheck1.ncs differ diff --git a/nwnds_module/sc_belet2qcheck1.nss b/nwnds_module/sc_belet2qcheck1.nss new file mode 100644 index 000000000..1bedea7b1 --- /dev/null +++ b/nwnds_module/sc_belet2qcheck1.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_takeout") == 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_belet2qcheck2.ncs b/nwnds_module/sc_belet2qcheck2.ncs new file mode 100644 index 000000000..a8f651112 Binary files /dev/null and b/nwnds_module/sc_belet2qcheck2.ncs differ diff --git a/nwnds_module/sc_belet2qcheck2.nss b/nwnds_module/sc_belet2qcheck2.nss new file mode 100644 index 000000000..427acaa23 --- /dev/null +++ b/nwnds_module/sc_belet2qcheck2.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_takeout") == 2)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_belet2qcheck3.ncs b/nwnds_module/sc_belet2qcheck3.ncs new file mode 100644 index 000000000..92445b4e5 Binary files /dev/null and b/nwnds_module/sc_belet2qcheck3.ncs differ diff --git a/nwnds_module/sc_belet2qcheck3.nss b/nwnds_module/sc_belet2qcheck3.nss new file mode 100644 index 000000000..10394fdd3 --- /dev/null +++ b/nwnds_module/sc_belet2qcheck3.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_takeout") == 3)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_beletqcheck1.ncs b/nwnds_module/sc_beletqcheck1.ncs new file mode 100644 index 000000000..b3a34deae Binary files /dev/null and b/nwnds_module/sc_beletqcheck1.ncs differ diff --git a/nwnds_module/sc_beletqcheck1.nss b/nwnds_module/sc_beletqcheck1.nss new file mode 100644 index 000000000..38eda8752 --- /dev/null +++ b/nwnds_module/sc_beletqcheck1.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_queenstouch") == 1)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_beletqcheck2.ncs b/nwnds_module/sc_beletqcheck2.ncs new file mode 100644 index 000000000..09c1901ae Binary files /dev/null and b/nwnds_module/sc_beletqcheck2.ncs differ diff --git a/nwnds_module/sc_beletqcheck2.nss b/nwnds_module/sc_beletqcheck2.nss new file mode 100644 index 000000000..0be37c495 --- /dev/null +++ b/nwnds_module/sc_beletqcheck2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_queenstouch") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_beletqcheck3.ncs b/nwnds_module/sc_beletqcheck3.ncs new file mode 100644 index 000000000..6d2480ddf Binary files /dev/null and b/nwnds_module/sc_beletqcheck3.ncs differ diff --git a/nwnds_module/sc_beletqcheck3.nss b/nwnds_module/sc_beletqcheck3.nss new file mode 100644 index 000000000..712095452 --- /dev/null +++ b/nwnds_module/sc_beletqcheck3.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_queenstouch") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_bheartcheck.ncs b/nwnds_module/sc_bheartcheck.ncs new file mode 100644 index 000000000..9e4f2810b Binary files /dev/null and b/nwnds_module/sc_bheartcheck.ncs differ diff --git a/nwnds_module/sc_bheartcheck.nss b/nwnds_module/sc_bheartcheck.nss new file mode 100644 index 000000000..8cd0e0169 --- /dev/null +++ b/nwnds_module/sc_bheartcheck.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_bheartcheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/2002 4:04:33 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_BANDITHEART"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +return FALSE; +} diff --git a/nwnds_module/sc_bloodqcheck3.ncs b/nwnds_module/sc_bloodqcheck3.ncs new file mode 100644 index 000000000..839ac670e Binary files /dev/null and b/nwnds_module/sc_bloodqcheck3.ncs differ diff --git a/nwnds_module/sc_bloodqcheck3.nss b/nwnds_module/sc_bloodqcheck3.nss new file mode 100644 index 000000000..527dfa290 --- /dev/null +++ b/nwnds_module/sc_bloodqcheck3.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_elinikqchec2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:34:05 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_bloodletter") == 3)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_bloodqcheck4.ncs b/nwnds_module/sc_bloodqcheck4.ncs new file mode 100644 index 000000000..dcb041c20 Binary files /dev/null and b/nwnds_module/sc_bloodqcheck4.ncs differ diff --git a/nwnds_module/sc_bloodqcheck4.nss b/nwnds_module/sc_bloodqcheck4.nss new file mode 100644 index 000000000..c72abbb06 --- /dev/null +++ b/nwnds_module/sc_bloodqcheck4.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_elinikqchec2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:34:05 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_bloodletter") == 4)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_brill01.ncs b/nwnds_module/sc_brill01.ncs new file mode 100644 index 000000000..9fca45a8c Binary files /dev/null and b/nwnds_module/sc_brill01.ncs differ diff --git a/nwnds_module/sc_brill01.nss b/nwnds_module/sc_brill01.nss new file mode 100644 index 000000000..583a6f9fb --- /dev/null +++ b/nwnds_module/sc_brill01.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_brill01 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:16:01 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nBrillQuest") == 0)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_brill03.ncs b/nwnds_module/sc_brill03.ncs new file mode 100644 index 000000000..7b64ca17c Binary files /dev/null and b/nwnds_module/sc_brill03.ncs differ diff --git a/nwnds_module/sc_brill03.nss b/nwnds_module/sc_brill03.nss new file mode 100644 index 000000000..8c999159e --- /dev/null +++ b/nwnds_module/sc_brill03.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_brill03 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:20:21 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "QST_SMITHHAMMER")) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nBrillQuest") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkarineck.ncs b/nwnds_module/sc_checkarineck.ncs new file mode 100644 index 000000000..1474e4239 Binary files /dev/null and b/nwnds_module/sc_checkarineck.ncs differ diff --git a/nwnds_module/sc_checkarineck.nss b/nwnds_module/sc_checkarineck.nss new file mode 100644 index 000000000..501231323 --- /dev/null +++ b/nwnds_module/sc_checkarineck.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkarineck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 11:24:18 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "AristiphanalesNecklace")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkarmerthr.ncs b/nwnds_module/sc_checkarmerthr.ncs new file mode 100644 index 000000000..a5c4e9b70 Binary files /dev/null and b/nwnds_module/sc_checkarmerthr.ncs differ diff --git a/nwnds_module/sc_checkarmerthr.nss b/nwnds_module/sc_checkarmerthr.nss new file mode 100644 index 000000000..5ea4488c2 --- /dev/null +++ b/nwnds_module/sc_checkarmerthr.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkarmerthr +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 11:42:09 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nArenaMerch2Threat") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkbllotus.ncs b/nwnds_module/sc_checkbllotus.ncs new file mode 100644 index 000000000..006591b32 Binary files /dev/null and b/nwnds_module/sc_checkbllotus.ncs differ diff --git a/nwnds_module/sc_checkbllotus.nss b/nwnds_module/sc_checkbllotus.nss new file mode 100644 index 000000000..a564b8f4b --- /dev/null +++ b/nwnds_module/sc_checkbllotus.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkbllotus +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/30/2002 2:49:25 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "bluelotus")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkcromisle.ncs b/nwnds_module/sc_checkcromisle.ncs new file mode 100644 index 000000000..52a2da84c Binary files /dev/null and b/nwnds_module/sc_checkcromisle.ncs differ diff --git a/nwnds_module/sc_checkcromisle.nss b/nwnds_module/sc_checkcromisle.nss new file mode 100644 index 000000000..44bbaaade --- /dev/null +++ b/nwnds_module/sc_checkcromisle.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkcromisle +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 2:18:04 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nCromlinIsle") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkelven.ncs b/nwnds_module/sc_checkelven.ncs new file mode 100644 index 000000000..42569563c Binary files /dev/null and b/nwnds_module/sc_checkelven.ncs differ diff --git a/nwnds_module/sc_checkelven.nss b/nwnds_module/sc_checkelven.nss new file mode 100644 index 000000000..6c5e09218 --- /dev/null +++ b/nwnds_module/sc_checkelven.nss @@ -0,0 +1,62 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkelven +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/28/2002 1:27:08 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Reject player races + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_DWARF) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_GNOME) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFELF) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFLING) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HALFORC) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMAN) + return FALSE; + + // Reject other races + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ABERRATION) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ANIMAL) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_BEAST) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_CONSTRUCT) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_DRAGON) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELEMENTAL) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_FEY) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_GIANT) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_GOBLINOID) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_MAGICAL_BEAST) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_MONSTROUS) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_ORC) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_OUTSIDER) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_REPTILIAN) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_SHAPECHANGER) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_UNDEAD) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_VERMIN) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkgerst1.ncs b/nwnds_module/sc_checkgerst1.ncs new file mode 100644 index 000000000..67b808769 Binary files /dev/null and b/nwnds_module/sc_checkgerst1.ncs differ diff --git a/nwnds_module/sc_checkgerst1.nss b/nwnds_module/sc_checkgerst1.nss new file mode 100644 index 000000000..a309e7b73 --- /dev/null +++ b/nwnds_module/sc_checkgerst1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkgerst1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:17:33 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGerrofStory") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkhenst1.ncs b/nwnds_module/sc_checkhenst1.ncs new file mode 100644 index 000000000..abe51e569 Binary files /dev/null and b/nwnds_module/sc_checkhenst1.ncs differ diff --git a/nwnds_module/sc_checkhenst1.nss b/nwnds_module/sc_checkhenst1.nss new file mode 100644 index 000000000..55f75b38c --- /dev/null +++ b/nwnds_module/sc_checkhenst1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkhenst1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:13:20 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nHendelStory") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkinvwater.ncs b/nwnds_module/sc_checkinvwater.ncs new file mode 100644 index 000000000..a30cc604f Binary files /dev/null and b/nwnds_module/sc_checkinvwater.ncs differ diff --git a/nwnds_module/sc_checkinvwater.nss b/nwnds_module/sc_checkinvwater.nss new file mode 100644 index 000000000..981714f1d --- /dev/null +++ b/nwnds_module/sc_checkinvwater.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkinvwater +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 3:14:18 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "AR_IT_WATER002")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkleswife1.ncs b/nwnds_module/sc_checkleswife1.ncs new file mode 100644 index 000000000..34221f144 Binary files /dev/null and b/nwnds_module/sc_checkleswife1.ncs differ diff --git a/nwnds_module/sc_checkleswife1.nss b/nwnds_module/sc_checkleswife1.nss new file mode 100644 index 000000000..b32c46970 --- /dev/null +++ b/nwnds_module/sc_checkleswife1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkleswife1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:41:12 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nLestonWife") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkneut.ncs b/nwnds_module/sc_checkneut.ncs new file mode 100644 index 000000000..d07ef23f6 Binary files /dev/null and b/nwnds_module/sc_checkneut.ncs differ diff --git a/nwnds_module/sc_checkneut.nss b/nwnds_module/sc_checkneut.nss new file mode 100644 index 000000000..495f8db55 --- /dev/null +++ b/nwnds_module/sc_checkneut.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkneut +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:00:39 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's alignment + if(GetAlignmentGoodEvil(GetPCSpeaker()) != ALIGNMENT_NEUTRAL) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checknonelf.ncs b/nwnds_module/sc_checknonelf.ncs new file mode 100644 index 000000000..bbe65fe1a Binary files /dev/null and b/nwnds_module/sc_checknonelf.ncs differ diff --git a/nwnds_module/sc_checknonelf.nss b/nwnds_module/sc_checknonelf.nss new file mode 100644 index 000000000..05e257e6d --- /dev/null +++ b/nwnds_module/sc_checknonelf.nss @@ -0,0 +1,52 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checknonelf +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/28/2002 1:25:42 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Reject player races + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELF) + return FALSE; + + // Reject other races + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ABERRATION) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ANIMAL) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_BEAST) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_CONSTRUCT) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_DRAGON) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_ELEMENTAL) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_FEY) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_GIANT) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_GOBLINOID) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_MAGICAL_BEAST) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_MONSTROUS) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_ORC) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_OUTSIDER) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_HUMANOID_REPTILIAN) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_SHAPECHANGER) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_UNDEAD) + return FALSE; + if(GetRacialType(GetPCSpeaker()) == RACIAL_TYPE_VERMIN) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkpcloc.ncs b/nwnds_module/sc_checkpcloc.ncs new file mode 100644 index 000000000..cca5f6699 Binary files /dev/null and b/nwnds_module/sc_checkpcloc.ncs differ diff --git a/nwnds_module/sc_checkpcloc.nss b/nwnds_module/sc_checkpcloc.nss new file mode 100644 index 000000000..3dc60d97e --- /dev/null +++ b/nwnds_module/sc_checkpcloc.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkpcloc +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 4:31:09 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nPiratesCoveLoc") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkpcovepas.ncs b/nwnds_module/sc_checkpcovepas.ncs new file mode 100644 index 000000000..8748aa791 Binary files /dev/null and b/nwnds_module/sc_checkpcovepas.ncs differ diff --git a/nwnds_module/sc_checkpcovepas.nss b/nwnds_module/sc_checkpcovepas.nss new file mode 100644 index 000000000..f7627489c --- /dev/null +++ b/nwnds_module/sc_checkpcovepas.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkpcovepas +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 3:11:07 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nPirateCovePass") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checktkchakey.ncs b/nwnds_module/sc_checktkchakey.ncs new file mode 100644 index 000000000..5ebd9f0e6 Binary files /dev/null and b/nwnds_module/sc_checktkchakey.ncs differ diff --git a/nwnds_module/sc_checktkchakey.nss b/nwnds_module/sc_checktkchakey.nss new file mode 100644 index 000000000..ace6fec5b --- /dev/null +++ b/nwnds_module/sc_checktkchakey.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checktkchakey +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 6:55:26 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nTookCharKey") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkunearpr1.ncs b/nwnds_module/sc_checkunearpr1.ncs new file mode 100644 index 000000000..76182312a Binary files /dev/null and b/nwnds_module/sc_checkunearpr1.ncs differ diff --git a/nwnds_module/sc_checkunearpr1.nss b/nwnds_module/sc_checkunearpr1.nss new file mode 100644 index 000000000..1a44235b9 --- /dev/null +++ b/nwnds_module/sc_checkunearpr1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkunearpr1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/4/2002 1:35:23 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nUnearthedPortal") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkvatoken.ncs b/nwnds_module/sc_checkvatoken.ncs new file mode 100644 index 000000000..5eb22cc94 Binary files /dev/null and b/nwnds_module/sc_checkvatoken.ncs differ diff --git a/nwnds_module/sc_checkvatoken.nss b/nwnds_module/sc_checkvatoken.nss new file mode 100644 index 000000000..8806b14c0 --- /dev/null +++ b/nwnds_module/sc_checkvatoken.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkvatoken +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/7/2002 1:05:28 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!GetIsObjectValid(GetItemPossessedBy(GetPCSpeaker(), "VeiledAllianceAmulet"))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_checkwestmsh1.ncs b/nwnds_module/sc_checkwestmsh1.ncs new file mode 100644 index 000000000..43fd33109 Binary files /dev/null and b/nwnds_module/sc_checkwestmsh1.ncs differ diff --git a/nwnds_module/sc_checkwestmsh1.nss b/nwnds_module/sc_checkwestmsh1.nss new file mode 100644 index 000000000..7dea71f56 --- /dev/null +++ b/nwnds_module/sc_checkwestmsh1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_checkwestmsh1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/24/2002 1:53:09 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nWestmorreShop") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chekillqueen.ncs b/nwnds_module/sc_chekillqueen.ncs new file mode 100644 index 000000000..aea806023 Binary files /dev/null and b/nwnds_module/sc_chekillqueen.ncs differ diff --git a/nwnds_module/sc_chekillqueen.nss b/nwnds_module/sc_chekillqueen.nss new file mode 100644 index 000000000..b96d94cbe --- /dev/null +++ b/nwnds_module/sc_chekillqueen.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chekillqueen +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 1:26:13 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nKilledQueen") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chequenven1.ncs b/nwnds_module/sc_chequenven1.ncs new file mode 100644 index 000000000..b1ab461df Binary files /dev/null and b/nwnds_module/sc_chequenven1.ncs differ diff --git a/nwnds_module/sc_chequenven1.nss b/nwnds_module/sc_chequenven1.nss new file mode 100644 index 000000000..701ced7d1 --- /dev/null +++ b/nwnds_module/sc_chequenven1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chequenven1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 1:22:12 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nQueenVenom") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chesiavachk1.ncs b/nwnds_module/sc_chesiavachk1.ncs new file mode 100644 index 000000000..dcefd8c6f Binary files /dev/null and b/nwnds_module/sc_chesiavachk1.ncs differ diff --git a/nwnds_module/sc_chesiavachk1.nss b/nwnds_module/sc_chesiavachk1.nss new file mode 100644 index 000000000..3442a17a1 --- /dev/null +++ b/nwnds_module/sc_chesiavachk1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chesiavachk1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 11:20:42 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nChesiaVA") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkale.ncs b/nwnds_module/sc_chkale.ncs new file mode 100644 index 000000000..077c899a9 Binary files /dev/null and b/nwnds_module/sc_chkale.ncs differ diff --git a/nwnds_module/sc_chkale.nss b/nwnds_module/sc_chkale.nss new file mode 100644 index 000000000..f2e374277 --- /dev/null +++ b/nwnds_module/sc_chkale.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkale +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:43:24 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "NW_IT_MPOTION021")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkbalicticke.ncs b/nwnds_module/sc_chkbalicticke.ncs new file mode 100644 index 000000000..7d643457f Binary files /dev/null and b/nwnds_module/sc_chkbalicticke.ncs differ diff --git a/nwnds_module/sc_chkbalicticke.nss b/nwnds_module/sc_chkbalicticke.nss new file mode 100644 index 000000000..7bef85133 --- /dev/null +++ b/nwnds_module/sc_chkbalicticke.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkbalicticke +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 11:40:52 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "BalicIslandTicket")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkbroy.ncs b/nwnds_module/sc_chkbroy.ncs new file mode 100644 index 000000000..7ce638b69 Binary files /dev/null and b/nwnds_module/sc_chkbroy.ncs differ diff --git a/nwnds_module/sc_chkbroy.nss b/nwnds_module/sc_chkbroy.nss new file mode 100644 index 000000000..78811f88d --- /dev/null +++ b/nwnds_module/sc_chkbroy.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkbroy +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:43:49 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "POT_BROY")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkchoosenone.ncs b/nwnds_module/sc_chkchoosenone.ncs new file mode 100644 index 000000000..b8907e9c4 Binary files /dev/null and b/nwnds_module/sc_chkchoosenone.ncs differ diff --git a/nwnds_module/sc_chkchoosenone.nss b/nwnds_module/sc_chkchoosenone.nss new file mode 100644 index 000000000..9ff07a002 --- /dev/null +++ b/nwnds_module/sc_chkchoosenone.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkchoosenone +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:35:29 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nChoosenOne") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkcleric.ncs b/nwnds_module/sc_chkcleric.ncs new file mode 100644 index 000000000..f07ba1904 Binary files /dev/null and b/nwnds_module/sc_chkcleric.ncs differ diff --git a/nwnds_module/sc_chkcleric.nss b/nwnds_module/sc_chkcleric.nss new file mode 100644 index 000000000..4b077562b --- /dev/null +++ b/nwnds_module/sc_chkcleric.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkcleric +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 3:57:10 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's class + int iPassed = 0; + if(GetLevelByClass(CLASS_TYPE_CLERIC, GetPCSpeaker()) >= 1) + iPassed = 1; + if(iPassed == 0) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkclocticket.ncs b/nwnds_module/sc_chkclocticket.ncs new file mode 100644 index 000000000..4b747f083 Binary files /dev/null and b/nwnds_module/sc_chkclocticket.ncs differ diff --git a/nwnds_module/sc_chkclocticket.nss b/nwnds_module/sc_chkclocticket.nss new file mode 100644 index 000000000..97982d34e --- /dev/null +++ b/nwnds_module/sc_chkclocticket.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkcromticket +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 11:39:26 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "ClockworkIslandTicket")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkcromticket.ncs b/nwnds_module/sc_chkcromticket.ncs new file mode 100644 index 000000000..7827f13a1 Binary files /dev/null and b/nwnds_module/sc_chkcromticket.ncs differ diff --git a/nwnds_module/sc_chkcromticket.nss b/nwnds_module/sc_chkcromticket.nss new file mode 100644 index 000000000..05cee9fe1 --- /dev/null +++ b/nwnds_module/sc_chkcromticket.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkcromticket +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 11:39:26 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "CromlinIslandTicket")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkdrunkpay.ncs b/nwnds_module/sc_chkdrunkpay.ncs new file mode 100644 index 000000000..e88e226c7 Binary files /dev/null and b/nwnds_module/sc_chkdrunkpay.ncs differ diff --git a/nwnds_module/sc_chkdrunkpay.nss b/nwnds_module/sc_chkdrunkpay.nss new file mode 100644 index 000000000..6429a37f9 --- /dev/null +++ b/nwnds_module/sc_chkdrunkpay.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkdrunkpay +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/8/2002 11:41:06 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nDrunkPay") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkevil.ncs b/nwnds_module/sc_chkevil.ncs new file mode 100644 index 000000000..1e3be7f20 Binary files /dev/null and b/nwnds_module/sc_chkevil.ncs differ diff --git a/nwnds_module/sc_chkevil.nss b/nwnds_module/sc_chkevil.nss new file mode 100644 index 000000000..f953f81d5 --- /dev/null +++ b/nwnds_module/sc_chkevil.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkevil +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:00:52 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's alignment + if(GetAlignmentGoodEvil(GetPCSpeaker()) != ALIGNMENT_EVIL) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkfaildarlie.ncs b/nwnds_module/sc_chkfaildarlie.ncs new file mode 100644 index 000000000..826d225da Binary files /dev/null and b/nwnds_module/sc_chkfaildarlie.ncs differ diff --git a/nwnds_module/sc_chkfaildarlie.nss b/nwnds_module/sc_chkfaildarlie.nss new file mode 100644 index 000000000..565ecbeff --- /dev/null +++ b/nwnds_module/sc_chkfaildarlie.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkfaildarlie +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 11/18/2002 1:15:46 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFailDariyaLie") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkfemale.ncs b/nwnds_module/sc_chkfemale.ncs new file mode 100644 index 000000000..58d216e4f Binary files /dev/null and b/nwnds_module/sc_chkfemale.ncs differ diff --git a/nwnds_module/sc_chkfemale.nss b/nwnds_module/sc_chkfemale.nss new file mode 100644 index 000000000..901c68930 --- /dev/null +++ b/nwnds_module/sc_chkfemale.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkfemale +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/18/2002 2:12:45 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the gender restrictions + if(GetGender(GetPCSpeaker()) != GENDER_FEMALE) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkfirstdonat.ncs b/nwnds_module/sc_chkfirstdonat.ncs new file mode 100644 index 000000000..4b09033df Binary files /dev/null and b/nwnds_module/sc_chkfirstdonat.ncs differ diff --git a/nwnds_module/sc_chkfirstdonat.nss b/nwnds_module/sc_chkfirstdonat.nss new file mode 100644 index 000000000..e815558bb --- /dev/null +++ b/nwnds_module/sc_chkfirstdonat.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkmirbelt +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 1:47:59 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGaveDonationFirst") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkgood.ncs b/nwnds_module/sc_chkgood.ncs new file mode 100644 index 000000000..12bdb7cce Binary files /dev/null and b/nwnds_module/sc_chkgood.ncs differ diff --git a/nwnds_module/sc_chkgood.nss b/nwnds_module/sc_chkgood.nss new file mode 100644 index 000000000..e7eb232f4 --- /dev/null +++ b/nwnds_module/sc_chkgood.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkgood +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 4:00:15 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Restrict based on the player's alignment + if(GetAlignmentGoodEvil(GetPCSpeaker()) != ALIGNMENT_GOOD) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkgotrugxp.ncs b/nwnds_module/sc_chkgotrugxp.ncs new file mode 100644 index 000000000..14f3e92a2 Binary files /dev/null and b/nwnds_module/sc_chkgotrugxp.ncs differ diff --git a/nwnds_module/sc_chkgotrugxp.nss b/nwnds_module/sc_chkgotrugxp.nss new file mode 100644 index 000000000..58e106985 --- /dev/null +++ b/nwnds_module/sc_chkgotrugxp.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkgotrugxp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/24/2002 11:04:18 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGotRugXP") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkhelpjariel.ncs b/nwnds_module/sc_chkhelpjariel.ncs new file mode 100644 index 000000000..249f87865 Binary files /dev/null and b/nwnds_module/sc_chkhelpjariel.ncs differ diff --git a/nwnds_module/sc_chkhelpjariel.nss b/nwnds_module/sc_chkhelpjariel.nss new file mode 100644 index 000000000..0cd5179e3 --- /dev/null +++ b/nwnds_module/sc_chkhelpjariel.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkhelpjariel +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/12/2002 1:40:20 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nHelpJariel") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkinsultjogo.ncs b/nwnds_module/sc_chkinsultjogo.ncs new file mode 100644 index 000000000..1eb3d0175 Binary files /dev/null and b/nwnds_module/sc_chkinsultjogo.ncs differ diff --git a/nwnds_module/sc_chkinsultjogo.nss b/nwnds_module/sc_chkinsultjogo.nss new file mode 100644 index 000000000..d37640733 --- /dev/null +++ b/nwnds_module/sc_chkinsultjogo.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkinsultjogo +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/6/2002 10:02:50 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nInsultJogodin") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkjavo.ncs b/nwnds_module/sc_chkjavo.ncs new file mode 100644 index 000000000..7ae00adf4 Binary files /dev/null and b/nwnds_module/sc_chkjavo.ncs differ diff --git a/nwnds_module/sc_chkjavo.nss b/nwnds_module/sc_chkjavo.nss new file mode 100644 index 000000000..f315165fa --- /dev/null +++ b/nwnds_module/sc_chkjavo.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkjavo +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:44:14 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "POT_JAVONECTAR")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkjogoinsfin.ncs b/nwnds_module/sc_chkjogoinsfin.ncs new file mode 100644 index 000000000..755cb9bd4 Binary files /dev/null and b/nwnds_module/sc_chkjogoinsfin.ncs differ diff --git a/nwnds_module/sc_chkjogoinsfin.nss b/nwnds_module/sc_chkjogoinsfin.nss new file mode 100644 index 000000000..6bdb0ef71 --- /dev/null +++ b/nwnds_module/sc_chkjogoinsfin.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkjogoinsfin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 8:02:19 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nInsultJogoFinal") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chklootcromc1.ncs b/nwnds_module/sc_chklootcromc1.ncs new file mode 100644 index 000000000..40c6b3c0c Binary files /dev/null and b/nwnds_module/sc_chklootcromc1.ncs differ diff --git a/nwnds_module/sc_chklootcromc1.nss b/nwnds_module/sc_chklootcromc1.nss new file mode 100644 index 000000000..0c657390d --- /dev/null +++ b/nwnds_module/sc_chklootcromc1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chklootcromc1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/17/2002 12:35:16 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nLootedCromChest") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkmilkwine.ncs b/nwnds_module/sc_chkmilkwine.ncs new file mode 100644 index 000000000..146f27436 Binary files /dev/null and b/nwnds_module/sc_chkmilkwine.ncs differ diff --git a/nwnds_module/sc_chkmilkwine.nss b/nwnds_module/sc_chkmilkwine.nss new file mode 100644 index 000000000..a8ae03a6f --- /dev/null +++ b/nwnds_module/sc_chkmilkwine.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkmilkwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:43:49 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "POT_MILKWINE")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chknualweap.ncs b/nwnds_module/sc_chknualweap.ncs new file mode 100644 index 000000000..73d235ba4 Binary files /dev/null and b/nwnds_module/sc_chknualweap.ncs differ diff --git a/nwnds_module/sc_chknualweap.nss b/nwnds_module/sc_chknualweap.nss new file mode 100644 index 000000000..e36c6fa27 --- /dev/null +++ b/nwnds_module/sc_chknualweap.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chknualweap +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/18/2002 2:34:34 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nNualWeapons") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chkpalmwine.ncs b/nwnds_module/sc_chkpalmwine.ncs new file mode 100644 index 000000000..f983b8b85 Binary files /dev/null and b/nwnds_module/sc_chkpalmwine.ncs differ diff --git a/nwnds_module/sc_chkpalmwine.nss b/nwnds_module/sc_chkpalmwine.nss new file mode 100644 index 000000000..2b7016948 --- /dev/null +++ b/nwnds_module/sc_chkpalmwine.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chkpalmwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:43:49 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "POT_PALMWINE")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chksapwine.ncs b/nwnds_module/sc_chksapwine.ncs new file mode 100644 index 000000000..efaa690dc Binary files /dev/null and b/nwnds_module/sc_chksapwine.ncs differ diff --git a/nwnds_module/sc_chksapwine.nss b/nwnds_module/sc_chksapwine.nss new file mode 100644 index 000000000..cbb6c2ca9 --- /dev/null +++ b/nwnds_module/sc_chksapwine.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chksapwine +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/16/2002 11:43:49 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "POT_SAPWINE")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_chktakedonati.ncs b/nwnds_module/sc_chktakedonati.ncs new file mode 100644 index 000000000..deefdaece Binary files /dev/null and b/nwnds_module/sc_chktakedonati.ncs differ diff --git a/nwnds_module/sc_chktakedonati.nss b/nwnds_module/sc_chktakedonati.nss new file mode 100644 index 000000000..6411789ee --- /dev/null +++ b/nwnds_module/sc_chktakedonati.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_chktakedonati +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/11/2002 2:08:17 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nTakeDonations") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_circleqcheck1.ncs b/nwnds_module/sc_circleqcheck1.ncs new file mode 100644 index 000000000..06fe17aba Binary files /dev/null and b/nwnds_module/sc_circleqcheck1.ncs differ diff --git a/nwnds_module/sc_circleqcheck1.nss b/nwnds_module/sc_circleqcheck1.nss new file mode 100644 index 000000000..a7a8117a6 --- /dev/null +++ b/nwnds_module/sc_circleqcheck1.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_circleqcheck2.ncs b/nwnds_module/sc_circleqcheck2.ncs new file mode 100644 index 000000000..3ce82df97 Binary files /dev/null and b/nwnds_module/sc_circleqcheck2.ncs differ diff --git a/nwnds_module/sc_circleqcheck2.nss b/nwnds_module/sc_circleqcheck2.nss new file mode 100644 index 000000000..8313fcbd5 --- /dev/null +++ b/nwnds_module/sc_circleqcheck2.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 2)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_circleqcheck3.ncs b/nwnds_module/sc_circleqcheck3.ncs new file mode 100644 index 000000000..abf5cd63c Binary files /dev/null and b/nwnds_module/sc_circleqcheck3.ncs differ diff --git a/nwnds_module/sc_circleqcheck3.nss b/nwnds_module/sc_circleqcheck3.nss new file mode 100644 index 000000000..32968579c --- /dev/null +++ b/nwnds_module/sc_circleqcheck3.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 3)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_circleqcheck5.ncs b/nwnds_module/sc_circleqcheck5.ncs new file mode 100644 index 000000000..d10dd6415 Binary files /dev/null and b/nwnds_module/sc_circleqcheck5.ncs differ diff --git a/nwnds_module/sc_circleqcheck5.nss b/nwnds_module/sc_circleqcheck5.nss new file mode 100644 index 000000000..211f4b448 --- /dev/null +++ b/nwnds_module/sc_circleqcheck5.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 5)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_circleqcheck6.ncs b/nwnds_module/sc_circleqcheck6.ncs new file mode 100644 index 000000000..71b8363ea Binary files /dev/null and b/nwnds_module/sc_circleqcheck6.ncs differ diff --git a/nwnds_module/sc_circleqcheck6.nss b/nwnds_module/sc_circleqcheck6.nss new file mode 100644 index 000000000..1bce4abc9 --- /dev/null +++ b/nwnds_module/sc_circleqcheck6.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 6)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_circleqcheck7.ncs b/nwnds_module/sc_circleqcheck7.ncs new file mode 100644 index 000000000..c572d326c Binary files /dev/null and b/nwnds_module/sc_circleqcheck7.ncs differ diff --git a/nwnds_module/sc_circleqcheck7.nss b/nwnds_module/sc_circleqcheck7.nss new file mode 100644 index 000000000..b666027db --- /dev/null +++ b/nwnds_module/sc_circleqcheck7.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 7)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_climbidea.ncs b/nwnds_module/sc_climbidea.ncs new file mode 100644 index 000000000..fef5f8e67 Binary files /dev/null and b/nwnds_module/sc_climbidea.ncs differ diff --git a/nwnds_module/sc_climbidea.nss b/nwnds_module/sc_climbidea.nss new file mode 100644 index 000000000..d60c7461e --- /dev/null +++ b/nwnds_module/sc_climbidea.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_climbidea +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/11/2002 11:29:23 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 10)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_dispcheckh.ncs b/nwnds_module/sc_dispcheckh.ncs new file mode 100644 index 000000000..bd2efecfc Binary files /dev/null and b/nwnds_module/sc_dispcheckh.ncs differ diff --git a/nwnds_module/sc_dispcheckh.nss b/nwnds_module/sc_dispcheckh.nss new file mode 100644 index 000000000..bb9bafc58 --- /dev/null +++ b/nwnds_module/sc_dispcheckh.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_dispcheckh +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/4/2002 1:19:08 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_HARD, SKILL_DISCIPLINE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_elinikqcheck1.ncs b/nwnds_module/sc_elinikqcheck1.ncs new file mode 100644 index 000000000..1be1fa9db Binary files /dev/null and b/nwnds_module/sc_elinikqcheck1.ncs differ diff --git a/nwnds_module/sc_elinikqcheck1.nss b/nwnds_module/sc_elinikqcheck1.nss new file mode 100644 index 000000000..e66b21118 --- /dev/null +++ b/nwnds_module/sc_elinikqcheck1.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_elinikqchec2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:34:05 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_unearthed") == 1)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_elinikqcheck2.ncs b/nwnds_module/sc_elinikqcheck2.ncs new file mode 100644 index 000000000..f8a42a534 Binary files /dev/null and b/nwnds_module/sc_elinikqcheck2.ncs differ diff --git a/nwnds_module/sc_elinikqcheck2.nss b/nwnds_module/sc_elinikqcheck2.nss new file mode 100644 index 000000000..c3217d7c7 --- /dev/null +++ b/nwnds_module/sc_elinikqcheck2.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_elinikcheck2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:40:23 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_unearthed") == 2)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_elinikqcheck3.ncs b/nwnds_module/sc_elinikqcheck3.ncs new file mode 100644 index 000000000..753907434 Binary files /dev/null and b/nwnds_module/sc_elinikqcheck3.ncs differ diff --git a/nwnds_module/sc_elinikqcheck3.nss b/nwnds_module/sc_elinikqcheck3.nss new file mode 100644 index 000000000..f58d9215b --- /dev/null +++ b/nwnds_module/sc_elinikqcheck3.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_elinikcheck2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:40:23 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_unearthed") == 3)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/sc_foundcloie.ncs b/nwnds_module/sc_foundcloie.ncs new file mode 100644 index 000000000..1fc02e886 Binary files /dev/null and b/nwnds_module/sc_foundcloie.ncs differ diff --git a/nwnds_module/sc_foundcloie.nss b/nwnds_module/sc_foundcloie.nss new file mode 100644 index 000000000..0babd2d79 --- /dev/null +++ b/nwnds_module/sc_foundcloie.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_foundcloie +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:32:12 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "Cloie"); +if(!GetIsObjectValid(oItemToTake) != 0) + return FALSE; +if(GetLocalInt(GetPCSpeaker(),"DydrinaFirstTimeTalked") != 1) + return FALSE; +if(GetHitDice(GetPCSpeaker()) > 12) + return FALSE; +// else +return TRUE; +} diff --git a/nwnds_module/sc_gaorgqchk1.ncs b/nwnds_module/sc_gaorgqchk1.ncs new file mode 100644 index 000000000..1c258bdb3 Binary files /dev/null and b/nwnds_module/sc_gaorgqchk1.ncs differ diff --git a/nwnds_module/sc_gaorgqchk1.nss b/nwnds_module/sc_gaorgqchk1.nss new file mode 100644 index 000000000..f9a137f97 --- /dev/null +++ b/nwnds_module/sc_gaorgqchk1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_gaorgsdebt") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gaorgqchk2.ncs b/nwnds_module/sc_gaorgqchk2.ncs new file mode 100644 index 000000000..7a5ada43c Binary files /dev/null and b/nwnds_module/sc_gaorgqchk2.ncs differ diff --git a/nwnds_module/sc_gaorgqchk2.nss b/nwnds_module/sc_gaorgqchk2.nss new file mode 100644 index 000000000..b3ecea98d --- /dev/null +++ b/nwnds_module/sc_gaorgqchk2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_gaorgsdebt") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gaorgqchk3.ncs b/nwnds_module/sc_gaorgqchk3.ncs new file mode 100644 index 000000000..588d05175 Binary files /dev/null and b/nwnds_module/sc_gaorgqchk3.ncs differ diff --git a/nwnds_module/sc_gaorgqchk3.nss b/nwnds_module/sc_gaorgqchk3.nss new file mode 100644 index 000000000..028aee547 --- /dev/null +++ b/nwnds_module/sc_gaorgqchk3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_gaorgsdebt") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gerrofqcheck1.ncs b/nwnds_module/sc_gerrofqcheck1.ncs new file mode 100644 index 000000000..01423c721 Binary files /dev/null and b/nwnds_module/sc_gerrofqcheck1.ncs differ diff --git a/nwnds_module/sc_gerrofqcheck1.nss b/nwnds_module/sc_gerrofqcheck1.nss new file mode 100644 index 000000000..ae13d693b --- /dev/null +++ b/nwnds_module/sc_gerrofqcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_banditleader") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gerrofqcheck2.ncs b/nwnds_module/sc_gerrofqcheck2.ncs new file mode 100644 index 000000000..34a3655a0 Binary files /dev/null and b/nwnds_module/sc_gerrofqcheck2.ncs differ diff --git a/nwnds_module/sc_gerrofqcheck2.nss b/nwnds_module/sc_gerrofqcheck2.nss new file mode 100644 index 000000000..504d0038c --- /dev/null +++ b/nwnds_module/sc_gerrofqcheck2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_banditleader") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gerrofqcheck3.ncs b/nwnds_module/sc_gerrofqcheck3.ncs new file mode 100644 index 000000000..36a11ef2d Binary files /dev/null and b/nwnds_module/sc_gerrofqcheck3.ncs differ diff --git a/nwnds_module/sc_gerrofqcheck3.nss b/nwnds_module/sc_gerrofqcheck3.nss new file mode 100644 index 000000000..cc5dce1eb --- /dev/null +++ b/nwnds_module/sc_gerrofqcheck3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_banditleader") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_gerrofqset1.ncs b/nwnds_module/sc_gerrofqset1.ncs new file mode 100644 index 000000000..583b3dbf0 Binary files /dev/null and b/nwnds_module/sc_gerrofqset1.ncs differ diff --git a/nwnds_module/sc_gerrofqset1.nss b/nwnds_module/sc_gerrofqset1.nss new file mode 100644 index 000000000..d0a109889 --- /dev/null +++ b/nwnds_module/sc_gerrofqset1.nss @@ -0,0 +1,4 @@ +void main() +{ +SetLocalInt(GetPCSpeaker(), "Gerrof", 1); +} diff --git a/nwnds_module/sc_gerrofspokc1.ncs b/nwnds_module/sc_gerrofspokc1.ncs new file mode 100644 index 000000000..a5c118b1c Binary files /dev/null and b/nwnds_module/sc_gerrofspokc1.ncs differ diff --git a/nwnds_module/sc_gerrofspokc1.nss b/nwnds_module/sc_gerrofspokc1.nss new file mode 100644 index 000000000..08779354a --- /dev/null +++ b/nwnds_module/sc_gerrofspokc1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_gerrofspokc1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 1:27:00 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGerrofSpokenTo") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_givexp_pick.ncs b/nwnds_module/sc_givexp_pick.ncs new file mode 100644 index 000000000..6a2bde859 Binary files /dev/null and b/nwnds_module/sc_givexp_pick.ncs differ diff --git a/nwnds_module/sc_givexp_pick.nss b/nwnds_module/sc_givexp_pick.nss new file mode 100644 index 000000000..d00581441 --- /dev/null +++ b/nwnds_module/sc_givexp_pick.nss @@ -0,0 +1,87 @@ +//sc_givexp_pick: Give XP on Pick Lock by KidCharlemagne 9/15/02 + +//Script gives experience points to a PC who picks a lock. +//Place this script in the OnUnLock Event of the door, chest, etc. +//They must not have key in inventory for it to work. + +//Note: Although I arrived at this idea independently, I later +//found a similar script on NWN Vault to give xp when a trap +//is disarmed. This script was written by Velmar. I give credit +//to a like minded individual. :) + +//VARIABLES: +// +//nExp = XP to be given +//oPC = PC who unlocked object +//oItem = variable to check through oPC's inventory +//sKey = string of key required to unlock object +//oKey = key object required to unlock object +//nDC = DC to unlock object +//nAlreadyPicked = local integer on calling object to prevent PC +// from locking object and picking to gain xp +// repeatedly + +void main() +{ + +//VARIABLE DECLARATIONS---------------------------- + + int nExp = 0; + object oPC = GetLastUnlocked(); + object oItem = GetFirstItemInInventory(oPC); + string sKey = GetTrapKeyTag(OBJECT_SELF); + object oKey = GetObjectByTag(sKey); + int nDC = GetLockUnlockDC(OBJECT_SELF); + int nKeyAssociated = TRUE; + int nAlreadyUnlocked = FALSE; + +//if object's lock has already been unlocked before, don't give xp + + nAlreadyUnlocked = GetLocalInt(OBJECT_SELF,"AlreadyUnlocked"); + + if (nAlreadyUnlocked == TRUE) + { + return; + } + +//Regardless of whether lock was just picked or key was used, +//localint "AlreadyUnlocked" will be set to indicate unlocking. + + SetLocalInt(OBJECT_SELF,"AlreadyUnlocked",TRUE); + +//if oKey is OBJECT_INVALID then no key is associated with object + + if (oKey == OBJECT_INVALID) + { + nKeyAssociated = FALSE; + } + +//If a key is associated with the door, check oPC's inventory for the key +//If oPC has key, return from script + + while (oItem != OBJECT_INVALID && nKeyAssociated == TRUE) + { + if (oItem == oKey) + { + return; + } + oItem = GetNextItemInInventory(oPC); + } +//The amount of experience given will depend on DC of the lock. +//This section is adjustable to suit level of XP required. + + if (nDC <= 18) + { + nExp = 50; + } + if (18 < nDC <= 30) + { + nExp = 100; + } + if (nDC > 30) + { + nExp = 200; + } + + GiveXPToCreature(oPC,nExp); +} diff --git a/nwnds_module/sc_grignardeath.ncs b/nwnds_module/sc_grignardeath.ncs new file mode 100644 index 000000000..b8405911d Binary files /dev/null and b/nwnds_module/sc_grignardeath.ncs differ diff --git a/nwnds_module/sc_grignardeath.nss b/nwnds_module/sc_grignardeath.nss new file mode 100644 index 000000000..289b54d05 --- /dev/null +++ b/nwnds_module/sc_grignardeath.nss @@ -0,0 +1,224 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ + +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +SpeakString("Curse you! They left me to die! They should starve!", TALKVOLUME_TALK); +CreateItemOnObject("storeroomkey", oPC); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); + +} + + + } + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/sc_grignarperc.ncs b/nwnds_module/sc_grignarperc.ncs new file mode 100644 index 000000000..4ef6c72fa Binary files /dev/null and b/nwnds_module/sc_grignarperc.ncs differ diff --git a/nwnds_module/sc_grignarperc.nss b/nwnds_module/sc_grignarperc.nss new file mode 100644 index 000000000..a313bc694 --- /dev/null +++ b/nwnds_module/sc_grignarperc.nss @@ -0,0 +1,135 @@ +//::////////////////////////////////////////////////// +//:: NW_C2_DEFAULT2 +/* + Default OnPerception event handler for NPCs. + + Handles behavior when perceiving a creature for the + first time. + */ +//::////////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + { + +object oPC = GetLastPerceived(); + +if (!GetIsPC(oPC)) return; + +if (!GetLastPerceptionSeen()) return; +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYjt_takeout"); + +if (!(nInt < 2)) + return; + +ActionSpeakString("You! I can smell Belet and his miner filth on you! I shall feast on your bones and they shall starve!"); + +} +// * if not runnning normal or better Ai then exit for performance reasons + // * if not runnning normal or better Ai then exit for performance reasons + if (GetAILevel() == AI_LEVEL_VERY_LOW) return; + + object oPercep = GetLastPerceived(); + int bSeen = GetLastPerceptionSeen(); + + // This will cause the NPC to speak their one-liner + // conversation on perception even if they are already + // in combat. + if(GetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION) + && GetIsPC(oPercep) + && bSeen) + { + SpeakOneLinerConversation(); + } + + // March 5 2003 Brent + // Had to add this section back in, since modifications were not taking this specific + // example into account -- it made invisibility basically useless. + //If the last perception event was hearing based or if someone vanished then go to search mode + if ((GetLastPerceptionVanished()) && GetIsEnemy(oPercep)) + { + //object oGone = GetLastPerceived(); + if((GetAttemptedAttackTarget() == oPercep || + GetAttemptedSpellTarget() == oPercep || + GetAttackTarget() == oPercep) && GetArea(oPercep) != GetArea(OBJECT_SELF)) + { + //SpeakString("dude...like disappeared."); + ClearAllActions(); + DetermineCombatRound(); + } + } + + // This section has been heavily revised while keeping the + // pre-existing behavior: + // - If we're in combat, keep fighting. + // - If not and we've perceived an enemy, start to fight. + // Even if the perception event was a 'vanish', that's + // still what we do anyway, since that will keep us + // fighting any visible targets. + // - If we're not in combat and haven't perceived an enemy, + // see if the perception target is a PC and if we should + // speak our attention-getting one-liner. + if (GetIsFighting(OBJECT_SELF)) { + // don't do anything else, we're busy + //MyPrintString("GetIsFighting: TRUE"); + + } + // * BK FEB 2003 Only fight if you can see them. DO NOT RELY ON HEARING FOR ENEMY DETECTION + else if (GetIsEnemy(oPercep) && bSeen) { + //MyPrintString("GetIsEnemy: TRUE"); + // We spotted an enemy and we're not already fighting + if(!GetHasEffect(EFFECT_TYPE_SLEEP)) { + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + //MyPrintString("DetermineSpecialBehavior"); + DetermineSpecialBehavior(); + } else { + //MyPrintString("DetermineCombatRound"); + SetFacingPoint(GetPosition(oPercep)); + SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK); + DetermineCombatRound(); + } + } + } else { + if (bSeen) { + //MyPrintString("GetLastPerceptionSeen: TRUE"); + if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL)) { + DetermineSpecialBehavior(); + } else if (GetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION) + && GetIsPC(oPercep)) + { + // The NPC will speak their one-liner conversation + // This should probably be: + // SpeakOneLinerConversation(oPercep); + // instead, but leaving it as is for now. + //ActionStartConversation(OBJECT_SELF); + } + } + + // activate ambient animations or walk waypoints if appropriate + if (!IsInConversation(OBJECT_SELF)) { + if (GetIsPostOrWalking()) { + WalkWayPoints(); + } else if (GetIsPC(oPercep) && + (GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) + || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN) + || GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) + || GetIsEncounterCreature())) + { + SetAnimationCondition(NW_ANIM_FLAG_IS_ACTIVE); + } + } + } + + // Send the user-defined event if appropriate + if(GetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT) && bSeen) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_PERCEIVE)); + } +} + + + + diff --git a/nwnds_module/sc_grik01.ncs b/nwnds_module/sc_grik01.ncs new file mode 100644 index 000000000..61b4fe7fe Binary files /dev/null and b/nwnds_module/sc_grik01.ncs differ diff --git a/nwnds_module/sc_grik01.nss b/nwnds_module/sc_grik01.nss new file mode 100644 index 000000000..4467299a6 --- /dev/null +++ b/nwnds_module/sc_grik01.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_grik01 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:13:47 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGrikQuest") == 0)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_grik03.ncs b/nwnds_module/sc_grik03.ncs new file mode 100644 index 000000000..e074c06ad Binary files /dev/null and b/nwnds_module/sc_grik03.ncs differ diff --git a/nwnds_module/sc_grik03.nss b/nwnds_module/sc_grik03.nss new file mode 100644 index 000000000..c212211fb --- /dev/null +++ b/nwnds_module/sc_grik03.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_grik03 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/29/02 7:22:43 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "qst_arrowcrate")) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nGrikQuest") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hasbluehelm.ncs b/nwnds_module/sc_hasbluehelm.ncs new file mode 100644 index 000000000..dd3328a5d Binary files /dev/null and b/nwnds_module/sc_hasbluehelm.ncs differ diff --git a/nwnds_module/sc_hasbluehelm.nss b/nwnds_module/sc_hasbluehelm.nss new file mode 100644 index 000000000..d7d5b3cc0 --- /dev/null +++ b/nwnds_module/sc_hasbluehelm.nss @@ -0,0 +1,11 @@ +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "helmurik"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} diff --git a/nwnds_module/sc_hasjustl.ncs b/nwnds_module/sc_hasjustl.ncs new file mode 100644 index 000000000..6085138d0 Binary files /dev/null and b/nwnds_module/sc_hasjustl.ncs differ diff --git a/nwnds_module/sc_hasjustl.nss b/nwnds_module/sc_hasjustl.nss new file mode 100644 index 000000000..6f41c507d --- /dev/null +++ b/nwnds_module/sc_hasjustl.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p001") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hasjustl2.ncs b/nwnds_module/sc_hasjustl2.ncs new file mode 100644 index 000000000..c4a9ad50f Binary files /dev/null and b/nwnds_module/sc_hasjustl2.ncs differ diff --git a/nwnds_module/sc_hasjustl2.nss b/nwnds_module/sc_hasjustl2.nss new file mode 100644 index 000000000..64106b45b --- /dev/null +++ b/nwnds_module/sc_hasjustl2.nss @@ -0,0 +1,8 @@ +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_ITNCK_JUSTL") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/sc_hasleash.ncs b/nwnds_module/sc_hasleash.ncs new file mode 100644 index 000000000..819d39c2a Binary files /dev/null and b/nwnds_module/sc_hasleash.ncs differ diff --git a/nwnds_module/sc_hasleash.nss b/nwnds_module/sc_hasleash.nss new file mode 100644 index 000000000..9e6bc92d8 --- /dev/null +++ b/nwnds_module/sc_hasleash.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_hasleash +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:38:54 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "KankLeash")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_haslongbow.ncs b/nwnds_module/sc_haslongbow.ncs new file mode 100644 index 000000000..e6871d8e6 Binary files /dev/null and b/nwnds_module/sc_haslongbow.ncs differ diff --git a/nwnds_module/sc_haslongbow.nss b/nwnds_module/sc_haslongbow.nss new file mode 100644 index 000000000..4989ee356 --- /dev/null +++ b/nwnds_module/sc_haslongbow.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_haslongbow +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/1/02 2:42:07 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "NW_WBWLN001"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +return FALSE; + +} diff --git a/nwnds_module/sc_hasredear2.ncs b/nwnds_module/sc_hasredear2.ncs new file mode 100644 index 000000000..5d3ecc606 Binary files /dev/null and b/nwnds_module/sc_hasredear2.ncs differ diff --git a/nwnds_module/sc_hasredear2.nss b/nwnds_module/sc_hasredear2.nss new file mode 100644 index 000000000..96ed863c4 --- /dev/null +++ b/nwnds_module/sc_hasredear2.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "di_RedEar") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/sc_hasredhelm.ncs b/nwnds_module/sc_hasredhelm.ncs new file mode 100644 index 000000000..9231efa94 Binary files /dev/null and b/nwnds_module/sc_hasredhelm.ncs differ diff --git a/nwnds_module/sc_hasredhelm.nss b/nwnds_module/sc_hasredhelm.nss new file mode 100644 index 000000000..ab8d66982 --- /dev/null +++ b/nwnds_module/sc_hasredhelm.nss @@ -0,0 +1,11 @@ +#include "nw_i0_tool" + +int StartingConditional() +{ +object oItemToTake; +oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "helmva"); +if(GetIsObjectValid(oItemToTake) != 0) + return TRUE; +// else +return FALSE; +} diff --git a/nwnds_module/sc_hasspidersack.ncs b/nwnds_module/sc_hasspidersack.ncs new file mode 100644 index 000000000..7b0579573 Binary files /dev/null and b/nwnds_module/sc_hasspidersack.ncs differ diff --git a/nwnds_module/sc_hasspidersack.nss b/nwnds_module/sc_hasspidersack.nss new file mode 100644 index 000000000..9988c7a4e --- /dev/null +++ b/nwnds_module/sc_hasspidersack.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_hasspidersack +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 03 2012 +//::////////////////////////////////////////////// + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "CRFT_SPIDERSAC") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/sc_hendelqcheck1.ncs b/nwnds_module/sc_hendelqcheck1.ncs new file mode 100644 index 000000000..3c3b5100e Binary files /dev/null and b/nwnds_module/sc_hendelqcheck1.ncs differ diff --git a/nwnds_module/sc_hendelqcheck1.nss b/nwnds_module/sc_hendelqcheck1.nss new file mode 100644 index 000000000..103395129 --- /dev/null +++ b/nwnds_module/sc_hendelqcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck2.ncs b/nwnds_module/sc_hendelqcheck2.ncs new file mode 100644 index 000000000..02a4e3c21 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck2.ncs differ diff --git a/nwnds_module/sc_hendelqcheck2.nss b/nwnds_module/sc_hendelqcheck2.nss new file mode 100644 index 000000000..f0f342479 --- /dev/null +++ b/nwnds_module/sc_hendelqcheck2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck3.ncs b/nwnds_module/sc_hendelqcheck3.ncs new file mode 100644 index 000000000..02ace7b77 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck3.ncs differ diff --git a/nwnds_module/sc_hendelqcheck3.nss b/nwnds_module/sc_hendelqcheck3.nss new file mode 100644 index 000000000..c66cded1f --- /dev/null +++ b/nwnds_module/sc_hendelqcheck3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck4.ncs b/nwnds_module/sc_hendelqcheck4.ncs new file mode 100644 index 000000000..074b865b5 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck4.ncs differ diff --git a/nwnds_module/sc_hendelqcheck4.nss b/nwnds_module/sc_hendelqcheck4.nss new file mode 100644 index 000000000..2ea2ee24a --- /dev/null +++ b/nwnds_module/sc_hendelqcheck4.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 4)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck5.ncs b/nwnds_module/sc_hendelqcheck5.ncs new file mode 100644 index 000000000..16289cf33 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck5.ncs differ diff --git a/nwnds_module/sc_hendelqcheck5.nss b/nwnds_module/sc_hendelqcheck5.nss new file mode 100644 index 000000000..c5ff8aacc --- /dev/null +++ b/nwnds_module/sc_hendelqcheck5.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 5)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck6.ncs b/nwnds_module/sc_hendelqcheck6.ncs new file mode 100644 index 000000000..1e1484ef3 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck6.ncs differ diff --git a/nwnds_module/sc_hendelqcheck6.nss b/nwnds_module/sc_hendelqcheck6.nss new file mode 100644 index 000000000..26348b60f --- /dev/null +++ b/nwnds_module/sc_hendelqcheck6.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 6)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqcheck7.ncs b/nwnds_module/sc_hendelqcheck7.ncs new file mode 100644 index 000000000..8192b26a3 Binary files /dev/null and b/nwnds_module/sc_hendelqcheck7.ncs differ diff --git a/nwnds_module/sc_hendelqcheck7.nss b/nwnds_module/sc_hendelqcheck7.nss new file mode 100644 index 000000000..e00a5816d --- /dev/null +++ b/nwnds_module/sc_hendelqcheck7.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_forbiddentomb") == 7)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_hendelqset1.ncs b/nwnds_module/sc_hendelqset1.ncs new file mode 100644 index 000000000..0425b6be5 Binary files /dev/null and b/nwnds_module/sc_hendelqset1.ncs differ diff --git a/nwnds_module/sc_hendelqset1.nss b/nwnds_module/sc_hendelqset1.nss new file mode 100644 index 000000000..160c85678 --- /dev/null +++ b/nwnds_module/sc_hendelqset1.nss @@ -0,0 +1,5 @@ +void main() +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 1); +} + diff --git a/nwnds_module/sc_hendelqset3.ncs b/nwnds_module/sc_hendelqset3.ncs new file mode 100644 index 000000000..b11434918 Binary files /dev/null and b/nwnds_module/sc_hendelqset3.ncs differ diff --git a/nwnds_module/sc_hendelqset3.nss b/nwnds_module/sc_hendelqset3.nss new file mode 100644 index 000000000..59cf12b83 --- /dev/null +++ b/nwnds_module/sc_hendelqset3.nss @@ -0,0 +1,5 @@ +void main() +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 3); +} + diff --git a/nwnds_module/sc_hendelqset5.ncs b/nwnds_module/sc_hendelqset5.ncs new file mode 100644 index 000000000..8da615013 Binary files /dev/null and b/nwnds_module/sc_hendelqset5.ncs differ diff --git a/nwnds_module/sc_hendelqset5.nss b/nwnds_module/sc_hendelqset5.nss new file mode 100644 index 000000000..e06c5d1db --- /dev/null +++ b/nwnds_module/sc_hendelqset5.nss @@ -0,0 +1,5 @@ +void main() +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 5); +} + diff --git a/nwnds_module/sc_hendelqset6.ncs b/nwnds_module/sc_hendelqset6.ncs new file mode 100644 index 000000000..b6722aadf Binary files /dev/null and b/nwnds_module/sc_hendelqset6.ncs differ diff --git a/nwnds_module/sc_hendelqset6.nss b/nwnds_module/sc_hendelqset6.nss new file mode 100644 index 000000000..1d115a39a --- /dev/null +++ b/nwnds_module/sc_hendelqset6.nss @@ -0,0 +1,5 @@ +void main() +{ +SetLocalInt(GetPCSpeaker(), "Hendel", 6); +} + diff --git a/nwnds_module/sc_ibod.ncs b/nwnds_module/sc_ibod.ncs new file mode 100644 index 000000000..19f8123da Binary files /dev/null and b/nwnds_module/sc_ibod.ncs differ diff --git a/nwnds_module/sc_ibod.nss b/nwnds_module/sc_ibod.nss new file mode 100644 index 000000000..205564608 --- /dev/null +++ b/nwnds_module/sc_ibod.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: FileName at_10gp100xp +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 4:54:01 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker some gold + GiveGoldToCreature(GetPCSpeaker(), 30); + + // Give the speaker some XP + GiveXPToCreature(GetPCSpeaker(), 250); + + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_OFFICIALDOCS"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + // Set the variables + SetLocalInt(GetPCSpeaker(), "nIbodQuest", 2); + +} diff --git a/nwnds_module/sc_ikaasqcheck1.ncs b/nwnds_module/sc_ikaasqcheck1.ncs new file mode 100644 index 000000000..5dd256f9b Binary files /dev/null and b/nwnds_module/sc_ikaasqcheck1.ncs differ diff --git a/nwnds_module/sc_ikaasqcheck1.nss b/nwnds_module/sc_ikaasqcheck1.nss new file mode 100644 index 000000000..a241205a7 --- /dev/null +++ b/nwnds_module/sc_ikaasqcheck1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "IkaasVision") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_ikaasqcheck2.ncs b/nwnds_module/sc_ikaasqcheck2.ncs new file mode 100644 index 000000000..ff42a924c Binary files /dev/null and b/nwnds_module/sc_ikaasqcheck2.ncs differ diff --git a/nwnds_module/sc_ikaasqcheck2.nss b/nwnds_module/sc_ikaasqcheck2.nss new file mode 100644 index 000000000..5db79c304 --- /dev/null +++ b/nwnds_module/sc_ikaasqcheck2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "IkaasVision") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_insightche12.ncs b/nwnds_module/sc_insightche12.ncs new file mode 100644 index 000000000..cb7fc5148 Binary files /dev/null and b/nwnds_module/sc_insightche12.ncs differ diff --git a/nwnds_module/sc_insightche12.nss b/nwnds_module/sc_insightche12.nss new file mode 100644 index 000000000..0e697a113 --- /dev/null +++ b/nwnds_module/sc_insightche12.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_insightche12 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/9/2002 9:49:28 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 12)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_insightcheck.ncs b/nwnds_module/sc_insightcheck.ncs new file mode 100644 index 000000000..cb7fc5148 Binary files /dev/null and b/nwnds_module/sc_insightcheck.ncs differ diff --git a/nwnds_module/sc_insightcheck.nss b/nwnds_module/sc_insightcheck.nss new file mode 100644 index 000000000..9dffd75f0 --- /dev/null +++ b/nwnds_module/sc_insightcheck.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_insightcheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/14/2002 12:50:08 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 12)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_intcheck13ab.ncs b/nwnds_module/sc_intcheck13ab.ncs new file mode 100644 index 000000000..bd3bbd821 Binary files /dev/null and b/nwnds_module/sc_intcheck13ab.ncs differ diff --git a/nwnds_module/sc_intcheck13ab.nss b/nwnds_module/sc_intcheck13ab.nss new file mode 100644 index 000000000..4600fb259 --- /dev/null +++ b/nwnds_module/sc_intcheck13ab.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_intcheck13ab +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:55:11 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 13)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_intelcheck14h.ncs b/nwnds_module/sc_intelcheck14h.ncs new file mode 100644 index 000000000..232090fb3 Binary files /dev/null and b/nwnds_module/sc_intelcheck14h.ncs differ diff --git a/nwnds_module/sc_intelcheck14h.nss b/nwnds_module/sc_intelcheck14h.nss new file mode 100644 index 000000000..14b9abf08 --- /dev/null +++ b/nwnds_module/sc_intelcheck14h.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_intelcheck14h +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/4/2002 1:08:58 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 14)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_isfirsttalk.ncs b/nwnds_module/sc_isfirsttalk.ncs new file mode 100644 index 000000000..cd811fcbd Binary files /dev/null and b/nwnds_module/sc_isfirsttalk.ncs differ diff --git a/nwnds_module/sc_isfirsttalk.nss b/nwnds_module/sc_isfirsttalk.nss new file mode 100644 index 000000000..6b3760013 --- /dev/null +++ b/nwnds_module/sc_isfirsttalk.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_isfirsttalk +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:23:36 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "DydrinaFirstTimeTalked") == 0)) + return FALSE; + if(GetHitDice(GetPCSpeaker()) > 12) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_isover15.ncs b/nwnds_module/sc_isover15.ncs new file mode 100644 index 000000000..d51e3dea4 Binary files /dev/null and b/nwnds_module/sc_isover15.ncs differ diff --git a/nwnds_module/sc_isover15.nss b/nwnds_module/sc_isover15.nss new file mode 100644 index 000000000..7369ecebd --- /dev/null +++ b/nwnds_module/sc_isover15.nss @@ -0,0 +1,19 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_isover15 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/25/02 8:21:03 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ +object oPC = GetPCSpeaker(); +object oItemToTake = GetItemPossessedBy(oPC, "RedFactionHelm"); + + // Add the randomness + if((GetHitDice(oPC) <= 9) || (GetIsObjectValid(oItemToTake) != 0)) + return FALSE; + if (GetLocalInt(GetPCSpeaker(),"nDidROB")) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/sc_jacobstch1.ncs b/nwnds_module/sc_jacobstch1.ncs new file mode 100644 index 000000000..b11a76485 Binary files /dev/null and b/nwnds_module/sc_jacobstch1.ncs differ diff --git a/nwnds_module/sc_jacobstch1.nss b/nwnds_module/sc_jacobstch1.nss new file mode 100644 index 000000000..adb3a3e96 --- /dev/null +++ b/nwnds_module/sc_jacobstch1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_jacobstch1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 5:07:24 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nJacobStory") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_karlenqcheck1.ncs b/nwnds_module/sc_karlenqcheck1.ncs new file mode 100644 index 000000000..8e332c854 Binary files /dev/null and b/nwnds_module/sc_karlenqcheck1.ncs differ diff --git a/nwnds_module/sc_karlenqcheck1.nss b/nwnds_module/sc_karlenqcheck1.nss new file mode 100644 index 000000000..26794c12c --- /dev/null +++ b/nwnds_module/sc_karlenqcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_woodstew") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_karlenqcheck2.ncs b/nwnds_module/sc_karlenqcheck2.ncs new file mode 100644 index 000000000..637f7bac9 Binary files /dev/null and b/nwnds_module/sc_karlenqcheck2.ncs differ diff --git a/nwnds_module/sc_karlenqcheck2.nss b/nwnds_module/sc_karlenqcheck2.nss new file mode 100644 index 000000000..47e876887 --- /dev/null +++ b/nwnds_module/sc_karlenqcheck2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_woodstew") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_karlenqcheck3.ncs b/nwnds_module/sc_karlenqcheck3.ncs new file mode 100644 index 000000000..ea40ead46 Binary files /dev/null and b/nwnds_module/sc_karlenqcheck3.ncs differ diff --git a/nwnds_module/sc_karlenqcheck3.nss b/nwnds_module/sc_karlenqcheck3.nss new file mode 100644 index 000000000..368520b3d --- /dev/null +++ b/nwnds_module/sc_karlenqcheck3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_woodstew") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_lestonspokc1.ncs b/nwnds_module/sc_lestonspokc1.ncs new file mode 100644 index 000000000..8ef058b0d Binary files /dev/null and b/nwnds_module/sc_lestonspokc1.ncs differ diff --git a/nwnds_module/sc_lestonspokc1.nss b/nwnds_module/sc_lestonspokc1.nss new file mode 100644 index 000000000..9701ef14b --- /dev/null +++ b/nwnds_module/sc_lestonspokc1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_lestonspokc1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 1:29:48 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nLestonSpokenTo") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_liecheck.ncs b/nwnds_module/sc_liecheck.ncs new file mode 100644 index 000000000..62cf760e7 Binary files /dev/null and b/nwnds_module/sc_liecheck.ncs differ diff --git a/nwnds_module/sc_liecheck.nss b/nwnds_module/sc_liecheck.nss new file mode 100644 index 000000000..521f94ec0 --- /dev/null +++ b/nwnds_module/sc_liecheck.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_liecheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/14/2002 1:21:49 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_CHARISMA) > 11)) + return FALSE; + + // Perform skill checks + if(!(AutoDC(DC_MEDIUM, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_makecycbridg2.ncs b/nwnds_module/sc_makecycbridg2.ncs new file mode 100644 index 000000000..516b6a04d Binary files /dev/null and b/nwnds_module/sc_makecycbridg2.ncs differ diff --git a/nwnds_module/sc_makecycbridg2.nss b/nwnds_module/sc_makecycbridg2.nss new file mode 100644 index 000000000..9acd054fd --- /dev/null +++ b/nwnds_module/sc_makecycbridg2.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_makecycbridge +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 12:27:09 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_WISDOM) > 11)) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nKilledCyclops") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_makecycbridge.ncs b/nwnds_module/sc_makecycbridge.ncs new file mode 100644 index 000000000..29a420f62 Binary files /dev/null and b/nwnds_module/sc_makecycbridge.ncs differ diff --git a/nwnds_module/sc_makecycbridge.nss b/nwnds_module/sc_makecycbridge.nss new file mode 100644 index 000000000..3312da920 --- /dev/null +++ b/nwnds_module/sc_makecycbridge.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_makecycbridge +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 12:27:09 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_INTELLIGENCE) > 11)) + return FALSE; + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nKilledCyclops") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_minermoan1.ncs b/nwnds_module/sc_minermoan1.ncs new file mode 100644 index 000000000..da15ae3ce Binary files /dev/null and b/nwnds_module/sc_minermoan1.ncs differ diff --git a/nwnds_module/sc_minermoan1.nss b/nwnds_module/sc_minermoan1.nss new file mode 100644 index 000000000..9750eef33 --- /dev/null +++ b/nwnds_module/sc_minermoan1.nss @@ -0,0 +1,4 @@ +void main() +{ +ActionSpeakString("Oooo...why...why?"); +} diff --git a/nwnds_module/sc_minermoan2.ncs b/nwnds_module/sc_minermoan2.ncs new file mode 100644 index 000000000..564ad84f0 Binary files /dev/null and b/nwnds_module/sc_minermoan2.ncs differ diff --git a/nwnds_module/sc_minermoan2.nss b/nwnds_module/sc_minermoan2.nss new file mode 100644 index 000000000..bfb08e08f --- /dev/null +++ b/nwnds_module/sc_minermoan2.nss @@ -0,0 +1,4 @@ +void main() +{ +ActionSpeakString("H-hey, no...don't touch tha- OWWW!!!"); +} diff --git a/nwnds_module/sc_minermoan3.ncs b/nwnds_module/sc_minermoan3.ncs new file mode 100644 index 000000000..5c0a7ec14 Binary files /dev/null and b/nwnds_module/sc_minermoan3.ncs differ diff --git a/nwnds_module/sc_minermoan3.nss b/nwnds_module/sc_minermoan3.nss new file mode 100644 index 000000000..1cf99e06c --- /dev/null +++ b/nwnds_module/sc_minermoan3.nss @@ -0,0 +1,4 @@ +void main() +{ +ActionSpeakString("Please...h-help...me..."); +} diff --git a/nwnds_module/sc_mperscheck.ncs b/nwnds_module/sc_mperscheck.ncs new file mode 100644 index 000000000..aa440b3f5 Binary files /dev/null and b/nwnds_module/sc_mperscheck.ncs differ diff --git a/nwnds_module/sc_mperscheck.nss b/nwnds_module/sc_mperscheck.nss new file mode 100644 index 000000000..9014e5851 --- /dev/null +++ b/nwnds_module/sc_mperscheck.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_mperscheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/15/2002 11:15:32 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_MEDIUM, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_mpersuade.ncs b/nwnds_module/sc_mpersuade.ncs new file mode 100644 index 000000000..aa440b3f5 Binary files /dev/null and b/nwnds_module/sc_mpersuade.ncs differ diff --git a/nwnds_module/sc_mpersuade.nss b/nwnds_module/sc_mpersuade.nss new file mode 100644 index 000000000..c02bf44ee --- /dev/null +++ b/nwnds_module/sc_mpersuade.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_mpersuade +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/14/2002 1:09:30 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_MEDIUM, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_olinaqcheck1.ncs b/nwnds_module/sc_olinaqcheck1.ncs new file mode 100644 index 000000000..a261aefb7 Binary files /dev/null and b/nwnds_module/sc_olinaqcheck1.ncs differ diff --git a/nwnds_module/sc_olinaqcheck1.nss b/nwnds_module/sc_olinaqcheck1.nss new file mode 100644 index 000000000..4c083ccf9 --- /dev/null +++ b/nwnds_module/sc_olinaqcheck1.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_olinasass") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_olinaqcheck2.ncs b/nwnds_module/sc_olinaqcheck2.ncs new file mode 100644 index 000000000..02055502d Binary files /dev/null and b/nwnds_module/sc_olinaqcheck2.ncs differ diff --git a/nwnds_module/sc_olinaqcheck2.nss b/nwnds_module/sc_olinaqcheck2.nss new file mode 100644 index 000000000..0f112ac25 --- /dev/null +++ b/nwnds_module/sc_olinaqcheck2.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_olinasass") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_olinaqcheck3.ncs b/nwnds_module/sc_olinaqcheck3.ncs new file mode 100644 index 000000000..cc80c558b Binary files /dev/null and b/nwnds_module/sc_olinaqcheck3.ncs differ diff --git a/nwnds_module/sc_olinaqcheck3.nss b/nwnds_module/sc_olinaqcheck3.nss new file mode 100644 index 000000000..2de9dd8c3 --- /dev/null +++ b/nwnds_module/sc_olinaqcheck3.nss @@ -0,0 +1,9 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_olinasass") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_perscheckeasy.ncs b/nwnds_module/sc_perscheckeasy.ncs new file mode 100644 index 000000000..d23f50146 Binary files /dev/null and b/nwnds_module/sc_perscheckeasy.ncs differ diff --git a/nwnds_module/sc_perscheckeasy.nss b/nwnds_module/sc_perscheckeasy.nss new file mode 100644 index 000000000..1cf723cff --- /dev/null +++ b/nwnds_module/sc_perscheckeasy.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_perscheckeasy +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/20/2002 12:10:01 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_EASY, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_persuadeh.ncs b/nwnds_module/sc_persuadeh.ncs new file mode 100644 index 000000000..97c2a3e3f Binary files /dev/null and b/nwnds_module/sc_persuadeh.ncs differ diff --git a/nwnds_module/sc_persuadeh.nss b/nwnds_module/sc_persuadeh.nss new file mode 100644 index 000000000..392612ea2 --- /dev/null +++ b/nwnds_module/sc_persuadeh.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_persuadeh +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/2002 8:24:50 PM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Perform skill checks + if(!(AutoDC(DC_HARD, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_phobosdeath.ncs b/nwnds_module/sc_phobosdeath.ncs new file mode 100644 index 000000000..fe3d88c48 Binary files /dev/null and b/nwnds_module/sc_phobosdeath.ncs differ diff --git a/nwnds_module/sc_phobosdeath.nss b/nwnds_module/sc_phobosdeath.nss new file mode 100644 index 000000000..aaaccbce7 --- /dev/null +++ b/nwnds_module/sc_phobosdeath.nss @@ -0,0 +1,225 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ + +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +while (GetIsObjectValid(GetMaster(oPC))) + { + oPC=GetMaster(oPC); + } +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); +AddJournalQuestEntry ("spyretower", 2, oPC); + SpeakString("No! This cannot be!", TALKVOLUME_TALK); + +CreateItemOnObject("qst_earthrelic", oPC); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/sc_random1d10.ncs b/nwnds_module/sc_random1d10.ncs new file mode 100644 index 000000000..fe2a6609e Binary files /dev/null and b/nwnds_module/sc_random1d10.ncs differ diff --git a/nwnds_module/sc_random1d10.nss b/nwnds_module/sc_random1d10.nss new file mode 100644 index 000000000..bd8e2c146 --- /dev/null +++ b/nwnds_module/sc_random1d10.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_random1d10 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/9/2002 2:09:52 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the randomness + if(Random(10) >= 1) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_random1d20.ncs b/nwnds_module/sc_random1d20.ncs new file mode 100644 index 000000000..e8da9fb94 Binary files /dev/null and b/nwnds_module/sc_random1d20.ncs differ diff --git a/nwnds_module/sc_random1d20.nss b/nwnds_module/sc_random1d20.nss new file mode 100644 index 000000000..e78d6c2a5 --- /dev/null +++ b/nwnds_module/sc_random1d20.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_random1d20 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/9/2002 1:53:23 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the randomness + if(Random(20) >= 1) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_random1d30.ncs b/nwnds_module/sc_random1d30.ncs new file mode 100644 index 000000000..aeb384f12 Binary files /dev/null and b/nwnds_module/sc_random1d30.ncs differ diff --git a/nwnds_module/sc_random1d30.nss b/nwnds_module/sc_random1d30.nss new file mode 100644 index 000000000..486b5fceb --- /dev/null +++ b/nwnds_module/sc_random1d30.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_random1d30 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/9/2002 1:52:46 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the randomness + if(Random(30) >= 1) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_random1d5.ncs b/nwnds_module/sc_random1d5.ncs new file mode 100644 index 000000000..4de55679d Binary files /dev/null and b/nwnds_module/sc_random1d5.ncs differ diff --git a/nwnds_module/sc_random1d5.nss b/nwnds_module/sc_random1d5.nss new file mode 100644 index 000000000..6e5a9ecd6 --- /dev/null +++ b/nwnds_module/sc_random1d5.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_random1d5 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 10/12/2002 1:58:54 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the randomness + if(Random(5) >= 1) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_randomcoin.ncs b/nwnds_module/sc_randomcoin.ncs new file mode 100644 index 000000000..4de55679d Binary files /dev/null and b/nwnds_module/sc_randomcoin.ncs differ diff --git a/nwnds_module/sc_randomcoin.nss b/nwnds_module/sc_randomcoin.nss new file mode 100644 index 000000000..261f7cea0 --- /dev/null +++ b/nwnds_module/sc_randomcoin.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_randomcoin +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 2:57:34 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Add the randomness + if(Random(5) >= 1) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_salikdeath.ncs b/nwnds_module/sc_salikdeath.ncs new file mode 100644 index 000000000..dec48d388 Binary files /dev/null and b/nwnds_module/sc_salikdeath.ncs differ diff --git a/nwnds_module/sc_salikdeath.nss b/nwnds_module/sc_salikdeath.nss new file mode 100644 index 000000000..2d2e210c5 --- /dev/null +++ b/nwnds_module/sc_salikdeath.nss @@ -0,0 +1,223 @@ +/************************ [On Death] ******************************************* + Filename: j_ai_ondeath or nw_c2_default7 +************************* [On Death] ******************************************* + Speeded up no end, when compiling, with seperate Include. + Cleans up all un-droppable items, all ints and all local things when destroyed. + + Check down near the bottom for a good place to add XP or corpse lines ;-) +************************* [History] ******************************************** + 1.3 - Added in Turn of corpses toggle + - Added in appropriate space for XP awards, marked with ideas (effect death) +************************* [Workings] ******************************************* + You can edit this for experience, there is a seperate section for it. + + It will use DeathCheck to execute a cleanup-and-destroy script, that removes + any coprse, named "j_ai_destroyself". +************************* [Arguments] ****************************************** + Arguments: GetLastKiller. +************************* [On Death] ******************************************/ + +// We only require the constants/debug file. We have 1 function, not worth another include. +#include "j_inc_constants" + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths); +void ClearSlot(int iSlotID); +void PartyGold(object oPC); +void main() +{ + +// initialise local variables +int nKillFlag = GetLocalInt(GetLastKiller(), "KILL_TASK_FLAG"); +object oPC = GetLastKiller(); +string sTagSelf = GetTag(OBJECT_SELF); +string sTagTarget = GetLocalString(oPC, "KILL_TASK_TARGET"); +PartyGold(oPC); + if(GetIsPC(GetLastKiller()) && + GetLocalInt(GetLastKiller(),"NW_JOURNAL_ENTRY" + "jt_unearthed") == 1) + { + AddJournalQuestEntry ("jt_unearthed", 2, oPC); + } + SpeakString("N-no...this...wasn't supposed to...h-happen...", TALKVOLUME_TALK); +// check for correct kill task target and complete +if(sTagSelf == sTagTarget && nKillFlag == 1) { +SetLocalInt(oPC, "KILL_TASK_FLAG", 2); +AddJournalQuestEntry("kt_journal_01", 99, oPC); +} + + +} + +void ClearSlot(int iSlotID) +{ + object oItem = GetItemInSlot(iSlotID); + if(GetIsObjectValid(oItem)) + { + if(!GetDroppableFlag(oItem)) + DestroyObject(oItem); + } +} + +void PartyGold(object oPC) +{ +int nHD = GetHitDice(OBJECT_SELF); +int nGold = ((nHD - 3) * 4) + d20(); + + // This code shows how you can cycle through all the party members of the first PC +object oPartyMember = GetFirstFactionMember(oPC, TRUE); +int nMembers = 0; +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + // count party members + nMembers++; + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} +if (nMembers < 1) +nMembers = 1; +int nShare = (nGold / nMembers); + +oPartyMember = GetFirstFactionMember(oPC, TRUE); +while (GetIsObjectValid(oPartyMember) == TRUE) +{ + GiveGoldToCreature(oPartyMember, nShare); + oPartyMember = GetNextFactionMember(oPartyMember, TRUE); +} + // If we are set to, don't fire this script at all + if(GetAIInteger(I_AM_TOTALLY_DEAD)) return; + + // Pre-death-event + if(FireUserEvent(AI_FLAG_UDE_DEATH_PRE_EVENT, EVENT_DEATH_PRE_EVENT)) + // We may exit if it fires + if(ExitFromUDE(EVENT_DEATH_PRE_EVENT)) return; + + // Note: No AI on/off check here. + + // Who killed us? (alignment changing, debug, XP). + object oKiller = GetLastKiller(); + + // Stops if we just applied EffectDeath to ourselves. + if(GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) return; + + // Special: To stop giving out multiple amounts of XP, we use EffectDeath + // to change the killer, so the XP systems will NOT award MORE XP. + // - Even the default one suffers from this! + if(GetAIInteger(WE_HAVE_DIED_ONCE)) + { + if(!GetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH)) + { + // Don't apply effect death to self more then once per 2 seconds. + SetLocalTimer(AI_TIMER_DEATH_EFFECT_DEATH, f2); + // This should make the last killer us. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), OBJECT_SELF); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints()), OBJECT_SELF); + } + } + else if(oKiller != OBJECT_SELF) + { + // Set have died once, stops giving out mulitple amounts of XP. + SetAIInteger(WE_HAVE_DIED_ONCE, TRUE); + +/************************ [Experience] ***************************************** + THIS is the place for it, below this comment. To reward XP, you might want + to first apply EffectDeath to ourselves (uncomment the example lines) which + will remove the "You recieved 0 Experience" if you have normal XP at 0, as + the On Death event is before the reward, and therefore now our last killer + will be outselves. It will not cause any errors, oKiller is already set. + + Anything else, I leave to you. GetFirstFactionMember (and next), GiveXPToCreature, + GetXP, SetXP, GetChallengeRating all are really useful. + + Bug note: GetFirstFactionMember/Next with the PC parameter means either ONLY PC +************************* [Experience] ****************************************/ + // Do XP things (Use object "oKiller"). + + + +/************************ [Experience] ****************************************/ + } + + // Note: Here we do a simple way of checking how many times we have died. + // Nothing special. Debugging most useful aspect. + int iDeathCounterNew = GetAIInteger(AMOUNT_OF_DEATHS); + iDeathCounterNew++; + SetAIInteger(AMOUNT_OF_DEATHS, iDeathCounterNew); + + // Here is the last time (in game seconds) we died. It is used in the executed script + // to make sure we don't prematurly remove areselves. + + // We may want some sort of visual effect - like implosion or something, to fire. + int iDeathEffect = GetAIConstant(AI_DEATH_VISUAL_EFFECT); + + // Valid constants from 0 and up. Apply to our location (not to us, who will go!) + if(iDeathEffect >= i0) + { + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(iDeathEffect), GetLocation(OBJECT_SELF)); + } + // Default Commoner alignment changing. (If the commoner is not evil!) + if(GetLevelByClass(CLASS_TYPE_COMMONER) > i0 && + GetAlignmentGoodEvil(OBJECT_SELF) != ALIGNMENT_EVIL && + !GetSpawnInCondition(AI_FLAG_OTHER_NO_COMMONER_ALIGNMENT_CHANGE, AI_OTHER_MASTER)) + { + if(GetIsPC(oKiller)) + { + AdjustAlignment(oKiller, ALIGNMENT_EVIL, i5); + } + else + { + // If it is a summon, henchmen or familar of a PC, we adust the PC itself + // Clever, eh? + object oMaster = GetMaster(oKiller); + if(GetIsObjectValid(oMaster) && GetIsPC(oMaster)) + { + AdjustAlignment(oMaster, ALIGNMENT_EVIL, i5); + } + } + } + // Always shout when we are killed. Reactions - Morale penalty, and attack the killer. + AISpeakString(I_WAS_KILLED); + + // Speaks the set death speak, like "AGGGGGGGGGGGGGGGGGGG!! NOOOO!" for instance :-) + SpeakArrayString(AI_TALK_ON_DEATH); + + // First check - do we use "destroyable corpses" or not? (default, yes) + if(!GetSpawnInCondition(AI_FLAG_OTHER_TURN_OFF_CORPSES, AI_OTHER_MASTER)) + { + // We will actually dissapear after 30.0 seconds if not raised. + int iTime = GetAIInteger(AI_CORPSE_DESTROY_TIME); + if(iTime == i0) // Error checking + { + iTime = i30; + } + // 64: "[Death] Checking corpse status in " + IntToString(iTime) + " [Killer] " + GetName(oKiller) + " [Times Died Now] " + IntToString(iDeathCounterNew) + DebugActionSpeakByInt(64, oKiller, iTime, IntToString(iDeathCounterNew)); + // Delay check + DelayCommand(IntToFloat(iTime), DeathCheck(iDeathCounterNew)); + } + else + { +/************************ [Alternative Corpses] ******************************** + This is where you can add some alternative corpse code - EG looting + and so on, without disrupting the rest of the AI (as the corpses + are turned off). +************************* [Alternative Corpses] *******************************/ + // Add alternative corpse code here + + +/************************ [Alternative Corpses] *******************************/ + } + // Signal the death event. + FireUserEvent(AI_FLAG_UDE_DEATH_EVENT, EVENT_DEATH_EVENT); +} + +// We need a wrapper. If the amount of deaths, got in this, is not equal to iDeaths, +// we don't execute the script, else we do. :-P +void DeathCheck(int iDeaths) +{ + // Do the deaths imputted equal the amount we have suffered? + if(GetAIInteger(AMOUNT_OF_DEATHS) == iDeaths) + { + // - This now includes a check for Bioware's lootable functions and using them. + ExecuteScript(FILE_DEATH_CLEANUP, OBJECT_SELF); + } +} diff --git a/nwnds_module/sc_salikospaw.ncs b/nwnds_module/sc_salikospaw.ncs new file mode 100644 index 000000000..676ae4c57 Binary files /dev/null and b/nwnds_module/sc_salikospaw.ncs differ diff --git a/nwnds_module/sc_salikospaw.nss b/nwnds_module/sc_salikospaw.nss new file mode 100644 index 000000000..31b46516f --- /dev/null +++ b/nwnds_module/sc_salikospaw.nss @@ -0,0 +1,75 @@ +//:://///////////////////////////////////////////// +//:: Default: On Spawn In +//:: NW_C2_DEFAULT9 +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Determines the course of action to be taken + after having just been spawned in +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 25, 2001 +//::////////////////////////////////////////////// +#include "NW_O2_CONINCLUDE" +#include "NW_I0_GENERIC" + +void main() +{ +// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** + //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); + //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); + // This causes the creature to say a special greeting in their conversation file + // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired + // greeting in order to designate it. As the creature is actually saying this to + // himself, don't attach any player responses to the greeting. + + //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); + // This will set the listening pattern on the NPC to attack when allies call + //SetSpawnInCondition(NW_FLAG_STEALTH); + // If the NPC has stealth and they are a rogue go into stealth mode + //SetSpawnInCondition(NW_FLAG_SEARCH); + // If the NPC has Search go into Search Mode + //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); + // This will set the NPC to give a warning to non-enemies before attacking + + //SetSpawnInCondition(NW_FLAG_SLEEP); + //Creatures that spawn in during the night will be asleep. + //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); + //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); + //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); + //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); + //This will play Ambient Animations until the NPC sees an enemy or is cleared. + //NOTE that these animations will play automatically for Encounter Creatures. + + // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. + //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) + //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) + //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) + +// CUSTOM USER DEFINED EVENTS +/* + The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the + On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined + events user 1000 - 1010 +*/ + //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 + //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 + //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 + //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 + //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 + //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 + //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 + //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 + +// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** + SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. + WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) + // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them + // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after + // combat. + GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature +} + + diff --git a/nwnds_module/sc_seenwstew.ncs b/nwnds_module/sc_seenwstew.ncs new file mode 100644 index 000000000..40229354e Binary files /dev/null and b/nwnds_module/sc_seenwstew.ncs differ diff --git a/nwnds_module/sc_seenwstew.nss b/nwnds_module/sc_seenwstew.nss new file mode 100644 index 000000000..685494e01 --- /dev/null +++ b/nwnds_module/sc_seenwstew.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_seenwstew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 9:48:12 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nSeenWoodStew") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_spidmadcheck.ncs b/nwnds_module/sc_spidmadcheck.ncs new file mode 100644 index 000000000..9d67cc4b4 Binary files /dev/null and b/nwnds_module/sc_spidmadcheck.ncs differ diff --git a/nwnds_module/sc_spidmadcheck.nss b/nwnds_module/sc_spidmadcheck.nss new file mode 100644 index 000000000..0923063ee --- /dev/null +++ b/nwnds_module/sc_spidmadcheck.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_spidmadcheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/9/2002 11:52:25 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nSpiderMadness") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_startconver.ncs b/nwnds_module/sc_startconver.ncs new file mode 100644 index 000000000..cf0b3a0d8 Binary files /dev/null and b/nwnds_module/sc_startconver.ncs differ diff --git a/nwnds_module/sc_startconver.nss b/nwnds_module/sc_startconver.nss new file mode 100644 index 000000000..62b8c7d84 --- /dev/null +++ b/nwnds_module/sc_startconver.nss @@ -0,0 +1,5 @@ +void main() +{ +object oUser = GetLastUsedBy(); +AssignCommand(OBJECT_SELF, ActionStartConversation(oUser)); +} diff --git a/nwnds_module/sc_startconvern.ncs b/nwnds_module/sc_startconvern.ncs new file mode 100644 index 000000000..cf0b3a0d8 Binary files /dev/null and b/nwnds_module/sc_startconvern.ncs differ diff --git a/nwnds_module/sc_startconvern.nss b/nwnds_module/sc_startconvern.nss new file mode 100644 index 000000000..62b8c7d84 --- /dev/null +++ b/nwnds_module/sc_startconvern.nss @@ -0,0 +1,5 @@ +void main() +{ +object oUser = GetLastUsedBy(); +AssignCommand(OBJECT_SELF, ActionStartConversation(oUser)); +} diff --git a/nwnds_module/sc_thranefirst.ncs b/nwnds_module/sc_thranefirst.ncs new file mode 100644 index 000000000..b10bc3bc4 Binary files /dev/null and b/nwnds_module/sc_thranefirst.ncs differ diff --git a/nwnds_module/sc_thranefirst.nss b/nwnds_module/sc_thranefirst.nss new file mode 100644 index 000000000..60ea30761 --- /dev/null +++ b/nwnds_module/sc_thranefirst.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_isfirsttalk +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/27/02 11:23:36 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nFirstTimeTalked") == 0)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_threatencheck.ncs b/nwnds_module/sc_threatencheck.ncs new file mode 100644 index 000000000..9a0f55701 Binary files /dev/null and b/nwnds_module/sc_threatencheck.ncs differ diff --git a/nwnds_module/sc_threatencheck.nss b/nwnds_module/sc_threatencheck.nss new file mode 100644 index 000000000..528e4d461 --- /dev/null +++ b/nwnds_module/sc_threatencheck.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_threatencheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/14/2002 1:26:59 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_STRENGTH) > 13)) + return FALSE; + + // Perform skill checks + if(!(AutoDC(DC_MEDIUM, SKILL_PERSUADE, GetPCSpeaker()))) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_threatenmed.ncs b/nwnds_module/sc_threatenmed.ncs new file mode 100644 index 000000000..43dc95f10 Binary files /dev/null and b/nwnds_module/sc_threatenmed.ncs differ diff --git a/nwnds_module/sc_threatenmed.nss b/nwnds_module/sc_threatenmed.nss new file mode 100644 index 000000000..8011d1392 --- /dev/null +++ b/nwnds_module/sc_threatenmed.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_threatenmed +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/21/2002 11:38:12 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_STRENGTH) > 16)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_tookkeythenst.ncs b/nwnds_module/sc_tookkeythenst.ncs new file mode 100644 index 000000000..ca6354ba1 Binary files /dev/null and b/nwnds_module/sc_tookkeythenst.ncs differ diff --git a/nwnds_module/sc_tookkeythenst.nss b/nwnds_module/sc_tookkeythenst.nss new file mode 100644 index 000000000..b86a56bbe --- /dev/null +++ b/nwnds_module/sc_tookkeythenst.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_tookkeythenst +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/29/2002 6:43:50 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nTookCharKey") == 1)) + return FALSE; + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_thecircle") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_traabiqcheck1.ncs b/nwnds_module/sc_traabiqcheck1.ncs new file mode 100644 index 000000000..116313fa9 Binary files /dev/null and b/nwnds_module/sc_traabiqcheck1.ncs differ diff --git a/nwnds_module/sc_traabiqcheck1.nss b/nwnds_module/sc_traabiqcheck1.nss new file mode 100644 index 000000000..691a68324 --- /dev/null +++ b/nwnds_module/sc_traabiqcheck1.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_traabislotus") == 1)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_traabiqcheck2.ncs b/nwnds_module/sc_traabiqcheck2.ncs new file mode 100644 index 000000000..f07df22c8 Binary files /dev/null and b/nwnds_module/sc_traabiqcheck2.ncs differ diff --git a/nwnds_module/sc_traabiqcheck2.nss b/nwnds_module/sc_traabiqcheck2.nss new file mode 100644 index 000000000..8558616c2 --- /dev/null +++ b/nwnds_module/sc_traabiqcheck2.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_traabislotus") == 2)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_traabiqcheck3.ncs b/nwnds_module/sc_traabiqcheck3.ncs new file mode 100644 index 000000000..a9aacee77 Binary files /dev/null and b/nwnds_module/sc_traabiqcheck3.ncs differ diff --git a/nwnds_module/sc_traabiqcheck3.nss b/nwnds_module/sc_traabiqcheck3.nss new file mode 100644 index 000000000..baa65d0e7 --- /dev/null +++ b/nwnds_module/sc_traabiqcheck3.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_traabislotus") == 3)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_traabiqcheck4.ncs b/nwnds_module/sc_traabiqcheck4.ncs new file mode 100644 index 000000000..c2949da43 Binary files /dev/null and b/nwnds_module/sc_traabiqcheck4.ncs differ diff --git a/nwnds_module/sc_traabiqcheck4.nss b/nwnds_module/sc_traabiqcheck4.nss new file mode 100644 index 000000000..57ecb1ef9 --- /dev/null +++ b/nwnds_module/sc_traabiqcheck4.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "jt_traabislotus") == 4)) + return FALSE; + + return TRUE; +} + diff --git a/nwnds_module/sc_triedwstew.ncs b/nwnds_module/sc_triedwstew.ncs new file mode 100644 index 000000000..b7f55c6a8 Binary files /dev/null and b/nwnds_module/sc_triedwstew.ncs differ diff --git a/nwnds_module/sc_triedwstew.nss b/nwnds_module/sc_triedwstew.nss new file mode 100644 index 000000000..9add9567e --- /dev/null +++ b/nwnds_module/sc_triedwstew.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_triedwstew +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/22/2002 9:50:04 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "nTriedWoodStew") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_trigcoldyintk.ncs b/nwnds_module/sc_trigcoldyintk.ncs new file mode 100644 index 000000000..4097da09c Binary files /dev/null and b/nwnds_module/sc_trigcoldyintk.ncs differ diff --git a/nwnds_module/sc_trigcoldyintk.nss b/nwnds_module/sc_trigcoldyintk.nss new file mode 100644 index 000000000..fb2880d42 --- /dev/null +++ b/nwnds_module/sc_trigcoldyintk.nss @@ -0,0 +1,9 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_unearthed") == 1) + { + AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_coldyintakatt")); + } +} + diff --git a/nwnds_module/sc_trigpirateass.ncs b/nwnds_module/sc_trigpirateass.ncs new file mode 100644 index 000000000..e19af985c Binary files /dev/null and b/nwnds_module/sc_trigpirateass.ncs differ diff --git a/nwnds_module/sc_trigpirateass.nss b/nwnds_module/sc_trigpirateass.nss new file mode 100644 index 000000000..7e763c109 --- /dev/null +++ b/nwnds_module/sc_trigpirateass.nss @@ -0,0 +1,8 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_olinasass") == 1) + { + AssignCommand(GetNearestObjectByTag("PIRATEASSASSIN"),SpeakOneLinerConversation()); + } +} diff --git a/nwnds_module/sc_trigrevspeech.ncs b/nwnds_module/sc_trigrevspeech.ncs new file mode 100644 index 000000000..4ce94e418 Binary files /dev/null and b/nwnds_module/sc_trigrevspeech.ncs differ diff --git a/nwnds_module/sc_trigrevspeech.nss b/nwnds_module/sc_trigrevspeech.nss new file mode 100644 index 000000000..2bd2d93d8 --- /dev/null +++ b/nwnds_module/sc_trigrevspeech.nss @@ -0,0 +1,9 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "rottedparchment") == 2) + { + AssignCommand(GetEnteringObject(),SpeakOneLinerConversation("cv_revspeech2")); + } +} + diff --git a/nwnds_module/sc_trigrumaattk.ncs b/nwnds_module/sc_trigrumaattk.ncs new file mode 100644 index 000000000..f3ca11233 Binary files /dev/null and b/nwnds_module/sc_trigrumaattk.ncs differ diff --git a/nwnds_module/sc_trigrumaattk.nss b/nwnds_module/sc_trigrumaattk.nss new file mode 100644 index 000000000..0a80ba21a --- /dev/null +++ b/nwnds_module/sc_trigrumaattk.nss @@ -0,0 +1,8 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_bloodletter") == 2) + { + AssignCommand(GetNearestObjectByTag("AR_RUMAGON"),SpeakOneLinerConversation()); + } +} diff --git a/nwnds_module/sc_trigsaltalk.ncs b/nwnds_module/sc_trigsaltalk.ncs new file mode 100644 index 000000000..94147578c Binary files /dev/null and b/nwnds_module/sc_trigsaltalk.ncs differ diff --git a/nwnds_module/sc_trigsaltalk.nss b/nwnds_module/sc_trigsaltalk.nss new file mode 100644 index 000000000..b7ff38f5e --- /dev/null +++ b/nwnds_module/sc_trigsaltalk.nss @@ -0,0 +1,8 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "jt_unearthed") == 1) + { + AssignCommand(GetNearestObjectByTag("SALIK001"),SpeakOneLinerConversation()); + } +} diff --git a/nwnds_module/sc_trigsligcvat.ncs b/nwnds_module/sc_trigsligcvat.ncs new file mode 100644 index 000000000..e7b3c71ae Binary files /dev/null and b/nwnds_module/sc_trigsligcvat.ncs differ diff --git a/nwnds_module/sc_trigsligcvat.nss b/nwnds_module/sc_trigsligcvat.nss new file mode 100644 index 000000000..5f08a37fa --- /dev/null +++ b/nwnds_module/sc_trigsligcvat.nss @@ -0,0 +1,8 @@ +void main() +{ + if(GetIsPC(GetEnteringObject()) && + GetLocalInt(GetEnteringObject(),"NW_JOURNAL_ENTRY" + "rottedparchment") == 1) + { + AssignCommand(GetNearestObjectByTag("SLIG001"),SpeakOneLinerConversation()); + } +} diff --git a/nwnds_module/sc_va1check.ncs b/nwnds_module/sc_va1check.ncs new file mode 100644 index 000000000..755ca56d0 Binary files /dev/null and b/nwnds_module/sc_va1check.ncs differ diff --git a/nwnds_module/sc_va1check.nss b/nwnds_module/sc_va1check.nss new file mode 100644 index 000000000..988613a73 --- /dev/null +++ b/nwnds_module/sc_va1check.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_va1check +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/30/2002 12:41:17 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "VA") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_venomchecksac.ncs b/nwnds_module/sc_venomchecksac.ncs new file mode 100644 index 000000000..e34d1e928 Binary files /dev/null and b/nwnds_module/sc_venomchecksac.ncs differ diff --git a/nwnds_module/sc_venomchecksac.nss b/nwnds_module/sc_venomchecksac.nss new file mode 100644 index 000000000..8ef92ed19 --- /dev/null +++ b/nwnds_module/sc_venomchecksac.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_venomchecksac +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/11/2002 12:38:20 AM +//::////////////////////////////////////////////// +#include "nw_i0_tool" + +int StartingConditional() +{ + + // Make sure the PC speaker has these items in their inventory + if(!CheckPartyForItem(GetPCSpeaker(), "QueensPoisonSack")) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/sc_wootcheck.ncs b/nwnds_module/sc_wootcheck.ncs new file mode 100644 index 000000000..1df306e97 Binary files /dev/null and b/nwnds_module/sc_wootcheck.ncs differ diff --git a/nwnds_module/sc_wootcheck.nss b/nwnds_module/sc_wootcheck.nss new file mode 100644 index 000000000..9bafd978a --- /dev/null +++ b/nwnds_module/sc_wootcheck.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_wootcheck +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/21/2002 1:03:49 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + if(!(GetAbilityScore(GetPCSpeaker(), ABILITY_WISDOM) > 14)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/scdrummerhide.uti b/nwnds_module/scdrummerhide.uti new file mode 100644 index 000000000..36f7ea5a9 Binary files /dev/null and b/nwnds_module/scdrummerhide.uti differ diff --git a/nwnds_module/scor_plat_north.are b/nwnds_module/scor_plat_north.are new file mode 100644 index 000000000..abde4fd31 Binary files /dev/null and b/nwnds_module/scor_plat_north.are differ diff --git a/nwnds_module/scor_plat_north.gic b/nwnds_module/scor_plat_north.gic new file mode 100644 index 000000000..efe7e9d06 Binary files /dev/null and b/nwnds_module/scor_plat_north.gic differ diff --git a/nwnds_module/scor_plat_north.git b/nwnds_module/scor_plat_north.git new file mode 100644 index 000000000..518fbb8cd Binary files /dev/null and b/nwnds_module/scor_plat_north.git differ diff --git a/nwnds_module/scor_plat_south.are b/nwnds_module/scor_plat_south.are new file mode 100644 index 000000000..ee9f5d774 Binary files /dev/null and b/nwnds_module/scor_plat_south.are differ diff --git a/nwnds_module/scor_plat_south.gic b/nwnds_module/scor_plat_south.gic new file mode 100644 index 000000000..a3ebb2a77 Binary files /dev/null and b/nwnds_module/scor_plat_south.gic differ diff --git a/nwnds_module/scor_plat_south.git b/nwnds_module/scor_plat_south.git new file mode 100644 index 000000000..9a70262c2 Binary files /dev/null and b/nwnds_module/scor_plat_south.git differ diff --git a/nwnds_module/scor_plat_tower.are b/nwnds_module/scor_plat_tower.are new file mode 100644 index 000000000..d5cb808fd Binary files /dev/null and b/nwnds_module/scor_plat_tower.are differ diff --git a/nwnds_module/scor_plat_tower.gic b/nwnds_module/scor_plat_tower.gic new file mode 100644 index 000000000..554bcf31a Binary files /dev/null and b/nwnds_module/scor_plat_tower.gic differ diff --git a/nwnds_module/scor_plat_tower.git b/nwnds_module/scor_plat_tower.git new file mode 100644 index 000000000..64c45084b Binary files /dev/null and b/nwnds_module/scor_plat_tower.git differ diff --git a/nwnds_module/scorchdrummer001.utc b/nwnds_module/scorchdrummer001.utc new file mode 100644 index 000000000..d8382dbba Binary files /dev/null and b/nwnds_module/scorchdrummer001.utc differ diff --git a/nwnds_module/scorpion_grab01.ncs b/nwnds_module/scorpion_grab01.ncs new file mode 100644 index 000000000..cc69b1621 Binary files /dev/null and b/nwnds_module/scorpion_grab01.ncs differ diff --git a/nwnds_module/scorpion_grab01.nss b/nwnds_module/scorpion_grab01.nss new file mode 100644 index 000000000..09ea73ef5 --- /dev/null +++ b/nwnds_module/scorpion_grab01.nss @@ -0,0 +1,70 @@ +//:: Scorpion Grab 01 - Item Unique OnHit Script +//:: +//:: This attack is for the Large Monsterous Scorpion. +//:: +//:: + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(1)+nCreSTR, DAMAGE_TYPE_SLASHING); + int nSTR_Target; + int nSTR_Creature; + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal claw damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/scorpion_grab01.uti b/nwnds_module/scorpion_grab01.uti new file mode 100644 index 000000000..906269ef9 Binary files /dev/null and b/nwnds_module/scorpion_grab01.uti differ diff --git a/nwnds_module/scorpion_grab02.ncs b/nwnds_module/scorpion_grab02.ncs new file mode 100644 index 000000000..a899ef5b8 Binary files /dev/null and b/nwnds_module/scorpion_grab02.ncs differ diff --git a/nwnds_module/scorpion_grab02.nss b/nwnds_module/scorpion_grab02.nss new file mode 100644 index 000000000..22befc4a4 --- /dev/null +++ b/nwnds_module/scorpion_grab02.nss @@ -0,0 +1,69 @@ +//:: Scorpion Grab 02 - Item Unique OnHit Script +//:: +//:: This attack is for the Huge Monsterous Scorpion. +//:: +//:: + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d8(1)+nCreSTR, DAMAGE_TYPE_SLASHING); + int nSTR_Target; + int nSTR_Creature; + +// Colossal creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal claw damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/scorpion_grab02.uti b/nwnds_module/scorpion_grab02.uti new file mode 100644 index 000000000..f5ce22896 Binary files /dev/null and b/nwnds_module/scorpion_grab02.uti differ diff --git a/nwnds_module/scorpion_grab03.ncs b/nwnds_module/scorpion_grab03.ncs new file mode 100644 index 000000000..6e747a023 Binary files /dev/null and b/nwnds_module/scorpion_grab03.ncs differ diff --git a/nwnds_module/scorpion_grab03.nss b/nwnds_module/scorpion_grab03.nss new file mode 100644 index 000000000..60f286ab6 --- /dev/null +++ b/nwnds_module/scorpion_grab03.nss @@ -0,0 +1,64 @@ +//:: Scorpion Grab 03 - Item Unique OnHit Script +//:: +//:: This attack is for the Gargantuan Monsterous Scorpion. +//:: +//:: + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + effect eGrabDmg = EffectDamage(d6(2)+nCreSTR, DAMAGE_TYPE_SLASHING); + int nSTR_Target; + int nSTR_Creature; + +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal claw damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eGrabDmg, oTarget); +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the constriction attack.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// Shambling Mound TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The creature tries to constrict you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The creature is constricting you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the Shambling +// Mounds entangle attempt failed. Otherwise it simply gets entangled as +// intended. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectEntangle(), oTarget, 9.0f); + } + diff --git a/nwnds_module/scorpion_grab03.uti b/nwnds_module/scorpion_grab03.uti new file mode 100644 index 000000000..8c214fa0e Binary files /dev/null and b/nwnds_module/scorpion_grab03.uti differ diff --git a/nwnds_module/screamerbeetle.uti b/nwnds_module/screamerbeetle.uti new file mode 100644 index 000000000..ada3b2e51 Binary files /dev/null and b/nwnds_module/screamerbeetle.uti differ diff --git a/nwnds_module/scrollshop.dlg b/nwnds_module/scrollshop.dlg new file mode 100644 index 000000000..493c084e6 Binary files /dev/null and b/nwnds_module/scrollshop.dlg differ diff --git a/nwnds_module/scrying_pool.utp b/nwnds_module/scrying_pool.utp new file mode 100644 index 000000000..1812b357a Binary files /dev/null and b/nwnds_module/scrying_pool.utp differ diff --git a/nwnds_module/se_door_death.ncs b/nwnds_module/se_door_death.ncs new file mode 100644 index 000000000..a40840531 Binary files /dev/null and b/nwnds_module/se_door_death.ncs differ diff --git a/nwnds_module/se_door_death.nss b/nwnds_module/se_door_death.nss new file mode 100644 index 000000000..8752df76d --- /dev/null +++ b/nwnds_module/se_door_death.nss @@ -0,0 +1,86 @@ +//:://////////////////////////////////////////////////////////////////////////// +//:: Name Respawn Door/s v1.1 +//:: FileName se_door_death +//:: Copyright (c) 2001 Bioware Corp. +//:://////////////////////////////////////////////////////////////////////////// +/* + Respawn a door after a set delay + Set a float on the door ie. RESPAWN_TIMER = xx else the default is used + Thanks to Craig Welburn for the insight + Cheers to Zarathustra217 +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By: Sir Elric +//:: Created On: 8th May, 2006 +//:: Modified On: 16th August, 2007 +//:: Event Used: OnDeath event of a door +//:://////////////////////////////////////////////////////////////////////////// + +#include "x2_inc_compon" + +// ----------------------------------------------------------------------------- +// CONSTANTS - Settings below +// ----------------------------------------------------------------------------- + +const float RESPAWN_TIMER_DEFAULT = 600.0; // Default respawn delay +const int DO_CRAFT_DROP = TRUE; // Drop default Bioware crafting item? + + +// ----------------------------------------------------------------------------- +// PROTOTYPES +// ----------------------------------------------------------------------------- + +// Respawn a door after a set delay +// If no float is set on the door ie. RESPAWN_TIMER = xx +// The default delay will be used ie. RESPAWN_TIMER_DEFAULT = xx +// oSelf: - Object calling the script +void SE_RespawnDoor(object oSelf); + + +// ----------------------------------------------------------------------------- +// FUNCTIONS +// ----------------------------------------------------------------------------- + +void SE_RespawnDoor(object oSelf) +{ + PlayAnimation(ANIMATION_DOOR_CLOSE); + int nHealAmount = GetMaxHitPoints(oSelf) - GetCurrentHitPoints(oSelf); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHealAmount), oSelf); +} + + +// ----------------------------------------------------------------------------- +// MAIN +// ----------------------------------------------------------------------------- + + +void main() + { + object oSelf = OBJECT_SELF; + object oKiller = GetLastKiller(); + + SetIsDestroyable(FALSE); + + float fDelay = GetLocalFloat(oSelf, "RESPAWN_TIMER"); + if(fDelay == 0.0) + fDelay = RESPAWN_TIMER_DEFAULT; + + DelayCommand(fDelay, SE_RespawnDoor(oSelf)); + + if (!GetIsPC(oKiller)) + return; + + while (GetIsObjectValid(GetMaster(oKiller))) + { + oKiller=GetMaster(oKiller); + } + + if(GetIsObjectValid(oKiller)) + { + AdjustReputation(oKiller, OBJECT_SELF, -35); + AdjustAlignment (oKiller, ALIGNMENT_CHAOTIC, 10); + } + + if(DO_CRAFT_DROP) + craft_drop_placeable(); + } diff --git a/nwnds_module/se_inc_resp_trap.nss b/nwnds_module/se_inc_resp_trap.nss new file mode 100644 index 000000000..5c8143683 --- /dev/null +++ b/nwnds_module/se_inc_resp_trap.nss @@ -0,0 +1,788 @@ +//:://////////////////////////////////////////////////////////////////////////// +//:: Name Sir Elric's Respawning Traps v2.7 +//:: FileName se_inc_resp_trap +//:: Copyright (c) 2006 Melnibone Corp. +//:://////////////////////////////////////////////////////////////////////////// +/* + - Change the constant setting below to suit your module + + - This is an include file and will NOT compile like a normal script. + Once you have chosen your settings save it via Ctrl+S + Then build and compile ALL scripts for the changes to take effect. +*/ +//:://////////////////////////////////////////////////////////////////////////// +//:: Created By : Sir Elric +//:: Created On : 19th June, 2006 +//:: Modified On: 19th December, 2007 +//:: Patch : 1.67 or above required +//:://////////////////////////////////////////////////////////////////////////// + + +// ----------------------------------------------------------------------------- +// CONSTANTS +// ----------------------------------------------------------------------------- + + +// DEBUG - TRUE or FALSE(Set to TRUE by default - Gives debugging info) +const int DEBUG_MODE = FALSE; + +// DEBUG - TRUE or FALSE(Set to TRUE by default - Visual effect for trap creation) +const int DO_EFFECTS = FALSE; + +// Area trap respawner timer +// When a player enters the area objects are scanned and trapped, if set +// And the timer is started +const float SE_AREA_TIMER = 300.0; // 1 minute for testing + +// Trap defaults if not set by the builder +const float SE_TRAP_SIZE_DEFAULT = 1.0; // 1 game meter +const int SE_TRAP_PERCENTILE_DEFAULT = 50; // 50% +const int SE_TRAP_TYPE_DEFAULT = 2; // Average category + +// Reward disarm XP to the disarmer of the trap? +const int SE_DISARM_XP_ACTIVE = TRUE; // Main toggle - Switch on or off here + + const int SE_DISARM_XP_ROGUE_ONLY = TRUE; // Reward rogues only? + const int SE_DISARM_XP_ONCE_ONLY = TRUE; // Reward once per object per player per reset? + + // The XP reward is equal to the disarm XP + const int SE_DISARM_XP_MULTIPLIER = 1; // Use the multiplier to increase it + const int SE_DISARM_XP_DIVIDER = 1; // Use the divider to decrease it + +// Random trap disarm constants. Set to suit your module +const int SE_DISARM_BASE_DC = 25; +const int SE_DISARM_RANDOM = 10; + +const int SE_DISARM_MODIFIER_MINOR = 0; +const int SE_DISARM_MODIFIER_AVERAGE = 0; +const int SE_DISARM_MODIFIER_STRONG = 5; +const int SE_DISARM_MODIFIER_DEADLY = 10; +const int SE_DISARM_MODIFIER_EPIC = 25; + +// Random object trapping array +// This ensures the exact perentage of objects are trapped in an area +// No more no less (leave as is) +const string VALID_OBJECT_ARRAY = "sObjectArray"; + +// ----------------------------------------------------------------------------- +// PROTOTYPES +// ----------------------------------------------------------------------------- + + +// Debug messages +void SE_Debug(string sMessage); + +// Optional Trap Settings - Check and adjust accordingly +void SE_OptionalTrapSettings(object oTrap, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nOneShot); + +// Create a trap at the location of the object only if one doesn't already exist +// lLoc - Location to create trap +// fSize - Size of the trap +// oObject - Object to create trap on +// nTrapType - Type of trap +// nNoDetect - Non-Detectable? 1 is TRUE optional +// nDetectDC - Set detect DC (1 to 250) optional +// nNoDisarm - Non-Disarmable? 1 is TRUE optional +// nDisarmDC - Set disarm DC (1 to 250) optional +// nNoRecover - Non-Recoverable? 1 is TRUE optional +// nMultiShot - Not a one shot trap? 1 is TRUE optional +void SE_SpawnTrapAtLocation(location lLoc, float fSize, object oObject, int nTrapType, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nMultiShot); + +// Create a trap on the object only if one doesn't already exist +// oObject - Object to create trap on +// nTrapType - Type of trap +// nNoDetect - Non-Detectable? 1 is TRUE optional +// nDetectDC - Set detect DC (1 to 250) optional +// nNoDisarm - Non-Disarmable? 1 is TRUE optional +// nDisarmDC - Set disarm DC (1 to 250) optional +// nNoRecover - Non-Recoverable? 1 is TRUE optional +// nOneShot - One shot trap? +void SE_SpawnTrapOnObject(object oObject, int nTrapType, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nMultiShot); + +// Return a random trap dependant on the trap strength set on the invisible object +// nTrapStength = 1 Minor, 2 Average, 3 Strong, 4 Deadly, 5 Epic +int SE_TrapType(int nTrap, object oSelf); + +// Create a random trap on each object or door in the area dependant on the +// percentile set on the invisible object but only if one doesn't already exist. +// oSelf - Object to create trap on +void SE_SetRandomTrapsEveryTime(object oSelf); + +// Create a random trap on each object or door in the area dependant on the +// percentile set on the invisible object but only if one doesn't already exist. +// oSelf - Object to create trap on +void SE_SetRandomTraps(object oSelf); + +// Check only object & doors previously trapped by SE_SetRandomTraps() +// If trap is invalid create a new one +// oSelf - Object to check for traps +void SE_CheckRandomTraps(object oSelf); + +// Random DisarmDC range by default +// - 1 Minor = 25 to 35 DC range +// - 2 Average = 25 to 35 DC range +// - 3 Strong = 30 to 40 DC range +// - 4 Deadly = 35 to 45 DC range +// - 5 Epic = 50 to 60 DC range +// nType = Trap strength category +int SE_RandomDisarmDC(int nType); + +// Return TRUE if a valid target object or door +int SE_GetIsValidTrapTarget(object oObject); + +// Return TRUE if an invisible spawner object +int SE_GetIsASpawnerObject(object oObject); + +// Return TRUE if already trapped or a valid transition +// The latter prevents trapping open doorways +int SE_GetIsTrappedOrTransition(object oObject); + +// Return TRUE if there is no trap found, the trap is futher away than 1.0 +// the trap creator is a PC +int SE_CheckGroundTrapStatus(object oObject, object oTrap); + +// Return the trap type +// If not set return the default +int SE_ReturnTrapType(object oSelf); + +// Return the trap size +// If not set return the default +float SE_ReturnTrapSize(object oSelf); + +// ----------------------------------------------------------------------------- +// FUNCTIONS +// ----------------------------------------------------------------------------- + + +void SE_Debug(string sMessage) +{ + if(DEBUG_MODE) + { + SendMessageToPC(GetFirstPC(), "DEBUG: " + sMessage); + PrintString("**" + sMessage); + } +} + +void SE_OptionalTrapSettings(object oTrap, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nOneShot) +{ + if(nNoDetect) + { + SetTrapDetectable(oTrap, FALSE); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting non-detectable for " + GetName(oTrap) + " to TRUE"); + } + if(nDetectDC) + { + SetTrapDetectDC(oTrap, nDetectDC); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting trap detect DC for " + GetName(oTrap) + " to " + + IntToString(GetTrapDetectDC(oTrap))); + } + if(nNoDisarm) + { + SetTrapDisarmable(oTrap, FALSE); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting non-disarmable for " + GetName(oTrap) + " to TRUE"); + } + if(nDisarmDC) + { + SetTrapDisarmDC(oTrap, nDisarmDC); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting trap disarm DC for " + GetName(oTrap)+" to " + + IntToString(GetTrapDisarmDC(oTrap))); + } + if(nNoRecover) + { + SetTrapRecoverable(oTrap, FALSE); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting non-recoverable for " + GetName(oTrap) + " to TRUE"); + } + if(nOneShot) + { + SetTrapOneShot(oTrap, FALSE); + + SE_Debug("[" + GetName(GetArea(oTrap)) + "] " + + "Setting one shot for " + GetName(oTrap) + " to FALSE"); + } +} + + +void SE_SpawnTrapAtLocation(location lLoc, float fSize, object oObject, int nTrapType, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nMultiShot) +{ + object oTrap = CreateTrapAtLocation(nTrapType, lLoc, fSize, "", STANDARD_FACTION_HOSTILE, "se_on_disarmed_l", ""); + + SE_Debug("[" + GetName(GetArea(oObject)) + "] " + + "Creating trap " + Get2DAString("traps", "Label", nTrapType) + + " at the location of " + GetName(oObject)); + + // Check for optional trap settings and set accordingly + SE_OptionalTrapSettings(oTrap, nNoDetect, nDetectDC, nNoDisarm, nDisarmDC, nNoRecover, nMultiShot); + + if(DO_EFFECTS) + { + effect eEffect = EffectVisualEffect(VFX_IMP_TORNADO); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, lLoc); + } +} + +void SE_SpawnTrapOnObject(object oObject, int nTrapType, int nNoDetect, int nDetectDC, int nNoDisarm, int nDisarmDC, int nNoRecover, int nMultiShot) +{ + if(GetIsTrapped(oObject)) + { + SE_Debug("[" + GetName(GetArea(oObject)) + "] " + + GetName(GetTrapCreator(oObject)) + " set a trap on the " + + GetName(oObject) + " spawn cancelled."); + + return; + } + + SE_Debug("[" + GetName(GetArea(oObject)) + "] " + + "Creating trap " + Get2DAString("traps", "Label", nTrapType) + + " on the " + GetName(oObject)); + + CreateTrapOnObject(nTrapType, oObject, STANDARD_FACTION_HOSTILE, "se_on_disarmed", ""); + + // Check for optional trap settings and set accordingly + SE_OptionalTrapSettings(oObject, nNoDetect, nDetectDC, nNoDisarm, nDisarmDC, nNoRecover, nMultiShot); + + if(DO_EFFECTS) + { + effect eEffect = EffectVisualEffect(VFX_IMP_TORNADO); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oObject); + } + // v1.5 addition + //SetLocalInt(oObject, "STOCK_TRAP_DISARM_DC", GetTrapDisarmDC(oObject)); + +} + +int SE_TrapType(int nTrap, object oSelf) +{ + switch(nTrap) + { + case 1: nTrap = GetLocalInt(oSelf, "PRESET_TYPE"); + if(nTrap == 0 || nTrap > 11 ) + nTrap = Random(10) + 1; + switch(nTrap)// Minor + { + case 1: nTrap = TRAP_BASE_TYPE_MINOR_ACID; return nTrap; + case 2: nTrap = TRAP_BASE_TYPE_MINOR_ACID_SPLASH;return nTrap; + case 3: nTrap = TRAP_BASE_TYPE_MINOR_ELECTRICAL; return nTrap; + case 4: nTrap = TRAP_BASE_TYPE_MINOR_FIRE; return nTrap; + case 5: nTrap = TRAP_BASE_TYPE_MINOR_FROST; return nTrap; + case 6: nTrap = TRAP_BASE_TYPE_MINOR_GAS; return nTrap; + case 7: nTrap = TRAP_BASE_TYPE_MINOR_HOLY; return nTrap; + case 8: nTrap = TRAP_BASE_TYPE_MINOR_NEGATIVE; return nTrap; + case 9: nTrap = TRAP_BASE_TYPE_MINOR_SONIC; return nTrap; + case 10: nTrap = TRAP_BASE_TYPE_MINOR_SPIKE; return nTrap; + case 11: nTrap = TRAP_BASE_TYPE_MINOR_TANGLE; return nTrap; + } + + case 2: nTrap = GetLocalInt(oSelf, "PRESET_TYPE"); + if(nTrap == 0 || nTrap > 11 ) + nTrap = Random(10) + 1; + switch(nTrap)// Average + { + case 1: nTrap = TRAP_BASE_TYPE_AVERAGE_ACID; return nTrap; + case 2: nTrap = TRAP_BASE_TYPE_AVERAGE_ACID_SPLASH;return nTrap; + case 3: nTrap = TRAP_BASE_TYPE_AVERAGE_ELECTRICAL; return nTrap; + case 4: nTrap = TRAP_BASE_TYPE_AVERAGE_FIRE; return nTrap; + case 5: nTrap = TRAP_BASE_TYPE_AVERAGE_FROST; return nTrap; + case 6: nTrap = TRAP_BASE_TYPE_AVERAGE_GAS; return nTrap; + case 7: nTrap = TRAP_BASE_TYPE_AVERAGE_HOLY; return nTrap; + case 8: nTrap = TRAP_BASE_TYPE_AVERAGE_NEGATIVE; return nTrap; + case 9: nTrap = TRAP_BASE_TYPE_AVERAGE_SONIC; return nTrap; + case 10: nTrap = TRAP_BASE_TYPE_AVERAGE_SPIKE; return nTrap; + case 11: nTrap = TRAP_BASE_TYPE_AVERAGE_TANGLE; return nTrap; + } + case 3 : nTrap = GetLocalInt(oSelf, "PRESET_TYPE"); + if(nTrap == 0 || nTrap > 11 ) + nTrap = Random(10) + 1; + switch(nTrap)// Strong + { + case 1: nTrap = TRAP_BASE_TYPE_STRONG_ACID; return nTrap; + case 2: nTrap = TRAP_BASE_TYPE_STRONG_ACID_SPLASH;return nTrap; + case 3: nTrap = TRAP_BASE_TYPE_STRONG_ELECTRICAL; return nTrap; + case 4: nTrap = TRAP_BASE_TYPE_STRONG_FIRE; return nTrap; + case 5: nTrap = TRAP_BASE_TYPE_STRONG_FROST; return nTrap; + case 6: nTrap = TRAP_BASE_TYPE_STRONG_GAS; return nTrap; + case 7: nTrap = TRAP_BASE_TYPE_STRONG_HOLY; return nTrap; + case 8: nTrap = TRAP_BASE_TYPE_STRONG_NEGATIVE; return nTrap; + case 9: nTrap = TRAP_BASE_TYPE_STRONG_SONIC; return nTrap; + case 10: nTrap = TRAP_BASE_TYPE_STRONG_SPIKE; return nTrap; + case 11: nTrap = TRAP_BASE_TYPE_STRONG_TANGLE; return nTrap; + } + case 4: nTrap = GetLocalInt(oSelf, "PRESET_TYPE"); + if(nTrap == 0 || nTrap > 11 ) + nTrap = Random(10) + 1; + switch(nTrap)// Deadly + { + case 1: nTrap = TRAP_BASE_TYPE_DEADLY_ACID; return nTrap; + case 2: nTrap = TRAP_BASE_TYPE_DEADLY_ACID_SPLASH;return nTrap; + case 3: nTrap = TRAP_BASE_TYPE_DEADLY_ELECTRICAL; return nTrap; + case 4: nTrap = TRAP_BASE_TYPE_DEADLY_FIRE; return nTrap; + case 5: nTrap = TRAP_BASE_TYPE_DEADLY_FROST; return nTrap; + case 6: nTrap = TRAP_BASE_TYPE_DEADLY_GAS; return nTrap; + case 7: nTrap = TRAP_BASE_TYPE_DEADLY_HOLY; return nTrap; + case 8: nTrap = TRAP_BASE_TYPE_DEADLY_NEGATIVE; return nTrap; + case 9: nTrap = TRAP_BASE_TYPE_DEADLY_SONIC; return nTrap; + case 10: nTrap = TRAP_BASE_TYPE_DEADLY_SPIKE; return nTrap; + case 11: nTrap = TRAP_BASE_TYPE_DEADLY_TANGLE; return nTrap; + } + case 5: nTrap = GetLocalInt(oSelf, "PRESET_TYPE"); + if(nTrap == 0 || nTrap > 4 ) + nTrap = Random(3) + 1; + switch(nTrap)// Epic + { + case 1: nTrap = TRAP_BASE_TYPE_EPIC_ELECTRICAL;return nTrap; + case 2: nTrap = TRAP_BASE_TYPE_EPIC_FIRE; return nTrap; + case 3: nTrap = TRAP_BASE_TYPE_EPIC_FROST; return nTrap; + case 4: nTrap = TRAP_BASE_TYPE_EPIC_SONIC; return nTrap; + } + } + return SE_TRAP_TYPE_DEFAULT; // Fail safe +} + +void SE_SetRandomTrapsEveryTime(object oSelf) +{ + int nObject = 1; + + // Return the trap type, if not set use the default + int nTrapType = SE_ReturnTrapType(oSelf); + + // Return the trap size, if not set use the default + float fSize = SE_ReturnTrapSize(oSelf); + + // Return the percentile, if not set use the default + int nPerc = GetLocalInt(oSelf, "TRAP_PERCENTILE"); + + if(nPerc == 0) + { + DelayCommand(3.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + "DEFAULT: Trap percentile was not set on " + + GetName(oSelf) + " setting it to the default " + + IntToString(SE_TRAP_PERCENTILE_DEFAULT) + "%")); + + SetLocalInt(oSelf, "TRAP_PERCENTILE", SE_TRAP_PERCENTILE_DEFAULT); + } + else + { + DelayCommand(3.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + " Trap percentile was set to " + + IntToString(nPerc) + "%")); + } + + // iterate through each object in the area + int i, n, nPick, nLast; + + object oObject = GetFirstObjectInArea(); + while(GetIsObjectValid(oObject)) + { + // Remove previously spawned traps first + if(GetIsTrapped(oObject)) + { + object oTrapCreator = GetTrapCreator(oObject); + if(GetIsPC(oTrapCreator) == FALSE && GetLocalInt(oObject, "TRAP_ALWAYS") == FALSE) + { + SetTrapDisabled(oObject); + if(GetObjectType(oObject) == OBJECT_TYPE_TRIGGER) + { + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + " Removing location trap " + GetName(oObject)); + } + else + { + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + " Removing trap from " + GetName(oObject)); + } + } + } + + // "TRAP_ALWAYS" objects will be trapped so no need to add them to the random list + // "TRAP_NEVER" skip these from the random list + if(SE_GetIsValidTrapTarget(oObject) + && GetLocalInt(oObject, "TRAP_ALWAYS") == FALSE + && GetLocalInt(oObject, "TRAP_NEVER") == FALSE) + { + // Not a spawner object or a valid transition + if(SE_GetIsASpawnerObject(oObject) == FALSE && + !GetIsObjectValid(GetTransitionTarget(oObject))) + { + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(n), oObject); + n++; // increment counter + } + } + oObject = GetNextObjectInArea(); + } + + // Work out our percentage to trap here from the total valid targets + nPerc = (n * nPerc / 100); + + DelayCommand(3.5, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + IntToString(nPerc) + " of " + IntToString(n) + + " valid targets to be trapped in this area")); + + // now we shuffle the array + for(nLast = n - 1 ; nLast > 1; nLast--) + { + // pick a number at random between 1 and last unshuffled element + nPick = Random(nLast - 1) + 1; + + object oLast = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nLast)); + object oPick = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nPick)); + + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nLast), oPick); + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nPick), oLast); + } + + // Now we finally trap the percent to be trapped + i = 1; + for(i ; i <= nPerc; i++) + { + oObject = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(i)); + if(GetTag(oObject) == "RANDOM_GROUND_TRAP_LOCATION") + { + location lNewLoc = GetLocation(oObject); + SE_SpawnTrapAtLocation(lNewLoc, + fSize, + oObject, + SE_TrapType(nTrapType, oSelf), + GetLocalInt(oSelf, "TRAP_DETECTABLE"), + GetLocalInt(oSelf, "TRAP_DETECT_DC"), + GetLocalInt(oSelf, "TRAP_DISARM"), + SE_RandomDisarmDC(nTrapType), + GetLocalInt(oSelf, "TRAP_RECOVERABLE"), + GetLocalInt(oSelf, "TRAP_MULTI_SHOT")); + + // Increment number of trapped placeables + SetLocalInt(oSelf, "NUMBER_TRAPPED", nObject); + nObject += 1; + + SE_Debug("[" + GetName(GetArea(oObject)) + "] * Trapping " + + GetName(oObject)); + } + else + { + SE_SpawnTrapOnObject(oObject, + SE_TrapType(nTrapType, oSelf), + GetLocalInt(oSelf, "TRAP_DETECTABLE"), + GetLocalInt(oSelf, "TRAP_DETECT_DC"), + GetLocalInt(oSelf, "TRAP_DISARM"), + SE_RandomDisarmDC(nTrapType), + GetLocalInt(oSelf, "TRAP_RECOVERABLE"), + GetLocalInt(oSelf, "TRAP_MULTI_SHOT")); + + // Increment number of trapped placeables + SetLocalInt(oSelf, "NUMBER_TRAPPED", nObject); + nObject += 1; + + SE_Debug("[" + GetName(GetArea(oObject)) + "] * Trapping " + GetName(oObject)); + } + } + DelayCommand(4.0, + SE_Debug("[" + GetName(GetArea(oObject)) + "] Total valid targets that were trapped " + + IntToString(nObject - 1))); +} +void SE_SetRandomTraps(object oSelf) +{ + int nObject = 1; + + // Only run this function once per random spawner object + SetLocalInt(oSelf, "LOOP_AREA_ONCE", TRUE ); + + // Return the trap type, if not set use the default + int nTrapType = SE_ReturnTrapType(oSelf); + + // Return the trap size, if not set use the default + float fSize = SE_ReturnTrapSize(oSelf); + + // Return the percentile, if not set use the default + int nPerc = GetLocalInt(oSelf, "TRAP_PERCENTILE"); + + if(nPerc == 0) + { + DelayCommand(3.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + "DEFAULT: Trap percentile was not set on " + + GetName(oSelf) + " setting it to the default " + + IntToString(SE_TRAP_PERCENTILE_DEFAULT) + "%")); + + SetLocalInt(oSelf, "TRAP_PERCENTILE", SE_TRAP_PERCENTILE_DEFAULT); + } + else + { + DelayCommand(3.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + " Trap percentile was set to " + + IntToString(nPerc) + "%")); + } + + // iterate through each object in the area + int i, n, nPick, nLast; + + object oObject = GetFirstObjectInArea(); + while(GetIsObjectValid(oObject)) + { + // "TRAP_ALWAYS" objects will be trapped so no need to add them to the random list + // "TRAP_NEVER" skip these from the random list + if(SE_GetIsValidTrapTarget(oObject) + && GetLocalInt(oObject, "TRAP_ALWAYS") == FALSE + && GetLocalInt(oObject, "TRAP_NEVER") == FALSE) + { + // Not a spawner object or a valid transition + if(SE_GetIsASpawnerObject(oObject) == FALSE && SE_GetIsTrappedOrTransition(oObject) == FALSE) + { + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(n), oObject); + n++; // increment counter + } + } + oObject = GetNextObjectInArea(); + } + + // Work out our percentage to trap here from the total valid targets + nPerc = (n * nPerc / 100); + + DelayCommand(3.5, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + IntToString(nPerc) + " of " + IntToString(n) + + " valid targets to be trapped in this area")); + + // now we shuffle the array + for(nLast = n - 1 ; nLast > 1; nLast--) + { + // pick a number at random between 1 and last unshuffled element + nPick = Random(nLast - 1) + 1; + + object oLast = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nLast)); + object oPick = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nPick)); + + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nLast), oPick); + SetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(nPick), oLast); + } + + // Now we finally trap the percent to be trapped + i = 1; + for(i ; i <= nPerc; i++) + { + oObject = GetLocalObject(oSelf, VALID_OBJECT_ARRAY + IntToString(i)); + if(GetTag(oObject) == "RANDOM_GROUND_TRAP_LOCATION") + { + location lNewLoc = GetLocation(oObject); + SE_SpawnTrapAtLocation(lNewLoc, + fSize, + oObject, + SE_TrapType(nTrapType, oSelf), + GetLocalInt(oSelf, "TRAP_DETECTABLE"), + GetLocalInt(oSelf, "TRAP_DETECT_DC"), + GetLocalInt(oSelf, "TRAP_DISARM"), + SE_RandomDisarmDC(nTrapType), + GetLocalInt(oSelf, "TRAP_RECOVERABLE"), + GetLocalInt(oSelf, "TRAP_MULTI_SHOT")); + + // Increment number of trapped placeables + SetLocalObject(oSelf, "TRAP_SET" + IntToString(nObject), oObject); + SetLocalInt(oSelf, "NUMBER_TRAPPED", nObject); + nObject += 1; + + SE_Debug("[" + GetName(GetArea(oObject)) + "] * Trapping " + + GetName(oObject)); + } + else + { + SE_SpawnTrapOnObject(oObject, + SE_TrapType(nTrapType, oSelf), + GetLocalInt(oSelf, "TRAP_DETECTABLE"), + GetLocalInt(oSelf, "TRAP_DETECT_DC"), + GetLocalInt(oSelf, "TRAP_DISARM"), + SE_RandomDisarmDC(nTrapType), + GetLocalInt(oSelf, "TRAP_RECOVERABLE"), + GetLocalInt(oSelf, "TRAP_MULTI_SHOT")); + + // Increment number of trapped placeables + SetLocalObject(oSelf, "TRAP_SET" + IntToString(nObject), oObject); + SetLocalInt(oSelf, "NUMBER_TRAPPED", nObject); + nObject += 1; + + SE_Debug("[" + GetName(GetArea(oObject)) + "] * Trapping " + GetName(oObject)); + } + } + DelayCommand(4.0, + SE_Debug("[" + GetName(GetArea(oObject)) + "] Total valid targets that were trapped " + + IntToString(nObject - 1))); +} + + +void SE_CheckRandomTraps(object oSelf) +{ + // Return the trap type, if not set use the default + int nTrapType = SE_ReturnTrapType(oSelf); + + // Return the trap size, if not set use the default + float fSize = SE_ReturnTrapSize(oSelf); + + location lMyLoc; + int nLoop; + int nObjectsTrapped = GetLocalInt(oSelf, "NUMBER_TRAPPED"); + if(!nObjectsTrapped) + { + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + "No traps were set. Destroying invisible object."); + + DestroyObject(oSelf, 0.0); + return; + } + for (nLoop=1; nLoop<=nObjectsTrapped; nLoop++) + { + object oObject = GetLocalObject(oSelf, "TRAP_SET"+IntToString(nLoop)); + if(GetIsObjectValid(oObject)) + { + // Ground trap waypoint? + if(GetTag(oObject) == "RANDOM_GROUND_TRAP_LOCATION") + { + object oTrap = GetNearestTrapToObject(oObject, FALSE ); + + if(SE_CheckGroundTrapStatus(oObject, oTrap)) + { + SE_Debug("[" + GetName(GetArea(oObject)) + "] " + + "No trap found at the location of " + + GetName(oObject) + " creating one"); + + lMyLoc = GetLocation(oObject); + + SE_SpawnTrapAtLocation(lMyLoc, + fSize, + oObject, + SE_TrapType(nTrapType, oSelf), + 0, + 0, + 0, + SE_RandomDisarmDC(nTrapType), + 0, + 0); + } + } + else if(!GetIsTrapped(oObject)) + { + SE_Debug("[" + GetName(GetArea(oObject)) + "] " + "No trap found on " + + GetName(oObject) + " creating one"); + + SE_SpawnTrapOnObject(oObject, + SE_TrapType(nTrapType, oSelf), + 0, + 0, + 0, + SE_RandomDisarmDC(nTrapType), + 0, + 0); + } + } + } +} + +int SE_RandomDisarmDC(int nType) +{ + int nDC = SE_DISARM_BASE_DC; + switch(nType) + { + case 1: nDC += SE_DISARM_MODIFIER_MINOR; break; + case 2: nDC += SE_DISARM_MODIFIER_AVERAGE; break; + case 3: nDC += SE_DISARM_MODIFIER_STRONG; break; + case 4: nDC += SE_DISARM_MODIFIER_DEADLY; break; + case 5: nDC += SE_DISARM_MODIFIER_EPIC; break; + } + nDC += Random(SE_DISARM_RANDOM) + 1; + return nDC; +} + + +int SE_GetIsValidTrapTarget(object oObject) +{ + int nType = GetObjectType(oObject); + + if(nType == OBJECT_TYPE_DOOR) + return TRUE; + + if(nType == OBJECT_TYPE_PLACEABLE && GetUseableFlag(oObject) == TRUE) + return TRUE; + + if((nType == OBJECT_TYPE_WAYPOINT) && GetTag(oObject) == "RANDOM_GROUND_TRAP_LOCATION") + return TRUE; + + return FALSE; +} + + +int SE_GetIsASpawnerObject(object oObject) +{ + if(GetTag(oObject) == "INVIS_TRAP_SPAWNER_RANDOM" || + GetTag(oObject) == "INVIS_TRAP_SPAWNER") + return TRUE; + + return FALSE; +} + + +int SE_GetIsTrappedOrTransition(object oObject) +{ + if(GetIsTrapped(oObject) || GetIsObjectValid(GetTransitionTarget(oObject))) + return TRUE; + + return FALSE; +} + + +int SE_CheckGroundTrapStatus(object oObject, object oTrap) +{ + object oCreator = GetTrapCreator(oTrap); + + if(GetIsObjectValid(oTrap) == FALSE + || GetDistanceBetween(oObject, oTrap) > 1.0f + || GetIsPC(oCreator)) + + return TRUE; + + return FALSE; +} + + +int SE_ReturnTrapType(object oSelf) +{ + int nType = GetLocalInt(oSelf, "TRAP_TYPE"); + if(nType == 0) + { + DelayCommand(4.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + "DEFAULT: Trap type was not set on " + + GetName(oSelf) + " setting it to the default of " + + IntToString(SE_TRAP_TYPE_DEFAULT))); + + SetLocalInt(oSelf, "TRAP_TYPE", SE_TRAP_TYPE_DEFAULT); + nType = SE_TRAP_TYPE_DEFAULT; + } + return nType; +} + +float SE_ReturnTrapSize(object oSelf) +{ + float fSize = GetLocalFloat(oSelf, "TRAP_SIZE"); + if(fSize == 0.0) + { + DelayCommand(4.0, + SE_Debug("[" + GetName(GetArea(oSelf)) + "] " + + "DEFAULT: Trap size not set on " + + GetName(oSelf) + " setting it to the default of " + + IntToString(FloatToInt(SE_TRAP_SIZE_DEFAULT)))); + + SetLocalFloat(oSelf, "TRAP_SIZE", SE_TRAP_SIZE_DEFAULT); + fSize = SE_TRAP_SIZE_DEFAULT; + } + return fSize; +} +//void main() {} diff --git a/nwnds_module/serenityoasis.are b/nwnds_module/serenityoasis.are new file mode 100644 index 000000000..84635d93d Binary files /dev/null and b/nwnds_module/serenityoasis.are differ diff --git a/nwnds_module/serenityoasis.gic b/nwnds_module/serenityoasis.gic new file mode 100644 index 000000000..63ea550e0 Binary files /dev/null and b/nwnds_module/serenityoasis.gic differ diff --git a/nwnds_module/serenityoasis.git b/nwnds_module/serenityoasis.git new file mode 100644 index 000000000..74fc022c4 Binary files /dev/null and b/nwnds_module/serenityoasis.git differ diff --git a/nwnds_module/sh_spiderbite.uti b/nwnds_module/sh_spiderbite.uti new file mode 100644 index 000000000..80cfda2ae Binary files /dev/null and b/nwnds_module/sh_spiderbite.uti differ diff --git a/nwnds_module/sh_spiderhide.uti b/nwnds_module/sh_spiderhide.uti new file mode 100644 index 000000000..7739714d6 Binary files /dev/null and b/nwnds_module/sh_spiderhide.uti differ diff --git a/nwnds_module/shadgianttouch01.uti b/nwnds_module/shadgianttouch01.uti new file mode 100644 index 000000000..074f0f55f Binary files /dev/null and b/nwnds_module/shadgianttouch01.uti differ diff --git a/nwnds_module/shadow001.utc b/nwnds_module/shadow001.utc new file mode 100644 index 000000000..51e128361 Binary files /dev/null and b/nwnds_module/shadow001.utc differ diff --git a/nwnds_module/shadow002.utc b/nwnds_module/shadow002.utc new file mode 100644 index 000000000..e9d437762 Binary files /dev/null and b/nwnds_module/shadow002.utc differ diff --git a/nwnds_module/shadow003.utc b/nwnds_module/shadow003.utc new file mode 100644 index 000000000..dfd2528de Binary files /dev/null and b/nwnds_module/shadow003.utc differ diff --git a/nwnds_module/shadow_touch.ncs b/nwnds_module/shadow_touch.ncs new file mode 100644 index 000000000..81a5de52e Binary files /dev/null and b/nwnds_module/shadow_touch.ncs differ diff --git a/nwnds_module/shadow_touch.nss b/nwnds_module/shadow_touch.nss new file mode 100644 index 000000000..0fde629eb --- /dev/null +++ b/nwnds_module/shadow_touch.nss @@ -0,0 +1,77 @@ +//:: +//:: A pnp version of the Shadows's STR damaging touch. +//:: +//:: Modified by: DM Heatstroke 01-04-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoStrDamage(object oTarget, object oCaster) +{ //:: + //:: Intialize damage value & figure out which shadow we are dealing with + //:: + int nHitDice = GetHitDice(oCaster); + int nDam; + if (1 == nHitDice) + { + nDam = 1; //Lesser Shadow + } + + else if (nHitDice >= 9) + { + nDam = d8(); //Greater Shadow + } + + else + { + nDam = d6(); //Normal Shadow + } + + // Get Ability Damage + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + effect eStr = EffectAbilityDecrease(ABILITY_STRENGTH, nDam); + eStr = SupernaturalEffect(eStr); + + // Determine if they can die from ability loss + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + // Shadow's touch has no save! + int nStr = GetAbilityScore(oTarget, ABILITY_STRENGTH); + if ( ( nStr - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eStr, oTarget, 8640.0); // 24 "Athas Reborn" hours -DMH + +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoStrDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/shadowaspbite.uti b/nwnds_module/shadowaspbite.uti new file mode 100644 index 000000000..1b69e02fe Binary files /dev/null and b/nwnds_module/shadowaspbite.uti differ diff --git a/nwnds_module/shadowgianthide1.uti b/nwnds_module/shadowgianthide1.uti new file mode 100644 index 000000000..e6cde701f Binary files /dev/null and b/nwnds_module/shadowgianthide1.uti differ diff --git a/nwnds_module/shadowhide001.uti b/nwnds_module/shadowhide001.uti new file mode 100644 index 000000000..81b53de81 Binary files /dev/null and b/nwnds_module/shadowhide001.uti differ diff --git a/nwnds_module/shadowhide002.uti b/nwnds_module/shadowhide002.uti new file mode 100644 index 000000000..ed89a4478 Binary files /dev/null and b/nwnds_module/shadowhide002.uti differ diff --git a/nwnds_module/shadowhide003.uti b/nwnds_module/shadowhide003.uti new file mode 100644 index 000000000..82fb1ea58 Binary files /dev/null and b/nwnds_module/shadowhide003.uti differ diff --git a/nwnds_module/shadowhide999.uti b/nwnds_module/shadowhide999.uti new file mode 100644 index 000000000..f8a7c5548 Binary files /dev/null and b/nwnds_module/shadowhide999.uti differ diff --git a/nwnds_module/shadowmastiff001.utc b/nwnds_module/shadowmastiff001.utc new file mode 100644 index 000000000..0dadbf789 Binary files /dev/null and b/nwnds_module/shadowmastiff001.utc differ diff --git a/nwnds_module/shadowratbite.uti b/nwnds_module/shadowratbite.uti new file mode 100644 index 000000000..3a2836896 Binary files /dev/null and b/nwnds_module/shadowratbite.uti differ diff --git a/nwnds_module/shadowratbite002.uti b/nwnds_module/shadowratbite002.uti new file mode 100644 index 000000000..ea0438218 Binary files /dev/null and b/nwnds_module/shadowratbite002.uti differ diff --git a/nwnds_module/shadowspawn.utc b/nwnds_module/shadowspawn.utc new file mode 100644 index 000000000..f3ab7dfc1 Binary files /dev/null and b/nwnds_module/shadowspawn.utc differ diff --git a/nwnds_module/shadowspider001.utc b/nwnds_module/shadowspider001.utc new file mode 100644 index 000000000..04795e14b Binary files /dev/null and b/nwnds_module/shadowspider001.utc differ diff --git a/nwnds_module/shadowtouch001.uti b/nwnds_module/shadowtouch001.uti new file mode 100644 index 000000000..1389fc254 Binary files /dev/null and b/nwnds_module/shadowtouch001.uti differ diff --git a/nwnds_module/shardspider001.utc b/nwnds_module/shardspider001.utc new file mode 100644 index 000000000..ab3ccf17c Binary files /dev/null and b/nwnds_module/shardspider001.utc differ diff --git a/nwnds_module/shardspiderhide.uti b/nwnds_module/shardspiderhide.uti new file mode 100644 index 000000000..631aca92b Binary files /dev/null and b/nwnds_module/shardspiderhide.uti differ diff --git a/nwnds_module/shd_spiderbite.uti b/nwnds_module/shd_spiderbite.uti new file mode 100644 index 000000000..2416c0ede Binary files /dev/null and b/nwnds_module/shd_spiderbite.uti differ diff --git a/nwnds_module/shiftalignment.nss b/nwnds_module/shiftalignment.nss new file mode 100644 index 000000000..60656189c --- /dev/null +++ b/nwnds_module/shiftalignment.nss @@ -0,0 +1,30 @@ +void ShiftAlignment (int Alignment, int Amount); + +void ShiftAlignment (int Alignment, int Amount) + { + object oSpeaker; + effect eAlignment; + + oSpeaker = GetPCSpeaker(); + + switch (Alignment) + { + case ALIGNMENT_GOOD: + eAlignment=EffectVisualEffect(VFX_IMP_HEAD_HOLY,FALSE); + break; + case ALIGNMENT_LAWFUL: + eAlignment=EffectVisualEffect(VFX_IMP_HEAD_MIND,FALSE); + break; + case ALIGNMENT_EVIL: + eAlignment=EffectVisualEffect(VFX_IMP_HEAD_EVIL,FALSE); + break; + case ALIGNMENT_CHAOTIC: + eAlignment=EffectVisualEffect(VFX_IMP_HEAD_ODD,FALSE); + break; + case ALIGNMENT_NEUTRAL: + eAlignment=EffectVisualEffect(VFX_IMP_HEAD_NATURE,FALSE); + break; + } + ApplyEffectToObject(DURATION_TYPE_INSTANT, eAlignment, oSpeaker, 0.5); + AdjustAlignment(oSpeaker, Alignment, Amount); + } diff --git a/nwnds_module/shiftchaotic.ncs b/nwnds_module/shiftchaotic.ncs new file mode 100644 index 000000000..573f0ef9a Binary files /dev/null and b/nwnds_module/shiftchaotic.ncs differ diff --git a/nwnds_module/shiftchaotic.nss b/nwnds_module/shiftchaotic.nss new file mode 100644 index 000000000..415b17d72 --- /dev/null +++ b/nwnds_module/shiftchaotic.nss @@ -0,0 +1,5 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_CHAOTIC, 25); +} diff --git a/nwnds_module/shiftchaoticevil.ncs b/nwnds_module/shiftchaoticevil.ncs new file mode 100644 index 000000000..f16f5cb85 Binary files /dev/null and b/nwnds_module/shiftchaoticevil.ncs differ diff --git a/nwnds_module/shiftchaoticevil.nss b/nwnds_module/shiftchaoticevil.nss new file mode 100644 index 000000000..65d201cc1 --- /dev/null +++ b/nwnds_module/shiftchaoticevil.nss @@ -0,0 +1,6 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_CHAOTIC, 25); + ShiftAlignment(ALIGNMENT_EVIL, 25); +} diff --git a/nwnds_module/shiftchaoticgood.ncs b/nwnds_module/shiftchaoticgood.ncs new file mode 100644 index 000000000..1aa58086c Binary files /dev/null and b/nwnds_module/shiftchaoticgood.ncs differ diff --git a/nwnds_module/shiftchaoticgood.nss b/nwnds_module/shiftchaoticgood.nss new file mode 100644 index 000000000..d36fc8fef --- /dev/null +++ b/nwnds_module/shiftchaoticgood.nss @@ -0,0 +1,6 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_CHAOTIC, 25); + ShiftAlignment(ALIGNMENT_GOOD, 25); +} diff --git a/nwnds_module/shiftevil.ncs b/nwnds_module/shiftevil.ncs new file mode 100644 index 000000000..d854d0776 Binary files /dev/null and b/nwnds_module/shiftevil.ncs differ diff --git a/nwnds_module/shiftevil.nss b/nwnds_module/shiftevil.nss new file mode 100644 index 000000000..052b4fc79 --- /dev/null +++ b/nwnds_module/shiftevil.nss @@ -0,0 +1,5 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_EVIL, 25); +} diff --git a/nwnds_module/shiftgood.ncs b/nwnds_module/shiftgood.ncs new file mode 100644 index 000000000..015e87f77 Binary files /dev/null and b/nwnds_module/shiftgood.ncs differ diff --git a/nwnds_module/shiftgood.nss b/nwnds_module/shiftgood.nss new file mode 100644 index 000000000..f05fbec07 --- /dev/null +++ b/nwnds_module/shiftgood.nss @@ -0,0 +1,5 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_GOOD, 25); +} diff --git a/nwnds_module/shiftlawful.ncs b/nwnds_module/shiftlawful.ncs new file mode 100644 index 000000000..0193bdd7f Binary files /dev/null and b/nwnds_module/shiftlawful.ncs differ diff --git a/nwnds_module/shiftlawful.nss b/nwnds_module/shiftlawful.nss new file mode 100644 index 000000000..b28686f42 --- /dev/null +++ b/nwnds_module/shiftlawful.nss @@ -0,0 +1,5 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_LAWFUL, 25); +} diff --git a/nwnds_module/shiftlawfulevil.ncs b/nwnds_module/shiftlawfulevil.ncs new file mode 100644 index 000000000..04dcce6ee Binary files /dev/null and b/nwnds_module/shiftlawfulevil.ncs differ diff --git a/nwnds_module/shiftlawfulevil.nss b/nwnds_module/shiftlawfulevil.nss new file mode 100644 index 000000000..be1a6ce17 --- /dev/null +++ b/nwnds_module/shiftlawfulevil.nss @@ -0,0 +1,6 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_LAWFUL, 25); + ShiftAlignment(ALIGNMENT_EVIL, 25); +} diff --git a/nwnds_module/shiftlawfulgood.ncs b/nwnds_module/shiftlawfulgood.ncs new file mode 100644 index 000000000..7be7b3611 Binary files /dev/null and b/nwnds_module/shiftlawfulgood.ncs differ diff --git a/nwnds_module/shiftlawfulgood.nss b/nwnds_module/shiftlawfulgood.nss new file mode 100644 index 000000000..d3773360e --- /dev/null +++ b/nwnds_module/shiftlawfulgood.nss @@ -0,0 +1,6 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_LAWFUL, 25); + ShiftAlignment(ALIGNMENT_GOOD, 25); +} diff --git a/nwnds_module/shiftneutral.ncs b/nwnds_module/shiftneutral.ncs new file mode 100644 index 000000000..91562794d Binary files /dev/null and b/nwnds_module/shiftneutral.ncs differ diff --git a/nwnds_module/shiftneutral.nss b/nwnds_module/shiftneutral.nss new file mode 100644 index 000000000..bf7ef3ef3 --- /dev/null +++ b/nwnds_module/shiftneutral.nss @@ -0,0 +1,5 @@ +#include "SHIFTALIGNMENT" +void main() +{ + ShiftAlignment(ALIGNMENT_NEUTRAL, 25); +} diff --git a/nwnds_module/silkwyrmbite.ncs b/nwnds_module/silkwyrmbite.ncs new file mode 100644 index 000000000..bf5cf0bd2 Binary files /dev/null and b/nwnds_module/silkwyrmbite.ncs differ diff --git a/nwnds_module/silkwyrmbite.nss b/nwnds_module/silkwyrmbite.nss new file mode 100644 index 000000000..a968262f6 --- /dev/null +++ b/nwnds_module/silkwyrmbite.nss @@ -0,0 +1,83 @@ +// Silk Wyrm Bite - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nSTR_Target; + int nSTR_Creature; + int nDam = 1; + + effect eWebVis = EffectVisualEffect(VFX_DUR_WEB); + effect eCocoon = EffectEntangle(); + eCocoon = ExtraordinaryEffect(eCocoon); + effect eLink = EffectLinkEffects(eWebVis, eCocoon); + + + effect eBloodVis = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL); + effect eBloodsuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam); + eBloodsuck = ExtraordinaryEffect(eBloodsuck); + +// Gargantuan & larger creatures cannot be constricted. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_GARGANTUAN || + GetCreatureSize(oTarget) == CREATURE_SIZE_COLOSSAL) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Deal 1 CON Damage. + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodVis, oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodsuck, oTarget); + +// Perform an opposed Strength check. If the target wins this check, it won't +// get entangled. To avoid ties, we do the rolling in a loop that breaks once +// the two results are NOT identical. + do + { + nSTR_Target = GetAbilityScore(oTarget, ABILITY_STRENGTH) + d20(); + nSTR_Creature = GetAbilityScore(oPC, ABILITY_STRENGTH) + d20(); + } + while (nSTR_Target == nSTR_Creature); +// If the target wins, send a short message to it and return. + if (nSTR_Target > nSTR_Creature) + { + FloatingTextStringOnCreature("You escape the silk wyrm's grapple.", oTarget); + return; + } +// Check for immunity vs entangle. If the target is immune, tell him that the +// silk wyrm TRIED to entangle him. Otherwise tell him that he GOT +// entangled. + if (GetIsImmune(oTarget, IMMUNITY_TYPE_ENTANGLE, oPC)) + { + FloatingTextStringOnCreature("The silk wyrm tries to grapple you!", oTarget); + } + else + { + FloatingTextStringOnCreature("The silk wyrm is grappling you!", oTarget); + } +// Apply the Entangle effect no matter whether the target is immune or not. If +// it is, it will have already received an according message that the silk +// wyrm's entangle attempt failed. Otherwise it simply gets entangled as +// intended. + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, 6.0f); + +} + + diff --git a/nwnds_module/silkwyrmbite.uti b/nwnds_module/silkwyrmbite.uti new file mode 100644 index 000000000..2e57a5332 Binary files /dev/null and b/nwnds_module/silkwyrmbite.uti differ diff --git a/nwnds_module/silkwyrmhide.uti b/nwnds_module/silkwyrmhide.uti new file mode 100644 index 000000000..0685f0261 Binary files /dev/null and b/nwnds_module/silkwyrmhide.uti differ diff --git a/nwnds_module/siltspiderbite.uti b/nwnds_module/siltspiderbite.uti new file mode 100644 index 000000000..b0e57ea75 Binary files /dev/null and b/nwnds_module/siltspiderbite.uti differ diff --git a/nwnds_module/siltspiderhide.uti b/nwnds_module/siltspiderhide.uti new file mode 100644 index 000000000..66c9d90a3 Binary files /dev/null and b/nwnds_module/siltspiderhide.uti differ diff --git a/nwnds_module/sit.ncs b/nwnds_module/sit.ncs new file mode 100644 index 000000000..a1671621a Binary files /dev/null and b/nwnds_module/sit.ncs differ diff --git a/nwnds_module/sit.nss b/nwnds_module/sit.nss new file mode 100644 index 000000000..55fc50aab --- /dev/null +++ b/nwnds_module/sit.nss @@ -0,0 +1,14 @@ + void main() +{ + +object oPC = GetLastUsedBy(); + +//if (!GetIsPC(oPC)) return; + +object oTarget; +oTarget = OBJECT_SELF; + +AssignCommand(oPC, ActionSit(oTarget)); + +} + diff --git a/nwnds_module/sitak001.utc b/nwnds_module/sitak001.utc new file mode 100644 index 000000000..052538a36 Binary files /dev/null and b/nwnds_module/sitak001.utc differ diff --git a/nwnds_module/sitakclaw.uti b/nwnds_module/sitakclaw.uti new file mode 100644 index 000000000..130dfc1b5 Binary files /dev/null and b/nwnds_module/sitakclaw.uti differ diff --git a/nwnds_module/skeleguard001.utc b/nwnds_module/skeleguard001.utc new file mode 100644 index 000000000..28a65de29 Binary files /dev/null and b/nwnds_module/skeleguard001.utc differ diff --git a/nwnds_module/skeleguard002.utc b/nwnds_module/skeleguard002.utc new file mode 100644 index 000000000..13179e3d5 Binary files /dev/null and b/nwnds_module/skeleguard002.utc differ diff --git a/nwnds_module/skeletondwarf001.utc b/nwnds_module/skeletondwarf001.utc new file mode 100644 index 000000000..10f617e42 Binary files /dev/null and b/nwnds_module/skeletondwarf001.utc differ diff --git a/nwnds_module/skeletongiant001.utc b/nwnds_module/skeletongiant001.utc new file mode 100644 index 000000000..438933295 Binary files /dev/null and b/nwnds_module/skeletongiant001.utc differ diff --git a/nwnds_module/skeletonhide001.uti b/nwnds_module/skeletonhide001.uti new file mode 100644 index 000000000..28ad8b3cb Binary files /dev/null and b/nwnds_module/skeletonhide001.uti differ diff --git a/nwnds_module/skeletonhuman001.utc b/nwnds_module/skeletonhuman001.utc new file mode 100644 index 000000000..0034fbe82 Binary files /dev/null and b/nwnds_module/skeletonhuman001.utc differ diff --git a/nwnds_module/skeletonhuman002.utc b/nwnds_module/skeletonhuman002.utc new file mode 100644 index 000000000..665374a61 Binary files /dev/null and b/nwnds_module/skeletonhuman002.utc differ diff --git a/nwnds_module/skyrosarmor.uti b/nwnds_module/skyrosarmor.uti new file mode 100644 index 000000000..0ec9873b0 Binary files /dev/null and b/nwnds_module/skyrosarmor.uti differ diff --git a/nwnds_module/skyroshide.uti b/nwnds_module/skyroshide.uti new file mode 100644 index 000000000..7b5ddcd98 Binary files /dev/null and b/nwnds_module/skyroshide.uti differ diff --git a/nwnds_module/sl_trackerslam.uti b/nwnds_module/sl_trackerslam.uti new file mode 100644 index 000000000..23a83a964 Binary files /dev/null and b/nwnds_module/sl_trackerslam.uti differ diff --git a/nwnds_module/slam1d12.uti b/nwnds_module/slam1d12.uti new file mode 100644 index 000000000..ea9e0f6a4 Binary files /dev/null and b/nwnds_module/slam1d12.uti differ diff --git a/nwnds_module/slam4d8.uti b/nwnds_module/slam4d8.uti new file mode 100644 index 000000000..1f6d33421 Binary files /dev/null and b/nwnds_module/slam4d8.uti differ diff --git a/nwnds_module/slam8d6.uti b/nwnds_module/slam8d6.uti new file mode 100644 index 000000000..38a2400b5 Binary files /dev/null and b/nwnds_module/slam8d6.uti differ diff --git a/nwnds_module/slaughterwight01.utc b/nwnds_module/slaughterwight01.utc new file mode 100644 index 000000000..37b81e91c Binary files /dev/null and b/nwnds_module/slaughterwight01.utc differ diff --git a/nwnds_module/slig001.utc b/nwnds_module/slig001.utc new file mode 100644 index 000000000..0e9a873a2 Binary files /dev/null and b/nwnds_module/slig001.utc differ diff --git a/nwnds_module/slig002.utc b/nwnds_module/slig002.utc new file mode 100644 index 000000000..887a894f4 Binary files /dev/null and b/nwnds_module/slig002.utc differ diff --git a/nwnds_module/slithertrack001.utc b/nwnds_module/slithertrack001.utc new file mode 100644 index 000000000..5de784ad6 Binary files /dev/null and b/nwnds_module/slithertrack001.utc differ diff --git a/nwnds_module/sluggiant001.utc b/nwnds_module/sluggiant001.utc new file mode 100644 index 000000000..20b6d2cd2 Binary files /dev/null and b/nwnds_module/sluggiant001.utc differ diff --git a/nwnds_module/smairelemhide.uti b/nwnds_module/smairelemhide.uti new file mode 100644 index 000000000..452c987d4 Binary files /dev/null and b/nwnds_module/smairelemhide.uti differ diff --git a/nwnds_module/smearthelemhide.uti b/nwnds_module/smearthelemhide.uti new file mode 100644 index 000000000..ae4ad4fdb Binary files /dev/null and b/nwnds_module/smearthelemhide.uti differ diff --git a/nwnds_module/smfireelemhide.uti b/nwnds_module/smfireelemhide.uti new file mode 100644 index 000000000..e08c3c5af Binary files /dev/null and b/nwnds_module/smfireelemhide.uti differ diff --git a/nwnds_module/smfireelemslam.uti b/nwnds_module/smfireelemslam.uti new file mode 100644 index 000000000..0045f7927 Binary files /dev/null and b/nwnds_module/smfireelemslam.uti differ diff --git a/nwnds_module/smithing_anvil.utp b/nwnds_module/smithing_anvil.utp new file mode 100644 index 000000000..a8766fa51 Binary files /dev/null and b/nwnds_module/smithing_anvil.utp differ diff --git a/nwnds_module/smmagelemslam.uti b/nwnds_module/smmagelemslam.uti new file mode 100644 index 000000000..03bf77853 Binary files /dev/null and b/nwnds_module/smmagelemslam.uti differ diff --git a/nwnds_module/smrainelemhide.uti b/nwnds_module/smrainelemhide.uti new file mode 100644 index 000000000..93eee4a73 Binary files /dev/null and b/nwnds_module/smrainelemhide.uti differ diff --git a/nwnds_module/smrainelemslam.uti b/nwnds_module/smrainelemslam.uti new file mode 100644 index 000000000..77d2b0502 Binary files /dev/null and b/nwnds_module/smrainelemslam.uti differ diff --git a/nwnds_module/smsiltelemslam.uti b/nwnds_module/smsiltelemslam.uti new file mode 100644 index 000000000..c5166e660 Binary files /dev/null and b/nwnds_module/smsiltelemslam.uti differ diff --git a/nwnds_module/smwaterelemhide.uti b/nwnds_module/smwaterelemhide.uti new file mode 100644 index 000000000..2c577d160 Binary files /dev/null and b/nwnds_module/smwaterelemhide.uti differ diff --git a/nwnds_module/smwaterelemslam.uti b/nwnds_module/smwaterelemslam.uti new file mode 100644 index 000000000..e03f2e1ba Binary files /dev/null and b/nwnds_module/smwaterelemslam.uti differ diff --git a/nwnds_module/soundpalcus.itp b/nwnds_module/soundpalcus.itp new file mode 100644 index 000000000..51bf35361 Binary files /dev/null and b/nwnds_module/soundpalcus.itp differ diff --git a/nwnds_module/soutbite.uti b/nwnds_module/soutbite.uti new file mode 100644 index 000000000..cdec8705e Binary files /dev/null and b/nwnds_module/soutbite.uti differ diff --git a/nwnds_module/soutclaw.uti b/nwnds_module/soutclaw.uti new file mode 100644 index 000000000..09fd6dea1 Binary files /dev/null and b/nwnds_module/soutclaw.uti differ diff --git a/nwnds_module/soutproperties.uti b/nwnds_module/soutproperties.uti new file mode 100644 index 000000000..ef1ba4f17 Binary files /dev/null and b/nwnds_module/soutproperties.uti differ diff --git a/nwnds_module/spawn__history.nss b/nwnds_module/spawn__history.nss new file mode 100644 index 000000000..81496a33a --- /dev/null +++ b/nwnds_module/spawn__history.nss @@ -0,0 +1,544 @@ +// +// +// NESS +// Version 8.1.3 +// Spawn History +// +// +// Neshke Narovken (Original Author) +// +// Cereborn (Maintainer) +// +//******************************************************************* +// +// History: +// +// +++ Start Version 7.0 +// +// --/--/-- Neshke Created +// +// +// +++ Start Version 7.0.1 +// +// 12/03/02 Cereborn Added DanielleB's merchant-based loot tables +// 12/12/02 Cereborn Added area-wide count of currently spawned +// creatures +// 12/31/02 Cereborn Added LT subflags A, B, and C for specifying +// percentage chances of receiving 1, 2, or 3 +// loot items. +// 01/01/03 Cereborn Added SX flag for dim returns suppression. +// +// +++ Start Version 7.0.2 +// +// 01/07/03 Cereborn Added NESS_ActivateSpawn(), +// NESS_DeactivateSpawn, NESS_GetSpawnByID(), +// NESS_ActivateSpawnByID(), NESS_ForceProcess() +// NESS_DeactivateSpawnByID() and +// NESS_TrackModuleSpawns(). +// Modified so that an activated spawn is processed +// immediately instead of waiting for the next +// process tick when using SPxx +// Moved ReportSpawns and TrackModuleSpawns +// to spawn_functions from spawn_main; modified +// spawn_main to call TrackModuleSpawns() if +// enabled, removing the need for placing +// in each area heartbeat script +// +// 01/08/03 Cereborn Fixed bug preventing initial flag processing +// when using SPxx. +// Added new deactivate spawn (DS) condition +// (6) which deactivates a spawn whenever spawn +// count reaches spawn number. This is similar +// to DS1, except that DS1 is based on number +// of children *ever* spawned, so once +// deactivated can never be reactivated, while +// DS6 is based on current child count, allowing +// the spawn to be re-activated if 1 or more of +// it's children have been killed or despawned +// 01/10/03 Cereborn Prevent despawning creatures when possessed +// by a DM. (the code was attempting to do so +// already but due to a Bioware bug it wasn't +// working) +// 01/11/03 Cereborn Added I subflag to SU to check each child's +// location individually instead of the spawn's +// location +// 01/17/03 Cereborn Added force process of spawns when PCs +// re-arrive id deactivated by PC flag +// 01/18/03 Cereborn Added new type (3) to PL and subflag P +// Added P subflag to SD. +// 01/20/03 Cereborn Force process on deactivate +// Added NESS_IsModuleSpawnTracking() +// +// +++ Start Version 7.0.3 +// +// 01/22/03 Cereborn Bug fix: Initialize module spawn count to +// 0 to fix bug with loading from saved games +// 01/24/03 Cereborn Added NESS_DumpModuleSpawns() and +// NESS_IsModuleSpawnDumping(). When spawn +// dumping is enabled, each area with active +// spawns reports its spawn count each HB +// +// +// +++ Start Version ALFA 1.0 +// +// +// 02/05/03 - 03/21/03 +// +// Added NESS_ProcessDeadCreature(). This can be used to notify NESS that +// a spawned creature has died (typically from an onDeath event script). +// This is particularly useful when using larger SPxx values and the CD +// flag, since without notification it can take a long time for NESS to +// discover that the spawned creature has died and set up the lootable +// corpse. +// +// Added O(ffset) subflag to the SP flag. NESS now processes all spawns on +// the first heartbeat, and then spawns are be processed on heartbeat +// 1 + offset + (processRate * N). For example, SP3 gets processed on +// heartbeats 1, 4, 7, 10, etc.... while SP3O1 gets processed on heartbeats +// 1, 5, 8, 11..., and so on. This should be used to spread out heartbeats +// within an area. +// +// NESS no longer does any timing based on counted heartbeats. All timings +// are now based on the clock. A new file, spawn_timefuncs, contains +// functions for converting the game clock to real seconds for use in NESS +// timings. +// +// When spawns despawn due to using the PC flag (and if the R subflag is +// not specified) the despawning creature resrefs and their locations are +// recorded, and the spawn is restored to it previous state when PCs +// re-enter the area. This prevents exploits where players intentionally +// 'pop' a zone, then leave for the PC flag's duration, to effectively +// clear an area of all obstacles until the spawn delay timer (if any) +// expires. +// +// Fixed the bug causing corpses that had been fully looted to not decay. +// +// Fixed the bug that caused corpses to *never* decay if the decay timer +// went off when the inventory was open (now a new decay timer is set). +// +// Flag parsing code cleaned up; fixed a bug that caused the default value +// for a flag to always be 1 (ignoring what was set up in spawn_cfg_global) +// +// Items marked no-drop are no longer copied onto the lootable corpses +// +// All no-drop items are explicitly destroyed (whether the CD flag is used +// or not) to working around a current Bioware memory leak. +// +// Added NESS_ReturnHome(). Call to force a NESS spawn to it's home point. +// +// Added support for RH flag on spawn camps. +// +// +++ Start Version ALFA 1.0 Patch 1 (v1.0.1) +// +// 03/29/03 +// +// A bug where spawn delays were being applied to first time spawns that +// didn't happen right away (such as triggered spawns, day/night only, +// etc.) was fixed. +// +// If a spawn has the RH flag and is respawned after being despawned due +// to the PC flag, creatures will respawn at their home point instead of +// where they were when they despawned. +// +// An errant debug statement was removed. +// +// +++ Start Version ALFA 1.0 Patch 2 (v1.0.2) +// +// 03/30/03 +// +// Fixed a bug where the number of creatures in a spawn was getting +// confused due to spawns that use the M subflag of the SN flag +// recalculating their spawn numbers when spawns deactivated due to the +// PC flag. This bug fix should eliminate the overpopulating spawns +// problem. +// +// +++ Start Version ALFA 1.0 Patch 3 (v1.0.3) +// +// 03/31/03 +// +// Fixed a bug where spawn delays could be skipped. +// +// +++ Start Version ALFA 1.0 Patch 4 (v1.0.4) +// +// 04/04/03 +// +// Fixed a bug where spawn delays were ignored on placeables. +// Fixed P subflag of SD being ignored. +// Reset spawn delay after RS-failed spawn attempt +// Set up a new spawn delay when creature killed +// +// +++ Start Version ALFA 1.0 Patch 5 (v1.0.5) +// +// 04/07/03 +// +// Fixed bug in spawn_timefuncs that resulting in incorrect conversions +// in years other than the Epoch year. +// Changed the Epoch year to 1340 to conform to the lowest date in +// the NWN engine. +// +// +++ Start Version ALFA 1.0 Patch 6 (v1.0.6) +// +// 04/08/03 +// +// Fixed bug with corpse decay and death script flags not being available +// for camp spawns when onDeath notification occurs. +// +// +++ Start Version ALFA 1.0 Patch 7 (v1.0.7) +// +// 04/27/03 +// +// Added debugging for spawn delays and spawn counts that can be +// independently enabled/disabled for each area from the spawn banner +// rod. +// +// +++ Start Version ALFA 1.1 (v1.1) +// +// 04/28/03 +// +// Fixed bug in Loot Merchant code. The original code used +// GetNearestObjectByTag() to look up loot merchants, which according to +// the documentation should never have worked for merchants not in the same +// area as the creature spawned. In reality, it stopped working (at least +// in some cases) after Bioware released version 1.29 of the game. +// +// 05/03/03 +// +// Changed distribution method used for SR flag to evenly distribute +// spawns in the spawn circle instead. The old method made the spawns +// denser near the center and rarer near the circle's edge +// +// Made SF work (again?) for placeables +// +// When the SF flag is not specified for a multi-child spawn, a random +// SF is now calcualated independently for each child +// +// 05/08/03 +// +// Added NL (No Loot) flag. This suppresses looting of player corpses. +// Only applies when using ACR 1.14 and higher +// +// 05/25/03 +// +// Fixed overspawning bug caused by changing child counts on spawns that +// had been 'saved' with potentially different counts +// +// 05/27/03 +// +// Added C (Closest) subflag to the PR (Patrol Route) flag. If C is +// specified, the spawned creature will start at the closest waypoint +// rather than the first (does not apply to T2 flagged routes(random +// traverse)). +// +// 05/30/03 +// +// Added SB (Subdual) flag. Causes creatures to be spawned in in subdual +// mode. Only applies when using ACR 1.14 and higher. +// +// +// +++ Start Version ALFA 1.2 (v1.2) +// +// 08/24/03 +// +// Removed LocationToString() function from spawn_functions, as this is +// now a Bioware function +// +// 08/25/03 +// +// Modified the way the SX flag works. First, there is now a global flag, +// nGlobalSuppressDR, in spawn_cfg_global that can be set to determine +// whether or not creatures spawn in with DR on or off when no SX flag is +// specified. The current default is for DR to *not* be suppressed, i.e., +// it will be operational. Also, the SX flag can now take a value of 0 or 1. +// If 1, DR is suppressed, if 0 DR is enabled (useful if you've set +// nGlobalSuppressDR to 1). The default if no value is specified (just SX) +// is 1 (to suppress). You can also change this default in spawn_cfg_global. +// If nGlobalSuppressDR is 1 and nSuppressDR is 0, you will get the opposite +// of the v1.1 functionality; no DR on creatures, except when the SX flag is +// present. +// +// +++ Start Version ALFA 1.2.1 (v1.2.1) +// +// 09/01/03 +// +// Fixed bug where spawn number was always being set to the number of saved +// camp spawns on PC-flag restore instead of the sum of saved camp and +// regular spawn counts. +// +// +++ Start Version ALFA 1.2.2 (v1.2.2) +// +// 09/02/03 +// +// Fixed bug introduced by last bug fix that caused overspawning! +// +// +++ Start Version ALFA 1.2.3 (v1.2.3) +// +// 09/21/03 +// +// Added EL - E(ncounter) L(evel) flag +// +// +++ Start Version ALFA 1.2.4 (v1.2.4) +// +// 10/03/03 +// +// Added I subflag to SL flag. +// +// Modified ST behavior so that spawned creatures walk to their seats +// instead of running +// +// 10/18/03 +// +// Check night / day only, day, hour, lifespan and SU before restoring +// spawns +// +// Fixed recalculate random spawn number bug where the spawn number could +// change before a despawn due to the PC flag was restored, causing the +// number of creatures thought to exist to differ from what actually got +// restored +// +// 10/19/03 +// +// Fixed SD bug; under certain cases (such as a despawn due to CL flag) +// SD was being ignored. +// +// Fixed bug where SU|I only worked if RS or SL were in use +// +// +++ Start Version ALFA 1.2.5 (v1.2.5) +// +// 10/25/03 +// +// Do a ClearAllActions() before despawning creatures. This helps prevent +// 'broken' Bioware chairs caused by despawning creatures using the ST +// flag. +// +// 10/27/03 + +// Modified the spawn_cfg_camp example to use standard BW creatures / +// placeables for the benefit of non-ALFA users. +// +// +// 11/02/03 +// +// Added a scaled encounter example. This uses the same basic methodology +// as Sareena's random wilderness spawns - an SNxx flag is given large +// enough for the largest possible spawn and then the actual number (and +// types) of creatures is determined when the spawn actually takes place. +// +// +// +++ Start Version 8.0 +// +// Given that NESS is now being supported outside the ALFA umbrella, I've +// decided to begin version numbering from 8.0 from here out. Version 8.0 +// is the immediate successor to ALFA version 1.2.5. +// +// 01/19/04 +// +// Fixed problems with naked NPC corpses that had droppable armor / +// clothing. playable race characters (humans, dwarves, elves, etc.) +// now keep a copy of whatever is in the chest slot on the original +// corpse. +// +// +// 01/21/04 +// +// Added Rn subflag to CD to specify what type of remains are left after +// corpse decay. These correspond 1 to 1 to the treasure type field for +// placeables, except for R7, which causes no loot bag to be left (loot +// destroyed when corpse decays). See the specific flag documentation +// below for the values/types of each R subflag. +// +// Added D subflag to CD to cause corpse to drop wielded weapons on the +// ground. Note that droppable flag on weapon still takes precedence - +// non-droppable wielded weapons will not be dropped. +// +// Delete armor/clothing from corpse if looted. +// +// Added scripts for lootable corpse onOpen, onClosed, onUsed, and +// onDisturbed events (renamed with a spawn_ prefix). +// +// Added a lootable corpse placeable for each remains type; each has the +// correct event scripts attached. +// +// 01/22/04 +// +// Initialize global defaults and flags on first area heartbeat, not first +// heartbeat with PCs present. +// +// Use DelayCommand(0.0, ...) to give each spawn flag initialization +// function its own command queue (allowing many more spawn points before +// TMIs at initialization occur). +// +// 01/23/04 +// +// Fixed bug with EE flag. Spawned creature was not walking to spawn point +// after entrance. +// +// Fixed bug with spawn in effect when using EE. Spawn in effect now happens +// at the entrance point. +// +// Added support for ALFA-specific flags as Custom Flags (following the CF +// flag. Parsing and processing of custom flags can now be done by +// modifying spawn_cfg_cusflg. This file contains 2 functions: +// ParseCustomFlags() and SetupCustomFlags(). ParseCustomFlags is called +// with whatever flags follow the CF_ flag (when flags for the spawn are +// being initialized. Typically, flags are parsed and there values are +// written to the spawn object. SetupCustomFlags() is called when a +// creature is actually spawned (typically flags are copied from the spawn +// object to the creature (spawned) object. The processing of ALFA-specific +// flags are included in this file as an example. +// +// +// +++ Start Version 8.1 +// +// 1/29/04 +// +// Put better sounds for closing / opening corpses. Changed the names of +// the onOpen and onClose event scripts for corpses, and updated the corpse +// placeables to use those. +// +// 2/15/04 +// +// Fixed bugs in spawn_cfg_cusflag that caused flag values to be lost if +// specified as normal flags rather than custom flags (only affected the +// ALFA custom flags). +// +// 3/8/04 +// +// 'Home' is now either the place a creature spawned in, or the place it +// *would have spawned in* if there wasn't an alternate specified by the EE +// flag. Hopefully, this restores it to its original, correct behavior. +// +// The initial delay subflag of IS should now work correctly. +// +// The corpse remains type default value was using one variable name in +// spawn_defaults to set it and a different one in spawn_functions to +// retrieve the value, which resulted in the default not working. This has +// been fixed. +// +// Added 2 new Patrol Route flags at Danmar's request. They are RPn (for +// random pause and RRn for Random Route. These allow for some +// randomization of patrol routes. The RRn flag sets the percentage chance +// that the next stop in a route will actually be gone to (otherwise it's +// skipped. RPn specifies a range to randomly choose an additional pause +// amount which is added to the value specified by PSn. +// +// At EPOlson's request, NESS will now look for a local string variable on +// the spawn waypoint named "NESS" for spawn flags. If no string is found +// (or if it does not start with "SP") then the flags specified in the +// waypoint name are used (just like it used to). +// +// NESS now has full support for using pseudo-heartbeats as an alternative +// to the standard area heartbeats. For those who wish to use this, remove +// Spawn() from your area heartbeat script (or, if spawn_sample_hb is your +// area haertbeat script, just remove that script from your areas' On +// Heartbeat slots) and call Spawn_OnAreaEnter() and Spawn_OnAreaExit() +// from your area On Enter and On Exit scripts respectively. Again, if you +// do no currrent have On Enter and or On Exit scripts in use for your areas +// you can use spawn_smpl_onent and spawn_smpl_onext which are provided with +// this release. +// +// Spawn_OnAreaEnter() takes up to 3 optional arguments. The first is the +// name of the script you want called when the pseudo-heartbeat happens. +// By default, spawn_sample_hb is called (which in turn just calls Spawn(). +// You can put any script you like there, but remember that it will only be +// when PCs or NESS creatures are in the area. The second argument is the +// time between pseudo-heartbeats. The default is 6.0 seconds, which will +// result in Spawn() being called about as often as when you used regular +// area heartbeats. If you find you can get away with 10.0 seconds (that's +// what I'm currently using) you've reduced your NESS processing by 40%... +// The 3rd argument specifies a delay for the first heartbeat after a PC or +// PCs enter the area. In areas where there aren't a lot of spawns, and +// you are spawning in sight (like NPCs in a store) no delay is ideal. For +// outdoor areas with a lot of spawns that spawn away from the player, a +// delay helps prevent a spawn lag spike for the entering player. The +// default is 0.0 seconds (no delay). I'm currently delaying 3 seconds on +// all outdoor and underground areas, but no delay on indoor areas, by +// the following in my On Enter script: +// +// if ( GetIsAreaAboveGround( oCurrArea ) && +// ! GetIsAreaNatural( oCurrArea ) ) +// { +// // Indoors - no delay on the first HB +// Spawn_OnAreaEnter( "spawn_sample_hb", 10.0 ); +// } +// +// else +// { +// // Outdoors or underground - do a 3 second delay on the first HB +// Spawn_OnAreaEnter( "spawn_sample_hb", 10.0, 3.0 ); +// } +// +// Thanks to Mentha Arvensis who provided the starting scripts for pseudo- +// heartbeats. +// +// +// +++ Start Version 8.1.1 +// +// 2/1/04 - 5/28/04 +// +// +// NESS now allows you to specify the spawn tag by adding a variable, named +// "NESS_TAG", on the spawn waypoint. If this variable exists, it will use +// it's value as the spawn tag instead of waypoint's tag. +// +// Always retrieve spawn tag and spawn name from the variables written on +// the the spawn instead of using GetTag() an GetName(). This is necessary +// to support use of the "NESS" and "NESS_TAG" variables. +// +// Added a global flag, bLeftoversForceProcessing, to indicate whether or +// not spawned creatures in an area should cause NESS processing when no +// PCs are in the area. Default is TRUE (they do) which is how things +// worked before the flag was added. The flag essentially gives you the +// ability to suppress that behavior. To do so, set +// bLeftoversForceProcessing to FALSE in your spawn_cfg_global script. +// +// Added some bullet-proofing to check that spawn waypoints remain valid +// objects. +// +// Turned off ALL NESS processing of creatures that are DM possessed. +// +// Make sure a patrol waypoint actually exists before attempting to move to +// it. +// +// Normal Camp behavior is to despawn when all creatures in the camp have +// been destroyed. However, they were also despawning if there were never +// any creatures in the camp to begin with (a placeable-only camp). This +// was fixed. +// +// Loot/corpse decay was not working properly on camps, as the changes to +// this system to the regular spawns was never propagated to the camps. +// Fixed. +// +// +++ Start Version 8.1.2 +// +// 5/30/04 +// +// Advance routes to their next stop when patrol waypoints are missing +// +// +++ Start Version 8.1.3 +// +// 7/04/04 +// +// Write a local var onto entering PCs which can be checked on area exit +// to maintain a proper PC count. This is necessary because GetIsPC() does +// not work when a PC logs out. +// +// Don't call NESS_CleanInventory on camp placeables when a camp is +// destroyed, as the placeables may remain for a while. +// +// 7/05/04 +// +// Added code to detect stalled patrol routes and jump the creature to it's +// intended destination. This can be turned off by setting +// CheckForStuckPatrols global variable to FALSE. +// +// Write oSpawn onto the camp object "before" the call to SetCampSpawn() so +// it is available to that function. +// +// Added flag to turn off corpse destruction when CD is not specified. +// +// Added additional on area enter script with indoor/outdoor checking to +// determine if an initial delay should be used. +// +// 7/06/04 +// +// Added check to randomWalk for ACTION_CASTSPELL to avoid interruptions diff --git a/nwnds_module/spawn__readme.nss b/nwnds_module/spawn__readme.nss new file mode 100644 index 000000000..d2e4a463c --- /dev/null +++ b/nwnds_module/spawn__readme.nss @@ -0,0 +1,694 @@ +// +// +// NESS +// Version 8.1.2 +// Spawn Readme +// +// +// Neshke Narovken (Original Author) +// +// Cereborn (Maintainer) +// +//******************************************************************* +// +// +// INCLUDES: +// +// Do NOT Modify Main Script: +// +// Spawn: 'spawn_main' +// +// Do NOT Modify Helper Scripts: +// +// Information: 'spawn__readme' +// Functions: 'spawn_functions' +// Corpse Death: 'spawn_corpse_dth' +// Corpse Decay: 'spawn_corpse_dcy' +// Global Defaults: 'spawn_defaults' +// Flag Parsing: 'spawn_flags' +// Pseudo-heartbeat 'spawn_pseudohb" +// +// Lootable corpse event scripts: + +// Corpse On Open: 'spawn_onopencrp' +// Corpse On Closed: 'spawn_oncloscrp' +// Corpse disturbed: 'spawn_dist_corps' +// Corpse used: 'spawn_used_corps' +// +// +// CONFIGURATION: +// +// Modify Configuration Includes if Needed +// Only where Specified in Each File: +// +// Spawn Flags: 'spawn_cfg_flag' +// Spawn Groups: 'spawn_cfg_group' +// Loot Tables: 'spawn_cfg_loot' +// Spawn Camps: 'spawn_cfg_camp' +// Spawn Effects: 'spawn_cfg_fxsp' +// Area Effects: 'spawn_cfg_fxae' +// Object Effects: 'spawn_cfg_fxobj' +// User Defaults: 'spawn_cfg_global' +// Custom Flags: 'spawn_cfg_cusflg' +// +// Modify Check Includes if Needed +// Only where Specified in each File: +// +// Check PCs: 'spawn_chk_pcs' +// Custom Check: 'spawn_chk_custom' +// +// Modify Scripting Includes if Needed +// Only where Specified in Each File: +// +// Spawn/Despawn: 'spawn_sc_spawn' +// Heartbeat: 'spawn_sc_hbeat' +// Death: 'spawn_sc_death' +// Deactivation: 'spawn_sc_deactiv' +// Camp Trigger: 'spawn_sc_cmptrig' +// Patrol Stops: 'spawn_sc_patrol' +// +// +// USAGE: +// +// Add Following to Area Heartbeat: +// +// Sample Script: 'spawn_sample_hb' +// +// #include "spawn_main" +// Spawn(); +// +// Add Spawn Waypoints +// All Switches Optional +// +// Waypoint Name: +// SP_ +// +// Waypoint Tag: +// Child Object Tag/ResRef +// Group Designation +// Camp Designation +// +// Note: +// For Custom Creatures +// You must use the ResRef +// +// Available Flags: +// SPnOn_ISnDn_IDn_FTn_SNnMn_SAnMn_SRnMnP_SDnMn_CLnMn +// _RGnMnCn_RWRn_DYnTn_HRnTn_DOD_NOD_PCnR_SF_SUnIn_FXnDn +// _PRnTn_PLnTn_EEnRn_EXnRn_SG_CDnTnRnD_LTnAnBnCn_DSnSn_DIn_CMDn +// _SSnDn_CCn_CPnRn_TRnDn_AEnDn_OEnDn_RSn_FCn +// _ALnSn_HBn_SLnRnI_RHDn_DTn_HLnE_IT_ST_PT_SM_CF +// _SXn_NL_SB_ELn +// +// +// Format: +// Flag|OptionalFlag +// +// +// SPn|On +// : Designates Spawn Waypoint +// : SP is Required on all Spawn Waypoints +// : Performs Spawn processing every SP1 to SP99 heartbeats +// : Default is SP1 Heartbeat : ~6 Seconds +// : SP00 Defaults to SP01 +// : Optional Flag: On +// : Offset processing spawn from first process by n heartbeats. +// : Used to stagger spawn processing within an area +// +// ISn|Dn +// : Initial State +// : Type 0 : Inactive +// : Type 1 : Default : Active +// : Optional Flag: D000 +// : Delay Initial Spawn D000 Minutes +// +// IDn +// : SpawnID +// : Sets LocalInt "SpawnID" to SpawnID +// : On Spawn Waypoint Object +// +// FTn +// : Flag Table +// : Use Flags from Table FT00 +// : Flags are Defined in 'spawn_cfg_flag' +// +// +// SNn|Mn +// : Spawn Number +// : Maintains a Spawn of SN00 to SN99 Children +// : Despawns Extra Children +// : Optional Flag: M00 +// : Minimum Children +// : Will Randomly Spawn between M00 and SN00 Children +// +// SA|n|Mn +// : Spawn All at Once +// : Default is Spawn One Child per Cycle +// : Optional Flag: 00 +// : Spawn 00 Children per Cycle +// : Optional Flag: M00 +// : Spawn Minimum M00 per Cycle +// +// SRn|Mn|P +// : Spawn Radius +// : Randomly Spawns Children in a +// : Location SR00 to SR99 Meters from Waypoint +// : Optional Flag: M00 +// : Minimum Radius, M00 to SR99 Meters +// : Optional Flag: P +// : Spawn Center is Near a Random PC in Area +// +// SDn|Mn|P +// : Spawn Delay +// : Delay SD00 to SD99 Minutes between Spawns +// : Optional Flag: M00 +// : Minimum Delay, M00 to SD99 Minutes +// : Optional Flag: P +// : This flag sets up a spawn period, whereas the default spawn delay +// : specifies a spacing between spawns. +// : This is particularly useful with PL3 (keep the times the same on +// : each) it will cause the placeable to refresh if alive or respawn +// : if not on a regular schedule. Note that if the P subflag is used, +// : the M subflag is ignored. +// +// +// CLn|Mn +// : Child Lifespan +// : Child will Despawn after CL00 Minutes +// : Optional Flag: M00 +// : Child will Despawn after M00 to CL00 Minutes +// +// DYn|Tn +// : Spawn Day +// : Spawn Only on Day DY00 to DY28 +// : Children are Despawned during Invalid Days +// : Optional Flag: T00 +// : Spawn from Day DY00 to Day T00 +// +// HRn|Tn +// : Spawn Hour +// : Spawn Only during Hour HR00 to HR24 +// : Children are Despawned during Invalid Hours +// : Optional Flag: T00 +// : Spawn from Hour HR00 to Hour T00 +// +// DO|D +// : Day Only +// : Only Spawns at Day +// : Optional Flag: D +// : Despawn Children at Nightfall +// +// NO|D +// : Night Only +// : Only Spawns at Night +// : Optional Flag: D +// : Despawn Children at Daybreak +// +// RW|Rn +// : Random Walk +// : Children Wander Randomly +// : Optional Flag: R00 +// : WARNING: This is Resource Intensive!! +// : Wander Range, R00 to R99 Meters +// +// PC|n|R +// : PC Check +// : Only Spawn Children if PCs are in Area +// : Children are Despawned if no PCs in Area +// : Optional Flag: PC00 +// : Depawn if no PCs in Area for PC00 Minutes +// : Optional Flag: R +// : Reset Spawn Point if no PCs are Present +// +// RGn|Mn|Cn +// : Random Gold +// : Generates Random Amount of Gold on Children +// : From RG000 to RG999 Gold +// : Optional Flag: M00 +// : Minimum Gold Amount +// : Optional Flag: C00 +// : Gold Chance C00% to C99% +// : Default 100% chance +// +// SF +// : Spawn Facing +// : Set Facing of Children to Match Waypoint +// : Default Random Facing +// +// SUn|In +// : Spawn Unseen +// : Only Spawn if PCs are not within SU00 to SU99 Meters +// : Optional flag: I00 +// : Use the location of each individual child to determine if that +// : child can spawn, instead of using to location of the spawn itself. +// : If using SR or SL|R, I00 to I99 additional random locations will be +// : attempted +// +// FXn|Dn +// : Spawn Effect +// : Spawn in with Effect FX001 to FX999 +// : Effects are Defined in 'spawn_cfg_fxsp' +// : Optional Flag: D000 +// : Despawn with Effect D001 to D999 +// +// PRn|Tn|C +// : Patrol Route +// : Assign Waypoints Route PR00 to PR99 +// : Optional Flag: T0 +// : Route Type +// : 0 - Sequential +// : 1 - Circular +// : 2 - Random +// : 3 - Walk Once/Despawn +// : Optional Flag C +// : Start at closest waypoint. Does not apply to T2 (random) +// : +// : Route Name: Variable +// : Route Tag: PR00_SN00_PS000_RN_FC_DO_NO_SC000 +// : +// : PR - Route Number 00 to 99 +// : SN - Stop Number 00 to 99 +// : PS - Pause 000 to maxint seconds at Stop +// : RP - Random additional amount (0 - maxint) added to PS +// : RN - Run to Stop +// : RR - Percentage chance a Stop will be visited (skipped otherwise) +// : SF - Face the Waypoint Direction +// : DO - Only Stop here during the Day +// : NO - Only Stop here during the Night +// : SC - Run script 000 to 999 +// : Scripts are Defined in 'spawn_sc_patrol' +// +// EEn|Rn +// : Entrance/Exit +// : Enter and Exit at Waypoint EE00 +// : Optional Flag: R +// : Choose Random Entrance Exit +// : from R00 to EE00 +// : +// : Entrance/Exit Name: Variable +// : Entrance/Exit Tag: EE00 +// +// EXn|Rn +// : Exit +// : Exit at Waypoint EX00 +// : Optional Flag: R +// : Choose Random Exit +// : from R00 to EX00 +// : +// : Exit Name: Variable +// : Exit Tag: EX00 +// +// PLn|Tn|Pn +// : Placeable Object +// : Spawns a Placeable Object with Behavior +// : Behavior 0: Default Behavior +// : Behavior 1: Despawn if Empty +// : Behavior 2: Refill if Empty (after spawn delay minutes!) +// : Behavior 3: Refresh (despawn/respawn) every P000 minutes; default +// : (if no Pn specified) is 60 minutes +// : Optional Flag: T00 +// : Trap Disabled Chance +// : 00% to 99% chance of Trap Disabled +// : Trap must already be part of Placeable's Template +// : Default 100% Chance Trap is Disabled +// : Optional Flag: P00 +// : Refresh period (in minutes) +// +// SG +// : Spawn Group +// : Spawn Children from Group +// : Waypoint Tag is Defined Group +// : Groups are Defined in 'spawn_cfg_group' +// +// CDn|Tn|Rn|D +// : Corpse Decay +// : Decay Corpse after CD000 to CD999 Seconds +// : Default No Corpse, Standard Loot Bag +// : Optional Flag: T +// : Corpse Inventory Type +// : Type 0: Inventory Items +// : Type 1: Inventory & Equipped Items +// : Type 2: Inventory Items, if PC Killed +// : Type 3: Inventory & Equipped Items, if PC Killed +// : Optional Flag: R +// : Remains Type +// : Type 0: Loot bag +// : Type 1: Body +// : Type 2: Bones +// : Type 3: Potion +// : Type 4: Pouch +// : Type 5: Scroll +// : Type 6: Treasure +// : Type 7: None (destroy loot on decay) +// : Optional Flag: D +// : Drop wielded weapons +// +// LTn|An|Bn|Cn +// : Loot Table +// : Spawn Loot on Children from Table LT000 to LT999 +// : Loot Tables are Defined in 'spawn_cfg_loot' +// : LT500 to LT999 currently reserved for merchant-based +// : loot tables +// : Optional Flag: A000 +// : When using merchant-based loot tables, the percentage chance that +// : only 1 item will spawn. Default is 50%. Values over 100% are truncated +// : to 100% +// : Optional Flag: B000 +// : When using merchant-based loot tables, the percentage chance that +// : 2 items will spawn. Default is 15%. Values over 100% are truncated +// : to 100% +// : Optional Flag: C000 +// : When using merchant-based loot tables, the percentage chance that +// : 3 items will spawn. Default is 05%. Values over 100% are truncated +// : to 100% +// +// DSn|Sn +// : Deactivate Spawn +// : Deactivate Spawn based on Condition +// : Type 0: Deactivate if all Children are Dead +// : Type 1: Deactivate if Spawn Number has been Spawned +// : Type 2: Deactive Spawn until all Children are Dead +// : Type 3: Deactivate Spawn after DI00 Children +// : Type 4: Deactivate Spawn after DI00 Minutes +// : Type 5: Deactivate Spawn after DI00 Cycles +// : Type 6: Deactivate when Spawn Count == Spawn Number +// : Optional Flag: S000 +// : Run Script 000 to 999 when Spawn Deactivated +// : Scripts are Defined in 'spawn_sc_deactiv' +// : +// : Can Reactivate by Manually Calling: +// : SetLocalInt(oSpawn, "SpawnDeactivated", FALSE); +// +// DIn +// : Deactivation Information +// +// CM|Dn +// : Spawn Camp +// : Spawns Camp of Creatures and Placeables +// : Waypoint Tag is Defined Camp +// : Despawns Camp when all Children Dead +// : Camps are Defined in 'spawn_cfg_camp' +// : Optional Flag: D000 +// : Placeables Decay 000 Seconds after Camp Despawn +// : +// : Camp Children Flags: +// : +// : RW : Random Walk +// : SF : Spawn Facing Camp +// : SG : Spawn Group +// : LT00 : Loot Table +// : CD000|T0 : Corpse Decay +// : PL0|T00 : Placeable Type +// : Placeable Trap Disabled +// +// SSn|Dn +// : Spawn Script +// : Run Script 001 to 999 on Spawn +// : Scripts are Defined in 'spawn_sc_spawn' +// : Optional Flag: D000 +// : Run Script 001 to 999 on Despawn +// +// DTn +// : Death Script +// : Run Script 001 to 999 on Death +// : Scripts are Defined in 'spawn_sc_death' +// +// CPn|Rn +// : Spawn Check PCs +// : Check Custom Code to see if Spawn Proceeds +// : Custom Code is Defined in 'spawn_chk_pcs' +// : Optional Flag: R00 +// : Check all PCs in Radius R00 +// : Default Check all PCs in Area +// +// CCn +// : Spawn Check Custom +// : Check Custom Code to see if Spawn Proceeds +// : Custom Code is Defined in 'spawn_chk_custom' +// +// TRn|Dn +// : Spawn Trigger +// : Only Spawns if PC is within 00 Meters +// : Optional Flag: D00 +// : Despawns if PC is not within D00 Meters +// +// AEn|Dn +// : Spawn Area Effect +// : Area Effects are Defined in 'spawn_cfg_fxae' +// : Waypoint Tag can be "AE" to Spawn only Area Effect +// : Optional Flag: D000 +// : Area Effect Duration of 000 to 999 Seconds +// : Duration of 000 means Permanent Area Effect +// : Default Duration is 005 Seconds +// +// OEn|Dn +// : Object Effect +// : Object Effects are Defined in 'spawn_cfg_fxobj' +// : Optional Flag: D000 +// : Object Effect Duration of 000 to 999 Seconds +// : Duration of 000 means Permanent Object Effect +// : Default Duration is Permanent +// +// RSn +// : Random Spawn +// : Percentage Chance Spawn will Occur +// : Default 100% Chance +// +// FCn +// : Spawn Faction +// : Change Faction of Children: +// : Faction 0: COMMONER +// : Faction 1: DEFENDER +// : Faction 2: MERCHANT +// : Faction 3: HOSTILE +// : Faction 4: CUSTOM +// : Change Faction to Same as Nearest +// : Object with Tag 'SpawnFaction' +// +// ALn|Sn +// : Spawn Alignment +// : Shift Alignment of Children +// : Alignment 0: Neutral +// : Alignment 1: Law +// : Alignment 2: Chaos +// : Alignment 3: Good +// : Alignment 4: Evil +// : Alignment 5: All +// : Optional Flag: S00 +// : Shift Alignment by S00 +// : Default Shift by 10 +// +// HBn +// : Heartbeat Script +// : Children will Run Script HB000 each Cycle +// : Scripts are Defined in 'spawn_sc_hbeat' +// +// SLn|Rn|I +// : Spawn Location +// : Spawn Children at Waypoint SL00 +// : Optional Flag: R +// : Choose Random Location +// : from R00 to SL00 +// : Optional Flag: I +// : When spawning multiple children, each child takes the next +// : waypoint, In order - (first child spawns at SL00, next at SL01, etc.) +// : +// : Location Name: Variable +// : Location Tag: SL00 +// +// RH|Dn +// : Return Home +// : Child will always Return to Home +// : Optional Flag: D00 +// : Child will Return to Home +// : Only if further than D00 Meters +// +// HL|n|E +// : Heal Children if Not in Combat +// : Optional Value: 00 +// : Heal 00% per Cycle +// +// IT +// : Spawn Item +// : Spawnpoint Tag is Item Template +// +// ST +// : Spawn Sit +// : Children will Sit in Nearest Unoccupied Sittable +// : Sittable's Tag must be 'Seat' +// +// PT +// : Spawn Plot +// : Sets Children as Plot +// +// SM +// : Spawn Merchant +// : Spawnpoint Tag is Merchant Template +// +// CF +// : Custom Flag +// : Everything in Spawn Name after CF +// : Is Stored in LocalString "CustomFlag" +// : On Each Spawned Child +// +// +// +// + +// +// Functions for external control. Please use these when possible instead +// of modifying variables directly in NESS. +// +// object NESS_GetSpawnByID(int nSpawnID, object oArea) +// : Returns the spawn waypoint in area oArea with ID nSpawnID +// +// void NESS_ActivateSpawnByID(int nSpawnID, object oArea) +// : Activates the spawn in area oArea with ID nSpawnID +// +// void NESS_DeactivateSpawnByID(int nSpawnID, object oArea) +// : Deactivates the spawn in area oArea with ID nSpawnID +// +// void NESS_ActivateSpawn(object oSpawn) +// : Activates spawn oSpawn +// +// void NESS_DeactivateSpawn(object oSpawn) +// : Deactivates spawn oSpawn +// +// void NESS_ForceProcess(object oSpawn) +// : Force spawn oSpawn to be processed next heartbeat (regardless of +// : SPxx value) +// +// void NESS_TrackModuleSpawns(int nFlag=TRUE) +// : Enable (nFlag == TRUE) or Disable (nFlag == FALSE) Spawn Tracking +// +// int NESS_IsModuleSpawnTracking() +// : Returns TRUE is spawn tracking is enabled, FALSE otherwise +// +// +// Some Tips and Pointers +// - with Thanks to Eliha for Creating this Section +// +// 1. The .erf script files we import for NWN usually contain .nss and +// .utp files. +// +// 1.1. The .nss files are the Nwn Source Scripts that are in plain text that +// we manipulate in the script editor. +// +// 1.2. The .utp file(s) are objects such as an invisible corpse object that +// automatically gets put in the right column of the toolset where you select +// the creatures, doors, placeables, etc. under the custom button. +// +// 2. After importing the .erf and ignoring that it couldn't find the .ncs files +// you'll need to save your module then reopen it for the new scripts to appear +// in the left column (due to the lack of a refresh button). +// +// 3. When working in the various configuration scripts you only need to save +// them, not compile them. They are just add-ons to the main spawn_sample_hb.nss +// script and attempts to compile them will result in errors. The spawn_sc_xxxx +// files will compile but even they should just be saved like all the other +// spawn_cfg_xxxx scripts. +// +// 4. When finished editing and saving the various configuration scripts you +// will then need to open the spawn_sample_hb script and compile it to integrate +// your new changes into the system. If you customized your scripts, saved them, +// saved the module, then loaded the game and find nothings working....chances are +// you forgot to compile the spawn_sample_hb script after making your changes. +// +// 5. You can usually tell which script needs to be compiled by noticing which +// one needs to be put in an area heartbeat or on an object somewhere, etc.. In +// this case, we are adding the spawn_sample_hb to the area heartbeat so it is the +// main file and requires compiling. +// + + +// +// Package Header +// +/* +NESS Version 8.1.1 + +Cereborn + +See 'spawn__readme' for Instructions +Ignore all 'Missing Resource' Errors +See the NWN Forums for More Info + +Spawn Package: + + NESS Scripts: +- spawn__readme +- spawn__history +- spawn_cfg_camp +- spawn_cfg_flag +- spawn_cfg_fxae +- spawn_cfg_fxobj +- spawn_cfg_fxsp +- spawn_cfg_global +- spawn_cfg_group +- spawn_cfg_loot +- spawn_cfg_cusflg +- spawn_chk_pcs +- spawn_chk_custom +- spawn_corpse_dcy +- spawn_corpse_dth +- spawn_defaults +- spawn_dist_corps +- spawn_flags +- spawn_functions +- spawn_main +- spawn_onopencrp +- spawn_oncloscrp +- spawn_pseudohb +- spawn_sample_hb +- spawn_sc_cmptrig +- spawn_sc_deactiv +- spawn_sc_death +- spawn_sc_patrol +- spawn_sc_spawn +- spawn_smpl_onent +- spawn_smpl_onext +- spawn_timefuncs +- spawn_used_corps + + NESS Resources: +- invis_corpse_obj +- invis_corpse_bdy +- invis_corpse_bon +- invis_corpse_pot +- invis_corpse_pch +- invis_corpse_ser +- invis_corpse_tre + + Spawn Banner Scripts: +- spawnb_cc_activ +- spawnb_cc_dactiv +- spawnb_cc_dump +- spawnb_cc_nodump +- spawnb_cc_notrck +- spawnb_cc_nsclog +- spawnb_cc_nsdlog +- spawnb_cc_sclog +- spawnb_cc_sdlog +- spawnb_cc_trck +- spawnb_main +- spawnb_sample_ai +- spawnb_sc_activ +- spawnb_sc_dactiv +- spawnb_sc_disp +- spawnb_sc_dump +- spawnb_sc_nodump +- spawnb_sc_notrck +- spawnb_sc_nsdlog +- spawnb_sc_sclog +- spawnb_sc_sdlog +- spawnb_sc_snclog +- spawnb_sc_trck + + Spawn Banner Resources: +- spawn_ban_rod.uti +- spawn_banner.dlg +- spawn_ban_a.utp +- spawn_ban_d.utp + + +*/ diff --git a/nwnds_module/spawn_ban_a.utp b/nwnds_module/spawn_ban_a.utp new file mode 100644 index 000000000..f72fdfa28 Binary files /dev/null and b/nwnds_module/spawn_ban_a.utp differ diff --git a/nwnds_module/spawn_ban_d.utp b/nwnds_module/spawn_ban_d.utp new file mode 100644 index 000000000..8126913e6 Binary files /dev/null and b/nwnds_module/spawn_ban_d.utp differ diff --git a/nwnds_module/spawn_ban_rod.uti b/nwnds_module/spawn_ban_rod.uti new file mode 100644 index 000000000..ca5a3efa6 Binary files /dev/null and b/nwnds_module/spawn_ban_rod.uti differ diff --git a/nwnds_module/spawn_banner.dlg b/nwnds_module/spawn_banner.dlg new file mode 100644 index 000000000..6c8f81f43 Binary files /dev/null and b/nwnds_module/spawn_banner.dlg differ diff --git a/nwnds_module/spawn_cfg_camp.nss b/nwnds_module/spawn_cfg_camp.nss new file mode 100644 index 000000000..034d56b9e --- /dev/null +++ b/nwnds_module/spawn_cfg_camp.nss @@ -0,0 +1,134 @@ +// +// Spawn Camp +// +// +// CampNumP +// CampNumC +// CampRadius +// CampTrigger +// CampTriggerScript +// +// RW : Random Walk +// SF : Spawn Facing Camp +// SG : Spawn Group +// LT00 : Loot Table +// CD000|T0 : Corpse Decay +// PL0|T00 : Placeable Trap Disabled +// DT000 : Death Script +// RH000 : Return Home +// +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void SetCampSpawn(object oCamp, string sCamp, location lCamp) +{ + +// +// Place Custom Camps Here +// ------------------------------------------- + + + // Example Camp + // One Campfire and 4 Goblins + if (sCamp == "goblincamp") + { + + // Set Number of Placeables + SetLocalInt(oCamp, "CampNumP", 2); + // Set Number of Creatures + SetLocalInt(oCamp, "CampNumC", 4); + // Set Radius of Camp + SetLocalFloat(oCamp, "CampRadius", 10.0); + + // Set Creature 0 to be Trigger + // Script 00 : Kill him and the Camp Despawns + SetLocalString(oCamp, "CampTrigger", "C0"); + SetLocalInt(oCamp, "CampTriggerScript", 0); + + // Set Placeable 0 to be Camp Center + SetLocalString(oCamp, "CampCenter", "P0"); + + // Set Placeable 0 and Spawn Flags + // First Placeable always Spawns at Center of Camp + // If CampCenter Is Not Set + SetLocalString(oCamp, "CampP0", "plc_campfrwspit"); + SetLocalString(oCamp, "CampP0_Flags", "SP_SF"); + + // Set Placeable 1 and Spawn Flags + SetLocalString(oCamp, "CampP1", "plc_chest1"); + SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30"); + + // Set Creature 0 and Spawn Flags + SetLocalString(oCamp, "CampC0", "NW_GOBCHIEFB"); + SetLocalString(oCamp, "CampC0_Flags", "SP_RW_CD60_RH30"); + + // Set Creature 1 and Spawn Flags + SetLocalString(oCamp, "CampC1", "goblins_low"); + SetLocalString(oCamp, "CampC1_Flags", "SP_SF_SG_CD60_RH"); + + // Set Creature 2 and Spawn Flags + SetLocalString(oCamp, "CampC2", "goblins_low"); + SetLocalString(oCamp, "CampC2_Flags", "SP_SF_SG_CD60_RH"); + + // Set Creature 3 and Spawn Flags + SetLocalString(oCamp, "CampC3", "goblins_low"); + SetLocalString(oCamp, "CampC3_Flags", "SP_SF_SG_CD60_RH"); + } + else if (sCamp == "demoncamp") + { + + // Set Number of Placeables + SetLocalInt(oCamp, "CampNumP", 2); + // Set Number of Creatures + SetLocalInt(oCamp, "CampNumC", 4); + // Set Radius of Camp + SetLocalFloat(oCamp, "CampRadius", 5.0); + + // Set Creature 0 to be Trigger + // Script 00 : Kill him and the Camp Despawns + SetLocalString(oCamp, "CampTrigger", "C0"); + SetLocalInt(oCamp, "CampTriggerScript", 0); + + // Set Placeable 0 to be Camp Center + SetLocalString(oCamp, "CampCenter", "P0"); + + // Set Placeable 0 and Spawn Flags + // First Placeable always Spawns at Center of Camp + // If CampCenter Is Not Set + SetLocalString(oCamp, "CampP0", "plc_campfrwspit"); + SetLocalString(oCamp, "CampP0_Flags", "SP_SF"); + + // Set Placeable 1 and Spawn Flags + SetLocalString(oCamp, "CampP1", "plc_chest1"); + SetLocalString(oCamp, "CampP1_Flags", "SP_PL3T80P30"); + + // Set Creature 0 and Spawn Flags + SetLocalString(oCamp, "CampC0", "NW_DEMON"); + SetLocalString(oCamp, "CampC0_Flags", "SP_RW"); + + // Set Creature 1 and Spawn Flags + SetLocalString(oCamp, "CampC1", "NW_DEMON"); + SetLocalString(oCamp, "CampC1_Flags", "SP_SF"); + + // Set Creature 2 and Spawn Flags + SetLocalString(oCamp, "CampC2", "NW_DEMON"); + SetLocalString(oCamp, "CampC2_Flags", "SP_SF"); + + // Set Creature 3 and Spawn Flags + SetLocalString(oCamp, "CampC3", "NW_DEMON"); + SetLocalString(oCamp, "CampC3_Flags", "SP_SF"); + } + // + + +// ------------------------------------------- +// +} diff --git a/nwnds_module/spawn_cfg_cusflg.nss b/nwnds_module/spawn_cfg_cusflg.nss new file mode 100644 index 000000000..8ff8fd013 --- /dev/null +++ b/nwnds_module/spawn_cfg_cusflg.nss @@ -0,0 +1,114 @@ +// +// NESS V8.1 +// Spawn Config Custom Flags +// +// This file is for the USER to to add support for custom flags. It will +// normally not be overwritten by UPDATE releases, so remerging can be avoided. +// +// ALFA and LoG Custom Flags (included here both as examples and to aid +// ALFA builders in switching over to the new methodology) +// +// SXn +// : Suppress XP +// : Suppress diminishing returns XP +// : SX1 turns suppression on (the default, you may just use SX) +// : SX0 turns suppression off for the spawn if it has been put on +// : globally (by setting nGlobalSuppressDR to TRUE in spawn_cfg_global) +// +// NL +// : No Loot +// : Suppress player corpse looting +// +// SB +// : SuBdual +// : Spawn creatures in in subdual mode +// +// ELn +// : Encounter Level +// : Set the encounter level for a spawn +// : This is used by the ALFA core rules in determining whether or not +// : an encounter should result in XP to a given level party. If not +// : specified, the CR of the creature killed is used as the EL. +// +// + +#include "spawn_flags" + +void ParseCustomFlags(object oSpawn, string sFlags) +{ + // Get Defaults. You can set defaults for your custom flags in + // spawn_cfg_global + object oModule = GetModule(); + + int dfSuppressDR = GetLocalInt(oModule, "df_SuppressDR"); + int dfGlobalSuppressDR = GetLocalInt(oModule, "df_GlobalSuppressDR"); + int dfEncounterLevel = GetLocalInt(oModule, "df_EncounterLevel"); + + + // NOTE: Because of the unique nature of these flags being present as both + // standard flags and custom flags (for back compatibility) only write flags + // if they're present!! + + // Initialize Dim Returns Suppression + int nSuppressDimReturns = IsFlagPresent(sFlags, "SX"); + + if (nSuppressDimReturns) + { + // If the flag is present, get suppression mode from its value + nSuppressDimReturns = GetFlagValue(sFlags, "SX", dfSuppressDR); + SetLocalInt(oSpawn, "f_SuppressDimReturns", nSuppressDimReturns); + } + + // Initialize Loot Suppression + int nSuppressLooting = IsFlagPresent(sFlags, "NL"); + + // Record Loot Suppression + if (nSuppressLooting) + { + SetLocalInt(oSpawn, "f_SuppressLooting", nSuppressLooting); + } + + // Initialize Subdual Mode + int nSubdualMode = IsFlagPresent(sFlags, "SB"); + + // Record Subdual Mode + if (nSubdualMode) + { + SetLocalInt(oSpawn, "f_SubdualMode", nSubdualMode); + } + + int nEncounterLevel; + + // Initialize Encounter Level + if (IsFlagPresent(sFlags, "EL")) + { + nEncounterLevel = GetFlagValue(sFlags, "EL", dfEncounterLevel); + SetLocalInt(oSpawn, "f_EncounterLevel", nEncounterLevel); + } +} + +void SetupCustomFlags(object oSpawn, object oSpawned) +{ + int nSuppressLooting = GetLocalInt(oSpawn, "f_SuppressLooting"); + int nSubdualMode = GetLocalInt(oSpawn, "f_SubdualMode"); + int nEncounterLevel = GetLocalInt(oSpawn, "f_EncounterLevel"); + + + // Set up loot suppression + if (nSuppressLooting) + { + SetLocalInt(oSpawned, "DoNotLoot", TRUE); + } + + // Set up subdual mode + if (nSubdualMode) + { + SetLocalInt(oSpawned, "SubdualMode", TRUE); + } + + // Set up encounter level + if (nEncounterLevel > 0) + { + SetLocalInt(oSpawned, "AlfaEncounterLevel", nEncounterLevel); + } +} diff --git a/nwnds_module/spawn_cfg_flag.nss b/nwnds_module/spawn_cfg_flag.nss new file mode 100644 index 000000000..d72b6013e --- /dev/null +++ b/nwnds_module/spawn_cfg_flag.nss @@ -0,0 +1,116 @@ +// +// Spawn Flags +// +void SpawnFlags(object oSpawn, int nFlagTableNumber) +{ + // Initialize Values + string sSpawnName = GetName(oSpawn); + string sSpawnTag = GetTag(oSpawn); + string sFlags, sTemplate; + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Sample Complex Replacement + // Using FT without FT00 will + // Default to nFlagTableNumber 0 + // if (nFlagTableNumber == 0) + // { + // // Old Method of using SpawnTag + // if (sSpawnTag == "myspawns") + // { + // sFlags = "SP_SN02_SA_RW"; + // sTemplate = "NW_DOG"; + // } + + // if (sSpawnTag == "undead") + // { + // sFlags = "SP_SNO4"; + // sTemplate = "NW_ZOMBIE01"; + // } + // } + // + + // Sample Simple Replacement Flag + // Completely Replaces Flags + // On Spawnpoints with FT01 + // FIELDS sligs/fieldsbandits + if (nFlagTableNumber == 0) + { + sFlags = "_SN02_SA_SD03M01_PR00T2_LT16_PCR"; + } + // + + // ashen wastes giants/ + if (nFlagTableNumber == 1) + { + sFlags = "_SN06M03_SA_SD03M01_PCR"; + } + // + // GREAT SPYRE + + if (nFlagTableNumber == 2) + { + sFlags = "_SG_SN02_SA_SD03M01_SL14R01_PCR"; + + } +//Gskeletons + if (nFlagTableNumber == 3) + { + sFlags = "_SN02_SA_SD03M01_LT00_SL14R01_PCR"; + + } +//Magera + if (nFlagTableNumber == 4) + { + sFlags = "_SN03M01_SA_SD03M01_LT03_SL14R01_PCR"; + + } + // apprenticedefilers - sligs + if (nFlagTableNumber == 5) + { + sFlags = "_SN02_SA_SD03M01_PCR"; + + } + + // mummies + if (nFlagTableNumber == 6) + { + sFlags = "_SN03_SA_SD03M01_LT17_PCR"; + + } + // Sample Template Flags + // These Flags Get Added + // // To Spawnpoints with FT02 + // if (nFlagTableNumber == 2) + // { + // sFlags = "_RW_PC05R"; +// } + // + + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Record Values + if (sFlags != "") + { + SetLocalString(oSpawn, "f_Flags", sFlags); + } + else + { + SetLocalString(oSpawn, "f_Flags", sSpawnName); + } + if (sTemplate != "") + { + SetLocalString(oSpawn, "f_Template", sTemplate); + } + else + { + SetLocalString(oSpawn, "f_Template", sSpawnTag); + } +} diff --git a/nwnds_module/spawn_cfg_fxae.nss b/nwnds_module/spawn_cfg_fxae.nss new file mode 100644 index 000000000..72198bf27 --- /dev/null +++ b/nwnds_module/spawn_cfg_fxae.nss @@ -0,0 +1,75 @@ +// +// Spawn AreaEffect +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +effect SpawnAreaEffect(object oSpawn) +{ + // Initialize Variables + effect eAreaEffect; + + // Initialize Values + int nSpawnAreaEffect = GetLocalInt(oSpawn, "f_SpawnAreaEffect"); + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + // AreaEffect 00 + // Dummy AreaEffect - Never Use + if (nSpawnAreaEffect == 0) + { + return eAreaEffect; + } + // + + // Web, only Visual + if (nSpawnAreaEffect == 1) + { + eAreaEffect = EffectAreaOfEffect(AOE_PER_WEB, "****", "****", "****"); + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Return the AreaEffect + return eAreaEffect; +} + +/* +0 - AOE_PER_FOGACID +1 - AOE_PER_FOGFIRE +2 - AOE_PER_FOGSTINK +3 - AOE_PER_FOGKILL +4 - AOE_PER_FOGMIND +18 - AOE_MOB_UNEARTHLY +19 - AOE_MOB_MENACE +20 - AOE_MOB_UNNATURAL +21 - AOE_MOB_STUN +22 - AOE_MOB_PROTECTION +23 - AOE_MOB_FIRE +24 - AOE_MOB_FROST +25 - AOE_MOB_ELECTRICAL +26 - AOE_PER_FOGGHOUL +27 - AOE_MOB_TYRANT_FOG +28 - AOE_PER_STORM +29 - AOE_PER_INVIS_SPHERE +30 - AOE_MOB_SILENCE +31 - AOE_PER_DELAY_BLAST_FIREBALL +32 - AOE_PER_GREASE +33 - AOE_PER_CREEPING_DOOM +35 - AOE_MOB_INVISIBILITY_PURGE +*/ diff --git a/nwnds_module/spawn_cfg_fxobj.nss b/nwnds_module/spawn_cfg_fxobj.nss new file mode 100644 index 000000000..4b7809dfe --- /dev/null +++ b/nwnds_module/spawn_cfg_fxobj.nss @@ -0,0 +1,55 @@ +// +// Spawn ObjectEffect +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +effect ObjectEffect(object oSpawn) +{ + // Initialize Variables + effect eObjectEffect; + + // Initialize Values + int nObjectEffect = GetLocalInt(oSpawn, "f_ObjectEffect"); + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // ObjectEffect 00 + // Dummy ObjectEffect - Never Use + if (nObjectEffect == 0) + { + return eObjectEffect; + } + // + + // Bard's Song + if (nObjectEffect == 1) + { + eObjectEffect = EffectVisualEffect(VFX_DUR_BARD_SONG); + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Return the ObjectEffect + return eObjectEffect; +} + +/* + +*/ diff --git a/nwnds_module/spawn_cfg_fxsp.nss b/nwnds_module/spawn_cfg_fxsp.nss new file mode 100644 index 000000000..31bf2e986 --- /dev/null +++ b/nwnds_module/spawn_cfg_fxsp.nss @@ -0,0 +1,253 @@ +// +// Spawn Effect +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +int SpawnEffect(object oSpawn, int nSpawnEffect, int nDespawnEffect) +{ + // Initialize + int nEffect; + int nEffectNumber; + + // Initialize Values + if (nSpawnEffect == TRUE) + { + nEffectNumber = GetLocalInt(oSpawn, "f_SpawnEffect"); + } + else if (nDespawnEffect == TRUE) + { + nEffectNumber = GetLocalInt(oSpawn, "f_DespawnEffect"); + } + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Effect 00 + // Dummy Effect - Never Use + if (nEffectNumber == 0) + { + return nEffect; + } + // + + // Effect 32 + // Gate Summon Effect + if (nEffectNumber == 32) + { + nEffect = VFX_FNF_SUMMON_GATE; + } + // + + // Rotting Corpse Spawn/Despawn + if (nEffectNumber == 51) + { + nEffect = VFX_IMP_DISEASE_S; + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Return the Effect + return nEffect; +} + +/* +18 - VFX_FNF_BLINDDEAF +19 - VFX_FNF_DISPEL +20 - VFX_FNF_DISPEL_DISJUNCTION +21 - VFX_FNF_DISPEL_GREATER +22 - VFX_FNF_FIREBALL +23 - VFX_FNF_FIRESTORM +24 - VFX_FNF_IMPLOSION +26 - VFX_FNF_MASS_HEAL +27 - VFX_FNF_MASS_MIND_AFFECTING +28 - VFX_FNF_METEOR_SWARM +29 - VFX_FNF_NATURES_BALANCE +30 - VFX_FNF_PWKILL +31 - VFX_FNF_PWSTUN +32 - VFX_FNF_SUMMON_GATE +33 - VFX_FNF_SUMMON_MONSTER_1 +34 - VFX_FNF_SUMMON_MONSTER_2 +35 - VFX_FNF_SUMMON_MONSTER_3 +36 - VFX_FNF_SUMMON_UNDEAD +37 - VFX_FNF_SUNBEAM +38 - VFX_FNF_TIME_STOP +39 - VFX_FNF_WAIL_O_BANSHEES +40 - VFX_FNF_WEIRD +41 - VFX_FNF_WORD +42 - VFX_IMP_AC_BONUS +43 - VFX_IMP_ACID_L +44 - VFX_IMP_ACID_S +46 - VFX_IMP_BLIND_DEAF_M +47 - VFX_IMP_BREACH +48 - VFX_IMP_CONFUSION_S +49 - VFX_IMP_DAZED_S +50 - VFX_IMP_DEATH +51 - VFX_IMP_DISEASE_S +52 - VFX_IMP_DISPEL +53 - VFX_IMP_DISPEL_DISJUNCTION +54 - VFX_IMP_DIVINE_STRIKE_FIRE +55 - VFX_IMP_DIVINE_STRIKE_HOLY +56 - VFX_IMP_DOMINATE_S +57 - VFX_IMP_DOOM +58 - VFX_IMP_FEAR_S +60 - VFX_IMP_FLAME_M +61 - VFX_IMP_FLAME_S +62 - VFX_IMP_FROST_L +63 - VFX_IMP_FROST_S +64 - VFX_IMP_GREASE +65 - VFX_IMP_HASTE +66 - VFX_IMP_HEALING_G +67 - VFX_IMP_HEALING_L +68 - VFX_IMP_HEALING_M +69 - VFX_IMP_HEALING_S +70 - VFX_IMP_HEALING_X +71 - VFX_IMP_HOLY_AID +72 - VFX_IMP_KNOCK +74 - VFX_IMP_LIGHTNING_M +75 - VFX_IMP_LIGHTNING_S +76 - VFX_IMP_MAGBLUE +81 - VFX_IMP_NEGATIVE_ENERGY +83 - VFX_IMP_POISON_L +84 - VFX_IMP_POISON_S +85 - VFX_IMP_POLYMORPH +86 - VFX_IMP_PULSE_COLD +87 - VFX_IMP_PULSE_FIRE +88 - VFX_IMP_PULSE_HOLY +89 - VFX_IMP_PULSE_NEGATIVE +90 - VFX_IMP_RAISE_DEAD +91 - VFX_IMP_REDUCE_ABILITY_SCORE +92 - VFX_IMP_REMOVE_CONDITION +93 - VFX_IMP_SILENCE +94 - VFX_IMP_SLEEP +95 - VFX_IMP_SLOW +96 - VFX_IMP_SONIC +97 - VFX_IMP_STUN +98 - VFX_IMP_SUNSTRIKE +99 - VFX_IMP_UNSUMMON +100 - VFX_COM_SPECIAL_BLUE_RED +101 - VFX_COM_SPECIAL_PINK_ORANGE +102 - VFX_COM_SPECIAL_RED_WHITE +103 - VFX_COM_SPECIAL_RED_ORANGE +104 - VFX_COM_SPECIAL_WHITE_BLUE +105 - VFX_COM_SPECIAL_WHITE_ORANGE +106 - VFX_COM_BLOOD_REG_WIMP +107 - VFX_COM_BLOOD_LRG_WIMP +108 - VFX_COM_BLOOD_CRT_WIMP +109 - VFX_COM_BLOOD_REG_RED +110 - VFX_COM_BLOOD_REG_GREEN +111 - VFX_COM_BLOOD_REG_YELLOW +112 - VFX_COM_BLOOD_LRG_RED +113 - VFX_COM_BLOOD_LRG_GREEN +114 - VFX_COM_BLOOD_LRG_YELLOW +115 - VFX_COM_BLOOD_CRT_RED +116 - VFX_COM_BLOOD_CRT_GREEN +117 - VFX_COM_BLOOD_CRT_YELLOW +118 - FX_COM_SPARKS_PARRY +120 - VFX_COM_UNLOAD_MODEL +121 - VFX_COM_CHUNK_RED_SMALL +122 - VFX_COM_CHUNK_RED_MEDIUM +123 - VFX_COM_CHUNK_GREEN_SMALL +124 - VFX_COM_CHUNK_GREEN_MEDIUM +125 - VFX_COM_CHUNK_YELLOW_SMALL +126 - VFX_COM_CHUNK_YELLOW_MEDIUM +139 - VFX_IMP_IMPROVE_ABILITY_SCORE +140 - VFX_IMP_CHARM +141 - VFX_IMP_MAGICAL_VISION +144 - VFX_IMP_EVIL_HELP +145 - VFX_IMP_GOOD_HELP +146 - VFX_IMP_DEATH_WARD +149 - VFX_IMP_MAGIC_PROTECTION +150 - VFX_IMP_SUPER_HEROISM +151 - VFX_FNF_STORM +152 - VFX_IMP_ELEMENTAL_PROTECTION +181 - VFX_IMP_MIRV +183 - VFX_FNF_SOUND_BURST +184 - VFX_FNF_STRIKE_HOLY +185 - VFX_FNF_LOS_EVIL_10 +186 - VFX_FNF_LOS_EVIL_20 +187 - VFX_FNF_LOS_EVIL_30 +188 - VFX_FNF_LOS_HOLY_10 +189 - VFX_FNF_LOS_HOLY_20 +190 - VFX_FNF_LOS_HOLY_30 +191 - VFX_FNF_LOS_NORMAL_10 +192 - VFX_FNF_LOS_NORMAL_20 +193 - VFX_FNF_LOS_NORMAL_30 +194 - VFX_IMP_HEAD_ACID +195 - VFX_IMP_HEAD_FIRE +196 - VFX_IMP_HEAD_SONIC +197 - VFX_IMP_HEAD_ELECTRICITY +198 - VFX_IMP_HEAD_COLD +199 - VFX_IMP_HEAD_HOLY +200 - VFX_IMP_HEAD_NATURE +201 - VFX_IMP_HEAD_HEAL +202 - VFX_IMP_HEAD_MIND +203 - VFX_IMP_HEAD_EVIL +204 - VFX_IMP_HEAD_ODD +217 - VFX_IMP_DEATH_L +219 - VFX_FNF_SUMMON_CELESTIAL +221 - VFX_IMP_RESTORATION_LESSER +222 - VFX_IMP_RESTORATION +223 - VFX_IMP_RESTORATION_GREATER +231 - VFX_FNF_ICESTORM +233 - VFX_IMP_MIRV_FLAME +234 - VFX_IMP_DESTRUCTION +235 - VFX_COM_CHUNK_RED_LARGE +236 - VFX_COM_CHUNK_BONE_MEDIUM +237 - VFX_COM_BLOOD_SPARK_SMALL +238 - VFX_COM_BLOOD_SPARK_MEDIUM +239 - VFX_COM_BLOOD_SPARK_LARGE +241 - VFX_FNF_HORRID_WILTING +246 - VFX_IMP_HARM +250 - VFX_IMP_MAGIC_RESISTANCE_USE +251 - VFX_IMP_GLOBE_USE +252 - VFX_IMP_WILL_SAVING_THROW_USE +253 - VFX_IMP_SPIKE_TRAP +254 - VFX_IMP_SPELL_MANTLE_USE +255 - VFX_IMP_FORTITUDE_SAVING_THROW_USE +256 - VFX_IMP_REFLEX_SAVE_THROW_USE +257 - VFX_FNF_GAS_EXPLOSION_ACID +258 - VFX_FNF_GAS_EXPLOSION_EVIL +259 - VFX_FNF_GAS_EXPLOSION_NATURE +260 - VFX_FNF_GAS_EXPLOSION_FIRE +261 - VFX_FNF_GAS_EXPLOSION_GREASE +262 - VFX_FNF_GAS_EXPLOSION_MIND +263 - VFX_FNF_SMOKE_PUFF +264 - VFX_IMP_PULSE_WATER +265 - VFX_IMP_PULSE_WIND +266 - VFX_IMP_PULSE_NATURE +273 - VFX_IMP_AURA_HOLY +274 - VFX_IMP_AURA_UNEARTHLY +275 - VFX_IMP_AURA_FEAR +276 - VFX_IMP_AURA_NEGATIVE_ENERGY +278 - VFX_FNF_HOWL_MIND +279 - VFX_FNF_HOWL_ODD +280 - VFX_COM_HIT_FIRE +281 - VFX_COM_HIT_FROST +282 - VFX_COM_HIT_ELECTRICAL +283 - VFX_COM_HIT_ACID +284 - VFX_COM_HIT_SONIC +285 - VFX_FNF_HOWL_WAR_CRY +286 - VFX_FNF_SCREEN_SHAKE +287 - VFX_FNF_SCREEN_BUMP +288 - VFX_COM_HIT_NEGATIVE +289 - VFX_COM_HIT_DIVINE +290 - VFX_FNF_HOWL_WAR_CRY_FEMALE +*/ + +//void main () {} diff --git a/nwnds_module/spawn_cfg_global.nss b/nwnds_module/spawn_cfg_global.nss new file mode 100644 index 000000000..f1959fb3e --- /dev/null +++ b/nwnds_module/spawn_cfg_global.nss @@ -0,0 +1,32 @@ +// +// ALFA NESS V1.2.3 +// Spawn Global Defaults +// +// History: +// 09/21/03 Cereborn Created +// +// This file is for the USER to make changes to NESS default values. It will +// normally not be overwritten by UPDATE releases, so remerging can be avoided. +// + +#include "spawn_defaults" + +void SetUserGlobalDefaults() +{ + // SXn + // Set this value to TRUE (or 1) to have dim returns suppression be the default + // when no SX flag is present. + // + // **** uncomment me to make DR off by default + // nGlobalSuppressDR = TRUE; + + // This is the default value for the SX flag when no value is specified. + // Set to FALSE (or 0) to make SX (without a value) enable dim returns. + // + // **** uncomment me to make the SX flag (without arguments) turn DR on for + // a spawn. Note that this is not strictly necessary, as you can also just use + // SX0 on the spawn. This was added for Albereth because he had already created + // spawn points using SX without the 0... + // nSuppressDR = FALSE; + +} diff --git a/nwnds_module/spawn_cfg_group.ncs b/nwnds_module/spawn_cfg_group.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/spawn_cfg_group.ncs differ diff --git a/nwnds_module/spawn_cfg_group.nss b/nwnds_module/spawn_cfg_group.nss new file mode 100644 index 000000000..0c53a34cc --- /dev/null +++ b/nwnds_module/spawn_cfg_group.nss @@ -0,0 +1,1171 @@ +// +// Spawn Groups +// +// +// nChildrenSpawned +// : Number of Total Children ever Spawned +// +// nSpawnCount +// : Number of Children currently Alive +// +// nSpawnNumber +// : Number of Children to Maintain at Spawn +// +// nRandomWalk +// : Walking Randomly? TRUE/FALSE +// +// nPlaceable +// : Spawning Placeables? TRUE/FALSE +// +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +string SpawnGroup(object oSpawn, string sTemplate) +{ + // Initialize + string sRetTemplate; + + // Initialize Values + int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); + int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk"); + int nPlaceable = GetLocalInt(oSpawn, "f_Placeable"); + int nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned"); + int nSpawnCount = GetLocalInt(oSpawn, "SpawnCount"); + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // gw_halfling + if (sTemplate == "gw_halfling") + { + switch(d4(1)) + { + case 1: + sRetTemplate = "halflingraider"; + break; + case 2: + sRetTemplate = "halflingraide001"; + break; + case 3: + sRetTemplate = "halflingraide001"; + break; + case 4: + sRetTemplate = "halflingraide002"; + break; + } + } + // + + // gw_mul + if (sTemplate == "gw_mul") + { + switch(d4(1)) + { + case 1: + sRetTemplate = "renegademul"; + break; + case 2: + sRetTemplate = "renegademul001"; + break; + case 3: + sRetTemplate = "renegademul"; + break; + case 4: + sRetTemplate = "renegademul"; + break; + } + } + // + + // ashengiants + if (sTemplate == "ashengiants") + { + switch(d4(1)) + { + case 1: + sRetTemplate = "gntfrost001"; + break; + case 2: + sRetTemplate = "gntfrost001"; + break; + case 3: + sRetTemplate = "gntfrost001"; + break; + case 4: + sRetTemplate = "gntfrost002"; + break; + } + } + // + + // cr_militia + if (sTemplate == "cr_militia") + { + switch(d2(1)) + { + case 1: + sRetTemplate = "cr_militia_m"; + break; + case 2: + sRetTemplate = "cr_militia_f"; + break; + } + } + // + + // pg_guard + if (sTemplate == "pg_guard") + { + switch(d2(1)) + { + case 1: + sRetTemplate = "pg_guard_m"; + break; + case 2: + sRetTemplate = "pg_guard_f"; + break; + } + } + // + + // Goblins + if (sTemplate == "goblins_low") + { + if (d2(1) == 1) + { + sRetTemplate = "NW_GOBLINA"; + } + else + { + sRetTemplate = "NW_GOBLINB"; + } + } + // + + // undead + if (sTemplate == "undead") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "skelchief001"; + break; + case 2: + sRetTemplate = "skelmage001"; + break; + case 3: + sRetTemplate = "skelpriest001"; + break; + case 4: + sRetTemplate = "skeletonwarrior"; + break; + case 5: + sRetTemplate = "ds_undead_fael"; + break; + case 6: + sRetTemplate = "plagueblight"; + break; + } + } + // + + // Great Spyre + if (sTemplate == "greatspyre") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "dagoron"; + break; + case 2: + sRetTemplate = "dagoron"; + break; + case 3: + sRetTemplate = "hafling"; + break; + case 4: + sRetTemplate = "ds_strine001"; + break; + case 5: + sRetTemplate = "ds_strine001"; + break; + case 6: + sRetTemplate = "wilddog001"; + break; + } + } + // + + // dune bandits + if (sTemplate == "dunebandits") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "banditdog002"; + break; + case 2: + sRetTemplate = "dbandit003"; + break; + case 3: + sRetTemplate = "dbandit003"; + break; + case 4: + sRetTemplate = "dbandit004"; + break; + case 5: + sRetTemplate = "dbandit004"; + break; + case 6: + sRetTemplate = "dbandit002"; + break; + } + } + // + + // field bandits + if (sTemplate == "fieldbandits") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "bandit"; + break; + case 2: + sRetTemplate = "bandit"; + break; + case 3: + sRetTemplate = "hafling"; + break; + case 4: + sRetTemplate = "hafling"; + break; + case 5: + sRetTemplate = "bandit"; + break; + case 6: + sRetTemplate = "psibandit"; + break; + } + } + // + + // ashenundead + if (sTemplate == "ashenundead") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "mumfight001"; + break; + case 2: + sRetTemplate = "mumfight001"; + break; + case 3: + sRetTemplate = "mummyboss001"; + break; + case 4: + sRetTemplate = "mummyboss001"; + break; + case 5: + sRetTemplate = "mumfight001"; + break; + case 6: + sRetTemplate = "mumfight001"; + break; + } + } + // + + // Santukas and Abominations + if (sTemplate == "santukasgp") + { + switch(d6(1)) + { + case 1: + sRetTemplate = "greatsantukas001"; + break; + case 2: + sRetTemplate = "santukas001"; + break; + case 3: + sRetTemplate = "santukas001"; + break; + case 4: + sRetTemplate = "santukas001"; + break; + case 5: + sRetTemplate = "abomination002"; + break; + case 6: + sRetTemplate = "abomination002"; + break; + } + } + // + + // Pirates and Boss + if (sTemplate == "pirates") + { + int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned"); + if (nIsBossSpawned == TRUE) + { + // Find the Boss + object oBoss = GetChildByTag(oSpawn, "cygnus"); + + // Check if Boss is Alive + if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE) + { + // He's alive, spawn a Peon to keep him Company + sRetTemplate = "pirate"; + } + else + { + // He's dead, Deactivate Camp! + SetLocalInt(oSpawn, "SpawnDeactivated", TRUE); + } + } + else + { + // No Boss, so Let's Spawn Him + sRetTemplate = "cygnus"; + SetLocalInt(oSpawn, "IsBossSpawned", TRUE); + } + } + // + + // Cult Leader and cultists + if (sTemplate == "cultists") + { + int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned"); + if (nIsBossSpawned == TRUE) + { + // Find the Boss + object oBoss = GetChildByTag(oSpawn, "cultleader"); + + // Check if Boss is Alive + if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE) + { + // He's alive, spawn a Peon to keep him Company + sRetTemplate = "cultist"; + } + else + { + // He's dead, Deactivate Camp! + SetLocalInt(oSpawn, "SpawnDeactivated", TRUE); + } + } + else + { + // No Boss, so Let's Spawn Him + sRetTemplate = "cultleader"; + SetLocalInt(oSpawn, "IsBossSpawned", TRUE); + } + } + // + + // Termites and King + if (sTemplate == "termites") + { + int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned"); + if (nIsBossSpawned == TRUE) + { + // Find the Boss + object oBoss = GetChildByTag(oSpawn, "termiteking001"); + + // Check if Boss is Alive + if (oBoss != OBJECT_INVALID && GetIsDead(oBoss) == FALSE) + { + // He's alive, spawn a Peon to keep him Company + sRetTemplate = "termitesoldie001"; + } + else + { + // He's dead, Deactivate Camp! + SetLocalInt(oSpawn, "SpawnDeactivated", TRUE); + } + } + else + { + // No Boss, so Let's Spawn Him + sRetTemplate = "termiteking001"; + SetLocalInt(oSpawn, "IsBossSpawned", TRUE); + } + } + // + + // Dark Spiders and Queen + if (sTemplate == "darkspiders") + { + int nIsBossSpawned = GetLocalInt(oSpawn, "IsBossSpawned"); + if (nIsBossSpawned == TRUE) + { + // Find the Boss + object oBoss = GetChildByTag(oSpawn, "darkspiderque002"); + + // Check if Boss is Alive + if (d2(1) == 1) + { + sRetTemplate = "darkspider001"; + } + else + { + sRetTemplate = "darkpsionspid001"; + } + } + else + { + // No Boss, so Let's Spawn Him + sRetTemplate = "darkspiderque001"; + SetLocalInt(oSpawn, "IsBossSpawned", TRUE); + } + } + // + +// Scaled encounter - Altaruk Guards + if (sTemplate == "alt_guards") + { + // Initialize Variables + int nTotalPCs; + int nTotalPCLevel; + int nAveragePCLevel; + object oArea = GetArea(OBJECT_SELF); + // Cycle through PCs in Area + object oPC = GetFirstObjectInArea(oArea); + while (oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC) == TRUE) + { + nTotalPCs++; + nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC); + } + oPC = GetNextObjectInArea(oArea); + } + if (nTotalPCs > 0) + { + nAveragePCLevel = nTotalPCLevel / nTotalPCs; + } + else + { + nAveragePCLevel = 3; + } + // Select a Creature to Spawn + switch (nAveragePCLevel) + { + // Spawn Something with CR 1 + case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: + sRetTemplate = "ar_altguard_001"; + break; + // + // Spawn Something with CR 10 + case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: + sRetTemplate = "ar_altguard_002"; + break; + // + // Spawn Something with CR 20 + case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: + sRetTemplate = "ar_altguard_003"; + break; + // + // Spawn Something with CR 30 + case 30: case 31: case 32: case 33: case 34: case 35: case 36: case 37: case 38: case 39: + sRetTemplate = "ar_altguard_004"; + break; + // + // Whatever. I have no idea why this doesn't work right. + case 40: + sRetTemplate = "ar_altguard_004"; + break; + // + } + + } + // Scaled encounter - Coldfire Primals + if (sTemplate == "cfd_primals") + { + // Initialize Variables + int nTotalPCs; + int nTotalPCLevel; + int nAveragePCLevel; + object oArea = GetArea(OBJECT_SELF); + // Cycle through PCs in Area + object oPC = GetFirstObjectInArea(oArea); + while (oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC) == TRUE) + { + nTotalPCs++; + nTotalPCLevel = nTotalPCLevel + GetHitDice(oPC); + } + oPC = GetNextObjectInArea(oArea); + } + if (nTotalPCs > 0) + { + nAveragePCLevel = nTotalPCLevel / nTotalPCs; + } + else + { + nAveragePCLevel = 3; + } + // Select a Creature to Spawn + switch (nAveragePCLevel) + { + // Spawn Yintak Berserker + case 3: case 5: case 7: case 9: case 11: case 13: case 15: case 17: case 19: case 21: case 23: + case 25: case 27: case 29: case 31: case 33: + sRetTemplate = "yintakberserk001"; + break; + // Spawn Fire Yintak + case 4: case 6: case 8: case 10: case 12: case 14: case 16: case 18: case 20: case 22: case 24: + case 26: case 28: case 30: case 32: case 34: + sRetTemplate = "fireyintak001"; + break; + // Spawn Primal Water Elemental + case 36: case 38: case 40: + sRetTemplate = "primalwaterele"; + break; + // + // Spawn Primal Earth Elemental + case 35: case 37: case 39: + sRetTemplate = "primalearthele"; + break; + // + } + + } + // SS_Creature_Spawn + if (sTemplate == "SS_CREATURE_SPAWN") + { + switch(d100(1)) + { + case 1: + sRetTemplate = "ar_gith_001"; + break; + case 2: + sRetTemplate = "ar_gith_001"; + break; + case 3: + sRetTemplate = "ar_gith_001"; + break; + case 4: + sRetTemplate = "ar_gith_002"; + break; + case 5: + sRetTemplate = "ar_gith_003"; + break; + case 6: + sRetTemplate = "athyena001"; + break; + case 7: + sRetTemplate = "athyena001"; + break; + case 8: + sRetTemplate = "ds_ztal001"; + break; + case 9: + sRetTemplate = "ds_ztal002"; + break; + case 10: + sRetTemplate = "kestrekel001"; + break; + case 11: + sRetTemplate = "kestrekel001"; + break; + case 12: + sRetTemplate = "zep_scorp003"; + break; + case 13: + sRetTemplate = "zep_scorp003"; + break; + case 14: + sRetTemplate = "desertviper_001"; + break; + case 15: + sRetTemplate = "desertviper_001"; + break; + case 16: + sRetTemplate = "jankx001"; + break; + case 17: + sRetTemplate = "jankx001"; + break; + case 18: + sRetTemplate = "skeletongiant001"; + break; + case 19: + sRetTemplate = "sitak001"; + break; + case 20: + sRetTemplate = "sitak001"; + break; + case 21: + sRetTemplate = "skeletonhuman001"; + break; + case 22: + sRetTemplate = "zhackal001"; + break; + case 23: + sRetTemplate = "zhackal001"; + break; + case 24: + sRetTemplate = "skeletonhuman001"; + break; + case 25: + sRetTemplate = "skeletonhuman002"; + break; + case 26: + sRetTemplate = "skeletonhuman002"; + break; + case 27: + sRetTemplate = "zep_skelpir3"; + break; + case 28: + sRetTemplate = "zombie002"; + break; + case 29: + sRetTemplate = "zombie002"; + break; + case 30: + sRetTemplate = "zombie001"; + break; + case 31: + sRetTemplate = "kivit001"; + break; + case 32: + sRetTemplate = "ar_cheetah001"; + break; + case 33: + sRetTemplate = "zep_cougar"; + break; + case 34: + sRetTemplate = "ar_gith_001"; + break; + case 35: + sRetTemplate = "ar_gith_001"; + break; + case 36: + sRetTemplate = "ar_gith_001"; + break; + case 37: + sRetTemplate = "ar_gith_002"; + break; + case 38: + sRetTemplate = "ar_gith_003"; + break; + case 39: + sRetTemplate = "athyena001"; + break; + case 40: + sRetTemplate = "athyena001"; + break; + case 41: + sRetTemplate = "ds_ztal001"; + break; + case 42: + sRetTemplate = "ds_ztal002"; + break; + case 43: + sRetTemplate = "kestrekel001"; + break; + case 44: + sRetTemplate = "kestrekel001"; + break; + case 45: + sRetTemplate = "zep_scorp003"; + break; + case 46: + sRetTemplate = "zep_scorp003"; + break; + case 47: + sRetTemplate = "desertviper_001"; + break; + case 48: + sRetTemplate = "desertviper_001"; + break; + case 49: + sRetTemplate = "ds_jankx001"; + break; + case 50: + sRetTemplate = "ds_jankx001"; + break; + case 51: + sRetTemplate = "skeletongiant001"; + break; + case 52: + sRetTemplate = "sitak001"; + break; + case 53: + sRetTemplate = "sitak001"; + break; + case 54: + sRetTemplate = "skeletonhuman001"; + break; + case 55: + sRetTemplate = "zhackal001"; + break; + case 56: + sRetTemplate = "zhackal001"; + break; + case 57: + sRetTemplate = "skeletonhuman001"; + break; + case 58: + sRetTemplate = "skeletonhuman002"; + break; + case 59: + sRetTemplate = "skeletonhuman002"; + break; + case 60: + sRetTemplate = "zep_skelpir3"; + break; + case 61: + sRetTemplate = "zombie002"; + break; + case 62: + sRetTemplate = "zombie002"; + break; + case 63: + sRetTemplate = "zombie001"; + break; + case 64: + sRetTemplate = "kivit001"; + break; + case 65: + sRetTemplate = "ar_cheetah001"; + break; + case 66: + sRetTemplate = "zep_cougar"; + break; + case 67: + sRetTemplate = "ar_gith_001"; + break; + case 68: + sRetTemplate = "ar_gith_001"; + break; + case 69: + sRetTemplate = "ar_gith_001"; + break; + case 70: + sRetTemplate = "ar_gith_002"; + break; + case 71: + sRetTemplate = "ar_gith_003"; + break; + case 72: + sRetTemplate = "athyena001"; + break; + case 73: + sRetTemplate = "athyena001"; + break; + case 74: + sRetTemplate = "ds_ztal001"; + break; + case 75: + sRetTemplate = "ds_ztal002"; + break; + case 76: + sRetTemplate = "kestrekel001"; + break; + case 77: + sRetTemplate = "kestrekel001"; + break; + case 78: + sRetTemplate = "zep_scorp003"; + break; + case 79: + sRetTemplate = "zep_scorp003"; + break; + case 80: + sRetTemplate = "desertviper_001"; + break; + case 81: + sRetTemplate = "desertviper_001"; + break; + case 82: + sRetTemplate = "ds_jankx001"; + break; + case 83: + sRetTemplate = "ds_jankx001"; + break; + case 84: + sRetTemplate = "skeletongiant001"; + break; + case 85: + sRetTemplate = "sitak001"; + break; + case 86: + sRetTemplate = "sitak001"; + break; + case 87: + sRetTemplate = "skeletonhuman001"; + break; + case 88: + sRetTemplate = "zhackal001"; + break; + case 89: + sRetTemplate = "zhackal001"; + break; + case 90: + sRetTemplate = "skeletonhuman001"; + break; + case 91: + sRetTemplate = "skeletonhuman002"; + break; + case 92: + sRetTemplate = "skeletonhuman002"; + break; + case 93: + sRetTemplate = "zep_skelpir3"; + break; + case 94: + sRetTemplate = "zombie002"; + break; + case 95: + sRetTemplate = "zombie002"; + break; + case 96: + sRetTemplate = "zombie001"; + break; + case 97: + sRetTemplate = "kivit001"; + break; + case 98: + sRetTemplate = "ar_cheetah001"; + break; + case 99: + sRetTemplate = "zep_cougar"; + break; + case 100: + sRetTemplate = "zep_cougar"; + break; + } +} + + // FT_IANTO__CREATURE_SPAWN + if (sTemplate == "FT_IANTO__CREATURE_SPAWN") + { + switch(d100(1)) + { + case 1: + sRetTemplate = "ar_gith_001"; + break; + case 2: + sRetTemplate = "ar_gith_001"; + break; + case 3: + sRetTemplate = "ar_gith_001"; + break; + case 4: + sRetTemplate = "ar_gith_002"; + break; + case 5: + sRetTemplate = "ar_gith_003"; + break; + case 6: + sRetTemplate = "athyena001"; + break; + case 7: + sRetTemplate = "athyena001"; + break; + case 8: + sRetTemplate = "ds_ztal001"; + break; + case 9: + sRetTemplate = "ds_ztal002"; + break; + case 10: + sRetTemplate = "kestrekel001"; + break; + case 11: + sRetTemplate = "kestrekel001"; + break; + case 12: + sRetTemplate = "zep_scorp003"; + break; + case 13: + sRetTemplate = "zep_scorp003"; + break; + case 14: + sRetTemplate = "desertviper_001"; + break; + case 15: + sRetTemplate = "desertviper_001"; + break; + case 16: + sRetTemplate = "jankx001"; + break; + case 17: + sRetTemplate = "jankx001"; + break; + case 18: + sRetTemplate = "skeletongiant001"; + break; + case 19: + sRetTemplate = "sitak001"; + break; + case 20: + sRetTemplate = "sitak001"; + break; + case 21: + sRetTemplate = "skeletonhuman001"; + break; + case 22: + sRetTemplate = "zhackal001"; + break; + case 23: + sRetTemplate = "zhackal001"; + break; + case 24: + sRetTemplate = "skeletonhuman001"; + break; + case 25: + sRetTemplate = "skeletonhuman002"; + break; + case 26: + sRetTemplate = "skeletonhuman002"; + break; + case 27: + sRetTemplate = "zep_skelpir3"; + break; + case 28: + sRetTemplate = "zombie002"; + break; + case 29: + sRetTemplate = "zombie002"; + break; + case 30: + sRetTemplate = "zombie001"; + break; + case 31: + sRetTemplate = "kivit001"; + break; + case 32: + sRetTemplate = "ar_cheetah001"; + break; + case 33: + sRetTemplate = "zep_cougar"; + break; + case 34: + sRetTemplate = "ar_gith_001"; + break; + case 35: + sRetTemplate = "ar_gith_001"; + break; + case 36: + sRetTemplate = "ar_gith_001"; + break; + case 37: + sRetTemplate = "ar_gith_002"; + break; + case 38: + sRetTemplate = "ar_gith_003"; + break; + case 39: + sRetTemplate = "athyena001"; + break; + case 40: + sRetTemplate = "athyena001"; + break; + case 41: + sRetTemplate = "ds_ztal001"; + break; + case 42: + sRetTemplate = "ds_ztal002"; + break; + case 43: + sRetTemplate = "kestrekel001"; + break; + case 44: + sRetTemplate = "kestrekel001"; + break; + case 45: + sRetTemplate = "zep_scorp003"; + break; + case 46: + sRetTemplate = "zep_scorp003"; + break; + case 47: + sRetTemplate = "desertviper_001"; + break; + case 48: + sRetTemplate = "desertviper_001"; + break; + case 49: + sRetTemplate = "ds_jankx001"; + break; + case 50: + sRetTemplate = "ds_jankx001"; + break; + case 51: + sRetTemplate = "skeletongiant001"; + break; + case 52: + sRetTemplate = "sitak001"; + break; + case 53: + sRetTemplate = "sitak001"; + break; + case 54: + sRetTemplate = "skeletonhuman001"; + break; + case 55: + sRetTemplate = "zhackal001"; + break; + case 56: + sRetTemplate = "zhackal001"; + break; + case 57: + sRetTemplate = "skeletonhuman001"; + break; + case 58: + sRetTemplate = "skeletonhuman002"; + break; + case 59: + sRetTemplate = "skeletonhuman002"; + break; + case 60: + sRetTemplate = "zep_skelpir3"; + break; + case 61: + sRetTemplate = "zombie002"; + break; + case 62: + sRetTemplate = "zombie002"; + break; + case 63: + sRetTemplate = "zombie001"; + break; + case 64: + sRetTemplate = "kivit001"; + break; + case 65: + sRetTemplate = "ar_cheetah001"; + break; + case 66: + sRetTemplate = "zep_cougar"; + break; + case 67: + sRetTemplate = "ar_gith_001"; + break; + case 68: + sRetTemplate = "ar_gith_001"; + break; + case 69: + sRetTemplate = "ar_gith_001"; + break; + case 70: + sRetTemplate = "ar_gith_002"; + break; + case 71: + sRetTemplate = "ar_gith_003"; + break; + case 72: + sRetTemplate = "athyena001"; + break; + case 73: + sRetTemplate = "athyena001"; + break; + case 74: + sRetTemplate = "ds_ztal001"; + break; + case 75: + sRetTemplate = "ds_ztal002"; + break; + case 76: + sRetTemplate = "kestrekel001"; + break; + case 77: + sRetTemplate = "kestrekel001"; + break; + case 78: + sRetTemplate = "zep_scorp003"; + break; + case 79: + sRetTemplate = "zep_scorp003"; + break; + case 80: + sRetTemplate = "desertviper_001"; + break; + case 81: + sRetTemplate = "desertviper_001"; + break; + case 82: + sRetTemplate = "ds_jankx001"; + break; + case 83: + sRetTemplate = "ds_jankx001"; + break; + case 84: + sRetTemplate = "skeletongiant001"; + break; + case 85: + sRetTemplate = "sitak001"; + break; + case 86: + sRetTemplate = "sitak001"; + break; + case 87: + sRetTemplate = "skeletonhuman001"; + break; + case 88: + sRetTemplate = "zhackal001"; + break; + case 89: + sRetTemplate = "zhackal001"; + break; + case 90: + sRetTemplate = "skeletonhuman001"; + break; + case 91: + sRetTemplate = "skeletonhuman002"; + break; + case 92: + sRetTemplate = "skeletonhuman002"; + break; + case 93: + sRetTemplate = "zep_skelpir3"; + break; + case 94: + sRetTemplate = "zombie002"; + break; + case 95: + sRetTemplate = "zombie002"; + break; + case 96: + sRetTemplate = "zombie001"; + break; + case 97: + sRetTemplate = "kivit001"; + break; + case 98: + sRetTemplate = "ar_cheetah001"; + break; + case 99: + sRetTemplate = "zep_cougar"; + break; + case 100: + sRetTemplate = "zep_cougar"; + break; + } +} + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + return sRetTemplate; +} + +//void main (){} + diff --git a/nwnds_module/spawn_cfg_loot.nss b/nwnds_module/spawn_cfg_loot.nss new file mode 100644 index 000000000..2bf8d13e2 --- /dev/null +++ b/nwnds_module/spawn_cfg_loot.nss @@ -0,0 +1,1703 @@ +// +// Spawn Loot +// +// History: +// --/--/-- Neshke Created +// 12/03/02 Cereborn Added DanielleB's merchant-based loot tables +// 12/31/02 Cereborn Use newly added flags for determining the +// probabilities of 1,2, or 3 item drops from +// merchant-based (LT500-LT999) loot tables. +// Fixed an off-by-one bug in the item choosing +// code for for merchant-based loot tables. The +// code was trying to take items 2 through n+1. +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +void CleanInventory(object oSpawned); +// +// +void LootTable(object oSpawn, object oSpawned, int nLootTable) +{ + // Initialize + object oItem; + string sTemplate; + int nStack; + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Table 00 + if (nLootTable == 0) + { + // 40% Chance + if (d100() <= 40) + CreateItemOnObject("giantskeletonsku", oSpawned); + } + // + + // Table 01 + if (nLootTable == 1) + { + // 40% Chance + if (d100() <= 40) + CreateItemOnObject("spiderpoisonsack", oSpawned); + } + // + + // Table 02 + if (nLootTable == 2) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("airdrakehide", oSpawned); + } + // + + // Table 03 + if (nLootTable == 3) + { + // 30% Chance + if (d100(1) <= 30) + { + // Created Custom Item with ResRef of ogretooth + sTemplate = "ogretooth"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 04 + if (nLootTable == 4) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of rampagereye + sTemplate = "rampagereye"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 05 + if (nLootTable == 5) + { + // 90% Chance + if (d100(1) <= 90) + { + // Created Custom Item with ResRef of githkey + sTemplate = "githkey"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 06 + if (nLootTable == 6) + { + // 80% Chance + if (d100(1) <= 80) + { + // Created Custom Item with ResRef of zombiekey + sTemplate = "zombiekey"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + // Table 07 + if (nLootTable == 7) + { + // 80% Chance + if (d100(1) <= 80) + { + // Created Custom Item with ResRef of pieceofthegol003 + sTemplate = "pieceofthegol003"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 08 + if (nLootTable == 8) + { + // 80% Chance + if (d100(1) <= 80) + { + // Created Custom Item with ResRef of revenantkey + sTemplate = "revenantkey"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 09 + if (nLootTable == 9) + { + // 100% Chance + if (d100(1) <= 100) + { + // Created Custom Item with ResRef of githchiefhead + sTemplate = "githchiefhead"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 10 + if (nLootTable == 10) + { + // 80% Chance + if (d100(1) <= 80) + { + // Created Custom Item with ResRef of secondpieceofthe + sTemplate = "secondpieceofthe"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 11 + if (nLootTable == 11) + { + // 70% Chance + if (d100(1) <= 70) + { + // Created Custom Item with ResRef of jaryxsledger + sTemplate = "jaryxsledger"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 12 + if (nLootTable == 12) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of brimstone + sTemplate = "brimstone"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 13 + if (nLootTable == 13) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of icenine + sTemplate = "icenine"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 14 + if (nLootTable == 14) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of acidcrystal + sTemplate = "acidcrystal"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 15 + if (nLootTable == 15) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of chargedcrystal + sTemplate = "chargedcrystal"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 16 - Fields/NOOB + if (nLootTable == 16) + { + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //55% chance + if(nVeggie <= 40) + CreateItemOnObject("spinach", oSpawned); + //40% chance + if ((nVeggie > 40) && (nVeggie <= 60)) + CreateItemOnObject("garlic", oSpawned); + //40% chance + if ((nVeggie > 60) && (nVeggie <= 80)) + CreateItemOnObject("water", oSpawned); + //20% chance + if (nVeggie > 80) + CreateItemOnObject("ginseng", oSpawned); + } + } + // + + // Table 17 + if (nLootTable == 17) + { + // 10% Chance + if (d100(1) <= 10) + { + // Created Custom Item with ResRef of shadowsphere + sTemplate = "shadowsphere"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 18 + if (nLootTable == 18) + { + // 15% Chance + if (d100(1) <= 15) + { + // Created Custom Item with ResRef of shadowsphere + sTemplate = "hen_sha1qt001"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 19 + if (nLootTable == 19) + { + // Created Custom Item with ResRef of shadowsphere + sTemplate = "clockworkamulet"; + nStack = 1; + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 20 + if (nLootTable == 20) + { + // Created Custom Item with ResRef of shadowsphere + sTemplate = "clockworkamul001"; + nStack = 1; + + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 21 + if (nLootTable == 21) + { + // Created Custom Item with ResRef of shadowsphere + sTemplate = "clockworkamul002"; + nStack = 1; + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 22 + if (nLootTable == 22) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of garlic + sTemplate = "it_msmlmisc025"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + + // Table 23 for Earth Key + if (nLootTable == 23) + { + // 90% Chance + if (d100() <= 90) + CreateItemOnObject("earthkey", oSpawned); + } + // + + // Table 24 for Air Key + if (nLootTable == 24) + { + // 90% Chance + if (d100() <= 90) + CreateItemOnObject("airkey", oSpawned); + } + // + + // Table 25 for Ice Key + if (nLootTable == 25) + { + // 90% Chance + if (d100() <= 90) + CreateItemOnObject("icekey", oSpawned); + } + // + + // Table 26 for Fire Key + if (nLootTable == 26) + { + // 90% Chance + if (d100() <= 90) + CreateItemOnObject("firekey", oSpawned); + } + // + + // Table 27 for Low Armor + if (nLootTable == 27) + { + // 5% Chance + if (d100() <= 5) + { + int nArmor = d100(); + //3% chance + if (nArmor <= 3) + CreateItemOnObject("aarcl006", oSpawned); + //3% chance + else if ((nArmor > 3) && (nArmor <= 6)) + CreateItemOnObject("aarcl007", oSpawned); + //3% chance + else if ((nArmor > 6) && (nArmor <= 9)) + CreateItemOnObject("aarcl012", oSpawned); + //3% chance + else if ((nArmor > 9) && (nArmor <= 12)) + CreateItemOnObject("aarcl008", oSpawned); + //3% chance + else if ((nArmor > 12) && (nArmor <= 15)) + CreateItemOnObject("aarcl009", oSpawned); + //3% chance + else if ((nArmor > 15) && (nArmor <= 18)) + CreateItemOnObject("steelbandedmai", oSpawned); + //3% chance + else if ((nArmor > 18) && (nArmor <= 21)) + CreateItemOnObject("steelhalfplate", oSpawned); + //3% chance + else if ((nArmor > 21) && (nArmor <= 24)) + CreateItemOnObject("steelplatemail", oSpawned); + //3% chance + else if ((nArmor > 24) && (nArmor <= 27)) + CreateItemOnObject("aarcl013", oSpawned); + //3% chance + else if ((nArmor > 27) && (nArmor <= 30)) + CreateItemOnObject("aarcl003", oSpawned); + //3% chance + else if ((nArmor > 30) && (nArmor <= 33)) + CreateItemOnObject("aarcl014", oSpawned); + //3% chance + else if ((nArmor > 33) && (nArmor <= 36)) + CreateItemOnObject("aarcl002", oSpawned); + //3% chance + else if ((nArmor > 36) && (nArmor <= 39)) + CreateItemOnObject("steelchainshir", oSpawned); + //3% chance + else if ((nArmor > 39) && (nArmor <= 42)) + CreateItemOnObject("steelstuddedar", oSpawned); + //3% chance + else if ((nArmor > 42) && (nArmor <= 45)) + CreateItemOnObject("aarcl004", oSpawned); + //3% chance + else if ((nArmor > 45) && (nArmor <= 48)) + CreateItemOnObject("aarcl010", oSpawned); + //3% chance + else if ((nArmor > 48) && (nArmor <= 51)) + CreateItemOnObject("aarcl005", oSpawned); + //3% chance + else if ((nArmor > 51) && (nArmor <= 54)) + CreateItemOnObject("steelchainmail", oSpawned); + //3% chance + else if ((nArmor > 54) && (nArmor <= 57)) + CreateItemOnObject("arhe005", oSpawned); + //3% chance + else if ((nArmor > 57) && (nArmor <= 60)) + CreateItemOnObject("arhe002", oSpawned); + //3% chance + else if ((nArmor > 60) && (nArmor <= 63)) + CreateItemOnObject("ironhelmet", oSpawned); + //3% chance + else if ((nArmor > 63) && (nArmor <= 66)) + CreateItemOnObject("steelhelmet", oSpawned); + //3% chance + else if ((nArmor > 66) && (nArmor <= 69)) + CreateItemOnObject("ashmlw003", oSpawned); + //3% chance + else if ((nArmor > 69) && (nArmor <= 72)) + CreateItemOnObject("ashmlw004", oSpawned); + //3% chance + else if ((nArmor > 72) && (nArmor <= 75)) + CreateItemOnObject("ashlw002", oSpawned); + //3% chance + else if ((nArmor > 75) && (nArmor <= 78)) + CreateItemOnObject("ashmsw003", oSpawned); + //4% chance + else if ((nArmor > 78) && (nArmor <= 82)) + CreateItemOnObject("ashmsw004", oSpawned); + //4% chance + else if ((nArmor > 82) && (nArmor <= 86)) + CreateItemOnObject("ashsw002", oSpawned); + //4% chance + else if ((nArmor > 86) && (nArmor <= 90)) + CreateItemOnObject("ashmto004", oSpawned); + //4% chance + else if ((nArmor > 90) && (nArmor <= 94)) + CreateItemOnObject("ashto002", oSpawned); + //6% chance + else if (nArmor > 94) + CreateItemOnObject("ashmto003", oSpawned); + } + } + + // Table 28 for Spiders Loot + if (nLootTable == 28) + { + + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 5) + CreateItemOnObject("cloth008", oSpawned); + //% chance + else if ((nVeggie > 5) && (nVeggie <= 15)) + CreateItemOnObject("mcloth008", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 20)) + CreateItemOnObject("robesofthesage", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 25)) + CreateItemOnObject("aarcl008", oSpawned); + //% chance + else if ((nVeggie > 25) && (nVeggie <= 40)) + CreateItemOnObject("aarcl009", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 45)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 55)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 55) && (nVeggie <= 65)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 65) && (nVeggie <= 70)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 80)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 85)) + CreateItemOnObject("spelunkershelm", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 90)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if ((nVeggie > 90) && (nVeggie <= 95)) + CreateItemOnObject("darksilkgland", oSpawned); + //% chance + else if (nVeggie > 95) + CreateItemOnObject("darksilkgland", oSpawned); + } + } + + // Table 29 for Yinks + if (nLootTable == 29) + { + + // 10% Chance + if (d100() <= 10) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 5) + CreateItemOnObject("cloth008", oSpawned); + //% chance + else if ((nVeggie > 5) && (nVeggie <= 15)) + CreateItemOnObject("mcloth008", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 20)) + CreateItemOnObject("robesofthesage", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 25)) + CreateItemOnObject("aarcl008", oSpawned); + //% chance + else if ((nVeggie > 25) && (nVeggie <= 40)) + CreateItemOnObject("aarcl009", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 45)) + CreateItemOnObject("steelbandedmai", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 55)) + CreateItemOnObject("steelhalfplate", oSpawned); + //% chance + else if ((nVeggie > 55) && (nVeggie <= 65)) + CreateItemOnObject("steelplatemail", oSpawned); + //% chance + else if ((nVeggie > 65) && (nVeggie <= 70)) + CreateItemOnObject("steelchainshir", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 80)) + CreateItemOnObject("steelscalemail", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 85)) + CreateItemOnObject("spelunkershelm", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 90)) + CreateItemOnObject("towershieldofspe", oSpawned); + //% chance + else if (nVeggie > 90) + CreateItemOnObject("smallshieldofpro", oSpawned); + } + } + + // Table 30 + if (nLootTable == 30) + { + + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of garlic + sTemplate = "waterdrakehide"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + + // Table 31 + if (nLootTable == 31) + { + + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of garlic + sTemplate = "earthdrakehide"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + + // Table 32 + // Random Gold for Chests + if (nLootTable == 32) + { + nStack = Random(50) + 1; + oItem = CreateItemOnObject("nw_it_gold001", oSpawned, nStack); + } + // + + // Table 33 + if (nLootTable == 33) + { + // 20% Chance + if (d100(1) <= 20) + { + // Created Custom Item with ResRef of garlic + sTemplate = "mastyrialsblade"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // + + // Table 34 for SoT Giants (formerly Tyr Guards) + if (nLootTable == 34) + { + // 10% Chance + if (d100() <= 10) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("divineshell", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("imbuedhelmet", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("rogueswrap", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("imbuedshield", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("mastersringofstr", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 15)) + CreateItemOnObject("mastersringofcon", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 17)) + CreateItemOnObject("mastersringofwis", oSpawned); + //% chance + else if ((nVeggie > 17) && (nVeggie <= 19)) + CreateItemOnObject("sunrunnerring", oSpawned); + //% chance + else if ((nVeggie > 19) && (nVeggie <= 21)) + CreateItemOnObject("defilerash", oSpawned); + //% chance + else if ((nVeggie > 21) && (nVeggie <= 27)) + CreateItemOnObject("mastersamuletofc", oSpawned); + //% chance + else if ((nVeggie > 27) && (nVeggie <= 33)) + CreateItemOnObject("mastersamuletofd", oSpawned); + //% chance + else if ((nVeggie > 33) && (nVeggie <= 39)) + CreateItemOnObject("mastersringofcha", oSpawned); + //% chance + else if ((nVeggie > 39) && (nVeggie <= 45)) + CreateItemOnObject("mastersamuletofw", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 51)) + CreateItemOnObject("mastersamuletofs", oSpawned); + //% chance + else if ((nVeggie > 51) && (nVeggie <= 57)) + CreateItemOnObject("mastersamuletofi", oSpawned); + //% chance + else if ((nVeggie > 57) && (nVeggie <= 63)) + CreateItemOnObject("mastersringofdex", oSpawned); + //% chance + else if ((nVeggie > 63) && (nVeggie <= 69)) + CreateItemOnObject("mastersringofint", oSpawned); + //% chance + else if ((nVeggie > 69) && (nVeggie <= 75)) + CreateItemOnObject("mastersamuletofh", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 81)) + CreateItemOnObject("lichsgreedring", oSpawned); + //% chance + else if ((nVeggie > 81) && (nVeggie <= 83)) + CreateItemOnObject("zanscord", oSpawned); + //% chance + else if ((nVeggie > 83) && (nVeggie <= 85)) + CreateItemOnObject("naturesgift", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 87)) + CreateItemOnObject("forgottenaxe", oSpawned); + //% chance + else if ((nVeggie > 87) && (nVeggie <= 89)) + CreateItemOnObject("bladeofthesun", oSpawned); + //% chance + else if ((nVeggie > 89) && (nVeggie <= 92)) + CreateItemOnObject("ringofhate", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 95)) + CreateItemOnObject("maskofpain", oSpawned); + //% chance + else if ((nVeggie > 97) && (nVeggie <= 99)) + CreateItemOnObject("thedurvishsblade", oSpawned); + //% chance + else if (nVeggie > 99) + CreateItemOnObject("trudshook", oSpawned); + } + } + // + + // Table 35 for Journeyman Key to Spyre Tower 2 + if (nLootTable == 35) + { + // 99% Chance + if (d100() <= 99) + CreateItemOnObject("spyrekey1", oSpawned); + } + // + + + // Table 41 for Runes + if (nLootTable == 41) + { + // 100% Chance + if (d100() <= 50) + { + int nVeggie = d100(); + //25% chance + if(nVeggie <= 25) + CreateItemOnObject("voidrune", oSpawned); + //25% chance + if ((nVeggie > 25) && (nVeggie <= 50)) + CreateItemOnObject("touchrune", oSpawned); + //25% chance + if ((nVeggie > 50) && (nVeggie <= 75)) + CreateItemOnObject("selfrune", oSpawned); + //25% chance + if (nVeggie > 75) + CreateItemOnObject("projectionrune", oSpawned); + } + } + + // Table 42 for Arrows + if (nLootTable == 42) + { + + // 10% Chance + if (d100() <= 10) + { + int nVeggie = d100(); + //20% chance + if(nVeggie <= 20) + CreateItemOnObject("MysticArrow", oSpawned, 99); + //20% chance + if ((nVeggie > 20) && (nVeggie <= 40)) + CreateItemOnObject("NW_WAMMAR006", oSpawned, 99); + //20% chance + if ((nVeggie > 40) && (nVeggie <= 60)) + CreateItemOnObject("HeartSeekerArrow", oSpawned, 99); + //20% chance + if ((nVeggie > 60) && (nVeggie <= 80)) + CreateItemOnObject("wammar004", oSpawned, 99); + //20% chance + if (nVeggie > 80) + CreateItemOnObject("ShadowArrow", oSpawned, 99); + } + } + // Table 43 for undead dwarves + if (nLootTable == 43) + { + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //10% chance + if(nVeggie <= 10) + CreateItemOnObject("shroudofdecay", oSpawned); + //30% chance + if ((nVeggie > 10) && (nVeggie <= 40)) + CreateItemOnObject("waxgr002", oSpawned); + //15% chance + if ((nVeggie > 40) && (nVeggie <= 55)) + CreateItemOnObject("rockstemchopper", oSpawned); + //30% chance + if ((nVeggie > 55) && (nVeggie <= 85)) + CreateItemOnObject("steelbattleaxe", oSpawned); + //15% chance + if (nVeggie > 85) + CreateItemOnObject("carrikalofhuevra", oSpawned); + + } + } + + // Table 44 for large bone drops + if (nLootTable == 44) + { + // 10% Chance + if (d100() <= 10) + CreateItemOnObject("x2_it_cmat_bone", oSpawned); + } + + + // Table 45 for FD Hides + if (nLootTable == 45) + { + + + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("firedrakehide", oSpawned); + + } + + + // Table 46 for Dune Reaper Glands + if (nLootTable == 46) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("gland1", oSpawned); + + } + + // Table 47 for Defiler Ash + if (nLootTable == 47) + { + // 10% Chance + if (d100() <= 15) + CreateItemOnObject("defilerash", oSpawned); + + } + // Table 48 for defiler journeymen scrolls + if (nLootTable == 48) + { + // 15% Chance + if (d100() <= 15) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 5) + CreateItemOnObject("x2_it_sparscr101", oSpawned); + //% chance + else if ((nVeggie > 5) && (nVeggie <= 10)) + CreateItemOnObject("x2_it_sparscr104", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 15)) + CreateItemOnObject("x2_it_sparscr202", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 20)) + CreateItemOnObject("x2_it_sparscr105", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 25)) + CreateItemOnObject("nw_it_sparscr414", oSpawned); + //% chance + else if ((nVeggie > 25) && (nVeggie <= 30)) + CreateItemOnObject("nw_it_sparscr211", oSpawned); + //% chance + else if ((nVeggie > 30) && (nVeggie <= 35)) + CreateItemOnObject("nw_it_sparscr206", oSpawned); + //% chance + else if ((nVeggie > 35) && (nVeggie <= 40)) + CreateItemOnObject("nw_it_sparscr202", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 45)) + CreateItemOnObject("nw_it_sparscr315", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 50)) + CreateItemOnObject("nw_it_sparscr113", oSpawned); + //% chance + else if ((nVeggie > 50) && (nVeggie <= 55)) + CreateItemOnObject("nw_it_sparscr415", oSpawned); + //% chance + else if ((nVeggie > 55) && (nVeggie <= 60)) + CreateItemOnObject("nw_it_sparscr102", oSpawned); + //% chance + else if ((nVeggie > 60) && (nVeggie <= 65)) + CreateItemOnObject("nw_it_sparscr111", oSpawned); + //% chance + else if ((nVeggie > 65) && (nVeggie <= 70)) + CreateItemOnObject("nw_it_sparscr412", oSpawned); + //% chance + else if ((nVeggie > 70) && (nVeggie <= 75)) + CreateItemOnObject("nw_it_sparscr218", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 80)) + CreateItemOnObject("nw_it_sparscr104", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 85)) + CreateItemOnObject("nw_it_sparscr311", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 90)) + CreateItemOnObject("x2_it_sparscr205", oSpawned); + //% chance + else if ((nVeggie > 90) && (nVeggie <= 95)) + CreateItemOnObject("x2_it_sparscr201", oSpawned); + //% chance + else if (nVeggie > 95) + CreateItemOnObject("x2_it_sparscr203", oSpawned); + } + } +// Table 49 + if (nLootTable == 49) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("magmadrakehide", oSpawned); + } + // Table 50 + if (nLootTable == 50) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("sundrakehide", oSpawned); + } + // Table 51 + if (nLootTable == 51) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("raindrakehide", oSpawned); + } + // Table 52 + if (nLootTable == 52) + { + // 20% Chance + if (d100() <= 20) + CreateItemOnObject("siltdrakehide", oSpawned); + } + // Table 53 + if (nLootTable == 53) + { + // 100% Chance + if (d100() <= 100) + CreateItemOnObject("mimsitem", oSpawned); + } + +// Table 54 for Ashen Drake + if (nLootTable == 54) + { + // 90% Chance + if (d100() <= 90) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("robesofliving", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("pyreenforgedplat", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("rogueswrap", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("imbuedshield", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("mastersringofstr", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 15)) + CreateItemOnObject("mastersringofcon", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 17)) + CreateItemOnObject("mastersringofwis", oSpawned); + //% chance + else if ((nVeggie > 17) && (nVeggie <= 19)) + CreateItemOnObject("dimensionalblade", oSpawned); + //% chance + else if ((nVeggie > 19) && (nVeggie <= 21)) + CreateItemOnObject("frostbite", oSpawned); + //% chance + else if ((nVeggie > 21) && (nVeggie <= 27)) + CreateItemOnObject("mastersamuletofc", oSpawned); + //% chance + else if ((nVeggie > 27) && (nVeggie <= 33)) + CreateItemOnObject("mastersamuletofd", oSpawned); + //% chance + else if ((nVeggie > 33) && (nVeggie <= 39)) + CreateItemOnObject("mastersringofcha", oSpawned); + //% chance + else if ((nVeggie > 39) && (nVeggie <= 45)) + CreateItemOnObject("mastersamuletofw", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 51)) + CreateItemOnObject("mastersamuletofs", oSpawned); + //% chance + else if ((nVeggie > 51) && (nVeggie <= 57)) + CreateItemOnObject("mastersamuletofi", oSpawned); + //% chance + else if ((nVeggie > 57) && (nVeggie <= 63)) + CreateItemOnObject("mastersringofdex", oSpawned); + //% chance + else if ((nVeggie > 63) && (nVeggie <= 69)) + CreateItemOnObject("mastersringofint", oSpawned); + //% chance + else if ((nVeggie > 69) && (nVeggie <= 75)) + CreateItemOnObject("mastersamuletofh", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 81)) + CreateItemOnObject("astralblade", oSpawned); + //% chance + else if ((nVeggie > 81) && (nVeggie <= 83)) + CreateItemOnObject("backlash", oSpawned); + //% chance + else if ((nVeggie > 83) && (nVeggie <= 85)) + CreateItemOnObject("sureshot", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 87)) + CreateItemOnObject("forgottenaxe", oSpawned); + //% chance + else if ((nVeggie > 87) && (nVeggie <= 89)) + CreateItemOnObject("severer", oSpawned); + //% chance + else if ((nVeggie > 89) && (nVeggie <= 92)) + CreateItemOnObject("ringofhate", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 95)) + CreateItemOnObject("sunslasher", oSpawned); + //% chance + else if ((nVeggie > 97) && (nVeggie <= 99)) + CreateItemOnObject("thedurvishsblade", oSpawned); + //% chance + else if (nVeggie > 99) + CreateItemOnObject("robeofashend", oSpawned); + } + } +// Table 55 for Epic Level Foes VERSION 1 + if (nLootTable == 55) + { + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("iconicamuletofch", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("iconicamuletofst", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("iconicringofdext", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("iconicamuletofwi", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("iconicringofinte", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 12)) + CreateItemOnObject("iconicringofs", oSpawned); + //% chance + else if ((nVeggie > 12) && (nVeggie <= 14)) + CreateItemOnObject("iconicringofwisd", oSpawned); + //% chance + else if ((nVeggie > 14) && (nVeggie <= 16)) + CreateItemOnObject("iconicamuletofco", oSpawned); + //% chance + else if ((nVeggie > 16) && (nVeggie <= 18)) + CreateItemOnObject("iconicamuletofde", oSpawned); + //% chance + else if ((nVeggie > 18) && (nVeggie <= 20)) + CreateItemOnObject("iconicamuletofin", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 22)) + CreateItemOnObject("iconicringofchar", oSpawned); + //% chance + else if ((nVeggie > 22) && (nVeggie <= 24)) + CreateItemOnObject("iconicringofcons", oSpawned); + //% chance + else if ((nVeggie > 24) && (nVeggie <= 26)) + CreateItemOnObject("jingsgarb", oSpawned); + //% chance + else if ((nVeggie > 26) && (nVeggie <= 28)) + CreateItemOnObject("rhulthaunmaste", oSpawned); + //% chance + else if ((nVeggie > 28) && (nVeggie <= 30)) + CreateItemOnObject("robeofillwill", oSpawned); + //% chance + else if ((nVeggie > 30) && (nVeggie <= 32)) + CreateItemOnObject("phandarashelm", oSpawned); + //% chance + else if ((nVeggie > 32) && (nVeggie <= 34)) + CreateItemOnObject("beastmasterarm", oSpawned); + //% chance + else if ((nVeggie > 34) && (nVeggie <= 36)) + CreateItemOnObject("battleragearmo", oSpawned); + //% chance + else if ((nVeggie > 36) && (nVeggie <= 38)) + CreateItemOnObject("forgedshieldof", oSpawned); + //% chance + else if ((nVeggie > 38) && (nVeggie <= 40)) + CreateItemOnObject("halfbreedsguardi", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 42)) + CreateItemOnObject("girdleofpower", oSpawned); + //% chance + else if ((nVeggie > 42) && (nVeggie <= 44)) + CreateItemOnObject("jandorasgarb", oSpawned); + //% chance + else if ((nVeggie > 44) && (nVeggie <= 46)) + CreateItemOnObject("jandorastiara", oSpawned); + //% chance + else if ((nVeggie > 46) && (nVeggie <= 48)) + CreateItemOnObject("bracersofwardi", oSpawned); + //% chance + else if ((nVeggie > 48) && (nVeggie <= 50)) + CreateItemOnObject("torakswrap", oSpawned); + //% chance + else if ((nVeggie > 50) && (nVeggie <= 52)) + CreateItemOnObject("spectralcloak", oSpawned); + //% chance + else if ((nVeggie > 52) && (nVeggie <= 54)) + CreateItemOnObject("blindingedgegaun", oSpawned); + //% chance + else if ((nVeggie > 54) && (nVeggie <= 56)) + CreateItemOnObject("greaterringofadr", oSpawned); + //% chance + else if ((nVeggie > 56) && (nVeggie <= 58)) + CreateItemOnObject("x2_it_sparscr902", oSpawned); + //% chance + else if ((nVeggie > 58) && (nVeggie <= 60)) + CreateItemOnObject("x2_it_spdvscr509", oSpawned); + //% chance + else if ((nVeggie > 60) && (nVeggie <= 62)) + CreateItemOnObject("meteorforgedpl", oSpawned); + //% chance + else if ((nVeggie > 62) && (nVeggie <= 64)) + CreateItemOnObject("scorchedaxeof", oSpawned); + //% chance + else if ((nVeggie > 64) && (nVeggie <= 66)) + CreateItemOnObject("giftoftheelem", oSpawned); + //% chance + else if ((nVeggie > 66) && (nVeggie <= 68)) + CreateItemOnObject("ragnarok", oSpawned); + //% chance + else if ((nVeggie > 68) && (nVeggie <= 70)) + CreateItemOnObject("ginosbackstabb", oSpawned); + //% chance + else if ((nVeggie > 70) && (nVeggie <= 72)) + CreateItemOnObject("shimmeringblade", oSpawned); + //% chance + else if ((nVeggie > 72) && (nVeggie <= 74)) + CreateItemOnObject("thecleavelander", oSpawned); + //% chance + else if ((nVeggie > 74) && (nVeggie <= 76)) + CreateItemOnObject("lifesapper", oSpawned); + //% chance + else if ((nVeggie > 76) && (nVeggie <= 78)) + CreateItemOnObject("heartpiercer", oSpawned); + //% chance + else if ((nVeggie > 78) && (nVeggie <= 80)) + CreateItemOnObject("thewifebeater", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 82)) + CreateItemOnObject("theeclipse", oSpawned); + //% chance + else if ((nVeggie > 82) && (nVeggie <= 84)) + CreateItemOnObject("justlshammer", oSpawned); + //% chance + else if ((nVeggie > 84) && (nVeggie <= 86)) + CreateItemOnObject("sunstaff", oSpawned); + //% chance + else if ((nVeggie > 86) && (nVeggie <= 88)) + CreateItemOnObject("destinysedge", oSpawned); + //% chance + else if ((nVeggie > 88) && (nVeggie <= 90)) + CreateItemOnObject("theicyheart", oSpawned); + //% chance + else if ((nVeggie > 90) && (nVeggie <= 92)) + CreateItemOnObject("theoldballandcha", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 94)) + CreateItemOnObject("theharvester", oSpawned); + //% chance + else if ((nVeggie > 94) && (nVeggie <= 96)) + CreateItemOnObject("soulsharvest", oSpawned); + //% chance + else if ((nVeggie > 96) && (nVeggie <= 98)) + CreateItemOnObject("ds_a8_gorgoth001", oSpawned); + //% chance + else if (nVeggie > 98) + CreateItemOnObject("ds_h0_gorgoth001", oSpawned); + } + } +// Table 56 for Epic Level Foes VERSION 2 + if (nLootTable == 56) + { + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("dregothsrage", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("iconicamuletofst", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("iconicringofdext", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("iconicamuletofwi", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("iconicringofinte", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 12)) + CreateItemOnObject("iconicringofs", oSpawned); + //% chance + else if ((nVeggie > 12) && (nVeggie <= 14)) + CreateItemOnObject("iconicringofwisd", oSpawned); + //% chance + else if ((nVeggie > 14) && (nVeggie <= 16)) + CreateItemOnObject("iconicamuletofco", oSpawned); + //% chance + else if ((nVeggie > 16) && (nVeggie <= 18)) + CreateItemOnObject("iconicamuletofde", oSpawned); + //% chance + else if ((nVeggie > 18) && (nVeggie <= 20)) + CreateItemOnObject("iconicamuletofin", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 22)) + CreateItemOnObject("iconicringofchar", oSpawned); + //% chance + else if ((nVeggie > 22) && (nVeggie <= 24)) + CreateItemOnObject("iconicringofcons", oSpawned); + //% chance + else if ((nVeggie > 24) && (nVeggie <= 26)) + CreateItemOnObject("lalorsspine", oSpawned); + //% chance + else if ((nVeggie > 26) && (nVeggie <= 28)) + CreateItemOnObject("shininggythka", oSpawned); + //% chance + else if ((nVeggie > 28) && (nVeggie <= 30)) + CreateItemOnObject("devestation", oSpawned); + //% chance + else if ((nVeggie > 30) && (nVeggie <= 32)) + CreateItemOnObject("drakebonegythk", oSpawned); + //% chance + else if ((nVeggie > 32) && (nVeggie <= 34)) + CreateItemOnObject("robesofthewis", oSpawned); + //% chance + else if ((nVeggie > 34) && (nVeggie <= 36)) + CreateItemOnObject("embraceofthespir", oSpawned); + //% chance + else if ((nVeggie > 36) && (nVeggie <= 38)) + CreateItemOnObject("meteorforgedpl", oSpawned); + //% chance + else if ((nVeggie > 38) && (nVeggie <= 40)) + CreateItemOnObject("meteorforgedhe", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 42)) + CreateItemOnObject("meteorforgedarmo", oSpawned); + //% chance + else if ((nVeggie > 42) && (nVeggie <= 44)) + CreateItemOnObject("meteorforgedchai", oSpawned); + //% chance + else if ((nVeggie > 44) && (nVeggie <= 46)) + CreateItemOnObject("imbuedagafarilar", oSpawned); + //% chance + else if ((nVeggie > 46) && (nVeggie <= 48)) + CreateItemOnObject("imbuedagafarisma", oSpawned); + //% chance + else if ((nVeggie > 48) && (nVeggie <= 50)) + CreateItemOnObject("imbuedagafarishi", oSpawned); + //% chance + else if ((nVeggie > 50) && (nVeggie <= 52)) + CreateItemOnObject("guardianofthe", oSpawned); + //% chance + else if ((nVeggie > 52) && (nVeggie <= 54)) + CreateItemOnObject("blindingedgegaun", oSpawned); + //% chance + else if ((nVeggie > 54) && (nVeggie <= 56)) + CreateItemOnObject("heartofland", oSpawned); + //% chance + else if ((nVeggie > 56) && (nVeggie <= 58)) + CreateItemOnObject("x2_it_sparscr902", oSpawned); + //% chance + else if ((nVeggie > 58) && (nVeggie <= 60)) + CreateItemOnObject("x2_it_spdvscr509", oSpawned); + //% chance + else if ((nVeggie > 60) && (nVeggie <= 62)) + CreateItemOnObject("psitana", oSpawned); + //% chance + else if ((nVeggie > 62) && (nVeggie <= 64)) + CreateItemOnObject("messengerofraj", oSpawned); + //% chance + else if ((nVeggie > 64) && (nVeggie <= 66)) + CreateItemOnObject("retscutter", oSpawned); + //% chance + else if ((nVeggie > 66) && (nVeggie <= 68)) + CreateItemOnObject("solarflare", oSpawned); + //% chance + else if ((nVeggie > 68) && (nVeggie <= 70)) + CreateItemOnObject("lalisbliss", oSpawned); + //% chance + else if ((nVeggie > 70) && (nVeggie <= 72)) + CreateItemOnObject("shimmeringblade", oSpawned); + //% chance + else if ((nVeggie > 72) && (nVeggie <= 74)) + CreateItemOnObject("thecleavelander", oSpawned); + //% chance + else if ((nVeggie > 74) && (nVeggie <= 76)) + CreateItemOnObject("lifesapper", oSpawned); + //% chance + else if ((nVeggie > 76) && (nVeggie <= 78)) + CreateItemOnObject("heartpiercer", oSpawned); + //% chance + else if ((nVeggie > 78) && (nVeggie <= 80)) + CreateItemOnObject("thewifebeater", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 82)) + CreateItemOnObject("theeclipse", oSpawned); + //% chance + else if ((nVeggie > 82) && (nVeggie <= 84)) + CreateItemOnObject("justlshammer", oSpawned); + //% chance + else if ((nVeggie > 84) && (nVeggie <= 86)) + CreateItemOnObject("sunstaff", oSpawned); + //% chance + else if ((nVeggie > 86) && (nVeggie <= 88)) + CreateItemOnObject("destinysedge", oSpawned); + //% chance + else if ((nVeggie > 88) && (nVeggie <= 90)) + CreateItemOnObject("theicyheart", oSpawned); + //% chance + else if ((nVeggie > 90) && (nVeggie <= 92)) + CreateItemOnObject("dregothsrage", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 94)) + CreateItemOnObject("theharvester", oSpawned); + //% chance + else if ((nVeggie > 94) && (nVeggie <= 96)) + CreateItemOnObject("gauntletsoffai", oSpawned); + //% chance + else if ((nVeggie > 96) && (nVeggie <= 98)) + CreateItemOnObject("blindingedgegaun", oSpawned); + //% chance + else if (nVeggie > 98) + CreateItemOnObject("greaterringofadr", oSpawned); + } + + + // Table 57 + if (nLootTable == 57) + { + + // 3% Chance + if (d100(1) <= 6) + { + // Created Custom Item with ResRef of garlic + sTemplate = "farrauksreaper"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + // Table 58 + if (nLootTable == 58) + { + + // 2% Chance + if (d100(1) <= 4) + { + // Created Custom Item with ResRef of garlic + sTemplate = "imbuedobsidai"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + + } + // Table 56 for Epic Level Foes New Rares + if (nLootTable == 59) + { + // 5% Chance + if (d100() <= 5) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("dregothsrage", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("iconicamuletofst", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("iconicringofdext", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("iconicamuletofwi", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("iconicringofinte", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 12)) + CreateItemOnObject("iconicringofs", oSpawned); + //% chance + else if ((nVeggie > 12) && (nVeggie <= 14)) + CreateItemOnObject("iconicringofwisd", oSpawned); + //% chance + else if ((nVeggie > 14) && (nVeggie <= 16)) + CreateItemOnObject("iconicamuletofco", oSpawned); + //% chance + else if ((nVeggie > 16) && (nVeggie <= 18)) + CreateItemOnObject("iconicamuletofde", oSpawned); + //% chance + else if ((nVeggie > 18) && (nVeggie <= 20)) + CreateItemOnObject("iconicamuletofin", oSpawned); + //% chance + else if ((nVeggie > 20) && (nVeggie <= 22)) + CreateItemOnObject("iconicringofchar", oSpawned); + //% chance + else if ((nVeggie > 22) && (nVeggie <= 24)) + CreateItemOnObject("iconicringofcons", oSpawned); + //% chance + else if ((nVeggie > 24) && (nVeggie <= 26)) + CreateItemOnObject("lalorsspine", oSpawned); + //% chance + else if ((nVeggie > 26) && (nVeggie <= 28)) + CreateItemOnObject("shininggythka", oSpawned); + //% chance + else if ((nVeggie > 28) && (nVeggie <= 30)) + CreateItemOnObject("devestation", oSpawned); + //% chance + else if ((nVeggie > 30) && (nVeggie <= 32)) + CreateItemOnObject("drakebonegythk", oSpawned); + //% chance + else if ((nVeggie > 32) && (nVeggie <= 34)) + CreateItemOnObject("robesofthewis", oSpawned); + //% chance + else if ((nVeggie > 34) && (nVeggie <= 36)) + CreateItemOnObject("embraceofthespir", oSpawned); + //% chance + else if ((nVeggie > 36) && (nVeggie <= 38)) + CreateItemOnObject("meteorforgedpl", oSpawned); + //% chance + else if ((nVeggie > 38) && (nVeggie <= 40)) + CreateItemOnObject("meteorforgedhe", oSpawned); + //% chance + else if ((nVeggie > 40) && (nVeggie <= 42)) + CreateItemOnObject("meteorforgedarmo", oSpawned); + //% chance + else if ((nVeggie > 42) && (nVeggie <= 44)) + CreateItemOnObject("meteorforgedchai", oSpawned); + //% chance + else if ((nVeggie > 44) && (nVeggie <= 46)) + CreateItemOnObject("imbuedagafarilar", oSpawned); + //% chance + else if ((nVeggie > 46) && (nVeggie <= 48)) + CreateItemOnObject("imbuedagafarisma", oSpawned); + //% chance + else if ((nVeggie > 48) && (nVeggie <= 50)) + CreateItemOnObject("imbuedagafarishi", oSpawned); + //% chance + else if ((nVeggie > 50) && (nVeggie <= 52)) + CreateItemOnObject("guardianofthe", oSpawned); + //% chance + else if ((nVeggie > 52) && (nVeggie <= 54)) + CreateItemOnObject("blindingedgegaun", oSpawned); + //% chance + else if ((nVeggie > 54) && (nVeggie <= 56)) + CreateItemOnObject("heartofland", oSpawned); + //% chance + else if ((nVeggie > 56) && (nVeggie <= 58)) + CreateItemOnObject("x2_it_sparscr902", oSpawned); + //% chance + else if ((nVeggie > 58) && (nVeggie <= 60)) + CreateItemOnObject("x2_it_spdvscr509", oSpawned); + //% chance + else if ((nVeggie > 60) && (nVeggie <= 62)) + CreateItemOnObject("psitana", oSpawned); + //% chance + else if ((nVeggie > 62) && (nVeggie <= 64)) + CreateItemOnObject("messengerofraj", oSpawned); + //% chance + else if ((nVeggie > 64) && (nVeggie <= 66)) + CreateItemOnObject("retscutter", oSpawned); + //% chance + else if ((nVeggie > 66) && (nVeggie <= 68)) + CreateItemOnObject("solarflare", oSpawned); + //% chance + else if ((nVeggie > 68) && (nVeggie <= 70)) + CreateItemOnObject("lalisbliss", oSpawned); + //% chance + else if ((nVeggie > 70) && (nVeggie <= 72)) + CreateItemOnObject("shimmeringblade", oSpawned); + //% chance + else if ((nVeggie > 72) && (nVeggie <= 74)) + CreateItemOnObject("thecleavelander", oSpawned); + //% chance + else if ((nVeggie > 74) && (nVeggie <= 76)) + CreateItemOnObject("lifesapper", oSpawned); + //% chance + else if ((nVeggie > 76) && (nVeggie <= 78)) + CreateItemOnObject("heartpiercer", oSpawned); + //% chance + else if ((nVeggie > 78) && (nVeggie <= 80)) + CreateItemOnObject("thewifebeater", oSpawned); + //% chance + else if ((nVeggie > 80) && (nVeggie <= 82)) + CreateItemOnObject("theeclipse", oSpawned); + //% chance + else if ((nVeggie > 82) && (nVeggie <= 84)) + CreateItemOnObject("justlshammer", oSpawned); + //% chance + else if ((nVeggie > 84) && (nVeggie <= 86)) + CreateItemOnObject("sunstaff", oSpawned); + //% chance + else if ((nVeggie > 86) && (nVeggie <= 88)) + CreateItemOnObject("destinysedge", oSpawned); + //% chance + else if ((nVeggie > 88) && (nVeggie <= 90)) + CreateItemOnObject("theicyheart", oSpawned); + //% chance + else if ((nVeggie > 90) && (nVeggie <= 92)) + CreateItemOnObject("dregothsrage", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 94)) + CreateItemOnObject("theharvester", oSpawned); + //% chance + else if ((nVeggie > 94) && (nVeggie <= 96)) + CreateItemOnObject("gauntletsoffai", oSpawned); + //% chance + else if ((nVeggie > 96) && (nVeggie <= 98)) + CreateItemOnObject("blindingedgegaun", oSpawned); + //% chance + else if (nVeggie > 98) + CreateItemOnObject("greaterringofadr", oSpawned); + } + // Table 60 + + if (nLootTable == 60) + { + // 90% Chance + if (d100() <= 90) + { + int nVeggie = d100(); + //% chance + if (nVeggie <= 2) + CreateItemOnObject("robesofliving", oSpawned); + //% chance + else if ((nVeggie > 2) && (nVeggie <= 4)) + CreateItemOnObject("pyreenforgedplat", oSpawned); + //% chance + else if ((nVeggie > 4) && (nVeggie <= 6)) + CreateItemOnObject("rogueswrap", oSpawned); + //% chance + else if ((nVeggie > 6) && (nVeggie <= 8)) + CreateItemOnObject("imbuedshield", oSpawned); + //% chance + else if ((nVeggie > 8) && (nVeggie <= 10)) + CreateItemOnObject("mastersringofstr", oSpawned); + //% chance + else if ((nVeggie > 10) && (nVeggie <= 15)) + CreateItemOnObject("mastersringofcon", oSpawned); + //% chance + else if ((nVeggie > 15) && (nVeggie <= 17)) + CreateItemOnObject("mastersringofwis", oSpawned); + //% chance + else if ((nVeggie > 17) && (nVeggie <= 19)) + CreateItemOnObject("dimensionalblade", oSpawned); + //% chance + else if ((nVeggie > 19) && (nVeggie <= 21)) + CreateItemOnObject("frostbite", oSpawned); + //% chance + else if ((nVeggie > 21) && (nVeggie <= 27)) + CreateItemOnObject("mastersamuletofc", oSpawned); + //% chance + else if ((nVeggie > 27) && (nVeggie <= 33)) + CreateItemOnObject("mastersamuletofd", oSpawned); + //% chance + else if ((nVeggie > 33) && (nVeggie <= 39)) + CreateItemOnObject("mastersringofcha", oSpawned); + //% chance + else if ((nVeggie > 39) && (nVeggie <= 45)) + CreateItemOnObject("mastersamuletofw", oSpawned); + //% chance + else if ((nVeggie > 45) && (nVeggie <= 51)) + CreateItemOnObject("mastersamuletofs", oSpawned); + //% chance + else if ((nVeggie > 51) && (nVeggie <= 57)) + CreateItemOnObject("mastersamuletofi", oSpawned); + //% chance + else if ((nVeggie > 57) && (nVeggie <= 63)) + CreateItemOnObject("mastersringofdex", oSpawned); + //% chance + else if ((nVeggie > 63) && (nVeggie <= 69)) + CreateItemOnObject("mastersringofint", oSpawned); + //% chance + else if ((nVeggie > 69) && (nVeggie <= 75)) + CreateItemOnObject("mastersamuletofh", oSpawned); + //% chance + else if ((nVeggie > 75) && (nVeggie <= 81)) + CreateItemOnObject("astralblade", oSpawned); + //% chance + else if ((nVeggie > 81) && (nVeggie <= 83)) + CreateItemOnObject("backlash", oSpawned); + //% chance + else if ((nVeggie > 83) && (nVeggie <= 85)) + CreateItemOnObject("sureshot", oSpawned); + //% chance + else if ((nVeggie > 85) && (nVeggie <= 87)) + CreateItemOnObject("forgottenaxe", oSpawned); + //% chance + else if ((nVeggie > 87) && (nVeggie <= 89)) + CreateItemOnObject("severer", oSpawned); + //% chance + else if ((nVeggie > 89) && (nVeggie <= 92)) + CreateItemOnObject("ringofhate", oSpawned); + //% chance + else if ((nVeggie > 92) && (nVeggie <= 95)) + CreateItemOnObject("sunslasher", oSpawned); + //% chance + else if ((nVeggie > 97) && (nVeggie <= 99)) + CreateItemOnObject("thedurvishsblade", oSpawned); + //% chance + else if (nVeggie > 99) + CreateItemOnObject("robeofashend", oSpawned); + } + // Table 61 + if (nLootTable == 61) + { + // 15% Chance + if (d100(1) <= 15) + { + // Drops VA Key + sTemplate = "vakey"; + nStack = 1; + } + oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); + } + } +// if ((nVeggie > 44) && (nVeggie < 91)){ +// sTemplate = "garlic"; +// // +// // 20% Chance +// if (d100(1) < 20) +// { +// // Created Custom Item with ResRef of garlic +// sTemplate = "voidrune"; +// nStack = 1; +// } +// oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); +// } +// if (nLootTable == 42) +// { +// +// // 20% Chance +// if (d100(1) < 20) +// { +// // Created Custom Item with ResRef of garlic +// sTemplate = "touchrune"; +// nStack = 1; +// } +// } +// if (nLootTable == 43) +// { +// +// // 20% Chance +// if (d100(1) < 20) +// { +// // Created Custom Item with ResRef of garlic +// sTemplate = "projectionrune"; +// nStack = 1; +// } +// oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); +// } +// if (nLootTable == 44) +// { +// +// // 20% Chance +// if (d100(1) < 20) +// { +// // Created Custom Item with ResRef of garlic +// sTemplate = "selfrune"; +// nStack = 1; +// } +// oItem = CreateItemOnObject(sTemplate, oSpawned, nStack); +// } + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +}} +//void main () {} diff --git a/nwnds_module/spawn_chk_custom.nss b/nwnds_module/spawn_chk_custom.nss new file mode 100644 index 000000000..cfdb1dea3 --- /dev/null +++ b/nwnds_module/spawn_chk_custom.nss @@ -0,0 +1,103 @@ +// +// Spawn Check - Custom +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +int SpawnCheckCustom(object oSpawn) +{ + // Initialize Values + int nSpawnCheckCustom = GetLocalInt(oSpawn, "f_SpawnCheckCustom"); + + // Block Spawn by Default + int nProcessSpawn = FALSE; + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + // Check 00 + if (nSpawnCheckCustom == 0) + { + // Example, Allow Spawn + nProcessSpawn = TRUE; + } + // + + // + if (nSpawnCheckCustom == 1) + { + if (GetIsDawn() == TRUE || GetIsDay() == TRUE) + { + nProcessSpawn = TRUE; + SetLocalInt(oSpawn, "SpawnProcessed", FALSE); + } + else + { + int nSpawnProcessed = GetLocalInt(oSpawn, "SpawnProcessed"); + if (nSpawnProcessed == FALSE) + { + nProcessSpawn = TRUE; + SetLocalInt(oSpawn, "SpawnProcessed", TRUE); + } + } + } + // + + // Reproducing Predators + if (nSpawnCheckCustom == 10) + { + int nChildren = GetLocalInt(oSpawn, "ChildrenSpawned"); + if (nChildren >= 10) + { + int nHappy = 0; + int nPredators; + int nNth = 1; + object oPredator = GetNearestObject(OBJECT_TYPE_CREATURE, oSpawn, nNth); + while (oPredator != OBJECT_INVALID) + { + if (GetLocalInt(oPredator, "Predator") == TRUE) + { + nPredators++; + if (GetLocalInt(oPredator, "CurrentHungerState") > 0) + { + nHappy++; + } + } + nNth++; + oPredator = GetNearestObject(OBJECT_TYPE_CREATURE, oSpawn, nNth); + } + SendMessageToAllDMs("There are " + IntToString(nPredators) + " Predators Alive."); + if (nHappy >= 2) + { + nProcessSpawn = TRUE; + } + } + else + { + nProcessSpawn = TRUE; + } + if (nProcessSpawn == TRUE) + { + SendMessageToAllDMs("A Predator is Born!"); + } + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Return whether Spawn can Proceed + return nProcessSpawn; +} diff --git a/nwnds_module/spawn_chk_pcs.nss b/nwnds_module/spawn_chk_pcs.nss new file mode 100644 index 000000000..06d35d86c --- /dev/null +++ b/nwnds_module/spawn_chk_pcs.nss @@ -0,0 +1,132 @@ +// +// Spawn Check - PCs +// +int ParseFlagValue(string sName, string sFlag, int nDigits, int nDefault); +int ParseSubFlagValue(string sName, string sFlag, int nDigits, string sSubFlag, int nSubDigits, int nDefault); +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +int SpawnCheckPCs(object oSpawn) +{ + // Initialize Values + object oPC; + object oArea = GetArea(oSpawn); + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + location lSpawn = GetLocation(oSpawn); + int nCheckPCs = GetLocalInt(oSpawn, "f_SpawnCheckPCs"); + float fCheckPCsRadius = GetLocalFloat(oSpawn, "f_CheckPCsRadius"); + + // Block Spawn by Default + int nProcessSpawn = FALSE; + + // Cycle through PCs + if (fCheckPCsRadius > -1.0) + { + oPC = GetFirstObjectInShape(SHAPE_SPHERE, fCheckPCsRadius, lSpawn, FALSE, OBJECT_TYPE_CREATURE); + } + else + { + oPC = GetFirstObjectInArea(oArea); + } + while (oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC) == TRUE) + { + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Check 00 + if (nCheckPCs == 0) + { + // Example, Allow Spawn + nProcessSpawn = TRUE; + } + // + + // Spawn with a Skill Check + if (nCheckPCs == 1) + { + // Get Current Number of Children + int nSpawnCount = GetLocalInt(oSpawn, "SpawnCount"); + + if (nSpawnCount == 0) + { + // DC of Hidden Placeable + int nItemDC = 20; + + // Player's Skill + int nSkill = GetSkillRank(SKILL_SEARCH, oPC); + + // Do Skill Check + int nDCCheck = d20() + nSkill; + if (nDCCheck >= nItemDC) + { + // Placeable Spotted! + string sSpotted = "You notice a thingamathingy!"; + FloatingTextStringOnCreature(sSpotted, oPC, TRUE); + //Spawn it! + nProcessSpawn = TRUE; + } + } + } + // + + // Spawn Based on Journal Quest Entry + if (nCheckPCs == 1) + { + // Check Journal Quest Entry + int nQuest = GetLocalInt(oPC, "NW_JOURNAL_ENTRYQuest1"); + if (nQuest == 1) + { + // Quest Entry is 1, Spawn! + nProcessSpawn = TRUE; + } + } + // + + // Spawn Based on Item in PC Inventory + if (nCheckPCs == 2) + { + // Check Player for Item + object oItem = GetFirstItemInInventory(oPC); + while (oItem != OBJECT_INVALID) + { + if (GetTag(oItem) == "MysticKey") + { + // Item Found, Spawn! + nProcessSpawn = TRUE; + } + oItem = GetNextItemInInventory(oPC); + } + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + } + // Retreive Next PC + if (fCheckPCsRadius > -1.0) + { + oPC = GetNextObjectInShape(SHAPE_SPHERE, fCheckPCsRadius, lSpawn, FALSE, OBJECT_TYPE_CREATURE); + } + else + { + oPC = GetNextObjectInArea(oArea); + } + } + + // Return whether Spawn can Proceed + return nProcessSpawn; +} diff --git a/nwnds_module/spawn_corpse_dcy.ncs b/nwnds_module/spawn_corpse_dcy.ncs new file mode 100644 index 000000000..a5a090d7a Binary files /dev/null and b/nwnds_module/spawn_corpse_dcy.ncs differ diff --git a/nwnds_module/spawn_corpse_dcy.nss b/nwnds_module/spawn_corpse_dcy.nss new file mode 100644 index 000000000..c27063be3 --- /dev/null +++ b/nwnds_module/spawn_corpse_dcy.nss @@ -0,0 +1,62 @@ +// +// NESS V8.0 +// Spawn: Corpse Decay Script +// +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +#include "spawn_functions" + +void main() +{ + object oHostBody = OBJECT_SELF; + object oLootCorpse = GetLocalObject(oHostBody, "Corpse"); + object oItem; + float fCorpseDecay; + + // Don't Decay while Someone is Looting + if (GetIsOpen(oLootCorpse) == TRUE) + { + // try again + fCorpseDecay = GetLocalFloat(oHostBody, "CorpseDecay"); + DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oHostBody)); + return; + } + + // Don't Decay if not Empty and Timer not Expired + oItem = GetFirstItemInInventory(oLootCorpse); + int nDecayTimerExpired = GetLocalInt(oHostBody, "DecayTimerExpired"); + + // Don't think this should ever happen, since nDecayTimerExpired should + // be set to try by the command immediately beforethe one invoking this + // script! + if (oItem != OBJECT_INVALID && nDecayTimerExpired == FALSE) + { + fCorpseDecay = GetLocalFloat(oHostBody, "CorpseDecay"); + DelayCommand(fCorpseDecay - 0.1, SetLocalInt(oHostBody, "DecayTimerExpired", TRUE)); + DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oHostBody)); + return; + } + + int bDeleteLootOnDecay = GetLocalInt(oHostBody, "CorpseDeleteLootOnDecay"); + + // To avoid potential memory leaks, we clean everything that might be left on the + // original creatures body + NESS_CleanCorpse(oHostBody); + + // Destroy all loot if indicated (R7 subflag) + if (bDeleteLootOnDecay) + { + NESS_CleanInventory(oLootCorpse); + } + + // Destroy the invis corpse and drop a loot bag (if any loot left) + SetPlotFlag(oLootCorpse, FALSE); + DestroyObject(oLootCorpse); + + // Destroy the visible corpse + SetObjectIsDestroyable(oHostBody, TRUE, FALSE, FALSE); + DestroyObject(oHostBody, 0.2); +} diff --git a/nwnds_module/spawn_corpse_dth.ncs b/nwnds_module/spawn_corpse_dth.ncs new file mode 100644 index 000000000..72c9d33cd Binary files /dev/null and b/nwnds_module/spawn_corpse_dth.ncs differ diff --git a/nwnds_module/spawn_corpse_dth.nss b/nwnds_module/spawn_corpse_dth.nss new file mode 100644 index 000000000..019a5d8e2 --- /dev/null +++ b/nwnds_module/spawn_corpse_dth.nss @@ -0,0 +1,119 @@ +// +// NESS V8.0 +// Spawn : Corpse Death Script +// +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +#include "spawn_functions" + +void main() +{ + object oDeadNPC = OBJECT_SELF; + object oLootCorpse, oBlood; + location lCorpseLoc = GetLocation(oDeadNPC); + float fCorpseDecay = GetLocalFloat(oDeadNPC, "CorpseDecay"); + int nCorpseDecayType = GetLocalInt(oDeadNPC, "CorpseDecayType"); + int bDropWielded = GetLocalInt(oDeadNPC, "CorpseDropWielded"); + string sLootCorpseResRef = GetLocalString(oDeadNPC, "CorpseRemainsResRef"); + struct NESS_CorpseInfo stCorpseInfo; + + int nCorpseGold = FALSE, nCorpseInv = FALSE, nCorpseEquip = FALSE; + + object oKiller = GetLastDamager(); + if (oKiller == OBJECT_INVALID) + { + oKiller = GetLastKiller(); + } + + if (fCorpseDecay > 0.0) + { + //Protect our corpse from decaying + SetIsDestroyable(FALSE, FALSE, FALSE); + + // Create Corpse and Lootable Corpse + oLootCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, sLootCorpseResRef, lCorpseLoc); + + SetLocalObject(oLootCorpse, "HostBody", oDeadNPC); + SetLocalObject(oDeadNPC, "Corpse", oLootCorpse); + + switch (nCorpseDecayType) + { + // Type 0: + // Inventory Items + case 0: + nCorpseGold = TRUE; + nCorpseInv = TRUE; + nCorpseEquip = FALSE; + break; + + // Type 1: + // Inventory & Equipped Items + case 1: + nCorpseGold = TRUE; + nCorpseInv = TRUE; + nCorpseEquip = TRUE; + break; + + // Type 2: + // Inventory Items, if PC Killed + case 2: + if (GetIsPC(oKiller) == TRUE || GetIsPC(GetMaster(oKiller)) == TRUE) + { + nCorpseGold = TRUE; + nCorpseInv = TRUE; + nCorpseEquip = FALSE; + } + break; + + // Type 3: + // Inventory & Equipped Items, if PC Killed + case 3: + if (GetIsPC(oKiller) == TRUE || GetIsPC(GetMaster(oKiller)) == TRUE) + { + nCorpseGold = TRUE; + nCorpseInv = TRUE; + nCorpseEquip = TRUE; + } + break; + } + + // Get Gold + if (nCorpseGold == TRUE) + { + int nAmtGold = GetGold(oDeadNPC); + if(nAmtGold) + { + object oGold = CreateItemOnObject("nw_it_gold001", oLootCorpse, nAmtGold); + AssignCommand(oLootCorpse, TakeGoldFromCreature(nAmtGold, oDeadNPC,TRUE)); + } + } + + // Get Inventory & Equipment + if (nCorpseEquip == TRUE) + { + stCorpseInfo = TransferAllInventorySlots(oDeadNPC, oLootCorpse, bDropWielded); + } + + if (nCorpseInv == TRUE) + { + LootInventory(oDeadNPC, oLootCorpse); + } + + // Write a record of stuff left on the original corpse and its loot + // corpse counterpart. These are used to remove items from the visual corpse + // when the corresponding items are looted + SetLocalObject(oLootCorpse, "OrigArmor", stCorpseInfo.origArmor); + SetLocalObject(oLootCorpse, "LootArmor", stCorpseInfo.lootArmor); + SetLocalObject(oLootCorpse, "OrigRgtWpn", stCorpseInfo.origRgtWpn); + SetLocalObject(oLootCorpse, "LootRgtWpn", stCorpseInfo.lootRgtWpn); + SetLocalObject(oLootCorpse, "OrigLftWpn", stCorpseInfo.origLftWpn); + SetLocalObject(oLootCorpse, "LootLftWpn", stCorpseInfo.lootLftWpn); + + // Set Corpse to Decay + DelayCommand(fCorpseDecay - 0.1, SetLocalInt(oDeadNPC, "DecayTimerExpired", TRUE)); + DelayCommand(fCorpseDecay, ExecuteScript("spawn_corpse_dcy", oDeadNPC)); + } +} diff --git a/nwnds_module/spawn_defaults.nss b/nwnds_module/spawn_defaults.nss new file mode 100644 index 000000000..862a866c1 --- /dev/null +++ b/nwnds_module/spawn_defaults.nss @@ -0,0 +1,293 @@ +// +// NESS V8.1.3 +// +// Spawn Global Defaults +// +// + +// SXn +// Set this value to 1 to have dim returns suppression be the default +// when no SX flag is present. +int nGlobalSuppressDR = 0; + +// This is the default value for the SX flag when no value is specified. +// Set to 0 to make SX (without a value) enable dim returns. +int nSuppressDR = 1; + +// SPnOn +int nProcessFrequency = 1; +int nProcessOffset = 0; + +// ISnDn +// InitialState +int nInitialState = 1; +int nInitialDelay = -1; + +// FTn +// FlagTable +int nFlagTableNumber = 0; + +// SDn|Mn +// SpawnDelay +int nSpawnDelay = 0; +int nDelayMinimum = 0; + +// SNn|Mn SA|n|Mn +// SpawnNumber +int nSpawnNumber = 1; +int nSpawnNumberMin = -1; +int nSpawnNumberAtOnce = 0; +int nSpawnNumberAtOnceMin = 0; + +// DYn|Tn +// SpawnDay +int nSpawnDayStart = -1; +int nSpawnDayEnd = -1; + +// HRn|Tn +// SpawnHour +int nSpawnHourStart = -1; +int nSpawnHourEnd = -1; + +// RW|Rn +// RandomWalk +int nWanderRange = 0; + +// RH|Dn +// ReturnHome +int nReturnHomeRange = 1; + +// PC|n|R +// PCCheck +int nPCCheckDelay = 0; + +// RGn|Mn|Cn +// RandomGold +int nRandomGold = 0; +int nRandomGoldMin = 0; +int nGoldChance = 100; + +// FXn|Dn +// SpawnEffects +int nSpawnEffect = 0; +int nDespawnEffect = 0; + +// PRn|Tn +// PatrolRoutes +int nPatrolRoute = -1; +int nRouteType = 0; + +// PLn|Tn|Pn +// Placeables +int nPlaceableType = 0; +int nPlaceableRefreshPeriod = 60; +int nTrapDisabled = 100; + +// LTn|An|Bn|Cn +// LootTable +int nLootTable = -1; + +// Cereborn: added 12/31/02 +int nLootTable1ItemChance = 50; +int nLootTable2ItemChance = 15; +int nLootTable3ItemChance = 5; + +// DSn|Sn +// SpawnDeactivation +int nDeactivateSpawn = -1; +int nDeactivateScript = -1; + +// DIn +// DeactivationInfo +int nDeactivationInfo = -1; + +// CLn|Mn +// ChildLifespan +int nChildLifespanMax = -1; +int nChildLifespanMin = -1; + +// SRn|Mn|P +// SpawnRadius +int nSpawnRadius = 0; +int nSpawnRadiusMin = 0; + +// SUn|In +// SpawnUnseen +int nSpawnUnseen = 0; +int nUnseenRetryCount = -1; + +// CDn|Tn|Rn|D +// CorpseDecay +int nCorpseDecay = 0; +int nCorpseDecayType = 0; +int nCorpseRemainsType = 0; + +// CM|Dn +// SpawnCamp +int nCampDecay = 0; + +// SSn|Dn +// SpawnScript +int nSpawnScript = -1; +int nDespawnScript = -1; + +// DTn +// DeathScript +int nDeathScript = -1; + +// CCn +// SpawnCheckCustom +int nSpawnCheckCustom = -1; + +// CPn|Rn +// SpawnCheckPCs +int nSpawnCheckPCs = -1; +int nCheckPCsRadius = -1; + +// TRn|Dn +// SpawnTrigger +int nSpawnTrigger = 0; +int nDespawnTrigger = 0; + +// AEn|Dn +// AreaEffect +int nSpawnAreaEffect = 0; +int nAreaEffectDuration = 5; + +// OEn|Dn +// ObjectEffect +int nObjectEffect = 0; +int nObjectEffectDuration = -1; + +// RSn +// RandomSpawn +int nRandomSpawn = 100; + +// FCn +// SpawnFaction +int nSpawnFaction = -1; + +// ALn|Sn +int nSpawnAlignment = -1; +int nAlignmentShift = 10; + +// HBn +// HeartbeatScript +int nHeartbeatScript = -1; + +// SLn|Rn +// SpawnLocation +int nSpawnLocation = -1; +int nSpawnLocationMin = -1; + +// EEn|Rn +// EntranceExit +int nEntranceExit = -1; +int nEntranceExitMin = -1; +int nExit = -1; +int nExitMin = -1; + +// HL|n|E +// HealChildren +int nHealChildren = 0; + +// Sittable Tag +string sSeatTag = "Seat"; + +int nEncounterLevel = 0; +int bLeftoversForceProcessing = 1; +int bCheckForStuckPatrols = 1; +int bAlwaysDestroyCorpses = 1; + + +void SetUserGlobalDefaults(); + +void SetGlobalDefaults() +{ + SetUserGlobalDefaults(); + + // Record Values + object oModule = GetModule(); + SetLocalInt(oModule, "df_GlobalSuppressDR", nGlobalSuppressDR); + SetLocalInt(oModule, "df_SuppressDR", nSuppressDR); + SetLocalInt(oModule, "df_processFrequency", nProcessFrequency); + SetLocalInt(oModule, "df_processOffset", nProcessOffset); + SetLocalInt(oModule, "df_InitialState", nInitialState); + SetLocalInt(oModule, "df_InitialDelay", nInitialDelay); + SetLocalInt(oModule, "df_FlagTableNumber", nFlagTableNumber); + SetLocalInt(oModule, "df_SpawnDelay", nSpawnDelay); + SetLocalInt(oModule, "df_DelayMinimum", nDelayMinimum); + SetLocalInt(oModule, "df_SpawnNumber", nSpawnNumber); + SetLocalInt(oModule, "df_SpawnNumberMin", nSpawnNumberMin); + SetLocalInt(oModule, "df_SpawnNumberAtOnce", nSpawnNumberAtOnce); + SetLocalInt(oModule, "df_SpawnNumberAtOnceMin", nSpawnNumberAtOnceMin); + SetLocalInt(oModule, "df_SpawnDayStart", nSpawnDayStart); + SetLocalInt(oModule, "df_SpawnDayEnd", nSpawnDayEnd); + SetLocalInt(oModule, "df_SpawnHourStart", nSpawnHourStart); + SetLocalInt(oModule, "df_SpawnHourEnd", nSpawnHourEnd); + SetLocalInt(oModule, "df_WanderRange", nWanderRange); + SetLocalInt(oModule, "df_ReturnHomeRange", nReturnHomeRange); + SetLocalInt(oModule, "df_PCCheckDelay", nPCCheckDelay); + SetLocalInt(oModule, "df_RandomGold", nRandomGold); + SetLocalInt(oModule, "df_RandomGoldMin", nRandomGoldMin); + SetLocalInt(oModule, "df_GoldChance", nGoldChance); + SetLocalInt(oModule, "df_SpawnEffect", nSpawnEffect); + SetLocalInt(oModule, "df_DespawnEffect", nDespawnEffect); + SetLocalInt(oModule, "df_PatrolRoute", nPatrolRoute); + SetLocalInt(oModule, "df_RouteType", nRouteType); + SetLocalInt(oModule, "df_PlaceableType", nPlaceableType); + SetLocalInt(oModule, "df_PlaceableRefreshPeriod", nPlaceableRefreshPeriod); + SetLocalInt(oModule, "df_TrapDisabled", nTrapDisabled); + SetLocalInt(oModule, "df_LootTable", nLootTable); + SetLocalInt(oModule, "df_LootTable1ItemChance", nLootTable1ItemChance); + SetLocalInt(oModule, "df_LootTable2ItemChance", nLootTable2ItemChance); + SetLocalInt(oModule, "df_LootTable3ItemChance", nLootTable3ItemChance); + SetLocalInt(oModule, "df_DeactivateSpawn", nDeactivateSpawn); + SetLocalInt(oModule, "df_DeactivateScript", nDeactivateScript); + SetLocalInt(oModule, "df_DeactivationInfo", nDeactivationInfo); + SetLocalInt(oModule, "df_ChildLifespanMax", nChildLifespanMax); + SetLocalInt(oModule, "df_ChildLifespanMin", nChildLifespanMin); + SetLocalInt(oModule, "df_SpawnRadius", nSpawnRadius); + SetLocalInt(oModule, "df_SpawnRadiusMin", nSpawnRadiusMin); + SetLocalInt(oModule, "df_SpawnUnseen", nSpawnUnseen); + SetLocalInt(oModule, "df_UnseenRetryCount", nUnseenRetryCount); + SetLocalInt(oModule, "df_CorpseDecay", nCorpseDecay); + SetLocalInt(oModule, "df_CorpseDecayType", nCorpseDecayType); + SetLocalInt(oModule, "df_CampDecay", nCampDecay); + SetLocalInt(oModule, "df_SpawnScript", nSpawnScript); + SetLocalInt(oModule, "df_DespawnScript", nDespawnScript); + SetLocalInt(oModule, "df_DeathScript", nDeathScript); + SetLocalInt(oModule, "df_SpawnCheckCustom", nSpawnCheckCustom); + SetLocalInt(oModule, "df_SpawnCheckPCs", nSpawnCheckPCs); + SetLocalInt(oModule, "f_CheckPCsRadius", nCheckPCsRadius); + SetLocalInt(oModule, "df_SpawnTrigger", nSpawnTrigger); + SetLocalInt(oModule, "df_DespawnTrigger", nDespawnTrigger); + SetLocalInt(oModule, "df_SpawnAreaEffect", nSpawnAreaEffect); + SetLocalInt(oModule, "df_AreaEffectDuration", nAreaEffectDuration); + SetLocalInt(oModule, "df_ObjectEffect", nObjectEffect); + SetLocalInt(oModule, "df_ObjectEffectDuration", nObjectEffectDuration); + SetLocalInt(oModule, "df_RandomSpawn", nRandomSpawn); + SetLocalInt(oModule, "df_SpawnFaction", nSpawnFaction); + SetLocalInt(oModule, "df_SpawnAlignment", nSpawnAlignment); + SetLocalInt(oModule, "df_AlignmentShift", nAlignmentShift); + SetLocalInt(oModule, "df_HeartbeatScript", nHeartbeatScript); + SetLocalInt(oModule, "df_SpawnLocation", nSpawnLocation); + SetLocalInt(oModule, "df_SpawnLocationMin", nSpawnLocationMin); + SetLocalInt(oModule, "df_EntranceExit", nEntranceExit); + SetLocalInt(oModule, "df_EntranceExitMin", nEntranceExitMin); + SetLocalInt(oModule, "df_Exit", nExit); + SetLocalInt(oModule, "df_ExitMin", nExitMin); + SetLocalInt(oModule, "df_HealChildren", nHealChildren); + SetLocalInt(oModule, "df_EncounterLevel", nEncounterLevel); + SetLocalInt(oModule, "df_CorpseRemainsType", nCorpseRemainsType); + + SetLocalInt(oModule, "ModuleSpawnCount", 0); + + SetLocalString(oModule, "df_SeatTag", sSeatTag); + SetLocalInt(oModule, "LeftoversForceProcessing", bLeftoversForceProcessing); + SetLocalInt(oModule, "CheckForStuckPatrols", bCheckForStuckPatrols); + SetLocalInt(oModule, "AlwaysDestroyCorpses", bAlwaysDestroyCorpses); + + // Record Initialization + SetLocalInt(oModule, "GlobalDefaultsInitialized", TRUE); +} diff --git a/nwnds_module/spawn_dist_corps.ncs b/nwnds_module/spawn_dist_corps.ncs new file mode 100644 index 000000000..b4c6a056b Binary files /dev/null and b/nwnds_module/spawn_dist_corps.ncs differ diff --git a/nwnds_module/spawn_dist_corps.nss b/nwnds_module/spawn_dist_corps.nss new file mode 100644 index 000000000..fa0fde34c --- /dev/null +++ b/nwnds_module/spawn_dist_corps.nss @@ -0,0 +1,127 @@ +// +// NESS V8.0 +// Spawn Disturbed Corpse +// +// Brought into the NESS distribution for Version 8.0 and beyond. Original +// header below. This file has been modified from its original form. +// + +//////////////////////////////////////////////////////////////////////////////// +// // // +// _kb_ondist_loot // VERSION 1.1 // +// // // +// by Keron Blackfeld on 07/17/2002 //////////////////////////// +// // +// email Questions and Comments to: keron@broadswordgaming.com or catch me // +// in Bioware's NWN Community - Builder's NWN Scripting Forum // +// // +//////////////////////////////////////////////////////////////////////////////// +// // +// This is an OnDisturbed Script to go with my _kb_loot_corpse script for // +// LOOTABLE MONSTER/NPC CORPSES. If you were using my _kb_ohb_lootable, be // +// sure to remove that script from the onHeartbeat of your lootable, the // +// "invis_corpse_obj" placeable. // +// // +// PLACE THIS SCRIPT IN THE ONDISTURBED EVENT OF YOUR "invis_corpse_obj" // +// BLUEPRINT. This script checks the inventory of OBJECT_SELF, and when it // +// is empty, it checks the LocalInt to see if the now empty corpse should // +// be Destroyed along with the Lootable Corpse Object. This script will also // +// checks to see if it should clear its own inventory prior to fading in // +// order to prevent a lootbag from appearing. If the inventory is NOT empty, // +// it checks to see if the ARMOUR is removed from itself, and if so, it // +// destroys the Original Armour on the corpse. // +// // +// The _kb_loot_corpse script must have this line: // +// int nKeepEmpties = FALSE; // +// in order for the Empty Corpse to Destroy itself in this script. // +// // +//////////////////////////////////////////////////////////////////////////////// + +// +// ALFA NESS +// Spawn : Loot Corpse Disturbed Script v1.2 +// +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +#include "spawn_functions" + +/******************************************* + ** Here is our main script, which is ** + ** fired if the Inventory is disturbed. ** + ** It then checks to see if it needs to ** + ** either clean up the corpse or Destroy ** + ** the original suit of armor still on ** + ** the corpse. ** + *******************************************/ +void main() +{ + //** Get all of our required information + + //Get item that was disturbed to trigger event + object oInvDisturbed = GetInventoryDisturbItem(); + + //Get type of inventory disturbance + int nInvDistType = GetInventoryDisturbType(); + + // Get Values set by spawn_corpse_dth at creation + object oHostCorpse = GetLocalObject(OBJECT_SELF, "HostBody"); + object oOrigArmor = GetLocalObject(OBJECT_SELF, "OrigArmor"); + object oLootArmor = GetLocalObject(OBJECT_SELF, "LootArmor"); + object oOrigRgtWpn = GetLocalObject(OBJECT_SELF, "OrigRgtWpn"); + object oLootRgtWpn = GetLocalObject(OBJECT_SELF, "LootRgtWpn"); + object oOrigLftWpn = GetLocalObject(OBJECT_SELF, "OrigLftWpn"); + object oLootLftWpn = GetLocalObject(OBJECT_SELF, "LootLftWpn"); + + object oPC = GetLastDisturbed(); + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f)); + + object oHasInventory = GetFirstItemInInventory(OBJECT_SELF); //Check for inventory + if (oHasInventory == OBJECT_INVALID) //If no inventory found + { + /******************************************* + ** Delete empty. ** + *******************************************/ + NESS_CleanCorpse(oHostCorpse); + AssignCommand(oHostCorpse,SetIsDestroyable(TRUE,FALSE,FALSE)); //Set actual corpse to destroyable + DestroyObject(oHostCorpse); //Delete the actual Creature Corpse + + DelayCommand(1.0f,DestroyObject(OBJECT_SELF)); //Delete Lootable Object (Self) + + } + + else + { + /******************************************* + ** If not empty, check to see if armor, ** + ** left or right weapons have been ** + ** removed from corpse. ** + *******************************************/ + if (nInvDistType == INVENTORY_DISTURB_TYPE_REMOVED) + { + if (oInvDisturbed == oLootArmor) + { + /******************************************* + ** The Armor is gone - destroy original ** + ** armor still showing on corpse. ** + *******************************************/ + DestroyObject(oOrigArmor); + } + + // We don't do these for now, as the unequip animations look too + // damn silly + //else if (oInvDisturbed == oLootRgtWpn) + //{ + // DestroyObject(oOrigRgtWpn); + //} + + //else if (oInvDisturbed == oLootLftWpn) + //{ + // DestroyObject(oOrigLftWpn); + //} + } + } + +} diff --git a/nwnds_module/spawn_flags.nss b/nwnds_module/spawn_flags.nss new file mode 100644 index 000000000..7fa45b00a --- /dev/null +++ b/nwnds_module/spawn_flags.nss @@ -0,0 +1,154 @@ +// +// NESS V8.0 +// Spawn Flags +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +int IsFlagPresent(string sName, string sFlag) +{ + int nPos = FindSubString(sName, sFlag); + if (nPos >= 0) // flag found + { + //debug("flag " + sFlag + " present"); + return TRUE; + } + return FALSE; +} + +// This Function parses a String for Flags +// When nGetValue is FALSE, this returns TRUE if the flag exists, FALSE otherwise. +// nDefault is unused when nGetValue is FALSE. +// When nGetValue is TRUE, it returns the value of the flag if it +// exists, or nDefault otherwise. +int GetFlagValue(string sName, string sFlag, int nDefault) +{ + int nRetValue; + int nPos; + + nPos = FindSubString(sName, sFlag); + if (nPos >= 0) // flag found + { + // Trim to the start of the flag + sName = GetStringRight(sName, GetStringLength(sName) - + (nPos + GetStringLength(sFlag))); + + // find the end of the flag + nPos = FindSubString(sName, "_"); + if (nPos >= 0) + { + sName = GetStringLeft(sName, nPos); + } + + // Retreive Flag + if (TestStringAgainstPattern("*n", GetStringLeft(sName, 1)) == FALSE) + { + // No value specified, use default + nRetValue = nDefault; + //debug("flag " + sFlag + " - def val = " + IntToString(nRetValue)); + + + } + else + { + // Retrieve Value + nRetValue = StringToInt(sName); + //debug("flag " + sFlag + " - val = " + IntToString(nRetValue)); + } + } + + else // flag not found at all + { + nRetValue = nDefault; + + } + + // Return Value + return nRetValue; +} +// + +int IsSubFlagPresent(string sName, string sFlag, string sSubFlag) +{ + int nPos = FindSubString(sName, sFlag); + if (nPos >= 0) + { + // Trim Flag + sName = GetStringRight(sName, GetStringLength(sName) - + (nPos + GetStringLength(sFlag))); + + nPos = FindSubString(sName, "_"); + if (nPos >= 0) + { + sName = GetStringLeft(sName, nPos); + } + + // Retreive SubFlag + nPos = FindSubString(sName, sSubFlag); + if (nPos >= 0) + { + //debug("flag " + sFlag + "subflag " + sSubFlag + " present"); + return TRUE; + } + } + + return FALSE; +} + +// This Function parses a String for a Subvalue from Flags +int GetSubFlagValue(string sName, string sFlag, string sSubFlag, int nDefault) +{ + int nRetValue; + int nPos; + + nPos = FindSubString(sName, sFlag); + if (nPos >= 0) + { + // Trim Flag + sName = GetStringRight(sName, GetStringLength(sName) - + (nPos + GetStringLength(sFlag))); + + nPos = FindSubString(sName, "_"); + + if (nPos >= 0) + { + sName = GetStringLeft(sName, nPos); + } + + // Retreive SubFlag + nPos = FindSubString(sName, sSubFlag); + if (nPos >= 0) + { + sName = GetStringRight(sName, GetStringLength(sName) - + (nPos + GetStringLength(sSubFlag))); + + if (TestStringAgainstPattern("*n", GetStringLeft(sName, 1)) == FALSE) + { + nRetValue = nDefault; // SubFlag found but no value + //debug("flag " + sFlag + " subflag " + sSubFlag + " - def val = " + + // IntToString(nRetValue)); + } + else + { + // Retrieve Value + nRetValue = StringToInt(sName); // Subflag (with value) found + //debug("flag " + sFlag + " subflag " + sSubFlag + " - val = " + + // IntToString(nRetValue)); + } + } + else + { + nRetValue = nDefault; // subflag not found + } + } + else + { + nRetValue = nDefault; // Main flag not found + } + + // Return Value + return nRetValue; +} +// + diff --git a/nwnds_module/spawn_functions.nss b/nwnds_module/spawn_functions.nss new file mode 100644 index 000000000..9c9f36b3f --- /dev/null +++ b/nwnds_module/spawn_functions.nss @@ -0,0 +1,3333 @@ +// +// NESS V8.1.3 +// Spawn Functions +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +#include "spawn_timefuncs" +#include "spawn_flags" +#include "spawn_cfg_cusflg" +#include "x0_i0_corpses" + +void InitFlags(object oSpawn, string sSpawnName, string sSpawnTag); +int SetSpawns(location lBase); +string PadIntToString(int nInt, int nDigits); + +void ResetSpawn(object oSpawn, int nTimeNow); +int IsRestoreBlocked(object oSpawn, location lChildLoc, int iExpireTime, + int nTimeNow); + +void SetupSpawned(object oSpawn, object oSpawned, location lHome, int nTimeNow, + int nWalkToHome = FALSE); + +void SetupCampSpawned(object oSpawn, object oSpawned, vector vCampPosition, + location lHome, string sFlags); + +// Returns new nNextSpawnTime +int SetupSpawnDelay(int nSpawnDelay, int nDelayMinimum, int nDelayRandom, + int nTimeNow); + +// Writes all the necessary info onto a spawn and its child after spawning +void RecordSpawned(object oSpawn, object oSpawned, location lHome, + location lEntranceExit, float fSpawnedFacing); + +// Saves the state of one child onto the spawn (or a camp object) for respawning +void SaveStateOnDespawn(object oSpawned, object oSpawn, int nCamp=FALSE); + +// Saves a camp object onto the spawn for respawning +void SaveCampStateOnDespawn(object oCamp, object oSpawn); + +// Respawns all saved children/camps +void RestorePCDespawns(object oSpawn, int nTimeNow); + +void ReturnHome(location lHome); +int FindNextEmptyChildSlot(object oSpawn); + +// +// Pseudo-heartbeat support +// + +const string SPAWN_INTERVAL = "Spawn_Interval"; +const string SPAWN_PCS_IN_AREA = "Spawn_PCsInArea"; +const string SPAWN_AREA_COUNT = "AreaSpawnCount"; +const string SPAWN_HEARTBEAT_SCRIPT = "SpawnHeartbeatScript"; +const string SPAWN_HEARTBEAT_SCHEDULED = "SpawnHeartbeatScheduled"; + +// This checks conditions to determine if a pseudo-heartbeat should be called +int NeedPseudoHeartbeat( object oArea ); +// ... and if it should, this schedules it. +void ScheduleNextPseudoHeartbeat( object oArea ); + +// Pseudo-heartbeat area enter and exit functions +void Spawn_OnAreaEnter( string sHeartbeatScript = "spawn_sample_hb", + float fHeartbeatInterval = 6.0, float fFirstDelay = 0.0 ); +void Spawn_OnAreaExit(); + +// Externals +void LootTable(object oSpawn, object oSpawned, int nLootTable); +effect ObjectEffect(object oSpawn); + + + +int SPAWN_DELAY_DEBUG = FALSE; +int SPAWN_COUNT_DEBUG = FALSE; +int CONSOLE_DEBUG = TRUE; + +void SpawnDelayDebug(object oSpawn, string str) +{ + if (SPAWN_DELAY_DEBUG) + { + WriteTimestampedLogEntry("[sd " + GetName(GetArea(oSpawn)) + "] " + + GetLocalString(oSpawn, "f_Template") + " (" + ObjectToString(oSpawn) + "): " + str); + + if (CONSOLE_DEBUG) + { + SendMessageToAllDMs("[sd " + GetName(GetArea(oSpawn)) + "] " + + GetLocalString(oSpawn, "f_Template") + " (" + ObjectToString(oSpawn) + "): " + str); + } + /* + object oPC = GetFirstPC(); + if (! GetIsDM(oPC)) + SendMessageToPC(oPC, str); + */ + } +} + +void SpawnCountDebug(object oSpawn, string str) +{ + if (SPAWN_COUNT_DEBUG) + { + WriteTimestampedLogEntry("[sc " + GetName(GetArea(oSpawn)) + "] " + + GetLocalString(oSpawn, "f_Template") + " (" +ObjectToString(oSpawn) + "): " + str); + + if (CONSOLE_DEBUG) + { + SendMessageToAllDMs("[sc " + GetName(GetArea(oSpawn)) + "] " + + GetLocalString(oSpawn, "f_Template") + " (" +ObjectToString(oSpawn) + "): " + str); + } + /* + object oPC = GetFirstPC(); + if (! GetIsDM(oPC)) + SendMessageToPC(oPC, str); + */ + } +} + +// +// Custom Functions +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +void AddChild(object oSpawn, object oSpawned); +void ReportSpawns(int nAreaSpawns, int nModuleSpawns); +void TrackModuleSpawns(int nAreaSpawnCount, int nTrackModuleSpawns); +void DumpModuleSpawns(); +void DumpModuleSpawns(); + +// +// PC and NPC Functions +// +int CountPCsInArea(object oArea = OBJECT_INVALID, int nDM = FALSE); +int CountPCsInRadius(location lCenter, float fRadius, int nDM = FALSE); +object GetRandomPCInArea(object oArea, object oSpawn); + +// This struct is returned by TransferAllInventorySlots() to return back the +// object ids of the armor, right hand weapon, and left hand weapons (if any) +// both left on the (original) corpse and copied to the lootable corpse +struct NESS_CorpseInfo +{ + object origLftWpn; + object origRgtWpn; + object origArmor; + object lootLftWpn; + object lootRgtWpn; + object lootArmor; +}; + +// This is equivalent to (and adapted from) the Bioware LootInventorySlots() function. +// However, it does not schedule deletions for a hardcoded +// corpse decay time later (the corpse decay script handles those). +struct NESS_CorpseInfo TransferAllInventorySlots(object oCreature, object oTarget, + int bDropWielded=FALSE); + +int IsCreatureItem(object oItem); +void RandomWalk(object oSpawn, float fWalkingRadius, int nRun); +void FindSeat(object oSpawn, object oSpawned); + +void NESS_CleanInventory(object oSpawned); +// for back compatibility (grr) will remove at some point +void CleanInventory(object oSpawned) +{ + NESS_CleanInventory(oSpawned); +} +void NESS_CleanEquipped(object oSpawned); +void NESS_CleanCorpse(object oSpawned); +object NESS_CopyCorpseItem(object oSource, object oInventory); +void StripNonDroppables(object oSpawned); +void DestroyIfNonDrop(object oItem); + +// +// Date and Time Functions +// +int IsBetweenDays(int nCheckDay, int nDayStart, int nDayEnd); +int IsBetweenHours(int nCheckHour, int nHourStart, int nHourEnd); +// +// Patrol Route Functions +// +void SetPatrolRoute(int nPatrolRoute, int nStartClosest=FALSE); +void DoPatrolRoute(int nPatrolRoute, int nRouteType); +void AddPatrolStop(int nPatrolRoute, int nStopNumber, int bJump=FALSE); +void CheckForStuckPatrol(object oCreature, int nPatrolRoute, int nRouteType); + +// +// Camp Functions +// +int ProcessCamp(object oCamp); +void DestroyCamp(object oCamp, float fCampDecay, int nSaveState); +// +// Outside Functions +// +void SpawnFlags(object oSpawn, int nFlagTableNumber); +// +// + +// Functions for External Use. +object NESS_GetSpawnByID(int nSpawnID, object oArea); +void NESS_ActivateSpawnByID(int nSpawnID, object oAreaD); +void NESS_DeactivateSpawnByID(int nSpawnID, object oArea); +void NESS_ActivateSpawn(object oSpawn); +void NESS_DeactivateSpawn(object oSpawn); +void NESS_ForceProcess(object oSpawn); +void NESS_TrackModuleSpawns(int flag=TRUE); +int NESS_IsModuleSpawnTracking(); +void NESS_DumpModuleSpawns(int flag=TRUE); +int NESS_IsModuleSpawnDumping(); +void NESS_ReturnHome(object oCreature, int bRun=FALSE); +void NESS_ProcessDeadCreature(object oCreature, object oSpawn=OBJECT_INVALID); + +// This Function Initializes the Flags +void InitFlags(object oSpawn, string sSpawnName, string sSpawnTag) +{ + // These are true when certain flags are present, false otherwise + + // Retreive Defaults + object oModule = GetModule(); + + // These have values associated with them, although in some cases value + // of 0 is treated as a non-existent flag + int dfProcessFrequency = GetLocalInt(oModule, "df_processFrequency"); + int dfProcessOffset = GetLocalInt(oModule, "df_processOffest"); + int dfInitialState = GetLocalInt(oModule, "df_InitialState"); + int dfInitialDelay = GetLocalInt(oModule, "df_InitialDelay"); + int dfFlagTableNumber = GetLocalInt(oModule, "df_FlagTableNumber"); + int dfSpawnDelay = GetLocalInt(oModule, "df_SpawnDelay"); + int dfDelayMinimum = GetLocalInt(oModule, "df_DelayMinimum"); + int dfSpawnNumber = GetLocalInt(oModule, "df_SpawnNumber"); + int dfSpawnNumberMin = GetLocalInt(oModule, "df_SpawnNumberMin"); + int dfSpawnNumberAtOnce = GetLocalInt(oModule, "df_SpawnNumberAtOnce"); + int dfSpawnNumberAtOnceMin = GetLocalInt(oModule, "df_SpawnNumberAtOnceMin"); + int dfSpawnDayStart = GetLocalInt(oModule, "df_SpawnDayStart"); + int dfSpawnDayEnd = GetLocalInt(oModule, "df_SpawnDayEnd"); + int dfSpawnHourStart = GetLocalInt(oModule, "df_SpawnHourStart"); + int dfSpawnHourEnd = GetLocalInt(oModule, "df_SpawnHourEnd"); + int dfWanderRange = GetLocalInt(oModule, "df_WanderRange"); + int dfReturnHomeRange = GetLocalInt(oModule, "df_ReturnHomeRange"); + int dfPCCheckDelay = GetLocalInt(oModule, "df_PCCheckDelay"); + int dfRandomGold = GetLocalInt(oModule, "df_RandomGold"); + int dfRandomGoldMin = GetLocalInt(oModule, "df_RandomGoldMin"); + int dfGoldChance = GetLocalInt(oModule, "df_GoldChance"); + int dfSpawnEffect = GetLocalInt(oModule, "df_SpawnEffect"); + int dfDespawnEffect = GetLocalInt(oModule, "df_DespawnEffect"); + int dfPatrolRoute = GetLocalInt(oModule, "df_PatrolRoute"); + int dfRouteType = GetLocalInt(oModule, "df_RouteType"); + int dfPlaceableType = GetLocalInt(oModule, "df_PlaceableType"); + int dfTrapDisabled = GetLocalInt(oModule, "df_TrapDisabled"); + int dfPlaceableRefreshPeriod = GetLocalInt(oModule, "df_PlaceableRefreshPeriod"); + int dfLootTable = GetLocalInt(oModule, "df_LootTable"); + int dfLootTable1ItemChance = GetLocalInt(oModule, "df_LootTable1ItemChance"); + int dfLootTable2ItemChance = GetLocalInt(oModule, "df_LootTable2ItemChance"); + int dfLootTable3ItemChance = GetLocalInt(oModule, "df_LootTable3ItemChance"); + int dfDeactivateSpawn = GetLocalInt(oModule, "df_DeactivateSpawn"); + int dfDeactivateScript = GetLocalInt(oModule, "df_DeactivateScript"); + int dfDeactivationInfo = GetLocalInt(oModule, "df_DeactivationInfo"); + int dfChildLifespanMax = GetLocalInt(oModule, "df_ChildLifespanMax"); + int dfChildLifespanMin = GetLocalInt(oModule, "df_ChildLifespanMin"); + int dfSpawnRadius = GetLocalInt(oModule, "df_SpawnRadius"); + int dfSpawnRadiusMin = GetLocalInt(oModule, "df_SpawnRadiusMin"); + int dfSpawnUnseen = GetLocalInt(oModule, "df_SpawnUnseen"); + int dfUnseenRetryCount = GetLocalInt(oModule, "df_dfUnseenRetryCount"); + int dfCorpseDecay = GetLocalInt(oModule, "df_CorpseDecay"); + int dfCorpseDecayType = GetLocalInt(oModule, "df_CorpseDecayType"); + int dfCorpseRemainsType = GetLocalInt(oModule, "df_CorpseRemainsType"); + int dfCampDecay = GetLocalInt(oModule, "df_CampDecay"); + int dfSpawnScript = GetLocalInt(oModule, "df_SpawnScript"); + int dfDespawnScript = GetLocalInt(oModule, "df_DespawnScript"); + int dfDeathScript = GetLocalInt(oModule, "df_DeathScript"); + int dfSpawnCheckCustom = GetLocalInt(oModule, "df_SpawnCheckCustom"); + int dfSpawnCheckPCs = GetLocalInt(oModule, "df_SpawnCheckPCs"); + int dfCheckPCsRadius = GetLocalInt(oModule, "f_CheckPCsRadius"); + int dfSpawnTrigger = GetLocalInt(oModule, "df_SpawnTrigger"); + int dfDespawnTrigger = GetLocalInt(oModule, "df_DespawnTrigger"); + int dfSpawnAreaEffect = GetLocalInt(oModule, "df_SpawnAreaEffect"); + int dfAreaEffectDuration = GetLocalInt(oModule, "df_AreaEffectDuration"); + int dfObjectEffect = GetLocalInt(oModule, "df_ObjectEffect"); + int dfObjectEffectDuration = GetLocalInt(oModule, "df_ObjectEffectDuration"); + int dfRandomSpawn = GetLocalInt(oModule, "df_RandomSpawn"); + int dfSpawnFaction = GetLocalInt(oModule, "df_SpawnFaction"); + int dfSpawnAlignment = GetLocalInt(oModule, "df_SpawnAlignment"); + int dfAlignmentShift = GetLocalInt(oModule, "df_AlignmentShift"); + int dfHeartbeatScript = GetLocalInt(oModule, "df_HeartbeatScript"); + int dfSpawnLocation = GetLocalInt(oModule, "df_SpawnLocation"); + int dfSpawnLocationMin = GetLocalInt(oModule, "df_SpawnLocationMin"); + int dfSpawnFacing = GetLocalInt(oModule, "df_SpawnFacing"); + int dfEntranceExit = GetLocalInt(oModule, "df_EntranceExit"); + int dfEntranceExitMin = GetLocalInt(oModule, "df_EntranceExitMin"); + int dfExit = GetLocalInt(oModule, "df_Exit"); + int dfExitMin = GetLocalInt(oModule, "df_ExitMin"); + int dfHealChildren = GetLocalInt(oModule, "df_HealChildren"); + int dfGlobalSuppressDR = GetLocalInt(oModule, "df_GlobalSuppressDR"); + int dfSuppressDR = GetLocalInt(oModule, "df_SuppressDR"); + int dfEncounterLevel = GetLocalInt(oModule, "df_EncounterLevel"); + + //debug("init flags: " + sSpawnName); + SetLocalString(oSpawn, "f_Flags", sSpawnName); + SetLocalString(oSpawn, "f_Template", sSpawnTag); + + // Initialize FlagTable + int nFlagTable = IsFlagPresent(sSpawnName, "_FT"); + int nFlagTableNumber = GetFlagValue(sSpawnName, "_FT", dfFlagTableNumber); + + if (nFlagTable == TRUE) + { + SpawnFlags(oSpawn, nFlagTableNumber); + if (GetStringLeft(GetLocalString(oSpawn, "f_Flags"), 2) == "SP") + { + sSpawnName = GetLocalString(oSpawn, "f_Flags"); + } + else if (GetStringLeft(GetLocalString(oSpawn, "f_Flags"), 1) == "_") + { + sSpawnName = sSpawnName + GetLocalString(oSpawn, "f_Flags"); + } + + SetLocalString(oSpawn, "f_Flags", sSpawnName); + sSpawnTag = GetLocalString(oSpawn, "f_Template"); + } + + // Initialize CustomFlag + string sCustomFlag; + int nCustomFlag = IsFlagPresent(sSpawnName, "CF"); + + if (nCustomFlag == TRUE) + { + sCustomFlag = GetStringRight(sSpawnName, GetStringLength(sSpawnName) - + (FindSubString(sSpawnName, "CF") + 2)); + sSpawnName = GetStringLeft(sSpawnName, GetStringLength(sSpawnName) - + (GetStringLength(sCustomFlag) + 3)); + SetLocalString(oSpawn, "f_Flags", sSpawnName); + + } + + // Record CustomFlag + SetLocalString(oSpawn, "f_CustomFlag", sCustomFlag); + ParseCustomFlags(oSpawn, sCustomFlag); + + // Initialize Process Frequency + int nProcessFrequency = GetFlagValue(sSpawnName, "SP", dfProcessFrequency); + int nProcessOffset = GetSubFlagValue(sSpawnName, "SP", "O", dfProcessOffset); + if (nProcessFrequency <= 0) + { + nProcessFrequency = 1; + } + + // Record Process Frequency + SetLocalInt(oSpawn, "f_ProcessFrequency", nProcessFrequency); + SetLocalInt(oSpawn, "f_ProcessOffset", nProcessOffset); + + // Initialize InitialState + int nInitialState = GetFlagValue(sSpawnName, "IS", dfInitialState); + int nInitialDelay = GetSubFlagValue(sSpawnName, "IS", "D", dfInitialDelay); + nInitialDelay *= 60; // convert to seconds + + // Record InitialState + SetLocalInt(oSpawn, "f_InitialState", nInitialState); + SetLocalInt(oSpawn, "f_InitialDelay", nInitialDelay); + + // Initialize SpawnID + int nSpawnID = GetFlagValue(sSpawnName, "ID", 0); + + // Record SpawnID + if (nSpawnID > 0) + { + SetLocalInt(oSpawn, "SpawnID", nSpawnID); + } + + // Initialize SpawnDelay + int nSpawnDelay = GetFlagValue(sSpawnName, "SD", dfSpawnDelay); + nSpawnDelay *= 60; // convert to seconds + int nDelayRandom = IsSubFlagPresent(sSpawnName, "SD", "M"); + int nDelayMinimum = GetSubFlagValue(sSpawnName, "SD", "M", dfDelayMinimum); + nDelayMinimum *= 60; // convert to seconds + int nSpawnDelayPeriodic = IsSubFlagPresent(sSpawnName, "SD", "P"); + + if (nDelayMinimum > nSpawnDelay) + { + nDelayRandom = FALSE; + nDelayMinimum = 0; + } + + // Record SpawnDelay + SetLocalInt(oSpawn, "f_SpawnDelay", nSpawnDelay); + SetLocalInt(oSpawn, "f_DelayRandom", nDelayRandom); + SetLocalInt(oSpawn, "f_DelayMinimum", nDelayMinimum); + SetLocalInt(oSpawn, "f_SpawnDelayPeriodic", nSpawnDelayPeriodic); + + // Initialize SpawnNumber + int nSpawnNumber = GetFlagValue(sSpawnName, "SN", dfSpawnNumber); + int nSpawnNumberMax = nSpawnNumber; + int nSpawnNumberMin = GetSubFlagValue(sSpawnName, "SN", "M", dfSpawnNumberMin); + int nSpawnAllAtOnce = IsFlagPresent(sSpawnName, "SA"); + int nSpawnNumberAtOnce = GetFlagValue(sSpawnName, "SA", dfSpawnNumberAtOnce); + int nSpawnNumberAtOnceMin = GetSubFlagValue(sSpawnName, "SA", "M", + dfSpawnNumberAtOnceMin); + + if (nSpawnNumberMin > nSpawnNumber) + { + nSpawnNumberMin = -1; + } + if (nSpawnNumberMin > -1) + { + int nRndSpawnNumber = Random(nSpawnNumberMax + 1); + while (nRndSpawnNumber < nSpawnNumberMin) + { + nRndSpawnNumber = Random(nSpawnNumberMax + 1); + } + nSpawnNumber = nRndSpawnNumber; + } + + if (nSpawnNumberAtOnce == 1) + { + nSpawnAllAtOnce = FALSE; + } + if (nSpawnNumberAtOnceMin > nSpawnNumberAtOnce) + { + nSpawnNumberAtOnceMin = 0; + } + + // Record SpawnNumber + SetLocalInt(oSpawn, "f_SpawnNumber", nSpawnNumber); + SetLocalInt(oSpawn, "f_SpawnNumberMin", nSpawnNumberMin); + SetLocalInt(oSpawn, "f_SpawnNumberMax", nSpawnNumberMax); + SetLocalInt(oSpawn, "f_SpawnAllAtOnce", nSpawnAllAtOnce); + SetLocalInt(oSpawn, "f_SpawnNumberAtOnce", nSpawnNumberAtOnce); + SetLocalInt(oSpawn, "f_SpawnNumberAtOnceMin", nSpawnNumberAtOnceMin); + + // Initialize Day/Night Only + int nDayOnly = IsFlagPresent(sSpawnName, "DO"); + int nDayOnlyDespawn = IsSubFlagPresent(sSpawnName, "DO", "D"); + int nNightOnly = IsFlagPresent(sSpawnName, "NO"); + int nNightOnlyDespawn = IsSubFlagPresent(sSpawnName, "NO", "D"); + + // Record Day/Night Only + SetLocalInt(oSpawn, "f_DayOnly", nDayOnly); + SetLocalInt(oSpawn, "f_DayOnlyDespawn", nDayOnlyDespawn); + SetLocalInt(oSpawn, "f_NightOnly", nNightOnly); + SetLocalInt(oSpawn, "f_NightOnlyDespawn", nNightOnlyDespawn); + + // Initialize Day/Hour Spawns + int nSpawnDayStart = GetFlagValue(sSpawnName, "DY", dfSpawnDayStart); + int nSpawnDayEnd = GetSubFlagValue(sSpawnName, "DY", "T", dfSpawnDayEnd); + if (nSpawnDayEnd > nSpawnDayStart) + { + nSpawnDayEnd = -1; + } + int nSpawnHourStart = GetFlagValue(sSpawnName, "HR", dfSpawnHourStart); + int nSpawnHourEnd = GetSubFlagValue(sSpawnName, "HR", "T", dfSpawnHourEnd); + if (nSpawnHourStart > nSpawnHourEnd) + { + nSpawnHourEnd = -1; + } + + // Record Day/Hour Spawns + SetLocalInt(oSpawn, "f_SpawnDayStart", nSpawnDayStart); + SetLocalInt(oSpawn, "f_SpawnDayEnd", nSpawnDayEnd); + SetLocalInt(oSpawn, "f_SpawnHourStart", nSpawnHourStart); + SetLocalInt(oSpawn, "f_SpawnHourEnd", nSpawnHourEnd); + + // Initialize RandomWalk + int nRandomWalk = IsFlagPresent(sSpawnName, "RW"); + float fWanderRange = IntToFloat(GetSubFlagValue(sSpawnName, "RW", "R", dfWanderRange)); + + // Record RandomWalk + SetLocalInt(oSpawn, "f_RandomWalk", nRandomWalk); + SetLocalFloat(oSpawn, "f_WanderRange", fWanderRange); + + // Initialize ReturnHome + int nReturnHome = IsFlagPresent(sSpawnName, "RH"); + float fReturnHomeRange = IntToFloat(GetFlagValue(sSpawnName, "RH", dfReturnHomeRange)); + + // Record ReturnHome + SetLocalInt(oSpawn, "f_ReturnHome", nReturnHome); + SetLocalFloat(oSpawn, "f_ReturnHomeRange", fReturnHomeRange); + + // Initialize PCCheck + int nPCCheck = IsFlagPresent(sSpawnName, "PC"); + int nPCCheckDelay = GetFlagValue(sSpawnName, "PC", dfPCCheckDelay); + nPCCheckDelay *= 60; // convert to seconds + int nPCReset = IsSubFlagPresent(sSpawnName, "PC", "R"); + + // Record PCCheck + SetLocalInt(oSpawn, "f_PCCheck", nPCCheck); + SetLocalInt(oSpawn, "f_PCCheckDelay", nPCCheckDelay); + SetLocalInt(oSpawn, "f_PCReset", nPCReset); + + // Initialize RandomGold + int nRandomGold = GetFlagValue(sSpawnName, "RG", dfRandomGold); + int nRandomGoldMin = GetSubFlagValue(sSpawnName, "RG", "M", dfRandomGoldMin); + int nGoldChance = GetSubFlagValue(sSpawnName, "RG", "C", dfGoldChance); + + // Record RandomGold + SetLocalInt(oSpawn, "f_RandomGold", nRandomGold); + SetLocalInt(oSpawn, "f_RandomGoldMin", nRandomGoldMin); + SetLocalInt(oSpawn, "f_GoldChance", nGoldChance); + + // Initialize SpawnEffects + int nSpawnEffect = GetFlagValue(sSpawnName, "FX", dfSpawnEffect); + int nDespawnEffect = GetSubFlagValue(sSpawnName, "FX", "D", dfDespawnEffect); + + // Record SpawnEffects + SetLocalInt(oSpawn, "f_SpawnEffect", nSpawnEffect); + SetLocalInt(oSpawn, "f_DespawnEffect", nDespawnEffect); + + // Initialize PatrolRoutes + int nPatrolRoute = GetFlagValue(sSpawnName, "PR", dfPatrolRoute); + int nRouteType = GetSubFlagValue(sSpawnName, "PR", "T", dfRouteType); + int nStartAtClosest = IsSubFlagPresent(sSpawnName, "PR", "C"); + + // Record PatrolRoutes + SetLocalInt(oSpawn, "f_PatrolRoute", nPatrolRoute); + SetLocalInt(oSpawn, "f_RouteType", nRouteType); + SetLocalInt(oSpawn, "f_PatrolStartAtClosest", nStartAtClosest); + + // Initialize Placeables + int nPlaceable = IsFlagPresent(sSpawnName, "PL"); + int nPlaceableType = GetFlagValue(sSpawnName, "PL", dfPlaceableType); + int nTrapDisabled = GetSubFlagValue(sSpawnName, "PL", "T", dfTrapDisabled); + int nPlaceableRefreshPeriod = GetSubFlagValue(sSpawnName, "PL", "P", dfPlaceableRefreshPeriod); + nPlaceableRefreshPeriod *= 60; // convert to seconds + + // Record Placeables + SetLocalInt(oSpawn, "f_Placeable", nPlaceable); + SetLocalInt(oSpawn, "f_PlaceableType", nPlaceableType); + SetLocalInt(oSpawn, "f_TrapDisabled", nTrapDisabled); + SetLocalInt(oSpawn, "f_PlaceableRefreshPeriod", nPlaceableRefreshPeriod); + + // Initialize SpawnGroups + int nSpawnGroup = IsFlagPresent(sSpawnName, "SG"); + + // Record SpawnGroups + SetLocalInt(oSpawn, "f_SpawnGroup", nSpawnGroup); + + // Initialize LootTable + int nLootTable = GetFlagValue(sSpawnName, "LT", dfLootTable); + int nLootTable1ItemChance = GetSubFlagValue(sSpawnName, "LT", "A", dfLootTable1ItemChance); + int nLootTable2ItemChance = GetSubFlagValue(sSpawnName, "LT", "B", dfLootTable2ItemChance); + int nLootTable3ItemChance = GetSubFlagValue(sSpawnName, "LT", "C", dfLootTable3ItemChance); + + if (nLootTable1ItemChance > 100) nLootTable1ItemChance = 100; + if (nLootTable2ItemChance > 100) nLootTable2ItemChance = 100; + if (nLootTable3ItemChance > 100) nLootTable3ItemChance = 100; + + // Record LootTable + SetLocalInt(oSpawn, "f_LootTable", nLootTable); + SetLocalInt(oSpawn, "f_LootTable1ItemChance", nLootTable1ItemChance); + SetLocalInt(oSpawn, "f_LootTable2ItemChance", nLootTable2ItemChance); + SetLocalInt(oSpawn, "f_LootTable3ItemChance", nLootTable3ItemChance); + + // Initialize SpawnDeactivation + int nDeactivateSpawn = GetFlagValue(sSpawnName, "DS", dfDeactivateSpawn); + int nDeactivateScript = GetSubFlagValue(sSpawnName, "DS", "S", dfDeactivateScript); + int nDeactivationInfo = GetFlagValue(sSpawnName, "DI", dfDeactivationInfo); + + // Record SpawnDeactivations + SetLocalInt(oSpawn, "f_DeactivateSpawn", nDeactivateSpawn); + SetLocalInt(oSpawn, "f_DeactivateScript", nDeactivateScript); + + if (nDeactivateSpawn == 4) + { + nDeactivationInfo *= 60; // convert minutes to seconds + } + else if (nDeactivateSpawn == 5) + { + nDeactivationInfo *= 6; // convert cycles to seconds + } + + SetLocalInt(oSpawn, "f_DeactivationInfo", nDeactivationInfo); + + // Initialize ChildLifespan + int nChildLifespanMax = GetFlagValue(sSpawnName, "CL", dfChildLifespanMax); + nChildLifespanMax *= 60; // convert to seconds + int nChildLifespanMin = GetSubFlagValue(sSpawnName, "CL", "M", dfChildLifespanMin); + nChildLifespanMin *= 60; // convert to seconds + if (nChildLifespanMin > nChildLifespanMax) + { + nChildLifespanMin = -1; + } + + // Record ChildLifespan + SetLocalInt(oSpawn, "f_ChildLifespanMax", nChildLifespanMax); + SetLocalInt(oSpawn, "f_ChildLifespanMin", nChildLifespanMin); + + // Initialize SpawnRadius + float fSpawnRadius = IntToFloat(GetFlagValue(sSpawnName, "SR", dfSpawnRadius)); + float fSpawnRadiusMin = IntToFloat(GetSubFlagValue(sSpawnName, "SR", "M", dfSpawnRadiusMin)); + int nSpawnNearPCs = IsSubFlagPresent(sSpawnName, "SR", "P"); + if (fSpawnRadiusMin > fSpawnRadius) + { + fSpawnRadiusMin = 0.0; + } + + // Record SpawnRadius + SetLocalFloat(oSpawn, "f_SpawnRadius", fSpawnRadius); + SetLocalFloat(oSpawn, "f_SpawnRadiusMin", fSpawnRadiusMin); + SetLocalInt(oSpawn, "f_SpawnNearPCs", nSpawnNearPCs); + + // Initialize SpawnUnseen + float fSpawnUnseen = IntToFloat(GetFlagValue(sSpawnName, "SU", dfSpawnUnseen)); + + int nUnseenIndividual = IsSubFlagPresent(sSpawnName, "SU", "I"); + int nUnseenRetryCount = GetSubFlagValue(sSpawnName, "SU", "I", dfUnseenRetryCount); + + // Record SpawnUnseen + SetLocalFloat(oSpawn, "f_SpawnUnseen", fSpawnUnseen); + SetLocalInt(oSpawn, "f_UnseenIndividual", nUnseenIndividual); + SetLocalInt(oSpawn, "f_UnseenRetryCount", nUnseenRetryCount); + + // Initialize CorpseDecay + float fCorpseDecay = IntToFloat(GetFlagValue(sSpawnName, "CD", dfCorpseDecay)); + int nCorpseDecayType = GetSubFlagValue(sSpawnName, "CD", "T", dfCorpseDecayType); + int nCorpseRemainsType = GetSubFlagValue(sSpawnName, "CD", "R", dfCorpseRemainsType); + int bDropWielded = IsSubFlagPresent(sSpawnName, "CD", "D"); + + string sCorpseRemainsResRef; + int bDeleteLootOnDecay = FALSE; + + switch (nCorpseRemainsType) + { + case 0: sCorpseRemainsResRef = "invis_corpse_obj"; break; + case 1: sCorpseRemainsResRef = "invis_corpse_bdy"; break; + case 2: sCorpseRemainsResRef = "invis_corpse_bon"; break; + case 3: sCorpseRemainsResRef = "invis_corpse_pot"; break; + case 4: sCorpseRemainsResRef = "invis_corpse_pch"; break; + case 5: sCorpseRemainsResRef = "invis_corpse_scr"; break; + case 6: sCorpseRemainsResRef = "invis_corpse_tre"; break; + case 7: + sCorpseRemainsResRef = "invis_corpse_obj"; + bDeleteLootOnDecay = TRUE; + break; + } + + // Record CorpseDecay + SetLocalFloat(oSpawn, "f_CorpseDecay", fCorpseDecay); + SetLocalInt(oSpawn, "f_CorpseDecayType", nCorpseDecayType); + SetLocalString(oSpawn, "f_CorpseRemainsResRef", sCorpseRemainsResRef); + SetLocalInt(oSpawn, "f_CorpseDropWielded", bDropWielded); + SetLocalInt(oSpawn, "f_CorpseDeleteLootOnDecay", bDeleteLootOnDecay); + + // Initialize SpawnCamp + int nSpawnCamp = IsFlagPresent(sSpawnName, "CM"); + float fCampDecay = IntToFloat(GetSubFlagValue(sSpawnName, "CM", "D", dfCampDecay)); + + // Record SpawnCamp + SetLocalInt(oSpawn, "f_SpawnCamp", nSpawnCamp); + SetLocalFloat(oSpawn, "f_CampDecay", fCampDecay); + + // Initialize Spawn Scripts + int nSpawnScript = GetFlagValue(sSpawnName, "SS", dfSpawnScript); + int nDespawnScript = GetSubFlagValue(sSpawnName, "SS", "D", dfDespawnScript); + + // Record Spawn Scripts + SetLocalInt(oSpawn, "f_SpawnScript", nSpawnScript); + SetLocalInt(oSpawn, "f_DespawnScript", nDespawnScript); + + // Initialize Death Scripts + int nDeathScript = GetFlagValue(sSpawnName, "DT", dfDeathScript); + + // Record Death Scripts + SetLocalInt(oSpawn, "f_DeathScript", nDeathScript); + + // Initialize SpawnCheckCustom + int nSpawnCheckCustom = GetFlagValue(sSpawnName, "CC", dfSpawnCheckCustom); + + // Record SpawnCheckCustom + SetLocalInt(oSpawn, "f_SpawnCheckCustom", nSpawnCheckCustom); + + // Initialize SpawnCheckPCs + int nSpawnCheckPCs = GetFlagValue(sSpawnName, "CP", dfSpawnCheckPCs); + float fCheckPCsRadius = IntToFloat(GetSubFlagValue(sSpawnName, "CP", "R", dfCheckPCsRadius)); + + // Record SpawnCheckPCs + SetLocalInt(oSpawn, "f_SpawnCheckPCs", nSpawnCheckPCs); + SetLocalFloat(oSpawn, "f_CheckPCsRadius", fCheckPCsRadius); + + // Intialize SpawnTrigger + float fSpawnTrigger = IntToFloat(GetFlagValue(sSpawnName, "TR", dfSpawnTrigger)); + float fDespawnTrigger = IntToFloat(GetSubFlagValue(sSpawnName, "TR", "D", dfDespawnTrigger)); + + // Record SpawnTrigger + SetLocalFloat(oSpawn, "f_SpawnTrigger", fSpawnTrigger); + SetLocalFloat(oSpawn, "f_DespawnTrigger", fDespawnTrigger); + + // Initialize AreaEffect + int nSpawnAreaEffect = GetFlagValue(sSpawnName, "AE", dfSpawnAreaEffect); + float fAreaEffectDuration = IntToFloat(GetSubFlagValue(sSpawnName, "AE", "D", dfAreaEffectDuration)); + + // Record AreaEffect + SetLocalInt(oSpawn, "f_SpawnAreaEffect", nSpawnAreaEffect); + SetLocalFloat(oSpawn, "f_AreaEffectDuration", fAreaEffectDuration); + + // Initialize ObjectEffect + int nObjectEffect = GetFlagValue(sSpawnName, "OE", dfObjectEffect); + float fObjectEffectDuration = IntToFloat(GetSubFlagValue(sSpawnName, "OE", "D", dfObjectEffectDuration)); + if (fObjectEffectDuration == 0.0) + { + fObjectEffectDuration = -1.0; + } + + // Record ObjectEffect + SetLocalInt(oSpawn, "f_ObjectEffect", nObjectEffect); + SetLocalFloat(oSpawn, "f_ObjectEffectDuration", fObjectEffectDuration); + + // Initialize RandomSpawn + int nRandomSpawn = GetFlagValue(sSpawnName, "RS", dfRandomSpawn); + + // Record RandomSpawn + SetLocalInt(oSpawn, "f_RandomSpawn", nRandomSpawn); + + // Initialize SpawnFaction + int nSpawnFaction = GetFlagValue(sSpawnName, "FC", dfSpawnFaction); + + // Record SpawnFaction + SetLocalInt(oSpawn, "f_SpawnFaction", nSpawnFaction); + + // Initialize SpawnAlignment + int nSpawnAlignment = GetFlagValue(sSpawnName, "AL", dfSpawnAlignment); + int nAlignmentShift = GetSubFlagValue(sSpawnName, "AL", "S", dfAlignmentShift); + + // Record SpawnAlignment + SetLocalInt(oSpawn, "f_SpawnAlignment", nSpawnAlignment); + SetLocalInt(oSpawn, "f_AlignmentShift", nAlignmentShift); + + // Initialize Heartbeat + int nHeartbeatScript = GetFlagValue(sSpawnName, "HB", dfHeartbeatScript); + + // Record HeartBeat + SetLocalInt(oSpawn, "f_HeartbeatScript", nHeartbeatScript); + + // Initialize SpawnLocation + int nSpawnLocation = GetFlagValue(sSpawnName, "SL", dfSpawnLocation); + int nSpawnLocationMin = GetSubFlagValue(sSpawnName, "SL", "R", dfSpawnLocationMin); + int nSpawnLocationInd = IsSubFlagPresent(sSpawnName, "SL", "I"); + if (nSpawnLocationMin > nSpawnLocation) + { + nSpawnLocationMin = -1; + } + + // Record SpawnLocation + SetLocalInt(oSpawn, "f_SpawnLocation", nSpawnLocation); + SetLocalInt(oSpawn, "f_SpawnLocationMin", nSpawnLocationMin); + SetLocalInt(oSpawn, "f_SpawnLocationInd", nSpawnLocationInd); + + // Initialize SpawnFacing + float fSpawnFacing; + int nSpawnFacing = IsFlagPresent(sSpawnName, "SF"); + if (nSpawnFacing == TRUE) + { + fSpawnFacing = GetFacingFromLocation(GetLocation(oSpawn)); + } + else + { + // If f_Facing is false, fSpawnFacing is now calculated for + // each individual creature + fSpawnFacing = 0.0; + // fSpawnFacing = IntToFloat(Random(360)); + } + + // Record SpawnFacing + SetLocalInt(oSpawn, "f_Facing", nSpawnFacing); + SetLocalFloat(oSpawn, "f_SpawnFacing", fSpawnFacing); + + // Initialize EntranceExit + int nEntranceExit = GetFlagValue(sSpawnName, "EE", dfEntranceExit); + int nEntranceExitMin = GetSubFlagValue(sSpawnName, "EE", "R", dfEntranceExitMin); + if (nEntranceExitMin > nEntranceExit) + { + nEntranceExitMin = -1; + } + int nExit = GetFlagValue(sSpawnName, "EX", dfExit); + int nExitMin = GetSubFlagValue(sSpawnName, "EX", "R", dfExitMin); + if (nExitMin > nExit) + { + nExitMin = -1; + } + + // Record EntranceExit + SetLocalInt(oSpawn, "f_EntranceExit", nEntranceExit); + SetLocalInt(oSpawn, "f_EntranceExitMin", nEntranceExitMin); + SetLocalInt(oSpawn, "f_Exit", nExit); + SetLocalInt(oSpawn, "f_ExitMin", nExitMin); + + // Initialize HealChildren + int nHealChildren = GetFlagValue(sSpawnName, "HL", dfHealChildren); + int nHealEffects = IsSubFlagPresent(sSpawnName, "HL", "E"); + if (nHealChildren == 1) + { + nHealChildren == 100; + } + + // Record HealChildren + SetLocalInt(oSpawn, "f_HealChildren", nHealChildren); + SetLocalInt(oSpawn, "f_HealEffects", nHealEffects); + + // Initialize SpawnItem + int nSpawnItem = IsFlagPresent(sSpawnName, "IT"); + + // Record SpawnItem + SetLocalInt(oSpawn, "f_SpawnItem", nSpawnItem); + + // Initialize SpawnSit + int nSpawnSit = IsFlagPresent(sSpawnName, "ST"); + + // Record SpawnSit + SetLocalInt(oSpawn, "f_SpawnSit", nSpawnSit); + + // Initialize SpawnPlot + int nSpawnPlot = IsFlagPresent(sSpawnName, "PT"); + + // Record SpawnPlot + SetLocalInt(oSpawn, "f_SpawnPlot", nSpawnPlot); + + // Initialize SpawnMerchant + int nSpawnMerchant = IsFlagPresent(sSpawnName, "SM"); + + // Record SpawnMerchant + SetLocalInt(oSpawn, "f_SpawnMerchant", nSpawnMerchant); + + // Initialize Dim Returns Suppression + int nSuppressDimReturns = IsFlagPresent(sSpawnName, "SX"); + + if (nSuppressDimReturns) + { + // If the flag is present, get suppression mode from its value + nSuppressDimReturns = GetFlagValue(sSpawnName, "SX", dfSuppressDR); + } + + else + { + // Use the global setting + nSuppressDimReturns = dfGlobalSuppressDR; + } + + // Record Dim Returns Suppression + SetLocalInt(oSpawn, "f_SuppressDimReturns", nSuppressDimReturns); + + // Initialize Loot Suppression + int nSuppressLooting = IsFlagPresent(sSpawnName, "NL"); + + // Record Loot Suppression + SetLocalInt(oSpawn, "f_SuppressLooting", nSuppressLooting); + + // Initialize Subdual Mode + int nSubdualMode = IsFlagPresent(sSpawnName, "SB"); + + // Record Subdual Mode + SetLocalInt(oSpawn, "f_SubdualMode", nSubdualMode); + + int nEncounterLevel; + + // Initialize Encounter Level + if (IsFlagPresent(sSpawnName, "EL")) + { + nEncounterLevel = GetFlagValue(sSpawnName, "EL", dfEncounterLevel); + SetLocalInt(oSpawn, "f_EncounterLevel", nEncounterLevel); + } + + // Record Flags Initialized + SetLocalInt(oSpawn, "FlagsInitialized", TRUE); +} +// + +// This Function Sets the Spawns +int SetSpawns(location lBase) +{ + string sSpawnName, sSpawnNum, sSpawnTag; + int nNth = 1; + int nSpawnNum = 0; + + // Enumerate Waypoints in the Area + object oSpawn = GetFirstObjectInArea(OBJECT_SELF); + while (oSpawn != OBJECT_INVALID) + { + // Check for a local string called "NESS" on the waypoint + // first. If it exists, use it instead of the name + sSpawnName = GetLocalString(oSpawn, "NESS"); + + if (GetStringLeft(sSpawnName, 2) != "SP") + { + // Retrieve Name + sSpawnName = GetName(oSpawn); + } + + // Check if Waypoint is a Spawn Controller + if (GetStringLeft(sSpawnName, 2) == "SP") + { + // Set Spawn + nSpawnNum++; + sSpawnNum = "Spawn" + PadIntToString(nSpawnNum, 2); + SetLocalObject(OBJECT_SELF, sSpawnNum, oSpawn); + + + sSpawnTag = GetLocalString(oSpawn, "NESS_TAG"); + if (sSpawnTag == "") + { + sSpawnTag = GetTag(oSpawn); + } + + DelayCommand(0.0, InitFlags(oSpawn, sSpawnName, sSpawnTag)); + } + nNth++; + oSpawn = GetNextObjectInArea(OBJECT_SELF); + } + SetLocalInt(OBJECT_SELF, "Spawns", nSpawnNum); + return nSpawnNum; +} +// + +// This Function returns the Number of PCs in an Area +int CountPCsInArea(object oArea = OBJECT_INVALID, int nDM = FALSE) + { + int retVal = 0; + if (oArea == OBJECT_INVALID) + { + oArea = GetArea(OBJECT_SELF); + } + object oPC = GetFirstPC(); + while (oPC != OBJECT_INVALID) + { + if (GetArea(oPC) == oArea) + { + if (GetIsDM(oPC) == TRUE) + { + if (nDM == TRUE) + { + retVal++; + } + } + else + { + retVal++; + } + } + oPC = GetNextPC(); + } + return retVal; +} +// + +// This Function Returns the Number of PCs in a Radius +int CountPCsInRadius(location lCenter, float fRadius, int nDM = FALSE) +{ + int nPCs = 0; + object oPC = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lCenter, FALSE, + OBJECT_TYPE_ALL); + + while (oPC != OBJECT_INVALID) + { + if (GetIsPC(oPC)) + { + if (GetIsDM(oPC)) + { + //debug(GetName(oPC) + " is a DM "); + if (nDM == TRUE) + { + nPCs++; + } + } + else + { + //debug("found a real PC"); + nPCs++; + } + } + + oPC = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lCenter, FALSE, + OBJECT_TYPE_ALL); + } + return nPCs; +} +// + +int IsCreatureItem(object oItem) +{ + if (GetBaseItemType(oItem) == BASE_ITEM_CREATUREITEM || + GetBaseItemType(oItem) == BASE_ITEM_CBLUDGWEAPON || + GetBaseItemType(oItem) == BASE_ITEM_CPIERCWEAPON || + GetBaseItemType(oItem) == BASE_ITEM_CSLASHWEAPON || + GetBaseItemType(oItem) == BASE_ITEM_CSLSHPRCWEAP) + { + return TRUE; + } + + return FALSE; +} + +// This Function Returns a Random PC from Area +object GetRandomPCInArea(object oArea, object oSpawn) +{ + int nPCsInArea = CountPCsInArea(oArea, TRUE); + int nNth = Random(nPCsInArea) + 1; + object oRandomPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oSpawn, nNth); + return oRandomPC; +} + +object NESS_CopyCorpseItem(object oSource, object oInventory) +{ + int bWasPlot = GetPlotFlag(oSource); + object oNewItem = CopyItem(oSource, oInventory); + if (bWasPlot == TRUE) + { + SetPlotFlag(oNewItem,TRUE); + } + + return oNewItem; +} + +// +struct NESS_CorpseInfo TransferAllInventorySlots(object oVictim, + object oCorpse, int bDropWielded=FALSE) +{ + int i=0; + object oItem = OBJECT_INVALID; + location locItem; + struct NESS_CorpseInfo stCorpseInfo; + + // Initialize + stCorpseInfo.origRgtWpn = OBJECT_INVALID; + stCorpseInfo.origLftWpn = OBJECT_INVALID; + stCorpseInfo.origArmor = OBJECT_INVALID; + stCorpseInfo.lootRgtWpn = OBJECT_INVALID; + stCorpseInfo.lootLftWpn = OBJECT_INVALID; + stCorpseInfo.lootArmor = OBJECT_INVALID; + + for (i=0; i < NUM_INVENTORY_SLOTS; i++) + { + oItem = GetItemInSlot(i, oVictim); + + // See if we're going to allow looting of this item. + if (GetIsObjectValid(oItem) && GetDroppableFlag(oItem)) + { + // Handle different items slightly differently. + + if (i == INVENTORY_SLOT_CHEST && GetIsVictimDressed(oVictim)) + { + // The victim is wearing the armor. We don't want to destroy + // it while the corpse is around, since that would leave the + // body naked. + stCorpseInfo.origArmor = oItem; + stCorpseInfo.lootArmor = NESS_CopyCorpseItem(oItem, oCorpse); + } + + else if (i == INVENTORY_SLOT_RIGHTHAND) + { + if (bDropWielded) + { + // This is a wielded item. Drop it nearby. + locItem = GetStepRightLocation(oVictim); + CreateObject(OBJECT_TYPE_ITEM, GetResRef(oItem), locItem); + DestroyObject(oItem, 0.1); + } + + else + { + stCorpseInfo.origRgtWpn = oItem; + stCorpseInfo.lootRgtWpn = NESS_CopyCorpseItem(oItem, oCorpse); + } + + } + + else if (i == INVENTORY_SLOT_LEFTHAND) + { + if(bDropWielded) + { + // This is a wielded item. Drop it nearby. + locItem = GetStepLeftLocation(oVictim); + CreateObject(OBJECT_TYPE_ITEM, GetResRef(oItem), locItem); + DestroyObject(oItem, 0.1); + } + + else + { + stCorpseInfo.origLftWpn = oItem; + stCorpseInfo.lootLftWpn = NESS_CopyCorpseItem(oItem, oCorpse); + } + } + + else + { + NESS_CopyCorpseItem(oItem, oCorpse); + DestroyObject(oItem, 0.1); + } + } + } + return stCorpseInfo; +} + +// + +// This Function Checks if the Party is within fDistance Meters of Each Other +int IsPartyTogether(object oPC, float fDistance) +{ + int nTogether = TRUE; + object oMember = GetFirstFactionMember(oPC, TRUE); + while (oMember != OBJECT_INVALID) + { + if (GetIsDead(oMember) == FALSE) + { + if (GetDistanceBetween(oPC, oMember) > fDistance) + { + nTogether = FALSE; + oMember = OBJECT_INVALID; + } + } + oMember = GetNextFactionMember(oPC, TRUE); + } + return nTogether; +} +// + +// This Function Returns the Number of PCs in a Party +int CountMembersInParty(object oPC, int bPCOnly = TRUE) +{ + int nCount; + object oMember = GetFirstFactionMember(oPC, bPCOnly); + while (oMember != OBJECT_INVALID) + { + nCount++; + oMember = GetNextFactionMember(oPC, bPCOnly); + } + return nCount; +} +// + +// This Function Checks if nCheckDay is Between Days +int IsBetweenDays(int nCheckDay, int nDayStart, int nDayEnd) +{ + if (nDayEnd > -1) + { + if (nCheckDay >= nDayStart && nCheckDay <= nDayEnd) + { + return TRUE; + } + } + else + { + if (nCheckDay == nDayStart) + { + return TRUE; + } + } + + return FALSE; +} +// + +// This Function Checks if nCheckHour is Between Hours +int IsBetweenHours(int nCheckHour, int nHourStart, int nHourEnd) +{ + if (nHourEnd > -1) + { + if (nCheckHour >= nHourStart && nCheckHour <= nHourEnd) + { + return TRUE; + } + } + else + { + if (nCheckHour == nHourStart) + { + return TRUE; + } + } + + return FALSE; +} +// + +// This Function Pads an IntToString with 0s +string PadIntToString(int nInt, int nDigits) +{ + string sRetString; + string sTempInt = IntToString(nInt); + int iCount; + + sRetString = ""; + for (iCount = 1; iCount <= (nDigits - GetStringLength(sTempInt)); iCount++) + { + sRetString = sRetString + "0"; + } + sRetString = sRetString + sTempInt; + return sRetString; +} +// + +// This Function returns a Child Object by Tag +object GetChildByTag(object oSpawn, string sChildTag) +{ + object oChild; + object oRetChild = OBJECT_INVALID; + string sChildSlot; + int nChildSlot; + + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + int nSpawnNumber = GetFlagValue(sSpawnName, "SN", 1); + + // Cycle through Children + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + if (GetTag(oChild) == sChildTag) + { + oRetChild = oChild; + } + } + + return oRetChild; +} +// + +// This Function returns a Child Object by Slot Number +object GetChildByNumber(object oSpawn, int nChildNum) +{ + object oRetChild = OBJECT_INVALID; + string sChildSlot; + + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + int nSpawnNumber = GetFlagValue(sSpawnName, "SN", 1); + + // Check if Valid Number + if (nChildNum > nSpawnNumber) + { + return oRetChild; + } + + // Retrieve Child + sChildSlot = "ChildSlot" + PadIntToString(nChildNum, 2); + oRetChild = GetLocalObject(oSpawn, sChildSlot); + + // Return Child + return oRetChild; +} +// +object NESS_GetSpawnByID(int nSpawnID, object oArea) +{ + string sSpawnName; + object oRetSpawn; + + // Enumerate Waypoints in the Area + object oSpawn = GetFirstObjectInArea(oArea); + while (oSpawn != OBJECT_INVALID) + { + // Retrieve Name + sSpawnName = GetLocalString(oSpawn, "f_Flags"); + + // Check if Waypoint is a Spawn Controller + if (GetStringLeft(sSpawnName, 2) == "SP") + { + if (GetLocalInt(oSpawn, "SpawnID") == nSpawnID) + { + oRetSpawn = oSpawn; + } + } + oSpawn = GetNextObjectInArea(oArea); + } + return oRetSpawn; +} +// + +// This Function returns a Spawn Object by ID +object GetSpawnByID(int nSpawnID) +{ + return NESS_GetSpawnByID(nSpawnID, OBJECT_SELF); +} +// + +// This Function Sets Children to Despawn +void DespawnChildren(object oSpawn) +{ + object oChild; + string sChildSlot; + int nChildSlot; + + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + int nSpawnNumber = GetFlagValue(sSpawnName, "SN", 1); + + // Cycle through Children + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + SetLocalInt(oChild, "ForceDespawn", TRUE); + } +} +// + +// This Function Sets Children to Despawn by Tag +void DespawnChildrenByTag(object oSpawn, string sChildTag) +{ + object oChild; + string sChildSlot; + int nChildSlot; + + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + int nSpawnNumber = GetFlagValue(sSpawnName, "SN", 1); + + // Cycle through Children + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + if (GetTag(oChild) == sChildTag) + { + SetLocalInt(oChild, "ForceDespawn", TRUE); + } + } +} +// + +// This Function Adds a Child to a Spawn +void AddChild(object oSpawn, object oSpawned) +{ + // Declare Variables + int nEmptyChildSlot, nChildSlot; + int nSpawnNumber, nSpawnCount, nChildrenSpawned; + string sChildSlot, sEmptyChildSlot; + object oChild; + + // Retreive Values + nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); + nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned"); + nSpawnCount = GetLocalInt(oSpawn, "SpawnCount"); + + // Find Empty Child Slot + nEmptyChildSlot = 0; + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + + // Check if this is Child Slot is Valid + if (GetIsObjectValid(oChild) == FALSE || GetIsDead(oChild)) + { + // Empty Slot + if (nEmptyChildSlot == 0) + { + nEmptyChildSlot = nChildSlot; + sEmptyChildSlot = sChildSlot; + } + } + } + + if (nEmptyChildSlot != 0) + { + // Assign Values to oSpawned + SetLocalObject(oSpawned, "ParentSpawn", oSpawn); + SetLocalFloat(oSpawned, "HomeX", GetPositionFromLocation(GetLocation(oSpawned)).x); + SetLocalFloat(oSpawned, "HomeY", GetPositionFromLocation(GetLocation(oSpawned)).y); + + // Assign Child Slot + SetLocalObject(oSpawn, sEmptyChildSlot, oSpawned); + SetLocalString(oSpawned, "ParentChildSlot", sEmptyChildSlot); + + // Assign Values to oSpawn + nChildrenSpawned++; + SetLocalInt(oSpawn, "ChildrenSpawned", nChildrenSpawned); + nSpawnCount++; + SetLocalInt(oSpawn, "SpawnCount", nSpawnCount); + } +} +// + +void NESS_DeactivateSpawnByID(int nSpawnID, object oArea) +{ + object oSpawn = NESS_GetSpawnByID(nSpawnID, oArea); + NESS_DeactivateSpawn(oSpawn); +} +// Identical to DeactivateSpawn, but included for interface consistency +void NESS_DeactivateSpawn(object oSpawn) +{ + DeactivateSpawn(oSpawn); +} +// This Function Sets a Spawn to Deactivate +void DeactivateSpawn(object oSpawn) +{ + SetLocalInt(oSpawn, "ForceDeactivateSpawn", TRUE); + NESS_ForceProcess(oSpawn); +} + +void NESS_ActivateSpawnByID(int nSpawnID, object oArea) +{ + object oSpawn = NESS_GetSpawnByID(nSpawnID, oArea); + NESS_ActivateSpawn(oSpawn); +} + +// This Function Sets a Spawn to Activate +void NESS_ActivateSpawn(object oSpawn) +{ + SetLocalInt(oSpawn, "SpawnDeactivated", FALSE); + NESS_ForceProcess(oSpawn); +} + +void NESS_ForceProcess(object oSpawn) +{ + SetLocalInt(oSpawn, "SpawnForceProcess", TRUE); +} + +void NESS_TrackModuleSpawns(int flag=TRUE) +{ + SetLocalInt(GetModule(), "TrackModuleSpawns", flag); +} + +int NESS_IsModuleSpawnTracking() +{ + return GetLocalInt(GetModule(), "TrackModuleSpawns"); +} + +// + +void NESS_DumpModuleSpawns(int flag=TRUE) +{ + SetLocalInt(GetModule(), "DumpModuleSpawns", flag); +} + +int NESS_IsModuleSpawnDumping() +{ + return GetLocalInt(GetModule(), "DumpModuleSpawns"); +} +// +// This Function Sets all Spawns by Tag to Deactivate +void DeactivateSpawnsByTag(string sSpawnTag) +{ + int nNth; + object oSpawn; + string sSpawnNum; + + int nSpawns = GetLocalInt(GetArea(OBJECT_SELF), "Spawns"); + + for (nNth = 1; nNth <= nSpawns; nNth++) + { + // Retrieve Spawn + sSpawnNum = "Spawn" + PadIntToString(nNth, 2); + oSpawn = GetLocalObject(OBJECT_SELF, sSpawnNum); + if (GetTag(oSpawn) == sSpawnTag) + { + SetLocalInt(oSpawn, "ForceDeactivateSpawn", TRUE); + } + } +} +// + +// This Function Sets all Spawns to Deactivate +void DeactivateAllSpawns() +{ + int nNth; + object oSpawn; + string sSpawnNum; + + int nSpawns = GetLocalInt(GetArea(OBJECT_SELF), "Spawns"); + + for (nNth = 1; nNth <= nSpawns; nNth++) + { + // Retrieve Spawn + sSpawnNum = "Spawn" + PadIntToString(nNth, 2); + oSpawn = GetLocalObject(OBJECT_SELF, sSpawnNum); + SetLocalInt(oSpawn, "ForceDeactivateSpawn", TRUE); + } +} +// +location GetRandomLocationInRadius(object oSpawn, float fWalkingRadius) +{ + vector vCurrentLocation, vTargetLocation; + float fRadiusX, fRadiusY; + location lTargetLocation; + + // Create our Random Location + fRadiusX = IntToFloat(Random(FloatToInt(fWalkingRadius))); + fRadiusY = IntToFloat(Random(FloatToInt(fWalkingRadius))); + if (d2() == 2) + { + fRadiusX = -fRadiusX; + } + if (d2() == 2) + { + fRadiusY = -fRadiusY; + } + vTargetLocation = Vector(fRadiusX, fRadiusY); + vCurrentLocation = GetPositionFromLocation(GetLocation(oSpawn)); + lTargetLocation = Location(OBJECT_SELF, vCurrentLocation + vTargetLocation, + 0.0); + + return lTargetLocation; +} + +// Random Walking with Range +void RandomWalk(object oSpawn, float fWalkingRadius, int nRun) +{ + // Walk to the New Location + float fRadiusX, fRadiusY; + + // Create our Random Location + fRadiusX = IntToFloat(Random(FloatToInt(fWalkingRadius))); + fRadiusY = IntToFloat(Random(FloatToInt(fWalkingRadius))); + if (d2() == 2) + { + fRadiusX = -fRadiusX; + } + if (d2() == 2) + { + fRadiusY = -fRadiusY; + } + + location lSpawnLocation = GetLocation(oSpawn); + vector vNewPosition = GetPositionFromLocation(lSpawnLocation); + + vNewPosition.x += fRadiusX; + vNewPosition.y += fRadiusY; + + location lRandomWalkLocation = Location(GetArea(OBJECT_SELF), vNewPosition, + 0.0); + ActionMoveToLocation(lRandomWalkLocation, nRun); +} +// + +// This Function Finds aaSeatnd Sits in It +void FindSeat(object oSpawn, object oSpawned) +{ + object oSeat; + string sSeatTag = GetLocalString(GetModule(), "df_SeatTag"); + location lSeatLocation; + + int nNth = 1; + object oSittable = GetNearestObjectByTag(sSeatTag, oSpawned, nNth); + while (oSittable != OBJECT_INVALID && oSeat == OBJECT_INVALID) + { + if (GetSittingCreature(oSittable) == OBJECT_INVALID) + { + oSeat = oSittable; + } + nNth++; + oSittable = GetNearestObjectByTag(sSeatTag, oSpawned, nNth); + } + + if (GetIsObjectValid(oSeat)) + { + lSeatLocation = GetLocation(oSeat); + AssignCommand(oSpawned, ClearAllActions()); + AssignCommand(oSpawned, ActionMoveToLocation(lSeatLocation)); + AssignCommand(oSpawned, ActionSit(oSeat)); + } +} +// + +// This Function Cleans an Object's Inventory + +void NESS_CleanCorpse(object oSpawned) +{ + NESS_CleanEquipped(oSpawned); + NESS_CleanInventory(oSpawned); +} + +void NESS_CleanEquipped(object oSpawned) +{ + int i = 0; + object oItem = OBJECT_INVALID; + + for (i=0; i < NUM_INVENTORY_SLOTS; i++) + { + oItem = GetItemInSlot(i, oSpawned); + + if (GetIsObjectValid(oItem)) + { + // Why the delay? This is used to remove equipped items from corpses. If the + // corpse is still around, it do it's unequip animation... + DestroyObject(oItem, 1.0); + oItem = GetNextItemInInventory(oSpawned); + } + } +} + +void NESS_CleanInventory(object oSpawned) +{ + // Clean out oSpawned's Inventory + //debug("in clean inventory"); + object oItem = GetFirstItemInInventory(oSpawned); + while (oItem != OBJECT_INVALID) + { + //debug("destroying " + GetName(oItem)); + DestroyObject(oItem); + oItem = GetNextItemInInventory(oSpawned); + } +} + +// + +// This Functions Sets up the Patrol Route +void SetPatrolRoute(int nPatrolRoute, int nStartClosest=FALSE) +{ + object oStop; + int nRouteNumber, nStopNumber, iCount, nNumStops; + string sStop; + + // These 3 vars only used if nStartClosest is TRUE; + float fLeastDistance = 9999999.0;// any distance returned should be smaller + float fCurrentDistance; + int nClosestStopNum; + + // Cycle through Available Patrol Route Stops + iCount = 0; + nNumStops = 0; + oStop = GetNearestObject(OBJECT_TYPE_WAYPOINT, OBJECT_SELF, iCount); + while (oStop != OBJECT_INVALID) + { + sStop = GetTag(oStop); + // Check Route Number + nRouteNumber = GetFlagValue(sStop, "PR", -1); + if (nRouteNumber == nPatrolRoute) + { + // Identical Route Number, Add this Stop to oSpawned + nNumStops++; + nStopNumber = GetFlagValue(sStop, "SN", 0); + SetLocalObject(OBJECT_SELF, "PR_SN" + PadIntToString(nStopNumber, 2), oStop); + if (nStartClosest) + { + fCurrentDistance = GetDistanceToObject(oStop); + if (fCurrentDistance < fLeastDistance) + { + nClosestStopNum = nStopNumber; + fLeastDistance = fCurrentDistance; + } + } + + } + iCount++; + oStop = GetNearestObject(OBJECT_TYPE_WAYPOINT, OBJECT_SELF, iCount); + } + SetLocalInt(OBJECT_SELF, "PR_STOPS", nNumStops); + if (nStartClosest && (nClosestStopNum > 0)) + { + SetLocalInt(OBJECT_SELF, "PR_LASTSTOP", nClosestStopNum - 1); + + // Force it to go to a new waypoint + SetLocalInt(OBJECT_SELF, "PR_NEXTSTOP", -1); + + } +} +// + +// This Function Performs the Patrol Route +void DoPatrolRoute(int nPatrolRoute, int nRouteType) +{ + int nNumStops, nDespawn; + int nNextPatrolStop = -1; + int nLastPatrolStop = -1; + int nReturnRoute = FALSE; + + if (GetCurrentAction() != ACTION_INVALID) + return; + + ClearAllActions(); + + // Retreive Stop Information + nNumStops = GetLocalInt(OBJECT_SELF, "PR_STOPS"); + nNextPatrolStop = GetLocalInt(OBJECT_SELF, "PR_NEXTSTOP"); + nLastPatrolStop = GetLocalInt(OBJECT_SELF, "PR_LASTSTOP"); + nReturnRoute = GetLocalInt(OBJECT_SELF, "PR_RETURNROUTE"); + + // Add New Stop to Route + if (nNextPatrolStop == -1) + { + // Sequential Route + if (nRouteType == 0 || nRouteType == 3) + { + if (nReturnRoute == TRUE) + { + if (nLastPatrolStop == 0) + { + nReturnRoute = FALSE; + SetLocalInt(OBJECT_SELF, "PR_RETURNROUTE", nReturnRoute); + nNextPatrolStop = nLastPatrolStop + 1; + } + else + { + nNextPatrolStop = nLastPatrolStop - 1; + } + } + else + { + if (nLastPatrolStop == nNumStops) + { + if (nRouteType == 3) + { + // End of Line, Despawn + nDespawn = TRUE; + } + else + { + nReturnRoute = TRUE; + SetLocalInt(OBJECT_SELF, "PR_RETURNROUTE", nReturnRoute); + nNextPatrolStop = nLastPatrolStop - 2; + } + } + else + { + nNextPatrolStop = nLastPatrolStop + 1; + } + } + } + + // Circular Route + if (nRouteType == 1) + { + if (nLastPatrolStop == nNumStops) + { + nNextPatrolStop = 0; + } + else + { + nNextPatrolStop = nLastPatrolStop + 1; + } + } + + // Random Route + if (nRouteType == 2) + { + nNextPatrolStop = Random(nNumStops); + while (nNextPatrolStop == nLastPatrolStop) + { + nNextPatrolStop = Random(nNumStops); + } + } + } + + if (nDespawn == TRUE) + { + ClearAllActions(); + SetLocalInt(OBJECT_SELF, "ForceDespawn", TRUE); + } + else + { + // Set Next Stop + SetLocalInt(OBJECT_SELF, "PR_NEXTSTOP", nNextPatrolStop); + + // Add Stop to Patrol + AddPatrolStop(nPatrolRoute, nNextPatrolStop); + + // Repeat the Process + ActionDoCommand(DoPatrolRoute(nPatrolRoute, nRouteType)); + } +} +// + +// This Function adds a Stop to the Patrol Route +void AddPatrolStop(int nPatrolRoute, int nStopNumber, int bJump=FALSE) +{ + object oStop; + int nRun, nScript, nFacing; + int nDayOnly, nNightOnly; + float fPause; + // Danmar: Added below for random pause setup + int nRandomPause; + int nRandomRoute; + // End Danmar changes + string sStop; + int nValid = TRUE; + + // Gather Stop Information + oStop = GetLocalObject(OBJECT_SELF, "PR_SN" + + PadIntToString(nStopNumber, 2)); + + if (GetIsObjectValid( oStop ) ) + { + sStop = GetTag(oStop); + nRun = IsFlagPresent(sStop, "RN"); + fPause = IntToFloat(GetFlagValue(sStop, "PS", 1)); + + // Danmar: Added RP###/RR### flag to patrol points to allow randomization + // of the pause time and stops. + nRandomPause = GetFlagValue(sStop, "RP", 0); + nRandomRoute = GetFlagValue(sStop, "RR", 0); + // End Danmar changes. + + nScript = GetFlagValue(sStop, "SC", -1); + nFacing = IsFlagPresent(sStop, "SF"); + nDayOnly = IsFlagPresent(sStop, "DO"); + nNightOnly = IsFlagPresent(sStop, "NO"); + + // Day Only + if (nDayOnly == TRUE && (GetIsDay() == FALSE && GetIsDawn() == FALSE)) + { + nValid = FALSE; + } + + // Night Only + if (nNightOnly == TRUE && (GetIsNight() == FALSE && GetIsDusk() == FALSE)) + { + nValid = FALSE; + } + + // Check if Valid + if (nValid == TRUE) + { + // Move to Stop + // Modified by Danmar + // ActionMoveToObject(oStop, nRun); // Original NESS line. + // if d% is less than nRandomRoute (RRxxx) then we move to the next stop. + // If its not then we skip that one and move to the next. + if ((nRandomRoute == 0) || ((Random(100) + 1) < nRandomRoute)) + { + if (bJump) + { + ActionJumpToLocation(GetLocation(oStop)); + } + else + { + ActionMoveToObject(oStop, nRun); + } + } + // End Danmar Changes + if (nFacing == TRUE) + { + ActionDoCommand(SetFacing(GetFacingFromLocation(GetLocation(oStop)))); + } + + // Execute Script + if (nScript > -1) + { + SetLocalInt(OBJECT_SELF, "PatrolScript", nScript); + ActionDoCommand(SetLocalInt(OBJECT_SELF, "PatrolScriptRunning", TRUE)); + ExecuteScript("spawn_sc_patrol", OBJECT_SELF); + ActionDoCommand(SetLocalInt(OBJECT_SELF, "PatrolScriptRunning", FALSE)); + } + + // Pause + /* Danmar: If fRandomPause!=0 then let's pick a random pause length and + add it to the existing fpause. This way you can use PS to set the + minimum pause and RP to set the maximum pause. + Example: PR01_SN01_PS010_RR011 would cause the creature to pause between + 10 to 20 seconds. */ + if (nRandomPause != 0) + { + fPause = fPause + IntToFloat(Random(nRandomPause)); + } + // End Danmar Changes + ActionWait(fPause); + } + } + + // Record this Stop and Clear Next Stop + ActionDoCommand(SetLocalInt(OBJECT_SELF, "PR_LASTSTOP", nStopNumber)); + ActionDoCommand(SetLocalInt(OBJECT_SELF, "PR_NEXTSTOP", -1)); +} + +void CheckForStuckPatrol(object oCreature, int nPatrolRoute, int nRouteType) +{ + // are we at the same location as last time? + location lLast = GetLocalLocation(oCreature, "NESSLastLoc"); + location lCurrent = GetLocation(oCreature); + if (lLast != lCurrent) + { + SetLocalLocation(oCreature, "NESSLastLoc", lCurrent); + SetLocalInt(oCreature, "NESSStuckCount", 0); + return; + } + + int nStuckCount = GetLocalInt(oCreature, "NESSStuckCount"); + nStuckCount += 1; + + if (nStuckCount < 3) + { + SetLocalInt(oCreature, "NESSStuckCount", nStuckCount); + return; + } + + AssignCommand(oCreature, ClearAllActions()); + + // unstuck 'im + int nLastStop = GetLocalInt(OBJECT_SELF, "PR_LASTSTOP"); + + // force a move + AssignCommand(oCreature, AddPatrolStop(nPatrolRoute, nLastStop, TRUE)); + + // reset + SetLocalInt(oCreature, "NESSStuckCount", 0); + +} +// + +// This Function Checks Camp State +int ProcessCamp(object oCamp) +{ + int iCount; + int nIsAlive = FALSE; + int nCampNumC, nCampNumP, nPlaceableType, nDeathScript; + float fCorpseDecay; + object oSpawned, oCampTrigger, oItem; + string sObject, sFlags, sCampTrigger; + + // Check Creatures + nCampNumC = GetLocalInt(oCamp, "CampNumC"); + + // Suppress despawning on creatureless camps + if ( nCampNumC == 0 ) + { + nIsAlive = TRUE; + } + + for (iCount = 1; iCount <= nCampNumC; iCount++) + { + sObject = "CampC" + IntToString(iCount - 1); + sFlags = GetLocalString(oCamp, sObject + "_Flags"); + fCorpseDecay = IntToFloat(GetFlagValue(sFlags, "CD", 0)); + nDeathScript = GetFlagValue(sFlags, "DT", -1); + oSpawned = GetLocalObject(oCamp, sObject); + if (oSpawned != OBJECT_INVALID) + { + if (GetIsDead(oSpawned) == FALSE) + { + nIsAlive = TRUE; + int nIsBusy = FALSE; + if (GetIsInCombat(oSpawned) || IsInConversation(oSpawned) || + (GetCurrentAction(oSpawned) != ACTION_INVALID)) + { + nIsBusy = TRUE; + } + if (! nIsBusy) + { + // Do return home processing + int nReturnHome = GetLocalInt(oSpawned, "f_ReturnHome"); + if (nReturnHome) + { + // retrieve lHome and fReturnRange + float fReturnHomeRange = GetLocalFloat(oSpawned, + "f_ReturnHomeRange"); + float fHomeX = GetLocalFloat(oSpawned, "HomeX"); + float fHomeY = GetLocalFloat(oSpawned, "HomeY"); + vector vHome = Vector(fHomeX, fHomeY, 0.0); + location lHome = Location(OBJECT_SELF, vHome, 0.0); + + if (GetDistanceBetweenLocations(lHome, GetLocation(oSpawned)) + > fReturnHomeRange) + { + AssignCommand(oSpawned, ReturnHome(lHome)); + nIsBusy = TRUE; + } + + } + } + + // Do random walk + if (! nIsBusy) + { + int nRandomWalk = GetLocalInt(oSpawned, "f_RandomWalk"); + if (nRandomWalk && + GetCurrentAction(oSpawned) != ACTION_WAIT && + GetCurrentAction(oSpawned) != ACTION_CASTSPELL && + (d2(1) == 2)) + { + AssignCommand(oSpawned, ClearAllActions()); + AssignCommand(oSpawned, ActionRandomWalk()); + } + } + } + else + { + NESS_ProcessDeadCreature(oSpawned); + DeleteLocalObject(oCamp, sObject); + } + } + } + + // Check Camp Trigger + if (nIsAlive) + { + sCampTrigger = GetLocalString(oCamp, "CampTrigger"); + if (sCampTrigger != "") + { + oCampTrigger = GetLocalObject(oCamp, "Camp" + sCampTrigger); + if (oCampTrigger == OBJECT_INVALID || GetIsDead(oCampTrigger) == TRUE) + { + // Run Trigger Script + ExecuteScript("spawn_sc_cmptrig", oCamp); + } + } + } + + // Check Placeable + nCampNumP = GetLocalInt(oCamp, "CampNumP"); + for (iCount = 1; iCount <= nCampNumP; iCount++) + { + sObject = "CampP" + IntToString(iCount - 1); + sFlags = GetLocalString(oCamp, sObject + "_Flags"); + nPlaceableType = GetFlagValue(sFlags, "PL", 0); + if (nPlaceableType == 1) + { + // Despawn if Empty + oSpawned = GetLocalObject(oCamp, sObject); + if (GetFirstItemInInventory(oSpawned) == OBJECT_INVALID) + { + DestroyObject(oSpawned); + } + } + } + + return nIsAlive; +} +// + +// This Function will Despawn a Camp +void DestroyCamp(object oCamp, float fCampDecay, int nSaveState) +{ + int iCount; + object oSpawned; + string sObject; + + int nCampNumP = GetLocalInt(oCamp, "CampNumP"); + int nCampNumC = GetLocalInt(oCamp, "CampNumC"); + + // Destroy Placeables + for (iCount = 1; iCount <= nCampNumP; iCount++) + { + sObject = "CampP" + IntToString(iCount - 1); + oSpawned = GetLocalObject(oCamp, sObject); + + if (nSaveState) + { + //debug("Saving " + sObject); + SaveStateOnDespawn(oSpawned, oCamp, TRUE); + } + SpawnCountDebug(oCamp, "despawning camp object " + ObjectToString(oSpawned)); + DestroyObject(oSpawned, fCampDecay); + } + + // Destroy Creatures + for (iCount = 1; iCount <= nCampNumC; iCount++) + { + sObject = "CampC" + IntToString(iCount - 1); + oSpawned = GetLocalObject(oCamp, sObject); + + if (nSaveState) + { + //debug("Saving " + sObject); + SaveStateOnDespawn(oSpawned, oCamp, TRUE); + } + AssignCommand(oSpawned, ClearAllActions()); + if (oSpawned != OBJECT_INVALID) + { + + NESS_CleanInventory(oSpawned); + AssignCommand(oSpawned, SetIsDestroyable(TRUE)); + SpawnCountDebug(oCamp, "despawning camp creature " + ObjectToString(oSpawned)); + + DestroyObject(oSpawned); + } + // remove from camp object + DeleteLocalObject(oCamp, sObject); + } +} +// + +object GetSpawnLocationObject(object oSpawn, int nSpawnLocationMin, + int nSpawnLocation, int nSpawnLocationInd) +{ + string sSpawnLocation; + object oSpawnLocation; + + if (nSpawnLocationInd) + { + int nNextEmptySlot; + + nNextEmptySlot = FindNextEmptyChildSlot(oSpawn); + + if (nNextEmptySlot > 0) + { + sSpawnLocation = "SL" + PadIntToString(nSpawnLocation + nNextEmptySlot - 1, + 2); + } + + else + { + // no empty slots? Just use base, I guess + sSpawnLocation = "SL" + PadIntToString(nSpawnLocation, 2); + } + + oSpawnLocation = GetNearestObjectByTag(sSpawnLocation, oSpawn); + } + + else + { + int nRndSpawnLocation; + + if (nSpawnLocationMin > -1) + { + nRndSpawnLocation = Random(nSpawnLocation + 1); + while (nRndSpawnLocation < nSpawnLocationMin) + { + nRndSpawnLocation = Random(nSpawnLocation + 1); + } + nSpawnLocation = nRndSpawnLocation; + } + sSpawnLocation = "SL" + PadIntToString(nSpawnLocation, 2); + oSpawnLocation = GetNearestObjectByTag(sSpawnLocation, oSpawn); + } + + return oSpawnLocation; +} + +vector GetSpawnRadiusPosition(vector vSpawnPos, float fSpawnRadius, + float fSpawnRadiusMin, int nRadialDistribution=FALSE) +{ + float fX, fY; + vector vRadius; + + if (nRadialDistribution) + { + float fSpawnAngle, fRadius; + + fSpawnAngle = IntToFloat(Random(361)); + if (fSpawnRadiusMin == fSpawnRadius) + { + fX = fSpawnRadius * cos(fSpawnAngle); + fY = fSpawnRadius * sin(fSpawnAngle); + } + else + { + fRadius = IntToFloat(Random(FloatToInt(fSpawnRadius) + 1)); + while (fRadius < fSpawnRadiusMin) + { + fRadius = IntToFloat(Random(FloatToInt(fSpawnRadius) + 1)); + } + fX = fRadius * cos(fSpawnAngle); + fY = fRadius * sin(fSpawnAngle); + } + } + + else + { + float fTestDistSquared, fMaxRadiusSquared, fMinRadiusSquared; + int nSpawnRadius = FloatToInt(fSpawnRadius); + + // Set up comparators + fMaxRadiusSquared = fSpawnRadius * fSpawnRadius; + fMinRadiusSquared = fSpawnRadiusMin * fSpawnRadiusMin; + + // Calculate first attempt + fX = IntToFloat(Random((2 * nSpawnRadius) + 1) - + nSpawnRadius + 1); + fY = IntToFloat(Random((2 * nSpawnRadius) + 1) - + nSpawnRadius + 1); + fTestDistSquared = (fX * fX) + (fY * fY); + + while (fTestDistSquared < fMinRadiusSquared || + fTestDistSquared > fMaxRadiusSquared) + { + fX = IntToFloat(Random((2 * nSpawnRadius) + 1) - + nSpawnRadius + 1); + fY = IntToFloat(Random((2 * nSpawnRadius) + 1) - + nSpawnRadius + 1); + fTestDistSquared = (fX * fX) + (fY * fY); + } + } + vRadius = Vector(vSpawnPos.x + fX, vSpawnPos.y + fY); + return vRadius; +} + +int CheckPositionUnseen(vector vSpawnPos, float fUnseenRadius) +{ + location lSpawn = Location(OBJECT_SELF, vSpawnPos, 0.0); + + object oCreature = GetFirstObjectInShape(SHAPE_SPHERE, fUnseenRadius, + lSpawn, FALSE, OBJECT_TYPE_CREATURE); + + while (oCreature != OBJECT_INVALID) + { + if (GetIsPC(oCreature) == TRUE) + { + return FALSE; + } + oCreature = GetNextObjectInShape(SHAPE_SPHERE, fUnseenRadius, + lSpawn, FALSE, OBJECT_TYPE_CREATURE); + } + + return TRUE; + +} + +void ReportSpawns(int nAreaSpawns, int nModuleSpawns) +{ + SendMessageToAllDMs("New creature count in " + + GetName(OBJECT_SELF) + ": " + IntToString(nAreaSpawns) + + " Module spawn count: " + IntToString(nModuleSpawns) + + (SPAWN_DELAY_DEBUG ? " (sd+)" : " (sd-)") + + (SPAWN_COUNT_DEBUG ? " (sc+)" : " (sc-)")); +} + +void TrackModuleSpawns(int nAreaSpawnCount, int nTrackModuleSpawns) +{ + int nNewAreaSpawnCount = GetLocalInt(OBJECT_SELF, SPAWN_AREA_COUNT ); + int nSpawnDifference = nNewAreaSpawnCount - nAreaSpawnCount; + + if (nSpawnDifference) + { + int nModuleSpawns = GetLocalInt(GetModule(), "ModuleSpawnCount"); + nModuleSpawns += nSpawnDifference; + SetLocalInt(GetModule(), "ModuleSpawnCount", nModuleSpawns); + if (nTrackModuleSpawns) + { + ReportSpawns(nNewAreaSpawnCount, nModuleSpawns); + } + } +} + +void DumpModuleSpawns() +{ + int nAreaSpawnCount = GetLocalInt(OBJECT_SELF, SPAWN_AREA_COUNT ); + if (nAreaSpawnCount > 0) + { + SendMessageToAllDMs("Area " + GetName(OBJECT_SELF) + ": " + + IntToString(nAreaSpawnCount) + + (SPAWN_DELAY_DEBUG ? " (sd+)" : " (sd-)") + + (SPAWN_COUNT_DEBUG ? " (sc+)" : " (sc-)")); + } +} + +void NESS_ReturnHome(object oCreature, int bRun=FALSE) +{ + float fHomeX = GetLocalFloat(oCreature, "HomeX"); + float fHomeY = GetLocalFloat(oCreature, "HomeY"); + vector vHome = Vector(fHomeX, fHomeY, 0.0); + location lHome = Location(GetArea(oCreature), vHome, 0.0); + + ClearAllActions(); + ActionMoveToLocation(lHome, bRun); +} + +void ReturnHome(location lHome) +{ + if (GetCurrentAction() != ACTION_INVALID) + return; + + ClearAllActions(); + ActionMoveToLocation(lHome); +} + +void DestroyIfNonDrop(object oItem) +{ + if(GetIsObjectValid(oItem)) + { + if (! GetDroppableFlag(oItem)) + { + //debug("Destroying non-drop item named " + GetName(oItem)); + DestroyObject(oItem); + } + } +} + +void StripNonDroppables(object oSpawned) +{ + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_ARMS, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_ARROWS, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_BELT, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_BOLTS, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_BOOTS, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_BULLETS, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_CHEST, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_CLOAK, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_HEAD, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_NECK, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oSpawned)); + DestroyIfNonDrop(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oSpawned)); + + object oItem = GetFirstItemInInventory(oSpawned); + while (oItem != OBJECT_INVALID) + { + DestroyIfNonDrop(oItem); + oItem = GetNextItemInInventory(oSpawned); + } +} + +void NESS_ProcessDeadCreature(object oCreature, object oSpawn=OBJECT_INVALID) +{ + int nCampCreature; + + // Only do once per creature. Since this may be called from onDeath + // or within a NESS HB, check/mark for having been processed + int nProcessedDeath = GetLocalInt(oCreature, "ProcessedDeath"); + if (nProcessedDeath) + { + return; + } + + + SetLocalInt(oCreature, "ProcessedDeath", TRUE); + + // Find parent if not passed in + if (oSpawn == OBJECT_INVALID) + { + oSpawn = GetLocalObject(oCreature, "ParentSpawn"); + } + + object oArea = GetArea(oCreature); + SPAWN_DELAY_DEBUG = GetLocalInt(oArea, "SpawnDelayDebug"); + SPAWN_COUNT_DEBUG = GetLocalInt(oArea, "SpawnCountDebug"); + SpawnDelayDebug(oSpawn, "creature " + ObjectToString(oCreature) + " died"); + + // Remove non-drop items + // StripNonDroppables(oCreature); + + // Initialize DeathScripts + int nDeathScript; + float fCorpseDecay; + if (oSpawn == OBJECT_INVALID) + { + //debug("camp creature died"); + string sCampFlags; + nCampCreature = TRUE; + sCampFlags = GetLocalString(oCreature, "CreatureFlags"); + //debug("in process dead with flags " + sCampFlags); + fCorpseDecay = IntToFloat(GetFlagValue(sCampFlags, "CD", 0)); + nDeathScript = GetFlagValue(sCampFlags, "DT", -1); + //debug("camp creature: cd = " + FloatToString(fCorpseDecay)); + } + + else + { + //debug("non-camp creature died"); + nCampCreature = FALSE; + nDeathScript = GetLocalInt(oSpawn, "f_DeathScript"); + fCorpseDecay = GetLocalFloat(oSpawn, "f_CorpseDecay"); + //debug("not a camp creature: cd = " + FloatToString(fCorpseDecay)); + } + + // Run Death Script + if (nDeathScript > -1 && GetLocalInt(oCreature, "DeathScriptRan") == FALSE) + { + SetLocalInt(oCreature, "DeathScript", nDeathScript); + ExecuteScript("spawn_sc_death", oCreature); + } + + // Spawn Corpse if Dead and No Corpse + if (fCorpseDecay > 0.0) + { + if (GetLocalObject(oCreature, "Corpse") == OBJECT_INVALID) + { + //debug("calling spawn_corpse_dth"); + ExecuteScript("spawn_corpse_dth", oCreature); + } + } + + else + { + if (GetLocalInt(GetModule(), "AlwaysDestroyCorpses")) + { + AssignCommand(oCreature, SetIsDestroyable(TRUE, FALSE, FALSE)); + } + } +} + +void ResetSpawn(object oSpawn, int nTimeNow) +{ + // Reset the Spawn + SetLocalInt(oSpawn, "NextSpawnTime", nTimeNow); + //debug("set next spawn time on reset: " + IntToString(nTimeNow)); + SetLocalInt(oSpawn, "SpawnDeactivated", FALSE); + SetLocalInt(oSpawn, "ChildrenSpawned", 0); + SetLocalInt(oSpawn, "CurrentProcessTick", 0); + SetLocalInt(oSpawn, "SpawnAgeTime", 0); + //debug("PC reset"); + +} + +// + +void SaveStateOnDespawn(object oSpawned, object oSpawn, int nCamp=FALSE) +{ + string sSaveVarName; + + // These are the values needed to recreate the spawned object where + // it was when it despawned + int nObjectType = 0; + string sTemplate; + location lLastLocation; + float fLastFacing; + float fHomeX; + float fHomeY; + int nReturnHome; + + if (nCamp && !GetIsObjectValid(oSpawned)) + { + SpawnCountDebug(oSpawn, "creating slot for dead camp object" + + ObjectToString(oSpawned)); + sTemplate = ""; + } + + else + { + nObjectType = GetObjectType(oSpawned); + sTemplate = GetResRef(oSpawned); + lLastLocation = GetLocation(oSpawned); + fLastFacing = GetFacing(oSpawned); + fHomeX = GetLocalFloat(oSpawned, "HomeX"); + fHomeY = GetLocalFloat(oSpawned, "HomeY"); + + // if the return home flag is on, respawn at the home point + if (nCamp) + { + nReturnHome = GetLocalInt(oSpawned, "f_ReturnHome"); + } + + else + { + nReturnHome = GetLocalInt(oSpawn, "f_ReturnHome"); + } + + if (nReturnHome) + { + vector vHome = Vector(fHomeX, fHomeY, 0.0); + location lHome = Location(GetArea(oSpawned), vHome, fLastFacing); + lLastLocation = lHome; + } + } + + int nNumberSaveStates = GetLocalInt(oSpawn, "SpawnNumSavedStates"); + SetLocalInt(oSpawn, "SpawnNumSavedStates", ++nNumberSaveStates); + string sSaveVarNameBase = "SpawnedSaveState" + IntToString(nNumberSaveStates); + SpawnCountDebug(oSpawn, "PC despawn save count: " + IntToString(nNumberSaveStates)); + + + // Save the stuff needed to respawn + sSaveVarName = sSaveVarNameBase + "ObjectType"; + SetLocalInt(oSpawn, sSaveVarName, nObjectType); + + sSaveVarName = sSaveVarNameBase + "Template"; + SetLocalString(oSpawn, sSaveVarName, sTemplate); + + sSaveVarName = sSaveVarNameBase + "LastLocation"; + SetLocalLocation(oSpawn, sSaveVarName, lLastLocation); + + sSaveVarName = sSaveVarNameBase + "HomeX"; + SetLocalFloat(oSpawn, sSaveVarName, fHomeX); + + sSaveVarName = sSaveVarNameBase + "HomeY"; + SetLocalFloat(oSpawn, sSaveVarName, fHomeY); + + // These need to be preserved so they can be rewritten to the respawned + // object; they may be used in ProcessSpawn + if (! nCamp) + { + float fSpawnFacing = GetLocalFloat(oSpawned, "SpawnFacing"); + float fEntranceExitX = GetLocalFloat(oSpawned, "EntranceExitX"); + float fEntranceExitY = GetLocalFloat(oSpawned, "EntranceExitY"); + int iExpireTime = GetLocalInt(oSpawned, "LifespanExpireTime"); + + // Save the stuff we need to rewrite onto the spawn + sSaveVarName = sSaveVarNameBase + "SpawnFacing"; + SetLocalFloat(oSpawn, sSaveVarName, fSpawnFacing); + + sSaveVarName = sSaveVarNameBase + "EntranceExitX"; + SetLocalFloat(oSpawn, sSaveVarName, fEntranceExitX); + + sSaveVarName = sSaveVarNameBase + "EntranceExitY"; + SetLocalFloat(oSpawn, sSaveVarName, fEntranceExitY); + + sSaveVarName = sSaveVarNameBase + "LifeSpanExpireTime"; + SetLocalInt(oSpawn, sSaveVarName, iExpireTime); + } +} + +// + +void SaveCampStateOnDespawn(object oCamp, object oSpawn) +{ + // Note that most of what needs to be saved is on the camp object itself. + // This saves the camp object onto oSpawn + int nNumSavedCampStates = GetLocalInt(oSpawn,"SpawnNumSavedCampStates"); + SetLocalInt(oSpawn, "SpawnNumSavedCampStates",++nNumSavedCampStates); + + SpawnCountDebug(oSpawn, "PC despawn camp save count: " + IntToString(nNumSavedCampStates)); + + string sSaveCampVarName = "SpawnedSaveCampState" + + IntToString(nNumSavedCampStates); + SetLocalObject(oSpawn, sSaveCampVarName, oCamp); +} + +// + +void RestorePCDespawns(object oSpawn, int nTimeNow) +{ + int nSpawnNumSavedStates = GetLocalInt(oSpawn, "SpawnNumSavedStates"); + string sSaveVarNameBase; + string sSaveVarName; + int nChildNum; + + object oSpawned; + int nObjectType; + string sTemplate; + location lLastLocation; + location lEntranceExit; + float fHomeX; + float fHomeY; + location lHome; + int iExpireTime; + int i; + + SpawnCountDebug(oSpawn, "restoring " + IntToString(nSpawnNumSavedStates) + " objects"); + + for (i = 0; i < nSpawnNumSavedStates; i++) + { + nChildNum = i + 1; + sSaveVarNameBase = "SpawnedSaveState" + IntToString(nChildNum); + + sSaveVarName = sSaveVarNameBase + "ObjectType"; + nObjectType = GetLocalInt(oSpawn, sSaveVarName); + DeleteLocalInt(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "Template"; + sTemplate = GetLocalString(oSpawn, sSaveVarName); + DeleteLocalString (oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "LastLocation"; + lLastLocation = GetLocalLocation(oSpawn, sSaveVarName); + DeleteLocalLocation(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "SpawnFacing"; + float fSpawnFacing = GetLocalFloat(oSpawn, sSaveVarName); + DeleteLocalFloat(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "HomeX"; + fHomeX = GetLocalFloat(oSpawn, sSaveVarName); + DeleteLocalFloat(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "HomeY"; + fHomeY = GetLocalFloat(oSpawn, sSaveVarName); + DeleteLocalFloat(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "EntranceExitX"; + float fEntranceExitX = GetLocalFloat(oSpawn, sSaveVarName); + DeleteLocalFloat(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "EntranceExitY"; + float fEntranceExitY = GetLocalFloat(oSpawn, sSaveVarName); + DeleteLocalFloat(oSpawn, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "LifeSpanExpireTime"; + iExpireTime = GetLocalInt(oSpawn, sSaveVarName); + DeleteLocalInt(oSpawn, sSaveVarName); + + if (! IsRestoreBlocked(oSpawn, lLastLocation, iExpireTime, nTimeNow)) + { + object oSpawned = CreateObject(nObjectType, sTemplate, lLastLocation); + + SpawnCountDebug(oSpawn, "restored " + sSaveVarNameBase + "object id: " + + ObjectToString(oSpawned)); + + lHome = Location(OBJECT_SELF, Vector(fHomeX, fHomeY, 0.), fSpawnFacing); + lEntranceExit = Location(OBJECT_SELF, Vector(fEntranceExitX, + fEntranceExitY, 0.), fSpawnFacing); + + RecordSpawned(oSpawn, oSpawned, lHome, lEntranceExit, fSpawnFacing); + SetupSpawned(oSpawn, oSpawned, lHome, nTimeNow, FALSE); + + // Lifespan expire time needs to be rewritten the the spawned object, + // since SetupSpawned generated a new one based on the current time... + SetLocalInt(oSpawned, "LifespanExpireTime", iExpireTime); + } + + else + { + SpawnCountDebug(oSpawn, "restore blocked: " + sSaveVarNameBase); + } + } + + int nNumSavedCampStates = GetLocalInt(oSpawn, "SpawnNumSavedCampStates"); + + // restore camps + for (i = 0; i < nNumSavedCampStates; i++) + { + int j; + int nCampNum = i + 1; + + string sSaveCampVarName = "SpawnedSaveCampState" + + IntToString(nCampNum); + object oCamp = GetLocalObject(oSpawn, sSaveCampVarName); + DeleteLocalObject(oSpawn, sSaveCampVarName); + + // respawn camp objects + //debug("restoring " + sSaveCampVarName); + nSpawnNumSavedStates = GetLocalInt(oCamp, "SpawnNumSavedStates"); + int nPlaceableCount = 0; + int nCreatureCount = 0; + for (j = 0; j < nSpawnNumSavedStates; j++) + { + nChildNum = j + 1; + sSaveVarNameBase = "SpawnedSaveState" + IntToString(nChildNum); + //debug("restoring " + sSaveVarNameBase); + + sSaveVarName = sSaveVarNameBase + "ObjectType"; + //debug("Getting objtype with var name " + sSaveVarName); + nObjectType = GetLocalInt(oCamp, sSaveVarName); + DeleteLocalInt(oCamp, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "Template"; + sTemplate = GetLocalString(oCamp, sSaveVarName); + //debug("template: " + sTemplate); + DeleteLocalString (oCamp, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "LastLocation"; + lLastLocation = GetLocalLocation(oCamp, sSaveVarName); + DeleteLocalLocation(oCamp, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "HomeX"; + fHomeX = GetLocalFloat(oCamp, sSaveVarName); + DeleteLocalFloat(oCamp, sSaveVarName); + + sSaveVarName = sSaveVarNameBase + "HomeY"; + fHomeY = GetLocalFloat(oCamp, sSaveVarName); + DeleteLocalFloat(oCamp, sSaveVarName); + lHome = Location(OBJECT_SELF, Vector(fHomeX, fHomeY, 0.), 0.); + + sSaveVarName = sSaveVarNameBase + "LifeSpanExpireTime"; + iExpireTime = GetLocalInt(oSpawn, sSaveVarName); + DeleteLocalInt(oSpawn, sSaveVarName); + + string sObject; + + if (nObjectType == OBJECT_TYPE_CREATURE) + { + sObject = "CampC" + IntToString(nCreatureCount++); + } + + else if (nObjectType == OBJECT_TYPE_PLACEABLE) + { + sObject = "CampP"+ IntToString(nPlaceableCount++); + } + + if (sTemplate != "") + { + if (! IsRestoreBlocked(oCamp, lLastLocation, iExpireTime, nTimeNow)) + { + oSpawned = CreateObject(nObjectType, sTemplate, lLastLocation); + + SetLocalObject(oCamp, sObject, oSpawned); + + vector vCamp = GetPositionFromLocation(GetLocation(oSpawn)); + string sFlags = GetLocalString(oCamp, sObject + "_Flags"); + + SetupCampSpawned(oSpawn, oSpawned, vCamp, lHome, sFlags); + + // Lifespan expire time needs to be rewritten the the spawned object, + // since SetupSpawned generated a new one based on the current time... + SetLocalInt(oSpawned, "LifespanExpireTime", iExpireTime); + + } + + else + { + SetLocalObject(oCamp, sObject, OBJECT_INVALID); + } + } + + else + { + SetLocalObject(oCamp, sObject, OBJECT_INVALID); + } + } + location lCampLocation = GetLocation(oSpawn); + float fCampFacing = GetFacing(oSpawn); + RecordSpawned(oSpawn, oCamp, lCampLocation, lCampLocation, fCampFacing); + } + + SetLocalInt(oSpawn, "SpawnNumSavedStates", 0); + SetLocalInt(oSpawn, "SpawnNumSavedCampStates", 0); +} + +// + +void RecordSpawned(object oSpawn, object oSpawned, location lHome, + location lEntranceExit, float fSpawnedFacing) +{ + int nChildrenSpawned; + int nSpawnCount; + int nChildSlot; + int nEmptyChildSlot; + object oChild; + string sChildSlot, sEmptyChildSlot; + + string sCustomFlag = GetLocalString(oSpawn, "f_CustomFlag"); + int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); + + // Assign Values to oSpawned + SetLocalObject(oSpawned, "ParentSpawn", oSpawn); + SetLocalFloat(oSpawned, "SpawnFacing", fSpawnedFacing); + SetLocalFloat(oSpawned, "HomeX", GetPositionFromLocation(lHome).x); + SetLocalFloat(oSpawned, "HomeY", GetPositionFromLocation(lHome).y); + SetLocalFloat(oSpawned, "EntranceExitX", GetPositionFromLocation(lEntranceExit).x); + SetLocalFloat(oSpawned, "EntranceExitY", GetPositionFromLocation(lEntranceExit).y); + SetLocalString(oSpawned, "CustomFlag", sCustomFlag); + + // Assign Values to oSpawn + nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned"); + nChildrenSpawned++; + SetLocalInt(oSpawn, "ChildrenSpawned", nChildrenSpawned); + nSpawnCount = GetLocalInt(oSpawn, "SpawnCount"); + nSpawnCount++; + SetLocalInt(oSpawn, "SpawnCount", nSpawnCount); + + // Find Empty Child Slot + nChildSlot = 1; + nEmptyChildSlot = 0; + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + + // Check if this is Child Slot is Valid + if (GetIsObjectValid(oChild) == FALSE || GetIsDead(oChild)) + { + // Empty Slot + if (nEmptyChildSlot == 0) + { + nEmptyChildSlot = nChildSlot; + sEmptyChildSlot = sChildSlot; + } + } + } + + // Assign Child Slot + SpawnCountDebug(oSpawn, "recorded spawn " + GetTag(oSpawned) + " (" + + ObjectToString(oSpawned) + ") as " + sEmptyChildSlot); + SetLocalObject(oSpawn, sEmptyChildSlot, oSpawned); + SetLocalString(oSpawned, "ParentChildSlot", sEmptyChildSlot); + object oIdiot = GetLocalObject(oSpawn, sEmptyChildSlot); + string sValid = GetIsObjectValid(oIdiot) ? "valid" : "invalid"; +} + +// + +// Returns 0 if no empty slots +int FindNextEmptyChildSlot(object oSpawn) +{ + int nChildSlot; + int nEmptyChildSlot; + object oChild; + string sChildSlot; + int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); + + nChildSlot = 1; + nEmptyChildSlot = 0; + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Retrieve Child + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oChild = GetLocalObject(oSpawn, sChildSlot); + + // Check if this is Child Slot is Valid + if (GetIsObjectValid(oChild) == FALSE || GetIsDead(oChild)) + { + // Empty Slot + nEmptyChildSlot = nChildSlot; + break; + + } + } + + return nEmptyChildSlot; +} + +void SetupSpawned(object oSpawn, object oSpawned, location lHome, + int nTimeNow, int nWalkToHome = FALSE) +{ + object oFaction; + int nChildLifespanExpireTime; + int nGoldAmount; + effect eObject; + + int nSpawnFaction = GetLocalInt(oSpawn, "f_SpawnFaction"); + int nSpawnSit = GetLocalInt(oSpawn, "f_SpawnSit"); + int nSpawnPlot = GetLocalInt(oSpawn, "f_SpawnPlot"); + int nSpawnAlignment = GetLocalInt(oSpawn, "f_SpawnAlignment"); + int nAlignmentShift = GetLocalInt(oSpawn, "f_AlignmentShift"); + int nChildLifespanMax = GetLocalInt(oSpawn, "f_ChildLifespanMax"); + int nChildLifespanMin = GetLocalInt(oSpawn, "f_ChildLifespanMin"); + int nRandomGold = GetLocalInt(oSpawn, "f_RandomGold"); + int nRandomGoldMin = GetLocalInt(oSpawn, "f_RandomGoldMin"); + int nGoldChance = GetLocalInt(oSpawn, "f_GoldChance"); + int nLootTable = GetLocalInt(oSpawn, "f_LootTable"); + int nTrapDisabled = GetLocalInt(oSpawn, "f_TrapDisabled"); + float fCorpseDecay = GetLocalFloat(oSpawn, "f_CorpseDecay"); + int nCorpseDecayType = GetLocalInt(oSpawn, "f_CorpseDecayType"); + int bDropWielded = GetLocalInt(oSpawn, "f_CorpseDropWielded"); + int bDeleteLootOnDecay = GetLocalInt(oSpawn, "f_CorpseDeleteLootOnDecay"); + string sCorpseRemainsResRef = GetLocalString(oSpawn, "f_CorpseRemainsResRef"); + int nDeathScript = GetLocalInt(oSpawn, "f_DeathScript"); + int nSpawnScript = GetLocalInt(oSpawn, "f_SpawnScript"); + int nSpawnAreaEffect = GetLocalInt(oSpawn, "f_SpawnAreaEffect"); + float fAreaEffectDuration = GetLocalFloat(oSpawn, "f_AreaEffectDuration"); + int nObjectEffect = GetLocalInt(oSpawn, "f_ObjectEffect"); + float fObjectEffectDuration = GetLocalFloat(oSpawn, "f_ObjectEffectDuration"); + string sSpawnTag = GetLocalString(oSpawn, "f_Template"); + int nPatrolRoute = GetLocalInt(oSpawn, "f_PatrolRoute"); + int nPatrolStartAtClosest = GetLocalInt(oSpawn, "f_PatrolStartAtClosest"); + int nRouteType = GetLocalInt(oSpawn, "f_RouteType"); + int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk"); + float fWanderRange = GetLocalFloat(oSpawn, "f_WanderRange"); + int nSuppressLooting = GetLocalInt(oSpawn, "f_SuppressLooting"); + int nSubdualMode = GetLocalInt(oSpawn, "f_SubdualMode"); + int nEncounterLevel = GetLocalInt(oSpawn, "f_EncounterLevel"); + + + if (nWalkToHome) + { + AssignCommand(oSpawned, ActionMoveToLocation(lHome)); + } + + // Spawn it in with the right facing, and you don't need this; and + // then it works for placeables as well! + // AssignCommand(oSpawned, ActionDoCommand(SetFacing(fSpawnedFacing))); + + // Set up SpawnPlot + if (nSpawnPlot == TRUE) + { + SetPlotFlag(oSpawned, TRUE); + } + + // Set up Faction + if (nSpawnFaction > -1) + { + switch (nSpawnFaction) + { + case 0: + ChangeToStandardFaction(oSpawned, STANDARD_FACTION_COMMONER); + break; + case 1: + ChangeToStandardFaction(oSpawned, STANDARD_FACTION_DEFENDER); + break; + case 2: + ChangeToStandardFaction(oSpawned, STANDARD_FACTION_MERCHANT); + break; + case 3: + ChangeToStandardFaction(oSpawned, STANDARD_FACTION_HOSTILE); + break; + case 4: + oFaction = GetNearestObjectByTag("SpawnFaction", oSpawned); + if (oFaction != OBJECT_INVALID) + { + ChangeFaction(oSpawned, oFaction); + } + break; + } + } + + // Set up Alignment + if (nSpawnAlignment > -1) + { + switch (nSpawnAlignment) + { + case 0: + AdjustAlignment(oSpawned, ALIGNMENT_NEUTRAL, nAlignmentShift); + break; + case 1: + AdjustAlignment(oSpawned, ALIGNMENT_LAWFUL, nAlignmentShift); + break; + case 2: + AdjustAlignment(oSpawned, ALIGNMENT_CHAOTIC, nAlignmentShift); + break; + case 3: + AdjustAlignment(oSpawned, ALIGNMENT_GOOD, nAlignmentShift); + break; + case 4: + AdjustAlignment(oSpawned, ALIGNMENT_EVIL, nAlignmentShift); + break; + case 5: + AdjustAlignment(oSpawned, ALIGNMENT_ALL, nAlignmentShift); + break; + } + } + + // Set up Lifespan + if (nChildLifespanMax > -1) + { + if (nChildLifespanMin > -1) + { + nChildLifespanExpireTime = -1; + while (nChildLifespanExpireTime < nChildLifespanMin) + { + nChildLifespanExpireTime = nTimeNow + Random(nChildLifespanMax) + 1; + } + } + else + { + nChildLifespanExpireTime = nTimeNow + nChildLifespanMax; + } + SetLocalInt(oSpawned, "LifespanExpireTime", nChildLifespanExpireTime); + } + + // Give Creature Loot + if (nLootTable > -1) + { + DelayCommand(1.0, LootTable(oSpawn, oSpawned, nLootTable)); + } + + // Give RandomGold + if (nRandomGold > 0) + { + // One in Four Creatures give Gold + if (d100(1) <= nGoldChance) + { + // Calculate Gold to Drop + nGoldAmount = Random(nRandomGold + 1); + while (nGoldAmount < nRandomGoldMin) + { + nGoldAmount = Random(nRandomGold + 1); + } + + // Give Gold + CreateItemOnObject("nw_it_gold001", oSpawned, nGoldAmount); + } + } + + // Set up Trap on Placeable + if (GetIsTrapped(oSpawned)) + { + if (d100(1) <= nTrapDisabled) + { + SetTrapDisabled(oSpawned); + } + } + + // Set up Corpse Decay + if (fCorpseDecay > 0.0) + { + SetLocalFloat(oSpawned, "CorpseDecay", fCorpseDecay); + SetLocalInt(oSpawned, "CorpseDecayType", nCorpseDecayType); + SetLocalString(oSpawned, "CorpseRemainsResRef", sCorpseRemainsResRef); + SetLocalInt(oSpawned, "CorpseDropWielded", bDropWielded); + SetLocalInt(oSpawned, "CorpseDeleteLootOnDecay", bDeleteLootOnDecay); + AssignCommand(oSpawned, SetIsDestroyable(FALSE, FALSE, FALSE)); + } + + // Set up Death Script + if (nDeathScript > -1) + { + AssignCommand(oSpawned, SetIsDestroyable(FALSE, FALSE, FALSE)); + } + + // Set up Object Effects + if (nObjectEffect > 0) + { + eObject = ObjectEffect(oSpawn); + if (fObjectEffectDuration == -1.0) + { + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eObject, oSpawned, 0.0); + } + else + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eObject, oSpawned, fObjectEffectDuration); + } + } + + // Set up Area Effect + if (nSpawnAreaEffect > 0 && sSpawnTag == "AE" && fAreaEffectDuration > 0.0) + { + DestroyObject(oSpawned, fAreaEffectDuration); + } + + // Run the Spawn Script + if (nSpawnScript > -1) + { + SetLocalInt(oSpawned, "SpawnScript", nSpawnScript); + ExecuteScript("spawn_sc_spawn", oSpawned); + } + + // Set up Random Walking + if (nRandomWalk == TRUE) + { + if (fWanderRange > 0.0) + { + AssignCommand(oSpawned, RandomWalk(oSpawn, fWanderRange, FALSE)); + } + else + { + AssignCommand(oSpawned, ActionRandomWalk()); + } + } + + // Set up the Patrol Route + if (nPatrolRoute > -1) + { + AssignCommand(oSpawned, SetPatrolRoute(nPatrolRoute, + nPatrolStartAtClosest)); + AssignCommand(oSpawned, DoPatrolRoute(nPatrolRoute, nRouteType)); + } + + // Set up Spawn Sit + if (nSpawnSit == TRUE) + { + FindSeat(oSpawn, oSpawned); + } + + // Set up loot suppression + if (nSuppressLooting) + { + SetLocalInt(oSpawned, "DoNotLoot", TRUE); + } + + // Set up subdual mode + if (nSubdualMode) + { + SetLocalInt(oSpawned, "SubdualMode", TRUE); + } + + // Set up encounter level + if (nEncounterLevel > 0) + { + SetLocalInt(oSpawned, "AlfaEncounterLevel", nEncounterLevel); + } + + SetupCustomFlags(oSpawn, oSpawned); +} + +// + +void SetupCampSpawned(object oSpawn, object oSpawned, vector vCampPosition, + location lHome, string sFlags) +{ + //debug("in setupCampSpawned"); + + // This is the closest we get to an "InitFlags" call for camp creatures + // write the flags onto the spawned creature + SetLocalString(oSpawned, "CreatureFlags", sFlags); + int nSpawnFacing = IsFlagPresent(sFlags, "SF"); + int nLootTable = GetFlagValue(sFlags, "LT", -1); + int nTrapDisabled = GetSubFlagValue(sFlags, "PL", "T", 100); + int nRandomWalk = IsFlagPresent(sFlags, "RW"); + SetLocalInt(oSpawned, "f_RandomWalk", nRandomWalk); + + float fCorpseDecay = IntToFloat(GetFlagValue(sFlags, "CD", 0)); + int nCorpseDecayType = GetSubFlagValue(sFlags, "CD", "T", 0); + int nCorpseRemainsType = GetSubFlagValue(sFlags, "CD", "R", 0); + int bDropWielded = IsSubFlagPresent(sFlags, "CD", "D"); + + int nDeathScript = GetFlagValue(sFlags, "DT", -1); + int nReturnHome = IsFlagPresent(sFlags, "RH"); + SetLocalInt(oSpawned, "f_ReturnHome", nReturnHome); + + + if (nReturnHome) + { + int dfReturnHomeRange = GetLocalInt(GetModule(), "df_ReturnHomeRange"); + float fReturnHomeRange = IntToFloat(GetFlagValue(sFlags, "RH", + dfReturnHomeRange)); + SetLocalFloat(oSpawned, "f_ReturnHomeRange", fReturnHomeRange); + SetLocalFloat(oSpawned, "HomeX", GetPositionFromLocation(lHome).x); + SetLocalFloat(oSpawned, "HomeY", GetPositionFromLocation(lHome).y); + } + + // Spawn Facing + if (nSpawnFacing == TRUE) + { + AssignCommand(oSpawned, SetFacingPoint(vCampPosition)); + } + else + { + AssignCommand(oSpawned, SetFacing(IntToFloat(Random(360)))); + } + + // Loot Table + if (nLootTable > -1) + { + LootTable(oSpawn, oSpawned, nLootTable); + } + + // Trap Disabled + if (GetIsTrapped(oSpawned)) + { + if (d100(1) <= nTrapDisabled) + { + SetTrapDisabled(oSpawned); + } + } + + // RandomWalk + if (nRandomWalk == TRUE) + { + AssignCommand(oSpawned, ActionRandomWalk()); + } + + // Corpse Decay + if (fCorpseDecay > 0.0) + { + string sCorpseRemainsResRef; + int bDeleteLootOnDecay = FALSE; + + switch (nCorpseRemainsType) + { + case 0: sCorpseRemainsResRef = "invis_corpse_obj"; break; + case 1: sCorpseRemainsResRef = "invis_corpse_bdy"; break; + case 2: sCorpseRemainsResRef = "invis_corpse_bon"; break; + case 3: sCorpseRemainsResRef = "invis_corpse_pot"; break; + case 4: sCorpseRemainsResRef = "invis_corpse_pch"; break; + case 5: sCorpseRemainsResRef = "invis_corpse_scr"; break; + case 6: sCorpseRemainsResRef = "invis_corpse_tre"; break; + case 7: + sCorpseRemainsResRef = "invis_corpse_obj"; + bDeleteLootOnDecay = TRUE; + break; + } + + // Record CorpseDecay + SetLocalString(oSpawned, "CorpseRemainsResRef", sCorpseRemainsResRef); + SetLocalInt(oSpawned, "CorpseDropWielded", bDropWielded); + SetLocalInt(oSpawned, "CorpseDeleteLootOnDecay", bDeleteLootOnDecay); + SetLocalFloat(oSpawned, "CorpseDecay", fCorpseDecay); + SetLocalInt(oSpawned, "CorpseDecayType", nCorpseDecayType); + AssignCommand(oSpawned, SetIsDestroyable(FALSE, FALSE, FALSE)); + } + + // Death Script + if (nDeathScript > -1) + { + AssignCommand(oSpawned, SetIsDestroyable(FALSE, FALSE, FALSE)); + } +} + +int SetupSpawnDelay(int nSpawnDelay, int nDelayRandom, int nDelayMinimum, + int nTimeNow) +{ + int nNextSpawnTime; + + if (nDelayRandom == TRUE) + { + // Setup Next Spawn Randomly + nNextSpawnTime = Random(nSpawnDelay) + 1; + while (nNextSpawnTime < nDelayMinimum) + { + nNextSpawnTime = Random(nSpawnDelay) + 1; + } + nNextSpawnTime += nTimeNow; + } + else + { + // Setup Next Spawn + nNextSpawnTime = nTimeNow + nSpawnDelay; + } + return nNextSpawnTime; +} + +int IsRestoreBlocked(object oSpawn, location lChildLoc, int iExpireTime, + int nTimeNow) +{ + int nSpawnBlock = FALSE; + + // Initialize Day/Night Only + int nDayOnly = GetLocalInt(oSpawn, "f_DayOnly"); + int nDayOnlyDespawn = GetLocalInt(oSpawn, "f_DayOnlyDespawn"); + int nNightOnly = GetLocalInt(oSpawn, "f_NightOnly"); + int nNightOnlyDespawn = GetLocalInt(oSpawn, "f_NightOnlyDespawn"); + + // Initialize Day/Hour Spawns + int nDay, nHour; + int nSpawnDayStart = GetLocalInt(oSpawn, "f_SpawnDayStart"); + int nSpawnDayEnd = GetLocalInt(oSpawn, "f_SpawnDayEnd"); + int nSpawnHourStart = GetLocalInt(oSpawn, "f_SpawnHourStart"); + int nSpawnHourEnd = GetLocalInt(oSpawn, "f_SpawnHourEnd"); + + // Initialize Child Lifespan + int nChildLifespanMax = GetLocalInt(oSpawn, "f_ChildLifespanMax"); + + // Initialize SpawnUnseen + float fSpawnUnseen = GetLocalFloat(oSpawn, "f_SpawnUnseen"); + int nUnseenIndividual = GetLocalInt(oSpawn, "f_UnseenIndividual"); + + + // Check Against Spawn Unseen (_SUnn|I_) + if (fSpawnUnseen > 0.0) + { + if (nUnseenIndividual) + { + vector vChildPos = GetPositionFromLocation(lChildLoc); + + if (CheckPositionUnseen(vChildPos, fSpawnUnseen) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + else + { + vector vSpawnPos = GetPositionFromLocation(GetLocation(oSpawn)); + + if (CheckPositionUnseen(vSpawnPos, fSpawnUnseen) == FALSE) + { + nSpawnBlock = TRUE; + } + } + } + + // Check Against Night Only. Since this is a restore of something already + // spawned, it should only be blocked if despawn has been specified for the + // creature (_NOD_) + if (nNightOnly && nNightOnlyDespawn) + { + if (GetIsDay() || GetIsDawn()) + { + nSpawnBlock = TRUE; + } + } + + // Check Against Day Only (_DOD_) + if (nDayOnly && nDayOnlyDespawn) + { + if (GetIsDay() == FALSE && GetIsDawn() == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Against Specific Day(s) (_DYnn_) + if (nSpawnDayStart > -1) + { + nDay = GetCalendarDay(); + if (IsBetweenDays(nDay, nSpawnDayStart, nSpawnDayEnd) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Against Specific Hour(s) (_HRnn_) + if (nSpawnHourStart > -1) + { + nHour = GetTimeHour(); + if (IsBetweenHours(nHour, nSpawnHourStart, nSpawnHourEnd) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Lifespan (_CLnn_) + if (nChildLifespanMax > -1) + { + if (nTimeNow >= iExpireTime) + { + //debug("restore: lifespawn exceeded"); + nSpawnBlock = TRUE; + } + } + + return nSpawnBlock; +} + +int NeedPseudoHeartbeat( object oArea ) +{ + int bPCsInArea = GetLocalInt( oArea, SPAWN_PCS_IN_AREA ); + int nAreaSpawnCount = GetLocalInt( oArea, SPAWN_AREA_COUNT ); + int bHeartbeatScheduled = GetLocalInt( oArea, SPAWN_HEARTBEAT_SCHEDULED ); + int bLeftoversForceProcessing = GetLocalInt( GetModule(), + "LeftoversForceProcessing"); + + // Do a heartbeat if there are PCs in the area or any spawns up, and we + // don't already have a heartbeat scheduled + + if (bLeftoversForceProcessing) + { + return ( (bPCsInArea || nAreaSpawnCount) && ! bHeartbeatScheduled ); + } + + return ( bPCsInArea && ! bHeartbeatScheduled ); +} + +void Spawn_OnAreaEnter( string sHeartbeatScript = "spawn_sample_hb", + float fHeartbeatInterval = 6.0, float fFirstDelay = 0.0 ) +{ + object oPC = GetEnteringObject(); + object oArea = OBJECT_SELF; + + SetLocalString( oArea, SPAWN_HEARTBEAT_SCRIPT, sHeartbeatScript ); + SetLocalFloat( oArea, SPAWN_INTERVAL, fHeartbeatInterval ); + + if ( GetIsPC( oPC ) ) + { + SetLocalInt(oPC, "NESS_Player", TRUE); + int nPCsInArea = GetLocalInt( oArea, SPAWN_PCS_IN_AREA ); + int nAreaSpawnCount = GetLocalInt( oArea, SPAWN_AREA_COUNT ); + + nPCsInArea++; + SetLocalInt( oArea, SPAWN_PCS_IN_AREA, nPCsInArea ); + + if ( NeedPseudoHeartbeat( oArea ) ) + { + if ( fFirstDelay > 0.0 ) + { + DelayCommand( fFirstDelay, ExecuteScript( "spawn_pseudohb", oArea ) ); + } + + else + { + ExecuteScript( "spawn_pseudohb", oArea ); + } + } + } +} + +void Spawn_OnAreaExit() +{ + object oPC = GetExitingObject(); + object oArea = OBJECT_SELF; + int bIsPC = GetLocalInt(oPC, "NESS_Player"); + + if ( bIsPC ) + { + int nPCsInArea = GetLocalInt( oArea, SPAWN_PCS_IN_AREA ); + nPCsInArea--; + SetLocalInt( oArea, SPAWN_PCS_IN_AREA, nPCsInArea ); + } +} + +void ScheduleNextPseudoHeartbeat( object oArea ) +{ + float fInterval = GetLocalFloat( oArea, SPAWN_INTERVAL ); + + if ( fInterval == 0.0 ) + { + fInterval = 6.0; + } + + DelayCommand( fInterval, ExecuteScript( "spawn_pseudohb", oArea ) ); + SetLocalInt( oArea, SPAWN_HEARTBEAT_SCHEDULED, TRUE ); +} \ No newline at end of file diff --git a/nwnds_module/spawn_main.nss b/nwnds_module/spawn_main.nss new file mode 100644 index 000000000..cc33d595d --- /dev/null +++ b/nwnds_module/spawn_main.nss @@ -0,0 +1,1899 @@ +// +// +// NESS +// Spawn Main v8.1.3 +// +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// + +// Function Includes +#include "spawn_functions" + +// + +// Configuration Includes +#include "spawn_cfg_flag" +#include "spawn_cfg_group" +#include "spawn_cfg_global" +#include "spawn_cfg_loot" +#include "spawn_cfg_camp" +#include "spawn_cfg_fxsp" +#include "spawn_cfg_fxae" +#include "spawn_cfg_fxobj" +// + +// Check Includes +#include "spawn_chk_pcs" +#include "spawn_chk_custom" +// + +// Declare external functions +int GetCurrentRealSeconds(); + +// Declare Function Includes +void SetGlobalDefaults(); +int SetSpawns(location lBase); +string PadIntToString(int nInt, int nDigits); +int CountPCsInArea(object oArea = OBJECT_INVALID, int nDM = FALSE); +int CountPCsInRadius(location lCenter, float fRadius, int nDM = FALSE); +object GetRandomPCInArea(object oArea, object oSpawn); +int IsBetweenDays(int nCheckDay, int nDayStart, int nDayEnd); +int IsBetweenHours(int nCheckHour, int nHourStart, int nHourEnd); +void RandomWalk(object oSpawn, float fWalkingRadius, int nRun); +void FindSeat(object oSpawn, object oSpawned); +void SetPatrolRoute(int nPatrolRoute, int nStartClosest=FALSE); +void DoPatrolRoute(int nPatrolRoute, int nRouteType); +int ProcessCamp(object oCamp); +void DestroyCamp(object oCamp, float fCampDecay, int nSaveState); +// + +// Declare Configuration Includes +void LootTable(object oSpawn, object oSpawned, int nLootTable); +string SpawnGroup(object oSpawn, string sTemplate); +int SpawnCheckCustom(object oSpawn); +int SpawnCheckPCs(object oSpawn); +effect SpawnAreaEffect(object oSpawn); +effect ObjectEffect(object oSpawn); +int SpawnEffect(object oSpawn, int nSpawnEffect, int nDespawnEffect); +void SetCampSpawn(object oCamp, string sCamp, location lCamp); +// + +//Declare Functions we Define after Main Function +void ProcessSpawn(object oSpawn, int nProcessFrequency, int nPCCount, int nTimeNow, + int nWaypointCount); +void DoSpawn(object oSpawn, int nTimeNow); +object CampSpawn(object oSpawn, string sCamp, location lCamp); +object DoCampSpawn(object oCamp, location lCamp, float fSpawnRadius, + string sTemplate, int nPlaceable, int nSpawnNumber, int nCampCenter); + +// + +// The Spawn Function +void Spawn() +{ + // Declare Variables + object oSpawn; + string sSpawnName, sSpawnNum; + int nSpawnDeactivated; + int nProcessSpawn; + int nCurrentProcessTick; + int nProcessFrequency; + int nProcessOffset; + int nNth; + + SPAWN_DELAY_DEBUG = GetLocalInt(OBJECT_SELF, "SpawnDelayDebug"); + SPAWN_COUNT_DEBUG = GetLocalInt(OBJECT_SELF, "SpawnCountDebug"); + + int bAreaInitialized = GetLocalInt(OBJECT_SELF, "NESS_AreaInitialized"); + + if (! bAreaInitialized) + { + + // Set Global Defaults + SetGlobalDefaults(); + + // Set Spawns + location lBase = Location(OBJECT_SELF, Vector(), 0.0); + SetSpawns(lBase); + SetLocalInt(OBJECT_SELF, SPAWN_AREA_COUNT, 0); + SetLocalInt(OBJECT_SELF, "NESS_AreaInitialized", TRUE); + + // Recall ourselves after flags have been initialized + DelayCommand(0.1, Spawn()); + return; + } + + // Check Area State + if (GetLocalInt(OBJECT_SELF, "AreaSpawnsDeactivated") == TRUE) + { + return; + } + + int nPCCount = CountPCsInArea(OBJECT_SELF, TRUE); + + int nAreaSpawnCount = GetLocalInt(OBJECT_SELF, SPAWN_AREA_COUNT ); + int bLeftoversForceProcessing = GetLocalInt( GetModule(), + "LeftoversForceProcessing"); + + if (nPCCount == 0 && (nAreaSpawnCount == 0 || ! bLeftoversForceProcessing)) + { + return; + } + + int nSpawns = GetLocalInt(OBJECT_SELF, "Spawns"); + int nNewAreaSpawnCount = 0; + + // What time is it? Used to compare all times + int nTimeNow = GetCurrentRealSeconds(); + + // Enumerate Waypoints in the Area + for (nNth = 1; nNth <= nSpawns; nNth++) + { + // Retrieve Spawn + sSpawnNum = "Spawn" + PadIntToString(nNth, 2); + oSpawn = GetLocalObject(OBJECT_SELF, sSpawnNum); + + // Validate spawn + if (! GetIsObjectValid( oSpawn ) ) + { + continue; + } + sSpawnName = GetLocalString(oSpawn, "f_Flags"); + + // Check for spawns that need to be processed because they despawned + // due to a PCxx flag and PCs have returned + if (nPCCount > 0) + { + int nSpawnNumSaveStates = GetLocalInt(oSpawn, "SpawnNumSavedStates"); + int nSpawnNumSaveCampStates = GetLocalInt(oSpawn, "SpawnNumSavedCampStates"); + if (nSpawnNumSaveStates > 0 || nSpawnNumSaveCampStates > 0) + { + //debug("forcing respawns"); + RestorePCDespawns(oSpawn, nTimeNow); + NESS_ForceProcess(oSpawn); + } + } + + // Only Process every nProcessFrequency Seconds + nProcessSpawn = FALSE; + nProcessFrequency = GetLocalInt(oSpawn, "f_ProcessFrequency"); + nProcessOffset = GetLocalInt(oSpawn, "f_ProcessOffset"); + nCurrentProcessTick = GetLocalInt(oSpawn, "CurrentProcessTick"); + + if (nProcessFrequency == 1) + { + // Don't even need to bother with CurrentProcessTick or offset + nProcessSpawn = TRUE; + } + + else if (nCurrentProcessTick == 0) + { + // First time in. Always process the first time + nProcessSpawn = TRUE; + SetLocalInt(oSpawn, "CurrentProcessTick", 2-nProcessOffset); + //debug("Tick 1"); + //debug("+"); + } + + else + { + int nForceProcess = GetLocalInt(oSpawn, "SpawnForceProcess"); + if (nForceProcess) + { + SetLocalInt(oSpawn, "SpawnForceProcess", FALSE); + } + + if (nCurrentProcessTick > nProcessFrequency) + { + // Roll over Counter Tick + nCurrentProcessTick = 1; + //debug("Tick " + IntToString(nCurrentProcessTick)); + //debug("+"); + + nProcessSpawn = TRUE; + } + + else + { + //debug("Tick " + IntToString(nCurrentProcessTick)); + + if (nForceProcess) + { + //debug("+ (forced)"); + nProcessSpawn = TRUE; + } + + } + // Increment Counter Tick + nCurrentProcessTick++; + SetLocalInt(oSpawn, "CurrentProcessTick", nCurrentProcessTick); + } + + // Check if Deactivated + nSpawnDeactivated = GetLocalInt(oSpawn, "SpawnDeactivated"); + if (nSpawnDeactivated == TRUE) + { + nProcessSpawn = FALSE; + } + + // Process the Spawn + if (nProcessSpawn == TRUE) + { + DelayCommand(0.0, ProcessSpawn(oSpawn, nProcessFrequency, + nPCCount, nTimeNow, nNth)); + } + + nNewAreaSpawnCount += GetLocalInt(oSpawn, "SpawnCount"); + } + + // Do spawn tracking + int nTrackModuleSpawns = GetLocalInt(GetModule(), "TrackModuleSpawns"); + + SetLocalInt(OBJECT_SELF, SPAWN_AREA_COUNT, nNewAreaSpawnCount); + + // call with old count + TrackModuleSpawns(nAreaSpawnCount, nTrackModuleSpawns); + + // Do Spawn dumping + int nDumpModuleSpawns = GetLocalInt(GetModule(), "DumpModuleSpawns"); + if (nDumpModuleSpawns) + { + DumpModuleSpawns(); + } +} +// + +// This Function Processes a Spawn +void ProcessSpawn(object oSpawn, int nProcessFrequency, int nPCCount, + int nTimeNow, int nWaypoint) +{ + // Initialize Miscellaneous + int iCount; + int jCount; + + // Initialize Spawn and Spawned + object oCreature, oChild; + int nSpawnChild, nSpawnCount, nCurrentChildren; + int nChildSlot, nEmptyChildSlots; + string sChildSlot, sChild; + int nSpawnBlock, nSpawnDespawn, nDespawning; + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + string sSpawnTag = GetLocalString(oSpawn, "f_Template"); + location lSpawn = GetLocation(oSpawn); + int nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned"); + int nProcessesPerMinute = 60 / (nProcessFrequency * 6); + + // Get New Name and Tag + sSpawnName = GetLocalString(oSpawn, "f_Flags"); + sSpawnTag = GetLocalString(oSpawn, "f_Template"); + + // Initialize InitialState + int nInitialState = GetLocalInt(oSpawn, "f_InitialState"); + int nInitialDelay = GetLocalInt(oSpawn, "f_InitialDelay"); + int nNextSpawnTime = GetLocalInt(oSpawn, "NextSpawnTime"); + + // Set Initial Delay + if (nInitialDelay > 0) + { + if (GetLocalInt(oSpawn, "InitialDelaySet") == FALSE) + { + nNextSpawnTime = nTimeNow + nInitialDelay; + SpawnDelayDebug(oSpawn, "setting NextSpawnTime for initial delay " + + IntToString(nNextSpawnTime) + " [" + RealSecondsToString(nNextSpawnTime) + + "]"); + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + SetLocalInt(oSpawn, "InitialDelaySet", TRUE); + } + } + + // Initialize SpawnDelay + int nSpawnDelay = GetLocalInt(oSpawn, "f_SpawnDelay"); + int nDelayRandom = GetLocalInt(oSpawn, "f_DelayRandom"); + int nDelayMinimum = GetLocalInt(oSpawn, "f_DelayMinimum"); + int nSpawnDelayPeriodic = GetLocalInt(oSpawn, "f_SpawnDelayPeriodic"); + + // Initialize SpawnNumber + int nRndSpawnNumber; + int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); + int nSpawnNumberMax = GetLocalInt(oSpawn, "f_SpawnNumberMax"); + int nSpawnNumberMin = GetLocalInt(oSpawn, "f_SpawnNumberMin"); + int nSpawnAllAtOnce = GetLocalInt(oSpawn, "f_SpawnAllAtOnce"); + int nSpawnNumberAtOnce = GetLocalInt(oSpawn, "f_SpawnNumberAtOnce"); + int nSpawnNumberAtOnceMin = GetLocalInt(oSpawn, "f_SpawnNumberAtOnceMin"); + + // Initialize Day/Night Only + int nDayOnly = GetLocalInt(oSpawn, "f_DayOnly"); + int nDayOnlyDespawn = GetLocalInt(oSpawn, "f_DayOnlyDespawn"); + int nNightOnly = GetLocalInt(oSpawn, "f_NightOnly"); + int nNightOnlyDespawn = GetLocalInt(oSpawn, "f_NightOnlyDespawn"); + + // Initialize Day/Hour Spawns + int nDay, nHour; + int nSpawnDayStart = GetLocalInt(oSpawn, "f_SpawnDayStart"); + int nSpawnDayEnd = GetLocalInt(oSpawn, "f_SpawnDayEnd"); + int nSpawnHourStart = GetLocalInt(oSpawn, "f_SpawnHourStart"); + int nSpawnHourEnd = GetLocalInt(oSpawn, "f_SpawnHourEnd"); + + // Initialize RandomWalk + int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk"); + float fWanderRange = GetLocalFloat(oSpawn, "f_WanderRange"); + + // Initialize ReturnHome + int nReturnHome = GetLocalInt(oSpawn, "f_ReturnHome"); + float fReturnHomeRange = GetLocalFloat(oSpawn, "f_ReturnHomeRange"); + + // Initialize PCCheck + int nPCCheck = GetLocalInt(oSpawn, "f_PCCheck"); + int nPCCheckDelay = GetLocalInt(oSpawn, "f_PCCheckDelay"); + int nPCReset = GetLocalInt(oSpawn, "f_PCReset"); + + // Initialize RandomGold + int nGoldAmount; + int nRandomGold = GetLocalInt(oSpawn, "f_RandomGold"); + int nRandomGoldMin = GetLocalInt(oSpawn, "f_RandomGoldMin"); + int nGoldChance = GetLocalInt(oSpawn, "f_GoldChance"); + + // Initialize Spawn Effects + effect sSpawn, eDespawn; + int nSpawnEffect = GetLocalInt(oSpawn, "f_SpawnEffect"); + int nDespawnEffect = GetLocalInt(oSpawn, "f_DespawnEffect"); + + // Initialize Patrol Routes + int nPatrolScriptRunning; + int nPatrolRoute = GetLocalInt(oSpawn, "f_PatrolRoute"); + int nRouteType = GetLocalInt(oSpawn, "f_RouteType"); + int bCheckForStuckPatrols; + if (nPatrolRoute) + { + bCheckForStuckPatrols = GetLocalInt(GetModule(), "CheckForStuckPatrols"); + } + + // Initialize Placeables + int nLootTime; + int nRefreshTime; + int nPlaceable = GetLocalInt(oSpawn, "f_Placeable"); + int nPlaceableType = GetLocalInt(oSpawn, "f_PlaceableType"); + int nTrapDisabled = GetLocalInt(oSpawn, "f_TrapDisabled"); + int nPlaceableRefreshPeriod = GetLocalInt(oSpawn, "f_PlaceableRefreshPeriod"); + + // Initialize SpawnGroups + int nSpawnGroup = GetLocalInt(oSpawn, "f_SpawnGroup"); + + // Initialize LootTable + int nLootTable = GetLocalInt(oSpawn, "f_LootTable"); + + // Initialize Spawn Deactivation + int nSpawnDeactivated, nRunDeactivateScript, nSpawnAgeTime; + int nDeactivateSpawn = GetLocalInt(oSpawn, "f_DeactivateSpawn"); + int nDeactivateScript = GetLocalInt(oSpawn, "f_DeactivateScript"); + int nDeactivationInfo = GetLocalInt(oSpawn, "f_DeactivationInfo"); + int nForceDeactivateSpawn = GetLocalInt(oSpawn, "ForceDeactivateSpawn"); + + // Initialize Child Lifespan + int nChildLifespanExpireTime; + int nChildLifespanMax = GetLocalInt(oSpawn, "f_ChildLifespanMax"); + int nChildLifespanMin = GetLocalInt(oSpawn, "f_ChildLifespanMin"); + + // Initialize SpawnRadius + float fSpawnRadius = GetLocalFloat(oSpawn, "f_SpawnRadius"); + float fSpawnRadiusMin = GetLocalFloat(oSpawn, "f_SpawnRadiusMin"); + int nSpawnNearPCs = GetLocalInt(oSpawn, "f_SpawnNearPCs"); + + // Initialize SpawnUnseen + float fSpawnUnseen = GetLocalFloat(oSpawn, "f_SpawnUnseen"); + int nUnseenIndividual = GetLocalInt(oSpawn, "f_UnseenIndividual"); + int nUnseenRetryCount = GetLocalInt(oSpawn, "f_UnseenRetryCount"); + + // Initialize CorpseDecay + float fCorpseDecay = GetLocalFloat(oSpawn, "f_CorpseDecay"); + + // Initialize SpawnCamp + int nSpawnCamp = GetLocalInt(oSpawn, "f_SpawnCamp"); + float fCampDecay = GetLocalFloat(oSpawn, "f_CampDecay"); + + // Initialize SpawnScripts + int nSpawnScript = GetLocalInt(oSpawn, "f_SpawnScript"); + int nDespawnScript = GetLocalInt(oSpawn, "f_DespawnScript"); + + // Initialize SpawnCheckCustom + int nSpawnCheckCustom = GetLocalInt(oSpawn, "f_SpawnCheckCustom"); + + // Initialize SpawnCheckPCs + int nSpawnCheckPCs = GetLocalInt(oSpawn, "f_SpawnCheckPCs"); + + // Intialize SpawnTrigger + float fSpawnTrigger = GetLocalFloat(oSpawn, "f_SpawnTrigger"); + float fDespawnTrigger = GetLocalFloat(oSpawn, "f_DespawnTrigger"); + + // Initialize AreaEffect + int nSpawnAreaEffect = GetLocalInt(oSpawn, "f_SpawnAreaEffect"); + float fAreaEffectDuration = GetLocalFloat(oSpawn, "f_AreaEffectDuration"); + + // Initialize ObjectEffect + int nObjectEffect = GetLocalInt(oSpawn, "f_ObjectEffect"); + float fObjectEffectDuration = GetLocalFloat(oSpawn, "f_ObjectEffectDuration"); + + // Initialize RandomSpawn + int nRandomSpawn = GetLocalInt(oSpawn, "f_RandomSpawn"); + + // Initialize SpawnFaction + int nSpawnFaction = GetLocalInt(oSpawn, "f_SpawnFaction"); + + // Initialize SpawnAlignment + int nSpawnAlignment = GetLocalInt(oSpawn, "f_SpawnAlignment"); + int nAlignmentShift = GetLocalInt(oSpawn, "f_AlignmentShift"); + + // Initialize Heartbeat Script + int nHeartbeatScript = GetLocalInt(oSpawn, "f_HeartbeatScript"); + + // Initialize SpawnLocation + int nSpawnLocation = GetLocalInt(oSpawn, "f_SpawnLocation"); + int nSpawnLocationMin = GetLocalInt(oSpawn, "f_SpawnLocationMin"); + int nSpawnLocationInd = GetLocalInt(oSpawn, "f_SpawnLocationInd"); + + // Initialize SpawnFacing + int nFacing = GetLocalInt(oSpawn, "f_Facing"); + float fSpawnFacing = GetLocalFloat(oSpawn, "f_SpawnFacing"); + + // Initialize EntranceExit + float fEntranceExitX, fEntranceExitY; + vector vEntranceExit; + string sEntranceExit, sExit; + location lEntranceExit, lExit; + int nRndExit; + object oExit; + int nEntranceExit = GetLocalInt(oSpawn, "f_EntranceExit"); + int nEntranceExitMin = GetLocalInt(oSpawn, "f_EntranceExitMin"); + int nExit = GetLocalInt(oSpawn, "f_Exit"); + int nExitMin = GetLocalInt(oSpawn, "f_ExitMin"); + + // Initialize HealChildren + int nHealAmount; + effect eEffect; + int nHealChildren = GetLocalInt(oSpawn, "f_HealChildren"); + int nHealEffects = GetLocalInt(oSpawn, "f_HealEffects"); + + // Initialize SpawnItem + int nSpawnItem = GetLocalInt(oSpawn, "f_SpawnItem"); + + // Initialize SpawnSit + int nSpawnSit = GetLocalInt(oSpawn, "f_SpawnSit"); + + // Initialize SpawnPlot + int nSpawnPlot = GetLocalInt(oSpawn, "f_SpawnPlot"); + + // Initialize SpawnMerchant + int nSpawnMerchant = GetLocalInt(oSpawn, "f_SpawnMerchant"); + + int nPCCheckDespawn = FALSE; + + // decide if we'll despawn this HB due to PC Check + if (nPCCheck == TRUE) + { + //debug("Pc check"); + // Check for PCs + if (nPCCount == 0) + { + int nPCCheckDespawnTime = GetLocalInt(oSpawn, "PCCheckDespawnTime"); + //debug("despawn time = " + IntToString(nPCCheckDespawnTime)); + //debug("time now = " + IntToString(nTimeNow)); + if (nPCCheckDespawnTime == 0) + { + nPCCheckDespawnTime = nTimeNow + nPCCheckDelay; + SetLocalInt(oSpawn, "PCCheckDespawnTime", nPCCheckDespawnTime); + } + if (nTimeNow >= nPCCheckDespawnTime) + { + nPCCheckDespawn = TRUE; + SetLocalInt(oSpawn, "PCCheckDespawnTime", 0); + } + } + else + { + SetLocalInt(oSpawn, "PCCheckDespawnTime", 0); + } + } + + // Enumerate oSpawned Children + nChildSlot = 1; + nSpawnCount = 0; + nEmptyChildSlots = 0; + int nSpawnDelayTimerExpired = FALSE; + + for (nChildSlot = 1; nChildSlot <= nSpawnNumber; nChildSlot++) + { + // Starting Conditional + nSpawnDespawn = FALSE; + nDespawning = FALSE; + nSpawnChild = FALSE; + + // Retrieve Child + sChildSlot = "ChildSlot" + PadIntToString(nChildSlot, 2); + oCreature = GetLocalObject(oSpawn, sChildSlot); + //debug("checking " + sChildSlot + " of " + IntToString(nSpawnNumber)); + + + // Check if this is Child Slot is Valid + if (GetIsObjectValid(oCreature) == FALSE) + { + // Empty Slot + SpawnDelayDebug(oSpawn, "invalid in slot " + sChildSlot + ": object " + + ObjectToString(oCreature)); + SpawnCountDebug(oSpawn, "invalid in slot " + sChildSlot + ": object " + + ObjectToString(oCreature)); + nEmptyChildSlots++; + + } + else + { + if (nPlaceable == FALSE && nSpawnCamp == FALSE && nSpawnItem == FALSE) + { + // Don't process DM possessed creatures + + if (GetIsDMPossessed( oCreature ) ) + { + continue; + } + + // Check for Corpses + if (GetIsDead(oCreature) == FALSE) + { + //debug("alive"); + nSpawnChild = TRUE; + } + else + { + // Empty Slot + SpawnDelayDebug(oSpawn, "dead in slot " + sChildSlot + ": object " + + ObjectToString(oCreature)); + SpawnCountDebug(oSpawn, "dead in slot " + sChildSlot + ": object " + + ObjectToString(oCreature)); + nEmptyChildSlots++; + NESS_ProcessDeadCreature(oCreature, oSpawn); + } + } + else + { + nSpawnChild = TRUE; + } + } + + if (nSpawnChild == TRUE) + { + // Add to Count Total + nSpawnCount++; + //SpawnCountDebug("+ spawn count to " + IntToString(nSpawnCount)); + nSpawnBlock = FALSE; + + // Check Despawning + nDespawning = GetLocalInt(oCreature, "Despawning"); + + // Check Force Despawn + if (GetLocalInt(oCreature, "ForceDespawn") == TRUE) + { + //debug("force despawn"); + nDespawning = TRUE; + nSpawnDespawn = TRUE; + } + + // Get Creature Home + float fHomeX = GetLocalFloat(oCreature, "HomeX"); + float fHomeY = GetLocalFloat(oCreature, "HomeY"); + vector vHome = Vector(fHomeX, fHomeY, 0.0); + location lHome = Location(OBJECT_SELF, vHome, 0.0); + + // Check Facing + float fChildFacing = GetLocalFloat(oCreature, "SpawnFacing"); + + // Check Lifespan + if (nChildLifespanMax > -1) + { + nChildLifespanExpireTime = GetLocalInt(oCreature, "LifespanExpireTime"); + if (nTimeNow >= nChildLifespanExpireTime) + { + //debug("despawn: lifespawn exceeded"); + nSpawnDespawn = TRUE; + } + } + + // Day Only + if (nDayOnlyDespawn == TRUE && (nDayOnly == TRUE && (GetIsDay() == FALSE && GetIsDawn() == FALSE))) + { + //debug("despawn: night time for DO spawn"); + nSpawnDespawn = TRUE; + } + + // Night Only + if (nNightOnlyDespawn == TRUE && (nNightOnly == TRUE && (GetIsNight() == FALSE && GetIsDusk() == FALSE))) + { + //debug("despawn: day for NO spawn"); + nSpawnDespawn = TRUE; + } + + // Check Against Day + if (nSpawnDayStart > -1) + { + nDay = GetCalendarDay(); + if (IsBetweenDays(nDay, nSpawnDayStart, nSpawnDayEnd) == FALSE) + { + //debug("despawn: not right day"); + nSpawnDespawn = TRUE; + } + } + + // Check Against Hour + if (nSpawnHourStart > -1) + { + nHour = GetTimeHour(); + if (IsBetweenHours(nHour, nSpawnHourStart, nSpawnHourEnd) == FALSE) + { + //debug("despawn: not right hour"); + nSpawnDespawn = TRUE; + } + } + + // Random Walk + if (nRandomWalk == TRUE && nDespawning == FALSE && nSpawnDespawn == FALSE) + { + if (GetCurrentAction(oCreature) != ACTION_WAIT && + GetCurrentAction(oCreature) != ACTION_CASTSPELL && + !GetIsInCombat(oCreature) && !IsInConversation(oCreature)) + { + if (d2(1) == 2) + { + if (fWanderRange > 0.0) + { + //AssignCommand(oCreature, ClearAllActions()); + //RandomWalk(oSpawn, oCreature, fWanderRange, FALSE); + AssignCommand(oCreature, RandomWalk(oSpawn, + fWanderRange, FALSE)); + } + else + { + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, ActionRandomWalk()); + } + } + } + } + + // Patrol + if (nPatrolRoute > -1 && nDespawning == FALSE && nSpawnDespawn == FALSE) + { + if (!GetIsInCombat(oCreature) && !IsInConversation(oCreature)) + { + + nPatrolScriptRunning = GetLocalInt(oCreature, "PatrolScriptRunning"); + if (GetCurrentAction(oCreature) == ACTION_INVALID && nPatrolScriptRunning == FALSE) + { + // He's Slacking! Send him back to work! + //AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, SetPatrolRoute(nPatrolRoute)); + AssignCommand(oCreature, DoPatrolRoute(nPatrolRoute, nRouteType)); + } + + else if (bCheckForStuckPatrols) + { + CheckForStuckPatrol(oCreature, nPatrolRoute, nRouteType); + } + } + else if (IsInConversation(oCreature) == TRUE) + { + // Reset Script State + SetLocalInt(oCreature, "PatrolScriptRunning", FALSE); + } + } + + // ReturnHome + if (nReturnHome == TRUE && nDespawning == FALSE && nSpawnDespawn == FALSE) + { + if (GetDistanceBetweenLocations(lHome, GetLocation(oCreature)) > fReturnHomeRange) + { + if (GetCurrentAction(oCreature) == ACTION_INVALID && !GetIsInCombat(oCreature) && !IsInConversation(oCreature)) + { + // Send them back to Home + //AssignCommand(oCreature,ClearAllActions()); + //AssignCommand(oCreature,ActionMoveToLocation(lHome)); + AssignCommand(oCreature, ReturnHome(lHome)); + + if (nFacing == TRUE) + { + AssignCommand(oCreature, ActionDoCommand(SetFacing(fChildFacing))); + } + } + } + } + + // PC Check + if (nPCCheckDespawn == TRUE) + { + //debug("despawn: PC Check"); + nSpawnDespawn = TRUE; + } + + // Check Camp + if (nSpawnCamp == TRUE) + { + if (ProcessCamp(oCreature) == 0) + { + //debug("despawn: camp state is 0"); + nSpawnDespawn = TRUE; + } + } + + // Check Trigger + if (fDespawnTrigger > 0.0) + { + if (CountPCsInRadius(lSpawn, fDespawnTrigger, TRUE) == 0) + { + //debug("despawn: PCs in despawn trigger"); + nSpawnDespawn = TRUE; + } + } + + // Check Placeable + if (nPlaceable == TRUE) + { + // Despawn if Empty + if (nPlaceableType == 1) + { + if (GetFirstItemInInventory(oCreature) == OBJECT_INVALID) + { + //debug("despawn: empty placeable"); + nSpawnDespawn = TRUE; + } + } + // Generate Loot if Empty + else if (nPlaceableType == 2) + { + if (GetFirstItemInInventory(oCreature) == OBJECT_INVALID && GetIsOpen(oCreature) == FALSE) + { + // Check Delay Timer + if (nSpawnDelay > 0) + { + nLootTime = GetLocalInt(oCreature, "LootTime"); + if (nLootTime == 0) + { + // first time + if (nDelayRandom == TRUE) + { + nLootTime = -1; + while (nLootTime < nDelayMinimum) + { + nLootTime = Random(nSpawnDelay) + 1; + } + } + else + { + // Setup Next Spawn + nLootTime = nSpawnDelay; + } + nLootTime += nTimeNow; + SetLocalInt(oCreature, "LootTime", nLootTime); + } + } + else + { + nLootTime = nTimeNow; + } + + if (nTimeNow >= nLootTime) + { + // Give Random Gold + if (nRandomGold > 0) + { + if (d100(1) <= nGoldChance) + { + // Calculate Gold to Drop + nGoldAmount = Random(nRandomGold + 1); + while (nGoldAmount < nRandomGoldMin) + { + nGoldAmount = Random(nRandomGold + 1); + } + // Give Gold + CreateItemOnObject("nw_it_gold001", oCreature, + nGoldAmount); + } + } + // Generate New Loot + if (nLootTable > -1) + { + LootTable(oSpawn, oCreature, nLootTable); + } + + if (nSpawnDelay > 0) + { + // Set up Delay for next time + if (nDelayRandom == TRUE) + { + nLootTime = -1; + while (nLootTime < nDelayMinimum) + { + nLootTime = Random(nSpawnDelay) + 1; + } + } + else + { + // Setup Next Spawn + nLootTime = nSpawnDelay; + } + nLootTime += nTimeNow; + SetLocalInt(oCreature, "LootTime", nLootTime); + } + } // end if time to refill + } // end if empty + } // end if placeable-type == 2 + + else if (nPlaceableType == 3) + { + nRefreshTime = GetLocalInt(oCreature, "RefreshTime"); + if (nRefreshTime == 0) + { + nRefreshTime = nTimeNow + nPlaceableRefreshPeriod; + SetLocalInt(oCreature, "RefreshTime", nRefreshTime); + } + //debug("time now: " + IntToString(nTimeNow)); + //debug("refesh at: " + IntToString(nRefreshTime)); + if (nTimeNow >= nRefreshTime) + { + if (!GetIsOpen(oCreature)) + { + // Do the refresh + + // Despawn the current placeable + //debug("despawn: placeable refresh"); + nSpawnDespawn = TRUE; + + // Override SpawnDelay for respawn + SetLocalInt(oSpawn, "OverrideSpawnDelay", 1); + + // let the system know this is gone this frame + nEmptyChildSlots++; + } + } + } + } + + // Run Heartbeat Script + if (nHeartbeatScript > -1 && nDespawning == FALSE && nSpawnDespawn == FALSE) + { + SetLocalInt(oCreature, "HeartbeatScript", nHeartbeatScript); + ExecuteScript("spawn_sc_hbeat", oCreature); + } + + // Set Facing + if (nFacing == TRUE && nDespawning == FALSE) + { + if (GetFacing(oCreature) != fChildFacing && IsInConversation(oCreature) == FALSE && GetIsInCombat(oCreature) == FALSE && GetDistanceBetweenLocations(lHome, GetLocation(oCreature)) < 1.0) + { + AssignCommand(oCreature, ActionDoCommand(SetFacing(fChildFacing))); + } + } + + // Heal Children + if (nHealChildren > 0) + { + if (GetIsInCombat(oCreature) == FALSE && (GetMaxHitPoints(oCreature) != GetCurrentHitPoints(oCreature))) + { + nHealAmount = FloatToInt(IntToFloat(GetMaxHitPoints(oCreature)) * (IntToFloat(nHealChildren) / 100.0)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHealAmount), oCreature, 0.0); + if (nHealEffects == TRUE) + { + eEffect = GetFirstEffect(oCreature); + while (GetIsEffectValid(eEffect) == TRUE) + { + RemoveEffect(oCreature, eEffect); + eEffect = GetNextEffect(oCreature); + } + } + } + } + + // Spawn Sit + if (nSpawnSit == TRUE && nDespawning == FALSE) + { + if (GetCurrentAction(oCreature) != ACTION_SIT) + { + if (GetIsInCombat(oCreature) == FALSE && IsInConversation(oCreature) == FALSE) + { + FindSeat(oSpawn, oCreature); + } + } + } + + // Check if Item is Possessed by Someone + if (nSpawnItem == TRUE) + { + if (GetItemPossessor(oCreature) != OBJECT_INVALID) + { + // Remove Child Status + DeleteLocalObject(oSpawn, GetLocalString(oCreature, "ParentChildSlot")); + } + } + + // Population Control + if (nSpawnCount > nSpawnNumber) + { + nSpawnDespawn = TRUE; + nSpawnBlock = TRUE; + } + } + + + // Despawn Creatures + //if (GetIsDM(object) == TRUE || GetIsDM(GetMaster(object)) == TRUE) + if (nSpawnDespawn == TRUE && ! GetIsDM(oCreature) && + ! GetIsDM(GetMaster(oCreature))) + { + int nSaveState = nPCCheckDespawn && ! nPCReset; + SetLocalInt(oCreature, "Despawning", TRUE); + if (nSpawnPlot == TRUE) + { + SetPlotFlag(oCreature, FALSE); + } + if (nPlaceable == TRUE || nSpawnCamp == TRUE || nSpawnItem == TRUE + || nSpawnMerchant == TRUE) + { + if (nDespawnScript > -1) + { + SetLocalInt(oCreature, "DespawnScript", nDespawnScript); + ExecuteScript("spawn_sc_spawn", oCreature); + } + if (nSpawnCamp == TRUE) + { + // Destroy camp will save info about what in the camp is + // still present on the camp object (oCreature in this + // case) if nSaveState is true + DestroyCamp(oCreature, fCampDecay, nSaveState); + //if (! nSaveState) + //{ + // // This isn't a PC despawn, so set up SD if needed + // if (nSpawnDelay && nNextSpawnTime == 0) + // { + // nNextSpawnTime = SetupSpawnDelay(nSpawnDelay, + // nDelayRandom, nDelayMinimum, nTimeNow); + // SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + // } + //} + } + + if (nDespawnEffect > 0) + { + eDespawn = EffectVisualEffect(SpawnEffect(oSpawn, FALSE, TRUE)); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eDespawn, + GetLocation(oCreature), 5.0); + } + + // remove the child object from the spawn + DeleteLocalObject(oSpawn, GetLocalString(oCreature, + "ParentChildSlot")); + + if (nSaveState) + { + if (nSpawnCamp) + { + SaveCampStateOnDespawn(oCreature, oSpawn); + } + else + { + SaveStateOnDespawn(oCreature, oSpawn); + } + + } + + // saved camp states don't get destroyed; but everything else + // (including unsaved camp states do + if (! (nSaveState && nSpawnCamp)) + { + NESS_CleanInventory(oCreature); + AssignCommand(oCreature, SetIsDestroyable(TRUE, FALSE, + FALSE)); + SpawnCountDebug(oSpawn, "despawning " + ObjectToString(oCreature)); + DestroyObject(oCreature); + } + nSpawnCount--; + //debug("- spawn count to " + IntToString(nSpawnCount)); + } + else // is not placeable, camp, item, or merchant + { + if ((!GetIsInCombat(oCreature) && !IsInConversation(oCreature)) + || (nPCCheck == TRUE && nPCCount == 0)) + { + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, ActionWait(1.0) ); + if (nEntranceExit > -1) + { + if (nExit > -1) + { + if (nExitMin > -1) + { + nRndExit = Random(nExit + 1); + while (nRndExit < nExitMin) + { + nRndExit = Random(nExit + 1); + } + nExit = nRndExit; + } + sExit = "EX" + PadIntToString(nExit, 2); + oExit = GetNearestObjectByTag(sExit, oSpawn); + lExit = GetLocation(oExit); + //AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, ActionMoveToLocation(lExit)); + } + else + { + // Get Creature EntranceExit + fEntranceExitX = GetLocalFloat(oCreature, "EntranceExitX"); + fEntranceExitY = GetLocalFloat(oCreature, "EntranceExitY"); + vEntranceExit = Vector(fEntranceExitX, fEntranceExitY, 0.0); + lEntranceExit = Location(OBJECT_SELF, vEntranceExit, 0.0); + //AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, ActionMoveToLocation(lEntranceExit)); + } + if (nDespawnScript > -1) + { + SetLocalInt(oCreature, "DespawnScript", nDespawnScript); + ExecuteScript("spawn_sc_spawn", oCreature); + } + if (nDespawnEffect > 0) + { + eDespawn = EffectVisualEffect(SpawnEffect(oSpawn, FALSE, TRUE)); + AssignCommand(oCreature, ActionDoCommand(ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eDespawn, GetLocation(oCreature), 5.0))); + } + AssignCommand(oCreature, ActionDoCommand(DeleteLocalObject(oSpawn, GetLocalString(oCreature, "ParentChildSlot")))); + AssignCommand(oCreature, ActionDoCommand(NESS_CleanInventory(oCreature))); + if (nSaveState) + { + AssignCommand(oCreature, ActionDoCommand( + SaveStateOnDespawn(oCreature, oSpawn))); + } + + AssignCommand(oCreature, SetIsDestroyable(TRUE, FALSE, FALSE)); + SpawnCountDebug(oSpawn, "despawning " + ObjectToString(oCreature)); + + AssignCommand(oCreature, ActionDoCommand(DestroyObject(oCreature))); + } + else // doesn't have to exit at a specific place + { + if (nDespawnScript > -1) + { + SetLocalInt(oCreature, "DespawnScript", nDespawnScript); + ExecuteScript("spawn_sc_spawn", oCreature); + } + if (nDespawnEffect > 0) + { + eDespawn = EffectVisualEffect(SpawnEffect(oSpawn, FALSE, TRUE)); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eDespawn, GetLocation(oCreature), 5.0); + } + DeleteLocalObject(oSpawn, GetLocalString(oCreature, "ParentChildSlot")); + NESS_CleanInventory(oCreature); + if (nSaveState) + { + SaveStateOnDespawn(oCreature, oSpawn); + } + + AssignCommand(oCreature, SetIsDestroyable(TRUE, FALSE, FALSE)); + SpawnCountDebug(oSpawn, "despawning " + ObjectToString(oCreature)); + + DestroyObject(oCreature); + } + nSpawnCount--; + //debug("- spawn count to " + IntToString(nSpawnCount)); + + } + } + } + } + + if (nPCCheckDespawn && (nPCReset == TRUE)) + { + //debug("reset"); + ResetSpawn(oSpawn, nTimeNow); + } + + //++ Done processing living children + + // Record SpawnCount + SetLocalInt(oSpawn, "SpawnCount", nSpawnCount); + //SpawnCountDebug("set spawn count to " + IntToString(nSpawnCount)); + + // Recalculate spawn number if random spawn number range in use... + if (nSpawnCount == 0 && (!nPCCheckDespawn) && nSpawnNumberMin > -1 && nPCCount > 0) + { + nRndSpawnNumber = Random(nSpawnNumberMax + 1); + while (nRndSpawnNumber < nSpawnNumberMin) + { + nRndSpawnNumber = Random(nSpawnNumberMax + 1); + } + nSpawnNumber = nRndSpawnNumber; + nEmptyChildSlots = nSpawnNumber; + SetLocalInt(oSpawn, "f_SpawnNumber", nSpawnNumber); + SpawnCountDebug(oSpawn, "spawn number set to " + IntToString(nSpawnNumber)); + SpawnCountDebug(oSpawn, "empty slots is " + IntToString(nEmptyChildSlots)); + } + + // Check InitialState + if (nInitialState == 0) + { + if (GetLocalInt(oSpawn, "InitialStateProcessed") == FALSE) + { + nForceDeactivateSpawn = TRUE; + SetLocalInt(oSpawn, "InitialStateProcessed", TRUE); + } + } + + // Check to Deactivate Spawn + if (nDeactivateSpawn > -1 || nForceDeactivateSpawn == TRUE) + { + nSpawnDeactivated = FALSE; + nRunDeactivateScript = FALSE; + if (nForceDeactivateSpawn == FALSE) + { + switch (nDeactivateSpawn) + { + // Deactivate if all Children are Dead + case 0: + if (nSpawnCount == 0 && nChildrenSpawned != 0) + { + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + break; + // Deactivate if Spawned SpawnNumber Children + case 1: + if (nChildrenSpawned >= nSpawnNumber) + { + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + break; + // Temporary Pause until all Children are Dead + case 2: + if (nSpawnCount != 0) + { + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + break; + // Deactivate after DI00 Children Spawned + case 3: + if (nChildrenSpawned >= nDeactivationInfo) + { + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + break; + // Deactivate after DI00 Minutes (converted to seconds) + case 4: + // Deactivate after DI00 Cycles (converted to seconds + case 5: + nSpawnAgeTime = GetLocalInt(oSpawn, "SpawnAgeTime"); + if (nSpawnAgeTime == 0) + { + // first time + nSpawnAgeTime = nTimeNow + nDeactivationInfo; + } + + if (nTimeNow >= nSpawnAgeTime) + { + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + SetLocalInt(oSpawn, "SpawnAgeTime", nSpawnAgeTime); + break; + // Deactivate when spawn count == spawn number + case 6: + if (nSpawnCount >= nSpawnNumber) + { + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + } + break; + } + } + else + { + // Force Deactivate + nSpawnDeactivated = TRUE; + nRunDeactivateScript = TRUE; + nSpawnBlock = TRUE; + SetLocalInt(oSpawn, "ForceDeactivateSpawn", FALSE); + } + + // Record Deactivated State + SetLocalInt(oSpawn, "SpawnDeactivated", nSpawnDeactivated); + + // Run Deactivation Script + if (nRunDeactivateScript == TRUE && nDeactivateScript > -1) + { + SetLocalInt(oSpawn, "DeactivateScript", nDeactivateScript); + ExecuteScript("spawn_sc_deactiv", oSpawn); + SetLocalInt(oSpawn, "DeactivateScript", -1); + } + } + + //++ Done checking deactivation + + // Check Number of Creatures against nSpawnNumber + if (nEmptyChildSlots > 0) + { + // If there are empty slots and nSpawnDelay is true and nNextSpawnTime is 0 + // (which indicates no timer is currently set) and this isn't the first time + // we've ever spawned (as indicated by nNumberChildrenSpawned) and we're not + // despawning because PCs have left we should + // set up a timer + if (nSpawnDelay && (! nSpawnDelayPeriodic) && + nChildrenSpawned > 0 && nNextSpawnTime == 0 && ! nPCCheckDespawn ) + { + nNextSpawnTime = SetupSpawnDelay(nSpawnDelay, + nDelayRandom, nDelayMinimum, nTimeNow); + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + SpawnDelayDebug(oSpawn, "setup spawn delay: " + IntToString(nNextSpawnTime) + + " [" + RealSecondsToString(nNextSpawnTime) + "]"); + SpawnDelayDebug(oSpawn, "current time: " + IntToString(nTimeNow) + + " [" + RealSecondsToString(nTimeNow) + "]"); + } + + SpawnCountDebug(oSpawn, IntToString(nEmptyChildSlots) + " empty slots"); + + // Check Against Spawn Unseen + if (fSpawnUnseen > 0.0 && ! nUnseenIndividual) + { + if (nEntranceExit > -1) + { + fEntranceExitX = GetLocalFloat(oCreature, "EntranceExitX"); + fEntranceExitY = GetLocalFloat(oCreature, "EntranceExitY"); + vEntranceExit = Vector(fEntranceExitX, fEntranceExitY, 0.0); + lEntranceExit = Location(OBJECT_SELF, vEntranceExit, 0.0); + oCreature = GetFirstObjectInShape(SHAPE_SPHERE, fSpawnUnseen, + lEntranceExit, FALSE, OBJECT_TYPE_CREATURE); + } + else + { + oCreature = GetFirstObjectInShape(SHAPE_SPHERE, fSpawnUnseen, + lSpawn, FALSE, OBJECT_TYPE_CREATURE); + } + while (oCreature != OBJECT_INVALID) + { + if (GetIsPC(oCreature) == TRUE) + { + nSpawnBlock = TRUE; + oCreature = OBJECT_INVALID; + } + if (nEntranceExit > -1) + { + oCreature = GetNextObjectInShape(SHAPE_SPHERE, fSpawnUnseen, + lEntranceExit, FALSE, OBJECT_TYPE_CREATURE); + } + else + { + oCreature = GetNextObjectInShape(SHAPE_SPHERE, fSpawnUnseen, + lSpawn, FALSE, OBJECT_TYPE_CREATURE); + } + } + } + + // Check Against Day or Night Only + if ((nNightOnly == TRUE && (GetIsNight() == FALSE && GetIsDusk() == FALSE)) || (nDayOnly == TRUE && (GetIsDay() == FALSE && GetIsDawn() == FALSE))) + { + nSpawnBlock = TRUE; + } + + // Check Against Day + if (nSpawnDayStart > -1) + { + nDay = GetCalendarDay(); + if (IsBetweenDays(nDay, nSpawnDayStart, nSpawnDayEnd) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Against Hour + if (nSpawnHourStart > -1) + { + nHour = GetTimeHour(); + if (IsBetweenHours(nHour, nSpawnHourStart, nSpawnHourEnd) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Against PCCheck + if (nPCCheck == TRUE) + { + // Check for PCs + if (CountPCsInArea(OBJECT_SELF, TRUE) == 0) + { + nSpawnBlock = TRUE; + } + } + + // Check Trigger + if (fSpawnTrigger > 0.0) + { + //debug("checking trigger"); + if (CountPCsInRadius(lSpawn, fSpawnTrigger, TRUE) == 0) + { + //debug("no one close"); + nSpawnBlock = TRUE; + } + else + { + //debug("trigger tripped"); + } + } + + // Check Spawn Check PCs + if (nSpawnCheckPCs > -1) + { + // If Spawn Cannot Proceed, Block + if (SpawnCheckPCs(oSpawn) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + // Check Spawn Check Custom + if (nSpawnCheckCustom > -1) + { + // If Spawn Cannot Proceed, Block + if (SpawnCheckCustom(oSpawn) == FALSE) + { + nSpawnBlock = TRUE; + } + } + + if (nSpawnBlock == FALSE) + { + + // Check the spawn delay timer + int nOverrideSpawnDelay = GetLocalInt(oSpawn, "OverrideSpawnDelay"); + if (nSpawnDelay || nInitialDelay) + { + // need to refetch, as the death of a child may have changed it + //nNextSpawnTime = GetLocalInt(oSpawn, "NextSpawnTime"); + //debug("next spawn time: " + IntToString(nNextSpawnTime)); + //debug("time now: " + IntToString(nTimeNow)); + if ((nTimeNow >= nNextSpawnTime) && (! nPCCheck || nPCCount > 0)) + { + nSpawnDelayTimerExpired = TRUE; + + if (nInitialDelay) + { + nInitialDelay = 0; + SetLocalInt(oSpawn, "f_InitialDelay", nInitialDelay ); + } + + if (! nSpawnDelayPeriodic) + { + SpawnDelayDebug(oSpawn, "SD timer expired: " + + IntToString(nNextSpawnTime) + + " [" + RealSecondsToString(nNextSpawnTime) + "]"); + SpawnDelayDebug(oSpawn, "current time: " + IntToString(nTimeNow) + + " [" + RealSecondsToString(nTimeNow) + "]"); + + nNextSpawnTime = 0; + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + } + } + } + + + // Check Against spawn delay (SD flag) + //debug("SpawnDelayTimerExpired: " + IntToString(nSpawnDelayTimerExpired)); + + if ( ( (!nSpawnDelay || nOverrideSpawnDelay) && ! nInitialDelay ) || + nSpawnDelayTimerExpired ) + { + //debug("respawn after delay"); + SetLocalInt(oSpawn, "OverrideSpawnDelay", 0); + + // Check RandomSpawn + if (d100() <= nRandomSpawn) + { + SpawnDelayDebug(oSpawn, "spawn!"); + //debug("periodic: " + IntToString(nSpawnDelayPeriodic)); + //debug("nChildrenSpawned: " + IntToString(nChildrenSpawned)); + // Set up periodic spawn delay if first spawn + if (nSpawnDelayPeriodic && nChildrenSpawned == 0) + { + // little kludge here. Knock a second off so it + // won't roll over when we get to the bottom of this + // function. Avoids creating yet another special flag + nNextSpawnTime = nTimeNow + nSpawnDelay - 1; + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + //debug("setup first periodic delay: " + IntToString(nNextSpawnTime)); + } + + if (nSpawnAllAtOnce == FALSE) + { + // Spawn another Creature + DoSpawn(oSpawn, nTimeNow); + } + else + { + if (nSpawnNumberAtOnce > 0) + { + if (nSpawnNumberAtOnceMin == 0 || nEmptyChildSlots >= nSpawnNumberAtOnceMin) + { + // Spawn Sets of Creatures + for (jCount = 1; (jCount <= nEmptyChildSlots) && (jCount <= nSpawnNumberAtOnce); jCount++) + { + DelayCommand(0.0, DoSpawn(oSpawn, nTimeNow)); + } + } + } + else + { + // Spawn All Creatures + for (jCount = 1; jCount <= nEmptyChildSlots; jCount++) + { + DelayCommand(0.0, DoSpawn(oSpawn, nTimeNow)); + } + } + } + } // end RS + + else + { + SpawnDelayDebug(oSpawn, "Spawn blocked by RS"); + if (nSpawnDelay && ! nSpawnDelayPeriodic) + { + // reset spawn delay timer + nNextSpawnTime = SetupSpawnDelay(nSpawnDelay, + nDelayRandom, nDelayMinimum, nTimeNow); + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + SpawnDelayDebug(oSpawn, "setup spawn delay: " + + IntToString(nNextSpawnTime) + + " [" + RealSecondsToString(nNextSpawnTime) + "]"); + SpawnDelayDebug(oSpawn, "current time: " + IntToString(nTimeNow) + + " [" + RealSecondsToString(nTimeNow) + "]"); + + + } + } + + } // end spawn delay test + } // end if not spawn blocked (PC check or spawn unseen, for instance) + } // end if empty slots + + // If the SD is periodic, check for rollover + if (nSpawnDelayPeriodic) + { + // if next spawn time is zero, there is no timer in play + if (nNextSpawnTime > 0 && nTimeNow >= nNextSpawnTime) + { + // Setup Next Spawn + //debug("rollover - timeNow: " + IntToString(nTimeNow) + " nNextSpawnTime: " + // + IntToString(nNextSpawnTime)); + nNextSpawnTime += nSpawnDelay; + //debug("setup new periodic delay: " + IntToString(nNextSpawnTime)); + SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); + } + } +} +// + +// This Function Performs the Spawn +void DoSpawn(object oSpawn, int nTimeNow) +{ + vector vSpawnPos; + // lHome is the location of the actual spawn waypoint + location lHome; + // The location of an entrance waypoint to spawn in at instead of lHome + location lEntranceExit; + // lSpawnLocation is where we actually spawn in + location lSpawnLocation; + float fRadius, fRadiusX, fRadiusY, fSpawnAngle; + object oSpawned, oEntranceExit, oSpawnLocation, oPC; + effect eSpawn, eArea; + int nObjectType, nRadiusValid; + int nRndEntranceExit; + string sTemplate, sEntranceExit; + int nUnseenTryCount, nUnseen; + int nWalkToHome = FALSE; + + // Initialize Variables + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + string sSpawnTag = GetLocalString(oSpawn, "f_Template"); + // location lSpawn = GetLocation(oSpawn); + float fSpawnRadius = GetLocalFloat(oSpawn, "f_SpawnRadius"); + float fSpawnRadiusMin = GetLocalFloat(oSpawn, "f_SpawnRadiusMin"); + int nSpawnNearPCs = GetLocalInt(oSpawn, "f_SpawnNearPCs"); + float fSpawnFacing; + int nFacing = GetLocalInt(oSpawn, "f_Facing"); + + + int nSpawnEffect = GetLocalInt(oSpawn, "f_SpawnEffect"); + int nSpawnAreaEffect = GetLocalInt(oSpawn, "f_SpawnAreaEffect"); + float fAreaEffectDuration = GetLocalFloat(oSpawn, "f_AreaEffectDuration"); + + int nEntranceExit = GetLocalInt(oSpawn, "f_EntranceExit"); + int nEntranceExitMin = GetLocalInt(oSpawn, "f_EntranceExitMin"); + int nPlaceable = GetLocalInt(oSpawn, "f_Placeable"); + int nSpawnGroup = GetLocalInt(oSpawn, "f_SpawnGroup"); + int nSpawnCamp = GetLocalInt(oSpawn, "f_SpawnCamp"); + int nSpawnLocation = GetLocalInt(oSpawn, "f_SpawnLocation"); + int nSpawnLocationMin = GetLocalInt(oSpawn, "f_SpawnLocationMin"); + int nSpawnLocationInd = GetLocalInt(oSpawn, "f_SpawnLocationInd"); + int nSpawnItem = GetLocalInt(oSpawn, "f_SpawnItem"); + int nSpawnMerchant = GetLocalInt(oSpawn, "f_SpawnMerchant"); + + float fSpawnUnseen = GetLocalFloat(oSpawn, "f_SpawnUnseen"); + int nUnseenIndividual = GetLocalInt(oSpawn, "f_UnseenIndividual"); + int nUnseenRetryCount = GetLocalInt(oSpawn, "f_UnseenRetryCount"); + + // Start with this position for this spawn at the spawn waypoint + vSpawnPos = GetPositionFromLocation(GetLocation(oSpawn)); + + // Find facing for this spawn + if (nFacing) + { + fSpawnFacing = GetLocalFloat(oSpawn, "f_SpawnFacing"); + } + + else + { + fSpawnFacing = IntToFloat(Random(360)); + } + + // Check Spawn Location + if (nSpawnLocation > -1) + { + // Get SpawnLocation + oSpawnLocation = GetSpawnLocationObject(oSpawn, nSpawnLocationMin, + nSpawnLocation, nSpawnLocationInd); + + if (oSpawnLocation != OBJECT_INVALID) + { + vSpawnPos = GetPositionFromLocation(GetLocation(oSpawnLocation)); + } + + // kick out spawn unseen is true and SL location is in radius + if (fSpawnUnseen > 0.0 && nUnseenIndividual) + { + if (!CheckPositionUnseen(vSpawnPos, fSpawnUnseen)) + { + nUnseenTryCount = 0; + nUnseen = FALSE; + + while(nUnseenTryCount++ < nUnseenRetryCount && ! nUnseen) + { + oSpawnLocation = GetSpawnLocationObject(oSpawn, + nSpawnLocationMin, nSpawnLocation, nSpawnLocationInd); + + if (oSpawnLocation != OBJECT_INVALID) + { + vSpawnPos = GetPositionFromLocation(GetLocation( + oSpawnLocation)); + } + + if (CheckPositionUnseen(vSpawnPos, fSpawnUnseen)) + { + nUnseen = TRUE; + } + } + if (! nUnseen) + { + // do not spawn this child + return; + } + } + } + + // Adjust for New SpawnFacing + if (nFacing == TRUE) + { + fSpawnFacing = GetFacing(oSpawnLocation); + } + } + + else if (fSpawnRadius > 0.0) + { + // Check SpawnNearPCs + if (nSpawnNearPCs == TRUE) + { + oPC = GetRandomPCInArea(OBJECT_SELF, oSpawn); + if (oPC != OBJECT_INVALID) + { + vSpawnPos = GetPositionFromLocation(GetLocation(oPC)); + } + } + + vSpawnPos = GetSpawnRadiusPosition(vSpawnPos, fSpawnRadius, + fSpawnRadiusMin); + + // kick out spawn unseen is true and vSpawnPos is in range of PC + if (fSpawnUnseen > 0.0 && nUnseenIndividual) + { + if (!CheckPositionUnseen(vSpawnPos, fSpawnUnseen)) + { + nUnseenTryCount = 0; + nUnseen = FALSE; + + while(nUnseenTryCount++ < nUnseenRetryCount && ! nUnseen) + { + vSpawnPos = GetSpawnRadiusPosition(vSpawnPos, fSpawnRadius, + fSpawnRadiusMin); + + if (CheckPositionUnseen(vSpawnPos, fSpawnUnseen)) + { + nUnseen = TRUE; + } + } + + if (! nUnseen) + { + // do not spawn this child + return; + } + } + } + } // end else if SR + + else // Not SL or SR + { + if (fSpawnUnseen > 0.0 && nUnseenIndividual) + { + if (!CheckPositionUnseen(vSpawnPos, fSpawnUnseen)) + { + // do not spawn this child + return; + } + } + } + + // Home is where we spawn in OR where we WOULD spawn in if there were no + // Alternate entrance specified. + lHome = Location(OBJECT_SELF, vSpawnPos, fSpawnFacing); + + // If there's an entrance/exit, lSpawnLocation may still change to that + lSpawnLocation = lHome; + + + // Check Spawn Type + nObjectType = OBJECT_TYPE_CREATURE; + if (nPlaceable == TRUE || nSpawnCamp == TRUE || sSpawnTag == "AE") + { + nObjectType = OBJECT_TYPE_PLACEABLE; + } + if (nSpawnItem == TRUE) + { + nObjectType = OBJECT_TYPE_ITEM; + } + if (nSpawnMerchant == TRUE) + { + nObjectType = OBJECT_TYPE_STORE; + } + + // Check Spawn Group + if (nSpawnGroup == TRUE) + { + // Pull a Creature from the Group + sTemplate = SpawnGroup(oSpawn, sSpawnTag); + } + else + { + sTemplate = sSpawnTag; + } + + // Set up alternate Entrance/Exit + if (!nSpawnCamp) + { + // EntranceExit + if (nEntranceExit > -1) + { + // Get ExitEntrance + if (nEntranceExitMin > -1) + { + nRndEntranceExit = Random(nEntranceExit + 1); + while (nRndEntranceExit < nEntranceExitMin) + { + nRndEntranceExit = Random(nEntranceExit + 1); + } + nEntranceExit = nRndEntranceExit; + } + sEntranceExit = "EE" + PadIntToString(nEntranceExit, 2); + oEntranceExit = GetNearestObjectByTag(sEntranceExit, oSpawn); + lEntranceExit = GetLocation(oEntranceExit); + + lSpawnLocation = lEntranceExit; + nWalkToHome = TRUE; + } + } + + // Create Effect + if (nSpawnEffect > 0) + { + eSpawn = EffectVisualEffect(SpawnEffect(oSpawn, TRUE, FALSE)); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSpawn, lSpawnLocation, + 5.0); + } + + // Check Area Effect + if (nSpawnAreaEffect > 0) + { + eArea = SpawnAreaEffect(oSpawn); + if (fAreaEffectDuration > 0.0) + { + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eArea, lSpawnLocation, + fAreaEffectDuration); + } + else + { + ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eArea, lSpawnLocation, + 0.0); + } + + // Check Template + if (sSpawnTag == "AE") + { + sTemplate = "plc_invisobj"; + } + } + + // Validate sSpawnTag + if (sTemplate != "") + { + // Spawn + if (nSpawnCamp == TRUE) + { + oSpawned = CampSpawn(oSpawn, sTemplate, lSpawnLocation); + RecordSpawned(oSpawn, oSpawned, lHome, lEntranceExit, fSpawnFacing); + } + else + { + + oSpawned = CreateObject(nObjectType, sTemplate, lSpawnLocation); + SpawnDelayDebug(oSpawn, "spawned " + ObjectToString(oSpawned)); + RecordSpawned(oSpawn, oSpawned, lHome, lEntranceExit, + fSpawnFacing); + SetupSpawned(oSpawn, oSpawned, lHome, nTimeNow, nWalkToHome); + } + } +} +// + +// This Function Spawns a Camp +object CampSpawn(object oSpawn, string sCamp, location lCamp) +{ + // Spawn in Camp Placeholder + object oCamp = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lCamp, FALSE); + SetPlotFlag(oCamp, TRUE); + SetLocalObject(oCamp, "ParentSpawn", oSpawn); + SetCampSpawn(oCamp, sCamp, lCamp); + + // Initialize + int nCampNumP = GetLocalInt(oCamp, "CampNumP"); + int nCampNumC = GetLocalInt(oCamp, "CampNumC"); + float fSpawnRadius = GetLocalFloat(oCamp, "CampRadius"); + vector vCamp = GetPositionFromLocation(lCamp); + + object oSpawned; + int iCount; + int nRandomWalk, nSpawnFacing; + int nLootTable, nSpawnGroup, nTrapDisabled, nDeathScript; + float fCorpseDecay; + int nCorpseDecayType, nCampCenter; + string sObject, sTemplate, sFlags, sCampCenter; + + // Get Camp Center + sCampCenter = GetLocalString(oCamp, "CampCenter"); + + // Spawn Placeables + for (iCount = 1; iCount <= nCampNumP; iCount++) + { + // Initialize Values + sObject = "CampP" + IntToString(iCount - 1); + sTemplate = GetLocalString(oCamp, sObject); + nCampCenter = FALSE; + + // Check Flags + sFlags = GetLocalString(oCamp, sObject + "_Flags"); + nSpawnGroup = IsFlagPresent(sFlags, "SG"); + + // Spawn Group + if (nSpawnGroup == TRUE) + { + sTemplate = SpawnGroup(oSpawn, sTemplate); + } + + // Check Camp Center + if (sCampCenter != "") + { + if (sCampCenter == "P" + IntToString(iCount - 1)) + { + nCampCenter = TRUE; + } + } + // If no CampCenter set, Use first Placeable + else if (iCount == 1) + { + nCampCenter = TRUE; + } + + oSpawned = DoCampSpawn(oCamp, lCamp, fSpawnRadius, sTemplate, TRUE, iCount, nCampCenter); + SetLocalObject(oCamp, sObject, oSpawned); + SetupCampSpawned(oSpawn, oSpawned, vCamp, GetLocation(oSpawned), sFlags); + + } + + // Spawn Creatures + for (iCount = 1; iCount <= nCampNumC; iCount++) + { + // Initialize Values + sObject = "CampC" + IntToString(iCount - 1); + sTemplate = GetLocalString(oCamp, sObject); + + // Check Flags + sFlags = GetLocalString(oCamp, sObject + "_Flags"); + nSpawnGroup = IsFlagPresent(sFlags, "SG"); + + // Spawn Group + if (nSpawnGroup == TRUE) + { + sTemplate = SpawnGroup(oSpawn, sTemplate); + } + + // Check Camp Center + if (sCampCenter != "") + { + if (sCampCenter == "C" + IntToString(iCount - 1)) + { + nCampCenter = TRUE; + } + } + + oSpawned = DoCampSpawn(oCamp, lCamp, fSpawnRadius, sTemplate, FALSE, iCount, nCampCenter); + SetLocalObject(oCamp, sObject, oSpawned); + SetupCampSpawned(oSpawn, oSpawned, vCamp, GetLocation(oSpawned), sFlags); + } + + // Return Placeholder + return oCamp; +} +// + +// This Function Spawns the Camp Members +object DoCampSpawn(object oCamp, location lCamp, float fSpawnRadius, + string sTemplate, int nPlaceable, int nSpawnNumber, int nCampCenter) +{ + object oCampSpawned; + vector vCamp, vRadius; + float fRadius, fRadiusX, fRadiusY, fAngle; + + // Set up Location + if (nCampCenter == FALSE) + { + vCamp = GetPositionFromLocation(lCamp); + fAngle = IntToFloat(Random(361)); + fRadius = IntToFloat(Random(FloatToInt(fSpawnRadius)) + 1); + fRadiusX = fRadius * cos(fAngle); + fRadiusY = fRadius * sin(fAngle); + vRadius = Vector(fRadiusX, fRadiusY); + lCamp = Location(OBJECT_SELF, vCamp + vRadius, 0.0); + } + + // Spawn Camp Object + if (nPlaceable == TRUE) + { + oCampSpawned = CreateObject(OBJECT_TYPE_PLACEABLE, sTemplate, lCamp, FALSE); + //debug("created placeable at " + LocationToString(lCamp)); + } + else + { + oCampSpawned = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lCamp, FALSE); + } + + // Return Camp Object + return oCampSpawned; +} + diff --git a/nwnds_module/spawn_oncloscrp.ncs b/nwnds_module/spawn_oncloscrp.ncs new file mode 100644 index 000000000..c0d598c5b Binary files /dev/null and b/nwnds_module/spawn_oncloscrp.ncs differ diff --git a/nwnds_module/spawn_oncloscrp.nss b/nwnds_module/spawn_oncloscrp.nss new file mode 100644 index 000000000..5982831c9 --- /dev/null +++ b/nwnds_module/spawn_oncloscrp.nss @@ -0,0 +1,50 @@ +// +// NESS V8.1 +// Spawn On Close Corpse +// +// Brought into the NESS distribution for Version 8.0 and beyond. Original +// header below. Added code to cause immediate decay when emptied. +// + +//////////////////////////////////////////////////////////////////////////////// +// // // +// _kb_corpse_sound // VERSION 1.0 // +// // // +// by Keron Blackfeld on 07/17/2002 //////////////////////////// +// // +// email Questions and Comments to: keron@broadswordgaming.com or catch me // +// in Bioware's NWN Community - Builder's NWN Scripting Forum // +// // +//////////////////////////////////////////////////////////////////////////////// +// // +// This script is a simple, albeit weak, attempt to mask the default DOOR // +// sounds tied to the invisible lootable object. Please this in both the // +// onOpened and onClosed Events of the "invis_corpse_obj" described in my // +// _kb_lootable_corpse script. // +// // +//////////////////////////////////////////////////////////////////////////////// + +#include "spawn_functions" + +void main() +{ + effect eQuiet = EffectSilence(); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eQuiet, OBJECT_SELF, 120.0f); + PlaySound("as_sw_chestcl1"); + + + object oHasInventory = GetFirstItemInInventory(OBJECT_SELF); //Check for inventory + if (oHasInventory == OBJECT_INVALID) //If no inventory found + { + /******************************************* + ** Delete empty. ** + *******************************************/ + object oHostCorpse = GetLocalObject(OBJECT_SELF, "HostBody"); + NESS_CleanCorpse(oHostCorpse); + AssignCommand(oHostCorpse,SetIsDestroyable(TRUE,FALSE,FALSE)); //Set actual corpse to destroyable + DestroyObject(oHostCorpse); //Delete the actual Creature Corpse + + DelayCommand(1.0f,DestroyObject(OBJECT_SELF)); //Delete Lootable Object (Self) + + } +} diff --git a/nwnds_module/spawn_onopencrp.ncs b/nwnds_module/spawn_onopencrp.ncs new file mode 100644 index 000000000..67eda7ce1 Binary files /dev/null and b/nwnds_module/spawn_onopencrp.ncs differ diff --git a/nwnds_module/spawn_onopencrp.nss b/nwnds_module/spawn_onopencrp.nss new file mode 100644 index 000000000..69a8e023e --- /dev/null +++ b/nwnds_module/spawn_onopencrp.nss @@ -0,0 +1,33 @@ +// +// NESS V8.1 +// Spawn On Open Corpse +// +// Brought into the NESS distribution for Version 8.0 and beyond. Original +// header below. +// + +//////////////////////////////////////////////////////////////////////////////// +// // // +// _kb_corpse_sound // VERSION 1.0 // +// // // +// by Keron Blackfeld on 07/17/2002 //////////////////////////// +// // +// email Questions and Comments to: keron@broadswordgaming.com or catch me // +// in Bioware's NWN Community - Builder's NWN Scripting Forum // +// // +//////////////////////////////////////////////////////////////////////////////// +// // +// This script is a simple, albeit weak, attempt to mask the default DOOR // +// sounds tied to the invisible lootable object. Please this in both the // +// onOpened and onClosed Events of the "invis_corpse_obj" described in my // +// _kb_lootable_corpse script. // +// // +//////////////////////////////////////////////////////////////////////////////// + +void main() +{ + effect eQuiet = EffectSilence(); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eQuiet, OBJECT_SELF, 120.0f); + PlaySound("as_sw_clothop1"); + AssignCommand(GetLastOpenedBy(), ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.5f)); +} diff --git a/nwnds_module/spawn_orig_hb.ncs b/nwnds_module/spawn_orig_hb.ncs new file mode 100644 index 000000000..24328384c Binary files /dev/null and b/nwnds_module/spawn_orig_hb.ncs differ diff --git a/nwnds_module/spawn_orig_hb.nss b/nwnds_module/spawn_orig_hb.nss new file mode 100644 index 000000000..8dc98f467 --- /dev/null +++ b/nwnds_module/spawn_orig_hb.nss @@ -0,0 +1,8 @@ + +#include "spawn_main" + +void main() +{ + Spawn(); +} + diff --git a/nwnds_module/spawn_pseudohb.ncs b/nwnds_module/spawn_pseudohb.ncs new file mode 100644 index 000000000..986a99a89 Binary files /dev/null and b/nwnds_module/spawn_pseudohb.ncs differ diff --git a/nwnds_module/spawn_pseudohb.nss b/nwnds_module/spawn_pseudohb.nss new file mode 100644 index 000000000..7cb6de1c4 --- /dev/null +++ b/nwnds_module/spawn_pseudohb.nss @@ -0,0 +1,33 @@ +// +// NESS V8.1 +// +// Spawn Pseudo-heartbeat +// +// This script is executed when a PC enters an otherwise empty area +// + +#include "spawn_functions" + +void main() +{ + + object oArea = OBJECT_SELF; + + // No pseudo-heartbeats scheduled, since we just fired this one + SetLocalInt( oArea, SPAWN_HEARTBEAT_SCHEDULED, FALSE ); + + // Do a heartbeat if there are PCs in the area or any spawns up + if ( NeedPseudoHeartbeat( oArea ) ) + { + // This defaults to spawn_sample_hb. You can pass the name of any script + // to use in the function Spawn_OnAreaEnter() + string sHeartbeatFunc = GetLocalString( oArea, SPAWN_HEARTBEAT_SCRIPT ); + + // start actual heartbeat code + ExecuteScript( sHeartbeatFunc, oArea ); + // end actual heartbeat code + + // This function sets SPAWN_HEARTBEAT_SCHEDULED to TRUE + ScheduleNextPseudoHeartbeat( oArea ); + } +} \ No newline at end of file diff --git a/nwnds_module/spawn_sample_hb.ncs b/nwnds_module/spawn_sample_hb.ncs new file mode 100644 index 000000000..24328384c Binary files /dev/null and b/nwnds_module/spawn_sample_hb.ncs differ diff --git a/nwnds_module/spawn_sample_hb.nss b/nwnds_module/spawn_sample_hb.nss new file mode 100644 index 000000000..8dc98f467 --- /dev/null +++ b/nwnds_module/spawn_sample_hb.nss @@ -0,0 +1,8 @@ + +#include "spawn_main" + +void main() +{ + Spawn(); +} + diff --git a/nwnds_module/spawn_sc_cmptrig.ncs b/nwnds_module/spawn_sc_cmptrig.ncs new file mode 100644 index 000000000..7e96921f4 Binary files /dev/null and b/nwnds_module/spawn_sc_cmptrig.ncs differ diff --git a/nwnds_module/spawn_sc_cmptrig.nss b/nwnds_module/spawn_sc_cmptrig.nss new file mode 100644 index 000000000..feb945593 --- /dev/null +++ b/nwnds_module/spawn_sc_cmptrig.nss @@ -0,0 +1,55 @@ +// +// NESS +// Camp Trigger Scripts v8.1.3 +// +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +void DestroyCamp(object oCamp, float fCampDecay, int nSaveState); +// +// +void main() +{ + // Initialize Variables + object oSpawned; + string sObject; + int iCount, nCampNumP, nCampNumC; + + // Retrieve Script + int nCampTriggerScript = GetLocalInt(OBJECT_SELF, "CampTriggerScript"); + + // Invalid Script + if (nCampTriggerScript == -1) + { + return; + } + + object oCamp = OBJECT_SELF; + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + float fCampDecay = GetLocalFloat(oSpawn, "f_CampDecay"); + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Destroy Camp + if (nCampTriggerScript == 0) + { + DestroyCamp(oCamp, fCampDecay, FALSE); + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// +} diff --git a/nwnds_module/spawn_sc_deactiv.ncs b/nwnds_module/spawn_sc_deactiv.ncs new file mode 100644 index 000000000..7e2826891 Binary files /dev/null and b/nwnds_module/spawn_sc_deactiv.ncs differ diff --git a/nwnds_module/spawn_sc_deactiv.nss b/nwnds_module/spawn_sc_deactiv.nss new file mode 100644 index 000000000..7b551aa79 --- /dev/null +++ b/nwnds_module/spawn_sc_deactiv.nss @@ -0,0 +1,46 @@ +// +// Deactivation Scripts +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void main() +{ + // Retrieve Script + int nDeactivateScript = GetLocalInt(OBJECT_SELF, "DeactivateScript"); + + // Invalid Script + if (nDeactivateScript == -1) + { + return; + } + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + if (nDeactivateScript == 0) + { + // Explode with Gore when Deactivated + effect eVisual = EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE); + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVisual, GetLocation(OBJECT_SELF), 0.0); + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + +} diff --git a/nwnds_module/spawn_sc_death.ncs b/nwnds_module/spawn_sc_death.ncs new file mode 100644 index 000000000..f328f9dc2 Binary files /dev/null and b/nwnds_module/spawn_sc_death.ncs differ diff --git a/nwnds_module/spawn_sc_death.nss b/nwnds_module/spawn_sc_death.nss new file mode 100644 index 000000000..69712d04f --- /dev/null +++ b/nwnds_module/spawn_sc_death.nss @@ -0,0 +1,67 @@ +// +// Death Scripts +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void main() +{ + // Initialize Variables + + // Retrieve Script Number + int nDeathScript = GetLocalInt(OBJECT_SELF, "DeathScript"); + + // Invalid Script + if (nDeathScript == -1) + { + return; + } + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + if (nDeathScript == 0) + { + } + // + + // Scared Prey + if (nDeathScript == 10) + { + object oKiller = GetLastKiller(); + if (GetLocalInt(oKiller, "Predator") == TRUE) + { + // Feed the Predator + int nCurrentHungerState = GetLocalInt(oKiller, "CurrentHungerState"); + int nKills = GetLocalInt(oKiller, "Kills"); + nKills++; + int nFed = 5 + (nKills / 25); + nCurrentHungerState = nCurrentHungerState + 1 + nFed; + SendMessageToAllDMs("Predator is Fed (" + IntToString(nFed) + ")."); + AssignCommand(oKiller, SpeakString("That's " + IntToString(nKills) + " prey I've killed! I get " + IntToString(nFed) + " more food!")); + SetLocalInt(oKiller, "Kills", nKills); + SetLocalInt(oKiller, "CurrentHungerState", nCurrentHungerState); + } + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + // Record that we Ran Script + SetLocalInt(OBJECT_SELF, "DeathScriptRan", TRUE); +} diff --git a/nwnds_module/spawn_sc_hbeat.ncs b/nwnds_module/spawn_sc_hbeat.ncs new file mode 100644 index 000000000..02e40263e Binary files /dev/null and b/nwnds_module/spawn_sc_hbeat.ncs differ diff --git a/nwnds_module/spawn_sc_hbeat.nss b/nwnds_module/spawn_sc_hbeat.nss new file mode 100644 index 000000000..55b43cd15 --- /dev/null +++ b/nwnds_module/spawn_sc_hbeat.nss @@ -0,0 +1,180 @@ +// +// Heartbeat Scripts +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void main() +{ + // Retrieve Script Number + int nHeartbeatScript = GetLocalInt(OBJECT_SELF, "HeartbeatScript"); + + // Invalid Script + if (nHeartbeatScript == -1) + { + return; + } + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + if (nHeartbeatScript == 0) + { + if (d2() == 2) + { + ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED); + } + } + // + + // + if (nHeartbeatScript == 2) + { + object oCentralObject; + location lCentralObject, lLocation; + vector vCentralObject, vLocation; + float fAngle, fRadius, fLocationX, fLocationY; + + // Add Multiple Actions per HeartbeatScript + int nNth; + for (nNth = 1; nNth <= 10; nNth++) + { + // Central Object + oCentralObject = GetObjectByTag("CentralObject"); + lCentralObject = GetLocation(oCentralObject); + vCentralObject = GetPositionFromLocation(lCentralObject); + + // Retreive and Increment Angle by 10 Degrees + fAngle = GetLocalFloat(OBJECT_SELF, "Angle"); + fAngle = fAngle + 5.0; + if (fAngle >= 360.0) + { + fAngle = 0.0; + } + + // Create New Location + fRadius = 5.0; + fLocationX = fRadius * cos(fAngle); + fLocationY = fRadius * sin(fAngle); + vLocation = Vector(fLocationX, fLocationY, 0.0); + lLocation = Location(GetArea(OBJECT_SELF), vCentralObject + vLocation, 0.0); + + // Move to New Location + ActionMoveToLocation(lLocation, TRUE); + + // Record New Angle + SetLocalFloat(OBJECT_SELF, "Angle", fAngle); + } + } + // + + // Script 001 - Flavor text for dockworkers + if (nHeartbeatScript == 1) + { + ActionSpeakString("Hand me that rope, would ya?"); + } + // + + // Check if a Placeable was Used + if (nHeartbeatScript == 5) + { + object oPC = GetLastUsedBy(); + SendMessageToPC(oPC, "You were the last user."); + } + // + + // Prowling Predator + if (nHeartbeatScript == 10) + { + string sState; + int nCurrentHungerState = GetLocalInt(OBJECT_SELF, "CurrentHungerState"); + nCurrentHungerState--; + SetLocalInt(OBJECT_SELF, "Predator", TRUE); + + if (GetLocalInt(OBJECT_SELF, "Sleeping") == FALSE) + { + // Hungry Yet? + if (nCurrentHungerState <= 0) + { + if (nCurrentHungerState < -10) + { + // Death Comes to Those who Cannot Hunt + sState = "Dead from Starvation"; + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints(OBJECT_SELF)), OBJECT_SELF); + } + else + { + if (nCurrentHungerState > -5) + { + // Hungry! + sState = "Hungry and Prowling"; + } + else + { + // Dying of Starvation! + sState = "Starving"; + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetMaxHitPoints(OBJECT_SELF)/6), OBJECT_SELF); + } + // Prowl + if (GetIsInCombat(OBJECT_SELF) == FALSE) + { + ClearAllActions(); + ActionMoveAwayFromLocation(GetLocation(OBJECT_SELF), TRUE, 20.0); + } + } + } + else + { + if (nCurrentHungerState < 10) + { + if (nCurrentHungerState > 5) + { + // Happy and Healing. + sState = "Fat and Happy"; + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(OBJECT_SELF)/6), OBJECT_SELF, 0.0); + } + else + { + // Happy + sState = "Happy"; + } + } + else + { + sState = "Fat and Sleeping"; + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSleep(), OBJECT_SELF, 12.0); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SLEEP), OBJECT_SELF, 0.0); + SetLocalInt(OBJECT_SELF, "Sleeping", TRUE); + DelayCommand(10.0, SetLocalInt(OBJECT_SELF, "Sleeping", FALSE)); + } + } + } + else + { + sState = "Fat and Sleeping"; + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_IMP_SLEEP), OBJECT_SELF, 0.0); + } + SendMessageToAllDMs(sState + " (" + IntToString(nCurrentHungerState) + ")."); + SpeakString("I am " + sState + "."); + SetLocalInt(OBJECT_SELF, "CurrentHungerState", nCurrentHungerState); + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + +} diff --git a/nwnds_module/spawn_sc_patrol.ncs b/nwnds_module/spawn_sc_patrol.ncs new file mode 100644 index 000000000..57a8f1bd4 Binary files /dev/null and b/nwnds_module/spawn_sc_patrol.ncs differ diff --git a/nwnds_module/spawn_sc_patrol.nss b/nwnds_module/spawn_sc_patrol.nss new file mode 100644 index 000000000..c539261ee --- /dev/null +++ b/nwnds_module/spawn_sc_patrol.nss @@ -0,0 +1,62 @@ +// +// NESS +// Patrol Scripts v8.1.3 +// +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void main() +{ + // Retrieve Script Number + int nPatrolScript = GetLocalInt(OBJECT_SELF, "PatrolScript"); + + // Retrieve Stop Information + int nStopNumber = GetLocalInt(OBJECT_SELF, "PR_NEXTSTOP"); + object oStop = GetLocalObject(OBJECT_SELF, "PR_SN" + PadIntToString(nStopNumber, 2)); + + // Invalid Script + if (nPatrolScript == -1) + { + return; + } + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + if (nPatrolScript == 0) + { + ActionDoCommand(SpeakString("Example!")); + } + // + + // Turn Off Lights + if (nPatrolScript == 7) + { + object oLight = GetNearestObjectByTag("Light", oStop); + if ((GetIsDay() == TRUE && GetPlaceableIllumination(oLight) == TRUE) + || (GetIsNight() == TRUE && GetPlaceableIllumination(oLight) == FALSE)) + { + ActionDoCommand(DoPlaceableObjectAction(oLight, PLACEABLE_ACTION_USE)); + } + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + +} diff --git a/nwnds_module/spawn_sc_spawn.ncs b/nwnds_module/spawn_sc_spawn.ncs new file mode 100644 index 000000000..ea02fd788 Binary files /dev/null and b/nwnds_module/spawn_sc_spawn.ncs differ diff --git a/nwnds_module/spawn_sc_spawn.nss b/nwnds_module/spawn_sc_spawn.nss new file mode 100644 index 000000000..76044f12f --- /dev/null +++ b/nwnds_module/spawn_sc_spawn.nss @@ -0,0 +1,309 @@ +// +// Spawn and Despawn Scripts +// +#include "spawn_functions" +// +object GetChildByTag(object oSpawn, string sChildTag); +object GetChildByNumber(object oSpawn, int nChildNum); +object GetSpawnByID(int nSpawnID); +void DeactivateSpawn(object oSpawn); +void DeactivateSpawnsByTag(string sSpawnTag); +void DeactivateAllSpawns(); +void DespawnChildren(object oSpawn); +void DespawnChildrenByTag(object oSpawn, string sSpawnTag); +// +// +void main() +{ + // Retrieve Script Number + int nSpawnScript = GetLocalInt(OBJECT_SELF, "SpawnScript"); + int nDespawnScript = GetLocalInt(OBJECT_SELF, "DespawnScript"); + + // Invalid Script + if (nSpawnScript == -1 || nDespawnScript == -1) + { + return; + } + + if (nSpawnScript > 0) + { + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + // Dummy Script - Never Use + if (nSpawnScript == 0) + { + return; + } + // + + if (nSpawnScript == 1) + { + // lamplighter + int nLit = GetLocalInt(OBJECT_SELF, "torchesLit"); + if (! nLit) + { + //SendMessageToPC(GetFirstPC(), "lighting torches"); + SetLocalInt(OBJECT_SELF, "torchesLit", 1); + + // find all objects in area with tag lightableTorch + object oArea = GetArea(OBJECT_SELF); + object oTorch = GetFirstObjectInArea(oArea); + int nCount = 0; + string sTorchTag = "lightableTorch"; + + while (oTorch != OBJECT_INVALID) + { + if (GetTag(oTorch) == sTorchTag) + { + nCount++; + AssignCommand(oTorch, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + DelayCommand(0.4, SetPlaceableIllumination(oTorch, TRUE)); + SetLocalInt(oTorch,"NW_L_AMION",1); + } + + oTorch = GetNextObjectInArea(oArea); + } + + if (nCount > 0) + { + DelayCommand(0.1,RecomputeStaticLighting(oArea)); + } + + return; + } + }// end spawn script 1 + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + } + + if (nDespawnScript > 0) + { + +// +// Only Make Modifications Between These Lines +// ------------------------------------------- + + + // Script 00 + // Dummy Script - Never Use + if (nDespawnScript == 0) + { + return; + } + // + + if (nDespawnScript == 1) + { + + // lampdouser + //SendMessageToPC(GetFirstPC(), "dousing torches"); + + // find all objects in area with tag lightableTorch + object oArea = GetArea(OBJECT_SELF); + object oTorch = GetFirstObjectInArea(oArea); + int nCount = 0; + string sTorchTag = "lightableTorch"; + + while (oTorch != OBJECT_INVALID) + { + if (GetTag(oTorch) == sTorchTag) + { + nCount++; + AssignCommand(oTorch,PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); + DelayCommand(0.4, SetPlaceableIllumination(oTorch, FALSE)); + SetLocalInt(oTorch,"NW_L_AMION",0); + } + + oTorch = GetNextObjectInArea(oArea); + } + + if (nCount > 0) + { + DelayCommand(0.1,RecomputeStaticLighting(oArea)); + } + + return; + } + + // Area Cleanup Example + if (nDespawnScript == 999) + { + // Settings + int nMerchantPrefixLetters = 3; + string sMerchantPrefix = "MC_"; + int nChestPrefixLetters = 3; + string sChestPrefix = "CH_"; + + // Create an Area Merchant List + int nMerchantNum; + string sMerchantNum; + int nNth = 1; + object oMerchant = GetNearestObject(OBJECT_TYPE_STORE, OBJECT_SELF, nNth); + while (oMerchant != OBJECT_INVALID) + { + if (GetStringLeft(GetTag(oMerchant), nMerchantPrefixLetters) == sMerchantPrefix) + { + nMerchantNum++; + sMerchantNum = "Merchant" + PadIntToString(nMerchantNum, 2); + SetLocalObject(OBJECT_SELF, sMerchantNum, oMerchant); + } + nNth++; + oMerchant = GetNearestObject(OBJECT_TYPE_STORE, OBJECT_SELF, nNth); + } + + // Create an Area Chest List + int nChestNum; + string sChestNum; + nNth = 1; + object oChest = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth); + while (oChest != OBJECT_INVALID) + { + if (GetStringLeft(GetTag(oChest), nChestPrefixLetters) == sChestPrefix) + { + nChestNum++; + sChestNum = "Chest" + PadIntToString(nChestNum, 2); + SetLocalObject(OBJECT_SELF, sChestNum, oChest); + } + nNth++; + oChest = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth); + } + + // Cleanup Creatures + nNth = 1; + object oCreature = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, nNth); + while (oCreature != OBJECT_INVALID) + { + // Destroy Creatures NOT Spawned by Spawner + if (GetLocalObject(oCreature, "ParentSpawn") == OBJECT_INVALID) + { + DestroyObject(oCreature); + } + + // Cleanup Corpses + if (GetIsDead(oCreature) == TRUE) + { + AssignCommand(oCreature, SetIsDestroyable(TRUE, TRUE)); + DestroyObject(oCreature); + } + + nNth++; + oCreature = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, nNth); + } + + // Cleanup All Items in Area + string sItemTag; + int nStack; + int nCurrentMerchant = 0; + int nCurrentChest = 0; + nNth = 1; + object oItem = GetNearestObject(OBJECT_TYPE_ITEM, OBJECT_SELF, nNth); + while (oItem != OBJECT_INVALID) + { + // Retrieve Item Information + sItemTag = GetTag(oItem); + nStack = GetNumStackedItems(oItem); + + // Destroy Item + DestroyObject(oItem); + + // Place Items on Merchants + if (nMerchantNum > 0) + { + if (nCurrentMerchant = nMerchantNum - 1) + { + nCurrentMerchant = 0; + } + oMerchant = GetLocalObject(OBJECT_SELF, "Merchant" + PadIntToString(nCurrentMerchant, 2)); + CreateItemOnObject(sItemTag, oMerchant, nStack); + nCurrentMerchant++; + } + // Place Items in Chests + else if (nChestNum > 0) + { + if (nCurrentChest = nChestNum -1) + { + nCurrentChest = 0; + } + oChest = GetLocalObject(OBJECT_SELF, "Chest" + PadIntToString(nCurrentChest, 2)); + CreateItemOnObject(sItemTag, oChest, nStack); + nCurrentChest++; + } + + nNth++; + oItem = GetNearestObject(OBJECT_TYPE_ITEM, OBJECT_SELF, nNth); + } + + // Cleanup 'Body Bags' + nNth = 1; + oItem = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth); + while (oItem != OBJECT_INVALID) + { + if(GetTag(oItem) == "Body Bag") + { + // Check for Inventory + if (GetHasInventory(oItem) == TRUE) + { + object oInventoryItem = GetFirstItemInInventory(oItem); + while (oInventoryItem != OBJECT_INVALID) + { + // Retrieve Item Information + sItemTag = GetTag(oInventoryItem); + nStack = GetNumStackedItems(oInventoryItem); + + // Destroy Item + DestroyObject(oInventoryItem); + + // Place Items on Merchants + if (nMerchantNum > 0) + { + if (nCurrentMerchant = nMerchantNum - 1) + { + nCurrentMerchant = 0; + } + oMerchant = GetLocalObject(OBJECT_SELF, "Merchant" + PadIntToString(nCurrentMerchant, 2)); + CreateItemOnObject(sItemTag, oMerchant, nStack); + nCurrentMerchant++; + } + // Place Items in Chests + else if (nChestNum > 0) + { + if (nCurrentChest = nChestNum -1) + { + nCurrentChest = 0; + } + oChest = GetLocalObject(OBJECT_SELF, "Chest" + PadIntToString(nCurrentChest, 2)); + CreateItemOnObject(sItemTag, oChest, nStack); + nCurrentChest++; + } + oInventoryItem = GetNextItemInInventory(oItem); + } + } + + // Destroy Body Bag + DestroyObject(oItem); + } + nNth++; + oItem = GetNearestObject(OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nNth); + } + } + // + + +// ------------------------------------------- +// Only Make Modifications Between These Lines +// + + } + + // Clean Up + SetLocalInt(OBJECT_SELF, "SpawnScript", 0); + SetLocalInt(OBJECT_SELF, "DespawnScript", 0); +} diff --git a/nwnds_module/spawn_sit.ncs b/nwnds_module/spawn_sit.ncs new file mode 100644 index 000000000..87f354037 Binary files /dev/null and b/nwnds_module/spawn_sit.ncs differ diff --git a/nwnds_module/spawn_sit.nss b/nwnds_module/spawn_sit.nss new file mode 100644 index 000000000..5774ca08b --- /dev/null +++ b/nwnds_module/spawn_sit.nss @@ -0,0 +1,91 @@ + //:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; + + +#include "x2_inc_switches" +void main() +{ + string sTag; + object oNPC; + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + } // master does not exist - remove X3_HORSE_OWNER_TAG + } // look in module + } // look for master + + /* 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); + } + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS,1.0,10000.0f); +} diff --git a/nwnds_module/spawn_smpl_onen2.ncs b/nwnds_module/spawn_smpl_onen2.ncs new file mode 100644 index 000000000..38856198f Binary files /dev/null and b/nwnds_module/spawn_smpl_onen2.ncs differ diff --git a/nwnds_module/spawn_smpl_onen2.nss b/nwnds_module/spawn_smpl_onen2.nss new file mode 100644 index 000000000..20fd89809 --- /dev/null +++ b/nwnds_module/spawn_smpl_onen2.nss @@ -0,0 +1,34 @@ +// +// NESS V8.1.2 +// +// Spawn sample onEnter, version 2 +// +// If you want to use pseudo-heartbeats and do not already have an area onEnter +// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to +// your existing onEnter handler. Note that you use this (and +// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb. +// + +#include "spawn_functions" + +void main() +{ + // Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat + // script to execute, the heartbeat duration, and a delay for the first + // heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as + // if it were called like: + // Spawn_OnAreaEnter( "spawn_sample_hb", 6.0, 0.0 ); + + if ( GetIsAreaAboveGround( OBJECT_SELF ) && + ! GetIsAreaNatural( OBJECT_SELF ) ) + { + // Indoors - no delay on the first HB + Spawn_OnAreaEnter( "spawn_sample_hb", 10.0 ); + } + + else + { + // Outdoors or underground - do a 3 second delay on the first HB + Spawn_OnAreaEnter( "spawn_sample_hb", 10.0, 3.0 ); + } +} \ No newline at end of file diff --git a/nwnds_module/spawn_smpl_onent.ncs b/nwnds_module/spawn_smpl_onent.ncs new file mode 100644 index 000000000..b52692112 Binary files /dev/null and b/nwnds_module/spawn_smpl_onent.ncs differ diff --git a/nwnds_module/spawn_smpl_onent.nss b/nwnds_module/spawn_smpl_onent.nss new file mode 100644 index 000000000..93800090e --- /dev/null +++ b/nwnds_module/spawn_smpl_onent.nss @@ -0,0 +1,41 @@ +// +// NESS V8.1 +// +// Spawn sample onEnter +// +// If you want to use pseudo-heartbeats and do not already have an area onEnter +// script, you can use this one. Otherwise, just add Spawn_OnAreaEnter() to +// your existing onEnter handler. Note that you use this (and +// SpawnOnAreaExit()) INSTEAD OF Spawn() / spawn_sample_hb. +// + +#include "spawn_functions" +#include "tgdc_explore_inc" +#include "ar_db_main" + +void main() +{ + //NC:EDIT + //added to enable defiling aura on NPC's + //7-3-06 + object oEntering = GetEnteringObject(); + object oArea = GetArea(oEntering); + SetLocalInt(oArea, "X2_L_WILD_MAGIC", 1); + //NC:EDIT + + //NC:EDIT + // added arsx area index to area + SetLocalInt(oArea,ARSX_AREA_INDEX,ARSX_IndexArea(oArea)); + + //Heatstroke's Edit + //Added code to enable player exploration + PlayerExplore(oEntering, 0); + + // Spawn_OnAreaEnter() can take three arguments - the name of the heartbeat + // script to execute, the heartbeat duration, and a delay for the first + // heartbeat. They default to spawn_sample_hb, 6.0, and 0.0 respectively; as + // if it were called like: + Spawn_OnAreaEnter( "spawn_sample_hb", 6.0, 0.0 ); + + //Spawn_OnAreaEnter(); +} diff --git a/nwnds_module/spawn_smpl_onext.ncs b/nwnds_module/spawn_smpl_onext.ncs new file mode 100644 index 000000000..b5ac3ece7 Binary files /dev/null and b/nwnds_module/spawn_smpl_onext.ncs differ diff --git a/nwnds_module/spawn_smpl_onext.nss b/nwnds_module/spawn_smpl_onext.nss new file mode 100644 index 000000000..fcc082753 --- /dev/null +++ b/nwnds_module/spawn_smpl_onext.nss @@ -0,0 +1,17 @@ +// +// NESS V8.1 +// +// Spawn sample onExit +// +// If you want to use pseudo-heartbeats and do not already have an area onExit +// script, you can use this one. Otherwise, just add Spawn_OnAreaExit() to +// your existing onExit handler. Note that you use this (and +// SpawnOnAreaEnter()) INSTEAD OF Spawn() / spawn_sample_hb. +// + +#include "spawn_functions" + +void main() +{ + Spawn_OnAreaExit(); +} \ No newline at end of file diff --git a/nwnds_module/spawn_timefuncs.nss b/nwnds_module/spawn_timefuncs.nss new file mode 100644 index 000000000..a16df7ecc --- /dev/null +++ b/nwnds_module/spawn_timefuncs.nss @@ -0,0 +1,156 @@ +// +// +// ALFA NESS +// Time functions v1.1 +// +// Do NOT Modify this File +// See 'spawn__readme' for Instructions +// +// +//:://///////////////////////////////////////////// +//:: Time Conversion Functions +//:: spawn_timefuncs +//::////////////////////////////////////////////// +/* + These functions allow Calendar y/m/d/h/m/s to + be converted to seconds of real time which can be used as + a basis for time comparisons. Time is reckoned + in seconds from the NWN Epoch - 1340 DR. + + Note that HoursToRealSeconds() is equivalent to the Bioware function + HoursToSeconds(); it is included for completeness. +*/ +//::////////////////////////////////////////////// +//:: Created By: Cereborn +//:: Created On: November 22, 2002 +//::////////////////////////////////////////////// + +int CLOCK_DEBUG = FALSE; + +int SPAWN_EPOCH = 1340; + +void clockDebug(string str) +{ + if (CLOCK_DEBUG) + { + SendMessageToAllDMs(str); + object oPC = GetFirstPC(); + if (! GetIsDM(oPC)) + SendMessageToPC(oPC, str); + WriteTimestampedLogEntry(str); + } +} + +// Get the current time (elapsed since the Epoch) in real seconds +int GetCurrentRealSeconds(); + +// Convert a calendar (game) time to real seconds +int CalendarToRealSeconds(int year, int month, int day, int hour, int minute, + int second); + +// Returns number of real seconds in the # of specified (game) years +int YearsToRealSeconds(int years); + +// Returns number of real seconds in the # of specified (game) months +int MonthsToRealSeconds(int months); + +// Returns number of real seconds in the # of specified (game) days +int DaysToRealSeconds(int days); + +// Returns number of real seconds in the # of specified (game) hours +int HoursToRealSeconds(int hours); + +int YearsToRealSeconds(int years) +{ + return MonthsToRealSeconds(years*12); +} + +int MonthsToRealSeconds(int months) +{ + return DaysToRealSeconds(months*28); +} + +int DaysToRealSeconds(int days) +{ + return FloatToInt(HoursToSeconds(days*24)); +} + +int HoursToRealSeconds(int hours) +{ + return FloatToInt(HoursToSeconds(hours)); +} + +int CalendarToRealSeconds(int year, int month, int day, int hour, int minute, + int second) +{ + if (year < SPAWN_EPOCH) + year = SPAWN_EPOCH; + if (month < 1) + month = 1; + if (day < 1) + day = 1; + + return (YearsToRealSeconds(year-SPAWN_EPOCH) + + MonthsToRealSeconds(month-1) + + DaysToRealSeconds(day-1) + + FloatToInt(HoursToSeconds(hour)) + + (minute*60) + + second); +} + + +int GetCurrentRealSeconds() +{ + //clockDebug("Converting " + IntToString(GetCalendarYear()) + " " + + // IntToString(GetCalendarMonth()) + " " + + // IntToString(GetCalendarDay()) + " " + + // IntToString(GetTimeHour()) + " " + + // IntToString(GetTimeMinute()) + " " + + // IntToString(GetTimeSecond())); + + return CalendarToRealSeconds(GetCalendarYear(), GetCalendarMonth(), + GetCalendarDay(), GetTimeHour(), GetTimeMinute(), GetTimeSecond()); +} + +string RealSecondsToString(int nRealSeconds) +{ + int nMod; + int nRem; + string sDateTime = ""; + + nMod = nRealSeconds / YearsToRealSeconds(1); + nRem = nRealSeconds % YearsToRealSeconds(1); + + sDateTime = IntToString(nMod + SPAWN_EPOCH); + + nMod = nRem / MonthsToRealSeconds(1); + nRem = nRem % MonthsToRealSeconds(1); + + sDateTime += " " + IntToString(nMod+1); + + nMod = nRem / DaysToRealSeconds(1); + nRem = nRem % DaysToRealSeconds(1); + + sDateTime += " " + IntToString(nMod+1); + + nMod = nRem / FloatToInt(HoursToSeconds(1)); + nRem = nRem % FloatToInt(HoursToSeconds(1)); + + sDateTime += " " + IntToString(nMod) + ":"; + + nMod = nRem / 60; + nRem = nRem % 60; + + if (nMod < 10) + sDateTime += "0" + IntToString(nMod) + ":"; + else + sDateTime += IntToString(nMod) + ":"; + + if (nRem < 10) + sDateTime += "0" + IntToString(nRem); + else + sDateTime += IntToString(nRem); + + return sDateTime; +} + diff --git a/nwnds_module/spawn_used_corps.ncs b/nwnds_module/spawn_used_corps.ncs new file mode 100644 index 000000000..7b93683c6 Binary files /dev/null and b/nwnds_module/spawn_used_corps.ncs differ diff --git a/nwnds_module/spawn_used_corps.nss b/nwnds_module/spawn_used_corps.nss new file mode 100644 index 000000000..5445eb3c4 --- /dev/null +++ b/nwnds_module/spawn_used_corps.nss @@ -0,0 +1,29 @@ +// +// NESS V8.0 +// Spawn Used Corpse +// +// Brought into the NESS distribution for Version 8.0 and beyond. Original +// header below. +// + +//////////////////////////////////////////////////////////////////////////////// +// // // +// _kb_loot_crouch // VERSION 1.0 // +// // // +// by Keron Blackfeld on 07/27/2002 //////////////////////////// +// // +// email Questions and Comments to: keron@broadswordgaming.com or catch me // +// in Bioware's NWN Community - Builder's NWN Scripting Forum // +// // +//////////////////////////////////////////////////////////////////////////////// +// // +// PLACE THIS SCRIPT IN THE ONUSED EVENT OF YOUR "invis_corpse_obj" // +// BLUEPRINT. This script causes the PC opening the corpse to crouch down // +// and visibly reach for the corpse. // +// // +//////////////////////////////////////////////////////////////////////////////// +void main() +{ + object oPC = GetLastUsedBy(); + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f)); +} diff --git a/nwnds_module/spawnb_cc_activ.ncs b/nwnds_module/spawnb_cc_activ.ncs new file mode 100644 index 000000000..0cc56a587 Binary files /dev/null and b/nwnds_module/spawnb_cc_activ.ncs differ diff --git a/nwnds_module/spawnb_cc_activ.nss b/nwnds_module/spawnb_cc_activ.nss new file mode 100644 index 000000000..bdec25487 --- /dev/null +++ b/nwnds_module/spawnb_cc_activ.nss @@ -0,0 +1,16 @@ +// +// Spawn Banner +// Conversation Check +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + if (GetLocalInt(oSpawn, "SpawnDeactivated") == TRUE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_dactiv.ncs b/nwnds_module/spawnb_cc_dactiv.ncs new file mode 100644 index 000000000..fc5e113bf Binary files /dev/null and b/nwnds_module/spawnb_cc_dactiv.ncs differ diff --git a/nwnds_module/spawnb_cc_dactiv.nss b/nwnds_module/spawnb_cc_dactiv.nss new file mode 100644 index 000000000..ccdd93915 --- /dev/null +++ b/nwnds_module/spawnb_cc_dactiv.nss @@ -0,0 +1,16 @@ +// +// Spawn Banner +// Conversation Check +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + if (GetLocalInt(oSpawn, "SpawnDeactivated") == FALSE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_dump.ncs b/nwnds_module/spawnb_cc_dump.ncs new file mode 100644 index 000000000..5101e25d2 Binary files /dev/null and b/nwnds_module/spawnb_cc_dump.ncs differ diff --git a/nwnds_module/spawnb_cc_dump.nss b/nwnds_module/spawnb_cc_dump.nss new file mode 100644 index 000000000..effc78efc --- /dev/null +++ b/nwnds_module/spawnb_cc_dump.nss @@ -0,0 +1,15 @@ +// +// Spawn Banner +// Conversation Check +// + +#include "spawn_functions" + +int StartingConditional() +{ + if (NESS_IsModuleSpawnDumping()) + { + return FALSE; + } + return TRUE; +} diff --git a/nwnds_module/spawnb_cc_nodump.ncs b/nwnds_module/spawnb_cc_nodump.ncs new file mode 100644 index 000000000..1ab1629dd Binary files /dev/null and b/nwnds_module/spawnb_cc_nodump.ncs differ diff --git a/nwnds_module/spawnb_cc_nodump.nss b/nwnds_module/spawnb_cc_nodump.nss new file mode 100644 index 000000000..bed4a51fa --- /dev/null +++ b/nwnds_module/spawnb_cc_nodump.nss @@ -0,0 +1,15 @@ +// +// Spawn Banner +// Conversation Check +// + +#include "spawn_functions" + +int StartingConditional() +{ + if (NESS_IsModuleSpawnDumping()) + { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/spawnb_cc_notrck.ncs b/nwnds_module/spawnb_cc_notrck.ncs new file mode 100644 index 000000000..2b541ae47 Binary files /dev/null and b/nwnds_module/spawnb_cc_notrck.ncs differ diff --git a/nwnds_module/spawnb_cc_notrck.nss b/nwnds_module/spawnb_cc_notrck.nss new file mode 100644 index 000000000..68ba00507 --- /dev/null +++ b/nwnds_module/spawnb_cc_notrck.nss @@ -0,0 +1,15 @@ +// +// Spawn Banner +// Conversation Check +// + +#include "spawn_functions" + +int StartingConditional() +{ + if (NESS_IsModuleSpawnTracking()) + { + return TRUE; + } + return FALSE; +} diff --git a/nwnds_module/spawnb_cc_nsclog.ncs b/nwnds_module/spawnb_cc_nsclog.ncs new file mode 100644 index 000000000..6fccacb79 Binary files /dev/null and b/nwnds_module/spawnb_cc_nsclog.ncs differ diff --git a/nwnds_module/spawnb_cc_nsclog.nss b/nwnds_module/spawnb_cc_nsclog.nss new file mode 100644 index 000000000..b5639e616 --- /dev/null +++ b/nwnds_module/spawnb_cc_nsclog.nss @@ -0,0 +1,18 @@ +// +// Spawn Banner +// Conversation Check +// Spawn Delay Debugging off +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + object oArea = GetArea(oSpawn); + if (GetLocalInt(oArea, "SpawnCountDebug") == TRUE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_nsdlog.ncs b/nwnds_module/spawnb_cc_nsdlog.ncs new file mode 100644 index 000000000..f7c0ecb08 Binary files /dev/null and b/nwnds_module/spawnb_cc_nsdlog.ncs differ diff --git a/nwnds_module/spawnb_cc_nsdlog.nss b/nwnds_module/spawnb_cc_nsdlog.nss new file mode 100644 index 000000000..55372b44e --- /dev/null +++ b/nwnds_module/spawnb_cc_nsdlog.nss @@ -0,0 +1,18 @@ +// +// Spawn Banner +// Conversation Check +// Spawn Delay Debugging off +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + object oArea = GetArea(oSpawn); + if (GetLocalInt(oArea, "SpawnDelayDebug") == TRUE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_sclog.ncs b/nwnds_module/spawnb_cc_sclog.ncs new file mode 100644 index 000000000..a54d13a75 Binary files /dev/null and b/nwnds_module/spawnb_cc_sclog.ncs differ diff --git a/nwnds_module/spawnb_cc_sclog.nss b/nwnds_module/spawnb_cc_sclog.nss new file mode 100644 index 000000000..7eb6873d1 --- /dev/null +++ b/nwnds_module/spawnb_cc_sclog.nss @@ -0,0 +1,18 @@ +// +// Spawn Banner +// Conversation Check +// Spawn Delay Debugging on +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + object oArea = GetArea(oSpawn); + if (GetLocalInt(oArea, "SpawnCountDebug") == FALSE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_sdlog.ncs b/nwnds_module/spawnb_cc_sdlog.ncs new file mode 100644 index 000000000..3ee926a0c Binary files /dev/null and b/nwnds_module/spawnb_cc_sdlog.ncs differ diff --git a/nwnds_module/spawnb_cc_sdlog.nss b/nwnds_module/spawnb_cc_sdlog.nss new file mode 100644 index 000000000..39507ca6c --- /dev/null +++ b/nwnds_module/spawnb_cc_sdlog.nss @@ -0,0 +1,18 @@ +// +// Spawn Banner +// Conversation Check +// Spawn Delay Debugging on +// +int StartingConditional() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + object oArea = GetArea(oSpawn); + if (GetLocalInt(oArea, "SpawnDelayDebug") == FALSE) + { + return TRUE; + } + else + { + return FALSE; + } +} diff --git a/nwnds_module/spawnb_cc_trck.ncs b/nwnds_module/spawnb_cc_trck.ncs new file mode 100644 index 000000000..8993f6a6d Binary files /dev/null and b/nwnds_module/spawnb_cc_trck.ncs differ diff --git a/nwnds_module/spawnb_cc_trck.nss b/nwnds_module/spawnb_cc_trck.nss new file mode 100644 index 000000000..b12d7cc08 --- /dev/null +++ b/nwnds_module/spawnb_cc_trck.nss @@ -0,0 +1,15 @@ +// +// Spawn Banner +// Conversation Check +// + +#include "spawn_functions" + +int StartingConditional() +{ + if (NESS_IsModuleSpawnTracking()) + { + return FALSE; + } + return TRUE; +} diff --git a/nwnds_module/spawnb_main.nss b/nwnds_module/spawnb_main.nss new file mode 100644 index 000000000..6be386a79 --- /dev/null +++ b/nwnds_module/spawnb_main.nss @@ -0,0 +1,69 @@ +// +// SpawnBanner v1.0 +// +void SpawnBanner(object oPC, object oItem, object oTarget, location lTarget) +{ + object oArea = GetArea(oPC); + + if (GetTag(oTarget) == "SpawnBanner") + { + object oSpawn = GetLocalObject(oTarget, "ParentSpawn"); + + SetCustomToken(999, "\n"); + SetCustomToken(1000, GetLocalString(oSpawn, "f_Flags")); + SetCustomToken(1001, GetLocalString(oSpawn, "f_Template")); + + AssignCommand(oPC, ActionStartConversation(oTarget, "spawn_banner")); + } + else + { + int nState = GetLocalInt(oArea, "SpawnBannerState"); + if (nState == 0) + { + // Show Spawn Banners + SendMessageToAllDMs("showing banners"); + + int nNth; + string sSpawnNum, sSpawnName; + object oSpawn, oBanner; + location lSpawn; + + int nSpawns = GetLocalInt(oArea, "Spawns"); + + for (nNth = 1; nNth <= nSpawns; nNth++) + { + sSpawnNum = "Spawn"; + if (nNth < 10) + { + sSpawnNum = sSpawnNum + "0"; + } + sSpawnNum = sSpawnNum + IntToString(nNth); + oSpawn = GetLocalObject(oArea, sSpawnNum); + lSpawn = GetLocation(oSpawn); + if (GetLocalInt(oSpawn, "SpawnDeactivated") == FALSE) + { + oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_a", lSpawn); + } + else + { + oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_d", lSpawn); + } + SetLocalObject(oBanner, "ParentSpawn", oSpawn); + } + SetLocalInt(oArea, "SpawnBannerState", 1); + } + else + { + // Hide Spawn Banners + int nNth = 1; + object oBanner = GetNearestObjectByTag("SpawnBanner", oPC, nNth); + while (oBanner != OBJECT_INVALID) + { + DestroyObject(oBanner); + nNth++; + oBanner = GetNearestObjectByTag("SpawnBanner", oPC, nNth); + } + SetLocalInt(oArea, "SpawnBannerState", 0); + } + } +} diff --git a/nwnds_module/spawnb_sample_ai.ncs b/nwnds_module/spawnb_sample_ai.ncs new file mode 100644 index 000000000..666feb09b Binary files /dev/null and b/nwnds_module/spawnb_sample_ai.ncs differ diff --git a/nwnds_module/spawnb_sample_ai.nss b/nwnds_module/spawnb_sample_ai.nss new file mode 100644 index 000000000..2d050df37 --- /dev/null +++ b/nwnds_module/spawnb_sample_ai.nss @@ -0,0 +1,18 @@ +// +// SpawnBanner : Sample OnActivateItem Script +// +#include "spawnb_main" + +void main() +{ + object oPC = GetItemActivator(); + object oItem = GetItemActivated(); + object oTarget = GetItemActivatedTarget(); + location lTarget = GetItemActivatedTargetLocation(); + + // Rod of Spawn Banners + if (GetTag(oItem) == "RodofSpawnBanners") + { + SpawnBanner(oPC, oItem, oTarget, lTarget); + } +} diff --git a/nwnds_module/spawnb_sc_activ.ncs b/nwnds_module/spawnb_sc_activ.ncs new file mode 100644 index 000000000..fa72c445d Binary files /dev/null and b/nwnds_module/spawnb_sc_activ.ncs differ diff --git a/nwnds_module/spawnb_sc_activ.nss b/nwnds_module/spawnb_sc_activ.nss new file mode 100644 index 000000000..140b6c563 --- /dev/null +++ b/nwnds_module/spawnb_sc_activ.nss @@ -0,0 +1,17 @@ +// +// Spawn Banner +// Activate Spawn +// + +#include "spawn_functions" + +void main() +{ + object oPC = GetPCSpeaker(); + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + NESS_ActivateSpawn(oSpawn); + DestroyObject(OBJECT_SELF); + object oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_a", GetLocation(oSpawn)); + SetLocalObject(oBanner, "ParentSpawn", oSpawn); + FloatingTextStringOnCreature("Spawn Activated", oPC); +} diff --git a/nwnds_module/spawnb_sc_dactiv.ncs b/nwnds_module/spawnb_sc_dactiv.ncs new file mode 100644 index 000000000..abe739287 Binary files /dev/null and b/nwnds_module/spawnb_sc_dactiv.ncs differ diff --git a/nwnds_module/spawnb_sc_dactiv.nss b/nwnds_module/spawnb_sc_dactiv.nss new file mode 100644 index 000000000..8ad0941be --- /dev/null +++ b/nwnds_module/spawnb_sc_dactiv.nss @@ -0,0 +1,17 @@ +// +// Spawn Banner +// Deactivate Spawn +// +#include "spawn_functions" + +void main() +{ + object oPC = GetPCSpeaker(); + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + NESS_DeactivateSpawn(oSpawn); + DestroyObject(OBJECT_SELF); + object oBanner = CreateObject(OBJECT_TYPE_PLACEABLE, "spawn_ban_d", + GetLocation(oSpawn)); + SetLocalObject(oBanner, "ParentSpawn", oSpawn); + FloatingTextStringOnCreature("Spawn Deactivated", oPC); +} diff --git a/nwnds_module/spawnb_sc_disp.ncs b/nwnds_module/spawnb_sc_disp.ncs new file mode 100644 index 000000000..319ca8099 Binary files /dev/null and b/nwnds_module/spawnb_sc_disp.ncs differ diff --git a/nwnds_module/spawnb_sc_disp.nss b/nwnds_module/spawnb_sc_disp.nss new file mode 100644 index 000000000..c8638c5b6 --- /dev/null +++ b/nwnds_module/spawnb_sc_disp.nss @@ -0,0 +1,14 @@ +// +// Spawn Banner Display Text +// +void main() +{ + object oSpawn = GetLocalObject(OBJECT_SELF, "ParentSpawn"); + object oPC = GetLastUsedBy(); + + string sSpawnName = GetLocalString(oSpawn, "f_Flags"); + string sSpawnTag = GetLocalString(oSpawn, "f_Template"); + + DelayCommand(0.0, FloatingTextStringOnCreature(sSpawnName, oPC)); + DelayCommand(1.0, FloatingTextStringOnCreature(sSpawnTag, oPC)); +} diff --git a/nwnds_module/spawnb_sc_dump.ncs b/nwnds_module/spawnb_sc_dump.ncs new file mode 100644 index 000000000..8c2050a04 Binary files /dev/null and b/nwnds_module/spawnb_sc_dump.ncs differ diff --git a/nwnds_module/spawnb_sc_dump.nss b/nwnds_module/spawnb_sc_dump.nss new file mode 100644 index 000000000..da7914bf3 --- /dev/null +++ b/nwnds_module/spawnb_sc_dump.nss @@ -0,0 +1,12 @@ +// +// Spawn Banner +// Turn Spawn Tracking ON +// + +#include "spawn_functions" + +void main() +{ + NESS_DumpModuleSpawns(); + SendMessageToAllDMs("Spawn dumping enabled"); +} diff --git a/nwnds_module/spawnb_sc_nodump.ncs b/nwnds_module/spawnb_sc_nodump.ncs new file mode 100644 index 000000000..742f5df56 Binary files /dev/null and b/nwnds_module/spawnb_sc_nodump.ncs differ diff --git a/nwnds_module/spawnb_sc_nodump.nss b/nwnds_module/spawnb_sc_nodump.nss new file mode 100644 index 000000000..af9fd94ad --- /dev/null +++ b/nwnds_module/spawnb_sc_nodump.nss @@ -0,0 +1,12 @@ +// +// Spawn Banner +// Turn Spawn Tracking OFF +// + +#include "spawn_functions" + +void main() +{ + NESS_DumpModuleSpawns(FALSE); + SendMessageToAllDMs("Spawn dumping disabled"); +} diff --git a/nwnds_module/spawnb_sc_notrck.ncs b/nwnds_module/spawnb_sc_notrck.ncs new file mode 100644 index 000000000..1d137b780 Binary files /dev/null and b/nwnds_module/spawnb_sc_notrck.ncs differ diff --git a/nwnds_module/spawnb_sc_notrck.nss b/nwnds_module/spawnb_sc_notrck.nss new file mode 100644 index 000000000..10cb11dfc --- /dev/null +++ b/nwnds_module/spawnb_sc_notrck.nss @@ -0,0 +1,12 @@ +// +// Spawn Banner +// Turn Spawn Tracking OFF +// + +#include "spawn_functions" + +void main() +{ + NESS_TrackModuleSpawns(FALSE); + SendMessageToAllDMs("Spawn tracking disabled"); +} diff --git a/nwnds_module/spawnb_sc_nsdlog.ncs b/nwnds_module/spawnb_sc_nsdlog.ncs new file mode 100644 index 000000000..e6cd4a471 Binary files /dev/null and b/nwnds_module/spawnb_sc_nsdlog.ncs differ diff --git a/nwnds_module/spawnb_sc_nsdlog.nss b/nwnds_module/spawnb_sc_nsdlog.nss new file mode 100644 index 000000000..90fe1f25b --- /dev/null +++ b/nwnds_module/spawnb_sc_nsdlog.nss @@ -0,0 +1,11 @@ +// +// Spawn Banner +// Turn Spawn Delay logging ON +// + +void main() +{ + object oArea = GetArea(OBJECT_SELF); + SetLocalInt(oArea, "SpawnDelayDebug", FALSE); + SendMessageToAllDMs("Spawn delay logging disabled"); +} diff --git a/nwnds_module/spawnb_sc_sclog.ncs b/nwnds_module/spawnb_sc_sclog.ncs new file mode 100644 index 000000000..7ccdc1745 Binary files /dev/null and b/nwnds_module/spawnb_sc_sclog.ncs differ diff --git a/nwnds_module/spawnb_sc_sclog.nss b/nwnds_module/spawnb_sc_sclog.nss new file mode 100644 index 000000000..131bc8ecd --- /dev/null +++ b/nwnds_module/spawnb_sc_sclog.nss @@ -0,0 +1,11 @@ +// +// Spawn Banner +// Turn Spawn Delay logging ON +// + +void main() +{ + object oArea = GetArea(OBJECT_SELF); + SetLocalInt(oArea, "SpawnCountDebug", TRUE); + SendMessageToAllDMs("Spawn count logging enabled"); +} diff --git a/nwnds_module/spawnb_sc_sdlog.ncs b/nwnds_module/spawnb_sc_sdlog.ncs new file mode 100644 index 000000000..3c372438d Binary files /dev/null and b/nwnds_module/spawnb_sc_sdlog.ncs differ diff --git a/nwnds_module/spawnb_sc_sdlog.nss b/nwnds_module/spawnb_sc_sdlog.nss new file mode 100644 index 000000000..af01c7650 --- /dev/null +++ b/nwnds_module/spawnb_sc_sdlog.nss @@ -0,0 +1,11 @@ +// +// Spawn Banner +// Turn Spawn Delay logging ON +// + +void main() +{ + object oArea = GetArea(OBJECT_SELF); + SetLocalInt(oArea, "SpawnDelayDebug", TRUE); + SendMessageToAllDMs("Spawn delay logging enabled"); +} diff --git a/nwnds_module/spawnb_sc_snclog.ncs b/nwnds_module/spawnb_sc_snclog.ncs new file mode 100644 index 000000000..68c0e6600 Binary files /dev/null and b/nwnds_module/spawnb_sc_snclog.ncs differ diff --git a/nwnds_module/spawnb_sc_snclog.nss b/nwnds_module/spawnb_sc_snclog.nss new file mode 100644 index 000000000..8dcfeaa38 --- /dev/null +++ b/nwnds_module/spawnb_sc_snclog.nss @@ -0,0 +1,11 @@ +// +// Spawn Banner +// Turn Spawn Delay logging ON +// + +void main() +{ + object oArea = GetArea(OBJECT_SELF); + SetLocalInt(oArea, "SpawnCountDebug", FALSE); + SendMessageToAllDMs("Spawn count logging disable"); +} diff --git a/nwnds_module/spawnb_sc_trck.ncs b/nwnds_module/spawnb_sc_trck.ncs new file mode 100644 index 000000000..f46650bd7 Binary files /dev/null and b/nwnds_module/spawnb_sc_trck.ncs differ diff --git a/nwnds_module/spawnb_sc_trck.nss b/nwnds_module/spawnb_sc_trck.nss new file mode 100644 index 000000000..bec821e41 --- /dev/null +++ b/nwnds_module/spawnb_sc_trck.nss @@ -0,0 +1,12 @@ +// +// Spawn Banner +// Turn Spawn Tracking ON +// + +#include "spawn_functions" + +void main() +{ + NESS_TrackModuleSpawns(); + SendMessageToAllDMs("Spawn tracking enabled"); +} diff --git a/nwnds_module/spawnpoint.utw b/nwnds_module/spawnpoint.utw new file mode 100644 index 000000000..b2e8eb8c0 Binary files /dev/null and b/nwnds_module/spawnpoint.utw differ diff --git a/nwnds_module/spectrespawn.utc b/nwnds_module/spectrespawn.utc new file mode 100644 index 000000000..7cda86e34 Binary files /dev/null and b/nwnds_module/spectrespawn.utc differ diff --git a/nwnds_module/spinc_maze.nss b/nwnds_module/spinc_maze.nss new file mode 100644 index 000000000..1c61249bf --- /dev/null +++ b/nwnds_module/spinc_maze.nss @@ -0,0 +1,159 @@ +//::////////////////////////////////////////////// +//:: Maze scripts common functions +//:: spinc_maze +//::////////////////////////////////////////////// +/** @file + + + @author Ornedan + @date Created - 2005.10.18 +*/ +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// + +#include "prc_inc_spells" +#include "prc_inc_teleport" +#include "inc_dynconv" + +// Direction constants +const int NORTH = 0x1000; +const int SOUTH = 0x0100; +const int WEST = 0x0010; +const int EAST = 0x0001; + +// The escape DC. Should always be 20, but changeable for ease of testing +const int MAZE_ESCAPE_DC = 20; + +const int LOCAL_DEBUG = FALSE; + + + + +/** + * Debugging function for converting the direction constants to + * readable strings. + * + * @param n One of the direction constants in this file. + * @return Name of the constant. + */ +string DebugDir2String(int n) +{ + return (n == NORTH ? "NORTH": + n == SOUTH ? "SOUTH": + n == WEST ? "WEST" : + n == EAST ? "EAST" : + "ERROR" + ); +} + +/** + * Makes the creature move in the direction specified. + * + * @param oCreature The creature to command to move. + * @param nDirection One of the direction constants in this file. + */ +void GoDirection(object oCreature, int nDirection) +{ + if(LOCAL_DEBUG) DoDebug("GoDirection(): Direction is " + DebugDir2String(nDirection)); + // Generate location for the direction + location lDir; + vector v = GetPosition(oCreature); + if(nDirection == NORTH || nDirection == SOUTH) + { + v.y = nDirection == NORTH ? 160.0f : 0.0f; + lDir = Location(GetArea(oCreature), v, 0.0f); + } + else + { + v.x = nDirection == EAST ? 160.0f : 0.0f; + lDir = Location(GetArea(oCreature), v, 0.0f); + } + // Generate a location at the center of the trigger + location lTrigCenter; + v = GetPosition(OBJECT_SELF); + v.x = IntToFloat(((FloatToInt(v.x) / 10) * 10) + 5); + v.y = IntToFloat(((FloatToInt(v.y) / 10) * 10) + 5); + lTrigCenter = Location(GetArea(oCreature), v, GetFacing(oCreature)); + + // Nuke current action and move to the direction + AssignCommand(oCreature, ClearAllActions()); + AssignCommand(oCreature, ActionMoveToLocation(lTrigCenter)); + AssignCommand(oCreature, ActionMoveToLocation(lDir)); + // Turn the camera + AssignCommand(oCreature, SetCameraFacing((nDirection == NORTH ? 90.0f : + nDirection == SOUTH ? 270.0f : + nDirection == WEST ? 180.0f : + /*EAST*/ 0.0f + ), + -1.0f, -1.0f, CAMERA_TRANSITION_TYPE_FAST) + ); + + // Store the direction one should not move to from the next junction + switch(nDirection) + { + case NORTH: SetLocalInt(oCreature, "PRC_Maze_Direction", SOUTH); break; + case SOUTH: SetLocalInt(oCreature, "PRC_Maze_Direction", NORTH); break; + case WEST: SetLocalInt(oCreature, "PRC_Maze_Direction", EAST); break; + case EAST: SetLocalInt(oCreature, "PRC_Maze_Direction", WEST); break; + } +} + +void DoMazeVFX(location lLoc) +{ + DrawSpiral(DURATION_TYPE_INSTANT, VFX_IMP_HEAD_SONIC, lLoc, 1.0, 3.0, 0.0, 60, 2.5, 2.0, 0.0f, "z"/*, GetFacingFromLocation(lLoc)*/); +} + +void ReturnFromMaze(object oCreature) +{ + if(LOCAL_DEBUG) DoDebug("ReturnFromMaze() running\noCreature = '" + GetName(oCreature) + "'"); + location lReturn = GetLocalLocation(oCreature, "PRC_Maze_Return_Location"); + AssignCommand(oCreature, ClearAllActions(TRUE)); + DelayCommand(2.0f, AssignCommand(oCreature, JumpToLocation(lReturn))); + + // Do VFX + DoMazeVFX(GetLocation(oCreature)); +} + +void MazeEscapeHB(object oCreature, int nCountLeft) +{ + if(LOCAL_DEBUG) DoDebug("MazeEscapeHB() running\n" + + "oCreature = '" + GetName(oCreature) + "'\n" + + "nCountLeft = " + IntToString(nCountLeft) + "\n" + ); + + // If the counter has reached zero, ie. full 10 mins have passsed, return is automatic + if(nCountLeft <= 0) + { + if(LOCAL_DEBUG) DoDebug("MazeEscapeHB(): Timer has run out, returning from maze."); + ReturnFromMaze(oCreature); + return; + } + + // If it's a PC that hasn't made it's decision yet, don't run the int check + if(!GetLocalInt(oCreature, "PRC_Maze_PC_Waiting")) + { + if(LOCAL_DEBUG) DoDebug("MazeEscapeHB(): Running Int check."); + + // Int check versus MAZE_ESCAPE_DC to escape + int nD20 = d20(); + int nIntMod = GetAbilityModifier(ABILITY_INTELLIGENCE, oCreature); + int bResult = (nD20 + nIntMod) >= MAZE_ESCAPE_DC; + + // Inform the creature of the result + SendMessageToPC(oCreature, GetRGB(7,7,15) + GetName(oCreature) + "" + // "Int check" "success" "failure" + GetRGB(1,1,15) + " : " + GetStringByStrRef(16825701) + " : *" + (bResult ? GetStringByStrRef(5352) : GetStringByStrRef(5353)) + "* : (" + IntToString(nD20) + " + " + IntToString(nIntMod) + " = " + IntToString(nD20 + nIntMod) + " vs. DC: " + IntToString(MAZE_ESCAPE_DC) + ")"); + + // Return from the maze if the check was successfull + if(bResult) + { + ReturnFromMaze(oCreature); + return; + } + } + + // Schedule next check + DelayCommand(6.0f, MazeEscapeHB(oCreature, nCountLeft - 1)); +} + +// Test main +//void main(){} diff --git a/nwnds_module/spyre_lv_1.are b/nwnds_module/spyre_lv_1.are new file mode 100644 index 000000000..24c22fb45 Binary files /dev/null and b/nwnds_module/spyre_lv_1.are differ diff --git a/nwnds_module/spyre_lv_1.gic b/nwnds_module/spyre_lv_1.gic new file mode 100644 index 000000000..6210edd9e Binary files /dev/null and b/nwnds_module/spyre_lv_1.gic differ diff --git a/nwnds_module/spyre_lv_1.git b/nwnds_module/spyre_lv_1.git new file mode 100644 index 000000000..17385ec8c Binary files /dev/null and b/nwnds_module/spyre_lv_1.git differ diff --git a/nwnds_module/spyre_lv_2.are b/nwnds_module/spyre_lv_2.are new file mode 100644 index 000000000..ac8fb0622 Binary files /dev/null and b/nwnds_module/spyre_lv_2.are differ diff --git a/nwnds_module/spyre_lv_2.gic b/nwnds_module/spyre_lv_2.gic new file mode 100644 index 000000000..670e0245c Binary files /dev/null and b/nwnds_module/spyre_lv_2.gic differ diff --git a/nwnds_module/spyre_lv_2.git b/nwnds_module/spyre_lv_2.git new file mode 100644 index 000000000..c31d35e19 Binary files /dev/null and b/nwnds_module/spyre_lv_2.git differ diff --git a/nwnds_module/spyre_lv_3.are b/nwnds_module/spyre_lv_3.are new file mode 100644 index 000000000..d7fc6564d Binary files /dev/null and b/nwnds_module/spyre_lv_3.are differ diff --git a/nwnds_module/spyre_lv_3.gic b/nwnds_module/spyre_lv_3.gic new file mode 100644 index 000000000..de2a1ad13 Binary files /dev/null and b/nwnds_module/spyre_lv_3.gic differ diff --git a/nwnds_module/spyre_lv_3.git b/nwnds_module/spyre_lv_3.git new file mode 100644 index 000000000..1fb0c5eb6 Binary files /dev/null and b/nwnds_module/spyre_lv_3.git differ diff --git a/nwnds_module/ss_gate_guard1.dlg b/nwnds_module/ss_gate_guard1.dlg new file mode 100644 index 000000000..34e20bf85 Binary files /dev/null and b/nwnds_module/ss_gate_guard1.dlg differ diff --git a/nwnds_module/ss_gate_key.ncs b/nwnds_module/ss_gate_key.ncs new file mode 100644 index 000000000..3a44a9a85 Binary files /dev/null and b/nwnds_module/ss_gate_key.ncs differ diff --git a/nwnds_module/ss_gate_key.nss b/nwnds_module/ss_gate_key.nss new file mode 100644 index 000000000..63a53e5bc --- /dev/null +++ b/nwnds_module/ss_gate_key.nss @@ -0,0 +1,25 @@ + +void main() +{ + // Get the PC who is in this conversation. + object oPC = GetPCSpeaker(); + + // If the PC has the item "Silver Spring Key". + if ( GetItemPossessedBy(oPC, "KEY_SILVERSPRING") != OBJECT_INVALID ) + { + // Send a message to the player's chat window. + SendMessageToPC(oPC, "You already have the key."); + } + + // If the PC does not have the item "Silve Spring Key". + if ( GetItemPossessedBy(oPC, "KEY_SILVERSPRING") == OBJECT_INVALID ) + { + // Take 10 gold from the PC. + TakeGoldFromCreature(10, oPC, TRUE); + + // Give "ss" to the PC. + CreateItemOnObject("KEY_SILVERSPRING", oPC); + } +} + + diff --git a/nwnds_module/ss_key_destroy.ncs b/nwnds_module/ss_key_destroy.ncs new file mode 100644 index 000000000..5e71fe006 Binary files /dev/null and b/nwnds_module/ss_key_destroy.ncs differ diff --git a/nwnds_module/ss_key_destroy.nss b/nwnds_module/ss_key_destroy.nss new file mode 100644 index 000000000..22a340cc7 --- /dev/null +++ b/nwnds_module/ss_key_destroy.nss @@ -0,0 +1,12 @@ +void main() +{ + // Get the creature who triggered this event. + object oPC = GetExitingObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Destroy an object (not fully effective until this script ends). + DestroyObject(GetObjectByTag("SilverSpringKey")); +} diff --git a/nwnds_module/ss_silspgs_oasis.are b/nwnds_module/ss_silspgs_oasis.are new file mode 100644 index 000000000..7ff8c143a Binary files /dev/null and b/nwnds_module/ss_silspgs_oasis.are differ diff --git a/nwnds_module/ss_silspgs_oasis.gic b/nwnds_module/ss_silspgs_oasis.gic new file mode 100644 index 000000000..e716af6ea Binary files /dev/null and b/nwnds_module/ss_silspgs_oasis.gic differ diff --git a/nwnds_module/ss_silspgs_oasis.git b/nwnds_module/ss_silspgs_oasis.git new file mode 100644 index 000000000..5c66f6dcf Binary files /dev/null and b/nwnds_module/ss_silspgs_oasis.git differ diff --git a/nwnds_module/ss_toramund_tent.are b/nwnds_module/ss_toramund_tent.are new file mode 100644 index 000000000..af6b63b30 Binary files /dev/null and b/nwnds_module/ss_toramund_tent.are differ diff --git a/nwnds_module/ss_toramund_tent.gic b/nwnds_module/ss_toramund_tent.gic new file mode 100644 index 000000000..44a24169a Binary files /dev/null and b/nwnds_module/ss_toramund_tent.gic differ diff --git a/nwnds_module/ss_toramund_tent.git b/nwnds_module/ss_toramund_tent.git new file mode 100644 index 000000000..14897b301 Binary files /dev/null and b/nwnds_module/ss_toramund_tent.git differ diff --git a/nwnds_module/st_colossus_hide.uti b/nwnds_module/st_colossus_hide.uti new file mode 100644 index 000000000..b813c7ef8 Binary files /dev/null and b/nwnds_module/st_colossus_hide.uti differ diff --git a/nwnds_module/startfence.ncs b/nwnds_module/startfence.ncs new file mode 100644 index 000000000..a6d197a21 Binary files /dev/null and b/nwnds_module/startfence.ncs differ diff --git a/nwnds_module/startfence.nss b/nwnds_module/startfence.nss new file mode 100644 index 000000000..e2ab5e2b2 --- /dev/null +++ b/nwnds_module/startfence.nss @@ -0,0 +1,13 @@ +#include "nw_i0_plot" +void main() +{ + object oStore = GetNearestObjectByTag("Fence"); + if (GetObjectType(oStore) == OBJECT_TYPE_STORE) + { + OpenStore(oStore, GetPCSpeaker()); + } + else + { + ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK); + } +} diff --git a/nwnds_module/stats_arena.ncs b/nwnds_module/stats_arena.ncs new file mode 100644 index 000000000..7056f654f Binary files /dev/null and b/nwnds_module/stats_arena.ncs differ diff --git a/nwnds_module/stats_arena.nss b/nwnds_module/stats_arena.nss new file mode 100644 index 000000000..c2829e1d2 --- /dev/null +++ b/nwnds_module/stats_arena.nss @@ -0,0 +1,25 @@ +void main() +{ + object oModule = GetModule(); + string sText = "--------\n"; + int x; + + for (x = 1; x <= 10; x++) + { + switch (x) + { + case 1: sText += "First - "; break; + case 2: sText += "Second - "; break; + case 3: sText += "Third - "; break; + case 4: sText += "Fourth - "; break; + case 5: sText += "Fifth - "; break; + case 6: sText += "Sixth - "; break; + case 7: sText += "Seventh - "; break; + case 8: sText += "Eighth - "; break; + case 9: sText += "Ninth - "; break; + case 10: sText += "Tenth - "; break; + } + sText += GetLocalString(oModule, "sArenaKills" + IntToString(x)) + "\n"; + } + SpeakString(sText); +} diff --git a/nwnds_module/stats_bounty.ncs b/nwnds_module/stats_bounty.ncs new file mode 100644 index 000000000..b2cf4a9e3 Binary files /dev/null and b/nwnds_module/stats_bounty.ncs differ diff --git a/nwnds_module/stats_bounty.nss b/nwnds_module/stats_bounty.nss new file mode 100644 index 000000000..8135f3993 --- /dev/null +++ b/nwnds_module/stats_bounty.nss @@ -0,0 +1,36 @@ +#include "aps_include" +#include "dante_db" + +void main() +{ + string sText= "----------------\n"; + int bBounty = FALSE; + + object oPlayer = GetFirstPC(); + while(GetIsObjectValid(oPlayer)) + { + if(!GetIsDM(oPlayer) && !GetIsDMPossessed(oPlayer)) + { + string sVarPlayer = GetCampaignVariableName(oPlayer); + int nBounty = GetPersistentInt(oPlayer, "Bounty" + sVarPlayer, "ar_dsostats"); + if (nBounty > 0) + { + sText += GetName(oPlayer) + " - "; + sText += IntToString(nBounty) + " ceramics\n"; + if (!bBounty) + { + bBounty = TRUE; + } + } + } + oPlayer = GetNextPC(); + } + if (bBounty) + { + SpeakString(sText); + } + else + { + SpeakString("--------\nThere are no current bounties.\n"); + } +} \ No newline at end of file diff --git a/nwnds_module/stats_player.ncs b/nwnds_module/stats_player.ncs new file mode 100644 index 000000000..5bd062e78 Binary files /dev/null and b/nwnds_module/stats_player.ncs differ diff --git a/nwnds_module/stats_player.nss b/nwnds_module/stats_player.nss new file mode 100644 index 000000000..ecb5cd351 --- /dev/null +++ b/nwnds_module/stats_player.nss @@ -0,0 +1,25 @@ +void main() +{ + object oModule = GetModule(); + string sText = "--------\n"; + int x; + + for (x = 1; x <= 10; x++) + { + switch (x) + { + case 1: sText += "First - "; break; + case 2: sText += "Second - "; break; + case 3: sText += "Third - "; break; + case 4: sText += "Fourth - "; break; + case 5: sText += "Fifth - "; break; + case 6: sText += "Sixth - "; break; + case 7: sText += "Seventh - "; break; + case 8: sText += "Eighth - "; break; + case 9: sText += "Ninth - "; break; + case 10: sText += "Tenth - "; break; + } + sText += GetLocalString(oModule, "sPlayerKills" + IntToString(x)) + "\n"; + } + SpeakString(sText); +} diff --git a/nwnds_module/stealbreath.ncs b/nwnds_module/stealbreath.ncs new file mode 100644 index 000000000..5e7128f8f Binary files /dev/null and b/nwnds_module/stealbreath.ncs differ diff --git a/nwnds_module/stealbreath.nss b/nwnds_module/stealbreath.nss new file mode 100644 index 000000000..c28e38ffd --- /dev/null +++ b/nwnds_module/stealbreath.nss @@ -0,0 +1,51 @@ +#include "NW_I0_SPELLS" +#include "inc_suffocate" + +void DoConDamage(object oTarget) +{ + int nDam = d2(); + int nKillEm = FALSE; + if ( (!GetIsPC( oTarget ) ) || ( GetGameDifficulty() >= GAME_DIFFICULTY_CORE_RULES ) ) + { + nKillEm = 1; + } + int nTargetAbility = GetAbilityScore(oTarget, ABILITY_CONSTITUTION); + if ( ( (nTargetAbility - nDam) < 3) && nKillEm ) + { + int nHitPoints = GetCurrentHitPoints(oTarget); + effect eVis = EffectVisualEffect(VFX_IMP_DEATH); + effect eHitDamage = EffectDamage(nHitPoints, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eHitDamage, oTarget); + } + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); +} + + +void main() +{ + object oOrigin = OBJECT_SELF ; // Where the spell came from + object oTarget = GetSpellTargetObject(); // What the spell is aimed at + + if ( MySavingThrow(SAVING_THROW_FORT,oTarget,15) ) + { + return; + } + DelayCommand(0.1,DoConDamage(oTarget)); + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + effect eVis = EffectVisualEffect(VFX_IMP_HEALING_S); + effect eHeal = EffectHeal(5); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oOrigin); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oOrigin); + } + int nRace = GetRacialType(oTarget); + if (( nRace == RACIAL_TYPE_CONSTRUCT ) || ( nRace == RACIAL_TYPE_ELEMENTAL ) + || ( nRace == RACIAL_TYPE_UNDEAD ) || ( nRace == RACIAL_TYPE_OOZE ) ) + return; + + SuffocateCheck(oTarget); +} diff --git a/nwnds_module/steelshodquart.uti b/nwnds_module/steelshodquart.uti new file mode 100644 index 000000000..8cb74d4ba Binary files /dev/null and b/nwnds_module/steelshodquart.uti differ diff --git a/nwnds_module/stonecolossus001.utc b/nwnds_module/stonecolossus001.utc new file mode 100644 index 000000000..a3651bae5 Binary files /dev/null and b/nwnds_module/stonecolossus001.utc differ diff --git a/nwnds_module/stool.utp b/nwnds_module/stool.utp new file mode 100644 index 000000000..d115fd722 Binary files /dev/null and b/nwnds_module/stool.utp differ diff --git a/nwnds_module/store_aircleric.utm b/nwnds_module/store_aircleric.utm new file mode 100644 index 000000000..87ce26311 Binary files /dev/null and b/nwnds_module/store_aircleric.utm differ diff --git a/nwnds_module/store_arelias.utm b/nwnds_module/store_arelias.utm new file mode 100644 index 000000000..6097cfe55 Binary files /dev/null and b/nwnds_module/store_arelias.utm differ diff --git a/nwnds_module/store_arena_ammo.utm b/nwnds_module/store_arena_ammo.utm new file mode 100644 index 000000000..e022f7bd9 Binary files /dev/null and b/nwnds_module/store_arena_ammo.utm differ diff --git a/nwnds_module/store_arena_kit1.utm b/nwnds_module/store_arena_kit1.utm new file mode 100644 index 000000000..6b33a3b4c Binary files /dev/null and b/nwnds_module/store_arena_kit1.utm differ diff --git a/nwnds_module/store_arena_kit2.utm b/nwnds_module/store_arena_kit2.utm new file mode 100644 index 000000000..cea330920 Binary files /dev/null and b/nwnds_module/store_arena_kit2.utm differ diff --git a/nwnds_module/store_arms_amber.utm b/nwnds_module/store_arms_amber.utm new file mode 100644 index 000000000..917fdd858 Binary files /dev/null and b/nwnds_module/store_arms_amber.utm differ diff --git a/nwnds_module/store_arms_skonz.utm b/nwnds_module/store_arms_skonz.utm new file mode 100644 index 000000000..015ea128f Binary files /dev/null and b/nwnds_module/store_arms_skonz.utm differ diff --git a/nwnds_module/store_basic.utm b/nwnds_module/store_basic.utm new file mode 100644 index 000000000..eb9ac4fea Binary files /dev/null and b/nwnds_module/store_basic.utm differ diff --git a/nwnds_module/store_belet_01.utm b/nwnds_module/store_belet_01.utm new file mode 100644 index 000000000..b1569b4b6 Binary files /dev/null and b/nwnds_module/store_belet_01.utm differ diff --git a/nwnds_module/store_belet_02.utm b/nwnds_module/store_belet_02.utm new file mode 100644 index 000000000..e0fbd9918 Binary files /dev/null and b/nwnds_module/store_belet_02.utm differ diff --git a/nwnds_module/store_brill.utm b/nwnds_module/store_brill.utm new file mode 100644 index 000000000..ea5eda75e Binary files /dev/null and b/nwnds_module/store_brill.utm differ diff --git a/nwnds_module/store_chirl.utm b/nwnds_module/store_chirl.utm new file mode 100644 index 000000000..1c7ddd665 Binary files /dev/null and b/nwnds_module/store_chirl.utm differ diff --git a/nwnds_module/store_clothing1.utm b/nwnds_module/store_clothing1.utm new file mode 100644 index 000000000..d663fb93d Binary files /dev/null and b/nwnds_module/store_clothing1.utm differ diff --git a/nwnds_module/store_clothing2.utm b/nwnds_module/store_clothing2.utm new file mode 100644 index 000000000..d1a105275 Binary files /dev/null and b/nwnds_module/store_clothing2.utm differ diff --git a/nwnds_module/store_cobalte.utm b/nwnds_module/store_cobalte.utm new file mode 100644 index 000000000..7bfdab354 Binary files /dev/null and b/nwnds_module/store_cobalte.utm differ diff --git a/nwnds_module/store_crafter.utm b/nwnds_module/store_crafter.utm new file mode 100644 index 000000000..57be16b7f Binary files /dev/null and b/nwnds_module/store_crafter.utm differ diff --git a/nwnds_module/store_daaku.utm b/nwnds_module/store_daaku.utm new file mode 100644 index 000000000..1c34dbf50 Binary files /dev/null and b/nwnds_module/store_daaku.utm differ diff --git a/nwnds_module/store_draqoman.utm b/nwnds_module/store_draqoman.utm new file mode 100644 index 000000000..d7640bc0c Binary files /dev/null and b/nwnds_module/store_draqoman.utm differ diff --git a/nwnds_module/store_dukkaros.utm b/nwnds_module/store_dukkaros.utm new file mode 100644 index 000000000..cb5e2f963 Binary files /dev/null and b/nwnds_module/store_dukkaros.utm differ diff --git a/nwnds_module/store_earthcleri.utm b/nwnds_module/store_earthcleri.utm new file mode 100644 index 000000000..0be2e1c73 Binary files /dev/null and b/nwnds_module/store_earthcleri.utm differ diff --git a/nwnds_module/store_fence_rn.utm b/nwnds_module/store_fence_rn.utm new file mode 100644 index 000000000..55515fdab Binary files /dev/null and b/nwnds_module/store_fence_rn.utm differ diff --git a/nwnds_module/store_fence_tg.utm b/nwnds_module/store_fence_tg.utm new file mode 100644 index 000000000..0712bbb1b Binary files /dev/null and b/nwnds_module/store_fence_tg.utm differ diff --git a/nwnds_module/store_firecleric.utm b/nwnds_module/store_firecleric.utm new file mode 100644 index 000000000..400d1d486 Binary files /dev/null and b/nwnds_module/store_firecleric.utm differ diff --git a/nwnds_module/store_flin.utm b/nwnds_module/store_flin.utm new file mode 100644 index 000000000..bd46dd727 Binary files /dev/null and b/nwnds_module/store_flin.utm differ diff --git a/nwnds_module/store_gemshop.utm b/nwnds_module/store_gemshop.utm new file mode 100644 index 000000000..d5f300791 Binary files /dev/null and b/nwnds_module/store_gemshop.utm differ diff --git a/nwnds_module/store_griks.utm b/nwnds_module/store_griks.utm new file mode 100644 index 000000000..0c0389862 Binary files /dev/null and b/nwnds_module/store_griks.utm differ diff --git a/nwnds_module/store_guild.utm b/nwnds_module/store_guild.utm new file mode 100644 index 000000000..030d6f2e3 Binary files /dev/null and b/nwnds_module/store_guild.utm differ diff --git a/nwnds_module/store_hakkimos.utm b/nwnds_module/store_hakkimos.utm new file mode 100644 index 000000000..ea77716c4 Binary files /dev/null and b/nwnds_module/store_hakkimos.utm differ diff --git a/nwnds_module/store_healer01.utm b/nwnds_module/store_healer01.utm new file mode 100644 index 000000000..8d258e0db Binary files /dev/null and b/nwnds_module/store_healer01.utm differ diff --git a/nwnds_module/store_ibod_01.utm b/nwnds_module/store_ibod_01.utm new file mode 100644 index 000000000..e61a93fb7 Binary files /dev/null and b/nwnds_module/store_ibod_01.utm differ diff --git a/nwnds_module/store_ibod_02.utm b/nwnds_module/store_ibod_02.utm new file mode 100644 index 000000000..a2ed22a49 Binary files /dev/null and b/nwnds_module/store_ibod_02.utm differ diff --git a/nwnds_module/store_ingredient.utm b/nwnds_module/store_ingredient.utm new file mode 100644 index 000000000..9290d74a8 Binary files /dev/null and b/nwnds_module/store_ingredient.utm differ diff --git a/nwnds_module/store_item_amber.utm b/nwnds_module/store_item_amber.utm new file mode 100644 index 000000000..49cc2f907 Binary files /dev/null and b/nwnds_module/store_item_amber.utm differ diff --git a/nwnds_module/store_item_skonz.utm b/nwnds_module/store_item_skonz.utm new file mode 100644 index 000000000..0ae13ead6 Binary files /dev/null and b/nwnds_module/store_item_skonz.utm differ diff --git a/nwnds_module/store_jadejozhal.utm b/nwnds_module/store_jadejozhal.utm new file mode 100644 index 000000000..c7a7f5696 Binary files /dev/null and b/nwnds_module/store_jadejozhal.utm differ diff --git a/nwnds_module/store_justl.utm b/nwnds_module/store_justl.utm new file mode 100644 index 000000000..e6eba679b Binary files /dev/null and b/nwnds_module/store_justl.utm differ diff --git a/nwnds_module/store_kilari.utm b/nwnds_module/store_kilari.utm new file mode 100644 index 000000000..78548d848 Binary files /dev/null and b/nwnds_module/store_kilari.utm differ diff --git a/nwnds_module/store_kilgrasta1.utm b/nwnds_module/store_kilgrasta1.utm new file mode 100644 index 000000000..43677c970 Binary files /dev/null and b/nwnds_module/store_kilgrasta1.utm differ diff --git a/nwnds_module/store_kilgrasta2.utm b/nwnds_module/store_kilgrasta2.utm new file mode 100644 index 000000000..e81e90a61 Binary files /dev/null and b/nwnds_module/store_kilgrasta2.utm differ diff --git a/nwnds_module/store_lemli.utm b/nwnds_module/store_lemli.utm new file mode 100644 index 000000000..106627b0d Binary files /dev/null and b/nwnds_module/store_lemli.utm differ diff --git a/nwnds_module/store_lilara.utm b/nwnds_module/store_lilara.utm new file mode 100644 index 000000000..18e60dd92 Binary files /dev/null and b/nwnds_module/store_lilara.utm differ diff --git a/nwnds_module/store_lostvendor.utm b/nwnds_module/store_lostvendor.utm new file mode 100644 index 000000000..2125f18d6 Binary files /dev/null and b/nwnds_module/store_lostvendor.utm differ diff --git a/nwnds_module/store_magmacleri.utm b/nwnds_module/store_magmacleri.utm new file mode 100644 index 000000000..6df4077a3 Binary files /dev/null and b/nwnds_module/store_magmacleri.utm differ diff --git a/nwnds_module/store_marcus.utm b/nwnds_module/store_marcus.utm new file mode 100644 index 000000000..8843dc036 Binary files /dev/null and b/nwnds_module/store_marcus.utm differ diff --git a/nwnds_module/store_marris.utm b/nwnds_module/store_marris.utm new file mode 100644 index 000000000..9398fc79f Binary files /dev/null and b/nwnds_module/store_marris.utm differ diff --git a/nwnds_module/store_naamo.utm b/nwnds_module/store_naamo.utm new file mode 100644 index 000000000..75254413b Binary files /dev/null and b/nwnds_module/store_naamo.utm differ diff --git a/nwnds_module/store_nather.utm b/nwnds_module/store_nather.utm new file mode 100644 index 000000000..ad90e499f Binary files /dev/null and b/nwnds_module/store_nather.utm differ diff --git a/nwnds_module/store_nomad.utm b/nwnds_module/store_nomad.utm new file mode 100644 index 000000000..9beedab2f Binary files /dev/null and b/nwnds_module/store_nomad.utm differ diff --git a/nwnds_module/store_notuka.utm b/nwnds_module/store_notuka.utm new file mode 100644 index 000000000..98cd4372f Binary files /dev/null and b/nwnds_module/store_notuka.utm differ diff --git a/nwnds_module/store_nual.utm b/nwnds_module/store_nual.utm new file mode 100644 index 000000000..36229becb Binary files /dev/null and b/nwnds_module/store_nual.utm differ diff --git a/nwnds_module/store_pawn.utm b/nwnds_module/store_pawn.utm new file mode 100644 index 000000000..f44ba700d Binary files /dev/null and b/nwnds_module/store_pawn.utm differ diff --git a/nwnds_module/store_prata.utm b/nwnds_module/store_prata.utm new file mode 100644 index 000000000..44b6e801e Binary files /dev/null and b/nwnds_module/store_prata.utm differ diff --git a/nwnds_module/store_shiral.utm b/nwnds_module/store_shiral.utm new file mode 100644 index 000000000..1699a9c9c Binary files /dev/null and b/nwnds_module/store_shiral.utm differ diff --git a/nwnds_module/store_silhand_01.utm b/nwnds_module/store_silhand_01.utm new file mode 100644 index 000000000..8f97877c3 Binary files /dev/null and b/nwnds_module/store_silhand_01.utm differ diff --git a/nwnds_module/store_silhand_02.utm b/nwnds_module/store_silhand_02.utm new file mode 100644 index 000000000..4e927f52b Binary files /dev/null and b/nwnds_module/store_silhand_02.utm differ diff --git a/nwnds_module/store_silhand_03.utm b/nwnds_module/store_silhand_03.utm new file mode 100644 index 000000000..3e955013c Binary files /dev/null and b/nwnds_module/store_silhand_03.utm differ diff --git a/nwnds_module/store_tala.utm b/nwnds_module/store_tala.utm new file mode 100644 index 000000000..85ef817f1 Binary files /dev/null and b/nwnds_module/store_tala.utm differ diff --git a/nwnds_module/store_tavern1.utm b/nwnds_module/store_tavern1.utm new file mode 100644 index 000000000..d1271ad3f Binary files /dev/null and b/nwnds_module/store_tavern1.utm differ diff --git a/nwnds_module/store_tavern2.utm b/nwnds_module/store_tavern2.utm new file mode 100644 index 000000000..ba31c7986 Binary files /dev/null and b/nwnds_module/store_tavern2.utm differ diff --git a/nwnds_module/store_tricis.utm b/nwnds_module/store_tricis.utm new file mode 100644 index 000000000..955905e59 Binary files /dev/null and b/nwnds_module/store_tricis.utm differ diff --git a/nwnds_module/store_tyrtemp.utm b/nwnds_module/store_tyrtemp.utm new file mode 100644 index 000000000..59b8fb548 Binary files /dev/null and b/nwnds_module/store_tyrtemp.utm differ diff --git a/nwnds_module/store_uriktemp.utm b/nwnds_module/store_uriktemp.utm new file mode 100644 index 000000000..7f076782b Binary files /dev/null and b/nwnds_module/store_uriktemp.utm differ diff --git a/nwnds_module/store_va_fin.utm b/nwnds_module/store_va_fin.utm new file mode 100644 index 000000000..e2630a8a3 Binary files /dev/null and b/nwnds_module/store_va_fin.utm differ diff --git a/nwnds_module/store_va_mina_01.utm b/nwnds_module/store_va_mina_01.utm new file mode 100644 index 000000000..019fd7f13 Binary files /dev/null and b/nwnds_module/store_va_mina_01.utm differ diff --git a/nwnds_module/store_va_mina_02.utm b/nwnds_module/store_va_mina_02.utm new file mode 100644 index 000000000..b84fad53e Binary files /dev/null and b/nwnds_module/store_va_mina_02.utm differ diff --git a/nwnds_module/store_valdarmin.utm b/nwnds_module/store_valdarmin.utm new file mode 100644 index 000000000..b7b8388bc Binary files /dev/null and b/nwnds_module/store_valdarmin.utm differ diff --git a/nwnds_module/store_watercleri.utm b/nwnds_module/store_watercleri.utm new file mode 100644 index 000000000..bd13d6811 Binary files /dev/null and b/nwnds_module/store_watercleri.utm differ diff --git a/nwnds_module/store_westmore.utm b/nwnds_module/store_westmore.utm new file mode 100644 index 000000000..a05441f7f Binary files /dev/null and b/nwnds_module/store_westmore.utm differ diff --git a/nwnds_module/store_wik.utm b/nwnds_module/store_wik.utm new file mode 100644 index 000000000..a5cef4ae6 Binary files /dev/null and b/nwnds_module/store_wik.utm differ diff --git a/nwnds_module/store_witch.utm b/nwnds_module/store_witch.utm new file mode 100644 index 000000000..5e8c4bad9 Binary files /dev/null and b/nwnds_module/store_witch.utm differ diff --git a/nwnds_module/store_wrix_01.utm b/nwnds_module/store_wrix_01.utm new file mode 100644 index 000000000..30501673a Binary files /dev/null and b/nwnds_module/store_wrix_01.utm differ diff --git a/nwnds_module/store_wrix_02.utm b/nwnds_module/store_wrix_02.utm new file mode 100644 index 000000000..0153426bf Binary files /dev/null and b/nwnds_module/store_wrix_02.utm differ diff --git a/nwnds_module/store_zyph.utm b/nwnds_module/store_zyph.utm new file mode 100644 index 000000000..a033dcf5a Binary files /dev/null and b/nwnds_module/store_zyph.utm differ diff --git a/nwnds_module/storepalcus.itp b/nwnds_module/storepalcus.itp new file mode 100644 index 000000000..0dcb2b530 Binary files /dev/null and b/nwnds_module/storepalcus.itp differ diff --git a/nwnds_module/strengthdown.ncs b/nwnds_module/strengthdown.ncs new file mode 100644 index 000000000..147bf1e46 Binary files /dev/null and b/nwnds_module/strengthdown.ncs differ diff --git a/nwnds_module/strengthdown.nss b/nwnds_module/strengthdown.nss new file mode 100644 index 000000000..20f0e0476 --- /dev/null +++ b/nwnds_module/strengthdown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_STRENGTH, -2); +} diff --git a/nwnds_module/strengthup.ncs b/nwnds_module/strengthup.ncs new file mode 100644 index 000000000..c41fd5549 Binary files /dev/null and b/nwnds_module/strengthup.ncs differ diff --git a/nwnds_module/strengthup.nss b/nwnds_module/strengthup.nss new file mode 100644 index 000000000..77d1099ba --- /dev/null +++ b/nwnds_module/strengthup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_STRENGTH, 2); +} diff --git a/nwnds_module/stunjelly001.utc b/nwnds_module/stunjelly001.utc new file mode 100644 index 000000000..c0115846f Binary files /dev/null and b/nwnds_module/stunjelly001.utc differ diff --git a/nwnds_module/stunjelly_slam.uti b/nwnds_module/stunjelly_slam.uti new file mode 100644 index 000000000..9413eacda Binary files /dev/null and b/nwnds_module/stunjelly_slam.uti differ diff --git a/nwnds_module/swightslam.uti b/nwnds_module/swightslam.uti new file mode 100644 index 000000000..4a088190b Binary files /dev/null and b/nwnds_module/swightslam.uti differ diff --git a/nwnds_module/ta_freedignus.ncs b/nwnds_module/ta_freedignus.ncs new file mode 100644 index 000000000..f543bbff4 Binary files /dev/null and b/nwnds_module/ta_freedignus.ncs differ diff --git a/nwnds_module/ta_freedignus.nss b/nwnds_module/ta_freedignus.nss new file mode 100644 index 000000000..96c34e70a --- /dev/null +++ b/nwnds_module/ta_freedignus.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "ignus") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ta_hasdepraved.ncs b/nwnds_module/ta_hasdepraved.ncs new file mode 100644 index 000000000..1c875a5c2 Binary files /dev/null and b/nwnds_module/ta_hasdepraved.ncs differ diff --git a/nwnds_module/ta_hasdepraved.nss b/nwnds_module/ta_hasdepraved.nss new file mode 100644 index 000000000..a00938091 --- /dev/null +++ b/nwnds_module/ta_hasdepraved.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "KeyoftheDepraved") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_hasearthrelic.ncs b/nwnds_module/ta_hasearthrelic.ncs new file mode 100644 index 000000000..248f26144 Binary files /dev/null and b/nwnds_module/ta_hasearthrelic.ncs differ diff --git a/nwnds_module/ta_hasearthrelic.nss b/nwnds_module/ta_hasearthrelic.nss new file mode 100644 index 000000000..615f2fd3e --- /dev/null +++ b/nwnds_module/ta_hasearthrelic.nss @@ -0,0 +1,10 @@ +// Check for Nadie's Earth Relic + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "QST_EARTHRELIC") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_hashead.ncs b/nwnds_module/ta_hashead.ncs new file mode 100644 index 000000000..c104c1ac0 Binary files /dev/null and b/nwnds_module/ta_hashead.ncs differ diff --git a/nwnds_module/ta_hashead.nss b/nwnds_module/ta_hashead.nss new file mode 100644 index 000000000..d93697076 --- /dev/null +++ b/nwnds_module/ta_hashead.nss @@ -0,0 +1,5 @@ +int StartingConditional() +{ + int nShow = OBJECT_INVALID != GetItemPossessedBy(GetPCSpeaker(), "QST_LASKCHFHEAD"); + return nShow; +} diff --git a/nwnds_module/ta_haskyriskey.ncs b/nwnds_module/ta_haskyriskey.ncs new file mode 100644 index 000000000..8c91c03cc Binary files /dev/null and b/nwnds_module/ta_haskyriskey.ncs differ diff --git a/nwnds_module/ta_haskyriskey.nss b/nwnds_module/ta_haskyriskey.nss new file mode 100644 index 000000000..22b3a1937 --- /dev/null +++ b/nwnds_module/ta_haskyriskey.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "KyrisKey") == OBJECT_INVALID) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_isaircleric.ncs b/nwnds_module/ta_isaircleric.ncs new file mode 100644 index 000000000..3faf38dd9 Binary files /dev/null and b/nwnds_module/ta_isaircleric.ncs differ diff --git a/nwnds_module/ta_isaircleric.nss b/nwnds_module/ta_isaircleric.nss new file mode 100644 index 000000000..6a740b08c --- /dev/null +++ b/nwnds_module/ta_isaircleric.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_isearthcleric.ncs b/nwnds_module/ta_isearthcleric.ncs new file mode 100644 index 000000000..f568d5980 Binary files /dev/null and b/nwnds_module/ta_isearthcleric.ncs differ diff --git a/nwnds_module/ta_isearthcleric.nss b/nwnds_module/ta_isearthcleric.nss new file mode 100644 index 000000000..84cc36643 --- /dev/null +++ b/nwnds_module/ta_isearthcleric.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!GetHasFeat(FEAT_EARTH_DOMAIN_POWER, oPC)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_isfirecleric.ncs b/nwnds_module/ta_isfirecleric.ncs new file mode 100644 index 000000000..c3db795b0 Binary files /dev/null and b/nwnds_module/ta_isfirecleric.ncs differ diff --git a/nwnds_module/ta_isfirecleric.nss b/nwnds_module/ta_isfirecleric.nss new file mode 100644 index 000000000..96e0806fd --- /dev/null +++ b/nwnds_module/ta_isfirecleric.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!GetHasFeat(FEAT_FIRE_DOMAIN_POWER, oPC)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_ismagmacleric.ncs b/nwnds_module/ta_ismagmacleric.ncs new file mode 100644 index 000000000..d96e0081a Binary files /dev/null and b/nwnds_module/ta_ismagmacleric.ncs differ diff --git a/nwnds_module/ta_ismagmacleric.nss b/nwnds_module/ta_ismagmacleric.nss new file mode 100644 index 000000000..500e2bb90 --- /dev/null +++ b/nwnds_module/ta_ismagmacleric.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ +const int FEAT_MAGMA_DOMAIN_POWER = 5018; +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!GetHasFeat(FEAT_MAGMA_DOMAIN_POWER, oPC)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_iswatercleric.ncs b/nwnds_module/ta_iswatercleric.ncs new file mode 100644 index 000000000..ede9f909a Binary files /dev/null and b/nwnds_module/ta_iswatercleric.ncs differ diff --git a/nwnds_module/ta_iswatercleric.nss b/nwnds_module/ta_iswatercleric.nss new file mode 100644 index 000000000..f06119587 --- /dev/null +++ b/nwnds_module/ta_iswatercleric.nss @@ -0,0 +1,14 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_justltalk.ncs b/nwnds_module/ta_justltalk.ncs new file mode 100644 index 000000000..72b512a29 Binary files /dev/null and b/nwnds_module/ta_justltalk.ncs differ diff --git a/nwnds_module/ta_justltalk.nss b/nwnds_module/ta_justltalk.nss new file mode 100644 index 000000000..1f131d3ad --- /dev/null +++ b/nwnds_module/ta_justltalk.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (!(GetLocalInt(oPC, "justltalk") == 1)) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ta_justlwait.ncs b/nwnds_module/ta_justlwait.ncs new file mode 100644 index 000000000..d6ef8515a Binary files /dev/null and b/nwnds_module/ta_justlwait.ncs differ diff --git a/nwnds_module/ta_justlwait.nss b/nwnds_module/ta_justlwait.nss new file mode 100644 index 000000000..8ba46e0e3 --- /dev/null +++ b/nwnds_module/ta_justlwait.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p001") == 1)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/ta_justlwait2.ncs b/nwnds_module/ta_justlwait2.ncs new file mode 100644 index 000000000..0ecf19d5d Binary files /dev/null and b/nwnds_module/ta_justlwait2.ncs differ diff --git a/nwnds_module/ta_justlwait2.nss b/nwnds_module/ta_justlwait2.nss new file mode 100644 index 000000000..8f76a27c9 --- /dev/null +++ b/nwnds_module/ta_justlwait2.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName sc_beletqcheck1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 9/10/2002 12:38:53 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "NW_JOURNAL_ENTRY" + "p001") == 2)) + return FALSE; + + return TRUE; + +} diff --git a/nwnds_module/ta_nodragondlvl.ncs b/nwnds_module/ta_nodragondlvl.ncs new file mode 100644 index 000000000..f3b825901 Binary files /dev/null and b/nwnds_module/ta_nodragondlvl.ncs differ diff --git a/nwnds_module/ta_nodragondlvl.nss b/nwnds_module/ta_nodragondlvl.nss new file mode 100644 index 000000000..d79a483ba --- /dev/null +++ b/nwnds_module/ta_nodragondlvl.nss @@ -0,0 +1,15 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if ((GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oPC)!=0)) +return FALSE; + +return TRUE; +} diff --git a/nwnds_module/ta_onspyrequest.ncs b/nwnds_module/ta_onspyrequest.ncs new file mode 100644 index 000000000..d35b2143e Binary files /dev/null and b/nwnds_module/ta_onspyrequest.ncs differ diff --git a/nwnds_module/ta_onspyrequest.nss b/nwnds_module/ta_onspyrequest.nss new file mode 100644 index 000000000..9735e4957 --- /dev/null +++ b/nwnds_module/ta_onspyrequest.nss @@ -0,0 +1,19 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYspyretower"); + +if (!(nInt >= 1)) + return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/ta_spyretowerend.ncs b/nwnds_module/ta_spyretowerend.ncs new file mode 100644 index 000000000..4971cb711 Binary files /dev/null and b/nwnds_module/ta_spyretowerend.ncs differ diff --git a/nwnds_module/ta_spyretowerend.nss b/nwnds_module/ta_spyretowerend.nss new file mode 100644 index 000000000..1bae721eb --- /dev/null +++ b/nwnds_module/ta_spyretowerend.nss @@ -0,0 +1,18 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +int nInt; +nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYspyretower"); + +if (!(nInt >= 3)) + return FALSE; + +return TRUE; +} diff --git a/nwnds_module/tagster001.utc b/nwnds_module/tagster001.utc new file mode 100644 index 000000000..c81cd747e Binary files /dev/null and b/nwnds_module/tagster001.utc differ diff --git a/nwnds_module/tagsterhide.uti b/nwnds_module/tagsterhide.uti new file mode 100644 index 000000000..708dc4688 Binary files /dev/null and b/nwnds_module/tagsterhide.uti differ diff --git a/nwnds_module/tak_inc_thfchk00.nss b/nwnds_module/tak_inc_thfchk00.nss new file mode 100644 index 000000000..97865a20d --- /dev/null +++ b/nwnds_module/tak_inc_thfchk00.nss @@ -0,0 +1,108 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= +#include "x0_i0_position" + +void tak_container_agg_check(int nCondition, object oThief, object oOwner); + +void tak_container_thief_check(object oThief, int nCondition) +{ + string sOwner = GetLocalString(OBJECT_SELF, "owner"); + object oOwner = GetObjectByTag(sOwner); + if (oOwner != OBJECT_INVALID) + tak_container_agg_check(nCondition, oThief, oOwner); + + sOwner = GetLocalString(OBJECT_SELF, "owner"); + oOwner = GetObjectByTag(sOwner); + if (oOwner != OBJECT_INVALID) { + int cnt; + for (cnt = 1; sOwner != ""; cnt++) { + sOwner = GetLocalString(OBJECT_SELF, "owner" + IntToString(cnt)); + oOwner = GetObjectByTag(sOwner); + tak_container_agg_check(nCondition, oThief, oOwner); + } + } +} + +void tak_container_agg_check(int nCondition, object oThief, object oOwner) { + int nAgg = GetLocalInt(OBJECT_SELF,"agg"); + if (nAgg < 1) + nAgg == 0; + if (!(GetObjectSeen(oThief, oOwner))) { + if ((nCondition == 5) || + (nCondition == 7) || + (nCondition == 4)) + TurnToFaceObject(oThief, oOwner); + } + else { + switch (nCondition) { + case 1: + if (GetLocalInt(OBJECT_SELF,"ttc_unlock")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_unlock"); + else + nAgg+=3; + break; //unlocked + case 2: + if (GetLocalInt(OBJECT_SELF,"ttc_disarm")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_disarm"); + else + nAgg+=3; + break; //disarmed + case 3: + if (GetLocalInt(OBJECT_SELF,"ttc_taken")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_taken"); + else + nAgg+=5; + break; //item taken + case 4: + if (GetLocalInt(OBJECT_SELF,"ttc_trap")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_trap"); + else + nAgg+=3; + break; //trap triggered + case 5: + if (GetLocalInt(OBJECT_SELF,"ttc_damage")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_damage"); + else + nAgg+=2; + break; //damaged + case 6: + if (GetLocalInt(OBJECT_SELF,"ttc_open")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_open"); + else + nAgg+=5; + break; //opened + case 7: + if (GetLocalInt(OBJECT_SELF,"ttc_destroy")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_destroy"); + else + nAgg+=5; + break; //destroyed + case 8: + if (GetLocalInt(OBJECT_SELF,"ttc_attack")) + nAgg+=GetLocalInt(OBJECT_SELF,"ttc_attack"); + else + nAgg+=1; + break; //pysically attacked + } + } + SetLocalInt(OBJECT_SELF, "agg", nAgg); + if ((nAgg >= 5) && (GetObjectSeen(oThief, oOwner))) { //Now I'm Pissed. + AssignCommand(oOwner, ActionAttack(oThief)); + } +} diff --git a/nwnds_module/tak_thfchk_damag.ncs b/nwnds_module/tak_thfchk_damag.ncs new file mode 100644 index 000000000..9d3e797d5 Binary files /dev/null and b/nwnds_module/tak_thfchk_damag.ncs differ diff --git a/nwnds_module/tak_thfchk_damag.nss b/nwnds_module/tak_thfchk_damag.nss new file mode 100644 index 000000000..d702d7783 --- /dev/null +++ b/nwnds_module/tak_thfchk_damag.nss @@ -0,0 +1,28 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastDamager() == OBJECT_INVALID) + return; + oThief = GetLastDamager(); + tak_container_thief_check(oThief, 5); +} diff --git a/nwnds_module/tak_thfchk_destr.ncs b/nwnds_module/tak_thfchk_destr.ncs new file mode 100644 index 000000000..063d4b123 Binary files /dev/null and b/nwnds_module/tak_thfchk_destr.ncs differ diff --git a/nwnds_module/tak_thfchk_destr.nss b/nwnds_module/tak_thfchk_destr.nss new file mode 100644 index 000000000..c7cc3ab79 --- /dev/null +++ b/nwnds_module/tak_thfchk_destr.nss @@ -0,0 +1,29 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= + +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastKiller() == OBJECT_INVALID) + return; + oThief = GetLastKiller(); + tak_container_thief_check(oThief, 7); +} diff --git a/nwnds_module/tak_thfchk_distr.ncs b/nwnds_module/tak_thfchk_distr.ncs new file mode 100644 index 000000000..7bf1129c8 Binary files /dev/null and b/nwnds_module/tak_thfchk_distr.ncs differ diff --git a/nwnds_module/tak_thfchk_distr.nss b/nwnds_module/tak_thfchk_distr.nss new file mode 100644 index 000000000..b13923b53 --- /dev/null +++ b/nwnds_module/tak_thfchk_distr.nss @@ -0,0 +1,29 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= + +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastDisturbed() == OBJECT_INVALID) + return; + oThief = GetLastDisturbed(); + tak_container_thief_check(oThief, 3); +} diff --git a/nwnds_module/tak_thfchk_open.ncs b/nwnds_module/tak_thfchk_open.ncs new file mode 100644 index 000000000..7efef1e7f Binary files /dev/null and b/nwnds_module/tak_thfchk_open.ncs differ diff --git a/nwnds_module/tak_thfchk_open.nss b/nwnds_module/tak_thfchk_open.nss new file mode 100644 index 000000000..ec08b617e --- /dev/null +++ b/nwnds_module/tak_thfchk_open.nss @@ -0,0 +1,29 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= + +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastOpenedBy() == OBJECT_INVALID) + return; + oThief = GetLastOpenedBy(); + tak_container_thief_check(oThief, 6); +} diff --git a/nwnds_module/tak_thfchk_patk.ncs b/nwnds_module/tak_thfchk_patk.ncs new file mode 100644 index 000000000..91aa40ef8 Binary files /dev/null and b/nwnds_module/tak_thfchk_patk.ncs differ diff --git a/nwnds_module/tak_thfchk_patk.nss b/nwnds_module/tak_thfchk_patk.nss new file mode 100644 index 000000000..8c371b5d5 --- /dev/null +++ b/nwnds_module/tak_thfchk_patk.nss @@ -0,0 +1,28 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastAttacker() == OBJECT_INVALID) + return; + oThief = GetLastAttacker(); + tak_container_thief_check(oThief, 8); +} diff --git a/nwnds_module/tak_thfchk_unloc.ncs b/nwnds_module/tak_thfchk_unloc.ncs new file mode 100644 index 000000000..a9d92d482 Binary files /dev/null and b/nwnds_module/tak_thfchk_unloc.ncs differ diff --git a/nwnds_module/tak_thfchk_unloc.nss b/nwnds_module/tak_thfchk_unloc.nss new file mode 100644 index 000000000..ed361fcb5 --- /dev/null +++ b/nwnds_module/tak_thfchk_unloc.nss @@ -0,0 +1,29 @@ +//============================================================= +// Container Thief Check +// by William Amrull (aka Tak), Sep 4, 2005 +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Purpose: Makes the owner/guard(s) of a container attack +// anyone who messes with said container. +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Use: Put this script in the OnOpen event for the container +// and add a variable to the container. The variable you add +// should be called "owner" and contain the tag of the owner. +// For multiple guards the variables should be like so: +// string owner1 Tag +// string owner2 Tag +// string owner3 Tag +// etc.. +// Note: There should be no owner tag variable that does not +// include a number at the end when using multiple guards. +//============================================================= + +#include "tak_inc_thfchk00" + +void main() +{ + object oThief; + if (GetLastUnlocked() == OBJECT_INVALID) + return; + oThief = GetLastUnlocked(); + tak_container_thief_check(oThief, 1); +} diff --git a/nwnds_module/take100gold.ncs b/nwnds_module/take100gold.ncs new file mode 100644 index 000000000..57267bdfe Binary files /dev/null and b/nwnds_module/take100gold.ncs differ diff --git a/nwnds_module/take100gold.nss b/nwnds_module/take100gold.nss new file mode 100644 index 000000000..3e4c772ad --- /dev/null +++ b/nwnds_module/take100gold.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName take100gold +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:09:06 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(100, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/take50gold.ncs b/nwnds_module/take50gold.ncs new file mode 100644 index 000000000..bae1545a4 Binary files /dev/null and b/nwnds_module/take50gold.ncs differ diff --git a/nwnds_module/take50gold.nss b/nwnds_module/take50gold.nss new file mode 100644 index 000000000..7617ad5c7 --- /dev/null +++ b/nwnds_module/take50gold.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName take50gold +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:09:06 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/takebracelet.ncs b/nwnds_module/takebracelet.ncs new file mode 100644 index 000000000..9dd3e55b3 Binary files /dev/null and b/nwnds_module/takebracelet.ncs differ diff --git a/nwnds_module/takebracelet.nss b/nwnds_module/takebracelet.nss new file mode 100644 index 000000000..0c10b88b1 --- /dev/null +++ b/nwnds_module/takebracelet.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: FileName takebracelet +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/12/02 6:11:06 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "QST_GEARYSBRACE"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); + // Set the variables + SetLocalInt(GetPCSpeaker(), "thievesquests", 1); + + + +} diff --git a/nwnds_module/takegoldforcarav.ncs b/nwnds_module/takegoldforcarav.ncs new file mode 100644 index 000000000..bae1545a4 Binary files /dev/null and b/nwnds_module/takegoldforcarav.ncs differ diff --git a/nwnds_module/takegoldforcarav.nss b/nwnds_module/takegoldforcarav.nss new file mode 100644 index 000000000..6730fb991 --- /dev/null +++ b/nwnds_module/takegoldforcarav.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName takegoldforcarav +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 7/31/02 6:34:54 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove some gold from the player + TakeGoldFromCreature(50, GetPCSpeaker(), TRUE); +} diff --git a/nwnds_module/takeledger.ncs b/nwnds_module/takeledger.ncs new file mode 100644 index 000000000..d5b04d676 Binary files /dev/null and b/nwnds_module/takeledger.ncs differ diff --git a/nwnds_module/takeledger.nss b/nwnds_module/takeledger.nss new file mode 100644 index 000000000..71a414712 --- /dev/null +++ b/nwnds_module/takeledger.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName takeledger +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:34:24 PM +//::////////////////////////////////////////////// +void main() +{ + + // Remove items from the player's inventory + object oItemToTake; + oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "JaryxsLedger"); + if(GetIsObjectValid(oItemToTake) != 0) + DestroyObject(oItemToTake); +} diff --git a/nwnds_module/talkedtoguute.ncs b/nwnds_module/talkedtoguute.ncs new file mode 100644 index 000000000..19ed6fb3f Binary files /dev/null and b/nwnds_module/talkedtoguute.ncs differ diff --git a/nwnds_module/talkedtoguute.nss b/nwnds_module/talkedtoguute.nss new file mode 100644 index 000000000..51eaf06a7 --- /dev/null +++ b/nwnds_module/talkedtoguute.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName talkedtoguute +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/30/02 12:46:03 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "talkedtoguute", 1); + +} diff --git a/nwnds_module/tarek_001.utc b/nwnds_module/tarek_001.utc new file mode 100644 index 000000000..504b70ce0 Binary files /dev/null and b/nwnds_module/tarek_001.utc differ diff --git a/nwnds_module/tarek_002.utc b/nwnds_module/tarek_002.utc new file mode 100644 index 000000000..e6b707041 Binary files /dev/null and b/nwnds_module/tarek_002.utc differ diff --git a/nwnds_module/tarek_003.utc b/nwnds_module/tarek_003.utc new file mode 100644 index 000000000..9cb0f18b5 Binary files /dev/null and b/nwnds_module/tarek_003.utc differ diff --git a/nwnds_module/taribite.uti b/nwnds_module/taribite.uti new file mode 100644 index 000000000..f94512a2f Binary files /dev/null and b/nwnds_module/taribite.uti differ diff --git a/nwnds_module/tarisewervillage.are b/nwnds_module/tarisewervillage.are new file mode 100644 index 000000000..a5ef3d74d Binary files /dev/null and b/nwnds_module/tarisewervillage.are differ diff --git a/nwnds_module/tarisewervillage.gic b/nwnds_module/tarisewervillage.gic new file mode 100644 index 000000000..c279ff5ba Binary files /dev/null and b/nwnds_module/tarisewervillage.gic differ diff --git a/nwnds_module/tarisewervillage.git b/nwnds_module/tarisewervillage.git new file mode 100644 index 000000000..c31ce42cd Binary files /dev/null and b/nwnds_module/tarisewervillage.git differ diff --git a/nwnds_module/tavernvaletclo.uti b/nwnds_module/tavernvaletclo.uti new file mode 100644 index 000000000..bbc21b3f8 Binary files /dev/null and b/nwnds_module/tavernvaletclo.uti differ diff --git a/nwnds_module/tavernwench.utc b/nwnds_module/tavernwench.utc new file mode 100644 index 000000000..c3fc0f628 Binary files /dev/null and b/nwnds_module/tavernwench.utc differ diff --git a/nwnds_module/tb_tribalcave.are b/nwnds_module/tb_tribalcave.are new file mode 100644 index 000000000..5c30dd8bb Binary files /dev/null and b/nwnds_module/tb_tribalcave.are differ diff --git a/nwnds_module/tb_tribalcave.gic b/nwnds_module/tb_tribalcave.gic new file mode 100644 index 000000000..447e61659 Binary files /dev/null and b/nwnds_module/tb_tribalcave.gic differ diff --git a/nwnds_module/tb_tribalcave.git b/nwnds_module/tb_tribalcave.git new file mode 100644 index 000000000..219b79222 Binary files /dev/null and b/nwnds_module/tb_tribalcave.git differ diff --git a/nwnds_module/tbl_ashencavern.are b/nwnds_module/tbl_ashencavern.are new file mode 100644 index 000000000..1b7870192 Binary files /dev/null and b/nwnds_module/tbl_ashencavern.are differ diff --git a/nwnds_module/tbl_ashencavern.gic b/nwnds_module/tbl_ashencavern.gic new file mode 100644 index 000000000..a7b257bb0 Binary files /dev/null and b/nwnds_module/tbl_ashencavern.gic differ diff --git a/nwnds_module/tbl_ashencavern.git b/nwnds_module/tbl_ashencavern.git new file mode 100644 index 000000000..ed31d2a29 Binary files /dev/null and b/nwnds_module/tbl_ashencavern.git differ diff --git a/nwnds_module/tbl_ashensands.are b/nwnds_module/tbl_ashensands.are new file mode 100644 index 000000000..5b8bc4792 Binary files /dev/null and b/nwnds_module/tbl_ashensands.are differ diff --git a/nwnds_module/tbl_ashensands.gic b/nwnds_module/tbl_ashensands.gic new file mode 100644 index 000000000..3f0faf6b2 Binary files /dev/null and b/nwnds_module/tbl_ashensands.gic differ diff --git a/nwnds_module/tbl_ashensands.git b/nwnds_module/tbl_ashensands.git new file mode 100644 index 000000000..f3409a74d Binary files /dev/null and b/nwnds_module/tbl_ashensands.git differ diff --git a/nwnds_module/tbl_crimsonsands.are b/nwnds_module/tbl_crimsonsands.are new file mode 100644 index 000000000..58d7fe8a1 Binary files /dev/null and b/nwnds_module/tbl_crimsonsands.are differ diff --git a/nwnds_module/tbl_crimsonsands.gic b/nwnds_module/tbl_crimsonsands.gic new file mode 100644 index 000000000..71199a02b Binary files /dev/null and b/nwnds_module/tbl_crimsonsands.gic differ diff --git a/nwnds_module/tbl_crimsonsands.git b/nwnds_module/tbl_crimsonsands.git new file mode 100644 index 000000000..b957846f8 Binary files /dev/null and b/nwnds_module/tbl_crimsonsands.git differ diff --git a/nwnds_module/tbl_crsdbttlfld.are b/nwnds_module/tbl_crsdbttlfld.are new file mode 100644 index 000000000..a2936d956 Binary files /dev/null and b/nwnds_module/tbl_crsdbttlfld.are differ diff --git a/nwnds_module/tbl_crsdbttlfld.gic b/nwnds_module/tbl_crsdbttlfld.gic new file mode 100644 index 000000000..812f6da80 Binary files /dev/null and b/nwnds_module/tbl_crsdbttlfld.gic differ diff --git a/nwnds_module/tbl_crsdbttlfld.git b/nwnds_module/tbl_crsdbttlfld.git new file mode 100644 index 000000000..9c2362752 Binary files /dev/null and b/nwnds_module/tbl_crsdbttlfld.git differ diff --git a/nwnds_module/tbl_desertfort.are b/nwnds_module/tbl_desertfort.are new file mode 100644 index 000000000..2e993e161 Binary files /dev/null and b/nwnds_module/tbl_desertfort.are differ diff --git a/nwnds_module/tbl_desertfort.gic b/nwnds_module/tbl_desertfort.gic new file mode 100644 index 000000000..8893a3d7a Binary files /dev/null and b/nwnds_module/tbl_desertfort.gic differ diff --git a/nwnds_module/tbl_desertfort.git b/nwnds_module/tbl_desertfort.git new file mode 100644 index 000000000..b3388a645 Binary files /dev/null and b/nwnds_module/tbl_desertfort.git differ diff --git a/nwnds_module/tbl_drakesdemise.are b/nwnds_module/tbl_drakesdemise.are new file mode 100644 index 000000000..c0f495cbf Binary files /dev/null and b/nwnds_module/tbl_drakesdemise.are differ diff --git a/nwnds_module/tbl_drakesdemise.gic b/nwnds_module/tbl_drakesdemise.gic new file mode 100644 index 000000000..30b5c4b9c Binary files /dev/null and b/nwnds_module/tbl_drakesdemise.gic differ diff --git a/nwnds_module/tbl_drakesdemise.git b/nwnds_module/tbl_drakesdemise.git new file mode 100644 index 000000000..a2d2e38bc Binary files /dev/null and b/nwnds_module/tbl_drakesdemise.git differ diff --git a/nwnds_module/tbl_forktngrd_n.are b/nwnds_module/tbl_forktngrd_n.are new file mode 100644 index 000000000..65a1a5268 Binary files /dev/null and b/nwnds_module/tbl_forktngrd_n.are differ diff --git a/nwnds_module/tbl_forktngrd_n.gic b/nwnds_module/tbl_forktngrd_n.gic new file mode 100644 index 000000000..f11d67234 Binary files /dev/null and b/nwnds_module/tbl_forktngrd_n.gic differ diff --git a/nwnds_module/tbl_forktngrd_n.git b/nwnds_module/tbl_forktngrd_n.git new file mode 100644 index 000000000..454215a4e Binary files /dev/null and b/nwnds_module/tbl_forktngrd_n.git differ diff --git a/nwnds_module/tbl_forktngrd_s.are b/nwnds_module/tbl_forktngrd_s.are new file mode 100644 index 000000000..2c6efd134 Binary files /dev/null and b/nwnds_module/tbl_forktngrd_s.are differ diff --git a/nwnds_module/tbl_forktngrd_s.gic b/nwnds_module/tbl_forktngrd_s.gic new file mode 100644 index 000000000..53fff0655 Binary files /dev/null and b/nwnds_module/tbl_forktngrd_s.gic differ diff --git a/nwnds_module/tbl_forktngrd_s.git b/nwnds_module/tbl_forktngrd_s.git new file mode 100644 index 000000000..76f92e00c Binary files /dev/null and b/nwnds_module/tbl_forktngrd_s.git differ diff --git a/nwnds_module/tbl_graksfort.are b/nwnds_module/tbl_graksfort.are new file mode 100644 index 000000000..2f34d30d1 Binary files /dev/null and b/nwnds_module/tbl_graksfort.are differ diff --git a/nwnds_module/tbl_graksfort.gic b/nwnds_module/tbl_graksfort.gic new file mode 100644 index 000000000..700df896b Binary files /dev/null and b/nwnds_module/tbl_graksfort.gic differ diff --git a/nwnds_module/tbl_graksfort.git b/nwnds_module/tbl_graksfort.git new file mode 100644 index 000000000..c15b2deb6 Binary files /dev/null and b/nwnds_module/tbl_graksfort.git differ diff --git a/nwnds_module/tbl_grakspool_1.are b/nwnds_module/tbl_grakspool_1.are new file mode 100644 index 000000000..9096adb7a Binary files /dev/null and b/nwnds_module/tbl_grakspool_1.are differ diff --git a/nwnds_module/tbl_grakspool_1.gic b/nwnds_module/tbl_grakspool_1.gic new file mode 100644 index 000000000..e791e5731 Binary files /dev/null and b/nwnds_module/tbl_grakspool_1.gic differ diff --git a/nwnds_module/tbl_grakspool_1.git b/nwnds_module/tbl_grakspool_1.git new file mode 100644 index 000000000..c011608d1 Binary files /dev/null and b/nwnds_module/tbl_grakspool_1.git differ diff --git a/nwnds_module/tbl_grakspool_2.are b/nwnds_module/tbl_grakspool_2.are new file mode 100644 index 000000000..09c13639b Binary files /dev/null and b/nwnds_module/tbl_grakspool_2.are differ diff --git a/nwnds_module/tbl_grakspool_2.gic b/nwnds_module/tbl_grakspool_2.gic new file mode 100644 index 000000000..e78e83de5 Binary files /dev/null and b/nwnds_module/tbl_grakspool_2.gic differ diff --git a/nwnds_module/tbl_grakspool_2.git b/nwnds_module/tbl_grakspool_2.git new file mode 100644 index 000000000..85031c50d Binary files /dev/null and b/nwnds_module/tbl_grakspool_2.git differ diff --git a/nwnds_module/tbl_greysands.are b/nwnds_module/tbl_greysands.are new file mode 100644 index 000000000..08b1db5d5 Binary files /dev/null and b/nwnds_module/tbl_greysands.are differ diff --git a/nwnds_module/tbl_greysands.gic b/nwnds_module/tbl_greysands.gic new file mode 100644 index 000000000..53fff0655 Binary files /dev/null and b/nwnds_module/tbl_greysands.gic differ diff --git a/nwnds_module/tbl_greysands.git b/nwnds_module/tbl_greysands.git new file mode 100644 index 000000000..9b97d2898 Binary files /dev/null and b/nwnds_module/tbl_greysands.git differ diff --git a/nwnds_module/tbl_grottodreams.are b/nwnds_module/tbl_grottodreams.are new file mode 100644 index 000000000..c8142ae42 Binary files /dev/null and b/nwnds_module/tbl_grottodreams.are differ diff --git a/nwnds_module/tbl_grottodreams.gic b/nwnds_module/tbl_grottodreams.gic new file mode 100644 index 000000000..c9fe118cc Binary files /dev/null and b/nwnds_module/tbl_grottodreams.gic differ diff --git a/nwnds_module/tbl_grottodreams.git b/nwnds_module/tbl_grottodreams.git new file mode 100644 index 000000000..43bbb2a55 Binary files /dev/null and b/nwnds_module/tbl_grottodreams.git differ diff --git a/nwnds_module/tbl_ravines.are b/nwnds_module/tbl_ravines.are new file mode 100644 index 000000000..c7cec0380 Binary files /dev/null and b/nwnds_module/tbl_ravines.are differ diff --git a/nwnds_module/tbl_ravines.gic b/nwnds_module/tbl_ravines.gic new file mode 100644 index 000000000..d6627f02e Binary files /dev/null and b/nwnds_module/tbl_ravines.gic differ diff --git a/nwnds_module/tbl_ravines.git b/nwnds_module/tbl_ravines.git new file mode 100644 index 000000000..0c15c92bb Binary files /dev/null and b/nwnds_module/tbl_ravines.git differ diff --git a/nwnds_module/tbl_ravinestent.are b/nwnds_module/tbl_ravinestent.are new file mode 100644 index 000000000..1082e5179 Binary files /dev/null and b/nwnds_module/tbl_ravinestent.are differ diff --git a/nwnds_module/tbl_ravinestent.gic b/nwnds_module/tbl_ravinestent.gic new file mode 100644 index 000000000..00bc4b243 Binary files /dev/null and b/nwnds_module/tbl_ravinestent.gic differ diff --git a/nwnds_module/tbl_ravinestent.git b/nwnds_module/tbl_ravinestent.git new file mode 100644 index 000000000..b507b5d4f Binary files /dev/null and b/nwnds_module/tbl_ravinestent.git differ diff --git a/nwnds_module/tbl_river_blood.are b/nwnds_module/tbl_river_blood.are new file mode 100644 index 000000000..8a4f9b0bf Binary files /dev/null and b/nwnds_module/tbl_river_blood.are differ diff --git a/nwnds_module/tbl_river_blood.gic b/nwnds_module/tbl_river_blood.gic new file mode 100644 index 000000000..de2df9aa1 Binary files /dev/null and b/nwnds_module/tbl_river_blood.gic differ diff --git a/nwnds_module/tbl_river_blood.git b/nwnds_module/tbl_river_blood.git new file mode 100644 index 000000000..9bb77b21e Binary files /dev/null and b/nwnds_module/tbl_river_blood.git differ diff --git a/nwnds_module/tbl_safecave.are b/nwnds_module/tbl_safecave.are new file mode 100644 index 000000000..3bd6ebe7f Binary files /dev/null and b/nwnds_module/tbl_safecave.are differ diff --git a/nwnds_module/tbl_safecave.gic b/nwnds_module/tbl_safecave.gic new file mode 100644 index 000000000..c4b6bcb4d Binary files /dev/null and b/nwnds_module/tbl_safecave.gic differ diff --git a/nwnds_module/tbl_safecave.git b/nwnds_module/tbl_safecave.git new file mode 100644 index 000000000..64f5f3f43 Binary files /dev/null and b/nwnds_module/tbl_safecave.git differ diff --git a/nwnds_module/tbl_sandsoftime.are b/nwnds_module/tbl_sandsoftime.are new file mode 100644 index 000000000..bc7911420 Binary files /dev/null and b/nwnds_module/tbl_sandsoftime.are differ diff --git a/nwnds_module/tbl_sandsoftime.gic b/nwnds_module/tbl_sandsoftime.gic new file mode 100644 index 000000000..86f04a4b4 Binary files /dev/null and b/nwnds_module/tbl_sandsoftime.gic differ diff --git a/nwnds_module/tbl_sandsoftime.git b/nwnds_module/tbl_sandsoftime.git new file mode 100644 index 000000000..3391f6522 Binary files /dev/null and b/nwnds_module/tbl_sandsoftime.git differ diff --git a/nwnds_module/tbl_undergraks.are b/nwnds_module/tbl_undergraks.are new file mode 100644 index 000000000..8265aa1f8 Binary files /dev/null and b/nwnds_module/tbl_undergraks.are differ diff --git a/nwnds_module/tbl_undergraks.gic b/nwnds_module/tbl_undergraks.gic new file mode 100644 index 000000000..ea3be9551 Binary files /dev/null and b/nwnds_module/tbl_undergraks.gic differ diff --git a/nwnds_module/tbl_undergraks.git b/nwnds_module/tbl_undergraks.git new file mode 100644 index 000000000..25fcb8915 Binary files /dev/null and b/nwnds_module/tbl_undergraks.git differ diff --git a/nwnds_module/tchest_loot.ncs b/nwnds_module/tchest_loot.ncs new file mode 100644 index 000000000..f8cee21bf Binary files /dev/null and b/nwnds_module/tchest_loot.ncs differ diff --git a/nwnds_module/tchest_loot.nss b/nwnds_module/tchest_loot.nss new file mode 100644 index 000000000..96e313c84 --- /dev/null +++ b/nwnds_module/tchest_loot.nss @@ -0,0 +1,582 @@ +//Treasure Chest Loot +/* + By: The Great Slayer of Gelatinous Cubes + On: 1/31/03 + This generates loot in a treasure chest based on initial items placed in it + Included is a CreateLootXTimes, for easy customization + This goes in a containers on open event + + Enjoy! +*/ +#include "TGSOFGC_INC" +void CreateLoot(object oSelf, int iNum) +//Originally I used the local object to set the stack size +//However, while this method should work, it seems to only work the first time +//The function is called, why is still a mystery +{ + int iPick = Random(iNum)+1; //The random number of the pick + string sNum = IntToString(iPick); //Convert the number into a string to use as a name + string sResref = GetLocalString(oSelf, sNum); //Get the resref stored under that number + //////These two lines are relics to a mystery I would love an answer to + // object oRef = GetLocalObject(oSelf, sNum); + // int iStack = GetNumStackedItems(oRef); + /////////////////////////////////////////////// + CreateItemOnObject(sResref, oSelf, 1); //Spawn a stack size one of that loot +} +void CreateLootXTimes(int iTimes, object oChest, int iNum) +//This function is included for customization by novice scriptors whom are scared +//It Also reduces future needs to type, I am only including suport for: +//ints ranging between 0-30, if You run a function like create loot 30+ times you are asking to crash +//I recommend keeping this low, especially lower than about 15-20 +//This script is dedicated to the god send of Copy+Paste +{ + if(iTimes == 1){ + CreateLoot(oChest, iNum); + } + if(iTimes == 2){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 3){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 4){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 5){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 6){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 7){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 8){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 9){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 10){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 11){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 12){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 13){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 14){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 15){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 16){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 17){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 18){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 19){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 20){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 21){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 22){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 23){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 24){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 25){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 26){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 27){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 28){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 29){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + if(iTimes == 30){ + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + CreateLoot(oChest, iNum); + } + else{} +} +void main() +//This script goes in a container's on open event +{ + object oChest = OBJECT_SELF; //The container + float fDelay = RandomFloat(1200.0)+600.0; //Respawn delay = 10-20 minutes + //float fDelay = 1.0; //This is a relic of testing + int iLocal = GetLocalInt(oChest, "switch"); //The switch local keeps track of three states, first time open/unopened = 0, will spawn treasure when opened = 1, nothing special = 2 + if(iLocal == 0){ //This should only fire the first time it is opened + int iNumber = CountItemsInInventory(oChest); //This should only run once, and sets the approprait local variables for the createloot function + SetLocalInt(oChest, "items", iNumber);//Store the info above, so you don't need to run more counts + EmptyInventory(oChest);//Get rid of the initial stuff, that made up the options or loot table + CreateLoot(oChest, iNumber); //Create one peice of loot + SetLocalInt(oChest, "switch", 2); //Set to deactivate + DelayCommand(fDelay, SetLocalInt(oChest, "switch", 1)); //After the delay passes set to 1, or active + } + if(iLocal == 1){ + int iNum = GetLocalInt(oChest, "items"); //Get the local int, set above so you don't need to count again. Multiple counts after the emptying and or additions wrecks the loot table + CreateLoot(oChest, iNum); //Create one peice of loot + SetLocalInt(oChest, "switch", 2);//Set it to disabled + DelayCommand(fDelay, SetLocalInt(oChest, "switch", 1));//After the delay re-enable the chest + } + else{}//if iLocal doesn't equal 1 or 0, ie 2, then it is disabled (take no special actions) +} diff --git a/nwnds_module/tchowb_001.utc b/nwnds_module/tchowb_001.utc new file mode 100644 index 000000000..7318f38f2 Binary files /dev/null and b/nwnds_module/tchowb_001.utc differ diff --git a/nwnds_module/tembo001.utc b/nwnds_module/tembo001.utc new file mode 100644 index 000000000..de02de86b Binary files /dev/null and b/nwnds_module/tembo001.utc differ diff --git a/nwnds_module/tembo002.utc b/nwnds_module/tembo002.utc new file mode 100644 index 000000000..663fb3e34 Binary files /dev/null and b/nwnds_module/tembo002.utc differ diff --git a/nwnds_module/tembobite.uti b/nwnds_module/tembobite.uti new file mode 100644 index 000000000..41a8b6f71 Binary files /dev/null and b/nwnds_module/tembobite.uti differ diff --git a/nwnds_module/tembohide.uti b/nwnds_module/tembohide.uti new file mode 100644 index 000000000..a02d56603 Binary files /dev/null and b/nwnds_module/tembohide.uti differ diff --git a/nwnds_module/temp.ncs b/nwnds_module/temp.ncs new file mode 100644 index 000000000..464fc5b02 Binary files /dev/null and b/nwnds_module/temp.ncs differ diff --git a/nwnds_module/temp.nss b/nwnds_module/temp.nss new file mode 100644 index 000000000..9dcbccea8 --- /dev/null +++ b/nwnds_module/temp.nss @@ -0,0 +1,17 @@ +void main() +{ + // Get the creature who triggered this event. + object oPC = GetExitingObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Only fire once per PC. + if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) ) + return; + SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE); + + // Set a local integer. + SetLocalInt(oPC, "ring_mount_pass", 1); +} diff --git a/nwnds_module/test_pool.ncs b/nwnds_module/test_pool.ncs new file mode 100644 index 000000000..353227dd5 Binary files /dev/null and b/nwnds_module/test_pool.ncs differ diff --git a/nwnds_module/test_pool.nss b/nwnds_module/test_pool.nss new file mode 100644 index 000000000..c8a8a0dbe --- /dev/null +++ b/nwnds_module/test_pool.nss @@ -0,0 +1,62 @@ +//NiteCap 7-1-08 +//Divining pool script + +// only shows PC's with in the +/- 6 level range +// oSeer should point to the object using the script ie PC using the script +// oToBeSeen is the PC to check v/s the oSeer + +int GetPCCanBeSeen(object oSeer, object oToBeSeen); + + +//beg main +void main() +{ +object oUser = GetLastUsedBy(); +object oPC = GetFirstPC(); +string SpeakText; + + while(GetIsPC(oPC)) + { + if(!GetIsDM(oPC) || !GetIsDMPossessed(oPC)) + { + if (GetPCCanBeSeen(oUser,oPC)) + { + SpeakText += GetName(oPC); + SpeakText += " is in "; + SpeakText += GetName(GetArea(oPC)); + SpeakText += "\n"; + oPC = GetNextPC(); + } + } + oPC = GetNextPC(); + } + SpeakString(SpeakText); +} + //end main + + +int GetPCCanBeSeen(object oSeer, object oToBeSeen) +{ + int iUHD = GetHitDice(oSeer); + int iPCHD=GetHitDice(oToBeSeen); + int nGap = (iUHD-iPCHD); + + // base is unseen + int bSeen=FALSE; + if(nGap >= -6 <= 6)bSeen=TRUE; +/* + //if the user's hitdice are more than the PC oToBeSeen + if (iUHD = iPCHD) + { + if((iUHD - iPCHD) <= 6)bSeen=TRUE; + } + //if the user's hitdice are less than the PC oToBeSeen + if (iPCHD >= iUHD) + { + if((iPCHD-iUHD)<=6)bSeen=TRUE; + } + //let us see? + +*/ + return bSeen; +} diff --git a/nwnds_module/tg_revolve_001.ncs b/nwnds_module/tg_revolve_001.ncs new file mode 100644 index 000000000..15f385bc2 Binary files /dev/null and b/nwnds_module/tg_revolve_001.ncs differ diff --git a/nwnds_module/tg_revolve_001.nss b/nwnds_module/tg_revolve_001.nss new file mode 100644 index 000000000..0cb39cf2c --- /dev/null +++ b/nwnds_module/tg_revolve_001.nss @@ -0,0 +1,35 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this script OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +FloatingTextStringOnCreature("'As you step on the pressure-plate, the wall before you revolves, revealing an inner chamber.' ", oPC); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("DST_RevDoor_E"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} diff --git a/nwnds_module/tg_revolve_002.ncs b/nwnds_module/tg_revolve_002.ncs new file mode 100644 index 000000000..2794e9494 Binary files /dev/null and b/nwnds_module/tg_revolve_002.ncs differ diff --git a/nwnds_module/tg_revolve_002.nss b/nwnds_module/tg_revolve_002.nss new file mode 100644 index 000000000..2cb4b9418 --- /dev/null +++ b/nwnds_module/tg_revolve_002.nss @@ -0,0 +1,36 @@ +/* Script generated by +Lilac Soul's NWN Script Generator, v. 2.3 + +For download info, please visit: +http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */ + +//Put this script OnUsed +void main() +{ + +object oPC = GetLastUsedBy(); + +if (!GetIsPC(oPC)) return; + +FloatingTextStringOnCreature("'As you step on the pressure-plate, the wall before you revolves, revealing a long hallway.' ", oPC); + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("DST_RevDoor_X"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/tgc_trollgrave01.are b/nwnds_module/tgc_trollgrave01.are new file mode 100644 index 000000000..21f31db15 Binary files /dev/null and b/nwnds_module/tgc_trollgrave01.are differ diff --git a/nwnds_module/tgc_trollgrave01.gic b/nwnds_module/tgc_trollgrave01.gic new file mode 100644 index 000000000..55fb417d7 Binary files /dev/null and b/nwnds_module/tgc_trollgrave01.gic differ diff --git a/nwnds_module/tgc_trollgrave01.git b/nwnds_module/tgc_trollgrave01.git new file mode 100644 index 000000000..e6e0cefab Binary files /dev/null and b/nwnds_module/tgc_trollgrave01.git differ diff --git a/nwnds_module/tgdc_explore_inc.nss b/nwnds_module/tgdc_explore_inc.nss new file mode 100644 index 000000000..1006a507c --- /dev/null +++ b/nwnds_module/tgdc_explore_inc.nss @@ -0,0 +1,54 @@ + +//Checks to see if the player has been in the current area and +//if they have not, sends description and awards XP. +//oPC = Player nReveal: 1 = Reveals whole map - 0 = Does not - 2 Hides Map +//Info Type can be classed as the following: +void PlayerExplore(object oPC, int nReveal); + +void PlayerExplore(object oPC, int nReveal) +{ + if (!GetIsPC(oPC)) return; + if (nReveal == 1)ExploreAreaForPlayer(GetArea(oPC), oPC, TRUE); + if (nReveal == 2)ExploreAreaForPlayer(GetArea(oPC), oPC, FALSE); + +//GET AREA DETAILS + object oArea = GetArea(oPC); + string sArea = GetTag(oArea); +//DATABASE FUNCTIONS GO HERE + int nHasExplored = GetCampaignInt("Exploring Athas", sArea, oPC); + if (nHasExplored == 1) return; +//AREAS START FROM HERE +//ADD ONE "if (sArea =="") FOR EACH AREA YOU WISH TO DESCRIBE + + if (sArea == "AltarukREBUILD")//THE VARIABLE USED IS THE TAG OF THE AREA + { + //EDIT THE XP GIVEN AND JOURNAL ENTRY ID NUMBER TO SUIT + AddJournalQuestEntry("Exploring Athas", 1, oPC, FALSE, FALSE);//ONLY CHANGE THE ID NUMBER + GiveXPToCreature(oPC, 10);//DEFAULT IS 10 XP + SetCampaignInt("Exploring Athas", sArea, 1, oPC);//DO NOT CHANGE THIS NUMBER + return; + } + + if (sArea == "TheVillageofKled")//THE VARIABLE USED IS THE TAG OF THE AREA + { + //EDIT THE XP GIVEN AND JOURNAL ENTRY ID NUMBER TO SUIT + AddJournalQuestEntry("Exploring Athas", 2, oPC, FALSE, FALSE);//ONLY CHANGE THE ID NUMBER + GiveXPToCreature(oPC, 10);//DEFAULT IS 10 XP + SetCampaignInt("Exploring Athas", sArea, 1, oPC);//DO NOT CHANGE THIS NUMBER + return; + } + + if (sArea == "CaravanWayREBUILD")//THE VARIABLE USED IS THE TAG OF THE AREA + { + //EDIT THE XP GIVEN AND JOURNAL ENTRY ID NUMBER TO SUIT + AddJournalQuestEntry("Exploring Athas", 3, oPC, FALSE, FALSE);//ONLY CHANGE THE ID NUMBER + GiveXPToCreature(oPC, 10);//DEFAULT IS 10 XP + SetCampaignInt("Exploring Athas", sArea, 1, oPC);//DO NOT CHANGE THIS NUMBER + return; + } + +return; +} + +//void main(){} + diff --git a/nwnds_module/tgsofgc_inc.nss b/nwnds_module/tgsofgc_inc.nss new file mode 100644 index 000000000..0dcb21bb6 --- /dev/null +++ b/nwnds_module/tgsofgc_inc.nss @@ -0,0 +1,271 @@ +int CountEffectsOnObject(object oTarget) +//Again this is a standard counting effect, it simply deletes the local int +//Also because you can't SetLocalEffect, this has questionable utility +{ + effect eTarget = GetFirstEffect(oTarget); + DeleteLocalInt(oTarget, "count_e"); + do{ + int iNum = GetLocalInt(oTarget, "count_e"); + SetLocalInt(oTarget, "count_e", iNum+1); + }while(GetIsEffectValid(eTarget = GetNextEffect(oTarget)) != FALSE); + int iLocal = GetLocalInt(oTarget, "count_e"); + DeleteLocalInt(oTarget, "count_e"); + return iLocal; + +} +int CountObjectTypeInArea(object oArea, int iObjectType) +//The int uses the same objecttype phrasing as GetObjectType +{ + object oThing = GetFirstObjectInArea(oArea); + DeleteLocalInt(oArea, "count_ota"); + do{ + int iType = GetObjectType(oThing); + if(iType == iObjectType){ + int iCount = GetLocalInt(oArea, "count_ota"); + SetLocalInt(oArea, "count_ota", iCount+1); + int iNum = GetLocalInt(oArea, "count_ota"); + string sNum = IntToString(iNum); + SetLocalObject(oArea, sNum, oThing); + } + else{} + }while((oThing = GetNextObjectInArea(oArea)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oArea, "count_ota"); + DeleteLocalInt(oArea, "count_ota"); + return iLocal; +} +int CountEnemyTowardsInArea(object oArea, object oTarget) +//This is a counting function to return number of creatures hostile towards the target in the area +{ + object oThing = GetFirstObjectInArea(oArea); + DeleteLocalInt(oArea, "count_ett"); + do{ + int iType = GetObjectType(oThing); + if(iType == OBJECT_TYPE_CREATURE){ + int iEnemy = GetIsEnemy(oThing, oTarget); + if(iEnemy == TRUE){ + int iCount = GetLocalInt(oArea, "count_ett"); + SetLocalInt(oArea, "count_ett", iCount+1); + int iNum = GetLocalInt(oArea, "count_ett"); + string sNum = IntToString(iNum); + SetLocalObject(oArea, sNum, oThing); + } + else{} + } + else{} + }while((oThing = GetNextObjectInArea(oArea)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oArea, "count_ett"); + DeleteLocalInt(oArea, "count_ett"); + return iLocal; +} +int CountMembersOfFaction(object oMemberOfFaction, int iPcOnly=TRUE) +//the inputs are the same as per the getfirstfactionmember function +//Stores all variables on the faction member used for the input +{ + object oMember = GetFirstFactionMember(oMemberOfFaction, iPcOnly); + do{ + int iCount = GetLocalInt(oMemberOfFaction, "count_mfm"); + SetLocalInt(oMemberOfFaction, "count_mfm", iCount+1); + int iNum = GetLocalInt(oMemberOfFaction, "count_mfm"); + string sNum = IntToString(iNum); + SetLocalObject(oMemberOfFaction, sNum, oMember); + }while((oMember = GetNextFactionMember(oMemberOfFaction, iPcOnly)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oMemberOfFaction, "count_mfm"); + DeleteLocalInt(oMemberOfFaction, "count_mfm"); + return iLocal; +} +int CountPlayersInModule() +{ + object oPlayer = GetFirstPC(); + object oModule = GetModule(); + DeleteLocalInt(oModule, "count_mp"); + do{ + int iCount = GetLocalInt(oModule, "count_mp"); + SetLocalInt(oModule, "count_mp", iCount+1); + int iNum = GetLocalInt(oModule, "count_mp"); + string sNum = IntToString(iNum); + SetLocalObject(oModule, sNum, oPlayer); + }while((oPlayer = GetNextPC()) != OBJECT_INVALID); + int iLocal = GetLocalInt(oModule, "count_mp"); + DeleteLocalInt(oModule, "count_mp"); + return iLocal; +} +int CountPlayersInArea(object oArea) +{ + object oThing = GetFirstObjectInArea(oArea); + DeleteLocalInt(oArea, "count_ap"); + do{ + int iPc = GetIsPC(oThing); + if(iPc == TRUE){ + int iCount = GetLocalInt(oArea, "count_ap"); + SetLocalInt(oArea, "count_ap", iCount+1); + int iNum = GetLocalInt(oArea, "count_ap"); + string sNum = IntToString(iNum); + SetLocalObject(oArea, sNum, oThing); + } + else{} + }while((oThing = GetNextObjectInArea(oArea)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oArea, "count_ap"); + DeleteLocalInt(oArea, "count_ap"); + return iLocal; +} +int CountItemsInInventory(object oChest) +//Counting functions output a int of the count as well as saving +//a number of local variables making GetRandom scripting possible +{ + object oItem = GetFirstItemInInventory(oChest); + DeleteLocalInt(oChest, "count_i"); + do{ + int iCount = GetLocalInt(oChest, "count_i"); + SetLocalInt(oChest, "count_i", iCount+1); + int iNum = GetLocalInt(oChest, "count_i"); + string sNum = IntToString(iNum); + string sResref = GetResRef(oItem); + SetLocalString(oChest, sNum, sResref); + SetLocalObject(oChest, sNum, oItem); + }while((oItem = GetNextItemInInventory(oChest)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oChest, "count_i"); + DeleteLocalInt(oChest, "count_i"); + return iLocal; +} +float RandomFloat(float fInput) +{ + float fOutput = IntToFloat(Random(FloatToInt(fInput))); + return fOutput; +} +location GetLocationInArcOfObject(object oTarget, float fArcAngle, float fArcAngleLength, int iMinDistance, int iMaxDistance) +//This is ideal for say getting a location behind something +//The arcangle is the counterclockwise variation from the object's facing, ie 0 = objects facing, and 180 = objects rear +//arcangle length is the angle of the arc, a quarter circle is 90 +//The min distance is the minimium distance the location will be from the target +//maximium distance is maximium distance of the location from target +//out put location's fOrient is always facing the object used to create it +{ + float fFacing = GetFacing(oTarget)+fArcAngle; + float fHalfArc = (fArcAngleLength/2.0); + float fMax = fFacing+fHalfArc; + float fMin = fFacing+fHalfArc; + float fArcSpread = fMax-fMin; + float fAngle = RandomFloat(fArcSpread+1.0)+fMin; + int iDistSpread = iMaxDistance-iMinDistance; + float fDist = IntToFloat(Random(iDistSpread)+iMinDistance); + float fX1 = cos(fAngle); + float fY1 = sin(fAngle); + float fX = (fX1*fDist); + float fY = (fY1*fDist); + vector vPos = Vector(fX, fY, 0.0); + object oArea = GetArea(oTarget); + float fOrient = fAngle+180.0; + location lOutput = Location(oArea, vPos, fOrient); + return lOutput; +} +location GetLocationNear(int iMinDistance, int iMaxDistance, location lTarget) +//This returns a location near the target location such that it is at least min dist away and isn't more than max dist away +{ + int iSpread = iMaxDistance-iMinDistance; + int iDist = Random(iSpread+1)+iMinDistance; + int iX = Random(iDist+1); + int iY = iDist-iX; + float fX = IntToFloat(iX); + float fY = IntToFloat(iY); + vector vAdd = Vector(fX, fY, 0.0); + vector vCurrent = GetPositionFromLocation(lTarget); + object oArea = GetAreaFromLocation(lTarget); + float fOrient = GetFacingFromLocation(lTarget); + vector vNew = vCurrent+vAdd; + location lOutput = Location(oArea, vNew, fOrient); + return lOutput; +} +location GetRandomLocation(object oArea, int iXTiles, int iYTiles, float fOrient) +{ + int iX = Random(iXTiles*10); //Random # between 0- 10* number of tiles (each tile is 10 in each direction) + int iY = Random(iYTiles*10); //Same as above + float fX = IntToFloat(iX); //Convert int to float, because floats are necessary for distance and creating vectors + float fY = IntToFloat(iY); + vector vPos = Vector(fX, fY, 0.0);//Create a vector from your random coordinates of above + location lTarget = Location(oArea, vPos, fOrient);//Create a location from the position above and input data + return lTarget; //output the target location +} +int GetTotalHitDiceOfArea(object oArea) +//this returns the total hit dice of every creature currently in the area +//This is less like other counting functions in that it isn't met for prepatory work +//This function erases all its local ints +{ + object oCritter = GetFirstObjectInArea(oArea); + DeleteLocalInt(oArea, "hitdice"); + do{ + int iType = GetObjectType(oCritter); + if(iType == OBJECT_TYPE_CREATURE){ + int iHitDice = GetHitDice(oCritter); + int iNum = GetLocalInt(oArea, "hitdice"); + SetLocalInt(oArea, "hitdice", iNum+iHitDice); + } + else{} + }while((oCritter = GetNextObjectInArea(oArea)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oArea, "hitdice"); + DeleteLocalInt(oArea, "hitdice"); + return iLocal; + +} +int GetTotalHitDiceOfPlayersInArea(object oArea) +//this returns the total hit dice of every creature currently in the area +//This is less like other counting functions in that it isn't met for prepatory work +//This function erases all its local ints +{ + object oCritter = GetFirstObjectInArea(oArea); + DeleteLocalInt(oArea, "hitdice"); + do{ + int iType = GetIsPC(oCritter); + if(iType == TRUE){ + int iHitDice = GetHitDice(oCritter); + int iNum = GetLocalInt(oArea, "hitdice"); + SetLocalInt(oArea, "hitdice", iNum+iHitDice); + } + else{} + }while((oCritter = GetNextObjectInArea(oArea)) != OBJECT_INVALID); + int iLocal = GetLocalInt(oArea, "hitdice"); + DeleteLocalInt(oArea, "hitdice"); + return iLocal; + +} +int GetAverageCreatureHitDice(object oArea) +//this returns the average hitdice count for all the creatures in an area +//This doesn't count players +{ + int iCount = CountObjectTypeInArea(oArea, OBJECT_TYPE_CREATURE); + int iCountPlayers = CountPlayersInArea(oArea); + int iHDTotal = GetTotalHitDiceOfArea(oArea); + int iHDPlayers = GetTotalHitDiceOfPlayersInArea(oArea); + int iHD = iHDTotal-iHDPlayers; + int iDiv = iCount-iCountPlayers; + int iReturn = (iHD/iDiv); + return iReturn; +} +object GetRandomItemIn(object oTarget) +//This calls the Inventory Counting function as part of it +//Note these are local objects, so it actually retrieves that object, not a copy of it +{ + int iNum = CountItemsInInventory(oTarget); + int iPick = Random(iNum)+1; + string sNum = IntToString(iPick); + object oReturn = GetLocalObject(oTarget, sNum); + return oReturn; +} +object GetRandomObjectInArea(object oArea, int iObjectType) +//This returns the actual object froma getlocal object after running the counting function +{ + int iNum = CountObjectTypeInArea(oArea, iObjectType); + int iPick = Random(iNum)+1; + string sNum = IntToString(iPick); + object oReturn = GetLocalObject(oArea, sNum); + return oReturn; +} +void EmptyInventory(object oTarget) +//this destroys all items in a target object's inventory +//Including plot items... +{ + object oItem = GetFirstItemInInventory(oTarget); + do{ + SetPlotFlag(oItem, FALSE); + DestroyObject(oItem, 0.0); + }while((oItem = GetNextItemInInventory(oTarget)) != OBJECT_INVALID); +} diff --git a/nwnds_module/the_barrens.are b/nwnds_module/the_barrens.are new file mode 100644 index 000000000..1a2d9337e Binary files /dev/null and b/nwnds_module/the_barrens.are differ diff --git a/nwnds_module/the_barrens.gic b/nwnds_module/the_barrens.gic new file mode 100644 index 000000000..d1378b2e8 Binary files /dev/null and b/nwnds_module/the_barrens.gic differ diff --git a/nwnds_module/the_barrens.git b/nwnds_module/the_barrens.git new file mode 100644 index 000000000..73f01b79d Binary files /dev/null and b/nwnds_module/the_barrens.git differ diff --git a/nwnds_module/the_great_rift.are b/nwnds_module/the_great_rift.are new file mode 100644 index 000000000..5f21b0929 Binary files /dev/null and b/nwnds_module/the_great_rift.are differ diff --git a/nwnds_module/the_great_rift.gic b/nwnds_module/the_great_rift.gic new file mode 100644 index 000000000..b3058c4e4 Binary files /dev/null and b/nwnds_module/the_great_rift.gic differ diff --git a/nwnds_module/the_great_rift.git b/nwnds_module/the_great_rift.git new file mode 100644 index 000000000..eafe94b57 Binary files /dev/null and b/nwnds_module/the_great_rift.git differ diff --git a/nwnds_module/thegray.are b/nwnds_module/thegray.are new file mode 100644 index 000000000..37509c7cc Binary files /dev/null and b/nwnds_module/thegray.are differ diff --git a/nwnds_module/thegray.gic b/nwnds_module/thegray.gic new file mode 100644 index 000000000..a66812c23 Binary files /dev/null and b/nwnds_module/thegray.gic differ diff --git a/nwnds_module/thegray.git b/nwnds_module/thegray.git new file mode 100644 index 000000000..72469fdc9 Binary files /dev/null and b/nwnds_module/thegray.git differ diff --git a/nwnds_module/thequietofthemin.are b/nwnds_module/thequietofthemin.are new file mode 100644 index 000000000..da3275638 Binary files /dev/null and b/nwnds_module/thequietofthemin.are differ diff --git a/nwnds_module/thequietofthemin.gic b/nwnds_module/thequietofthemin.gic new file mode 100644 index 000000000..659a11dc2 Binary files /dev/null and b/nwnds_module/thequietofthemin.gic differ diff --git a/nwnds_module/thequietofthemin.git b/nwnds_module/thequietofthemin.git new file mode 100644 index 000000000..fab8ca512 Binary files /dev/null and b/nwnds_module/thequietofthemin.git differ diff --git a/nwnds_module/thiefmem.ncs b/nwnds_module/thiefmem.ncs new file mode 100644 index 000000000..d003001ba Binary files /dev/null and b/nwnds_module/thiefmem.ncs differ diff --git a/nwnds_module/thiefmem.nss b/nwnds_module/thiefmem.nss new file mode 100644 index 000000000..0418283c6 --- /dev/null +++ b/nwnds_module/thiefmem.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName thiefmem +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/11/02 12:31:39 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") > 4)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/thiefmember.ncs b/nwnds_module/thiefmember.ncs new file mode 100644 index 000000000..ec8198726 Binary files /dev/null and b/nwnds_module/thiefmember.ncs differ diff --git a/nwnds_module/thiefmember.nss b/nwnds_module/thiefmember.nss new file mode 100644 index 000000000..25c45db9e --- /dev/null +++ b/nwnds_module/thiefmember.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: FileName thiefmember +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: DM Heatstroke +//:: Created On: June 18 2012 +//::////////////////////////////////////////////// + +int StartingConditional() +{ +object oPC = GetPCSpeaker(); + +if (GetItemPossessedBy(oPC, "FAC_ITPRNG_THIEF") == OBJECT_INVALID) return FALSE; + +return TRUE; +} + diff --git a/nwnds_module/thievesquest1.ncs b/nwnds_module/thievesquest1.ncs new file mode 100644 index 000000000..62f733c26 Binary files /dev/null and b/nwnds_module/thievesquest1.ncs differ diff --git a/nwnds_module/thievesquest1.nss b/nwnds_module/thievesquest1.nss new file mode 100644 index 000000000..2df53205d --- /dev/null +++ b/nwnds_module/thievesquest1.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName thievesquest1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:12:53 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "thievesquests", 1); + SetLocalInt(GetPCSpeaker(), "pickpocket",2); + +} diff --git a/nwnds_module/thievesquest2.ncs b/nwnds_module/thievesquest2.ncs new file mode 100644 index 000000000..df1c2569b Binary files /dev/null and b/nwnds_module/thievesquest2.ncs differ diff --git a/nwnds_module/thievesquest2.nss b/nwnds_module/thievesquest2.nss new file mode 100644 index 000000000..80b909edf --- /dev/null +++ b/nwnds_module/thievesquest2.nss @@ -0,0 +1,14 @@ +//:://///////////////////////////////////////////// +//:: FileName thievesquest1 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:12:53 PM +//::////////////////////////////////////////////// +void main() +{ + // Set the variables + SetLocalInt(GetPCSpeaker(), "thievesquests", 1); + SetLocalInt(GetPCSpeaker(), "pickpocket",3); + +} diff --git a/nwnds_module/thievestask2.ncs b/nwnds_module/thievestask2.ncs new file mode 100644 index 000000000..f35a7ead1 Binary files /dev/null and b/nwnds_module/thievestask2.ncs differ diff --git a/nwnds_module/thievestask2.nss b/nwnds_module/thievestask2.nss new file mode 100644 index 000000000..c8408a94a --- /dev/null +++ b/nwnds_module/thievestask2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName thievestask2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:43:35 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") == 3)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/thievestasks.ncs b/nwnds_module/thievestasks.ncs new file mode 100644 index 000000000..6dfc141f0 Binary files /dev/null and b/nwnds_module/thievestasks.ncs differ diff --git a/nwnds_module/thievestasks.nss b/nwnds_module/thievestasks.nss new file mode 100644 index 000000000..90a3e5a99 --- /dev/null +++ b/nwnds_module/thievestasks.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName thievestasks +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:43:35 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") == 2)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/thinkzombie003.utc b/nwnds_module/thinkzombie003.utc new file mode 100644 index 000000000..71d84e8d0 Binary files /dev/null and b/nwnds_module/thinkzombie003.utc differ diff --git a/nwnds_module/thinkzombiebite.uti b/nwnds_module/thinkzombiebite.uti new file mode 100644 index 000000000..be3e64eaf Binary files /dev/null and b/nwnds_module/thinkzombiebite.uti differ diff --git a/nwnds_module/thinkzombieclaw.uti b/nwnds_module/thinkzombieclaw.uti new file mode 100644 index 000000000..ac8f69416 Binary files /dev/null and b/nwnds_module/thinkzombieclaw.uti differ diff --git a/nwnds_module/thinkzombiehide.uti b/nwnds_module/thinkzombiehide.uti new file mode 100644 index 000000000..cfa386d2b Binary files /dev/null and b/nwnds_module/thinkzombiehide.uti differ diff --git a/nwnds_module/thndr_mts_entry.are b/nwnds_module/thndr_mts_entry.are new file mode 100644 index 000000000..6d4cb1885 Binary files /dev/null and b/nwnds_module/thndr_mts_entry.are differ diff --git a/nwnds_module/thndr_mts_entry.gic b/nwnds_module/thndr_mts_entry.gic new file mode 100644 index 000000000..ace76427f Binary files /dev/null and b/nwnds_module/thndr_mts_entry.gic differ diff --git a/nwnds_module/thndr_mts_entry.git b/nwnds_module/thndr_mts_entry.git new file mode 100644 index 000000000..13ab16433 Binary files /dev/null and b/nwnds_module/thndr_mts_entry.git differ diff --git a/nwnds_module/thndr_mts_spass.are b/nwnds_module/thndr_mts_spass.are new file mode 100644 index 000000000..415e36d39 Binary files /dev/null and b/nwnds_module/thndr_mts_spass.are differ diff --git a/nwnds_module/thndr_mts_spass.gic b/nwnds_module/thndr_mts_spass.gic new file mode 100644 index 000000000..fbe6a805c Binary files /dev/null and b/nwnds_module/thndr_mts_spass.gic differ diff --git a/nwnds_module/thndr_mts_spass.git b/nwnds_module/thndr_mts_spass.git new file mode 100644 index 000000000..b68c535d4 Binary files /dev/null and b/nwnds_module/thndr_mts_spass.git differ diff --git a/nwnds_module/tigone001.utc b/nwnds_module/tigone001.utc new file mode 100644 index 000000000..84c2fb3c7 Binary files /dev/null and b/nwnds_module/tigone001.utc differ diff --git a/nwnds_module/tigonehide.uti b/nwnds_module/tigonehide.uti new file mode 100644 index 000000000..90d405c30 Binary files /dev/null and b/nwnds_module/tigonehide.uti differ diff --git a/nwnds_module/tliz001.utc b/nwnds_module/tliz001.utc new file mode 100644 index 000000000..f63cd37b0 Binary files /dev/null and b/nwnds_module/tliz001.utc differ diff --git a/nwnds_module/tliz_aura.ncs b/nwnds_module/tliz_aura.ncs new file mode 100644 index 000000000..927f92fbb Binary files /dev/null and b/nwnds_module/tliz_aura.ncs differ diff --git a/nwnds_module/tliz_aura.nss b/nwnds_module/tliz_aura.nss new file mode 100644 index 000000000..e9d738c8f --- /dev/null +++ b/nwnds_module/tliz_aura.nss @@ -0,0 +1,16 @@ +//:: +//:: tliz_aura +//:: +//:: A pnp version of the T'liz's Fear & Unnatural Aura. +//:: +//:: Modified by: DM Heatstroke 01-25-11 +//:: + +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_FEAR,"tliz_aura1","null","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/tliz_aura1.ncs b/nwnds_module/tliz_aura1.ncs new file mode 100644 index 000000000..137f55a2f Binary files /dev/null and b/nwnds_module/tliz_aura1.ncs differ diff --git a/nwnds_module/tliz_aura1.nss b/nwnds_module/tliz_aura1.nss new file mode 100644 index 000000000..a646de07c --- /dev/null +++ b/nwnds_module/tliz_aura1.nss @@ -0,0 +1,96 @@ +//:: +//:: tliz_aura1 +//:: +//:: A pnp version of the T'liz's Fear & Unnatural Aura. +//:: +//:: Modified by: DM Heatstroke 01-25-11 +//:: + +#include "NW_I0_SPELLS" + +void main() +{ + //:: Declare major variables + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + string sImmune = GetName(oCaster)+"_AURA_IMMUNE"; + + int nDuration = d4(2)+2; + int nRacial = GetRacialType(oTarget); + int nLvl = GetHitDice(oTarget); + int nHD = GetHitDice(oCaster); + int nChaMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nDC = 10 + nChaMod + nHD/2; + int nCasterSeed = GetLocalInt(oCaster, sImmune); + int nTargetSeed = GetLocalInt(oTarget, sImmune); + + + //:: Setup visuals + effect eVis1 = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR); + effect eVis2 = EffectVisualEffect(1965); //:: HGVFX_DUR_HALO_PURPLE + + //:: Setup Panic conditions for animals & those with less than 5 HD + effect ePanic = EffectFrightened(); + effect ePanicSave = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2); + effect ePanicSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2); + effect ePanicLink = EffectLinkEffects(eVis1, ePanic); + ePanicLink = EffectLinkEffects(ePanicSkill, ePanicSave); + + //:: Setup Shaken conditions for those with fewer HD than the T'liz + effect eShakenSave = EffectSavingThrowDecrease(SAVING_THROW_ALL, 2); + effect eShakenSkill = EffectSkillDecrease(SKILL_ALL_SKILLS, 2); + effect eShakenAB = EffectAttackDecrease(2); + effect eShakenLink = EffectLinkEffects(eVis2, eShakenSave); + eShakenLink = EffectLinkEffects(eShakenAB, eShakenSkill); + + /*if (nTargetSeed |= 0 && nTargetSeed == nCasterSeed) + { + return; + }*/ + + //:: Animals get no save + if (nRacial == RACIAL_TYPE_ANIMAL && !GetIsDead(oTarget)) + { + //Fire cast spell at event for the specified target + SignalEvent(oTarget, EventSpellCastAt(GetAreaOfEffectCreator(), SPELLABILITY_AURA_UNNATURAL)); + + //Apply the VFX impact and effects + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePanicLink, oTarget, RoundsToSeconds(nDuration)); + //:: Debug + FloatingTextStringOnCreature("Triggered Unnatural Aura", oTarget, FALSE); + return; + + } + + if (GetIsEnemy(oTarget) && !GetIsDead(oTarget)) + { + if (nLvl <= 5) + { + if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR)) + { + //Apply the VFX impact and effects + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePanicLink, oTarget, RoundsToSeconds(nDuration)); + SetLocalInt(oTarget, sImmune, nCasterSeed); + //:: Debug + FloatingTextStringOnCreature("Triggered Low Fear Aura", oTarget, FALSE); + + } + } + + else if (nLvl >= 6 && nLvl < nHD) + { + if (!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_FEAR)) + { + //Apply the VFX impact and effects + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eShakenLink, oTarget, RoundsToSeconds(nDuration)); + SetLocalInt(oTarget, sImmune, nCasterSeed); + //:: Debug + FloatingTextStringOnCreature("Triggered High Fear Aura", oTarget, FALSE); + } + } + SetLocalInt(oTarget, sImmune, nCasterSeed); + + } + +} diff --git a/nwnds_module/tliz_slam.ncs b/nwnds_module/tliz_slam.ncs new file mode 100644 index 000000000..cfecd0157 Binary files /dev/null and b/nwnds_module/tliz_slam.ncs differ diff --git a/nwnds_module/tliz_slam.nss b/nwnds_module/tliz_slam.nss new file mode 100644 index 000000000..a91c3f9a4 --- /dev/null +++ b/nwnds_module/tliz_slam.nss @@ -0,0 +1,48 @@ +//:: +//:: A pnp version of the Tliz's Level draining slam. +//:: +//:: Modified by: DM Heatstroke 05-10-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoLevelDrain(object oTarget, object oCaster) +{ + // Setup oCaster's healing + effect eDrain = EffectTemporaryHitpoints(5); + eDrain = ExtraordinaryEffect(eDrain); + effect eVis1 = EffectVisualEffect(VFX_IMP_HEALING_L); + + // Setup Level Drain + effect eVis2 = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY); + effect eNeg = EffectNegativeLevel(2); + eNeg = SupernaturalEffect(eNeg); + + // Drain levels from oTarget + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eNeg, oTarget, HoursToSeconds(24)); + // Apply Temp HP to oCaster + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrain, oCaster, HoursToSeconds(1)); + +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_NEGATIVE_LEVEL) ) + { + SendMessageToPC(oTarget,"Immune to level drain."); + return; + } + + DelayCommand(0.1,DoLevelDrain(oTarget,oCaster)); + +} diff --git a/nwnds_module/tlizhide001.uti b/nwnds_module/tlizhide001.uti new file mode 100644 index 000000000..dd73562a8 Binary files /dev/null and b/nwnds_module/tlizhide001.uti differ diff --git a/nwnds_module/tlizslam001.uti b/nwnds_module/tlizslam001.uti new file mode 100644 index 000000000..49bd564e3 Binary files /dev/null and b/nwnds_module/tlizslam001.uti differ diff --git a/nwnds_module/tlr_buycost.ncs b/nwnds_module/tlr_buycost.ncs new file mode 100644 index 000000000..38f07443b Binary files /dev/null and b/nwnds_module/tlr_buycost.ncs differ diff --git a/nwnds_module/tlr_buycost.nss b/nwnds_module/tlr_buycost.nss new file mode 100644 index 000000000..42fa08500 --- /dev/null +++ b/nwnds_module/tlr_buycost.nss @@ -0,0 +1,34 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Buy Cost +//:: tlr_buycost.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//-- bloodsong base cost and xer for adjusting price ranges +//::////////////////////////////////////////////// +int StartingConditional() +{ + int BaseCost = 0; //-- change to raise prices + float BaseMultiplyer = 2.0; //-- milamber's default + + + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iCost = BaseCost + FloatToInt((IntToFloat(GetGoldPieceValue(oItem)) * BaseMultiplyer)); + int iAC = GetItemACValue(oItem); + + string sOut = "Cost: " + IntToString(iCost) + " gold.\n"; + sOut += "AC: " + IntToString(iAC) + "\n"; + sOut += "(Note: Armor feats my be required to wear this.)\n"; + sOut += "\nDo you wish to continue with the purchase?"; + + SetCustomToken(9876, sOut); + //-- this is called to check if the pc has the money to buy + SetLocalInt(OBJECT_SELF, "CURRENTPRICE", iCost); + + return TRUE; +} diff --git a/nwnds_module/tlr_buyoutfit.ncs b/nwnds_module/tlr_buyoutfit.ncs new file mode 100644 index 000000000..06644415c Binary files /dev/null and b/nwnds_module/tlr_buyoutfit.ncs differ diff --git a/nwnds_module/tlr_buyoutfit.nss b/nwnds_module/tlr_buyoutfit.nss new file mode 100644 index 000000000..9b3b5d092 --- /dev/null +++ b/nwnds_module/tlr_buyoutfit.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: Tailor - Buy Outfit +//:: tlr_buyoutfit.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- int iCost = GetGoldPieceValue(oItem) * 2; + int iCost = GetLocalInt(OBJECT_SELF, "CURRENTPRICE"); +/* + if (GetGold(oPC) < iCost) { + SendMessageToPC(oPC, "This outfit costs" + IntToString(iCost) + " gold!"); + return; + } +*/ + + TakeGoldFromCreature(iCost, oPC, TRUE); + + CopyItem(oItem, oPC, TRUE); +} diff --git a/nwnds_module/tlr_cloth1.ncs b/nwnds_module/tlr_cloth1.ncs new file mode 100644 index 000000000..4fae26f2f Binary files /dev/null and b/nwnds_module/tlr_cloth1.ncs differ diff --git a/nwnds_module/tlr_cloth1.nss b/nwnds_module/tlr_cloth1.nss new file mode 100644 index 000000000..9f66c0eef --- /dev/null +++ b/nwnds_module/tlr_cloth1.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Cloth 1 +//:: tlr_cloth1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_CLOTH1; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + ClothColor(iColor)); +} diff --git a/nwnds_module/tlr_cloth2.ncs b/nwnds_module/tlr_cloth2.ncs new file mode 100644 index 000000000..41627d764 Binary files /dev/null and b/nwnds_module/tlr_cloth2.ncs differ diff --git a/nwnds_module/tlr_cloth2.nss b/nwnds_module/tlr_cloth2.nss new file mode 100644 index 000000000..7dd5f451f --- /dev/null +++ b/nwnds_module/tlr_cloth2.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Cloth 2 +//:: tlr_cloth2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_CLOTH2; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + ClothColor(iColor)); +} diff --git a/nwnds_module/tlr_color0.ncs b/nwnds_module/tlr_color0.ncs new file mode 100644 index 000000000..edb5cd8a6 Binary files /dev/null and b/nwnds_module/tlr_color0.ncs differ diff --git a/nwnds_module/tlr_color0.nss b/nwnds_module/tlr_color0.nss new file mode 100644 index 000000000..590451ce9 --- /dev/null +++ b/nwnds_module/tlr_color0.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 0 +//:: tlr_color0.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 0. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 0); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color1.ncs b/nwnds_module/tlr_color1.ncs new file mode 100644 index 000000000..77365ec8a Binary files /dev/null and b/nwnds_module/tlr_color1.ncs differ diff --git a/nwnds_module/tlr_color1.nss b/nwnds_module/tlr_color1.nss new file mode 100644 index 000000000..c46d95d51 --- /dev/null +++ b/nwnds_module/tlr_color1.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 1 +//:: tlr_color1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 1); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color2.ncs b/nwnds_module/tlr_color2.ncs new file mode 100644 index 000000000..1fb1ae1db Binary files /dev/null and b/nwnds_module/tlr_color2.ncs differ diff --git a/nwnds_module/tlr_color2.nss b/nwnds_module/tlr_color2.nss new file mode 100644 index 000000000..e65a661bf --- /dev/null +++ b/nwnds_module/tlr_color2.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 2 +//:: tlr_color2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 2. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 2); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color3.ncs b/nwnds_module/tlr_color3.ncs new file mode 100644 index 000000000..6615e815e Binary files /dev/null and b/nwnds_module/tlr_color3.ncs differ diff --git a/nwnds_module/tlr_color3.nss b/nwnds_module/tlr_color3.nss new file mode 100644 index 000000000..f677e0725 --- /dev/null +++ b/nwnds_module/tlr_color3.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 3 +//:: tlr_color3.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 3. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 3); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color4.ncs b/nwnds_module/tlr_color4.ncs new file mode 100644 index 000000000..ddae904c0 Binary files /dev/null and b/nwnds_module/tlr_color4.ncs differ diff --git a/nwnds_module/tlr_color4.nss b/nwnds_module/tlr_color4.nss new file mode 100644 index 000000000..a012c0af8 --- /dev/null +++ b/nwnds_module/tlr_color4.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 4 +//:: tlr_color4.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 4. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 4); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color5.ncs b/nwnds_module/tlr_color5.ncs new file mode 100644 index 000000000..5670fb0d5 Binary files /dev/null and b/nwnds_module/tlr_color5.ncs differ diff --git a/nwnds_module/tlr_color5.nss b/nwnds_module/tlr_color5.nss new file mode 100644 index 000000000..a4bec4c15 --- /dev/null +++ b/nwnds_module/tlr_color5.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 5 +//:: tlr_color5.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 5. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 5); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color6.ncs b/nwnds_module/tlr_color6.ncs new file mode 100644 index 000000000..cdcadad7f Binary files /dev/null and b/nwnds_module/tlr_color6.ncs differ diff --git a/nwnds_module/tlr_color6.nss b/nwnds_module/tlr_color6.nss new file mode 100644 index 000000000..e8b851713 --- /dev/null +++ b/nwnds_module/tlr_color6.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 6 +//:: tlr_color6.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 6. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 6); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_color7.ncs b/nwnds_module/tlr_color7.ncs new file mode 100644 index 000000000..d3ed3bd40 Binary files /dev/null and b/nwnds_module/tlr_color7.ncs differ diff --git a/nwnds_module/tlr_color7.nss b/nwnds_module/tlr_color7.nss new file mode 100644 index 000000000..5006abbaf --- /dev/null +++ b/nwnds_module/tlr_color7.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Color 7 +//:: tlr_color7.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color to 7. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorToDye", 7); + + ExecuteScript("tlr_dyeitem", OBJECT_SELF); +} diff --git a/nwnds_module/tlr_copycost.ncs b/nwnds_module/tlr_copycost.ncs new file mode 100644 index 000000000..51bc4c9c6 Binary files /dev/null and b/nwnds_module/tlr_copycost.ncs differ diff --git a/nwnds_module/tlr_copycost.nss b/nwnds_module/tlr_copycost.nss new file mode 100644 index 000000000..0a4b88ea2 --- /dev/null +++ b/nwnds_module/tlr_copycost.nss @@ -0,0 +1,36 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Copy Cost +//:: tlr_copycost.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//-- bloodsong: added base cost for adjusting price ranges. +//::////////////////////////////////////////////// +int StartingConditional() +{ + object oPC = GetPCSpeaker(); + int BaseCost = 0; //-- change this to raise your base prices. + float BaseDivider = 0.2; //-- mil default + + object oNPCItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + object oPCItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + + int iCost = BaseCost + GetGoldPieceValue(oNPCItem) + FloatToInt(IntToFloat(GetGoldPieceValue(oPCItem)) * BaseDivider); + int iAC = GetItemACValue(oNPCItem); + + string sOut = "Cost: " + IntToString(iCost) + " gold.\n"; + sOut += "AC: " + IntToString(iAC) + "\n"; + sOut += "(Note: You may only copy appearances that have the same AC value as your current clothing.)\n"; + sOut += "\nDo you wish to continue with the purchase?"; + + SetCustomToken(9876, sOut); + //-- this is called to check if the pc has the money to buy + SetLocalInt(OBJECT_SELF, "CURRENTPRICE", iCost); + + return TRUE; +} diff --git a/nwnds_module/tlr_copynpcoutfi.ncs b/nwnds_module/tlr_copynpcoutfi.ncs new file mode 100644 index 000000000..8cf7a1fb7 Binary files /dev/null and b/nwnds_module/tlr_copynpcoutfi.ncs differ diff --git a/nwnds_module/tlr_copynpcoutfi.nss b/nwnds_module/tlr_copynpcoutfi.nss new file mode 100644 index 000000000..5324b2729 --- /dev/null +++ b/nwnds_module/tlr_copynpcoutfi.nss @@ -0,0 +1,251 @@ +//:://///////////////////////////////////////////// +//:: Tailor - Copy NPC Outfit TO PC +//:: tlr_copynpcoutfi.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// + +object oPC = GetPCSpeaker(); + +object CopyItemAppearace(object oSource, object oTarget); +int CompareAC(object oFirst, object oSecond); + +// Get a Cached 2DA string. If its not cached read it from the 2DA file and cache it. +string GetCachedACBonus(string sFile, int iRow); + +void main() +{ + object oNPCItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + object oPCItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + + //int iCost = GetGoldPieceValue(oNPCItem) + FloatToInt(IntToFloat(GetGoldPieceValue(oPCItem)) * 0.2f); + int iCost = GetLocalInt(OBJECT_SELF, "CURRENTPRICE"); + + if (GetGold(oPC) < iCost) { + SendMessageToPC(oPC, "This outfit costs" + IntToString(iCost) + " gold to copy!"); + return; + } + + if (!CompareAC(oNPCItem, oPCItem)) { + SendMessageToPC(oPC, "You may only copy the appearance of items with the same base AC values."); + return; + } + + TakeGoldFromCreature(iCost, oPC, TRUE); + + // Copy the appearance + object oNew = CopyItemAppearace(oNPCItem, oPCItem); + SetLocalInt(oNew, "mil_EditingItem", TRUE); + + // Copy the armor back to the PC + object oOnPC = CopyItem(oNew, oPC, TRUE); + DestroyObject(oNew); + + // Equip the armor + DelayCommand(0.5f, AssignCommand(oPC, ActionEquipItem(oOnPC, INVENTORY_SLOT_CHEST))); + + // Set armor editable again + DelayCommand(3.0f, DeleteLocalInt(oOnPC, "mil_EditingItem")); +} + +object CopyItemAppearace(object oSource, object oTarget) { + object oChest = GetObjectByTag("ClothingBuilder"); + + int iSourceValue; + object oCurrent, oNew; + +////// Copy To Chest + oCurrent = oTarget; + oNew = CopyItem(oCurrent, oChest, TRUE); + DestroyObject(oCurrent); + +////// Copy Colors + // Cloth 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH1); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Cloth 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Leather 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER1); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Leather 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Metal 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL1); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Metal 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + +////// Copy Design + // Belt + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Neck + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Pelvis + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Robe + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Torso + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO, iSourceValue, TRUE); + DestroyObject(oCurrent); + + return oNew; +} + +int CompareAC(object oFirst, object oSecond) { + int iFirstApp = GetItemAppearance(oFirst, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); + int iSecondApp = GetItemAppearance(oSecond, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); + + string sFirstAC = GetCachedACBonus("parts_chest", iFirstApp); + string sSecondAC = GetCachedACBonus("parts_chest", iSecondApp); + + return (StringToInt(sFirstAC) == StringToInt(sSecondAC)); +} + +string GetCachedACBonus(string sFile, int iRow) { + string sACBonus = GetLocalString(GetModule(), sFile + IntToString(iRow)); + + if (sACBonus == "") { + sACBonus = Get2DAString(sFile, "ACBONUS", iRow); + + if (sACBonus == "") { + sACBonus = "-1"; + + string sCost = Get2DAString(sFile, "COSTMODIFIER", iRow); + if (sCost == "" ) sACBonus = "-2"; + } + + SetLocalString(GetModule(), sFile + IntToString(iRow), sACBonus); + } + + return sACBonus; +} diff --git a/nwnds_module/tlr_copypcoutfit.ncs b/nwnds_module/tlr_copypcoutfit.ncs new file mode 100644 index 000000000..86cd5a933 Binary files /dev/null and b/nwnds_module/tlr_copypcoutfit.ncs differ diff --git a/nwnds_module/tlr_copypcoutfit.nss b/nwnds_module/tlr_copypcoutfit.nss new file mode 100644 index 000000000..5078a9068 --- /dev/null +++ b/nwnds_module/tlr_copypcoutfit.nss @@ -0,0 +1,178 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Copy the PCs Outfit +//:: tlr_copypcoutfit.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + object oPC = GetPCSpeaker(); + + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iSourceValue; + object oCurrent, oNew; + +////// Copy Colors + // Cloth 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH1); + oCurrent = oItem; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Cloth 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_CLOTH2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Leather 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER1); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Leather 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_LEATHER2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Metal 1 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL1); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL1, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Metal 2 + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL2); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_COLOR_METAL2, iSourceValue, TRUE); + DestroyObject(oCurrent); + + +////// Copy Design + // Belt + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Left Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Neck + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Pelvis + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Robe + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Torso + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Equip + DelayCommand(0.5f, AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST))); +} diff --git a/nwnds_module/tlr_decreaseitem.ncs b/nwnds_module/tlr_decreaseitem.ncs new file mode 100644 index 000000000..7e5d572be Binary files /dev/null and b/nwnds_module/tlr_decreaseitem.ncs differ diff --git a/nwnds_module/tlr_decreaseitem.nss b/nwnds_module/tlr_decreaseitem.nss new file mode 100644 index 000000000..6c4616abb --- /dev/null +++ b/nwnds_module/tlr_decreaseitem.nss @@ -0,0 +1,87 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Decrease Item +//:: tlr_decreaseitem.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +// Get a Cached 2DA string. If its not cached read it from the 2DA file and cache it. +string GetCachedACBonus(string sFile, int iRow); + +// Get the Cached Upper limit for a 2DA file. If not cached, determine the Limit and cache it. +int GetCachedLimit(string sFile); + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + string s2DAFile = GetLocalString(OBJECT_SELF, "2DAFile"); + //SendMessageToPC(oPC,"s2DAFile: " + s2DAFile); + + int iNewApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify) - 1; + + string s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + + while (s2DA_ACBonus == "SKIP" || s2DA_ACBonus == "FAIL") { + if (s2DA_ACBonus == "FAIL") { + iNewApp = GetCachedLimit(s2DAFile); + } else { + iNewApp--; + } + + s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + } + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + SendMessageToPC(oPC, "New Appearance: " + IntToString(iNewApp)); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST)); +} + +string GetCachedACBonus(string sFile, int iRow) { + string sACBonus = GetLocalString(GetModule(), sFile + IntToString(iRow)); + + if (sACBonus == "") { + sACBonus = Get2DAString(sFile, "ACBONUS", iRow); + + if (sACBonus == "") { + sACBonus = "SKIP"; + + string sCost = Get2DAString(sFile, "COSTMODIFIER", iRow); + if (sCost == "" ) sACBonus = "FAIL"; + } + + SetLocalString(GetModule(), sFile + IntToString(iRow), sACBonus); + } + + return sACBonus; +} + +int GetCachedLimit(string sFile) { + int iLimit = GetLocalInt(GetModule(), sFile + "Limit"); + + if (iLimit == 0) { + int iCount = 0; + + while (Get2DAString(sFile, "COSTMODIFIER", iCount + 1) != "") { + iCount++; + } + + SetLocalInt(GetModule(), sFile + "Limit", iCount); + iLimit = iCount; + } + + return iLimit; +} diff --git a/nwnds_module/tlr_decreasetors.ncs b/nwnds_module/tlr_decreasetors.ncs new file mode 100644 index 000000000..443ed827d Binary files /dev/null and b/nwnds_module/tlr_decreasetors.ncs differ diff --git a/nwnds_module/tlr_decreasetors.nss b/nwnds_module/tlr_decreasetors.nss new file mode 100644 index 000000000..7e201edeb --- /dev/null +++ b/nwnds_module/tlr_decreasetors.nss @@ -0,0 +1,87 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Decrease Torso +//:: tlr_decreasetors.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// + +// Get a Cached 2DA string. If its not cached read it from the 2DA file and cache it. +string GetCachedACBonus(string sFile, int iRow); + +// Get the Cached Upper limit for a 2DA file. If not cached, determine the Limit and cache it. +int GetCachedLimit(string sFile); + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + string s2DAFile = GetLocalString(OBJECT_SELF, "2DAFile"); + int iFilter = GetLocalInt(OBJECT_SELF, "TorsoFilter"); + + int iNewApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify) - 1; + + string s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + + while (StringToInt(s2DA_ACBonus) != iFilter) { + if (s2DA_ACBonus == "-2") { + iNewApp = GetCachedLimit(s2DAFile); + } else { + iNewApp--; + } + + s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + } + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + SendMessageToPC(oPC, "New Appearance: " + IntToString(iNewApp)); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST)); +} + +string GetCachedACBonus(string sFile, int iRow) { + string sACBonus = GetLocalString(GetModule(), sFile + IntToString(iRow)); + + if (sACBonus == "") { + sACBonus = Get2DAString(sFile, "ACBONUS", iRow); + + if (sACBonus == "") { + sACBonus = "-1"; + + string sCost = Get2DAString(sFile, "COSTMODIFIER", iRow); + if (sCost == "" ) sACBonus = "-2"; + } + + SetLocalString(GetModule(), sFile + IntToString(iRow), sACBonus); + } + + return sACBonus; +} + +int GetCachedLimit(string sFile) { + int iLimit = GetLocalInt(GetModule(), sFile + "Limit"); + + if (iLimit == 0) { + int iCount = 0; + + while (Get2DAString(sFile, "COSTMODIFIER", iCount + 1) != "") { + iCount++; + } + + SetLocalInt(GetModule(), sFile + "Limit", iCount); + iLimit = iCount; + } + + return iLimit; +} diff --git a/nwnds_module/tlr_fixclothing.ncs b/nwnds_module/tlr_fixclothing.ncs new file mode 100644 index 000000000..7f20663e6 Binary files /dev/null and b/nwnds_module/tlr_fixclothing.ncs differ diff --git a/nwnds_module/tlr_fixclothing.nss b/nwnds_module/tlr_fixclothing.nss new file mode 100644 index 000000000..5ac2cf8b7 --- /dev/null +++ b/nwnds_module/tlr_fixclothing.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Fix Clothing +//:: tlr_fixclothing.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + AssignCommand(OBJECT_SELF, ActionUnequipItem(oArmor)); + DelayCommand(2.0f, AssignCommand(OBJECT_SELF, ActionEquipItem(oArmor, INVENTORY_SLOT_CHEST))); +} diff --git a/nwnds_module/tlr_group0.ncs b/nwnds_module/tlr_group0.ncs new file mode 100644 index 000000000..29ccfce04 Binary files /dev/null and b/nwnds_module/tlr_group0.ncs differ diff --git a/nwnds_module/tlr_group0.nss b/nwnds_module/tlr_group0.nss new file mode 100644 index 000000000..71ad0d346 --- /dev/null +++ b/nwnds_module/tlr_group0.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 0 +//:: tlr_group0.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 0. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 0); +} diff --git a/nwnds_module/tlr_group1.ncs b/nwnds_module/tlr_group1.ncs new file mode 100644 index 000000000..af54e41b1 Binary files /dev/null and b/nwnds_module/tlr_group1.ncs differ diff --git a/nwnds_module/tlr_group1.nss b/nwnds_module/tlr_group1.nss new file mode 100644 index 000000000..b976334ba --- /dev/null +++ b/nwnds_module/tlr_group1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 1 +//:: tlr_group1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 1); +} diff --git a/nwnds_module/tlr_group2.ncs b/nwnds_module/tlr_group2.ncs new file mode 100644 index 000000000..a34001290 Binary files /dev/null and b/nwnds_module/tlr_group2.ncs differ diff --git a/nwnds_module/tlr_group2.nss b/nwnds_module/tlr_group2.nss new file mode 100644 index 000000000..0ef2afb73 --- /dev/null +++ b/nwnds_module/tlr_group2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 2 +//:: tlr_group2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 2. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 2); +} diff --git a/nwnds_module/tlr_group3.ncs b/nwnds_module/tlr_group3.ncs new file mode 100644 index 000000000..2df1d29a6 Binary files /dev/null and b/nwnds_module/tlr_group3.ncs differ diff --git a/nwnds_module/tlr_group3.nss b/nwnds_module/tlr_group3.nss new file mode 100644 index 000000000..83b2f39db --- /dev/null +++ b/nwnds_module/tlr_group3.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 3 +//:: tlr_group3.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 3. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 3); +} diff --git a/nwnds_module/tlr_group4.ncs b/nwnds_module/tlr_group4.ncs new file mode 100644 index 000000000..a47f502b6 Binary files /dev/null and b/nwnds_module/tlr_group4.ncs differ diff --git a/nwnds_module/tlr_group4.nss b/nwnds_module/tlr_group4.nss new file mode 100644 index 000000000..beccaaceb --- /dev/null +++ b/nwnds_module/tlr_group4.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 4 +//:: tlr_group4.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 4. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 4); +} diff --git a/nwnds_module/tlr_group5.ncs b/nwnds_module/tlr_group5.ncs new file mode 100644 index 000000000..afc64048f Binary files /dev/null and b/nwnds_module/tlr_group5.ncs differ diff --git a/nwnds_module/tlr_group5.nss b/nwnds_module/tlr_group5.nss new file mode 100644 index 000000000..6957e8b83 --- /dev/null +++ b/nwnds_module/tlr_group5.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 5 +//:: tlr_group5.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 5. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 5); +} diff --git a/nwnds_module/tlr_group6.ncs b/nwnds_module/tlr_group6.ncs new file mode 100644 index 000000000..3f404a6eb Binary files /dev/null and b/nwnds_module/tlr_group6.ncs differ diff --git a/nwnds_module/tlr_group6.nss b/nwnds_module/tlr_group6.nss new file mode 100644 index 000000000..877a52db6 --- /dev/null +++ b/nwnds_module/tlr_group6.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 6 +//:: tlr_group6.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 6. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 6); +} diff --git a/nwnds_module/tlr_group7.ncs b/nwnds_module/tlr_group7.ncs new file mode 100644 index 000000000..9816310e2 Binary files /dev/null and b/nwnds_module/tlr_group7.ncs differ diff --git a/nwnds_module/tlr_group7.nss b/nwnds_module/tlr_group7.nss new file mode 100644 index 000000000..27ef400f6 --- /dev/null +++ b/nwnds_module/tlr_group7.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Group 7 +//:: tlr_group7.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Sets the color group to 7. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ColorGroup", 7); +} diff --git a/nwnds_module/tlr_hascost.ncs b/nwnds_module/tlr_hascost.ncs new file mode 100644 index 000000000..22268d896 Binary files /dev/null and b/nwnds_module/tlr_hascost.ncs differ diff --git a/nwnds_module/tlr_hascost.nss b/nwnds_module/tlr_hascost.nss new file mode 100644 index 000000000..cabb8a704 --- /dev/null +++ b/nwnds_module/tlr_hascost.nss @@ -0,0 +1,10 @@ +int StartingConditional() +{ + int nPrice = GetLocalInt(OBJECT_SELF, "CURRENTPRICE"); + + if(GetGold(GetPCSpeaker()) >= nPrice) + { return TRUE; } + + return FALSE; + +} diff --git a/nwnds_module/tlr_include.nss b/nwnds_module/tlr_include.nss new file mode 100644 index 000000000..fabba846b --- /dev/null +++ b/nwnds_module/tlr_include.nss @@ -0,0 +1,182 @@ +// Returns the name of a color given is index. +string ClothColor(int iColor) { + switch (iColor) { + case 00: return "Lightest Tan/Brown"; + case 01: return "Light Tan/Brown"; + case 02: return "Dark Tan/Brown"; + case 03: return "Darkest Tan/Brown"; + + case 04: return "Lightest Tan/Red"; + case 05: return "Light Tan/Red"; + case 06: return "Dark Tan/Red"; + case 07: return "Darkest Tan/Red"; + + case 08: return "Lightest Tan/Yellow"; + case 09: return "Light Tan/Yellow"; + case 10: return "Dark Tan/Yellow"; + case 11: return "Darkest Tan/Yellow"; + + case 12: return "Lightest Tan/Grey"; + case 13: return "Light Tan/Grey"; + case 14: return "Dark Tan/Grey"; + case 15: return "Darkest Tan/Grey"; + + case 16: return "Lightest Olive"; + case 17: return "Light Olive"; + case 18: return "Dark Olive"; + case 19: return "Darkest Olive"; + + case 20: return "White"; + case 21: return "Light Grey"; + case 22: return "Dark Grey"; + case 23: return "Charcoal"; + + case 24: return "Light Blue"; + case 25: return "Dark Blue"; + + case 26: return "Light Aqua"; + case 27: return "Dark Aqua"; + + case 28: return "Light Teal"; + case 29: return "Dark Teal"; + + case 30: return "Light Green"; + case 31: return "Dark Green"; + + case 32: return "Light Yellow"; + case 33: return "Dark Yellow"; + + case 34: return "Light Orange"; + case 35: return "Dark Orange"; + + case 36: return "Light Red"; + case 37: return "Dark Red"; + + case 38: return "Light Pink"; + case 39: return "Dark Pink"; + + case 40: return "Light Purple"; + case 41: return "Dark Purple"; + + case 42: return "Light Violet"; + case 43: return "Dark Violet"; + + case 44: return "Shiny White"; + case 45: return "Shiny Black"; + + case 46: return "Shiny Blue"; + case 47: return "Shiny Aqua"; + + case 48: return "Shiny Teal"; + case 49: return "Shiny Green"; + + case 50: return "Shiny Yellow"; + case 51: return "Shiny Orange"; + + case 52: return "Shiny Red"; + case 53: return "Shiny Pink"; + + case 54: return "Shiny Purple"; + case 55: return "Shiny Violet"; + + case 56: return "Hidden: Silver"; + case 57: return "Hidden: Obsidian"; + case 58: return "Hidden: Gold"; + case 59: return "Hidden: Copper"; + case 60: return "Hidden: Grey"; + case 61: return "Hidden: Mirror"; + case 62: return "Hidden: Pure White"; + case 63: return "Hidden: Pure Black"; + } + + return ""; +} + +// Returns the name of a color given is index. +string MetalColor(int iColor) { + switch (iColor) { + case 00: return "Lightest Shiny Silver"; + case 01: return "Light Shiny Silver"; + case 02: return "Dark Shiny Obsidian"; + case 03: return "Darkest Shiny Obsidian"; + + case 04: return "Lightest Dull Silver"; + case 05: return "Light Dull Silver"; + case 06: return "Dark Dull Obsidian"; + case 07: return "Darkest Dull Obsidian"; + + case 08: return "Lightest Gold"; + case 09: return "Light Gold"; + case 10: return "Dark Gold"; + case 11: return "Darkest Gold"; + + case 12: return "Lightest Celestial Gold"; + case 13: return "Light Celestial Gold"; + case 14: return "Dark Celestial Gold"; + case 15: return "Darkest Celestial Gold"; + + case 16: return "Lightest Copper"; + case 17: return "Light Copper"; + case 18: return "Dark Copper"; + case 19: return "Darkest Copper"; + + case 20: return "Lightest Brass"; + case 21: return "Light Brass"; + case 22: return "Dark Brass"; + case 23: return "Darkest Brass"; + + case 24: return "Light Red"; + case 25: return "Dark Red"; + case 26: return "Light Dull Red"; + case 27: return "Dark Dull Red"; + + case 28: return "Light Purple"; + case 29: return "Dark Purple"; + case 30: return "Light Dull Purple"; + case 31: return "Dark Dull Purple"; + + case 32: return "Light Blue"; + case 33: return "Dark Blue"; + case 34: return "Light Dull Blue"; + case 35: return "Dark Dull Blue"; + + case 36: return "Light Teal"; + case 37: return "Dark Teal"; + case 38: return "Light Dull Teal"; + case 39: return "Dark Dull Teal"; + + case 40: return "Light Green"; + case 41: return "Dark Green"; + case 42: return "Light Dull Green"; + case 43: return "Dark Dull Green"; + + case 44: return "Light Olive"; + case 45: return "Dark Olive"; + case 46: return "Light Dull Olive"; + case 47: return "Dark Dull Olive"; + + case 48: return "Light Prismatic"; + case 49: return "Dark Prismatic"; + + case 50: return "Lightest Rust"; + case 51: return "Light Rust"; + case 52: return "Dark Rust"; + case 53: return "Darkest Rust"; + + case 54: return "Light Aged Metal"; + case 55: return "Dark Aged Metal"; + + case 56: return "Hidden: Silver"; + case 57: return "Hidden: Obsidian"; + case 58: return "Hidden: Gold"; + case 59: return "Hidden: Copper"; + case 60: return "Hidden: Grey"; + case 61: return "Hidden: Mirror"; + case 62: return "Hidden: Pure White"; + case 63: return "Hidden: Pure Black"; + } + + return ""; +} + +// void main() {} diff --git a/nwnds_module/tlr_increaseitem.ncs b/nwnds_module/tlr_increaseitem.ncs new file mode 100644 index 000000000..484160911 Binary files /dev/null and b/nwnds_module/tlr_increaseitem.ncs differ diff --git a/nwnds_module/tlr_increaseitem.nss b/nwnds_module/tlr_increaseitem.nss new file mode 100644 index 000000000..5a75fd300 --- /dev/null +++ b/nwnds_module/tlr_increaseitem.nss @@ -0,0 +1,67 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Increase Item +//:: tlr_increaseitem.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +// Get a Cached 2DA string, and if its not cached read it from the 2DA file and cache it. +string GetCachedACBonus(string sFile, int iRow); + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + string s2DAFile = GetLocalString(OBJECT_SELF, "2DAFile"); + //SendMessageToPC(oPC,"s2DAFile: " + s2DAFile); + + int iNewApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify) + 1; + + string s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + + while (s2DA_ACBonus == "SKIP" || s2DA_ACBonus == "FAIL") { + if (s2DA_ACBonus == "FAIL") { + iNewApp = 1; + } else { + iNewApp++; + } + + s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + } + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + SendMessageToPC(oPC, "New Appearance: " + IntToString(iNewApp)); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST)); +} + +string GetCachedACBonus(string sFile, int iRow) { + string sACBonus = GetLocalString(GetModule(), sFile + IntToString(iRow)); + + if (sACBonus == "") { + sACBonus = Get2DAString(sFile, "ACBONUS", iRow); + + if (sACBonus == "") { + sACBonus = "SKIP"; + + string sCost = Get2DAString(sFile, "COSTMODIFIER", iRow); + if (sCost == "" ) sACBonus = "FAIL"; + } + + SetLocalString(GetModule(), sFile + IntToString(iRow), sACBonus); + } + + return sACBonus; +} diff --git a/nwnds_module/tlr_increasetors.ncs b/nwnds_module/tlr_increasetors.ncs new file mode 100644 index 000000000..cba3e2ed9 Binary files /dev/null and b/nwnds_module/tlr_increasetors.ncs differ diff --git a/nwnds_module/tlr_increasetors.nss b/nwnds_module/tlr_increasetors.nss new file mode 100644 index 000000000..5f42f9f3a --- /dev/null +++ b/nwnds_module/tlr_increasetors.nss @@ -0,0 +1,67 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Increase Torso +//:: tlr_increasetors.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// + +// Get a Cached 2DA string, and if its not cached read it from the 2DA file and cache it. +string GetCachedACBonus(string sFile, int iRow); + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + string s2DAFile = GetLocalString(OBJECT_SELF, "2DAFile"); + int iFilter = GetLocalInt(OBJECT_SELF, "TorsoFilter"); + + int iNewApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify) + 1; + + string s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + + while (StringToInt(s2DA_ACBonus) != iFilter) { + if (s2DA_ACBonus == "-2") { + iNewApp = 1; + } else { + iNewApp++; + } + + s2DA_ACBonus = GetCachedACBonus(s2DAFile, iNewApp); + //SendMessageToPC(oPC,"s2DA_ACBonus: " + s2DA_ACBonus); + } + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + SendMessageToPC(oPC, "New Appearance: " + IntToString(iNewApp)); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST)); +} + +string GetCachedACBonus(string sFile, int iRow) { + string sACBonus = GetLocalString(GetModule(), sFile + IntToString(iRow)); + + if (sACBonus == "") { + sACBonus = Get2DAString(sFile, "ACBONUS", iRow); + + if (sACBonus == "") { + sACBonus = "-1"; + + string sCost = Get2DAString(sFile, "COSTMODIFIER", iRow); + if (sCost == "" ) sACBonus = "-2"; + } + + SetLocalString(GetModule(), sFile + IntToString(iRow), sACBonus); + } + + return sACBonus; +} diff --git a/nwnds_module/tlr_leather1.ncs b/nwnds_module/tlr_leather1.ncs new file mode 100644 index 000000000..2bde2a5a5 Binary files /dev/null and b/nwnds_module/tlr_leather1.ncs differ diff --git a/nwnds_module/tlr_leather1.nss b/nwnds_module/tlr_leather1.nss new file mode 100644 index 000000000..ccf757b38 --- /dev/null +++ b/nwnds_module/tlr_leather1.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Leather 1 +//:: tlr_leather1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_LEATHER1; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + ClothColor(iColor)); +} diff --git a/nwnds_module/tlr_leather2.ncs b/nwnds_module/tlr_leather2.ncs new file mode 100644 index 000000000..c147726cb Binary files /dev/null and b/nwnds_module/tlr_leather2.ncs differ diff --git a/nwnds_module/tlr_leather2.nss b/nwnds_module/tlr_leather2.nss new file mode 100644 index 000000000..c2b62a167 --- /dev/null +++ b/nwnds_module/tlr_leather2.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Leather 2 +//:: tlr_leather2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_LEATHER2; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + ClothColor(iColor)); +} diff --git a/nwnds_module/tlr_listenoff.ncs b/nwnds_module/tlr_listenoff.ncs new file mode 100644 index 000000000..27151d6b2 Binary files /dev/null and b/nwnds_module/tlr_listenoff.ncs differ diff --git a/nwnds_module/tlr_listenoff.nss b/nwnds_module/tlr_listenoff.nss new file mode 100644 index 000000000..d8c3e7013 --- /dev/null +++ b/nwnds_module/tlr_listenoff.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Turning Listening Off +//:: tlr_listenoff.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetListening(OBJECT_SELF, FALSE); +} diff --git a/nwnds_module/tlr_listenon.ncs b/nwnds_module/tlr_listenon.ncs new file mode 100644 index 000000000..f3a6dc602 Binary files /dev/null and b/nwnds_module/tlr_listenon.ncs differ diff --git a/nwnds_module/tlr_listenon.nss b/nwnds_module/tlr_listenon.nss new file mode 100644 index 000000000..5c2ba0a8e --- /dev/null +++ b/nwnds_module/tlr_listenon.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Turning Listening On +//:: tlr_listenon.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetListenPattern(OBJECT_SELF, "**", 8888); + SetListening(OBJECT_SELF, TRUE); + SetLocalObject(OBJECT_SELF, "tlr_Client", GetPCSpeaker()); +} diff --git a/nwnds_module/tlr_metal1.ncs b/nwnds_module/tlr_metal1.ncs new file mode 100644 index 000000000..0e91bd847 Binary files /dev/null and b/nwnds_module/tlr_metal1.ncs differ diff --git a/nwnds_module/tlr_metal1.nss b/nwnds_module/tlr_metal1.nss new file mode 100644 index 000000000..8750f49aa --- /dev/null +++ b/nwnds_module/tlr_metal1.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Metal 1 +//:: tlr_metal1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_METAL1; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + MetalColor(iColor)); +} diff --git a/nwnds_module/tlr_metal2.ncs b/nwnds_module/tlr_metal2.ncs new file mode 100644 index 000000000..b9a867db5 Binary files /dev/null and b/nwnds_module/tlr_metal2.ncs differ diff --git a/nwnds_module/tlr_metal2.nss b/nwnds_module/tlr_metal2.nss new file mode 100644 index 000000000..12f0d74c7 --- /dev/null +++ b/nwnds_module/tlr_metal2.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Dye Metal 2 +//:: tlr_metal2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + Set the material to be died to Leather 1. +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// + +#include "tlr_include" + +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iMaterialToDye = ITEM_APPR_ARMOR_COLOR_METAL2; + + SetLocalInt(OBJECT_SELF, "MaterialToDye", iMaterialToDye); + + int iColor = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_COLOR, iMaterialToDye); + + SendMessageToPC(oPC, "Current Color: " + MetalColor(iColor)); +} diff --git a/nwnds_module/tlr_modbelt.ncs b/nwnds_module/tlr_modbelt.ncs new file mode 100644 index 000000000..3b34145e0 Binary files /dev/null and b/nwnds_module/tlr_modbelt.ncs differ diff --git a/nwnds_module/tlr_modbelt.nss b/nwnds_module/tlr_modbelt.nss new file mode 100644 index 000000000..42ef3463a --- /dev/null +++ b/nwnds_module/tlr_modbelt.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Belt +//:: tlr_modbelt.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_BELT); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_belt"); +} diff --git a/nwnds_module/tlr_modeldwarf.ncs b/nwnds_module/tlr_modeldwarf.ncs new file mode 100644 index 000000000..57dab1c74 Binary files /dev/null and b/nwnds_module/tlr_modeldwarf.ncs differ diff --git a/nwnds_module/tlr_modeldwarf.nss b/nwnds_module/tlr_modeldwarf.nss new file mode 100644 index 000000000..8381cac42 --- /dev/null +++ b/nwnds_module/tlr_modeldwarf.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Dwarf +//:: tlr_modeldwarf.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_DWARF); +} diff --git a/nwnds_module/tlr_modelelf.ncs b/nwnds_module/tlr_modelelf.ncs new file mode 100644 index 000000000..e8549d940 Binary files /dev/null and b/nwnds_module/tlr_modelelf.ncs differ diff --git a/nwnds_module/tlr_modelelf.nss b/nwnds_module/tlr_modelelf.nss new file mode 100644 index 000000000..2d031a9b7 --- /dev/null +++ b/nwnds_module/tlr_modelelf.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Elf +//:: tlr_modelelf.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_ELF); +} diff --git a/nwnds_module/tlr_modelgnome.ncs b/nwnds_module/tlr_modelgnome.ncs new file mode 100644 index 000000000..97c6a84a3 Binary files /dev/null and b/nwnds_module/tlr_modelgnome.ncs differ diff --git a/nwnds_module/tlr_modelgnome.nss b/nwnds_module/tlr_modelgnome.nss new file mode 100644 index 000000000..94f41372a --- /dev/null +++ b/nwnds_module/tlr_modelgnome.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Gnome +//:: tlr_modelgnome.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_GNOME); +} diff --git a/nwnds_module/tlr_modelhalfelf.ncs b/nwnds_module/tlr_modelhalfelf.ncs new file mode 100644 index 000000000..90679e09d Binary files /dev/null and b/nwnds_module/tlr_modelhalfelf.ncs differ diff --git a/nwnds_module/tlr_modelhalfelf.nss b/nwnds_module/tlr_modelhalfelf.nss new file mode 100644 index 000000000..979b5a477 --- /dev/null +++ b/nwnds_module/tlr_modelhalfelf.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Half-Elf +//:: tlr_modelhalfelf.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALF_ELF); +} diff --git a/nwnds_module/tlr_modelhalflin.ncs b/nwnds_module/tlr_modelhalflin.ncs new file mode 100644 index 000000000..621dbb221 Binary files /dev/null and b/nwnds_module/tlr_modelhalflin.ncs differ diff --git a/nwnds_module/tlr_modelhalflin.nss b/nwnds_module/tlr_modelhalflin.nss new file mode 100644 index 000000000..24a47725a --- /dev/null +++ b/nwnds_module/tlr_modelhalflin.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Halfing +//:: tlr_modelhalflin.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALFLING); +} diff --git a/nwnds_module/tlr_modelhalforc.ncs b/nwnds_module/tlr_modelhalforc.ncs new file mode 100644 index 000000000..568dd7e1f Binary files /dev/null and b/nwnds_module/tlr_modelhalforc.ncs differ diff --git a/nwnds_module/tlr_modelhalforc.nss b/nwnds_module/tlr_modelhalforc.nss new file mode 100644 index 000000000..3047bb2af --- /dev/null +++ b/nwnds_module/tlr_modelhalforc.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Half-Orc +//:: tlr_modelhalforc.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HALF_ORC); +} diff --git a/nwnds_module/tlr_modelhuman.ncs b/nwnds_module/tlr_modelhuman.ncs new file mode 100644 index 000000000..dc66173f5 Binary files /dev/null and b/nwnds_module/tlr_modelhuman.ncs differ diff --git a/nwnds_module/tlr_modelhuman.nss b/nwnds_module/tlr_modelhuman.nss new file mode 100644 index 000000000..6ebebfdf5 --- /dev/null +++ b/nwnds_module/tlr_modelhuman.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Model = Human +//:: tlr_modelhuman.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetCreatureAppearanceType(OBJECT_SELF, APPEARANCE_TYPE_HUMAN); +} diff --git a/nwnds_module/tlr_modlbicep.ncs b/nwnds_module/tlr_modlbicep.ncs new file mode 100644 index 000000000..6f811eb2b Binary files /dev/null and b/nwnds_module/tlr_modlbicep.ncs differ diff --git a/nwnds_module/tlr_modlbicep.nss b/nwnds_module/tlr_modlbicep.nss new file mode 100644 index 000000000..ce4510a20 --- /dev/null +++ b/nwnds_module/tlr_modlbicep.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Bicep +//:: tlr_modlbicep.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LBICEP); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_bicep"); +} diff --git a/nwnds_module/tlr_modlfoot.ncs b/nwnds_module/tlr_modlfoot.ncs new file mode 100644 index 000000000..a861154e2 Binary files /dev/null and b/nwnds_module/tlr_modlfoot.ncs differ diff --git a/nwnds_module/tlr_modlfoot.nss b/nwnds_module/tlr_modlfoot.nss new file mode 100644 index 000000000..f536ee2ba --- /dev/null +++ b/nwnds_module/tlr_modlfoot.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Foot +//:: tlr_modlfoot.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LFOOT); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_foot"); +} diff --git a/nwnds_module/tlr_modlforearm.ncs b/nwnds_module/tlr_modlforearm.ncs new file mode 100644 index 000000000..8e675f6b5 Binary files /dev/null and b/nwnds_module/tlr_modlforearm.ncs differ diff --git a/nwnds_module/tlr_modlforearm.nss b/nwnds_module/tlr_modlforearm.nss new file mode 100644 index 000000000..9c67d48d3 --- /dev/null +++ b/nwnds_module/tlr_modlforearm.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Forearm +//:: tlr_modlforearm.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LFOREARM); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_forearm"); +} diff --git a/nwnds_module/tlr_modlhand.ncs b/nwnds_module/tlr_modlhand.ncs new file mode 100644 index 000000000..a9bc39dca Binary files /dev/null and b/nwnds_module/tlr_modlhand.ncs differ diff --git a/nwnds_module/tlr_modlhand.nss b/nwnds_module/tlr_modlhand.nss new file mode 100644 index 000000000..6665c58da --- /dev/null +++ b/nwnds_module/tlr_modlhand.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Hand +//:: tlr_modlhand.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LHAND); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_hand"); +} diff --git a/nwnds_module/tlr_modlshin.ncs b/nwnds_module/tlr_modlshin.ncs new file mode 100644 index 000000000..4e3ee3c08 Binary files /dev/null and b/nwnds_module/tlr_modlshin.ncs differ diff --git a/nwnds_module/tlr_modlshin.nss b/nwnds_module/tlr_modlshin.nss new file mode 100644 index 000000000..e321941ee --- /dev/null +++ b/nwnds_module/tlr_modlshin.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Shin +//:: tlr_modlshin.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LSHIN); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_shin"); +} diff --git a/nwnds_module/tlr_modlshoudler.ncs b/nwnds_module/tlr_modlshoudler.ncs new file mode 100644 index 000000000..42e3ac5be Binary files /dev/null and b/nwnds_module/tlr_modlshoudler.ncs differ diff --git a/nwnds_module/tlr_modlshoudler.nss b/nwnds_module/tlr_modlshoudler.nss new file mode 100644 index 000000000..d8ba28eec --- /dev/null +++ b/nwnds_module/tlr_modlshoudler.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Shoulder +//:: tlr_modlshoudler.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LSHOULDER); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_shoulder"); +} diff --git a/nwnds_module/tlr_modlthigh.ncs b/nwnds_module/tlr_modlthigh.ncs new file mode 100644 index 000000000..50fb29a81 Binary files /dev/null and b/nwnds_module/tlr_modlthigh.ncs differ diff --git a/nwnds_module/tlr_modlthigh.nss b/nwnds_module/tlr_modlthigh.nss new file mode 100644 index 000000000..2ec5cef0d --- /dev/null +++ b/nwnds_module/tlr_modlthigh.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Left Thigh +//:: tlr_modlthigh.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_LTHIGH); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_legs"); +} diff --git a/nwnds_module/tlr_modneck.ncs b/nwnds_module/tlr_modneck.ncs new file mode 100644 index 000000000..40af65735 Binary files /dev/null and b/nwnds_module/tlr_modneck.ncs differ diff --git a/nwnds_module/tlr_modneck.nss b/nwnds_module/tlr_modneck.nss new file mode 100644 index 000000000..0653b748a --- /dev/null +++ b/nwnds_module/tlr_modneck.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Neck +//:: tlr_modneck.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_NECK); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_neck"); +} diff --git a/nwnds_module/tlr_modpelvis.ncs b/nwnds_module/tlr_modpelvis.ncs new file mode 100644 index 000000000..faaf83fdf Binary files /dev/null and b/nwnds_module/tlr_modpelvis.ncs differ diff --git a/nwnds_module/tlr_modpelvis.nss b/nwnds_module/tlr_modpelvis.nss new file mode 100644 index 000000000..b7b669b3b --- /dev/null +++ b/nwnds_module/tlr_modpelvis.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Pelvis +//:: tlr_modpelvis.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_PELVIS); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_pelvis"); +} diff --git a/nwnds_module/tlr_modrbicep.ncs b/nwnds_module/tlr_modrbicep.ncs new file mode 100644 index 000000000..ef185fb94 Binary files /dev/null and b/nwnds_module/tlr_modrbicep.ncs differ diff --git a/nwnds_module/tlr_modrbicep.nss b/nwnds_module/tlr_modrbicep.nss new file mode 100644 index 000000000..829570ac5 --- /dev/null +++ b/nwnds_module/tlr_modrbicep.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Bicep +//:: tlr_modrbicep.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RBICEP); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_bicep"); +} diff --git a/nwnds_module/tlr_modrfoot.ncs b/nwnds_module/tlr_modrfoot.ncs new file mode 100644 index 000000000..4723999c3 Binary files /dev/null and b/nwnds_module/tlr_modrfoot.ncs differ diff --git a/nwnds_module/tlr_modrfoot.nss b/nwnds_module/tlr_modrfoot.nss new file mode 100644 index 000000000..000ba7b64 --- /dev/null +++ b/nwnds_module/tlr_modrfoot.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Foot +//:: tlr_modrfoot.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RFOOT); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_foot"); +} diff --git a/nwnds_module/tlr_modrforearm.ncs b/nwnds_module/tlr_modrforearm.ncs new file mode 100644 index 000000000..b29831dbe Binary files /dev/null and b/nwnds_module/tlr_modrforearm.ncs differ diff --git a/nwnds_module/tlr_modrforearm.nss b/nwnds_module/tlr_modrforearm.nss new file mode 100644 index 000000000..af3aa1378 --- /dev/null +++ b/nwnds_module/tlr_modrforearm.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Forearm +//:: tlr_modrforearm.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RFOREARM); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_forearm"); +} diff --git a/nwnds_module/tlr_modrhand.ncs b/nwnds_module/tlr_modrhand.ncs new file mode 100644 index 000000000..f04560956 Binary files /dev/null and b/nwnds_module/tlr_modrhand.ncs differ diff --git a/nwnds_module/tlr_modrhand.nss b/nwnds_module/tlr_modrhand.nss new file mode 100644 index 000000000..935ae0487 --- /dev/null +++ b/nwnds_module/tlr_modrhand.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Hand +//:: tlr_modrhand.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RHAND); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_hand"); +} diff --git a/nwnds_module/tlr_modrobe.ncs b/nwnds_module/tlr_modrobe.ncs new file mode 100644 index 000000000..c04b273c1 Binary files /dev/null and b/nwnds_module/tlr_modrobe.ncs differ diff --git a/nwnds_module/tlr_modrobe.nss b/nwnds_module/tlr_modrobe.nss new file mode 100644 index 000000000..92020b38c --- /dev/null +++ b/nwnds_module/tlr_modrobe.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Robe +//:: tlr_modrobe.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_ROBE); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_robe"); +} diff --git a/nwnds_module/tlr_modrshin.ncs b/nwnds_module/tlr_modrshin.ncs new file mode 100644 index 000000000..15f11f30c Binary files /dev/null and b/nwnds_module/tlr_modrshin.ncs differ diff --git a/nwnds_module/tlr_modrshin.nss b/nwnds_module/tlr_modrshin.nss new file mode 100644 index 000000000..88668e55c --- /dev/null +++ b/nwnds_module/tlr_modrshin.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Shin +//:: tlr_modrshin.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RSHIN); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_shin"); +} diff --git a/nwnds_module/tlr_modrshoudler.ncs b/nwnds_module/tlr_modrshoudler.ncs new file mode 100644 index 000000000..1c4d33ada Binary files /dev/null and b/nwnds_module/tlr_modrshoudler.ncs differ diff --git a/nwnds_module/tlr_modrshoudler.nss b/nwnds_module/tlr_modrshoudler.nss new file mode 100644 index 000000000..f60b96558 --- /dev/null +++ b/nwnds_module/tlr_modrshoudler.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Shoulder +//:: tlr_modrshoudler.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RSHOULDER); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_shoulder"); +} diff --git a/nwnds_module/tlr_modrthigh.ncs b/nwnds_module/tlr_modrthigh.ncs new file mode 100644 index 000000000..bd2198773 Binary files /dev/null and b/nwnds_module/tlr_modrthigh.ncs differ diff --git a/nwnds_module/tlr_modrthigh.nss b/nwnds_module/tlr_modrthigh.nss new file mode 100644 index 000000000..438053f44 --- /dev/null +++ b/nwnds_module/tlr_modrthigh.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Right Thigh +//:: tlr_modrthigh.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_RTHIGH); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_legs"); +} diff --git a/nwnds_module/tlr_modtorso.ncs b/nwnds_module/tlr_modtorso.ncs new file mode 100644 index 000000000..6bb349cb5 Binary files /dev/null and b/nwnds_module/tlr_modtorso.ncs differ diff --git a/nwnds_module/tlr_modtorso.nss b/nwnds_module/tlr_modtorso.nss new file mode 100644 index 000000000..38ac45fb1 --- /dev/null +++ b/nwnds_module/tlr_modtorso.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Modify Torso +//:: tlr_modtorso.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "ToModify", ITEM_APPR_ARMOR_MODEL_TORSO); + SetLocalString(OBJECT_SELF, "2DAFile", "parts_chest"); +} diff --git a/nwnds_module/tlr_onconv.ncs b/nwnds_module/tlr_onconv.ncs new file mode 100644 index 000000000..6e6555cbe Binary files /dev/null and b/nwnds_module/tlr_onconv.ncs differ diff --git a/nwnds_module/tlr_onconv.nss b/nwnds_module/tlr_onconv.nss new file mode 100644 index 000000000..61685139c --- /dev/null +++ b/nwnds_module/tlr_onconv.nss @@ -0,0 +1,35 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - on Conversation +//:: tlr_onconv.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On:March 9, 2004 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" + +void main() +{ + + // See if what we just 'heard' matches any of our + // predefined patterns + int nMatch = GetListenPatternNumber(); + object oShouter = GetLastSpeaker(); + + if (nMatch == -1) { + if (GetCommandable(OBJECT_SELF)) + { + ClearAllActions(); + ActionStartConversation(oShouter, "", TRUE); + } + } else if (nMatch == 8888) { + if (GetLocalObject(OBJECT_SELF, "tlr_Client") == oShouter) { + SetLocalString(OBJECT_SELF, "tlr_Spoken", GetMatchedSubstring(0)); + } + } +} diff --git a/nwnds_module/tlr_r_remarms.ncs b/nwnds_module/tlr_r_remarms.ncs new file mode 100644 index 000000000..cff9ac689 Binary files /dev/null and b/nwnds_module/tlr_r_remarms.ncs differ diff --git a/nwnds_module/tlr_r_remarms.nss b/nwnds_module/tlr_r_remarms.nss new file mode 100644 index 000000000..45716b6c3 --- /dev/null +++ b/nwnds_module/tlr_r_remarms.nss @@ -0,0 +1,75 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: removal: arms +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from milambus' tailor stuff +//::////////////////////////////////////////////// + + + +void main() +{ + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iSourceValue = 0; + object oCurrent, oNew; + + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- step zero: create a duplicate to start modifying. + oNew = CopyItem(oSource, OBJECT_SELF); + + + // Right Bicep + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Forearm + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Hand + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shoulder + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Bicep + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Forearm + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Hand + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shoulder + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + + //-- step last: destroy the original clothing, and put on the new + + DestroyObject(oSource); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST)); + + +} diff --git a/nwnds_module/tlr_r_remlegs.ncs b/nwnds_module/tlr_r_remlegs.ncs new file mode 100644 index 000000000..de4feda4e Binary files /dev/null and b/nwnds_module/tlr_r_remlegs.ncs differ diff --git a/nwnds_module/tlr_r_remlegs.nss b/nwnds_module/tlr_r_remlegs.nss new file mode 100644 index 000000000..a61f727bc --- /dev/null +++ b/nwnds_module/tlr_r_remlegs.nss @@ -0,0 +1,66 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: removal: arms +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from milambus' tailor stuff +//::////////////////////////////////////////////// + + + +void main() +{ + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iSourceValue = 0; + object oCurrent, oNew; + + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- step zero: create a duplicate to start modifying. + oNew = CopyItem(oSource, OBJECT_SELF); + + + + // Right Thigh + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shin + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Foot + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + + // LEFT Thigh + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shin + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Foot + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + //-- step last: destroy the original clothing, and put on the new + + DestroyObject(oSource); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST)); + + +} diff --git a/nwnds_module/tlr_removeitem.ncs b/nwnds_module/tlr_removeitem.ncs new file mode 100644 index 000000000..1cdfdaa82 Binary files /dev/null and b/nwnds_module/tlr_removeitem.ncs differ diff --git a/nwnds_module/tlr_removeitem.nss b/nwnds_module/tlr_removeitem.nss new file mode 100644 index 000000000..3c73d6604 --- /dev/null +++ b/nwnds_module/tlr_removeitem.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Remove Item +//:: tlr_removeitem.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 8, 2004 +//::////////////////////////////////////////////// +void main() +{ + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + int iNewApp = 0; + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + + DelayCommand(0.5f, AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST))); +} diff --git a/nwnds_module/tlr_rotateclock.ncs b/nwnds_module/tlr_rotateclock.ncs new file mode 100644 index 000000000..cfa737623 Binary files /dev/null and b/nwnds_module/tlr_rotateclock.ncs differ diff --git a/nwnds_module/tlr_rotateclock.nss b/nwnds_module/tlr_rotateclock.nss new file mode 100644 index 000000000..4f077e61a --- /dev/null +++ b/nwnds_module/tlr_rotateclock.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Rotate Model Clockwise +//:: tlr_rotateclock.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + float fNewFace = GetFacing(OBJECT_SELF) - 30.0; + + if (fNewFace < 0.0) fNewFace += 360.0; + + AssignCommand(OBJECT_SELF, SetFacing(fNewFace)); +} diff --git a/nwnds_module/tlr_rotatecountr.ncs b/nwnds_module/tlr_rotatecountr.ncs new file mode 100644 index 000000000..0722cd02a Binary files /dev/null and b/nwnds_module/tlr_rotatecountr.ncs differ diff --git a/nwnds_module/tlr_rotatecountr.nss b/nwnds_module/tlr_rotatecountr.nss new file mode 100644 index 000000000..58f0413d2 --- /dev/null +++ b/nwnds_module/tlr_rotatecountr.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Rotate Model Counter-Clockwise +//:: tlr_rotatecountr.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + float fNewFace = GetFacing(OBJECT_SELF) + 30.0; + + if (fNewFace > 360.0) fNewFace -= 360.0; + + AssignCommand(OBJECT_SELF, SetFacing(fNewFace)); +} diff --git a/nwnds_module/tlr_s_l2r.ncs b/nwnds_module/tlr_s_l2r.ncs new file mode 100644 index 000000000..7e9de9996 Binary files /dev/null and b/nwnds_module/tlr_s_l2r.ncs differ diff --git a/nwnds_module/tlr_s_l2r.nss b/nwnds_module/tlr_s_l2r.nss new file mode 100644 index 000000000..4366e1aea --- /dev/null +++ b/nwnds_module/tlr_s_l2r.nss @@ -0,0 +1,94 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: right 2 left +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + check our local string for what we're swapping + "SYMMETRYTYPE" = + arms + legs + both + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from lots of milambus's routines +//::////////////////////////////////////////////// + + + +void main() +{ + string sSym = GetLocalString(OBJECT_SELF, "SYMMETRYTYPE"); + + int iSourceValue; //-- read from parts + object oNew, oCurrent; //-- items we'll iterate through + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- step zero: create a duplicate to start modifying. + oNew = CopyItem(oSource, OBJECT_SELF); + + //-- step one: copy arms + if (sSym == "arms" || sSym == "both") + { + //--A: get #s from one side to the other + + // LEFT Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + } //-- end ARMS copying + + + if (sSym == "legs" || sSym == "both") + { + //-- same thing, for leg parts + // LEFT Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + } //-- end LEGS + + + + //-- step last: destroy the original clothing, and put on the new + + DestroyObject(oSource); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST)); + +} diff --git a/nwnds_module/tlr_s_otherside.ncs b/nwnds_module/tlr_s_otherside.ncs new file mode 100644 index 000000000..7af64ad7a Binary files /dev/null and b/nwnds_module/tlr_s_otherside.ncs differ diff --git a/nwnds_module/tlr_s_otherside.nss b/nwnds_module/tlr_s_otherside.nss new file mode 100644 index 000000000..59e8bd2c2 --- /dev/null +++ b/nwnds_module/tlr_s_otherside.nss @@ -0,0 +1,53 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: symmetry, copy from the other side +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + is it symmetrical? + read # from other side + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from milambus's scripts +//-- milamBUS, one day, i'll learn his name right! +//--(i suck at names, k?) +//::////////////////////////////////////////////// + + + +void main() +{ + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + int iNewLook; + //-- step zero: translate our toModify + switch (iToModify) + { + case ITEM_APPR_ARMOR_MODEL_RBICEP: { iNewLook = ITEM_APPR_ARMOR_MODEL_LBICEP; break; } + case ITEM_APPR_ARMOR_MODEL_RFOOT: { iNewLook = ITEM_APPR_ARMOR_MODEL_LFOOT; break; } + case ITEM_APPR_ARMOR_MODEL_RFOREARM: { iNewLook = ITEM_APPR_ARMOR_MODEL_LFOREARM; break; } + case ITEM_APPR_ARMOR_MODEL_RHAND: { iNewLook = ITEM_APPR_ARMOR_MODEL_LHAND; break; } + case ITEM_APPR_ARMOR_MODEL_RSHIN: { iNewLook = ITEM_APPR_ARMOR_MODEL_LSHIN; break; } + case ITEM_APPR_ARMOR_MODEL_RSHOULDER: { iNewLook = ITEM_APPR_ARMOR_MODEL_LSHOULDER; break; } + case ITEM_APPR_ARMOR_MODEL_RTHIGH: { iNewLook = ITEM_APPR_ARMOR_MODEL_LTHIGH; break; } + case ITEM_APPR_ARMOR_MODEL_LBICEP: { iNewLook = ITEM_APPR_ARMOR_MODEL_RBICEP; break; } + case ITEM_APPR_ARMOR_MODEL_LFOOT: { iNewLook = ITEM_APPR_ARMOR_MODEL_RFOOT; break; } + case ITEM_APPR_ARMOR_MODEL_LFOREARM: { iNewLook = ITEM_APPR_ARMOR_MODEL_RFOREARM; break; } + case ITEM_APPR_ARMOR_MODEL_LHAND: { iNewLook = ITEM_APPR_ARMOR_MODEL_RHAND; break; } + case ITEM_APPR_ARMOR_MODEL_LSHIN: { iNewLook = ITEM_APPR_ARMOR_MODEL_RSHIN; break; } + case ITEM_APPR_ARMOR_MODEL_LSHOULDER: { iNewLook = ITEM_APPR_ARMOR_MODEL_RSHOULDER; break; } + case ITEM_APPR_ARMOR_MODEL_LTHIGH: { iNewLook = ITEM_APPR_ARMOR_MODEL_RTHIGH; break; } + + default: return; //-- not a symmetrical part + } + + int iNewApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iNewLook); + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + + DelayCommand(0.5f, AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST))); + +} diff --git a/nwnds_module/tlr_s_r2l.ncs b/nwnds_module/tlr_s_r2l.ncs new file mode 100644 index 000000000..3906d669b Binary files /dev/null and b/nwnds_module/tlr_s_r2l.ncs differ diff --git a/nwnds_module/tlr_s_r2l.nss b/nwnds_module/tlr_s_r2l.nss new file mode 100644 index 000000000..bd3b227a6 --- /dev/null +++ b/nwnds_module/tlr_s_r2l.nss @@ -0,0 +1,94 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: right 2 left +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + check our local string for what we're swapping + "SYMMETRYTYPE" = + arms + legs + both + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from lots of milambus's routines +//::////////////////////////////////////////////// + + + +void main() +{ + string sSym = GetLocalString(OBJECT_SELF, "SYMMETRYTYPE"); + + int iSourceValue; //-- read from parts + object oNew, oCurrent; //-- items we'll iterate through + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- step zero: create a duplicate to start modifying. + oNew = CopyItem(oSource, OBJECT_SELF); + + //-- step one: copy arms + if (sSym == "arms" || sSym == "both") + { + //--A: get #s from one side to the other + + // Right Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + } //-- end ARMS copying + + + if (sSym == "legs" || sSym == "both") + { + //-- same thing, for leg parts + // Right Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + } //-- end LEGS + + + + //-- step last: destroy the original clothing, and put on the new + + DestroyObject(oSource); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST)); + +} diff --git a/nwnds_module/tlr_s_setarms.ncs b/nwnds_module/tlr_s_setarms.ncs new file mode 100644 index 000000000..c64af5716 Binary files /dev/null and b/nwnds_module/tlr_s_setarms.ncs differ diff --git a/nwnds_module/tlr_s_setarms.nss b/nwnds_module/tlr_s_setarms.nss new file mode 100644 index 000000000..8d170f27e --- /dev/null +++ b/nwnds_module/tlr_s_setarms.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: symmetry sets +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + + set the local int for what symmetry we're doing + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//::////////////////////////////////////////////// + + + +void main() +{ + + SetLocalString(OBJECT_SELF, "SYMMETRYTYPE", "arms"); + +} diff --git a/nwnds_module/tlr_s_setboth.ncs b/nwnds_module/tlr_s_setboth.ncs new file mode 100644 index 000000000..44a8fe170 Binary files /dev/null and b/nwnds_module/tlr_s_setboth.ncs differ diff --git a/nwnds_module/tlr_s_setboth.nss b/nwnds_module/tlr_s_setboth.nss new file mode 100644 index 000000000..ff855609a --- /dev/null +++ b/nwnds_module/tlr_s_setboth.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: symmetry sets +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + + set the local int for what symmetry we're doing + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//::////////////////////////////////////////////// + + + +void main() +{ + + SetLocalString(OBJECT_SELF, "SYMMETRYTYPE", "both"); + +} diff --git a/nwnds_module/tlr_s_setlegs.ncs b/nwnds_module/tlr_s_setlegs.ncs new file mode 100644 index 000000000..8d04ee5cc Binary files /dev/null and b/nwnds_module/tlr_s_setlegs.ncs differ diff --git a/nwnds_module/tlr_s_setlegs.nss b/nwnds_module/tlr_s_setlegs.nss new file mode 100644 index 000000000..386190cda --- /dev/null +++ b/nwnds_module/tlr_s_setlegs.nss @@ -0,0 +1,21 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: symmetry sets +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + + set the local int for what symmetry we're doing + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//::////////////////////////////////////////////// + + + +void main() +{ + + SetLocalString(OBJECT_SELF, "SYMMETRYTYPE", "legs"); + +} diff --git a/nwnds_module/tlr_s_swap.ncs b/nwnds_module/tlr_s_swap.ncs new file mode 100644 index 000000000..d9560f089 Binary files /dev/null and b/nwnds_module/tlr_s_swap.ncs differ diff --git a/nwnds_module/tlr_s_swap.nss b/nwnds_module/tlr_s_swap.nss new file mode 100644 index 000000000..222e9f7ef --- /dev/null +++ b/nwnds_module/tlr_s_swap.nss @@ -0,0 +1,139 @@ +//:://///////////////////////////////////////////// +//:: TAILOR: right 2 left +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + check our local string for what we're swapping + "SYMMETRYTYPE" = + arms + legs + both + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//-- cobbled from lots of milambus's routines +//::////////////////////////////////////////////// + + + +void main() +{ + string sSym = GetLocalString(OBJECT_SELF, "SYMMETRYTYPE"); + + int iSourceValue; //-- read from parts + object oNew, oCurrent; //-- items we'll iterate through + object oSource = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + //-- step zero: create a duplicate to start modifying. + oNew = CopyItem(oSource, OBJECT_SELF); + + //-- step one: copy arms + if (sSym == "arms" || sSym == "both") + { + //--A: get #s from one side to the other + + // Right Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Bicep + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Forearm + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Hand + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shoulder + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, iSourceValue, TRUE); + DestroyObject(oCurrent); + + + + } //-- end ARMS copying + + + if (sSym == "legs" || sSym == "both") + { + //-- same thing, for leg parts + // Right Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // Right Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + + // LEFT Thigh + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Shin + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, iSourceValue, TRUE); + DestroyObject(oCurrent); + + // LEFT Foot + iSourceValue = GetItemAppearance(oSource, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT); + oCurrent = oNew; + oNew = CopyItemAndModify(oCurrent, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, iSourceValue, TRUE); + DestroyObject(oCurrent); + + } //-- end LEGS + + + + //-- step last: destroy the original clothing, and put on the new + + DestroyObject(oSource); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNew, INVENTORY_SLOT_CHEST)); + +} diff --git a/nwnds_module/tlr_s_unset.ncs b/nwnds_module/tlr_s_unset.ncs new file mode 100644 index 000000000..1abd0c747 Binary files /dev/null and b/nwnds_module/tlr_s_unset.ncs differ diff --git a/nwnds_module/tlr_s_unset.nss b/nwnds_module/tlr_s_unset.nss new file mode 100644 index 000000000..d5e48b048 --- /dev/null +++ b/nwnds_module/tlr_s_unset.nss @@ -0,0 +1,22 @@ +//:://///////////////////////////////////////////// +//::TAILOR: unset symmetry locals +//:: onconv mil_tailor +//::////////////////////////////////////////////// +/* + + this deletes the symmetry locals, + so they dont get confused. + +*/ +//::////////////////////////////////////////////// +//:: Created By: bloodsong +//::////////////////////////////////////////////// + + + +void main() +{ + DeleteLocalString(OBJECT_SELF, "SYMMETRYTYPE"); + + +} diff --git a/nwnds_module/tlr_setitem.ncs b/nwnds_module/tlr_setitem.ncs new file mode 100644 index 000000000..828d86666 Binary files /dev/null and b/nwnds_module/tlr_setitem.ncs differ diff --git a/nwnds_module/tlr_setitem.nss b/nwnds_module/tlr_setitem.nss new file mode 100644 index 000000000..b8b58dad1 --- /dev/null +++ b/nwnds_module/tlr_setitem.nss @@ -0,0 +1,31 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Set Item +//:: tlr_setitem.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetListening(OBJECT_SELF, FALSE); + + object oPC = GetPCSpeaker(); + object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF); + + int iToModify = GetLocalInt(OBJECT_SELF, "ToModify"); + + int iNewApp = StringToInt(GetLocalString(OBJECT_SELF, "tlr_Spoken")); + if (iNewApp < 0) iNewApp = 0; + + object oNewItem = CopyItemAndModify(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, iToModify, iNewApp, TRUE); + + DestroyObject(oItem); + SendMessageToPC(oPC, "New Appearance: " + IntToString(iNewApp)); + + AssignCommand(OBJECT_SELF, ActionEquipItem(oNewItem, INVENTORY_SLOT_CHEST)); +} diff --git a/nwnds_module/tlr_torso0.ncs b/nwnds_module/tlr_torso0.ncs new file mode 100644 index 000000000..24afd8470 Binary files /dev/null and b/nwnds_module/tlr_torso0.ncs differ diff --git a/nwnds_module/tlr_torso0.nss b/nwnds_module/tlr_torso0.nss new file mode 100644 index 000000000..994b25a0f --- /dev/null +++ b/nwnds_module/tlr_torso0.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 0 +//:: tlr_torso0.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 0); +} diff --git a/nwnds_module/tlr_torso1.ncs b/nwnds_module/tlr_torso1.ncs new file mode 100644 index 000000000..9a19323c8 Binary files /dev/null and b/nwnds_module/tlr_torso1.ncs differ diff --git a/nwnds_module/tlr_torso1.nss b/nwnds_module/tlr_torso1.nss new file mode 100644 index 000000000..0e3fdf011 --- /dev/null +++ b/nwnds_module/tlr_torso1.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 1 +//:: tlr_torso1.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 1); +} diff --git a/nwnds_module/tlr_torso2.ncs b/nwnds_module/tlr_torso2.ncs new file mode 100644 index 000000000..8d58c48b9 Binary files /dev/null and b/nwnds_module/tlr_torso2.ncs differ diff --git a/nwnds_module/tlr_torso2.nss b/nwnds_module/tlr_torso2.nss new file mode 100644 index 000000000..71b5656ac --- /dev/null +++ b/nwnds_module/tlr_torso2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 2 +//:: tlr_torso2.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 2); +} diff --git a/nwnds_module/tlr_torso3.ncs b/nwnds_module/tlr_torso3.ncs new file mode 100644 index 000000000..0a3f33f49 Binary files /dev/null and b/nwnds_module/tlr_torso3.ncs differ diff --git a/nwnds_module/tlr_torso3.nss b/nwnds_module/tlr_torso3.nss new file mode 100644 index 000000000..d3aa20f2e --- /dev/null +++ b/nwnds_module/tlr_torso3.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 3 +//:: tlr_torso3.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 3); +} diff --git a/nwnds_module/tlr_torso4.ncs b/nwnds_module/tlr_torso4.ncs new file mode 100644 index 000000000..987d6aaed Binary files /dev/null and b/nwnds_module/tlr_torso4.ncs differ diff --git a/nwnds_module/tlr_torso4.nss b/nwnds_module/tlr_torso4.nss new file mode 100644 index 000000000..f892a6157 --- /dev/null +++ b/nwnds_module/tlr_torso4.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 4 +//:: tlr_torso4.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 4); +} diff --git a/nwnds_module/tlr_torso5.ncs b/nwnds_module/tlr_torso5.ncs new file mode 100644 index 000000000..5fd542035 Binary files /dev/null and b/nwnds_module/tlr_torso5.ncs differ diff --git a/nwnds_module/tlr_torso5.nss b/nwnds_module/tlr_torso5.nss new file mode 100644 index 000000000..48bda9184 --- /dev/null +++ b/nwnds_module/tlr_torso5.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 5 +//:: tlr_torso5.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 5); +} diff --git a/nwnds_module/tlr_torso6.ncs b/nwnds_module/tlr_torso6.ncs new file mode 100644 index 000000000..4810e7790 Binary files /dev/null and b/nwnds_module/tlr_torso6.ncs differ diff --git a/nwnds_module/tlr_torso6.nss b/nwnds_module/tlr_torso6.nss new file mode 100644 index 000000000..372392450 --- /dev/null +++ b/nwnds_module/tlr_torso6.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 6 +//:: tlr_torso6.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 6); +} diff --git a/nwnds_module/tlr_torso7.ncs b/nwnds_module/tlr_torso7.ncs new file mode 100644 index 000000000..fa72fa1c5 Binary files /dev/null and b/nwnds_module/tlr_torso7.ncs differ diff --git a/nwnds_module/tlr_torso7.nss b/nwnds_module/tlr_torso7.nss new file mode 100644 index 000000000..afb7b4b97 --- /dev/null +++ b/nwnds_module/tlr_torso7.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 7 +//:: tlr_torso7.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 7); +} diff --git a/nwnds_module/tlr_torso8.ncs b/nwnds_module/tlr_torso8.ncs new file mode 100644 index 000000000..8bd357765 Binary files /dev/null and b/nwnds_module/tlr_torso8.ncs differ diff --git a/nwnds_module/tlr_torso8.nss b/nwnds_module/tlr_torso8.nss new file mode 100644 index 000000000..c8d74cbf4 --- /dev/null +++ b/nwnds_module/tlr_torso8.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: Tailoring - Torso AC 8 +//:: tlr_torso8.nss +//:: Copyright (c) 2003 Jake E. Fitch +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Jake E. Fitch (Milambus Mandragon) +//:: Created On: March 9, 2004 +//::////////////////////////////////////////////// +void main() +{ + SetLocalInt(OBJECT_SELF, "TorsoFilter", 8); +} diff --git a/nwnds_module/tmp_m_airinc.ncs b/nwnds_module/tmp_m_airinc.ncs new file mode 100644 index 000000000..18c6dec25 Binary files /dev/null and b/nwnds_module/tmp_m_airinc.ncs differ diff --git a/nwnds_module/tmp_m_airinc.nss b/nwnds_module/tmp_m_airinc.nss new file mode 100644 index 000000000..0ad2bd432 --- /dev/null +++ b/nwnds_module/tmp_m_airinc.nss @@ -0,0 +1,279 @@ +//:://///////////////////////////////////////////// +//:: Name Air Incarnation template script +//:: FileName tmp_m_airinc.nss +//:: +//::////////////////////////////////////////////// +/*CREATING AN ELEMENTAL INCARNATION +Elemental incarnation is an inherited template that can be added to any corporeal aberration, animal, magical beast, plant, or vermin (referred to hereafter as the base creature). + +An elemental incarnation uses all the base creature‘s statistics and abilities except as noted here. + +Size and Type: The creature‘s type changes to elemental, and the creature gains one or more elemental subtypes. Size is unchanged. Elemental incarnations encountered on the Material Plane have the extraplanar +subtype. + +Hit Dice: Change base creature‘s racial Hit Dice to d8s. Do not change class Hit Dice. (Possible?) + +Attack: An elemental incarnation retains all the special attacks of the base creature and also gains special attacks depending on its elemental kind. + +Special Qualities: An elemental incarnation retains all the special qualities of the base creature and also gains the following. + +* Darkvision out to 60 feet. + +* Immunity to poison, sleep effects, paralysis, and stunning. + +* Not subject to critical hits or flanking. + +* Unlike most other living creatures, an elemental does not have a dual nature—its soul and body form one unit. When an elemental is slain, no soul is set loose. Spells that restore souls to their bodies, such as raise dead, reincarnate, and resurrection, don‘t work on an elemental. It takes a different magical effect, such as limited wish, wish, miracle, or true resurrection, to restore it to life + +* Damage reduction (see the table below). If the base creature already has damage reduction, use the better value. If an air incarnation gains damage reduction, its natural weapons are treated as magic +weapons for the purpose of overcoming damage reduction. + +Hit Dice Damage Reduction +1–3 — +4–11 5/magic +12 or more 10/magic + +Special Attacks: An air incarnation retains all the special attacks of the base creature and also gains the following special attacks. + +Windstorm (Ex): As a standard action, an air incarnation can create a windstorm with a radius depending on its Hit Dice (see the table below) up to 60 feet away. The storm lasts as long as the incarnation concentrates and has the normal effects of a windstorm, except that ranged attacks are possible in its area: The windstorm imposes a –8 penalty on ranged attack rolls and Listen checks, extinguishes unprotected flames, and has a 75% chance of extinguishing protected flames each round. + +Skills: If the creature has an Intelligence of at least 3, it speaks Auran. + +Abilities: Change from the base creature as follows: Strength –2, Dexterity +4, Constitution –2 + +Challenge Rating: HD 3 or less, as base creature; HD 4 to 7, as base creature +1; HD 8 or more, as base creature +2. + +Alignment: Usually neutral. + +Level Adjustment: Same as the base creature +4. + +*/ + +#include "prc_inc_template" +#include "prc_inc_natweap" +#include "prc_inc_combat" + +void main() +{ + int nEvent = GetRunningEvent(); + if(DEBUG) DoDebug("tmp_m_airinc running, event: " + IntToString(nEvent)); + + // Get the PC. This is event-dependent + object oPC; + switch(nEvent) + { + case EVENT_ITEM_ONHIT: oPC = OBJECT_SELF; break; + case EVENT_ONPLAYEREQUIPITEM: oPC = GetItemLastEquippedBy(); break; + case EVENT_ONPLAYERUNEQUIPITEM: oPC = GetItemLastUnequippedBy(); break; + case EVENT_ONHEARTBEAT: oPC = OBJECT_SELF; break; + + default: + oPC = OBJECT_SELF; + } + + object oItem; + object oSkin = GetPCSkin(oPC); + itemproperty ipIP; + + // We aren't being called from any event, instead from EvalPRCFeats + if(nEvent == FALSE) + { + + // Make Air Incarnation + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_CRITICAL); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_SNEAKATTACK); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_PARALYSIS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_TO_SLEEP); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_POISON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + SetLocalInt(oPC, "NOSTUN", 1); + + // Set Damage Reduction + if (GetHitDice(oPC) > 11) + { + ipIP = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_10_HP); + } + else if (GetHitDice(oPC) > 3) + { + ipIP = ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1, IP_CONST_DAMAGESOAK_5_HP); + } + + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + //Abilities + SetCompositeBonus(oSkin, "Template_AirInc_str", -2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_STR); + SetCompositeBonus(oSkin, "Template_AirInc_dex", 4, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_DEX); + SetCompositeBonus(oSkin, "Template_AirInc_con", -2, ITEM_PROPERTY_ABILITY_BONUS, IP_CONST_ABILITY_CON); + + //feats + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_WEAPON_PROF_CREATURE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMPROVED_UNARMED_STRIKE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + //Natural Attacks + string sResRef = "prc_raks_bite_"; + int nSize = PRCGetCreatureSize(oPC); + sResRef += GetAffixForSize(nSize); + AddNaturalSecondaryWeapon(oPC, sResRef); + //primary weapon + sResRef = "prc_claw_1d6l_"; + sResRef += GetAffixForSize(nSize); + AddNaturalPrimaryWeapon(oPC, sResRef, 2); + + //make Gravetouched undead + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_UNDEAD_HD); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_ABILITY_DECREASE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_CRITICAL); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_DEATH); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_DISEASE); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_MIND_SPELLS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_PARALYSIS); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_POISON); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = PRCItemPropertyBonusFeat(IP_CONST_FEAT_IMMUNITY_SNEAKATTACK); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + ipIP = ItemPropertyDamageImmunity(IP_CONST_DAMAGETYPE_NEGATIVE, IP_CONST_DAMAGEIMMUNITY_100_PERCENT); + IPSafeAddItemProperty(oSkin, ipIP, 0.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE); + + // Hook in the events, needed from level 1 for Skirmish + if(DEBUG) DoDebug("tmp_m_gravetouch: Adding eventhooks"); + AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, "tmp_m_gravetouch", TRUE, FALSE); + AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, "tmp_m_gravetouch", TRUE, FALSE); + AddEventScript(oPC, EVENT_ONHEARTBEAT, "tmp_m_gravetouch", TRUE, FALSE); + } + // We're being called from the OnHit eventhook + else if(nEvent == EVENT_ITEM_ONHIT) + { + oItem = GetSpellCastItem(); + object oTarget = PRCGetSpellTargetObject(); + if(DEBUG) DoDebug("tmp_m_gravetouch: OnHit:\n" + + "oPC = " + DebugObject2Str(oPC) + "\n" + + "oItem = " + DebugObject2Str(oItem) + "\n" + + "oTarget = " + DebugObject2Str(oTarget) + "\n" + ); + //FloatingTextStringOnCreature(GetName(oItem)+" is OnHit Item for Gravetouched", oPC, FALSE); + int nDC = 10 + GetHitDice(oPC)/2 + GetAbilityModifier(ABILITY_CHARISMA, oPC); + if (oItem == GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oPC)) + { + // Disease bite + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_DISEASE)) ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDisease(DISEASE_GHOUL_ROT), oTarget); + } + // Can't paralyze elves + if (GetIsCreatureWeapon(oItem) && MyPRCGetRacialType(oTarget) != RACIAL_TYPE_ELF) + { + if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nDC, SAVING_THROW_TYPE_NONE)) ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectParalyze(), oTarget, RoundsToSeconds(d4()+1)); + } + }// end if - Running OnHit event + // We are called from the OnPlayerEquipItem eventhook. Add OnHitCast: Unique Power to oPC's weapon + else if(nEvent == EVENT_ONPLAYEREQUIPITEM) + { + oPC = GetItemLastEquippedBy(); + oItem = GetItemLastEquipped(); + if(DEBUG) DoDebug("tmp_m_gravetouch - OnEquip\n" + + "oPC = " + DebugObject2Str(oPC) + "\n" + + "oItem = " + DebugObject2Str(oItem) + "\n" + ); + if (oItem == GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oPC)) + { + IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + } + if (oItem == GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oPC)) + { + IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + } + if (oItem == GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oPC)) + { + IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + //AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_POSITIVE, IP_CONST_DAMAGEBONUS_2), oItem, 99999.0); + } + } + // We are called from the OnPlayerUnEquipItem eventhook. Remove OnHitCast: Unique Power from oPC's weapon + else if(nEvent == EVENT_ONPLAYERUNEQUIPITEM) + { + oPC = GetItemLastUnequippedBy(); + oItem = GetItemLastUnequipped(); + if(DEBUG) DoDebug("tmp_m_gravetouch - OnUnEquip\n" + + "oPC = " + DebugObject2Str(oPC) + "\n" + + "oItem = " + DebugObject2Str(oItem) + "\n" + ); + + // Only applies to creature weapons + if(GetIsCreatureWeapon(oItem)) + { + // Remove the temporary OnHitCastSpell: Unique + RemoveEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + RemoveSpecificProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL, IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 0, 1, "", -1, DURATION_TYPE_TEMPORARY); + } + } + else if(nEvent == EVENT_ONHEARTBEAT) + { + if(DEBUG) DoDebug("tmp_m_gravetouch - OnHB\n" + + "oPC = " + DebugObject2Str(oPC) + "\n" + + "oItem = " + DebugObject2Str(oItem) + "\n" + ); + /* FloatingTextStringOnCreature(GetName(oPC)+" is heartbeat", oPC, FALSE); + oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oPC); + if (GetIsObjectValid(oItem)) + { + // IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + // AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + FloatingTextStringOnCreature(GetName(oItem)+" is in Creature Slot Bite", oPC, FALSE); + } + oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oPC); + if (GetIsObjectValid(oItem)) + { + // IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + // AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + FloatingTextStringOnCreature(GetName(oItem)+" is in Creature Slot Right", oPC, FALSE); + } + oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oPC); + if (GetIsObjectValid(oItem)) + { + // IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 99999.0, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, FALSE); + // AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), oItem, 99999.0); + // AddEventScript(oItem, EVENT_ITEM_ONHIT, "tmp_m_gravetouch", TRUE, FALSE); + FloatingTextStringOnCreature(GetName(oItem)+" is in Creature Slot Left", oPC, FALSE); + + // No equipping magical items, and make sure to ignore creature items + itemproperty ip = GetFirstItemProperty(oItem); + while(GetIsItemPropertyValid(ip)) + { + FloatingTextStringOnCreature(ItemPropertyToString(ip)+" is on Creature Slot Left", oPC, FALSE); + ip = GetNextItemProperty(oItem); + } + + //AddItemProperty(DURATION_TYPE_PERMANENT,ItemPropertyMonsterDamage(iMonsterDamage),oWeapL); + + //AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_POSITIVE, IP_CONST_DAMAGEBONUS_10), oItem, 99999.0); + }*/ + } +} \ No newline at end of file diff --git a/nwnds_module/tombmote001.utc b/nwnds_module/tombmote001.utc new file mode 100644 index 000000000..8505af046 Binary files /dev/null and b/nwnds_module/tombmote001.utc differ diff --git a/nwnds_module/tombmotebite001.uti b/nwnds_module/tombmotebite001.uti new file mode 100644 index 000000000..340db980f Binary files /dev/null and b/nwnds_module/tombmotebite001.uti differ diff --git a/nwnds_module/tombmotehide001.uti b/nwnds_module/tombmotehide001.uti new file mode 100644 index 000000000..a9a58267b Binary files /dev/null and b/nwnds_module/tombmotehide001.uti differ diff --git a/nwnds_module/totalitemvalue.ncs b/nwnds_module/totalitemvalue.ncs new file mode 100644 index 000000000..dc7eb7cd9 Binary files /dev/null and b/nwnds_module/totalitemvalue.ncs differ diff --git a/nwnds_module/totalitemvalue.nss b/nwnds_module/totalitemvalue.nss new file mode 100644 index 000000000..efd65583f --- /dev/null +++ b/nwnds_module/totalitemvalue.nss @@ -0,0 +1,42 @@ +int GetTotalPlayerItemCost(object oPlayer); + +void main() +{ + object oPlayer; + int nTotalPlayerCost; + + oPlayer = GetPCSpeaker(); + + nTotalPlayerCost = GetTotalPlayerItemCost(oPlayer); + SetCustomToken(500,IntToString(nTotalPlayerCost)); +} + + +int GetTotalPlayerItemCost( object oPlayer ) +{ + int nCount, nTotalCost = 0; + object oItem; + + // Calculate the total cost of items in the creature's + // repository + oItem = GetFirstItemInInventory(oPlayer); + while ( GetIsObjectValid(oItem) == TRUE ) + { + nTotalCost += GetGoldPieceValue(oItem); + oItem = GetNextItemInInventory(oPlayer); + } + + // Now iterate through each inventory slot and compute + // the cost of the item (if one exists in that slot) + // - BKH - Jun/09/02 + for ( nCount = 0; nCount < NUM_INVENTORY_SLOTS; nCount++ ) + { + oItem = GetItemInSlot(nCount,oPlayer); + if ( GetIsObjectValid(oItem) ) + { + nTotalCost += GetGoldPieceValue(oItem); + } + } + + return nTotalCost; +} diff --git a/nwnds_module/towncriercloth.uti b/nwnds_module/towncriercloth.uti new file mode 100644 index 000000000..9fbcb2b0a Binary files /dev/null and b/nwnds_module/towncriercloth.uti differ diff --git a/nwnds_module/tr_air_dr_bite.uti b/nwnds_module/tr_air_dr_bite.uti new file mode 100644 index 000000000..57a0cd822 Binary files /dev/null and b/nwnds_module/tr_air_dr_bite.uti differ diff --git a/nwnds_module/tr_air_dr_claw.uti b/nwnds_module/tr_air_dr_claw.uti new file mode 100644 index 000000000..d06c6c6c5 Binary files /dev/null and b/nwnds_module/tr_air_dr_claw.uti differ diff --git a/nwnds_module/tr_air_dr_hide.uti b/nwnds_module/tr_air_dr_hide.uti new file mode 100644 index 000000000..1dab09168 Binary files /dev/null and b/nwnds_module/tr_air_dr_hide.uti differ diff --git a/nwnds_module/tr_air_dr_tail.uti b/nwnds_module/tr_air_dr_tail.uti new file mode 100644 index 000000000..bf8bd007d Binary files /dev/null and b/nwnds_module/tr_air_dr_tail.uti differ diff --git a/nwnds_module/tr_earth_dr_claw.uti b/nwnds_module/tr_earth_dr_claw.uti new file mode 100644 index 000000000..f49a2547d Binary files /dev/null and b/nwnds_module/tr_earth_dr_claw.uti differ diff --git a/nwnds_module/trainer001.dlg b/nwnds_module/trainer001.dlg new file mode 100644 index 000000000..f6ff128d9 Binary files /dev/null and b/nwnds_module/trainer001.dlg differ diff --git a/nwnds_module/trans_cv.ncs b/nwnds_module/trans_cv.ncs new file mode 100644 index 000000000..67951de32 Binary files /dev/null and b/nwnds_module/trans_cv.ncs differ diff --git a/nwnds_module/trans_cv.nss b/nwnds_module/trans_cv.nss new file mode 100644 index 000000000..0ace4ae11 --- /dev/null +++ b/nwnds_module/trans_cv.nss @@ -0,0 +1,20 @@ +/* + * Script generated by LS Script Generator, v.TK.0 + * + * For download info, please visit: + * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 + */ +// Put this script OnClick of a placeable. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetPlaceableLastClickedBy(); + string sCv = GetLocalString(OBJECT_SELF, "TRANSITION_CV"); + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, sCv, TRUE, FALSE); + + +} + diff --git a/nwnds_module/trans_enter_ftms.ncs b/nwnds_module/trans_enter_ftms.ncs new file mode 100644 index 000000000..9caea9c02 Binary files /dev/null and b/nwnds_module/trans_enter_ftms.ncs differ diff --git a/nwnds_module/trans_enter_ftms.nss b/nwnds_module/trans_enter_ftms.nss new file mode 100644 index 000000000..387969c02 --- /dev/null +++ b/nwnds_module/trans_enter_ftms.nss @@ -0,0 +1,28 @@ + +void main() +{ + +object oPC = GetClickingObject(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("FROM_FT_AMBERtoFT_MASTER"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/trans_enter_tals.ncs b/nwnds_module/trans_enter_tals.ncs new file mode 100644 index 000000000..a17b27b5f Binary files /dev/null and b/nwnds_module/trans_enter_tals.ncs differ diff --git a/nwnds_module/trans_enter_tals.nss b/nwnds_module/trans_enter_tals.nss new file mode 100644 index 000000000..9ac0ee31b --- /dev/null +++ b/nwnds_module/trans_enter_tals.nss @@ -0,0 +1,35 @@ +/////////////////////////////////////////////////////////////////////// +// +// trans_enter_tals.nss +// +// temp script to enter Tal's Weapons w/o working doors in Ft. Amber. +// +/////////////////////////////////////////////////////////////////////// + +void main() +{ + +object oPC = GetClickingObject(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("FROM_FT_AMBERtoTALSWEAPONS"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/trans_enter_tora.ncs b/nwnds_module/trans_enter_tora.ncs new file mode 100644 index 000000000..287ec289f Binary files /dev/null and b/nwnds_module/trans_enter_tora.ncs differ diff --git a/nwnds_module/trans_enter_tora.nss b/nwnds_module/trans_enter_tora.nss new file mode 100644 index 000000000..e46bf58dc --- /dev/null +++ b/nwnds_module/trans_enter_tora.nss @@ -0,0 +1,28 @@ + +void main() +{ + +object oPC = GetClickingObject(); + +if (!GetIsPC(oPC)) return; + +object oTarget; +location lTarget; +oTarget = GetWaypointByTag("FROMFT_AMBERtoTORAS_INN"); + +lTarget = GetLocation(oTarget); + +//only do the jump if the location is valid. +//though not flawless, we just check if it is in a valid area. +//the script will stop if the location isn't valid - meaning that +//nothing put after the teleport will fire either. +//the current location won't be stored, either + +if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; + +AssignCommand(oPC, ClearAllActions()); + +AssignCommand(oPC, ActionJumpToLocation(lTarget)); + +} + diff --git a/nwnds_module/trapdoor.ncs b/nwnds_module/trapdoor.ncs new file mode 100644 index 000000000..57b3904cc Binary files /dev/null and b/nwnds_module/trapdoor.ncs differ diff --git a/nwnds_module/trapdoor.nss b/nwnds_module/trapdoor.nss new file mode 100644 index 000000000..04ddde14e --- /dev/null +++ b/nwnds_module/trapdoor.nss @@ -0,0 +1,41 @@ +//:://///////////////////////////////////////////// +//:: Trap door that takes you to a waypoint that +//:: is stored into the Destination local string. +//:: FileName +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + +*/ +//::////////////////////////////////////////////// +//:: Created By: Robert Babiak +//:: Created On: June 25, 2002 +//::////////////////////////////////////////////// + +void main() +{ + object oidUser; + object oidDest; + string sDest; + + if (!GetLocked(OBJECT_SELF) ) + { + if ( GetIsOpen(OBJECT_SELF)) + { + sDest = GetLocalString( OBJECT_SELF, "Destination" ); + + oidUser = GetLastUsedBy(); + oidDest = GetObjectByTag(sDest); + + AssignCommand(oidUser, ActionJumpToObject(oidDest,FALSE)); + PlayAnimation(ANIMATION_PLACEABLE_CLOSE ); + } else + { + PlayAnimation(ANIMATION_PLACEABLE_OPEN ); + } + } else + { + // ActionUseSkill + } + +} diff --git a/nwnds_module/trapdoor.utp b/nwnds_module/trapdoor.utp new file mode 100644 index 000000000..a8db44b94 Binary files /dev/null and b/nwnds_module/trapdoor.utp differ diff --git a/nwnds_module/treantath001.utc b/nwnds_module/treantath001.utc new file mode 100644 index 000000000..67d8139b8 Binary files /dev/null and b/nwnds_module/treantath001.utc differ diff --git a/nwnds_module/treantdef001.utc b/nwnds_module/treantdef001.utc new file mode 100644 index 000000000..fe75b46b5 Binary files /dev/null and b/nwnds_module/treantdef001.utc differ diff --git a/nwnds_module/treanthide001.uti b/nwnds_module/treanthide001.uti new file mode 100644 index 000000000..7b87dfea9 Binary files /dev/null and b/nwnds_module/treanthide001.uti differ diff --git a/nwnds_module/treanthide002.uti b/nwnds_module/treanthide002.uti new file mode 100644 index 000000000..98fe33697 Binary files /dev/null and b/nwnds_module/treanthide002.uti differ diff --git a/nwnds_module/treasuresys_inc.nss b/nwnds_module/treasuresys_inc.nss new file mode 100644 index 000000000..444e4b22b --- /dev/null +++ b/nwnds_module/treasuresys_inc.nss @@ -0,0 +1,41 @@ +float TREASURE_RESPAWN_TIME = 2700.0; //sets the time before treasure/container respawn +string sTreasureGenScript = "x0_o2_anylow"; //the name of the script generating treasure + +void Empty_Container(object oContainer ) +{ + object oItem = GetFirstItemInInventory( oContainer ); + while ( GetIsObjectValid( oItem )) + { + DestroyObject( oItem ); + oItem = GetNextItemInInventory( oContainer ); + } +} + +void Create_Chest ( string template, string sTag, location lchest ) +{ + effect eSpawn = EffectVisualEffect( VFX_FNF_SMOKE_PUFF ); + object chest = CreateObject( OBJECT_TYPE_PLACEABLE, template, lchest, TRUE, sTag ); + ApplyEffectAtLocation( DURATION_TYPE_INSTANT, eSpawn, lchest ); +} + +void Respawn_Chest ( object oContainer ) +{ +string sResRef = GetResRef( oContainer ); +string sTag = GetTag( oContainer ); +location lLoc = GetLocation( oContainer ); + +Empty_Container( oContainer ); +DestroyObject( oContainer ); +Create_Chest( sResRef, sTag, lLoc ); + +} + +void Handle_Open ( object oContainer ) +{ + if (GetLocalInt( oContainer, "NW_DO_ONCE" )) return; + float respawnTime = TREASURE_RESPAWN_TIME; + AssignCommand( GetArea(oContainer), DelayCommand( respawnTime, Respawn_Chest(oContainer) )); + +} + +//void main(){} diff --git a/nwnds_module/triggerpalcus.itp b/nwnds_module/triggerpalcus.itp new file mode 100644 index 000000000..eb17af43b Binary files /dev/null and b/nwnds_module/triggerpalcus.itp differ diff --git a/nwnds_module/trm_tyrpass.ncs b/nwnds_module/trm_tyrpass.ncs new file mode 100644 index 000000000..df365b16a Binary files /dev/null and b/nwnds_module/trm_tyrpass.ncs differ diff --git a/nwnds_module/trm_tyrpass.nss b/nwnds_module/trm_tyrpass.nss new file mode 100644 index 000000000..99e02cace --- /dev/null +++ b/nwnds_module/trm_tyrpass.nss @@ -0,0 +1,15 @@ +// Put this script OnEnter. + + +void main() +{ + // Get the creature who triggered this event. + object oPC = GetEnteringObject(); + + // Only fire for (real) PCs. + if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) ) + return; + + // Have us strike up a conversation with the PC. + ActionStartConversation(oPC, "trm_tyrpass", TRUE, FALSE); +} diff --git a/nwnds_module/trueseeingskin.uti b/nwnds_module/trueseeingskin.uti new file mode 100644 index 000000000..f6ffca88e Binary files /dev/null and b/nwnds_module/trueseeingskin.uti differ diff --git a/nwnds_module/tss_clock_catacm.are b/nwnds_module/tss_clock_catacm.are new file mode 100644 index 000000000..a2611293d Binary files /dev/null and b/nwnds_module/tss_clock_catacm.are differ diff --git a/nwnds_module/tss_clock_catacm.gic b/nwnds_module/tss_clock_catacm.gic new file mode 100644 index 000000000..162ff1756 Binary files /dev/null and b/nwnds_module/tss_clock_catacm.gic differ diff --git a/nwnds_module/tss_clock_catacm.git b/nwnds_module/tss_clock_catacm.git new file mode 100644 index 000000000..12bb88366 Binary files /dev/null and b/nwnds_module/tss_clock_catacm.git differ diff --git a/nwnds_module/tss_clock_isle.are b/nwnds_module/tss_clock_isle.are new file mode 100644 index 000000000..2bd088733 Binary files /dev/null and b/nwnds_module/tss_clock_isle.are differ diff --git a/nwnds_module/tss_clock_isle.gic b/nwnds_module/tss_clock_isle.gic new file mode 100644 index 000000000..c521ad1f1 Binary files /dev/null and b/nwnds_module/tss_clock_isle.gic differ diff --git a/nwnds_module/tss_clock_isle.git b/nwnds_module/tss_clock_isle.git new file mode 100644 index 000000000..1f2ca0c4c Binary files /dev/null and b/nwnds_module/tss_clock_isle.git differ diff --git a/nwnds_module/tss_clock_ruins1.are b/nwnds_module/tss_clock_ruins1.are new file mode 100644 index 000000000..b93150c77 Binary files /dev/null and b/nwnds_module/tss_clock_ruins1.are differ diff --git a/nwnds_module/tss_clock_ruins1.gic b/nwnds_module/tss_clock_ruins1.gic new file mode 100644 index 000000000..913e81973 Binary files /dev/null and b/nwnds_module/tss_clock_ruins1.gic differ diff --git a/nwnds_module/tss_clock_ruins1.git b/nwnds_module/tss_clock_ruins1.git new file mode 100644 index 000000000..5b82b06ec Binary files /dev/null and b/nwnds_module/tss_clock_ruins1.git differ diff --git a/nwnds_module/tss_clock_ruins2.are b/nwnds_module/tss_clock_ruins2.are new file mode 100644 index 000000000..235b0ac6f Binary files /dev/null and b/nwnds_module/tss_clock_ruins2.are differ diff --git a/nwnds_module/tss_clock_ruins2.gic b/nwnds_module/tss_clock_ruins2.gic new file mode 100644 index 000000000..7106e2b53 Binary files /dev/null and b/nwnds_module/tss_clock_ruins2.gic differ diff --git a/nwnds_module/tss_clock_ruins2.git b/nwnds_module/tss_clock_ruins2.git new file mode 100644 index 000000000..8d35d361d Binary files /dev/null and b/nwnds_module/tss_clock_ruins2.git differ diff --git a/nwnds_module/tss_clock_wrix.are b/nwnds_module/tss_clock_wrix.are new file mode 100644 index 000000000..e5b9390e6 Binary files /dev/null and b/nwnds_module/tss_clock_wrix.are differ diff --git a/nwnds_module/tss_clock_wrix.gic b/nwnds_module/tss_clock_wrix.gic new file mode 100644 index 000000000..a816b0485 Binary files /dev/null and b/nwnds_module/tss_clock_wrix.gic differ diff --git a/nwnds_module/tss_clock_wrix.git b/nwnds_module/tss_clock_wrix.git new file mode 100644 index 000000000..3c2613582 Binary files /dev/null and b/nwnds_module/tss_clock_wrix.git differ diff --git a/nwnds_module/tss_cromlin_isle.are b/nwnds_module/tss_cromlin_isle.are new file mode 100644 index 000000000..d062a380b Binary files /dev/null and b/nwnds_module/tss_cromlin_isle.are differ diff --git a/nwnds_module/tss_cromlin_isle.gic b/nwnds_module/tss_cromlin_isle.gic new file mode 100644 index 000000000..69007a0b8 Binary files /dev/null and b/nwnds_module/tss_cromlin_isle.gic differ diff --git a/nwnds_module/tss_cromlin_isle.git b/nwnds_module/tss_cromlin_isle.git new file mode 100644 index 000000000..d3efe8666 Binary files /dev/null and b/nwnds_module/tss_cromlin_isle.git differ diff --git a/nwnds_module/tss_cromlin_ug.are b/nwnds_module/tss_cromlin_ug.are new file mode 100644 index 000000000..0d07920c8 Binary files /dev/null and b/nwnds_module/tss_cromlin_ug.are differ diff --git a/nwnds_module/tss_cromlin_ug.gic b/nwnds_module/tss_cromlin_ug.gic new file mode 100644 index 000000000..24e5fe19c Binary files /dev/null and b/nwnds_module/tss_cromlin_ug.gic differ diff --git a/nwnds_module/tss_cromlin_ug.git b/nwnds_module/tss_cromlin_ug.git new file mode 100644 index 000000000..1422030d8 Binary files /dev/null and b/nwnds_module/tss_cromlin_ug.git differ diff --git a/nwnds_module/tss_pirate_docks.are b/nwnds_module/tss_pirate_docks.are new file mode 100644 index 000000000..de973fd8d Binary files /dev/null and b/nwnds_module/tss_pirate_docks.are differ diff --git a/nwnds_module/tss_pirate_docks.gic b/nwnds_module/tss_pirate_docks.gic new file mode 100644 index 000000000..bae24e7a7 Binary files /dev/null and b/nwnds_module/tss_pirate_docks.gic differ diff --git a/nwnds_module/tss_pirate_docks.git b/nwnds_module/tss_pirate_docks.git new file mode 100644 index 000000000..6111417bb Binary files /dev/null and b/nwnds_module/tss_pirate_docks.git differ diff --git a/nwnds_module/tss_pirate_lair.are b/nwnds_module/tss_pirate_lair.are new file mode 100644 index 000000000..a5f380171 Binary files /dev/null and b/nwnds_module/tss_pirate_lair.are differ diff --git a/nwnds_module/tss_pirate_lair.gic b/nwnds_module/tss_pirate_lair.gic new file mode 100644 index 000000000..c693aec56 Binary files /dev/null and b/nwnds_module/tss_pirate_lair.gic differ diff --git a/nwnds_module/tss_pirate_lair.git b/nwnds_module/tss_pirate_lair.git new file mode 100644 index 000000000..5bc5b7eda Binary files /dev/null and b/nwnds_module/tss_pirate_lair.git differ diff --git a/nwnds_module/tt4.ncs b/nwnds_module/tt4.ncs new file mode 100644 index 000000000..b288023f7 Binary files /dev/null and b/nwnds_module/tt4.ncs differ diff --git a/nwnds_module/tt4.nss b/nwnds_module/tt4.nss new file mode 100644 index 000000000..6f4348506 --- /dev/null +++ b/nwnds_module/tt4.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName tt4 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/11/02 12:22:55 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") == 4)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/tt5.ncs b/nwnds_module/tt5.ncs new file mode 100644 index 000000000..2fa4ec850 Binary files /dev/null and b/nwnds_module/tt5.ncs differ diff --git a/nwnds_module/tt5.nss b/nwnds_module/tt5.nss new file mode 100644 index 000000000..c98568b4e --- /dev/null +++ b/nwnds_module/tt5.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName tt5 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/11/02 12:27:17 AM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("fac_itprng_thief", GetPCSpeaker(), 1); + + // Set the variables + SetLocalInt(GetPCSpeaker(), "thievesquests", 5); + +} diff --git a/nwnds_module/twigblightclaw.uti b/nwnds_module/twigblightclaw.uti new file mode 100644 index 000000000..c6d41f48d Binary files /dev/null and b/nwnds_module/twigblightclaw.uti differ diff --git a/nwnds_module/twigblighthide.uti b/nwnds_module/twigblighthide.uti new file mode 100644 index 000000000..0f0654d41 Binary files /dev/null and b/nwnds_module/twigblighthide.uti differ diff --git a/nwnds_module/tyr.ncs b/nwnds_module/tyr.ncs new file mode 100644 index 000000000..2486f8a6f Binary files /dev/null and b/nwnds_module/tyr.ncs differ diff --git a/nwnds_module/tyr.nss b/nwnds_module/tyr.nss new file mode 100644 index 000000000..4ca1b955f --- /dev/null +++ b/nwnds_module/tyr.nss @@ -0,0 +1,43 @@ + +void main() +{ + int nHench; + object oHench; + object oTarget; + + // Get the PC who is in this conversation. + object oPC = GetPCSpeaker(); + + // Find the location to which to teleport. + oTarget = GetWaypointByTag("tyr_wp1"); + + // Teleport the PC. + AssignCommand(oPC, ClearAllActions()); + AssignCommand(oPC, JumpToObject(oTarget)); + + // Also teleport associates. + oHench = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + oHench = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC); + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + + // Support for multiple henchmen (includes horses). + nHench = 1; + oHench = GetHenchman(oPC, 1); + while ( oHench != OBJECT_INVALID ) + { + AssignCommand(oHench, ClearAllActions()); + AssignCommand(oHench, JumpToObject(oTarget)); + // Next henchman. + oHench = GetHenchman(oPC, ++nHench); + } +} + diff --git a/nwnds_module/tyr_caravanway.are b/nwnds_module/tyr_caravanway.are new file mode 100644 index 000000000..cec4098a3 Binary files /dev/null and b/nwnds_module/tyr_caravanway.are differ diff --git a/nwnds_module/tyr_caravanway.gic b/nwnds_module/tyr_caravanway.gic new file mode 100644 index 000000000..9a8d4c6ef Binary files /dev/null and b/nwnds_module/tyr_caravanway.gic differ diff --git a/nwnds_module/tyr_caravanway.git b/nwnds_module/tyr_caravanway.git new file mode 100644 index 000000000..313711704 Binary files /dev/null and b/nwnds_module/tyr_caravanway.git differ diff --git a/nwnds_module/tyr_cw_advhall.are b/nwnds_module/tyr_cw_advhall.are new file mode 100644 index 000000000..93ddaf0e6 Binary files /dev/null and b/nwnds_module/tyr_cw_advhall.are differ diff --git a/nwnds_module/tyr_cw_advhall.gic b/nwnds_module/tyr_cw_advhall.gic new file mode 100644 index 000000000..a591dd2d2 Binary files /dev/null and b/nwnds_module/tyr_cw_advhall.gic differ diff --git a/nwnds_module/tyr_cw_advhall.git b/nwnds_module/tyr_cw_advhall.git new file mode 100644 index 000000000..166aa2657 Binary files /dev/null and b/nwnds_module/tyr_cw_advhall.git differ diff --git a/nwnds_module/tyr_cw_brills.are b/nwnds_module/tyr_cw_brills.are new file mode 100644 index 000000000..dd1a9b63c Binary files /dev/null and b/nwnds_module/tyr_cw_brills.are differ diff --git a/nwnds_module/tyr_cw_brills.gic b/nwnds_module/tyr_cw_brills.gic new file mode 100644 index 000000000..c09f4b69f Binary files /dev/null and b/nwnds_module/tyr_cw_brills.gic differ diff --git a/nwnds_module/tyr_cw_brills.git b/nwnds_module/tyr_cw_brills.git new file mode 100644 index 000000000..f03ff99aa Binary files /dev/null and b/nwnds_module/tyr_cw_brills.git differ diff --git a/nwnds_module/tyr_cw_carapub.are b/nwnds_module/tyr_cw_carapub.are new file mode 100644 index 000000000..b2999d81e Binary files /dev/null and b/nwnds_module/tyr_cw_carapub.are differ diff --git a/nwnds_module/tyr_cw_carapub.gic b/nwnds_module/tyr_cw_carapub.gic new file mode 100644 index 000000000..53d21d13b Binary files /dev/null and b/nwnds_module/tyr_cw_carapub.gic differ diff --git a/nwnds_module/tyr_cw_carapub.git b/nwnds_module/tyr_cw_carapub.git new file mode 100644 index 000000000..b4fc534de Binary files /dev/null and b/nwnds_module/tyr_cw_carapub.git differ diff --git a/nwnds_module/tyr_cw_caravan.are b/nwnds_module/tyr_cw_caravan.are new file mode 100644 index 000000000..b7ea0cdfe Binary files /dev/null and b/nwnds_module/tyr_cw_caravan.are differ diff --git a/nwnds_module/tyr_cw_caravan.gic b/nwnds_module/tyr_cw_caravan.gic new file mode 100644 index 000000000..86fa0a457 Binary files /dev/null and b/nwnds_module/tyr_cw_caravan.gic differ diff --git a/nwnds_module/tyr_cw_caravan.git b/nwnds_module/tyr_cw_caravan.git new file mode 100644 index 000000000..2295bc88c Binary files /dev/null and b/nwnds_module/tyr_cw_caravan.git differ diff --git a/nwnds_module/tyr_cw_carpenter.are b/nwnds_module/tyr_cw_carpenter.are new file mode 100644 index 000000000..463b25496 Binary files /dev/null and b/nwnds_module/tyr_cw_carpenter.are differ diff --git a/nwnds_module/tyr_cw_carpenter.gic b/nwnds_module/tyr_cw_carpenter.gic new file mode 100644 index 000000000..95fb7c26d Binary files /dev/null and b/nwnds_module/tyr_cw_carpenter.gic differ diff --git a/nwnds_module/tyr_cw_carpenter.git b/nwnds_module/tyr_cw_carpenter.git new file mode 100644 index 000000000..7ca56dc89 Binary files /dev/null and b/nwnds_module/tyr_cw_carpenter.git differ diff --git a/nwnds_module/tyr_cw_cityguide.are b/nwnds_module/tyr_cw_cityguide.are new file mode 100644 index 000000000..ba218cbd4 Binary files /dev/null and b/nwnds_module/tyr_cw_cityguide.are differ diff --git a/nwnds_module/tyr_cw_cityguide.gic b/nwnds_module/tyr_cw_cityguide.gic new file mode 100644 index 000000000..873583f7d Binary files /dev/null and b/nwnds_module/tyr_cw_cityguide.gic differ diff --git a/nwnds_module/tyr_cw_cityguide.git b/nwnds_module/tyr_cw_cityguide.git new file mode 100644 index 000000000..ba5604cc2 Binary files /dev/null and b/nwnds_module/tyr_cw_cityguide.git differ diff --git a/nwnds_module/tyr_cw_destiny.are b/nwnds_module/tyr_cw_destiny.are new file mode 100644 index 000000000..a3d230dc8 Binary files /dev/null and b/nwnds_module/tyr_cw_destiny.are differ diff --git a/nwnds_module/tyr_cw_destiny.gic b/nwnds_module/tyr_cw_destiny.gic new file mode 100644 index 000000000..ff707fb60 Binary files /dev/null and b/nwnds_module/tyr_cw_destiny.gic differ diff --git a/nwnds_module/tyr_cw_destiny.git b/nwnds_module/tyr_cw_destiny.git new file mode 100644 index 000000000..08e04fdfa Binary files /dev/null and b/nwnds_module/tyr_cw_destiny.git differ diff --git a/nwnds_module/tyr_cw_draqoman.are b/nwnds_module/tyr_cw_draqoman.are new file mode 100644 index 000000000..6408d45dd Binary files /dev/null and b/nwnds_module/tyr_cw_draqoman.are differ diff --git a/nwnds_module/tyr_cw_draqoman.gic b/nwnds_module/tyr_cw_draqoman.gic new file mode 100644 index 000000000..26997530a Binary files /dev/null and b/nwnds_module/tyr_cw_draqoman.gic differ diff --git a/nwnds_module/tyr_cw_draqoman.git b/nwnds_module/tyr_cw_draqoman.git new file mode 100644 index 000000000..fd14763cb Binary files /dev/null and b/nwnds_module/tyr_cw_draqoman.git differ diff --git a/nwnds_module/tyr_cw_flins.are b/nwnds_module/tyr_cw_flins.are new file mode 100644 index 000000000..90db5ec09 Binary files /dev/null and b/nwnds_module/tyr_cw_flins.are differ diff --git a/nwnds_module/tyr_cw_flins.gic b/nwnds_module/tyr_cw_flins.gic new file mode 100644 index 000000000..1c36dc97f Binary files /dev/null and b/nwnds_module/tyr_cw_flins.gic differ diff --git a/nwnds_module/tyr_cw_flins.git b/nwnds_module/tyr_cw_flins.git new file mode 100644 index 000000000..dc31f729b Binary files /dev/null and b/nwnds_module/tyr_cw_flins.git differ diff --git a/nwnds_module/tyr_cw_goldinix.are b/nwnds_module/tyr_cw_goldinix.are new file mode 100644 index 000000000..f49c410d8 Binary files /dev/null and b/nwnds_module/tyr_cw_goldinix.are differ diff --git a/nwnds_module/tyr_cw_goldinix.gic b/nwnds_module/tyr_cw_goldinix.gic new file mode 100644 index 000000000..a80b47d0c Binary files /dev/null and b/nwnds_module/tyr_cw_goldinix.gic differ diff --git a/nwnds_module/tyr_cw_goldinix.git b/nwnds_module/tyr_cw_goldinix.git new file mode 100644 index 000000000..63a2596cb Binary files /dev/null and b/nwnds_module/tyr_cw_goldinix.git differ diff --git a/nwnds_module/tyr_cw_griks.are b/nwnds_module/tyr_cw_griks.are new file mode 100644 index 000000000..593314b51 Binary files /dev/null and b/nwnds_module/tyr_cw_griks.are differ diff --git a/nwnds_module/tyr_cw_griks.gic b/nwnds_module/tyr_cw_griks.gic new file mode 100644 index 000000000..828bbe648 Binary files /dev/null and b/nwnds_module/tyr_cw_griks.gic differ diff --git a/nwnds_module/tyr_cw_griks.git b/nwnds_module/tyr_cw_griks.git new file mode 100644 index 000000000..490cbac2f Binary files /dev/null and b/nwnds_module/tyr_cw_griks.git differ diff --git a/nwnds_module/tyr_cw_hallhonor.are b/nwnds_module/tyr_cw_hallhonor.are new file mode 100644 index 000000000..115ffef8e Binary files /dev/null and b/nwnds_module/tyr_cw_hallhonor.are differ diff --git a/nwnds_module/tyr_cw_hallhonor.gic b/nwnds_module/tyr_cw_hallhonor.gic new file mode 100644 index 000000000..87822a9b5 Binary files /dev/null and b/nwnds_module/tyr_cw_hallhonor.gic differ diff --git a/nwnds_module/tyr_cw_hallhonor.git b/nwnds_module/tyr_cw_hallhonor.git new file mode 100644 index 000000000..61323dcf3 Binary files /dev/null and b/nwnds_module/tyr_cw_hallhonor.git differ diff --git a/nwnds_module/tyr_cw_healer.are b/nwnds_module/tyr_cw_healer.are new file mode 100644 index 000000000..ac989d311 Binary files /dev/null and b/nwnds_module/tyr_cw_healer.are differ diff --git a/nwnds_module/tyr_cw_healer.gic b/nwnds_module/tyr_cw_healer.gic new file mode 100644 index 000000000..e0cf77740 Binary files /dev/null and b/nwnds_module/tyr_cw_healer.gic differ diff --git a/nwnds_module/tyr_cw_healer.git b/nwnds_module/tyr_cw_healer.git new file mode 100644 index 000000000..e7a8d5b0c Binary files /dev/null and b/nwnds_module/tyr_cw_healer.git differ diff --git a/nwnds_module/tyr_cw_hospital.are b/nwnds_module/tyr_cw_hospital.are new file mode 100644 index 000000000..954037491 Binary files /dev/null and b/nwnds_module/tyr_cw_hospital.are differ diff --git a/nwnds_module/tyr_cw_hospital.gic b/nwnds_module/tyr_cw_hospital.gic new file mode 100644 index 000000000..a7a7ce6ac Binary files /dev/null and b/nwnds_module/tyr_cw_hospital.gic differ diff --git a/nwnds_module/tyr_cw_hospital.git b/nwnds_module/tyr_cw_hospital.git new file mode 100644 index 000000000..c36152e41 Binary files /dev/null and b/nwnds_module/tyr_cw_hospital.git differ diff --git a/nwnds_module/tyr_cw_jail.are b/nwnds_module/tyr_cw_jail.are new file mode 100644 index 000000000..0201a391a Binary files /dev/null and b/nwnds_module/tyr_cw_jail.are differ diff --git a/nwnds_module/tyr_cw_jail.gic b/nwnds_module/tyr_cw_jail.gic new file mode 100644 index 000000000..f248cce1b Binary files /dev/null and b/nwnds_module/tyr_cw_jail.gic differ diff --git a/nwnds_module/tyr_cw_jail.git b/nwnds_module/tyr_cw_jail.git new file mode 100644 index 000000000..c0c26172b Binary files /dev/null and b/nwnds_module/tyr_cw_jail.git differ diff --git a/nwnds_module/tyr_cw_morgue.are b/nwnds_module/tyr_cw_morgue.are new file mode 100644 index 000000000..0316261c2 Binary files /dev/null and b/nwnds_module/tyr_cw_morgue.are differ diff --git a/nwnds_module/tyr_cw_morgue.gic b/nwnds_module/tyr_cw_morgue.gic new file mode 100644 index 000000000..3f032bcc8 Binary files /dev/null and b/nwnds_module/tyr_cw_morgue.gic differ diff --git a/nwnds_module/tyr_cw_morgue.git b/nwnds_module/tyr_cw_morgue.git new file mode 100644 index 000000000..cfcc60375 Binary files /dev/null and b/nwnds_module/tyr_cw_morgue.git differ diff --git a/nwnds_module/tyr_cw_potter.are b/nwnds_module/tyr_cw_potter.are new file mode 100644 index 000000000..a64c1c958 Binary files /dev/null and b/nwnds_module/tyr_cw_potter.are differ diff --git a/nwnds_module/tyr_cw_potter.gic b/nwnds_module/tyr_cw_potter.gic new file mode 100644 index 000000000..8a373d64f Binary files /dev/null and b/nwnds_module/tyr_cw_potter.gic differ diff --git a/nwnds_module/tyr_cw_potter.git b/nwnds_module/tyr_cw_potter.git new file mode 100644 index 000000000..fada7f1e0 Binary files /dev/null and b/nwnds_module/tyr_cw_potter.git differ diff --git a/nwnds_module/tyr_cw_pratas.are b/nwnds_module/tyr_cw_pratas.are new file mode 100644 index 000000000..27ccff384 Binary files /dev/null and b/nwnds_module/tyr_cw_pratas.are differ diff --git a/nwnds_module/tyr_cw_pratas.gic b/nwnds_module/tyr_cw_pratas.gic new file mode 100644 index 000000000..fe6db03ce Binary files /dev/null and b/nwnds_module/tyr_cw_pratas.gic differ diff --git a/nwnds_module/tyr_cw_pratas.git b/nwnds_module/tyr_cw_pratas.git new file mode 100644 index 000000000..323e32021 Binary files /dev/null and b/nwnds_module/tyr_cw_pratas.git differ diff --git a/nwnds_module/tyr_cw_rolins.are b/nwnds_module/tyr_cw_rolins.are new file mode 100644 index 000000000..a7b6d173f Binary files /dev/null and b/nwnds_module/tyr_cw_rolins.are differ diff --git a/nwnds_module/tyr_cw_rolins.gic b/nwnds_module/tyr_cw_rolins.gic new file mode 100644 index 000000000..a33cf48ee Binary files /dev/null and b/nwnds_module/tyr_cw_rolins.gic differ diff --git a/nwnds_module/tyr_cw_rolins.git b/nwnds_module/tyr_cw_rolins.git new file mode 100644 index 000000000..9e47375b4 Binary files /dev/null and b/nwnds_module/tyr_cw_rolins.git differ diff --git a/nwnds_module/tyr_cw_scribe.are b/nwnds_module/tyr_cw_scribe.are new file mode 100644 index 000000000..74e896ee7 Binary files /dev/null and b/nwnds_module/tyr_cw_scribe.are differ diff --git a/nwnds_module/tyr_cw_scribe.gic b/nwnds_module/tyr_cw_scribe.gic new file mode 100644 index 000000000..c2140cccd Binary files /dev/null and b/nwnds_module/tyr_cw_scribe.gic differ diff --git a/nwnds_module/tyr_cw_scribe.git b/nwnds_module/tyr_cw_scribe.git new file mode 100644 index 000000000..dc8929d17 Binary files /dev/null and b/nwnds_module/tyr_cw_scribe.git differ diff --git a/nwnds_module/tyr_cw_shinsands.are b/nwnds_module/tyr_cw_shinsands.are new file mode 100644 index 000000000..bb9b5ce77 Binary files /dev/null and b/nwnds_module/tyr_cw_shinsands.are differ diff --git a/nwnds_module/tyr_cw_shinsands.gic b/nwnds_module/tyr_cw_shinsands.gic new file mode 100644 index 000000000..c985746f5 Binary files /dev/null and b/nwnds_module/tyr_cw_shinsands.gic differ diff --git a/nwnds_module/tyr_cw_shinsands.git b/nwnds_module/tyr_cw_shinsands.git new file mode 100644 index 000000000..0879c49cc Binary files /dev/null and b/nwnds_module/tyr_cw_shinsands.git differ diff --git a/nwnds_module/tyr_cw_tarills.are b/nwnds_module/tyr_cw_tarills.are new file mode 100644 index 000000000..305bd7d9e Binary files /dev/null and b/nwnds_module/tyr_cw_tarills.are differ diff --git a/nwnds_module/tyr_cw_tarills.gic b/nwnds_module/tyr_cw_tarills.gic new file mode 100644 index 000000000..e0cba9b6f Binary files /dev/null and b/nwnds_module/tyr_cw_tarills.gic differ diff --git a/nwnds_module/tyr_cw_tarills.git b/nwnds_module/tyr_cw_tarills.git new file mode 100644 index 000000000..87c829072 Binary files /dev/null and b/nwnds_module/tyr_cw_tarills.git differ diff --git a/nwnds_module/tyr_cw_treasurer.are b/nwnds_module/tyr_cw_treasurer.are new file mode 100644 index 000000000..fb8d48aa3 Binary files /dev/null and b/nwnds_module/tyr_cw_treasurer.are differ diff --git a/nwnds_module/tyr_cw_treasurer.gic b/nwnds_module/tyr_cw_treasurer.gic new file mode 100644 index 000000000..d2bc55e7a Binary files /dev/null and b/nwnds_module/tyr_cw_treasurer.gic differ diff --git a/nwnds_module/tyr_cw_treasurer.git b/nwnds_module/tyr_cw_treasurer.git new file mode 100644 index 000000000..05417f4d3 Binary files /dev/null and b/nwnds_module/tyr_cw_treasurer.git differ diff --git a/nwnds_module/tyr_cw_tsarlas.are b/nwnds_module/tyr_cw_tsarlas.are new file mode 100644 index 000000000..a3a5776e9 Binary files /dev/null and b/nwnds_module/tyr_cw_tsarlas.are differ diff --git a/nwnds_module/tyr_cw_tsarlas.gic b/nwnds_module/tyr_cw_tsarlas.gic new file mode 100644 index 000000000..39f95708e Binary files /dev/null and b/nwnds_module/tyr_cw_tsarlas.gic differ diff --git a/nwnds_module/tyr_cw_tsarlas.git b/nwnds_module/tyr_cw_tsarlas.git new file mode 100644 index 000000000..ea2e7a95c Binary files /dev/null and b/nwnds_module/tyr_cw_tsarlas.git differ diff --git a/nwnds_module/tyr_cw_umiautus.are b/nwnds_module/tyr_cw_umiautus.are new file mode 100644 index 000000000..242795258 Binary files /dev/null and b/nwnds_module/tyr_cw_umiautus.are differ diff --git a/nwnds_module/tyr_cw_umiautus.gic b/nwnds_module/tyr_cw_umiautus.gic new file mode 100644 index 000000000..bab825a06 Binary files /dev/null and b/nwnds_module/tyr_cw_umiautus.gic differ diff --git a/nwnds_module/tyr_cw_umiautus.git b/nwnds_module/tyr_cw_umiautus.git new file mode 100644 index 000000000..2663a6eda Binary files /dev/null and b/nwnds_module/tyr_cw_umiautus.git differ diff --git a/nwnds_module/tyr_cw_weaver.are b/nwnds_module/tyr_cw_weaver.are new file mode 100644 index 000000000..29e0b01b7 Binary files /dev/null and b/nwnds_module/tyr_cw_weaver.are differ diff --git a/nwnds_module/tyr_cw_weaver.gic b/nwnds_module/tyr_cw_weaver.gic new file mode 100644 index 000000000..3599ee773 Binary files /dev/null and b/nwnds_module/tyr_cw_weaver.gic differ diff --git a/nwnds_module/tyr_cw_weaver.git b/nwnds_module/tyr_cw_weaver.git new file mode 100644 index 000000000..51bc5b38b Binary files /dev/null and b/nwnds_module/tyr_cw_weaver.git differ diff --git a/nwnds_module/tyr_fields.are b/nwnds_module/tyr_fields.are new file mode 100644 index 000000000..4b06d5fb7 Binary files /dev/null and b/nwnds_module/tyr_fields.are differ diff --git a/nwnds_module/tyr_fields.gic b/nwnds_module/tyr_fields.gic new file mode 100644 index 000000000..cc48459ba Binary files /dev/null and b/nwnds_module/tyr_fields.gic differ diff --git a/nwnds_module/tyr_fields.git b/nwnds_module/tyr_fields.git new file mode 100644 index 000000000..7fc51ddf3 Binary files /dev/null and b/nwnds_module/tyr_fields.git differ diff --git a/nwnds_module/tyr_fields_cellr.are b/nwnds_module/tyr_fields_cellr.are new file mode 100644 index 000000000..908c62337 Binary files /dev/null and b/nwnds_module/tyr_fields_cellr.are differ diff --git a/nwnds_module/tyr_fields_cellr.gic b/nwnds_module/tyr_fields_cellr.gic new file mode 100644 index 000000000..5ac6d44ff Binary files /dev/null and b/nwnds_module/tyr_fields_cellr.gic differ diff --git a/nwnds_module/tyr_fields_cellr.git b/nwnds_module/tyr_fields_cellr.git new file mode 100644 index 000000000..396f479b6 Binary files /dev/null and b/nwnds_module/tyr_fields_cellr.git differ diff --git a/nwnds_module/tyr_fields_pas.are b/nwnds_module/tyr_fields_pas.are new file mode 100644 index 000000000..fecb1d5b8 Binary files /dev/null and b/nwnds_module/tyr_fields_pas.are differ diff --git a/nwnds_module/tyr_fields_pas.gic b/nwnds_module/tyr_fields_pas.gic new file mode 100644 index 000000000..fe4c56156 Binary files /dev/null and b/nwnds_module/tyr_fields_pas.gic differ diff --git a/nwnds_module/tyr_fields_pas.git b/nwnds_module/tyr_fields_pas.git new file mode 100644 index 000000000..d85c66367 Binary files /dev/null and b/nwnds_module/tyr_fields_pas.git differ diff --git a/nwnds_module/tyr_gc_goldcity.are b/nwnds_module/tyr_gc_goldcity.are new file mode 100644 index 000000000..edbf1a409 Binary files /dev/null and b/nwnds_module/tyr_gc_goldcity.are differ diff --git a/nwnds_module/tyr_gc_goldcity.gic b/nwnds_module/tyr_gc_goldcity.gic new file mode 100644 index 000000000..32ece132d Binary files /dev/null and b/nwnds_module/tyr_gc_goldcity.gic differ diff --git a/nwnds_module/tyr_gc_goldcity.git b/nwnds_module/tyr_gc_goldcity.git new file mode 100644 index 000000000..469833e3c Binary files /dev/null and b/nwnds_module/tyr_gc_goldcity.git differ diff --git a/nwnds_module/tyr_gs_arena.are b/nwnds_module/tyr_gs_arena.are new file mode 100644 index 000000000..0606a3fa3 Binary files /dev/null and b/nwnds_module/tyr_gs_arena.are differ diff --git a/nwnds_module/tyr_gs_arena.gic b/nwnds_module/tyr_gs_arena.gic new file mode 100644 index 000000000..f854cfa08 Binary files /dev/null and b/nwnds_module/tyr_gs_arena.gic differ diff --git a/nwnds_module/tyr_gs_arena.git b/nwnds_module/tyr_gs_arena.git new file mode 100644 index 000000000..f6bd22ab1 Binary files /dev/null and b/nwnds_module/tyr_gs_arena.git differ diff --git a/nwnds_module/tyr_gs_foyer.are b/nwnds_module/tyr_gs_foyer.are new file mode 100644 index 000000000..b60448839 Binary files /dev/null and b/nwnds_module/tyr_gs_foyer.are differ diff --git a/nwnds_module/tyr_gs_foyer.gic b/nwnds_module/tyr_gs_foyer.gic new file mode 100644 index 000000000..b84a69f8b Binary files /dev/null and b/nwnds_module/tyr_gs_foyer.gic differ diff --git a/nwnds_module/tyr_gs_foyer.git b/nwnds_module/tyr_gs_foyer.git new file mode 100644 index 000000000..41ce5c9ba Binary files /dev/null and b/nwnds_module/tyr_gs_foyer.git differ diff --git a/nwnds_module/tyr_ironmines01.are b/nwnds_module/tyr_ironmines01.are new file mode 100644 index 000000000..34ce61279 Binary files /dev/null and b/nwnds_module/tyr_ironmines01.are differ diff --git a/nwnds_module/tyr_ironmines01.gic b/nwnds_module/tyr_ironmines01.gic new file mode 100644 index 000000000..68de9e361 Binary files /dev/null and b/nwnds_module/tyr_ironmines01.gic differ diff --git a/nwnds_module/tyr_ironmines01.git b/nwnds_module/tyr_ironmines01.git new file mode 100644 index 000000000..6dae1efd7 Binary files /dev/null and b/nwnds_module/tyr_ironmines01.git differ diff --git a/nwnds_module/tyr_ironmines02.are b/nwnds_module/tyr_ironmines02.are new file mode 100644 index 000000000..3efaeaaca Binary files /dev/null and b/nwnds_module/tyr_ironmines02.are differ diff --git a/nwnds_module/tyr_ironmines02.gic b/nwnds_module/tyr_ironmines02.gic new file mode 100644 index 000000000..31e7de712 Binary files /dev/null and b/nwnds_module/tyr_ironmines02.gic differ diff --git a/nwnds_module/tyr_ironmines02.git b/nwnds_module/tyr_ironmines02.git new file mode 100644 index 000000000..c2cbf3f29 Binary files /dev/null and b/nwnds_module/tyr_ironmines02.git differ diff --git a/nwnds_module/tyr_ironroad.are b/nwnds_module/tyr_ironroad.are new file mode 100644 index 000000000..fb065a2d5 Binary files /dev/null and b/nwnds_module/tyr_ironroad.are differ diff --git a/nwnds_module/tyr_ironroad.gic b/nwnds_module/tyr_ironroad.gic new file mode 100644 index 000000000..200b0caaa Binary files /dev/null and b/nwnds_module/tyr_ironroad.gic differ diff --git a/nwnds_module/tyr_ironroad.git b/nwnds_module/tyr_ironroad.git new file mode 100644 index 000000000..024695ab6 Binary files /dev/null and b/nwnds_module/tyr_ironroad.git differ diff --git a/nwnds_module/tyr_kingsgardens.are b/nwnds_module/tyr_kingsgardens.are new file mode 100644 index 000000000..7d3c0d06e Binary files /dev/null and b/nwnds_module/tyr_kingsgardens.are differ diff --git a/nwnds_module/tyr_kingsgardens.gic b/nwnds_module/tyr_kingsgardens.gic new file mode 100644 index 000000000..29b118deb Binary files /dev/null and b/nwnds_module/tyr_kingsgardens.gic differ diff --git a/nwnds_module/tyr_kingsgardens.git b/nwnds_module/tyr_kingsgardens.git new file mode 100644 index 000000000..f0c7f4cde Binary files /dev/null and b/nwnds_module/tyr_kingsgardens.git differ diff --git a/nwnds_module/tyr_md_bakery.are b/nwnds_module/tyr_md_bakery.are new file mode 100644 index 000000000..902ca51dc Binary files /dev/null and b/nwnds_module/tyr_md_bakery.are differ diff --git a/nwnds_module/tyr_md_bakery.gic b/nwnds_module/tyr_md_bakery.gic new file mode 100644 index 000000000..483a33d34 Binary files /dev/null and b/nwnds_module/tyr_md_bakery.gic differ diff --git a/nwnds_module/tyr_md_bakery.git b/nwnds_module/tyr_md_bakery.git new file mode 100644 index 000000000..463e4fd9d Binary files /dev/null and b/nwnds_module/tyr_md_bakery.git differ diff --git a/nwnds_module/tyr_md_bathhouse.are b/nwnds_module/tyr_md_bathhouse.are new file mode 100644 index 000000000..657fbc575 Binary files /dev/null and b/nwnds_module/tyr_md_bathhouse.are differ diff --git a/nwnds_module/tyr_md_bathhouse.gic b/nwnds_module/tyr_md_bathhouse.gic new file mode 100644 index 000000000..13e26c872 Binary files /dev/null and b/nwnds_module/tyr_md_bathhouse.gic differ diff --git a/nwnds_module/tyr_md_bathhouse.git b/nwnds_module/tyr_md_bathhouse.git new file mode 100644 index 000000000..0024f318f Binary files /dev/null and b/nwnds_module/tyr_md_bathhouse.git differ diff --git a/nwnds_module/tyr_md_fullflag.are b/nwnds_module/tyr_md_fullflag.are new file mode 100644 index 000000000..a3e2a253e Binary files /dev/null and b/nwnds_module/tyr_md_fullflag.are differ diff --git a/nwnds_module/tyr_md_fullflag.gic b/nwnds_module/tyr_md_fullflag.gic new file mode 100644 index 000000000..dda886a14 Binary files /dev/null and b/nwnds_module/tyr_md_fullflag.gic differ diff --git a/nwnds_module/tyr_md_fullflag.git b/nwnds_module/tyr_md_fullflag.git new file mode 100644 index 000000000..59e06a835 Binary files /dev/null and b/nwnds_module/tyr_md_fullflag.git differ diff --git a/nwnds_module/tyr_md_gearys01.are b/nwnds_module/tyr_md_gearys01.are new file mode 100644 index 000000000..bbaff71c3 Binary files /dev/null and b/nwnds_module/tyr_md_gearys01.are differ diff --git a/nwnds_module/tyr_md_gearys01.gic b/nwnds_module/tyr_md_gearys01.gic new file mode 100644 index 000000000..9068c7561 Binary files /dev/null and b/nwnds_module/tyr_md_gearys01.gic differ diff --git a/nwnds_module/tyr_md_gearys01.git b/nwnds_module/tyr_md_gearys01.git new file mode 100644 index 000000000..22e14aa84 Binary files /dev/null and b/nwnds_module/tyr_md_gearys01.git differ diff --git a/nwnds_module/tyr_md_gearys02.are b/nwnds_module/tyr_md_gearys02.are new file mode 100644 index 000000000..ae6f24fdd Binary files /dev/null and b/nwnds_module/tyr_md_gearys02.are differ diff --git a/nwnds_module/tyr_md_gearys02.gic b/nwnds_module/tyr_md_gearys02.gic new file mode 100644 index 000000000..eb93046a0 Binary files /dev/null and b/nwnds_module/tyr_md_gearys02.gic differ diff --git a/nwnds_module/tyr_md_gearys02.git b/nwnds_module/tyr_md_gearys02.git new file mode 100644 index 000000000..7c6fd0f0e Binary files /dev/null and b/nwnds_module/tyr_md_gearys02.git differ diff --git a/nwnds_module/tyr_md_gimpys.are b/nwnds_module/tyr_md_gimpys.are new file mode 100644 index 000000000..dfcd3553e Binary files /dev/null and b/nwnds_module/tyr_md_gimpys.are differ diff --git a/nwnds_module/tyr_md_gimpys.gic b/nwnds_module/tyr_md_gimpys.gic new file mode 100644 index 000000000..9068c7561 Binary files /dev/null and b/nwnds_module/tyr_md_gimpys.gic differ diff --git a/nwnds_module/tyr_md_gimpys.git b/nwnds_module/tyr_md_gimpys.git new file mode 100644 index 000000000..9142b7148 Binary files /dev/null and b/nwnds_module/tyr_md_gimpys.git differ diff --git a/nwnds_module/tyr_md_houseshom.are b/nwnds_module/tyr_md_houseshom.are new file mode 100644 index 000000000..497a49847 Binary files /dev/null and b/nwnds_module/tyr_md_houseshom.are differ diff --git a/nwnds_module/tyr_md_houseshom.gic b/nwnds_module/tyr_md_houseshom.gic new file mode 100644 index 000000000..fbcdf4546 Binary files /dev/null and b/nwnds_module/tyr_md_houseshom.gic differ diff --git a/nwnds_module/tyr_md_houseshom.git b/nwnds_module/tyr_md_houseshom.git new file mode 100644 index 000000000..4c119b023 Binary files /dev/null and b/nwnds_module/tyr_md_houseshom.git differ diff --git a/nwnds_module/tyr_md_katjanas.are b/nwnds_module/tyr_md_katjanas.are new file mode 100644 index 000000000..464125128 Binary files /dev/null and b/nwnds_module/tyr_md_katjanas.are differ diff --git a/nwnds_module/tyr_md_katjanas.gic b/nwnds_module/tyr_md_katjanas.gic new file mode 100644 index 000000000..75d484c37 Binary files /dev/null and b/nwnds_module/tyr_md_katjanas.gic differ diff --git a/nwnds_module/tyr_md_katjanas.git b/nwnds_module/tyr_md_katjanas.git new file mode 100644 index 000000000..d49695a39 Binary files /dev/null and b/nwnds_module/tyr_md_katjanas.git differ diff --git a/nwnds_module/tyr_md_magdas.are b/nwnds_module/tyr_md_magdas.are new file mode 100644 index 000000000..206cfa5e6 Binary files /dev/null and b/nwnds_module/tyr_md_magdas.are differ diff --git a/nwnds_module/tyr_md_magdas.gic b/nwnds_module/tyr_md_magdas.gic new file mode 100644 index 000000000..f034c39a9 Binary files /dev/null and b/nwnds_module/tyr_md_magdas.gic differ diff --git a/nwnds_module/tyr_md_magdas.git b/nwnds_module/tyr_md_magdas.git new file mode 100644 index 000000000..1f697515c Binary files /dev/null and b/nwnds_module/tyr_md_magdas.git differ diff --git a/nwnds_module/tyr_md_plutes.are b/nwnds_module/tyr_md_plutes.are new file mode 100644 index 000000000..22d5f8b13 Binary files /dev/null and b/nwnds_module/tyr_md_plutes.are differ diff --git a/nwnds_module/tyr_md_plutes.gic b/nwnds_module/tyr_md_plutes.gic new file mode 100644 index 000000000..eb93046a0 Binary files /dev/null and b/nwnds_module/tyr_md_plutes.gic differ diff --git a/nwnds_module/tyr_md_plutes.git b/nwnds_module/tyr_md_plutes.git new file mode 100644 index 000000000..b9abe74b2 Binary files /dev/null and b/nwnds_module/tyr_md_plutes.git differ diff --git a/nwnds_module/tyr_md_saltmill1.are b/nwnds_module/tyr_md_saltmill1.are new file mode 100644 index 000000000..148170853 Binary files /dev/null and b/nwnds_module/tyr_md_saltmill1.are differ diff --git a/nwnds_module/tyr_md_saltmill1.gic b/nwnds_module/tyr_md_saltmill1.gic new file mode 100644 index 000000000..f6a8cb17e Binary files /dev/null and b/nwnds_module/tyr_md_saltmill1.gic differ diff --git a/nwnds_module/tyr_md_saltmill1.git b/nwnds_module/tyr_md_saltmill1.git new file mode 100644 index 000000000..5830a252f Binary files /dev/null and b/nwnds_module/tyr_md_saltmill1.git differ diff --git a/nwnds_module/tyr_md_saltmill2.are b/nwnds_module/tyr_md_saltmill2.are new file mode 100644 index 000000000..7ad54141f Binary files /dev/null and b/nwnds_module/tyr_md_saltmill2.are differ diff --git a/nwnds_module/tyr_md_saltmill2.gic b/nwnds_module/tyr_md_saltmill2.gic new file mode 100644 index 000000000..9068c7561 Binary files /dev/null and b/nwnds_module/tyr_md_saltmill2.gic differ diff --git a/nwnds_module/tyr_md_saltmill2.git b/nwnds_module/tyr_md_saltmill2.git new file mode 100644 index 000000000..fbdf91274 Binary files /dev/null and b/nwnds_module/tyr_md_saltmill2.git differ diff --git a/nwnds_module/tyr_md_sitlounge.are b/nwnds_module/tyr_md_sitlounge.are new file mode 100644 index 000000000..c04f56aa8 Binary files /dev/null and b/nwnds_module/tyr_md_sitlounge.are differ diff --git a/nwnds_module/tyr_md_sitlounge.gic b/nwnds_module/tyr_md_sitlounge.gic new file mode 100644 index 000000000..d4c6b0fe9 Binary files /dev/null and b/nwnds_module/tyr_md_sitlounge.gic differ diff --git a/nwnds_module/tyr_md_sitlounge.git b/nwnds_module/tyr_md_sitlounge.git new file mode 100644 index 000000000..8a6570a67 Binary files /dev/null and b/nwnds_module/tyr_md_sitlounge.git differ diff --git a/nwnds_module/tyr_md_theladle.are b/nwnds_module/tyr_md_theladle.are new file mode 100644 index 000000000..ee92e2e50 Binary files /dev/null and b/nwnds_module/tyr_md_theladle.are differ diff --git a/nwnds_module/tyr_md_theladle.gic b/nwnds_module/tyr_md_theladle.gic new file mode 100644 index 000000000..4409c5742 Binary files /dev/null and b/nwnds_module/tyr_md_theladle.gic differ diff --git a/nwnds_module/tyr_md_theladle.git b/nwnds_module/tyr_md_theladle.git new file mode 100644 index 000000000..1dd7138ed Binary files /dev/null and b/nwnds_module/tyr_md_theladle.git differ diff --git a/nwnds_module/tyr_md_themill.are b/nwnds_module/tyr_md_themill.are new file mode 100644 index 000000000..d7f47f2a2 Binary files /dev/null and b/nwnds_module/tyr_md_themill.are differ diff --git a/nwnds_module/tyr_md_themill.gic b/nwnds_module/tyr_md_themill.gic new file mode 100644 index 000000000..f6a8cb17e Binary files /dev/null and b/nwnds_module/tyr_md_themill.gic differ diff --git a/nwnds_module/tyr_md_themill.git b/nwnds_module/tyr_md_themill.git new file mode 100644 index 000000000..3f0123de2 Binary files /dev/null and b/nwnds_module/tyr_md_themill.git differ diff --git a/nwnds_module/tyr_md_weaver.are b/nwnds_module/tyr_md_weaver.are new file mode 100644 index 000000000..4ddf7a1d1 Binary files /dev/null and b/nwnds_module/tyr_md_weaver.are differ diff --git a/nwnds_module/tyr_md_weaver.gic b/nwnds_module/tyr_md_weaver.gic new file mode 100644 index 000000000..9d76f96dd Binary files /dev/null and b/nwnds_module/tyr_md_weaver.gic differ diff --git a/nwnds_module/tyr_md_weaver.git b/nwnds_module/tyr_md_weaver.git new file mode 100644 index 000000000..eff5c838e Binary files /dev/null and b/nwnds_module/tyr_md_weaver.git differ diff --git a/nwnds_module/tyr_merchantdist.are b/nwnds_module/tyr_merchantdist.are new file mode 100644 index 000000000..9d29494a2 Binary files /dev/null and b/nwnds_module/tyr_merchantdist.are differ diff --git a/nwnds_module/tyr_merchantdist.gic b/nwnds_module/tyr_merchantdist.gic new file mode 100644 index 000000000..00c614180 Binary files /dev/null and b/nwnds_module/tyr_merchantdist.gic differ diff --git a/nwnds_module/tyr_merchantdist.git b/nwnds_module/tyr_merchantdist.git new file mode 100644 index 000000000..87ce031b5 Binary files /dev/null and b/nwnds_module/tyr_merchantdist.git differ diff --git a/nwnds_module/tyr_nqe_hse_berr.are b/nwnds_module/tyr_nqe_hse_berr.are new file mode 100644 index 000000000..66e7c1841 Binary files /dev/null and b/nwnds_module/tyr_nqe_hse_berr.are differ diff --git a/nwnds_module/tyr_nqe_hse_berr.gic b/nwnds_module/tyr_nqe_hse_berr.gic new file mode 100644 index 000000000..c5debf32e Binary files /dev/null and b/nwnds_module/tyr_nqe_hse_berr.gic differ diff --git a/nwnds_module/tyr_nqe_hse_berr.git b/nwnds_module/tyr_nqe_hse_berr.git new file mode 100644 index 000000000..1366634f3 Binary files /dev/null and b/nwnds_module/tyr_nqe_hse_berr.git differ diff --git a/nwnds_module/tyr_nqe_nobqrt_e.are b/nwnds_module/tyr_nqe_nobqrt_e.are new file mode 100644 index 000000000..77617864e Binary files /dev/null and b/nwnds_module/tyr_nqe_nobqrt_e.are differ diff --git a/nwnds_module/tyr_nqe_nobqrt_e.gic b/nwnds_module/tyr_nqe_nobqrt_e.gic new file mode 100644 index 000000000..5d22fd9fc Binary files /dev/null and b/nwnds_module/tyr_nqe_nobqrt_e.gic differ diff --git a/nwnds_module/tyr_nqe_nobqrt_e.git b/nwnds_module/tyr_nqe_nobqrt_e.git new file mode 100644 index 000000000..9cfcfbe58 Binary files /dev/null and b/nwnds_module/tyr_nqe_nobqrt_e.git differ diff --git a/nwnds_module/tyr_nqw_aban_hse.are b/nwnds_module/tyr_nqw_aban_hse.are new file mode 100644 index 000000000..cc18d4d7a Binary files /dev/null and b/nwnds_module/tyr_nqw_aban_hse.are differ diff --git a/nwnds_module/tyr_nqw_aban_hse.gic b/nwnds_module/tyr_nqw_aban_hse.gic new file mode 100644 index 000000000..6fc2246d4 Binary files /dev/null and b/nwnds_module/tyr_nqw_aban_hse.gic differ diff --git a/nwnds_module/tyr_nqw_aban_hse.git b/nwnds_module/tyr_nqw_aban_hse.git new file mode 100644 index 000000000..7dcd5ea6a Binary files /dev/null and b/nwnds_module/tyr_nqw_aban_hse.git differ diff --git a/nwnds_module/tyr_nqw_aldarath.are b/nwnds_module/tyr_nqw_aldarath.are new file mode 100644 index 000000000..6f198bc29 Binary files /dev/null and b/nwnds_module/tyr_nqw_aldarath.are differ diff --git a/nwnds_module/tyr_nqw_aldarath.gic b/nwnds_module/tyr_nqw_aldarath.gic new file mode 100644 index 000000000..cd58a33f9 Binary files /dev/null and b/nwnds_module/tyr_nqw_aldarath.gic differ diff --git a/nwnds_module/tyr_nqw_aldarath.git b/nwnds_module/tyr_nqw_aldarath.git new file mode 100644 index 000000000..2addc2279 Binary files /dev/null and b/nwnds_module/tyr_nqw_aldarath.git differ diff --git a/nwnds_module/tyr_nqw_dpravity.are b/nwnds_module/tyr_nqw_dpravity.are new file mode 100644 index 000000000..0a722e89e Binary files /dev/null and b/nwnds_module/tyr_nqw_dpravity.are differ diff --git a/nwnds_module/tyr_nqw_dpravity.gic b/nwnds_module/tyr_nqw_dpravity.gic new file mode 100644 index 000000000..270edf9c7 Binary files /dev/null and b/nwnds_module/tyr_nqw_dpravity.gic differ diff --git a/nwnds_module/tyr_nqw_dpravity.git b/nwnds_module/tyr_nqw_dpravity.git new file mode 100644 index 000000000..00792950e Binary files /dev/null and b/nwnds_module/tyr_nqw_dpravity.git differ diff --git a/nwnds_module/tyr_nqw_jadejozh.are b/nwnds_module/tyr_nqw_jadejozh.are new file mode 100644 index 000000000..ebca30ab6 Binary files /dev/null and b/nwnds_module/tyr_nqw_jadejozh.are differ diff --git a/nwnds_module/tyr_nqw_jadejozh.gic b/nwnds_module/tyr_nqw_jadejozh.gic new file mode 100644 index 000000000..dca6e7c8f Binary files /dev/null and b/nwnds_module/tyr_nqw_jadejozh.gic differ diff --git a/nwnds_module/tyr_nqw_jadejozh.git b/nwnds_module/tyr_nqw_jadejozh.git new file mode 100644 index 000000000..a007bc859 Binary files /dev/null and b/nwnds_module/tyr_nqw_jadejozh.git differ diff --git a/nwnds_module/tyr_nqw_kyrianis.are b/nwnds_module/tyr_nqw_kyrianis.are new file mode 100644 index 000000000..0912c1bb9 Binary files /dev/null and b/nwnds_module/tyr_nqw_kyrianis.are differ diff --git a/nwnds_module/tyr_nqw_kyrianis.gic b/nwnds_module/tyr_nqw_kyrianis.gic new file mode 100644 index 000000000..5cb0b03da Binary files /dev/null and b/nwnds_module/tyr_nqw_kyrianis.gic differ diff --git a/nwnds_module/tyr_nqw_kyrianis.git b/nwnds_module/tyr_nqw_kyrianis.git new file mode 100644 index 000000000..871da40ff Binary files /dev/null and b/nwnds_module/tyr_nqw_kyrianis.git differ diff --git a/nwnds_module/tyr_nqw_nobqrt_w.are b/nwnds_module/tyr_nqw_nobqrt_w.are new file mode 100644 index 000000000..69bfcf1f9 Binary files /dev/null and b/nwnds_module/tyr_nqw_nobqrt_w.are differ diff --git a/nwnds_module/tyr_nqw_nobqrt_w.gic b/nwnds_module/tyr_nqw_nobqrt_w.gic new file mode 100644 index 000000000..f01c7ff78 Binary files /dev/null and b/nwnds_module/tyr_nqw_nobqrt_w.gic differ diff --git a/nwnds_module/tyr_nqw_nobqrt_w.git b/nwnds_module/tyr_nqw_nobqrt_w.git new file mode 100644 index 000000000..24e2ebfec Binary files /dev/null and b/nwnds_module/tyr_nqw_nobqrt_w.git differ diff --git a/nwnds_module/tyr_nqw_sndstone.are b/nwnds_module/tyr_nqw_sndstone.are new file mode 100644 index 000000000..c8d350678 Binary files /dev/null and b/nwnds_module/tyr_nqw_sndstone.are differ diff --git a/nwnds_module/tyr_nqw_sndstone.gic b/nwnds_module/tyr_nqw_sndstone.gic new file mode 100644 index 000000000..b0c4d1401 Binary files /dev/null and b/nwnds_module/tyr_nqw_sndstone.gic differ diff --git a/nwnds_module/tyr_nqw_sndstone.git b/nwnds_module/tyr_nqw_sndstone.git new file mode 100644 index 000000000..51d7af86c Binary files /dev/null and b/nwnds_module/tyr_nqw_sndstone.git differ diff --git a/nwnds_module/tyr_nqw_swtwater.are b/nwnds_module/tyr_nqw_swtwater.are new file mode 100644 index 000000000..08ff854c1 Binary files /dev/null and b/nwnds_module/tyr_nqw_swtwater.are differ diff --git a/nwnds_module/tyr_nqw_swtwater.gic b/nwnds_module/tyr_nqw_swtwater.gic new file mode 100644 index 000000000..536223958 Binary files /dev/null and b/nwnds_module/tyr_nqw_swtwater.gic differ diff --git a/nwnds_module/tyr_nqw_swtwater.git b/nwnds_module/tyr_nqw_swtwater.git new file mode 100644 index 000000000..08f6ad26c Binary files /dev/null and b/nwnds_module/tyr_nqw_swtwater.git differ diff --git a/nwnds_module/tyr_se_graveyard.are b/nwnds_module/tyr_se_graveyard.are new file mode 100644 index 000000000..7e0cd2bae Binary files /dev/null and b/nwnds_module/tyr_se_graveyard.are differ diff --git a/nwnds_module/tyr_se_graveyard.gic b/nwnds_module/tyr_se_graveyard.gic new file mode 100644 index 000000000..d3c3e10ba Binary files /dev/null and b/nwnds_module/tyr_se_graveyard.gic differ diff --git a/nwnds_module/tyr_se_graveyard.git b/nwnds_module/tyr_se_graveyard.git new file mode 100644 index 000000000..9ff313d39 Binary files /dev/null and b/nwnds_module/tyr_se_graveyard.git differ diff --git a/nwnds_module/tyr_se_masoleum.are b/nwnds_module/tyr_se_masoleum.are new file mode 100644 index 000000000..7724fa610 Binary files /dev/null and b/nwnds_module/tyr_se_masoleum.are differ diff --git a/nwnds_module/tyr_se_masoleum.gic b/nwnds_module/tyr_se_masoleum.gic new file mode 100644 index 000000000..9adb4a7db Binary files /dev/null and b/nwnds_module/tyr_se_masoleum.gic differ diff --git a/nwnds_module/tyr_se_masoleum.git b/nwnds_module/tyr_se_masoleum.git new file mode 100644 index 000000000..8049bce54 Binary files /dev/null and b/nwnds_module/tyr_se_masoleum.git differ diff --git a/nwnds_module/tyr_southexpanse.are b/nwnds_module/tyr_southexpanse.are new file mode 100644 index 000000000..53d5d2732 Binary files /dev/null and b/nwnds_module/tyr_southexpanse.are differ diff --git a/nwnds_module/tyr_southexpanse.gic b/nwnds_module/tyr_southexpanse.gic new file mode 100644 index 000000000..65815a192 Binary files /dev/null and b/nwnds_module/tyr_southexpanse.gic differ diff --git a/nwnds_module/tyr_southexpanse.git b/nwnds_module/tyr_southexpanse.git new file mode 100644 index 000000000..358c9b057 Binary files /dev/null and b/nwnds_module/tyr_southexpanse.git differ diff --git a/nwnds_module/tyr_theivesguild.are b/nwnds_module/tyr_theivesguild.are new file mode 100644 index 000000000..3d783174e Binary files /dev/null and b/nwnds_module/tyr_theivesguild.are differ diff --git a/nwnds_module/tyr_theivesguild.gic b/nwnds_module/tyr_theivesguild.gic new file mode 100644 index 000000000..bc3a3105d Binary files /dev/null and b/nwnds_module/tyr_theivesguild.gic differ diff --git a/nwnds_module/tyr_theivesguild.git b/nwnds_module/tyr_theivesguild.git new file mode 100644 index 000000000..f82cf0318 Binary files /dev/null and b/nwnds_module/tyr_theivesguild.git differ diff --git a/nwnds_module/tyr_tq_barracks.are b/nwnds_module/tyr_tq_barracks.are new file mode 100644 index 000000000..113b373c8 Binary files /dev/null and b/nwnds_module/tyr_tq_barracks.are differ diff --git a/nwnds_module/tyr_tq_barracks.gic b/nwnds_module/tyr_tq_barracks.gic new file mode 100644 index 000000000..7bcf5601a Binary files /dev/null and b/nwnds_module/tyr_tq_barracks.gic differ diff --git a/nwnds_module/tyr_tq_barracks.git b/nwnds_module/tyr_tq_barracks.git new file mode 100644 index 000000000..9a56eb378 Binary files /dev/null and b/nwnds_module/tyr_tq_barracks.git differ diff --git a/nwnds_module/tyr_tq_council.are b/nwnds_module/tyr_tq_council.are new file mode 100644 index 000000000..57c901fb1 Binary files /dev/null and b/nwnds_module/tyr_tq_council.are differ diff --git a/nwnds_module/tyr_tq_council.gic b/nwnds_module/tyr_tq_council.gic new file mode 100644 index 000000000..d2820fe9c Binary files /dev/null and b/nwnds_module/tyr_tq_council.gic differ diff --git a/nwnds_module/tyr_tq_council.git b/nwnds_module/tyr_tq_council.git new file mode 100644 index 000000000..2404247d9 Binary files /dev/null and b/nwnds_module/tyr_tq_council.git differ diff --git a/nwnds_module/tyr_tq_library.are b/nwnds_module/tyr_tq_library.are new file mode 100644 index 000000000..f38c86521 Binary files /dev/null and b/nwnds_module/tyr_tq_library.are differ diff --git a/nwnds_module/tyr_tq_library.gic b/nwnds_module/tyr_tq_library.gic new file mode 100644 index 000000000..ab23bbc71 Binary files /dev/null and b/nwnds_module/tyr_tq_library.gic differ diff --git a/nwnds_module/tyr_tq_library.git b/nwnds_module/tyr_tq_library.git new file mode 100644 index 000000000..08ca62c0f Binary files /dev/null and b/nwnds_module/tyr_tq_library.git differ diff --git a/nwnds_module/tyr_tq_school.are b/nwnds_module/tyr_tq_school.are new file mode 100644 index 000000000..840932d4e Binary files /dev/null and b/nwnds_module/tyr_tq_school.are differ diff --git a/nwnds_module/tyr_tq_school.gic b/nwnds_module/tyr_tq_school.gic new file mode 100644 index 000000000..295539e76 Binary files /dev/null and b/nwnds_module/tyr_tq_school.gic differ diff --git a/nwnds_module/tyr_tq_school.git b/nwnds_module/tyr_tq_school.git new file mode 100644 index 000000000..15d9edf7c Binary files /dev/null and b/nwnds_module/tyr_tq_school.git differ diff --git a/nwnds_module/tyr_tq_templarhq.are b/nwnds_module/tyr_tq_templarhq.are new file mode 100644 index 000000000..ed5e61f54 Binary files /dev/null and b/nwnds_module/tyr_tq_templarhq.are differ diff --git a/nwnds_module/tyr_tq_templarhq.gic b/nwnds_module/tyr_tq_templarhq.gic new file mode 100644 index 000000000..c93769146 Binary files /dev/null and b/nwnds_module/tyr_tq_templarhq.gic differ diff --git a/nwnds_module/tyr_tq_templarhq.git b/nwnds_module/tyr_tq_templarhq.git new file mode 100644 index 000000000..0199b20ab Binary files /dev/null and b/nwnds_module/tyr_tq_templarhq.git differ diff --git a/nwnds_module/tyr_tq_tempquart.are b/nwnds_module/tyr_tq_tempquart.are new file mode 100644 index 000000000..856bfc8b0 Binary files /dev/null and b/nwnds_module/tyr_tq_tempquart.are differ diff --git a/nwnds_module/tyr_tq_tempquart.gic b/nwnds_module/tyr_tq_tempquart.gic new file mode 100644 index 000000000..9677bde77 Binary files /dev/null and b/nwnds_module/tyr_tq_tempquart.gic differ diff --git a/nwnds_module/tyr_tq_tempquart.git b/nwnds_module/tyr_tq_tempquart.git new file mode 100644 index 000000000..a034db466 Binary files /dev/null and b/nwnds_module/tyr_tq_tempquart.git differ diff --git a/nwnds_module/tyr_tq_warehouse.are b/nwnds_module/tyr_tq_warehouse.are new file mode 100644 index 000000000..f54a219db Binary files /dev/null and b/nwnds_module/tyr_tq_warehouse.are differ diff --git a/nwnds_module/tyr_tq_warehouse.gic b/nwnds_module/tyr_tq_warehouse.gic new file mode 100644 index 000000000..790c5b05f Binary files /dev/null and b/nwnds_module/tyr_tq_warehouse.gic differ diff --git a/nwnds_module/tyr_tq_warehouse.git b/nwnds_module/tyr_tq_warehouse.git new file mode 100644 index 000000000..7f6069b4e Binary files /dev/null and b/nwnds_module/tyr_tq_warehouse.git differ diff --git a/nwnds_module/tyr_tq_yehinas.are b/nwnds_module/tyr_tq_yehinas.are new file mode 100644 index 000000000..627a6c8c2 Binary files /dev/null and b/nwnds_module/tyr_tq_yehinas.are differ diff --git a/nwnds_module/tyr_tq_yehinas.gic b/nwnds_module/tyr_tq_yehinas.gic new file mode 100644 index 000000000..82d52dc83 Binary files /dev/null and b/nwnds_module/tyr_tq_yehinas.gic differ diff --git a/nwnds_module/tyr_tq_yehinas.git b/nwnds_module/tyr_tq_yehinas.git new file mode 100644 index 000000000..877637e83 Binary files /dev/null and b/nwnds_module/tyr_tq_yehinas.git differ diff --git a/nwnds_module/tyr_w_abanhome.are b/nwnds_module/tyr_w_abanhome.are new file mode 100644 index 000000000..3018cd3d0 Binary files /dev/null and b/nwnds_module/tyr_w_abanhome.are differ diff --git a/nwnds_module/tyr_w_abanhome.gic b/nwnds_module/tyr_w_abanhome.gic new file mode 100644 index 000000000..f1af54b9f Binary files /dev/null and b/nwnds_module/tyr_w_abanhome.gic differ diff --git a/nwnds_module/tyr_w_abanhome.git b/nwnds_module/tyr_w_abanhome.git new file mode 100644 index 000000000..dd756d5a9 Binary files /dev/null and b/nwnds_module/tyr_w_abanhome.git differ diff --git a/nwnds_module/tyr_w_cryschess.are b/nwnds_module/tyr_w_cryschess.are new file mode 100644 index 000000000..12cf63fce Binary files /dev/null and b/nwnds_module/tyr_w_cryschess.are differ diff --git a/nwnds_module/tyr_w_cryschess.gic b/nwnds_module/tyr_w_cryschess.gic new file mode 100644 index 000000000..b773b87dc Binary files /dev/null and b/nwnds_module/tyr_w_cryschess.gic differ diff --git a/nwnds_module/tyr_w_cryschess.git b/nwnds_module/tyr_w_cryschess.git new file mode 100644 index 000000000..6da1deb49 Binary files /dev/null and b/nwnds_module/tyr_w_cryschess.git differ diff --git a/nwnds_module/tyr_w_cryspider.are b/nwnds_module/tyr_w_cryspider.are new file mode 100644 index 000000000..72403cf45 Binary files /dev/null and b/nwnds_module/tyr_w_cryspider.are differ diff --git a/nwnds_module/tyr_w_cryspider.gic b/nwnds_module/tyr_w_cryspider.gic new file mode 100644 index 000000000..c35c6f78b Binary files /dev/null and b/nwnds_module/tyr_w_cryspider.gic differ diff --git a/nwnds_module/tyr_w_cryspider.git b/nwnds_module/tyr_w_cryspider.git new file mode 100644 index 000000000..f91dfc426 Binary files /dev/null and b/nwnds_module/tyr_w_cryspider.git differ diff --git a/nwnds_module/tyr_w_draqomanhq.are b/nwnds_module/tyr_w_draqomanhq.are new file mode 100644 index 000000000..f85337606 Binary files /dev/null and b/nwnds_module/tyr_w_draqomanhq.are differ diff --git a/nwnds_module/tyr_w_draqomanhq.gic b/nwnds_module/tyr_w_draqomanhq.gic new file mode 100644 index 000000000..834bf0f36 Binary files /dev/null and b/nwnds_module/tyr_w_draqomanhq.gic differ diff --git a/nwnds_module/tyr_w_draqomanhq.git b/nwnds_module/tyr_w_draqomanhq.git new file mode 100644 index 000000000..36985176d Binary files /dev/null and b/nwnds_module/tyr_w_draqomanhq.git differ diff --git a/nwnds_module/tyr_w_drunkgiant.are b/nwnds_module/tyr_w_drunkgiant.are new file mode 100644 index 000000000..d63340d21 Binary files /dev/null and b/nwnds_module/tyr_w_drunkgiant.are differ diff --git a/nwnds_module/tyr_w_drunkgiant.gic b/nwnds_module/tyr_w_drunkgiant.gic new file mode 100644 index 000000000..e51056803 Binary files /dev/null and b/nwnds_module/tyr_w_drunkgiant.gic differ diff --git a/nwnds_module/tyr_w_drunkgiant.git b/nwnds_module/tyr_w_drunkgiant.git new file mode 100644 index 000000000..bcf0b3725 Binary files /dev/null and b/nwnds_module/tyr_w_drunkgiant.git differ diff --git a/nwnds_module/tyr_w_fortnoasis.are b/nwnds_module/tyr_w_fortnoasis.are new file mode 100644 index 000000000..ccc660868 Binary files /dev/null and b/nwnds_module/tyr_w_fortnoasis.are differ diff --git a/nwnds_module/tyr_w_fortnoasis.gic b/nwnds_module/tyr_w_fortnoasis.gic new file mode 100644 index 000000000..8421893a1 Binary files /dev/null and b/nwnds_module/tyr_w_fortnoasis.gic differ diff --git a/nwnds_module/tyr_w_fortnoasis.git b/nwnds_module/tyr_w_fortnoasis.git new file mode 100644 index 000000000..90005105d Binary files /dev/null and b/nwnds_module/tyr_w_fortnoasis.git differ diff --git a/nwnds_module/tyr_w_happydwarf.are b/nwnds_module/tyr_w_happydwarf.are new file mode 100644 index 000000000..d20359c70 Binary files /dev/null and b/nwnds_module/tyr_w_happydwarf.are differ diff --git a/nwnds_module/tyr_w_happydwarf.gic b/nwnds_module/tyr_w_happydwarf.gic new file mode 100644 index 000000000..a6612598f Binary files /dev/null and b/nwnds_module/tyr_w_happydwarf.gic differ diff --git a/nwnds_module/tyr_w_happydwarf.git b/nwnds_module/tyr_w_happydwarf.git new file mode 100644 index 000000000..7a0b44abb Binary files /dev/null and b/nwnds_module/tyr_w_happydwarf.git differ diff --git a/nwnds_module/tyr_w_housfingrs.are b/nwnds_module/tyr_w_housfingrs.are new file mode 100644 index 000000000..a5ffd0cc5 Binary files /dev/null and b/nwnds_module/tyr_w_housfingrs.are differ diff --git a/nwnds_module/tyr_w_housfingrs.gic b/nwnds_module/tyr_w_housfingrs.gic new file mode 100644 index 000000000..4081d6b36 Binary files /dev/null and b/nwnds_module/tyr_w_housfingrs.gic differ diff --git a/nwnds_module/tyr_w_housfingrs.git b/nwnds_module/tyr_w_housfingrs.git new file mode 100644 index 000000000..2e7e50bce Binary files /dev/null and b/nwnds_module/tyr_w_housfingrs.git differ diff --git a/nwnds_module/tyr_w_hungryhalf.are b/nwnds_module/tyr_w_hungryhalf.are new file mode 100644 index 000000000..4bd52c161 Binary files /dev/null and b/nwnds_module/tyr_w_hungryhalf.are differ diff --git a/nwnds_module/tyr_w_hungryhalf.gic b/nwnds_module/tyr_w_hungryhalf.gic new file mode 100644 index 000000000..a11469028 Binary files /dev/null and b/nwnds_module/tyr_w_hungryhalf.gic differ diff --git a/nwnds_module/tyr_w_hungryhalf.git b/nwnds_module/tyr_w_hungryhalf.git new file mode 100644 index 000000000..16cbf5155 Binary files /dev/null and b/nwnds_module/tyr_w_hungryhalf.git differ diff --git a/nwnds_module/tyr_w_kilarishop.are b/nwnds_module/tyr_w_kilarishop.are new file mode 100644 index 000000000..37c84a795 Binary files /dev/null and b/nwnds_module/tyr_w_kilarishop.are differ diff --git a/nwnds_module/tyr_w_kilarishop.gic b/nwnds_module/tyr_w_kilarishop.gic new file mode 100644 index 000000000..618c6db53 Binary files /dev/null and b/nwnds_module/tyr_w_kilarishop.gic differ diff --git a/nwnds_module/tyr_w_kilarishop.git b/nwnds_module/tyr_w_kilarishop.git new file mode 100644 index 000000000..73283d485 Binary files /dev/null and b/nwnds_module/tyr_w_kilarishop.git differ diff --git a/nwnds_module/tyr_w_marcusshop.are b/nwnds_module/tyr_w_marcusshop.are new file mode 100644 index 000000000..b518a7141 Binary files /dev/null and b/nwnds_module/tyr_w_marcusshop.are differ diff --git a/nwnds_module/tyr_w_marcusshop.gic b/nwnds_module/tyr_w_marcusshop.gic new file mode 100644 index 000000000..92fc669b7 Binary files /dev/null and b/nwnds_module/tyr_w_marcusshop.gic differ diff --git a/nwnds_module/tyr_w_marcusshop.git b/nwnds_module/tyr_w_marcusshop.git new file mode 100644 index 000000000..6149684b0 Binary files /dev/null and b/nwnds_module/tyr_w_marcusshop.git differ diff --git a/nwnds_module/tyr_w_midnitesnd.are b/nwnds_module/tyr_w_midnitesnd.are new file mode 100644 index 000000000..045cafac0 Binary files /dev/null and b/nwnds_module/tyr_w_midnitesnd.are differ diff --git a/nwnds_module/tyr_w_midnitesnd.gic b/nwnds_module/tyr_w_midnitesnd.gic new file mode 100644 index 000000000..b8a53cd08 Binary files /dev/null and b/nwnds_module/tyr_w_midnitesnd.gic differ diff --git a/nwnds_module/tyr_w_midnitesnd.git b/nwnds_module/tyr_w_midnitesnd.git new file mode 100644 index 000000000..01e1f2967 Binary files /dev/null and b/nwnds_module/tyr_w_midnitesnd.git differ diff --git a/nwnds_module/tyr_w_mimshouse.are b/nwnds_module/tyr_w_mimshouse.are new file mode 100644 index 000000000..32c30e190 Binary files /dev/null and b/nwnds_module/tyr_w_mimshouse.are differ diff --git a/nwnds_module/tyr_w_mimshouse.gic b/nwnds_module/tyr_w_mimshouse.gic new file mode 100644 index 000000000..3f4ab5f2e Binary files /dev/null and b/nwnds_module/tyr_w_mimshouse.gic differ diff --git a/nwnds_module/tyr_w_mimshouse.git b/nwnds_module/tyr_w_mimshouse.git new file mode 100644 index 000000000..49e47b49f Binary files /dev/null and b/nwnds_module/tyr_w_mimshouse.git differ diff --git a/nwnds_module/tyr_w_redkank.are b/nwnds_module/tyr_w_redkank.are new file mode 100644 index 000000000..40b719d51 Binary files /dev/null and b/nwnds_module/tyr_w_redkank.are differ diff --git a/nwnds_module/tyr_w_redkank.gic b/nwnds_module/tyr_w_redkank.gic new file mode 100644 index 000000000..f77104479 Binary files /dev/null and b/nwnds_module/tyr_w_redkank.gic differ diff --git a/nwnds_module/tyr_w_redkank.git b/nwnds_module/tyr_w_redkank.git new file mode 100644 index 000000000..caeeed075 Binary files /dev/null and b/nwnds_module/tyr_w_redkank.git differ diff --git a/nwnds_module/tyr_w_ruinhome1.are b/nwnds_module/tyr_w_ruinhome1.are new file mode 100644 index 000000000..d48047201 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome1.are differ diff --git a/nwnds_module/tyr_w_ruinhome1.gic b/nwnds_module/tyr_w_ruinhome1.gic new file mode 100644 index 000000000..b74470880 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome1.gic differ diff --git a/nwnds_module/tyr_w_ruinhome1.git b/nwnds_module/tyr_w_ruinhome1.git new file mode 100644 index 000000000..e0c2b2af6 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome1.git differ diff --git a/nwnds_module/tyr_w_ruinhome2.are b/nwnds_module/tyr_w_ruinhome2.are new file mode 100644 index 000000000..e9edd5bc9 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome2.are differ diff --git a/nwnds_module/tyr_w_ruinhome2.gic b/nwnds_module/tyr_w_ruinhome2.gic new file mode 100644 index 000000000..32b75eca2 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome2.gic differ diff --git a/nwnds_module/tyr_w_ruinhome2.git b/nwnds_module/tyr_w_ruinhome2.git new file mode 100644 index 000000000..83dd157e9 Binary files /dev/null and b/nwnds_module/tyr_w_ruinhome2.git differ diff --git a/nwnds_module/tyr_w_scrmcllrbs.are b/nwnds_module/tyr_w_scrmcllrbs.are new file mode 100644 index 000000000..2dc10e148 Binary files /dev/null and b/nwnds_module/tyr_w_scrmcllrbs.are differ diff --git a/nwnds_module/tyr_w_scrmcllrbs.gic b/nwnds_module/tyr_w_scrmcllrbs.gic new file mode 100644 index 000000000..26f9a6ff6 Binary files /dev/null and b/nwnds_module/tyr_w_scrmcllrbs.gic differ diff --git a/nwnds_module/tyr_w_scrmcllrbs.git b/nwnds_module/tyr_w_scrmcllrbs.git new file mode 100644 index 000000000..d92405784 Binary files /dev/null and b/nwnds_module/tyr_w_scrmcllrbs.git differ diff --git a/nwnds_module/tyr_w_scrmncellr.are b/nwnds_module/tyr_w_scrmncellr.are new file mode 100644 index 000000000..04771e0fa Binary files /dev/null and b/nwnds_module/tyr_w_scrmncellr.are differ diff --git a/nwnds_module/tyr_w_scrmncellr.gic b/nwnds_module/tyr_w_scrmncellr.gic new file mode 100644 index 000000000..27a9f619d Binary files /dev/null and b/nwnds_module/tyr_w_scrmncellr.gic differ diff --git a/nwnds_module/tyr_w_scrmncellr.git b/nwnds_module/tyr_w_scrmncellr.git new file mode 100644 index 000000000..dc78260f4 Binary files /dev/null and b/nwnds_module/tyr_w_scrmncellr.git differ diff --git a/nwnds_module/tyr_w_weepnwidow.are b/nwnds_module/tyr_w_weepnwidow.are new file mode 100644 index 000000000..bbd6298a3 Binary files /dev/null and b/nwnds_module/tyr_w_weepnwidow.are differ diff --git a/nwnds_module/tyr_w_weepnwidow.gic b/nwnds_module/tyr_w_weepnwidow.gic new file mode 100644 index 000000000..a5b455adb Binary files /dev/null and b/nwnds_module/tyr_w_weepnwidow.gic differ diff --git a/nwnds_module/tyr_w_weepnwidow.git b/nwnds_module/tyr_w_weepnwidow.git new file mode 100644 index 000000000..ae696daac Binary files /dev/null and b/nwnds_module/tyr_w_weepnwidow.git differ diff --git a/nwnds_module/tyr_warrens.are b/nwnds_module/tyr_warrens.are new file mode 100644 index 000000000..8ae55b020 Binary files /dev/null and b/nwnds_module/tyr_warrens.are differ diff --git a/nwnds_module/tyr_warrens.gic b/nwnds_module/tyr_warrens.gic new file mode 100644 index 000000000..c6b6afed6 Binary files /dev/null and b/nwnds_module/tyr_warrens.gic differ diff --git a/nwnds_module/tyr_warrens.git b/nwnds_module/tyr_warrens.git new file mode 100644 index 000000000..31f633abe Binary files /dev/null and b/nwnds_module/tyr_warrens.git differ diff --git a/nwnds_module/tyrantfogspawn.utc b/nwnds_module/tyrantfogspawn.utc new file mode 100644 index 000000000..6fc3e62d8 Binary files /dev/null and b/nwnds_module/tyrantfogspawn.utc differ diff --git a/nwnds_module/tyrguardclothe.uti b/nwnds_module/tyrguardclothe.uti new file mode 100644 index 000000000..6972518c4 Binary files /dev/null and b/nwnds_module/tyrguardclothe.uti differ diff --git a/nwnds_module/tyrianslimehid.uti b/nwnds_module/tyrianslimehid.uti new file mode 100644 index 000000000..48b6d58f3 Binary files /dev/null and b/nwnds_module/tyrianslimehid.uti differ diff --git a/nwnds_module/tyrianslimesla.uti b/nwnds_module/tyrianslimesla.uti new file mode 100644 index 000000000..cd80076d9 Binary files /dev/null and b/nwnds_module/tyrianslimesla.uti differ diff --git a/nwnds_module/ue_darkspidlair.are b/nwnds_module/ue_darkspidlair.are new file mode 100644 index 000000000..0eb99b7f7 Binary files /dev/null and b/nwnds_module/ue_darkspidlair.are differ diff --git a/nwnds_module/ue_darkspidlair.gic b/nwnds_module/ue_darkspidlair.gic new file mode 100644 index 000000000..cfcf22662 Binary files /dev/null and b/nwnds_module/ue_darkspidlair.gic differ diff --git a/nwnds_module/ue_darkspidlair.git b/nwnds_module/ue_darkspidlair.git new file mode 100644 index 000000000..75ab8de3c Binary files /dev/null and b/nwnds_module/ue_darkspidlair.git differ diff --git a/nwnds_module/ue_emptynest.are b/nwnds_module/ue_emptynest.are new file mode 100644 index 000000000..e90986e87 Binary files /dev/null and b/nwnds_module/ue_emptynest.are differ diff --git a/nwnds_module/ue_emptynest.gic b/nwnds_module/ue_emptynest.gic new file mode 100644 index 000000000..9a5f94564 Binary files /dev/null and b/nwnds_module/ue_emptynest.gic differ diff --git a/nwnds_module/ue_emptynest.git b/nwnds_module/ue_emptynest.git new file mode 100644 index 000000000..270c7ce73 Binary files /dev/null and b/nwnds_module/ue_emptynest.git differ diff --git a/nwnds_module/ue_restquarters.are b/nwnds_module/ue_restquarters.are new file mode 100644 index 000000000..447d0c305 Binary files /dev/null and b/nwnds_module/ue_restquarters.are differ diff --git a/nwnds_module/ue_restquarters.gic b/nwnds_module/ue_restquarters.gic new file mode 100644 index 000000000..5e4b7eadd Binary files /dev/null and b/nwnds_module/ue_restquarters.gic differ diff --git a/nwnds_module/ue_restquarters.git b/nwnds_module/ue_restquarters.git new file mode 100644 index 000000000..e7ab61a19 Binary files /dev/null and b/nwnds_module/ue_restquarters.git differ diff --git a/nwnds_module/ue_storageroom.are b/nwnds_module/ue_storageroom.are new file mode 100644 index 000000000..2c053ff5e Binary files /dev/null and b/nwnds_module/ue_storageroom.are differ diff --git a/nwnds_module/ue_storageroom.gic b/nwnds_module/ue_storageroom.gic new file mode 100644 index 000000000..afa083df2 Binary files /dev/null and b/nwnds_module/ue_storageroom.gic differ diff --git a/nwnds_module/ue_storageroom.git b/nwnds_module/ue_storageroom.git new file mode 100644 index 000000000..89ac8ef34 Binary files /dev/null and b/nwnds_module/ue_storageroom.git differ diff --git a/nwnds_module/ulitharid001.utc b/nwnds_module/ulitharid001.utc new file mode 100644 index 000000000..7f1193509 Binary files /dev/null and b/nwnds_module/ulitharid001.utc differ diff --git a/nwnds_module/ulitharid002.utc b/nwnds_module/ulitharid002.utc new file mode 100644 index 000000000..7c09e3922 Binary files /dev/null and b/nwnds_module/ulitharid002.utc differ diff --git a/nwnds_module/ulitharidhide001.uti b/nwnds_module/ulitharidhide001.uti new file mode 100644 index 000000000..5d0c816f0 Binary files /dev/null and b/nwnds_module/ulitharidhide001.uti differ diff --git a/nwnds_module/ulitharidtent001.uti b/nwnds_module/ulitharidtent001.uti new file mode 100644 index 000000000..968e8fdbc Binary files /dev/null and b/nwnds_module/ulitharidtent001.uti differ diff --git a/nwnds_module/undeadevo1.uti b/nwnds_module/undeadevo1.uti new file mode 100644 index 000000000..b45ff0b87 Binary files /dev/null and b/nwnds_module/undeadevo1.uti differ diff --git a/nwnds_module/undeadhide001.uti b/nwnds_module/undeadhide001.uti new file mode 100644 index 000000000..eea96869a Binary files /dev/null and b/nwnds_module/undeadhide001.uti differ diff --git a/nwnds_module/undtyr_cistern.are b/nwnds_module/undtyr_cistern.are new file mode 100644 index 000000000..44314490b Binary files /dev/null and b/nwnds_module/undtyr_cistern.are differ diff --git a/nwnds_module/undtyr_cistern.gic b/nwnds_module/undtyr_cistern.gic new file mode 100644 index 000000000..0e23e5c27 Binary files /dev/null and b/nwnds_module/undtyr_cistern.gic differ diff --git a/nwnds_module/undtyr_cistern.git b/nwnds_module/undtyr_cistern.git new file mode 100644 index 000000000..a6bd23ac4 Binary files /dev/null and b/nwnds_module/undtyr_cistern.git differ diff --git a/nwnds_module/undtyr_crawl.are b/nwnds_module/undtyr_crawl.are new file mode 100644 index 000000000..b3c20c398 Binary files /dev/null and b/nwnds_module/undtyr_crawl.are differ diff --git a/nwnds_module/undtyr_crawl.gic b/nwnds_module/undtyr_crawl.gic new file mode 100644 index 000000000..60b3fd551 Binary files /dev/null and b/nwnds_module/undtyr_crawl.gic differ diff --git a/nwnds_module/undtyr_crawl.git b/nwnds_module/undtyr_crawl.git new file mode 100644 index 000000000..bef5d8b74 Binary files /dev/null and b/nwnds_module/undtyr_crawl.git differ diff --git a/nwnds_module/undtyr_farias.are b/nwnds_module/undtyr_farias.are new file mode 100644 index 000000000..1c2325622 Binary files /dev/null and b/nwnds_module/undtyr_farias.are differ diff --git a/nwnds_module/undtyr_farias.gic b/nwnds_module/undtyr_farias.gic new file mode 100644 index 000000000..9c2d86460 Binary files /dev/null and b/nwnds_module/undtyr_farias.gic differ diff --git a/nwnds_module/undtyr_farias.git b/nwnds_module/undtyr_farias.git new file mode 100644 index 000000000..b96be377e Binary files /dev/null and b/nwnds_module/undtyr_farias.git differ diff --git a/nwnds_module/undtyr_oldmines.are b/nwnds_module/undtyr_oldmines.are new file mode 100644 index 000000000..013e7981d Binary files /dev/null and b/nwnds_module/undtyr_oldmines.are differ diff --git a/nwnds_module/undtyr_oldmines.gic b/nwnds_module/undtyr_oldmines.gic new file mode 100644 index 000000000..c841732a9 Binary files /dev/null and b/nwnds_module/undtyr_oldmines.gic differ diff --git a/nwnds_module/undtyr_oldmines.git b/nwnds_module/undtyr_oldmines.git new file mode 100644 index 000000000..3efbf0155 Binary files /dev/null and b/nwnds_module/undtyr_oldmines.git differ diff --git a/nwnds_module/undtyr_pass01.are b/nwnds_module/undtyr_pass01.are new file mode 100644 index 000000000..0e0fbcfcb Binary files /dev/null and b/nwnds_module/undtyr_pass01.are differ diff --git a/nwnds_module/undtyr_pass01.gic b/nwnds_module/undtyr_pass01.gic new file mode 100644 index 000000000..f7eac2b5a Binary files /dev/null and b/nwnds_module/undtyr_pass01.gic differ diff --git a/nwnds_module/undtyr_pass01.git b/nwnds_module/undtyr_pass01.git new file mode 100644 index 000000000..61409fe81 Binary files /dev/null and b/nwnds_module/undtyr_pass01.git differ diff --git a/nwnds_module/undtyr_pass02.are b/nwnds_module/undtyr_pass02.are new file mode 100644 index 000000000..1dfeeb515 Binary files /dev/null and b/nwnds_module/undtyr_pass02.are differ diff --git a/nwnds_module/undtyr_pass02.gic b/nwnds_module/undtyr_pass02.gic new file mode 100644 index 000000000..a11561c5c Binary files /dev/null and b/nwnds_module/undtyr_pass02.gic differ diff --git a/nwnds_module/undtyr_pass02.git b/nwnds_module/undtyr_pass02.git new file mode 100644 index 000000000..941eee777 Binary files /dev/null and b/nwnds_module/undtyr_pass02.git differ diff --git a/nwnds_module/undtyr_pass03.are b/nwnds_module/undtyr_pass03.are new file mode 100644 index 000000000..ecca4d477 Binary files /dev/null and b/nwnds_module/undtyr_pass03.are differ diff --git a/nwnds_module/undtyr_pass03.gic b/nwnds_module/undtyr_pass03.gic new file mode 100644 index 000000000..638e9e9f6 Binary files /dev/null and b/nwnds_module/undtyr_pass03.gic differ diff --git a/nwnds_module/undtyr_pass03.git b/nwnds_module/undtyr_pass03.git new file mode 100644 index 000000000..bb439bf9b Binary files /dev/null and b/nwnds_module/undtyr_pass03.git differ diff --git a/nwnds_module/undtyr_revs.are b/nwnds_module/undtyr_revs.are new file mode 100644 index 000000000..8dc04a74c Binary files /dev/null and b/nwnds_module/undtyr_revs.are differ diff --git a/nwnds_module/undtyr_revs.gic b/nwnds_module/undtyr_revs.gic new file mode 100644 index 000000000..ea14ebfd6 Binary files /dev/null and b/nwnds_module/undtyr_revs.gic differ diff --git a/nwnds_module/undtyr_revs.git b/nwnds_module/undtyr_revs.git new file mode 100644 index 000000000..d86f4b0f8 Binary files /dev/null and b/nwnds_module/undtyr_revs.git differ diff --git a/nwnds_module/undtyr_tempblood.are b/nwnds_module/undtyr_tempblood.are new file mode 100644 index 000000000..9e87391cd Binary files /dev/null and b/nwnds_module/undtyr_tempblood.are differ diff --git a/nwnds_module/undtyr_tempblood.gic b/nwnds_module/undtyr_tempblood.gic new file mode 100644 index 000000000..9a98ea039 Binary files /dev/null and b/nwnds_module/undtyr_tempblood.gic differ diff --git a/nwnds_module/undtyr_tempblood.git b/nwnds_module/undtyr_tempblood.git new file mode 100644 index 000000000..c8046813a Binary files /dev/null and b/nwnds_module/undtyr_tempblood.git differ diff --git a/nwnds_module/undtyr_waystat.are b/nwnds_module/undtyr_waystat.are new file mode 100644 index 000000000..ff1e1088b Binary files /dev/null and b/nwnds_module/undtyr_waystat.are differ diff --git a/nwnds_module/undtyr_waystat.gic b/nwnds_module/undtyr_waystat.gic new file mode 100644 index 000000000..c8c4f6320 Binary files /dev/null and b/nwnds_module/undtyr_waystat.gic differ diff --git a/nwnds_module/undtyr_waystat.git b/nwnds_module/undtyr_waystat.git new file mode 100644 index 000000000..b586b5cf8 Binary files /dev/null and b/nwnds_module/undtyr_waystat.git differ diff --git a/nwnds_module/undtyr_web.are b/nwnds_module/undtyr_web.are new file mode 100644 index 000000000..cd3d9bad5 Binary files /dev/null and b/nwnds_module/undtyr_web.are differ diff --git a/nwnds_module/undtyr_web.gic b/nwnds_module/undtyr_web.gic new file mode 100644 index 000000000..b12829aee Binary files /dev/null and b/nwnds_module/undtyr_web.gic differ diff --git a/nwnds_module/undtyr_web.git b/nwnds_module/undtyr_web.git new file mode 100644 index 000000000..c693d97e3 Binary files /dev/null and b/nwnds_module/undtyr_web.git differ diff --git a/nwnds_module/unearthed.are b/nwnds_module/unearthed.are new file mode 100644 index 000000000..6afc7cca5 Binary files /dev/null and b/nwnds_module/unearthed.are differ diff --git a/nwnds_module/unearthed.gic b/nwnds_module/unearthed.gic new file mode 100644 index 000000000..d9f42c765 Binary files /dev/null and b/nwnds_module/unearthed.gic differ diff --git a/nwnds_module/unearthed.git b/nwnds_module/unearthed.git new file mode 100644 index 000000000..f39cd920d Binary files /dev/null and b/nwnds_module/unearthed.git differ diff --git a/nwnds_module/untitled000.dlg b/nwnds_module/untitled000.dlg new file mode 100644 index 000000000..11e35f405 Binary files /dev/null and b/nwnds_module/untitled000.dlg differ diff --git a/nwnds_module/urik_ad_glitter.are b/nwnds_module/urik_ad_glitter.are new file mode 100644 index 000000000..8bc09a0de Binary files /dev/null and b/nwnds_module/urik_ad_glitter.are differ diff --git a/nwnds_module/urik_ad_glitter.gic b/nwnds_module/urik_ad_glitter.gic new file mode 100644 index 000000000..87216bc92 Binary files /dev/null and b/nwnds_module/urik_ad_glitter.gic differ diff --git a/nwnds_module/urik_ad_glitter.git b/nwnds_module/urik_ad_glitter.git new file mode 100644 index 000000000..d48b18800 Binary files /dev/null and b/nwnds_module/urik_ad_glitter.git differ diff --git a/nwnds_module/urik_ad_goldlion.are b/nwnds_module/urik_ad_goldlion.are new file mode 100644 index 000000000..c7fda79a3 Binary files /dev/null and b/nwnds_module/urik_ad_goldlion.are differ diff --git a/nwnds_module/urik_ad_goldlion.gic b/nwnds_module/urik_ad_goldlion.gic new file mode 100644 index 000000000..3190fe2d9 Binary files /dev/null and b/nwnds_module/urik_ad_goldlion.gic differ diff --git a/nwnds_module/urik_ad_goldlion.git b/nwnds_module/urik_ad_goldlion.git new file mode 100644 index 000000000..997da73dd Binary files /dev/null and b/nwnds_module/urik_ad_goldlion.git differ diff --git a/nwnds_module/urik_ad_sildunes.are b/nwnds_module/urik_ad_sildunes.are new file mode 100644 index 000000000..fad1d4776 Binary files /dev/null and b/nwnds_module/urik_ad_sildunes.are differ diff --git a/nwnds_module/urik_ad_sildunes.gic b/nwnds_module/urik_ad_sildunes.gic new file mode 100644 index 000000000..64d567017 Binary files /dev/null and b/nwnds_module/urik_ad_sildunes.gic differ diff --git a/nwnds_module/urik_ad_sildunes.git b/nwnds_module/urik_ad_sildunes.git new file mode 100644 index 000000000..6171b6747 Binary files /dev/null and b/nwnds_module/urik_ad_sildunes.git differ diff --git a/nwnds_module/urik_ad_treasury.are b/nwnds_module/urik_ad_treasury.are new file mode 100644 index 000000000..f01da560e Binary files /dev/null and b/nwnds_module/urik_ad_treasury.are differ diff --git a/nwnds_module/urik_ad_treasury.gic b/nwnds_module/urik_ad_treasury.gic new file mode 100644 index 000000000..a60c6c5e5 Binary files /dev/null and b/nwnds_module/urik_ad_treasury.gic differ diff --git a/nwnds_module/urik_ad_treasury.git b/nwnds_module/urik_ad_treasury.git new file mode 100644 index 000000000..dc9c727f2 Binary files /dev/null and b/nwnds_module/urik_ad_treasury.git differ diff --git a/nwnds_module/urik_artdistrict.are b/nwnds_module/urik_artdistrict.are new file mode 100644 index 000000000..3a84687fe Binary files /dev/null and b/nwnds_module/urik_artdistrict.are differ diff --git a/nwnds_module/urik_artdistrict.gic b/nwnds_module/urik_artdistrict.gic new file mode 100644 index 000000000..b1d2af999 Binary files /dev/null and b/nwnds_module/urik_artdistrict.gic differ diff --git a/nwnds_module/urik_artdistrict.git b/nwnds_module/urik_artdistrict.git new file mode 100644 index 000000000..908d16757 Binary files /dev/null and b/nwnds_module/urik_artdistrict.git differ diff --git a/nwnds_module/urik_fields.are b/nwnds_module/urik_fields.are new file mode 100644 index 000000000..b29869af5 Binary files /dev/null and b/nwnds_module/urik_fields.are differ diff --git a/nwnds_module/urik_fields.gic b/nwnds_module/urik_fields.gic new file mode 100644 index 000000000..a75bac66d Binary files /dev/null and b/nwnds_module/urik_fields.gic differ diff --git a/nwnds_module/urik_fields.git b/nwnds_module/urik_fields.git new file mode 100644 index 000000000..914001181 Binary files /dev/null and b/nwnds_module/urik_fields.git differ diff --git a/nwnds_module/urik_fq_5knives.are b/nwnds_module/urik_fq_5knives.are new file mode 100644 index 000000000..171e9b11a Binary files /dev/null and b/nwnds_module/urik_fq_5knives.are differ diff --git a/nwnds_module/urik_fq_5knives.gic b/nwnds_module/urik_fq_5knives.gic new file mode 100644 index 000000000..e75c090bc Binary files /dev/null and b/nwnds_module/urik_fq_5knives.gic differ diff --git a/nwnds_module/urik_fq_5knives.git b/nwnds_module/urik_fq_5knives.git new file mode 100644 index 000000000..6caf50a77 Binary files /dev/null and b/nwnds_module/urik_fq_5knives.git differ diff --git a/nwnds_module/urik_fq_forquart.are b/nwnds_module/urik_fq_forquart.are new file mode 100644 index 000000000..c0faf9520 Binary files /dev/null and b/nwnds_module/urik_fq_forquart.are differ diff --git a/nwnds_module/urik_fq_forquart.gic b/nwnds_module/urik_fq_forquart.gic new file mode 100644 index 000000000..388641877 Binary files /dev/null and b/nwnds_module/urik_fq_forquart.gic differ diff --git a/nwnds_module/urik_fq_forquart.git b/nwnds_module/urik_fq_forquart.git new file mode 100644 index 000000000..c193a14a6 Binary files /dev/null and b/nwnds_module/urik_fq_forquart.git differ diff --git a/nwnds_module/urik_fq_healer.are b/nwnds_module/urik_fq_healer.are new file mode 100644 index 000000000..33fece1b7 Binary files /dev/null and b/nwnds_module/urik_fq_healer.are differ diff --git a/nwnds_module/urik_fq_healer.gic b/nwnds_module/urik_fq_healer.gic new file mode 100644 index 000000000..05be8db05 Binary files /dev/null and b/nwnds_module/urik_fq_healer.gic differ diff --git a/nwnds_module/urik_fq_healer.git b/nwnds_module/urik_fq_healer.git new file mode 100644 index 000000000..23e810829 Binary files /dev/null and b/nwnds_module/urik_fq_healer.git differ diff --git a/nwnds_module/urik_fq_kiklikna.are b/nwnds_module/urik_fq_kiklikna.are new file mode 100644 index 000000000..a2ce2ec91 Binary files /dev/null and b/nwnds_module/urik_fq_kiklikna.are differ diff --git a/nwnds_module/urik_fq_kiklikna.gic b/nwnds_module/urik_fq_kiklikna.gic new file mode 100644 index 000000000..eb93046a0 Binary files /dev/null and b/nwnds_module/urik_fq_kiklikna.gic differ diff --git a/nwnds_module/urik_fq_kiklikna.git b/nwnds_module/urik_fq_kiklikna.git new file mode 100644 index 000000000..422d78ca4 Binary files /dev/null and b/nwnds_module/urik_fq_kiklikna.git differ diff --git a/nwnds_module/urik_fq_pleasure.are b/nwnds_module/urik_fq_pleasure.are new file mode 100644 index 000000000..a07b49f0c Binary files /dev/null and b/nwnds_module/urik_fq_pleasure.are differ diff --git a/nwnds_module/urik_fq_pleasure.gic b/nwnds_module/urik_fq_pleasure.gic new file mode 100644 index 000000000..0b4d58053 Binary files /dev/null and b/nwnds_module/urik_fq_pleasure.gic differ diff --git a/nwnds_module/urik_fq_pleasure.git b/nwnds_module/urik_fq_pleasure.git new file mode 100644 index 000000000..3f79b5600 Binary files /dev/null and b/nwnds_module/urik_fq_pleasure.git differ diff --git a/nwnds_module/urik_fq_scribe.are b/nwnds_module/urik_fq_scribe.are new file mode 100644 index 000000000..7ee9e79f7 Binary files /dev/null and b/nwnds_module/urik_fq_scribe.are differ diff --git a/nwnds_module/urik_fq_scribe.gic b/nwnds_module/urik_fq_scribe.gic new file mode 100644 index 000000000..6fa44df8d Binary files /dev/null and b/nwnds_module/urik_fq_scribe.gic differ diff --git a/nwnds_module/urik_fq_scribe.git b/nwnds_module/urik_fq_scribe.git new file mode 100644 index 000000000..b7a467517 Binary files /dev/null and b/nwnds_module/urik_fq_scribe.git differ diff --git a/nwnds_module/urik_half_jungle.are b/nwnds_module/urik_half_jungle.are new file mode 100644 index 000000000..1de51d3fd Binary files /dev/null and b/nwnds_module/urik_half_jungle.are differ diff --git a/nwnds_module/urik_half_jungle.gic b/nwnds_module/urik_half_jungle.gic new file mode 100644 index 000000000..42ea2af00 Binary files /dev/null and b/nwnds_module/urik_half_jungle.gic differ diff --git a/nwnds_module/urik_half_jungle.git b/nwnds_module/urik_half_jungle.git new file mode 100644 index 000000000..979b455bc Binary files /dev/null and b/nwnds_module/urik_half_jungle.git differ diff --git a/nwnds_module/urik_hg_cmdr_hs1.are b/nwnds_module/urik_hg_cmdr_hs1.are new file mode 100644 index 000000000..1ab1910ec Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs1.are differ diff --git a/nwnds_module/urik_hg_cmdr_hs1.gic b/nwnds_module/urik_hg_cmdr_hs1.gic new file mode 100644 index 000000000..4a3cd03d6 Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs1.gic differ diff --git a/nwnds_module/urik_hg_cmdr_hs1.git b/nwnds_module/urik_hg_cmdr_hs1.git new file mode 100644 index 000000000..1f22d0968 Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs1.git differ diff --git a/nwnds_module/urik_hg_cmdr_hs2.are b/nwnds_module/urik_hg_cmdr_hs2.are new file mode 100644 index 000000000..bcbc99e44 Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs2.are differ diff --git a/nwnds_module/urik_hg_cmdr_hs2.gic b/nwnds_module/urik_hg_cmdr_hs2.gic new file mode 100644 index 000000000..beaddfa8b Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs2.gic differ diff --git a/nwnds_module/urik_hg_cmdr_hs2.git b/nwnds_module/urik_hg_cmdr_hs2.git new file mode 100644 index 000000000..0acf04c54 Binary files /dev/null and b/nwnds_module/urik_hg_cmdr_hs2.git differ diff --git a/nwnds_module/urik_hg_templrhq.are b/nwnds_module/urik_hg_templrhq.are new file mode 100644 index 000000000..70bc5316a Binary files /dev/null and b/nwnds_module/urik_hg_templrhq.are differ diff --git a/nwnds_module/urik_hg_templrhq.gic b/nwnds_module/urik_hg_templrhq.gic new file mode 100644 index 000000000..07a33fb81 Binary files /dev/null and b/nwnds_module/urik_hg_templrhq.gic differ diff --git a/nwnds_module/urik_hg_templrhq.git b/nwnds_module/urik_hg_templrhq.git new file mode 100644 index 000000000..f38de27ab Binary files /dev/null and b/nwnds_module/urik_hg_templrhq.git differ diff --git a/nwnds_module/urik_highgate.are b/nwnds_module/urik_highgate.are new file mode 100644 index 000000000..6f284478f Binary files /dev/null and b/nwnds_module/urik_highgate.are differ diff --git a/nwnds_module/urik_highgate.gic b/nwnds_module/urik_highgate.gic new file mode 100644 index 000000000..0fedb93b7 Binary files /dev/null and b/nwnds_module/urik_highgate.gic differ diff --git a/nwnds_module/urik_highgate.git b/nwnds_module/urik_highgate.git new file mode 100644 index 000000000..bb2be54a1 Binary files /dev/null and b/nwnds_module/urik_highgate.git differ diff --git a/nwnds_module/urik_kg_bwwell.are b/nwnds_module/urik_kg_bwwell.are new file mode 100644 index 000000000..f97d8c64a Binary files /dev/null and b/nwnds_module/urik_kg_bwwell.are differ diff --git a/nwnds_module/urik_kg_bwwell.gic b/nwnds_module/urik_kg_bwwell.gic new file mode 100644 index 000000000..aee873d02 Binary files /dev/null and b/nwnds_module/urik_kg_bwwell.gic differ diff --git a/nwnds_module/urik_kg_bwwell.git b/nwnds_module/urik_kg_bwwell.git new file mode 100644 index 000000000..e6ddf3158 Binary files /dev/null and b/nwnds_module/urik_kg_bwwell.git differ diff --git a/nwnds_module/urik_kg_olaes.are b/nwnds_module/urik_kg_olaes.are new file mode 100644 index 000000000..337774a03 Binary files /dev/null and b/nwnds_module/urik_kg_olaes.are differ diff --git a/nwnds_module/urik_kg_olaes.gic b/nwnds_module/urik_kg_olaes.gic new file mode 100644 index 000000000..f708c31ba Binary files /dev/null and b/nwnds_module/urik_kg_olaes.gic differ diff --git a/nwnds_module/urik_kg_olaes.git b/nwnds_module/urik_kg_olaes.git new file mode 100644 index 000000000..6e695de9c Binary files /dev/null and b/nwnds_module/urik_kg_olaes.git differ diff --git a/nwnds_module/urik_kg_shubbys.are b/nwnds_module/urik_kg_shubbys.are new file mode 100644 index 000000000..979f13064 Binary files /dev/null and b/nwnds_module/urik_kg_shubbys.are differ diff --git a/nwnds_module/urik_kg_shubbys.gic b/nwnds_module/urik_kg_shubbys.gic new file mode 100644 index 000000000..b6c9ac06a Binary files /dev/null and b/nwnds_module/urik_kg_shubbys.gic differ diff --git a/nwnds_module/urik_kg_shubbys.git b/nwnds_module/urik_kg_shubbys.git new file mode 100644 index 000000000..d52ad2b7c Binary files /dev/null and b/nwnds_module/urik_kg_shubbys.git differ diff --git a/nwnds_module/urik_kg_teths.are b/nwnds_module/urik_kg_teths.are new file mode 100644 index 000000000..827581455 Binary files /dev/null and b/nwnds_module/urik_kg_teths.are differ diff --git a/nwnds_module/urik_kg_teths.gic b/nwnds_module/urik_kg_teths.gic new file mode 100644 index 000000000..618c6db53 Binary files /dev/null and b/nwnds_module/urik_kg_teths.gic differ diff --git a/nwnds_module/urik_kg_teths.git b/nwnds_module/urik_kg_teths.git new file mode 100644 index 000000000..059623d3d Binary files /dev/null and b/nwnds_module/urik_kg_teths.git differ diff --git a/nwnds_module/urik_kg_tiredtrv.are b/nwnds_module/urik_kg_tiredtrv.are new file mode 100644 index 000000000..42a7499f6 Binary files /dev/null and b/nwnds_module/urik_kg_tiredtrv.are differ diff --git a/nwnds_module/urik_kg_tiredtrv.gic b/nwnds_module/urik_kg_tiredtrv.gic new file mode 100644 index 000000000..bfc0598df Binary files /dev/null and b/nwnds_module/urik_kg_tiredtrv.gic differ diff --git a/nwnds_module/urik_kg_tiredtrv.git b/nwnds_module/urik_kg_tiredtrv.git new file mode 100644 index 000000000..3317d5a53 Binary files /dev/null and b/nwnds_module/urik_kg_tiredtrv.git differ diff --git a/nwnds_module/urik_kg_yallas.are b/nwnds_module/urik_kg_yallas.are new file mode 100644 index 000000000..ce5801c9d Binary files /dev/null and b/nwnds_module/urik_kg_yallas.are differ diff --git a/nwnds_module/urik_kg_yallas.gic b/nwnds_module/urik_kg_yallas.gic new file mode 100644 index 000000000..6cdcac21f Binary files /dev/null and b/nwnds_module/urik_kg_yallas.gic differ diff --git a/nwnds_module/urik_kg_yallas.git b/nwnds_module/urik_kg_yallas.git new file mode 100644 index 000000000..6c4db7792 Binary files /dev/null and b/nwnds_module/urik_kg_yallas.git differ diff --git a/nwnds_module/urik_kingsgate.are b/nwnds_module/urik_kingsgate.are new file mode 100644 index 000000000..4ed9281e4 Binary files /dev/null and b/nwnds_module/urik_kingsgate.are differ diff --git a/nwnds_module/urik_kingsgate.gic b/nwnds_module/urik_kingsgate.gic new file mode 100644 index 000000000..612807f81 Binary files /dev/null and b/nwnds_module/urik_kingsgate.gic differ diff --git a/nwnds_module/urik_kingsgate.git b/nwnds_module/urik_kingsgate.git new file mode 100644 index 000000000..a05863111 Binary files /dev/null and b/nwnds_module/urik_kingsgate.git differ diff --git a/nwnds_module/urik_obsidgate.are b/nwnds_module/urik_obsidgate.are new file mode 100644 index 000000000..cf373db4f Binary files /dev/null and b/nwnds_module/urik_obsidgate.are differ diff --git a/nwnds_module/urik_obsidgate.gic b/nwnds_module/urik_obsidgate.gic new file mode 100644 index 000000000..f96683eb8 Binary files /dev/null and b/nwnds_module/urik_obsidgate.gic differ diff --git a/nwnds_module/urik_obsidgate.git b/nwnds_module/urik_obsidgate.git new file mode 100644 index 000000000..53a466905 Binary files /dev/null and b/nwnds_module/urik_obsidgate.git differ diff --git a/nwnds_module/urik_og_armory.are b/nwnds_module/urik_og_armory.are new file mode 100644 index 000000000..38e3e4415 Binary files /dev/null and b/nwnds_module/urik_og_armory.are differ diff --git a/nwnds_module/urik_og_armory.gic b/nwnds_module/urik_og_armory.gic new file mode 100644 index 000000000..f828f5d44 Binary files /dev/null and b/nwnds_module/urik_og_armory.gic differ diff --git a/nwnds_module/urik_og_armory.git b/nwnds_module/urik_og_armory.git new file mode 100644 index 000000000..74dc5d441 Binary files /dev/null and b/nwnds_module/urik_og_armory.git differ diff --git a/nwnds_module/urik_og_caravan.are b/nwnds_module/urik_og_caravan.are new file mode 100644 index 000000000..83aebc31b Binary files /dev/null and b/nwnds_module/urik_og_caravan.are differ diff --git a/nwnds_module/urik_og_caravan.gic b/nwnds_module/urik_og_caravan.gic new file mode 100644 index 000000000..86fa0a457 Binary files /dev/null and b/nwnds_module/urik_og_caravan.gic differ diff --git a/nwnds_module/urik_og_caravan.git b/nwnds_module/urik_og_caravan.git new file mode 100644 index 000000000..015f78add Binary files /dev/null and b/nwnds_module/urik_og_caravan.git differ diff --git a/nwnds_module/urik_og_clothing.are b/nwnds_module/urik_og_clothing.are new file mode 100644 index 000000000..dcb8b2d54 Binary files /dev/null and b/nwnds_module/urik_og_clothing.are differ diff --git a/nwnds_module/urik_og_clothing.gic b/nwnds_module/urik_og_clothing.gic new file mode 100644 index 000000000..70c4f2a1e Binary files /dev/null and b/nwnds_module/urik_og_clothing.gic differ diff --git a/nwnds_module/urik_og_clothing.git b/nwnds_module/urik_og_clothing.git new file mode 100644 index 000000000..498d25b40 Binary files /dev/null and b/nwnds_module/urik_og_clothing.git differ diff --git a/nwnds_module/urik_og_draqoman.are b/nwnds_module/urik_og_draqoman.are new file mode 100644 index 000000000..6fbd4ae7b Binary files /dev/null and b/nwnds_module/urik_og_draqoman.are differ diff --git a/nwnds_module/urik_og_draqoman.gic b/nwnds_module/urik_og_draqoman.gic new file mode 100644 index 000000000..86fa0a457 Binary files /dev/null and b/nwnds_module/urik_og_draqoman.gic differ diff --git a/nwnds_module/urik_og_draqoman.git b/nwnds_module/urik_og_draqoman.git new file mode 100644 index 000000000..3fa3d8936 Binary files /dev/null and b/nwnds_module/urik_og_draqoman.git differ diff --git a/nwnds_module/urik_og_hospital.are b/nwnds_module/urik_og_hospital.are new file mode 100644 index 000000000..54d3418d5 Binary files /dev/null and b/nwnds_module/urik_og_hospital.are differ diff --git a/nwnds_module/urik_og_hospital.gic b/nwnds_module/urik_og_hospital.gic new file mode 100644 index 000000000..5cf8e55ce Binary files /dev/null and b/nwnds_module/urik_og_hospital.gic differ diff --git a/nwnds_module/urik_og_hospital.git b/nwnds_module/urik_og_hospital.git new file mode 100644 index 000000000..cf5d63407 Binary files /dev/null and b/nwnds_module/urik_og_hospital.git differ diff --git a/nwnds_module/urik_og_jewelry.are b/nwnds_module/urik_og_jewelry.are new file mode 100644 index 000000000..6817e07c1 Binary files /dev/null and b/nwnds_module/urik_og_jewelry.are differ diff --git a/nwnds_module/urik_og_jewelry.gic b/nwnds_module/urik_og_jewelry.gic new file mode 100644 index 000000000..c52a63149 Binary files /dev/null and b/nwnds_module/urik_og_jewelry.gic differ diff --git a/nwnds_module/urik_og_jewelry.git b/nwnds_module/urik_og_jewelry.git new file mode 100644 index 000000000..948b18de2 Binary files /dev/null and b/nwnds_module/urik_og_jewelry.git differ diff --git a/nwnds_module/urik_og_kargs.are b/nwnds_module/urik_og_kargs.are new file mode 100644 index 000000000..aae9b33be Binary files /dev/null and b/nwnds_module/urik_og_kargs.are differ diff --git a/nwnds_module/urik_og_kargs.gic b/nwnds_module/urik_og_kargs.gic new file mode 100644 index 000000000..16cf712a4 Binary files /dev/null and b/nwnds_module/urik_og_kargs.gic differ diff --git a/nwnds_module/urik_og_kargs.git b/nwnds_module/urik_og_kargs.git new file mode 100644 index 000000000..be00eac9b Binary files /dev/null and b/nwnds_module/urik_og_kargs.git differ diff --git a/nwnds_module/urik_og_prison.are b/nwnds_module/urik_og_prison.are new file mode 100644 index 000000000..b1bb5a08d Binary files /dev/null and b/nwnds_module/urik_og_prison.are differ diff --git a/nwnds_module/urik_og_prison.gic b/nwnds_module/urik_og_prison.gic new file mode 100644 index 000000000..669bfe8c5 Binary files /dev/null and b/nwnds_module/urik_og_prison.gic differ diff --git a/nwnds_module/urik_og_prison.git b/nwnds_module/urik_og_prison.git new file mode 100644 index 000000000..40b391ea7 Binary files /dev/null and b/nwnds_module/urik_og_prison.git differ diff --git a/nwnds_module/urik_og_rogans.are b/nwnds_module/urik_og_rogans.are new file mode 100644 index 000000000..a4d0fd40f Binary files /dev/null and b/nwnds_module/urik_og_rogans.are differ diff --git a/nwnds_module/urik_og_rogans.gic b/nwnds_module/urik_og_rogans.gic new file mode 100644 index 000000000..886e57088 Binary files /dev/null and b/nwnds_module/urik_og_rogans.gic differ diff --git a/nwnds_module/urik_og_rogans.git b/nwnds_module/urik_og_rogans.git new file mode 100644 index 000000000..50edd150c Binary files /dev/null and b/nwnds_module/urik_og_rogans.git differ diff --git a/nwnds_module/urik_og_ucilarms.are b/nwnds_module/urik_og_ucilarms.are new file mode 100644 index 000000000..cc83f2d49 Binary files /dev/null and b/nwnds_module/urik_og_ucilarms.are differ diff --git a/nwnds_module/urik_og_ucilarms.gic b/nwnds_module/urik_og_ucilarms.gic new file mode 100644 index 000000000..f995ee62d Binary files /dev/null and b/nwnds_module/urik_og_ucilarms.gic differ diff --git a/nwnds_module/urik_og_ucilarms.git b/nwnds_module/urik_og_ucilarms.git new file mode 100644 index 000000000..10f89c187 Binary files /dev/null and b/nwnds_module/urik_og_ucilarms.git differ diff --git a/nwnds_module/urik_sg_armory.are b/nwnds_module/urik_sg_armory.are new file mode 100644 index 000000000..79c6152eb Binary files /dev/null and b/nwnds_module/urik_sg_armory.are differ diff --git a/nwnds_module/urik_sg_armory.gic b/nwnds_module/urik_sg_armory.gic new file mode 100644 index 000000000..ddd73e520 Binary files /dev/null and b/nwnds_module/urik_sg_armory.gic differ diff --git a/nwnds_module/urik_sg_armory.git b/nwnds_module/urik_sg_armory.git new file mode 100644 index 000000000..055da896e Binary files /dev/null and b/nwnds_module/urik_sg_armory.git differ diff --git a/nwnds_module/urik_slavegate.are b/nwnds_module/urik_slavegate.are new file mode 100644 index 000000000..f36c92913 Binary files /dev/null and b/nwnds_module/urik_slavegate.are differ diff --git a/nwnds_module/urik_slavegate.gic b/nwnds_module/urik_slavegate.gic new file mode 100644 index 000000000..529fa27d2 Binary files /dev/null and b/nwnds_module/urik_slavegate.gic differ diff --git a/nwnds_module/urik_slavegate.git b/nwnds_module/urik_slavegate.git new file mode 100644 index 000000000..4494a1ee5 Binary files /dev/null and b/nwnds_module/urik_slavegate.git differ diff --git a/nwnds_module/urik_thedrygulch.are b/nwnds_module/urik_thedrygulch.are new file mode 100644 index 000000000..de06aef67 Binary files /dev/null and b/nwnds_module/urik_thedrygulch.are differ diff --git a/nwnds_module/urik_thedrygulch.gic b/nwnds_module/urik_thedrygulch.gic new file mode 100644 index 000000000..4a4c5eb54 Binary files /dev/null and b/nwnds_module/urik_thedrygulch.gic differ diff --git a/nwnds_module/urik_thedrygulch.git b/nwnds_module/urik_thedrygulch.git new file mode 100644 index 000000000..4f94ac864 Binary files /dev/null and b/nwnds_module/urik_thedrygulch.git differ diff --git a/nwnds_module/urik_trade_rte01.are b/nwnds_module/urik_trade_rte01.are new file mode 100644 index 000000000..d64b144ee Binary files /dev/null and b/nwnds_module/urik_trade_rte01.are differ diff --git a/nwnds_module/urik_trade_rte01.gic b/nwnds_module/urik_trade_rte01.gic new file mode 100644 index 000000000..4a28c4739 Binary files /dev/null and b/nwnds_module/urik_trade_rte01.gic differ diff --git a/nwnds_module/urik_trade_rte01.git b/nwnds_module/urik_trade_rte01.git new file mode 100644 index 000000000..724e7d22d Binary files /dev/null and b/nwnds_module/urik_trade_rte01.git differ diff --git a/nwnds_module/urik_trade_rte02.are b/nwnds_module/urik_trade_rte02.are new file mode 100644 index 000000000..37114c13e Binary files /dev/null and b/nwnds_module/urik_trade_rte02.are differ diff --git a/nwnds_module/urik_trade_rte02.gic b/nwnds_module/urik_trade_rte02.gic new file mode 100644 index 000000000..50a66360a Binary files /dev/null and b/nwnds_module/urik_trade_rte02.gic differ diff --git a/nwnds_module/urik_trade_rte02.git b/nwnds_module/urik_trade_rte02.git new file mode 100644 index 000000000..752b62cc1 Binary files /dev/null and b/nwnds_module/urik_trade_rte02.git differ diff --git a/nwnds_module/urik_trade_rte03.are b/nwnds_module/urik_trade_rte03.are new file mode 100644 index 000000000..73a4254e4 Binary files /dev/null and b/nwnds_module/urik_trade_rte03.are differ diff --git a/nwnds_module/urik_trade_rte03.gic b/nwnds_module/urik_trade_rte03.gic new file mode 100644 index 000000000..f0b9fc1fb Binary files /dev/null and b/nwnds_module/urik_trade_rte03.gic differ diff --git a/nwnds_module/urik_trade_rte03.git b/nwnds_module/urik_trade_rte03.git new file mode 100644 index 000000000..65ced1fc0 Binary files /dev/null and b/nwnds_module/urik_trade_rte03.git differ diff --git a/nwnds_module/urik_trade_rte04.are b/nwnds_module/urik_trade_rte04.are new file mode 100644 index 000000000..32e3cf4e0 Binary files /dev/null and b/nwnds_module/urik_trade_rte04.are differ diff --git a/nwnds_module/urik_trade_rte04.gic b/nwnds_module/urik_trade_rte04.gic new file mode 100644 index 000000000..ec4a79817 Binary files /dev/null and b/nwnds_module/urik_trade_rte04.gic differ diff --git a/nwnds_module/urik_trade_rte04.git b/nwnds_module/urik_trade_rte04.git new file mode 100644 index 000000000..f020429af Binary files /dev/null and b/nwnds_module/urik_trade_rte04.git differ diff --git a/nwnds_module/urik_trade_rte05.are b/nwnds_module/urik_trade_rte05.are new file mode 100644 index 000000000..4bda5619e Binary files /dev/null and b/nwnds_module/urik_trade_rte05.are differ diff --git a/nwnds_module/urik_trade_rte05.gic b/nwnds_module/urik_trade_rte05.gic new file mode 100644 index 000000000..426f8c187 Binary files /dev/null and b/nwnds_module/urik_trade_rte05.gic differ diff --git a/nwnds_module/urik_trade_rte05.git b/nwnds_module/urik_trade_rte05.git new file mode 100644 index 000000000..638d17608 Binary files /dev/null and b/nwnds_module/urik_trade_rte05.git differ diff --git a/nwnds_module/urik_va_hq.are b/nwnds_module/urik_va_hq.are new file mode 100644 index 000000000..dadf335fa Binary files /dev/null and b/nwnds_module/urik_va_hq.are differ diff --git a/nwnds_module/urik_va_hq.gic b/nwnds_module/urik_va_hq.gic new file mode 100644 index 000000000..a4640989b Binary files /dev/null and b/nwnds_module/urik_va_hq.gic differ diff --git a/nwnds_module/urik_va_hq.git b/nwnds_module/urik_va_hq.git new file mode 100644 index 000000000..de3d5522d Binary files /dev/null and b/nwnds_module/urik_va_hq.git differ diff --git a/nwnds_module/urikbel_sewers.are b/nwnds_module/urikbel_sewers.are new file mode 100644 index 000000000..44e4cf9e7 Binary files /dev/null and b/nwnds_module/urikbel_sewers.are differ diff --git a/nwnds_module/urikbel_sewers.gic b/nwnds_module/urikbel_sewers.gic new file mode 100644 index 000000000..489125204 Binary files /dev/null and b/nwnds_module/urikbel_sewers.gic differ diff --git a/nwnds_module/urikbel_sewers.git b/nwnds_module/urikbel_sewers.git new file mode 100644 index 000000000..7e1a2e053 Binary files /dev/null and b/nwnds_module/urikbel_sewers.git differ diff --git a/nwnds_module/urikbel_yuanti.are b/nwnds_module/urikbel_yuanti.are new file mode 100644 index 000000000..c9dd398bb Binary files /dev/null and b/nwnds_module/urikbel_yuanti.are differ diff --git a/nwnds_module/urikbel_yuanti.gic b/nwnds_module/urikbel_yuanti.gic new file mode 100644 index 000000000..28dc34935 Binary files /dev/null and b/nwnds_module/urikbel_yuanti.gic differ diff --git a/nwnds_module/urikbel_yuanti.git b/nwnds_module/urikbel_yuanti.git new file mode 100644 index 000000000..849375376 Binary files /dev/null and b/nwnds_module/urikbel_yuanti.git differ diff --git a/nwnds_module/utyr_crimshrine0.are b/nwnds_module/utyr_crimshrine0.are new file mode 100644 index 000000000..bcd56bb7d Binary files /dev/null and b/nwnds_module/utyr_crimshrine0.are differ diff --git a/nwnds_module/utyr_crimshrine0.gic b/nwnds_module/utyr_crimshrine0.gic new file mode 100644 index 000000000..270642c0a Binary files /dev/null and b/nwnds_module/utyr_crimshrine0.gic differ diff --git a/nwnds_module/utyr_crimshrine0.git b/nwnds_module/utyr_crimshrine0.git new file mode 100644 index 000000000..cecaee0cd Binary files /dev/null and b/nwnds_module/utyr_crimshrine0.git differ diff --git a/nwnds_module/utyr_crimshrine1.are b/nwnds_module/utyr_crimshrine1.are new file mode 100644 index 000000000..5c504297e Binary files /dev/null and b/nwnds_module/utyr_crimshrine1.are differ diff --git a/nwnds_module/utyr_crimshrine1.gic b/nwnds_module/utyr_crimshrine1.gic new file mode 100644 index 000000000..18321032f Binary files /dev/null and b/nwnds_module/utyr_crimshrine1.gic differ diff --git a/nwnds_module/utyr_crimshrine1.git b/nwnds_module/utyr_crimshrine1.git new file mode 100644 index 000000000..019fee329 Binary files /dev/null and b/nwnds_module/utyr_crimshrine1.git differ diff --git a/nwnds_module/utyr_crimshrine2.are b/nwnds_module/utyr_crimshrine2.are new file mode 100644 index 000000000..4cd7e5d34 Binary files /dev/null and b/nwnds_module/utyr_crimshrine2.are differ diff --git a/nwnds_module/utyr_crimshrine2.gic b/nwnds_module/utyr_crimshrine2.gic new file mode 100644 index 000000000..b283b5ed3 Binary files /dev/null and b/nwnds_module/utyr_crimshrine2.gic differ diff --git a/nwnds_module/utyr_crimshrine2.git b/nwnds_module/utyr_crimshrine2.git new file mode 100644 index 000000000..75a7e70f0 Binary files /dev/null and b/nwnds_module/utyr_crimshrine2.git differ diff --git a/nwnds_module/utyr_deadrevenge.are b/nwnds_module/utyr_deadrevenge.are new file mode 100644 index 000000000..2fc76e0a2 Binary files /dev/null and b/nwnds_module/utyr_deadrevenge.are differ diff --git a/nwnds_module/utyr_deadrevenge.gic b/nwnds_module/utyr_deadrevenge.gic new file mode 100644 index 000000000..9fced7caa Binary files /dev/null and b/nwnds_module/utyr_deadrevenge.gic differ diff --git a/nwnds_module/utyr_deadrevenge.git b/nwnds_module/utyr_deadrevenge.git new file mode 100644 index 000000000..7e2f9228c Binary files /dev/null and b/nwnds_module/utyr_deadrevenge.git differ diff --git a/nwnds_module/utyr_hejkincave.are b/nwnds_module/utyr_hejkincave.are new file mode 100644 index 000000000..36c75498e Binary files /dev/null and b/nwnds_module/utyr_hejkincave.are differ diff --git a/nwnds_module/utyr_hejkincave.gic b/nwnds_module/utyr_hejkincave.gic new file mode 100644 index 000000000..7a7e617bc Binary files /dev/null and b/nwnds_module/utyr_hejkincave.gic differ diff --git a/nwnds_module/utyr_hejkincave.git b/nwnds_module/utyr_hejkincave.git new file mode 100644 index 000000000..c26ea4079 Binary files /dev/null and b/nwnds_module/utyr_hejkincave.git differ diff --git a/nwnds_module/utyr_illithidcel.are b/nwnds_module/utyr_illithidcel.are new file mode 100644 index 000000000..b2b0c44e8 Binary files /dev/null and b/nwnds_module/utyr_illithidcel.are differ diff --git a/nwnds_module/utyr_illithidcel.gic b/nwnds_module/utyr_illithidcel.gic new file mode 100644 index 000000000..bc58c6cb0 Binary files /dev/null and b/nwnds_module/utyr_illithidcel.gic differ diff --git a/nwnds_module/utyr_illithidcel.git b/nwnds_module/utyr_illithidcel.git new file mode 100644 index 000000000..92d28e013 Binary files /dev/null and b/nwnds_module/utyr_illithidcel.git differ diff --git a/nwnds_module/utyr_sewerhide01.are b/nwnds_module/utyr_sewerhide01.are new file mode 100644 index 000000000..f11bca243 Binary files /dev/null and b/nwnds_module/utyr_sewerhide01.are differ diff --git a/nwnds_module/utyr_sewerhide01.gic b/nwnds_module/utyr_sewerhide01.gic new file mode 100644 index 000000000..e17208274 Binary files /dev/null and b/nwnds_module/utyr_sewerhide01.gic differ diff --git a/nwnds_module/utyr_sewerhide01.git b/nwnds_module/utyr_sewerhide01.git new file mode 100644 index 000000000..5d2829677 Binary files /dev/null and b/nwnds_module/utyr_sewerhide01.git differ diff --git a/nwnds_module/utyr_sewerhide02.are b/nwnds_module/utyr_sewerhide02.are new file mode 100644 index 000000000..c3084a009 Binary files /dev/null and b/nwnds_module/utyr_sewerhide02.are differ diff --git a/nwnds_module/utyr_sewerhide02.gic b/nwnds_module/utyr_sewerhide02.gic new file mode 100644 index 000000000..ab4eea226 Binary files /dev/null and b/nwnds_module/utyr_sewerhide02.gic differ diff --git a/nwnds_module/utyr_sewerhide02.git b/nwnds_module/utyr_sewerhide02.git new file mode 100644 index 000000000..7bd21cd1f Binary files /dev/null and b/nwnds_module/utyr_sewerhide02.git differ diff --git a/nwnds_module/utyr_sewernet01.are b/nwnds_module/utyr_sewernet01.are new file mode 100644 index 000000000..1138734b5 Binary files /dev/null and b/nwnds_module/utyr_sewernet01.are differ diff --git a/nwnds_module/utyr_sewernet01.gic b/nwnds_module/utyr_sewernet01.gic new file mode 100644 index 000000000..42f024b24 Binary files /dev/null and b/nwnds_module/utyr_sewernet01.gic differ diff --git a/nwnds_module/utyr_sewernet01.git b/nwnds_module/utyr_sewernet01.git new file mode 100644 index 000000000..0a0e7a653 Binary files /dev/null and b/nwnds_module/utyr_sewernet01.git differ diff --git a/nwnds_module/utyr_sewernet02.are b/nwnds_module/utyr_sewernet02.are new file mode 100644 index 000000000..341513098 Binary files /dev/null and b/nwnds_module/utyr_sewernet02.are differ diff --git a/nwnds_module/utyr_sewernet02.gic b/nwnds_module/utyr_sewernet02.gic new file mode 100644 index 000000000..b54adfd1f Binary files /dev/null and b/nwnds_module/utyr_sewernet02.gic differ diff --git a/nwnds_module/utyr_sewernet02.git b/nwnds_module/utyr_sewernet02.git new file mode 100644 index 000000000..1a747b326 Binary files /dev/null and b/nwnds_module/utyr_sewernet02.git differ diff --git a/nwnds_module/utyr_sewernet03.are b/nwnds_module/utyr_sewernet03.are new file mode 100644 index 000000000..8e1210cb1 Binary files /dev/null and b/nwnds_module/utyr_sewernet03.are differ diff --git a/nwnds_module/utyr_sewernet03.gic b/nwnds_module/utyr_sewernet03.gic new file mode 100644 index 000000000..0ca6f6acf Binary files /dev/null and b/nwnds_module/utyr_sewernet03.gic differ diff --git a/nwnds_module/utyr_sewernet03.git b/nwnds_module/utyr_sewernet03.git new file mode 100644 index 000000000..a7e7e5074 Binary files /dev/null and b/nwnds_module/utyr_sewernet03.git differ diff --git a/nwnds_module/utyr_thesorrows.are b/nwnds_module/utyr_thesorrows.are new file mode 100644 index 000000000..c7c9923c5 Binary files /dev/null and b/nwnds_module/utyr_thesorrows.are differ diff --git a/nwnds_module/utyr_thesorrows.gic b/nwnds_module/utyr_thesorrows.gic new file mode 100644 index 000000000..33416d6b6 Binary files /dev/null and b/nwnds_module/utyr_thesorrows.gic differ diff --git a/nwnds_module/utyr_thesorrows.git b/nwnds_module/utyr_thesorrows.git new file mode 100644 index 000000000..233006dd9 Binary files /dev/null and b/nwnds_module/utyr_thesorrows.git differ diff --git a/nwnds_module/va2.ncs b/nwnds_module/va2.ncs new file mode 100644 index 000000000..203e2bf4c Binary files /dev/null and b/nwnds_module/va2.ncs differ diff --git a/nwnds_module/va2.nss b/nwnds_module/va2.nss new file mode 100644 index 000000000..60af94696 --- /dev/null +++ b/nwnds_module/va2.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName va2 +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 12:34:40 AM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "VAQ") == 1)) + return FALSE; + + return TRUE; +} diff --git a/nwnds_module/vajaryx.ncs b/nwnds_module/vajaryx.ncs new file mode 100644 index 000000000..b07ad00c0 Binary files /dev/null and b/nwnds_module/vajaryx.ncs differ diff --git a/nwnds_module/vajaryx.nss b/nwnds_module/vajaryx.nss new file mode 100644 index 000000000..1a9677ccc --- /dev/null +++ b/nwnds_module/vajaryx.nss @@ -0,0 +1,16 @@ +//:://///////////////////////////////////////////// +//:: FileName vajaryx +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/20/02 6:24:37 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if((GetLocalInt(GetPCSpeaker(), "VA") == 3)) + return TRUE; + + return FALSE; +} diff --git a/nwnds_module/vakey.ncs b/nwnds_module/vakey.ncs new file mode 100644 index 000000000..ff3fc70c2 Binary files /dev/null and b/nwnds_module/vakey.ncs differ diff --git a/nwnds_module/vakey.nss b/nwnds_module/vakey.nss new file mode 100644 index 000000000..b320b4350 --- /dev/null +++ b/nwnds_module/vakey.nss @@ -0,0 +1,13 @@ +//:://///////////////////////////////////////////// +//:: FileName vakey +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/19/02 11:59:06 PM +//::////////////////////////////////////////////// +void main() +{ + // Give the speaker the items + CreateItemOnObject("FAC_KEY_TYRVA", GetPCSpeaker(), 1); + +} diff --git a/nwnds_module/vampirespawn_f.utc b/nwnds_module/vampirespawn_f.utc new file mode 100644 index 000000000..fa91c94a2 Binary files /dev/null and b/nwnds_module/vampirespawn_f.utc differ diff --git a/nwnds_module/vampirespawn_m.utc b/nwnds_module/vampirespawn_m.utc new file mode 100644 index 000000000..687feb5b3 Binary files /dev/null and b/nwnds_module/vampirespawn_m.utc differ diff --git a/nwnds_module/vilstrak001.utc b/nwnds_module/vilstrak001.utc new file mode 100644 index 000000000..6209677f3 Binary files /dev/null and b/nwnds_module/vilstrak001.utc differ diff --git a/nwnds_module/voidwraith001.utc b/nwnds_module/voidwraith001.utc new file mode 100644 index 000000000..c59ca533e Binary files /dev/null and b/nwnds_module/voidwraith001.utc differ diff --git a/nwnds_module/voidwraithhide01.uti b/nwnds_module/voidwraithhide01.uti new file mode 100644 index 000000000..6c7142b71 Binary files /dev/null and b/nwnds_module/voidwraithhide01.uti differ diff --git a/nwnds_module/voidwrathslam.uti b/nwnds_module/voidwrathslam.uti new file mode 100644 index 000000000..8de04258d Binary files /dev/null and b/nwnds_module/voidwrathslam.uti differ diff --git a/nwnds_module/votls_s_shore.are b/nwnds_module/votls_s_shore.are new file mode 100644 index 000000000..db64f095b Binary files /dev/null and b/nwnds_module/votls_s_shore.are differ diff --git a/nwnds_module/votls_s_shore.gic b/nwnds_module/votls_s_shore.gic new file mode 100644 index 000000000..1f5017167 Binary files /dev/null and b/nwnds_module/votls_s_shore.gic differ diff --git a/nwnds_module/votls_s_shore.git b/nwnds_module/votls_s_shore.git new file mode 100644 index 000000000..c4b9fa2ff Binary files /dev/null and b/nwnds_module/votls_s_shore.git differ diff --git a/nwnds_module/votls_sw_shore.are b/nwnds_module/votls_sw_shore.are new file mode 100644 index 000000000..bfaa949ba Binary files /dev/null and b/nwnds_module/votls_sw_shore.are differ diff --git a/nwnds_module/votls_sw_shore.gic b/nwnds_module/votls_sw_shore.gic new file mode 100644 index 000000000..831fa8663 Binary files /dev/null and b/nwnds_module/votls_sw_shore.gic differ diff --git a/nwnds_module/votls_sw_shore.git b/nwnds_module/votls_sw_shore.git new file mode 100644 index 000000000..f509d5e24 Binary files /dev/null and b/nwnds_module/votls_sw_shore.git differ diff --git a/nwnds_module/warrensthug001.utc b/nwnds_module/warrensthug001.utc new file mode 100644 index 000000000..86587949b Binary files /dev/null and b/nwnds_module/warrensthug001.utc differ diff --git a/nwnds_module/water.uti b/nwnds_module/water.uti new file mode 100644 index 000000000..776a28616 Binary files /dev/null and b/nwnds_module/water.uti differ diff --git a/nwnds_module/water_cleric.ncs b/nwnds_module/water_cleric.ncs new file mode 100644 index 000000000..b66868a1f Binary files /dev/null and b/nwnds_module/water_cleric.ncs differ diff --git a/nwnds_module/water_cleric.nss b/nwnds_module/water_cleric.nss new file mode 100644 index 000000000..3c5a210ca --- /dev/null +++ b/nwnds_module/water_cleric.nss @@ -0,0 +1,24 @@ +// Use x2_it_example as a base for building more complicated items, that is items +// that will fire a script on more than one event +#include "x2_inc_switches" +void main() +{ + int nEvent =GetUserDefinedItemEventNumber(); + object oPC; + object oItem; + + // * This code runs when the item is equipped + // * Note that this event fires PCs only + if (nEvent ==X2_ITEM_EVENT_EQUIP) + { + + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + // If they don't have Water domain, unequip the item + if(!GetHasFeat(FEAT_WATER_DOMAIN_POWER, oPC)) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + } +} diff --git a/nwnds_module/waterdrakeprops.uti b/nwnds_module/waterdrakeprops.uti new file mode 100644 index 000000000..e893687a9 Binary files /dev/null and b/nwnds_module/waterdrakeprops.uti differ diff --git a/nwnds_module/waypointpalcus.itp b/nwnds_module/waypointpalcus.itp new file mode 100644 index 000000000..d9a2449b0 Binary files /dev/null and b/nwnds_module/waypointpalcus.itp differ diff --git a/nwnds_module/wbthief.ncs b/nwnds_module/wbthief.ncs new file mode 100644 index 000000000..617b7488d Binary files /dev/null and b/nwnds_module/wbthief.ncs differ diff --git a/nwnds_module/wbthief.nss b/nwnds_module/wbthief.nss new file mode 100644 index 000000000..95e2e9190 --- /dev/null +++ b/nwnds_module/wbthief.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: FileName wbthief +//::////////////////////////////////////////////// +//::////////////////////////////////////////////// +//:: Created By: Script Wizard +//:: Created On: 8/10/02 11:21:45 PM +//::////////////////////////////////////////////// +int StartingConditional() +{ + + // Inspect local variables + if(!(GetLocalInt(GetPCSpeaker(), "thievesquests") == 1)) + return FALSE; + object oItemToTake = GetItemPossessedBy(GetPCSpeaker(), "FAC_ITPRNG_THIEF"); + if(GetIsObjectValid(oItemToTake) == TRUE) + return FALSE; + return TRUE; +} diff --git a/nwnds_module/wd_badlands.are b/nwnds_module/wd_badlands.are new file mode 100644 index 000000000..eef3770e8 Binary files /dev/null and b/nwnds_module/wd_badlands.are differ diff --git a/nwnds_module/wd_badlands.gic b/nwnds_module/wd_badlands.gic new file mode 100644 index 000000000..ccea50634 Binary files /dev/null and b/nwnds_module/wd_badlands.gic differ diff --git a/nwnds_module/wd_badlands.git b/nwnds_module/wd_badlands.git new file mode 100644 index 000000000..0a24e2871 Binary files /dev/null and b/nwnds_module/wd_badlands.git differ diff --git a/nwnds_module/wd_banditcamp.are b/nwnds_module/wd_banditcamp.are new file mode 100644 index 000000000..5617ea279 Binary files /dev/null and b/nwnds_module/wd_banditcamp.are differ diff --git a/nwnds_module/wd_banditcamp.gic b/nwnds_module/wd_banditcamp.gic new file mode 100644 index 000000000..4daf87efd Binary files /dev/null and b/nwnds_module/wd_banditcamp.gic differ diff --git a/nwnds_module/wd_banditcamp.git b/nwnds_module/wd_banditcamp.git new file mode 100644 index 000000000..6bcfb3868 Binary files /dev/null and b/nwnds_module/wd_banditcamp.git differ diff --git a/nwnds_module/wd_westpass.are b/nwnds_module/wd_westpass.are new file mode 100644 index 000000000..de28238ef Binary files /dev/null and b/nwnds_module/wd_westpass.are differ diff --git a/nwnds_module/wd_westpass.gic b/nwnds_module/wd_westpass.gic new file mode 100644 index 000000000..7de3f2ed8 Binary files /dev/null and b/nwnds_module/wd_westpass.gic differ diff --git a/nwnds_module/wd_westpass.git b/nwnds_module/wd_westpass.git new file mode 100644 index 000000000..f31f84606 Binary files /dev/null and b/nwnds_module/wd_westpass.git differ diff --git a/nwnds_module/wheep001.utc b/nwnds_module/wheep001.utc new file mode 100644 index 000000000..a16429ba5 Binary files /dev/null and b/nwnds_module/wheep001.utc differ diff --git a/nwnds_module/wheepbite001.uti b/nwnds_module/wheepbite001.uti new file mode 100644 index 000000000..abe4bc599 Binary files /dev/null and b/nwnds_module/wheepbite001.uti differ diff --git a/nwnds_module/wheepclaw001.uti b/nwnds_module/wheepclaw001.uti new file mode 100644 index 000000000..e58d9b1d7 Binary files /dev/null and b/nwnds_module/wheepclaw001.uti differ diff --git a/nwnds_module/wheephide001.uti b/nwnds_module/wheephide001.uti new file mode 100644 index 000000000..37adae983 Binary files /dev/null and b/nwnds_module/wheephide001.uti differ diff --git a/nwnds_module/wightspawn.utc b/nwnds_module/wightspawn.utc new file mode 100644 index 000000000..d29bdf26b Binary files /dev/null and b/nwnds_module/wightspawn.utc differ diff --git a/nwnds_module/wildmul001.utc b/nwnds_module/wildmul001.utc new file mode 100644 index 000000000..f98cfc088 Binary files /dev/null and b/nwnds_module/wildmul001.utc differ diff --git a/nwnds_module/wildmul002.utc b/nwnds_module/wildmul002.utc new file mode 100644 index 000000000..29ae108fc Binary files /dev/null and b/nwnds_module/wildmul002.utc differ diff --git a/nwnds_module/wildmul003.utc b/nwnds_module/wildmul003.utc new file mode 100644 index 000000000..cae845bb7 Binary files /dev/null and b/nwnds_module/wildmul003.utc differ diff --git a/nwnds_module/wind_walker_hide.uti b/nwnds_module/wind_walker_hide.uti new file mode 100644 index 000000000..8e4e16197 Binary files /dev/null and b/nwnds_module/wind_walker_hide.uti differ diff --git a/nwnds_module/windscythe.uti b/nwnds_module/windscythe.uti new file mode 100644 index 000000000..4c2697b93 Binary files /dev/null and b/nwnds_module/windscythe.uti differ diff --git a/nwnds_module/windwalker001.utc b/nwnds_module/windwalker001.utc new file mode 100644 index 000000000..1baab6645 Binary files /dev/null and b/nwnds_module/windwalker001.utc differ diff --git a/nwnds_module/winterwight001.utc b/nwnds_module/winterwight001.utc new file mode 100644 index 000000000..a9f4095c9 Binary files /dev/null and b/nwnds_module/winterwight001.utc differ diff --git a/nwnds_module/winwightclaw001.uti b/nwnds_module/winwightclaw001.uti new file mode 100644 index 000000000..6055fc186 Binary files /dev/null and b/nwnds_module/winwightclaw001.uti differ diff --git a/nwnds_module/winwighthide001.uti b/nwnds_module/winwighthide001.uti new file mode 100644 index 000000000..f044d98f9 Binary files /dev/null and b/nwnds_module/winwighthide001.uti differ diff --git a/nwnds_module/wisdomdown.ncs b/nwnds_module/wisdomdown.ncs new file mode 100644 index 000000000..f69aaa99a Binary files /dev/null and b/nwnds_module/wisdomdown.ncs differ diff --git a/nwnds_module/wisdomdown.nss b/nwnds_module/wisdomdown.nss new file mode 100644 index 000000000..458bc9665 --- /dev/null +++ b/nwnds_module/wisdomdown.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_WISDOM, -2); +} diff --git a/nwnds_module/wisdomup.ncs b/nwnds_module/wisdomup.ncs new file mode 100644 index 000000000..bbb48658b Binary files /dev/null and b/nwnds_module/wisdomup.ncs differ diff --git a/nwnds_module/wisdomup.nss b/nwnds_module/wisdomup.nss new file mode 100644 index 000000000..b95ab8c8a --- /dev/null +++ b/nwnds_module/wisdomup.nss @@ -0,0 +1,5 @@ +#include "AdjustAbility" +void main() +{ + AdjustAbility(ABILITY_WISDOM, 2); +} diff --git a/nwnds_module/wm_transition.utt b/nwnds_module/wm_transition.utt new file mode 100644 index 000000000..f0d35d9cc Binary files /dev/null and b/nwnds_module/wm_transition.utt differ diff --git a/nwnds_module/wolfspiderbite.uti b/nwnds_module/wolfspiderbite.uti new file mode 100644 index 000000000..65f813e4d Binary files /dev/null and b/nwnds_module/wolfspiderbite.uti differ diff --git a/nwnds_module/woodgolemhide.uti b/nwnds_module/woodgolemhide.uti new file mode 100644 index 000000000..42584c2b1 Binary files /dev/null and b/nwnds_module/woodgolemhide.uti differ diff --git a/nwnds_module/woodgolemslam.uti b/nwnds_module/woodgolemslam.uti new file mode 100644 index 000000000..806302412 Binary files /dev/null and b/nwnds_module/woodgolemslam.uti differ diff --git a/nwnds_module/wow_at_bounty_01.ncs b/nwnds_module/wow_at_bounty_01.ncs new file mode 100644 index 000000000..3e7e162e6 Binary files /dev/null and b/nwnds_module/wow_at_bounty_01.ncs differ diff --git a/nwnds_module/wow_at_bounty_01.nss b/nwnds_module/wow_at_bounty_01.nss new file mode 100644 index 000000000..278195af4 --- /dev/null +++ b/nwnds_module/wow_at_bounty_01.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(1); +} diff --git a/nwnds_module/wow_at_bounty_02.ncs b/nwnds_module/wow_at_bounty_02.ncs new file mode 100644 index 000000000..6683c4543 Binary files /dev/null and b/nwnds_module/wow_at_bounty_02.ncs differ diff --git a/nwnds_module/wow_at_bounty_02.nss b/nwnds_module/wow_at_bounty_02.nss new file mode 100644 index 000000000..972186c04 --- /dev/null +++ b/nwnds_module/wow_at_bounty_02.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(2); +} diff --git a/nwnds_module/wow_at_bounty_03.ncs b/nwnds_module/wow_at_bounty_03.ncs new file mode 100644 index 000000000..82349438f Binary files /dev/null and b/nwnds_module/wow_at_bounty_03.ncs differ diff --git a/nwnds_module/wow_at_bounty_03.nss b/nwnds_module/wow_at_bounty_03.nss new file mode 100644 index 000000000..3125db475 --- /dev/null +++ b/nwnds_module/wow_at_bounty_03.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(3); +} diff --git a/nwnds_module/wow_at_bounty_04.ncs b/nwnds_module/wow_at_bounty_04.ncs new file mode 100644 index 000000000..7e6a1df6e Binary files /dev/null and b/nwnds_module/wow_at_bounty_04.ncs differ diff --git a/nwnds_module/wow_at_bounty_04.nss b/nwnds_module/wow_at_bounty_04.nss new file mode 100644 index 000000000..d9276b6e6 --- /dev/null +++ b/nwnds_module/wow_at_bounty_04.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(4); +} diff --git a/nwnds_module/wow_at_bounty_05.ncs b/nwnds_module/wow_at_bounty_05.ncs new file mode 100644 index 000000000..c0f4c725a Binary files /dev/null and b/nwnds_module/wow_at_bounty_05.ncs differ diff --git a/nwnds_module/wow_at_bounty_05.nss b/nwnds_module/wow_at_bounty_05.nss new file mode 100644 index 000000000..abb251216 --- /dev/null +++ b/nwnds_module/wow_at_bounty_05.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(5); +} diff --git a/nwnds_module/wow_at_bounty_06.ncs b/nwnds_module/wow_at_bounty_06.ncs new file mode 100644 index 000000000..c657b2526 Binary files /dev/null and b/nwnds_module/wow_at_bounty_06.ncs differ diff --git a/nwnds_module/wow_at_bounty_06.nss b/nwnds_module/wow_at_bounty_06.nss new file mode 100644 index 000000000..f7b3fa7a0 --- /dev/null +++ b/nwnds_module/wow_at_bounty_06.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(6); +} diff --git a/nwnds_module/wow_at_bounty_07.ncs b/nwnds_module/wow_at_bounty_07.ncs new file mode 100644 index 000000000..b14b90541 Binary files /dev/null and b/nwnds_module/wow_at_bounty_07.ncs differ diff --git a/nwnds_module/wow_at_bounty_07.nss b/nwnds_module/wow_at_bounty_07.nss new file mode 100644 index 000000000..3db0f0463 --- /dev/null +++ b/nwnds_module/wow_at_bounty_07.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(7); +} diff --git a/nwnds_module/wow_at_bounty_08.ncs b/nwnds_module/wow_at_bounty_08.ncs new file mode 100644 index 000000000..15bf6e39f Binary files /dev/null and b/nwnds_module/wow_at_bounty_08.ncs differ diff --git a/nwnds_module/wow_at_bounty_08.nss b/nwnds_module/wow_at_bounty_08.nss new file mode 100644 index 000000000..68b39c76b --- /dev/null +++ b/nwnds_module/wow_at_bounty_08.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(8); +} diff --git a/nwnds_module/wow_at_bounty_09.ncs b/nwnds_module/wow_at_bounty_09.ncs new file mode 100644 index 000000000..563b454f8 Binary files /dev/null and b/nwnds_module/wow_at_bounty_09.ncs differ diff --git a/nwnds_module/wow_at_bounty_09.nss b/nwnds_module/wow_at_bounty_09.nss new file mode 100644 index 000000000..4ac8fe5a4 --- /dev/null +++ b/nwnds_module/wow_at_bounty_09.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(9); +} diff --git a/nwnds_module/wow_at_bounty_10.ncs b/nwnds_module/wow_at_bounty_10.ncs new file mode 100644 index 000000000..c4c064586 Binary files /dev/null and b/nwnds_module/wow_at_bounty_10.ncs differ diff --git a/nwnds_module/wow_at_bounty_10.nss b/nwnds_module/wow_at_bounty_10.nss new file mode 100644 index 000000000..1c48d7e66 --- /dev/null +++ b/nwnds_module/wow_at_bounty_10.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_SetChoice(10); +} diff --git a/nwnds_module/wow_at_bounty_en.ncs b/nwnds_module/wow_at_bounty_en.ncs new file mode 100644 index 000000000..b2fa45c5f Binary files /dev/null and b/nwnds_module/wow_at_bounty_en.ncs differ diff --git a/nwnds_module/wow_at_bounty_en.nss b/nwnds_module/wow_at_bounty_en.nss new file mode 100644 index 000000000..268dc4fdd --- /dev/null +++ b/nwnds_module/wow_at_bounty_en.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_ClearBountyVariables(); +} diff --git a/nwnds_module/wow_at_bounty_nx.ncs b/nwnds_module/wow_at_bounty_nx.ncs new file mode 100644 index 000000000..cad5f553f Binary files /dev/null and b/nwnds_module/wow_at_bounty_nx.ncs differ diff --git a/nwnds_module/wow_at_bounty_nx.nss b/nwnds_module/wow_at_bounty_nx.nss new file mode 100644 index 000000000..1aa5d3cdf --- /dev/null +++ b/nwnds_module/wow_at_bounty_nx.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_TurnPage(); +} diff --git a/nwnds_module/wow_at_bounty_pr.ncs b/nwnds_module/wow_at_bounty_pr.ncs new file mode 100644 index 000000000..d0cb5e08f Binary files /dev/null and b/nwnds_module/wow_at_bounty_pr.ncs differ diff --git a/nwnds_module/wow_at_bounty_pr.nss b/nwnds_module/wow_at_bounty_pr.nss new file mode 100644 index 000000000..7ed4db10c --- /dev/null +++ b/nwnds_module/wow_at_bounty_pr.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_TurnPage(FALSE); +} diff --git a/nwnds_module/wow_at_bounty_tb.ncs b/nwnds_module/wow_at_bounty_tb.ncs new file mode 100644 index 000000000..ff897da59 Binary files /dev/null and b/nwnds_module/wow_at_bounty_tb.ncs differ diff --git a/nwnds_module/wow_at_bounty_tb.nss b/nwnds_module/wow_at_bounty_tb.nss new file mode 100644 index 000000000..3135ac701 --- /dev/null +++ b/nwnds_module/wow_at_bounty_tb.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +void main() +{ + wow_AcceptBounty(); +} diff --git a/nwnds_module/wow_bounty.dlg b/nwnds_module/wow_bounty.dlg new file mode 100644 index 000000000..c32c37d6d Binary files /dev/null and b/nwnds_module/wow_bounty.dlg differ diff --git a/nwnds_module/wow_crafting.ncs b/nwnds_module/wow_crafting.ncs new file mode 100644 index 000000000..3c2894d09 Binary files /dev/null and b/nwnds_module/wow_crafting.ncs differ diff --git a/nwnds_module/wow_crafting.nss b/nwnds_module/wow_crafting.nss new file mode 100644 index 000000000..60a728d7d --- /dev/null +++ b/nwnds_module/wow_crafting.nss @@ -0,0 +1,1514 @@ +//Athas Reborn Forge OnDisturbed Script// + +int lsn=151; +//lsstype=1 + +void SetItemLocals() +{ +//Shadow Arrows Stack of 99 (Shadow Sphere + Wooden Arrow + Flourospar)// +SetLocalString(OBJECT_SELF, "lsn1", "shadowarrow"); +SetLocalInt(OBJECT_SELF, "lsc_shadowarrow", 3); +SetLocalString(OBJECT_SELF, "lsi1_shadowarrow", "NW_WAMAR001"); +SetLocalString(OBJECT_SELF, "lsi2_shadowarrow", "ShadowSphere"); +SetLocalString(OBJECT_SELF, "lsi3_shadowarrow", "NW_IT_GEM015"); +SetLocalInt(OBJECT_SELF, "lss_shadowarrow", -10); +SetLocalInt(OBJECT_SELF, "lsv_shadowarrow", VFX_FNF_SMOKE_PUFF); + +//Shadow Bolts Stack of 99 (Shadow Sphere + Wooden Bolt + Flourospar)// +SetLocalString(OBJECT_SELF, "lsn2", "shadowbolts"); +SetLocalInt(OBJECT_SELF, "lsc_shadowbolts", 3); +SetLocalString(OBJECT_SELF, "lsi1_shadowbolts", "NW_WAMBO001"); +SetLocalString(OBJECT_SELF, "lsi2_shadowbolts", "ShadowSphere"); +SetLocalString(OBJECT_SELF, "lsi3_shadowbolts", "NW_IT_GEM015"); +SetLocalInt(OBJECT_SELF, "lss_shadowbolts", -10); +SetLocalInt(OBJECT_SELF, "lsv_shadowbolts", VFX_FNF_SMOKE_PUFF); + +//Shadow Bullets Stack of 99 (Shadow Sphere + Stone Bullet + Flourospar)// +SetLocalString(OBJECT_SELF, "lsn3", "shadowbullet"); +SetLocalInt(OBJECT_SELF, "lsc_shadowbullet", 3); +SetLocalString(OBJECT_SELF, "lsi1_shadowbullet", "NW_WAMBU001"); +SetLocalString(OBJECT_SELF, "lsi2_shadowbullet", "ShadowSphere"); +SetLocalString(OBJECT_SELF, "lsi3_shadowbullet", "NW_IT_GEM015"); +SetLocalInt(OBJECT_SELF, "lss_shadowbullet", -10); +SetLocalInt(OBJECT_SELF, "lsv_shadowbullet", VFX_FNF_SMOKE_PUFF); + +//Fire Arrows Stack of 99 (Brimstone + Wooden Arrow + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn4", "wammar003"); +SetLocalInt(OBJECT_SELF, "lsc_wammar003", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammar003", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_wammar003", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_wammar003", "NW_WAMAR001"); +SetLocalInt(OBJECT_SELF, "lss_wammar003", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammar003", VFX_FNF_SMOKE_PUFF); + +//Fire Bolts Stack of 99 (Brimstone + Wooden Bolt + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn5", "wammbo006"); +SetLocalInt(OBJECT_SELF, "lsc_wammbo006", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbo006", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_wammbo006", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_wammbo006", "NW_WAMBO001"); +SetLocalInt(OBJECT_SELF, "lss_wammbo006", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbo006", VFX_FNF_SMOKE_PUFF); + +//Fire Bullets Stack of 99 (Brimstone + Stone Bullet + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn6", "wammbu006"); +SetLocalInt(OBJECT_SELF, "lsc_wammbu006", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbu006", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_wammbu006", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_wammbu006", "NW_WAMBU001"); +SetLocalInt(OBJECT_SELF, "lss_wammbu006", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbu006", VFX_FNF_SMOKE_PUFF); + +//Fire Darts Stack of 50 (Brimstone + Wooden Dart + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn7", "firedart"); +SetLocalInt(OBJECT_SELF, "lsc_firedart", 3); +SetLocalString(OBJECT_SELF, "lsi1_firedart", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_firedart", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_firedart", "NW_WTHDT001"); +SetLocalInt(OBJECT_SELF, "lss_firedart", -10); +SetLocalInt(OBJECT_SELF, "lsv_firedart", VFX_FNF_SMOKE_PUFF); + +//Fire Throwing Axes Stack of 50 (Brimstone + Stone Throwing Axe + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn8", "fireaxe"); +SetLocalInt(OBJECT_SELF, "lsc_fireaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_fireaxe", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_fireaxe", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_fireaxe", "NW_WTHAX001"); +SetLocalInt(OBJECT_SELF, "lss_fireaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_fireaxe", VFX_FNF_SMOKE_PUFF); + +//Fire Chatchkas Stack of 50 (Brimstone + Obsidian Chatchka + Fire Agate)// +SetLocalString(OBJECT_SELF, "lsn9", "firechatchka"); +SetLocalInt(OBJECT_SELF, "lsc_firechatchka", 3); +SetLocalString(OBJECT_SELF, "lsi1_firechatchka", "NW_IT_GEM002"); +SetLocalString(OBJECT_SELF, "lsi2_firechatchka", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi3_firechatchka", "Chatchka"); +SetLocalInt(OBJECT_SELF, "lss_firechatchka", -10); +SetLocalInt(OBJECT_SELF, "lsv_firechatchka", VFX_FNF_SMOKE_PUFF); + +//Ice Arrows Stack of 99 (Coldstone + Wooden Arrow + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn10", "wammar006"); +SetLocalInt(OBJECT_SELF, "lsc_wammar006", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammar006", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_wammar006", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_wammar006", "NW_WAMAR001"); +SetLocalInt(OBJECT_SELF, "lss_wammar006", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammar006", VFX_FNF_SMOKE_PUFF); + +//Ice Bolts Stack of 99 (Coldstone + Wooden Bolt + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn11", "wammbo002"); +SetLocalInt(OBJECT_SELF, "lsc_wammbo002", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbo002", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_wammbo002", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_wammbo002", "NW_WAMBO001"); +SetLocalInt(OBJECT_SELF, "lss_wammbo002", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbo002", VFX_FNF_SMOKE_PUFF); + +//Ice Bullets Stack of 99 (Coldstone + Stone Bullet + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn12", "wammbu007"); +SetLocalInt(OBJECT_SELF, "lsc_wammbu007", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbu007", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_wammbu007", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_wammbu007", "NW_WAMBU001"); +SetLocalInt(OBJECT_SELF, "lss_wammbu007", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbu007", VFX_FNF_SMOKE_PUFF); + +//Ice Darts Stack of 50 (Coldstone + Wooden Dart + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn13", "icedart"); +SetLocalInt(OBJECT_SELF, "lsc_icedart", 3); +SetLocalString(OBJECT_SELF, "lsi1_icedart", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_icedart", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_icedart", "NW_WTHDT001"); +SetLocalInt(OBJECT_SELF, "lss_icedart", -10); +SetLocalInt(OBJECT_SELF, "lsv_icedart", VFX_FNF_SMOKE_PUFF); + +//Ice Throwing Axes Stack of 50 (Coldstone + Stone Throwing Axe + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn14", "iceaxe"); +SetLocalInt(OBJECT_SELF, "lsc_iceaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_iceaxe", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_iceaxe", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_iceaxe", "NW_WTHAX001"); +SetLocalInt(OBJECT_SELF, "lss_iceaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_iceaxe", VFX_FNF_SMOKE_PUFF); + +//Ice Chatchkas Stack of 50 (Coldstone + Obsidian Chatchka + Aventurine)// +SetLocalString(OBJECT_SELF, "lsn15", "icechatchka"); +SetLocalInt(OBJECT_SELF, "lsc_icechatchka", 3); +SetLocalString(OBJECT_SELF, "lsi1_icechatchka", "NW_IT_GEM014"); +SetLocalString(OBJECT_SELF, "lsi2_icechatchka", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi3_icechatchka", "Chatchka"); +SetLocalInt(OBJECT_SELF, "lss_icechatchka", -10); +SetLocalInt(OBJECT_SELF, "lsv_icechatchka", VFX_FNF_SMOKE_PUFF); + +//Acid Arrows Stack of 99 (Acid Crystal + Wooden Arrow + Malachite)// +SetLocalString(OBJECT_SELF, "lsn16", "wammar004"); +SetLocalInt(OBJECT_SELF, "lsc_wammar004", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammar004", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_wammar004", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammar004", "NW_WAMAR001"); +SetLocalInt(OBJECT_SELF, "lss_wammar004", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammar004", VFX_FNF_SMOKE_PUFF); + +//Acid Bolts Stack of 99 (Acid Crystal + Wooden Bolt + Malachite)// +SetLocalString(OBJECT_SELF, "lsn17", "wammbo004"); +SetLocalInt(OBJECT_SELF, "lsc_wammbo004", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbo004", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_wammbo004", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammbo004", "NW_WAMBO001"); +SetLocalInt(OBJECT_SELF, "lss_wammbo004", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbo004", VFX_FNF_SMOKE_PUFF); + +//Acid Bullets Stack of 99 (Acid Crystal + Stone Bullet + Malachite)// +SetLocalString(OBJECT_SELF, "lsn18", "wammbu009"); +SetLocalInt(OBJECT_SELF, "lsc_wammbu009", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbu009", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_wammbu009", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammbu009", "NW_WAMBU001"); +SetLocalInt(OBJECT_SELF, "lss_wammbu009", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbu009", VFX_FNF_SMOKE_PUFF); + +//Acid Darts Stack of 50 (Acid Crystal + Wooden Dart + Malachite)// +SetLocalString(OBJECT_SELF, "lsn19", "aciddart"); +SetLocalInt(OBJECT_SELF, "lsc_aciddart", 3); +SetLocalString(OBJECT_SELF, "lsi1_aciddart", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_aciddart", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_aciddart", "NW_WTHDT001"); +SetLocalInt(OBJECT_SELF, "lss_aciddart", -10); +SetLocalInt(OBJECT_SELF, "lsv_aciddart", VFX_FNF_SMOKE_PUFF); + +//Acid Throwing Axes Stack of 50 (Acid Crystal + Stone Throwing Axe + Malachite)// +SetLocalString(OBJECT_SELF, "lsn20", "acidaxe"); +SetLocalInt(OBJECT_SELF, "lsc_acidaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidaxe", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_acidaxe", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_acidaxe", "NW_WTHAX001"); +SetLocalInt(OBJECT_SELF, "lss_acidaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidaxe", VFX_FNF_SMOKE_PUFF); + +//Acid Chatchkas Stack of 50 (Acid Crystal + Obsidian Chatchka + Malachite)// +SetLocalString(OBJECT_SELF, "lsn21", "acidchatchka"); +SetLocalInt(OBJECT_SELF, "lsc_acidchatchka", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidchatchka", "NW_IT_GEM007"); +SetLocalString(OBJECT_SELF, "lsi2_acidchatchka", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_acidchatchka", "Chatchka"); +SetLocalInt(OBJECT_SELF, "lss_acidchatchka", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidchatchka", VFX_FNF_SMOKE_PUFF); + +//Lightning Arrows Stack of 99 (Charged Crystal + Wooden Arrow + Phenalope)// +SetLocalString(OBJECT_SELF, "lsn22", "wammar007"); +SetLocalInt(OBJECT_SELF, "lsc_wammar007", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammar007", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_wammar007", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammar007", "NW_WAMAR001"); +SetLocalInt(OBJECT_SELF, "lss_wammar007", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammar007", VFX_FNF_SMOKE_PUFF); + +//Lightning Bolts Stack of 99 (Charged Crystal + Wooden Bolt + Phenalope)// +SetLocalString(OBJECT_SELF, "lsn23", "wammbo003"); +SetLocalInt(OBJECT_SELF, "lsc_wammbo003", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbo003", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_wammbo003", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammbo003", "NW_WAMBO001"); +SetLocalInt(OBJECT_SELF, "lss_wammbo003", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbo003", VFX_FNF_SMOKE_PUFF); + +//Lightning Bullets Stack of 99 (Charged Crystal + Stone Bullet + Phenalope)// +SetLocalString(OBJECT_SELF, "lsn24", "wammbu008"); +SetLocalInt(OBJECT_SELF, "lsc_wammbu008", 3); +SetLocalString(OBJECT_SELF, "lsi1_wammbu008", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_wammbu008", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_wammbu008", "NW_WAMBU001"); +SetLocalInt(OBJECT_SELF, "lss_wammbu008", -10); +SetLocalInt(OBJECT_SELF, "lsv_wammbu008", VFX_FNF_SMOKE_PUFF); + +//Lightning Darts Stack of 50 (Charged Crystal + Wooden Dart + Phenalope)// +SetLocalString(OBJECT_SELF, "lsn25", "lightningdart"); +SetLocalInt(OBJECT_SELF, "lsc_lightningdart", 3); +SetLocalString(OBJECT_SELF, "lsi1_lightningdart", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_lightningdart", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_lightningdart", "NW_WTHDT001"); +SetLocalInt(OBJECT_SELF, "lss_lightningdart", -10); +SetLocalInt(OBJECT_SELF, "lsv_lightningdart", VFX_FNF_SMOKE_PUFF); + +//Lightning Throwing Axes Stack of 50 (Charged Crystal + Stone Throwing Axe + Phenalope)// +SetLocalString(OBJECT_SELF, "ls26", "lightningaxe"); +SetLocalInt(OBJECT_SELF, "lsc_lightningaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_lightningaxe", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_lightningaxe", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_lightningaxe", "NW_WTHAX001"); +SetLocalInt(OBJECT_SELF, "lss_lightningaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_lightningaxe", VFX_FNF_SMOKE_PUFF); + +//Lightning Chatchkas Stack of 50 (Charged Crystal + Obsidian Chatchka + Phenalope)// +SetLocalString(OBJECT_SELF, "lsn27", "lightningchatchk"); +SetLocalInt(OBJECT_SELF, "lsc_lightningchatchk", 3); +SetLocalString(OBJECT_SELF, "lsi1_lightningchatchk", "NW_IT_GEM004"); +SetLocalString(OBJECT_SELF, "lsi2_lightningchatchk", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi3_lightningchatchk", "Chatchka"); +SetLocalInt(OBJECT_SELF, "lss_lightningchatchk", -10); +SetLocalInt(OBJECT_SELF, "lsv_lightningchatchk", VFX_FNF_SMOKE_PUFF); + +//Air Drake Heavy Armor (Bone Brigadine + Ruby + Air Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn28", "airdrakearmorh"); +SetLocalInt(OBJECT_SELF, "lsc_airdrakearmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_airdrakearmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi2_airdrakearmorh", "AirDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_airdrakearmorh", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_airdrakearmorh", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_airdrakearmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_airdrakearmorh", VFX_FNF_SMOKE_PUFF); + +//Air Drake Medium Armor (Bone Scale Mail + Ruby + Air Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn29", "airdrakearmorm"); +SetLocalInt(OBJECT_SELF, "lsc_airdrakearmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_airdrakearmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi2_airdrakearmorm", "AirDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_airdrakearmorm", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_airdrakearmorm", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_airdrakearmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_airdrakearmorm", VFX_FNF_SMOKE_PUFF); + +//Air Drake Light Armor (Bone Studded Leather + Ruby + Air Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn30", "airdrakearmorl"); +SetLocalInt(OBJECT_SELF, "lsc_airdrakearmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_airdrakearmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi2_airdrakearmorl", "AirDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_airdrakearmorl", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_airdrakearmorl", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_airdrakearmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_airdrakearmorl", VFX_FNF_SMOKE_PUFF); + +//Air Drake Helmet (Bone Helmet + Ruby + Air Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn31", "airdrakehelmet"); +SetLocalInt(OBJECT_SELF, "lsc_airdrakehelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_airdrakehelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi2_airdrakehelmet", "AirDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_airdrakehelmet", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_airdrakehelmet", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_airdrakehelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_airdrakehelmet", VFX_FNF_SMOKE_PUFF); + +//Water Drake Heavy Armor (Bone Brigadine + Ruby + Water Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn32", "waterdrakearmorh"); +SetLocalInt(OBJECT_SELF, "lsc_waterdrakearmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_waterdrakearmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi2_waterdrakearmorh", "WaterDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_waterdrakearmorh", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_waterdrakearmorh", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_waterdrakearmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_waterdrakearmorh", VFX_FNF_SMOKE_PUFF); + +//Water Drake Medium Armor (Bone Scale Mail + Ruby + Water Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn33", "waterdrakearmom"); +SetLocalInt(OBJECT_SELF, "lsc_waterdrakearmom", 4); +SetLocalString(OBJECT_SELF, "lsi1_waterdrakearmom", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi2_waterdrakearmom", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi3_waterdrakearmom", "WaterDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi4_waterdrakearmom", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_waterdrakearmom", -10); +SetLocalInt(OBJECT_SELF, "lsv_waterdrakearmom", VFX_FNF_SMOKE_PUFF); + +//Water Drake Light Armor (Bone Studded Leather + Ruby + Water Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn34", "waterdrakearmol"); +SetLocalInt(OBJECT_SELF, "lsc_waterdrakearmol", 4); +SetLocalString(OBJECT_SELF, "lsi1_waterdrakearmol", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi2_waterdrakearmol", "WaterDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_waterdrakearmol", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_waterdrakearmol", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_waterdrakearmol", -10); +SetLocalInt(OBJECT_SELF, "lsv_waterdrakearmol", VFX_FNF_SMOKE_PUFF); + +//Water Drake Helmet (Bone Helmet + Ruby + Water Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn35", "waterdrakehelmet"); +SetLocalInt(OBJECT_SELF, "lsc_waterdrakehelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_waterdrakehelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi2_waterdrakehelmet", "WaterDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_waterdrakehelmet", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_waterdrakehelmet", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_waterdrakehelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_waterdrakehelmet", VFX_FNF_SMOKE_PUFF); + +//Earth Drake Heavy Armor (Bone Brigadine + Ruby + Earth Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn36", "earthdrakeh"); +SetLocalInt(OBJECT_SELF, "lsc_earthdrakeh", 4); +SetLocalString(OBJECT_SELF, "lsi1_earthdrakeh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi2_earthdrakeh", "EarthDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_earthdrakeh", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_earthdrakeh", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_earthdrakeh", -10); +SetLocalInt(OBJECT_SELF, "lsv_earthdrakeh", VFX_FNF_SMOKE_PUFF); + +//Earth Drake Medium Armor (Bone Scale Mail + Ruby + Earth Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn37", "earthdrakem"); +SetLocalInt(OBJECT_SELF, "lsc_earthdrakem", 4); +SetLocalString(OBJECT_SELF, "lsi1_earthdrakem", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi2_earthdrakem", "EarthDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_earthdrakem", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_earthdrakem", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_earthdrakem", -10); +SetLocalInt(OBJECT_SELF, "lsv_earthdrakem", VFX_FNF_SMOKE_PUFF); + +//Earth Drake Light Armor (Bone Studded Leather + Ruby + Earth Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn38", "earthdrakel"); +SetLocalInt(OBJECT_SELF, "lsc_earthdrakel", 4); +SetLocalString(OBJECT_SELF, "lsi1_earthdrakel", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi2_earthdrakel", "EarthDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_earthdrakel", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_earthdrakel", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_earthdrakel", -10); +SetLocalInt(OBJECT_SELF, "lsv_earthdrakel", VFX_FNF_SMOKE_PUFF); + +//Earth Drake Helmet (Bone Helmet + Ruby + Earth Drake Hide + Erdlu Blood)// +SetLocalString(OBJECT_SELF, "lsn39", "earthdrakehelm"); +SetLocalInt(OBJECT_SELF, "lsc_earthdrakehelm", 4); +SetLocalString(OBJECT_SELF, "lsi1_earthdrakehelm", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi2_earthdrakehelm", "EarthDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_earthdrakehelm", "ErdluBlood"); +SetLocalString(OBJECT_SELF, "lsi4_earthdrakehelm", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_earthdrakehelm", -10); +SetLocalInt(OBJECT_SELF, "lsv_earthdrakehelm", VFX_FNF_SMOKE_PUFF); + +//Fire Drake Heavy Armor (Bone Brigadine + Ruby + Fire Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn40", "firedrakearmor"); +SetLocalInt(OBJECT_SELF, "lsc_firedrakearmor", 4); +SetLocalString(OBJECT_SELF, "lsi1_firedrakearmor", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi2_firedrakearmor", "FireDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_firedrakearmor", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_firedrakearmor", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_firedrakearmor", -10); +SetLocalInt(OBJECT_SELF, "lsv_firedrakearmor", VFX_FNF_SMOKE_PUFF); + +//Fire Drake Medium Armor (Bone Scale Mail + Ruby + Fire Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn41", "firedrakearmorm"); +SetLocalInt(OBJECT_SELF, "lsc_firedrakearmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_firedrakearmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi2_firedrakearmorm", "FireDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_firedrakearmorm", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_firedrakearmorm", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_firedrakearmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_firedrakearmorm", VFX_FNF_SMOKE_PUFF); + +//Fire Drake Light Armor (Bone Studded Leather + Ruby + Fire Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn42", "firedrakearmorl"); +SetLocalInt(OBJECT_SELF, "lsc_firedrakearmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_firedrakearmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi2_firedrakearmorl", "FireDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_firedrakearmorl", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_firedrakearmorl", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_firedrakearmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_firedrakearmorl", VFX_FNF_SMOKE_PUFF); + +//Fire Drake Helmet (Bone Helmet + Ruby + Fire Drake Hide + Celestial Elxir)// +SetLocalString(OBJECT_SELF, "lsn43", "firedrakehelm"); +SetLocalInt(OBJECT_SELF, "lsc_firedrakehelm", 4); +SetLocalString(OBJECT_SELF, "lsi1_firedrakehelm", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi2_firedrakehelm", "FireDrakeHide"); +SetLocalString(OBJECT_SELF, "lsi3_firedrakehelm", "NW_HEN_SHA1QT"); +SetLocalString(OBJECT_SELF, "lsi4_firedrakehelm", "NW_IT_GEM006"); +SetLocalInt(OBJECT_SELF, "lss_firedrakehelm", -10); +SetLocalInt(OBJECT_SELF, "lsv_firedrakehelm", VFX_FNF_SMOKE_PUFF); + +//Flame Short Sword (Emerald + Obsidian Short Sword + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn44", "flameblade"); +SetLocalInt(OBJECT_SELF, "lsc_flameblade", 3); +SetLocalString(OBJECT_SELF, "lsi1_flameblade", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flameblade", "NW_WSWSS002"); +SetLocalString(OBJECT_SELF, "lsi3_flameblade", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flameblade", -10); +SetLocalInt(OBJECT_SELF, "lsv_flameblade", VFX_FNF_SMOKE_PUFF); + +//Ice Short Sword (Emerald + Obsidian Short Sword + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn45", "iceblade"); +SetLocalInt(OBJECT_SELF, "lsc_iceblade", 3); +SetLocalString(OBJECT_SELF, "lsi1_iceblade", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_iceblade", "NW_WSWSS002"); +SetLocalString(OBJECT_SELF, "lsi3_iceblade", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_iceblade", -10); +SetLocalInt(OBJECT_SELF, "lsv_iceblade", VFX_FNF_SMOKE_PUFF); + +//Acid Short Sword (Emerald + Obsidian Short Sword + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn46", "acidblade"); +SetLocalInt(OBJECT_SELF, "lsc_acidblade", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidblade", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidblade", "NW_WSWSS002"); +SetLocalString(OBJECT_SELF, "lsi3_acidblade", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidblade", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidblade", VFX_FNF_SMOKE_PUFF); + +//Charged Short Sword (Emerald + Obsidian Short Sword + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn47", "chargedblade"); +SetLocalInt(OBJECT_SELF, "lsc_chargedblade", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedblade", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedblade", "NW_WSWSS002"); +SetLocalString(OBJECT_SELF, "lsi3_chargedblade", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedblade", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedblade", VFX_FNF_SMOKE_PUFF); + +//Fire Kama (Emerald + Obsidian Kama + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn48", "firekama"); +SetLocalInt(OBJECT_SELF, "lsc_firekama", 3); +SetLocalString(OBJECT_SELF, "lsi1_firekama", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_firekama", "ObsidianKama"); +SetLocalString(OBJECT_SELF, "lsi3_firekama", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_firekama", -10); +SetLocalInt(OBJECT_SELF, "lsv_firekama", VFX_FNF_SMOKE_PUFF); + +//Ice Kama (Emerald + Obsidian Kama + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn49", "icekama"); +SetLocalInt(OBJECT_SELF, "lsc_icekama", 3); +SetLocalString(OBJECT_SELF, "lsi1_icekama", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icekama", "ObsidianKama"); +SetLocalString(OBJECT_SELF, "lsi3_icekama", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icekama", -10); +SetLocalInt(OBJECT_SELF, "lsv_icekama", VFX_FNF_SMOKE_PUFF); + +//Acid Kama (Emerald + Obsidian Kama + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn50", "acidkama"); +SetLocalInt(OBJECT_SELF, "lsc_acidkama", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidkama", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidkama", "ObsidianKama"); +SetLocalString(OBJECT_SELF, "lsi3_acidkama", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidkama", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidkama", VFX_FNF_SMOKE_PUFF); + +//Charged Kama (Emerald + Obsidian Kama + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn51", "chargedkama"); +SetLocalInt(OBJECT_SELF, "lsc_chargedkama", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedkama", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedkama", "ObsidianKama"); +SetLocalString(OBJECT_SELF, "lsi3_chargedkama", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedkama", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedkama", VFX_FNF_SMOKE_PUFF); + +//Flame Longsword (Emerald + Obsidian Longsword + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn52", "flamesword"); +SetLocalInt(OBJECT_SELF, "lsc_flamesword", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamesword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamesword", "NW_WSWLS002"); +SetLocalString(OBJECT_SELF, "lsi3_flamesword", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamesword", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamesword", VFX_FNF_SMOKE_PUFF); + +//Ice Longsword (Emerald + Obsidian Longsword + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn53", "icesword"); +SetLocalInt(OBJECT_SELF, "lsc_icesword", 3); +SetLocalString(OBJECT_SELF, "lsi1_icesword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icesword", "NW_WSWLS002"); +SetLocalString(OBJECT_SELF, "lsi3_icesword", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icesword", -10); +SetLocalInt(OBJECT_SELF, "lsv_icesword", VFX_FNF_SMOKE_PUFF); + +//Acid Longsword (Emerald + Obsidian Longsword + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn54", "acidsword"); +SetLocalInt(OBJECT_SELF, "lsc_acidsword", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidsword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidsword", "NW_WSWLS002"); +SetLocalString(OBJECT_SELF, "lsi3_acidsword", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidsword", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidsword", VFX_FNF_SMOKE_PUFF); + +//Charged Longsword (Emerald + Obsidian Longsword + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn55", "chargedsword"); +SetLocalInt(OBJECT_SELF, "lsc_chargedsword", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedsword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedsword", "NW_WSWLS002"); +SetLocalString(OBJECT_SELF, "lsi3_chargedsword", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedsword", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedsword", VFX_FNF_SMOKE_PUFF); + +//Flame Spear (Emerald + Wooden Spear + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn56", "firespear"); +SetLocalInt(OBJECT_SELF, "lsc_firespear", 3); +SetLocalString(OBJECT_SELF, "lsi1_firespear", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_firespear", "NW_WPLSS002"); +SetLocalString(OBJECT_SELF, "lsi3_firespear", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_firespear", -10); +SetLocalInt(OBJECT_SELF, "lsv_firespear", VFX_FNF_SMOKE_PUFF); + +//Ice Spear (Emerald + Wooden Spear + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn57", "icespear"); +SetLocalInt(OBJECT_SELF, "lsc_icespear", 3); +SetLocalString(OBJECT_SELF, "lsi1_icespear", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icespear", "NW_WPLSS002"); +SetLocalString(OBJECT_SELF, "lsi3_icespear", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icespear", -10); +SetLocalInt(OBJECT_SELF, "lsv_icespear", VFX_FNF_SMOKE_PUFF); + +//Acid Spear (Emerald + Wooden Spear + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn58", "acidspear"); +SetLocalInt(OBJECT_SELF, "lsc_acidspear", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidspear", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidspear", "NW_WPLSS002"); +SetLocalString(OBJECT_SELF, "lsi3_acidspear", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidspear", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidspear", VFX_FNF_SMOKE_PUFF); + +//Charged Spear (Emerald + Wooden Spear + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn59", "chargedspear"); +SetLocalInt(OBJECT_SELF, "lsc_chargedspear", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedspear", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedspear", "NW_WPLSS002"); +SetLocalString(OBJECT_SELF, "lsi3_chargedspear", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedspear", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedspear", VFX_FNF_SMOKE_PUFF); + +//Flame Halberd (Emerald + Obsidian Halberd + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn60", "flamehalberd"); +SetLocalInt(OBJECT_SELF, "lsc_flamehalberd", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamehalberd", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamehalberd", "NW_WPLHB002"); +SetLocalString(OBJECT_SELF, "lsi3_flamehalberd", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamehalberd", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamehalberd", VFX_FNF_SMOKE_PUFF); + +//Ice Halberd (Emerald + Wooden Spear + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn61", "icehalberd"); +SetLocalInt(OBJECT_SELF, "lsc_icehalberd", 3); +SetLocalString(OBJECT_SELF, "lsi1_icehalberd", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icehalberd", "NW_WPLHB002"); +SetLocalString(OBJECT_SELF, "lsi3_icehalberd", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icehalberd", -10); +SetLocalInt(OBJECT_SELF, "lsv_icehalberd", VFX_FNF_SMOKE_PUFF); + +//Acid Halberd (Emerald + Wooden Spear + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn62", "acidhalberd"); +SetLocalInt(OBJECT_SELF, "lsc_acidhalberd", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidhalberd", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidhalberd", "NW_WPLHB002"); +SetLocalString(OBJECT_SELF, "lsi3_acidhalberd", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidhalberd", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidhalberd", VFX_FNF_SMOKE_PUFF); + +//Charged Halberd (Emerald + Wooden Spear + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn63", "chargedhalberd"); +SetLocalInt(OBJECT_SELF, "lsc_chargedhalberd", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedhalberd", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedhalberd", "NW_WPLHB002"); +SetLocalString(OBJECT_SELF, "lsi3_chargedhalberd", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedhalberd", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedhalberd", VFX_FNF_SMOKE_PUFF); + +//Flame Scimitar (Emerald + Obsidian Scimitar + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn64", "flamescimitar"); +SetLocalInt(OBJECT_SELF, "lsc_flamescimitar", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamescimitar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamescimitar", "ObsidianScimitar"); +SetLocalString(OBJECT_SELF, "lsi3_flamescimitar", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamescimitar", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamescimitar", VFX_FNF_SMOKE_PUFF); + +//Ice Scimitar (Emerald + Obsidian Scimitar + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn65", "icescimitar"); +SetLocalInt(OBJECT_SELF, "lsc_icescimitar", 3); +SetLocalString(OBJECT_SELF, "lsi1_icescimitar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icescimitar", "ObsidianScimitar"); +SetLocalString(OBJECT_SELF, "lsi3_icescimitar", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icescimitar", -10); +SetLocalInt(OBJECT_SELF, "lsv_icescimitar", VFX_FNF_SMOKE_PUFF); + +//Acid Scimitar (Emerald + Obsidian Scimitar + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn66", "acidscimitar"); +SetLocalInt(OBJECT_SELF, "lsc_acidscimitar", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidscimitar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidscimitar", "ObsidianScimitar"); +SetLocalString(OBJECT_SELF, "lsi3_acidscimitar", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidscimitar", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidscimitar", VFX_FNF_SMOKE_PUFF); + +//Charged Scimitar (Emerald + Obsidian Scimitar + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn67", "chargedscimitar"); +SetLocalInt(OBJECT_SELF, "lsc_chargedscimitar", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedscimitar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedscimitar", "ObsidianScimitar"); +SetLocalString(OBJECT_SELF, "lsi3_chargedscimitar", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedscimitar", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedscimitar", VFX_FNF_SMOKE_PUFF); + +//Flame Kukri (Emerald + Obsidian Kukri + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn68", "firekukri"); +SetLocalInt(OBJECT_SELF, "lsc_firekukri", 3); +SetLocalString(OBJECT_SELF, "lsi1_firekukri", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_firekukri", "ObsidianKukri"); +SetLocalString(OBJECT_SELF, "lsi3_firekukri", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_firekukri", -10); +SetLocalInt(OBJECT_SELF, "lsv_firekukri", VFX_FNF_SMOKE_PUFF); + +//Ice Kukri (Emerald + Obsidian Kukri + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn69", "icekukri"); +SetLocalInt(OBJECT_SELF, "lsc_icekukri", 3); +SetLocalString(OBJECT_SELF, "lsi1_icekukri", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icekukri", "ObsidianKukri"); +SetLocalString(OBJECT_SELF, "lsi3_icekukri", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icekukri", -10); +SetLocalInt(OBJECT_SELF, "lsv_icekukri", VFX_FNF_SMOKE_PUFF); + +//Acid Kukri (Emerald + Obsidian Kukri + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn70", "acidkukri"); +SetLocalInt(OBJECT_SELF, "lsc_acidkukri", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidkukri", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidkukri", "ObsidianKukri"); +SetLocalString(OBJECT_SELF, "lsi3_acidkukri", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidkukri", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidkukri", VFX_FNF_SMOKE_PUFF); + +//Charged Kukri (Emerald + Obsidian Kukri + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn71", "chargedkukri"); +SetLocalInt(OBJECT_SELF, "lsc_chargedkukri", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedkukri", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedkukri", "ObsidianKukri"); +SetLocalString(OBJECT_SELF, "lsi3_chargedkukri", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedkukri", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedkukri", VFX_FNF_SMOKE_PUFF); + +//Flame Rapier (Emerald + Obsidian Rapier + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn72", "flamerapier"); +SetLocalInt(OBJECT_SELF, "lsc_flamerapier", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamerapier", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamerapier", "ObsidianRapier"); +SetLocalString(OBJECT_SELF, "lsi3_flamerapier", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamerapier", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamerapier", VFX_FNF_SMOKE_PUFF); + +//Ice Rapier (Emerald + Obsidian Rapier + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn73", "icerapier"); +SetLocalInt(OBJECT_SELF, "lsc_icerapier", 3); +SetLocalString(OBJECT_SELF, "lsi1_icerapier", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icerapier", "ObsidianRapier"); +SetLocalString(OBJECT_SELF, "lsi3_icerapier", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icerapier", -10); +SetLocalInt(OBJECT_SELF, "lsv_icerapier", VFX_FNF_SMOKE_PUFF); + +//Acid Rapier (Emerald + Obsidian Rapier + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn74", "acidrapier"); +SetLocalInt(OBJECT_SELF, "lsc_acidrapier", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidrapier", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidrapier", "ObsidianRapier"); +SetLocalString(OBJECT_SELF, "lsi3_acidrapier", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidrapier", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidrapier", VFX_FNF_SMOKE_PUFF); + +//Charged Rapier (Emerald + Obsidian Rapier + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn75", "chargedrapier"); +SetLocalInt(OBJECT_SELF, "lsc_chargedrapier", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedrapier", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedrapier", "ObsidianRapier"); +SetLocalString(OBJECT_SELF, "lsi3_chargedrapier", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedrapier", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedrapier", VFX_FNF_SMOKE_PUFF); + +//Flame Bastard Sword (Emerald + Obsidian Bastard Sword + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn76", "flamebastard"); +SetLocalInt(OBJECT_SELF, "lsc_flamebastard", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamebastard", "ObsidianBastardSword"); +SetLocalString(OBJECT_SELF, "lsi2_flamebastard", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi3_flamebastard", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamebastard", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamebastard", VFX_FNF_SMOKE_PUFF); + +//Ice Bastard Sword (Emerald + Obsidian Bastard Sword + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn77", "icebastard"); +SetLocalInt(OBJECT_SELF, "lsc_icebastard", 3); +SetLocalString(OBJECT_SELF, "lsi1_icebastard", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icebastard", "ObsidianBastardSword"); +SetLocalString(OBJECT_SELF, "lsi3_icebastard", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icebastard", -10); +SetLocalInt(OBJECT_SELF, "lsv_icebastard", VFX_FNF_SMOKE_PUFF); + +//Acid Bastard Sword (Emerald + Obsidian Bastard Sword + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn78", "acidbastard"); +SetLocalInt(OBJECT_SELF, "lsc_acidbastard", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidbastard", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidbastard", "ObsidianBastardSword"); +SetLocalString(OBJECT_SELF, "lsi3_acidbastard", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidbastard", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidbastard", VFX_FNF_SMOKE_PUFF); + +//Charged Bastard Sword (Emerald + Obsidian Bastard Sword + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn79", "chargedbastard"); +SetLocalInt(OBJECT_SELF, "lsc_chargedbastard", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedbastard", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedbastard", "ObsidianBastardSword"); +SetLocalString(OBJECT_SELF, "lsi3_chargedbastard", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedbastard", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedbastard", VFX_FNF_SMOKE_PUFF); + +//Flame Whip (Emerald + Leather Whip + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn80", "firewhip"); +SetLocalInt(OBJECT_SELF, "lsc_firewhip", 3); +SetLocalString(OBJECT_SELF, "lsi1_firewhip", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_firewhip", "LeatherWhip"); +SetLocalString(OBJECT_SELF, "lsi3_firewhip", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_firewhip", -10); +SetLocalInt(OBJECT_SELF, "lsv_firewhip", VFX_FNF_SMOKE_PUFF); + +//Ice Whip (Emerald + Leather Whip + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn81", "icewhip"); +SetLocalInt(OBJECT_SELF, "lsc_icewhip", 3); +SetLocalString(OBJECT_SELF, "lsi1_icewhip", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icewhip", "LeatherWhip"); +SetLocalString(OBJECT_SELF, "lsi3_icewhip", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icewhip", -10); +SetLocalInt(OBJECT_SELF, "lsv_icewhip", VFX_FNF_SMOKE_PUFF); + +//Acid Whip (Emerald + Leather Whip + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn82", "acidwhip"); +SetLocalInt(OBJECT_SELF, "lsc_acidwhip", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidwhip", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidwhip", "LeatherWhip"); +SetLocalString(OBJECT_SELF, "lsi3_acidwhip", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidwhip", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidwhip", VFX_FNF_SMOKE_PUFF); + +//Charged Whip (Emerald + Leather Whip + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn83", "chargedwhip"); +SetLocalInt(OBJECT_SELF, "lsc_chargedwhip", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedwhip", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedwhip", "LeatherWhip"); +SetLocalString(OBJECT_SELF, "lsi3_chargedwhip", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedwhip", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedwhip", VFX_FNF_SMOKE_PUFF); + +//Flame Katana (Emerald + Obsidian Katana + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn84", "flamekatana"); +SetLocalInt(OBJECT_SELF, "lsc_flamekatana", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamekatana", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamekatana", "ObsidianKatana"); +SetLocalString(OBJECT_SELF, "lsi3_flamekatana", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamekatana", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamekatana", VFX_FNF_SMOKE_PUFF); + +//Ice Katana (Emerald + Obsidian Katana + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn85", "icekatana"); +SetLocalInt(OBJECT_SELF, "lsc_icekatana", 3); +SetLocalString(OBJECT_SELF, "lsi1_icekatana", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icekatana", "ObsidianKatana"); +SetLocalString(OBJECT_SELF, "lsi3_icekatana", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icekatana", -10); +SetLocalInt(OBJECT_SELF, "lsv_icekatana", VFX_FNF_SMOKE_PUFF); + +//Acid Katana (Emerald + Obsidian Katana + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn86", "acidkatana"); +SetLocalInt(OBJECT_SELF, "lsc_acidkatana", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidkatana", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidkatana", "ObsidianKatana"); +SetLocalString(OBJECT_SELF, "lsi3_acidkatana", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidkatana", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidkatana", VFX_FNF_SMOKE_PUFF); + +//Charged Katana (Emerald + Obsidian Katana + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn87", "chargedkatana"); +SetLocalInt(OBJECT_SELF, "lsc_chargedkatana", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedkatana", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedkatana", "ObsidianKatana"); +SetLocalString(OBJECT_SELF, "lsi3_chargedkatana", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedkatana", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedkatana", VFX_FNF_SMOKE_PUFF); + +//Flame Greataxe (Emerald + Obsidian Greataxe + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn88", "flamegreataxe"); +SetLocalInt(OBJECT_SELF, "lsc_flamegreataxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamegreataxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamegreataxe", "ObsidianGreataxe"); +SetLocalString(OBJECT_SELF, "lsi3_flamegreataxe", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamegreataxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamegreataxe", VFX_FNF_SMOKE_PUFF); + +//Ice Greataxe (Emerald + Obsidian Greataxe + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn89", "icegreataxe"); +SetLocalInt(OBJECT_SELF, "lsc_icegreataxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_icegreataxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icegreataxe", "ObsidianGreataxe"); +SetLocalString(OBJECT_SELF, "lsi3_icegreataxe", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icegreataxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_icegreataxe", VFX_FNF_SMOKE_PUFF); + +//Acid Greataxe (Emerald + Obsidian Greataxe + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn90", "acidgreataxe"); +SetLocalInt(OBJECT_SELF, "lsc_acidgreataxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidgreataxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidgreataxe", "ObsidianGreataxe"); +SetLocalString(OBJECT_SELF, "lsi3_acidgreataxe", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidgreataxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidgreataxe", VFX_FNF_SMOKE_PUFF); + +//Charged Greataxe (Emerald + Obsidian Greataxe + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn91", "chargedgreataxe"); +SetLocalInt(OBJECT_SELF, "lsc_chargedgreataxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedgreataxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedgreataxe", "ObsidianGreataxe"); +SetLocalString(OBJECT_SELF, "lsi3_chargedgreataxe", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedgreataxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedgreataxe", VFX_FNF_SMOKE_PUFF); + +//Flame Battleaxe (Emerald + Obsidian Battleaxe + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn92", "flamebattleaxe"); +SetLocalInt(OBJECT_SELF, "lsc_flamebattleaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamebattleaxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamebattleaxe", "ObsidianBattleaxe"); +SetLocalString(OBJECT_SELF, "lsi3_flamebattleaxe", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamebattleaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamebattleaxe", VFX_FNF_SMOKE_PUFF); + +//Ice Battleaxe (Emerald + Obsidian Battleaxe + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn93", "icebattleaxe"); +SetLocalInt(OBJECT_SELF, "lsc_icebattleaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_icebattleaxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icebattleaxe", "ObsidianBattleaxe"); +SetLocalString(OBJECT_SELF, "lsi3_icebattleaxe", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icebattleaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_icebattleaxe", VFX_FNF_SMOKE_PUFF); + +//Acid Battleaxe (Emerald + Obsidian Battleaxe + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn94", "acidbattleaxe"); +SetLocalInt(OBJECT_SELF, "lsc_acidbattleaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidbattleaxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidbattleaxe", "ObsidianBattleaxe"); +SetLocalString(OBJECT_SELF, "lsi3_acidbattleaxe", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidbattleaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidbattleaxe", VFX_FNF_SMOKE_PUFF); + +//Charged Battleaxe (Emerald + Obsidian Battleaxe + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn95", "chargedbattleax"); +SetLocalInt(OBJECT_SELF, "lsc_chargedbattleax", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedbattleax", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedbattleax", "ObsidianBattleaxe"); +SetLocalString(OBJECT_SELF, "lsi3_chargedbattleax", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedbattleax", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedbattleax", VFX_FNF_SMOKE_PUFF); + +//Flame Handaxe (Emerald + Obsidian Handaxe + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn96", "flameaxe"); +SetLocalInt(OBJECT_SELF, "lsc_flameaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_flameaxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flameaxe", "ObsidianHandaxe"); +SetLocalString(OBJECT_SELF, "lsi3_flameaxe", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flameaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_flameaxe", VFX_FNF_SMOKE_PUFF); + +//Ice Handaxe (Emerald + Obsidian Handaxe + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn97", "iceaxe2"); +SetLocalInt(OBJECT_SELF, "lsc_iceaxe2", 3); +SetLocalString(OBJECT_SELF, "lsi1_iceaxe2", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_iceaxe2", "ObsidianHandaxe"); +SetLocalString(OBJECT_SELF, "lsi3_iceaxe2", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_iceaxe2", -10); +SetLocalInt(OBJECT_SELF, "lsv_iceaxe2", VFX_FNF_SMOKE_PUFF); + +//Acid Handaxe (Emerald + Obsidian Handaxe + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn98", "acidaxe2"); +SetLocalInt(OBJECT_SELF, "lsc_acidaxe2", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidaxe2", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidaxe2", "ObsidianHandaxe"); +SetLocalString(OBJECT_SELF, "lsi3_acidaxe2", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidaxe2", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidaxe2", VFX_FNF_SMOKE_PUFF); + +//Charged Handaxe (Emerald + Obsidian Handaxe + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn99", "chargedaxe"); +SetLocalInt(OBJECT_SELF, "lsc_chargedaxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedaxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedaxe", "ObsidianHandaxe"); +SetLocalString(OBJECT_SELF, "lsi3_chargedaxe", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedaxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedaxe", VFX_FNF_SMOKE_PUFF); + +//Flame Waraxe (Emerald + Obsidian War + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn100", "flamewaraxe"); +SetLocalInt(OBJECT_SELF, "lsc_flamewaraxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamewaraxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamewaraxe", "ObsidianWaraxe"); +SetLocalString(OBJECT_SELF, "lsi3_flamewaraxe", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamewaraxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamewaraxe", VFX_FNF_SMOKE_PUFF); + +//Ice Waraxe (Emerald + Obsidian War + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn101", "icewaraxe"); +SetLocalInt(OBJECT_SELF, "lsc_icewaraxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_icewaraxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icewaraxe", "ObsidianWaraxe"); +SetLocalString(OBJECT_SELF, "lsi3_icewaraxe", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icewaraxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_icewaraxe", VFX_FNF_SMOKE_PUFF); + +//Acid Waraxe (Emerald + Obsidian War + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn102", "acidwaraxe"); +SetLocalInt(OBJECT_SELF, "lsc_acidwaraxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidwaraxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidwaraxe", "ObsidianWaraxe"); +SetLocalString(OBJECT_SELF, "lsi3_acidwaraxe", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidwaraxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidwaraxe", VFX_FNF_SMOKE_PUFF); + +//Charged Waraxe (Emerald + Obsidian War + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn103", "chargedwaraxe"); +SetLocalInt(OBJECT_SELF, "lsc_chargedwaraxe", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedwaraxe", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedwaraxe", "ObsidianWaraxe"); +SetLocalString(OBJECT_SELF, "lsi3_chargedwaraxe", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedwaraxe", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedwaraxe", VFX_FNF_SMOKE_PUFF); + +//Flame Two-Bladed Sword (Emerald + Obsidian Two-Bladed Sword + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn104", "flametwobladed"); +SetLocalInt(OBJECT_SELF, "lsc_flametwobladed", 3); +SetLocalString(OBJECT_SELF, "lsi1_flametwobladed", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flametwobladed", "ObsidianTwoBladedSword"); +SetLocalString(OBJECT_SELF, "lsi3_flametwobladed", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flametwobladed", -10); +SetLocalInt(OBJECT_SELF, "lsv_flametwobladed", VFX_FNF_SMOKE_PUFF); + +//Ice Two-Bladed Sword (Emerald + Obsidian Two-Bladed Sword + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn105", "icetwobladeds"); +SetLocalInt(OBJECT_SELF, "lsc_icetwobladeds", 3); +SetLocalString(OBJECT_SELF, "lsi1_icetwobladeds", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icetwobladeds", "ObsidianTwoBladedSword"); +SetLocalString(OBJECT_SELF, "lsi3_icetwobladeds", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icetwobladeds", -10); +SetLocalInt(OBJECT_SELF, "lsv_icetwobladeds", VFX_FNF_SMOKE_PUFF); + +//Acid Two-Bladed Sword (Emerald + Obsidian Two-Bladed Sword + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn106", "acidtwobladed"); +SetLocalInt(OBJECT_SELF, "lsc_acidtwobladed", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidtwobladed", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidtwobladed", "ObsidianTwoBladedSword"); +SetLocalString(OBJECT_SELF, "lsi3_acidtwobladed", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidtwobladed", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidtwobladed", VFX_FNF_SMOKE_PUFF); + +//Charged Two-Bladed Sword (Emerald + Obsidian Two-Bladed Sword + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn107", "chargedtwoblad"); +SetLocalInt(OBJECT_SELF, "lsc_chargedtwoblad", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedtwoblad", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedtwoblad", "ObsidianTwoBladedSword"); +SetLocalString(OBJECT_SELF, "lsi3_chargedtwoblad", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedtwoblad", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedtwoblad", VFX_FNF_SMOKE_PUFF); + +//Flame Flail (Emerald + Obsidian Flail + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn108", "flameflail"); +SetLocalInt(OBJECT_SELF, "lsc_flameflail", 3); +SetLocalString(OBJECT_SELF, "lsi1_flameflail", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flameflail", "ObsidianFlail"); +SetLocalString(OBJECT_SELF, "lsi3_flameflail", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flameflail", -10); +SetLocalInt(OBJECT_SELF, "lsv_flameflail", VFX_FNF_SMOKE_PUFF); + +//Ice Flail (Emerald + Obsidian Flail + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn109", "iceflail"); +SetLocalInt(OBJECT_SELF, "lsc_iceflail", 3); +SetLocalString(OBJECT_SELF, "lsi1_iceflail", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_iceflail", "ObsidianFlail"); +SetLocalString(OBJECT_SELF, "lsi3_iceflail", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_iceflail", -10); +SetLocalInt(OBJECT_SELF, "lsv_iceflail", VFX_FNF_SMOKE_PUFF); + +//Acid Flail (Emerald + Obsidian Flail + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn110", "acidflail"); +SetLocalInt(OBJECT_SELF, "lsc_acidflail", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidflail", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidflail", "ObsidianFlail"); +SetLocalString(OBJECT_SELF, "lsi3_acidflail", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidflail", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidflail", VFX_FNF_SMOKE_PUFF); + +//Charged Flail (Emerald + Obsidian Flail + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn111", "chargedflail"); +SetLocalInt(OBJECT_SELF, "lsc_chargedflail", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedflail", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedflail", "ObsidianFlail"); +SetLocalString(OBJECT_SELF, "lsi3_chargedflail", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedflail", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedflail", VFX_FNF_SMOKE_PUFF); + +//Flame Warhammer (Emerald + Obsidian Warhammer + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn112", "flamewarhammer"); +SetLocalInt(OBJECT_SELF, "lsc_flamewarhammer", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamewarhammer", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamewarhammer", "ObsidianWarhammer"); +SetLocalString(OBJECT_SELF, "lsi3_flamewarhammer", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamewarhammer", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamewarhammer", VFX_FNF_SMOKE_PUFF); + +//Ice Warhammer (Emerald + Obsidian Warhammer + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn113", "icewarhammer"); +SetLocalInt(OBJECT_SELF, "lsc_icewarhammer", 3); +SetLocalString(OBJECT_SELF, "lsi1_icewarhammer", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icewarhammer", "ObsidianWarhammer"); +SetLocalString(OBJECT_SELF, "lsi3_icewarhammer", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icewarhammer", -10); +SetLocalInt(OBJECT_SELF, "lsv_icewarhammer", VFX_FNF_SMOKE_PUFF); + +//Acid Warhammer (Emerald + Obsidian Warhammer + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn114", "acidwarhammer"); +SetLocalInt(OBJECT_SELF, "lsc_acidwarhammer", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidwarhammer", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidwarhammer", "ObsidianWarhammer"); +SetLocalString(OBJECT_SELF, "lsi3_acidwarhammer", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidwarhammer", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidwarhammer", VFX_FNF_SMOKE_PUFF); + +//Charged Warhammer (Emerald + Obsidian Warhammer + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn115", "chargedwarhamme"); +SetLocalInt(OBJECT_SELF, "lsc_chargedwarhamme", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedwarhamme", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedwarhamme", "ObsidianWarhammer"); +SetLocalString(OBJECT_SELF, "lsi3_chargedwarhamme", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedwarhamme", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedwarhamme", VFX_FNF_SMOKE_PUFF); + +//Flame Dagger (Emerald + Obsidian Dagger + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn116", "flamedagger"); +SetLocalInt(OBJECT_SELF, "lsc_flamedagger", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamedagger", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamedagger", "NW_WSWDG002"); +SetLocalString(OBJECT_SELF, "lsi3_flamedagger", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamedagger", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamedagger", VFX_FNF_SMOKE_PUFF); + +//Ice Dagger (Emerald + Obsidian Dagger + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn117", "icedagger"); +SetLocalInt(OBJECT_SELF, "lsc_icedagger", 3); +SetLocalString(OBJECT_SELF, "lsi1_icedagger", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icedagger", "NW_WSWDG002"); +SetLocalString(OBJECT_SELF, "lsi3_icedagger", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icedagger", -10); +SetLocalInt(OBJECT_SELF, "lsv_icedagger", VFX_FNF_SMOKE_PUFF); + +//Acid Dagger (Emerald + Obsidian Dagger + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn118", "aciddagger"); +SetLocalInt(OBJECT_SELF, "lsc_aciddagger", 3); +SetLocalString(OBJECT_SELF, "lsi1_aciddagger", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_aciddagger", "NW_WSWDG002"); +SetLocalString(OBJECT_SELF, "lsi3_aciddagger", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_aciddagger", -10); +SetLocalInt(OBJECT_SELF, "lsv_aciddagger", VFX_FNF_SMOKE_PUFF); + +//Charged Dagger (Emerald + Obsidian Dagger + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn119", "chargeddagger"); +SetLocalInt(OBJECT_SELF, "lsc_chargeddagger", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargeddagger", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargeddagger", "NW_WSWDG002"); +SetLocalString(OBJECT_SELF, "lsi3_chargeddagger", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargeddagger", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargeddagger", VFX_FNF_SMOKE_PUFF); + +//Flame Quarterstaff (Emerald + Wooden Quarterstaff + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn120", "flamequartersta"); +SetLocalInt(OBJECT_SELF, "lsc_flamequartersta", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamequartersta", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamequartersta", "WoodenQuarterstaff"); +SetLocalString(OBJECT_SELF, "lsi3_flamequartersta", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamequartersta", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamequartersta", VFX_FNF_SMOKE_PUFF); + +//Ice Quarterstaff (Emerald + Wooden Quarterstaff + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn121", "icequarterstaff"); +SetLocalInt(OBJECT_SELF, "lsc_icequarterstaff", 3); +SetLocalString(OBJECT_SELF, "lsi1_icequarterstaff", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icequarterstaff", "WoodenQuarterstaff"); +SetLocalString(OBJECT_SELF, "lsi3_icequarterstaff", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icequarterstaff", -10); +SetLocalInt(OBJECT_SELF, "lsv_icequarterstaff", VFX_FNF_SMOKE_PUFF); + +//Acid Quarterstaff (Emerald + Wooden Quarterstaff + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn122", "acidquarterstaf"); +SetLocalInt(OBJECT_SELF, "lsc_acidquarterstaf", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidquarterstaf", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidquarterstaf", "WoodenQuarterstaff"); +SetLocalString(OBJECT_SELF, "lsi3_acidquarterstaf", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidquarterstaf", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidquarterstaf", VFX_FNF_SMOKE_PUFF); + +//Charged Quarterstaff (Emerald + Wooden Quarterstaff + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn123", "chargedquarters"); +SetLocalInt(OBJECT_SELF, "lsc_chargedquarters", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedquarters", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedquarters", "WoodenQuarterstaff"); +SetLocalString(OBJECT_SELF, "lsi3_chargedquarters", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedquarters", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedquarters", VFX_FNF_SMOKE_PUFF); + +//Flame Mace (Emerald + Obsidian Mace + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn124", "flamemace"); +SetLocalInt(OBJECT_SELF, "lsc_flamemace", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamemace", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamemace", "ObsidianMace"); +SetLocalString(OBJECT_SELF, "lsi3_flamemace", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamemace", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamemace", VFX_FNF_SMOKE_PUFF); + +//Ice Mace (Emerald + Obsidian Mace + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn125", "icemace"); +SetLocalInt(OBJECT_SELF, "lsc_icemace", 3); +SetLocalString(OBJECT_SELF, "lsi1_icemace", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icemace", "ObsidianMace"); +SetLocalString(OBJECT_SELF, "lsi3_icemace", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icemace", -10); +SetLocalInt(OBJECT_SELF, "lsv_icemace", VFX_FNF_SMOKE_PUFF); + +//Acid Mace (Emerald + Obsidian Mace + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn126", "acidmace"); +SetLocalInt(OBJECT_SELF, "lsc_acidmace", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidmace", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidmace", "ObsidianMace"); +SetLocalString(OBJECT_SELF, "lsi3_acidmace", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidmace", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidmace", VFX_FNF_SMOKE_PUFF); + +//Charged Mace (Emerald + Obsidian Mace + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn127", "chargedmace"); +SetLocalInt(OBJECT_SELF, "lsc_chargedmace", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedmace", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedmace", "ObsidianMace"); +SetLocalString(OBJECT_SELF, "lsi3_chargedmace", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedmace", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedmace", VFX_FNF_SMOKE_PUFF); + +//Flame Morningstar (Emerald + Obsidian Morningstar + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn128", "flamemorningsta"); +SetLocalInt(OBJECT_SELF, "lsc_flamemorningsta", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamemorningsta", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamemorningsta", "ObsidianMorningstar"); +SetLocalString(OBJECT_SELF, "lsi3_flamemorningsta", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamemorningsta", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamemorningsta", VFX_FNF_SMOKE_PUFF); + +//Ice Morningstar (Emerald + Obsidian Morningstar + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn129", "icemorningstar"); +SetLocalInt(OBJECT_SELF, "lsc_icemorningstar", 3); +SetLocalString(OBJECT_SELF, "lsi1_icemorningstar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icemorningstar", "ObsidianMorningstar"); +SetLocalString(OBJECT_SELF, "lsi3_icemorningstar", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icemorningstar", -10); +SetLocalInt(OBJECT_SELF, "lsv_icemorningstar", VFX_FNF_SMOKE_PUFF); + +//Acid Morningstar (Emerald + Obsidian Morningstar + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn130", "acidmorningstar"); +SetLocalInt(OBJECT_SELF, "lsc_acidmorningstar", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidmorningstar", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidmorningstar", "ObsidianMorningstar"); +SetLocalString(OBJECT_SELF, "lsi3_acidmorningstar", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidmorningstar", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidmorningstar", VFX_FNF_SMOKE_PUFF); + +//Charged Morningstar (Emerald + Obsidian Morningstar + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn131", "chargedmornings"); +SetLocalInt(OBJECT_SELF, "lsc_chargedmornings", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedmornings", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedmornings", "ObsidianMorningstar"); +SetLocalString(OBJECT_SELF, "lsi3_chargedmornings", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedmornings", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedmornings", VFX_FNF_SMOKE_PUFF); + +//Flame Greatsword (Emerald + Obsidian Greatsword + Brimstone)// +SetLocalString(OBJECT_SELF, "lsn132", "flamegreatsword"); +SetLocalInt(OBJECT_SELF, "lsc_flamegreatsword", 3); +SetLocalString(OBJECT_SELF, "lsi1_flamegreatsword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_flamegreatsword", "ObsidianGreatsword"); +SetLocalString(OBJECT_SELF, "lsi3_flamegreatsword", "Brimstone"); +SetLocalInt(OBJECT_SELF, "lss_flamegreatsword", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamegreatsword", VFX_FNF_SMOKE_PUFF); + +//Ice Greatsword (Emerald + Obsidian Greatsword + Coldstone)// +SetLocalString(OBJECT_SELF, "lsn133", "icegreatsword"); +SetLocalInt(OBJECT_SELF, "lsc_icegreatsword", 3); +SetLocalString(OBJECT_SELF, "lsi1_icegreatsword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_icegreatsword", "ObsidianGreatsword"); +SetLocalString(OBJECT_SELF, "lsi3_icegreatsword", "IceNine"); +SetLocalInt(OBJECT_SELF, "lss_icegreatsword", -10); +SetLocalInt(OBJECT_SELF, "lsv_icegreatsword", VFX_FNF_SMOKE_PUFF); + +//Acid Greatsword (Emerald + Obsidian Greatsword + Acid Crystal)// +SetLocalString(OBJECT_SELF, "lsn134", "acidgreatsword"); +SetLocalInt(OBJECT_SELF, "lsc_acidgreatsword", 3); +SetLocalString(OBJECT_SELF, "lsi1_acidgreatsword", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_acidgreatsword", "ObsidianGreatsword"); +SetLocalString(OBJECT_SELF, "lsi3_acidgreatsword", "AcidCrystal"); +SetLocalInt(OBJECT_SELF, "lss_acidgreatsword", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidgreatsword", VFX_FNF_SMOKE_PUFF); + +//Charged Greatsword (Emerald + Obsidian Greatsword + Charged Crystal)// +SetLocalString(OBJECT_SELF, "lsn135", "chargedgreatswo"); +SetLocalInt(OBJECT_SELF, "lsc_chargedgreatswo", 3); +SetLocalString(OBJECT_SELF, "lsi1_chargedgreatswo", "NW_IT_GEM012"); +SetLocalString(OBJECT_SELF, "lsi2_chargedgreatswo", "ObsidianGreatsword"); +SetLocalString(OBJECT_SELF, "lsi3_chargedgreatswo", "ChargedCrystal"); +SetLocalInt(OBJECT_SELF, "lss_chargedgreatswo", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedgreatswo", VFX_FNF_SMOKE_PUFF); + +//Ice Heavy Armor (Bone Brigadine + Coldstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn136", "icearmorh"); +SetLocalInt(OBJECT_SELF, "lsc_icearmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_icearmorh", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_icearmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi3_icearmorh", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi4_icearmorh", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_icearmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_icearmorh", VFX_FNF_SMOKE_PUFF); + +//Flame Heavy Armor (Bone Brigadine + Brimstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn137", "flamearmorh"); +SetLocalInt(OBJECT_SELF, "lsc_flamearmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_flamearmorh", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_flamearmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi3_flamearmorh", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi4_flamearmorh", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_flamearmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamearmorh", VFX_FNF_SMOKE_PUFF); + +//Acid Heavy Armor (Bone Brigadine + Acid Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn138", "acidarmorh"); +SetLocalInt(OBJECT_SELF, "lsc_acidarmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_acidarmorh", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_acidarmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi3_acidarmorh", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_acidarmorh", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_acidarmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidarmorh", VFX_FNF_SMOKE_PUFF); + +//Charged Heavy Armor (Bone Brigadine + Charged Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn139", "chargedarmorh"); +SetLocalInt(OBJECT_SELF, "lsc_chargedarmorh", 4); +SetLocalString(OBJECT_SELF, "lsi1_chargedarmorh", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_chargedarmorh", "NW_AARCL006"); +SetLocalString(OBJECT_SELF, "lsi3_chargedarmorh", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_chargedarmorh", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_chargedarmorh", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedarmorh", VFX_FNF_SMOKE_PUFF); + +//Ice Medium Armor (Bone Scale Mail + Coldstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn140", "icearmorm"); +SetLocalInt(OBJECT_SELF, "lsc_icearmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_icearmorm", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_icearmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi3_icearmorm", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi4_icearmorm", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_icearmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_icearmorm", VFX_FNF_SMOKE_PUFF); + +//Flame Medium Armor (Bone Scale Mail + Brimstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn141", "flamearmorm"); +SetLocalInt(OBJECT_SELF, "lsc_flamearmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_flamearmorm", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_flamearmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi3_flamearmorm", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi4_flamearmorm", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_flamearmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamearmorm", VFX_FNF_SMOKE_PUFF); + +//Acid Medium Armor (Bone Scale Mail + Acid Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn142", "acidarmorm"); +SetLocalInt(OBJECT_SELF, "lsc_acidarmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_acidarmorm", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_acidarmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi3_acidarmorm", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_acidarmorm", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_acidarmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidarmorm", VFX_FNF_SMOKE_PUFF); + +//Charged Medium Armor (Bone Scale Mail + Charged Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn143", "chargedarmorm"); +SetLocalInt(OBJECT_SELF, "lsc_chargedarmorm", 4); +SetLocalString(OBJECT_SELF, "lsi1_chargedarmorm", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_chargedarmorm", "BoneScaleMail"); +SetLocalString(OBJECT_SELF, "lsi3_chargedarmorm", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_chargedarmorm", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_chargedarmorm", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedarmorm", VFX_FNF_SMOKE_PUFF); + +//Ice Light Armor (Bone Studded Leather + Coldstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn144", "icearmorl"); +SetLocalInt(OBJECT_SELF, "lsc_icearmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_icearmorl", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_icearmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi3_icearmorl", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi4_icearmorl", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_icearmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_icearmorl", VFX_FNF_SMOKE_PUFF); + +//Flame Light Armor (Bone Studded Leather + Brimstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn145", "flamearmorl"); +SetLocalInt(OBJECT_SELF, "lsc_flamearmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_flamearmorl", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_flamearmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi3_flamearmorl", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi4_flamearmorl", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_flamearmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamearmorl", VFX_FNF_SMOKE_PUFF); + +//Acid Light Armor (Bone Studded Leather + Acid Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn146", "acidarmorl"); +SetLocalInt(OBJECT_SELF, "lsc_acidarmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_acidarmorl", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_acidarmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi3_acidarmorl", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_acidarmorl", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_acidarmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidarmorl", VFX_FNF_SMOKE_PUFF); + +//Charged Light Armor (Bone Studded Leather + Charged Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn147", "chargedarmorl"); +SetLocalInt(OBJECT_SELF, "lsc_chargedarmorl", 4); +SetLocalString(OBJECT_SELF, "lsi1_chargedarmorl", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_chargedarmorl", "NW_AARCL002"); +SetLocalString(OBJECT_SELF, "lsi3_chargedarmorl", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_chargedarmorl", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_chargedarmorl", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedarmorl", VFX_FNF_SMOKE_PUFF); + +//Ice Helmet (Bone Helmet + Coldstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn148", "icehelmet"); +SetLocalInt(OBJECT_SELF, "lsc_icehelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_icehelmet", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_icehelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi3_icehelmet", "IceNine"); +SetLocalString(OBJECT_SELF, "lsi4_icehelmet", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_icehelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_icehelmet", VFX_FNF_SMOKE_PUFF); + +//Flame Helmet (Bone Helmet + Brimstone + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn149", "flamehelmet"); +SetLocalInt(OBJECT_SELF, "lsc_flamehelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_flamehelmet", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_flamehelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi3_flamehelmet", "Brimstone"); +SetLocalString(OBJECT_SELF, "lsi4_flamehelmet", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_flamehelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_flamehelmet", VFX_FNF_SMOKE_PUFF); + +//Acid Helmet (Bone Helmet + Acid Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn150", "acidhelmet"); +SetLocalInt(OBJECT_SELF, "lsc_acidhelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_acidhelmet", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_acidhelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi3_acidhelmet", "AcidCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_acidhelmet", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_acidhelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_acidhelmet", VFX_FNF_SMOKE_PUFF); + +//Charged Helmet (Bone Helmet + Charged Crystal + Ruby + Slaad's Tongue)// +SetLocalString(OBJECT_SELF, "lsn151", "chargedhelmet"); +SetLocalInt(OBJECT_SELF, "lsc_chargedhelmet", 4); +SetLocalString(OBJECT_SELF, "lsi1_chargedhelmet", "NW_IT_GEM006"); +SetLocalString(OBJECT_SELF, "lsi2_chargedhelmet", "BoneHelmet"); +SetLocalString(OBJECT_SELF, "lsi3_chargedhelmet", "ChargedCrystal"); +SetLocalString(OBJECT_SELF, "lsi4_chargedhelmet", "NW_IT_MSMLMISC10"); +SetLocalInt(OBJECT_SELF, "lss_chargedhelmet", -10); +SetLocalInt(OBJECT_SELF, "lsv_chargedhelmet", VFX_FNF_SMOKE_PUFF); + +} + +void CreateGold(object oTarget, int nAmount) +{ + CreateItemOnObject("nw_it_gold001", oTarget, nAmount); +} + +// Wanye added: Custom function to return TRUE if the item type is an +// item type that can affect the total amount in the stack created. +int wow_CheckBaseItemType(object oItem) +{ + int nReturn; + int nType = GetBaseItemType(oItem); + switch(nType) + { + // Just add in any types here that will affect the number in the + // stack created. + case BASE_ITEM_ARROW: + case BASE_ITEM_BOLT: + case BASE_ITEM_BULLET: + case BASE_ITEM_DART: + case BASE_ITEM_THROWINGAXE: + { + nReturn = TRUE; + break; + } + default: + { + break; + } + } + return nReturn; +} + +void main() +{ + object oOwner = OBJECT_SELF; + + if (!GetLocalInt(OBJECT_SELF, "lsvar_set")) + { + SetItemLocals(); + SetLocalInt(OBJECT_SELF, "lsvar_set", TRUE); + } + if (lsn==0 || GetInventoryDisturbType() != INVENTORY_DISTURB_TYPE_ADDED) return; + + object oItem; + int nNth, nIngredients, nCurrent, nCount, nGold, nStack, nRecipe, nOkay, nHasGold; + string sCurrent, sNth, sRequired; + + for(nNth = 1; nNth <= lsn; nNth++) + { + sNth = IntToString(nNth); + sCurrent = GetLocalString(oOwner, "lsn"+sNth); + nIngredients = GetLocalInt(oOwner, "lsc_"+sCurrent); + nCurrent = 0; + nStack = 0; + nGold = 0; + + for(nCount = 1; nCount <= nIngredients; nCount++) + { + sNth = IntToString(nCount); + sRequired = GetLocalString(oOwner, "lsi"+sNth+"_"+sCurrent); + + if (GetStringLeft(sRequired, 8)==" gold ") + { + nGold = StringToInt(GetStringRight(sRequired, GetStringLength(sRequired)-8)); + if (GetGold(oOwner)>=nGold) nCurrent++; + + } + else + { + oItem = GetItemPossessedBy(oOwner, sRequired); + if(GetIsObjectValid(oItem)) + { + nCurrent++; + } + } + if(nRecipe == 0 && nCurrent == nIngredients) + { + nRecipe = nNth; + break; // break out of the loop now that we have a recipe + } + } + } + + // I'm not sure what the -10 is used for in the crafting so I left these + // lines intact + if (GetLocalInt(oOwner, "lss_"+sCurrent)==-10) nOkay=TRUE; + else if (GetLastSpell()==GetLocalInt(oOwner, "lss_"+sCurrent)) nOkay=TRUE; + else nOkay=FALSE; + + if(nOkay && (nRecipe > 0)) + { + if (nGold>0) + { + nHasGold=GetGold(oOwner); + DestroyObject(GetItemPossessedBy(oOwner, "NW_IT_GOLD001")); + DelayCommand(0.2, CreateGold(oOwner, nHasGold-nGold)); + } + sCurrent = GetLocalString(oOwner, "lsn"+IntToString(nRecipe)); + for(nNth = 1; nNth <= nIngredients; nNth++) + { + sNth = IntToString(nNth); + sRequired = GetLocalString(oOwner, "lsi"+sNth+"_"+sCurrent); + oItem = GetItemPossessedBy(oOwner, sRequired); + if(wow_CheckBaseItemType(oItem)) nStack = GetNumStackedItems(oItem); + + if(GetIsObjectValid(oItem)) DestroyObject(oItem); + } + + CreateItemOnObject(sCurrent, oOwner, nStack); + int nVis=GetLocalInt(oOwner, "lsv_"+sCurrent); + if (nVis!=-10) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(nVis), oOwner); + } +} + diff --git a/nwnds_module/wow_faction_adj.ncs b/nwnds_module/wow_faction_adj.ncs new file mode 100644 index 000000000..15d9f9bdf Binary files /dev/null and b/nwnds_module/wow_faction_adj.ncs differ diff --git a/nwnds_module/wow_faction_adj.nss b/nwnds_module/wow_faction_adj.nss new file mode 100644 index 000000000..1deff60b8 --- /dev/null +++ b/nwnds_module/wow_faction_adj.nss @@ -0,0 +1,147 @@ +// The delay for 2DA reads, change as needed. +const float DELAY_2DA = 0.3; + +// The delay between switching factions, change as needed. +const float DELAY_FACTION = 0.3; + +// Row is how self feels about column +int wow_GetCurrentWorkingFaction(); +void wow_SetCurrentWorkingFaction(int nFaction); +int wow_GetIsBusy(); +void wow_SetIsBusy(int nBusy = TRUE); +void wow_ResetFactions(int nRun = 1); +int wow_GetMaxFactions(); +void wow_SetUpFaction(int nFaction = 1, int nRun = 0); +int wow_GetIsFactionSetUp(int nFaction); +void wow_ChangeFactionFeelings(int nFaction, int nWorking = 1); + +void main() +{ + if(wow_GetIsBusy()) SendMessageToPC(GetLastUsedBy(), "Factions are currently being reset already."); + else + { + SendMessageToAllDMs("Resetting factions now. This will take a few moments"); + wow_SetIsBusy(); + wow_ResetFactions(); + } +} + +void MessagePC(string sMessage) +{ + SendMessageToPC(GetFirstPC(), sMessage); +} + +void wow_ChangeFactionFeelings(int nFaction, int nWorking = 1) +{ + int nMax = wow_GetMaxFactions(); + if(nWorking <= nMax) + { + string sSourceTag = GetLocalString(OBJECT_SELF, "FACTION"+IntToString(nFaction)); + string sTargetTag = GetLocalString(OBJECT_SELF, "FACTION"+IntToString(nWorking)); + object oSource = GetObjectByTag(sSourceTag); + object oTarget = GetObjectByTag(sTargetTag); + object oTemp = GetFirstFactionMember(oSource, FALSE); + string sTrue = sSourceTag+"_"+IntToString(nWorking); + int nTrueFeelings = GetLocalInt(OBJECT_SELF, sTrue); + int nCurrentFeelings; + while(GetIsObjectValid(oTemp)) + { + nCurrentFeelings = GetReputation(oTemp, oTarget); + + if(nCurrentFeelings != nTrueFeelings) AdjustReputation(oTemp, oTarget, (nTrueFeelings - nCurrentFeelings)); + oTemp = GetNextFactionMember(oSource, FALSE); + } + nWorking++; + DelayCommand(DELAY_FACTION, wow_ChangeFactionFeelings(nFaction, nWorking)); + } + else + { + nFaction++; + DelayCommand(DELAY_FACTION, wow_ResetFactions(nFaction)); + } +} + +void wow_ResetFactions(int nRun = 1) +{ + int nMax = wow_GetMaxFactions(); + if(nRun <= nMax) + { + if(!wow_GetIsFactionSetUp(nRun)) + { + wow_SetUpFaction(); + } + else wow_ChangeFactionFeelings(nRun); + } + else + { + SendMessageToAllDMs("Factions are now reset."); + wow_SetIsBusy(FALSE); + } +} + +void wow_SetUpFaction(int nFaction = 1, int nRun = 0) +{ + string sFaction = GetLocalString(OBJECT_SELF, "FACTION"+IntToString(nFaction)); + int nMax = wow_GetMaxFactions(); + + if(nRun > 0) + { + string sTemp = Get2DAString("athas_factions", "Faction"+IntToString(nRun), nFaction); + SetLocalInt(OBJECT_SELF, sFaction+"_"+IntToString(nRun), StringToInt(sTemp)); + } + else + { + sFaction = Get2DAString("athas_factions", "FactionTag", nFaction); + SetLocalString(OBJECT_SELF, "FACTION"+IntToString(nFaction), sFaction); + } + nRun++; + if(nRun <= nMax) + { + DelayCommand(DELAY_2DA, wow_SetUpFaction(nFaction, nRun)); + } + else + { + nFaction++; + if(nFaction <= nMax) DelayCommand(DELAY_FACTION, wow_SetUpFaction(nFaction, 0)); + else DelayCommand(DELAY_2DA, wow_ResetFactions(1)); + } +} + +int wow_GetIsFactionSetUp(int nFaction) +{ + if(GetLocalString(OBJECT_SELF, "FACTION"+IntToString(nFaction)) != "") return TRUE; + else return FALSE; +} + +int wow_GetMaxFactions() +{ + int nReturn = GetLocalInt(OBJECT_SELF, "MAX_FACTIONS"); + if(!nReturn) + { + nReturn = StringToInt(Get2DAString("athas_factions", "NumberOfFactions", 0)); + SetLocalInt(OBJECT_SELF, "MAX_FACTIONS", nReturn); + } + return nReturn; +} + +void wow_SetIsBusy(int nBusy = TRUE) +{ + SetLocalInt(OBJECT_SELF, "BUSY", nBusy); +} + +int wow_GetIsBusy() +{ + return GetLocalInt(OBJECT_SELF, "BUSY"); +} + +int wow_GetCurrentWorkingFaction() +{ + return GetLocalInt(OBJECT_SELF, "CURRENT_FACTION"); +} + +void wow_SetCurrentWorkingFaction(int nFaction) +{ + SetLocalInt(OBJECT_SELF, "CURRENT_FACTION", nFaction); +} + + diff --git a/nwnds_module/wow_inc_bounty.nss b/nwnds_module/wow_inc_bounty.nss new file mode 100644 index 000000000..ba89b01d5 --- /dev/null +++ b/nwnds_module/wow_inc_bounty.nss @@ -0,0 +1,347 @@ +#include "dante_db" +#include "aps_include" + +void wow_BountyBoardChange(object oPlayer); +void wow_SetBountyBoardRanking(object oBoard, string sPlayer, string sAccount, int nRank, int nCount, int nIncreaseMax = FALSE); +int wow_GetCurrentBountyRank(object oBountyBoard, int nBountyCount); +object wow_GetBountyObject(); +object wow_GetPlayerKiller(object oDead); +void wow_SpamServer(string sMessage); +int wow_BountySC(); +void wow_ClearBountyVariables(); +void wow_SetBountyPlayers(); +void wow_SetBountyTokens(); +int wow_GetIsBountyPlayerValid(); +void wow_TurnPage(int nForward = TRUE); +void wow_AcceptBounty(); +void wow_SetChoice(int nChoice); + +void wow_ClearBountyVariables() +{ + int nMax = GetLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS"); + int nNth; + DeleteLocalInt(OBJECT_SELF, "COUNT"); + DeleteLocalInt(OBJECT_SELF, "PAGE"); + DeleteLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS"); + DeleteLocalInt(OBJECT_SELF, "BOUNTIES_SET"); + DeleteLocalInt(OBJECT_SELF, "CHOICE"); + + for(nNth = 1; nNth <= nMax; nNth++) + { + DeleteLocalString(OBJECT_SELF, "BOUNTY_PLAYER_TEXT_"+IntToString(nNth)); + DeleteLocalString(OBJECT_SELF, "BOUNTY_PLAYER_VARIABLE_"+IntToString(nNth)); + } +} + +int wow_BountySC() +{ + int nReturn; + int nCount = GetLocalInt(OBJECT_SELF, "COUNT"); + int nPage = GetLocalInt(OBJECT_SELF, "PAGE"); + + switch(nCount) + { + case 0: + { + wow_SetBountyPlayers(); + wow_SetBountyTokens(); + nReturn = TRUE; + break; + } + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + { + nReturn = wow_GetIsBountyPlayerValid(); + break; + } + case 11: + { + if(GetLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS") > ((nPage + 1) * 10)) nReturn = TRUE; + break; + } + case 12: + { + if(nPage > 0) nReturn = TRUE; + break; + } + } + nCount++; + if(nCount == 13) DeleteLocalInt(OBJECT_SELF, "COUNT"); + else SetLocalInt(OBJECT_SELF, "COUNT", nCount); + return nReturn; +} + +void wow_SetChoice(int nChoice) +{ + SetLocalInt(OBJECT_SELF, "CHOICE", nChoice); +} + +void wow_AcceptBounty() +{ + int nPage = GetLocalInt(OBJECT_SELF, "PAGE"); + int nChoice = GetLocalInt(OBJECT_SELF, "CHOICE"); + string sChoice = GetLocalString(OBJECT_SELF, "BOUNTY_PLAYER_VARIABLE_"+IntToString((nPage * 10) + nChoice)); + SetLocalInt(GetPCSpeaker(), "WOW_BOUNTY_"+sChoice, TRUE); +} + +void wow_TurnPage(int nForward = TRUE) +{ + int nPage = GetLocalInt(OBJECT_SELF, "PAGE"); + if(nForward) nPage++; + else nPage--; + SetLocalInt(OBJECT_SELF, "PAGE", nPage); +} + +void wow_SetBountyPlayers() +{ + if(!GetLocalInt(OBJECT_SELF, "BOUNTIES_SET")) + { + SetLocalInt(OBJECT_SELF, "BOUNTIES_SET", TRUE); + int nCount; + object oPC = GetFirstPC(); + object oSpeaker = GetPCSpeaker(); + + while(GetIsObjectValid(oPC)) + { + if(GetLocalInt(oPC, "Bounty") > 0 && oPC != oSpeaker) + { + nCount++; + SetLocalString(OBJECT_SELF, "BOUNTY_PLAYER_VARIABLE_"+IntToString(nCount), GetCampaignVariableName(oPC)); + SetLocalString(OBJECT_SELF, "BOUNTY_PLAYER_TEXT_"+IntToString(nCount), GetName(oPC)+", Level: "+IntToString(GetHitDice(oPC))+", Bounty: "+IntToString(GetLocalInt(oPC, "Bounty"))); + } + oPC = GetNextPC(); + } + SetLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS", nCount); + } +} +void wow_SetBountyTokens() +{ + int nMax = GetLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS"); + int nPage = GetLocalInt(OBJECT_SELF, "PAGE"); + int nNth; + int nToken = 5300; + + for(nNth = 1; nNth <= 10; nNth++) + { + if(((nPage * 10) + nNth) <= nMax) + { + SetCustomToken((nToken + nNth), GetLocalString(OBJECT_SELF, "BOUNTY_PLAYER_TEXT_"+IntToString((nPage * 10) + nNth))); + } + } +} + +int wow_GetIsBountyPlayerValid() +{ + int nMax = GetLocalInt(OBJECT_SELF, "BOUNTY_PLAYERS"); + int nPage = GetLocalInt(OBJECT_SELF, "PAGE"); + int nCount = GetLocalInt(OBJECT_SELF, "COUNT"); + int nCurrent = (nPage * 10) + nCurrent; + if(nCurrent <= nMax) return TRUE; + else return FALSE; +} + +void wow_SpamServer(string sMessage) +{ + object oPC = GetFirstPC(); + while(GetIsObjectValid(oPC)) + { + SendMessageToPC(oPC, sMessage); + oPC = GetNextPC(); + } +} + +object wow_GetPlayerKiller(object oDead) +{ + ExecuteScript("wow_playerkiller", oDead); + object oKiller = GetLocalObject(oDead, "WOW_BOUNTY_BOARD_KILLER"); + object oActor = GetLocalObject(oDead, "WOW_BOUNTY_BOARD_ACTOR"); + DeleteLocalObject(oDead, "WOW_BOUNTY_BOARD_KILLER"); + DeleteLocalObject(oDead, "WOW_BOUNTY_BOARD_ACTOR"); + object oReturn = OBJECT_INVALID; + int nKillerType = GetObjectType(oKiller); + int nActorType = GetObjectType(oActor); + + if(GetIsObjectValid(oKiller)) + { + if(!GetIsPC(oKiller)) + { + switch(nKillerType) + { + case OBJECT_TYPE_AREA_OF_EFFECT: + { + oKiller = GetAreaOfEffectCreator(oKiller); + break; + } + case OBJECT_TYPE_CREATURE: + { + oKiller = GetMaster(oKiller); + break; + } + case OBJECT_TYPE_DOOR: + case OBJECT_TYPE_PLACEABLE: + case OBJECT_TYPE_TRIGGER: + { + oKiller = GetTrapCreator(oKiller); + break; + } + default: + { + break; + } + } + } + } + if(GetIsObjectValid(oActor)) + { + if(!GetIsPC(oActor)) + { + switch(nActorType) + { + case OBJECT_TYPE_AREA_OF_EFFECT: + { + oActor = GetAreaOfEffectCreator(oActor); + break; + } + case OBJECT_TYPE_CREATURE: + { + oActor = GetMaster(oActor); + break; + } + case OBJECT_TYPE_DOOR: + case OBJECT_TYPE_PLACEABLE: + case OBJECT_TYPE_TRIGGER: + { + oActor = GetTrapCreator(oActor); + break; + } + default: + { + break; + } + } + } + } + if(GetIsPC(oKiller) && !GetIsDM(oKiller) && !GetIsDMPossessed(oKiller)) oReturn = oKiller; + else if(GetIsPC(oActor) && !GetIsDM(oActor) && !GetIsDMPossessed(oActor)) oReturn = oActor; + else oReturn = GetLastKiller(); + return oReturn; +} + +object wow_GetBountyObject() +{ + object oReturn = GetWaypointByTag("WOW_BOUNTY_WP"); + if(!GetIsObjectValid(oReturn)) + { + SendMessageToPC(GetFirstPC(), "Bounty object not valid"); + oReturn = CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", GetStartingLocation(), FALSE, "WOW_BOUNTY_WP"); + int nMax = GetPersistentInt(GetModule(), "WOW_BOUNTY_MAX","ar_dsostats"); + int nNth; + SetLocalInt(oReturn, "WOW_BOUNTY_MAX", nMax); + + for(nNth = 1; nNth <= nMax; nNth++) + { + SetLocalInt(oReturn, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_COUNT", GetPersistentInt(GetModule(), "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_COUNT","ar_dsostats")); + SetLocalString(oReturn, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_PLAYER", GetPersistentString(GetModule(), "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_PLAYER","ar_dsostats")); + SetLocalString(oReturn, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_ACCOUNT", GetPersistentString(GetModule(), "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_ACCOUNT","ar_dsostats")); + } + } + else SendMessageToPC(GetFirstPC(), "Bounty object valid"); + return oReturn; +} + +int wow_GetCurrentBountyRank(object oBountyBoard, int nBountyCount) +{ + int nMax = GetLocalInt(oBountyBoard, "WOW_BOUNTY_MAX"); + int nRank, nNth; + for(nNth = 1; nNth <= nMax; nNth++) + { + if(!nRank) + { + if(nBountyCount > GetLocalInt(oBountyBoard, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_COUNT")) nRank = nNth; + } + } + if(!nRank) nRank = nMax + 1; + return nRank; +} + +void wow_SetBountyBoardRanking(object oBoard, string sPlayer, string sAccount, int nRank, int nCount, int nIncreaseMax = FALSE) +{ + string sRank = IntToString(nRank); + SetLocalInt(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_COUNT", nCount); + SetLocalString(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_PLAYER", sPlayer); + SetLocalString(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_ACCOUNT", sAccount); + + SetPersistentInt(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_COUNT", nCount,0,"ar_dsostats"); + SetPersistentString(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_PLAYER", sPlayer,0,"ar_dsostats"); + SetPersistentString(oBoard, "WOW_BOUNTY_RANK_"+sRank+"_ACCOUNT", sAccount,0,"ar_dsostats"); + + if(nIncreaseMax) + { + int nMax = GetLocalInt(oBoard, "WOW_BOUNTY_MAX"); + nMax++; + SetLocalInt(oBoard, "WOW_BOUNTY_MAX", nMax); + SetPersistentInt(oBoard,"WOW_BOUNTY_MAX", nMax,0,"ar_dsostats"); + //SetCampaignInt("DSOStats", "WOW_BOUNTY_MAX", nMax); + } +} + +void wow_BountyBoardChange(object oPlayer) +{ + object oBoard = wow_GetBountyObject(); + int nMax = GetLocalInt(oBoard, "WOW_BOUNTY_MAX"); + int nPlayerCount = GetLocalInt(oPlayer, "WOW_BOUNTIES_COLLECTED"); + int nRank = wow_GetCurrentBountyRank(oBoard, nPlayerCount); + int nNth, nCurrentCount, nNextCount, nFound; + string sCurrentName, sNextName, sCurrentAccount, sNextAccount; + string sPlayerAccount = GetStringUpperCase(GetPCPlayerName(oPlayer)); + string sPlayerName = GetName(oPlayer); + sCurrentAccount = sPlayerAccount; + sCurrentName = sPlayerName; + nCurrentCount = nPlayerCount; + + if(nRank <= nMax) + { + for(nNth = nRank; nNth <= nMax; nNth++) + { + // Get the next lower rank + nNextCount = GetLocalInt(oBoard, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_COUNT"); + sNextName = GetLocalString(oBoard, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_PLAYER"); + sNextAccount = GetLocalString(oBoard, "WOW_BOUNTY_RANK_"+IntToString(nNth)+"_ACCOUNT"); + + if(nFound) + { + nCurrentCount = nNextCount; + sCurrentName = sNextName; + sCurrentAccount = sNextAccount; + wow_SetBountyBoardRanking(oBoard, sCurrentName, sCurrentAccount, nNth, nCurrentCount); + } + else + { + wow_SetBountyBoardRanking(oBoard, sCurrentName, sCurrentAccount, nNth, nCurrentCount); + nCurrentCount = nNextCount; + sCurrentName = sNextName; + sCurrentAccount = sNextAccount; + } + // If this is the player's old standing do??? + if(sPlayerName == sCurrentName && sPlayerAccount == sCurrentAccount) + { + // Set the variable to show this account has been found + nFound = TRUE; + } + } + } + // New person on the board + else + { + wow_SetBountyBoardRanking(oBoard, sPlayerName, sPlayerAccount, nNth, nPlayerCount, TRUE); + } +} + diff --git a/nwnds_module/wow_inc_forge.nss b/nwnds_module/wow_inc_forge.nss new file mode 100644 index 000000000..d9db60006 --- /dev/null +++ b/nwnds_module/wow_inc_forge.nss @@ -0,0 +1,187 @@ +/* + WOW__R = number of recipes + WOW__RX = number of ingredients + WOW__RX_RES = resref + WOW__RX_INGX = tag of INGX + WOW__RX_GOLD = Gold + WOW__RX_VFX = VFX + WOW__RX_STACK = number to create +*/ +#include "wow_inc_load_sys" + +void wow_DelayedCreateItem(string sResRef, object oTarget, int nStack) +{ + CreateItemOnObject(sResRef, oTarget, nStack); +} + +int wow_CheckBaseItemType(object oItem) +{ + int nReturn; + int nType = GetBaseItemType(oItem); + switch(nType) + { + // Just add in any types here that will affect the number in the + // stack created. + case BASE_ITEM_ARROW: + case BASE_ITEM_BOLT: + case BASE_ITEM_BULLET: + case BASE_ITEM_DART: + case BASE_ITEM_THROWINGAXE: + case BASE_ITEM_SHURIKEN: + { + nReturn = TRUE; + break; + } + default: + { + break; + } + } + return nReturn; +} + +void wow_Forge() +{ + if(GetLocalInt(GetModule(), "WOW_LOADING_SYSTEM") > 0) return; + if(GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED) wow_CheckAllRecipes(); +} + +void wow_CreateGold(int nAmount) +{ + CreateItemOnObject("nw_it_gold001", OBJECT_SELF, nAmount); +} + +void wow_CreateRecipe(int nRecipe) +{ + string sBase = "WOW_"+GetTag(OBJECT_SELF)+"_R"+IntToString(nRecipe); + object oModule = GetModule(); + int nMaxIng = GetLocalInt(oModule, sBase); + int nGold = GetLocalInt(oModule, sBase+"_GOLD"); + int nNth, nCount, nReturn; + int nStack = GetLocalInt(oModule, sBase+"_STACK"); + string sTag; + string sResRef = GetLocalString(oModule, sBase+"_RES"); + object oItem; + + for(nNth = 1; nNth <= nMaxIng; nNth++) + { + sTag = GetLocalString(oModule, sBase+"_ING"+IntToString(nNth)); + oItem = GetItemPossessedBy(OBJECT_SELF, sTag); + if(GetIsObjectValid(oItem)) + { + if(wow_CheckBaseItemType(oItem) && nStack <= 0) nStack = GetNumStackedItems(oItem); + DestroyObject(oItem); + } + } + if(GetGold(OBJECT_SELF) == nGold && nGold >= 0) DestroyObject(GetItemPossessedBy(OBJECT_SELF, "NW_IT_GOLD001")); + else if(nGold >= 0) + { + nCount = GetGold(OBJECT_SELF); + DestroyObject(GetItemPossessedBy(OBJECT_SELF, "NW_IT_GOLD001")); + DelayCommand(0.2, wow_CreateGold(nCount-nGold)); + } + if(nStack <= 0) nStack = 1; + DelayCommand(1.0, wow_DelayedCreateItem(sResRef, OBJECT_SELF, nStack)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(GetLocalInt(oModule, sBase+"_VFX")), OBJECT_SELF); + } + +int wow_CheckRecipe(int nRecipe) +{ + object oItem; + object oModule = GetModule(); + string sBase = "WOW_"+GetTag(OBJECT_SELF)+"_R"+IntToString(nRecipe); + int nMaxIng = GetLocalInt(oModule, sBase); + int nGold = GetLocalInt(oModule, sBase+"_GOLD"); + int nNth, nCount, nReturn; + string sTag; + + for(nNth = 1; nNth <= nMaxIng; nNth++) + { + sTag = GetLocalString(oModule, sBase+"_ING"+IntToString(nNth)); + oItem = GetItemPossessedBy(OBJECT_SELF, sTag); + if(GetIsObjectValid(oItem)) nCount++; + } + if(nCount == nMaxIng && GetGold(OBJECT_SELF) >= nGold) nReturn = TRUE; + return nReturn; +} + +void wow_CheckAllRecipes() +{ + string sTag = GetTag(OBJECT_SELF); + string sBase = "WOW_"+sTag+"_R"; + object oModule = GetModule(); + int nMax = GetLocalInt(oModule, sBase); + int nNth, nRun, nRecipe; + + for(nNth = 1; (nNth <= nMax) && (!nRun); nNth++) + { + nRun = wow_CheckRecipe(nNth); + if(nRun) nRecipe = nNth; + } + if(nRecipe > 0) wow_CreateRecipe(nRecipe); +} + + +void wow_SetUpRecipe(int nRecipe, string sTag, string s2DA, int nRow = 0) +{ + string sMaxRows = Get2DAString(s2DA, "RESREF", 0); + string sMaxIng = Get2DAString(s2DA, "NUMING", 0); + int nMaxRows = StringToInt(sMaxRows); + int nMaxIng = StringToInt(sMaxIng); + int nEnd = nRow + 3; + string sBase = "WOW_"+sTag+"_R"; + int nNum, nIng, nGold, nVFX, nCount, nStack; + string sNum, sRow, sIng, sGold, sCount, sStack, sResRef, sVFX, sIng2; + object oModule = GetModule(); + if(nRow == 0) + { + nRow = 1; + SetLocalInt(oModule, sBase, nMaxRows); + } + + for(nRow = nRow; (nRow < nEnd) && ((nRow < nMaxRows) || (nRow == nMaxRows)); nRow++) + { + sRow = IntToString(nRow); + sNum = Get2DAString(s2DA, "NUMING", nRow); + sResRef = Get2DAString(s2DA, "RESREF", nRow); + sGold = Get2DAString(s2DA, "GOLD", nRow); + sVFX = Get2DAString(s2DA, "VFX", nRow); + sStack = Get2DAString(s2DA, "NUMCREATE", nRow); + nNum = StringToInt(sNum); + nGold = StringToInt(sGold); + nVFX = StringToInt(sVFX); + nStack = StringToInt(sStack); + SetLocalInt(oModule, sBase+sRow, nNum); // Number of ingredients + SetLocalString(oModule, sBase+sRow+"_RES", sResRef); + if(nGold > 0) SetLocalInt(oModule, sBase+sRow+"_GOLD", nGold); + SetLocalInt(oModule, sBase+sRow+"_VFX", nVFX); + if(nStack > 0) SetLocalInt(oModule, sBase+sRow+"_STACK", nStack); + + for(nIng = 1; nIng <= nNum; nIng++) + { + sIng = "ING"+IntToString(nIng); + sIng2 = Get2DAString(s2DA, sIng, nRow); + SetLocalString(oModule, sBase+sRow+"_"+sIng, sIng2); + } + } + + if(nRow <= nMaxRows) DelayCommand(1.0, wow_SetUpRecipe(nRecipe, sTag, s2DA, nRow)); + else DelayCommand(1.0, wow_SetupForge(nRecipe)); +} + +void wow_SetupForge(int nRecipe = 0) +{ + string sMax = Get2DAString("wow_crft_base", "TAG", 0); + int nMax = StringToInt(sMax); + nRecipe++; + + if(nRecipe <= nMax) + { + string s2DA = Get2DAString("wow_crft_base", "2DA", nRecipe); + string sTag = Get2DAString("wow_crft_base", "TAG", nRecipe); + DelayCommand(0.5, wow_SetUpRecipe(nRecipe, sTag, s2DA)); + } + else DelayCommand(0.5, wow_Setup()); +} + + diff --git a/nwnds_module/wow_inc_forge2.nss b/nwnds_module/wow_inc_forge2.nss new file mode 100644 index 000000000..62ec5578f --- /dev/null +++ b/nwnds_module/wow_inc_forge2.nss @@ -0,0 +1,197 @@ +/* + WOW__R = number of recipes + WOW__RX = number of ingredients + WOW__RX_RES = resref + WOW__RX_INGX = tag of INGX + WOW__RX_GOLD = Gold + WOW__RX_VFX = VFX + WOW__RX_STACK = number to create +*/ + + +void wow_Setup(int nRecipe = 0); +void wow_SetUpRecipe(int nRecipe, string sTag, string s2DA, int nRow = 0); +void wow_CheckAllRecipes(); +int wow_CheckRecipe(int nRecipe); +void wow_CreateRecipe(int nRecipe); +void wow_CreateGold(int nAmount); +int wow_CheckBaseItemType(object oItem); +void wow_Forge(); + +int wow_CheckBaseItemType(object oItem) +{ + int nReturn; + int nType = GetBaseItemType(oItem); + switch(nType) + { + // Just add in any types here that will affect the number in the + // stack created. + case BASE_ITEM_ARROW: + case BASE_ITEM_BOLT: + case BASE_ITEM_BULLET: + case BASE_ITEM_DART: + case BASE_ITEM_THROWINGAXE: + case BASE_ITEM_SHURIKEN: + { + nReturn = TRUE; + break; + } + default: + { + break; + } + } + return nReturn; +} + +void wow_Forge() +{ + if(GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED) wow_CheckAllRecipes(); +} + +void wow_CreateGold(int nAmount) +{ + CreateItemOnObject("nw_it_gold001", OBJECT_SELF, nAmount); +} + +void wow_CreateRecipe(int nRecipe) +{ + string sBase = "WOW_"+GetTag(OBJECT_SELF)+"_R"+IntToString(nRecipe); + object oModule = GetModule(); + int nMaxIng = GetLocalInt(oModule, sBase); + int nGold = GetLocalInt(oModule, sBase+"_GOLD"); + int nNth, nCount, nReturn; + int nStack = GetLocalInt(oModule, sBase+"_STACK"); + string sTag; + string sResRef = GetLocalString(oModule, sBase+"_RES"); + object oItem; + + for(nNth = 1; nNth <= nMaxIng; nNth++) + { + sTag = GetLocalString(oModule, sBase+"_ING"+IntToString(nNth)); + oItem = GetItemPossessedBy(OBJECT_SELF, sTag); + if(GetIsObjectValid(oItem)) + { + if(wow_CheckBaseItemType(oItem) && nStack <= 0) nStack = GetNumStackedItems(oItem); + DestroyObject(oItem); + } + } + if(GetGold(OBJECT_SELF) == nGold && nGold >= 0) DestroyObject(GetItemPossessedBy(OBJECT_SELF, "NW_IT_GOLD001")); + else if(nGold >= 0) + { + nCount = GetGold(OBJECT_SELF); + DestroyObject(GetItemPossessedBy(OBJECT_SELF, "NW_IT_GOLD001")); + DelayCommand(0.2, wow_CreateGold(nCount-nGold)); + } + if(nStack <= 0) nStack = 1; + SendMessageToPC(GetFirstPC(), "Creating recipe "+IntToString(nRecipe)+", creating "+IntToString(nStack)+" of item "+sResRef); + CreateItemOnObject(sResRef, OBJECT_SELF, nStack); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(GetLocalInt(oModule, sBase+"_VFX")), OBJECT_SELF); + } + +int wow_CheckRecipe(int nRecipe) +{ + object oItem; + object oModule = GetModule(); + string sBase = "WOW_"+GetTag(OBJECT_SELF)+"_R"+IntToString(nRecipe); + int nMaxIng = GetLocalInt(oModule, sBase); + int nGold = GetLocalInt(oModule, sBase+"_GOLD"); + int nNth, nCount, nReturn; + string sTag; + + for(nNth = 1; nNth <= nMaxIng; nNth++) + { + sTag = GetLocalString(oModule, sBase+"_ING"+IntToString(nNth)); + oItem = GetItemPossessedBy(OBJECT_SELF, sTag); + if(GetIsObjectValid(oItem)) nCount++; + } + if(nCount == nMaxIng && GetGold(OBJECT_SELF) >= nGold) nReturn = TRUE; + return nReturn; +} + +void wow_CheckAllRecipes() +{ + string sTag = GetTag(OBJECT_SELF); + string sBase = "WOW_"+sTag+"_R"; + object oModule = GetModule(); + int nMax = GetLocalInt(oModule, sBase); + int nNth, nRun, nRecipe; + + for(nNth = 1; (nNth <= nMax) && (!nRun); nNth++) + { + nRun = wow_CheckRecipe(nNth); + if(nRun) nRecipe = nNth; + } + if(nRecipe > 0) wow_CreateRecipe(nRecipe); +} + + +void wow_SetUpRecipe(int nRecipe, string sTag, string s2DA, int nRow = 0) +{ + string sMaxRows = Get2DAString(s2DA, "RESREF", 0); + string sMaxIng = Get2DAString(s2DA, "NUMING", 0); + int nMaxRows = StringToInt(sMaxRows); + int nMaxIng = StringToInt(sMaxIng); + int nEnd = nRow + 5; + string sBase = "WOW_"+sTag+"_R"; + int nNum, nIng, nGold, nVFX, nCount, nStack; + string sNum, sRow, sIng, sGold, sCount, sStack, sResRef, sVFX; + object oModule = GetModule(); + + if(nRow == 0) + { + nRow = 1; + SetLocalInt(oModule, sBase, nMaxRows); + } + if(nEnd > nMaxRows) nEnd = nMaxRows; + string sMessage; + string sN = "\n"; + for(nRow = nRow; nRow <= nEnd; nRow++) + { + sRow = IntToString(nRow); + sNum = Get2DAString(s2DA, "NUMING", nRow); + sResRef = Get2DAString(s2DA, "RESREF", nRow); + sGold = Get2DAString(s2DA, "GOLD", nRow); + sVFX = Get2DAString(s2DA, "VFX", nRow); + sStack = Get2DAString(s2DA, "NUMCREATE", nRow); + nNum = StringToInt(sNum); + nGold = StringToInt(sGold); + nVFX = StringToInt(sVFX); + nStack = StringToInt(sStack); + SetLocalInt(oModule, sBase+sRow, nNum); // Number of ingredients + SetLocalString(oModule, sBase+sRow+"_RES", sResRef); + if(nGold > 0) SetLocalInt(oModule, sBase+sRow+"_GOLD", nGold); + SetLocalInt(oModule, sBase+sRow+"_VFX", nVFX); + if(nStack > 0) SetLocalInt(oModule, sBase+sRow+"_STACK", nStack); + sMessage = "Recipe: "+sRow+sN; + sMessage += "Number of ingredients: "+sNum+sN; + sMessage += "ResRef: "+sResRef+sN; + sMessage += "Gold: "+sGold+sN; + sMessage += "VFX: "+sVFX+sN; + sMessage += "Stack: "+sStack+sN; + for(nIng = 1; nIng <= nNum; nIng++) + { + sIng = "ING"+IntToString(nIng); + SetLocalString(oModule, sBase+sRow+"_"+sIng, Get2DAString(s2DA, sIng, nRow)); + sMessage += "Ingredient "+IntToString(nIng)+": "+GetLocalString(oModule, sBase+sRow+"_"+sIng)+sN; + } + SendMessageToPC(GetFirstPC(), sMessage); + } + if(nRow >= nMaxRows) DelayCommand(1.0, wow_Setup(nRecipe)); + else DelayCommand(1.0, wow_SetUpRecipe(nRecipe, sTag, s2DA, nRow)); +} + +void wow_Setup(int nRecipe = 0) +{ + string sMax = Get2DAString("wow_crft_base", "TAG", 0); + int nMax = StringToInt(sMax); + nRecipe++; + if(nRecipe <= nMax) + { + string s2DA = Get2DAString("wow_crft_base", "2DA", nRecipe); + string sTag = Get2DAString("wow_crft_base", "TAG", nRecipe); + DelayCommand(0.5, wow_SetUpRecipe(nRecipe, sTag, s2DA)); + } +} + + diff --git a/nwnds_module/wow_inc_headers.nss b/nwnds_module/wow_inc_headers.nss new file mode 100644 index 000000000..68c6e7cc6 --- /dev/null +++ b/nwnds_module/wow_inc_headers.nss @@ -0,0 +1,86 @@ +// ka_inc_loothomes +void wow_SetUpLootableHomes(); +void wow_SetUpConversation(string sTag, string s2DA, int nRow = 0); +string wow_FindEmptyConversation(); +void wow_SetConversationActive(string sConv); +void wow_SetConversationInactive(); +int wow_FindBeginningToken(); +int wow_GetCurrentPage(); +void wow_SetCurrentPage(int nPage); +int wow_GetCount(); +void wow_IncreaseCount(); +void wow_ClearCount(); +int wow_GetRogueLevel(); +int wow_GetLineCount(); +int wow_GetRootCount(); +int wow_GetIsPCLine(int nLine); +void wow_SetUpNextLines(string sVariable, string sText); +int wow_FindAND(string sText); +int wow_FindOR(string sText); +int wow_CountANDs(string sText); +int wow_CountORs(string sText); +int wow_RunLineCheck(int nLine); +void wow_RunActions(int nLine); +int wow_GetAnimation(int nLine); +void wow_RunAnimation(int nLine); +void wow_PlaySound(int nLine); +float wow_GetAnimationTime(int nLine); +void wow_RewardExp(int nLine); +void wow_RewardGold(int nLine); +void wow_RewardItems(int nLine); +int wow_GetRewardNumItems(int nLine); +string wow_GetWaypointTag(); +int wow_GetSkill(int nLine); +int wow_GetSkillDC(int nLine); +int wow_GetAttribute(int nLine); +int wow_GetAttributeDC(int nLine); +int wow_GetFailedBefore(); +int wow_GetAlreadyLooted(); +void wow_SetFailedBefore(); +void wow_SetAlreadyLooted(); +void wow_RunAction(int nAction, int nLine); +void wow_JumpToWaypoint(); +int wow_CountWaypoints(string sWaypoint); +int wow_RunCheck(int nCheck, int nLine); +void wow_ActionsTaken(int nPCLine); +int wow_StartingConditional(); +void wow_SetText(int nLine, int nToken); +int wow_SetRoots(); +int wow_SetNPCLine(); +int wow_GetNextLineCount(int nLine); +int wow_SetPCLine(); +void wow_ClearFields(); +void wow_OnUsed(); +void wow_ReturnToDoor(); + +// ka_inc_traps + +// wow_inc_forge +void wow_SetupForge(int nRecipe = 0); +void wow_SetUpRecipe(int nRecipe, string sTag, string s2DA, int nRow = 0); +void wow_CheckAllRecipes(); +int wow_CheckRecipe(int nRecipe); +void wow_CreateRecipe(int nRecipe); +void wow_CreateGold(int nAmount); +int wow_CheckBaseItemType(object oItem); +void wow_Forge(); +void wow_DelayedCreateItem(string sResRef, object oTarget, int nStack); + +// wow_inc_load_sys +void wow_Setup(); +string wow_GetAndReturnColoredText(string sText); +int wow_FindMarker(string sText); +int wow_CountMarkers(string sText); +int wow_FindD(string sText); +int wow_CountDs(string sText); +int wow_RollDice(int nNumber, int nDice); +void wow_SetUpScoreBoard(int nNumber = 0); + + +// gen_inc_color +string GetRGB(int red = 15,int green = 15,int blue = 15); +string GetTextColor(string sColor = "WHITE"); + +//void main () {} + + diff --git a/nwnds_module/wow_inc_journal.ncs b/nwnds_module/wow_inc_journal.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/wow_inc_journal.ncs differ diff --git a/nwnds_module/wow_inc_journal.nss b/nwnds_module/wow_inc_journal.nss new file mode 100644 index 000000000..5a81d68dc --- /dev/null +++ b/nwnds_module/wow_inc_journal.nss @@ -0,0 +1,9 @@ +// This will return the state of the journal quest. +// sJournalID is the tag of the journal quest to return +// oPlayer is the player to retrieve it from +int GetJournalQuestStatus (string sJournalID, object oPlayer) +{ + return GetLocalInt(oPlayer, "NW_JOURNAL_ENTRY"+sJournalID); +} + + diff --git a/nwnds_module/wow_inc_load_sys.ncs b/nwnds_module/wow_inc_load_sys.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/wow_inc_load_sys.ncs differ diff --git a/nwnds_module/wow_inc_load_sys.nss b/nwnds_module/wow_inc_load_sys.nss new file mode 100644 index 000000000..5a898468c --- /dev/null +++ b/nwnds_module/wow_inc_load_sys.nss @@ -0,0 +1,196 @@ +#include "gen_inc_color" +#include "aps_include" + + +void wow_Setup() +{ + object oModule = GetModule(); + int nSystem = GetLocalInt(oModule, "WOW_LOADING_SYSTEM"); + int nHour = GetTimeHour(); + int nMinute = GetTimeMinute(); + int nSecond = GetTimeSecond(); + int nMilli = GetTimeMillisecond(); + object oTemp; + switch(nSystem) + { + case 0: + { + WriteTimestampedLogEntry("Load time start: "+IntToString(nHour)+":"+IntToString(nMinute)+":"+IntToString(nSecond)+":"+IntToString(nMilli)); + SetLocalInt(oModule, "WOW_LOADING_SYSTEM", 1); + DelayCommand(0.1, wow_SetUpScoreBoard()); + break; + } + case 1: + { + SetLocalInt(oModule, "WOW_LOADING_SYSTEM", 2); + DelayCommand(0.1, wow_SetupForge()); + break; + } + case 2: + { + SetLocalInt(oModule, "WOW_LOADING_SYSTEM", 3); + DelayCommand(0.1, wow_SetUpLootableHomes()); + break; + } + default: + { + WriteTimestampedLogEntry("Load time end: "+IntToString(nHour)+":"+IntToString(nMinute)+":"+IntToString(nSecond)+":"+IntToString(nMilli)); + DeleteLocalInt(oModule, "WOW_LOADING_SYSTEM"); + oTemp = GetFirstPC(); + + while(GetIsObjectValid(oTemp)) + { + if(GetPCPlayerName(oTemp) == "Kyriani Agrivar") SendMessageToPC(oTemp, "All 2DA systems loaded");// Kyriani Agrivar + oTemp = GetNextPC(); + } + SendMessageToAllDMs("All 2DA systems loaded"); + break; + } + } +} + +void wow_SetUpScoreBoard(int nNumber = 0) +{ + object oModule = GetModule(); + if(nNumber == 0) nNumber = 1; + { + SetLocalInt(oModule, "nArenaKills" + IntToString(nNumber), GetPersistentInt(oModule, "nArenaKills" + IntToString(nNumber),"ar_dsostats")); + SetLocalString(oModule, "sArenaKills" + IntToString(nNumber), GetPersistentString(oModule, "sArenaKills" + IntToString(nNumber),"ar_dsostats")); + SetLocalString(oModule, "sArenaKillsAccount" + IntToString(nNumber), GetPersistentString(oModule, "sArenaKillsAccount" + IntToString(nNumber),"ar_dsostats")); + SetLocalInt(oModule, "nPlayerKills" + IntToString(nNumber), GetPersistentInt(oModule, "nPlayerKills" + IntToString(nNumber),"ar_dsostats")); + SetLocalString(oModule, "sPlayerKills" + IntToString(nNumber), GetPersistentString(oModule, "sPlayerKills" + IntToString(nNumber),"ar_dsostats")); + SetLocalString(oModule, "sPlayerKillsAccount" + IntToString(nNumber), GetPersistentString(oModule, "sPlayerKillsAccount" + IntToString(nNumber),"ar_dsostats")); + } + nNumber++; + if(nNumber <=10) DelayCommand(0.2, wow_SetUpScoreBoard(nNumber)); + else DelayCommand(0.2, wow_Setup()); +} + +string wow_GetAndReturnColoredText(string sText) +{ + int nRight, nLength; + int nSub = wow_FindMarker(sText); + string sLeft, sColor, sNew; + while(nSub != -1) + { + nLength = GetStringLength(sText); + sNew += GetStringLeft(sText, nSub); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + nSub = wow_FindMarker(sText); + if(nSub != -1) + { + nLength = GetStringLength(sText); + sColor = GetStringLeft(sText, nSub); + nRight = nLength - (nSub + 2); + sNew += GetTextColor(sColor); + sText = GetStringRight(sText, nRight); + } + nSub = wow_FindMarker(sText); + } + if(sNew != "") sNew += sText; + else sNew = sText; + return sNew; +} + +int wow_FindMarker(string sText) +{ + return FindSubString(sText, "||"); +} + +int wow_CountMarkers(string sText) +{ + int nSub, nCount, nLength, nRight; + while(nSub != -1) + { + nSub = wow_FindMarker(sText); + if(nSub != -1) + { + nCount++; + nLength = GetStringLength(sText); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + } + } + return nCount; +} + +int wow_FindD(string sText) +{ + return FindSubString(sText, "d"); +} + +int wow_CountDs(string sText) +{ + int nSub, nCount, nLength, nRight; + while(nSub != -1) + { + nSub = wow_FindD(sText); + if(nSub != -1) + { + nCount++; + nLength = GetStringLength(sText); + nRight = nLength - (nSub + 2); + sText = GetStringRight(sText, nRight); + } + } + return nCount; +} + +int wow_RollDice(int nNumber, int nDice) +{ + int nReturn; + switch(nDice) + { + case 2: + { + nReturn = d2(nNumber); + break; + } + case 3: + { + nReturn = d3(nNumber); + break; + } + case 4: + { + nReturn = d4(nNumber); + break; + } + case 6: + { + nReturn = d6(nNumber); + break; + } + case 8: + { + nReturn = d8(nNumber); + break; + } + case 10: + { + nReturn = d10(nNumber); + break; + } + case 12: + { + nReturn = d12(nNumber); + break; + } + case 20: + { + nReturn = d20(nNumber); + break; + } + case 100: + { + nReturn = d100(nNumber); + break; + } + } + return nReturn; +} + +//void main(){} + + diff --git a/nwnds_module/wow_inc_scouting.nss b/nwnds_module/wow_inc_scouting.nss new file mode 100644 index 000000000..deffc6dcb --- /dev/null +++ b/nwnds_module/wow_inc_scouting.nss @@ -0,0 +1,767 @@ +/* +const int X2_ITEM_EVENT_ACTIVATE = 0; +const int X2_ITEM_EVENT_EQUIP = 1; +const int X2_ITEM_EVENT_UNEQUIP = 2; +const int X2_ITEM_EVENT_ONHITCAST = 3; +const int X2_ITEM_EVENT_ACQUIRE = 4; +const int X2_ITEM_EVENT_UNACQUIRE = 5; +const int X2_ITEM_EVENT_SPELLCAST_AT = 6; +*/ +#include "yr_inc_effects" +#include "x2_inc_switches" +const int WOW_ITEM_EVENT_ONACTIVATE = 1; +const int WOW_ITEM_EVENT_ONEQUIP = 2; +const int WOW_ITEM_EVENT_ONUNEQUIP = 4; +const int WOW_ITEM_EVENT_ONACQUIRE = 8; +const int WOW_ITEM_EVENT_ONUNACQUIRE = 16; +const int WOW_ITEM_EVENT_ONHITCAST = 32; + +// Returns TRUE if oPC currently has nEvent loaded +int wow_CheckForModuleItemEvent(object oPC, int nEvent); +void wow_SetModuleItemEvent(object oPC, int nEvent); +int wow_GetModuleItemEvent(object oPC); +void wow_DeleteModuleItemEvent(object oPC, int nEvent); +int wow_CheckModuleEventForScoutingSystem(int nSpell = FALSE); +int wow_GetIsPlayerScouting(object oPC); +void wow_SetPlayerScouting(object oPC); +void wow_DeletePlayerScouting(object oPC); +int wow_GetIsScoutingItem(object oItem); +int wow_GetAppearanceFromRace(object oPC); +int wow_CheckForModuleItemEventOverride(object oPC, int nModuleEvent); +int wow_TurnModuleEventToItemEvent(int nModuleEvent); +void wow_RestoreItemsAcquiredDuringScouting(object oPC, object oOwner, object oItem, int nStack); +void wow_RetrieveItemDroppedWhileScouting(object oPC, object oItem); +void wow_StartScouting(object oPC); +void wow_CloneScouter(object oPC); +void wow_SetScoutingClone(object oPC, object oClone); +object wow_GetScoutingClone(object oPC); +void wow_DeleteScoutingClone(object oPC); +void wow_ReturnToBody(object oPC); +int wow_GetSlotByItem(object oPC, object oItem); +void wow_MonitorHealth(object oPC); +void wow_AdjustHitPoints(object oPC, object oClone); + + +// void main(){} + + +void wow_AdjustHitPoints(object oPC, object oClone) +{ + int nCHP = GetCurrentHitPoints(oClone); + int nPHP = GetCurrentHitPoints(oPC); + if(nCHP != nPHP) + { + effect eEffect; + + if(nCHP > nPHP) eEffect = EffectHeal((nCHP - nPHP)); + else eEffect = EffectDamage((nPHP - nCHP)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC); + } +} + +void wow_MonitorHealth(object oPC) +{ + if(wow_GetIsPlayerScouting(oPC)) + { + if(GetIsInCombat(oPC)) + { + FloatingTextStringOnCreature("You cannot engage in combat while you are scouting.", oPC); + wow_ReturnToBody(oPC); + } + else + { + object oClone = wow_GetScoutingClone(oPC); + if(GetIsInCombat(oClone)) + { + FloatingTextStringOnCreature("Your body is under attack!", oPC); + } + else + { + int nPHP = GetCurrentHitPoints(oPC); + int nCHP = GetCurrentHitPoints(oClone); + if(nPHP > nCHP) FloatingTextStringOnCreature("Your body is under attack!", oPC); + else if(nCHP > nPHP) + { + FloatingTextStringOnCreature("You cannot engage in combat while you are scouting.", oPC); + wow_ReturnToBody(oPC); + } + } + DelayCommand(1.0, wow_MonitorHealth(oPC)); + } + } +} + +int wow_GetSlotByItem(object oPC, object oItem) +{ + int nType = GetBaseItemType(oItem); + int nReturn = -1; + switch(nType) + { + // weapons + case BASE_ITEM_SHORTSWORD: + case BASE_ITEM_LONGSWORD: + case BASE_ITEM_BATTLEAXE: + case BASE_ITEM_BASTARDSWORD: + case BASE_ITEM_LIGHTFLAIL: + case BASE_ITEM_WARHAMMER: + case BASE_ITEM_HEAVYCROSSBOW: + case BASE_ITEM_LIGHTCROSSBOW: + case BASE_ITEM_LONGBOW: + case BASE_ITEM_LIGHTMACE: + case BASE_ITEM_HALBERD: + case BASE_ITEM_SHORTBOW: + case BASE_ITEM_TWOBLADEDSWORD: + case BASE_ITEM_GREATSWORD: + case BASE_ITEM_GREATAXE: + case BASE_ITEM_DAGGER: + case BASE_ITEM_CLUB: + case BASE_ITEM_DART: + case BASE_ITEM_DIREMACE: + case BASE_ITEM_DOUBLEAXE: + case BASE_ITEM_HEAVYFLAIL: + case BASE_ITEM_LIGHTHAMMER: + case BASE_ITEM_HANDAXE: + case BASE_ITEM_KAMA: + case BASE_ITEM_KATANA: + case BASE_ITEM_KUKRI: + case BASE_ITEM_MAGICSTAFF: + case BASE_ITEM_MORNINGSTAR: + case BASE_ITEM_QUARTERSTAFF: + case BASE_ITEM_RAPIER: + case BASE_ITEM_SCIMITAR: + case BASE_ITEM_SCYTHE: + case BASE_ITEM_SHORTSPEAR: + case BASE_ITEM_SHURIKEN: + case BASE_ITEM_SICKLE: + case BASE_ITEM_SLING: + case BASE_ITEM_THROWINGAXE: + case BASE_ITEM_DWARVENWARAXE: + case BASE_ITEM_WHIP: + { + if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC))) nReturn = INVENTORY_SLOT_RIGHTHAND; + else if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC))) nReturn = INVENTORY_SLOT_LEFTHAND; + break; + } + case BASE_ITEM_SMALLSHIELD: + case BASE_ITEM_LARGESHIELD: + case BASE_ITEM_TOWERSHIELD: + { + nReturn = INVENTORY_SLOT_LEFTHAND; + break; + } + case BASE_ITEM_ARMOR: + { + nReturn = INVENTORY_SLOT_CHEST; + break; + } + case BASE_ITEM_HELMET: + { + nReturn = INVENTORY_SLOT_HEAD; + break; + } + case BASE_ITEM_AMULET: + { + nReturn = INVENTORY_SLOT_NECK; + break; + } + case BASE_ITEM_ARROW: + { + nReturn = INVENTORY_SLOT_ARROWS; + break; + } + case BASE_ITEM_BELT: + { + nReturn = INVENTORY_SLOT_BELT; + break; + } + case BASE_ITEM_BOLT: + { + nReturn = INVENTORY_SLOT_BOLTS; + break; + } + case BASE_ITEM_BOOTS: + { + nReturn = INVENTORY_SLOT_BOOTS; + break; + } + case BASE_ITEM_BULLET: + { + nReturn = INVENTORY_SLOT_BULLETS; + break; + } + case BASE_ITEM_RING: + { + if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC))) nReturn = INVENTORY_SLOT_RIGHTRING; + else if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC))) nReturn = INVENTORY_SLOT_LEFTRING; + break; + } + case BASE_ITEM_CLOAK: + { + nReturn = INVENTORY_SLOT_CLOAK; + break; + } + case BASE_ITEM_GLOVES: + case BASE_ITEM_BRACER: + { + nReturn = INVENTORY_SLOT_ARMS; + break; + } + } + return nReturn; +} + +void wow_ReturnToBody(object oPC) +{ + object oClone = wow_GetScoutingClone(oPC); + location lClone = GetLocation(oClone); + location lPC = GetLocation(oPC); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oClone); + effect eVis = EffectVisualEffect(459); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lClone); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lPC); + SetCreatureAppearanceType(oPC, wow_GetAppearanceFromRace(oPC)); + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, JumpToLocation(lClone)); + wow_AdjustHitPoints(oPC, oClone); + wow_DeletePlayerScouting(oPC); +} + +void wow_SetScoutingClone(object oPC, object oClone) +{ + SetLocalObject(oPC, "WOW_SCOUTING_CLONE", oClone); + AssignCommand(oClone, SetIsDestroyable(FALSE, FALSE, FALSE)); +} + +object wow_GetScoutingClone(object oPC) +{ + return GetLocalObject(oPC, "WOW_SCOUTING_CLONE"); +} + +void wow_DeleteScoutingClone(object oPC) +{ + object oClone = wow_GetScoutingClone(oPC); + AssignCommand(oClone, SetIsDestroyable(TRUE, FALSE, FALSE)); + DeleteLocalObject(oPC, "WOW_SCOUTING_CLONE"); + DestroyObject(oClone, 0.1); +} + +void wow_CloneScouter(object oPC) +{ + vector vPos = GetPosition(oPC); + float fFacing = GetFacing(oPC); + vPos = vPos + 1.0 * AngleToVector(fFacing); + fFacing += 180.0; + if(fFacing > 359.9) fFacing -= 360.0; + else if(fFacing < 0.0) fFacing += 360.0; + location lClone = GetLocation(oPC); + location lPC = Location(GetArea(oPC), vPos, fFacing); + object oClone = CopyObject(oPC, lClone); + BootPC(oClone); + AssignCommand(oPC, JumpToLocation(lPC)); + wow_SetScoutingClone(oPC, oClone); + RemoveLocalEffect(oPC, "WOW_SCOUTING_GHOST_EFFECT"); + effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_IMPROVED); + effect eVis = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE); + SetLocalEffect(oPC, eInvis, "WOW_SCOUTING_INVISIBILITY_EFFECT"); + SetLocalEffect(oPC, eVis, "WOW_SCOUTING__INVISIBILITY_VFX_EFFECT"); + SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_WILL_O_WISP); +} + +void wow_StartScouting(object oPC) +{ + wow_SetPlayerScouting(oPC); + effect eVis = EffectVisualEffect(459); + ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oPC)); + effect eGhost =EffectCutsceneGhost(); + SetLocalEffect(oPC, eGhost, "WOW_SCOUTING_GHOST_EFFECT"); + AssignCommand(oPC, ClearAllActions(TRUE)); + DelayCommand(0.1, wow_CloneScouter(oPC)); + DelayCommand(1.0, wow_MonitorHealth(oPC)); +} + +void wow_RetrieveItemDroppedWhileScouting(object oPC, object oItem) +{ + object oOwner = GetItemPossessor(oItem); + int nStack = GetItemStackSize(oItem); + if(GetIsObjectValid(oOwner)) + { + if(nStack == 1) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionTakeItem(oItem, oOwner)); + } + else + { + object oTemp; + string sTag; + int nCount, nFound; + CreateItemOnObject(GetResRef(oItem), oPC, nStack); + oTemp = GetFirstItemInInventory(oOwner); + sTag = GetTag(oItem); + while(GetIsObjectValid(oTemp) && !nFound) + { + if(sTag == GetTag(oTemp)) + { + nCount = GetItemStackSize(oTemp); + if(nCount > nStack) + { + nFound = TRUE; + SetItemStackSize(oTemp, (nCount - nStack)); + } + else if(nCount == nStack) + { + nFound = TRUE; + DestroyObject(oTemp); + } + else + { + DestroyObject(oTemp, 0.1); + nStack -= nCount; + } + } + oTemp = GetNextItemInInventory(oOwner); + } + + } + } + else + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionPickUpItem(oItem)); + } +} + +void wow_RestoreItemsAcquiredDuringScouting(object oPC, object oOwner, object oItem, int nStack) +{ + string sMessage, sTag; + object oTemp; + int nNth, nFound, nCount; + if(GetIsObjectValid(oItem)) // Its not gold + { + sMessage = "You cannot acquire any items while you are scouting."; + if(GetIsObjectValid(oOwner)) // It was gotten from someone/something + { + if(nStack == 1) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionGiveItem(oItem, oOwner)); + } + else + { + CreateItemOnObject(GetResRef(oItem), oOwner, nStack); + oTemp = GetFirstItemInInventory(oPC); + sTag = GetTag(oItem); + while(GetIsObjectValid(oTemp) && !nFound) + { + if(sTag == GetTag(oTemp)) + { + nCount = GetItemStackSize(oTemp); + if(nCount > nStack) + { + nFound = TRUE; + SetItemStackSize(oTemp, (nCount - nStack)); + } + else if(nCount == nStack) + { + nFound = TRUE; + DestroyObject(oTemp); + } + else + { + DestroyObject(oTemp); + nStack -= nCount; + } + } + oTemp = GetNextItemInInventory(oPC); + } + } + } + else + { + if(nStack == 1) + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionPutDownItem(oItem)); + } + else + { + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW)); + vector vPos = GetPosition(oPC); + vPos = vPos + 1.0 * AngleToVector(GetFacing(oPC)); + location lLoc = Location(GetArea(oPC), vPos, 0.0); + oTemp = CreateObject(OBJECT_TYPE_ITEM, GetResRef(oItem), lLoc); + SetItemStackSize(oTemp, nStack); + oTemp = GetFirstItemInInventory(oPC); + sTag = GetTag(oItem); + while(GetIsObjectValid(oTemp) && !nFound) + { + if(sTag == GetTag(oTemp)) + { + nCount = GetItemStackSize(oTemp); + if(nCount > nStack) + { + nFound = TRUE; + SetItemStackSize(oTemp, (nCount - nStack)); + } + else if(nCount == nStack) + { + nFound = TRUE; + DestroyObject(oTemp); + } + else + { + DestroyObject(oTemp); + nStack -= nCount; + } + } + oTemp = GetNextItemInInventory(oPC); + } + } + } + } + else // it's gold + { + sMessage = "You cannot acquire any gold while scouting."; + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, TakeGoldFromCreature(nStack, oPC, TRUE)); + if(GetIsObjectValid(oOwner)) + { + GiveGoldToCreature(oOwner, nStack); + } + else + { + AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW)); + vector vPos = GetPosition(oPC); + vPos = vPos + 1.0 * AngleToVector(GetFacing(oPC)); + location lLoc = Location(GetArea(oPC), vPos, 0.0); + oTemp = CreateObject(OBJECT_TYPE_ITEM, "nw_it_gold001", lLoc); + SetItemStackSize(oTemp, nStack); + } + } + FloatingTextStringOnCreature(sMessage, oPC); +} + +int wow_TurnModuleEventToItemEvent(int nModuleEvent) +{ + int nReturn; + switch(nModuleEvent) + { + case X2_ITEM_EVENT_ACTIVATE: + { + nReturn = WOW_ITEM_EVENT_ONACTIVATE; + break; + } + case X2_ITEM_EVENT_EQUIP: + { + nReturn = WOW_ITEM_EVENT_ONEQUIP; + break; + } + case X2_ITEM_EVENT_UNEQUIP: + { + nReturn = WOW_ITEM_EVENT_ONUNEQUIP; + break; + } + case X2_ITEM_EVENT_ONHITCAST: + { + nReturn = WOW_ITEM_EVENT_ONHITCAST; + break; + } + case X2_ITEM_EVENT_ACQUIRE: + { + nReturn = WOW_ITEM_EVENT_ONACQUIRE; + break; + } + case X2_ITEM_EVENT_UNACQUIRE: + { + nReturn = WOW_ITEM_EVENT_ONUNACQUIRE; + break; + } + } + return nReturn; +} + +int wow_CheckForModuleItemEventOverride(object oPC, int nModuleEvent) +{ + int nEvent = wow_GetModuleItemEvent(oPC); + nModuleEvent = wow_TurnModuleEventToItemEvent(nModuleEvent); + return (nEvent & nModuleEvent); +} + +int wow_GetAppearanceFromRace(object oPC) +{ + int nReturn = -1; + int nRace = GetRacialType(oPC); + switch(nRace) + { + case RACIAL_TYPE_DWARF: + { + nReturn = APPEARANCE_TYPE_DWARF; + break; + } + case RACIAL_TYPE_ELF: + { + nReturn = APPEARANCE_TYPE_ELF; + break; + } + case RACIAL_TYPE_GNOME: + { + nReturn = APPEARANCE_TYPE_GNOME; + break; + } + case RACIAL_TYPE_HALFELF: + { + nReturn = APPEARANCE_TYPE_HALF_ELF; + break; + } + case RACIAL_TYPE_HALFLING: + { + nReturn = APPEARANCE_TYPE_HALFLING; + break; + } + case RACIAL_TYPE_HALFORC: + { + nReturn = APPEARANCE_TYPE_HALF_ORC; + break; + } + case RACIAL_TYPE_HUMAN: + { + nReturn = APPEARANCE_TYPE_HUMAN; + break; + } + } + if(nReturn == -1) nReturn = GetAppearanceType(oPC); + return nReturn; +} + +int wow_GetIsScoutingItem(object oItem) +{ + int nEvent = GetUserDefinedItemEventNumber(); + int nReturn = FALSE; + string sTag = GetTag(oItem); + switch(nEvent) + { + case X2_ITEM_EVENT_ACTIVATE: + { + if(sTag == "WOW_SCOUTING_ITEM") nReturn = TRUE; + break; + } + case X2_ITEM_EVENT_EQUIP: + { + if(sTag == "WOW_SCOUTING_BITE" || sTag == "WOW_SCOUTING_CLAW" || sTag == "WOW_SCOUTING_CARMOR") nReturn = TRUE; + break; + } + case X2_ITEM_EVENT_UNEQUIP: + { + if(sTag == "WOW_SCOUTING_BITE" || sTag == "WOW_SCOUTING_CLAW" || sTag == "WOW_SCOUTING_CARMOR") nReturn = TRUE; + break; + } + case X2_ITEM_EVENT_ONHITCAST: + { + if(sTag == "WOW_SCOUTING_BITE" || sTag == "WOW_SCOUTING_CLAW" || sTag == "WOW_SCOUTING_CARMOR") nReturn = TRUE; + break; + } + case X2_ITEM_EVENT_ACQUIRE: + { + if(sTag == "WOW_SCOUTING_BITE" || sTag == "WOW_SCOUTING_CLAW" || sTag == "WOW_SCOUTING_CARMOR") nReturn = TRUE; + break; + } + case X2_ITEM_EVENT_UNACQUIRE: + { + if(sTag == "WOW_SCOUTING_BITE" || sTag == "WOW_SCOUTING_CLAW" || sTag == "WOW_SCOUTING_CARMOR") nReturn = TRUE; + break; + } + } + return nReturn; +} + +int wow_GetIsPlayerScouting(object oPC) +{ + return GetLocalInt(oPC, "WOW_SCOUTING_SYSTEM"); +} + +void wow_SetPlayerScouting(object oPC) +{ + SetLocalInt(oPC, "WOW_SCOUTING_SYSTEM", TRUE); +} + +void wow_DeletePlayerScouting(object oPC) +{ + DeleteLocalInt(oPC, "WOW_SCOUTING_SYSTEM"); + wow_DeleteScoutingClone(oPC); + DeleteLocalInt(oPC, "WOW_MODULE_ITEM_EVENT"); + RemoveLocalEffect(oPC, "WOW_SCOUTING_INVISIBILITY_EFFECT"); + RemoveLocalEffect(oPC, "WOW_SCOUTING__INVISIBILITY_VFX_EFFECT"); +} + +int wow_CheckForModuleItemEvent(object oPC, int nEvent) +{ + return (wow_GetModuleItemEvent(oPC) & nEvent); +} + +void wow_SetModuleItemEvent(object oPC, int nEvent) +{ + if(!wow_CheckForModuleItemEvent(oPC, nEvent)) + { + int nCurrent = wow_GetModuleItemEvent(oPC); + nCurrent = nCurrent | nEvent; + SetLocalInt(oPC, "WOW_MODULE_ITEM_EVENT", nCurrent); + } +} + +int wow_GetModuleItemEvent(object oPC) +{ + return GetLocalInt(oPC, "WOW_MODULE_ITEM_EVENT"); +} + +void wow_DeleteModuleItemEvent(object oPC, int nEvent) +{ + if(wow_CheckForModuleItemEvent(oPC, nEvent)) + { + int nCurrent = wow_GetModuleItemEvent(oPC); + SetLocalInt(oPC, "WOW_MODULE_ITEM_EVENT", (nCurrent - nEvent)); + } +} + +int wow_CheckModuleEventForScoutingSystem(int nSpell = FALSE) +{ + object oPC; + int nReturn = FALSE; + int nEvent = GetUserDefinedItemEventNumber(); + int nTemp; + + if(nSpell) + { + oPC = OBJECT_SELF; + if(wow_GetIsPlayerScouting(oPC)) + { + FloatingTextStringOnCreature("You cannot cast a spell while scouting.", oPC); + nReturn = TRUE; + } + } + else + { + object oItem, oTemp; + int nStack; + string sMessage; + switch(nEvent) + { + case X2_ITEM_EVENT_ONHITCAST: + { + oPC = OBJECT_SELF; + if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + FloatingTextStringOnCreature("You cannot engage in combat while you are scouting.", oPC); + wow_ReturnToBody(oPC); + } + break; + } + case X2_ITEM_EVENT_ACTIVATE: + { + oPC = GetItemActivator(); + oItem = GetItemActivated(); + if(wow_GetIsScoutingItem(oItem)) + { + nReturn = TRUE; + if(wow_GetIsPlayerScouting(oPC)) wow_ReturnToBody(oPC); + else wow_StartScouting(oPC); + } + else if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + FloatingTextStringOnCreature("You cannot activate an item while scouting.", oPC); + } + break; + } + case X2_ITEM_EVENT_EQUIP: + { + oPC = GetPCItemLastEquippedBy(); + oItem = GetPCItemLastEquipped(); + if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + if(!wow_CheckForModuleItemEventOverride(oPC, nEvent)) + { + FloatingTextStringOnCreature("You cannot equip any items while scouting.", oPC); + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionDoCommand(wow_SetModuleItemEvent(oPC, WOW_ITEM_EVENT_ONUNEQUIP))); + AssignCommand(oPC, ActionUnequipItem(oItem)); + } + else + { + wow_DeleteModuleItemEvent(oPC, WOW_ITEM_EVENT_ONEQUIP); + } + } + break; + } + case X2_ITEM_EVENT_UNEQUIP: + { + oPC = GetPCItemLastUnequippedBy(); + oItem = GetPCItemLastUnequipped(); + if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + if(!wow_CheckForModuleItemEventOverride(oPC, nEvent)) + { + nTemp = wow_GetSlotByItem(oPC, oItem); + if(nTemp != -1) + { + FloatingTextStringOnCreature("You cannot unequip any items while scouting.", oPC); + AssignCommand(oPC, ClearAllActions(TRUE)); + AssignCommand(oPC, ActionDoCommand(wow_SetModuleItemEvent(oPC, WOW_ITEM_EVENT_ONEQUIP))); + AssignCommand(oPC, ActionEquipItem(oItem, nTemp)); + } + } + else + { + wow_DeleteModuleItemEvent(oPC, WOW_ITEM_EVENT_ONUNEQUIP); + } + } + break; + } + case X2_ITEM_EVENT_ACQUIRE: + { + oPC = GetModuleItemAcquiredBy(); + oItem = GetModuleItemAcquired(); + nStack = GetModuleItemAcquiredStackSize(); + oTemp = GetModuleItemAcquiredFrom(); + if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + if(!wow_CheckForModuleItemEventOverride(oPC, nEvent)) + { + wow_SetModuleItemEvent(oPC, WOW_ITEM_EVENT_ONUNACQUIRE); + wow_RestoreItemsAcquiredDuringScouting(oPC, oTemp, oItem, nStack); + } + else + { + wow_DeleteModuleItemEvent(oPC, WOW_ITEM_EVENT_ONACQUIRE); + } + } + break; + } + case X2_ITEM_EVENT_UNACQUIRE: + { + oPC = GetModuleItemLostBy(); + oItem = GetModuleItemLost(); + if(wow_GetIsPlayerScouting(oPC)) + { + nReturn = TRUE; + if(!wow_CheckForModuleItemEventOverride(oPC, nEvent)) + { + FloatingTextStringOnCreature("You cannot unacquire items while scouting.", oPC); + wow_SetModuleItemEvent(oPC, WOW_ITEM_EVENT_ONACQUIRE); + wow_RetrieveItemDroppedWhileScouting(oPC, oItem); + } + else + { + wow_DeleteModuleItemEvent(oPC, WOW_ITEM_EVENT_ONUNACQUIRE); + } + } + break; + } + } + } + return nReturn; +} diff --git a/nwnds_module/wow_polyinclude.ncs b/nwnds_module/wow_polyinclude.ncs new file mode 100644 index 000000000..ecb1c72d2 Binary files /dev/null and b/nwnds_module/wow_polyinclude.ncs differ diff --git a/nwnds_module/wow_polyinclude.nss b/nwnds_module/wow_polyinclude.nss new file mode 100644 index 000000000..22605db6b --- /dev/null +++ b/nwnds_module/wow_polyinclude.nss @@ -0,0 +1,287 @@ +const float WOW_POLYMORPH_HEARTBEAT = 1.0; // The delay between heartbeats +int wow_GetPrimaryAbility(); +void wow_PolyFix(); +effect wow_GetPolyFixEffect(); +void wow_PolyHeartbeat(); +void wow_RemovePolyFix(); +int wow_CheckPoly(); +int wow_GetPolySpellId(); +void wow_PolyOnClientEnter(); +int wow_CheckForCasterLevels(); + +int wow_CheckForCasterLevels() +{ + if(GetLevelByClass(CLASS_TYPE_BARD) > 0 || + GetLevelByClass(CLASS_TYPE_CLERIC) > 0 || + GetLevelByClass(CLASS_TYPE_DRUID) > 0 || + GetLevelByClass(CLASS_TYPE_PALADIN) > 0 || + GetLevelByClass(CLASS_TYPE_RANGER) > 0 || + GetLevelByClass(CLASS_TYPE_SHIFTER) > 0 || + GetLevelByClass(CLASS_TYPE_SORCERER) > 0 || + GetLevelByClass(CLASS_TYPE_WIZARD) > 0) return TRUE; + else return FALSE; +} + +void wow_PolyOnClientEnter() +{ + if(!GetIsPC(OBJECT_SELF)) + { + AssignCommand(GetEnteringObject(), wow_PolyOnClientEnter()); + } + else + { + if(wow_CheckPoly()) DelayCommand(WOW_POLYMORPH_HEARTBEAT, wow_PolyHeartbeat()); + else wow_RemovePolyFix(); + } +} + +void wow_RemovePolyFix() +{ + effect eEffect = GetFirstEffect(OBJECT_SELF); + int nType, nSpell; + + while(GetIsEffectValid(eEffect)) + { + nType = GetEffectType(eEffect); + nSpell = GetEffectSpellId(eEffect); + if(nType == EFFECT_TYPE_ABILITY_INCREASE) + { + switch(nSpell) + { + case 184: + case 387: + case 388: + case 389: + case 390: + case 391: + case 392: + case 393: + case 394: + case 395: + case 396: + case 397: + case 398: + case 399: + case 400: + case 401: + case 402: + case 403: + case 404: + case 405: + case 658: + case 659: + case 660: + case 661: + case 662: + case 672: + case 678: + case 680: + case 670: + case 673: + case 674: + case 679: + case 691: + case 694: + case 682: + case 683: + case 684: + case 704: + case 705: + case 706: + case 707: + case 708: + case 709: + case 733: + case 734: + case 735: + case 738: + case 739: + case 740: + { + RemoveEffect(OBJECT_SELF, eEffect); + break; + } + } + } + eEffect = GetNextEffect(OBJECT_SELF); + } +} + +int wow_GetPolySpellId() +{ + int nReturn = -1; + effect eEffect = GetFirstEffect(OBJECT_SELF); + int nType; + + while(GetIsEffectValid(eEffect)) + { + nType = GetEffectType(eEffect); + if(nType == EFFECT_TYPE_POLYMORPH) nReturn = GetEffectSpellId(eEffect); + eEffect = GetNextEffect(OBJECT_SELF); + } + return nReturn; +} + +int wow_CheckPoly() +{ + int nAppearance = GetAppearanceType(OBJECT_SELF); + int nReturn = FALSE; + int nSpell = wow_GetPolySpellId(); + switch(nSpell) + { + case 387: + { + if(nAppearance == 159) nReturn = TRUE; + break; + } + case 388: + { + if(nAppearance == 167) nReturn = TRUE; + break; + } + case 389: + { + if(nAppearance == 168) nReturn = TRUE; + break; + } + case 390: + { + if(nAppearance == 55) nReturn = TRUE; + break; + } + case 391: + { + if(nAppearance == 198) nReturn = TRUE; + break; + } + case 392: + { + if(nAppearance == 49) nReturn = TRUE; + break; + } + case 393: + { + if(nAppearance == 80) nReturn = TRUE; + break; + } + case 394: + { + if(nAppearance == 38) nReturn = TRUE; + break; + } + case 395: + { + if(nAppearance == 152) nReturn = TRUE; + break; + } + case 396: + { + if(nAppearance == 89) nReturn = TRUE; + break; + } + case 184: + { + if(nAppearance == 40) nReturn = TRUE; + break; + } + } + return nReturn; +} +void wow_PolyHeartbeat() +{ + if(wow_CheckPoly()) DelayCommand(WOW_POLYMORPH_HEARTBEAT, wow_PolyHeartbeat()); + else DelayCommand(1.0, wow_RemovePolyFix()); +} + +int wow_GetPrimaryAbility() +{ + int nAbility; + int nClass = GetLastSpellCastClass(); + if(nClass == CLASS_TYPE_INVALID) nClass = CLASS_TYPE_SHIFTER; + switch(nClass) + { + case CLASS_TYPE_BARD: + case CLASS_TYPE_SORCERER: + { + nAbility = ABILITY_CHARISMA; + break; + } + case CLASS_TYPE_CLERIC: + case CLASS_TYPE_DRUID: + case CLASS_TYPE_PALADIN: + case CLASS_TYPE_RANGER: + case CLASS_TYPE_SHIFTER: + { + nAbility = ABILITY_WISDOM; + break; + } + case CLASS_TYPE_WIZARD: + { + nAbility = ABILITY_INTELLIGENCE; + break; + } + default: + { + nAbility = -1; + break; + } + } + return nAbility; +} + +void wow_PolyFix() +{ + if(GetIsPC(OBJECT_SELF) && wow_CheckForCasterLevels() && (GetIsPC(GetSpellTargetObject()) || !GetIsObjectValid(GetSpellTargetObject()))) + { + effect eEffect = wow_GetPolyFixEffect(); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, GetSpellTargetObject()); + AssignCommand(GetSpellTargetObject(), DelayCommand(WOW_POLYMORPH_HEARTBEAT, wow_PolyHeartbeat())); + } +} + +effect wow_GetPolyFixEffect() +{ + int nAbility = wow_GetPrimaryAbility(); + effect eEffect; + if(nAbility != -1) + { + object oItem; + int nSlot, nValue; // 13, 1 + itemproperty ipIP; + for(nSlot = 0; nSlot <= 13; nSlot++) + { + oItem = GetItemInSlot(nSlot, OBJECT_SELF); + if(GetIsObjectValid(oItem)) + { + if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ABILITY_BONUS) || GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ABILITY_SCORE)) + { + ipIP = GetFirstItemProperty(oItem); + while(GetIsItemPropertyValid(ipIP)) + { + if(GetItemPropertyType(ipIP) == ITEM_PROPERTY_ABILITY_BONUS) + { + if(GetItemPropertySubType(ipIP) == nAbility) + { + nValue += GetItemPropertyCostTableValue(ipIP); + } + } + else if(GetItemPropertyType(ipIP) == ITEM_PROPERTY_DECREASED_ABILITY_SCORE) + { + if(GetItemPropertySubType(ipIP) == nAbility) + { + nValue -= GetItemPropertyCostTableValue(ipIP); + } + } + ipIP = GetNextItemProperty(oItem); + } + } + } + } + if(nValue > 0) + { + eEffect = EffectAbilityIncrease(nAbility, nValue); + } + } + return eEffect; +} +//void main () {} diff --git a/nwnds_module/wow_sc_bounty.ncs b/nwnds_module/wow_sc_bounty.ncs new file mode 100644 index 000000000..df03e34e0 Binary files /dev/null and b/nwnds_module/wow_sc_bounty.ncs differ diff --git a/nwnds_module/wow_sc_bounty.nss b/nwnds_module/wow_sc_bounty.nss new file mode 100644 index 000000000..cebe105a9 --- /dev/null +++ b/nwnds_module/wow_sc_bounty.nss @@ -0,0 +1,5 @@ +#include "wow_inc_bounty" +int StartingConditional() +{ + return wow_BountySC(); +} diff --git a/nwnds_module/wp_arrive.ncs b/nwnds_module/wp_arrive.ncs new file mode 100644 index 000000000..9b01b530b Binary files /dev/null and b/nwnds_module/wp_arrive.ncs differ diff --git a/nwnds_module/wp_arrive.nss b/nwnds_module/wp_arrive.nss new file mode 100644 index 000000000..9a3cb2cb3 --- /dev/null +++ b/nwnds_module/wp_arrive.nss @@ -0,0 +1,7 @@ +void main() +{ + object oPC = GetLastUsedBy(); + object oDest = GetObjectByTag("wp_arrive_02"); + AssignCommand(oPC, JumpToObject(oDest)); + +} diff --git a/nwnds_module/wp_arrive_01.ncs b/nwnds_module/wp_arrive_01.ncs new file mode 100644 index 000000000..786e91dde Binary files /dev/null and b/nwnds_module/wp_arrive_01.ncs differ diff --git a/nwnds_module/wp_arrive_01.nss b/nwnds_module/wp_arrive_01.nss new file mode 100644 index 000000000..bd719fd43 --- /dev/null +++ b/nwnds_module/wp_arrive_01.nss @@ -0,0 +1,7 @@ +void main() +{ + object oPC = GetLastUsedBy(); + object oDest = GetObjectByTag("wp_arrive_01"); + AssignCommand(oPC, JumpToObject(oDest)); + +} diff --git a/nwnds_module/wrab001.utc b/nwnds_module/wrab001.utc new file mode 100644 index 000000000..a7675aa6d Binary files /dev/null and b/nwnds_module/wrab001.utc differ diff --git a/nwnds_module/wrabbite.ncs b/nwnds_module/wrabbite.ncs new file mode 100644 index 000000000..21cad61c7 Binary files /dev/null and b/nwnds_module/wrabbite.ncs differ diff --git a/nwnds_module/wrabbite.nss b/nwnds_module/wrabbite.nss new file mode 100644 index 000000000..e5bd1d0f0 --- /dev/null +++ b/nwnds_module/wrabbite.nss @@ -0,0 +1,58 @@ +// Wrab's Bloodsuck Attack - Item Unique OnHit Script +// + +#include "nw_i0_spells" +//#include "x2_inc_spellhook" +#include "x2_inc_switches" + +const int CREATURE_SIZE_DIMINUTIVE = 20; +const int CREATURE_SIZE_FINE = 21; +const int CREATURE_SIZE_GARGANTUAN = 22; +const int CREATURE_SIZE_COLOSSAL = 23; + +void main() +{ + + object oPC = OBJECT_SELF; + object oItem = GetSpellCastItem(); + object oTarget = GetSpellTargetObject(); + int nCreSTR = GetAbilityModifier(ABILITY_STRENGTH, oPC); + int nConDrain = d4(1); + int nSTR_Target; + int nSTR_Creature; + int nTickFull; + effect eTickOn = EffectMovementSpeedIncrease(99); + effect eTickOff = EffectMovementSpeedDecrease(99); + effect eBloodSuck = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConDrain); + +// Fine & smaller creatures cannot be attached to. + if (GetCreatureSize(oTarget) == CREATURE_SIZE_DIMINUTIVE || + GetCreatureSize(oTarget) == CREATURE_SIZE_FINE) + { + return; + } +// Perform a melee touch attack. Return if it missed. + if (!TouchAttackMelee(oTarget)) + { + return; + } +// Drain 1d4 points of CON. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBloodSuck, oTarget); + +// Increase the tick's speed so it can stay "attached" to it's victim + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOn, oPC); + +// When the tick drains 8 CON worth of blood it will detach & run away. + if (nTickFull >= 4) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT, eTickOff, oPC); + SetLocalInt(oPC, "X2_L_BEH_OFFENSE", 0); + return; + } + +// Add CON loss to total drained + nTickFull = nTickFull + nConDrain; + +FloatingTextStringOnCreature("The tick is draining your blood!", oTarget); + + } diff --git a/nwnds_module/wrabbite.uti b/nwnds_module/wrabbite.uti new file mode 100644 index 000000000..743b46f98 Binary files /dev/null and b/nwnds_module/wrabbite.uti differ diff --git a/nwnds_module/wraith_touch.ncs b/nwnds_module/wraith_touch.ncs new file mode 100644 index 000000000..73be2ca50 Binary files /dev/null and b/nwnds_module/wraith_touch.ncs differ diff --git a/nwnds_module/wraith_touch.nss b/nwnds_module/wraith_touch.nss new file mode 100644 index 000000000..8fd9dde73 --- /dev/null +++ b/nwnds_module/wraith_touch.nss @@ -0,0 +1,71 @@ +//:: +//:: A pnp version of the Wraith's CON draining touch. +//:: +//:: Modified by: DM Heatstroke 01-04-11 +//:: + +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void DoConDamage(object oTarget, object oCaster) +{ // Get Ability Damage + effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE); + int nDam = d6(); + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam); + eCon = ExtraordinaryEffect(eCon); + + // Setup oCaster's healing + effect eDrain = EffectTemporaryHitpoints(5); + eDrain = ExtraordinaryEffect(eDrain); + effect eDrainVis = EffectVisualEffect(VFX_IMP_HEALING_L); + + // Determine if they can die from ability loss + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + // Get oCaster's Touch DC + int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster); + int nCreHD = GetHitDice (oCaster); + int nTouchDC = (10 + (nCreHD/2) + nCreCHAMod); + + // Roll a saving throw + if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nTouchDC, SAVING_THROW_TYPE_NONE, oCaster) ) + { // If they fail a save & have less than a 3 Constitution, kill them + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath2 = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget); + + } + ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); // Apply Viz + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCon, oTarget, 8640.0); // 24 "Athas Reborn" hours -DMH + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oCaster); // Heal up + ApplyEffectToObject(DURATION_TYPE_INSTANT, eDrainVis, oCaster); // Apply Viz + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + + if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + SendMessageToPC(oTarget,"Immune to ability drain."); + return; + } + + DelayCommand(0.1,DoConDamage(oTarget,oCaster)); + +} diff --git a/nwnds_module/wraithhide001.uti b/nwnds_module/wraithhide001.uti new file mode 100644 index 000000000..413d83ac7 Binary files /dev/null and b/nwnds_module/wraithhide001.uti differ diff --git a/nwnds_module/wraithhide002.uti b/nwnds_module/wraithhide002.uti new file mode 100644 index 000000000..b5e2ce70e Binary files /dev/null and b/nwnds_module/wraithhide002.uti differ diff --git a/nwnds_module/wraithhide003.uti b/nwnds_module/wraithhide003.uti new file mode 100644 index 000000000..83c58dfb6 Binary files /dev/null and b/nwnds_module/wraithhide003.uti differ diff --git a/nwnds_module/wraithspawn.utc b/nwnds_module/wraithspawn.utc new file mode 100644 index 000000000..0ec10ea76 Binary files /dev/null and b/nwnds_module/wraithspawn.utc differ diff --git a/nwnds_module/wraithtouch001.uti b/nwnds_module/wraithtouch001.uti new file mode 100644 index 000000000..2a8e61c92 Binary files /dev/null and b/nwnds_module/wraithtouch001.uti differ diff --git a/nwnds_module/wraithtouch002.uti b/nwnds_module/wraithtouch002.uti new file mode 100644 index 000000000..b58c7f0cc Binary files /dev/null and b/nwnds_module/wraithtouch002.uti differ diff --git a/nwnds_module/wswdg002.uti b/nwnds_module/wswdg002.uti new file mode 100644 index 000000000..e16f3e437 Binary files /dev/null and b/nwnds_module/wswdg002.uti differ diff --git a/nwnds_module/ww_aura.ncs b/nwnds_module/ww_aura.ncs new file mode 100644 index 000000000..0471378ab Binary files /dev/null and b/nwnds_module/ww_aura.ncs differ diff --git a/nwnds_module/ww_aura.nss b/nwnds_module/ww_aura.nss new file mode 100644 index 000000000..6ff463e7b --- /dev/null +++ b/nwnds_module/ww_aura.nss @@ -0,0 +1,8 @@ +void main() +{ + effect eAOE = EffectAreaOfEffect(AOE_MOB_FROST,"ww_aura1","ww_aura2","null"); + eAOE = SupernaturalEffect(eAOE); + eAOE = ExtraordinaryEffect(eAOE); + + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100)); +} diff --git a/nwnds_module/ww_aura1.ncs b/nwnds_module/ww_aura1.ncs new file mode 100644 index 000000000..99e189d18 Binary files /dev/null and b/nwnds_module/ww_aura1.ncs differ diff --git a/nwnds_module/ww_aura1.nss b/nwnds_module/ww_aura1.nss new file mode 100644 index 000000000..790433b28 --- /dev/null +++ b/nwnds_module/ww_aura1.nss @@ -0,0 +1,68 @@ +int IsColdSubType( object oTarget ) +{ + object oHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oTarget); + + if ( !GetIsObjectValid( oHide ) ) + return FALSE; + + int bCold = FALSE; + int bFire = FALSE; + int nIPType; + int nIPSubType; + + itemproperty ipIP = GetFirstItemProperty(oHide); + + while ( GetIsItemPropertyValid(ipIP) ) + { + nIPType = GetItemPropertyType(ipIP); + nIPSubType = GetItemPropertySubType(ipIP); + if ( nIPType == ITEM_PROPERTY_DAMAGE_VULNERABILITY && + nIPSubType == 10 ) // fire vuln + bFire = TRUE; + if ( nIPType == ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE && + nIPSubType == 7 ) // cold immunity + bCold = TRUE; + + if ( bFire && bCold ) + return TRUE; + + ipIP = GetNextItemProperty(oHide); + } + return FALSE; +} + +void main() +{ + object oTarget = GetEnteringObject(); + object oCaster = GetAreaOfEffectCreator(); + + if ( oTarget == oCaster ) + return; + + effect eCold = EffectDamage(d10(2),DAMAGE_TYPE_COLD); + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eRegen = EffectRegenerate(10,6.0); + effect eTurn = EffectTurnResistanceIncrease(6); + effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM); + + + if ( GetIsEnemy(oTarget, oCaster) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eCold,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + + // check for fire and cold properties on hide to determine + // if creature is cold subtype + + if ( IsColdSubType(oTarget) ) + { + + if ( GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD ) + eRegen = EffectLinkEffects(eRegen,eTurn); + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,oTarget,6.0); + } + +} diff --git a/nwnds_module/ww_aura2.ncs b/nwnds_module/ww_aura2.ncs new file mode 100644 index 000000000..4e68a712e Binary files /dev/null and b/nwnds_module/ww_aura2.ncs differ diff --git a/nwnds_module/ww_aura2.nss b/nwnds_module/ww_aura2.nss new file mode 100644 index 000000000..3163f10d1 --- /dev/null +++ b/nwnds_module/ww_aura2.nss @@ -0,0 +1,69 @@ +int IsColdSubType( object oTarget ) +{ + object oHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oTarget); + + if ( !GetIsObjectValid( oHide ) ) + return FALSE; + + int bCold = FALSE; + int bFire = FALSE; + int nIPType; + int nIPSubType; + + itemproperty ipIP = GetFirstItemProperty(oHide); + + while ( GetIsItemPropertyValid(ipIP) ) + { + nIPType = GetItemPropertyType(ipIP); + nIPSubType = GetItemPropertySubType(ipIP); + if ( nIPType == ITEM_PROPERTY_DAMAGE_VULNERABILITY && + nIPSubType == 10 ) // fire vuln + bFire = TRUE; + if ( nIPType == ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE && + nIPSubType == 7 ) // cold immunity + bCold = TRUE; + + if ( bFire && bCold ) + return TRUE; + + ipIP = GetNextItemProperty(oHide); + } + return FALSE; +} + + + +void main() +{ + object oCaster = GetAreaOfEffectCreator(); + + effect eCold; + effect eVis = EffectVisualEffect(VFX_IMP_FROST_S); + effect eRegen = EffectRegenerate(10,6.0); + effect eTurn = EffectTurnResistanceIncrease(6); + effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM); + + object oTarget = GetFirstInPersistentObject(); + while ( GetIsObjectValid(oTarget ) ) + { + if ( oTarget != oCaster && !GetIsDead(oTarget) ) + { + if ( GetIsEnemy(oTarget,oCaster)) + { + eCold = EffectDamage(d10(2),DAMAGE_TYPE_COLD); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eCold,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + } + if ( IsColdSubType(oTarget) ) + { + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,oTarget,6.0); + if ( GetRacialType(oTarget) == RACIAL_TYPE_UNDEAD ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eTurn,oTarget,6.0); + } + } + } + oTarget = GetNextInPersistentObject(); + } +} diff --git a/nwnds_module/wwclaw.ncs b/nwnds_module/wwclaw.ncs new file mode 100644 index 000000000..38f18a9c6 Binary files /dev/null and b/nwnds_module/wwclaw.ncs differ diff --git a/nwnds_module/wwclaw.nss b/nwnds_module/wwclaw.nss new file mode 100644 index 000000000..aa375b400 --- /dev/null +++ b/nwnds_module/wwclaw.nss @@ -0,0 +1,81 @@ +#include "NW_I0_SPELLS" + + +void DoConDamage(object oTarget, object oCaster) +{ + if ( GetIsDead(oTarget) || + !GetIsObjectValid(oTarget) ) + return; + + effect eVis = EffectVisualEffect(VFX_IMP_FROST_L); + int nDam = 4; + effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION,nDam); + eCon = SupernaturalEffect(eCon); + + int bKillEm = FALSE; + if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES + || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT ) + bKillEm = TRUE; + + int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION); + if ( ( nCon - nDam ) < 3 && bKillEm ) + { + effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH); + effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY); + effect eDeath = EffectDeath(); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget); + ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget); + } + + ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eCon,oTarget); + + effect eHeal = EffectTemporaryHitpoints(10); + effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_S); + + if ( !GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) ) + { + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHeal, oCaster, HoursToSeconds(1)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, eHealVis, oCaster); + } +} + +int DoBlight(object oTarget, object oCaster, float fDelay = 0.0 ) +{ + if ( !GetIsObjectValid(oTarget) ) + return FALSE; + if ( !MySavingThrow(SAVING_THROW_FORT,oTarget,35,SAVING_THROW_TYPE_NONE,oCaster,fDelay) ) + { + DelayCommand(fDelay,DoConDamage(oTarget,oCaster)); + return TRUE; + } + else + { + return FALSE; + } +} + +void main() +{ + object oTarget = GetSpellTargetObject(); + object oCaster = OBJECT_SELF; + +/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned"); + if ( bIsPoisoned ) + return; */ + if ( GetLocalInt(oTarget,"BlightFire") ) + { + return; + } + int bResult = DoBlight(oTarget,oCaster); + float fDelay = 6.0; + SetLocalInt(oTarget,"BlightFire",1); + while ( bResult && fDelay <= 30.0 ) + { + bResult = DoBlight(oTarget,oCaster,fDelay); + fDelay += 6.0; + } + + DelayCommand(fDelay,SetLocalInt(oTarget,"BlightFire",0)); +} diff --git a/nwnds_module/x0_bread.utp b/nwnds_module/x0_bread.utp new file mode 100644 index 000000000..91e7dea22 Binary files /dev/null and b/nwnds_module/x0_bread.utp differ diff --git a/nwnds_module/x0_s2_shadsum.ncs b/nwnds_module/x0_s2_shadsum.ncs new file mode 100644 index 000000000..c7091545c Binary files /dev/null and b/nwnds_module/x0_s2_shadsum.ncs differ diff --git a/nwnds_module/x0_s2_shadsum.nss b/nwnds_module/x0_s2_shadsum.nss new file mode 100644 index 000000000..85fd76108 --- /dev/null +++ b/nwnds_module/x0_s2_shadsum.nss @@ -0,0 +1,75 @@ +//:://///////////////////////////////////////////// +//:: Summon Shadow +//:: X0_S2_ShadSum.nss +//:: Copyright (c) 2002 Bioware Corp. +//::////////////////////////////////////////////// +/* + PRESTIGE CLASS VERSION + Spell powerful ally from the shadow plane to + battle for the wizard +*/ +//::////////////////////////////////////////////// +//:: Created By: Preston Watamaniuk +//:: Created On: Oct 26, 2001 +//::////////////////////////////////////////////// + +void main() +{ + //Declare major variables + int nMetaMagic = GetMetaMagicFeat(); + int nCasterLevel = GetLevelByClass(27); + int nDuration = nCasterLevel; + effect eSummon; + object oSummon; + + + //Set the summoned undead to the appropriate template based on the caster level + if (nCasterLevel <= 5) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_01",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <= 8) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_02",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=11) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_03",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=14) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_04",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=17) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_05",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=20) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_06",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=23) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_07",VFX_FNF_SUMMON_UNDEAD); + } + else if (nCasterLevel <=26) + { + eSummon = EffectSummonCreature("DS_S_SHADOW_08",VFX_FNF_SUMMON_UNDEAD); + } + else + { + if (GetHasFeat(1002,OBJECT_SELF))// has epic shadowlord feat + { + //GZ 2003-07-24: Epic shadow lord + eSummon = EffectSummonCreature("DS_S_SHADOW_09",VFX_FNF_SUMMON_UNDEAD); + } + else + { + eSummon = EffectSummonCreature("DS_S_SHADOW_09",VFX_FNF_SUMMON_UNDEAD); + } + + } + + //Apply VFX impact and summon effect + ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration)); +} diff --git a/nwnds_module/x2_ai_mflayer.ncs b/nwnds_module/x2_ai_mflayer.ncs new file mode 100644 index 000000000..bb52dd967 Binary files /dev/null and b/nwnds_module/x2_ai_mflayer.ncs differ diff --git a/nwnds_module/x2_ai_mflayer.nss b/nwnds_module/x2_ai_mflayer.nss new file mode 100644 index 000000000..0283bc355 --- /dev/null +++ b/nwnds_module/x2_ai_mflayer.nss @@ -0,0 +1,279 @@ +//:://///////////////////////////////////////////// +//:: Custom Mindflayer AI +//:: x2_ai_mflayer +//:: Copyright (c) 2003 Bioware Corp. +//::////////////////////////////////////////////// +/* + This is the Hordes of the Underdark campaign + Mini AI run on the mindflayer. + + It does not use any spells assigned to the + mindflayer, if you want to make a custom mindflayer + you need to deactivate this AI by removing the + approriate variable from your beholder creature + in the toolset + + +*/ +//::////////////////////////////////////////////// +//:: Created By: Georg Zoeller +//:: Created On: 2003-08-21 +//::////////////////////////////////////////////// + +#include "nw_i0_generic" +#include "x0_i0_spells" +#include "x2_inc_switches" +#include "x2_inc_toollib" + +const int X2_MINDFLAYER_TELEPORT_MAXUSES = 10; + +int MFGetTargetConditionSucks(object oTarget) +{ + // if polymorphed we do not suck + if (GetHasEffect(EFFECT_TYPE_POLYMORPH, oTarget) == TRUE) + { + return FALSE; + } + + if (GetHasEffect(EFFECT_TYPE_STUNNED, oTarget) || GetHasEffect(EFFECT_TYPE_PARALYZE, oTarget) + || GetHasEffect(VFX_DUR_PARALYZE_HOLD, oTarget) || GetHasEffect(VFX_DUR_PARALYZE_HOLD, oTarget) ) + { + return TRUE; + } + else + { + // if dazed, try to brainsuck only 30% of the time) + if (GetHasEffect(EFFECT_TYPE_DAZED, oTarget) && (Random(100)<30) ) + { + return TRUE; + } + return FALSE; + } + +} + +void MFlayerSuck(object oTarget) +{ + if ( GetDistanceBetween( OBJECT_SELF, oTarget ) < 1.5f) + { + ActionMoveAwayFromObject(oTarget, FALSE, 1.5f); + } + ActionMoveToObject( oTarget, FALSE, 1.5f); + ActionDoCommand(SetFacingPoint( GetPositionFromLocation(GetLocation(oTarget)))); + ActionWait(0.5f); + if (MFGetTargetConditionSucks(oTarget)) + { + ActionCastSpellAtObject(716, oTarget,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT); + } + else + { + ActionCastSpellAtObject(551, oTarget,METAMAGIC_ANY,TRUE,0,PROJECTILE_PATH_TYPE_DEFAULT); + } + +} + +int MFlayerDoPsionics(object oTarget) +{ + return TalentSpellAttack(oTarget); +} + + +void MFlayClearFleeState() +{ + DeleteLocalInt(OBJECT_SELF,"X2_MFLAYER_AI_FLEEING"); +} + +void MFlayClearState() +{ + if (GetCurrentAction(OBJECT_SELF) == ACTION_ATTACKOBJECT || GetCurrentAction(OBJECT_SELF) == ACTION_MOVETOPOINT ) + { + ClearAllActions(); + } +} + +/* +int TryToTeleport(object oTargetFrom, int bCloseIn = FALSE) +{ + int nTeleportCounter = GetLocalInt(OBJECT_SELF,"X2_MINDFLAYER_AI_TELECOUNT"); + + if (nTeleportCounter > X2_MINDFLAYER_TELEPORT_MAXUSES) + { + return FALSE; + } + else + { + nTeleportCounter ++; + SetLocalInt(OBJECT_SELF,"X2_MINDFLAYER_AI_TELECOUNT",nTeleportCounter); + } + + object oExit; + + if (bCloseIn) + { + oExit = GetNearestObjectByTag("X2_WP_MFLAYER_EXIT",oTargetFrom); + } + else + { + oExit = GetNearestObjectByTag("X2_WP_MFLAYER_EXIT"); + } + + if (!GetIsObjectValid(oExit)) + { + return FALSE; + } + float fDist = GetDistanceBetween(oExit,oTargetFrom); + int bJump; + + if (bCloseIn) + { + if ((fDist >= 8.0f) && (fDist <= 20.0f)) + { + bJump = TRUE; + } + } + else + { + if ((fDist >= 10.0f) && (fDist <= 40.0f)) + { + bJump = TRUE; + } + } + + if (!bJump) + { + if (bCloseIn) + { + oExit = GetNearestObjectByTag("X2_WP_MFLAYER_EXIT",oTargetFrom,2); + } + else + { + oExit = GetNearestObjectByTag("X2_WP_MFLAYER_EXIT",OBJECT_SELF,2); + } + + if (!GetIsObjectValid(oExit)) + { + return FALSE; + } + else + { + fDist = GetDistanceBetween(oExit,oTargetFrom); + if (bCloseIn) + { + if ((fDist >= 6.0f) && (fDist <= 15.0f)) + { + bJump = TRUE; + } + } + else + { + if ((fDist >= 8.0f) && (fDist <= 50.0f)) + { + bJump = TRUE; + } + } + } + + } + + if (bJump) + { + if (!GetIsDead(OBJECT_SELF)) + { + + effect eAppear = EffectDisappearAppear(GetLocation(oExit)) ; + eAppear = ExtraordinaryEffect(eAppear); + object oSelf = OBJECT_SELF; + //effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON); + //ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oSelf); + ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAppear,oSelf,4.0f); + + } + return TRUE; + } + else + { + return FALSE; + } + + + return TRUE; +} +*/ + + + +// 1 - Melee +// 2 - Suck +int GetMindFlayerTactics(object oTarget) +{ + int nRet = FALSE; + + // we go melee against petrified targets + if (GetHasEffect(EFFECT_TYPE_PETRIFY, oTarget) == TRUE) + { + nRet = 1; + } + else if (GetIsPlayableRacialType(oTarget) && MFGetTargetConditionSucks(oTarget) || GetSubRace(oTarget)== "Tiefling") + { + nRet = 2; + } + // if the target is down below 10 hp and AC is below 23, we go into melee as well + else if ( GetCurrentHitPoints(oTarget) < 10 && GetAC(oTarget) < 23) + { + nRet = 1; + } + + + + return nRet; +} + +void main() +{ + //The following two lines should not be touched + object oIntruder = GetCreatureOverrideAIScriptTarget(); + ClearCreatureOverrideAIScriptTarget(); + + // ********************* Start of custom AI script **************************** + + + // Here you can write your own AI to run in place of DetermineCombatRound. + // The minimalistic approach would be something like + // + // TalentFlee(oTarget); // flee on any combat activity + + if(GetAssociateState(NW_ASC_IS_BUSY)) + { + return; + } + + if (GetIsObjectValid(oIntruder) == FALSE) + oIntruder = bkAcquireTarget(); + + if(BashDoorCheck(oIntruder)) {return;} + // * BK: stop fighting if something bizarre that shouldn't happen, happens + if (bkEvaluationSanityCheck(oIntruder, GetFollowDistance()) == TRUE) + { + return; + } + + if (GetIsObjectValid(oIntruder) == FALSE || GetIsDead(oIntruder)) + { + return; // fall back to default AI because SetCreatureOverrideAIScriptFinished(); wasnt called t cal + } + + int nTactics = GetMindFlayerTactics(oIntruder); + if (nTactics == 2) + { + __TurnCombatRoundOn(TRUE); + MFlayerSuck(oIntruder); + __TurnCombatRoundOn(FALSE); + SetCreatureOverrideAIScriptFinished(); + } + else + { + return; // fall back to default AI because SetCreatureOverrideAIScriptFinished(); wasnt called t cal + } + + +} diff --git a/nwnds_module/x2_def_attacked.ncs b/nwnds_module/x2_def_attacked.ncs new file mode 100644 index 000000000..e3743f749 Binary files /dev/null and b/nwnds_module/x2_def_attacked.ncs differ diff --git a/nwnds_module/x2_def_attacked.nss b/nwnds_module/x2_def_attacked.nss new file mode 100644 index 000000000..4c4596832 --- /dev/null +++ b/nwnds_module/x2_def_attacked.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_attacked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Physically attacked script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + //-------------------------------------------------------------------------- + // GZ: 2003-10-16 + // Make Plot Creatures Ignore Attacks + //-------------------------------------------------------------------------- + if (GetPlotFlag(OBJECT_SELF)) + { + return; + } + + //-------------------------------------------------------------------------- + // Execute old NWN default AI code + //-------------------------------------------------------------------------- + + ExecuteScript("prc_npc_physatt", OBJECT_SELF); + ExecuteScript("nw_c2_default5", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_endcombat.ncs b/nwnds_module/x2_def_endcombat.ncs new file mode 100644 index 000000000..4834fc0e9 Binary files /dev/null and b/nwnds_module/x2_def_endcombat.ncs differ diff --git a/nwnds_module/x2_def_endcombat.nss b/nwnds_module/x2_def_endcombat.nss new file mode 100644 index 000000000..2717782a2 --- /dev/null +++ b/nwnds_module/x2_def_endcombat.nss @@ -0,0 +1,25 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_endcombat +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default Combat Round End script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_battlecry_" +/////////////////////////// + +void main() +{ + ExecuteScript("prc_npc_combat", OBJECT_SELF); + ExecuteScript("nw_c2_default3", OBJECT_SELF); + + // Necromancy 101 /// + DoCombatCry(); + ///////////////////// +} diff --git a/nwnds_module/x2_def_heartbeat.ncs b/nwnds_module/x2_def_heartbeat.ncs new file mode 100644 index 000000000..948e90a24 Binary files /dev/null and b/nwnds_module/x2_def_heartbeat.ncs differ diff --git a/nwnds_module/x2_def_heartbeat.nss b/nwnds_module/x2_def_heartbeat.nss new file mode 100644 index 000000000..a19c4e65f --- /dev/null +++ b/nwnds_module/x2_def_heartbeat.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_heartbeat +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default Heartbeat script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("prc_npc_hb", OBJECT_SELF); + ExecuteScript("nw_c2_default1", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_onblocked.ncs b/nwnds_module/x2_def_onblocked.ncs new file mode 100644 index 000000000..c1c71f52e Binary files /dev/null and b/nwnds_module/x2_def_onblocked.ncs differ diff --git a/nwnds_module/x2_def_onblocked.nss b/nwnds_module/x2_def_onblocked.nss new file mode 100644 index 000000000..0472c96e2 --- /dev/null +++ b/nwnds_module/x2_def_onblocked.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_onblocked +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnBlocked script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("prc_npc_blocked", OBJECT_SELF); + ExecuteScript("nw_c2_defaulte", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_onconv.ncs b/nwnds_module/x2_def_onconv.ncs new file mode 100644 index 000000000..b6e7dc9a7 Binary files /dev/null and b/nwnds_module/x2_def_onconv.ncs differ diff --git a/nwnds_module/x2_def_onconv.nss b/nwnds_module/x2_def_onconv.nss new file mode 100644 index 000000000..4ed4af2af --- /dev/null +++ b/nwnds_module/x2_def_onconv.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_onconv +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Conversation script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("prc_npc_conv", OBJECT_SELF); + ExecuteScript("nw_c2_default4", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_ondamage.ncs b/nwnds_module/x2_def_ondamage.ncs new file mode 100644 index 000000000..247e2f657 Binary files /dev/null and b/nwnds_module/x2_def_ondamage.ncs differ diff --git a/nwnds_module/x2_def_ondamage.nss b/nwnds_module/x2_def_ondamage.nss new file mode 100644 index 000000000..86cf0d670 --- /dev/null +++ b/nwnds_module/x2_def_ondamage.nss @@ -0,0 +1,29 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_ondamage +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnDamaged script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + //-------------------------------------------------------------------------- + // GZ: 2003-10-16 + // Make Plot Creatures Ignore Attacks + //-------------------------------------------------------------------------- + if (GetPlotFlag(OBJECT_SELF)) + { + return; + } + + //-------------------------------------------------------------------------- + // Execute old NWN default AI code + //-------------------------------------------------------------------------- + ExecuteScript("prc_npc_damaged", OBJECT_SELF); + ExecuteScript("nw_c2_default6", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_ondeath.ncs b/nwnds_module/x2_def_ondeath.ncs new file mode 100644 index 000000000..5d9c1b075 Binary files /dev/null and b/nwnds_module/x2_def_ondeath.ncs differ diff --git a/nwnds_module/x2_def_ondeath.nss b/nwnds_module/x2_def_ondeath.nss new file mode 100644 index 000000000..1e5fd14cf --- /dev/null +++ b/nwnds_module/x2_def_ondeath.nss @@ -0,0 +1,262 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_ondeath +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnDeath script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_livingdead_" +#include "_inc_battlecry_" +//////////////////////////// +#include "NW_I0_SPELLS" +#include "nw_i0_plot" + +void main() +{ + object oNPC = OBJECT_SELF; + + if ((GetResRef(oNPC) == "NPC_KLEDGUARD") || + (GetResRef(oNPC) == "NPC_IANTO_GUARD1") || + (GetResRef(oNPC) == "NPC_IANTO_GUARD2") || + (GetResRef(oNPC) == "ds_vorlon_guard1") || + (GetResRef(oNPC) == "ds_vorlon_guard2")) + { + 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); + + } + + + 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 ( !MySavingThrow(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)); + } + + ExecuteScript("nw_c2_default7", OBJECT_SELF); + // Necromancy 101 /////////////////////// + DoDeathCry(); + if (UndeadCheck(GetLastKiller())) return; + ///////////////////////////////////////// +} diff --git a/nwnds_module/x2_def_ondisturb.ncs b/nwnds_module/x2_def_ondisturb.ncs new file mode 100644 index 000000000..80a483f18 Binary files /dev/null and b/nwnds_module/x2_def_ondisturb.ncs differ diff --git a/nwnds_module/x2_def_ondisturb.nss b/nwnds_module/x2_def_ondisturb.nss new file mode 100644 index 000000000..a5e23b8e1 --- /dev/null +++ b/nwnds_module/x2_def_ondisturb.nss @@ -0,0 +1,17 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_ondisturb +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default OnDisturbed script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + ExecuteScript("prc_npc_disturb", OBJECT_SELF); + ExecuteScript("nw_c2_default8", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_percept.ncs b/nwnds_module/x2_def_percept.ncs new file mode 100644 index 000000000..6100d15df Binary files /dev/null and b/nwnds_module/x2_def_percept.ncs differ diff --git a/nwnds_module/x2_def_percept.nss b/nwnds_module/x2_def_percept.nss new file mode 100644 index 000000000..95ea0ea29 --- /dev/null +++ b/nwnds_module/x2_def_percept.nss @@ -0,0 +1,26 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_percept +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Perception script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +// Necromancy 101 ///////// +#include "_inc_battlecry_" +//////////////////////////// + + +void main() +{ + ExecuteScript("prc_npc_percep", OBJECT_SELF); + ExecuteScript("nw_c2_default2", OBJECT_SELF); + + // Necromancy 101 /// + DoBattleCry(); + ///////////////////// +} diff --git a/nwnds_module/x2_def_rested.ncs b/nwnds_module/x2_def_rested.ncs new file mode 100644 index 000000000..0e9f0636b Binary files /dev/null and b/nwnds_module/x2_def_rested.ncs differ diff --git a/nwnds_module/x2_def_rested.nss b/nwnds_module/x2_def_rested.nss new file mode 100644 index 000000000..2e09ffc14 --- /dev/null +++ b/nwnds_module/x2_def_rested.nss @@ -0,0 +1,182 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_rested +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Rested script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + int nNumber = GetLocalInt(OBJECT_SELF,"CREATURE_VAR_NUMBER_OF_ATTACKS"); + if (nNumber >0 ) + { + SetBaseAttackBonus(nNumber); + } + + int nShadowy = GetLocalInt(OBJECT_SELF,"SHADOWY"); + if (nShadowy) + { + effect eVis = EffectVisualEffect(VFX_DUR_PROT_SHADOW_ARMOR); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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 nGlow = GetLocalInt (OBJECT_SELF,"GLOW_COLOR"); + if (nGlow == 1) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BLUE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 2) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_BROWN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 3) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREEN); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 4) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_GREY); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 12) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_ORANGE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 13) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_PURPLE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 14) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_RED); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 15) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_WHITE); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + else if (nGlow == 16) + { + effect eVis = EffectVisualEffect(VFX_DUR_GLOW_YELLOW); + eVis = SupernaturalEffect(eVis); + eVis = ExtraordinaryEffect(eVis); + ApplyEffectToObject(DURATION_TYPE_PERMANENT,eVis,OBJECT_SELF); + } + + ExecuteScript("prc_npc_rested", OBJECT_SELF); + ExecuteScript("nw_c2_defaulta", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_spawn.ncs b/nwnds_module/x2_def_spawn.ncs new file mode 100644 index 000000000..c3607f3b1 Binary files /dev/null and b/nwnds_module/x2_def_spawn.ncs differ diff --git a/nwnds_module/x2_def_spawn.nss b/nwnds_module/x2_def_spawn.nss new file mode 100644 index 000000000..20ad9fc40 --- /dev/null +++ b/nwnds_module/x2_def_spawn.nss @@ -0,0 +1,461 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spawn +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spawn script + + + 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. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner, Georg Zoeller +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +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" + +void ShrinkEm(object oPC) +{ + SetObjectVisualTransform(oPC, OBJECT_VISUAL_TRANSFORM_SCALE, 0.5f); +} + +void main() +{ + string sTag; + object oNPC; + ExecuteScript("prc_npc_spawn", OBJECT_SELF); + // 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 )); + } + + sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG"); + if (GetStringLength(sTag)>0) + { // look for master + 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(OBJECT_SELF,"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(50); + eSlow = SupernaturalEffect(eSlow); + eSlow = ExtraordinaryEffect(eSlow); + DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSlow,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 nNatInvis = GetLocalInt(OBJECT_SELF,"NATURAL_INVIS"); + if (nNatInvis > 0) + { + effect eNatInvis = EffectInvisibility(4); + eNatInvis = SupernaturalEffect(eNatInvis); + eNatInvis = ExtraordinaryEffect(eNatInvis); + DelayCommand(0.0f, ApplyEffectToObject(DURATION_TYPE_PERMANENT,eNatInvis,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 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)); + } + + //modify to try fix on Various Aura effects. + //NC:EDIT +/* int nAtropal = GetTag(OBJECT_SELF)=="ATROPAL001" ? TRUE : FALSE; + if(nAtropal)ExecuteScript("atropal_aura",OBJECT_SELF); + int nNWalker = GetTag(OBJECT_SELF)=="Nightwalker" ? TRUE : FALSE; + if(nNWalker)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nNCrawler = GetTag(OBJECT_SELF)=="Nightcrawler" ? TRUE : FALSE; + if(nNCrawler)ExecuteScript("desecrating_aura",OBJECT_SELF); + int nVoidWraith = GetTag(OBJECT_SELF)=="Voidwraith" ? TRUE : FALSE; + if(nVoidWraith)ExecuteScript("airlessaura",OBJECT_SELF); + int AtropalScion = GetTag(OBJECT_SELF)=="AtropalScion" ? TRUE : FALSE; + if(AtropalScion)ExecuteScript("neaura",OBJECT_SELF); + int nGhast = GetTag(OBJECT_SELF)=="GHAST001" ? TRUE : FALSE; + if(nGhast)ExecuteScript("ghast_stench",OBJECT_SELF); */ + + + // Execute default OnSpawn script. + ExecuteScript("nw_c2_default9", OBJECT_SELF); + + + //Post Spawn event requeste + if (nSpecEvent == 2 || nSpecEvent == 3) + { + SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN)); + } + + ms_Nomenclature(OBJECT_SELF); + +} diff --git a/nwnds_module/x2_def_spellcast.ncs b/nwnds_module/x2_def_spellcast.ncs new file mode 100644 index 000000000..6cf4ee1a1 Binary files /dev/null and b/nwnds_module/x2_def_spellcast.ncs differ diff --git a/nwnds_module/x2_def_spellcast.nss b/nwnds_module/x2_def_spellcast.nss new file mode 100644 index 000000000..8b35dfde8 --- /dev/null +++ b/nwnds_module/x2_def_spellcast.nss @@ -0,0 +1,30 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_spellcast +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On Spell Cast At script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +void main() +{ + + //-------------------------------------------------------------------------- + // GZ: 2003-10-16 + // Make Plot Creatures Ignore Attacks + //-------------------------------------------------------------------------- + if (GetPlotFlag(OBJECT_SELF)) + { + return; + } + + //-------------------------------------------------------------------------- + // Execute old NWN default AI code + //-------------------------------------------------------------------------- + ExecuteScript("prc_npc_spellat", OBJECT_SELF); + ExecuteScript("nw_c2_defaultb", OBJECT_SELF); +} diff --git a/nwnds_module/x2_def_userdef.ncs b/nwnds_module/x2_def_userdef.ncs new file mode 100644 index 000000000..f54f9ef9e Binary files /dev/null and b/nwnds_module/x2_def_userdef.ncs differ diff --git a/nwnds_module/x2_def_userdef.nss b/nwnds_module/x2_def_userdef.nss new file mode 100644 index 000000000..a7a026bd9 --- /dev/null +++ b/nwnds_module/x2_def_userdef.nss @@ -0,0 +1,64 @@ +//:://///////////////////////////////////////////// +//:: Name x2_def_userdef +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Default On User Defined Event script +*/ +//::////////////////////////////////////////////// +//:: Created By: Keith Warner +//:: Created On: June 11/03 +//::////////////////////////////////////////////// + +const int EVENT_USER_DEFINED_PRESPAWN = 1510; +const int EVENT_USER_DEFINED_POSTSPAWN = 1511; +void main() +{ + ExecuteScript("prc_npc_userdef", OBJECT_SELF); + int nUser = GetUserDefinedEventNumber(); + + if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT + { + + } + 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 + { + + } + 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) + { + + } + + +} + + diff --git a/nwnds_module/x2_sig_state.ncs b/nwnds_module/x2_sig_state.ncs new file mode 100644 index 000000000..122c59670 Binary files /dev/null and b/nwnds_module/x2_sig_state.ncs differ diff --git a/nwnds_module/x2_sig_state.nss b/nwnds_module/x2_sig_state.nss new file mode 100644 index 000000000..a02876878 --- /dev/null +++ b/nwnds_module/x2_sig_state.nss @@ -0,0 +1,18 @@ +//:://///////////////////////////////////////////// +//:: x2_sig_state +//:: Copyright (c) 2001 Bioware Corp. +//::////////////////////////////////////////////// +/* + Sends an event to every party member + saying I've been put into a disabling state +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: +//::////////////////////////////////////////////// +#include "x0_inc_henai" + +void main() +{ + //SendForHelp(); +} diff --git a/nwnds_module/x_ch_fix_pos.ncs b/nwnds_module/x_ch_fix_pos.ncs new file mode 100644 index 000000000..ca516db4c Binary files /dev/null and b/nwnds_module/x_ch_fix_pos.ncs differ diff --git a/nwnds_module/x_ch_fix_pos.nss b/nwnds_module/x_ch_fix_pos.nss new file mode 100644 index 000000000..28f344389 --- /dev/null +++ b/nwnds_module/x_ch_fix_pos.nss @@ -0,0 +1,37 @@ +#include "chess_include" + +void main() +{ + string sSide = WHITE; + int i = 0; + while (i < 2) + { + int iP = 0; + while (iP < 16) + { + object oP = GetChessPiece(sSide, iP); + if (GetIsObjectValid(oP) == TRUE) + { + ExecuteScript("x_ch_jump", oP); + } + iP = iP + 1; + } + + object oP; + + // fix the position of any promoted pawns. + for (iP = 1 ; iP < 9 ; iP++) + { + oP = GetChessPiece(sSide, 14, iP); + if (GetIsObjectValid(oP) == TRUE) + { + ExecuteScript("x_ch_jump", oP); + } else { + break; + } + } + + i = i + 1; + sSide = BLACK; + } +} diff --git a/nwnds_module/x_ch_main_used.ncs b/nwnds_module/x_ch_main_used.ncs new file mode 100644 index 000000000..b76ca06e4 Binary files /dev/null and b/nwnds_module/x_ch_main_used.ncs differ diff --git a/nwnds_module/x_ch_main_used.nss b/nwnds_module/x_ch_main_used.nss new file mode 100644 index 000000000..cc63bf55b --- /dev/null +++ b/nwnds_module/x_ch_main_used.nss @@ -0,0 +1,20 @@ +// the use script for the game control system. + +void main() +{ + string sTag = GetTag(OBJECT_SELF); + int iSeperator = FindSubString(sTag, "_"); + string sWhite = GetSubString(sTag,0, iSeperator); + string sBlack = GetSubString(sTag,iSeperator+1, 10); + + SetCustomToken(300, sWhite); + SetCustomToken(301, sBlack); + + object oPC = GetLastUsedBy(); + if (GetIsObjectValid(oPC) == FALSE) + { + SpeakString("Used by invalid object."); + return; + } + BeginConversation("chess_main", oPC); +} diff --git a/nwnds_module/x_ch_used.ncs b/nwnds_module/x_ch_used.ncs new file mode 100644 index 000000000..6e73902fe Binary files /dev/null and b/nwnds_module/x_ch_used.ncs differ diff --git a/nwnds_module/x_ch_used.nss b/nwnds_module/x_ch_used.nss new file mode 100644 index 000000000..113c86915 --- /dev/null +++ b/nwnds_module/x_ch_used.nss @@ -0,0 +1,42 @@ +#include "chess_include" + +void main() +{ + object oPC = GetLastUsedBy(); + if (GetIsObjectValid(oPC) == FALSE) + { + SpeakString("Used by invalid object."); + return; + } + + object oArea = GetArea(OBJECT_SELF); + + string sSide = GetSideFromTag(GetTag(OBJECT_SELF)); + + if (GetLocalInt(oArea, "LockCircles") == 1) + { + string sLocked = GetLocalString(oArea, sSide + "User"); + if ( sLocked == "") + { + SetLocalString(oArea, sSide + "User", GetName(oPC)); + SpeakString("Setting " + GetName(oPC) + " as the " + sSide + " player."); + } else if (sLocked != GetName(oPC)) { + SpeakString("This circle is locked so that only " + sLocked + " may use it."); + return; + } + } else { + SetLocalString(oArea, sSide + "User", GetName(oPC)); + } + + if (GetLocalString(oArea, "Summoned " + sSide) == "") + { + ExecuteScript("x_ch_summon", OBJECT_SELF); + SpeakString("Summoning Army..."); + return; + } + + SetupCustomChessTokens(GetSideFromTag(GetTag(OBJECT_SELF))); + BeginConversation("chess_control", oPC); +} + + diff --git a/nwnds_module/xerichou001.utc b/nwnds_module/xerichou001.utc new file mode 100644 index 000000000..dfc1af3e4 Binary files /dev/null and b/nwnds_module/xerichou001.utc differ diff --git a/nwnds_module/xerichou002.utc b/nwnds_module/xerichou002.utc new file mode 100644 index 000000000..b9a708180 Binary files /dev/null and b/nwnds_module/xerichou002.utc differ diff --git a/nwnds_module/xplevel.nss b/nwnds_module/xplevel.nss new file mode 100644 index 000000000..df362058f --- /dev/null +++ b/nwnds_module/xplevel.nss @@ -0,0 +1,27 @@ +void XPLevel(int SetLevel) +{ + object oSpeaker; + effect eLevel; + int Level, XP, xxx; + + XP=0; + + for (xxx=1; xxx=XP) + { + eLevel=EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY,FALSE); + } + else if (LevelTombs, Grave Markers -> +//:: Pile of Bones"). +//::////////////////////////////////////////////// +/* + This script is no longer needed for demiliches, + but is retained for backwards-compatibility, and + in case someone is interested in changing the + perception range of demilich placeables. +*/ +//::////////////////////////////////////////////// +//:: Created by: Loki Hakanin +//:: Created on: April 21, 2004 +//::////////////////////////////////////////////// +//:: Modified by: The Krit +//:: Modified on: May 10, 2007 +//::////////////////////////////////////////////// + + +#include "zep_inc_demi" + + +void main() +{ + // Find the distance to the nearest enemy. + float fDistance = GetDistanceToObject( + GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, + OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE)); + + // Is the nearest enemy within perception range? + if ( 0.0 <= fDistance && fDistance <= ZEP_DEMI_PERC_RANGE ) + { + // Respawn the demilich. + ZEPDemilichFromBones(OBJECT_SELF, GetLocalString(OBJECT_SELF, ZEP_DEMI_LOCAL_RESREF), TRUE); + // Destroy the placeables. + object oDust = GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_AMBIENT); + if ( oDust != OBJECT_INVALID ) + DestroyObject(oDust); + else + // Probably a legacy placeable. Destroy nearest dust cloud. + DestroyObject(GetNearestObjectByTag("zep_demi_dust")); + DestroyObject(OBJECT_SELF); + } +} + diff --git a/nwnds_module/zep_demi_bone_us.ncs b/nwnds_module/zep_demi_bone_us.ncs new file mode 100644 index 000000000..20345530d Binary files /dev/null and b/nwnds_module/zep_demi_bone_us.ncs differ diff --git a/nwnds_module/zep_demi_bone_us.nss b/nwnds_module/zep_demi_bone_us.nss new file mode 100644 index 000000000..9075ef8df --- /dev/null +++ b/nwnds_module/zep_demi_bone_us.nss @@ -0,0 +1,36 @@ +//:://///////////////////////////////////////////// +//:: zep_demi_bone_us +//:: OnUsed event handler for a CEP demilich Pile +//:: of Bones placeable (found under the custom +//:: placeables: "Dungeons->Tombs, Grave Markers -> +//:: Pile of Bones"). +//::////////////////////////////////////////////// +/* + Transfroms a Pile of Bones to a demilich. + + Assumes this is executed by a resting demilich's + Pile of Bones placeable. + + A different blueprint will be used for regenerating + demiliches. +*/ +//::////////////////////////////////////////////// +//:: Created by: The Krit +//:: Created on: May 10, 2007 +//::////////////////////////////////////////////// + + +#include "zep_inc_demi" + + +void main() +{ + // Spawn the demilich. + ZEPDemilichFromBones(OBJECT_SELF, GetLocalString(OBJECT_SELF, ZEP_DEMI_LOCAL_RESREF), TRUE); + // Destroy the detector. + DestroyObject(GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SOURCE)); + // Destroy the placeables. + DestroyObject(GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_AMBIENT)); + DestroyObject(OBJECT_SELF); +} + diff --git a/nwnds_module/zep_doorkill.ncs b/nwnds_module/zep_doorkill.ncs new file mode 100644 index 000000000..76597d361 Binary files /dev/null and b/nwnds_module/zep_doorkill.ncs differ diff --git a/nwnds_module/zep_doorkill.nss b/nwnds_module/zep_doorkill.nss new file mode 100644 index 000000000..3e97ced8b --- /dev/null +++ b/nwnds_module/zep_doorkill.nss @@ -0,0 +1,43 @@ +//:://///////////////////////////////////////////// +//:: ZEP_DOORkill.nss +//:: Copyright (c) 2001 Bioware Corp. +//:: Modified by Dan Heidel 1/14/04 for CEP +//:: Modified by TJ Rayn (Bioware name: TheExcimer-500) 3/11/06 for CEP2 +//:: - added lines to create new placeable on death. +//::////////////////////////////////////////////// +/* + Place in the OnDestruct function of a placeable door + to ensure proper functioning. See zep_openclose for + further documentation. + + For create new placeable - add Local Variable on Object: + Type: string, Variable Name: CEP_L_DIEREPLACE Value: . +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: January 2002 +//::////////////////////////////////////////////// + +void main() +{ + string sGateBlock = GetLocalString(OBJECT_SELF, "CEP_L_GATEBLOCK"); + location lSelfLoc = GetLocation(OBJECT_SELF); + int nIsOpen = GetIsOpen(OBJECT_SELF); + + if (nIsOpen == 0) //if the door is closed + { + object oSelf = OBJECT_SELF; + if (GetLocalObject(oSelf, "GateBlock")!= OBJECT_INVALID) + { + DestroyObject(GetLocalObject(oSelf, "GateBlock")); + } + } + +//Create New Placeable on Death + string sDieReplace = GetLocalString(OBJECT_SELF, "CEP_L_DIEREPLACE"); + if (sDieReplace!="") +{CreateObject(OBJECT_TYPE_PLACEABLE, sDieReplace,lSelfLoc);} +} + + + diff --git a/nwnds_module/zep_doorspawn.ncs b/nwnds_module/zep_doorspawn.ncs new file mode 100644 index 000000000..ce85d441d Binary files /dev/null and b/nwnds_module/zep_doorspawn.ncs differ diff --git a/nwnds_module/zep_doorspawn.nss b/nwnds_module/zep_doorspawn.nss new file mode 100644 index 000000000..fad908d92 --- /dev/null +++ b/nwnds_module/zep_doorspawn.nss @@ -0,0 +1,27 @@ +//:://///////////////////////////////////////////// +//:: ZEP_DOORSPAWN.nss +//:: Copyright (c) 2001 Bioware Corp. +//:: Modified by Dan Heidel 1/14/04 for CEP +//::////////////////////////////////////////////// +/* + Place in the OnHeartbeat function of a placeable door + to ensure proper functioning. See zep_openclose for + further documentation. +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: January 2002 +//::////////////////////////////////////////////// + + +void main() +{ + int nIsOpen = GetIsOpen(OBJECT_SELF); + if(nIsOpen == 1)return; //if door is open, quit + if(GetLocalObject(OBJECT_SELF, "GateBlock") != OBJECT_INVALID) return; //if gateblock is already in place, quit + string sGateBlock = GetLocalString(OBJECT_SELF, "CEP_L_GATEBLOCK"); + location lSelfLoc = GetLocation(OBJECT_SELF); + object oSelf = OBJECT_SELF; + PlayAnimation(ANIMATION_PLACEABLE_CLOSE); + SetLocalObject(oSelf, "GateBlock", CreateObject(OBJECT_TYPE_PLACEABLE, sGateBlock, lSelfLoc)); +} diff --git a/nwnds_module/zep_inc_demi.nss b/nwnds_module/zep_inc_demi.nss new file mode 100644 index 000000000..c0f64cb0d --- /dev/null +++ b/nwnds_module/zep_inc_demi.nss @@ -0,0 +1,883 @@ +//:://///////////////////////////////////////////// +//:: zep_inc_demi +//::////////////////////////////////////////////// +/* + Constants and functions for use with The Krit's + revisions of the CEP adaptation of Demigog's + demilich. +*/ +//::////////////////////////////////////////////// +//:: Created by: The Krit +//:: Created on: May 10, 2007 +//::////////////////////////////////////////////// +//:: Based on scripts by: Loki Hakanin and Demigog +//::////////////////////////////////////////////// + + +#include "colors_inc" +#include "zep_inc_scrptdlg" + + +//------------------------------------------------------------------------------ +// CONSTANTS +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// MODULE SETTINGS + +// The name of a module local integer that holds a number indicating what +// should be done with soul gem victims when a demilich is truly destroyed. +const string ZEP_DEMI_RESS_VICTIMS = "ZEP_DEMILICH_Raise_Victims"; +// There are three possibilities for the content of this variable and +// what happens to the victims: +// 0 means victims become raisable, but are left dead. +// 1 means victims are raised. +// 2 means victims are resurrected to full hit points. + +// The name of a module local string that holds the name of a script to run +// when a demilich is killed. +const string ZEP_DEMI_DEAD_SCRIPT = "ZEP_DEMILICH_OnDeath_Script"; +// Since killing a demilich is not permanent, the standard OnDeath script +// is not called when a demilich dies. Instead, the script whose name is held +// in this local string is run before the demilich retreats into the Pile of +// Bones placeable. +// The functions ZEPDemilichGetVictim() and ZEPDemilichGetVictimParty() might +// be useful in this script. + +// The name of a module local string that holds the name of a script to run +// when a demilich is truly destroyed. +const string ZEP_DEMI_DEST_SCRIPT = "ZEP_DEMILICH_Destroyed_Script"; +// The object running this script will be the bone pile placeable. +// The PC who destroyed the demilich can be retrieved in this script with +// GetLocalObject(OBJECT_SELF, "MyDestroyer"); +// The ResRef of the destroyed demilich can be retrieved in this script with +// GetLocalString(OBJECT_SELF, "ZEP_DEMI_ResRef"); +// Inventory that will be dropped is held by the object retrieved with +// GetLocalObject(OBJECT_SELF, "ZEP_DEMI_Holder"); +// This script will be run before consuming the holy water and running the +// destruction effects. +// The functions ZEPDemilichGetVictim() and ZEPDemilichGetVictimParty() might +// be useful in this script. + +// There are two very fast pseudo-heartbeats used by the demilich routines. +// The delay on these is the following: +const float ZEP_DEMILICH_PSEUDO_DELAY = 6.0; +// This can be overridden for the module (even if this script is in a hak) by +// setting a local variable on the module. If a module variable's name is +// ZEP_DEMILICH_Pseudo_Delay and its type is float, then the contents and that +// variable will override the above. +// NOTES: A smaller delay means less lag when dealing with the soulgem victims, +// but it also means more strain on the server. + +// The number of seconds required for a demilich to regenerate from battle +// can be overridden for a module by storing the custom time as a local +// float named ZEP_DEMILICH_Regen_Time on the module. + + +//------------------------------------------------------------------------------ +// BLUEPRINT SETTINGS + +// The minimum level a caster must be before a demilich will consider the +// caster worthy of being a soulgem victim can be overridden for an +// individual blueprint by storing the custom threshold in a local integer +// named ZEP_DEMI_Power_Threshold on the blueprint. + +// The save DC of the demilich's attempt to trap the souls of casters can be +// overridden for an individual blueprint by storing the custom DC in a local +// integer named ZEP_DEMI_TrapSoul_SaveDC on the blueprint. + + +//------------------------------------------------------------------------------ +// LEGACY SUPPORT + +// If you want to use the older heartbeat-based demilich, add "zep_demi_bone_hb" +// as the OnHeartbeat event of the placeable blueprint zep_demi_skull (Pile of +// Bones), and set the following flag to TRUE. +const int ZEP_DEMI_USE_LEGACY = FALSE; +// IMPORTANT: Do not add a heartbeat event to the blueprint zep_demi_skull0; +// just add it to the blueprint without the '0'. + +// One advantage of using the heartbeat-based demilich is the ability to set +// the placeables' "perception" range. Set that here. +// The demilich's perception range while resting or regenerating, in meters. +// (Setting this higher than 20.0 can be bad.) +const float ZEP_DEMI_PERC_RANGE = 5.0; + + +//------------------------------------------------------------------------------ +// RESTING/REGENERATION + + +// The ResRefs of the skull and dust placeables to be created when the demilich +// goes into resting mode. +const string ZEP_DEMI_SKULL_RESREF = "zep_demi_skull"; // Using this draws out the demilich. +const string ZEP_DEMI_INERT_RESREF = "zep_demi_skull0"; // Using this starts a conversation. +const string ZEP_DEMI_DUST_RESREF = "zep_demi_dust"; + +// The message spoken by a freshly-regenerated demilich. +string ZEP_DEMI_REGEN_MSG = GetStringByStrRef(nZEPDemiRestored); //"At last, I am restored..." +// The message spoken by a demilich responding to intruders. +string ZEP_DEMI_DIST_MSG = GetStringByStrRef(nZEPDemiDisturbed); //"You disturb my work!" + +// The number of seconds required for a demilich to regenerate from battle +// injuries after seemingly being killed. +// Should be at least long enough for a PC to apply Holy Water to the +// demilich's bones. +const float ZEP_DEMILICH_REGEN_TIME = 300.0; +// This can be overridden for a module by storing the custom time as a local +// float named ZEP_DEMILICH_Regen_Time on the module. + +// The tag of the item that is needed to destroy a regenerating demilich. +// (By default, this is the tag of Holy Water, whose blueprint is "zep_holy_water".) +const string ZEP_DEMI_DEST_TAG = "zep_holy_water"; + +// The floating text displayed when a demilich is truly destroyed. +string ZEP_DEMI_FINAL_DEST = GetStringByStrRef(nZEPDemiVictFree); //"With the demilich destroyed, the souls of its victims are released to their bodies." + + +//------------------------------------------------------------------------------ +// SOUL TRAPPING + + +// The maximum number of soulgem victims the demilich will take on at a time +// (a.k.a. the number of soulgems embedded in a demilich). +const int ZEP_DEMI_NUM_SOULGEMS = 8; +// This is not settable via local variables because changing this value in the +// middle of a game could be bad. + +// The minimum level a caster must be before a demilich will consider the +// caster worthy of being a soulgem victim. +const int ZEP_DEMI_POWER_THRESHOLD = 15; +// This can be overridden for an individual blueprint by storing the custom +// threshold in a local integer named ZEP_DEMI_Power_Threshold on the blueprint. + +// The save DC of the demilich's attempt to trap the souls of casters. +const int ZEP_DEMI_TRAPSOUL_SAVEDC = 15; +// This can be overridden for an individual blueprint by storing the custom +// DC in a local integer named ZEP_DEMI_TrapSoul_SaveDC on the blueprint. + +// The message spoken by a demilich who has been hit by a spell from a high +// level caster, just before attempting to capture the caster's soul. +string ZEP_DEMI_ONSPELL_MSG = GetStringByStrRef(nZEPDemiHavePower); //"Yes, I sense you have power...your potential shall be mine!" + +// The combat message sent to a player, as a demilich attempts to capture the +// PC's soul. +// Will be prefixed by the demilich's name. +string ZEP_DEMI_TRAPSOUL_MESSAGE = " attempts Trap the Soul."; + +// The message that floats over a PC as the PC's soul is stolen. +string ZEP_DEMI_TRAPSOUL_FLOATINGTEXT = " has trapped the soul of "; + + +//------------------------------------------------------------------------------ +// LOCAL VARIABLES + +const string ZEP_DEMI_LOCAL_AMBIENT = "ZEP_DEMI_Ambient"; // Eye-candy placeable (dust plume). +const string ZEP_DEMI_LOCAL_RESREF = "ZEP_DEMI_ResRef"; // Blueprint of demilich creature. +const string ZEP_DEMI_LOCAL_SOURCE = "ZEP_DEMI_Source"; // Placeable storing creature info. +const string ZEP_DEMI_LOCAL_HOLDER = "ZEP_DEMI_Holder"; // Inventory storage. +const string ZEP_DEMI_LOCAL_SGCORPSE = "ZEP_DEMI_SG_Corpse_";// The corpse of a soul gem victim. + // Also: the victim stored on the corpse. +const string ZEP_DEMI_LOCAL_HITDICE = "ZEP_DEMI_HitDice"; // The hit dice of the demilich. +const string ZEP_DEMI_LOCAL_PARTY = "ZEP_DEMI_Party"; // A party member of a soul gem victim. + + +//------------------------------------------------------------------------------ +// PROTOTYPES +//------------------------------------------------------------------------------ + +// Moves all items with the droppable flag set from the inventory of oFrom to +// the inventory of oTo. Also moves equipped items. +// (The order of the parameters is comparable to an assignment: oTo = oFrom.) +void MoveDroppableInventory(object oTo, object oFrom); + +// Creates and initializes the objects used to represent a resting or +// regenerating demilich. +// oDemilich is the demilich about to rest or regenerate. +// bWasKilled is TRUE if oDemilich was killed (and needs to regenerate). +void ZEPDemilichSpawnBones(object oDemilich, int bWasKilled); + +// Creates a demilich from its resting or regenerating state. +// oBones is the bone placeable storing demilich data. +// sResRef is the blueprint to use (supports custom demiliches). +// bIntrusion is TRUE if the demilich is responding to an intruder. +object ZEPDemilichFromBones(object oBones, string sResRef, int bIntrusion); + +// Creates an area of effect that will serve to detect any nearby intruders. +// lTarget is where the effect will be centered. +object ZEPDemilichCreateDetector(location lTarget); + +// Restores a regenerating demilich. +// To be run by the bone pile placeable. +// sResRef is the blueprint of the demilich. +// oDust is the associated dust placeable. +// oHolder is the associated inventory holder placeable. +void ZEPDemilichRestore(string sResRef, object oDust, object oHolder); + +// Sees if we want to trap oPC in a soul gem. +// If so, returns the gem number to trap oPC within. +// If not, returns -1. +// To be run by the demilich. +int ZEPDemilichChooseSoulGem(object oPC); + +// Traps the soul of oPC, which kills oPC and prevents resurreaction. +// To be run by the demilich. +// nGem is the number of the gem in which to trap the soul. +void ZEPDemilichTrapSoul(object oPC, int nGem); + +// Frees the soul trapped in a soulgem, allowing the character ro be raised. +// Does nothing if the indicated soulgem does not contain a soul. +// To be run by the demilich or the bone pile placeable. +// nGem is the number of the soulgem. +void ZEPDemilichFreeSoul(int nGem); + +// Restores oPC's raisable status. +// Also raises oPC if ZEP_DEMI_RESS_VICTIMS is set. +// To be run by the cloned corpse. +// fDelay is the delay that will be used when recursing pseudo-heartbeat style. +void ZEPDemilichRaiseVictim(object oPC, float fDelay); + +// Cleans up the result of oPC's soul being stolen. +// Any cutscene-ghost effects are removed. +// If the death effect worked, oPC will be made invisible and untargettable, and +// a pseudo-heartbeat will be started to track if oPC respawned. +// If the death effect failed, the caller is destroyed. +// To be called by the cloned corpse. +void ZEPDemilichCorpseInit(object oPC); + +// Pseudo-heartbeat function that will clean-up if a soul gem victim respawns. +// To be run by the cloned corpse. +// oPC is the real victim. +// fDelay is the delay that will be used when recursing pseudo-heartbeat style. +void ZEPDemilichCorpseCheck(object oPC, float fDelay); + +// Retrieves soul gem victim number nGem. +// Valid values for nGem are 0 through ZEP_DEMI_NUM_SOULGEMS - 1. +// Returns OBJECT_INVALID on error. +// To be called by a demilich or the bone pile placeable (as would be the case +// if called from an OnDeath or Destruction script). +object ZEPDemilichGetVictim(int nGem); + +// Retrieves a party member of soul gem victim number nGem. +// For PC victims, this is a member of the PC's party when the PC was trapped. +// For NPC victims, this is the NPC's master. +// Valid values for nGem are 0 through ZEP_DEMI_NUM_SOULGEMS - 1. +// Returns OBJECT_INVALID on error. +// To be called by a demilich or the bone pile placeable (as would be the case +// if called from an OnDeath or Destruction script). +object ZEPDemilichGetVictimParty(int nGem); + + +//------------------------------------------------------------------------------ +// FUNCTIONS +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// MoveDroppableInventory() +// +// Moves all items with the droppable flag set from the inventory of oFrom to +// the inventory of oTo. Also moves equipped items. +// (The order of the parameters is comparable to an assignment: oTo = oFrom.) +// +void MoveDroppableInventory(object oTo, object oFrom) +{ + // This hangs if oTo is invalid. + if ( !GetIsObjectValid(oTo) ) + return; + + // Loop through oFrom's inventory. + object oItem = GetFirstItemInInventory(oFrom); + while ( oItem != OBJECT_INVALID ) + { + // Check the droppable flag. + if ( GetDroppableFlag(oItem) ) + { + // Move the item. + CopyItem(oItem, oTo, TRUE); + DestroyObject(oItem); + } + // Advance the loop. + oItem = GetNextItemInInventory(oFrom); + } + + // Loop through oFrom's equipment slots. + int nSlot = NUM_INVENTORY_SLOTS; + while ( nSlot-- > 0 ) + { + oItem = GetItemInSlot(nSlot, oFrom); + // Check the droppable flag. + if ( GetDroppableFlag(oItem) ) + { + // Move the item. + CopyItem(oItem, oTo, TRUE); + DestroyObject(oItem); + } + } +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichSpawnBones() +// +// Creates and initializes the objects used to represent a resting or +// regenerating demilich. +// oDemilich is the demilich about to rest or regenerate. +// bWasKilled is TRUE if oDemilich was killed (and needs to regenerate). +// +void ZEPDemilichSpawnBones(object oDemilich, int bWasKilled) +{ + // Get the location where the objects will appear. + location lDemilich = GetLocation(oDemilich); + // Get the blueprint of this demilich. + // (Has to be stored in a variable for when this is an OnDeath event.) + string sDemilich = GetResRef(oDemilich); + + // Create a skull pile and dust plume. + object oDust = CreateObject(OBJECT_TYPE_PLACEABLE, ZEP_DEMI_DUST_RESREF, lDemilich); + object oBones; + if ( bWasKilled ) + oBones = CreateObject(OBJECT_TYPE_PLACEABLE, ZEP_DEMI_INERT_RESREF, lDemilich); + else + oBones = CreateObject(OBJECT_TYPE_PLACEABLE, ZEP_DEMI_SKULL_RESREF, lDemilich); + // Link the dust to the bones. + SetLocalObject(oBones, ZEP_DEMI_LOCAL_AMBIENT, oDust); + // Record the blueprint for this demilich. + SetLocalString(oBones, ZEP_DEMI_LOCAL_RESREF, sDemilich); + // Record the hit dice of this demilich. + SetLocalInt(oBones, ZEP_DEMI_LOCAL_HITDICE, GetHitDice(oDemilich)); + + // Copy the variables recording soulgem victims. + int nGem = ZEP_DEMI_NUM_SOULGEMS; + while ( nGem-- > 0 ) + SetLocalObject(oBones, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem), + GetLocalObject(oDemilich, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem))); + + // See if the demilich is regenerating or merely resting. + if ( bWasKilled ) + { + // Move the droppable inventory into an invisible placeable. + object oHolder = CreateObject(OBJECT_TYPE_PLACEABLE, "x0_plc_corpse", lDemilich); + MoveDroppableInventory(oHolder, oDemilich); + SetUseableFlag(oHolder, FALSE); + SetLocalObject(oBones, ZEP_DEMI_LOCAL_HOLDER, oHolder); + + // Find a suitable delay. + float fDelay = GetLocalFloat(GetModule(), "ZEP_DEMILICH_Regen_Time"); + if ( fDelay == 0.0 ) + fDelay = ZEP_DEMILICH_REGEN_TIME; + // Delay-restore the demilich. + AssignCommand(oBones, DelayCommand(fDelay, ZEPDemilichRestore(sDemilich, oDust, oHolder))); + } + // A resting legacy Demilich needs no additional work at this point. + else if ( !ZEP_DEMI_USE_LEGACY ) + { + // Create an object to detect intruders. + object oDetector = ZEPDemilichCreateDetector(lDemilich); + + // Initialize the detector. + SetLocalObject(oDetector, ZEP_DEMI_LOCAL_SOURCE, oBones); + SetLocalObject(oDetector, ZEP_DEMI_LOCAL_AMBIENT, oDust); + SetLocalString(oDetector, ZEP_DEMI_LOCAL_RESREF, sDemilich); + // Link the detector to the bone pile. + SetLocalObject(oBones, ZEP_DEMI_LOCAL_SOURCE, oDetector); + } +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichFromBones() +// +// Creates a demilich from its resting or regenerating state. +// oBones is the bone placeable storing demilich data. +// sResRef is the blueprint to use. +// bIntrusion is TRUE if the demilich is responding to an intruder. +// +object ZEPDemilichFromBones(object oBones, string sResRef, int bIntrusion) +{ + // Double-check the blueprint. + if ( sResRef == "" ) + // Use the CEP default. + sResRef = "zep_demi_lich"; + + // Create the demilich. + object oDemilich = CreateObject(OBJECT_TYPE_CREATURE, sResRef, GetLocation(oBones)); + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_MIND), oBones); + + // Copy the variables recording soulgem victims. + int nGem = ZEP_DEMI_NUM_SOULGEMS; + while ( nGem-- > 0 ) + SetLocalObject(oDemilich, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem), + GetLocalObject(oBones, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem))); + + // Have the demilich say something appropriate. + string sSayThis = ColorTokenShout(); + if ( bIntrusion ) + sSayThis += ZEP_DEMI_DIST_MSG; + else + sSayThis += ZEP_DEMI_REGEN_MSG; + sSayThis += ColorTokenEnd(); + // A creature apparently will not be heard if told to speak immediately upon + // spawning. On my machine, a quarter-second delay worked well, so a full + // second should be safe, yet still not noticeable by a player. + AssignCommand(oDemilich, DelayCommand(1.0, SpeakString(sSayThis))); + // Add a little audial panache. + AssignCommand(oDemilich, DelayCommand(0.5, PlaySound("c_demilich_bat2"))); + + // Return the newly created demilich. + return oDemilich; +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichCreateDetector() +// +// Creates an area of effect that will serve to detect any nearby intruders. +// lTarget is where the effect will be centered. +// +object ZEPDemilichCreateDetector(location lTarget) +{ + // Create an invisible area of effect to detect intruders. + effect eDetector = EffectAreaOfEffect(AOE_PER_CUSTOM_AOE, "zep_demi_aoe_ent"); + ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eDetector, lTarget); + + // Look for the area of effect object we just created. + object oDetector = GetFirstObjectInShape(SHAPE_CUBE, 0.0, lTarget, FALSE, + OBJECT_TYPE_AREA_OF_EFFECT); + while( GetIsObjectValid(oDetector) ) + { + // Match creator, tag, and not initialized yet. + if( GetAreaOfEffectCreator(oDetector) == OBJECT_SELF && + GetTag(oDetector) == "VFX_CUSTOM" && + GetLocalObject(oDetector, ZEP_DEMI_LOCAL_SOURCE) == OBJECT_INVALID ) + { + // Return this object. + return oDetector; + } + + // Get the next candidate AOE object. + oDetector = GetNextObjectInShape(SHAPE_CUBE, 0.0, lTarget, FALSE, + OBJECT_TYPE_AREA_OF_EFFECT); + } + + // This should never happen, but there still needs to be a default return value. + return OBJECT_INVALID; +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichRestore() +// +// Restores a regenerating demilich. +// To be run by the bone pile placeable. +// sResRef is the blueprint of the demilich. +// oDust is the associated dust placeable. +// oHolder is the associated inventory holder placeable. +// +void ZEPDemilichRestore(string sResRef, object oDust, object oHolder) +{ + // See if the demilich is in the process of being destroyed. + if ( GetLocalInt(OBJECT_SELF, "DESTROYED") ) + // Abort. + return; + + // Spawn the demilich. + ZEPDemilichFromBones(OBJECT_SELF, sResRef, FALSE); + + // Destroy oHolder's inventory. + object oItem = GetFirstItemInInventory(oHolder); + while ( oItem != OBJECT_INVALID ) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(oHolder); + } + + // Destroy the placeables. + DestroyObject(oHolder); + DestroyObject(oDust); + DestroyObject(OBJECT_SELF); +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichChooseSoulGem() +// +// Sees if we want to trap oPC in a soul gem. +// If so, returns the gem number to trap oPC within. +// If not, returns -1. +// To be run by the demilich. +// +int ZEPDemilichChooseSoulGem(object oPC) +{ + // Do not trap myself. + if ( oPC == OBJECT_SELF ) + return -1; + + // Make sure oPC is the right type of creature. + if ( !GetIsPC(oPC) && !GetLocalInt(oPC, "ZEP_DEMILICH_AllowSoulGem") ) + // Do not trap. + return -1; + + // Get the threshold for our attention from the demilich. + int nThreshold = GetLocalInt(OBJECT_SELF, "ZEP_DEMI_Power_Threshold"); + if ( nThreshold == 0 ) + // Use the module default. + nThreshold = ZEP_DEMI_POWER_THRESHOLD; + // See if oPC is not worthy of attention. + if ( GetCasterLevel(oPC) < nThreshold ) + // Do not trap. + return -1; + + // Find the weakest entrapped soul. + int nWeakestGem = -1; + int nWeakestLevel = 99; + int nGem = ZEP_DEMI_NUM_SOULGEMS; + while ( nGem-- > 0 ) + { + // Get the level of the prisoner of this soul gem. + int nLevel = GetHitDice(GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem))); + // Check for an empty gem. + if ( nLevel == 0 ) + // Use this gem. + return nGem; + // Check for a new lowest level. + else if ( nLevel < nWeakestLevel ) + { + // Remember this gem. + nWeakestLevel = nLevel; + nWeakestGem = nGem; + } + } + + // See if we found a prisoner we would give up for oPC. + if ( nWeakestLevel < GetHitDice(oPC) ) + // Use the weakest gem. + return nWeakestGem; + + // At this point, it's not worth the effort. Do not trap. + return -1; +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichTrapSoul() +// +// Traps the soul of oPC, which kills oPC and prevents resurreaction. +// To be run by the demilich. +// nGem is the number of the gem in which to trap the soul. +// +void ZEPDemilichTrapSoul(object oPC, int nGem) +{ + float fDelay = 1.5; + + // If there is an existing prisoner, free it. + ZEPDemilichFreeSoul(nGem); + + // Stop the PC for this effect. (Makes the visual effects look better.) + AssignCommand(oPC, ClearAllActions()); + DelayCommand(0.1, SetCommandable(FALSE, oPC)); + DelayCommand(fDelay, SetCommandable(TRUE, oPC)); + + // Clone oPC in place. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), oPC); + object oClone = CopyObject(oPC, GetLocation(oPC), OBJECT_INVALID, "ZEP_DEMILICH_VICTIM"); + // The clone will become a selectable, but not raisable, corpse. + AssignCommand(oClone, SetIsDestroyable(FALSE, FALSE, TRUE)); + // Record the soon-to-be corpse. + SetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem), oClone); + SetLocalObject(oClone, ZEP_DEMI_LOCAL_SGCORPSE, oPC); + + // Apply a visual effect. + ApplyEffectToObject(DURATION_TYPE_TEMPORARY, + EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND), + oClone, fDelay); + + // Give some feedback. + DelayCommand(fDelay, FloatingTextStringOnCreature( + GetName(OBJECT_SELF) + ZEP_DEMI_TRAPSOUL_FLOATINGTEXT + + GetName(oPC) + "!", oPC)); + + // Kill PC and clone. + effect oDeath = SupernaturalEffect(EffectDeath()); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, oDeath, oClone)); + DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, oDeath, oPC)); + + // Turn processing over to the clone. + // This will either hide oPC so it cannot be targetted by Raise Dead, or + // destroy the clone so there does not appear to be a copy involved. + AssignCommand(oClone, DelayCommand(fDelay + 0.1, ZEPDemilichCorpseInit(oPC))); +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichFreeSoul() +// +// Frees the soul trapped in a soulgem, allowing the character ro be raised. +// Does nothing if the indicated soulgem does not contain a soul. +// To be run by the demilich or the bone pile placeable. +// nGem is the number of the soulgem. +// +void ZEPDemilichFreeSoul(int nGem) +{ + // Retrieve and delete the relevant local variable. + object oCorpse = GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem)); + DeleteLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem)); + + // See if there is a soul currently trapped in the soulgem. + if ( !GetIsObjectValid(oCorpse) ) + // No soul to free, nothing to do. + return; + + // Get the PC whose soul is being released. + object oPC = GetLocalObject(oCorpse, ZEP_DEMI_LOCAL_SGCORPSE); + + // Generate visual effects. + float fVFXDuration = 0.4 + 0.07 * GetDistanceToObject(oCorpse); + // Use an auxiliary placeable so that the visuals can overlap, and because + // faked spells don't fire reliably. + object oVFXMaker = CreateObject(OBJECT_TYPE_PLACEABLE, "x0_plc_bomb", GetLocation(OBJECT_SELF)); + AssignCommand(oVFXMaker, ActionCastSpellAtObject(SPELL_PHANTASMAL_KILLER, oCorpse)); + AssignCommand(oVFXMaker, ActionDoCommand(DestroyObject(oVFXMaker))); + // Visual on the corpse. + AssignCommand(oCorpse, DelayCommand(fVFXDuration, + ApplyEffectToObject(DURATION_TYPE_INSTANT, + EffectVisualEffect(VFX_IMP_RESTORATION_GREATER), + oCorpse))); + // Make the corpse disappear (in case the victim logged out). + AssignCommand(oCorpse, DelayCommand(fVFXDuration + 1.0, + ApplyEffectToObject(DURATION_TYPE_PERMANENT, + EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), + oCorpse))); + + // Get the pseudo-heartbeat delay. + float fDelay = GetLocalFloat(GetModule(), "ZEP_DEMILICH_Pseudo_Delay"); + if ( fDelay == 0.0 ) + // Use the default. + fDelay = ZEP_DEMILICH_PSEUDO_DELAY; + // Restore the PC. + // Delayed to give the visual effect time to execute. + AssignCommand(oCorpse, DelayCommand(fVFXDuration + 0.1, ZEPDemilichRaiseVictim(oPC, fDelay))); +} + + +//------------------------------------------------------------------------------ +// void ZEPDemilichRaiseVictim() +// +// Restores oPC's raisable status. +// Also raises oPC if ZEP_DEMI_RESS_VICTIMS is set. +// To be run by the cloned corpse. +// fDelay is the delay that will be used when recursing pseudo-heartbeat style. +// +void ZEPDemilichRaiseVictim(object oPC, float fDelay) +{ + // See if target is invalid. + if ( !GetIsObjectValid(oPC) ) + { + // Player must have logged out. + // Search again next round. + DelayCommand(fDelay, ZEPDemilichRaiseVictim(oPC, fDelay)); + return; + } + + // Make oPC visible again. + // Loop through active effects. + effect eInvis = GetFirstEffect(oPC); + while ( GetIsEffectValid(eInvis) ) + { + // Check for the cutscene invisibility. + if ( GetEffectCreator(eInvis) == OBJECT_SELF ) + // Remove this effect. + RemoveEffect(oPC, eInvis); + // Update the loop. + eInvis = GetNextEffect(oPC); + } + + // Send a message to oPC to explain the situation. + SendMessageToPC(oPC, GetStringByStrRef(nZEPReturnToLife)); // "You feel disoriented momentarily as your soul returns to its mortal shell." + + // Check the ZEP_DEMI_RESS_VICTIMS flag. + int nResVictims = GetLocalInt(GetModule(), ZEP_DEMI_RESS_VICTIMS); + if ( nResVictims > 0 ) + { + // Raise the vicitm. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPC); + // Check for full resurrection. + if ( nResVictims > 1 ) + // Heal the victim to full hit points. + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPC)), oPC); + } + // This corpse is no longer needed. + SetIsDestroyable(TRUE, FALSE, FALSE); + DestroyObject(OBJECT_SELF); +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichCorpseInit() +// +// Cleans up the result of oPC's soul being stolen. +// Any cutscene-ghost effects are removed. +// If the death effect worked, oPC will be made invisible and untargettable, and +// a pseudo-heartbeat will be started to track if oPC respawned. +// If the death effect failed, the caller is destroyed. +// To be called by the cloned corpse. +// +void ZEPDemilichCorpseInit(object oPC) +{ + // Make the corpse cutscene-ghosted. (Not sure if this helps, but it might.) + ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectCutsceneGhost(), OBJECT_SELF); + + // Loop through active effects on oPC. + effect eGhost = GetFirstEffect(oPC); + while ( GetIsEffectValid(eGhost) ) + { + // Look for cutscene-ghost effects. + if ( GetEffectType(eGhost) == EFFECT_TYPE_CUTSCENEGHOST ) + // Remove cutscene-ghost. + RemoveEffect(oPC, eGhost); + eGhost = GetNextEffect(oPC); + } + + if ( GetIsDead(oPC) ) + { + // Hide oPC with cutscene invisibility. + // Effect is extraordinary so that it cannot be dispelled, but can be gotten + // rid of by the PC (by resting) if something goes wrong with the removal scripts. + ApplyEffectToObject(DURATION_TYPE_PERMANENT, + ExtraordinaryEffect(EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY)), + oPC); + + // Prevent party members from targetting the character's portrait. + if ( GetIsPC(oPC) ) + { + // First, find a party member who is not oPC, if any. + object oParty = GetFirstFactionMember(oPC); + if ( oParty == oPC ) + oParty = GetNextFactionMember(oPC); + // Keep a record of oPC's party in case the module wants it later. + SetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_PARTY, oParty); + // Now remove oPC from the party so others can't target the portrait. + RemoveFromParty(oPC); + } + else + { + // See if oPC has a master. + object oMaster = GetMaster(oPC); + if ( oMaster != OBJECT_INVALID ) + { + // Keep a record of oPC's master in case the module wants it later. + SetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_PARTY, oMaster); + // Now remove oPC from the party so others can't target the portrait. + // NOTE: This function is called a split second after the death + // effect is applied, so any module-specific code will have a chance + // to run before this line fires the henchman. + RemoveHenchman(GetMaster(oPC), oPC); + } + } + } + + // This clone corpse should not drop any items. + // Clear out inventory. + object oItem = GetFirstItemInInventory(); + while ( oItem != OBJECT_INVALID ) + { + DestroyObject(oItem); + oItem = GetNextItemInInventory(); + } + // Flag equipped items as undroppable. + int nSlot = NUM_INVENTORY_SLOTS; + while ( nSlot-- > 0 ) + SetDroppableFlag(GetItemInSlot(nSlot), FALSE); + // Remove gold. + TakeGoldFromCreature(GetGold(), OBJECT_SELF, TRUE); + + // Get the pseudo-heartbeat delay. + float fDelay = GetLocalFloat(GetModule(), "ZEP_DEMILICH_Pseudo_Delay"); + if ( fDelay == 0.0 ) + // Use the default. + fDelay = ZEP_DEMILICH_PSEUDO_DELAY; + // Start a pseudo-heartbeat that will destroy the caller when oPC is alive. + ZEPDemilichCorpseCheck(oPC, fDelay); +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichCorpseCheck() +// +// Pseudo-heartbeat function that will clean-up if a soul gem victim respawns. +// To be run by the cloned corpse. +// oPC is the real victim. +// fDelay is the delay that will be used when recursing pseudo-heartbeat style. +// +void ZEPDemilichCorpseCheck(object oPC, float fDelay) +{ + // See if oPC is still dead (or logged off). + if ( GetIsDead(oPC) || !GetIsObjectValid(oPC) ) + // Recurse the pseudo-heartbeat. + DelayCommand(fDelay, ZEPDemilichCorpseCheck(oPC, fDelay)); + else + { + // oPC is alive! Hooray! + // Since oPC was made cutscene-invisible, this can only happen via + // respawning, DM intervention, or release from the demilich. + + // Make oPC visible again. + // Loop through active effects. + effect eInvis = GetFirstEffect(oPC); + while ( GetIsEffectValid(eInvis) ) + { + // Check for the cutscene invisibility. + if ( GetEffectCreator(eInvis) == OBJECT_SELF ) + // Remove this effect. + RemoveEffect(oPC, eInvis); + // Update the loop. + eInvis = GetNextEffect(oPC); + } + + // This corpse is no longer needed. + SetIsDestroyable(TRUE, FALSE, FALSE); + DestroyObject(OBJECT_SELF); + } +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichGetVictim() +// +// Retrieves soul gem victim number nGem. +// +// Valid values for nGem are 0 through ZEP_DEMI_NUM_SOULGEMS - 1. +// Returns OBJECT_INVALID on error. +// +// To be called by a demilich or the bone pile placeable (as would be the case +// if called from an OnDeath or Destruction script). +// +object ZEPDemilichGetVictim(int nGem) +{ + return GetLocalObject( + GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem)), + ZEP_DEMI_LOCAL_PARTY); +} + + +//------------------------------------------------------------------------------ +// ZEPDemilichGetVictimParty() +// +// Retrieves a party member of soul gem victim number nGem. +// For PC victims, this is a member of the PC's party when the PC was trapped. +// For NPC victims, this is the NPC's master. +// +// Valid values for nGem are 0 through ZEP_DEMI_NUM_SOULGEMS - 1. +// Returns OBJECT_INVALID on error. +// +// To be called by a demilich or the bone pile placeable (as would be the case +// if called from an OnDeath or Destruction script). +// +object ZEPDemilichGetVictimParty(int nGem) +{ + return GetLocalObject( + GetLocalObject(OBJECT_SELF, ZEP_DEMI_LOCAL_SGCORPSE + IntToString(nGem)), + ZEP_DEMI_LOCAL_SGCORPSE); +} + diff --git a/nwnds_module/zep_inc_main.nss b/nwnds_module/zep_inc_main.nss new file mode 100644 index 000000000..5255a005d --- /dev/null +++ b/nwnds_module/zep_inc_main.nss @@ -0,0 +1,133 @@ +#include "zep_inc_scrptdlg" + +const int ITEM_PROPERTY_USE_LIMITATION_GENDER = 150; + +//Baseitem: New Weapon Types +const int BASE_ITEM_TRIDENT_1H = 300; +const int BASE_ITEM_HEAVYPICK = 301; +const int BASE_ITEM_LIGHTPICK = 302; +const int BASE_ITEM_SAI = 303; +const int BASE_ITEM_NUNCHAKU = 304; +const int BASE_ITEM_FALCHION1 = 305; +const int BASE_ITEM_SAP = 308; +const int BASE_ITEM_DAGGERASSASSIN = 309; +const int BASE_ITEM_KATAR = 310; +const int BASE_ITEM_LIGHTMACE2 = 312; +const int BASE_ITEM_KUKRI2 = 313; +const int BASE_ITEM_FALCHION2 = 316; +const int BASE_ITEM_HEAVYMACE = 317; +const int BASE_ITEM_MAUL = 318; +const int BASE_ITEM_MERCURIALLONGSWORD = 319; +const int BASE_ITEM_MERCURIALGREATSWORD = 320; +const int BASE_ITEM_DOUBLESCIMITAR = 321; +const int BASE_ITEM_GOAD = 322; +const int BASE_ITEM_WINDFIREWHEEL = 323; + + +int ColorInit(string sLightConst); + +int ColorInit(string sLightConst) +{ + int nLight = VFX_DUR_LIGHT;//if sLight remains uninitialized, + //this causes no light effect to be placed rather than the humming, + //blue/white flashing effect that occurs when the VFX constant is set to 0 + string sLeft = GetStringLeft(sLightConst, 2); + string sRight = GetStringRight(sLightConst, 2); + //this converts the name of the light constant in the string CEP_L_LIGHTCONST + //to an integer which can be used by the engine. + if(sLeft == "BL"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_BLUE_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_BLUE_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_BLUE_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_BLUE_20; + } + if(sLeft == "GR"){//note: grey lighting is actually green, go figure + if(sRight == "_5") nLight = VFX_DUR_LIGHT_GREY_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_GREY_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_GREY_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_GREY_20; + } + if(sLeft == "OR"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_ORANGE_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_ORANGE_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_ORANGE_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_ORANGE_20; + } + if(sLeft == "PU"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_PURPLE_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_PURPLE_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_PURPLE_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_PURPLE_20; + } + if(sLeft == "RE"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_RED_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_RED_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_RED_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_RED_20; + } + if(sLeft == "WH"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_WHITE_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_WHITE_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_WHITE_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_WHITE_20; + } + if(sLeft == "YE"){ + if(sRight == "_5") nLight = VFX_DUR_LIGHT_YELLOW_5; + if(sRight == "10") nLight = VFX_DUR_LIGHT_YELLOW_10; + if(sRight == "15") nLight = VFX_DUR_LIGHT_YELLOW_15; + if(sRight == "20") nLight = VFX_DUR_LIGHT_YELLOW_20; + } + return nLight; +} + +//Function will check if oPC is the correct gender +//to equip oItem. If not, it will force the player +//to unequip the item and inform them of the reason. +void ZEPGenderRestrict(object oItem, object oPC); + +void ZEPGenderRestrict(object oItem, object oPC) +{ +// --------------------------------------------------- + // CEP Gender restriction property script + // Searches the item just equipped for a gender + // restriction property. If it finds it, it will + // check the PC's gender against the appropriate value + // and de-equip the item if they are found not to + // match. + // --------------------------------------------------- + //First we check if this has the item property: Use Limitation: Gender. + //If so, we enter the if statment and check PC gender + //vs. the item's limitation. Else we continue out of the + //function. + if (GetItemHasItemProperty(oItem,ITEM_PROPERTY_USE_LIMITATION_GENDER)) + { + itemproperty ipGenderProperty=GetFirstItemProperty(oItem); + //We're not sure if the above property is the one + //we want, so we'll check it vs. the Gender property, + //and, if it's not it, loop through until we find it. + while ((GetIsItemPropertyValid(ipGenderProperty))&&(GetItemPropertyType(ipGenderProperty)!=ITEM_PROPERTY_USE_LIMITATION_GENDER)) + { + ipGenderProperty=GetNextItemProperty(oItem); + } + //If, after all that, the property is invalid for + //some reason, we return. Else we now have a property + //with the data of the Gender restriction of teh PC's + //item. + if (!GetIsItemPropertyValid(ipGenderProperty)) return; + //Next line is kind of long and wonky looking, but bear + //with me as I'm doing this to cut out variables. + //We're comparing the item property parameter value (gender + //type) vs. the PCs. Theoretically they use the same + //scale... + //If they are not the same, we de-euip the item + if (GetItemPropertySubType(ipGenderProperty)!=GetGender(oPC)) + { + //Not equal, so take it off! + AssignCommand(oPC,ActionUnequipItem(oItem)); + //Tell PC why. + string sMessageToPC= GetStringByStrRef(nZEPGenderRestTXT,GENDER_MALE); + SendMessageToPC(oPC,sMessageToPC); + } + } +} + diff --git a/nwnds_module/zep_inc_scrptdlg.nss b/nwnds_module/zep_inc_scrptdlg.nss new file mode 100644 index 000000000..de59ec937 --- /dev/null +++ b/nwnds_module/zep_inc_scrptdlg.nss @@ -0,0 +1,51 @@ +//File name: zep_inc_scrptdlg +//Author: Loki Hakanin +//Usage/Explanation: +// This include file is intended for use with the NWN CEP. +// This is an index of the cep.tlk file dialogue TLK file +// offsets for the various strings of text that are +// sent to the player, DMs, etc, during the execution +// of various CEP scripts. + +//const int nZEPScriptTLKOffset = 16818216; +//Traps +const int nZEPPitJump = (16818226); //df_t0_camopita.nss: SendMessageToPC(oPC,"You jump to the side and =avoid falling into the pit"); +const int nZEPPitFall = (16818227); //df_t0_camopita.nss: SendMessageToPC(oPC,"You fall into the =pit!"); +const int nZEPPitClimb = (16818228); //df_t0_camopita.nss: DelayCommand(30.0,SendMessageToPC(oPC,"You finally climb out of the =pit")); +const int nZEPDrowning = (16818231); //trap_fire.nss: AssignCommand(oPC,SpeakString("Blub! =Glug!")); +const int nZEPTrapFind = (16818234); //trap_on_acquire.nss: SendMessageToPC(oPC,"Nearest Trap: ="+GetName(GetNearestTrapToObject(oPC))); +const int nZEPTrapSearch1 = (16818235); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap)); +const int nZEPTrapSearch2= (16818236); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap)); +const int nZEPTrapSearch3 = (16818237); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap)); +const int nZEPTrapReset = (16818238); //trap_reset.nss: SendMessageToPC(oPC,"The lever clicks into its new =postion"); + +//Item Properties +const int nZEPGenderRestTXT = (16818246); //zep_inc_main.nss: SendMessageToPC(oPC,"You cannot equip that =item due to gender differences."); + +//Doors +const int nZEPDoorLocked = (16818256); //zep_openclose.nss: SpeakString("Locked"); + +//Demilich Scripts +const int nZEPReturnToLife = (16818266); //zep_demi_dest.nss: SendMessageToPC(oVictimCounter,"You feel =disoriented momentarily as your soul returns to its mortal coil."); +const int nZEPCacklingLaugh = (16818267); //zep_demi_onspell.nss: =DelayCommand(6.0,SpeakString("Hahhahaha....",TALKVOLUME_SHOUT)); +const int nZEPCantBeRaised = (16818268); //zep_inc_demi.nss:const string ZEP_DEMI_RESLAY_MSG =3D " jerks upright =and spasms for a few moments before collapsing again."; +const int nZEPNoRaiseExplan = (16818269); //zep_inc_demi.nss:const string ZEP_DEMI_RESLAY_MSG2 =3D "Until the =demilich's captive souls are freed, its victims cannot be raised."; +const int nZEPDemiRestored = (16818270); //zep_inc_demi.nss:const string ZEP_DEMI_REGEN_MSG =3D "At last, I am =restored..."; +const int nZEPDemiDisturbed = (16818271); //zep_inc_demi.nss:const string ZEP_DEMI_DIST_MSG =3D "You disturb my =work!"; +const int nZEPDemiHavePower = (16818272); //zep_inc_demi.nss:const string ZEP_DEMI_ONSPELL_MSG =3D "Yes, I sense you =have power...your potential shall be mine!"; +const int nZEPDemiVictFree = (16818273); //zep_inc_demi.nss:const string ZEP_DEMI_FINAL_DEST =3D "With the demilich =destroyed, the souls of its victims are released to their bodies."; + +//Marilith Scripts +const int nZEPMarilithDMG = (16818286); //zep_marilith_end.nss: SendMessageToPC(oTarget, "You were hit for ="+IntToString(nDamage)); + +//Rust monster scripts +const int nZEPRustMonBrush = (16818296); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"The Rust Monster's =antennae brush against your "+sItem ); +const int nZEPRustButResist1 = (16818297); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"But the "+sItem+" =resists the rust effects!"); +const int nZEPRustButResist2 = (16818298); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"But the "+sItem+" =resists the rust effects!"); +const int nZEPRustAndDest = (16818299); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"And destroys your ="+sItem+"!"); +const int nZEPRustYourTXT = (16818300); //zep_rust_dmg.nss: "Your " +const int nZEPRustWeapRes = (16818301); //zep_rust_dmg.nss: SendMessageToPC(oPC,"Your "+sWeapon+" =resists the rust effects."); +const int nZEPRustWeapDest = (16818302); //zep_rust_dmg.nss: SendMessageToPC(oPC,"Your "+sWeapon+" =damages the monster, but is destroyed in the process!"); + +const int nZEPFoundSecret = (16818316); //zep_sarcof1use.nss: "You have discovered a secret passage!" + diff --git a/nwnds_module/zep_onoff.ncs b/nwnds_module/zep_onoff.ncs new file mode 100644 index 000000000..5af971ac9 Binary files /dev/null and b/nwnds_module/zep_onoff.ncs differ diff --git a/nwnds_module/zep_onoff.nss b/nwnds_module/zep_onoff.nss new file mode 100644 index 000000000..e837d7fe4 --- /dev/null +++ b/nwnds_module/zep_onoff.nss @@ -0,0 +1,54 @@ +//:://///////////////////////////////////////////// +//:: ZEP_ONOFF.nss +//:: Copyright (c) 2001 Bioware Corp. +//:: Modified by Dan Heidel 1/14/04 for CEP +//::////////////////////////////////////////////// +/* + Turns the placeable object's animation on/off + + Since the activation state for a placeable cannot + be querried, this state must be stored in the + local int CEP_L_AMION. If the placeable is + activated by default, CEP_L_AMION must be 1. If the + placeable is deactivated by default, CEP_L_AMION must + be set to 0 or else incorrect behavior will result. + All CEP placeables have local variables set properly. + + Also, for musical instruments, etc, sounds will be + played if specified. + CEP_L_SOUND1 is the name of the WAV file to play + when the placeable is activated. + CEP_L_SOUND2 is the name of the WAV file to play + when the placeable is deactivated. + If either of these is not defined, no sound will + be played for that anim. + By default, all CEP placeables that have sounds + attached to them already have local variables + defined for them. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: January 2002 +//::////////////////////////////////////////////// + + +void main() +{ + string sSound1 = GetLocalString(OBJECT_SELF, "CEP_L_SOUND1"); + string sSound2 = GetLocalString(OBJECT_SELF, "CEP_L_SOUND2"); + if (GetLocalInt(OBJECT_SELF,"CEP_L_AMION") == 0) + { + object oSelf = OBJECT_SELF; + PlaySound(sSound1); + DelayCommand(0.1, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE)); + SetLocalInt(OBJECT_SELF,"CEP_L_AMION",1); + } + else + { + object oSelf = OBJECT_SELF; + PlaySound(sSound2); + DelayCommand(0.1, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); + SetLocalInt(OBJECT_SELF,"CEP_L_AMION",0); + } +} diff --git a/nwnds_module/zep_openclose.ncs b/nwnds_module/zep_openclose.ncs new file mode 100644 index 000000000..daa5cd3af Binary files /dev/null and b/nwnds_module/zep_openclose.ncs differ diff --git a/nwnds_module/zep_openclose.nss b/nwnds_module/zep_openclose.nss new file mode 100644 index 000000000..28ca97452 --- /dev/null +++ b/nwnds_module/zep_openclose.nss @@ -0,0 +1,94 @@ +//:://///////////////////////////////////////////// +//:: ZEP_OPENCLOSE.nss +//:: Copyright (c) 2001 Bioware Corp. +//:: Modified by Dan Heidel 1/14/04 for CEP +//::////////////////////////////////////////////// +/* + This function goes in the OnUse function of an + openable placeable or door. Do not use for + placeables which have an inventory, only for those + where clicking should trigger the open/close anim + without opening up an inventory. Eg: sarcophagii, + grandfather clock and iron maiden. If you wish for + these items to have an inventory make a copy of the + placeable with this function removed and the 'has + inventory' box checked. + + No local variables are needed if the placeable is + not a door. + + If the placeable is a door, CEP_L_GATEBLOCK is a + local string containing the blueprint resref of the + gateblock corresponding to the particular door. + + A gateblock is an invisible placeable with a walkmesh + of the size, shape and orientation of the door. In + the case of CEP Door 01-11, there is a corresponding + Gateblock 01-11. Therefore, for Door01, the CEP_L_GATEBLOCK + should be gateblock001 - the resref for Gateblock 01. + + When the door is closed, a gateblock placeable is created + so that the door is impassable. When the door is opened, + the gateblock is destroyed so the gate is passable. + + GateBlock is a local object that stores the gateblock + being used by a particular door. No user intervention is + needed other than to not create a local variable with the same + name. + + In addition, zep_doorspawn must be placed in the heartbeat + function of the door and zep_doorkill must be placed in the + OnDestruct function of the door. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: January 2002 +//:: Modified by: Dan Heidel 1-21-04 for CEP +//::////////////////////////////////////////////// + +#include "zep_inc_scrptdlg" + +void main() +{ + string sGateBlock = GetLocalString(OBJECT_SELF, "CEP_L_GATEBLOCK"); + location lSelfLoc = GetLocation(OBJECT_SELF); + int nIsOpen = GetIsOpen(OBJECT_SELF); + + if (GetLocked(OBJECT_SELF) == 1){ + //FloatingTextStringOnCreature("Locked", OBJECT_SELF); + string sLockedMSG = GetStringByStrRef(nZEPDoorLocked,GENDER_MALE); + SpeakString(sLockedMSG); + return; + } + //if the object is locked, it cannot be opened or closed + + if (sGateBlock == ""){ // if the item is not a door + if (nIsOpen == 0) + { + PlayAnimation(ANIMATION_PLACEABLE_OPEN); + } + else + { + PlayAnimation(ANIMATION_PLACEABLE_CLOSE); + } + return; + } + + if (nIsOpen == 0) //if the item is a door + { + object oSelf = OBJECT_SELF; + PlayAnimation(ANIMATION_PLACEABLE_OPEN); + if (GetLocalObject(oSelf, "GateBlock")!= OBJECT_INVALID) + { + DestroyObject(GetLocalObject(oSelf, "GateBlock")); + SetLocalObject(oSelf, "GateBlock", OBJECT_INVALID); + } + } + else + { + object oSelf = OBJECT_SELF; + PlayAnimation(ANIMATION_PLACEABLE_CLOSE); + SetLocalObject(oSelf, "GateBlock", CreateObject(OBJECT_TYPE_PLACEABLE, sGateBlock, lSelfLoc)); + } +} diff --git a/nwnds_module/zep_sala.utc b/nwnds_module/zep_sala.utc new file mode 100644 index 000000000..e1f6f772c Binary files /dev/null and b/nwnds_module/zep_sala.utc differ diff --git a/nwnds_module/zep_stocksuse.ncs b/nwnds_module/zep_stocksuse.ncs new file mode 100644 index 000000000..70c540cff Binary files /dev/null and b/nwnds_module/zep_stocksuse.ncs differ diff --git a/nwnds_module/zep_stocksuse.nss b/nwnds_module/zep_stocksuse.nss new file mode 100644 index 000000000..4278a4fe0 --- /dev/null +++ b/nwnds_module/zep_stocksuse.nss @@ -0,0 +1,58 @@ +//::////////////////////////////////////////////// +//:: Created By: John Hawkins +//:: Created On: January 2004 +//::////////////////////////////////////////////// +//:: +//:: this script will make my placeable prisoners +//:: react to you and talk to you if desired. +//:: +//:: to converse with the placeable, you need to +//:: put the name of the conversation you wish to +//:: have inside the quotation marks ("") down in +//:: line 57. +//:: +//::////////////////////////////////////////////// + +void main() +{ + object oUser = GetLastUsedBy(); + int iRnd = d6(); + string sSound = IntToString(iRnd); + if (GetLocalInt(OBJECT_SELF,"disturbed") == 0) + { + object oSelf = OBJECT_SELF; + PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); + SetLocalInt(OBJECT_SELF,"disturbed",1); + } + else + { + object oSelf = OBJECT_SELF; + PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE); + SetLocalInt(OBJECT_SELF,"disturbed",0); + } + if(iRnd==1) + { + AssignCommand(oUser,PlaySound("as_pl_ailingm1")); + } + if(iRnd==2) + { + AssignCommand(oUser,PlaySound("as_pl_despairm1")); + } + if(iRnd==3) + { + AssignCommand(oUser,PlaySound("as_pl_despairm2")); + } + if(iRnd==4) + { + AssignCommand(oUser,PlaySound("as_pl_cryingm1")); + } + if(iRnd==5) + { + AssignCommand(oUser,PlaySound("as_pl_despairm1")); + } + if(iRnd==6) + { + AssignCommand(oUser,PlaySound("as_pl_despairm2")); + } + //AssignCommand(OBJECT_SELF,ActionStartConversation(oUser,"",FALSE,FALSE)); +} diff --git a/nwnds_module/zep_torch.ncs b/nwnds_module/zep_torch.ncs new file mode 100644 index 000000000..fd5992c4c Binary files /dev/null and b/nwnds_module/zep_torch.ncs differ diff --git a/nwnds_module/zep_torch.nss b/nwnds_module/zep_torch.nss new file mode 100644 index 000000000..d4cf4b037 --- /dev/null +++ b/nwnds_module/zep_torch.nss @@ -0,0 +1,63 @@ +//:://///////////////////////////////////////////// +//:: ZEP_TORCH.nss +//:: Copyright (c) 2001 Bioware Corp. +//:: Modified by Dan Heidel 1/21/04 for CEP +//::////////////////////////////////////////////// +/* + Turns the placeable object's animation on/off + for the activation of torches, candles and othe light sources. + It works by deleting the calling object and replacing it with its + lit/unlit counterpart. Although this function ignores the value of + CEP_L_LIGHTCYCLE, if that localint is set to 1, the placeable will + revert back to its normal lit/unlit day/night cycle state on the + next heartbeat. To properly turn off a cycling light-source placeable, + CEP_L_LIGHTCYCLE must be set to 0. + + Works as zep_onoff except that no sounds are called and a + lighting effect is called on the placeable instead. The + light type is stored in a local int CEP_L_LIGHT. CEP_L_LIGHT is + defined in zep_torchspawn from a table of constants - eg: + VFX_DUR_LIGHT_YELLOW_20. CEP_L_LIGHTCONST is a local string defined + on the placeable which is used to set CEP_L_LIGHTCONST to the proper value. + Place the name of the constant in this local string so that + zep_torchspawn to operate correctly. + +*/ +//::////////////////////////////////////////////// +//:: Created By: Brent +//:: Created On: January 2002 +//::////////////////////////////////////////////// + +#include "zep_inc_main" + + +void main() +{ + location lLoc = GetLocation(OBJECT_SELF); + string sResRef = GetResRef(OBJECT_SELF); + int nAmIOn = GetLocalInt(OBJECT_SELF, "CEP_L_AMION"); + int nLightCycle = GetLocalInt(OBJECT_SELF, "CEP_L_LIGHTCYCLE"); + int nInitialized = GetLocalInt(OBJECT_SELF, "CEP_L_LIGHTINITIALIZED"); + int nLightDiurnal = GetIsNight(); + string sLightConst = GetLocalString(OBJECT_SELF, "CEP_L_LIGHTCONST"); + string sLightSwap = GetLocalString(OBJECT_SELF, "CEP_L_LIGHTSWAP"); + int nLight = ColorInit(sLightConst); + + if(nAmIOn == 1){nAmIOn = 0;} + else {nAmIOn = 1;} + + object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sLightSwap, lLoc); + SetLocalInt(oNew, "CEP_L_AMION", nAmIOn); + SetLocalInt(oNew, "CEP_L_LIGHTCYCLE", nLightCycle); + SetLocalInt(oNew, "CEP_L_LIGHTINITIALIZED", nInitialized); + SetLocalInt(oNew, "CEP_L_LIGHTDIURNAL", nLightDiurnal); + SetLocalString(oNew, "CEP_L_LIGHTCONST", sLightConst); + SetLocalString(oNew, "CEP_L_LIGHTSWAP", sResRef); + + if (nAmIOn == 1) + { + effect eLight = EffectVisualEffect(nLight); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oNew); + } + DestroyObject(OBJECT_SELF, 0.0); +} diff --git a/nwnds_module/zep_torchspawn.ncs b/nwnds_module/zep_torchspawn.ncs new file mode 100644 index 000000000..65e0eb46e Binary files /dev/null and b/nwnds_module/zep_torchspawn.ncs differ diff --git a/nwnds_module/zep_torchspawn.nss b/nwnds_module/zep_torchspawn.nss new file mode 100644 index 000000000..38c9971a3 --- /dev/null +++ b/nwnds_module/zep_torchspawn.nss @@ -0,0 +1,159 @@ +//:://///////////////////////////////////////////// +//:: ZEP_TORCHSPAWN.nss +//:: Created by by Dan Heidel 1/21/04 for CEP +//::////////////////////////////////////////////// +/* + This function is called on heartbeat and designed to exert minimal + drag on the system except during module load. This function is used + to initialize light-emitting placeables. Since there is no OnSpawn + event handler for placeables, the OnHeartbeat handler is used instead. + As long as the total number of lighting placeables is kept to a reasonable + number, the CPU impact will be minimal. + + This is used to initialize a light-emitting placeable and to update certain + placeable behaviors if certain conditions are met. + + The following local variables are used on light-emitting placeables: + + CEP_L_AMION: this is a localint that holds the present on-off state of the + placeable. If the placeable is to be switched on or off, please use the + zep_torch or zep_torchupdate functions. DO NOT CHANGE THIS VARIABLE MANUALLY. + Doing so will cause the light-emitting placeable to stop functioning + properly if done improperly. + + CEP_L_LIGHTCYCLE: this is a localint that determines whether the light- + -emitting placeable will automatically switch itself on and off to match the + day/night cycle. If it is set to 1, the placeable will shut off during the + day. If set to 0, the placeable does not change state unless zep_torch or + zep_torchupdate are used to change it. + Also note that cycling placeables update on every heartbeat. This means + that if a cycling light-emitter is turned off at night, it will switch back + on on the next heartbeat. + + CEP_L_LIGHTCONST: this localstring holds the name of the lighting constant + used to put a colored light on a lit light-emitting placeable. For example, + if a torch is supposed to emit a 20 foot diameter yellow light, CEP_L_LIGHTCONST + should contain "YELLOW_20". The function ColorInit in the zep_inc_main + library converts this string into a number which can be used by the game + engine. + The following colors and light radii are available: + White, Yellow, Orange, Red, Green, Blue and Purple (note that Green actually + calls a GREY lighting effect which is green for some inscrutible reason) + 5, 10, 15, 20 are the available radii. Note that some light colors are + brighter than others. Consult the CEP Builder's guide for more information. + + Note: the ColorInit function only looks at the first two and last two + characters of the string so YELLOW_5 could be called by YE_5 and RED_20 + with RE20 but for readability, the user is encouraged to use the full names. + Note: changing this string only causes the lighting color to change when a + a cycling light-emitter switches states, a light-emitter is switched on or + off with zep_torch or when a zep_torchupdate is called on a light-emitter. + + CEP_L_LIGHTSWAP: this localstring holds the resref of its counterpart + light-emitter. For example, a lit wooden lantern's CEP_L_LIGHTSWAP + contains "owoodlantern001" and an unlit wood lantern's CEP_L_LIGHTSWAP + contains "woodlantern001". This variable provides a handle so that the + lit/unlit light-emitter placeable can be swapped for its counterpart + when the placeable "switches" on or off. NEVER CHANGE THIS VARIABLE. + + CEP_L_LIGHTINITIALIZED: this localint is 0 if the placeable hasn't been initialized + yet, 1 if it has. This localint is defined at runtime. NEVER CHANGE THIS VARIABLE. + + CEP_L_LIGHTDIURNAL: this localint holds the last checked value of GetIsNight() + for use by cycling torches. Defined at runtime. DO NOT CHANGE. + +************************************************** + + Due to various limitations in the Aurora NWN graphics engine, the switching + of light-emitting placeables is done by deleting the placeable and putting + it's lit/unlit counterpart at the same position. + + Use zep_torch on a light-emitting placeable to switch it on or off.It is best + to call zep_torch from another object or script since even if the torch is made + usable, it will be replaced with a non-usable version when the on/off switch occurs. + + If the color of a light-emitting placeable is changed and the change is to + be reflected in game, a zep_torchupdate must be used on the placeable. + + As provided, the light-emitting placeables provided in CEP should work with + little to no builder intervention. The local variables are all set. Simply + place a lit or unlit placeable and it will take care of itself. + + All light-emitting placeables in the Civilization Exterior/Lighting category + are day/night cycling by default, the rest are non-cycling. Change the value + of CEP_L_LIGHTCYCLE in the variables on your placed placeable if you wish to + change this. + + Likewise, the color and radius of the emitted light can be changed on placeables + placed down in the toolset. + +*/ + +#include "zep_inc_main" + + +void main() +{ + int nLightCycle = GetLocalInt(OBJECT_SELF, "CEP_L_LIGHTCYCLE"); + int nInitialized = GetLocalInt(OBJECT_SELF, "CEP_L_LIGHTINITIALIZED"); + //0 if the first time this function has run for this torch, 1 if it has run before + //used so that non-cycling placeables use less CPU time. + if (nInitialized == 1 & nLightCycle == 0) return; //if torch is non cycling and has been initialized, quit + + int nAmIOn = GetLocalInt(OBJECT_SELF, "CEP_L_AMION"); + string sLightConst = GetLocalString(OBJECT_SELF, "CEP_L_LIGHTCONST"); + string sLightSwap = GetLocalString(OBJECT_SELF, "CEP_L_LIGHTSWAP"); + int nLight = ColorInit(sLightConst); + + if (nInitialized == 0){ + SetLocalInt(OBJECT_SELF, "CEP_L_LIGHTINITIALIZED", 1); + SetLocalInt(OBJECT_SELF, "CEP_L_LIGHTDIURNAL", !GetIsNight()); + } //if the placeable wasn't marked as initialized, it is now. + + int nLightDiurnal = GetLocalInt(OBJECT_SELF, "CEP_L_LIGHTDIURNAL"); + SetLocalInt(OBJECT_SELF, "CEP_L_LIGHTDIURNAL", GetIsNight()); + //this gets the GetIsNight value from the last time zep_torchspawn fired + //it is used to check to see if the torch needs to change state for day/night cycle + + if(nLightCycle == 1){ //if this is a cycling placeable + if(GetIsNight() == nLightDiurnal) return; + //if day/night hasn't changed since last time, return. + + if((GetIsNight() == 0)&(nAmIOn == 0)) return; + if((GetIsNight() == 1)&(nAmIOn == 1)) return; + //if the on/off state matches what it should be, return. + + //otherwise, destroy the placeable and place its lit/unlit counterpart at the same location + if(nAmIOn == 1){nAmIOn = 0;} + else {nAmIOn = 1;} + + string sResRef = GetResRef(OBJECT_SELF); + location lLoc = GetLocation(OBJECT_SELF); + + object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sLightSwap, lLoc); + SetLocalInt(oNew, "CEP_L_AMION", nAmIOn); + SetLocalInt(oNew, "CEP_L_LIGHTCYCLE", nLightCycle); + SetLocalInt(oNew, "CEP_L_LIGHTINITIALIZED", nInitialized); + SetLocalInt(oNew, "CEP_L_LIGHTDIURNAL", GetIsNight()); + SetLocalString(oNew, "CEP_L_LIGHTCONST", sLightConst); + SetLocalString(oNew, "CEP_L_LIGHTSWAP", sResRef); + + if (nAmIOn == 1) + { + effect eLight = EffectVisualEffect(nLight); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oNew); + } + DestroyObject(OBJECT_SELF, 0.0); + return; + }else{ + + //if not a cycling placeable and uninitialized, place a light effect, if needed + if (nAmIOn == 1) + { + effect eLight = EffectVisualEffect(nLight); + ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, OBJECT_SELF); + } + } +} + + diff --git a/nwnds_module/zep_use_chair.ncs b/nwnds_module/zep_use_chair.ncs new file mode 100644 index 000000000..a0d74a308 Binary files /dev/null and b/nwnds_module/zep_use_chair.ncs differ diff --git a/nwnds_module/zep_use_chair.nss b/nwnds_module/zep_use_chair.nss new file mode 100644 index 000000000..4a7d0a0fe --- /dev/null +++ b/nwnds_module/zep_use_chair.nss @@ -0,0 +1,20 @@ +//:://///////////////////////////////////////////// +//:: FileName: X0_O2_CHAIR_SIT +//::////////////////////////////////////////////// +/* + Sit on a placeable chair or on an invisible object + placed on a tileset chair. +*/ +//::////////////////////////////////////////////// +//:: Created By: Naomi Novik +//:: Created On: /2002 +//::////////////////////////////////////////////// + + +void main() +{ + object oChair = OBJECT_SELF; + if (!GetIsObjectValid(GetSittingCreature(OBJECT_SELF))) { + AssignCommand(GetLastUsedBy(), ActionSit(oChair)); + } +} diff --git a/nwnds_module/zep_wizrobes.uti b/nwnds_module/zep_wizrobes.uti new file mode 100644 index 000000000..ff00dc5c0 Binary files /dev/null and b/nwnds_module/zep_wizrobes.uti differ diff --git a/nwnds_module/zhackal001.utc b/nwnds_module/zhackal001.utc new file mode 100644 index 000000000..2e7c19cfb Binary files /dev/null and b/nwnds_module/zhackal001.utc differ diff --git a/nwnds_module/zhackal002.utc b/nwnds_module/zhackal002.utc new file mode 100644 index 000000000..86ec8ad43 Binary files /dev/null and b/nwnds_module/zhackal002.utc differ diff --git a/nwnds_module/zombie001.utc b/nwnds_module/zombie001.utc new file mode 100644 index 000000000..f58787694 Binary files /dev/null and b/nwnds_module/zombie001.utc differ diff --git a/nwnds_module/zombie002.utc b/nwnds_module/zombie002.utc new file mode 100644 index 000000000..ad644824f Binary files /dev/null and b/nwnds_module/zombie002.utc differ diff --git a/nwnds_module/zombie003.utc b/nwnds_module/zombie003.utc new file mode 100644 index 000000000..9c81a0bcc Binary files /dev/null and b/nwnds_module/zombie003.utc differ diff --git a/nwnds_module/zombiehide_ar.uti b/nwnds_module/zombiehide_ar.uti new file mode 100644 index 000000000..6a024699a Binary files /dev/null and b/nwnds_module/zombiehide_ar.uti differ diff --git a/nwnds_module/zombiespawn.utc b/nwnds_module/zombiespawn.utc new file mode 100644 index 000000000..522a0e9fc Binary files /dev/null and b/nwnds_module/zombiespawn.utc differ