Can someone make an on spawn script where the npc spawns laying down and near death? Thank you.
NPC Spawns Unconscious and Near Death
Débuté par
Souldry
, juin 29 2011 12:40
#1
Posté 29 juin 2011 - 12:40
#2
Posté 29 juin 2011 - 05:43
void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
AssignCommand(oRespawner, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10000.00));
}
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
AssignCommand(oRespawner, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10000.00));
}
#3
Posté 29 juin 2011 - 09:17
EffectResurrection only works if the creature is dead, and killing it first might launch some unwanted OnDeath scripts. Also, GetLastRespawnButtonPresser only works in module 'on pc death' script for players who actually press the respawn button on the death gui
void main()
{
object oNPC = OBJECT_SELF;
ApplyEffectToObject(DURATION_TYPE_INSTANT, SupernaturalEffect(EffectDamage(GetCurrentHitPoints(oNPC)-1)), oNPC);
AssignCommand(oNPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10000.00));
}
#4
Posté 29 juin 2011 - 10:08
Doh...it's just me trying to do things while sleepy and not paying attention. I was thinking PC instead of NPC when I first read it. Yeah..Xardex's script is what you want for NPC. Sorry bout that.
Modifié par GhostOfGod, 29 juin 2011 - 10:10 .
#5
Posté 30 juin 2011 - 04:27
Is there any way the script could allow the NPC to stay laying down after the PC clicks on him? I've noticed he stands back up when clicked.
#6
Posté 30 juin 2011 - 09:04
In that case you want to add this line in your NPC's script:
SetCommandable(FALSE);
SetCommandable(FALSE);
#7
Posté 30 juin 2011 - 09:05
Or modify their OnConversation script to have them lie back down again AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10000.00));
This also works if you want a sitting NPC to remain sitting for the duration of the conversation without them hopping back up when you click on them.
This also works if you want a sitting NPC to remain sitting for the duration of the conversation without them hopping back up when you click on them.
#8
Posté 02 juillet 2011 - 03:11
Thanks guys good help here
#9
Posté 04 juillet 2011 - 08:33
In that case you want to add this line in your NPC's script:
SetCommandable(FALSE);
Exactly where do I put this? In the OnSpawn-script?





Retour en haut






