No I just have my own method. It just selects a trap to spawn from a list.
So npc's carry trap kits maybe 4-8 and then depending on conditionals, like have they been in combat, or wounded, or it's night, they will get into their trap dropping mode. I developed this method for spawning random placeables earlier and once traps came around adapted it to creating traps at the location of the dropped trap, which is then destroyed. So it actually looks like the npc is setting a trap, but it is all done through scripting. Then I will get the location of the object dropped and create a trap from a list at that spot.
I have mainly use that method for creating traps too, but nothing so in depth as you suggest.
For instance:
//:://////////////////////////////////////////////
//:: Created By: ffbj
//:: Created On: a long time ago
//Give the npc a bunch of traps, does not matter which kind. ffbj
//an executable caused to fire, usually on combatrdend when the npc has lost contact
//with the PC
void main()
{
object oTarget;
oTarget = OBJECT_SELF;
ClearAllActions(TRUE);//just want to drop stuff
object oInventory = GetFirstItemInInventory();
object oKit;
// Get if trap kit
if(GetBaseItemType(oInventory) == BASE_ITEM_TRAPKIT)
{
oKit = oInventory;
}
oInventory = GetNextItemInInventory();
// Check oKit
if(GetIsObjectValid(oKit))
{
ActionPutDownItem(oKit);//set it down
//mostly for ascetics so he looks like he is setting a trap, but also
//a method to limit of number of traps that can be lain.
location lLoc = GetLocation(OBJECT_SELF);
int iHD = GetHitDice(oTarget);
float fRange = 10.0;//make these numbers larger or smaller,
int nMaxInteger = 8;//to make the trapper go further
int nRandom = (nMaxInteger);
string sTag = "trap";
ActionMoveAwayFromObject(oKit, FALSE, fRange + nRandom);
DestroyObject(oKit, 2.0);//destroy the evidence
{
//Check which trap is chosen
switch(d4())
{
case 1:CreateTrapAtLocation (TRAP_BASE_TYPE_AVERAGE_ACID, lLoc, 4.0f, sTag, STANDARD_FACTION_HOSTILE);break;
case 2:CreateTrapAtLocation(TRAP_BASE_TYPE_AVERAGE_NEGATIVE, lLoc, 5.0f, sTag, STANDARD_FACTION_HOSTILE);break;
case 3:CreateTrapAtLocation(TRAP_BASE_TYPE_AVERAGE_FIRE, lLoc, 6.0f, sTag, STANDARD_FACTION_HOSTILE);break;
case 4:CreateTrapAtLocation(TRAP_BASE_TYPE_STRONG_FROST, lLoc, 7.0f, sTag, STANDARD_FACTION_HOSTILE);break;
}
object oTrap = GetObjectByTag(sTag);
SetTrapDetectDC(oTrap, iHD *2 + nRandom);
SetTrapDisarmDC (oTrap, iHD *2+ nRandom);
}
DelayCommand (2.0,ActionMoveAwayFromObject(oKit, TRUE, fRange + nRandom));
if ((d100() > 70 -iHD)&& (!GetIsInCombat(OBJECT_SELF)))
DelayCommand (10.0, ExecuteScript("_createtrap01", oTarget));
}
}
So the atual dc's are based on the trapsetter's level plus a random number.
For a while I had it on a while loop so say the guy had 5 traps he would drop them all in the same spot. A couple guys bought the farm that way, until I figured out what was happening.
Modifié par ffbj, 21 août 2012 - 03:44 .