Hello all,
I seem to miss something within the NWN-system:
I have a (working) script, which teleports the PC, who delt the killing strike to the creature, to a certain waypoint.
EDIT (added code):
So, this goes into the OnDeath of a monster:
void main()
{
// Control-FX
object oCreature = OBJECT_SELF;
effect eHealVis = EffectVisualEffect(VFX_IMP_RESTORATION_GREATER);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCreature);
// The teleportation
object oPC = GetLastKiller();
location lTarget;
object oTarget;
oTarget = GetWaypointByTag("WP_Arrive_PortTest" );
lTarget = GetLocation(oTarget);
AssignCommand(oPC, ClearAllActions());
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
}
My test victim is goblin with HPs set to 1.
It works nicely, as long as the damage delt is 11 or less. (In the case of my test monster, one hit is enough). As soon as the delt damage is higher, the script does fire (added some control things like an effect), but the teleport does not happen.
Edit 2: It's probably the number of negative HPs: 0 to -10, the script works, -11 HPs and lower, the teleport is not done.
Is there an explanation to this?
Is there a workaround for this?
Thanks.
Modifié par TheOneBlackRider, 20 février 2014 - 08:07 .