Aller au contenu

Photo

Start conversation when enemy defeated


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

#1
kamal_

kamal_
  • Members
  • 5 238 messages

I really should be able to figure this out, but what I want is when the player defeats a boss enemy in combat (defeated meaning <0 hp and no nearby allies of the boss alive), the boss changes to a neutral faction and speaks to the pc.



#2
Tchos

Tchos
  • Members
  • 5 030 messages

Several ways to do it.  One way is to first turn on the "immortal" property for the NPC.  The NPC will lose health when hit, but can't reach less than 0 as you specify -- it can only reach 0 and remain at 0 until the immortal property is turned off.  Then have a script check the NPC's HP, and switch the faction, end combat, and initiate conversation.  You can put the script in On Damaged, or other places.

 

I put the script in the On User Defined slot, using the On End Combat Round event signal.  I first used the SurrenderAllToEnemies() function from "x0_i0_partywide", and then switched the faction to Commoner, healed the NPC, and fired a conversation using CreateIPSpeaker().



#3
kamal_

kamal_
  • Members
  • 5 238 messages

It helps when I put my scripts in the onDamaged instead of onDeath... Doh! :wacko:



#4
Shallina

Shallina
  • Members
  • 1 011 messages

script on on death, and dont forget to use "surrender to ennemies" on what ever it sspelled.

 

Also if the object is destroyed it can' t execute script. On on death it 's better to call an ExecuteScript on module or the area on the on death event especially if you make use of  a Delay. You execute the script on the module, and put the delay inside that script.



#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
The standard heartbeat script gb_surrender_hb can also be used on the boss.
  • GCoyote aime ceci