Aller au contenu

Photo

NPC Spawns Unconscious and Near Death


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Souldry

Souldry
  • Members
  • 8 messages
Can someone make an on spawn script where the npc spawns laying down and near death? Thank you.

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
void main()
{
    object oRespawner = GetLastRespawnButtonPresser();
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
    AssignCommand(oRespawner, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 10000.00));
}

#3
Xardex

Xardex
  • Members
  • 217 messages
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
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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.:whistle:

Modifié par GhostOfGod, 29 juin 2011 - 10:10 .


#5
Souldry

Souldry
  • Members
  • 8 messages
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
Snarkblat

Snarkblat
  • Members
  • 52 messages
In that case you want to add this line in your NPC's script:

SetCommandable(FALSE);

#7
Snarkblat

Snarkblat
  • Members
  • 52 messages
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.

#8
Souldry

Souldry
  • Members
  • 8 messages
Thanks guys good help here

#9
Green_Dragon123

Green_Dragon123
  • Members
  • 11 messages

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?