Posted by: Zyraen
« on: December 13, 2005, 10:16:35 PM »
This is the code on Kiyone's BAF file. Similar Blocks are also present for Kova's BAF.
The first block describes a perma-death of sorts, where Kova "dies" and immediately leaves the party. This includes Imprisonment and Petrification though. This causes Kiyone to say something like "oh no." and leave.
The second block describes a normal death, but the party kicks Kova out. Conventionally, this means the NPC is not resurrectable in any way. This results in Kiyone giving <Charname> a middle finger for being an ass before leaving and taking Kova with her, presumably to try to resurrect him.
// If Kova dies and is kicked out
IF OR(5)
StateCheck("Kova",STATE_ACID_DEATH)
StateCheck("Kova",STATE_FLAME_DEATH)
StateCheck("Kova",STATE_EXPLODING_DEATH)
StateCheck("Kova",STATE_STONE_DEATH)
StateCheck("Kova",STATE_FROZEN_DEATH)
!InPartyAllowDead("Kova")
InParty(Myself)
Global("KKJoin", "GLOBAL", 1)
!Global("FindingKova", "GLOBAL", 250)
THEN
RESPONSE #100
StartDialog("KYCSPLAT", Player1)
END
IF Dead("Kova")
!StateCheck("Kova",STATE_ACID_DEATH)
!StateCheck("Kova",STATE_FLAME_DEATH)
!StateCheck("Kova",STATE_EXPLODING_DEATH)
!StateCheck("Kova",STATE_STONE_DEATH)
!StateCheck("Kova",STATE_FROZEN_DEATH)
!InPartyAllowDead("Kova")
Global("KKJoin", "GLOBAL", 1)
!Global("FindingKova", "GLOBAL", 250)
THEN
RESPONSE #100
StartDialog("KYCDEAD", Player1)
END
BTW, in "KYCDEAD", when Kova is dead, I need to execute ActionOverride("Kova", DestroySelf()) in the dialog, as when Player1 kicks a dead person out of the party, the body will appear beside Player1 (usually).
Kiyone, in her annoyance expressed in the "KYCDEAD" dialog, will speak of taking his body away to be revived, so I use the DestroySelf() command to make Kova's discarded body disappear.
Obviously, in "KYCSPLAT" it is not an issue as there Kova has no corpse left for her to deal with.
================
Further Notes - Kiyone joins the Party before Kova does, so I use the KKJoin Global to indicate if he has joined in the party. From the time that Kova joins the party, they become coded to be "inseparable".
For the standard party leaving Dialogue for Kiyone... (the following isn't the exact code i use, btw)
CHAIN
IF ~(blah)~ THEN Z#KIYOP ByePlayer1
~blah blah Bye <CHARNAME>!~
END
IF ~InParty("Kova")~ THEN EXTERN Z#KOVAJ ByePlayer1AfterKiyoSayBye
IF ~!Dead("Kova") !InParty("Kova") Global("KKJoin","GLOBAL",1) THEN EXTERN Z#KOVAP ByePlayer1AfterKiyoSayBye
IF ~Dead("Kova") InPartyAllowDead("Kova")~ THEN EXTERN Z#KIYOB KiyoNotLeavingWithKovaDead
The first option it is Z#KOVAJ and not Z#KOVAP, because I assume that the player reformed party and kicked only Kiyone out without taking him along.
The second option assumes the Player1 kicked them both out at the same time (so both switch to P files).
The third option checks that Kova is dead and in the party, and if so she simply refuses to leave. If you want her to leave and take Kova's dead body along, in place of
EXTERN Z#KIYOB KiyoNotLeavingWithKovaDead
use
DO ~ActionOverride("Kova", LeaveParty())
ActionOverride("Kova", DestroySelf())~ EXTERN KiyoTakeKovaBodyAway
Note there is a distinction between "ByePlayer1AfterKiyoSayBye" and "ByePlayer1". This prevents infinite loops (like Kiyone saying bye, then Kova saying bye, then Kiyone saying bye, then Kova saying bye) and so on and so forth. However if you can control it through globals and proper checks, then it's not an issue, you can use the same blocks. In my case, if I use a setting of "KKJoin" Global to control it, I can use the same DLG blocks.
===============
Remember for both of the above you must create the same for the other NPC (in this case, for Kova)