Palace guard update

script changes to hopefully cut out TMI errors.  Various mob appearance changes.
This commit is contained in:
EpicValor 2023-12-05 00:55:15 -06:00
parent b7e52ec994
commit b59db83a72
52 changed files with 1422 additions and 1661 deletions

View File

@ -2913,7 +2913,7 @@
},
"Version": {
"type": "dword",
"value": 60
"value": 62
},
"Width": {
"type": "int",

File diff suppressed because it is too large Load Diff

View File

@ -172,7 +172,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "Ah so the nature of this war preplexes you to? Stand fast my friend. Maybe we can be of service to each other here. I have a dilema you may be able to help me with, and mayhaps I have something of use to you in exchange?"
"0": "Ah. so the nature of this war preplexes you to0? Stand fast my friend. Maybe we can be of service to each other here. I have a dilema you may be able to help me with, and perhaps I offer something of use to you in exchange?"
}
}
},
@ -241,7 +241,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "As you may be aware it is rumoured that several magical portals still exist in the realm that lead to the outer planes. Specifically, to an area we call the rift. Recently my spies unearthed rumours in the Palace that one such portal was located in the NasGarthian sewers. I have heard that the Emperor sent a small force of troops into this portal led by his advisory council. The six man council being led by his most trusted advisors, Lord McDaggart High Priest of Torm for NasGarth, and the Imperial Army commander, General Jacob Kell. My spies go on to report that the council returned corrupted by unimaginable evil within the rift. Now refering to themselves as the Scorpion council. Rumours suggest that they have seized control of NasGarth and are in fact the true instigators of the war and not the Emperor as many believe."
"0": "As you may be aware it is rumoured that several magical portals still exist in the realm that lead to the outer planes. Specifically, to an area we call the rift. Recently, my spies unearthed rumours in the Palace that one such portal was located in the NasGarthian sewers. I have heard that the Emperor sent a small force of troops into this portal led by his advisory council. The six man council being led by his most trusted advisors, Lord McDaggart High Priest of Torm for NasGarth, and the Imperial Army commander, General Jacob Kell. My spies go on to report that the council returned corrupted by unimaginable evil within the rift. Now refering to themselves as the Scorpion council. Rumours suggest that they have seized control of NasGarth and are in fact the true instigators of the war and not the Emperor as many believe."
}
}
},
@ -398,7 +398,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "Excellent my friend! Here is the rift stone I spoke of earlier. Good luck, my friend!"
"0": "Excellent, my friend! Here is the rift stone I spoke of earlier. Good luck to you!"
}
}
},
@ -555,7 +555,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "This message from my friend confirms my fears. It seems I was right and the Emperor no longer controls NasGarth but rather is used as a puppet by this mysterious Scorpion Council. Here take this, it is a \"copy\" of the Imperial Palace key. It will allow you to gain entry to the NasGarthian Palace. Mayhap you can help bring this war to an end,and as promised take these items to aid you on your quest"
"0": "This message from my friend confirms my fears. It seems I was right and the Emperor no longer controls NasGarth but rather is used as a puppet by this mysterious Scorpion Council. Here, take this, it is a copy of the Imperial Palace key. It will allow you to gain entry to the NasGarthian Palace. Mayhap you can help bring this war to an end, and as promised take these items to aid you on your quest"
}
}
},
@ -612,7 +612,7 @@
},
"NumWords": {
"type": "dword",
"value": 542
"value": 541
},
"PreventZoomIn": {
"type": "byte",
@ -682,7 +682,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "Interesting I have braved many trails and battles in my quest to discover the cause of this great war,what information could you offer me?"
"0": "Interesting, I have braved many trials and battles in my quest to discover the cause of this great war. What information could you offer me?"
}
}
},
@ -747,7 +747,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "Very well, what is it you want?"
"0": "Very well. Wwhat is it you want?"
}
}
},
@ -971,7 +971,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "No problem. Consider the job done"
"0": "I shall return"
}
}
},
@ -1016,7 +1016,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "I have yet to decide if you shall live or die rogue..."
"0": "I have yet to decide if you shall live or die, rogue."
}
}
},
@ -1081,7 +1081,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "I am afraid so. Your friend is dead but I found this note on his body although I am unable to understand it..."
"0": "I am afraid so. Your friend is dead but I found this note on his body although I am unable to understand it."
}
}
},

View File

@ -21,6 +21,10 @@
"value": [
{
"__struct_id": 0,
"ActionParams": {
"type": "list",
"value": []
},
"Animation": {
"type": "dword",
"value": 0
@ -50,6 +54,10 @@
"type": "resref",
"value": ""
},
"ConditionParams": {
"type": "list",
"value": []
},
"Index": {
"type": "dword",
"value": 1
@ -65,6 +73,10 @@
"type": "resref",
"value": ""
},
"ConditionParams": {
"type": "list",
"value": []
},
"Index": {
"type": "dword",
"value": 0
@ -91,7 +103,7 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "Huh, Spose you wanna trade........"
"0": "Huh, s'pose you wanna trade?"
}
}
}
@ -110,6 +122,10 @@
"value": [
{
"__struct_id": 0,
"ActionParams": {
"type": "list",
"value": []
},
"Animation": {
"type": "dword",
"value": 0
@ -145,12 +161,16 @@
"Text": {
"type": "cexolocstring",
"value": {
"0": "No, thanks."
"0": "No thanks."
}
}
},
{
"__struct_id": 1,
"ActionParams": {
"type": "list",
"value": []
},
"Animation": {
"type": "dword",
"value": 0
@ -201,6 +221,10 @@
"type": "resref",
"value": ""
},
"ConditionParams": {
"type": "list",
"value": []
},
"Index": {
"type": "dword",
"value": 0

View File

@ -48,14 +48,90 @@
"value": [
{
"__struct_id": 4,
"Appearance_Head": {
"type": "byte",
"value": 13
},
"Appearance_Type": {
"type": "word",
"value": 27
"value": 3
},
"ArmorPart_RFoot": {
"type": "byte",
"value": 1
},
"BodyBag": {
"type": "byte",
"value": 0
},
"BodyPart_Belt": {
"type": "byte",
"value": 0
},
"BodyPart_LBicep": {
"type": "byte",
"value": 1
},
"BodyPart_LFArm": {
"type": "byte",
"value": 1
},
"BodyPart_LFoot": {
"type": "byte",
"value": 1
},
"BodyPart_LHand": {
"type": "byte",
"value": 1
},
"BodyPart_LShin": {
"type": "byte",
"value": 1
},
"BodyPart_LShoul": {
"type": "byte",
"value": 0
},
"BodyPart_LThigh": {
"type": "byte",
"value": 1
},
"BodyPart_Neck": {
"type": "byte",
"value": 1
},
"BodyPart_Pelvis": {
"type": "byte",
"value": 1
},
"BodyPart_RBicep": {
"type": "byte",
"value": 0
},
"BodyPart_RFArm": {
"type": "byte",
"value": 1
},
"BodyPart_RHand": {
"type": "byte",
"value": 1
},
"BodyPart_RShin": {
"type": "byte",
"value": 1
},
"BodyPart_RShoul": {
"type": "byte",
"value": 0
},
"BodyPart_RThigh": {
"type": "byte",
"value": 1
},
"BodyPart_Torso": {
"type": "byte",
"value": 1
},
"Cha": {
"type": "byte",
"value": 8
@ -80,6 +156,22 @@
}
]
},
"Color_Hair": {
"type": "byte",
"value": 169
},
"Color_Skin": {
"type": "byte",
"value": 80
},
"Color_Tattoo1": {
"type": "byte",
"value": 92
},
"Color_Tattoo2": {
"type": "byte",
"value": 127
},
"Con": {
"type": "byte",
"value": 14
@ -118,7 +210,268 @@
},
"Equip_ItemList": {
"type": "list",
"value": []
"value": [
{
"__struct_id": 2,
"AddCost": {
"type": "dword",
"value": 0
},
"ArmorPart_Belt": {
"type": "byte",
"value": 0
},
"ArmorPart_LBicep": {
"type": "byte",
"value": 157
},
"ArmorPart_LFArm": {
"type": "byte",
"value": 125
},
"ArmorPart_LFoot": {
"type": "byte",
"value": 149
},
"ArmorPart_LHand": {
"type": "byte",
"value": 9
},
"ArmorPart_LShin": {
"type": "byte",
"value": 81
},
"ArmorPart_LShoul": {
"type": "byte",
"value": 0
},
"ArmorPart_LThigh": {
"type": "byte",
"value": 80
},
"ArmorPart_Neck": {
"type": "byte",
"value": 2
},
"ArmorPart_Pelvis": {
"type": "byte",
"value": 159
},
"ArmorPart_RBicep": {
"type": "byte",
"value": 157
},
"ArmorPart_RFArm": {
"type": "byte",
"value": 125
},
"ArmorPart_RFoot": {
"type": "byte",
"value": 149
},
"ArmorPart_RHand": {
"type": "byte",
"value": 155
},
"ArmorPart_Robe": {
"type": "byte",
"value": 0
},
"ArmorPart_RShin": {
"type": "byte",
"value": 81
},
"ArmorPart_RShoul": {
"type": "byte",
"value": 0
},
"ArmorPart_RThigh": {
"type": "byte",
"value": 80
},
"ArmorPart_Torso": {
"type": "byte",
"value": 171
},
"BaseItem": {
"type": "int",
"value": 16
},
"Charges": {
"type": "byte",
"value": 0
},
"Cloth1Color": {
"type": "byte",
"value": 119
},
"Cloth2Color": {
"type": "byte",
"value": 167
},
"Cost": {
"type": "dword",
"value": 1
},
"Cursed": {
"type": "byte",
"value": 0
},
"DescIdentified": {
"type": "cexolocstring",
"value": {}
},
"Description": {
"type": "cexolocstring",
"value": {}
},
"Identified": {
"type": "byte",
"value": 1
},
"Leather1Color": {
"type": "byte",
"value": 127
},
"Leather2Color": {
"type": "byte",
"value": 115
},
"LocalizedName": {
"id": 12924,
"type": "cexolocstring",
"value": {}
},
"Metal1Color": {
"type": "byte",
"value": 167
},
"Metal2Color": {
"type": "byte",
"value": 47
},
"Plot": {
"type": "byte",
"value": 0
},
"PropertiesList": {
"type": "list",
"value": []
},
"StackSize": {
"type": "word",
"value": 1
},
"Stolen": {
"type": "byte",
"value": 0
},
"Tag": {
"type": "cexostring",
"value": "NW_CLOTH023"
},
"TemplateResRef": {
"type": "resref",
"value": "nw_cloth023"
},
"xArmorPart_Belt": {
"type": "word",
"value": 0
},
"xArmorPart_LBice": {
"type": "word",
"value": 157
},
"xArmorPart_LFArm": {
"type": "word",
"value": 125
},
"xArmorPart_LFoot": {
"type": "word",
"value": 149
},
"xArmorPart_LHand": {
"type": "word",
"value": 9
},
"xArmorPart_LShin": {
"type": "word",
"value": 81
},
"xArmorPart_LShou": {
"type": "word",
"value": 0
},
"xArmorPart_LThig": {
"type": "word",
"value": 80
},
"xArmorPart_Neck": {
"type": "word",
"value": 2
},
"xArmorPart_Pelvi": {
"type": "word",
"value": 159
},
"xArmorPart_RBice": {
"type": "word",
"value": 157
},
"xArmorPart_RFArm": {
"type": "word",
"value": 125
},
"xArmorPart_RFoot": {
"type": "word",
"value": 149
},
"xArmorPart_RHand": {
"type": "word",
"value": 155
},
"xArmorPart_Robe": {
"type": "word",
"value": 0
},
"xArmorPart_RShin": {
"type": "word",
"value": 81
},
"xArmorPart_RShou": {
"type": "word",
"value": 0
},
"xArmorPart_RThig": {
"type": "word",
"value": 80
},
"xArmorPart_Torso": {
"type": "word",
"value": 171
},
"XOrientation": {
"type": "float",
"value": 0.0
},
"XPosition": {
"type": "float",
"value": -1.0
},
"YOrientation": {
"type": "float",
"value": 1.0
},
"YPosition": {
"type": "float",
"value": -1.0
},
"ZPosition": {
"type": "float",
"value": -1.0
}
}
]
},
"FactionID": {
"type": "word",
@ -262,7 +615,7 @@
},
"PortraitId": {
"type": "word",
"value": 162
"value": 124
},
"Race": {
"type": "byte",
@ -604,7 +957,7 @@
},
"SoundSetFile": {
"type": "word",
"value": 431
"value": 426
},
"SpecAbilityList": {
"type": "list",
@ -654,6 +1007,82 @@
"type": "byte",
"value": 12
},
"xAppearance_Head": {
"type": "word",
"value": 13
},
"xArmorPart_RFoot": {
"type": "word",
"value": 1
},
"xBodyPart_Belt": {
"type": "word",
"value": 0
},
"xBodyPart_LBicep": {
"type": "word",
"value": 1
},
"xBodyPart_LFArm": {
"type": "word",
"value": 1
},
"xBodyPart_LFoot": {
"type": "word",
"value": 1
},
"xBodyPart_LHand": {
"type": "word",
"value": 1
},
"xBodyPart_LShin": {
"type": "word",
"value": 1
},
"xBodyPart_LShoul": {
"type": "word",
"value": 0
},
"xBodyPart_LThigh": {
"type": "word",
"value": 1
},
"xBodyPart_Neck": {
"type": "word",
"value": 1
},
"xBodyPart_Pelvis": {
"type": "word",
"value": 1
},
"xBodyPart_RBicep": {
"type": "word",
"value": 0
},
"xBodyPart_RFArm": {
"type": "word",
"value": 1
},
"xBodyPart_RHand": {
"type": "word",
"value": 1
},
"xBodyPart_RShin": {
"type": "word",
"value": 1
},
"xBodyPart_RShoul": {
"type": "word",
"value": 0
},
"xBodyPart_RThigh": {
"type": "word",
"value": 1
},
"xBodyPart_Torso": {
"type": "word",
"value": 1
},
"XOrientation": {
"type": "float",
"value": 0.0

View File

@ -31119,7 +31119,7 @@
"__struct_id": 0,
"CR": {
"type": "float",
"value": 46.0
"value": 30.0
},
"FACTION": {
"type": "cexostring",
@ -31480,7 +31480,7 @@
"__struct_id": 0,
"CR": {
"type": "float",
"value": 40.0
"value": 39.0
},
"FACTION": {
"type": "cexostring",
@ -31765,7 +31765,7 @@
"__struct_id": 0,
"CR": {
"type": "float",
"value": 40.0
"value": 45.0
},
"FACTION": {
"type": "cexostring",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
_module/ncs/prc_rest.ncs Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,903 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
// // //
// _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 = 10 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"
#include "sd_lootsystem"
/*******************************************************************************
** 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);
ExecuteScript("sl_destroyself2", oCorpseBlood);
//Set Local for deletion later if needed
SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood);
}
void BodyFade(object oHostBody, object oBlood)
{
object oBones;
location lLoc = GetLocation(oHostBody);
SetPlotFlag(oHostBody, FALSE);
AssignCommand(oHostBody, SetIsDestroyable(TRUE,FALSE,FALSE));
if ((GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_ANIMAL))
{
oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bones", lLoc, FALSE);
ExecuteScript("sd_destroyself", oBones);
}
DestroyObject(oBlood);
if (GetIsDead(oHostBody))DestroyObject(oHostBody, 0.2f);
}
void LeaveCorpse()
{
//SET YOUR LOOTABLE CORPSES PREFERENCES HERE ///////////////
//
int nUseLootable = TRUE; // Set this to FALSE if you want disable the lootable corpse functionality //
int nMoveEquipped = FALSE; // Set this to FALSE if you don't want to move Equipped items to the corpse //
int nCopyArmour = FALSE; // 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 = TRUE; // This will use the ResRef for dropping the weapons on the ground //
int nMoveWeapons = FALSE; // Setting this TRUE will just move the weapons to the Lootable Object //
int nUseBlood = FALSE; // 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 = 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 = FALSE; // 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 = 145; // 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 = 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 = 120; // 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 = FALSE; // Set this to FALSE if you want EMPTY corpses to fade immediately. //
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 = FALSE; // 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 = FALSE;// 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. //
float lsDelay = 240.0; // Corpse & loot fade delay
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ALTER THE FOLLOWING AT YOUR OWN RISK :)
object oHostBody = OBJECT_SELF; //Get the Dead Creature Object
object oBlood;
object oSaveBlood;
string sBaseTag = GetTag(oHostBody); //Get that TAG of the dead creature
string sPrefix = GetStringLeft(sBaseTag, 4); //Look for Dead Prefix
location lLoc = GetLocation(oHostBody);
if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) &&
(GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&&
(GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON))
{
oBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lLoc, FALSE);
}
DelayCommand(lsDelay, BodyFade(oHostBody, oBlood));
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, "rr_sack", lCorpseLoc, FALSE); //Spawn our lootable object
SetLocalObject(oLootCorpse, "oHostBody", oHostBody); //Set Local for deletion later if needed
SetLocalObject(oLootCorpse, "oBlood", oBlood);
NameSack(oLootCorpse);
DelayCommand(0.1,sd_droploot(oHostBody, oLootCorpse));
DelayCommand(lsDelay, LootClear(oLootCorpse));
// 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);
ExecuteScript("sl_destroyself", oCorpseBlood);
/*
// 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);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
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);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
}
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);
ExecuteScript("sl_destroyself", oCorpseBlood);
}
}
// 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(){}

View File

@ -18,9 +18,9 @@ void main()
//:: Send Under Construction message
SendMessageToPC(oPC, "This server is under active development and could go down arbitrarily. Admin will try to give notice beforehand.");
ExecuteScript("prc_onenter", OBJECT_SELF);
ExecuteScript("_oncliententer", OBJECT_SELF);
DelayCommand(10.0, ExecuteScript("prc_onenter", OBJECT_SELF));
DelayCommand(11.0, ExecuteScript("_oncliententer", OBJECT_SELF));
AssignCommand(oPC, DelayCommand (1.0, ClearAllActions(TRUE)));
AssignCommand(oPC, DelayCommand(1.2, PlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 0.5)));
AssignCommand(oPC, DelayCommand (10.0, ClearAllActions(TRUE)));
AssignCommand(oPC, DelayCommand(10.2, PlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 0.5)));
}

408
_module/nss/prc_rest.nss Normal file
View File

@ -0,0 +1,408 @@
//::///////////////////////////////////////////////
//:: OnPlayerRest eventscript
//:: prc_rest
//:://////////////////////////////////////////////
/*
Hooked NPC's into this via prc_npc_rested - 06.03.2004, Ornedan
*/
#include "prc_inc_function"
#include "psi_inc_psifunc"
#include "prc_sp_func"
#include "prc_inc_domain"
#include "true_inc_trufunc"
#include "inv_inc_invfunc"
#include "inc_epicspells"
#include "prc_inc_scry"
#include "prc_inc_dragsham"
#include "prc_inc_wpnrest"
#include "inc_dynconv"
#include "prc_inc_util"
#include "shd_inc_myst"
#include "prc_inc_template"
void PrcFeats(object oPC)
{
if(DEBUG) DoDebug("prc_rest: Evaluating PC feats for " + DebugObject2Str(oPC));
SetLocalInt(oPC,"ONREST",1);
object oSkin = GetPCSkin(oPC);
DelayCommand(0.2, ScrubPCSkin(oPC, oSkin));
DelayCommand(0.3, FeatSpecialUsePerDay(oPC));
DelayCommand(0.4, DeletePRCLocalInts(oSkin));
DelayCommand(0.5, DeletePRCLocalIntsT(oPC));
DelayCommand(0.6, EvalPRCFeats(oPC));
DelayCommand(0.7, DoWeaponsEquip(oPC));
DelayCommand(1.0, DeleteLocalInt(oPC,"ONREST"));
}
void RestCancelled(object oPC)
{
if(GetPRCSwitch(PRC_PNP_REST_HEALING))
{
int nHP = GetLocalInt(oPC, "PnP_Rest_InitialHP");
//cancelled, dont heal anything
//nHP += GetHitDice(oPC);
int nCurrentHP = GetCurrentHitPoints(oPC);
int nDamage = nCurrentHP-nHP;
//check its a positive number
if(nDamage > 0)
{
//DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY), oPC));
SetCurrentHitPoints(oPC, nCurrentHP - nDamage);
}
}
if(DEBUG) DoDebug("prc_rest: Rest cancelled for " + DebugObject2Str(oPC));
DelayCommand(1.1,PrcFeats(oPC));
// Execute scripts hooked to this event for the player triggering it
ExecuteAllScriptsHookedToEvent(oPC, EVENT_ONPLAYERREST_CANCELLED);
}
void RestFinished(object oPC)
{
int nGeneration = PRC_NextGeneration(GetLocalInt(oPC, PRC_Rest_Generation));
if (DEBUG > 1) DoDebug("Rest Generation: " + IntToString(nGeneration));
SetLocalInt(oPC, PRC_Rest_Generation, nGeneration);
if(DEBUG) DoDebug("prc_rest: Rest finished for for " + DebugObject2Str(oPC));
//Restore Power Points for Psionics
ExecuteScript("prc_psi_ppoints", oPC);
ExecuteScript("tob_evnt_recover", oPC);
DelayCommand(0.1, BonusDomainRest(oPC));
DelayCommand(0.2, ClearLawLocalVars(oPC));
DelayCommand(0.3, ClearMystLocalVars(oPC));
DelayCommand(0.4, ClearLegacyUses(oPC));
DelayCommand(0.5, ClearInvocationLocalVars(oPC));
// To heal up enslaved creatures...
object oSlave = GetLocalObject(oPC, "EnslavedCreature");
if (GetIsObjectValid(oSlave) && !GetIsDead(oSlave) && !GetIsInCombat(oSlave))
AssignCommand(oSlave, ActionRest());
//ForceRest(oSlave);
if (GetIsEpicSpellcaster(oPC)) {
FloatingTextStringOnCreature("*You feel refreshed*", oPC, FALSE);
ReplenishSlots(oPC);
}
if (GetHasFeat(FEAT_SF_CODE,oPC))
DelayCommand(0.1, RemoveSpecificProperty(GetPCSkin(oPC),ITEM_PROPERTY_BONUS_FEAT,IP_CONST_FEAT_SF_CODE));
// begin flurry of swords array
if (GetLevelByClass(CLASS_TYPE_ARCANE_DUELIST, oPC))
{
DeleteLocalInt(oPC, "FLURRY_TARGET_NUMBER");
int i;
for (i = 0 ; i < 10 ; i++)
{
string sName = "FLURRY_TARGET_" + IntToString(i);
SetLocalObject(oPC, sName, OBJECT_INVALID);
}
}
// end flurry or swords array
//Check for leftover Diamond Dragon appendages
if (GetLevelByClass(CLASS_TYPE_DIAMOND_DRAGON, oPC))
{
if(GetPersistantLocalInt(oPC, "ChannelingTail"))
{
SetPersistantLocalInt(oPC, "ChannelingTail", FALSE);
SetCreatureTailType(CREATURE_TAIL_TYPE_NONE, oPC);
}
if(GetPersistantLocalInt(oPC, "ChannelingWings"))
{
SetPersistantLocalInt(oPC, "ChannelingWings", FALSE);
SetCreatureWingType(CREATURE_WING_TYPE_NONE, oPC);
}
}
if(GetPRCSwitch(PRC_PNP_REST_HEALING))
{
int nHP = GetLocalInt(oPC, "PnP_Rest_InitialHP");
int nOldMax = GetLocalInt(oPC, "PnP_Rest_InitialMax");
if(DEBUG) DoDebug("prc_rest: Finished HPs for " + DebugObject2Str(oPC)+"n/n/"+" nCurrent: "+IntToString(nHP)+" nMax: "+IntToString(nOldMax));
//only heal HP if not undead and not a construct
if(MyPRCGetRacialType(oPC) != RACIAL_TYPE_UNDEAD && MyPRCGetRacialType(oPC) != RACIAL_TYPE_CONSTRUCT)
nHP = GetMaxHitPoints(oPC) - nOldMax + nHP + GetHitDice(oPC);
int nCurrentHP = GetCurrentHitPoints(oPC);
int nDamage = nCurrentHP-nHP;
//check its a positive number
if(nDamage > 0)
{
//DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_TWENTY), oPC));
SetCurrentHitPoints(oPC, nCurrentHP - nDamage);
}
// We've finished rest, clean up
DeleteLocalInt(oPC, "PnP_Rest_InitialHP");
DeleteLocalInt(oPC, "PnP_Rest_InitialMax");
}
int nSpellCount = GetPRCSwitch(PRC_DISABLE_SPELL_COUNT);
int i;
string sMessage;
for(i=1;i<nSpellCount;i++)
{ //WARNING! WILL DO BAD THINGS TO SPONTANEOUS CASTERS AFFECTED
int nSpell = GetPRCSwitch(PRC_DISABLE_SPELL_+IntToString(i));
int nMessage;
while(PRCGetHasSpell(nSpell, oPC))
{
if(!nMessage)
{
sMessage += "You cannot use "+GetStringByStrRef(StringToInt(Get2DACache("spells", "Name", nSpell)))+" in this module.\n";
nMessage = TRUE;
}
PRCDecrementRemainingSpellUses(oPC, nSpell);
}
}
if(sMessage != "")
FloatingTextStringOnCreature(sMessage, oPC, TRUE);
//Clear Battle Fortitude lock
DeleteLocalInt(oPC, "BattleFortitude");
DeleteLocalInt(oPC, "ArmouredStealth");
//Clear Spelldancing
DeleteLocalInt(oPC, "SpelldanceFatigue");
DeleteLocalInt(oPC, "SpelldanceExhaust");
DeleteLocalInt(oPC, "SpelldanceRounds");
//Clear Killoren
DeleteLocalInt(oPC, "KillorenAncient");
DeleteLocalInt(oPC, "KillorenHunter");
//Clear Earth Smite
DeleteLocalInt(oPC, "EarthSmite");
//Clear Fatigue
DeleteLocalInt(oPC, "Fatigued");
DeleteLocalInt(oPC, "HeatstrokeCount");
// Allow Readying
DeleteLocalInt(oPC, "ReadyManeuverCru");
DeleteLocalInt(oPC, "ReadyManeuverSwd");
DeleteLocalInt(oPC, "ReadyManeuverWar");
// Rest Ranged Recall
DeleteLocalInt(oPC, "RangedRecall");
// Animal Affinity
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_STRENGTH));
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_DEXTERITY));
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_CONSTITUTION));
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_WISDOM));
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_INTELLIGENCE));
DeleteLocalInt(oPC, "AnimalAffin"+IntToString(ABILITY_CHARISMA));
// Talon of Tiamat
DeleteLocalInt(oPC, "TalonBreath1");
DeleteLocalInt(oPC, "TalonBreath2");
DeleteLocalInt(oPC, "TalonBreath3");
DeleteLocalInt(oPC, "TalonBreath4");
DeleteLocalInt(oPC, "TalonBreath5");
if(GetHasFeat(FEAT_WEAPON_APTITUDE, oPC))
{
FloatingTextStringOnCreature(GetStringByStrRef(16837723), oPC, FALSE);
SetLocalInt(oPC, "PRC_WEAPON_APTITUDE_APPLIED", 0);
}
//DelayCommand(1.0,PrcFeats(oPC));
PrcFeats(oPC);
//allow players to recruit a new cohort
DeleteLocalInt(oPC, "CohortRecruited");
//in large parties, sometimes people dont rest
//loop over all and forcerest when necessary
//assumes NPCs start and finish resting after the PC
/*if(!GetIsObjectValid(GetMaster(oPC)))
{*/
int nType;
for(nType = 1; nType < 6; nType++)
{
int i = 1;
object oOldTest;
object oTest = GetAssociate(nType, oPC, i);
while(GetIsObjectValid(oTest) && oTest != oOldTest)
{
if(GetCurrentAction(oTest) != ACTION_REST)
AssignCommand(oTest, DelayCommand(0.01, PRCForceRest(oTest)));
i++;
oOldTest = oTest;
oTest = GetAssociate(nType, oPC, i);
}
}
//}
// New Spellbooks
DelayCommand(0.5, CheckNewSpellbooks(oPC));
// PnP spellschools
if(GetPRCSwitch(PRC_PNP_SPELL_SCHOOLS)
&& GetLevelByClass(CLASS_TYPE_WIZARD, oPC))
{
//need to put a check in to make sure the player
//memorized one spell of their specialized
//school for each spell level
//also need to remove spells of prohibited schools
}
//Reset potions brewed
DeleteLocalInt(oPC, "PRC_POTIONS_BREWED");
//Reset scry on familiar uses
DeleteLocalInt(oPC, "Scry_Familiar");
//for Touch of Vitality point resetting
ResetTouchOfVitality(oPC);
//Lahm's finger darts - recover lost fingers
SetPersistantLocalInt(oPC, "FINGERS_LEFT_HAND", 6);
SetPersistantLocalInt(oPC, "FINGERS_RIGHT_HAND", 6);
SetPersistantLocalInt(oPC, "LEFT_HAND_USELESS", FALSE);
SetPersistantLocalInt(oPC, "RIGHT_HAND_USELESS", FALSE);
//DelayCommand(6.0f, ExecuteScript("prc_trueappear", oPC));
//skip time forward if applicable
DelayCommand(0.4, AdvanceTimeForPlayer(oPC, HoursToSeconds(8)));
int nRest = GetPRCSwitch(PRC_PNP_REST_LIMIT);
if(nRest > 0 || nRest < 0)
{
int nDelay = nRest * GetHitDice(oPC);
if (nRest == -1) nDelay = 24;
else if (nRest == -2) nDelay = 16;
SetLocalInt(oPC, "RestTimer", TRUE);
DelayCommand(HoursToSeconds(nDelay), DeleteLocalInt(oPC, "RestTimer"));
DelayCommand(HoursToSeconds(nDelay), FloatingTextStringOnCreature("You may now rest again.", oPC, FALSE));
FloatingTextStringOnCreature("You may rest again in "+IntToString(nDelay)+" hours.", oPC, FALSE);
}
//ebonfowl: execute reserve feat update
if(GetLocalInt(oPC, "ReserveFeatsRunning") == TRUE)
{
DelayCommand(1.5, ExecuteScript("prc_reservefeat", oPC));
}
// Execute scripts hooked to this event for the player triggering it
ExecuteAllScriptsHookedToEvent(oPC, EVENT_ONPLAYERREST_FINISHED);
}
void RestStarted(object oPC)
{
if(DEBUG) DoDebug("prc_rest: Rest started for " + DebugObject2Str(oPC));
// Scrying cleanup
if (GetIsScrying(oPC))
{
object oCopy = GetLocalObject(oPC, "Scry_Copy");
DoScryEnd(oPC, oCopy);
}
int nRest = GetPRCSwitch(PRC_PNP_REST_LIMIT);
if(nRest > 0 || nRest < 0)
{
int nDelay = nRest * GetHitDice(oPC);
if (nRest == -1) nDelay = 24;
else if (nRest == -2) nDelay = 16;
if(GetLocalInt(oPC, "RestTimer"))
{
AssignCommand(oPC, ClearAllActions());
FloatingTextStringOnCreature("You may not rest yet. You may rest once every "+IntToString(nDelay)+" hours.", oPC, FALSE);
}
}
// Clean up Crown of Might
object oCrown = GetItemPossessedBy(oPC, "prc_crown_might");
if (GetIsObjectValid(oCrown)) DestroyObject(oCrown);
oCrown = GetItemPossessedBy(oPC, "prc_crown_prot");
if (GetIsObjectValid(oCrown)) DestroyObject(oCrown);
if (GetLevelByClass(CLASS_TYPE_DRUNKEN_MASTER, oPC)){
SetLocalInt(oPC, "DRUNKEN_MASTER_IS_IN_DRUNKEN_RAGE", 0);
SetLocalInt(oPC, "DRUNKEN_MASTER_IS_DRUNK_LIKE_A_DEMON", 0);
}
/* Left here in case the multisummon trick is ever broken. In that case, use this to make Astral Constructs get unsummoned properly
if(GetHasFeat(whatever feat determines if the PC can manifest Astral Construct here)){
int i = 1;
object oCheck = GetHenchman(oPC, i);
while(oCheck != OBJECT_INVALID){
if(GetStringLeft(GetTag(oCheck), 14) == "psi_astral_con")
DoDespawn(oCheck);
i++;
oCheck = GetHenchman(oPC, i);
}
}
*/
if (GetIsPC(oPC)) SetLocalInt(oPC, "PnP_Rest_InitialHP", GetCurrentHitPoints(oPC));
SetLocalInt(oPC, "PnP_Rest_InitialMax", GetMaxHitPoints(oPC));
if(DEBUG) DoDebug("prc_rest: HPs for " + DebugObject2Str(oPC)+"n/n/"+" nCurrent: "+IntToString(GetCurrentHitPoints(oPC))+" nMax: "+IntToString(GetMaxHitPoints(oPC)));
// Remove Psionic Focus
if(GetIsPsionicallyFocused(oPC))
{
LosePsionicFocus(oPC);
}
DeleteLocalInt(oPC, PRC_SPELL_CHARGE_COUNT);
DeleteLocalInt(oPC, PRC_SPELL_CHARGE_SPELLID);
DeleteLocalObject(oPC, PRC_SPELL_CONC_TARGET);
if(GetLocalInt(oPC, PRC_SPELL_HOLD)) FloatingTextStringOnCreature("*Normal Casting*", oPC);
DeleteLocalInt(oPC, PRC_SPELL_HOLD);
DeleteLocalInt(oPC, PRC_SPELL_METAMAGIC);
DeleteLocalManifestation(oPC, PRC_POWER_HOLD_MANIFESTATION);
DeleteLocalMystery(oPC, "MYST_HOLD_MYST");
// run the prereq check here
ExecuteScript("prc_prereq", oPC);
// Execute scripts hooked to this event for the player triggering it
ExecuteAllScriptsHookedToEvent(oPC, EVENT_ONPLAYERREST_STARTED);
}
void main()
{
object oPC = GetLastBeingRested();
if(DEBUG) DoDebug("prc_rest: Running for " + DebugObject2Str(oPC));
if(DEBUG) DoDebug("prc_rest Void Main: HPs for " + DebugObject2Str(oPC) +" nCurrent: "+IntToString(GetCurrentHitPoints(oPC)));
// return here for DMs as they don't need all this stuff
if(GetIsDM(oPC))
return;
//rest kits
if(GetPRCSwitch(PRC_SUPPLY_BASED_REST))
ExecuteScript("sbr_onrest", OBJECT_SELF);
// Handle the PRCForceRest() wrapper
if(GetLocalInt(oPC, "PRC_ForceRested"))
{
if(DEBUG) DoDebug("prc_rest: Handling forced rest");
RestStarted(oPC);
// A minor delay to break the script association and to lessen TMI chances
DelayCommand(0.5f, RestFinished(oPC));
// Clear the flag
DeleteLocalInt(oPC, "PRC_ForceRested");
}
else
{
switch(MyGetLastRestEventType()){
case REST_EVENTTYPE_REST_CANCELLED:{
RestCancelled(oPC);
break;
}
case REST_EVENTTYPE_REST_STARTED:{
RestStarted(oPC);
break;
}
case REST_EVENTTYPE_REST_FINISHED:{
RestFinished(oPC);
break;
}
case REST_EVENTTYPE_REST_INVALID:{
break;
}
}
}
}

View File

@ -0,0 +1,51 @@
//File name: zep_inc_scrptdlg
//Author: Loki Hakanin
//Usage/Explanation:
// This include file is intended for use with the NWN CEP.
// This is an index of the cep.tlk file dialogue TLK file
// offsets for the various strings of text that are
// sent to the player, DMs, etc, during the execution
// of various CEP scripts.
//const int nZEPScriptTLKOffset = 16818216;
//Traps
const int nZEPPitJump = (16818226); //df_t0_camopita.nss: SendMessageToPC(oPC,"You jump to the side and =avoid falling into the pit");
const int nZEPPitFall = (16818227); //df_t0_camopita.nss: SendMessageToPC(oPC,"You fall into the =pit!");
const int nZEPPitClimb = (16818228); //df_t0_camopita.nss: DelayCommand(30.0,SendMessageToPC(oPC,"You finally climb out of the =pit"));
const int nZEPDrowning = (16818231); //trap_fire.nss: AssignCommand(oPC,SpeakString("Blub! =Glug!"));
const int nZEPTrapFind = (16818234); //trap_on_acquire.nss: SendMessageToPC(oPC,"Nearest Trap: ="+GetName(GetNearestTrapToObject(oPC)));
const int nZEPTrapSearch1 = (16818235); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap));
const int nZEPTrapSearch2= (16818236); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap));
const int nZEPTrapSearch3 = (16818237); //trap_on_load.nss: PrintString("In "+sTag+" Checking for: ="+IntToString(nID)+", found: "+GetTag(oTrap));
const int nZEPTrapReset = (16818238); //trap_reset.nss: SendMessageToPC(oPC,"The lever clicks into its new =postion");
//Item Properties
const int nZEPGenderRestTXT = (16818246); //zep_inc_main.nss: SendMessageToPC(oPC,"You cannot equip that =item due to gender differences.");
//Doors
const int nZEPDoorLocked = (16818256); //zep_openclose.nss: SpeakString("Locked");
//Demilich Scripts
const int nZEPReturnToLife = (16818266); //zep_demi_dest.nss: SendMessageToPC(oVictimCounter,"You feel =disoriented momentarily as your soul returns to its mortal coil.");
const int nZEPCacklingLaugh = (16818267); //zep_demi_onspell.nss: =DelayCommand(6.0,SpeakString("Hahhahaha....",TALKVOLUME_SHOUT));
const int nZEPCantBeRaised = (16818268); //zep_inc_demi.nss:const string ZEP_DEMI_RESLAY_MSG =3D " jerks upright =and spasms for a few moments before collapsing again.";
const int nZEPNoRaiseExplan = (16818269); //zep_inc_demi.nss:const string ZEP_DEMI_RESLAY_MSG2 =3D "Until the =demilich's captive souls are freed, its victims cannot be raised.";
const int nZEPDemiRestored = (16818270); //zep_inc_demi.nss:const string ZEP_DEMI_REGEN_MSG =3D "At last, I am =restored...";
const int nZEPDemiDisturbed = (16818271); //zep_inc_demi.nss:const string ZEP_DEMI_DIST_MSG =3D "You disturb my =work!";
const int nZEPDemiHavePower = (16818272); //zep_inc_demi.nss:const string ZEP_DEMI_ONSPELL_MSG =3D "Yes, I sense you =have power...your potential shall be mine!";
const int nZEPDemiVictFree = (16818273); //zep_inc_demi.nss:const string ZEP_DEMI_FINAL_DEST =3D "With the demilich =destroyed, the souls of its victims are released to their bodies.";
//Marilith Scripts
const int nZEPMarilithDMG = (16818286); //zep_marilith_end.nss: SendMessageToPC(oTarget, "You were hit for ="+IntToString(nDamage));
//Rust monster scripts
const int nZEPRustMonBrush = (16818296); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"The Rust Monster's =antennae brush against your "+sItem );
const int nZEPRustButResist1 = (16818297); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"But the "+sItem+" =resists the rust effects!");
const int nZEPRustButResist2 = (16818298); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"But the "+sItem+" =resists the rust effects!");
const int nZEPRustAndDest = (16818299); //zep_rust_cmb_end.nss: SendMessageToPC(oPC,"And destroys your ="+sItem+"!");
const int nZEPRustYourTXT = (16818300); //zep_rust_dmg.nss: "Your "
const int nZEPRustWeapRes = (16818301); //zep_rust_dmg.nss: SendMessageToPC(oPC,"Your "+sWeapon+" =resists the rust effects.");
const int nZEPRustWeapDest = (16818302); //zep_rust_dmg.nss: SendMessageToPC(oPC,"Your "+sWeapon+" =damages the monster, but is destroyed in the process!");
const int nZEPFoundSecret = (16818316); //zep_sarcof1use.nss: "You have discovered a secret passage!"

View File

@ -2,7 +2,7 @@
"__data_type": "UTC ",
"Appearance_Head": {
"type": "byte",
"value": 16
"value": 142
},
"Appearance_Type": {
"type": "word",
@ -90,7 +90,7 @@
},
"ChallengeRating": {
"type": "float",
"value": 46.0
"value": 30.0
},
"ClassList": {
"type": "list",
@ -121,7 +121,7 @@
},
"Color_Hair": {
"type": "byte",
"value": 53
"value": 127
},
"Color_Skin": {
"type": "byte",
@ -129,11 +129,11 @@
},
"Color_Tattoo1": {
"type": "byte",
"value": 52
"value": 136
},
"Color_Tattoo2": {
"type": "byte",
"value": 37
"value": 49
},
"Comment": {
"type": "cexostring",
@ -149,7 +149,7 @@
},
"CRAdjust": {
"type": "int",
"value": -72
"value": -92
},
"CurrentHitPoints": {
"type": "short",
@ -1224,7 +1224,7 @@
},
"xAppearance_Head": {
"type": "word",
"value": 16
"value": 142
},
"xArmorPart_RFoot": {
"type": "word",

View File

@ -90,7 +90,7 @@
},
"ChallengeRating": {
"type": "float",
"value": 40.0
"value": 39.0
},
"ClassList": {
"type": "list",
@ -149,7 +149,7 @@
},
"CRAdjust": {
"type": "int",
"value": -37
"value": -36
},
"CurrentHitPoints": {
"type": "short",

View File

@ -90,7 +90,7 @@
},
"ChallengeRating": {
"type": "float",
"value": 40.0
"value": 45.0
},
"ClassList": {
"type": "list",
@ -149,7 +149,7 @@
},
"CRAdjust": {
"type": "int",
"value": -60
"value": -53
},
"CurrentHitPoints": {
"type": "short",

View File

@ -14,11 +14,11 @@
},
"ArmorPart_LFArm": {
"type": "byte",
"value": 17
"value": 4
},
"ArmorPart_LFoot": {
"type": "byte",
"value": 10
"value": 3
},
"ArmorPart_LHand": {
"type": "byte",
@ -30,7 +30,7 @@
},
"ArmorPart_LShoul": {
"type": "byte",
"value": 8
"value": 24
},
"ArmorPart_LThigh": {
"type": "byte",
@ -38,11 +38,11 @@
},
"ArmorPart_Neck": {
"type": "byte",
"value": 4
"value": 2
},
"ArmorPart_Pelvis": {
"type": "byte",
"value": 27
"value": 36
},
"ArmorPart_RBicep": {
"type": "byte",
@ -50,11 +50,11 @@
},
"ArmorPart_RFArm": {
"type": "byte",
"value": 17
"value": 4
},
"ArmorPart_RFoot": {
"type": "byte",
"value": 10
"value": 3
},
"ArmorPart_RHand": {
"type": "byte",
@ -70,7 +70,7 @@
},
"ArmorPart_RShoul": {
"type": "byte",
"value": 8
"value": 24
},
"ArmorPart_RThigh": {
"type": "byte",
@ -90,11 +90,11 @@
},
"Cloth1Color": {
"type": "byte",
"value": 63
"value": 170
},
"Cloth2Color": {
"type": "byte",
"value": 52
"value": 170
},
"Comment": {
"type": "cexostring",
@ -126,11 +126,11 @@
},
"Leather1Color": {
"type": "byte",
"value": 63
"value": 79
},
"Leather2Color": {
"type": "byte",
"value": 52
"value": 170
},
"LocalizedName": {
"type": "cexolocstring",
@ -140,11 +140,11 @@
},
"Metal1Color": {
"type": "byte",
"value": 63
"value": 79
},
"Metal2Color": {
"type": "byte",
"value": 28
"value": 170
},
"PaletteID": {
"type": "byte",
@ -435,37 +435,6 @@
"type": "word",
"value": 0
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 63
},
"Subtype": {
"type": "word",
"value": 8
}
}
]
},
@ -495,11 +464,11 @@
},
"xArmorPart_LFArm": {
"type": "word",
"value": 17
"value": 4
},
"xArmorPart_LFoot": {
"type": "word",
"value": 10
"value": 3
},
"xArmorPart_LHand": {
"type": "word",
@ -511,7 +480,7 @@
},
"xArmorPart_LShou": {
"type": "word",
"value": 8
"value": 24
},
"xArmorPart_LThig": {
"type": "word",
@ -519,11 +488,11 @@
},
"xArmorPart_Neck": {
"type": "word",
"value": 4
"value": 2
},
"xArmorPart_Pelvi": {
"type": "word",
"value": 27
"value": 36
},
"xArmorPart_RBice": {
"type": "word",
@ -531,11 +500,11 @@
},
"xArmorPart_RFArm": {
"type": "word",
"value": 17
"value": 4
},
"xArmorPart_RFoot": {
"type": "word",
"value": 10
"value": 3
},
"xArmorPart_RHand": {
"type": "word",
@ -551,7 +520,7 @@
},
"xArmorPart_RShou": {
"type": "word",
"value": 8
"value": 24
},
"xArmorPart_RThig": {
"type": "word",

View File

@ -102,7 +102,7 @@
},
"Cost": {
"type": "dword",
"value": 3505547
"value": 3312926
},
"Cursed": {
"type": "byte",
@ -326,7 +326,7 @@
},
"CostValue": {
"type": "word",
"value": 3
"value": 2
},
"Param1": {
"type": "byte",
@ -357,7 +357,7 @@
},
"CostValue": {
"type": "word",
"value": 3
"value": 2
},
"Param1": {
"type": "byte",
@ -388,7 +388,7 @@
},
"CostValue": {
"type": "word",
"value": 3
"value": 2
},
"Param1": {
"type": "byte",
@ -419,7 +419,7 @@
},
"CostValue": {
"type": "word",
"value": 3
"value": 2
},
"Param1": {
"type": "byte",
@ -450,7 +450,7 @@
},
"CostValue": {
"type": "word",
"value": 3
"value": 2
},
"Param1": {
"type": "byte",

View File

@ -103,7 +103,7 @@
},
"CostValue": {
"type": "word",
"value": 5
"value": 3
},
"Param1": {
"type": "byte",
@ -134,7 +134,7 @@
},
"CostValue": {
"type": "word",
"value": 7
"value": 3
},
"Param1": {
"type": "byte",
@ -153,37 +153,6 @@
"value": 2
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 75
},
"Subtype": {
"type": "word",
"value": 0
}
},
{
"__struct_id": 0,
"ChanceAppear": {
@ -196,7 +165,7 @@
},
"CostValue": {
"type": "word",
"value": 7
"value": 4
},
"Param1": {
"type": "byte",
@ -215,37 +184,6 @@
"value": 10
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 37
},
"Subtype": {
"type": "word",
"value": 4
}
},
{
"__struct_id": 0,
"ChanceAppear": {
@ -277,68 +215,6 @@
"value": 5
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 37
},
"Subtype": {
"type": "word",
"value": 6
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 37
},
"Subtype": {
"type": "word",
"value": 1
}
},
{
"__struct_id": 0,
"ChanceAppear": {
@ -370,68 +246,6 @@
"value": 2
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 255
},
"PropertyName": {
"type": "word",
"value": 37
},
"Subtype": {
"type": "word",
"value": 7
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 37
},
"Subtype": {
"type": "word",
"value": 3
}
},
{
"__struct_id": 0,
"ChanceAppear": {
@ -462,37 +276,6 @@
"type": "word",
"value": 0
}
},
{
"__struct_id": 0,
"ChanceAppear": {
"type": "byte",
"value": 100
},
"CostTable": {
"type": "byte",
"value": 0
},
"CostValue": {
"type": "word",
"value": 0
},
"Param1": {
"type": "byte",
"value": 255
},
"Param1Value": {
"type": "byte",
"value": 0
},
"PropertyName": {
"type": "word",
"value": 71
},
"Subtype": {
"type": "word",
"value": 0
}
}
]
},

Binary file not shown.