 |
 |  |
NWN SCRIPTS- Jump to comments -
| Title | If the PC escapes, the melee enemy uses ranged | | Author | Uther1978 | | Submitted / Updated | 10-06-2010 / 04-03-2011 | | Category | Area | | Expansions | HOTU-1.69 | | Format | Module Only | | Type | Type - Combat | | Description | If the PC escapes, the melee weaponed enemy npc uses ranged weapons without losing the chase
Give a ranged weapon to the melee npc.
Put this code in his heartbeat:
#include "nw_i0_generic"
#include "x0_i0_position"
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION,
PERCEPTION_SEEN);
if (oPC != OBJECT_INVALID && GetIsEnemy(oPC))
if ((GetDistanceToObject(oPC) >= 3.0f) && (GetDistanceToObject(oPC) <= 8.0f))
{
ExecuteScript("distanceattack", OBJECT_SELF);
}
}
CREATE A FILE CALLED distanceattack WITHIN THIS CODE:
#include "x0_i0_position"
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION,
PERCEPTION_SEEN);
ClearAllActions(TRUE);
ActionEquipMostDamagingRanged();
ActionAttack(oPC);
DelayCommand(1.0, ActionEquipMostDamagingMelee());
}
|  |
Files| Name | Type | Size | Downloads | NO FILES |
|
|
|
Posted by uther1978 at 2011-04-03 10:49:18 Voted 10.00 on 04/03/11
| | I voted for myself lol |
Posted by uther1978 at 2010-10-08 11:15:53 Voted 10.00 on 04/03/11
| | No problem, man! ;) |
Posted by driller at 2010-10-07 15:57:03 | Well, you are right. If the first condition is true it runs the second one. It just didn't look right at first glance. Sorry.
_________________________ Blackstone Keep PW |
Posted by uther1978 at 2010-10-07 08:10:03 Voted 10.00 on 04/03/11
| | Are you sure? The script compile correctly. |
Posted by driller at 2010-10-07 06:52:31 | Just a fyi.
Your missing a { after:
if (oPC != OBJECT_INVALID && GetIsEnemy(oPC))
-driller _________________________ Blackstone Keep PW |
You must be Logged In to post comments in this section.
|
|
|