Jump to content


Photo

The vexation with Valygars


3 replies to this topic

#1 Wisp

Wisp
  • Modders
  • 1108 posts
  • Gender:Male

Posted 23 July 2012 - 11:41 AM

Originally from here.
When Valygar dies irreversibly he jettisons his body, so you can still open the sphere. Problem is, he does it when he is imprisoned as well, even though that is reversible death. When you then free him, you have Valygar and his body.
Script:
IF
  Die()
  !InPartyAllowDead(Myself)
  !StateCheck(Myself,STATE_STONE_DEATH)
  OR(2)
	Allegiance(Myself,ENEMY)
	Allegiance(Myself,NEUTRAL)
  !Dead("Tolger")
  Global("DropValygar","GLOBAL",0)
THEN
  RESPONSE #100
	CreateItem("misc7l",0,0,0) // Valygar's Body
	SetGlobal("DropValygar","GLOBAL",1)
	DropInventory()
END

Since there is no STATE_IMPRISONED or equivalent, this problem strikes me as rather hard to fix. Does anyone else have any bright ideas, or is this one for the 'unfixable' pile?

#2 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 7097 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 24 July 2012 - 09:10 AM

ToBEX request?

Or is this perhaps a place where the scripting should be moved to dialog, where you have to actually murder him in order to gain the body - if he just

...wait -

what about a script addition that runs and looks for both Vaygar being alive and the body being present, and deletes the body if he is alive?

in Valygar's script -
IF
  Global("DropValygar","GLOBAL",1)
  !StateCheck(Myself,CD_STATE_NOTVALID)
  !Dead("Tolger")
  PartyHasItem("misc7l") // Valygar's Body
THEN
  RESPONSE #100
		TakePartyItem("misc7l") // Valygar's Body
		DestroyItem("misc7l")
		SetGlobal("DropValygar","GLOBAL",0)
END

Without referencing InParty, you get a hostile or kicked-out Vally stealing back his body, but It still has the loophole of the body showing up on the ground, though, if the party doesn't pick it up. Which argues for a baldur.bcs placement. Except I am not sure master scripts like that can actually take items and destroy them... and it gets more complicated if you start using the invisible creature shell game.

Edited by cmorgan, 24 July 2012 - 09:22 AM.

I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams

#3 Wisp

Wisp
  • Modders
  • 1108 posts
  • Gender:Male

Posted 17 August 2012 - 07:11 AM

Well, don't I feel stupid. He doesn't actually drop his body the moment he is imprisoned. He does it the moment he is freed, which makes the fix very simple:
COPY_EXISTING valygar.bcs override
  DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~\(Global("DropValygar","GLOBAL",0)\)~ ~Dead("Valygar") \1~
  END
BUT_ONLY

The result is that he only drops his body when Die() is true and his death var is set. But since Freedom clears his death var, he won't drop his body after being imprisoned.

#4 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 7097 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 17 August 2012 - 10:21 AM

Sweeeeet!
I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams



Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users