generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
202
_module/nss/_inc_battlecry_.nss
Normal file
202
_module/nss/_inc_battlecry_.nss
Normal file
@@ -0,0 +1,202 @@
|
||||
///////////////////////////////////
|
||||
// Carcerian's BattleCry Script //
|
||||
// "Evil Dead" Edition //
|
||||
///////////////////////////////////
|
||||
#include "inc_utility"
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "prc_inc_racial"
|
||||
|
||||
const int BattleCryChance = 15;
|
||||
const int CombatCryChance = 20;
|
||||
const int DeathCryChance = 20;
|
||||
const int CustomUndeadChance = 50;
|
||||
const int CommerTalkChance = 50;
|
||||
|
||||
const string COLOR_RED = "<c<> >";
|
||||
const string COLOR_DARK = "<cSSS>";
|
||||
const string COLOR_GREEN = "<c <20> >";
|
||||
const string COLOR_WHITE = "<c<><63><EFBFBD>>";
|
||||
const string COLOR_VIOLET = "<c<> <20>>";
|
||||
const string COLOR_YELLOW = "<c<><63> >";
|
||||
|
||||
int HasSpoken()
|
||||
{
|
||||
if (GetLocalInt(OBJECT_SELF,"HASSPOKEN")) return 1;
|
||||
SetLocalInt(OBJECT_SELF,"HASSPOKEN",1);
|
||||
DelayCommand(IntToFloat(d10(4)),SetLocalInt(OBJECT_SELF,"HASSPOKEN",0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DoUndeadChatter()
|
||||
{
|
||||
string sMyTag = GetTag(OBJECT_SELF);
|
||||
if ((FindSubString(sMyTag,"SKEL")>-1)||(FindSubString(sMyTag,"MOHRG")>-1))
|
||||
{
|
||||
switch (d3()) // Skeletons
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_WHITE+"I got a bone to pick with you!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_WHITE+"Forward, you worthless bags of bones!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_WHITE+"CHARGE!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else if (FindSubString(sMyTag,"ZOMB")>-1)
|
||||
{
|
||||
if (Random(2)) ActionSpeakString(COLOR_GREEN+"Brains!",TALKVOLUME_TALK);
|
||||
else ActionSpeakString(COLOR_GREEN+"BRAINS!",TALKVOLUME_TALK);
|
||||
// "More brains!"
|
||||
}
|
||||
else if ((FindSubString(sMyTag,"GHOUL")>-1)||(FindSubString(sMyTag,"GHAST")>-1)
|
||||
||(FindSubString(sMyTag,"WIGHT")>-1))
|
||||
{
|
||||
switch (d4()) // Flesh Eaters
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_GREEN+"I'll feast on your entrails!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_GREEN+"FOOD!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_GREEN+"Live ones!!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_GREEN+"FLESSSSHHHH!!!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else if ((FindSubString(sMyTag,"WRAITH")>-1)||(FindSubString(sMyTag,"ALLIP")>-1)
|
||||
||(FindSubString(sMyTag,"Bodak")>-1)||(FindSubString(sMyTag,"SHADOW")>-1)
|
||||
||(FindSubString(sMyTag,"SHFIEND")>-1)||(FindSubString(sMyTag,"SPECTRE")>-1))
|
||||
{
|
||||
switch (d4()) // Soul Eaters
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_VIOLET+"I'll swallow your soul!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_VIOLET+"Your soul will be mine!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_VIOLET+"Mine!!!!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_VIOLET+"The darkness calls for you...",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
else switch (d6()) // Generic Undead
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_RED+"I'll swallow your soul!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_RED+"Blood and souls!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_RED+"Joinnnn usssssssss!",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_RED+"For the Master!",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_RED+"For the Master!",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_RED+"One by one we will take you!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
}
|
||||
|
||||
// For use on perception
|
||||
void DoBattleCry()
|
||||
{
|
||||
int iClass1 = GetClassByPosition(1, OBJECT_SELF);
|
||||
|
||||
//if undead spotted "i see dead people!" "Dead ahead!"
|
||||
if (d100()<=BattleCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
{
|
||||
DoUndeadChatter();
|
||||
}
|
||||
if ((iClass1 = 20) && (d100()<=CommerTalkChance))
|
||||
{
|
||||
switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_HELLO); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_SELECTED); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_TALKTOME); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_GOODBYE); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_HELLO); break;
|
||||
}
|
||||
}
|
||||
else switch (d10())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_ATTACK); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_BATTLECRY1); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_BATTLECRY2); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_BATTLECRY3); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_THREATEN); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_TAUNT); break;
|
||||
case 7: PlayVoiceChat(VOICE_CHAT_ENEMIES); break;
|
||||
case 8: PlayVoiceChat(VOICE_CHAT_CHEER); break;
|
||||
case 9: PlayVoiceChat(VOICE_CHAT_FOLLOWME); break;
|
||||
case 10: PlayVoiceChat(VOICE_CHAT_LOOKHERE); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//For End of Combat Round
|
||||
void DoCombatCry()
|
||||
{
|
||||
if (PRCGetHasEffect(EFFECT_TYPE_FRIGHTENED))
|
||||
{
|
||||
if (d100()<=CombatCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6()) //Turned undead :)
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_YELLOW+"It Burns! It Burns!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_YELLOW+"Cursed Light!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_YELLOW+"Your faith is weak, I can feel your fear...",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_YELLOW+"AAAIIIEEE!!!",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_YELLOW+"NOOO!!!",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_YELLOW+"It Burns!",TALKVOLUME_TALK); break;
|
||||
}
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_FLEE); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_HELP); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_GUARDME); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_CUSS); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_BADIDEA); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d100()<=CombatCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6())
|
||||
{
|
||||
DoUndeadChatter();
|
||||
}
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_BATTLECRY1); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_BATTLECRY2); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_BATTLECRY3); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_TAUNT); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_THREATEN); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//For Creature Death
|
||||
void DoDeathCry()
|
||||
{
|
||||
if (d100()<=DeathCryChance)
|
||||
{
|
||||
if (HasSpoken()) return;
|
||||
if ((MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)&&(d100()<=CustomUndeadChance))
|
||||
switch (d6())
|
||||
{
|
||||
case 1 : ActionSpeakString(COLOR_RED+"Dead by dawn! Dead by dawn!",TALKVOLUME_TALK); break;
|
||||
case 2 : ActionSpeakString(COLOR_RED+"Death is only the beginning!",TALKVOLUME_TALK); break;
|
||||
case 3 : ActionSpeakString(COLOR_RED+"Darkness take me...",TALKVOLUME_TALK); break;
|
||||
case 4 : ActionSpeakString(COLOR_RED+"Free at last...",TALKVOLUME_TALK); break;
|
||||
case 5 : ActionSpeakString(COLOR_RED+"Time to die...",TALKVOLUME_TALK); break;
|
||||
case 6 : ActionSpeakString(COLOR_RED+"Thank you...",TALKVOLUME_TALK); break;
|
||||
} // "No more tears..."
|
||||
else switch (d6())
|
||||
{
|
||||
case 1: PlayVoiceChat(VOICE_CHAT_CUSS); break;
|
||||
case 2: PlayVoiceChat(VOICE_CHAT_DEATH); break;
|
||||
case 3: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
|
||||
case 4: PlayVoiceChat(VOICE_CHAT_GOODBYE); break;
|
||||
case 5: PlayVoiceChat(VOICE_CHAT_LAUGH); break;
|
||||
case 6: PlayVoiceChat(VOICE_CHAT_HEALME); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//void main (){}
|
33
_module/nss/_kb_corpse_damg.nss
Normal file
33
_module/nss/_kb_corpse_damg.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_damg // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnDamaged event of the lootable corpse placeable (tag "invis_corpse_obj") //
|
||||
// contains this script. //
|
||||
// //
|
||||
// This script allows third-party plugins to function (if installed), or //
|
||||
// runs the default behavior (if no plugins installed). //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
|
||||
}
|
219
_module/nss/_kb_corpse_death.nss
Normal file
219
_module/nss/_kb_corpse_death.nss
Normal file
@@ -0,0 +1,219 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_death // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// CAUTION: You MUST re-save/compile (or press F7 for "Save and Compile") //
|
||||
// the "_kb_corpse_death" and "_kb_corpse_distb" scripts if you make any //
|
||||
// changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
|
||||
// #include file). //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnDeath event of the lootable corpse placeable (tag "invis_corpse_obj") //
|
||||
// contains this script. //
|
||||
// //
|
||||
// This script is used to clean up the loot within that object in the event //
|
||||
// it is destroyed - such as being caught in a fireball or physically hacked //
|
||||
// apart by a player (i.e. Bashed). Plot items are not destroyed. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.3 Change Log:
|
||||
- added DestroyIfEmpty function to ensure TransferToBones is finished before destroying oLootCorpse
|
||||
- fixed comments to clarify that "doa_bashbreak" script refers to DOA's "Bashed Loot Breakage" plugin
|
||||
/* Version 3.2 Change Log:
|
||||
- renamed script from "_kb_destroy_cpse" to "_kb_corpse_death" for naming consistency
|
||||
- consolidated inventory management functions to _kb_inc_invmgmt
|
||||
- DestroyInventory function calls changed to DestroyInventory + DestroyDroppedWeapons in _kb_inc_invmgmt (identical)
|
||||
- added simple plugin architecture (requires file _kb_plugins)
|
||||
- integration with DOA's "Bashed Loot Breakage" plugin now requires zero editing (no include call)
|
||||
- added GetIsObjectValid check before destroying Bloodspot
|
||||
- moved DestroyDroppedWeapons outside if/else clause, so that plugins don't need to address it
|
||||
- added nUseBonesBash to create bones when corpse is bashed
|
||||
- added nBonesFade to determine when bones fade (if ever)
|
||||
- added nTinyBones to prevent bones from appearing for tiny-sized creatures
|
||||
- added nKeepInventoryBash to keep all items in a creature's inventory when its corpse is bashed
|
||||
- changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions
|
||||
- changed comments to reflect that undead/constructs/elementals will not "gib" when bashed
|
||||
- renamed oHostCorpse to oHostBody for consistency
|
||||
- added support for DM's Helper wand (used to destroy corpse or bones)
|
||||
- added support for "Destroy Target" command of DM's Helper wand (used to destroy the corpse or bones)
|
||||
*/
|
||||
|
||||
#include "_kb_inc_invmgmt"
|
||||
|
||||
/*******************************************************************************
|
||||
** This script checks to make sure TransferToBones is done moving all items **
|
||||
** from oLootCorpse to oBones before destroying oLootCorpse. Note that all **
|
||||
** items on oLootCorpse are droppable (due to "_kb_loot_corpse"), so **
|
||||
** TransferToBones will always empty oLootCorpse completely. **
|
||||
*******************************************************************************/
|
||||
void DestroyIfEmpty()
|
||||
{
|
||||
if (!GetIsObjectValid(GetFirstItemInInventory(OBJECT_SELF)))
|
||||
{
|
||||
DestroyObject(OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// SendMessageToPC(GetFirstPC(), "oLootCorpse not empty yet");
|
||||
DelayCommand(1.0, DestroyIfEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
/*******************************************************************************
|
||||
** INTEGRATION WITH DM's HELPER **
|
||||
** Thanks to Bored Bistander for the idea/scripting! **
|
||||
** **
|
||||
** If you like the DM's Helper (http://www.nwnguide.com/~nwnbuilder/), you **
|
||||
** can use the "Destroy Target" command of the DM's Helper wand to destroy **
|
||||
** the lootable corpse or the bones. Just import the DM's Helper into your **
|
||||
** module, then paste the following lines at the beginning of the **
|
||||
** "dmwand_DestroyTarget()" function in the "dmw_func_inc" script: **
|
||||
*******************************************************************************/
|
||||
|
||||
/*
|
||||
// Added by Scrotok
|
||||
if ((GetTag(oMyTarget) == "invis_corpse_obj") || (GetTag(oMyTarget) == "loot_bones_obj"))
|
||||
{
|
||||
if (GetTag(oMyTarget) == "loot_bones_obj")
|
||||
{
|
||||
SetLocalInt(oMyTarget, "nDestroyedByDMsHelper", TRUE);
|
||||
}
|
||||
effect eDestroy = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDestroy, lMyLoc);
|
||||
ExecuteScript("_kb_corpse_death", oMyTarget);
|
||||
dmwand_BuildConversation("Start", "");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
** Save your module. Then re-build your module (scripts only); to do this, **
|
||||
** select Build Module under the Build pull-down menu, then check only the **
|
||||
** Advanced/Compile/Scripts boxes, then click Build, then Done once the **
|
||||
** build is finished. Then re-save your module. Once this is done, the **
|
||||
** code listed below will handle the rest. **
|
||||
*******************************************************************************/
|
||||
// Destroy bones if "Destroy Target" command sent by DM's Helper wand
|
||||
// (OBJECT_SELF in the following section refers to the bones)
|
||||
if (GetLocalInt(OBJECT_SELF, "nDestroyedByDMsHelper") == TRUE)
|
||||
{
|
||||
BonesCleanup(OBJECT_SELF, GetLocalInt(OBJECT_SELF, "nKeepWeaponsBonesFade"));
|
||||
return;
|
||||
}
|
||||
|
||||
//Get all of our required information
|
||||
int nUseBlood = GetLocalInt(OBJECT_SELF, "nUseBlood"); //Check for gratiutously Gory Destruction
|
||||
object oHostBody = GetLocalObject(OBJECT_SELF, "oHostBody"); //Get Value set by _kb_loot_corpse at creation
|
||||
object oCorpseBlood = GetLocalObject(OBJECT_SELF, "oBloodSpot"); //Get Value set by _kb_loot_corpse at creation
|
||||
|
||||
// Determine creature size for later use
|
||||
int nCorpseSize = GetCreatureSize(oHostBody);
|
||||
|
||||
object oPC = GetLastKiller();
|
||||
|
||||
if (nUseBlood)
|
||||
{
|
||||
// Undead/constructs/elementals will never "gib", but all other creatures
|
||||
// (including Tiny-sized ones) will
|
||||
effect eBloodyEnd = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
|
||||
PlaySound("cb_ht_chunk");
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBloodyEnd, OBJECT_SELF, 3.0f);
|
||||
}
|
||||
|
||||
//Delete the BloodSpot (if created)
|
||||
if (GetIsObjectValid(oCorpseBlood))
|
||||
{
|
||||
DestroyObject(oCorpseBlood);
|
||||
}
|
||||
|
||||
// Empty and delete actual creature corpse (body)
|
||||
DestroyInventory(oHostBody);
|
||||
/* There is no call to DestroyDroppedWeapons since if the weapons are
|
||||
dropped, they are already deleted from oHostBody. If the weapons are
|
||||
not dropped, then the function would still not delete the weapons
|
||||
since GetItemPossessor would be a valid object */
|
||||
AssignCommand(oHostBody, SetIsDestroyable(TRUE,FALSE,FALSE));
|
||||
DestroyObject(oHostBody);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The following section deletes ALL, SOME, or NONE of the inventory:
|
||||
// - All (except plot): default if DOA's "Bashed Loot Breakage" plugin ("doa_bashbreak") isn't installed
|
||||
// - Some (random chance based on item/value): requires "doa_bashbreak" plugin
|
||||
// - None: not default (only works if nKeepInventoryBash = TRUE)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
if (GetLocalInt(GetModule(),"doa_bashbreak"))
|
||||
{
|
||||
// Random chance of inventory items breaking when corpse is bashed
|
||||
ExecuteScript("doa_bashbreak", OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
if (GetLocalInt(OBJECT_SELF, "nKeepInventoryBash") == FALSE)
|
||||
// Delete all items (except Plot) from lootable corpse placeable
|
||||
DestroyInventory(OBJECT_SELF);
|
||||
else
|
||||
{
|
||||
// Do nothing (delete nothing from lootable corpse placeable)
|
||||
}
|
||||
}
|
||||
|
||||
// If user wants bones to be created when corpse is bashed...
|
||||
if (GetLocalInt(OBJECT_SELF, "nUseBonesBash"))
|
||||
{
|
||||
if ((GetLocalInt(OBJECT_SELF, "nTinyBones") == FALSE) && (nCorpseSize == CREATURE_SIZE_TINY))
|
||||
{
|
||||
// Do nothing -- no bones for tiny creatures if nTinyBones is FALSE
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create the bones
|
||||
object oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "loot_bones_obj", GetLocation(OBJECT_SELF), FALSE);
|
||||
// Move inventory to bones
|
||||
TransferToBones(OBJECT_SELF, oBones);
|
||||
// Fade bones after nBoneFade seconds
|
||||
if (GetLocalInt(OBJECT_SELF, "nBonesFade") > 0)
|
||||
{
|
||||
// Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin
|
||||
SetLocalInt(oBones, "nRacialType", GetLocalInt(OBJECT_SELF, "nRacialType"));
|
||||
SetLocalString(oBones, "sHostBodyResRef", GetLocalString(OBJECT_SELF, "sHostBodyResRef"));
|
||||
// Pass dropped weapon/shield/torch info to bones
|
||||
SetLocalObject(oBones, "oLeftWpn", GetLocalObject(OBJECT_SELF, "oLeftWpn"));
|
||||
SetLocalObject(oBones, "oRightWpn", GetLocalObject(OBJECT_SELF, "oRightWpn"));
|
||||
int nKeepWeaponsBonesFade = GetLocalInt(OBJECT_SELF, "nKeepWeaponsBonesFade");
|
||||
// Remember nKeepWeaponsBonesFade for use with DM's Helper wand
|
||||
SetLocalInt(oBones, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade);
|
||||
float fBonesFade = IntToFloat(GetLocalInt(OBJECT_SELF, "nBonesFade"));
|
||||
AssignCommand(oBones, DelayCommand(fBonesFade, BonesCleanup(oBones, nKeepWeaponsBonesFade)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete unclaimed, dropped, non-Plot weapons/shields/torches unless nKeepWeaponsBash = 1
|
||||
if (!GetLocalInt(OBJECT_SELF, "nKeepWeaponsBash"))
|
||||
DestroyDroppedWeapons(OBJECT_SELF);
|
||||
|
||||
// Destroy the lootable corpse placeable (once it's empty)
|
||||
// DelayCommand(1.0f, DestroyObject(OBJECT_SELF)); // Removed in version 3.3
|
||||
DelayCommand(1.0, DestroyIfEmpty());
|
||||
|
||||
}
|
189
_module/nss/_kb_corpse_distb.nss
Normal file
189
_module/nss/_kb_corpse_distb.nss
Normal file
@@ -0,0 +1,189 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_distb // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// CAUTION: You MUST re-save/compile (or press F7 for "Save and Compile") //
|
||||
// the "_kb_corpse_death" and "_kb_corpse_distb" scripts if you make any //
|
||||
// changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
|
||||
// #include file). //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// NOTE: If you were using the old "_kb_ohb_lootable", be sure to delete //
|
||||
// that script, and remove it from the OnHeartbeat of your lootable corpse //
|
||||
// placeable (tag "invis_corpse_obj"). This only applies if you have an OLD //
|
||||
// version of Keron's lootable corpses script. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnDisturbed event of the lootable corpse placeable (tag //
|
||||
// "invis_corpse_obj") contains this script. This script checks the //
|
||||
// inventory of OBJECT_SELF, and when it is empty (and dropped weapons have //
|
||||
// been claimed), it checks a LocalInt to see if the now-empty corpse should //
|
||||
// be destroyed along with the lootable corpse placeable. Plot items are //
|
||||
// not destroyed. If nKeepWeaponsEmpty is TRUE, empties will be destroyed //
|
||||
// even if dropped weapons/shields/torches are unclaimed. //
|
||||
// //
|
||||
// If the inventory is NOT empty, this script will also check to see if the //
|
||||
// lootable armour (oLootArmour) was removed; if so, it destroys the //
|
||||
// original armour (oOrigArmour) on the corpse. A similar check is made for //
|
||||
// oLootHelmet and oOrigHelmet. //
|
||||
// //
|
||||
// The "_kb_loot_corpse" script must have this line: //
|
||||
// int nKeepEmpties = FALSE; //
|
||||
// in order for the empty corpse to destroy itself in this script. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.3 Change Log:
|
||||
- fixed comments to clarify that "doa_lootnotify" script refers to DOA's "Party Loot Notification" plugin
|
||||
/* Version 3.2 Change Log:
|
||||
- renamed script from "_kb_ondist_loot" to "_kb_corpse_distb" for naming consistency
|
||||
- consolidated inventory management functions to _kb_inc_invmgmt
|
||||
- ClearInventory function calls changed to DestroyInventory in _kb_inc_invmgmt (identical)
|
||||
- get low animation moved to end of script (see DEFAULT BEHAVIOR)
|
||||
- added simple plugin architecture (requires file _kb_plugins)
|
||||
- integration with DOA's "Party Loot Notification" plugin ("doa_lootnotify") now requires zero editing (no include call)
|
||||
- added GetIsObjectValid check before destroying Bloodspot
|
||||
- changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions
|
||||
- renamed oHostCorpse to oHostBody for consistency
|
||||
- added check for oLootHelmet and oOrigHelmet
|
||||
*/
|
||||
|
||||
#include "_kb_inc_invmgmt"
|
||||
|
||||
/*********************************************************************
|
||||
** This function checks to see if our corpse's discarded weapons **
|
||||
** have been picked up. If so, it returns TRUE. Returns TRUE if **
|
||||
** no weapons have been dropped. Returns TRUE if any weapon is **
|
||||
** unclaimed but nKeepWeaponsEmpty is set to TRUE. **
|
||||
** **
|
||||
** NOTE: Shields/torches are also considered "weapons" for the **
|
||||
** purposes of this script. **
|
||||
*********************************************************************/
|
||||
int CheckWeapons(object oCorpse)
|
||||
{
|
||||
//Check to see if anyone possesses the Left Weapon
|
||||
object oLeftWpn = GetLocalObject(oCorpse, "oLeftWpn");
|
||||
object oLeftTest = GetItemPossessor(oLeftWpn);
|
||||
//Check to see if anyone possesses the Right Weapon
|
||||
object oRightWpn = GetLocalObject(oCorpse, "oRightWpn");
|
||||
object oRightTest = GetItemPossessor(oRightWpn);
|
||||
if (oLeftWpn == OBJECT_INVALID && oRightWpn == OBJECT_INVALID)
|
||||
{
|
||||
// No weapons have been dropped
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oLeftTest != OBJECT_INVALID && oRightTest != OBJECT_INVALID)
|
||||
{
|
||||
// All dropped weapons have been claimed
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetLocalInt(oCorpse, "nKeepWeaponsEmpty"))
|
||||
{
|
||||
// One or both dropped weapons are unclaimed, but nKeepWeaponsEmpty == TRUE
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
** Here is our main script, which is fired if the Inventory is **
|
||||
** disturbed. It then checks to see if it needs to either clean **
|
||||
** up the corpse, destroy the original suit of armour still on **
|
||||
** the corpse, or destroy the original helmet still on the corpse. **
|
||||
*********************************************************************/
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
//Get all of our required information
|
||||
object oInvDisturbed = GetInventoryDisturbItem(); //Get item that was disturbed to trigger event
|
||||
int nInvDistType = GetInventoryDisturbType(); //Get type of inventory disturbance
|
||||
object oHostBody = GetLocalObject(OBJECT_SELF, "oHostBody"); //Get Value set by _kb_loot_corpse at creation
|
||||
object oCorpseBlood = GetLocalObject(OBJECT_SELF, "oBloodSpot"); //Get Value set by _kb_loot_corpse at creation
|
||||
|
||||
object oOrigArmour = GetLocalObject(OBJECT_SELF, "oOrigArmour"); //Get Value set by _kb_loot_corpse at creation
|
||||
object oLootArmour = GetLocalObject(OBJECT_SELF, "oLootArmour"); //Get Value set by _kb_loot_corpse at creation
|
||||
|
||||
object oOrigHelmet = GetLocalObject(OBJECT_SELF, "oOrigHelmet"); //Get Value set by _kb_loot_corpse at creation
|
||||
object oLootHelmet = GetLocalObject(OBJECT_SELF, "oLootHelmet"); //Get Value set by _kb_loot_corpse at creation
|
||||
|
||||
object oPC = GetLastDisturbed();
|
||||
|
||||
object oHasInventory = GetFirstItemInInventory(OBJECT_SELF); //Check for inventory
|
||||
if (oHasInventory == OBJECT_INVALID && CheckWeapons(OBJECT_SELF)) //If no inventory found and Weapons have been claimed
|
||||
{
|
||||
/*******************************************
|
||||
** Inventory is empty. Now we check the **
|
||||
** nKeepEmpty value. **
|
||||
*******************************************/
|
||||
int nKeepEmpty = GetLocalInt(OBJECT_SELF, "nKeepEmpty"); //Get Value set by _kb_loot_corpse at creation
|
||||
if (!nKeepEmpty)
|
||||
{
|
||||
/*******************************************
|
||||
** nKeepEmpty is FALSE. Delete empty. **
|
||||
*******************************************/
|
||||
|
||||
//Delete the BloodSpot (if created)
|
||||
if (GetIsObjectValid(oCorpseBlood))
|
||||
{
|
||||
DestroyObject(oCorpseBlood);
|
||||
}
|
||||
// Empty and delete actual creature corpse (body)
|
||||
DestroyInventory(oHostBody);
|
||||
AssignCommand(oHostBody, SetIsDestroyable(TRUE,FALSE,FALSE));
|
||||
DestroyObject(oHostBody);
|
||||
// Empty and delete lootable corpse object (self)
|
||||
DelayCommand(1.0f, DestroyObject(OBJECT_SELF));
|
||||
}
|
||||
}
|
||||
|
||||
//Check to see if the Armour has been taken
|
||||
if (oInvDisturbed == oLootArmour && nInvDistType == INVENTORY_DISTURB_TYPE_REMOVED)
|
||||
{
|
||||
/*******************************************
|
||||
** The Armour is gone - destroy original **
|
||||
** armour still showing on corpse. **
|
||||
*******************************************/
|
||||
DestroyObject(oOrigArmour);
|
||||
}
|
||||
|
||||
//Check to see if the Helmet has been taken
|
||||
if (oInvDisturbed == oLootHelmet && nInvDistType == INVENTORY_DISTURB_TYPE_REMOVED)
|
||||
{
|
||||
/*******************************************
|
||||
** The Helmet is gone - destroy original **
|
||||
** helmet still showing on corpse. **
|
||||
*******************************************/
|
||||
DestroyObject(oOrigHelmet);
|
||||
}
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
if (GetLocalInt(GetModule(),"doa_lootnotify"))
|
||||
{
|
||||
ExecuteScript("doa_lootnotify", OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f));
|
||||
}
|
||||
}
|
33
_module/nss/_kb_corpse_phatk.nss
Normal file
33
_module/nss/_kb_corpse_phatk.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_phatk // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnPhysicalAttacked event of the lootable corpse placeable (tag //
|
||||
// "invis_corpse_obj") contains this script. //
|
||||
// //
|
||||
// This script allows third-party plugins to function (if installed), or //
|
||||
// runs the default behavior (if no plugins installed). //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
|
||||
}
|
37
_module/nss/_kb_corpse_spell.nss
Normal file
37
_module/nss/_kb_corpse_spell.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_spell // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnSpellCastAt events of the lootable corpse placeable (tag //
|
||||
// "invis_corpse_obj") and the lootable bones placeable ("loot_bones_obj") //
|
||||
// contain this script. //
|
||||
// //
|
||||
// This script allows third-party plugins to function (if installed), or //
|
||||
// runs the default behavior (if no plugins installed). //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
// Scrotok's Raise Dead/Resurrection plugin
|
||||
if (GetLocalInt(GetModule(),"kb_raise_res"))
|
||||
ExecuteScript("_kb_raise_res", OBJECT_SELF);
|
||||
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
|
||||
}
|
59
_module/nss/_kb_corpse_used.nss
Normal file
59
_module/nss/_kb_corpse_used.nss
Normal file
@@ -0,0 +1,59 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_used // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnUsed event of the lootable corpse placeable (tag "invis_corpse_obj") //
|
||||
// contains this script. This script causes the PC searching the corpse to //
|
||||
// crouch down and visibly reach for the corpse. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.3 Change Log:
|
||||
- fixed comments to clarify that "doa_lootnotify" script refers to DOA's "Party Loot Notification" plugin
|
||||
/* Version 3.2 Change Log:
|
||||
- renamed script from "_kb_loot_crouch" to "_kb_corpse_used" for naming consistency
|
||||
- added simple plugin architecture (requires file _kb_plugins)
|
||||
- integration with DOA's "Party Loot Notification" plugin ("doa_lootnotify") now requires zero editing (no include call)
|
||||
- added check of GetIsOpen to ensure crouch animation only plays when corpse is opened
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
if (GetLocalInt(GetModule(),"doa_lootnotify"))
|
||||
{
|
||||
ExecuteScript("doa_lootnotify_o", OBJECT_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
object oPC = GetLastUsedBy();
|
||||
|
||||
// Play crouch animation only if PC just opened the corpse inventory GUI
|
||||
// EXCEPTION: If the PC opens the corpse inventory, then quickly presses
|
||||
// the "I" key (to open the PC inventory), a BioWare software bug will
|
||||
// trick the software into permanently thinking the corpse inventory is
|
||||
// open (even though the GUI can be opened and closed normally). This will
|
||||
// cause the animation to play when corpse is opened or closed (a minor
|
||||
// bug).
|
||||
if (GetIsOpen(OBJECT_SELF))
|
||||
{
|
||||
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
34
_module/nss/_kb_corpse_user.nss
Normal file
34
_module/nss/_kb_corpse_user.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_corpse_user // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. The //
|
||||
// OnUserDefined event of the lootable corpse placeable (tag //
|
||||
// "invis_corpse_obj") contains this script. //
|
||||
// //
|
||||
// This script allows third-party plugins to function (if installed), or //
|
||||
// runs the default behavior (if no plugins installed). //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
/* Register Plugins */
|
||||
if (!GetLocalInt(GetModule(),"kb_lootcorpse_plugins"))
|
||||
ExecuteScript("_kb_plugins", OBJECT_SELF);
|
||||
|
||||
// PLUGIN BEHAVIOR
|
||||
|
||||
// DEFAULT BEHAVIOR if plugin not installed
|
||||
int iEvent = GetUserDefinedEventNumber();
|
||||
|
||||
}
|
156
_module/nss/_kb_inc_invmgmt.nss
Normal file
156
_module/nss/_kb_inc_invmgmt.nss
Normal file
@@ -0,0 +1,156 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_inc_invmgmt (include file) // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// CAUTION: You MUST re-save/compile (or press F7 for "Save and Compile") //
|
||||
// the "_kb_corpse_death" and "_kb_corpse_distb" scripts if you make any //
|
||||
// changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
|
||||
// #include file). //
|
||||
// //
|
||||
// CAUTION: You MUST re-save (not the F7 key!) "_kb_loot_corpse" if you make //
|
||||
// any changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
|
||||
// #include file). To re-save it, make a change to the script, then UNDO //
|
||||
// the change, then re-save. //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. It //
|
||||
// contains common functions used in "_kb_corpse_death", "_kb_corpse_distb", //
|
||||
// and "_kb_loot_corpse". //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.2 Change Log:
|
||||
- ClearInventory was 99% the same as DestroyInventory except for the
|
||||
dropped weapons, so they were consolidated.
|
||||
- DestroyInventory rewritten to use equipped item integers in a loop.
|
||||
- DestroyDroppedWeapons is a new function which does only that.
|
||||
- added TransferToBones function to move lootable corpse placeable inventory to bones
|
||||
- added BonesCleanup function to get rid of the bones after nBonesFade
|
||||
- changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions
|
||||
*/
|
||||
|
||||
/************************************************************************
|
||||
** This function is used to clear the entire inventory of an object **
|
||||
** (except for Creature Slots, which have no bearing here), so that **
|
||||
** when the object is destroyed, no Lootbags are left behind to **
|
||||
** litter up the landscape & devour system resources. Plot items are **
|
||||
** not affected. **
|
||||
************************************************************************/
|
||||
void DestroyInventory(object oCorpse)
|
||||
{
|
||||
|
||||
/* Version 3.2 - function rewritten */
|
||||
|
||||
object oLoot; int x;
|
||||
|
||||
//Get any gold from the dead creature
|
||||
x = GetGold(oCorpse);
|
||||
if (x) TakeGoldFromCreature(x, oCorpse, TRUE);
|
||||
|
||||
// Destroy any loot the dead creature has equipped
|
||||
// 0=head, 1=chest, 2=boot, 3=arms, 4=rhand, 5=lhand, 6=cloak,
|
||||
// 7=lring, 8=rring, 9=neck, 10=belt, 11=arrow, 12=bullet, 13=bolt
|
||||
for (x = 0; x < 4; x++)
|
||||
{
|
||||
oLoot = GetItemInSlot(x, oCorpse);
|
||||
if (GetIsObjectValid(oLoot))
|
||||
{
|
||||
if (!GetPlotFlag(oLoot))
|
||||
DestroyObject(oLoot);
|
||||
}
|
||||
}
|
||||
// skipped 4 & 5 = equipped weapons (rhand & lhand)
|
||||
for (x = 6; x < 14; x++)
|
||||
{
|
||||
oLoot = GetItemInSlot(x, oCorpse);
|
||||
if (GetIsObjectValid(oLoot))
|
||||
{
|
||||
if (!GetPlotFlag(oLoot))
|
||||
DestroyObject(oLoot);
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy remaining loot on creature
|
||||
oLoot = GetFirstItemInInventory(oCorpse);
|
||||
while (GetIsObjectValid(oLoot))
|
||||
{
|
||||
if (!GetPlotFlag(oLoot))
|
||||
DestroyObject(oLoot);
|
||||
oLoot = GetNextItemInInventory(oCorpse);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
** This function is used to destroy unclaimed dropped weapons. **
|
||||
** Plot items are not affected. **
|
||||
** **
|
||||
** NOTE: Shields/torches are also considered "weapons" for the **
|
||||
** purposes of this script. **
|
||||
** **
|
||||
** NOTE: The lootable corpse placeable or the bones can call this **
|
||||
** script. **
|
||||
************************************************************************/
|
||||
void DestroyDroppedWeapons(object oLootCorpse)
|
||||
{
|
||||
//Check to see if anyone Possesses the Left Weapon
|
||||
object oLeftWpn = GetLocalObject(oLootCorpse, "oLeftWpn");
|
||||
// If Left Weapon is unclaimed...
|
||||
if (GetItemPossessor(oLeftWpn) == OBJECT_INVALID)
|
||||
{
|
||||
// If dropped weapon is not Plot
|
||||
if (!GetPlotFlag(oLeftWpn))
|
||||
DestroyObject(oLeftWpn);
|
||||
}
|
||||
//Check to see if anyone Possesses the Right Weapon
|
||||
object oRightWpn = GetLocalObject(oLootCorpse, "oRightWpn");
|
||||
// If Right Weapon is unclaimed...
|
||||
if (GetItemPossessor(oRightWpn) == OBJECT_INVALID)
|
||||
{
|
||||
// If dropped weapon is not Plot
|
||||
if (!GetPlotFlag(oRightWpn))
|
||||
DestroyObject(oRightWpn);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************
|
||||
** This script gets rid of the bones after they fade **
|
||||
*********************************************************/
|
||||
void BonesCleanup(object oBones, int nKeepWeaponsBonesFade)
|
||||
{
|
||||
// Empty the bones inventory
|
||||
DestroyInventory(oBones);
|
||||
// Delete unclaimed, dropped, non-Plot weapons unless nKeepWeaponsBonesFade = 1
|
||||
if (!nKeepWeaponsBonesFade)
|
||||
DestroyDroppedWeapons(oBones);
|
||||
// Delete the bones
|
||||
DestroyObject(oBones);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** This script moves all items from lootable corpse placeable to the bones **
|
||||
******************************************************************************/
|
||||
void TransferToBones(object oLootCorpse, object oBones)
|
||||
{
|
||||
// Move gold to the bones
|
||||
if (GetGold(oLootCorpse))
|
||||
{
|
||||
AssignCommand(oBones, TakeGoldFromCreature(GetGold(oLootCorpse), oLootCorpse, FALSE));
|
||||
}
|
||||
// Move inventory items to the bones
|
||||
object oLoot = GetFirstItemInInventory(oLootCorpse);
|
||||
while (GetIsObjectValid(oLoot))
|
||||
{
|
||||
AssignCommand(oBones, ActionTakeItem(oLoot, oLootCorpse));
|
||||
oLoot = GetNextItemInInventory(oLootCorpse);
|
||||
}
|
||||
}
|
||||
|
||||
//void main() {}
|
855
_module/nss/_kb_loot_corpse.nss
Normal file
855
_module/nss/_kb_loot_corpse.nss
Normal file
@@ -0,0 +1,855 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_loot_corpse (include file) // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// CAUTION: You MUST re-save/compile (F7 key) "nw_c2_default7" whenever //
|
||||
// "_kb_loot_corpse" is modified! //
|
||||
// //
|
||||
// CAUTION: You MUST re-save (not the F7 key!) "_kb_loot_corpse" if you make //
|
||||
// any changes to "_kb_inc_invmgmt" (for programmers only: because it is an //
|
||||
// #include file). To re-save it, make a change to the script, then UNDO //
|
||||
// the change, then re-save. //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's included as //
|
||||
// part of "nw_c2_default7" using the #include command. All you need to do //
|
||||
// is configure the script (see below) as desired. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// //
|
||||
// CONFIGURING THE SCRIPT //
|
||||
// //
|
||||
// This script supports some configuration by the user. Following the //
|
||||
// void LeaveCorpse() of the _kb_loot_corpse, you'll find a section where //
|
||||
// you can set a few things. These include: (with default values displayed) //
|
||||
// //
|
||||
// //
|
||||
// int nUseLootable = TRUE This enables the script. Setting is to FALSE //
|
||||
// disables it. //
|
||||
// //
|
||||
// int nMoveEquipped = TRUE Setting this to FALSE will stop the script //
|
||||
// from moving equipped items (other than //
|
||||
// Armour/Helmet and Weapons/Shield/Torch) to //
|
||||
// the lootable corpse placeable. (To prevent //
|
||||
// the move/copy of Armour/Helmet and Weapons/ //
|
||||
// Shield/Torch, use the next four toggles.) //
|
||||
// Remember that CREATURE SLOTTED items are //
|
||||
// NEVER moved. //
|
||||
// //
|
||||
// int nCopyArmour = TRUE This will use the ResRef to create a copy of //
|
||||
// the Armour/Helmet the creature is wearing. //
|
||||
// If you do not want to use this function, you //
|
||||
// may want to consider the next one (called //
|
||||
// nMoveArmour). nCopyArmour takes precedence //
|
||||
// over nMoveArmour if both are TRUE. //
|
||||
// //
|
||||
// int nMoveArmour = FALSE Setting this TRUE will just move the armour //
|
||||
// from the Chest slot to the lootable corpse //
|
||||
// placeable on death; it will also move the //
|
||||
// helmet from the Head slot to the lootable //
|
||||
// corpse placeable. This can be a visual issue //
|
||||
// when used with NPCs - since when the armour //
|
||||
// is moved, the NPC will become 'naked'. //
|
||||
// //
|
||||
// *** If you do not wish to use either of the armour functions, just set //
|
||||
// both values to FALSE. Then just add an additional suit of armour //
|
||||
// and/or helmet to the inventory of creatures you want to have drop //
|
||||
// their armour/helmet. //
|
||||
// //
|
||||
// int nDropWeapons = TRUE This will use the ResRef for dropping the //
|
||||
// weapons on the ground - which is accomplished //
|
||||
// by creating new ones on the ground and //
|
||||
// destroying the ones in the creature's //
|
||||
// inventory. NOTE: Even though the parameter //
|
||||
// is called nDropWeapons, anything held in the //
|
||||
// left or right hand (shield, torch, etc.) is //
|
||||
// affected by this parameter. nDropWeapons //
|
||||
// takes precedence over nMoveWeapons if both //
|
||||
// are TRUE. //
|
||||
// //
|
||||
// int nMoveWeapons = FALSE Setting this TRUE will just move the weapons //
|
||||
// to the Lootable Object just as the rest of //
|
||||
// inventory is handled. NOTE: Even though the //
|
||||
// parameter is called nMoveWeapons, anything //
|
||||
// held in the left or right hand (shield, //
|
||||
// torch, etc.) is affected by this parameter. //
|
||||
// //
|
||||
// *** If you do not wish to use either of the weapon functions, just set //
|
||||
// both values to FALSE. Then just add additional weapons/shields/ //
|
||||
// torches to the inventory of creatures you want to have drop those //
|
||||
// items. //
|
||||
// //
|
||||
// int nUseBlood = TRUE Set this to TRUE if you want a Bloodspot to //
|
||||
// appear under the corpse for a little extra //
|
||||
// gory appeal. In addition, it will allow for //
|
||||
// a grisly display if the corpse is destroyed. //
|
||||
// Undead/constructs/elementals will not leave a //
|
||||
// Bloodspot or "gib" when bashed. //
|
||||
// //
|
||||
// int nTinyBlood = FALSE Set this to FALSE if you don't want Tiny- //
|
||||
// sized creatures (rats, bats, etc.) to leave a //
|
||||
// Bloodspot, scorch mark, or small flame. They //
|
||||
// will still "gib" normally. Only applies if //
|
||||
// nUseBlood = TRUE. //
|
||||
// //
|
||||
// int nUseFlame = TRUE Set this to TRUE if you want a scorch mark or //
|
||||
// a small flame (which burns out after 10-120 //
|
||||
// seconds, and is replaced by a scorch mark) to //
|
||||
// appear if 1/3 or more of the damage which //
|
||||
// killed the creature was fire or electrical. //
|
||||
// Scorch mark or flame will appear instead of //
|
||||
// Bloodspot. If the total fire or electrical //
|
||||
// damage exceeds the creature's max HP, a small //
|
||||
// flame appears instead of a scorch mark. The //
|
||||
// corpse will still gib normally. Undead, //
|
||||
// constructs, and elementals will leave a //
|
||||
// scorch mark, small flame, or nothing. Only //
|
||||
// applies if nUseBlood = TRUE. //
|
||||
// //
|
||||
// int nCorpseFade = 0 This is the delay in actual seconds that the //
|
||||
// corpse will remain before it fades. If you //
|
||||
// set this to 0 (zero) it will turn off the //
|
||||
// corpse fade - allowing all bodies and loot //
|
||||
// to remain indefinitely. //
|
||||
// //
|
||||
// int nUseBonesBash = TRUE Set this to TRUE if you want bones to appear //
|
||||
// when the corpse is bashed. The bones cannot //
|
||||
// be bashed; they will only disappear if //
|
||||
// nBonesFade > 0. //
|
||||
// //
|
||||
// int nUseBonesFade = TRUE Set this to TRUE if you want bones to appear //
|
||||
// when the corpse fades. The bones cannot //
|
||||
// be bashed; they will only disappear if //
|
||||
// nBonesFade > 0. //
|
||||
// //
|
||||
// int nBonesFade = 60 This is the delay in actual seconds that the //
|
||||
// bones will remain before they fade. If you //
|
||||
// set this to 0 (zero) it will turn off the //
|
||||
// bones fade - allowing all bones (and loot, //
|
||||
// if the bones contain any) to remain forever. //
|
||||
// //
|
||||
// int nTinyBones = FALSE Set this to FALSE if you don't want Tiny- //
|
||||
// sized creatures (rats, bats, etc.) to turn //
|
||||
// into bones when their corpse is bashed or //
|
||||
// fades. Only applies if nUseBonesBash and/or //
|
||||
// nUseBonesFade = TRUE. //
|
||||
// //
|
||||
// int nKeepInventoryBash = FALSE Set this to TRUE if you want all items //
|
||||
// in a creature's inventory to remain when //
|
||||
// its corpse is bashed. If installed, //
|
||||
// DOA's "Bashed Loot Breakage" plugin //
|
||||
// ("doa_bashbreak") takes precedence over //
|
||||
// nKeepInventoryBash. //
|
||||
// //
|
||||
// int nKeepInventoryFade = FALSE Set this to TRUE if you want all items //
|
||||
// in a creature's inventory to remain when //
|
||||
// its corpse fades. //
|
||||
// //
|
||||
// int nKeepEmpties = TRUE Set this to FALSE if you want EMPTY corpses //
|
||||
// to fade immediately after their inventory is //
|
||||
// emptied (and dropped weapons are claimed, //
|
||||
// unless nKeepWeaponsEmpty is TRUE). //
|
||||
// //
|
||||
// int nKeepWeaponsBonesFade = FALSE Set this to FALSE if you want //
|
||||
// dropped, unclaimed, non-plot weapons //
|
||||
// to be destroyed when bones fade. //
|
||||
// Only valid if nBonesFade > 0. //
|
||||
// //
|
||||
// int nKeepWeaponsCorpseFade = TRUE Set this to FALSE if you want //
|
||||
// dropped, unclaimed, non-plot weapons //
|
||||
// to be destroyed when corpses fade. //
|
||||
// Only valid if nCorpseFade > 0. //
|
||||
// //
|
||||
// int nKeepWeaponsBash = TRUE Set this to FALSE if you want //
|
||||
// dropped, unclaimed, non-plot weapons //
|
||||
// to be destroyed when corpses are //
|
||||
// bashed. //
|
||||
// //
|
||||
// int nKeepWeaponsEmpty = TRUE Set this to TRUE if you want empty //
|
||||
// corpses to be destroyed even if //
|
||||
// dropped weapons are unclaimed. //
|
||||
// //
|
||||
// *** Even though the 4 parameters listed above start with "nKeepWeapons", //
|
||||
// anything held in the left or right hand (shield, torch, etc.) is //
|
||||
// affected by these parameters, not just weapons. //
|
||||
// //
|
||||
// int nOverrideForPlacedCorpses = TRUE Set this to TRUE if you want the //
|
||||
// 'Spawned Corpses' you place to be //
|
||||
// permament. Setting it to FALSE //
|
||||
// will cause your Placed Dead //
|
||||
// creatures to act as the settings //
|
||||
// above dictate. (i.e. Fading Out //
|
||||
// after the delay or being emptied) //
|
||||
// To use this functionality, you //
|
||||
// should place the _kb_plc_corpse //
|
||||
// script in the OnSpawn of the //
|
||||
// critter you want to spawn dead. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.3 Change Log:
|
||||
- added SetPlotFlag to ensure oLootCorpse can't be destroyed before oHostBody is emptied (and weapons are dropped)
|
||||
- fixed comments to clarify that "doa_bashbreak" script refers to DOA's "Bashed Loot Breakage" plugin
|
||||
/* Version 3.2 Change Log:
|
||||
- consolidated inventory management functions to _kb_inc_invmgmt
|
||||
- DestroyInventory function calls changed to DestroyInventory + DestroyDroppedWeapons in _kb_inc_invmgmt (identical)
|
||||
- added nTinyBlood and nUseFlame (added Flameout function and rewrote Bloodspot routine)
|
||||
- added GetIsObjectValid check before destroying Bloodspot
|
||||
- removed ActionWait (wasn't needed)
|
||||
- combined several DelayCommand's into a single function (FadeCorpse) to improve performance
|
||||
- improved FadeCorpse to take advantage of new functionality (nKeepInventoryFade, nUseBonesFade, etc.)
|
||||
- fixed bug in DropLeftWeapon/DropRightWeapon that caused dropped weapons to have incorrect GetIdentified value
|
||||
- fixed bug where 2 copies of droppable, equipped, Plot armor were created instead of 1 when corpse was bashed
|
||||
- fixed bug that caused copied armor to have incorrect GetPlotFlag and GetIdentified values
|
||||
- added nUseBonesBash to create bones when corpse is bashed
|
||||
- added nUseBonesFade to create bones when corpse fades
|
||||
- added nBonesFade to determine when bones fade (if ever)
|
||||
- added nTinyBones to prevent bones from appearing for tiny-sized creatures
|
||||
- added nKeepInventoryBash to keep all items in a creature's inventory when its corpse is bashed
|
||||
- added nKeepInventoryFade to keep all items in a creature's inventory when its corpse fades
|
||||
- replaced nKeepWeapons with: nKeepWeaponsBonesFade, nKeepWeaponsCorpseFade, nKeepWeaponsBash, and nKeepWeaponsEmpty
|
||||
- changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions
|
||||
- changed comments to reflect that undead/constructs/elementals will not leave Bloodspot or "gib" when bashed
|
||||
- fixed bug so that nCopyArmour takes precedence over nMoveArmour if both are TRUE
|
||||
- added comments to clarify that nCopyArmour takes precedence over nMoveArmour if both are TRUE
|
||||
- added comments to clarify that nDropWeapons takes precedence over nMoveWeapons if both are TRUE
|
||||
- renamed oDeadNPC to oHostBody, and vDeadNPCLoc to vHostBodyLoc for consistency
|
||||
- fixed bug so that nCopyArmour/nMoveArmour affect helmets equipped in the creature's Head slot, as well
|
||||
- added support for "Destroy Target" command of DM's Helper wand (used to destroy the corpse or bones)
|
||||
- added code to pass oLeftWpn/oRightWpn from oHostBody to oLootCorpse for use with Scrotok's Raise Dead/Ressurection Plugin
|
||||
*/
|
||||
|
||||
#include "_kb_inc_invmgmt"
|
||||
|
||||
/*******************************************************************************
|
||||
** This script was borrowed from the Hard Core Ruleset, where they use it to **
|
||||
** move a Dead PC's inventory to a lootable corpse object. Credit where **
|
||||
** credit is due, I always say. :) **
|
||||
*******************************************************************************/
|
||||
object strip_equipped(object oHostBody, object oLootCorpse, object oEquip)
|
||||
{
|
||||
if(GetIsObjectValid(oEquip) && GetDroppableFlag(oEquip))
|
||||
{
|
||||
AssignCommand(oLootCorpse, ActionTakeItem(oEquip, oHostBody));
|
||||
}
|
||||
return oEquip;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** These scripts drop weapons/shields/torches held in the corpse's hands. **
|
||||
** **
|
||||
** SPECIAL THANKS TO DREZDAR and MOJO for their help in getting these two **
|
||||
** drop weapon scripts written. I never would have gotten the vectors right, **
|
||||
** but THEY sure did! **
|
||||
** **
|
||||
** (East = 0, North = 90, West = 180, South = 270) **
|
||||
** **
|
||||
*******************************************************************************/
|
||||
void DropLeftWeapon(object oLeftWpn, object oLootCorpse)
|
||||
{
|
||||
if(GetIsObjectValid(oLeftWpn) && GetDroppableFlag(oLeftWpn))
|
||||
{
|
||||
vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse));
|
||||
float fDifferential = 45.0f + IntToFloat(d20());//Randomize the Drop Angle
|
||||
float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance
|
||||
float fVarWpnFace = -20.0f - IntToFloat(d20(2));//Randomize the Drop Facing
|
||||
float fFacing = GetFacing(oLootCorpse);
|
||||
fFacing = fFacing + fDifferential;
|
||||
if (fFacing > 360.0f)
|
||||
{ fFacing = 720.0f - fFacing; }
|
||||
if (fFacing < 0.0f)
|
||||
{ fFacing = 360.0f + fFacing; }
|
||||
float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace;
|
||||
if (fWpnFacing > 360.0f)
|
||||
{ fWpnFacing = 720.0f - fWpnFacing; }
|
||||
if (fWpnFacing < 0.0f)
|
||||
{ fWpnFacing = 360.0f + fWpnFacing; }
|
||||
object oArea = GetArea(oLootCorpse);
|
||||
//Generate New Location
|
||||
float fNewX;
|
||||
float fNewY;
|
||||
float fNewZ;
|
||||
if ((fFacing > 0.0f) && (fFacing < 90.0f))
|
||||
{ fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 90.0f) && (fFacing < 180.0f))
|
||||
{ fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 180.0f) && (fFacing < 270.0f))
|
||||
{ fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 270.0f) && (fFacing < 360.0f))
|
||||
{ fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 0.0f)
|
||||
{ fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 90.0f)
|
||||
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 180.0f)
|
||||
{ fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 270.0f)
|
||||
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; }
|
||||
vector vNewFinal = Vector(fNewX, fNewY, fNewZ);
|
||||
location lDropLeft = Location(oArea, vNewFinal, fWpnFacing);
|
||||
//Drop Weapon
|
||||
string sLeftWpnRef = GetResRef(oLeftWpn);
|
||||
int nID = GetIdentified(oLeftWpn);
|
||||
if (GetPlotFlag(oLeftWpn))
|
||||
{
|
||||
SetPlotFlag(oLeftWpn, FALSE);
|
||||
DestroyObject(oLeftWpn);
|
||||
oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE);
|
||||
SetPlotFlag(oLeftWpn, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyObject(oLeftWpn);
|
||||
oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE);
|
||||
}
|
||||
SetIdentified(oLeftWpn, nID);
|
||||
SetLocalObject(oLootCorpse, "oLeftWpn", oLeftWpn);
|
||||
}
|
||||
// We're done with oHostBody, so allow oLootCorpse to be destroyable
|
||||
AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE)));
|
||||
}
|
||||
|
||||
void DropRightWeapon(object oRightWpn, object oLootCorpse)
|
||||
{
|
||||
if(GetIsObjectValid(oRightWpn) && GetDroppableFlag(oRightWpn))
|
||||
{
|
||||
vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse));
|
||||
float fDifferential = -45.0f + IntToFloat(d20());//Randomize the Drop Angle
|
||||
float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance
|
||||
float fVarWpnFace = 20.0f - IntToFloat(d20(2));//Randomize the Drop Facing
|
||||
float fFacing = GetFacing(oLootCorpse);
|
||||
fFacing = fFacing + fDifferential;
|
||||
if (fFacing > 360.0f)
|
||||
{ fFacing = 720.0f - fFacing; }
|
||||
if (fFacing < 0.0f)
|
||||
{ fFacing = 360.0f + fFacing; }
|
||||
float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace;
|
||||
if (fWpnFacing > 360.0f)
|
||||
{ fWpnFacing = 720.0f - fWpnFacing; }
|
||||
if (fWpnFacing < 0.0f)
|
||||
{ fWpnFacing = 360.0f + fWpnFacing; }
|
||||
object oArea = GetArea(oLootCorpse);
|
||||
//Generate New Location
|
||||
float fNewX;
|
||||
float fNewY;
|
||||
float fNewZ;
|
||||
if ((fFacing > 0.0f) && (fFacing < 90.0f))
|
||||
{ fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 90.0f) && (fFacing < 180.0f))
|
||||
{ fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 180.0f) && (fFacing < 270.0f))
|
||||
{ fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if ((fFacing > 270.0f) && (fFacing < 360.0f))
|
||||
{ fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 0.0f)
|
||||
{ fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 90.0f)
|
||||
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 180.0f)
|
||||
{ fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; }
|
||||
else if (fFacing == 270.0f)
|
||||
{ fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; }
|
||||
vector vNewFinal = Vector(fNewX, fNewY, fNewZ);
|
||||
location lDropRight = Location(oArea, vNewFinal, fWpnFacing);
|
||||
//Drop Weapon
|
||||
string sRightWpnRef = GetResRef(oRightWpn);
|
||||
int nID = GetIdentified(oRightWpn);
|
||||
if (GetPlotFlag(oRightWpn))
|
||||
{
|
||||
SetPlotFlag(oRightWpn, FALSE);
|
||||
DestroyObject(oRightWpn);
|
||||
oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE);
|
||||
SetPlotFlag(oRightWpn, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyObject(oRightWpn);
|
||||
oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE);
|
||||
}
|
||||
SetIdentified(oRightWpn, nID);
|
||||
SetLocalObject(oLootCorpse, "oRightWpn", oRightWpn);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** This script gets rid of the bloodspot, lootable corpse, and creature body **
|
||||
*******************************************************************************/
|
||||
void FadeCorpse(object oCorpseBlood, object oLootCorpse, object oHostBody)
|
||||
{
|
||||
//Delete the BloodSpot (if created)
|
||||
if (GetIsObjectValid(oCorpseBlood))
|
||||
{
|
||||
DestroyObject(oCorpseBlood);
|
||||
}
|
||||
// Empty (or don't empty) the lootable corpse placeable
|
||||
if (GetLocalInt(oLootCorpse, "nKeepInventoryFade") == FALSE)
|
||||
// Delete all items (except Plot) from lootable corpse placeable
|
||||
DestroyInventory(oLootCorpse);
|
||||
else
|
||||
{
|
||||
// Do nothing (delete nothing from lootable corpse placeable)
|
||||
}
|
||||
// If user wants bones to be created when corpse fades...
|
||||
if (GetLocalInt(oLootCorpse, "nUseBonesFade"))
|
||||
{
|
||||
if ((GetLocalInt(oLootCorpse, "nTinyBones") == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY))
|
||||
{
|
||||
// Do nothing -- no bones for tiny creatures if nTinyBones is FALSE
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create the bones
|
||||
object oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "loot_bones_obj", GetLocation(oLootCorpse), FALSE);
|
||||
// Move inventory to bones
|
||||
TransferToBones(oLootCorpse, oBones);
|
||||
// Fade bones after nBoneFade seconds
|
||||
if (GetLocalInt(oLootCorpse, "nBonesFade") > 0)
|
||||
{
|
||||
// Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin
|
||||
SetLocalInt(oBones, "nRacialType", GetLocalInt(oLootCorpse, "nRacialType"));
|
||||
SetLocalString(oBones, "sHostBodyResRef", GetLocalString(oLootCorpse, "sHostBodyResRef"));
|
||||
// Pass dropped weapon/shield/torch info to bones
|
||||
SetLocalObject(oBones, "oLeftWpn", GetLocalObject(oLootCorpse, "oLeftWpn"));
|
||||
SetLocalObject(oBones, "oRightWpn", GetLocalObject(oLootCorpse, "oRightWpn"));
|
||||
int nKeepWeaponsBonesFade = GetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade");
|
||||
// Remember nKeepWeaponsBonesFade for use with DM's Helper wand
|
||||
SetLocalInt(oBones, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade);
|
||||
float fBonesFade = IntToFloat(GetLocalInt(oLootCorpse, "nBonesFade"));
|
||||
AssignCommand(oBones, DelayCommand(fBonesFade, BonesCleanup(oBones, nKeepWeaponsBonesFade)));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Delete unclaimed, dropped, non-Plot weapons unless nKeepWeaponsCorpseFade = 1
|
||||
if (!GetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade"))
|
||||
DestroyDroppedWeapons(oLootCorpse);
|
||||
// Delete the lootable corpse placeable
|
||||
DestroyObject(oLootCorpse);
|
||||
// Empty and delete actual creature corpse (body)
|
||||
DestroyInventory(oHostBody);
|
||||
/* There is no call to DestroyDroppedWeapons since if the weapons are
|
||||
dropped, they are already deleted from oHostBody. If the weapons are
|
||||
not dropped, then the function would still not delete the weapons
|
||||
since GetItemPossessor would be a valid object */
|
||||
SetIsDestroyable(TRUE,FALSE,FALSE);
|
||||
// NOTE: The following line MUST be last in this script, since oHostBody
|
||||
// is the same as OBJECT_SELF
|
||||
DestroyObject(oHostBody);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** This script replaces the small flame with a scorch mark **
|
||||
*******************************************************************************/
|
||||
void Flameout(object oCorpseBlood, object oLootCorpse)
|
||||
{
|
||||
location lBloodLoc = GetLocation(oCorpseBlood);
|
||||
/*
|
||||
// Used for debugging
|
||||
SendMessageToPC(GetFirstPC(), "Flame script started...");
|
||||
if (!GetIsObjectValid(oCorpseBlood))
|
||||
{
|
||||
// This should never happen (if you bash/fade corpse, oHostBody is
|
||||
// destroyed, so Flameout won't run (can't add to action queue of invalid
|
||||
// object)
|
||||
SendMessageToPC(GetFirstPC(), "Flame already destroyed... location for new scorch unknown?");
|
||||
}
|
||||
*/
|
||||
// Get rid of small flame
|
||||
DestroyObject(oCorpseBlood);
|
||||
// ... and turn it into a scorch mark
|
||||
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE);
|
||||
//Set Local for deletion later if needed
|
||||
SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood);
|
||||
}
|
||||
|
||||
|
||||
void LeaveCorpse(object oNPC)
|
||||
{
|
||||
//SET YOUR LOOTABLE CORPSES PREFERENCES HERE ///////////////
|
||||
//
|
||||
int nUseLootable = FALSE; // Set this to FALSE if you want disable the lootable corpse functionality //
|
||||
int nMoveEquipped = TRUE; // Set this to FALSE if you don't want to move Equipped items to the corpse //
|
||||
int nCopyArmour = TRUE; // This will use the ResRef to create a copy of the armour/helmet //
|
||||
int nMoveArmour = FALSE; // Setting this TRUE will just move the armour/helmet (Naked NPCs) //
|
||||
int nDropWeapons = FALSE; // This will use the ResRef for dropping the weapons on the ground //
|
||||
int nMoveWeapons = TRUE; // Setting this TRUE will just move the weapons to the Lootable Object //
|
||||
int nUseBlood = TRUE; // Set this to TRUE if you want a Bloodspot to appear under the corpse and have //
|
||||
// "gibs" when a corpse is destroyed. Undead/constructs/elementals won't leave a //
|
||||
// Bloodspot or gib. //
|
||||
int nTinyBlood = TRUE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to //
|
||||
// leave a Bloodspot, scorch mark, or small flame. They will still "gib" //
|
||||
// normally. Only applies if nUseBlood = TRUE. //
|
||||
int nUseFlame = TRUE; // Set this to TRUE if you want a scorch mark or a small flame (which burns out //
|
||||
// after 10-120 seconds, and is replaced by a scorch mark) to appear if 1/3 or //
|
||||
// more of the damage which killed the creature was fire or electrical. Scorch //
|
||||
// mark or flame will appear instead of Bloodspot. If the total fire or //
|
||||
// electrical damage exceeds the creature's max HP, a small flame appears instead //
|
||||
// of a scorch mark. The corpse will still gib normally. Undead, constructs, //
|
||||
// and elementals will leave a scorch mark, small flame, or nothing. Only //
|
||||
// applies if nUseBlood = TRUE. //
|
||||
int nCorpseFade = 60; // Set this to 0 (ZERO) if you DO NOT want the corpses to fade //
|
||||
int nUseBonesBash = FALSE; // Set this to TRUE if you want bones to appear when the corpse is bashed. The //
|
||||
// bones cannot be bashed; they will only disappear if nBonesFade > 0. //
|
||||
int nUseBonesFade = FALSE; // Set this to TRUE if you want bones to appear when the corpse fades. The bones //
|
||||
// cannot be bashed; they will only disappear if nBonesFade > 0. //
|
||||
int nBonesFade = 60; // This is the delay in actual seconds that the bones will remain before they fade. //
|
||||
// If you set this to 0 (zero) it will turn off the bones fade - allowing all //
|
||||
// bones (and loot, if the bones contain any) to remain forever. //
|
||||
int nTinyBones = TRUE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to //
|
||||
// turn into bones when their corpse is bashed or fades. Only applies if //
|
||||
// nUseBonesBash and/or nUseBonesFade = TRUE. //
|
||||
int nKeepInventoryBash = TRUE; // Set this to TRUE if you want all items in a creature's inventory to remain when //
|
||||
// its corpse is bashed. If installed, DOA's "Bashed Loot Breakage" plugin //
|
||||
// ("doa_bashbreak") takes precedence over nKeepInventoryBash. //
|
||||
int nKeepInventoryFade = TRUE; // Set this to TRUE if you want all items in a creature's inventory to remain when //
|
||||
// its corpse fades. //
|
||||
int nKeepEmpties = FALSE; // Set this to FALSE if you want EMPTY corpses to fade immediately. //
|
||||
int nKeepWeaponsBonesFade = TRUE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
|
||||
// destroyed when bones fade. Only valid if nBonesFade > 0. //
|
||||
int nKeepWeaponsCorpseFade = TRUE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
|
||||
// destroyed when corpses fade. Only valid if nCorpseFade > 0. //
|
||||
int nKeepWeaponsBash = TRUE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be //
|
||||
// destroyed when corpses are bashed. //
|
||||
int nKeepWeaponsEmpty = TRUE; // Set this to TRUE if you want empty corpses to be destroyed even if dropped //
|
||||
// weapons are unclaimed. //
|
||||
int nOverrideForPlacedCorpses = TRUE;// Set this to TRUE if you want the 'Spawned Corpses' you //
|
||||
// place to be permament. Setting it to FALSE will cause //
|
||||
// your Placed Dead creatures to act as the settings above dictate. //
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//ALTER THE FOLLOWING AT YOUR OWN RISK :)
|
||||
object oHostBody = oNPC; //Get the Dead Creature Object
|
||||
string sBaseTag = GetTag(oHostBody); //Get that TAG of the dead creature
|
||||
string sPrefix = GetStringLeft(sBaseTag, 4); //Look for Dead Prefix
|
||||
|
||||
if(nUseLootable) //If False, do nothing
|
||||
{
|
||||
|
||||
//Do 'spawned corpse' settings if desired
|
||||
if (sPrefix == "Dead")
|
||||
{
|
||||
if (nOverrideForPlacedCorpses)
|
||||
{
|
||||
nKeepEmpties = TRUE; //Set 'Spawned Dead' corpses to Keep Empties
|
||||
nCorpseFade = 0; //Disable Corpse Fade for 'Spawned Dead' corpses
|
||||
}
|
||||
}
|
||||
|
||||
SetIsDestroyable(FALSE,TRUE,FALSE); //Protect our corpse from decaying
|
||||
|
||||
/*
|
||||
UNDER CONSTRUCTION :)
|
||||
|
||||
// Create lootable corpse object only if oHostBody has something to loot
|
||||
if (GetIsObjectValid(GetFirstItemInInventory(oHostBody)))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't create lootable corpse object(nothing to loot)
|
||||
if (nKeepEmpties == FALSE)
|
||||
{
|
||||
// Get rid of corpse immediately, since it's already empty
|
||||
nCorpseFade = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ensure oHostBody is destroyed/fades properly
|
||||
// Ensure blood spot is created and destroyed/fades properly
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//Set the spawnpoint for our lootable object and sink it
|
||||
float fSinkCorpseObj = 0.1f; //set depth to sink lootable object
|
||||
vector vHostBodyLoc = GetPosition(oHostBody); //get original vector so we can change it
|
||||
float fCorpseFacing = GetFacing(oHostBody); //get original facing
|
||||
vector vCorpseLoc = Vector(vHostBodyLoc.x, vHostBodyLoc.y, vHostBodyLoc.z - fSinkCorpseObj); //adjust z-axis to sink lootable object
|
||||
location lCorpseLoc = Location(GetArea(oHostBody), vCorpseLoc, fCorpseFacing); //create new location
|
||||
|
||||
object oLootCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, "invis_corpse_obj", lCorpseLoc, FALSE); //Spawn our lootable object
|
||||
SetLocalObject(oLootCorpse, "oHostBody", oHostBody); //Set Local for deletion later if needed
|
||||
|
||||
// Ensure oLootCorpse can't be destroyed until oHostBody is emptied (and weapons are dropped)
|
||||
SetPlotFlag(oLootCorpse, TRUE);
|
||||
|
||||
SetLocalInt(oLootCorpse, "nKeepEmpty", nKeepEmpties); //Set Local for deletion later if needed
|
||||
|
||||
SetLocalInt(oLootCorpse, "nUseBonesBash", nUseBonesBash); //Set Local for later use
|
||||
SetLocalInt(oLootCorpse, "nUseBonesFade", nUseBonesFade); //Set Local for later use
|
||||
SetLocalInt(oLootCorpse, "nBonesFade", nBonesFade); //Set Local for later use
|
||||
SetLocalInt(oLootCorpse, "nTinyBones", nTinyBones); //Set Local for later use
|
||||
|
||||
SetLocalInt(oLootCorpse, "nKeepInventoryBash", nKeepInventoryBash); //Set Local for later use
|
||||
SetLocalInt(oLootCorpse, "nKeepInventoryFade", nKeepInventoryFade); //Set Local for later use
|
||||
|
||||
// Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin
|
||||
SetLocalInt(oLootCorpse, "nRacialType", GetRacialType(oHostBody));
|
||||
SetLocalString(oLootCorpse, "sHostBodyResRef", GetResRef(oHostBody));
|
||||
|
||||
object oCorpseBlood;
|
||||
// If nUseBlood is TRUE and oHostBody isn't Undead/Construct/Elemental, set Local for later "gibbing" if bashed
|
||||
if ((nUseBlood) && (GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
|
||||
{
|
||||
SetLocalInt(oLootCorpse, "nUseBlood", TRUE);
|
||||
}
|
||||
// If nUseBlood = TRUE, continue Bloodspot routine
|
||||
if (nUseBlood)
|
||||
{
|
||||
location lBloodLoc = GetLocation(oHostBody); //get original location for placing blood spot
|
||||
if ((nTinyBlood == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY))
|
||||
{
|
||||
// Do nothing -- no bloodspot for tiny creatures if nTinyBlood is FALSE
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nUseFlame)
|
||||
{
|
||||
// If nUseFlame = TRUE, determine if scorch, flame, or bloodspot should appear
|
||||
int nFireDam = GetDamageDealtByType(DAMAGE_TYPE_FIRE);
|
||||
int nElecDam = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL);
|
||||
int nTotDam = GetTotalDamageDealt();
|
||||
int nMaxHP = GetMaxHitPoints();
|
||||
int nFlameout;
|
||||
|
||||
/*
|
||||
// Used for debugging
|
||||
SendMessageToPC(GetFirstPC(), "nFireDam: "+IntToString(nFireDam)+" nElecDam: "+IntToString(nElecDam)+" nTotDam: "+IntToString(nTotDam)+" nMaxHP: "+IntToString(nMaxHP)+" nTotDam/3: "+IntToString(nTotDam/3));
|
||||
*/
|
||||
|
||||
// If 1/3 or more of the damage is due to fire or electricity...
|
||||
// (only the final damage that actually killed the creature is
|
||||
// considered; tracking the cumulative damage taken would require
|
||||
// altering the default OnDamaged script for every creature,
|
||||
// which is not desirable)
|
||||
if ((nFireDam >= (nTotDam/3)) || (nElecDam >= (nTotDam/3)))
|
||||
{
|
||||
// If massive fire or electricity damage, spawn a small flame
|
||||
// which turns into a scorch mark after 10-120 seconds
|
||||
// ("massive" means >= max HP)
|
||||
if ((nFireDam >= nMaxHP) || (nElecDam >= nMaxHP))
|
||||
{
|
||||
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_flamesmall", lBloodLoc, FALSE);
|
||||
/*
|
||||
// Used for debugging
|
||||
nFlameout = 30;
|
||||
*/
|
||||
nFlameout = d12(10);
|
||||
DelayCommand(IntToFloat(nFlameout), Flameout(oCorpseBlood, oLootCorpse));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, spawn a scorch mark
|
||||
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not enough (or zero) fire/electrical damage, so just spawn bloodspot (or do nothing for Undead/Constructs/Elementals)
|
||||
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
|
||||
{
|
||||
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If nUseFlame = FALSE, just spawn the bloodspot (or do nothing for Undead/Constructs/Elementals)
|
||||
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL))
|
||||
{
|
||||
oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE);
|
||||
}
|
||||
}
|
||||
// oBloodSpot will either be a bloodstain, scorch mark, small flame, or OBJECT_INVALID (for Undead/Constructs/Elementals)
|
||||
SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood); //Set Local for deletion later if needed
|
||||
}
|
||||
}
|
||||
|
||||
// Get DEAD CREATURE'S INVENTORY - Move to oLootCorpse
|
||||
int nAmtGold = GetGold(oHostBody); //Get any gold from the dead creature
|
||||
if(nAmtGold)
|
||||
{
|
||||
AssignCommand(oLootCorpse, TakeGoldFromCreature(nAmtGold, oHostBody, FALSE));
|
||||
}
|
||||
|
||||
if (nMoveEquipped)
|
||||
{
|
||||
//Get any DROPPABLE loot the dead creature has equipped
|
||||
object oEquip1 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARMS, oHostBody));
|
||||
object oEquip2 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARROWS, oHostBody));
|
||||
object oEquip3 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BELT, oHostBody));
|
||||
object oEquip4 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOLTS, oHostBody));
|
||||
object oEquip5 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOOTS, oHostBody));
|
||||
object oEquip6 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BULLETS, oHostBody));
|
||||
object oEquip7 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CLOAK, oHostBody));
|
||||
// Version 3.2: Moved oEquip8 (helmets) to the armour section (see below)
|
||||
object oEquip9 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTRING, oHostBody));
|
||||
object oEquip10 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_NECK, oHostBody));
|
||||
object oEquip11 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oHostBody));
|
||||
|
||||
SetLocalObject(oLootCorpse, "oEquip1", oEquip1);
|
||||
SetLocalObject(oLootCorpse, "oEquip2", oEquip2);
|
||||
SetLocalObject(oLootCorpse, "oEquip3", oEquip3);
|
||||
SetLocalObject(oLootCorpse, "oEquip4", oEquip4);
|
||||
SetLocalObject(oLootCorpse, "oEquip5", oEquip5);
|
||||
SetLocalObject(oLootCorpse, "oEquip6", oEquip6);
|
||||
SetLocalObject(oLootCorpse, "oEquip7", oEquip7);
|
||||
// Version 3.2: Moved oEquip8 (helmets) to the armour section (see below)
|
||||
SetLocalObject(oLootCorpse, "oEquip9", oEquip9);
|
||||
SetLocalObject(oLootCorpse, "oEquip10", oEquip10);
|
||||
SetLocalObject(oLootCorpse, "oEquip11", oEquip11);
|
||||
}
|
||||
|
||||
// Handle Weapons/Shields/Torches equipped (held) in left/right hands
|
||||
// NOTE: nDropWeapons takes precedence over nMoveWeapons if both are TRUE
|
||||
/*
|
||||
If oHostBody has nothing in left/right hand, and has oLeftWpn/
|
||||
oRightWpn set (due to Scrotok's Raise Dead/Resurrection plugin),
|
||||
set oLeftWpn/oRightWpn (dropped weapon info) on oLootCorpse for
|
||||
later use
|
||||
*/
|
||||
if (nDropWeapons)
|
||||
{
|
||||
if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody) == OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsObjectValid(GetLocalObject(oHostBody, "oRightWpn")))
|
||||
{
|
||||
SetLocalObject(oLootCorpse, "oRightWpn", GetLocalObject(oHostBody, "oRightWpn"));
|
||||
}
|
||||
}
|
||||
if (GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody) == OBJECT_INVALID)
|
||||
{
|
||||
if (GetIsObjectValid(GetLocalObject(oHostBody, "oLeftWpn")))
|
||||
{
|
||||
SetLocalObject(oLootCorpse, "oLeftWpn", GetLocalObject(oHostBody, "oLeftWpn"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nMoveWeapons || nDropWeapons)
|
||||
{
|
||||
//Move equipped Weapons/Shields/Torches from oHostBody to oLootCorpse
|
||||
object oEquip12 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody));
|
||||
object oEquip13 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody));
|
||||
|
||||
// oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots
|
||||
SetLocalObject(oLootCorpse, "oEquip12", oEquip12);
|
||||
SetLocalObject(oLootCorpse, "oEquip13", oEquip13);
|
||||
}
|
||||
|
||||
if (nDropWeapons)
|
||||
{
|
||||
// oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots
|
||||
object oEquip12 = GetLocalObject(oLootCorpse, "oEquip12");
|
||||
object oEquip13 = GetLocalObject(oLootCorpse, "oEquip13");
|
||||
|
||||
// Drop the weapons/shields/torches
|
||||
/*
|
||||
The following commands destroy oEquip12 and oEquip13, and store
|
||||
the dropped weapons on oLootCorpse as "oLeftWpn" and "oRightWpn".
|
||||
Nothing gets stored in oLeftWpn/oRightWpn if oEquip12/13 ==
|
||||
OBJECT_INVALID.
|
||||
*/
|
||||
// Make sure DropLeftWeapon comes after DropRightWeapon in the lines
|
||||
// below, in order for the SetPlotFlag fix (version 3.3) to work
|
||||
AssignCommand(oLootCorpse, ActionDoCommand(DropRightWeapon(oEquip12, oLootCorpse)));
|
||||
AssignCommand(oLootCorpse, ActionDoCommand(DropLeftWeapon(oEquip13, oLootCorpse)));
|
||||
|
||||
SetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade); //Set Local to prevent deletion later if needed
|
||||
SetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade", nKeepWeaponsCorpseFade); //Set Local to prevent deletion later if needed
|
||||
SetLocalInt(oLootCorpse, "nKeepWeaponsBash", nKeepWeaponsBash); //Set Local to prevent deletion later if needed
|
||||
SetLocalInt(oLootCorpse, "nKeepWeaponsEmpty", nKeepWeaponsEmpty); //Set Local for later use
|
||||
}
|
||||
|
||||
// Handle Armour/Helmets
|
||||
// NOTE: nCopyArmour takes precedence over nMoveArmour if both are TRUE
|
||||
if(nCopyArmour)
|
||||
{
|
||||
nMoveArmour = FALSE;
|
||||
// Handle armour
|
||||
object oArmour = GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody);
|
||||
SetLocalObject(oLootCorpse, "oOrigArmour", oArmour);
|
||||
if (GetDroppableFlag(oArmour))
|
||||
{
|
||||
string sArmourRef = GetResRef(oArmour);
|
||||
object oLootArmour = CreateItemOnObject(sArmourRef, oLootCorpse);
|
||||
|
||||
SetPlotFlag(oLootArmour, GetPlotFlag(oArmour));
|
||||
SetIdentified(oLootArmour, GetIdentified(oArmour));
|
||||
|
||||
// Set Plot flag to FALSE for original armor so it can be
|
||||
// destroyed later if corpse is bashed
|
||||
SetPlotFlag(oArmour, FALSE);
|
||||
|
||||
SetLocalObject(oLootCorpse, "oLootArmour", oLootArmour);
|
||||
SetLocalObject(oLootCorpse, "oEquip14", oLootArmour);
|
||||
}
|
||||
|
||||
// Handle helmet
|
||||
object oHelmet = GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody);
|
||||
SetLocalObject(oLootCorpse, "oOrigHelmet", oHelmet);
|
||||
if (GetDroppableFlag(oHelmet))
|
||||
{
|
||||
string sHelmetRef = GetResRef(oHelmet);
|
||||
object oLootHelmet = CreateItemOnObject(sHelmetRef, oLootCorpse);
|
||||
|
||||
SetPlotFlag(oLootHelmet, GetPlotFlag(oHelmet));
|
||||
SetIdentified(oLootHelmet, GetIdentified(oHelmet));
|
||||
|
||||
// Set Plot flag to FALSE for original helmet so it can be
|
||||
// destroyed later if corpse is bashed
|
||||
SetPlotFlag(oHelmet, FALSE);
|
||||
|
||||
SetLocalObject(oLootCorpse, "oLootHelmet", oLootHelmet);
|
||||
SetLocalObject(oLootCorpse, "oEquip8", oLootHelmet);
|
||||
}
|
||||
}
|
||||
|
||||
if(nMoveArmour)
|
||||
{
|
||||
nCopyArmour = FALSE;
|
||||
// Handle armour
|
||||
object oEquip14 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody));
|
||||
SetLocalObject(oLootCorpse, "oEquip14", oEquip14);
|
||||
// Handle helmet
|
||||
object oEquip8 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody));
|
||||
SetLocalObject(oLootCorpse, "oEquip8", oEquip8);
|
||||
}
|
||||
|
||||
//Get the remaining loot from the dead creature and move it to oLootCorpse
|
||||
int nEquipCount = 14;
|
||||
object oLootEQ = GetFirstItemInInventory(oHostBody);
|
||||
while(GetIsObjectValid(oLootEQ))
|
||||
{
|
||||
nEquipCount++;
|
||||
// AssignCommand(oLootCorpse, ActionDoCommand(SendMessageToPC(GetFirstPC(), "oEquip"+IntToString(nEquipCount)+": "+GetTag(oLootEQ))));
|
||||
|
||||
object oEquipTemp = strip_equipped(oHostBody, oLootCorpse, oLootEQ);
|
||||
string sEquipCount = "oEquip" + IntToString(nEquipCount);
|
||||
SetLocalObject(oLootCorpse, sEquipCount, oEquipTemp);
|
||||
oLootEQ = GetNextItemInInventory(oHostBody);
|
||||
}
|
||||
|
||||
// We're done with oHostBody, so allow oLootCorpse to be destroyable
|
||||
if (!nDropWeapons)
|
||||
{
|
||||
AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE)));
|
||||
}
|
||||
|
||||
// Fade corpse out of existence after specified delay (unless set to 0)
|
||||
if (nCorpseFade > 0)
|
||||
{
|
||||
float fCorpseFade = IntToFloat(nCorpseFade);
|
||||
// ActionWait(fCorpseFade); // Removed for version 3.2
|
||||
DelayCommand(fCorpseFade, FadeCorpse(oCorpseBlood, oLootCorpse, oHostBody));
|
||||
}
|
||||
}
|
||||
}
|
||||
//void main(){}
|
38
_module/nss/_kb_plc_corpse.nss
Normal file
38
_module/nss/_kb_plc_corpse.nss
Normal file
@@ -0,0 +1,38 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_plc_corpse // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. //
|
||||
// Place this script in the OnSpawn event of any creature you want to spawn //
|
||||
// dead, then add "Dead" as the first 4 letters of its tag -- it will then //
|
||||
// be lootable! //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.2 Change Log:
|
||||
- changed EffectDamage to include DAMAGE_POWER_PLUS_FIVE to ensure creature spawns dead
|
||||
- renamed oDeadNPC to oHostBody for consistency
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
object oHostBody = OBJECT_SELF; //Get the Dead Creature Object
|
||||
string sBaseTag = GetTag(oHostBody); //Get that TAG of the dead creature
|
||||
string sPrefix = GetStringLeft(sBaseTag, 4); //Look for Dead Prefix
|
||||
if (sPrefix == "Dead") //Do Spawned Corpse
|
||||
{
|
||||
//Set up and Deliver our Death Blow
|
||||
/* this is only needed if you need this
|
||||
creature to SPAWN as a corpse. */
|
||||
//Set up for the kill
|
||||
effect eDamage = EffectDamage(9999, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
|
||||
//Deliver the killing effect
|
||||
ApplyEffectToObject (DURATION_TYPE_INSTANT, eDamage, oHostBody);
|
||||
}
|
||||
}
|
51
_module/nss/_kb_plugins.nss
Normal file
51
_module/nss/_kb_plugins.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_plugins // VERSION 3.3 //
|
||||
// // //
|
||||
// by Scrotok on 9 Feb 03 ////////////////////////////
|
||||
// Thanks to Keron Blackfeld for 99% of the work! //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it's already //
|
||||
// taken care of for you. //
|
||||
// //
|
||||
// This script works in conjunction with the "_kb_loot_corpse" script. //
|
||||
// //
|
||||
// When any script (OnDisturbed, OnSpellCastAt, etc.) for the lootable //
|
||||
// corpse placeable (tag "invis_corpse_obj") is executed, a call is made //
|
||||
// to "_kb_plugins" (once per module reset) to "register" installed plugins. //
|
||||
// //
|
||||
// End-users don't need to make any changes to this script. Plugin creators //
|
||||
// will need to contact Scrotok so that your plugin can be listed and the //
|
||||
// appropriate hooks created for distribution. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Version 3.3 Change Log:
|
||||
- fixed comments to clarify that "doa_bashbreak" script refers to DOA's "Bashed Loot Breakage" plugin
|
||||
- fixed comments to clarify that "doa_lootnotify" script refers to DOA's "Party Loot Notification" plugin
|
||||
- fixed comments to clarify that "_kb_raise_res" script refers to Scrotok's "Raise Dead/Resurrection" plugin
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
// Used for debugging
|
||||
int bModDebug = GetLocalInt(GetModule(),"bModDebug");
|
||||
if (bModDebug)
|
||||
SendMessageToPC(GetFirstPC(),"[kb_lootcorpse] Looking for plugins...");
|
||||
|
||||
// Register installed plugins (available plugins listed below)
|
||||
// ("registration" means setting a module-level variable to 1 for that
|
||||
// plugin, so that plugin behavior can function)
|
||||
|
||||
// IMPORTANT: You must keep OBJECT_INVALID in the lines below!
|
||||
ExecuteScript("doa_lootnotify", OBJECT_INVALID); // DOA's "Party Loot Notification" plugin
|
||||
ExecuteScript("_kb_raise_res", OBJECT_INVALID); // Scrotok's "Raise Dead/Resurrection" plugin
|
||||
ExecuteScript("doa_bashbreak", OBJECT_INVALID); // DOA's "Bashed Loot Breakage" plugin
|
||||
|
||||
// Run this script only once
|
||||
SetLocalInt(GetModule(),"kb_lootcorpse_plugins",1);
|
||||
}
|
||||
|
312
_module/nss/_kb_raise_res.nss
Normal file
312
_module/nss/_kb_raise_res.nss
Normal file
@@ -0,0 +1,312 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// // //
|
||||
// _kb_raise_res // VERSION 1.0 //
|
||||
// // //
|
||||
// Scrotok's Raise Dead/Resurrection Plugin ////////////////////////////
|
||||
// by Scrotok on 18 Dec 02 //
|
||||
// Thanks to Lord Niah and Bored Bistander for help on the Raise/Res idea //
|
||||
// email Questions and Comments to: jnbplatte@intellisys.net //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// This is an optional plugin for Scrotok's Lootable Corpses. It requires //
|
||||
// modified versions of "nw_s0_raisdead" and "nw_s0_resserec" (included in //
|
||||
// the ERF for this plugin). This script enables lootable corpses to be //
|
||||
// brought back to life with either the Resurrection or Raise Dead spells. //
|
||||
// This script can be called by lootable corpse placeables or bones. //
|
||||
// //
|
||||
// NEWBIES: You don't need to place this script anywhere -- it gets called //
|
||||
// (using the ExecuteScript function) by another script ("_kb_plugins").
|
||||
// //
|
||||
// KNOWN BUG: If Raise Dead or Resurrection is cast, but the spell //
|
||||
// won't work (based on racial type, or the fact that Raise Dead won't work //
|
||||
// on bones), the spell or scroll is still wasted in the attempt. //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Used for debugging to determine where the oEquip items are (or if the **
|
||||
** items are invalid objects). **
|
||||
*******************************************************************************/
|
||||
void DetermineEquipOwner(object oLootCorpse)
|
||||
{
|
||||
int x;
|
||||
string sEquip;
|
||||
for (x = 1; x < 15; x++)
|
||||
{
|
||||
sEquip = "oEquip"+IntToString(x);
|
||||
// oEquip12 & 13 == OBJECT_INVALID if nDropWeapons is TRUE
|
||||
// oEquip8 & 14 are destroyed (OBJECT_INVALID) during inventory move to oHostBody (if nCopyArmour is TRUE)
|
||||
if (GetIsObjectValid(GetLocalObject(oLootCorpse, sEquip)))
|
||||
{
|
||||
SendMessageToPC(GetFirstPC(), sEquip+" is possessed by "+GetTag(GetItemPossessor(GetLocalObject(oLootCorpse, sEquip))));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToPC(GetFirstPC(), sEquip+" is an invalid object.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** Used for debugging to ensure returned items get re-equipped by oHostBody. **
|
||||
** You can also verify some items are equipped in-game by right-clicking on **
|
||||
** the creature and selecting Examine; for example, you'll see "Increased **
|
||||
** Strength" if the creature is wearing Gauntlets of Ogre Power. **
|
||||
*******************************************************************************/
|
||||
void VerifyEquipped(object oHostBody)
|
||||
{
|
||||
object oItem; int x;
|
||||
for (x = 0; x < 14; x++)
|
||||
{
|
||||
oItem = GetItemInSlot(x, oHostBody);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
SendMessageToPC(GetFirstPC(), GetName(oItem)+" is equipped");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** This script removes ALL gold and inventory items (even non-Droppable and **
|
||||
** Plot) from a newly-created oHostBody (as part of Resurrection spell). **
|
||||
** Creature Slot items are not affected. **
|
||||
*******************************************************************************/
|
||||
void RemoveInventory(object oHostBody)
|
||||
{
|
||||
// Delete gold
|
||||
TakeGoldFromCreature(GetGold(oHostBody), oHostBody, TRUE);
|
||||
// Destroy equipped items
|
||||
// 0=head, 1=chest, 2=boot, 3=arms, 4=rhand, 5=lhand, 6=cloak,
|
||||
// 7=lring, 8=rring, 9=neck, 10=belt, 11=arrow, 12=bullet, 13=bolt
|
||||
object oItem; int x;
|
||||
for (x = 0; x < 14; x++)
|
||||
{
|
||||
oItem = GetItemInSlot(x, oHostBody);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (GetPlotFlag(oItem)) SetPlotFlag(oItem, FALSE);
|
||||
DestroyObject(oItem);
|
||||
}
|
||||
}
|
||||
// Delete items (including non-Droppable and Plot items)
|
||||
oItem = GetFirstItemInInventory(oHostBody);
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (GetPlotFlag(oItem)) SetPlotFlag(oItem, FALSE);
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory(oHostBody);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** Re-equip previously-equipped items on oHostBody if items were passed back **
|
||||
** to oHostBody from oLootCorpse (assumes the items weren't looted from **
|
||||
** oLootCorpse). This script only applies to oLootCorpse; bones don't have **
|
||||
** local "oEquip" objects, so if bones are resurrected, the items don't get **
|
||||
** re-equipped (NPCs with "naked" models will appear naked, which is as it **
|
||||
** should be, since their corpse was too damaged to wear equipment anyway). **
|
||||
*******************************************************************************/
|
||||
void ReEquip(object oHostBody, object oLootCorpse)
|
||||
{
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip1")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip1"), INVENTORY_SLOT_ARMS));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip2")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip2"), INVENTORY_SLOT_ARROWS));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip3")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip3"), INVENTORY_SLOT_BELT));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip4")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip4"), INVENTORY_SLOT_BOLTS));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip5")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip5"), INVENTORY_SLOT_BOOTS));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip6")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip6"), INVENTORY_SLOT_BULLETS));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip7")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip7"), INVENTORY_SLOT_CLOAK));
|
||||
/*
|
||||
Helmet (oEquip8) gets handled by "oOrigHelmet" code in ReturnInventory
|
||||
(if nCopyArmour is TRUE), or gets re-equipped (if nMoveArmour is TRUE and
|
||||
nCopyArmour is FALSE)
|
||||
*/
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip8")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip8"), INVENTORY_SLOT_HEAD));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip9")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip9"), INVENTORY_SLOT_LEFTRING));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip10")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip10"), INVENTORY_SLOT_NECK));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip11")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip11"), INVENTORY_SLOT_RIGHTRING));
|
||||
/*
|
||||
Weapons (oEquip12 & 13) stay dropped on the ground (if nDropWeapons is
|
||||
TRUE, oEquip12 & 13 == OBJECT_INVALID), or get re-equipped (if
|
||||
nMoveWeapons is TRUE and nDropWeapons is FALSE)
|
||||
*/
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip12")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip12"), INVENTORY_SLOT_RIGHTHAND));
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip13")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip13"), INVENTORY_SLOT_LEFTHAND));
|
||||
/*
|
||||
Armour (oEquip14) gets handled by "oOrigArmour" code in ReturnInventory
|
||||
(if nCopyArmour is TRUE), or gets re-equipped (if nMoveArmour is TRUE and
|
||||
nCopyArmour is FALSE)
|
||||
*/
|
||||
if (GetItemPossessor(GetLocalObject(oLootCorpse, "oEquip14")) == oHostBody)
|
||||
AssignCommand(oHostBody, ActionEquipItem(GetLocalObject(oLootCorpse, "oEquip14"), INVENTORY_SLOT_CHEST));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** This script returns gold and inventory items from oLootCorpse (or bones) **
|
||||
** to oHostBody. Dropped, unclaimed weapons remain where they fell. **
|
||||
** **
|
||||
** NOTE: Even though one of the parameters is "oLootCorpse = OBJECT_SELF", **
|
||||
** this script can also be called by bones! **
|
||||
*******************************************************************************/
|
||||
void ReturnInventory(object oHostBody, object oLootCorpse = OBJECT_SELF)
|
||||
{
|
||||
// Remember dropped weapon info
|
||||
/*
|
||||
Store oLeftWpn/oRightWpn on oHostBody, so that if the oHostBody is killed
|
||||
again, dropped weapons info will be saved (see "_kb_loot_corpse").
|
||||
*/
|
||||
SetLocalObject(oHostBody, "oLeftWpn", GetLocalObject(OBJECT_SELF, "oLeftWpn"));
|
||||
SetLocalObject(oHostBody, "oRightWpn", GetLocalObject(OBJECT_SELF, "oRightWpn"));
|
||||
|
||||
// Move gold to oHostBody
|
||||
// (This was commented out because gold is moved as an inventory item below)
|
||||
// (if you don't comment out this line, the creature's gold will double)
|
||||
// AssignCommand(oLootCorpse, GiveGoldToCreature(oHostBody, GetGold(oLootCorpse)));
|
||||
|
||||
// Move inventory items to oHostBody
|
||||
object oEquip = GetFirstItemInInventory(oLootCorpse);
|
||||
while (GetIsObjectValid(oEquip))
|
||||
{
|
||||
// If oHostBody is still wearing oOrigArmor, and no one has removed
|
||||
// oLootArmor from oLootCorpse, destroy oLootArmor/oEquip14 (no need to
|
||||
// transfer it back to oHostBody, since oOrigArmor is still there)
|
||||
// NOTE: This never applies to bones, since if bones exist, oHostBody
|
||||
// and oOrigArmour were already destroyed, and oLootArmour was already
|
||||
// transferred to the bones (oLootArmour/oOrigArmour == OBJECT_INVALID)
|
||||
if ((oEquip == GetLocalObject(OBJECT_SELF, "oLootArmour")) &&
|
||||
(GetIsObjectValid(GetLocalObject(OBJECT_SELF, "oOrigArmour"))))
|
||||
DestroyObject(oEquip); // destroys oLootArmour/oEquip14
|
||||
// Make a similar check for oLootHelmet/oEquip8 and oOrigHelmet
|
||||
// (doesn't apply to bones either)
|
||||
else if ((oEquip == GetLocalObject(OBJECT_SELF, "oLootHelmet")) &&
|
||||
(GetIsObjectValid(GetLocalObject(OBJECT_SELF, "oOrigHelmet"))))
|
||||
DestroyObject(oEquip); // destroys oLootHelmet/oEquip8
|
||||
else
|
||||
{
|
||||
// This following line doesn't work
|
||||
// (maybe because combat leads to ClearAllActions on oHostBody?)
|
||||
// AssignCommand(oHostBody, ActionTakeItem(oEquip, oLootCorpse));
|
||||
AssignCommand(oLootCorpse, ActionGiveItem(oEquip, oHostBody));
|
||||
}
|
||||
oEquip = GetNextItemInInventory(oLootCorpse);
|
||||
}
|
||||
|
||||
/*
|
||||
// Used for debugging
|
||||
SendMessageToPC(GetFirstPC(), "MOVING INVENTORY...");
|
||||
DetermineEquipOwner(oLootCorpse);
|
||||
DelayCommand(0.5, SendMessageToPC(GetFirstPC(), "MOVE COMPLETE (hopefully)..."));
|
||||
DelayCommand(0.5, DetermineEquipOwner(oLootCorpse));
|
||||
*/
|
||||
|
||||
// Delay time might need to be increased for slower PC's or large inventories
|
||||
DelayCommand(0.5, ReEquip(oHostBody, oLootCorpse));
|
||||
|
||||
// Used for debugging
|
||||
// DelayCommand(0.7, VerifyEquipped(oHostBody));
|
||||
|
||||
DelayCommand(1.0, DestroyObject(OBJECT_SELF));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
/* register with other scripts */
|
||||
int bModDebug = GetLocalInt(GetModule(),"bModDebug");
|
||||
if (!GetLocalInt(GetModule(),"kb_raise_res"))
|
||||
{
|
||||
if (bModDebug) SendMessageToPC(GetFirstPC(),"Registering _kb_raise_res ...");
|
||||
SetLocalInt(GetModule(),"kb_raise_res",1);
|
||||
}
|
||||
/* exit if null object calling - probably registration */
|
||||
if (OBJECT_SELF == OBJECT_INVALID) return;
|
||||
|
||||
/* run plugin code */
|
||||
int nSpellCast = GetLastSpell();
|
||||
|
||||
//Get all of our required information
|
||||
object oHostBody = GetLocalObject(OBJECT_SELF, "oHostBody"); // returns OBJECT_INVALID if script called by bones
|
||||
string sHostBodyResRef = GetLocalString(OBJECT_SELF, "sHostBodyResRef");
|
||||
object oCorpseBlood = GetLocalObject(OBJECT_SELF, "oBloodSpot"); // returns OBJECT_INVALID if script called by bones
|
||||
|
||||
// Spell failure effect (for later use)
|
||||
effect eSpellFail = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
|
||||
|
||||
// Raise Dead and Resurrection won't work on Outsiders, Elementals,
|
||||
// Constructs, Undead, or RACIAL_TYPE_INVALID
|
||||
int nRacialType = GetLocalInt(OBJECT_SELF, "nRacialType");
|
||||
if ((nRacialType == RACIAL_TYPE_OUTSIDER) ||
|
||||
(nRacialType == RACIAL_TYPE_ELEMENTAL) ||
|
||||
(nRacialType == RACIAL_TYPE_CONSTRUCT) ||
|
||||
(nRacialType == RACIAL_TYPE_UNDEAD) ||
|
||||
(nRacialType == RACIAL_TYPE_INVALID))
|
||||
{
|
||||
// Spell failure effect
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSpellFail, OBJECT_SELF);
|
||||
// Spell failure message
|
||||
if (nSpellCast == SPELL_RAISE_DEAD)
|
||||
{
|
||||
SendMessageToPC(GetLastSpellCaster(), "This type of creature cannot be raised from the dead.");
|
||||
}
|
||||
if (nSpellCast == SPELL_RESURRECTION)
|
||||
{
|
||||
SendMessageToPC(GetLastSpellCaster(), "This type of creature cannot be resurrected.");
|
||||
}
|
||||
// KNOWN BUG: Spell or scroll is wasted in the attempt
|
||||
return;
|
||||
}
|
||||
|
||||
if (nSpellCast == SPELL_RAISE_DEAD)
|
||||
{
|
||||
// Raise Dead won't work on bones
|
||||
if (GetTag(OBJECT_SELF) == "loot_bones_obj")
|
||||
{
|
||||
// Spell failure effect
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSpellFail, OBJECT_SELF);
|
||||
// Spell failure message
|
||||
SendMessageToPC(GetLastSpellCaster(), "This corpse is too badly damaged to be raised from the dead.");
|
||||
// KNOWN BUG: Spell or scroll is wasted in the attempt
|
||||
return;
|
||||
}
|
||||
ActionCastSpellAtObject(nSpellCast, oHostBody, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
|
||||
if (GetIsObjectValid(oCorpseBlood)) DestroyObject(oCorpseBlood);
|
||||
ReturnInventory(oHostBody);
|
||||
}
|
||||
else if (nSpellCast == SPELL_RESURRECTION)
|
||||
{
|
||||
// Works on lootable corpse placeable or bones
|
||||
if (!GetIsObjectValid(oHostBody))
|
||||
{
|
||||
// Resurrect oBones ("transforms" oBones into oHostBody by
|
||||
// re-creating the creature using sHostBodyResRef)
|
||||
oHostBody = CreateObject(OBJECT_TYPE_CREATURE, sHostBodyResRef, GetLocation(OBJECT_SELF), FALSE);
|
||||
// delete all default gold/items from oHostBody
|
||||
RemoveInventory(oHostBody);
|
||||
// Resurrection visual and sound effect
|
||||
effect eResVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eResVis, GetLocation(oHostBody));
|
||||
PlaySound("sim_healdead");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Resurrect oHostBody (lootable corpse placeable is OBJECT_SELF)
|
||||
ActionCastSpellAtObject(nSpellCast, oHostBody, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
|
||||
if (GetIsObjectValid(oCorpseBlood)) DestroyObject(oCorpseBlood);
|
||||
}
|
||||
ReturnInventory(oHostBody);
|
||||
}
|
||||
else return;
|
||||
}
|
9
_module/nss/abandonedtemplep.nss
Normal file
9
_module/nss/abandonedtemplep.nss
Normal file
@@ -0,0 +1,9 @@
|
||||
void main ()
|
||||
{
|
||||
object oPC= GetLastUsedBy();
|
||||
object oTarget=GetWaypointByTag("WP_Darkwoods2Port");
|
||||
effect eTeleport= EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport, GetObjectByTag ("Portal"));
|
||||
AssignCommand(oPC, JumpToObject(oTarget));
|
||||
}
|
||||
|
14
_module/nss/acid_cloud1.nss
Normal file
14
_module/nss/acid_cloud1.nss
Normal file
@@ -0,0 +1,14 @@
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetEnteringObject();
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
|
||||
if ( !GetIsEnemy(oTarget,oCaster) || oTarget == oCaster )
|
||||
return;
|
||||
|
||||
effect eAcid = EffectDamage(d6(6),DAMAGE_TYPE_ACID);
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcid,oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
}
|
21
_module/nss/acid_cloud2.nss
Normal file
21
_module/nss/acid_cloud2.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
void main()
|
||||
{
|
||||
effect eAcid;
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
|
||||
|
||||
object oCaster = GetAreaOfEffectCreator();
|
||||
|
||||
object oTarget = GetFirstInPersistentObject();
|
||||
|
||||
while ( GetIsObjectValid(oTarget ) )
|
||||
{
|
||||
if ( GetIsEnemy(oTarget,oCaster) )
|
||||
{
|
||||
eAcid = EffectDamage(d6(6),DAMAGE_TYPE_ACID);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eAcid,oTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
|
||||
}
|
||||
oTarget = GetNextInPersistentObject();
|
||||
}
|
||||
}
|
8
_module/nss/acid_cloud_aura.nss
Normal file
8
_module/nss/acid_cloud_aura.nss
Normal file
@@ -0,0 +1,8 @@
|
||||
void main()
|
||||
{
|
||||
effect eAOE = EffectAreaOfEffect(AOE_PER_FOGACID,"acid_cloud1","acid_cloud2","null");
|
||||
eAOE = SupernaturalEffect(eAOE);
|
||||
eAOE = ExtraordinaryEffect(eAOE);
|
||||
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eAOE,OBJECT_SELF,HoursToSeconds(100));
|
||||
}
|
232
_module/nss/advanced_ai.nss
Normal file
232
_module/nss/advanced_ai.nss
Normal file
@@ -0,0 +1,232 @@
|
||||
#include "x0_i0_talent"
|
||||
//#include "x0_inc_generic"
|
||||
#include "x2_inc_switches"
|
||||
#include "inc_AI"
|
||||
|
||||
void DoPhysical( object oTarget )
|
||||
{
|
||||
if ( !GetIsObjectValid(oTarget) || !GetIsEnemy(oTarget) )
|
||||
{
|
||||
oTarget = GetNearestEnemy();
|
||||
if ( !GetIsObjectValid(oTarget) )
|
||||
return;
|
||||
}
|
||||
object oEquip = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND);
|
||||
if ( GetDistanceToObject(oTarget) > FeetToMeters(20.0) )
|
||||
{
|
||||
if ( !GetIsObjectValid( oEquip ) || !GetWeaponRanged( oEquip ) )
|
||||
ActionEquipMostDamagingRanged();
|
||||
ActionAttack(oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !GetIsObjectValid( oEquip ) || GetWeaponRanged( oEquip ) )
|
||||
ActionEquipMostDamagingMelee();
|
||||
TalentMeleeAttack(oTarget);
|
||||
}
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// The following two lines should not be touched
|
||||
object oIntruder = GetCreatureOverrideAIScriptTarget();
|
||||
ClearCreatureOverrideAIScriptTarget();
|
||||
if ( !GetCanAct(OBJECT_SELF) )
|
||||
{
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
int bAura = GetLocalInt(OBJECT_SELF,"aura");
|
||||
if ( !bAura )
|
||||
{
|
||||
// ActionCastFakeSpellAtLocation(SPELL_SUMMON_SHADOW,GetLocation(OBJECT_SELF));
|
||||
|
||||
|
||||
string sScript = GetLocalString(OBJECT_SELF,"Aura_Script");
|
||||
// SpeakString("Running script " + sScript,TALKVOLUME_SHOUT);
|
||||
|
||||
// ClearAllActions();
|
||||
if ( sScript != "" )
|
||||
ExecuteScript(sScript,OBJECT_SELF);
|
||||
|
||||
// SetCreatureOverrideAIScriptFinished();
|
||||
SetLocalInt(OBJECT_SELF,"aura",1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* if ( d6() == 1 ) // in case they get busy-stuck, also to add randomness
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"busy",FALSE);
|
||||
return;
|
||||
} */
|
||||
// Don't inturupt actions in progress
|
||||
|
||||
|
||||
if ( GetCurrentAction() == ACTION_CASTSPELL )
|
||||
{
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( GetLocalInt(OBJECT_SELF,"physical") )
|
||||
{
|
||||
ClearAllActions();
|
||||
DoPhysical(oIntruder);
|
||||
return;
|
||||
}
|
||||
// Haste = Super awesome;
|
||||
if ( !GetHasEffect(EFFECT_TYPE_HASTE ) && ( GetHasSpell(SPELL_HASTE) ||
|
||||
GetHasSpell(SPELL_MASS_HASTE) ) )
|
||||
{
|
||||
// SpeakString("Time for haste!!!");
|
||||
|
||||
if ( GetHasSpell(SPELL_MASS_HASTE) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_MASS_HASTE,OBJECT_SELF);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( GetHasSpell(SPELL_HASTE) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_HASTE,OBJECT_SELF);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
SpeakString("WTF HASTE ERROR!!!");
|
||||
}
|
||||
|
||||
// Get those summons in there!
|
||||
if ( GetHasSpell(SPELL_ELEMENTAL_SWARM) )
|
||||
{
|
||||
ClearAllActions();
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
PlayVoiceChat(VOICE_CHAT_HELP);
|
||||
ActionCastSpellAtObject(SPELL_ELEMENTAL_SWARM,OBJECT_SELF);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( TalentSummonAllies() )
|
||||
{
|
||||
// SpeakString("Come to my side! Battle awaits!");
|
||||
PlayVoiceChat(VOICE_CHAT_HELP);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Hostile targeting actions
|
||||
if ( !GetIsObjectValid(oIntruder) || !GetIsReactionTypeHostile(oIntruder) )
|
||||
{
|
||||
oIntruder = GetNearestPerceivedEnemy();
|
||||
if ( !GetIsObjectValid(oIntruder) )
|
||||
return;
|
||||
}
|
||||
|
||||
// Dispel Casters
|
||||
if ( !GetLocalInt(OBJECT_SELF,"Dispel_once") &&
|
||||
( GetLevelByClass(CLASS_TYPE_SORCERER, oIntruder) >= 10 ||
|
||||
GetLevelByClass(CLASS_TYPE_WIZARD, oIntruder) >= 10 ||
|
||||
GetLevelByClass(CLASS_TYPE_CLERIC, oIntruder) >= 10 ||
|
||||
GetLevelByClass(CLASS_TYPE_SORCERER, oIntruder) >= 10 ||
|
||||
GetLevelByClass(CLASS_TYPE_DRUID, oIntruder) >= 10 ) )
|
||||
{
|
||||
if ( GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION) ||
|
||||
GetHasSpell(SPELL_GREATER_DISPELLING) ||
|
||||
GetHasSpell(SPELL_DISPEL_MAGIC) ||
|
||||
GetHasSpell(SPELL_GREATER_SPELL_BREACH) ||
|
||||
GetHasSpell(SPELL_LESSER_SPELL_BREACH) )
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"Dispel_once",1);
|
||||
// SpeakString("I will dispel you!!");
|
||||
if ( GetHasSpell(SPELL_GREATER_SPELL_BREACH) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_GREATER_SPELL_BREACH,oIntruder);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( GetHasSpell(SPELL_LESSER_SPELL_BREACH) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_LESSER_SPELL_BREACH,oIntruder);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_MORDENKAINENS_DISJUNCTION,oIntruder);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( GetHasSpell(SPELL_GREATER_DISPELLING) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_GREATER_DISPELLING,oIntruder);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
if ( GetHasSpell(SPELL_DISPEL_MAGIC) )
|
||||
{
|
||||
ClearActions(1001);
|
||||
// SetLocalInt(OBJECT_SELF,"busy",TRUE);
|
||||
ActionCastSpellAtObject(SPELL_DISPEL_MAGIC,oIntruder);
|
||||
// ActionDoCommand(SetLocalInt(OBJECT_SELF,"busy",FALSE));
|
||||
SetCreatureOverrideAIScriptFinished();
|
||||
return;
|
||||
}
|
||||
SpeakString("WTF! Dispel Error!");
|
||||
}
|
||||
}
|
||||
|
||||
// Melee up sometimes!
|
||||
|
||||
|
||||
if ( d10() == 10 )
|
||||
{
|
||||
switch ( d4() )
|
||||
{
|
||||
case 1:
|
||||
PlayVoiceChat(VOICE_CHAT_BATTLECRY1);
|
||||
break;
|
||||
case 2:
|
||||
PlayVoiceChat(VOICE_CHAT_ATTACK);
|
||||
break;
|
||||
case 3:
|
||||
PlayVoiceChat(VOICE_CHAT_BATTLECRY2);
|
||||
break;
|
||||
case 4:
|
||||
PlayVoiceChat(VOICE_CHAT_BATTLECRY3);
|
||||
break;
|
||||
}
|
||||
|
||||
SetLocalInt(OBJECT_SELF,"physical",1);
|
||||
DelayCommand(24.0,SetLocalInt(OBJECT_SELF,"physical",0));
|
||||
ClearAllActions();
|
||||
DoPhysical(oIntruder);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
6
_module/nss/akforesthomedown.nss
Normal file
6
_module/nss/akforesthomedown.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main() {
|
||||
location lLoc = GetLocation(GetWaypointByTag( "WP_AKHome02F1"));
|
||||
object player = GetPCSpeaker();
|
||||
AssignCommand(player, JumpToLocation(lLoc));
|
||||
}
|
||||
|
6
_module/nss/akforesthomeup.nss
Normal file
6
_module/nss/akforesthomeup.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main() {
|
||||
location lLoc = GetLocation(GetWaypointByTag( "WP_AKHome02F2"));
|
||||
object player = GetPCSpeaker();
|
||||
AssignCommand(player, JumpToLocation(lLoc));
|
||||
}
|
||||
|
49
_module/nss/akpaowiferandom.nss
Normal file
49
_module/nss/akpaowiferandom.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
void akpaostorerandom()
|
||||
{
|
||||
location lstore = GetLocation(GetWaypointByTag("akpaostoreWP"));
|
||||
switch ( d6(1) ) {
|
||||
case 1:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore1", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore1", lstore, FALSE, "akpaostore1");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore1");
|
||||
break;
|
||||
case 2:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore2", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore2", lstore, FALSE, "akpaostore2");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore2");
|
||||
break;
|
||||
case 3:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore3", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore3", lstore, FALSE, "akpaostore3");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore3");
|
||||
break;
|
||||
case 4:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore4", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore4", lstore, FALSE, "akpaostore4");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore4");
|
||||
break;
|
||||
case 5:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore5", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore5", lstore, FALSE, "akpaostore5");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore5");
|
||||
break;
|
||||
case 6:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore6", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore6", lstore, FALSE, "akpaostore6");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore6");
|
||||
break;
|
||||
default:
|
||||
DestroyObject(GetNearestObjectByTag("akpaostore1", oSelf));
|
||||
CreateObject(OBJECT_TYPE_STORE, "akpaostore1", lstore, FALSE, "akpaostore1");
|
||||
SetLocalString(OBJECT_SELF, "store", "akpaostore1");
|
||||
break;
|
||||
}
|
||||
DelayCommand(3600.0, akpaostorerandom());
|
||||
}
|
||||
|
||||
void main ()
|
||||
{
|
||||
akpaostorerandom();
|
||||
}
|
6
_module/nss/akrogueguilddown.nss
Normal file
6
_module/nss/akrogueguilddown.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main() {
|
||||
location lLoc = GetLocation(GetWaypointByTag( "WP_AKLodge2"));
|
||||
object player = GetPCSpeaker();
|
||||
AssignCommand(player, JumpToLocation(lLoc));
|
||||
}
|
||||
|
6
_module/nss/akrogueguildup.nss
Normal file
6
_module/nss/akrogueguildup.nss
Normal file
@@ -0,0 +1,6 @@
|
||||
void main() {
|
||||
location lLoc = GetLocation(GetWaypointByTag( "WP_AKLodge1"));
|
||||
object player = GetPCSpeaker();
|
||||
AssignCommand(player, JumpToLocation(lLoc));
|
||||
}
|
||||
|
31
_module/nss/akwagontofb.nss
Normal file
31
_module/nss/akwagontofb.nss
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Script generated by
|
||||
Lilac Soul's NWN Script Generator, v. 2.2
|
||||
|
||||
For download info, please visit:
|
||||
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
|
||||
|
||||
//Put this on action taken in the conversation editor
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
object oTarget;
|
||||
location lTarget;
|
||||
oTarget = GetWaypointByTag("FellbrookWagon");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
//only do the jump if the location is valid.
|
||||
//though not flawless, we just check if it is in a valid area.
|
||||
//the script will stop if the location isn't valid - meaning that
|
||||
//nothing put after the teleport will fire either.
|
||||
//the current location won't be stored, either
|
||||
|
||||
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
||||
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
|
||||
AssignCommand(oPC, ActionJumpToLocation(lTarget));
|
||||
|
||||
}
|
23
_module/nss/akwgnwife_onconv.nss
Normal file
23
_module/nss/akwgnwife_onconv.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Name x2_def_onconv
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Default On Conversation script
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Keith Warner
|
||||
//:: Created On: June 11/03
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("nw_c2_default4", OBJECT_SELF);
|
||||
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
|
||||
|
||||
if (DoOnce==TRUE) return;
|
||||
|
||||
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
|
||||
ExecuteScript("akpaowiferandom", OBJECT_SELF);
|
||||
|
||||
}
|
69
_module/nss/almakinantreelif.nss
Normal file
69
_module/nss/almakinantreelif.nss
Normal file
@@ -0,0 +1,69 @@
|
||||
/* This script has been edited by Luni@luukku.com */
|
||||
/* Transport PC and charge 25 xp if PC is at lvl 10 or higher */
|
||||
|
||||
//Function which removes the requested amount of xp from party
|
||||
void RemoveXPFromParty(int nXP, object oPC, int bAllParty=TRUE)
|
||||
{
|
||||
|
||||
if (!bAllParty)
|
||||
{
|
||||
nXP=(GetXP(oPC)-nXP)>=0 ? GetXP(oPC)-nXP : 0;
|
||||
SetXP(oPC, nXP);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oMember=GetFirstFactionMember(oPC, TRUE);
|
||||
|
||||
while (GetIsObjectValid(oMember))
|
||||
{
|
||||
nXP=(GetXP(oMember)-nXP)>=0 ? GetXP(oMember)-nXP : 0;
|
||||
SetXP(oMember, nXP);
|
||||
oMember=GetNextFactionMember(oPC, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Main function
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
object oTarget;
|
||||
location lTarget;
|
||||
oTarget = GetWaypointByTag("WP_ToLAlmaKinan");
|
||||
|
||||
lTarget = GetLocation(oTarget);
|
||||
|
||||
// If PC is at lvl 10 or higher, take 25 xp
|
||||
|
||||
if ((GetHitDice(oPC) >= 10)){
|
||||
|
||||
RemoveXPFromParty(25, oPC, FALSE);
|
||||
|
||||
}
|
||||
//only do the jump if the location is valid.
|
||||
//though not flawless, we just check if it is in a valid area.
|
||||
//the script will stop if the location isn't valid - meaning that
|
||||
//nothing put after the teleport will fire either.
|
||||
//the current location won't be stored, either
|
||||
|
||||
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
||||
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
|
||||
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
|
||||
|
||||
oTarget = oPC;
|
||||
|
||||
//Visual effects can't be applied to waypoints, so if it is a WP
|
||||
//apply to the WP's location instead
|
||||
|
||||
int nInt;
|
||||
nInt = GetObjectType(oTarget);
|
||||
|
||||
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
|
||||
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
|
||||
|
||||
}
|
||||
|
21
_module/nss/alt_givewidget.nss
Normal file
21
_module/nss/alt_givewidget.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
//Created by Esreyr Fears
|
||||
//on March 27th, 2006
|
||||
|
||||
void main() {
|
||||
//Get the PC (whether they are entering the module and acquiring the widget, or getting it by some other means.s
|
||||
object oPC = OBJECT_SELF;
|
||||
if ( !GetIsPC(oPC) ) oPC = GetEnteringObject();
|
||||
|
||||
//Give a Widget to any PC with a minimum druid level of 8.
|
||||
int nDruidLevel = GetLevelByClass(CLASS_TYPE_DRUID, oPC);
|
||||
int itemCount = 0;
|
||||
object oInventory = GetFirstItemInInventory(oPC);
|
||||
|
||||
while (GetIsObjectValid(oInventory)) {
|
||||
if ( GetTag(oInventory) == "alt_shape_conv") itemCount++;
|
||||
oInventory = GetNextItemInInventory(oPC);
|
||||
if (itemCount > 0) break; //no need to check further.
|
||||
}
|
||||
|
||||
if (itemCount == 0 && nDruidLevel > 12) CreateItemOnObject("alternateshapech", oPC);
|
||||
}
|
94
_module/nss/alt_shape_conv.nss
Normal file
94
_module/nss/alt_shape_conv.nss
Normal file
@@ -0,0 +1,94 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//start the conversation to choose which alternate humanoid shape to choose.
|
||||
|
||||
//Modified March 27th, 2006: Allow only 1 widget in the PC's inventory.
|
||||
// Added level checks for item activation (DM's can bypass this)
|
||||
|
||||
#include "x2_inc_itemprop"
|
||||
#include "x2_inc_switches"
|
||||
|
||||
void main() {
|
||||
int nEvent = GetUserDefinedItemEventNumber();
|
||||
object oPC;
|
||||
object oItem;
|
||||
|
||||
switch(nEvent) {
|
||||
//The following are not used
|
||||
case X2_ITEM_EVENT_SPELLCAST_AT: break;
|
||||
case X2_ITEM_EVENT_ONHITCAST: break;
|
||||
case X2_ITEM_EVENT_EQUIP: break;
|
||||
case X2_ITEM_EVENT_UNEQUIP: break;
|
||||
case X2_ITEM_EVENT_UNACQUIRE: break;
|
||||
|
||||
//When the Player activates the widget
|
||||
case X2_ITEM_EVENT_ACTIVATE: {
|
||||
//Begin the conversation if requirements are met (DM's can always use this widget)
|
||||
oPC = GetItemActivator();
|
||||
oItem = GetItemActivated();
|
||||
int nDruidLevel = GetLevelByClass(CLASS_TYPE_DRUID, oPC);
|
||||
// if (nDruidLevel > 8 || GetIsDMPossessed(oPC) || GetIsDM(oPC))
|
||||
AssignCommand( oPC, ActionStartConversation(oPC, "alt_shape", TRUE, FALSE) );
|
||||
// else
|
||||
// SendMessageToPC(oPC, "Requirements not met to use this ability.");
|
||||
break;
|
||||
}
|
||||
|
||||
//When the Player acquires the widget or logs into the game
|
||||
//This is potentally an expensive fuction call!!
|
||||
case X2_ITEM_EVENT_ACQUIRE: {
|
||||
oPC = GetModuleItemAcquiredBy();
|
||||
oItem = GetModuleItemAcquired();
|
||||
|
||||
//Don't give the widget if the PC alread has one.
|
||||
int itemCount = 0;
|
||||
object oInventory = GetFirstItemInInventory(oPC);
|
||||
while (GetIsObjectValid(oInventory)) {
|
||||
if ( GetTag(oInventory) == "alt_shape_conv") itemCount++;
|
||||
oInventory = GetNextItemInInventory(oPC);
|
||||
if (itemCount > 1) break; //no need to check further.
|
||||
}
|
||||
if (itemCount > 1) DestroyObject(oItem);
|
||||
|
||||
//originals (usefull for the DM and DM possessed creatures)
|
||||
SetLocalInt(oItem, "original_face", GetCreatureBodyPart(CREATURE_PART_HEAD, oPC) );
|
||||
SetLocalInt(oItem, "original_shape", GetAppearanceType(oPC) );
|
||||
SetLocalInt(oItem, "original_pheno", GetPhenoType(oPC) );
|
||||
SetLocalInt(oItem, "original_tail", GetCreatureTailType(oPC) );
|
||||
SetLocalInt(oItem, "original_wing", GetCreatureWingType(oPC) );
|
||||
|
||||
//Store the original shape, ignore if already set
|
||||
if ( !GetCampaignInt("altershape", "has_been_set", oPC) ) {
|
||||
SetCampaignInt("altershape", "original_face", GetCreatureBodyPart(CREATURE_PART_HEAD, oPC), oPC);
|
||||
SetCampaignInt("altershape", "original_shape", GetAppearanceType(oPC), oPC);
|
||||
SetCampaignInt("altershape", "original_pheno", GetPhenoType(oPC), oPC);
|
||||
SetCampaignInt("altershape", "original_tail", GetCreatureTailType(oPC), oPC);
|
||||
SetCampaignInt("altershape", "original_wing", GetCreatureWingType(oPC), oPC);
|
||||
SetCampaignInt("altershape", "has_been_set", TRUE, oPC);
|
||||
}
|
||||
|
||||
//change to temp variables
|
||||
SetLocalInt(oItem, "change_face", GetCreatureBodyPart(CREATURE_PART_HEAD, oPC) );
|
||||
SetLocalInt(oItem, "change_shape", GetAppearanceType(oPC) );
|
||||
SetLocalInt(oItem, "change_pheno", GetPhenoType(oPC) );
|
||||
SetLocalInt(oItem, "change_tail", GetCreatureTailType(oPC) );
|
||||
SetLocalInt(oItem, "change_wing", GetCreatureWingType(oPC) );
|
||||
|
||||
//slot 1 variables
|
||||
SetLocalInt(oItem, "slot1_face", GetCreatureBodyPart(CREATURE_PART_HEAD, oPC) );
|
||||
SetLocalInt(oItem, "slot1_shape", GetAppearanceType(oPC) );
|
||||
SetLocalInt(oItem, "slot1_pheno", GetPhenoType(oPC) );
|
||||
SetLocalInt(oItem, "slot1_tail", GetCreatureTailType(oPC) );
|
||||
SetLocalInt(oItem, "slot1_wing", GetCreatureWingType(oPC) );
|
||||
|
||||
//slot 2 variables
|
||||
SetLocalInt(oItem, "slot2_face", GetCreatureBodyPart(CREATURE_PART_HEAD, oPC) );
|
||||
SetLocalInt(oItem, "slot2_shape", GetAppearanceType(oPC) );
|
||||
SetLocalInt(oItem, "slot2_pheno", GetPhenoType(oPC) );
|
||||
SetLocalInt(oItem, "slot2_tail", GetCreatureTailType(oPC) );
|
||||
SetLocalInt(oItem, "slot2_wing", GetCreatureWingType(oPC) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
39
_module/nss/alt_shape_dwarf.nss
Normal file
39
_module/nss/alt_shape_dwarf.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Dwarf
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_DWARF );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
39
_module/nss/alt_shape_elf.nss
Normal file
39
_module/nss/alt_shape_elf.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Elf
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_ELF );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
20
_module/nss/alt_shape_face01.nss
Normal file
20
_module/nss/alt_shape_face01.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [01]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 1);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face02.nss
Normal file
20
_module/nss/alt_shape_face02.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [02]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 2);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face03.nss
Normal file
20
_module/nss/alt_shape_face03.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [03]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 3);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face04.nss
Normal file
20
_module/nss/alt_shape_face04.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [04]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 4);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face05.nss
Normal file
20
_module/nss/alt_shape_face05.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [05]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 5);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face06.nss
Normal file
20
_module/nss/alt_shape_face06.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [06]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 6);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face07.nss
Normal file
20
_module/nss/alt_shape_face07.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [07]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 7);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face08.nss
Normal file
20
_module/nss/alt_shape_face08.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [08]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 8);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face09.nss
Normal file
20
_module/nss/alt_shape_face09.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [09]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 9);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face10.nss
Normal file
20
_module/nss/alt_shape_face10.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [10]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 10);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face11.nss
Normal file
20
_module/nss/alt_shape_face11.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [11]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 11);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face12.nss
Normal file
20
_module/nss/alt_shape_face12.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [12]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 12);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face13.nss
Normal file
20
_module/nss/alt_shape_face13.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [13]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 13);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face14.nss
Normal file
20
_module/nss/alt_shape_face14.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [14]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 14);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face15.nss
Normal file
20
_module/nss/alt_shape_face15.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [15]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 15);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
50
_module/nss/alt_shape_face16.nss
Normal file
50
_module/nss/alt_shape_face16.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [16]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
int appnum = 16;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 16;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 16;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 16;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 16;
|
||||
}
|
||||
else {
|
||||
appnum = 161;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 16;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 16;
|
||||
break;
|
||||
default:
|
||||
appnum = 16;
|
||||
break;
|
||||
}
|
||||
//Get the PC & widget to store the information on
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
51
_module/nss/alt_shape_face17.nss
Normal file
51
_module/nss/alt_shape_face17.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [17]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
|
||||
int appnum = 17;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 17;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 17;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 17;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 17;
|
||||
}
|
||||
else {
|
||||
appnum = 162;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 17;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 17;
|
||||
break;
|
||||
default:
|
||||
appnum = 17;
|
||||
break;
|
||||
}
|
||||
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face18.nss
Normal file
49
_module/nss/alt_shape_face18.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [18]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 18;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 18;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 18;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 18;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 18;
|
||||
}
|
||||
else {
|
||||
appnum = 163;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 18;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 18;
|
||||
break;
|
||||
default:
|
||||
appnum = 18;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face19.nss
Normal file
49
_module/nss/alt_shape_face19.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [19]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 19;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 19;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 19;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 19;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 19;
|
||||
}
|
||||
else {
|
||||
appnum = 164;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 19;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 19;
|
||||
break;
|
||||
default:
|
||||
appnum = 19;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face20.nss
Normal file
49
_module/nss/alt_shape_face20.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [20]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 20;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 20;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 20;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 20;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 20;
|
||||
}
|
||||
else {
|
||||
appnum = 165;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 20;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 20;
|
||||
break;
|
||||
default:
|
||||
appnum = 20;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face21.nss
Normal file
49
_module/nss/alt_shape_face21.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [21]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 21;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 21;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 21;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 21;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 21;
|
||||
}
|
||||
else {
|
||||
appnum = 166;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 21;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 21;
|
||||
break;
|
||||
default:
|
||||
appnum = 21;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face22.nss
Normal file
49
_module/nss/alt_shape_face22.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [22]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 22;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 22;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 22;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 22;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 22;
|
||||
}
|
||||
else {
|
||||
appnum = 167;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 22;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 22;
|
||||
break;
|
||||
default:
|
||||
appnum = 22;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face23.nss
Normal file
20
_module/nss/alt_shape_face23.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [23]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 23);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face24.nss
Normal file
20
_module/nss/alt_shape_face24.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [24]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 24);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face25.nss
Normal file
20
_module/nss/alt_shape_face25.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [25]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 25);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face26.nss
Normal file
20
_module/nss/alt_shape_face26.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [26]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 26);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face27.nss
Normal file
49
_module/nss/alt_shape_face27.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [27]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 27;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 27;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 27;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 27;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 160;
|
||||
}
|
||||
else {
|
||||
appnum = 27;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 27;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 27;
|
||||
break;
|
||||
default:
|
||||
appnum = 27;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
49
_module/nss/alt_shape_face28.nss
Normal file
49
_module/nss/alt_shape_face28.nss
Normal file
@@ -0,0 +1,49 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [28]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
int appnum = 28;
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
appnum = 28;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
appnum = 28;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
appnum = 28;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE){
|
||||
appnum = 161;
|
||||
}
|
||||
else {
|
||||
appnum = 28;
|
||||
}
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
appnum = 28;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
appnum = 28;
|
||||
break;
|
||||
default:
|
||||
appnum = 28;
|
||||
break;
|
||||
}
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, appnum);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face29.nss
Normal file
20
_module/nss/alt_shape_face29.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [29]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 29);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face30.nss
Normal file
20
_module/nss/alt_shape_face30.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [30]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 30);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face31.nss
Normal file
20
_module/nss/alt_shape_face31.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [31]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 31);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face32.nss
Normal file
20
_module/nss/alt_shape_face32.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [32]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 32);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face33.nss
Normal file
20
_module/nss/alt_shape_face33.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [33]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 33);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face34.nss
Normal file
20
_module/nss/alt_shape_face34.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [34]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 34);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face35.nss
Normal file
20
_module/nss/alt_shape_face35.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [35]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 35);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face36.nss
Normal file
20
_module/nss/alt_shape_face36.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [36]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 36);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face37.nss
Normal file
20
_module/nss/alt_shape_face37.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [37]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 37);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face38.nss
Normal file
20
_module/nss/alt_shape_face38.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [38]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 38);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face39.nss
Normal file
20
_module/nss/alt_shape_face39.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [39]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 39);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face40.nss
Normal file
20
_module/nss/alt_shape_face40.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [40]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 40);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face41.nss
Normal file
20
_module/nss/alt_shape_face41.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [41]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 41);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face42.nss
Normal file
20
_module/nss/alt_shape_face42.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [42]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 42);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face43.nss
Normal file
20
_module/nss/alt_shape_face43.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [43]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 43);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face44.nss
Normal file
20
_module/nss/alt_shape_face44.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [44]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 44);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face45.nss
Normal file
20
_module/nss/alt_shape_face45.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [45]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 45);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face46.nss
Normal file
20
_module/nss/alt_shape_face46.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [46]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 46);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face47.nss
Normal file
20
_module/nss/alt_shape_face47.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [47]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 47);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face48.nss
Normal file
20
_module/nss/alt_shape_face48.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [48]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 48);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
20
_module/nss/alt_shape_face49.nss
Normal file
20
_module/nss/alt_shape_face49.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC's Head [49]
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Change the head
|
||||
int head_value = getMinHead(oPC, 49);
|
||||
SetLocalInt(oAltshapeWidget, "change_face", head_value );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
39
_module/nss/alt_shape_gnome.nss
Normal file
39
_module/nss/alt_shape_gnome.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Gnome
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_GNOME );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
39
_module/nss/alt_shape_hlflng.nss
Normal file
39
_module/nss/alt_shape_hlflng.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Halfling
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_HALFLING );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
39
_module/nss/alt_shape_human.nss
Normal file
39
_module/nss/alt_shape_human.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Human
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_HUMAN );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
121
_module/nss/alt_shape_inc.nss
Normal file
121
_module/nss/alt_shape_inc.nss
Normal file
@@ -0,0 +1,121 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to allow specifics of morphing (values can be either TRUE or FALSE)
|
||||
int IS_USING_CEP = TRUE;
|
||||
int ALLOW_CHANGE_RACE = TRUE;
|
||||
int ALLOW_CHANGE_FACE = TRUE;
|
||||
int ALLOW_CHANGE_PHENOTYPE = TRUE;
|
||||
int ALLOW_CHANGE_TAIL = TRUE;
|
||||
int ALLOW_CHANGE_WING = TRUE;
|
||||
|
||||
|
||||
//------------DO NOT MODIFY BELOW THIS LINE----------------------
|
||||
|
||||
//VARIABLES for use with CEP's Wings and Tails
|
||||
int CREATURE_WING_TYPE_DRAGON_BLACK = 34;
|
||||
int CREATURE_WING_TYPE_DRAGON_BLUE = 35;
|
||||
int CREATURE_WING_TYPE_DRAGON_BRASS = 36;
|
||||
int CREATURE_WING_TYPE_DRAGON_BRONZE = 37;
|
||||
int CREATURE_WING_TYPE_DRAGON_COPPER = 38;
|
||||
int CREATURE_WING_TYPE_DRAGON_GOLD = 39;
|
||||
int CREATURE_WING_TYPE_DRAGON_GREEN = 40;
|
||||
int CREATURE_WING_TYPE_DRAGON_RED = CREATURE_WING_TYPE_DRAGON;
|
||||
int CREATURE_WING_TYPE_DRAGON_SILVER = 41;
|
||||
int CREATURE_WING_TYPE_DRAGON_WHITE = 42;
|
||||
|
||||
int CREATURE_WING_TYPE_BIRD_BROWN = CREATURE_WING_TYPE_BIRD;
|
||||
int CREATURE_WING_TYPE_BIRD_RED = 31;
|
||||
int CREATURE_WING_TYPE_BIRD_DARK = 32;
|
||||
int CREATURE_WING_TYPE_BIRD_BLUE = 33;
|
||||
int CREATURE_WING_TYPE_DEMON_ERINYES = 30;
|
||||
|
||||
int CREATURE_TAIL_TYPE_CAT = 30;
|
||||
|
||||
//Getters
|
||||
int getMaxHeads(object oPC) {
|
||||
|
||||
//Set the VARIABLES for Faces
|
||||
int MAX_FACES_DWARF_FEMALE = 12;
|
||||
int MAX_FACES_DWARF_MALE = 13;
|
||||
int MAX_FACES_ELF_FEMALE = 16;
|
||||
int MAX_FACES_ELF_MALE = 18;
|
||||
int MAX_FACES_GNOME_FEMALE = 9;
|
||||
int MAX_FACES_GNOME_MALE = 13;
|
||||
int MAX_FACES_HALFLING_FEMALE = 11;
|
||||
int MAX_FACES_HALFLING_MALE = 10;
|
||||
int MAX_FACES_HALFORC_FEMALE = 12;
|
||||
int MAX_FACES_HALFORC_MALE = 13;
|
||||
int MAX_FACES_HUMAN_FEMALE = 27;
|
||||
int MAX_FACES_HUMAN_MALE = 34;
|
||||
|
||||
if (IS_USING_CEP) {
|
||||
MAX_FACES_DWARF_FEMALE = 23;
|
||||
MAX_FACES_DWARF_MALE = 24;
|
||||
MAX_FACES_ELF_FEMALE = 43;
|
||||
MAX_FACES_ELF_MALE = 34;
|
||||
MAX_FACES_GNOME_FEMALE = 10;
|
||||
MAX_FACES_GNOME_MALE = 35;
|
||||
MAX_FACES_HALFLING_FEMALE = 15;
|
||||
MAX_FACES_HALFLING_MALE = 28;
|
||||
MAX_FACES_HALFORC_FEMALE = 15;
|
||||
MAX_FACES_HALFORC_MALE = 31;
|
||||
MAX_FACES_HUMAN_FEMALE = 49;
|
||||
MAX_FACES_HUMAN_MALE = 49;
|
||||
}
|
||||
|
||||
//Return the Result
|
||||
switch ( GetAppearanceType(oPC) ) {
|
||||
case APPEARANCE_TYPE_DWARF:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_DWARF_MALE;
|
||||
else return MAX_FACES_DWARF_FEMALE;
|
||||
break;
|
||||
case APPEARANCE_TYPE_ELF:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_ELF_MALE;
|
||||
else return MAX_FACES_ELF_FEMALE;
|
||||
break;
|
||||
case APPEARANCE_TYPE_GNOME:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_GNOME_MALE;
|
||||
else return MAX_FACES_GNOME_FEMALE;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALFLING:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HALFLING_MALE;
|
||||
else return MAX_FACES_HALFLING_FEMALE;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HALF_ORC:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HALFORC_MALE;
|
||||
else return MAX_FACES_HALFORC_FEMALE;
|
||||
break;
|
||||
case APPEARANCE_TYPE_HUMAN:
|
||||
if (GetGender(oPC) == GENDER_MALE) return MAX_FACES_HUMAN_MALE;
|
||||
else return MAX_FACES_HUMAN_FEMALE;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int getMinHead(object oPC, int desired_head) {
|
||||
int max_head = getMaxHeads(oPC);
|
||||
if (desired_head < max_head) return desired_head;
|
||||
return max_head-1;
|
||||
}
|
||||
|
||||
int isPlayableRace(object oPC) {
|
||||
int n = GetAppearanceType(oPC);
|
||||
if (n == APPEARANCE_TYPE_DWARF || n == APPEARANCE_TYPE_ELF || n == APPEARANCE_TYPE_GNOME || n == APPEARANCE_TYPE_HALFLING || n == APPEARANCE_TYPE_HALF_ORC || n == APPEARANCE_TYPE_HUMAN) return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//Setter
|
||||
void makeChanges(object oPC, object oItem) {
|
||||
/* Shape */ SetCreatureAppearanceType(oPC, GetLocalInt(oItem, "change_shape"));
|
||||
/* Pheno */ SetPhenoType(GetLocalInt(oItem, "change_pheno"), oPC);
|
||||
/* Tail */ SetCreatureTailType(GetLocalInt(oItem, "change_tail"), oPC);
|
||||
/* Wing */ SetCreatureWingType(GetLocalInt(oItem, "change_wing"), oPC);
|
||||
/* Face */ int desired_head = getMinHead(oPC, GetLocalInt(oItem, "change_face") );
|
||||
SetCreatureBodyPart(CREATURE_PART_HEAD, desired_head, oPC);
|
||||
}
|
||||
|
24
_module/nss/alt_shape_load1.nss
Normal file
24
_module/nss/alt_shape_load1.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC back their original Race & Head & Wings & Tail
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_face", GetLocalInt(oAltshapeWidget, "slot1_face" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", GetLocalInt(oAltshapeWidget, "slot1_shape" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", GetLocalInt(oAltshapeWidget, "slot1_pheno" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_tail", GetLocalInt(oAltshapeWidget, "slot1_tail" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_wing", GetLocalInt(oAltshapeWidget, "slot1_wing" ) );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
24
_module/nss/alt_shape_load2.nss
Normal file
24
_module/nss/alt_shape_load2.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC back their original Race & Head & Wings & Tail
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_face", GetLocalInt(oAltshapeWidget, "slot2_face" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", GetLocalInt(oAltshapeWidget, "slot2_shape" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", GetLocalInt(oAltshapeWidget, "slot2_pheno" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_tail", GetLocalInt(oAltshapeWidget, "slot2_tail" ) );
|
||||
SetLocalInt(oAltshapeWidget, "change_wing", GetLocalInt(oAltshapeWidget, "slot2_wing" ) );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
11
_module/nss/alt_shape_m_1120.nss
Normal file
11
_module/nss/alt_shape_m_1120.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( getMaxHeads(GetPCSpeaker()) > 10 ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_2130.nss
Normal file
11
_module/nss/alt_shape_m_2130.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( getMaxHeads(GetPCSpeaker()) > 20 ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_3140.nss
Normal file
11
_module/nss/alt_shape_m_3140.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( getMaxHeads(GetPCSpeaker()) > 30 ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_4150.nss
Normal file
11
_module/nss/alt_shape_m_4150.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( getMaxHeads(GetPCSpeaker()) > 40 ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_cepf.nss
Normal file
11
_module/nss/alt_shape_m_cepf.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( IS_USING_CEP ) return FALSE;
|
||||
return TRUE;
|
||||
}
|
11
_module/nss/alt_shape_m_cept.nss
Normal file
11
_module/nss/alt_shape_m_cept.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( IS_USING_CEP ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_face.nss
Normal file
11
_module/nss/alt_shape_m_face.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( ALLOW_CHANGE_FACE ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_phen.nss
Normal file
11
_module/nss/alt_shape_m_phen.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( ALLOW_CHANGE_PHENOTYPE ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_race.nss
Normal file
11
_module/nss/alt_shape_m_race.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( ALLOW_CHANGE_RACE ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_tail.nss
Normal file
11
_module/nss/alt_shape_m_tail.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( ALLOW_CHANGE_TAIL ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
11
_module/nss/alt_shape_m_wing.nss
Normal file
11
_module/nss/alt_shape_m_wing.nss
Normal file
@@ -0,0 +1,11 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Determine if Menu item shows up or not.
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
int StartingConditional() {
|
||||
if( ALLOW_CHANGE_WING ) return TRUE;
|
||||
return FALSE;
|
||||
}
|
39
_module/nss/alt_shape_orc.nss
Normal file
39
_module/nss/alt_shape_orc.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Half-Orc
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", APPEARANCE_TYPE_HALF_ORC );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
int playable_race =isPlayableRace(oPC);
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
if ( !playable_race ) {
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_SHIN, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_THIGH, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_TORSO, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_FOREARM, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_BICEP, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oPC );
|
||||
SetCreatureBodyPart( CREATURE_PART_HEAD, 1, oPC );
|
||||
}
|
||||
}
|
23
_module/nss/alt_shape_pheno.nss
Normal file
23
_module/nss/alt_shape_pheno.nss
Normal file
@@ -0,0 +1,23 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change to an Body Type: Big (aka Fat)
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
if (GetPhenoType(oPC) == PHENOTYPE_BIG)
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", PHENOTYPE_NORMAL );
|
||||
else
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", PHENOTYPE_BIG );
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
33
_module/nss/alt_shape_revert.nss
Normal file
33
_module/nss/alt_shape_revert.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Change the PC back their original Race & Head & Wings & Tail
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
if (GetIsDM(oPC) || GetIsDMPossessed(oPC)) {
|
||||
//DM's seem incapable of setting/getting campaign variables on themselves.
|
||||
SetLocalInt(oAltshapeWidget, "change_face", GetLocalInt(oAltshapeWidget, "original_face") );
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", GetLocalInt(oAltshapeWidget, "original_shape") );
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", GetLocalInt(oAltshapeWidget, "original_pheno") );
|
||||
SetLocalInt(oAltshapeWidget, "change_tail", GetLocalInt(oAltshapeWidget, "original_tail") );
|
||||
SetLocalInt(oAltshapeWidget, "change_wing", GetLocalInt(oAltshapeWidget, "original_wing") );
|
||||
} else {
|
||||
SetLocalInt(oAltshapeWidget, "change_face", GetCampaignInt("altershape", "original_face", oPC) );
|
||||
SetLocalInt(oAltshapeWidget, "change_shape", GetCampaignInt("altershape", "original_shape", oPC) );
|
||||
SetLocalInt(oAltshapeWidget, "change_pheno", GetCampaignInt("altershape", "original_pheno", oPC) );
|
||||
SetLocalInt(oAltshapeWidget, "change_tail", GetCampaignInt("altershape", "original_tail", oPC) );
|
||||
SetLocalInt(oAltshapeWidget, "change_wing", GetCampaignInt("altershape", "original_wing", oPC) );
|
||||
}
|
||||
|
||||
//Change the PC's Race appearance
|
||||
makeChanges(oPC, oAltshapeWidget);
|
||||
}
|
22
_module/nss/alt_shape_save1.nss
Normal file
22
_module/nss/alt_shape_save1.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
//Created by Esreyr Fears
|
||||
//on February 2nd, 2006
|
||||
|
||||
//Save the current configuration to SLOT 1
|
||||
|
||||
#include "alt_shape_inc"
|
||||
|
||||
void main() {
|
||||
|
||||
//Get the PC & widget to store the information on
|
||||
object oPC = GetPCSpeaker();
|
||||
object oAltshapeWidget = GetItemPossessedBy(oPC, "alt_shape_conv");
|
||||
if (oAltshapeWidget == OBJECT_INVALID) return;
|
||||
|
||||
//Set the appropriate 'Change-to' variable
|
||||
SetLocalInt(oAltshapeWidget, "is_original", 1);
|
||||
SetLocalInt(oAltshapeWidget, "slot1_face", GetLocalInt(oAltshapeWidget, "change_face" ) );
|
||||
SetLocalInt(oAltshapeWidget, "slot1_shape", GetLocalInt(oAltshapeWidget, "change_shape" ) );
|
||||
SetLocalInt(oAltshapeWidget, "slot1_pheno", GetLocalInt(oAltshapeWidget, "change_pheno" ) );
|
||||
SetLocalInt(oAltshapeWidget, "slot1_tail", GetLocalInt(oAltshapeWidget, "change_tail" ) );
|
||||
SetLocalInt(oAltshapeWidget, "slot1_wing", GetLocalInt(oAltshapeWidget, "change_wing" ) );
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user