Random Traps on Ground
#1
Posté 19 juillet 2012 - 09:27
Any ideas?
#2
Posté 19 juillet 2012 - 09:46
#3
Posté 19 juillet 2012 - 09:56
It worked fine for me, at both 10 and 15. What method are you using to create the trap?void main()
{
object oTrap = CreateTrapAtLocation (TRAP_BASE_TYPE_AVERAGE_ACID, GetLocation (GetObjectByTag ("TARGET")));
SetTrapDisarmDC (oTrap, 10);
SpeakString (IntToString (GetTrapDisarmDC (oTrap)));
}
#4
Posté 19 juillet 2012 - 10:24
It seems to work as FB says though no object exists which the trap is on as the description states.
It's useful since you can vary the traps and the dc this way.
Modifié par ffbj, 19 juillet 2012 - 10:55 .
#5
Posté 19 juillet 2012 - 11:42
#6
Posté 20 juillet 2012 - 01:23
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (GetLocalInt(OBJECT_SELF,"TRAPS")== 1) return;
SetLocalInt(OBJECT_SELF,"TRAPS",1);
object oTarget = GetNearestObjectByTag("WP_TRAP" + IntToString(d4()));
location lLocation = GetLocation(oTarget);
float fSize;
int nTrapType;
switch(Random(8))
{
case 0: fSize = 1.0f; break;
case 1: fSize = 1.25f; break;
case 2: fSize = 1.75f; break;
case 3: fSize = 1.00f; break;
case 4: fSize = 1.25f; break;
case 5: fSize = 1.50f; break;
case 6: fSize = 1.75f; break;
case 7: fSize = 2.0f; break;
}
switch(Random(6))
{
case 0: nTrapType = TRAP_BASE_TYPE_MINOR_ACID_SPLASH; break;
case 1: nTrapType = TRAP_BASE_TYPE_MINOR_FROST; break;
case 2: nTrapType = TRAP_BASE_TYPE_MINOR_HOLY; break;
case 3: nTrapType = TRAP_BASE_TYPE_MINOR_NEGATIVE; break;
case 4: nTrapType = TRAP_BASE_TYPE_MINOR_SPIKE; break;
case 5: nTrapType = TRAP_BASE_TYPE_MINOR_TANGLE; break;
}
object oTrap = CreateTrapAtLocation(nTrapType, lLocation, fSize,"", STANDARD_FACTION_HOSTILE, "", "");
SetTrapDetectDC(oTrap, 6+d6());
SetTrapDisarmDC(oTrap, 12+d12());
}
Modifié par kalbaern, 20 juillet 2012 - 01:23 .
#7
Posté 20 juillet 2012 - 01:38
Modifié par ShadowM, 20 juillet 2012 - 01:39 .
#8
Posté 21 juillet 2012 - 02:13
Specifically I use npc's to set traps, with met conditionals, causing the create trap script to fire.
Each trapper, usually scout will sometimes set a trap after a fight where the PC has fled the area, or the scout has simply lost contact with them. Then the scout/npc will wander around dropping kits, on the ground. Next I take the location of the kit to create the trap trigger and then destroy the kit. In this way you can vary the number of traps that are set, and not use predetermined wp's as their set location. So I might give 3-5 traps to a midlevel scout, for instance.





Retour en haut







