Initial upload

Initial upload.
This commit is contained in:
Jaysyn904
2023-11-14 12:09:02 -05:00
parent 657466db0c
commit 08e84b4e71
1674 changed files with 1227255 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
#include "NW_O2_CONINCLUDE"
void main()
{
// Set respawntime float to the number of seconds.
float respawntime = 3600.00;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
location llocation = GetLocation(OBJECT_SELF);
// GenerateHighTreasure(oLastOpener, OBJECT_SELF);
int nTChance = d20(1);
if(nTChance == 1) {
CreateItemOnObject("hairofthedog", OBJECT_SELF, 1);
}
if(nTChance == 2) {
object oStirg1 = CreateObject(OBJECT_TYPE_CREATURE, "wraith001", llocation, FALSE);
object oStirg2 = CreateObject(OBJECT_TYPE_CREATURE, "wraith001", llocation, FALSE);
object oStirg3 = CreateObject(OBJECT_TYPE_CREATURE, "wraith001", llocation, FALSE);
object oStirg4 = CreateObject(OBJECT_TYPE_CREATURE, "wraith001", llocation, FALSE);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance == 3) {
object oStirg1 = CreateObject(OBJECT_TYPE_CREATURE, "golbone002", llocation, FALSE);
object oStirg2 = CreateObject(OBJECT_TYPE_CREATURE, "golbone002", llocation, FALSE);
object oStirg3 = CreateObject(OBJECT_TYPE_CREATURE, "golbone002", llocation, FALSE);
object oStirg4 = CreateObject(OBJECT_TYPE_CREATURE, "golbone002", llocation, FALSE);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance == 4) {
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance > 4 && nTChance < 8) {
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance > 7 && nTChance < 11) {
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance > 10 && nTChance < 20) {
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
if(nTChance == 20) {
int nGenieChance = d20(1);
if(nGenieChance > 10) {
object oGenie = CreateObject(OBJECT_TYPE_CREATURE, "agenie", llocation, FALSE);
} else {
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
}
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
AssignCommand( OBJECT_SELF, DelayCommand(360.0, SetLocked(OBJECT_SELF, TRUE)) );
}

155
_module/nss/aquiremarks.nss Normal file
View File

@@ -0,0 +1,155 @@
#include "x2_inc_switches"
// this function ripped from contest of champions
void ApplyFlagEffect( object oPlayer )
{
int nTeam, nVisEffect;
effect eFlagEffect;
nTeam = GetLocalInt(oPlayer, "m_nTeam");
nVisEffect = VFX_DUR_FLAG_GOLD;
if(nTeam == 1)
nVisEffect = VFX_DUR_FLAG_BLUE;
if(nTeam == 2)
nVisEffect = VFX_DUR_FLAG_RED;
// }
// else if ( nTeam == TEAM_RED )
// {
// nVisEffect = VFX_DUR_FLAG_RED;
// }
// else if ( nTeam == TEAM_GOLD )
// {
// nVisEffect = VFX_DUR_FLAG_PURPLE;
// }
// else if ( nTeam == TEAM_PURPLE )
// {
// nVisEffect = VFX_DUR_FLAG_GOLD;
// }
eFlagEffect = EffectVisualEffect(nVisEffect);
eFlagEffect = SupernaturalEffect(eFlagEffect);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFlagEffect,oPlayer);
PlaySound("as_mg_telepout1");
}
void RemoveAllEffects( object oPlayer )
{
effect eEffect;
eEffect = GetFirstEffect(oPlayer);
while ( GetIsEffectValid(eEffect) == TRUE )
{
if ( GetEffectDurationType(eEffect) == DURATION_TYPE_TEMPORARY ||
GetEffectDurationType(eEffect) == DURATION_TYPE_PERMANENT )
{
RemoveEffect(oPlayer,eEffect);
}
eEffect = GetNextEffect(oPlayer);
}
}
void main()
{
object oItem = GetModuleItemAcquired();
object oPC = GetItemPossessor(oItem);
int nYes;
string sItemTag = GetTag(oItem);
// * 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;
}
}
// check to see if the acquired item is a "mark"
if(sItemTag == "FalseMark")
nYes = 1;
if(sItemTag == "MarkofOron")
nYes = 1;
if(sItemTag == "MarkofGamlee")
nYes = 1;
if(sItemTag == "MarkofZool")
nYes = 1;
if(sItemTag == "MarkofMaro")
nYes = 1;
// check for the presence of magic bags
int nBagYes;
object oInvItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oInvItem) != 0)
{
if(GetName(oInvItem) == "Magic Bag") {
nBagYes = 1;
}
oInvItem = GetNextItemInInventory(oPC);
}
// if acquiring a mark and have magic bag in inv, destroy mark
if(nBagYes == 1 && nYes == 1) {
DestroyObject(oItem);
return;
}
// if acquiring magic bag, check for presence and destroy marks
if(GetName(oItem) == "Magic Bag") {
object oInv2 = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oInv2) != 0) {
if(GetTag(oInv2) == "FalseMark") {
DestroyObject(oInv2);
RemoveAllEffects(oPC);
}
if(GetTag(oInv2) == "MarkofGamlee") {
DestroyObject(oInv2);
RemoveAllEffects(oPC);
}
if(GetTag(oInv2) == "MarkofOron") {
DestroyObject(oInv2);
RemoveAllEffects(oPC);
}
if(GetTag(oInv2) == "MarkofMaro") {
DestroyObject(oInv2);
RemoveAllEffects(oPC);
}
if(GetTag(oInv2) == "MarkofZool") {
DestroyObject(oInv2);
RemoveAllEffects(oPC);
}
oInv2 = GetNextItemInInventory(oPC);
}
}
// if mark, apply the flag effect to the player
if(nYes == 1) {
if(oPC == OBJECT_INVALID)
return;
AssignCommand(oPC, DelayCommand(3.0, ApplyFlagEffect(oPC)));
}
}

View File

@@ -0,0 +1,34 @@
void main()
{
} int preEvent()
{
object oItem = GetModuleItemAcquired();
object oPC = GetItemPossessor(oItem);
object oItemOwner = GetModuleItemAcquiredFrom();
string sItemName = GetName (oItem);
string sPlayerName = GetName (oPC);
string sItemOwnerName = GetName (oItemOwner);
object oPartyMember = GetFirstFactionMember (oPC);
if (!GetIsObjectValid (oItemOwner))
{
while (GetIsObjectValid(oPartyMember))
{
SendMessageToPC (oPartyMember, sPlayerName + " has accquired " + sItemName + " from the ground.");
oPartyMember = GetNextFactionMember (oPC);
WriteTimestampedLogEntry (sPlayerName + " has accquired " + sItemName + " from the ground.");
}
return TRUE;
}
if ((GetObjectType (oItemOwner) == OBJECT_TYPE_PLACEABLE)
|| (GetObjectType (oItemOwner) == OBJECT_TYPE_CREATURE))
{
while (GetIsObjectValid(oPartyMember))
{
SendMessageToPC (oPartyMember, sPlayerName + " has accquired " + sItemName + " from " + sItemOwnerName);
oPartyMember = GetNextFactionMember (oPC);
WriteTimestampedLogEntry (sPlayerName + " has accquired " + sItemName + " from " + sItemOwnerName);
}
}
return TRUE;
}

View File

@@ -0,0 +1,143 @@
//#include "inc_array"
#include "nwnx_time"
// nwnx_data also includes inc_array, so don't double dip.
#include "nwnx_data"
void Log(string msg)
{
WriteTimestampedLogEntry(msg);
}
void TestArrayOnModule()
{
string array = "test";
// By default, temporary arrays are created on the module.
Array_PushBack_Str(array, "BItem1");
Array_PushBack_Str(array, "AItem2");
Array_PushBack_Str(array, "AItem3");
Array_PushBack_Str(array, "BItem2");
Array_Debug_Dump(array, "After first load");
int foo = Array_Find_Str(array, "AItem3");
Log("Found element AItem3 at index = " + IntToString(foo));
Array_Set_Str(array, 2, "Suck it up...");
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
Array_Erase(array, 1);
Array_Debug_Dump(array, "After delete 1");
Array_PushBack_Str(array, "MItem1");
Array_PushBack_Str(array, "QItem2");
Array_PushBack_Str(array, "NItem3");
Array_PushBack_Str(array, "KItem2");
Array_Debug_Dump(array, "After add more");
Array_SortAscending(array);
Array_Debug_Dump(array, "After sort");
Array_Shuffle(array);
Array_Debug_Dump(array, "After shuffle");
Log( (Array_Contains_Str(array, "NItem3")) ? "Passed.. found it" : "Failed.. should have found it" );
Log( (Array_Contains_Str(array, "KItem2")) ? "Passed.. found it" : "Failed.. should have found it" );
Log( (Array_Contains_Str(array, "xxxxxx")) ? "Failed.. not found" : "Passed.. should not exist" );
Array_Clear(array);
// Load up the array with 100 entries
int i;
struct NWNX_Time_HighResTimestamp b;
b = NWNX_Time_GetHighResTimeStamp();
Log("Start Time: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
for (i=0; i<1000; i++)
{
Array_PushBack_Str(array, IntToString(d100()) + " xxx " + IntToString(i));
}
b = NWNX_Time_GetHighResTimeStamp();
Log("Loaded 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
Array_Shuffle(array);
b = NWNX_Time_GetHighResTimeStamp();
Log("Shuffled 1000: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
for (i=5; i<995; i++)
{
// Delete the third entry a bunch of times
Array_Erase(array, 3);
}
b = NWNX_Time_GetHighResTimeStamp();
Log("Delete ~990: " + IntToString(b.seconds) + "." + IntToString(b.microseconds));
Array_Debug_Dump(array, "After mass insert/delete");
}
void TestArrayOnChicken()
{
string array="chicken";
// Let's create an array "on" our favorite creature: the deadly nw_chicken
// Note - arrays aren't really attached to the item, but the module, and they
// are tagged with the objects string representation.
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation());
if (!GetIsObjectValid(oCreature))
{
Log("NWNX_Creature test: Failed to create creature");
return;
}
Array_PushBack_Str(array, "BItem1", oCreature);
Array_PushBack_Str(array, "AItem2", oCreature);
Array_PushBack_Str(array, "AItem3", oCreature);
Array_PushBack_Str(array, "BItem2", oCreature);
Array_Debug_Dump(array, "After Chicken array load", oCreature);
}
void TestNWNXArray()
{
Log("");
Log("Start NWNX_Data test.");
string array = "test2";
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem2");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "ZItem3");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "XItem2");
Array_Debug_Dump(array, "After first load");
int foo = NWNX_Data_Array_Find_Str(GetModule(), array, "ZItem3");
Log("Found element AItem3 at index = " + IntToString(foo));
NWNX_Data_Array_Set_Str(GetModule(), array, 2, "Suck it up...");
Array_Debug_Dump(array, "After set 2 = 'Suck it up...'");
NWNX_Data_Array_Erase(NWNX_DATA_TYPE_STRING, GetModule(), array, 1);
Array_Debug_Dump(array, "After delete 1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "MItem1");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "QItem2");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "NItem3");
NWNX_Data_Array_PushBack_Str(GetModule(), array, "KItem2");
Array_Debug_Dump(array, "After add more");
NWNX_Data_Array_SortAscending(NWNX_DATA_TYPE_STRING, GetModule(), array);
Array_Debug_Dump(array, "After sort");
}
// Uncomment and assign to some event click.
/* */
void main()
{
Log("Start");
TestArrayOnModule();
TestArrayOnChicken();
TestNWNXArray();
}
/* */

View File

@@ -0,0 +1,17 @@
#include "NW_O2_CONINCLUDE"
void main()
{
// Set respawntime float to the number of seconds.
float respawntime = 1200.00;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
}

View File

@@ -0,0 +1,58 @@
//::///////////////////////////////////////////////
//:: Default:On Death
//:: NW_C2_DEFAULT7
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Shouts to allies that they have been killed
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_death", OBJECT_SELF);
object oArea = GetArea(OBJECT_SELF);
string sAreaTag = GetTag(oArea);
string sAreaName;
object oKiller = GetLastKiller();
string sKillerName = GetName(oKiller);
sAreaName = "some place";
if(sAreaTag == "BagWayNorth")
sAreaName = "Bag Way North";
if(sAreaTag == "BagWaySouth")
sAreaName = "Bag Way South";
if(sAreaTag == "TheNoblesCrypt")
sAreaName = "The Crypt Level One";
if(sAreaTag == "HillGiantValley")
sAreaName = "Hill Giant Valley";
if(sAreaTag == "MelviksMaddeningMaze")
sAreaName = "Melvik's Maddening Maze";
if(sAreaTag == "Gehenna")
sAreaName = "Gehenna";
SpeakString("Alas! I have been slain by " + sKillerName + " in " +
sAreaName + "!", TALKVOLUME_SHOUT);
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
{
object oKiller = GetLastKiller();
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
}
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);
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
}

View File

@@ -0,0 +1,41 @@
// bleeding_config by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial
// Included file, just make sure its named "bleeding_config"
// *** Configuration Variables - These are meant to be changed ***
int iStabilizationChance = 10;
// GUI Options When Disabled (0 HP)
string sDisabledGUIMessage = "You've been disabled. You can either wait for another player to help or respawn if nobody else is around.";
int bAllowRespawnWhenDisabled = TRUE;
int bAllowWaitForHelpWhenDisabled = TRUE;
// GUI Options When Stable (-1 to -9 and not bleeding)
string sStableGUIMessage = "You've stabilized! You can either wait for another player to help or respawn if nobody else is around.";
int bAllowRespawnWhenStable = TRUE;
int bAllowWaitForHelpWhenStable = TRUE;
// GUI Options When Dead (-10 or lower)
string sDeathGUIMessage = "You've died! Here are your options...";
int bAllowRespawnWhenDead = TRUE;
int bAllowWaitForHelpWhenDead = TRUE;
// *** Constants - DO NOT CHANGE THESE! ***
int PC_HEALTH_ALIVE = 0; // HP > 0
int PC_HEALTH_DISABLED = 1; // HP = 0
int PC_HEALTH_DYING = 2; // -10 < HP < 0 & Bleeding
int PC_HEALTH_STABLE = 3; // -10 < HP < 0 & Stabilized
int PC_HEALTH_DEAD = 4; // HP <= -10
// A tool to help us test
void SetPCHitPoints(object oPC, int iTargetHitPoints) {
if (GetIsPC(oPC)) {
int iDamage = GetCurrentHitPoints(oPC) - iTargetHitPoints;
effect eDamage = EffectDamage(iDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
}
}

View File

@@ -0,0 +1,135 @@
// Module : OnModuleLoad by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial
#include "x2_inc_switches"
#include "x2_inc_restsys"
void main()
{
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();
}
// * In the following section there are examples for setting various options
// * in horse package. For more information look in the "x3_inc_horse".
// * Ignores terrain height differencies while deciding whether to play mounting
// * animation or not (if the elevation difference between rider and horse in
// * hilly terrain is large, clipping occurs and the rider animates either above
// * the horse or sinks in the horse during animation, which may look funny).
SetLocalInt(GetModule(),"bX3_MOUNT_NO_ZAXIS",TRUE);
// * This tells how long you have left in seconds before you will be force-mounted
// * if you got stuck while moving to horse in mounting procedure, unless you
// * are using X3_HORSE_ACT_VS_DELAY method, where you can interrupt your movement
// * before reaching the mounting spot.
//SetLocalFloat(GetModule(),"fX3_TIMEOUT_TO_MOUNT",12.0f);
// * Once per fX3_FREQUENCY (default = 1.0s) seconds character will retry to
// * get on the right path when moving to horse in case he gets stuck or
// * something makes him temporarily stuck, if he doesnt get to horse in
// * fX3_TIMEOUT_TO_MOUNT seconds, he is forced to mount.
//SetLocalFloat(GetModule(),"fX3_FREQUENCY",2.0);
// * Use this if you want characters to be able to interrupt the mounting
// * procedure before they get to the horse (ie. by clicking on the ground).
//SetLocalInt(GetModule(),"X3_HORSE_ACT_VS_DELAY",TRUE);
// * Use horse's inventory as a storage for saddlebag content.
//SetLocalInt(GetModule(),"X3_HORSE_ENABLE_SADDLEBAGS",TRUE);
// * Dont forget to place the storage waypoint for this to work!
//SetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE","NAME");
// * Doesnt apply speed bonus when mounted.
//SetLocalInt(GetModule(),"X3_HORSE_DISABLE_SPEED",TRUE);
// * Mounts are allowed in exterior areas only.
SetLocalInt(GetModule(),"X3_MOUNTS_EXTERNAL_ONLY",TRUE);
// * No horses are allowed underground.
SetLocalInt(GetModule(),"X3_MOUNTS_NO_UNDERGROUND",TRUE);
// * Possible trouble-shoot for situation when players would be left in an
// * uncommandable state (it should never happen however)
//SetLocalInt(GetModule(),"X3_NO_MOUNT_COMMANDABLE",TRUE);
// Everybody is assumed to be living when the module loads
object oModule = GetModule();
SetLocalInt(oModule, "EverybodyAlive", TRUE);
}

17
_module/nss/blotto_sc.nss Normal file
View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: FileName blotto_sc
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 8/9/2002 9:57:48 PM
//:://////////////////////////////////////////////
void main()
{
// Either open the store with that tag or let the user know that no store exists.
object oStore = GetNearestObjectByTag("Blotto_mt");
if(GetObjectType(oStore) == OBJECT_TYPE_STORE)
OpenStore(oStore, GetPCSpeaker());
else
ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK);
}

160
_module/nss/breeder.nss Normal file
View File

@@ -0,0 +1,160 @@
/*
NOTES:
This is the making of a pretty unique trap that has no triggers or anything (of course you could link it to a trigger if you wanted). For a single PC that cannot kill one of these monsters rather quickly (less than BREED_STATE_MAX heartbeats), it will be viscious. For a group of players this could prove to be quite a fun "trap" to deal with. I suggest the monster(s) you attach this script to be on the easy to very-easy scale for the players you intend it for. Its completely adjustable. This could be adjusted so that there was one alpha-monster that when killed, every thing stopped breeding. In this example, however, they dont stop until you kill them all.
**WARNING**:
Its a good idea NOT to set so many creatures to spawn that it takes more than a heartbeat to spawn them, that could get NASTY. Its best to keep the number of creatures spawned VERY low, like 2. For example, with the BREED_AMOUNT set to the constant of 2, if no monsters are killed, but the spawn conditions are met and they are set to breed every heartbeat, 1 monster makes 2 more for a total of 3. Those 3 each make 2 more for a total of (3 + 3*2) 9. Those 9 each spawn 2 more, for a total of (9 + 9*2) = 27. The growth rate formula is as follows:
n = starting number of creatures
b = number of successful breeds thus far
n * ((BREED_AMOUNT + 1)^b)
in the example above, BREED_AMOUNT is 2 and we started with 1 creature. So for the 3rd successful breeding we would get (assuming NONE died):
1 * ((2+1)^3) = 1 * (3^3) = 27.
Continuing on with one more breeding in above example, you get:
1 * ((2+1)^4) = 1 * (3^4) = 81.
And once more you get:
1 * ((2+1)^5) = 1 * (3^5) = 243 (Yikes)
This is why i put the MAX_MONSTERS in the area so that it cant get out of hand. This is also why i put the BREED_STATE-- in when it cant successfully breed but the other conditions are met. This aleviates some of the race condition and explosive population growth. If the variables are not set correctly and with extreme care, the players will easily get into the situation where they cannot kill the monsters fast enough. This makes for an interesting situation, and will more than likely force the players to run or die.
INSTRUCTIONS:
- Create a monster (ideally a weak one) that has a tag and blueprint name that are the same (in my tests the monster tag was breeder_beetle as well as the blueprint res/ref)
- edit the scripts for this monster and place the appropriate code (below) in the corresponding scripts
- setup the variables (below) in the On User Defined Script
- Set the BREED_STATE_MAX = the number of successive heartbeats needed before the monster can call its Breed() function
- Set the BREED_AMOUNT = the number of creatures you want spawned when Breed() is called. This can be constant or random, you decide
- ex: BREED_AMOUNT = 5 (This will spawn 5 every time Breed() is called)
- ex: BREED_AMOUNT = d6() (this will spawn 1-6 every time Breed is called)
- Set the BREED_PERCENTAGE = the whole number percentage (1-100) chance you want this creature to have a successful breed when it gets the opportunity
- ex: BREED_PERCENTAGE = 100 (100% chance)
- ex: BREED_PERCENTAGE = 20 (20% chance)
- Set the MAX_MONSTERS = the total number of this creature with this tag that can exist in this area
- Set the MAX_DISTANCE = the total distance in meters (float value), that this creature will allow between him and oNearest before giving up the chase
- ex: MAX_DISTANCE = 25.0 (NOTE: Each square on the grid in the toolset is 10.0 meters)
On Spawn:
- uncomment the lines:
SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
SetSpawnInCondition(NW_FLAG_DEATH_EVENT);
- add line:
SignalEvent(OBJECT_SELF, EventUserDefined(100));
On User Defined:
*/
//::///////////////////////////////////////////////
//:: 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 Breed(string tag, int amount);
void main()
{
// enter desired behaviour here
int nUser = GetUserDefinedEventNumber();
object oObject; // objects in the area
int nCounter = 0; // monster counter
object oNearest; // the nearest alive enemy that i can see
object area = GetArea(OBJECT_SELF); // the area we are in
string tag = GetTag(OBJECT_SELF); // my tag
float MAX_DISTANCE = 25.0; // in meters, if distance between monster and oNearest is greater than this, the monster will give up chasing
int MAX_MONSTERS = 30; // the total number of these creatures that can be in the area at once (to keep them from going forever)
int BREED_AMOUNT = 1; // the amount to breed each time
int BREED_PERCENTAGE = 100; // the % chance (as a whole number) that they have to breed
int BREED_STATE_MAX = 10; // number of successive heartbeats needed to breed
int BREED_STATE = GetLocalInt(OBJECT_SELF, "BREED_STATE"); // the current breeding state of this monster
switch (nUser) {
case 100: // OnSpawn (100 in my example, but really its just whatever number you specified in the On Spawn script for this creature)
//SetLocalInt(area, tag + "_TOTAL", GetLocalInt(area, tag + "_TOTAL") + 1); // increment the total
oObject = GetFirstObjectInArea(area);
while (oObject != OBJECT_INVALID)
{
if(GetTag(oObject) == GetTag(OBJECT_SELF)) {
nCounter++;
}
oObject = GetNextObjectInArea(area);
}
SetLocalInt(area, tag + "_TOTAL", nCounter);
SetLocalInt(area, tag + "_MAX", MAX_MONSTERS); // set the max for the heck of it, so we dont have the pass the max amount around
SetLocalInt(OBJECT_SELF, "BREED_STATE", 1); // initialize the BREED_STATE to 1
break;
case 1001: // OnHeartBeat
// give me the nearest enemy thats alive and that i can see
oNearest = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
// SpeakString("DISTANCE = " + FloatToString(GetDistanceToObject(oNearest)));
if (GetIsObjectValid(oNearest) && GetDistanceToObject(oNearest) <= MAX_DISTANCE) {
BREED_STATE++;
if (BREED_STATE >= BREED_STATE_MAX) { // are we ready to breed?
if (GetLocalInt(area, tag + "_TOTAL") < MAX_MONSTERS) { // is there any room?
if (Random(100) <= BREED_PERCENTAGE) { // lets see if we are successful...
Breed(tag, BREED_AMOUNT); // lets make some babies!
BREED_STATE = 1;
}
else { // darn it, better luck next time!
BREED_STATE--; // every time it cant breed, lower its state by 1
// to keep them from all breeding at once when
// being held up by other conditions
}
}
else { // ugh too many of us, gotta wait cause we were told to
BREED_STATE--; // every time it cant breed, lower its state by 1
// to keep them from all breeding at once when
// being held up by other conditions
}
}
}
else { // too far away, gonna give up
BREED_STATE--; // every time it cant breed, lower its state by 1
// to keep them from all breeding at once when
// being held up by other conditions
ClearAllActions(); // give up
}
if (BREED_STATE < 1) { // just to make sure it doesnt go below 1
BREED_STATE = 1;
}
SetLocalInt(OBJECT_SELF, "BREED_STATE", BREED_STATE); // remember the last BREED_STATE
break;
case 1007: // OnDeath
SetLocalInt(area, tag + "_TOTAL", GetLocalInt(area, tag + "_TOTAL") - 1); // i died, so i can lower the total by 1
break;
}
}
void Breed(string tag, int amount) {
object area = GetArea(OBJECT_SELF);
int count = 1;
int total = GetLocalInt(area, tag + "_TOTAL");
int max = GetLocalInt(area, tag + "_MAX");
while (count <= amount && total < max) {
CreateObject(OBJECT_TYPE_CREATURE, tag, GetLocation(OBJECT_SELF));
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_ACID), GetLocation(OBJECT_SELF));
total = GetLocalInt(area, tag + "_TOTAL"); // dont have to increment total here, its done via OnSpawn
count++;
}
}

View File

@@ -0,0 +1,76 @@
//::///////////////////////////////////////////////
//:: 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
SignalEvent(OBJECT_SELF, EventUserDefined(100));
// 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
}

View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: FileName brenwyr_sc
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 9/25/2002 3:33:19 AM
//:://////////////////////////////////////////////
void main()
{
// Either open the store with that tag or let the user know that no store exists.
object oStore = GetNearestObjectByTag("Brenwyr_mt");
if(GetObjectType(oStore) == OBJECT_TYPE_STORE)
OpenStore(oStore, GetPCSpeaker());
else
ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK);
}

View File

@@ -0,0 +1,6 @@
void main()
{
object oUser = GetLastUsedBy();
ActionStartConversation(oUser, "burgher");
}

View File

@@ -0,0 +1,29 @@
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v1.0, 2002-06-25
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
// damage (Reflex save DC 15)
//Notes:
// v1.0: Release version
// tdh - altered this for disease instead of fire
#include "prc_inc_spells"
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 30, float fRadius = 3.) {
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_EVIL), lTarget);
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
do {
// if (FortitudeSave(oObject, nSaveDC, SAVING_THROW_TYPE_DISEASE, OBJECT_SELF)==0) {
ApplyEffectToObject( DURATION_TYPE_PERMANENT, EffectDisease(DISEASE_ZOMBIE_CREEP), oObject);
// }
// int nDamageAfterSave = GetReflexAdjustedDamage(nDamage, oObject, nSaveDC);
// ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_FIRE), oObject);
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
//
void main()
{
location lSource = GetLocation(OBJECT_SELF);
DelayCommand(3., ExplodeAtLocation(lSource, d10(2)));
}

View File

@@ -0,0 +1,25 @@
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v1.0, 2002-06-25
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
// damage (Reflex save DC 15)
//Notes:
// v1.0: Release version
// tdh - I changed reflex to 18 and damage to 2d10
#include "prc_inc_spells"
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 18, float fRadius = 3.) {
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIREBALL), lTarget);
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
do {
int nDamageAfterSave = PRCGetReflexAdjustedDamage(nDamage, oObject, nSaveDC);
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_FIRE), oObject);
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
//
void main()
{
location lSource = GetLocation(OBJECT_SELF);
DelayCommand(3., ExplodeAtLocation(lSource, d10(2)));
}

View File

@@ -0,0 +1,25 @@
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v1.0, 2002-06-25
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
// damage (Reflex save DC 15)
//Notes:
// v1.0: Release version
// tdh - I changed reflex to 18 and damage to 2d10
#include "prc_inc_spells"
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 25, float fRadius = 3.) {
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIREBALL), lTarget);
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
do {
int nDamageAfterSave = PRCGetReflexAdjustedDamage(nDamage, oObject, nSaveDC);
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_FIRE), oObject);
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
//
void main()
{
location lSource = GetLocation(OBJECT_SELF);
DelayCommand(3., ExplodeAtLocation(lSource, d10(4)));
}

View File

@@ -0,0 +1,25 @@
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v1.0, 2002-06-25
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
// damage (Reflex save DC 15)
//Notes:
// v1.0: Release version
// tdh - I changed reflex to 18 and damage to 2d10
#include "prc_inc_spells"
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 24, float fRadius = 3.) {
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_MIND), lTarget);
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
do {
int nDamageAfterSave = PRCGetReflexAdjustedDamage(nDamage, oObject, nSaveDC);
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_ACID), oObject);
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
//
void main()
{
location lSource = GetLocation(OBJECT_SELF);
DelayCommand(3., ExplodeAtLocation(lSource, d10(4)));
}

View File

@@ -0,0 +1,25 @@
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v1.0, 2002-06-25
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
// damage (Reflex save DC 15)
//Notes:
// v1.0: Release version
// tdh - I changed reflex to 18 and damage to 2d10
#include "prc_inc_spells"
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 18, float fRadius = 3.) {
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HORRID_WILTING), lTarget);
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
do {
// int nDamageAfterSave = GetReflexAdjustedDamage(nDamage, oObject, nSaveDC);
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_NEGATIVE), oObject);
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
//
void main()
{
location lSource = GetLocation(OBJECT_SELF);
DelayCommand(3., ExplodeAtLocation(lSource, d10(2)));
}

View 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()
{
// CreateItemOnObject("GoblinScalp2", OBJECT_SELF);
// 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
// Below is the stuff I added -tdh
AssignCommand(OBJECT_SELF, DelayCommand(900.00, ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), GetLocation(OBJECT_SELF))));
AssignCommand(OBJECT_SELF, DelayCommand(901.00, DestroyObject(OBJECT_SELF) ) );
}

View File

@@ -0,0 +1,18 @@
#include "NW_O2_CONINCLUDE"
void main()
{
// Set respawntime float to the number of seconds.
float respawntime = 1200.00;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
AssignCommand( OBJECT_SELF, DelayCommand(240.0, SetLocked(OBJECT_SELF, TRUE)) );
}

73
_module/nss/clearinv.nss Normal file
View File

@@ -0,0 +1,73 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Created By: Astaroth
* Created On: 6/22/2002
* Clears a PC's inventory when he/she first enters the trigger.
* Only runs once, when CLEAR_INV_SCENE variable equals 0.
* After running, CLEAR_INV_SCENE is set to 1 so PC's
* inventory isn't cleared again should he/she walk back into
* the trigger for whatever reason.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void main()
{
object oEnteringPC;
object oInvItem;
// Get the object that last entered this area
oEnteringPC = GetEnteringObject();
// Make sure the object is a PC
if (GetIsPC(oEnteringPC))
{
// Only clear inventory if we haven't already done it before
if (GetLocalInt(oEnteringPC, "CLEAR_INV_SCENE1") == 0)
{
oInvItem = GetFirstItemInInventory(oEnteringPC);
while (oInvItem != OBJECT_INVALID)
{
//ActionTakeItem(oInvItem, oEnteringPC);
DestroyObject(oInvItem);
oInvItem = GetNextItemInInventory(oEnteringPC);
}
// Since GetNextItemInInvetory() seems to not return equipped items,
// we need to manually remove them one by one.
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_ARMS, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_ARROWS, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_BELT, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_BOLTS, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_BOOTS, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_BULLETS, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CLOAK, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_HEAD, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_NECK, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oEnteringPC)) )
DestroyObject(oInvItem);
if ( OBJECT_INVALID != (oInvItem = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oEnteringPC)) )
DestroyObject(oInvItem);
// Make sure this script doesn't run anymore for the current PC
SetLocalInt(oEnteringPC, "CLEAR_INV_SCENE1", 1);
}
}
}

View File

@@ -0,0 +1,104 @@
#include "bleeding_config"
void main()
{
object oPC = GetEnteringObject();
object oInvItem;
int nPCxp = GetXP(oPC);
if (GetLocalInt(oPC, "Initialized")) {
int iLastHP;
if (GetLocalInt(oPC, "PlayerHealth") == PC_HEALTH_DYING) {
// They left while bleeding so just make em dead
iLastHP = -10;
}
else {
// Set them back to whatever HitPoints they had when they left...
iLastHP = GetLocalInt(oPC, "LastHitPoints");
}
effect eDamage = EffectDamage(GetCurrentHitPoints(oPC) - iLastHP, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
}
else {
// First time they signed on
SetLocalInt(oPC, "Initialized", TRUE);
SetLocalInt(oPC, "LastHitPoints", GetCurrentHitPoints(oPC));
if(nPCxp == 0) {
CreateItemOnObject("noobsguidetoeter", oPC);
CreateItemOnObject("readme", oPC);
}
// CreateItemOnObject("anotheritemchang", oPC);
oInvItem = GetFirstItemInInventory(oPC);
// while (GetIsObjectValid(oInvItem) != 0)
// {
// if (GetTag(oInvItem) == "nw_it_mbelt012") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_it_mbelt013") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_it_mbelt014") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_it_mbelt015") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_it_mring002") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_it_mring030") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "nw_ashmlw006") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "UrlsmasRing") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// if (GetTag(oInvItem) == "UrlsmasGreaterRing") {
// DestroyObject(oInvItem);
// GiveGoldToCreature(oPC, 10000);
// }
// }
// oInvItem = GetNextItemInInventory(oPC);
}
}

View File

@@ -0,0 +1,140 @@
#include "bleeding_config"
#include "x3_inc_horse"
#include "nwnx_webhook"
void RemoveAllEffects( object oPlayer )
{
effect eEffect;
eEffect = GetFirstEffect(oPlayer);
while ( GetIsEffectValid(eEffect) == TRUE )
{
if ( GetEffectDurationType(eEffect) == DURATION_TYPE_TEMPORARY ||
GetEffectDurationType(eEffect) == DURATION_TYPE_PERMANENT )
{
RemoveEffect(oPlayer,eEffect);
}
eEffect = GetNextEffect(oPlayer);
}
}
void main()
{
object oPC=GetEnteringObject();
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
//:: Add PRC journal entries
AddJournalQuestEntry("JRNL_XPCHART", 1, oPC, FALSE, FALSE, FALSE);
AddJournalQuestEntry("JRNL_LA_BUYOFF", 1, oPC, FALSE, FALSE, FALSE);
object oInvItem;
int nPCxp = GetXP(oPC);
if (GetLocalInt(oPC, "Initialized")) {
int iLastHP;
if (GetLocalInt(oPC, "PlayerHealth") == PC_HEALTH_DYING) {
// They left while bleeding so just make em dead
iLastHP = -10;
}
else {
// Set them back to whatever HitPoints they had when they left...
iLastHP = GetLocalInt(oPC, "LastHitPoints");
}
effect eDamage = EffectDamage(GetCurrentHitPoints(oPC) - iLastHP, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
}
else {
// First time they signed on
SetLocalInt(oPC, "Initialized", TRUE);
SetLocalInt(oPC, "LastHitPoints", GetCurrentHitPoints(oPC));
if(nPCxp == 0) {
CreateItemOnObject("noobsguidetoeter", oPC);
// CreateItemOnObject("readme", oPC);
}
CreateItemOnObject("warofthemarks", oPC);
CreateItemOnObject("serverisshutting", oPC);
}
oInvItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oInvItem) != 0)
{
if (GetTag(oInvItem) == "FalseMark") {
DestroyObject(oInvItem);
RemoveAllEffects(oPC);
}
if (GetTag(oInvItem) == "MarkofGamlee") {
DestroyObject(oInvItem);
RemoveAllEffects(oPC);
}
if (GetTag(oInvItem) == "MarkofOron") {
DestroyObject(oInvItem);
RemoveAllEffects(oPC);
}
if (GetTag(oInvItem) == "MarkofMaro") {
DestroyObject(oInvItem);
RemoveAllEffects(oPC);
}
if (GetTag(oInvItem) == "MarkofZool") {
DestroyObject(oInvItem);
RemoveAllEffects(oPC);
}
/* if (GetTag(oInvItem) == "nw_it_mbelt012") {
DestroyObject(oInvItem);
}
if (GetTag(oInvItem) == "nw_it_mbelt013") {
DestroyObject(oInvItem);
}
if (GetTag(oInvItem) == "nw_it_mbelt014") {
DestroyObject(oInvItem);
} */
oInvItem = GetNextItemInInventory(oPC);
}
oInvItem = GetItemInSlot(INVENTORY_SLOT_BELT, oPC);
/* if (GetTag(oInvItem) == "nw_it_mbelt012") {
DestroyObject(oInvItem);
}
if (GetTag(oInvItem) == "nw_it_mbelt013") {
DestroyObject(oInvItem);
}
if (GetTag(oInvItem) == "nw_it_mbelt014") {
DestroyObject(oInvItem);
} */
}

View File

@@ -0,0 +1,10 @@
// Module : OnClientLeave by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial
#include "bleeding_config"
void main() {
// Remember what their hit points were at for when they next sign on...
SetLocalInt(GetExitingObject(), "LastHitPoints", GetCurrentHitPoints(GetExitingObject()));
}

View File

@@ -0,0 +1,41 @@
// Module : OnClientLeave by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial
#include "bleeding_config"
void main() {
// Remember what their hit points were at for when they next sign on...
SetLocalInt(GetExitingObject(), "LastHitPoints", GetCurrentHitPoints(GetExitingObject()));
object oPC = GetExitingObject();
location lPClocation = GetLocation(oPC);
object oInvItem = GetFirstItemInInventory(oPC);
// object oLootBag = CreateObject(OBJECT_TYPE_PLACEABLE, "pclootbag", lPClocation);
int nYes;
string sItemTag;
while (GetIsObjectValid(oInvItem) == TRUE)
{
nYes = 0;
sItemTag = "";
sItemTag = GetTag(oInvItem);
if(sItemTag == "FalseMark")
nYes = 1;
if(sItemTag == "MarkofOron")
nYes = 1;
if(sItemTag == "MarkofGamlee")
nYes = 1;
if(sItemTag == "MarkofMaro")
nYes = 1;
if(sItemTag == "MarkofZool")
nYes = 1;
if(nYes == 1) {
// AssignCommand(oLootBag, ActionTakeItem(oInvItem, oPC));
DestroyObject(oInvItem);
}
oInvItem = GetNextItemInInventory(oPC);
}
}

1644
_module/nss/coc_include.nss Normal file

File diff suppressed because it is too large Load Diff

10
_module/nss/dbar_sc.nss Normal file
View File

@@ -0,0 +1,10 @@
//::///////////////////////////////////////////////
//:: FileName dbar_sc
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 8/7/2002 10:27:17 PM
//:://////////////////////////////////////////////
void main()
{
}

View File

@@ -0,0 +1,21 @@
void DestroyStuff() {
object oInv = GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(oInv) != 0) {
DestroyObject(oInv);
oInv = GetNextItemInInventory(OBJECT_SELF);
}
DestroyObject(OBJECT_SELF);
}
void main()
{
float fTimer = 180.00;
AssignCommand(OBJECT_SELF, DelayCommand(fTimer, DestroyStuff()));
}

View File

@@ -0,0 +1,171 @@
//dmw_activate
// ** This script goes in the OnItemActivation event of your Module
// ** Properties. It checks to see if the item used is a DM Helper
// ** And if so, and the user isnt a DM, destroys it, otherwise it
// ** Starts the DM Helper working. "dmw_inc" contains the actual
// ** code that controls the Helpers effects. If you update anything
// ** in it, you must recompile the calling dmw_<name> script to make
// ** the change take effect.
#include "x2_inc_switches"
void SummonCelestial(location lLocation)
{
object oAlly = CreateObject(OBJECT_TYPE_CREATURE, "celestialally", lLocation, FALSE);
}
void SummonDemon(location lLocation)
{
object oAlly = CreateObject(OBJECT_TYPE_CREATURE, "halfdemonally", lLocation, FALSE);
}
void main()
{
object oItem=GetItemActivated();
object oActivator=GetItemActivator();
// * 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;
}
}
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;
}
if(GetTag(oItem)=="CelestialRelic")
{
location lLocation = GetItemActivatedTargetLocation();
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), lLocation);
DelayCommand(3.0, SummonCelestial(lLocation));
// object oAlly = CreateObject(OBJECT_TYPE_CREATURE, "celestialally", lLocation, FALSE);
}
if(GetTag(oItem)=="DemonicSceptor")
{
location lLocation = GetItemActivatedTargetLocation();
ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_GATE), lLocation);
DelayCommand(3.0, SummonDemon(lLocation));
// object oAlly = CreateObject(OBJECT_TYPE_CREATURE, "halfdemonally", lLocation, FALSE);
}
}

View File

@@ -0,0 +1,32 @@
#include "dmw_inc"
void main()
{
int nCount;
int nCache;
DeleteLocalObject(oMySpeaker, "dmwandtarget");
DeleteLocalLocation(oMySpeaker, "dmwandloc");
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");
}

1425
_module/nss/dmw_conv_inc.nss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 1;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 2;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 3;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 4;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 5;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 6;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 7;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 8;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,8 @@
#include "dmw_dodialog_inc"
void main()
{
int nMyNum = 9;
dmwand_DoDialogChoice(nMyNum);
}

View File

@@ -0,0 +1,218 @@
#include "dmw_inc"
#include "dmw_proto_inc"
#include "dmw_conv_inc"
#include "dmw_test_inc"
#include "dmw_func_inc"
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("ShowAllAttribs", sCall))
{
dmwand_ShowAllAttribs();
return;
}
if(TestStringAgainstPattern("ShowBasicAttribs", sCall))
{
dmwand_ShowBasicAttribs();
return;
}
if(TestStringAgainstPattern("ShowInventory", sCall))
{
dmwand_ShowInventory();
return;
}
if(TestStringAgainstPattern("PlayerListConv", sCall))
{
dmwand_PlayerListConv(sCallParams);
return;
}
if(TestStringAgainstPattern("ShiftAlignment", sCall))
{
string sDir = GetStringLeft(sCallParams, 5);
int nLen = GetStringLength(sCallParams) - 5;
string sAmt = GetSubString(sCallParams, 5, nLen);
dmwand_ShiftAlignment(sDir, StringToInt(sAmt));
return;
}
if(TestStringAgainstPattern("MapArea", sCall))
{
dmwand_MapArea();
return;
}
if(TestStringAgainstPattern("FollowTarget", sCall))
{
dmwand_FollowTarget();
return;
}
if(TestStringAgainstPattern("FollowMe", sCall))
{
dmwand_FollowMe();
return;
}
if(TestStringAgainstPattern("ResumeDefault", sCall))
{
dmwand_ResumeDefault();
return;
}
if(TestStringAgainstPattern("Toad", sCall))
{
dmwand_Toad();
return;
}
if(TestStringAgainstPattern("Untoad", sCall))
{
dmwand_Untoad();
return;
}
if(TestStringAgainstPattern("KickPC", sCall))
{
dmwand_KickPC();
return;
}
if(TestStringAgainstPattern("IdentifyItem", sCall))
{
dmwand_IdentifyItem();
return;
}
if(TestStringAgainstPattern("DestroyItem", sCall))
{
dmwand_DestroyItem();
return;
}
if(TestStringAgainstPattern("TakeItem", sCall))
{
dmwand_TakeItem();
return;
}
if(TestStringAgainstPattern("KillAndReplace", sCall))
{
dmwand_KillAndReplace();
return;
}
if(TestStringAgainstPattern("SwapDayNight", sCall))
{
dmwand_SwapDayNight(StringToInt(sCallParams));
return;
}
if(TestStringAgainstPattern("AdvanceTime", sCall))
{
dmwand_AdvanceTime(StringToInt(sCallParams));
return;
}
if(TestStringAgainstPattern("ReloadModule", sCall))
{
dmwand_ReloadModule();
return;
}
if(TestStringAgainstPattern("TakeAll", sCall))
{
dmwand_TakeAll();
return;
}
if(TestStringAgainstPattern("TakeAllEquipped", sCall))
{
dmwand_TakeAllEquipped();
return;
}
if(TestStringAgainstPattern("TakeAllUnequipped", sCall))
{
dmwand_TakeAllUnequipped();
return;
}
if(TestStringAgainstPattern("AbilityCheck", sCall))
{
int nPrivate = StringToInt(GetStringLeft(sCallParams, 1));
int nLen = GetStringLength(sCallParams) - 1;
int nAbility = StringToInt(GetSubString(sCallParams, 1, nLen));
dmwand_AbilityCheck(nAbility, nPrivate);
return;
}
if(TestStringAgainstPattern("SkillCheck", sCall))
{
int nPrivate = StringToInt(GetStringLeft(sCallParams, 1));
int nLen = GetStringLength(sCallParams) - 1;
int nSkill = StringToInt(GetSubString(sCallParams, 1, nLen));
dmwand_SkillCheck(nSkill, nPrivate);
return;
}
if(TestStringAgainstPattern("DestroyTarget", sCall))
{
dmwand_DestroyTarget();
return;
}
if(TestStringAgainstPattern("DestroyNearbyTarget", sCall))
{
dmwand_DestroyNearbyTarget();
return;
}
if(TestStringAgainstPattern("TurnTargetOn", sCall))
{
dmwand_TurnTargetOn();
return;
}
if(TestStringAgainstPattern("TurnTargetOff", sCall))
{
dmwand_TurnTargetOff();
return;
}
if(TestStringAgainstPattern("TurnNearOff", sCall))
{
dmwand_TurnNearOff();
return;
}
if(TestStringAgainstPattern("TurnNearOn", sCall))
{
dmwand_TurnNearOn();
return;
}
if(TestStringAgainstPattern("ModRep", sCall))
{
dmwand_ModRep(sCallParams);
return;
}
if(TestStringAgainstPattern("ModOneRep", sCall))
{
dmwand_ModOneRep(sCallParams);
return;
}
if(TestStringAgainstPattern("ExportChars", sCall))
{
dmwand_ExportChars();
return;
}
if(TestStringAgainstPattern("JoinParty", sCall))
{
dmwand_JoinParty();
return;
}
if(TestStringAgainstPattern("LeaveParty", sCall))
{
dmwand_LeaveParty();
return;
}
if(TestStringAgainstPattern("JumpPlayerHere", sCall))
{
dmwand_JumpPlayerHere();
return;
}
if(TestStringAgainstPattern("JumpToPlayer", sCall))
{
dmwand_JumpToPlayer();
return;
}
}
}

View File

@@ -0,0 +1,949 @@
#include "dmw_proto_inc"
#include "prc_inc_spells"
//::///////////////////////////////////////////////
//:: File: dmw_func_inc
//::
//:: Useful functions for the DM's Helper
//:://////////////////////////////////////////////
void dmwand_AbilityCheck(int nAbility, int nSecret = TRUE)
{
int nRoll=d20();
int nRank=GetAbilityModifier (nAbility, oMyTarget);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility;
switch(nAbility)
{
case ABILITY_CHARISMA:
sAbility = "Charisma"; break;
case ABILITY_CONSTITUTION:
sAbility = "Constitution"; break;
case ABILITY_DEXTERITY:
sAbility = "Dexterity"; break;
case ABILITY_INTELLIGENCE:
sAbility = "Intelligence"; break;
case ABILITY_STRENGTH:
sAbility = "Strength"; break;
case ABILITY_WISDOM:
sAbility = "Wisdom"; break;
}
SendMessageToPC(oMySpeaker, GetName(oMyTarget)+"'s "+sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult);
if (!nSecret)
{
AssignCommand( oMyTarget, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}
}
void dmwand_AdvanceTime(int nHours)
{
int nCurrentHour = GetTimeHour();
int nCurrentMinute = GetTimeMinute();
int nCurrentSecond = GetTimeSecond();
int nCurrentMilli = GetTimeMillisecond();
nCurrentHour += nHours;
SetTime(nCurrentHour, nCurrentMinute, nCurrentSecond, nCurrentMilli);
dmwand_BuildConversation("TimeOfDay", "");
}
string dmwand_Alignment(object oEntity)
{
string sReturnString;
switch (GetAlignmentLawChaos(oEntity))
{
case ALIGNMENT_LAWFUL: sReturnString = "Lawful "; break;
case ALIGNMENT_NEUTRAL: sReturnString = "Neutral "; break;
case ALIGNMENT_CHAOTIC: sReturnString = "Chaotic "; break;
}
switch (GetAlignmentGoodEvil(oEntity))
{
case ALIGNMENT_GOOD: sReturnString = sReturnString + "Good"; break;
case ALIGNMENT_NEUTRAL: sReturnString = sReturnString + "Neutral"; break;
case ALIGNMENT_EVIL: sReturnString = sReturnString + "Evil"; break;
}
if (sReturnString == "Neutral Neutral"){sReturnString = "True Neutral";}
return sReturnString;
}
string dmwand_ClassLevel(object oEntity)
{
string sReturnString;
string sClass;
string sClassOne;
string sClassTwo;
string sClassThree;
int nLevelOne;
int nLevelTwo;
int nLevelThree;
int iIndex;
// Loop through all eight classes and pull out info
for(iIndex == 1;iIndex < 9;iIndex++)
{
switch (GetClassByPosition(iIndex,oEntity))
{
case CLASS_TYPE_ABERRATION: sClass ="Aberration";break;
case CLASS_TYPE_ANIMAL: sClass ="Animal"; break;
case CLASS_TYPE_BARBARIAN: sClass ="Barbarian";break;
case CLASS_TYPE_BARD: sClass ="Bard"; break;
case CLASS_TYPE_BEAST: sClass ="Beast"; break;
case CLASS_TYPE_CLERIC: sClass ="Cleric"; break;
case CLASS_TYPE_COMMONER: sClass ="Commoner";break;
case CLASS_TYPE_CONSTRUCT: sClass ="Construct"; break;
case CLASS_TYPE_DRAGON: sClass ="Dragon"; break;
case CLASS_TYPE_DRUID: sClass ="Druid";break;
case CLASS_TYPE_ELEMENTAL: sClass ="Elemental"; break;
case CLASS_TYPE_FEY: sClass ="Fey";break;
case CLASS_TYPE_FIGHTER: sClass ="Fighter"; break;
case CLASS_TYPE_GIANT: sClass ="Giant"; break;
case CLASS_TYPE_HUMANOID: sClass ="Humanoid"; break;
case CLASS_TYPE_INVALID: sClass ="";break;
case CLASS_TYPE_MAGICAL_BEAST:sClass ="Magical Beast"; break;
case CLASS_TYPE_MONK: sClass ="Monk"; break;
case CLASS_TYPE_OUTSIDER: sClass ="Outsider"; break;
case CLASS_TYPE_MONSTROUS: sClass ="Monstrous"; break;
case CLASS_TYPE_PALADIN: sClass ="Paladin";break;
case CLASS_TYPE_RANGER: sClass ="Ranger";break;
case CLASS_TYPE_ROGUE: sClass ="Rogue";break;
case CLASS_TYPE_SHAPECHANGER: sClass ="Shapechanger";break;
case CLASS_TYPE_SORCERER: sClass ="Sorcerer";break;
case CLASS_TYPE_UNDEAD: sClass ="Undead";break;
case CLASS_TYPE_VERMIN: sClass ="Vermin"; break;
case CLASS_TYPE_WIZARD: sClass ="Wizard"; break;
}
// Now depending on which iteration we just went through
// assign it to the proper class
switch (iIndex)
{
case 1: sClassOne = sClass; break;
case 2: sClassTwo = sClass; break;
case 3: sClassThree = sClass; break;
}
};
// Now get all three class levels. Wil be 0 if does class pos
//does not exists
nLevelOne = GetLevelByPosition(1,oEntity);
nLevelTwo = GetLevelByPosition(2,oEntity);
nLevelThree = GetLevelByPosition(3,oEntity);
//Start building return string
sReturnString = sClassOne + "(" + IntToString(nLevelOne) + ")" ;
//If second class exists append to return string
if(nLevelTwo > 0)
{
sReturnString =sReturnString + "/" + sClassTwo + "(" + IntToString(nLevelTwo) + ")";
}
//If third class exists append to return string
if(nLevelThree > 0)
{
sReturnString =sReturnString + "/" + sClassThree + "(" + IntToString(nLevelThree) + ")";
}
return sReturnString;
}
void dmwand_DestroyItem()
{
object oItem = GetLocalObject(oMySpeaker, "dmw_item");
if(GetIsObjectValid(oItem))
{
DestroyObject(oItem);
}
dmwand_BuildConversation("ListInventory", "");
}
void dmwand_DestroyNearbyTarget()
{
effect eDestroy = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
object oMyTest = GetFirstObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
while(GetIsObjectValid(oMyTest) && GetIsPC(oMyTest))
{
object oMyTest = GetNextObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
}
if(GetIsObjectValid(oMyTest) && (! GetIsPC(oMyTest)))
{
DestroyObject(oMyTest);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDestroy, lMyLoc);
}
dmwand_BuildConversation("Start", "");
}
void dmwand_DestroyTarget()
{
effect eDestroy = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
DestroyObject(oMyTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDestroy, lMyLoc);
dmwand_BuildConversation("Start", "");
}
void dmwand_ExportChars()
{
ExportAllCharacters();
}
void dmwand_FollowMe()
{
AssignCommand ( oMyTarget, ActionForceFollowObject( oMySpeaker));
}
void dmwand_FollowTarget()
{
AssignCommand ( oMySpeaker, ActionForceFollowObject(oMyTarget));
}
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 "Wierdo";
}
void dmwand_IdentifyItem()
{
object oItem = GetLocalObject(oMySpeaker, "dmw_item");
if(GetIsObjectValid(oItem))
{
SetIdentified(oItem, (GetIdentified(oItem)?FALSE:TRUE));
}
dmwand_BuildConversation("ItemListConv", "");
}
string dmwand_Inventory(object oEntity)
{
string sBaseType;
string sReturnString;
object oItem = GetFirstItemInInventory(oEntity);
while(oItem != OBJECT_INVALID)
{
sReturnString = sReturnString + "\n" + dmwand_ItemInfo(oItem, 0);
oItem = GetNextItemInInventory(oEntity);
};
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"; }
return sReturnString;
}
string dmwand_ItemInfo(object oItem, int nLongForm = 0)
{
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_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_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_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_TWOBLADEDSWORD: sBaseType ="2 Bladed Sword";break;
case BASE_ITEM_WARHAMMER: sBaseType ="Warhammer";break;
}
if (sBaseType != "Gold")
{
// If more than one item (stacked)
if (GetNumStackedItems(oItem) > 1 )
{
sStacked = "(" + IntToString(GetNumStackedItems(oItem)) + ") ";
}
else
{
// Build remainder of output string
sStacked = "";
}
}
if(nLongForm)
{
sIdentified = "Identified: " + ((GetIdentified(oItem))?"Yes":"No");
sGPValue = "Gold Piece Value: " + IntToString(GetGoldPieceValue(oItem));
int nACValue = GetItemACValue(oItem);
if(nACValue) { sACValue = "AC: " + IntToString(nACValue); }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ABILITY_BONUS)) { sProperties = sProperties + "Ability Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS)) { sProperties = sProperties + "AC Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP)) { sProperties = sProperties + "AC Bonus vs. Alignment Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE)) { sProperties = sProperties + "AC Bonus vs. Damage Type\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP)) { sProperties = sProperties + "AC Bonus vs. Racial Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT)) { sProperties = sProperties + "AC Bonus vs. Alignment\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS)) { sProperties = sProperties + "Attack Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP)) { sProperties = sProperties + "Attack Bonus vs. Alignment Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP)) { sProperties = sProperties + "Attack Bonusvs. Racial Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT)) { sProperties = sProperties + "Attack Bonus vs. Alignment\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION)) { sProperties = sProperties + "Weight Reduction\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BONUS_FEAT)) { sProperties = sProperties + "Bonus Feat\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N)) { sProperties = sProperties + "Bonus Spell Slot\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_BOOMERANG)) { sProperties = sProperties + "Boomerang\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_CAST_SPELL)) { sProperties = sProperties + "Cast Spell\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS)) { sProperties = sProperties + "Damage Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP)) { sProperties = sProperties + "Damage Bonus vs. Alignment Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP)) { sProperties = sProperties + "Damage Bonus vs. Racial Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT)) { sProperties = sProperties + "Damage Bonus vs. Alignment\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_REDUCTION)) { sProperties = sProperties + "Damage Reduction\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_RESISTANCE)) { sProperties = sProperties + "Damage Resistance\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_VULNERABILITY)) { sProperties = sProperties + "Damage Vulnerability\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DANCING)) { sProperties = sProperties + "Dancing\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DARKVISION)) { sProperties = sProperties + "Darkvision\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ABILITY_SCORE)) { sProperties = sProperties + "Decreased Ability\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_AC)) { sProperties = sProperties + "Decreased AC\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER)) { sProperties = sProperties + "Decreased Attack Modifier\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_DAMAGE)) { sProperties = sProperties + "Decreased Damage\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER)) { sProperties = sProperties + "Decreased Enhancement Modifier\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SAVING_THROWS)) { sProperties = sProperties + "Decreased Saving Throws\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC)) { sProperties = sProperties + "Decreased Specific Saving Throw\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DECREASED_SKILL_MODIFIER)) { sProperties = sProperties + "Decreased Skill Modifier\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_DOUBLE_STACK)) { sProperties = sProperties + "Double Stack\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCED_CONTAINER_BONUS_SLOTS)) { sProperties = sProperties + "Enhanced Container Bonus Slots\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT)) { sProperties = sProperties + "Enhanced Container Reduced Weight\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS)) { sProperties = sProperties + "Enhancement Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP)) { sProperties = sProperties + "Enhancement Bonus vs. Alignment Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP)) { sProperties = sProperties + "Enhancement Bonus vs. Racial Group\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT)) { sProperties = sProperties + "Enhancement Bonus vs. Alignment\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE)) { sProperties = sProperties + "Extra Melee Damage Type\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE)) { sProperties = sProperties + "Extra Ranged Damage Type\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_FREEDOM_OF_MOVEMENT)) { sProperties = sProperties + "Freedom of Movement\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_HASTE)) { sProperties = sProperties + "Haste\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_HOLY_AVENGER)) { sProperties = sProperties + "Holy Avenger\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE)) { sProperties = sProperties + "Immunity Damage Type\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)) { sProperties = sProperties + "Immunity Miscellaneous\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL)) { sProperties = sProperties + "Immunity Specific Spell\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL)) { sProperties = sProperties + "Immunity Spell School\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL)) { sProperties = sProperties + "Immunity Spell Level\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMPROVED_EVASION)) { sProperties = sProperties + "Improved Evasion\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_KEEN)) { sProperties = sProperties + "Keen\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_LIGHT)) { sProperties = sProperties + "Light\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MASSIVE_CRITICALS)) { sProperties = sProperties + "Massive Criticals\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MIGHTY)) { sProperties = sProperties + "Mighty\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MIND_BLANK)) { sProperties = sProperties + "Mind Blank\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_MONSTER_DAMAGE)) { sProperties = sProperties + "Monster Damage\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_NO_DAMAGE)) { sProperties = sProperties + "No Damage\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_HIT_PROPERTIES)) { sProperties = sProperties + "On Hit\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_MONSTER_HIT)) { sProperties = sProperties + "On Monster Hit\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_POISON)) { sProperties = sProperties + "Poison\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION)) { sProperties = sProperties + "Regeneration\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION_VAMPIRIC)) { sProperties = sProperties + "Vampiric Regeneration\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SAVING_THROW_BONUS)) { sProperties = sProperties + "Saving Throw Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC)) { sProperties = sProperties + "Specific Saving Throw Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SKILL_BONUS)) { sProperties = sProperties + "Skill Bonus\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_SPELL_RESISTANCE)) { sProperties = sProperties + "Spell Resistance\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_THIEVES_TOOLS)) { sProperties = sProperties + "Thieves Tools\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRAP)) { sProperties = sProperties + "Trap\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRUE_SEEING)) { sProperties = sProperties + "True Seeing\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_TURN_RESISTANCE)) { sProperties = sProperties + "Turn Resistance\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_UNLIMITED_AMMUNITION)) { sProperties = sProperties + "Unlimited Ammo\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP)) { sProperties = sProperties + "Alignment Group Use Limitation\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_USE_LIMITATION_CLASS)) { sProperties = sProperties + "Class Use Limitation\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE)) { sProperties = sProperties + "Racial Use Limitation\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT)) { sProperties = sProperties + "Alignment Use Limitation\n"; }
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_USE_LIMITATION_TILESET)) { sProperties = sProperties + "Tileset Use Limitation\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_VORPAL)) { sProperties = sProperties + "Vorpal\n"; }
//:: if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_WOUNDING)) { sProperties = sProperties + "Wounding\n"; }
if(sProperties != "") { sProperties = "Properties:\n" + sProperties; }
sReturnString = sStacked + GetName(oItem) + "\n" +
"-------------------------------------------\n" +
sBaseType + "\n" +
sIdentified + "\n" +
((nACValue)?sACValue + "\n":"") +
sProperties;
}
else
{
sReturnString = sStacked + GetName(oItem) + " (" + sBaseType + ")";
}
return sReturnString;
}
void dmwand_JoinParty()
{
AssignCommand(oMySpeaker, AddToParty( oMySpeaker, GetFactionLeader(oMyTarget)));
}
void dmwand_JumpPlayerHere()
{
location lJumpLoc = GetLocation(oMySpeaker);
AssignCommand(oMyTarget, ActionJumpToLocation(lJumpLoc));
}
void dmwand_JumpToPlayer()
{
location lJumpLoc = GetLocation(oMyTarget);
AssignCommand(oMySpeaker, ActionJumpToLocation(lJumpLoc));
}
void dmwand_KickPC()
{
// Create a lightning strike, thunder, scorch mark, and random small
// lightnings at target's location
AssignCommand( oMySpeaker, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), lMyLoc));
AssignCommand ( oMySpeaker, PlaySound ("as_wt_thundercl3"));
object oScorch = CreateObject ( OBJECT_TYPE_PLACEABLE, "plc_weathmark", lMyLoc, FALSE);
object oTargetArea = GetArea(oMySpeaker);
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( oMySpeaker, ApplyEffectAtLocation ( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_S), lNewLoc));
}
DelayCommand ( 20.0, DestroyObject ( oScorch));
// Kick the target out of the game
BootPC(oMyTarget);
}
void dmwand_KillAndReplace()
{
SetPlotFlag(oMyTarget, FALSE);
AssignCommand(oMyTarget, SetIsDestroyable(FALSE, FALSE));
AssignCommand(oMyTarget, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oMyTarget));
}
void dmwand_LeaveParty()
{
RemoveFromParty(oMySpeaker);
}
void dmwand_MapArea()
{
object omyarea = GetArea(oMySpeaker);
ExploreAreaForPlayer(omyarea, oMyTarget);
}
void dmwand_ModOneRep(string sPlayer)
{
string sAmt = GetLocalString(oMySpeaker, "dmw_repamt");
int nAmt = StringToInt(sAmt);
object oPlayer = GetLocalObject(oMySpeaker, "dmw_playercache" + sPlayer);
AdjustReputation(oPlayer, oMyTarget, nAmt);
AdjustReputation(oMyTarget, oPlayer, nAmt);
}
void dmwand_ModRep(string sAmt)
{
SetLocalString(oMySpeaker, "dmw_repamt", sAmt);
string sAllOrOne = GetLocalString(oMySpeaker, "dmw_repargs");
if(TestStringAgainstPattern(sAllOrOne, "one"))
{
dmwand_BuildConversation("ListPlayers", "func_ModOneRep");
return;
}
int nAmt = StringToInt(sAmt);
object oPlayer = GetFirstPC();
while(GetIsObjectValid(oPlayer))
{
AdjustReputation(oPlayer, oMyTarget, nAmt);
AdjustReputation(oMyTarget, oPlayer, nAmt);
oPlayer = GetNextPC();
}
}
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, "dmwandtarget", oMyTarget);
//Go back to the first conversation level
dmwand_BuildConversation("Start", "");
}
string dmwand_Race(object oEntity)
{
switch (MyPRCGetRacialType(oEntity))
{
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_INVALID: return "Unknown"; break;
case RACIAL_TYPE_MAGICAL_BEAST: return "Magical Beast"; 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";
}
void dmwand_ReloadModule()
{
string sModuleName = GetModuleName();
// SendMessageToPC(oMySpeaker,"CRASHES MODULE-DISABLED");
StartNewModule(sModuleName);
}
void dmwand_ResumeDefault()
{
if(GetIsPC(oMyTarget))
{
AssignCommand ( oMyTarget, ClearAllActions());
}
else
{
ExecuteScript ( "nw_c2_default9", oMyTarget);
}
}
void dmwand_ShiftAlignment(string sAlign, int nShift)
{
if(TestStringAgainstPattern(sAlign, "law__"))
{
AdjustAlignment (oMyTarget, ALIGNMENT_LAWFUL, nShift);
return;
}
if(TestStringAgainstPattern(sAlign, "chaos"))
{
AdjustAlignment (oMyTarget, ALIGNMENT_CHAOTIC, nShift);
return;
}
if(TestStringAgainstPattern(sAlign, "good_"))
{
AdjustAlignment (oMyTarget, ALIGNMENT_GOOD, nShift);
return;
}
if(TestStringAgainstPattern(sAlign, "evil_"))
{
AdjustAlignment (oMyTarget, ALIGNMENT_EVIL, nShift);
return;
}
}
void dmwand_ShowAllAttribs()
{
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) +
"PubCDKey: " + GetPCPublicCDKey(oMyTarget) +
"\nChar Name: " + GetName(oMyTarget) +
"\n-------------------------------------------" +
"\nRace: " + dmwand_Race(oMyTarget) +
"\nClass: " + dmwand_ClassLevel(oMyTarget) +
"\nXP: " + IntToString(GetXP(oMyTarget)) +
"\nGender: " + dmwand_Gender(oMyTarget) +
"\nAign: " + dmwand_Alignment(oMyTarget) +
"\nDiety: " + GetDeity(oMyTarget) +
"\n" +
"\nSTR: " + sSTR +
"\nINT: " + sINT +
"\nWIS: " + sWIS +
"\nDEX: " + sDEX +
"\nCON: " + sCON +
"\nCHA: " + sCHA +
"\n" +
"\nHPs: " + IntToString(GetCurrentHitPoints(oMyTarget)) +
" of " + IntToString(GetMaxHitPoints(oMyTarget)) +
"\nAC: " + IntToString(GetAC(oMyTarget)) +
"\n\nGold: " + IntToString(GetGold(oMyTarget)) +
"\nInventory:\n " + dmwand_Inventory(oMyTarget) +
"\n-------------------------------------------";
SetLocalString(oMySpeaker, "dmw_dialog0", sReport);
}
void dmwand_ShowBasicAttribs()
{
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-------------------------------------------" +
"\nPlayer Name: " + GetPCPlayerName(oMyTarget) +
"\nChar Name: " + GetName(oMyTarget) +
"\n-------------------------------------------" +
"\nRace: " + dmwand_Race(oMyTarget) +
"\nClass: " + dmwand_ClassLevel(oMyTarget) +
"\nXP: " + IntToString(GetXP(oMyTarget)) +
"\nGender: " + dmwand_Gender(oMyTarget) +
"\nAign: " + dmwand_Alignment(oMyTarget) +
"\nDiety: " + GetDeity(oMyTarget) +
"\n" +
"\nSTR: " + sSTR +
"\nINT: " + sINT +
"\nWIS: " + sWIS +
"\nDEX: " + sDEX +
"\nCON: " + sCON +
"\nCHA: " + sCHA +
"\n" +
"\nHPs: " + IntToString(GetCurrentHitPoints(oMyTarget)) +
" of " + IntToString(GetMaxHitPoints(oMyTarget)) +
"\nAC: " + IntToString(GetAC(oMyTarget)) +
"\n\nGold: " + IntToString(GetGold(oMyTarget)) +
"\n-------------------------------------------";
SetLocalString(oMySpeaker, "dmw_dialog0", sReport);
}
void dmwand_ShowInventory()
{
string sReport = "\n-------------------------------------------" +
"\nPlayer Name: " + GetPCPlayerName(oMyTarget) +
"\nChar Name: " + GetName(oMyTarget) +
"\n-------------------------------------------" +
"\nInventory:\n " + dmwand_Inventory(oMyTarget) +
"\n-------------------------------------------";
SetLocalString(oMySpeaker, "dmw_dialog0", sReport);
}
void dmwand_SkillCheck(int nSkill, int nSecret = TRUE)
{
int nRoll=d20();
int nRank=GetSkillRank (nSkill, oMyTarget);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sSkill;
switch(nSkill)
{
case SKILL_ANIMAL_EMPATHY:
sSkill = "Animal Empathy"; break;
case SKILL_CONCENTRATION:
sSkill = "Concentration"; break;
case SKILL_DISABLE_TRAP:
sSkill = "Disable Trap"; break;
case SKILL_DISCIPLINE:
sSkill = "Discipline"; break;
case SKILL_HEAL:
sSkill = "Heal"; break;
case SKILL_HIDE:
sSkill = "Hide"; break;
case SKILL_LISTEN:
sSkill = "Listen"; break;
case SKILL_LORE:
sSkill = "Lore"; break;
case SKILL_MOVE_SILENTLY:
sSkill = "Move Silently"; break;
case SKILL_OPEN_LOCK:
sSkill = "Open Lock"; break;
case SKILL_PARRY:
sSkill = "Parry"; break;
case SKILL_PERFORM:
sSkill = "Perform"; break;
case SKILL_PERSUADE:
sSkill = "Persuade"; break;
case SKILL_PICK_POCKET:
sSkill = "Pick Pocket"; break;
case SKILL_SEARCH:
sSkill = "Search"; break;
case SKILL_SET_TRAP:
sSkill = "Set Trap"; break;
case SKILL_SPELLCRAFT:
sSkill = "Spellcraft"; break;
case SKILL_SPOT:
sSkill = "Spot"; break;
case SKILL_TAUNT:
sSkill = "Taunt"; break;
case SKILL_USE_MAGIC_DEVICE:
sSkill = "Use Magic Device"; break;
}
SendMessageToPC(oMySpeaker, GetName(oMyTarget)+"'s "+sSkill+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult);
if (!nSecret)
{
AssignCommand( oMyTarget, SpeakString(sSkill+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}
}
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);
dmwand_BuildConversation("TimeOfDay", "");
}
void dmwand_TakeAll()
{
dmwand_TakeAllEquipped();
dmwand_TakeAllUnequipped();
}
void dmwand_TakeAllEquipped()
{
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_ARMS, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_ARROWS, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_BELT, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_BOLTS, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_BOOTS, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_BULLETS, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_CHEST, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_CLOAK, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_HEAD, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_NECK, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oMyTarget));
dmwand_takeoneitem(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oMyTarget));
}
void dmwand_TakeAllUnequipped()
{
object oEquip = GetFirstItemInInventory(oMyTarget);
while(GetIsObjectValid(oEquip))
{
dmwand_takeoneitem(oEquip);
oEquip = GetNextItemInInventory(oMyTarget);
}
}
void dmwand_TakeItem()
{
object oItem = GetLocalObject(oMySpeaker, "dmw_item");
dmwand_takeoneitem(oItem);
dmwand_BuildConversation("ListInventory", "");
}
void dmwand_takeoneitem(object oEquip)
{
if (GetIsObjectValid(oEquip) != 0)
{
AssignCommand(oMySpeaker, ActionTakeItem(oEquip, oMyTarget));
}
}
void dmwand_Toad()
{
effect ePenguin = EffectPolymorph(POLYMORPH_TYPE_PENGUIN);
effect eParalyze = EffectParalyze();
SendMessageToPC(oMySpeaker, "Penguin? Don't you mean toad?");
AssignCommand(oMyTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePenguin, oMyTarget));
AssignCommand(oMyTarget, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eParalyze, oMyTarget));
SetLocalInt(oMyTarget, "toaded", 1);
}
void dmwand_TurnNearOff()
{
object oMyTest = GetFirstObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
while(GetIsObjectValid(oMyTest) && GetIsPC(oMyTest))
{
object oMyTest = GetNextObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
}
if(GetIsObjectValid(oMyTest) && (! GetIsPC(oMyTest)))
{
dmwand_TurnOff(oMyTest);
}
}
void dmwand_TurnNearOn()
{
object oMyTest = GetFirstObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
while(GetIsObjectValid(oMyTest) && GetIsPC(oMyTest))
{
object oMyTest = GetNextObjectInShape(SHAPE_CUBE, 0.6, lMyLoc, FALSE, OBJECT_TYPE_ALL);
}
if(GetIsObjectValid(oMyTest) && (! GetIsPC(oMyTest)))
{
dmwand_TurnOn(oMyTest);
}
}
void dmwand_TurnOff(object oMyPlaceable)
{
AssignCommand(oMyPlaceable, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
DelayCommand(0.4,SetPlaceableIllumination(oMyPlaceable, FALSE));
DelayCommand(0.5,RecomputeStaticLighting(GetArea(oMyPlaceable)));
}
void dmwand_TurnOn(object oMyPlaceable)
{
AssignCommand(oMyPlaceable, PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
DelayCommand(0.4,SetPlaceableIllumination(oMyPlaceable, TRUE));
DelayCommand(0.5,RecomputeStaticLighting(GetArea(oMyPlaceable)));
}
void dmwand_TurnTargetOff()
{
dmwand_TurnOff(oMyTarget);
}
void dmwand_TurnTargetOn()
{
dmwand_TurnOn(oMyTarget);
}
void dmwand_Untoad()
{
effect eMyEffect = GetFirstEffect(oMyTarget);
while(GetIsEffectValid(eMyEffect))
{
if(GetEffectType(eMyEffect) == EFFECT_TYPE_POLYMORPH ||
GetEffectType(eMyEffect) == EFFECT_TYPE_PARALYZE)
{
RemoveEffect(oMyTarget, eMyEffect);
}
eMyEffect = GetNextEffect(oMyTarget);
}
}

6
_module/nss/dmw_inc.nss Normal file
View File

@@ -0,0 +1,6 @@
int DMW_START_CUSTOM_TOKEN = 8000;
//Retrieve targetting information
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");

View File

@@ -0,0 +1,218 @@
//::///////////////////////////////////////////////
//Test functions from dmw_test_inc
// 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();
//::///////////////////////////////////////////////
//Conversation functions from dmw_conv_inc
//Build Conversation by Dopple
//Build a conversation level, adding "next" and "previous" as needed
void dmwand_BuildConversation(string sConversation, string sParams);
//Build Conversation Dialog by Dopple
//Used by BuildConversation to translate string representation of a
// dialog name to its function
int dmwand_BuildConversationDialog(int nCurrent, int nChoice, string sConversation, string sParams);
// Chose which direction something's alignment should change
int dmw_conv_ChangeAlign(int nCurrent, int nChoice, string sParams = "");
// Chose what attributes to display about a creature
int dmw_conv_DispAttribs(int nCurrent, int nChoice, string sParams = "");
// Chose what ability or skill to do a roll with
int dmw_conv_DoRoll(int nCurrent, int nChoice, string sParams = "");
// Chose what to do with an object's inventory
int dmw_conv_Inventory(int nCurrent, int nChoice, string sParams = "");
// Diaplay an item's stats, and chose what to do with that item
int dmw_conv_ItemListConv(int nCurrent, int nChoice, string sParams = "");
// List a creature's inventory
int dmw_conv_ListInventory(int nCurrent, int nChoice, string sParams = "");
// List all players
int dmw_conv_ListPlayers(int nCurrent, int nChoice, string sParams = "");
// Chose how much to modify alignment by
int dmw_conv_ModAlign(int nCurrent, int nChoice, string sParams = "");
// Chose how much to change reputation by
int dmw_conv_ModRep(int nCurrent, int nChoice, string sParams = "");
// Chose whether a roll should be public or private
int dmw_conv_Roll(int nCurrent, int nChoice, string sParams = "");
// Starting conversation, all branches lead from here
int dmw_conv_Start(int nCurrent, int nChoice, string sParams = "");
// Chose how far to advance the time of day
int dmw_conv_TimeOfDay(int nCurrent, int nChoice, string sParams = "");
//::///////////////////////////////////////////////
//dmwand functions from dmw_func_inc
//Ability Roll Funtion by Jhenne
// - nAbility: ABILITY_*
// - nSecret: TRUE if roll should not be shown to other players
void dmwand_AbilityCheck(int nAbility, int nSecret = TRUE);
//Advance time by Dopple
// -nHours: number of hours to advance time by
void dmwand_AdvanceTime(int nHours);
//Alignment by Robert Bernavich, Jhenne, Archaego
// function returns concatenated string version of objects Alignment
string dmwand_Alignment(object oEntity);
//ClassLevel by Robert Bernavich, Jhenne, Archaego
// Returns all three classes and levels in string format of Object
string dmwand_ClassLevel(object oEntity);
//Destroy item by Dopple
//Destroys item in "dmw_item" local object on speaker, then returns to
// inventory list dialog
void dmwand_DestroyItem();
//Destroy nearby by Dopple
// Destroy the first object we find nearby the target location, then
// return to starting dialog
void dmwand_DestroyNearbyTarget();
//Destroy target by Dopple, adapted from Bioware script in World Builder Guide
// destroy target object/creature, then return to starting dialog
void dmwand_DestroyTarget();
//Export Characters suggested by a great number of people
void dmwand_ExportChars();
//Follow me by Jhenne
// force creature or player to follow user
void dmwand_FollowMe();
//Follow Target by Jhenne
// force user to follow target
void dmwand_FollowTarget();
//Gender by Robert Bernavich, Jhenne, Archaego
// function returns a string value of objects gender
string dmwand_Gender(object oEntity);
//Identify item by Dopple
// toggle identified status of item in "dmw_item" local object on user,
// then return to the ItemListConv dialog
void dmwand_IdentifyItem();
//Inventory by Robert Bernavich, Jhenne, Archaego, Dopple
// Loop through the objects inventory and return a string value of entire
// inventory
string dmwand_Inventory(object oEntity);
//Item Info by Robert Bernavich, Jhenne, Archaego, and Dopple
string dmwand_ItemInfo(object oItem, int nLongForm = 0);
//Join player's party
void dmwand_JoinParty();
//Jump player by Jhenne
void dmwand_JumpPlayerHere();
//Jump to player by Jhenne
void dmwand_JumpToPlayer();
//Kick PC by Dopple and Jhenne
// Kick out the target PC
void dmwand_KickPC();
//Kill the target, forcing it to leave a corpse behind
// taken from Bioware's KillAndReplace() in the World Builder Guide
void dmwand_KillAndReplace();
//Leave target's party
void dmwand_LeaveParty();
//Map area by Dopple
// Give the target a full map of the area
void dmwand_MapArea();
//Mod One Rep by Jhenne and Dopple
// Modify the reputations of target creature and player towards each other
void dmwand_ModOneRep(string sPlayer);
//Mod Rep by Jhenne and Dopple
// Modify the reputations of target creature and all players towards each
// other
void dmwand_ModRep(string sAmt);
//Player list conversation by Dopple
// Used to return to starting dialog after selecting a player
void dmwand_PlayerListConv(string sParams);
//Race by Robert Bernavich, Jhenne, Archaego
// Returns string version of objects race
string dmwand_Race(object oEntity);
//Reload Module by Dopple
// reload the current running module
void dmwand_ReloadModule();
//Resume default by Jhenne
// make target resume waypoints if creature, stop everything if player
void dmwand_ResumeDefault();
//Shift Alignment by Jhenne and Dopple
// Shift the alignment of object
// - sAlign: law__/chaos/good_/evil
// - nShift: amount to shift by
void dmwand_ShiftAlignment(string sAlign, int nShift);
//ShowAllAttribs by Robert Bernavich, Jhenne, Archaego
// Return formatted report of player's character information
void dmwand_ShowAllAttribs();
//ShowBasicAttribs by Robert Bernavich, Jhenne, Archaego
// Return formatted report of player's basic character information
void dmwand_ShowBasicAttribs();
//ShowInventory by RRobert Bernavich, Jhenne, Archaego
// Return formatted report of player's inventory
void dmwand_ShowInventory();
//Skill Roll Funtion by Jhenne, modified by Dopple
// - nSkill: SKILL_*
// - nSecret: TRUE if roll should not be shown to other players
void dmwand_SkillCheck(int nSkill, int nSecret = TRUE);
//Swap Day/Night by Dopple
// - nDay: 1 to make it day, 0 to make it night
void dmwand_SwapDayNight(int nDay);
//Take all by Jhenne and Dopple
// Take all items from target
void dmwand_TakeAll();
//Take all equipped by Jhenne and Dopple
// Take all equipped items off of target
void dmwand_TakeAllEquipped();
//Take all unequipped by Jhenne and Dopple
// take all unequipped items from target
void dmwand_TakeAllUnequipped();
//Take Item by Jhenne and Dopple
// take dialog-selected item from target, and return to inventory list dialog
void dmwand_TakeItem();
//Item Stripper by Jhenne - remove item from target
// - oEquip: object to remove
void dmwand_takeoneitem(object oEquip);
//Toad..err..penguin the player by Dopple
// I would rather a chicken, but it seems that's not a valid polymorph type :(
void dmwand_Toad();
//TurnNearOff by Dopple, adapted from Bioware's on/off script
// Turn a placeable near the target location off
void dmwand_TurnNearOff();
//TurnNearOn by Dopple, adapted from Bioware's on/off script
// Turn a placeable near the target location on
void dmwand_TurnNearOn();
//TurnOff by Dopple, adapted from Bioware's on/off script
// Turn a placeable off
void dmwand_TurnOff(object oMyPlaceable);
//TurnOn by Dopple, adapted from Bioware's on/off script
// Turn a placeable on
void dmwand_TurnOn(object oMyPlaceable);
//TurnTargetOff by Dopple, adapted from Bioware's on/off script
// Turn target off
void dmwand_TurnTargetOff();
//TurnTargetOn by Dopple, adapted from Bioware's on/off script
// Turn target on
void dmwand_TurnTargetOn();
//UnToad..err..penguin the player by Dopple
// reverse effects of Toad
void dmwand_Untoad();
//Do Dialog Choice by Dopple
//Dialog function in dmw_dodialog_inc, performs a function or starts
// another dialog function when a dialog choice is selected
void dmwand_DoDialogChoice(int nChoice);
//Start Conversation by Dopple
// Function to start the ball rolling, in dmw_start_inc
void dmwand_StartConversation();

View File

@@ -0,0 +1,35 @@
void main()
{
object oMyActivator = OBJECT_SELF;
if(GetIsDM(oMyActivator) != TRUE)
{
object oTest = GetFirstPC();
string sTestName = GetPCPlayerName(oMyActivator);
int nFound = FALSE;
while (GetIsObjectValid(oTest) && (! nFound))
{
if (GetPCPlayerName(oTest) == sTestName)
{
if(GetIsDM(oTest))
{
nFound = TRUE;
}
else
{
SendMessageToPC(oMyActivator,"This is too much power for mere mortals!");
return;
}
}
oTest=GetNextPC();
}
}
// get the wand's activator and target, put target info into local vars on activator
object oMyTarget;
SetLocalObject(oMyActivator, "dmwandtarget", oMyTarget);
location lMyLoc;
SetLocalLocation(oMyActivator, "dmwandloc", lMyLoc);
//Make the activator start a conversation with itself
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "dmwand", TRUE));
return;
}

View File

@@ -0,0 +1,418 @@
#include "dmw_proto_inc"
#include "dmw_test_inc"
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_istargetpcornpc())
{
sText = "Display this creature's attributes.";
sCall = "conv_DispAttribs";
sCallParams = "";
break;
}
case 2:
nCurrent = 2;
if(dmwand_istargetpcornpc())
{
sText = "Change this creature's alignment.";
sCall = "conv_ChangeAlign";
sCallParams = "";
break;
}
case 3:
nCurrent = 3;
if(dmwand_istargetpcornpcnme())
{
sText = "Map area out for this player.";
sCall = "func_MapArea";
sCallParams = "";
break;
}
case 4:
nCurrent = 4;
if(dmwand_istargetinventory())
{
sText = "Work with this object's inventory.";
sCall = "conv_Inventory";
sCallParams = "";
break;
}
case 5:
nCurrent = 5;
if(dmwand_istargetpcornpcnme())
{
sText = "Follow this creature.";
sCall = "func_FollowTarget";
sCallParams = "";
break;
}
case 6:
nCurrent = 6;
if(dmwand_istargetpcornpcnme())
{
sText = "Make this creature follow me.";
sCall = "func_FollowMe";
sCallParams = "";
break;
}
case 7:
nCurrent = 7;
if(dmwand_istargetpcornpcnme())
{
sText = "Make this creature go about its business.";
sCall = "func_ResumeDefault";
sCallParams = "";
break;
}
case 8:
nCurrent = 8;
if(dmwand_istargetpcnme())
{
sText = "Penguin this player.";
sCall = "func_Toad";
sCallParams = "";
break;
}
case 9:
nCurrent = 9;
if(dmwand_istargetpcnme())
{
sText = "Unpenguin this player.";
sCall = "func_Untoad";
sCallParams = "";
break;
}
case 10:
nCurrent = 10;
if(dmwand_istargetpcnme())
{
sText = "Boot this player.";
sCall = "func_KickPC";
sCallParams = "";
break;
}
case 11:
nCurrent = 11;
if(dmwand_istargetnpc())
{
sText = "Kill this, leaving a corpse.";
sCall = "func_KillAndReplace";
sCallParams = "";
break;
}
case 12:
nCurrent = 12;
if(dmwand_istargetinvalid())
{
sText = "List all players...";
sCall = "conv_ListPlayers";
sCallParams = "func_PlayerListConv";
break;
}
case 13:
nCurrent = 13;
if(dmwand_istargetinvalid())
{
sText = "Advance the current time of day.";
sCall = "conv_TimeOfDay";
sCallParams = "";
break;
}
case 14:
nCurrent = 14;
if(dmwand_istargetinvalid())
{
sText = "Reload the current running module.";
sCall = "func_ReloadModule";
sCallParams = "";
break;
}
case 15:
nCurrent = 15;
if(dmwand_istargetpcornpc())
{
sText = "Roll a skill check.";
sCall = "conv_Roll";
sCallParams = "skill__";
break;
}
case 16:
nCurrent = 16;
if(dmwand_istargetpcornpc())
{
sText = "Roll an ability check.";
sCall = "conv_Roll";
sCallParams = "ability";
break;
}
case 17:
nCurrent = 17;
if(dmwand_istargetdestroyable())
{
sText = "Destroy this object.";
sCall = "func_DestroyTarget";
sCallParams = "";
break;
}
case 18:
nCurrent = 18;
if((!dmwand_istargetdestroyable()) && dmwand_isnearbydestroyable())
{
sText = "Destroy an object near this spot.";
sCall = "func_DestroyNearbyTarget";
sCallParams = "";
break;
}
case 19:
nCurrent = 19;
if(dmwand_istargetdestroyable())
{
sText = "Turn this object on.";
sCall = "func_TurnTargetOn";
sCallParams = "";
break;
}
case 20:
nCurrent = 20;
if(dmwand_istargetdestroyable())
{
sText = "Turn this object off.";
sCall = "func_TurnTargetOff";
sCallParams = "";
break;
}
case 21:
nCurrent = 21;
if((!dmwand_istargetdestroyable()) && dmwand_isnearbydestroyable())
{
sText = "Turn on an object near this spot.";
sCall = "func_TurnNearOn";
sCallParams = "";
break;
}
case 22:
nCurrent = 22;
if((!dmwand_istargetdestroyable()) && dmwand_isnearbydestroyable())
{
sText = "Turn off an object near this spot.";
sCall = "func_TurnNearOff";
sCallParams = "";
break;
}
case 23:
nCurrent = 23;
if(dmwand_istargetnpc())
{
sText = "Change a player's reputation with this creature's faction.";
sCall = "conv_ModRep";
sCallParams = "one";
break;
}
case 24:
nCurrent = 24;
if(dmwand_istargetnpc())
{
sText = "Change all player reputations with this creature's faction.";
sCall = "conv_ModRep";
sCallParams = "all";
break;
}
case 25:
nCurrent = 25;
if(dmwand_istargetinvalid())
{
sText = "Export all characters.";
sCall = "func_ExportChars";
sCallParams = "";
break;
}
case 26:
nCurrent = 26;
if(dmwand_istargetpcnme())
{
sText = "Join this player's party.";
sCall = "func_JoinParty";
sCallParams = "";
break;
}
case 27:
nCurrent = 27;
if(dmwand_istargetinvalid())
{
sText = "Remove me from my current party.";
sCall = "func_LeaveParty";
sCallParams = "";
break;
}
case 28:
nCurrent = 28;
if(dmwand_istargetpcnme())
{
sText = "Jump this player to my location.";
sCall = "func_JumpPlayerHere";
sCallParams = "";
break;
}
case 29:
nCurrent = 29;
if(dmwand_istargetpcnme())
{
sText = "Jump me to this player's location.";
sCall = "func_JumpToPlayer";
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", "");
}

View File

@@ -0,0 +1,27 @@
#include "dmw_inc"
#include "dmw_start_inc"
int StartingConditional()
{
int nMyNum = 0;
//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
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 1;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 2;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 3;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 4;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 5;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 6;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 7;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 8;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,22 @@
#include "dmw_inc"
int StartingConditional()
{
int nMyNum = 9;
object oMySpeaker = GetLastSpeaker();
object oMyTarget = GetLocalObject(oMySpeaker, "dmwandtarget");
location lMyLoc = GetLocalLocation(oMySpeaker, "dmwandloc");
string sMyString = GetLocalString(oMySpeaker, "dmw_dialog" + IntToString(nMyNum));
if(sMyString == "")
{
return FALSE;
}
else
{
SetCustomToken(DMW_START_CUSTOM_TOKEN + nMyNum, sMyString);
return TRUE;
}
}

View File

@@ -0,0 +1,76 @@
#include "dmw_proto_inc"
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_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_istargetpcornpc()
{
return (GetIsObjectValid(oMyTarget) && GetAbilityScore(oMyTarget, ABILITY_CONSTITUTION));
}
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);
}

View File

@@ -0,0 +1,4 @@
void main()
{
DelayCommand(60.0, ActionCloseDoor(OBJECT_SELF));
}

View File

@@ -0,0 +1,91 @@
//::///////////////////////////////////////////////
//:: 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()
{
// CreateItemOnObject("GoblinScalp2", OBJECT_SELF);
// 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
// Below is the stuff I added -tdh
int nScalpRoll = d4(1);
if (nScalpRoll == 4) {
CreateItemOnObject("goblinscalp", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,84 @@
//::///////////////////////////////////////////////
//:: 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
// Below is the stuff I added -tdh
int nScalpRoll = d4(1);
if (nScalpRoll == 1) {
CreateItemOnObject("minornecromancyr", OBJECT_SELF);
}
}

View File

@@ -0,0 +1,10 @@
// Module : OnClientLeave by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial
#include "bleeding_config"
void main() {
// Remember what their hit points were at for when they next sign on...
SetLocalInt(GetExitingObject(), "LastHitPoints", GetCurrentHitPoints(GetExitingObject()));
}

View File

@@ -0,0 +1,84 @@
//::///////////////////////////////////////////////
//:: 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
// Below is the stuff I added -tdh
int nScalpRoll = d4(1);
if (nScalpRoll == 1) {
CreateItemOnObject("redaxeinsignia", OBJECT_SELF);
}
}

111
_module/nss/et_rest.nss Normal file
View File

@@ -0,0 +1,111 @@
#include "x2_inc_restsys"
#include "x2_inc_switches"
#include "x3_inc_horse"
void main()
{
object oPC = GetLastPCRested();
object oMount;
if (!GetLocalInt(GetModule(),"X3_MOUNT_NO_REST_DISMOUNT"))
{ // make sure not mounted
/* Deva, Jan 17, 2008
Do not allow a mounted PC to rest
*/
if (HorseGetIsMounted(oPC))
{ // cannot mount
if (GetLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT"))
{ // cancel message already played
DeleteLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT");
} // cancel message already played
else
{ // play cancel message
FloatingTextStrRefOnCreature(112006,oPC,FALSE);
SetLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT",TRUE); // sentinel
// value to prevent message played a 2nd time on canceled rest
} // play cancel message
AssignCommand(oPC,ClearAllActions(TRUE));
return;
} // cannot mount
} // make sure not mounted
if (!GetLocalInt(GetModule(),"X3_MOUNT_NO_REST_DESPAWN"))
{ // if there is a paladin mount despawn it
oMount=HorseGetPaladinMount(oPC);
if (!GetIsObjectValid(oMount)) oMount=GetLocalObject(oPC,"oX3PaladinMount");
if (GetIsObjectValid(oMount))
{ // paladin mount exists
if (oMount==oPC||!GetIsObjectValid(GetMaster(oMount))) AssignCommand(oPC,HorseUnsummonPaladinMount());
else { AssignCommand(GetMaster(oMount),HorseUnsummonPaladinMount()); }
} // paladin mount exists
} // if there is a paladin mount despawn it
if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
{
/* Georg, August 11, 2003
Added this code to allow the designer to specify a variable on the module
Instead of using a OnAreaEnter script. Nice new toolset feature!
Basically, the first time a player rests, the area is scanned for the
encounter table string and will set it up.
*/
object oArea = GetArea (oPC);
string sTable = GetLocalString(oArea,"X2_WM_ENCOUNTERTABLE") ;
if (sTable != "" )
{
int nDoors = GetLocalInt(oArea,"X2_WM_AREA_USEDOORS");
int nDC = GetLocalInt(oArea,"X2_WM_AREA_LISTENCHECK");
WMSetAreaTable(oArea,sTable,nDoors,nDC);
//remove string to indicate we are set up
DeleteLocalString(oArea,"X2_WM_ENCOUNTERTABLE");
}
/* Brent, July 2 2003
- If you rest and are a low level character at the beginning of the module.
You will trigger the first dream cutscene
*/
if (GetLocalInt(GetModule(), "X2_G_LOWLEVELSTART") == 10)
{
AssignCommand(oPC, ClearAllActions());
if (GetHitDice(oPC) >= 12)
{
ExecuteScript("bk_sleep", oPC);
return;
}
else
{
FloatingTextStrRefOnCreature(84141 , oPC);
return;
}
}
if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED)
{
if (!WMStartPlayerRest(oPC))
{
// The resting system has objections against resting here and now
// Probably because there is an ambush already in progress
FloatingTextStrRefOnCreature(84142 ,oPC);
AssignCommand(oPC,ClearAllActions());
}
if (WMCheckForWanderingMonster(oPC))
{
//This script MUST be run or the player won't be able to rest again ...
ExecuteScript("x2_restsys_ambus",oPC);
}
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC,TRUE); // removes sleep effect, etc
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC); // removes sleep effect, etc
}
}
}

View File

@@ -0,0 +1,101 @@
//::///////////////////////////////////////////////
//:: 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
object oCheckObject = GetFirstObjectInArea();
string sThisTag = GetTag(OBJECT_SELF);
while (oCheckObject != OBJECT_INVALID) {
if(oCheckObject != OBJECT_SELF && GetTag(oCheckObject) == sThisTag) {
DestroyObject(OBJECT_SELF);
}
if(GetTag(oCheckObject) == "WerewolfSerylwin" && GetTag(OBJECT_SELF) == "Serylwin") {
DestroyObject(OBJECT_SELF);
}
if(GetTag(oCheckObject) == "WerewolfDagdish" && GetTag(OBJECT_SELF) == "Dagdish") {
DestroyObject(OBJECT_SELF);
}
if(GetTag(oCheckObject) == "WerewolfGobbel" && GetTag(OBJECT_SELF) == "Gobbel") {
DestroyObject(OBJECT_SELF);
}
if(GetTag(oCheckObject) == "WerewolfHorace" && GetTag(OBJECT_SELF) == "HoracetheBartender") {
DestroyObject(OBJECT_SELF);
}
if(GetTag(oCheckObject) == "WerewolfRando" && GetTag(OBJECT_SELF) == "Rando") {
DestroyObject(OBJECT_SELF);
}
oCheckObject = GetNextObjectInArea();
}
}

View File

@@ -0,0 +1,84 @@
//::///////////////////////////////////////////////
//:: 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
// Below is the stuff I added -tdh
int nScalpRoll = d4(1);
if (nScalpRoll == 1) {
CreateItemOnObject("necromancyring", OBJECT_SELF);
}
}

17
_module/nss/etbar.nss Normal file
View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: FileName etbar
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Script Wizard
//:: Created On: 8/10/2002 2:50:16 AM
//:://////////////////////////////////////////////
void main()
{
// Either open the store with that tag or let the user know that no store exists.
object oStore = GetNearestObjectByTag("dbar_mt");
if(GetObjectType(oStore) == OBJECT_TYPE_STORE)
OpenStore(oStore, GetPCSpeaker());
else
ActionSpeakStringByStrRef(53090, TALKVOLUME_TALK);
}

View File

@@ -0,0 +1,56 @@
// good = 1, evil = 2
void AddPlayerToTeam( int nTeam, object oPlayer )
{
// int nNumPlayers, nCount;
// string sAreaTag;
// object oArea;
//
// nNumPlayers = GetTeamData(nTeam,TEAM_NUM_PLAYERS);
//
SetLocalInt(oPlayer,"m_nTeam",nTeam);
//
// SetTeamData(nTeam,TEAM_NUM_PLAYERS,nNumPlayers + 1);
//
// // Signal an event to each team's HQ to add a counter
// // for the number of players on a team.
// for ( nCount = 0; nCount < GetMaxTeams(); nCount++ )
// {
// sAreaTag = "Team_" + IntToString(nCount) + "_HQ";
// oArea = GetObjectByTag(sAreaTag);
//
// if ( GetIsObjectValid(oArea) == TRUE )
// {
// SignalEvent(oArea,EventUserDefined(EVENT_ADD_PLAYER_TO_TEAM + nTeam));
// }
// }
//
// Loop through all other players in the game
// and set up the likes/dislikes appropriately.
object oPC;
oPC = GetFirstPC();
while ( GetIsObjectValid(oPC) == TRUE )
{
if ( oPC != oPlayer )
{
if ( GetPlayerTeam(oPC) == nTeam )
{
SetPCLike(oPlayer,oPC);
SetPCLike(oPC,oPlayer);
}
// else
// {
// SetPCDislike(oPlayer,oPC);
// SetPCDislike(oPC,oPlayer);
// }
}
oPC = GetNextPC();
}
}
int GetPlayerTeam( object oPlayer )
{
return GetLocalInt(oPlayer,"m_nTeam");
}

26
_module/nss/evilchest.nss Normal file
View File

@@ -0,0 +1,26 @@
#include "NW_O2_CONINCLUDE"
void main()
{
// Set respawntime float to the number of seconds.
float respawntime = 1200.00;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
AssignCommand( OBJECT_SELF, DelayCommand(120.0, SetLocked(OBJECT_SELF, TRUE)) );
}

View File

@@ -0,0 +1,23 @@
void main()
{
// Move individual to new location
location lNewLocation = GetLocation(GetObjectByTag("GehennaEnter"));
object oTarget;
//Since the script is called from a conversation
//determine who is moved by calling the GetPCSpeaker function
oTarget = GetLastUsedBy();
if (GetIsObjectValid(oTarget) == TRUE){
AssignCommand(oTarget,ActionJumpToLocation(lNewLocation));
}
else if (GetIsObjectValid(oTarget) == FALSE) {
SpeakString("Problem here");
}
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetAbilityModifier (ABILITY_CHARISMA, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Charisma";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetAbilityModifier (ABILITY_CONSTITUTION, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Constitution";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d100();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d100 and gets a: "+sRoll)));
}

View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d10();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d10 and gets a: "+sRoll)));
}

View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d12();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d12 and gets a: "+sRoll)));
}

View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d20 and gets a: "+sRoll)));
}

11
_module/nss/ew_d4roll.nss Normal file
View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d4();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d4 and gets a: "+sRoll)));
}

11
_module/nss/ew_d6roll.nss Normal file
View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d6();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d6 and gets a: "+sRoll)));
}

11
_module/nss/ew_d8roll.nss Normal file
View File

@@ -0,0 +1,11 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d8();
string sName = GetName(oPC);
string sRoll=IntToString(nRoll);
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
DelayCommand( 2.0, AssignCommand( oPC, SpeakString(sName+"Rolled a d8 and gets a: "+sRoll)));
}

13
_module/nss/ew_dance.nss Normal file
View File

@@ -0,0 +1,13 @@
void main()
{
object oPC=GetLastSpeaker();
AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY2));
DelayCommand(3.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_TALK_LAUGHING, 3.0, 2.0)));
DelayCommand(3.0, AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_LAUGH)));
DelayCommand(5.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY1)));
DelayCommand(8.5, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3)));
DelayCommand(11.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_GET_MID, 3.0, 2.0)));
DelayCommand(14.5, AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_LAUGH)));
DelayCommand(13.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_VICTORY3)));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetAbilityModifier (ABILITY_DEXTERITY, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Dexterity";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_DISCIPLINE, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Discipline";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

7
_module/nss/ew_drunk.nss Normal file
View File

@@ -0,0 +1,7 @@
void main()
{
object oPC=GetLastSpeaker();
AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_PAUSE_DRUNK, 1.0, 8.0));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_DISABLE_TRAP, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Disable Trap";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetAbilityModifier (ABILITY_INTELLIGENCE, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Intelligence";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_LISTEN, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Listen";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_LORE, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Lore";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,7 @@
void main()
{
object oPC=GetLastSpeaker();
AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_MEDITATE, 1.0, 8.0));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_OPEN_LOCK, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Open Lock";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_PERFORM, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Perform";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

View File

@@ -0,0 +1,15 @@
void main()
{
object oPC = GetLastSpeaker();
int nRoll=d20();
int nRank=GetSkillRank (SKILL_PERSUADE, oPC);
int nResult=nRoll+nRank;
string sRoll=IntToString(nRoll);
string sRank=IntToString(nRank);
string sResult=IntToString(nResult);
string sAbility="Persuade";
AssignCommand( oPC, ActionPlayAnimation (ANIMATION_LOOPING_GET_MID, 3.0, 3.0));
AssignCommand( oPC, SpeakString(sAbility+" Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
}

7
_module/nss/ew_read.nss Normal file
View File

@@ -0,0 +1,7 @@
void main()
{
object oPC=GetLastSpeaker();
AssignCommand(oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_READ));
DelayCommand(3.0, AssignCommand( oPC, ActionPlayAnimation( ANIMATION_FIREFORGET_READ)));
}

View File

@@ -0,0 +1,5 @@
void main()
{
object oDM = GetLastSpeaker();
AssignCommand ( oDM, PlaySound("as_pl_nobtalk1"));
}

View File

@@ -0,0 +1,24 @@
void main()
{
object oDM = GetLastSpeaker();
switch (Random(5))
{
case 0: AssignCommand ( oDM, PlaySound("c_werecat_bat2"));
break;
case 1: AssignCommand ( oDM, PlaySound("c_werecat_bat1"));
break;
case 2: AssignCommand ( oDM, PlaySound("c_catlion_bat1"));
break;
case 3: AssignCommand ( oDM, PlaySound("c_catpanth_bat1"));
break;
case 4: AssignCommand ( oDM, PlaySound("c_cat_bat2"));
break;
}
}

View File

@@ -0,0 +1,23 @@
void main()
{
object oDM = GetLastSpeaker();
switch (Random(5))
{
case 0: AssignCommand ( oDM, PlaySound("fs_grass_hard3"));
break;
case 1: AssignCommand ( oDM, PlaySound("as_na_branchsnp1"));
break;
case 2: AssignCommand ( oDM, PlaySound("as_na_branchsnp2"));
break;
case 3: AssignCommand ( oDM, PlaySound("as_na_branchsnp3"));
break;
case 4: AssignCommand ( oDM, PlaySound("as_na_branchsnp4"));
break;
}
}

View File

@@ -0,0 +1,5 @@
void main()
{
object oDM = GetLastSpeaker();
AssignCommand ( oDM, PlaySound("as_na_bushmove1"));
}

View File

@@ -0,0 +1,5 @@
void main()
{
object oDM = GetLastSpeaker();
AssignCommand ( oDM, PlaySound("as_an_catscrech2"));
}

View File

@@ -0,0 +1,29 @@
void main()
{
object oDM = GetLastSpeaker();
switch (Random(7))
{
case 0: AssignCommand ( oDM, PlaySound("as_pl_coughm1"));
break;
case 1: AssignCommand ( oDM, PlaySound("as_pl_coughm2"));
break;
case 2: AssignCommand ( oDM, PlaySound("as_pl_coughm3"));
break;
case 3: AssignCommand ( oDM, PlaySound("as_pl_coughm4"));
break;
case 4: AssignCommand ( oDM, PlaySound("as_pl_coughm5"));
break;
case 5: AssignCommand( oDM, PlaySound("as_pl_coughm6"));
break;
case 6: AssignCommand( oDM, PlaySound("as_pl_coughm7"));
break;
}
}

16
_module/nss/ew_scow.nss Normal file
View File

@@ -0,0 +1,16 @@
void main()
{
object oDM = GetLastSpeaker();
switch (Random(1))
{
case 0: AssignCommand ( oDM, PlaySound("as_an_cow1"));
break;
case 1: AssignCommand ( oDM, PlaySound("as_an_cow2"));
break;
}
}

15
_module/nss/ew_scrow.nss Normal file
View File

@@ -0,0 +1,15 @@
void main()
{
object oDM = GetLastSpeaker();
switch (Random(2))
{
case 0: AssignCommand ( oDM, PlaySound("as_an_crow1"));
break;
case 1: AssignCommand ( oDM, PlaySound("as_an_crow2"));
break;
}
}

View File

@@ -0,0 +1,5 @@
void main()
{
object oDM = GetLastSpeaker();
AssignCommand ( oDM, PlaySound("c_demon_bat2"));
}

Some files were not shown because too many files have changed in this diff Show More