2025/09/03 Update
Modified CEP 2DA hak to remove extraneous creatures from palette. Added door closer script to most town doors. Added Amulet of Mighty Fists +1 through +5 to loot table. Fixed names on remainder of creatures. Updated PEPS. Set PEPS to server mode. Set module to server mode. Updated Class Title function in ms_name_inc. Updated dungeon areas to reset, globally & per player. Added "new" weapons to the Blacksmith. Added magical "new" weapons to the treasure tables. Fixed persistent storage.
This commit is contained in:
@@ -18,7 +18,7 @@ const string PHILOS_VERSION = "Philos' Enhancing Player System (PEPS) version:07
|
||||
// This will only work if you are using the PEPS menu system.
|
||||
const int AI_DEBUG = FALSE;
|
||||
// Defines if we are compiling for single player or a server. Always on for servers!
|
||||
const int AI_SERVER = FALSE;
|
||||
const int AI_SERVER = TRUE;
|
||||
// The number of classes allowed for a creature to take in the server/module.
|
||||
const int AI_MAX_CLASSES_PER_CHARACTER = 8;
|
||||
// Taunts cool down time before the AI attemps another Taunt.
|
||||
|
||||
165
_module/nss/area_onexit.nss
Normal file
165
_module/nss/area_onexit.nss
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
// Clears out non-plot, non-immortal objects from the area
|
||||
void CleanupArea(object oArea)
|
||||
{
|
||||
object oObj = GetFirstObjectInArea(oArea);
|
||||
while (GetIsObjectValid(oObj))
|
||||
{
|
||||
int bDestroy = FALSE;
|
||||
|
||||
// Clean creatures
|
||||
if (GetObjectType(oObj) == OBJECT_TYPE_CREATURE)
|
||||
{
|
||||
if (!GetPlotFlag(oObj) && !GetImmortal(oObj) && !GetIsPC(oObj))
|
||||
{
|
||||
bDestroy = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Clean items
|
||||
else if (GetObjectType(oObj) == OBJECT_TYPE_ITEM)
|
||||
{
|
||||
if (!GetPlotFlag(oObj) && !GetImmortal(oObj))
|
||||
{
|
||||
bDestroy = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Clean placeables (note: static placeables can't be destroyed anyway)
|
||||
else if (GetObjectType(oObj) == OBJECT_TYPE_PLACEABLE)
|
||||
{
|
||||
if (!GetPlotFlag(oObj) && !GetImmortal(oObj))
|
||||
{
|
||||
bDestroy = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (bDestroy)
|
||||
{
|
||||
WriteTimestampedLogEntry("CleanupArea: Destroying object " + GetTag(oObj) + " in " + GetName(oArea));
|
||||
DestroyObject(oObj);
|
||||
}
|
||||
|
||||
oObj = GetNextObjectInArea(oArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ResetPlayerDungeon(string sAreaTag, object oPC)
|
||||
{
|
||||
int bDebug = GetLocalInt(GetModule(), "MMD_DEBUG");
|
||||
|
||||
object oArea = GetObjectByTag(sAreaTag);
|
||||
|
||||
// Allow this PC to trigger spawns in this area again
|
||||
DeleteLocalInt(oPC, "DungeonCooldown_" + sAreaTag);
|
||||
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit >> ResetPlayerDungeon: Cooldown expired for area " + GetName(oArea)+" / ("+sAreaTag+").");
|
||||
|
||||
WriteTimestampedLogEntry("area_onexit >> ResetPlayerDungeon: Cooldown expired for PC " + GetName(oPC) + " in area " + GetName(oArea)+" / ("+sAreaTag+").");
|
||||
}
|
||||
|
||||
void ResetDungeonIfEmpty(string sAreaTag)
|
||||
{
|
||||
int bDebug = GetLocalInt(GetModule(), "MMD_DEBUG");
|
||||
|
||||
object oArea = GetObjectByTag(sAreaTag);
|
||||
if (oArea == OBJECT_INVALID) return;
|
||||
|
||||
// check if still empty
|
||||
object oCheck = GetFirstObjectInArea(oArea);
|
||||
while (oCheck != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oCheck)) return; // still occupied
|
||||
oCheck = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
// clear waypoint flags so the dungeon can respawn
|
||||
object oSpawn = GetFirstObjectInArea(oArea);
|
||||
while (oSpawn != OBJECT_INVALID)
|
||||
{
|
||||
if (GetObjectType(oSpawn) == OBJECT_TYPE_WAYPOINT)
|
||||
{
|
||||
DeleteLocalInt(oSpawn, "done");
|
||||
}
|
||||
oSpawn = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
object oPC = GetFirstPC();
|
||||
while (oPC != OBJECT_INVALID)
|
||||
{
|
||||
if (GetLocalInt(oPC, "DungeonCooldown_" + sAreaTag) == 1)
|
||||
{
|
||||
SetLocalInt(oPC, "DungeonCooldown_" + sAreaTag, 0);
|
||||
WriteTimestampedLogEntry("area_onexit >> ResetDungeonIfEmpty: Cooldown cleared for " + GetName(oPC) + " in area " + GetName(oArea)+" / ("+sAreaTag+").");
|
||||
}
|
||||
oPC = GetNextPC();
|
||||
}
|
||||
|
||||
if (bDebug) SpeakString("area_onexit >> ResetDungeonIfEmpty: Dungeon reset complete for area " + GetName(oPC) + " in area " + GetName(oArea)+" / ("+sAreaTag+").");
|
||||
|
||||
DelayCommand(0.0f, CleanupArea(oArea));
|
||||
|
||||
WriteTimestampedLogEntry("area_onexit >> ResetDungeonIfEmpty: Dungeon area " + GetName(oArea)+" / ("+sAreaTag+") is fully reset (no PCs present).");
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetExitingObject();
|
||||
object oDoor = OBJECT_SELF;
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
int bDebug = GetLocalInt(GetModule(), "MMD_DEBUG");
|
||||
|
||||
object oArea = GetArea(oDoor);
|
||||
string sAreaTag = GetTag(oArea);
|
||||
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Exiting area " + sAreaTag);
|
||||
WriteTimestampedLogEntry("area_onexit: PC " + GetName(oPC) + " exited " + sAreaTag);
|
||||
|
||||
// If no timer is running for this PC/area, start one
|
||||
int iCooldownActive = GetLocalInt(oPC, "DungeonCooldownRunning_" + sAreaTag);
|
||||
if (!iCooldownActive)
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Scheduling cooldown reset for " + sAreaTag + " in 5 minutes.");
|
||||
WriteTimestampedLogEntry("area_onexit: Starting cooldown timer for " + GetName(oPC) + " in area " + sAreaTag);
|
||||
|
||||
SetLocalInt(oPC, "DungeonCooldownRunning_" + sAreaTag, 1);
|
||||
|
||||
// 5-minute cooldown for THIS PC only
|
||||
DelayCommand(300.0, ResetPlayerDungeon(sAreaTag, oPC));
|
||||
DelayCommand(300.0, DeleteLocalInt(oPC, "DungeonCooldownRunning_" + sAreaTag));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Cooldown already active for " + sAreaTag);
|
||||
WriteTimestampedLogEntry("area_onexit: Cooldown already active for " + GetName(oPC) + " in area " + sAreaTag);
|
||||
}
|
||||
|
||||
// check if any PCs remain
|
||||
object oCheck = GetFirstObjectInArea(oArea);
|
||||
while (oCheck != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oCheck) && oCheck != oPC)
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Another PC remains in area " + GetName(oArea)+" / ("+sAreaTag+"). Not resetting.");
|
||||
WriteTimestampedLogEntry("area_onexit: Area " + sAreaTag + " not empty, skipping full reset.");
|
||||
return; // still someone here
|
||||
}
|
||||
oCheck = GetNextObjectInArea(oArea);
|
||||
}
|
||||
|
||||
// no PCs left -> schedule full dungeon reset in 5 minutes
|
||||
if (sAreaTag != "area4_20") // exclude cow level
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Scheduling dungeon reset for " + GetName(oArea)+" / ("+sAreaTag+") in 5 minutes.");
|
||||
WriteTimestampedLogEntry("area_onexit: Scheduling full reset for area " + GetName(oArea)+" / ("+sAreaTag+") in 5 minutes.");
|
||||
DelayCommand(300.0, ResetDungeonIfEmpty(sAreaTag));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "area_onexit: Cow level excluded from reset.");
|
||||
WriteTimestampedLogEntry("area_onexit: Cow level excluded from reset (" + sAreaTag + ")");
|
||||
}
|
||||
}
|
||||
5
_module/nss/hif_onplayernui.nss
Normal file
5
_module/nss/hif_onplayernui.nss
Normal file
@@ -0,0 +1,5 @@
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("mod_nui");
|
||||
ExecuteScript("prc_onplayernui");
|
||||
}
|
||||
6
_module/nss/hif_onplaytarget.nss
Normal file
6
_module/nss/hif_onplaytarget.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("mod_target");
|
||||
|
||||
ExecuteScript("prc_onplaytarget");
|
||||
}
|
||||
@@ -44,6 +44,7 @@ void PC_CreateNUIGoldWindow(object oPlayer);
|
||||
string PC_GetDatabaseName(object oPlayer)
|
||||
{
|
||||
return "PC_" + GetObjectUUID(oPlayer) + GetPCPublicCDKey(oPlayer, TRUE);
|
||||
//return "PC_" + GetPCPublicCDKey(oPlayer, TRUE);
|
||||
}
|
||||
|
||||
string PC_GetTableName(object oPlayer)
|
||||
|
||||
173
_module/nss/jy_itnk_amf1.nss
Normal file
173
_module/nss/jy_itnk_amf1.nss
Normal file
@@ -0,0 +1,173 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Amulet of Mighty Fists +1
|
||||
//:: jy_itnk_amf1
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Amulet of Mighty Fists +1
|
||||
Magic Item
|
||||
(Dungeon Master's Guide v.3.5, p. 246)
|
||||
|
||||
Price: 6,000 gp
|
||||
Body Slot: Throat
|
||||
Caster Level: 5th
|
||||
Aura: Faint; (DC 18) Evocation
|
||||
Activation: <20>
|
||||
Weight: <20> lb.
|
||||
|
||||
This amulet grants an enhancement bonus of +1 on attack
|
||||
and damage rolls with unarmed attacks and natural weapons.
|
||||
|
||||
Prerequisites: Craft Wondrous Item , Magic Fang, Greater
|
||||
creator's caster level must be at least 3x the amulet's bonus.
|
||||
|
||||
Cost to Create: 3,000 gp, 240 XP, 6 day(s).
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 2025-05-25 20:23:47
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_eventhook"
|
||||
#include "prc_inc_combat"
|
||||
|
||||
const string AMULET_RES = "jy_itnk_amf1";
|
||||
const string AMULET_EFFECT = "AMULET_MIGHTY_FISTS+1";
|
||||
const string SCRIPT_NAME = "jy_itnk_amf1";
|
||||
|
||||
// check if PC is wearing the amulet
|
||||
int WearingAmulet(object oPC)
|
||||
{
|
||||
object oNeck = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
|
||||
return (GetIsObjectValid(oNeck) &&
|
||||
(GetResRef(oNeck) == AMULET_RES || GetTag(oNeck) == AMULET_RES));
|
||||
}
|
||||
|
||||
// remove any lingering effect
|
||||
void RemoveAmuletEffect(object oPC)
|
||||
{
|
||||
effect e = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(e))
|
||||
{
|
||||
if (GetEffectTag(e) == AMULET_EFFECT)
|
||||
RemoveEffect(oPC, e);
|
||||
e = GetNextEffect(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
// apply new effect
|
||||
void ApplyAmuletEffect(object oPC)
|
||||
{
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
effect eMightyR = EffectAttackIncrease(1, ATTACK_BONUS_ONHAND);
|
||||
effect eMightyL = EffectAttackIncrease(1, ATTACK_BONUS_OFFHAND);
|
||||
effect eDmg = EffectDamageIncrease(DAMAGE_BONUS_1, DAMAGE_TYPE_MAGICAL);
|
||||
|
||||
effect eLink = EffectLinkEffects(EffectLinkEffects(eMightyR, eMightyL), eDmg);
|
||||
eLink = TagEffect(eLink, AMULET_EFFECT);
|
||||
eLink = ExtraordinaryEffect(eLink);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPC);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// Debug message
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> Event: " + IntToString(nEvent));
|
||||
|
||||
switch (nEvent)
|
||||
{
|
||||
// Item equipped (any item)
|
||||
case X2_ITEM_EVENT_EQUIP:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> Equipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being equipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Register for equipment change events
|
||||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
|
||||
// Apply effect if unarmed
|
||||
if (GetIsUnarmed(oPC))
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
// If a weapon is equipped while wearing the amulet, remove the effect
|
||||
else if (WearingAmulet(oPC) && !GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Item unequipped (any item)
|
||||
case X2_ITEM_EVENT_UNEQUIP:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> Unequipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being unequipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Remove effect immediately when amulet is unequipped
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
// Unregister events
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
}
|
||||
// If a weapon is unequipped while wearing the amulet, and PC is now unarmed,
|
||||
// apply the effect
|
||||
else if (WearingAmulet(oPC) && GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Handle PRC eventhooks
|
||||
case EVENT_ONPLAYEREQUIPITEM:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If a weapon was equipped, remove the amulet effect
|
||||
if (!GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> PRC Eventhook: Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_ONPLAYERUNEQUIPITEM:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If they're now unarmed after unequipping something, apply the effect
|
||||
if (GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf1 >> PRC Eventhook: Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
175
_module/nss/jy_itnk_amf2.nss
Normal file
175
_module/nss/jy_itnk_amf2.nss
Normal file
@@ -0,0 +1,175 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Amulet of Mighty Fists +2
|
||||
//:: jy_itnk_amf2
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Amulet of Might Fists +2
|
||||
Magic Item
|
||||
(Dungeon Master's Guide v.3.5, p. 246)
|
||||
|
||||
Price: 24,000 gp
|
||||
Body Slot: Throat
|
||||
Caster Level: 5th
|
||||
Aura: Faint; (DC 18) Evocation
|
||||
Activation: <20>
|
||||
Weight: <20> lb.
|
||||
|
||||
This amulet grants an enhancement bonus of +2
|
||||
on attack and damage rolls with unarmed attacks
|
||||
and natural weapons.
|
||||
|
||||
Prerequisites: Craft Wondrous Item , Magic Fang,
|
||||
Greater creator<6F>s caster level must be at least
|
||||
3x the amulet<65>s bonus.
|
||||
|
||||
Cost to Create: 12,000 gp, 960 XP, 24 day(s).
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 2025-09-03 20:57:04
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_eventhook"
|
||||
#include "prc_inc_combat"
|
||||
|
||||
const string AMULET_RES = "jy_itnk_amf2";
|
||||
const string AMULET_EFFECT = "AMULET_MIGHTY_FISTS+2";
|
||||
const string SCRIPT_NAME = "jy_itnk_amf2";
|
||||
|
||||
// check if PC is wearing the amulet
|
||||
int WearingAmulet(object oPC)
|
||||
{
|
||||
object oNeck = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
|
||||
return (GetIsObjectValid(oNeck) &&
|
||||
(GetResRef(oNeck) == AMULET_RES || GetTag(oNeck) == AMULET_RES));
|
||||
}
|
||||
|
||||
// remove any lingering effect
|
||||
void RemoveAmuletEffect(object oPC)
|
||||
{
|
||||
effect e = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(e))
|
||||
{
|
||||
if (GetEffectTag(e) == AMULET_EFFECT)
|
||||
RemoveEffect(oPC, e);
|
||||
e = GetNextEffect(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
// apply new effect
|
||||
void ApplyAmuletEffect(object oPC)
|
||||
{
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
effect eMightyR = EffectAttackIncrease(2, ATTACK_BONUS_ONHAND);
|
||||
effect eMightyL = EffectAttackIncrease(2, ATTACK_BONUS_OFFHAND);
|
||||
effect eDmg = EffectDamageIncrease(DAMAGE_BONUS_2, DAMAGE_TYPE_MAGICAL);
|
||||
|
||||
effect eLink = EffectLinkEffects(EffectLinkEffects(eMightyR, eMightyL), eDmg);
|
||||
eLink = TagEffect(eLink, AMULET_EFFECT);
|
||||
eLink = ExtraordinaryEffect(eLink);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPC);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// Debug message
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> Event: " + IntToString(nEvent));
|
||||
|
||||
switch (nEvent)
|
||||
{
|
||||
// Item equipped (any item)
|
||||
case X2_ITEM_EVENT_EQUIP:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> Equipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being equipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Register for equipment change events
|
||||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
|
||||
// Apply effect if unarmed
|
||||
if (GetIsUnarmed(oPC))
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
// If a weapon is equipped while wearing the amulet, remove the effect
|
||||
else if (WearingAmulet(oPC) && !GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Item unequipped (any item)
|
||||
case X2_ITEM_EVENT_UNEQUIP:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> Unequipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being unequipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Remove effect immediately when amulet is unequipped
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
// Unregister events
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
}
|
||||
// If a weapon is unequipped while wearing the amulet, and PC is now unarmed,
|
||||
// apply the effect
|
||||
else if (WearingAmulet(oPC) && GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Handle PRC eventhooks
|
||||
case EVENT_ONPLAYEREQUIPITEM:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If a weapon was equipped, remove the amulet effect
|
||||
if (!GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> PRC Eventhook: Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_ONPLAYERUNEQUIPITEM:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If they're now unarmed after unequipping something, apply the effect
|
||||
if (GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf2 >> PRC Eventhook: Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
175
_module/nss/jy_itnk_amf3.nss
Normal file
175
_module/nss/jy_itnk_amf3.nss
Normal file
@@ -0,0 +1,175 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Amulet of Mighty Fists +3
|
||||
//:: jy_itnk_amf3
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Amulet of Might Fists +3
|
||||
Magic Item
|
||||
(Dungeon Master's Guide v.3.5, p. 246)
|
||||
|
||||
Price: 54,000 gp
|
||||
Body Slot: Throat
|
||||
Caster Level: 5th
|
||||
Aura: Faint; (DC 18) Evocation
|
||||
Activation: <20>
|
||||
Weight: <20> lb.
|
||||
|
||||
This amulet grants an enhancement bonus of +3
|
||||
on attack and damage rolls with unarmed attacks
|
||||
and natural weapons.
|
||||
|
||||
Prerequisites: Craft Wondrous Item , Magic Fang,
|
||||
Greater creator<6F>s caster level must be at least
|
||||
3x the amulet<65>s bonus.
|
||||
|
||||
Cost to Create: 27,000 gp, 2,160 XP, 54 day(s).
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 2025-05-25 20:23:47
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_eventhook"
|
||||
#include "prc_inc_combat"
|
||||
|
||||
const string AMULET_RES = "jy_itnk_amf3";
|
||||
const string AMULET_EFFECT = "AMULET_MIGHTY_FISTS+3";
|
||||
const string SCRIPT_NAME = "jy_itnk_amf3";
|
||||
|
||||
// check if PC is wearing the amulet
|
||||
int WearingAmulet(object oPC)
|
||||
{
|
||||
object oNeck = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
|
||||
return (GetIsObjectValid(oNeck) &&
|
||||
(GetResRef(oNeck) == AMULET_RES || GetTag(oNeck) == AMULET_RES));
|
||||
}
|
||||
|
||||
// remove any lingering effect
|
||||
void RemoveAmuletEffect(object oPC)
|
||||
{
|
||||
effect e = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(e))
|
||||
{
|
||||
if (GetEffectTag(e) == AMULET_EFFECT)
|
||||
RemoveEffect(oPC, e);
|
||||
e = GetNextEffect(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
// apply new effect
|
||||
void ApplyAmuletEffect(object oPC)
|
||||
{
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
effect eMightyR = EffectAttackIncrease(3, ATTACK_BONUS_ONHAND);
|
||||
effect eMightyL = EffectAttackIncrease(3, ATTACK_BONUS_OFFHAND);
|
||||
effect eDmg = EffectDamageIncrease(DAMAGE_BONUS_3, DAMAGE_TYPE_MAGICAL);
|
||||
|
||||
effect eLink = EffectLinkEffects(EffectLinkEffects(eMightyR, eMightyL), eDmg);
|
||||
eLink = TagEffect(eLink, AMULET_EFFECT);
|
||||
eLink = ExtraordinaryEffect(eLink);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPC);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// Debug message
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> Event: " + IntToString(nEvent));
|
||||
|
||||
switch (nEvent)
|
||||
{
|
||||
// Item equipped (any item)
|
||||
case X2_ITEM_EVENT_EQUIP:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> Equipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being equipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Register for equipment change events
|
||||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
|
||||
// Apply effect if unarmed
|
||||
if (GetIsUnarmed(oPC))
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
// If a weapon is equipped while wearing the amulet, remove the effect
|
||||
else if (WearingAmulet(oPC) && !GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Item unequipped (any item)
|
||||
case X2_ITEM_EVENT_UNEQUIP:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> Unequipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being unequipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Remove effect immediately when amulet is unequipped
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
// Unregister events
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
}
|
||||
// If a weapon is unequipped while wearing the amulet, and PC is now unarmed,
|
||||
// apply the effect
|
||||
else if (WearingAmulet(oPC) && GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Handle PRC eventhooks
|
||||
case EVENT_ONPLAYEREQUIPITEM:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If a weapon was equipped, remove the amulet effect
|
||||
if (!GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> PRC Eventhook: Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_ONPLAYERUNEQUIPITEM:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If they're now unarmed after unequipping something, apply the effect
|
||||
if (GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf3 >> PRC Eventhook: Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
174
_module/nss/jy_itnk_amf4.nss
Normal file
174
_module/nss/jy_itnk_amf4.nss
Normal file
@@ -0,0 +1,174 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Amulet of Mighty Fists +4
|
||||
//:: jy_itnk_amf4
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Amulet of Might Fists +4
|
||||
Magic Item
|
||||
(Dungeon Master's Guide v.3.5, p. 246)
|
||||
|
||||
Price: 96,000 gp
|
||||
Body Slot: Throat
|
||||
Caster Level: 5th
|
||||
Aura: Faint; (DC 18)
|
||||
Activation: <20>
|
||||
Weight: <20> lb.
|
||||
|
||||
This amulet grants an enhancement bonus of +4
|
||||
on attack and damage rolls with unarmed attacks
|
||||
and natural weapons.
|
||||
|
||||
Prerequisites: creator<6F>s caster level must be at
|
||||
least 3x the amulet<65>s bonus.
|
||||
|
||||
Cost to Create: 48,000 gp, 3,840 XP, 96 day(s).
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 2025-05-25 20:23:47
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_eventhook"
|
||||
#include "prc_inc_combat"
|
||||
|
||||
const string AMULET_RES = "jy_itnk_amf4";
|
||||
const string AMULET_EFFECT = "AMULET_MIGHTY_FISTS+4";
|
||||
const string SCRIPT_NAME = "jy_itnk_amf4";
|
||||
|
||||
// check if PC is wearing the amulet
|
||||
int WearingAmulet(object oPC)
|
||||
{
|
||||
object oNeck = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
|
||||
return (GetIsObjectValid(oNeck) &&
|
||||
(GetResRef(oNeck) == AMULET_RES || GetTag(oNeck) == AMULET_RES));
|
||||
}
|
||||
|
||||
// remove any lingering effect
|
||||
void RemoveAmuletEffect(object oPC)
|
||||
{
|
||||
effect e = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(e))
|
||||
{
|
||||
if (GetEffectTag(e) == AMULET_EFFECT)
|
||||
RemoveEffect(oPC, e);
|
||||
e = GetNextEffect(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
// apply new effect
|
||||
void ApplyAmuletEffect(object oPC)
|
||||
{
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
effect eMightyR = EffectAttackIncrease(4, ATTACK_BONUS_ONHAND);
|
||||
effect eMightyL = EffectAttackIncrease(4, ATTACK_BONUS_OFFHAND);
|
||||
effect eDmg = EffectDamageIncrease(DAMAGE_BONUS_4, DAMAGE_TYPE_MAGICAL);
|
||||
|
||||
effect eLink = EffectLinkEffects(EffectLinkEffects(eMightyR, eMightyL), eDmg);
|
||||
eLink = TagEffect(eLink, AMULET_EFFECT);
|
||||
eLink = ExtraordinaryEffect(eLink);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPC);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// Debug message
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> Event: " + IntToString(nEvent));
|
||||
|
||||
switch (nEvent)
|
||||
{
|
||||
// Item equipped (any item)
|
||||
case X2_ITEM_EVENT_EQUIP:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> Equipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being equipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Register for equipment change events
|
||||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
|
||||
// Apply effect if unarmed
|
||||
if (GetIsUnarmed(oPC))
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
// If a weapon is equipped while wearing the amulet, remove the effect
|
||||
else if (WearingAmulet(oPC) && !GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Item unequipped (any item)
|
||||
case X2_ITEM_EVENT_UNEQUIP:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> Unequipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being unequipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Remove effect immediately when amulet is unequipped
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
// Unregister events
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
}
|
||||
// If a weapon is unequipped while wearing the amulet, and PC is now unarmed,
|
||||
// apply the effect
|
||||
else if (WearingAmulet(oPC) && GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Handle PRC eventhooks
|
||||
case EVENT_ONPLAYEREQUIPITEM:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If a weapon was equipped, remove the amulet effect
|
||||
if (!GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> PRC Eventhook: Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_ONPLAYERUNEQUIPITEM:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If they're now unarmed after unequipping something, apply the effect
|
||||
if (GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf4 >> PRC Eventhook: Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
173
_module/nss/jy_itnk_amf5.nss
Normal file
173
_module/nss/jy_itnk_amf5.nss
Normal file
@@ -0,0 +1,173 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Amulet of Mighty Fists +1
|
||||
//:: jy_itnk_amf5
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Amulet of Mighty Fists +1
|
||||
Magic Item
|
||||
(Dungeon Master's Guide v.3.5, p. 246)
|
||||
|
||||
Price: 6,000 gp
|
||||
Body Slot: Throat
|
||||
Caster Level: 5th
|
||||
Aura: Faint; (DC 18) Evocation
|
||||
Activation: <20>
|
||||
Weight: <20> lb.
|
||||
|
||||
This amulet grants an enhancement bonus of +1 on attack
|
||||
and damage rolls with unarmed attacks and natural weapons.
|
||||
|
||||
Prerequisites: Craft Wondrous Item , Magic Fang, Greater
|
||||
creator's caster level must be at least 3x the amulet's bonus.
|
||||
|
||||
Cost to Create: 3,000 gp, 240 XP, 6 day(s).
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Modified By: Jaysyn
|
||||
//:: Modified On: 2025-05-25 20:23:47
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_eventhook"
|
||||
#include "prc_inc_combat"
|
||||
|
||||
const string AMULET_RES = "jy_itnk_amf5";
|
||||
const string AMULET_EFFECT = "AMULET_MIGHTY_FISTS+5";
|
||||
const string SCRIPT_NAME = "jy_itnk_amf5";
|
||||
|
||||
// check if PC is wearing the amulet
|
||||
int WearingAmulet(object oPC)
|
||||
{
|
||||
object oNeck = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
|
||||
return (GetIsObjectValid(oNeck) &&
|
||||
(GetResRef(oNeck) == AMULET_RES || GetTag(oNeck) == AMULET_RES));
|
||||
}
|
||||
|
||||
// remove any lingering effect
|
||||
void RemoveAmuletEffect(object oPC)
|
||||
{
|
||||
effect e = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(e))
|
||||
{
|
||||
if (GetEffectTag(e) == AMULET_EFFECT)
|
||||
RemoveEffect(oPC, e);
|
||||
e = GetNextEffect(oPC);
|
||||
}
|
||||
}
|
||||
|
||||
// apply new effect
|
||||
void ApplyAmuletEffect(object oPC)
|
||||
{
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
effect eMightyR = EffectAttackIncrease(5, ATTACK_BONUS_ONHAND);
|
||||
effect eMightyL = EffectAttackIncrease(5, ATTACK_BONUS_OFFHAND);
|
||||
effect eDmg = EffectDamageIncrease(DAMAGE_BONUS_5, DAMAGE_TYPE_MAGICAL);
|
||||
|
||||
effect eLink = EffectLinkEffects(EffectLinkEffects(eMightyR, eMightyL), eDmg);
|
||||
eLink = TagEffect(eLink, AMULET_EFFECT);
|
||||
eLink = ExtraordinaryEffect(eLink);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPC);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
// Debug message
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> Event: " + IntToString(nEvent));
|
||||
|
||||
switch (nEvent)
|
||||
{
|
||||
// Item equipped (any item)
|
||||
case X2_ITEM_EVENT_EQUIP:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> Equipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being equipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Register for equipment change events
|
||||
AddEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
AddEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
|
||||
// Apply effect if unarmed
|
||||
if (GetIsUnarmed(oPC))
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
// If a weapon is equipped while wearing the amulet, remove the effect
|
||||
else if (WearingAmulet(oPC) && !GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Item unequipped (any item)
|
||||
case X2_ITEM_EVENT_UNEQUIP:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> Unequipped: " + GetName(oItem));
|
||||
|
||||
// If this is our amulet being unequipped
|
||||
if (GetResRef(oItem) == AMULET_RES || GetTag(oItem) == AMULET_RES)
|
||||
{
|
||||
// Remove effect immediately when amulet is unequipped
|
||||
RemoveAmuletEffect(oPC);
|
||||
|
||||
// Unregister events
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYEREQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
RemoveEventScript(oPC, EVENT_ONPLAYERUNEQUIPITEM, SCRIPT_NAME, TRUE, FALSE);
|
||||
}
|
||||
// If a weapon is unequipped while wearing the amulet, and PC is now unarmed,
|
||||
// apply the effect
|
||||
else if (WearingAmulet(oPC) && GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
// Handle PRC eventhooks
|
||||
case EVENT_ONPLAYEREQUIPITEM:
|
||||
oPC = GetPCItemLastEquippedBy();
|
||||
oItem = GetPCItemLastEquipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If a weapon was equipped, remove the amulet effect
|
||||
if (!GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> PRC Eventhook: Removing effect due to weapon equip");
|
||||
RemoveAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_ONPLAYERUNEQUIPITEM:
|
||||
oPC = GetPCItemLastUnequippedBy();
|
||||
oItem = GetPCItemLastUnequipped();
|
||||
|
||||
// If not wearing the amulet, do nothing
|
||||
if (!WearingAmulet(oPC))
|
||||
return;
|
||||
|
||||
// If they're now unarmed after unequipping something, apply the effect
|
||||
if (GetIsUnarmed(oPC))
|
||||
{
|
||||
if(DEBUG) DoDebug("jy_itnk_amf5 >> PRC Eventhook: Adding effect due to weapon unequip");
|
||||
ApplyAmuletEffect(oPC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
6
_module/nss/mmd_closedoors.nss
Normal file
6
_module/nss/mmd_closedoors.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
//Closes door if it is open
|
||||
void main()
|
||||
{
|
||||
DelayCommand(30.0,ActionCloseDoor(OBJECT_SELF));
|
||||
|
||||
}
|
||||
@@ -1,8 +1,37 @@
|
||||
#include "nui_i_main"
|
||||
#include "inc_perchest"
|
||||
#include "inc_gennui"
|
||||
#include "inc_examine"
|
||||
#include "inc_tictactoe"
|
||||
#include "inc_blackjack"
|
||||
#include "inc_transform"
|
||||
|
||||
void main()
|
||||
{
|
||||
NUI();
|
||||
|
||||
ExecuteScript("prc_onplayernui");
|
||||
}
|
||||
|
||||
object oPlayer = NuiGetEventPlayer();
|
||||
int nToken = NuiGetEventWindow();
|
||||
string sWindowId = NuiGetWindowId(oPlayer, nToken);
|
||||
string sType = NuiGetEventType();
|
||||
string sElement = NuiGetEventElement();
|
||||
int nArrayIndex = NuiGetEventArrayIndex();
|
||||
json jPayload = NuiGetEventPayload();
|
||||
|
||||
//SendMessageToPC(oPlayer, "(" + IntToString(nToken) + ":" + sWindowId + ") T: " + sType + ", E: " + sElement + ", AI: " + IntToString(nArrayIndex) + ", P: " + JsonDump(jPayload));
|
||||
|
||||
if (sWindowId == PC_NUI_WINDOW_ID || sWindowId == PC_NUI_GOLD_WINDOW_ID)
|
||||
PC_HandleNUIEvents(oPlayer, sWindowId, nToken, sType, sElement, nArrayIndex);
|
||||
else if (sWindowId == EXAMINE_NUI_WINDOW_ID)
|
||||
Examine_HandleNUIEvents(oPlayer, nToken, sType, sElement, nArrayIndex);
|
||||
else if (sWindowId == TTT_WINDOW_ID)
|
||||
TTT_HandleNUIEvents(oPlayer, nToken, sType, sElement, nArrayIndex, jPayload);
|
||||
else if (sWindowId == BJ_WINDOW_ID)
|
||||
BJ_HandleNUIEvents(oPlayer, nToken, sType, sElement, nArrayIndex, jPayload);
|
||||
else if (sWindowId == VT_WINDOW_ID)
|
||||
VT_HandleNUIEvents(oPlayer, nToken, sType, sElement, nArrayIndex, jPayload);
|
||||
else
|
||||
GNW_HandleNUIEvents();
|
||||
}
|
||||
@@ -7,5 +7,5 @@ void main()
|
||||
|
||||
NUI_HandleEvents(oPC);
|
||||
|
||||
ExecuteScript("prc_onplaytarget", oPC);
|
||||
|
||||
}
|
||||
18
_module/nss/mod_gui.nss
Normal file
18
_module/nss/mod_gui.nss
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "inc_examine"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPlayer = GetLastGuiEventPlayer();
|
||||
int nType = GetLastGuiEventType();
|
||||
object oTarget = GetLastGuiEventObject();
|
||||
int nValue = GetLastGuiEventInteger();
|
||||
|
||||
if (nType == GUIEVENT_DISABLED_PANEL_ATTEMPT_OPEN)
|
||||
{
|
||||
if (nValue == GUI_PANEL_EXAMINE_CREATURE || nValue == GUI_PANEL_EXAMINE_ITEM ||
|
||||
nValue == GUI_PANEL_EXAMINE_PLACEABLE || nValue == GUI_PANEL_EXAMINE_DOOR)
|
||||
{
|
||||
Examine_HandleGUIEvents(oPlayer, oTarget, nValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,9 +64,11 @@
|
||||
|
||||
///// FUNCTION DECLARATIONS ////////////////////////////////////////////////////
|
||||
|
||||
string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF);
|
||||
//:: Function to get the class type with the highest level
|
||||
int GetHighestClassType(object oCreature);
|
||||
|
||||
int GetHighestClassLevel(object oCreature = OBJECT_SELF);
|
||||
//:: Returns class level based NPC titles
|
||||
string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF);
|
||||
|
||||
// Generates a Random First Name
|
||||
// based on Race and Gender
|
||||
@@ -103,7 +105,10 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF)
|
||||
//:: Handles class level based NPC titles
|
||||
if (bClassTitle)
|
||||
{
|
||||
sClassTitle = GetClassLevelTitle(GetHighestClassLevel(oNPC), oNPC);
|
||||
int nClassType = GetHighestClassType(oNPC);
|
||||
sClassTitle = GetClassLevelTitle(nClassType, oNPC);
|
||||
|
||||
FloatingTextStringOnCreature("Title: " + sClassTitle, oNPC);
|
||||
}
|
||||
|
||||
//:: Handles class based Henchman titles
|
||||
@@ -972,7 +977,7 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF)
|
||||
|
||||
if (bClassTitle)
|
||||
{
|
||||
sRandomName = sBaseRace +" "+ sTitle;
|
||||
sRandomName = sBaseRace +" "+ sClassTitle;
|
||||
}
|
||||
|
||||
SetName(oNPC, (sRandomName));
|
||||
@@ -1048,34 +1053,38 @@ string ms_RandomLastName(object oNPC = OBJECT_SELF)
|
||||
return Name;
|
||||
}
|
||||
|
||||
//:: Function to get the highest class level of an object, excluding racialtype classes
|
||||
int GetHighestClassLevel(object oCreature)
|
||||
//:: Function to get the class type with the highest level
|
||||
int GetHighestClassType(object oCreature)
|
||||
{
|
||||
int nHighestLevel = -1;
|
||||
int nClassTypes = 254; // Maximum number of class types
|
||||
int i;
|
||||
int nHighestClass = -1;
|
||||
int nClassTypes = 254; // maximum
|
||||
|
||||
for (i = 0; i <= nClassTypes; i++)
|
||||
int i = 0;
|
||||
while (i <= nClassTypes)
|
||||
{
|
||||
// Check if the class type is excluded
|
||||
// Exclude racial/monster pseudo-classes
|
||||
if (i == CLASS_TYPE_ABERRATION ||
|
||||
i == CLASS_TYPE_ANIMAL ||
|
||||
i == CLASS_TYPE_BEAST ||
|
||||
i == CLASS_TYPE_CONSTRUCT ||
|
||||
i == CLASS_TYPE_DRAGON ||
|
||||
i == CLASS_TYPE_ELEMENTAL ||
|
||||
i == CLASS_TYPE_FEY ||
|
||||
i == CLASS_TYPE_GIANT ||
|
||||
i == CLASS_TYPE_HUMANOID ||
|
||||
i == CLASS_TYPE_MAGICAL_BEAST ||
|
||||
i == CLASS_TYPE_MONSTROUS ||
|
||||
i == CLASS_TYPE_OOZE ||
|
||||
i == CLASS_TYPE_OUTSIDER ||
|
||||
i == CLASS_TYPE_PLANT ||
|
||||
i == CLASS_TYPE_SHAPECHANGER ||
|
||||
i == CLASS_TYPE_UNDEAD ||
|
||||
i == CLASS_TYPE_VERMIN)
|
||||
i == CLASS_TYPE_ANIMAL ||
|
||||
i == CLASS_TYPE_BEAST ||
|
||||
i == CLASS_TYPE_CONSTRUCT ||
|
||||
i == CLASS_TYPE_DRAGON ||
|
||||
i == CLASS_TYPE_ELEMENTAL ||
|
||||
i == CLASS_TYPE_FEY ||
|
||||
i == CLASS_TYPE_GIANT ||
|
||||
i == CLASS_TYPE_HUMANOID ||
|
||||
i == CLASS_TYPE_MAGICAL_BEAST ||
|
||||
i == CLASS_TYPE_MONSTROUS ||
|
||||
i == CLASS_TYPE_OOZE ||
|
||||
i == CLASS_TYPE_OUTSIDER ||
|
||||
i == CLASS_TYPE_PLANT ||
|
||||
i == CLASS_TYPE_SHAPECHANGER ||
|
||||
i == CLASS_TYPE_UNDEAD ||
|
||||
i == CLASS_TYPE_VERMIN)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
int nLevel = GetLevelByClass(i, oCreature);
|
||||
if (nLevel > 0)
|
||||
@@ -1083,27 +1092,29 @@ int GetHighestClassLevel(object oCreature)
|
||||
if (nLevel > nHighestLevel)
|
||||
{
|
||||
nHighestLevel = nLevel;
|
||||
nHighestClass = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break; // Reached an invalid class level, exit the loop
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return nHighestLevel;
|
||||
if (nHighestClass != -1)
|
||||
{
|
||||
FloatingTextStringOnCreature("Highest Level class is " + IntToString(nHighestClass) +
|
||||
" at level " + IntToString(nHighestLevel) + ".", oCreature);
|
||||
}
|
||||
|
||||
return nHighestClass;
|
||||
}
|
||||
|
||||
|
||||
//:: Handles class level based NPC titles
|
||||
//:: Returns class level based NPC titles
|
||||
string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
{
|
||||
string sTitle;
|
||||
int nHighClass = GetHighestClassLevel(oNPC);
|
||||
int nLevel = GetLevelByClass(nHighClass, oNPC);
|
||||
int nGender = GetGender(oNPC);
|
||||
|
||||
switch (nHighClass)
|
||||
string sTitle;
|
||||
int nLevel = GetLevelByClass(nClassType, oNPC);
|
||||
int nGender = GetGender(oNPC);
|
||||
|
||||
switch (nClassType)
|
||||
{
|
||||
case CLASS_TYPE_BARBARIAN:
|
||||
switch(nLevel)
|
||||
@@ -1174,8 +1185,8 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
{sTitle = "Conqueress"; break;}
|
||||
else
|
||||
{sTitle = "Conqueror"; break;}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_ROGUE:
|
||||
switch(nLevel)
|
||||
@@ -1236,6 +1247,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Master Rogue"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_BARD:
|
||||
switch(nLevel)
|
||||
@@ -1335,6 +1347,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Master Bard"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_SORCERER:
|
||||
case CLASS_TYPE_WIZARD:
|
||||
@@ -1396,6 +1409,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Archmage"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_CLERIC:
|
||||
switch(nLevel)
|
||||
@@ -1468,6 +1482,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
{sTitle = "High Priest"; break;}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_DRUID:
|
||||
switch(nLevel)
|
||||
@@ -1528,6 +1543,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Archdruid"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_FIGHTER:
|
||||
switch(nLevel)
|
||||
@@ -1588,6 +1604,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Grandmaster"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_MONK:
|
||||
switch(nLevel)
|
||||
@@ -1659,6 +1676,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "High Master"; break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_PALADIN:
|
||||
switch(nLevel)
|
||||
@@ -1730,7 +1748,8 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "High Master"; break;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CLASS_TYPE_RANGER:
|
||||
switch(nLevel)
|
||||
{
|
||||
@@ -1817,7 +1836,7 @@ string GetClassLevelTitle(int nClassType, object oNPC = OBJECT_SELF)
|
||||
sTitle = "Ranger Lord"; break;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return sTitle;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
/// Local Override (int): PS_FORCE_SEARCH_BUTTON
|
||||
/// 1 = PS_TRUE
|
||||
/// -1 = PS_FALSE
|
||||
const int PS_FORCE_SEARCH_BUTTON_DEFAULT = PS_TRUE;
|
||||
const int PS_FORCE_SEARCH_BUTTON_DEFAULT = 1;
|
||||
|
||||
/// @brief Determines whether item object state is saved to the database. The
|
||||
/// object state includes variables and effects.
|
||||
@@ -42,7 +42,7 @@ const int PS_FORCE_SEARCH_BUTTON_DEFAULT = PS_TRUE;
|
||||
/// Local Override (int): PS_FORCE_OBJECT_STATE
|
||||
/// 1 = PS_TRUE
|
||||
/// -1 = PS_FALSE
|
||||
const int PS_FORCE_OBJECT_STATE_DEFAULT = PS_TRUE;
|
||||
const int PS_FORCE_OBJECT_STATE_DEFAULT = 1;
|
||||
|
||||
/// @brief Sets the item storage limit.
|
||||
/// Configuration File:
|
||||
@@ -79,7 +79,7 @@ const float PS_DISTANCE_DEFAULT = 5.0;
|
||||
/// Local Override (int): PS_ACCESS_TYPE
|
||||
/// 1 = PS_ACCESS_EXCLUSIVE
|
||||
/// 2 = PS_ACCESS_CONTENTIOUS
|
||||
const int PS_ACCESS_TYPE_DEFAULT = PS_ACCESS_EXCLUSIVE;
|
||||
const int PS_ACCESS_TYPE_DEFAULT = 1;
|
||||
|
||||
/// @brief Set the container type. Containers can be of multiple types:
|
||||
/// - Public: Any player can open, deposit and withdraw items from this
|
||||
@@ -101,7 +101,7 @@ const int PS_ACCESS_TYPE_DEFAULT = PS_ACCESS_EXCLUSIVE;
|
||||
/// 1 = PS_CONTAINER_PUBLIC
|
||||
/// 2 = PS_CONTAINER_CHARACTER
|
||||
/// 3 = PS_CONTAINER_CDKEY
|
||||
const int PS_CONTAINER_TYPE_DEFAULT = PS_CONTAINER_CDKEY;
|
||||
const int PS_CONTAINER_TYPE_DEFAULT = 3;
|
||||
|
||||
/// @brief Set the default container type, if the container is an item. Containers
|
||||
/// can be of multiple types:
|
||||
@@ -124,7 +124,7 @@ const int PS_CONTAINER_TYPE_DEFAULT = PS_CONTAINER_CDKEY;
|
||||
/// 1 = PS_CONTAINER_PUBLIC
|
||||
/// 2 = PS_CONTAINER_CHARACTER
|
||||
/// 3 = PS_CONTAINER_CDKEY
|
||||
const int PS_CONTAINER_ITEM_TYPE_DEFAULT = PS_CONTAINER_CHARACTER;
|
||||
const int PS_CONTAINER_ITEM_TYPE_DEFAULT = 2;
|
||||
|
||||
/// @brief Determines whether the player's inventory window will be opened
|
||||
/// when a container is opened.
|
||||
@@ -135,7 +135,7 @@ const int PS_CONTAINER_ITEM_TYPE_DEFAULT = PS_CONTAINER_CHARACTER;
|
||||
/// Local Override (int): PS_OPEN_INVENTORY
|
||||
/// 1 = PS_TRUE
|
||||
/// -1 = PS_FALSE
|
||||
const int PS_OPEN_INVENTORY_DEFAULT = PS_TRUE;
|
||||
const int PS_OPEN_INVENTORY_DEFAULT = 1;
|
||||
|
||||
/// @brief Determines the maximum amount of gold a container can store.
|
||||
/// If the container is set to store no gold, the form controls that
|
||||
@@ -168,7 +168,7 @@ const int PS_MAX_GOLD_DEFAULT = 1500000;
|
||||
/// -2 = PS_NONE
|
||||
/// Set to any positive integer to limit storage to that number of container
|
||||
/// items.
|
||||
const int PS_MAX_CONTAINER_ITEMS_DEFAULT = 100;
|
||||
const int PS_MAX_CONTAINER_ITEMS_DEFAULT = 50;
|
||||
|
||||
/// @brief Determines how many items can be stored in stored container items.
|
||||
/// Configuration File:
|
||||
@@ -191,7 +191,7 @@ const int PS_MAX_CONTAINER_ITEMS_DEFAULT = 100;
|
||||
/// @warning Items that fail check involved with container item limitations do
|
||||
/// not have default messages reported to the player. The item will simply fail
|
||||
/// to be stored.
|
||||
const int PS_MAX_CONTAINER_ITEMS_INVENTORY_DEFAULT = 1000;
|
||||
const int PS_MAX_CONTAINER_ITEMS_INVENTORY_DEFAULT = 500;
|
||||
|
||||
/// @brief Creates the form's title.
|
||||
/// @param oContainer The container object being used.
|
||||
|
||||
88
_module/nss/nw_c2_dropin9.nss
Normal file
88
_module/nss/nw_c2_dropin9.nss
Normal file
@@ -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"
|
||||
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_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.
|
||||
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
|
||||
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
|
||||
//NOTE that NPCs using this form of ambient animations will not move to other NPCs.
|
||||
SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
|
||||
|
||||
// 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.)
|
||||
|
||||
// SPECIAL BEHAVIOR SECTION
|
||||
/*
|
||||
The following section outlines the various special behaviors that can be placed on a creature. To activate one of the special
|
||||
behaviors:
|
||||
1. Comment in SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
|
||||
2. Comment in one other special behavior setting (ONLY ONE).
|
||||
*/
|
||||
//SetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL);
|
||||
//SetBehaviorState(NW_FLAG_BEHAVIOR_OMNIVORE); //Creature will only attack those that close within 5m and are not friends,
|
||||
//Rangers or Druids.
|
||||
//SetBehaviorState(NW_FLAG_BEHAVIOR_HERBIVORE);//Creature will flee those that close within 7m if they are not friends,
|
||||
//Rangers or Druids.
|
||||
|
||||
// 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
|
||||
|
||||
ExecuteScript("prc_pwonspawn");
|
||||
|
||||
}
|
||||
@@ -21,7 +21,16 @@ void main()
|
||||
{
|
||||
int iRand = d100(3)+50;
|
||||
GiveGoldToCreature(oPC,iRand);
|
||||
//:: Give Iron Rations to character.
|
||||
CreateItemOnObject("food002", oPC);
|
||||
CreateItemOnObject("food002", oPC);
|
||||
CreateItemOnObject("food002", oPC);
|
||||
//:: Give Canteen to character
|
||||
CreateItemOnObject("food004", oPC, 1);
|
||||
//:: Give random treasure to character
|
||||
ExecuteScript("ss_treasure",oPC);
|
||||
|
||||
SetXP(oPC, 2);
|
||||
}
|
||||
|
||||
//:: Add system journal entries
|
||||
@@ -29,4 +38,7 @@ void main()
|
||||
AddJournalQuestEntry("JRNL_LA_BUYOFF", 1, oPC, FALSE, FALSE, FALSE);
|
||||
AddJournalQuestEntry("JRNL_PRC8", 1, oPC, FALSE, FALSE, FALSE);
|
||||
AddJournalQuestEntry("JRNL_FOODWTR", 1, oPC, FALSE, FALSE, FALSE);
|
||||
|
||||
//:: Start PEPS AI client script.
|
||||
ExecuteScript("0e_onclientload", oPC);
|
||||
}
|
||||
|
||||
@@ -1,127 +1,311 @@
|
||||
void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
int iLevel = GetHitDice(oPC);
|
||||
if (iLevel>20) iLevel=20;
|
||||
string sLevel = IntToString(iLevel);
|
||||
string sMytag;
|
||||
int iType;
|
||||
location lMyloc;
|
||||
int iNum;
|
||||
string sNum;
|
||||
string sPtag;
|
||||
int iSix;
|
||||
string sSix;
|
||||
if (GetIsPC(oPC) != TRUE) return;
|
||||
object oPC = GetEnteringObject();
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
int bDebug = GetLocalInt(GetModule(), "MMD_DEBUG");
|
||||
|
||||
object oSpawn = GetFirstObjectInArea(OBJECT_SELF);
|
||||
//SendMessageToPC(oPC,"get first wp");
|
||||
int iSpawn = GetLocalInt(oSpawn,"done");
|
||||
int iKind = GetObjectType(oSpawn);
|
||||
int iLevel = GetHitDice(oPC);
|
||||
if (iLevel > 20) iLevel = 20;
|
||||
string sLevel = IntToString(iLevel);
|
||||
|
||||
string sMytag, sPtag, sNum, sSix;
|
||||
int iType, iNum, iSix;
|
||||
location lMyloc;
|
||||
|
||||
while (oSpawn != OBJECT_INVALID)
|
||||
{
|
||||
int iKind = GetObjectType(oSpawn);
|
||||
if (iSpawn != 1 && iKind == OBJECT_TYPE_WAYPOINT)
|
||||
string sAreaTag = GetTag(OBJECT_SELF);
|
||||
|
||||
if (bDebug) SendMessageToPC(oPC, "Entered area " + sAreaTag + " at level " + sLevel);
|
||||
WriteTimestampedLogEntry("PC " + GetName(oPC) + " entered " + sAreaTag + " at level " + sLevel);
|
||||
|
||||
// check if this PC is still on cooldown for this area
|
||||
int iCooldown = GetLocalInt(oPC, "DungeonCooldown_" + sAreaTag);
|
||||
if (iCooldown == 1)
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "Cooldown active for " + sAreaTag + ". Skipping spawn.");
|
||||
WriteTimestampedLogEntry("Spawn skipped: " + GetName(oPC) + " entered " + sAreaTag + " but is on cooldown.");
|
||||
return;
|
||||
}
|
||||
|
||||
// check if another PC is in the area already
|
||||
object oCheck = GetFirstObjectInArea(OBJECT_SELF);
|
||||
while (oCheck != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oCheck) && oCheck != oPC)
|
||||
{
|
||||
if (bDebug) SendMessageToPC(oPC, "Another character is already in the area. Skipping spawn.");
|
||||
WriteTimestampedLogEntry("Spawn skipped: " + GetName(oPC) + " entered " + sAreaTag + " but another PC is already inside.");
|
||||
return;
|
||||
}
|
||||
oCheck = GetNextObjectInArea(OBJECT_SELF);
|
||||
}
|
||||
|
||||
// mark this PC as having triggered the dungeon
|
||||
SetLocalInt(oPC, "DungeonCooldown_" + sAreaTag, 1);
|
||||
if (bDebug) SendMessageToPC(oPC, "Cooldown set. Starting spawns...");
|
||||
WriteTimestampedLogEntry("Spawns triggered: " + GetName(oPC) + " started dungeon " + sAreaTag);
|
||||
|
||||
object oSpawn = GetFirstObjectInArea(OBJECT_SELF);
|
||||
while (oSpawn != OBJECT_INVALID)
|
||||
{
|
||||
int iSpawn = GetLocalInt(oSpawn,"done");
|
||||
int iKind = GetObjectType(oSpawn);
|
||||
|
||||
if (iSpawn != 1 && iKind == OBJECT_TYPE_WAYPOINT)
|
||||
{
|
||||
SetLocalInt(oSpawn,"done",1);
|
||||
|
||||
sMytag = GetTag(oSpawn) + sLevel;
|
||||
sPtag = GetTag(oSpawn);
|
||||
iType = StringToInt(GetStringLeft(sMytag,1));
|
||||
lMyloc = GetLocation(oSpawn);
|
||||
iNum = d10(1);
|
||||
sNum = IntToString(Random(41)+1);
|
||||
iSix = d6();
|
||||
sSix = IntToString(iSix);
|
||||
|
||||
if (bDebug) SendMessageToPC(oPC, "Spawning type " + IntToString(iType) +
|
||||
" from WP " + sPtag);
|
||||
WriteTimestampedLogEntry("Spawn point " + sPtag + " (type " + IntToString(iType) + ") activated by " + GetName(oPC));
|
||||
|
||||
switch (iType)
|
||||
{
|
||||
string sWTF = GetTag(oSpawn);
|
||||
//SendMessageToPC(oPC,"tag is "+sWTF);
|
||||
SetLocalInt(oSpawn,"done",1);
|
||||
//SendMessageToPC(oPC,"spawning stuff");
|
||||
sMytag = GetTag(oSpawn)+sLevel;
|
||||
sPtag = GetTag(oSpawn);
|
||||
iType = StringToInt(GetStringLeft(sMytag,1));
|
||||
lMyloc = GetLocation(oSpawn);
|
||||
iNum = d10(1);
|
||||
sNum = IntToString(Random(40)+1);
|
||||
iSix = d6();
|
||||
sSix = IntToString(iSix);
|
||||
switch (iType)
|
||||
{
|
||||
case 1:
|
||||
switch (iNum)
|
||||
{
|
||||
case 1:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
case 2:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
case 3:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
case 4:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
case 5:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
case 6:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
case 7:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
case 8:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
case 9:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
case 10:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"b",lMyloc);
|
||||
break;
|
||||
}
|
||||
//CreateObject(OBJECT_TYPE_CREATURE,sMytag,lMyloc);
|
||||
break;
|
||||
case 2:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);//interactive placeables
|
||||
break;
|
||||
case 3:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);//mundane placeables
|
||||
break;
|
||||
case 4:
|
||||
CreateObject(OBJECT_TYPE_ITEM,sMytag+"_"+sSix,lMyloc);//loose items
|
||||
break;
|
||||
case 5:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sPtag+sNum,lMyloc);//special encounters
|
||||
break;
|
||||
case 6:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sMytag,lMyloc);//treasure chests
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
if (bDebug) SendMessageToPC(oPC, " -> Encounter roll " + IntToString(iNum));
|
||||
WriteTimestampedLogEntry("Encounter roll " + IntToString(iNum) + " at " + sPtag + " for " + GetName(oPC));
|
||||
switch (iNum)
|
||||
{
|
||||
case 1: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc); break;
|
||||
case 2: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc); break;
|
||||
case 3: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc); break;
|
||||
case 4: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc); break;
|
||||
case 5: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc); break;
|
||||
case 6: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc); break;
|
||||
case 7: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc); break;
|
||||
case 8: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc); break;
|
||||
case 9: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc); break;
|
||||
case 10: CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"b",lMyloc); break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
oSpawn = GetNextObjectInArea(OBJECT_SELF);
|
||||
iSpawn = GetLocalInt(oSpawn,"done");
|
||||
//SendMessageToPC(oPC,"get next wp");
|
||||
|
||||
}
|
||||
case 2: CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);
|
||||
if (bDebug) SendMessageToPC(oPC," -> Placed object: " + sPtag+sNum);
|
||||
WriteTimestampedLogEntry("Placed object " + sPtag+sNum + " at " + sPtag + " for " + GetName(oPC));
|
||||
break;
|
||||
case 3: CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);
|
||||
if (bDebug) SendMessageToPC(oPC," -> Placed mundane: " + sPtag+sNum);
|
||||
WriteTimestampedLogEntry("Placed mundane " + sPtag+sNum + " at " + sPtag + " for " + GetName(oPC));
|
||||
break;
|
||||
case 4: CreateObject(OBJECT_TYPE_ITEM,sMytag+"_"+sSix,lMyloc);
|
||||
if (bDebug) SendMessageToPC(oPC," -> Dropped item: " + sMytag+"_"+sSix);
|
||||
WriteTimestampedLogEntry("Dropped item " + sMytag+"_"+sSix + " at " + sPtag + " for " + GetName(oPC));
|
||||
break;
|
||||
case 5: CreateObject(OBJECT_TYPE_CREATURE,sPtag+sNum,lMyloc);
|
||||
if (bDebug) SendMessageToPC(oPC," -> Special encounter: " + sPtag+sNum);
|
||||
WriteTimestampedLogEntry("Special encounter " + sPtag+sNum + " spawned at " + sPtag + " for " + GetName(oPC));
|
||||
break;
|
||||
case 6: CreateObject(OBJECT_TYPE_PLACEABLE,sMytag,lMyloc);
|
||||
if (bDebug) SendMessageToPC(oPC," -> Treasure chest: " + sMytag);
|
||||
WriteTimestampedLogEntry("Treasure chest " + sMytag + " spawned at " + sPtag + " for " + GetName(oPC));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
oSpawn = GetNextObjectInArea(OBJECT_SELF);
|
||||
}
|
||||
|
||||
// attach OnExit handler once
|
||||
SetEventScript(OBJECT_SELF, EVENT_SCRIPT_AREA_ON_EXIT, "area_onexit");
|
||||
if (bDebug) SendMessageToPC(oPC, "OnExit script linked: area_onexit");
|
||||
WriteTimestampedLogEntry("OnExit script linked for " + sAreaTag);
|
||||
}
|
||||
|
||||
|
||||
/* void main()
|
||||
{
|
||||
object oPC = GetEnteringObject();
|
||||
int iLevel = GetHitDice(oPC);
|
||||
if (iLevel>20) iLevel=20;
|
||||
string sLevel = IntToString(iLevel);
|
||||
string sMytag;
|
||||
int iType;
|
||||
location lMyloc;
|
||||
int iNum;
|
||||
string sNum;
|
||||
string sPtag;
|
||||
int iSix;
|
||||
string sSix;
|
||||
if (GetIsPC(oPC) != TRUE) return;
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
string sAreaTag = GetTag(OBJECT_SELF);
|
||||
|
||||
// already done for this PC?
|
||||
if (GetLocalInt(oPC, "DungeonSetup_" + sAreaTag) == 1)
|
||||
return;
|
||||
|
||||
// check if another PC is in the area
|
||||
object oCheck = GetFirstObjectInArea(OBJECT_SELF);
|
||||
while (oCheck != OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsPC(oCheck) && oCheck != oPC)
|
||||
{
|
||||
// someone else is already here -> skip
|
||||
return;
|
||||
}
|
||||
oCheck = GetNextObjectInArea(OBJECT_SELF);
|
||||
}
|
||||
|
||||
// mark this PC as having triggered setup here
|
||||
SetLocalInt(oPC, "DungeonSetup_" + sAreaTag, 1);
|
||||
|
||||
object oSpawn = GetFirstObjectInArea(OBJECT_SELF);
|
||||
//SendMessageToPC(oPC,"get first wp");
|
||||
int iSpawn = GetLocalInt(oSpawn,"done");
|
||||
int iKind = GetObjectType(oSpawn);
|
||||
|
||||
|
||||
while (oSpawn != OBJECT_INVALID)
|
||||
{
|
||||
int iKind = GetObjectType(oSpawn);
|
||||
if (iSpawn != 1 && iKind == OBJECT_TYPE_WAYPOINT)
|
||||
{
|
||||
string sWTF = GetTag(oSpawn);
|
||||
//SendMessageToPC(oPC,"tag is "+sWTF);
|
||||
SetLocalInt(oSpawn,"done",1);
|
||||
//SendMessageToPC(oPC,"spawning stuff");
|
||||
sMytag = GetTag(oSpawn)+sLevel;
|
||||
sPtag = GetTag(oSpawn);
|
||||
iType = StringToInt(GetStringLeft(sMytag,1));
|
||||
lMyloc = GetLocation(oSpawn);
|
||||
iNum = d10(1);
|
||||
sNum = IntToString(Random(40)+1);
|
||||
iSix = d6();
|
||||
sSix = IntToString(iSix);
|
||||
|
||||
switch (iType)
|
||||
{
|
||||
case 1:
|
||||
switch (iNum)
|
||||
{
|
||||
case 1:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"m",lMyloc);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"h_alt",lMyloc);
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sMytag+"b",lMyloc);
|
||||
break;
|
||||
}
|
||||
//CreateObject(OBJECT_TYPE_CREATURE,sMytag,lMyloc);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);//interactive placeables
|
||||
break;
|
||||
|
||||
case 3:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sPtag+sNum,lMyloc);//mundane placeables
|
||||
break;
|
||||
|
||||
case 4:
|
||||
CreateObject(OBJECT_TYPE_ITEM,sMytag+"_"+sSix,lMyloc);//loose items
|
||||
break;
|
||||
|
||||
case 5:
|
||||
CreateObject(OBJECT_TYPE_CREATURE,sPtag+sNum,lMyloc);//special encounters
|
||||
break;
|
||||
|
||||
case 6:
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,sMytag,lMyloc);//treasure chests
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
oSpawn = GetNextObjectInArea(OBJECT_SELF);
|
||||
iSpawn = GetLocalInt(oSpawn,"done");
|
||||
//SendMessageToPC(oPC,"get next wp");
|
||||
|
||||
SetEventScript(OBJECT_SELF, EVENT_SCRIPT_AREA_ON_EXIT, "area_onexit");
|
||||
}
|
||||
} */
|
||||
@@ -43,7 +43,7 @@ void main()
|
||||
SetEventScript(GetModule(), EVENT_SCRIPT_MODULE_ON_PLAYER_TARGET, "mod_target");
|
||||
SetEventScript(GetModule(), EVENT_SCRIPT_MODULE_ON_PLAYER_GUIEVENT, "mod_gui"); */
|
||||
|
||||
NUI();
|
||||
// NUI();
|
||||
|
||||
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
|
||||
{
|
||||
|
||||
67
_module/nss/zep_drider_spawn.nss
Normal file
67
_module/nss/zep_drider_spawn.nss
Normal file
@@ -0,0 +1,67 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: NW_C2_DIMDOORS.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
OnSpawnIn, sets up creature to teleport
|
||||
during combat (requires NW_C2_DIMDOOR.nss on the
|
||||
user defined event for the creature)
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By:
|
||||
//:: Created On:
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#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_APPEAR_SPAWN_IN_ANIMATION);
|
||||
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
|
||||
// This will set the NPC to give a warning to non-enemies before attacking
|
||||
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_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.
|
||||
|
||||
ExecuteScript("prc_pwonspawn");
|
||||
}
|
||||
|
||||
68
_module/nss/zep_scorp_spawn.nss
Normal file
68
_module/nss/zep_scorp_spawn.nss
Normal file
@@ -0,0 +1,68 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: NW_C2_DIMDOORS.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
OnSpawnIn, sets up scorpions to teleport
|
||||
during combat (requires scorp_onuserdef in the
|
||||
user defined event slot for the creature)
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By:
|
||||
//:: Created On:
|
||||
//:: Modified By: Luna_C on 5/24/2003 for Scorpions Demo v1.0
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#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_APPEAR_SPAWN_IN_ANIMATION);
|
||||
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
|
||||
// This will set the NPC to give a warning to non-enemies before attacking
|
||||
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_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.
|
||||
|
||||
ExecuteScript("prc_pwonspawn");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user