mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
/**********************************************************************
|
|
|
|
*
|
|
* Title: mouse_droid
|
|
* Description: Gimps Marksman Trainers mouse droids to do little to no damage
|
|
|
|
**********************************************************************/
|
|
|
|
//Includes
|
|
include library.ai_lib;
|
|
include library.create;
|
|
include library.corpse;
|
|
include library.utils;
|
|
include library.weapons;
|
|
|
|
|
|
//Triggers
|
|
trigger OnInitialize()
|
|
{
|
|
obj_id weapon = aiGetPrimaryWeapon(self);
|
|
//ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
setWeaponMinDamage(weapon, 0);
|
|
setWeaponMaxDamage(weapon, 1);
|
|
weapons.setWeaponData(weapon);
|
|
setRegenRate(self, HEALTH, 3);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach()
|
|
{
|
|
obj_id weapon = aiGetPrimaryWeapon(self);
|
|
//ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
setWeaponMinDamage(weapon, 0);
|
|
setWeaponMaxDamage(weapon, 1);
|
|
weapons.setWeaponData(weapon);
|
|
setRegenRate(self, HEALTH, 3);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated(obj_id killer)
|
|
{
|
|
kill(self);
|
|
playClientEffectObj(killer, "clienteffect/npe_training_droid_explode.cef", self, "");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnDeath(obj_id killer, obj_id corpseId)
|
|
{
|
|
//debugSpeakMsg(self, "look I died");
|
|
messageTo(self, "cleanUpSelf", null, 5, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnHateTargetChanged(obj_id target)
|
|
{
|
|
removeHateTarget(self, target);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
messageHandler cleanUpSelf()
|
|
{
|
|
location myLoc = getLocation(self);
|
|
if(!utils.hasScriptVar(self, "npe.hasDied"))
|
|
{
|
|
create.object("npe_training_droid", myLoc, false);
|
|
utils.setScriptVar(self, "npe.hasDied", true);
|
|
}
|
|
destroyObject(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|