Jump to content

Solved! How does one destroy an item held by any party member?


BCaesar

Recommended Posts

Hello all,

Is there a single command to destroy an item held by any party member or to destroy all items of that type held by any party members? As long as I have an NPC present I can use TakePartyItem or TakePartyItemAll, but that requires me to have an NPC present. Is there any way to do that when my party members are alone or if I don't want any NPC to end up with the items?

 

I've been making it work by scripting Player1 to TakePartyItem (which seems to do nothing if Player1 already has that item, which is good) and then scripting Player1 to DestroyItem, but that's two commands to destroy a single item, which is far less convenient then something like TakePartyItemAll.

 

Any suggestions? I suppose I could create an invisible NPC right next to player one and then have them TakePartyItemAll but that's rather convoluted.

 

Thanks.

 

 

Solution: Use TakePartyItem or TakePartyItemAll in baldur.bcs or an area script (without having a particular NPC take it). The item just vanishes as if it's destroyed.

Link to comment

No NPC doing it - Not Player1 doing it - No invisible creature doing it?

 

You can use a container that destroys those items when put into it, but that requires the action to put said items into the container. (Container can be any immobile chest etc but also some bag to be carried by a party member).

 

Still, there is nothing wrong with your option to let someone (e.g. PC) do the two action TakePartyItem + DestroyItem.

Link to comment

TakePartyItemAll means all items of the same name are taken from the party, so if you use this in a party member's script you'd still have to do DestroyItem.

To your question: have a look at how drow items are destroyed after leaving the Underdark (area bcs and script blocks for Player1-6) or how items are transferred to chests in bd0103.BCS (I think that's the one in SoD). In this script I think the chest is taking the items and you can easily let them destroy then, too.

Link to comment
I can suggest, if you got SoD or later, to mod.


280 DestroyAllFragileEquipment(I:Type*ITEMFLAG)


There are free, moddable itemflags, in SoD.

So, theoretically, your mod could mark one or two items as 'adamantite', ' glass', etc. Then at special places, destroy all of the flagged items in one go.
Link to comment

I didn't realize I could just say TakePartyItem in an area script or in Baldur.bcs and it just vanishes. So I did that and it works.I'm working on a script so you can stake Hexxat and then add a dead Clara to your party.

 

The bag in this case is Dragomir's Respite. The way the game is made after she gives it to you she then turns into mist and goes into the casket inside the bag and the casket transforms into a casket containing Hexxat. Then she regenerates. I wanted to do it and have it work regardless.

 

I now have a working system. If you kill Hexxat she ends up in her coffin. When you have a stake you can finish her and Clara's added. I've tested it if you kill Hexxat when you first meet (both having a stake and not), if you add Hexxat to your party then kill and remove her before she gives you her bag (both having a stake and not), and if you add Hexxat to your party and wait for her to give you her bag and then kill her and remove her (both having a stake and not) and everything works!

 

I'm not actually done though because you could kill her but then she could regenerate before you find a stake so I need to do something for that. And there's some other variables if you're trying to break the game that can make it not work (for example removing Hexxat from your party during that minute before she gives you the bag and then killing her before she talks to you and leaves will cause her to turn to mist and escape area and the bag doesn't drop, so I might need to do something for that.) But this is a good start.

 

Here's the code:

IF	//Script to create the bag if Hexxat dies.
	StateCheck("hexxat",STATE_DEAD)
	!Exists("OHHBAG")
	!PartyHasItem("OHHBAG")
	Global("_bHexxatBag","GLOBAL",0)
	!InPartyAllowDead("hexxat")
	!Global("OHH_dragorespite","GLOBAL",3)
THEN
	RESPONSE #100
	GiveItemCreate("OHHBAG","hexxat",0,0,0)
	ActionOverride("hexxat",DropInventory())
	SetGlobal("_bHexxatBag","GLOBAL",1)
	SetGlobal("OHH_dragorespite","GLOBAL",3)
	ActionOverride(Player1,DisplayStringNoNameHead(Player1,@1)) /*You defeat the vampire, but she transforms into mist and quickly disappears. All that remains where she stood is an old sack.*/
END


IF	//Script to put Hexxat inside the casket when she dies if she didn't yet give it to you.
	PartyHasItem("OHHBAG")
	StateCheck("hexxat",STATE_DEAD)
	OR(2)
		Global("_bHexxatBag","GLOBAL",0)
		Global("_bHexxatBag","GLOBAL",1)
	Global("_bHexxatDeadCasketTransform","GLOBAL",0)
THEN
	RESPONSE #100
	ActionOverride(Player1,TakePartyItem("OHHBAG"))
	ActionOverride(Player1,TransformItem("ohhcask","ohhcask2"))
	SetGlobal("_bHexxatDeadCasketTransform","GLOBAL",1)
END


IF	//If you have the bag and hexxat is dead, but you don't have a stake.
	OR(2)
		PartyHasItem("OHHBAG")
		Exists("OHHBAG")
	!InPartyAllowDead("hexxat")
	Dead("hexxat")
	OR(2)
		Global("_bHexxatBag","GLOBAL",0)
		Global("_bHexxatBag","GLOBAL",1)
	!PartyHasItem("MISC6W")
THEN
	RESPONSE #100
	SetGlobal("_bHexxatBag","GLOBAL",2)
	ActionOverride(Player1,DisplayStringNoNameHead(Player1,@2)) /*The vampire is regenerating in her casket inside the old sack. If you had a stake you could end her life forever.*/
END


IF	//If you have the bag and hexxat is dead, and you have a stake.
	PartyHasItem("OHHBAG")
	!InPartyAllowDead("hexxat")
	Dead("hexxat")
	OR(3)
		Global("_bHexxatBag","GLOBAL",0)
		Global("_bHexxatBag","GLOBAL",1)
		Global("_bHexxatBag","GLOBAL",2)
	PartyHasItem("MISC6W")
THEN
	RESPONSE #100
	SetGlobal("_bHexxatBag","GLOBAL",3)
	ActionOverride(Player1,DisplayStringNoNameHead(Player1,@3)) /*You drive a stake through the vampire's heart ending her existence. With the vampire destroyed, her victim can be raised.*/
	TakePartyItem("MISC6W")
	ActionOverride(Player1,TakePartyItem("OHHBAG"))
	ActionOverride(Player1,TransformItem("ohhcask2","ohhcask"))
	AddexperienceParty(12000)
	AddJournalEntry(@4,USER) /*Dragomir's Tomb was a trap. The one I knew as Hexxat was a thrall under the control of a vampire, one who wished to speak with me. But I do not treat with monsters. I have killed the vampire and freed this girl's soul. Hopefully she will be better at making conversation now.*/
	SetGlobal("_bClaraLives","GLOBAL",1)
END
	

IF	//Script to add Clara to your party.
	Dead("hexxat")
	Global("_bClaraLives","GLOBAL",1)
	!InPartyAllowDead("hexxat")
THEN
	RESPONSE #100
	SetGlobal("_bClaraLives","GLOBAL",2)
	CreateCreature("_bClara",[-1.-1],N)
	ActionOverride("_bClara",JoinParty())
END


IF	//Bug fix for killing OHHFAK if Hexxat doesn't.
	Global("OHH_hexxat","OH7000",3)
	!Dead("OHHFAK")
THEN
	RESPONSE #100
	Kill("OHHFAK")
END

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...