Jump to content


Photo

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


4 replies to this topic

#1 BCaesar

BCaesar
  • Members
  • 13 posts
  • Gender:Male

Posted 11 May 2017 - 10:43 PM

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.


Edited by BCaesar, 13 May 2017 - 07:55 PM.


#2 Roxanne

Roxanne
  • Modders
  • 1179 posts
  • Gender:Not Telling

Posted 11 May 2017 - 11:10 PM

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.


Edited by Roxanne, 11 May 2017 - 11:13 PM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 12 May 2017 - 01:39 AM

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.

Edited by jastey, 12 May 2017 - 01:39 AM.


#4 Avenger

Avenger
  • Modders
  • 3675 posts
  • Gender:Male
  • Location:Hungary

Posted 12 May 2017 - 11:32 PM

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.

Edited by Avenger, 12 May 2017 - 11:33 PM.


#5 BCaesar

BCaesar
  • Members
  • 13 posts
  • Gender:Male

Posted 13 May 2017 - 02:22 AM

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


Edited by BCaesar, 13 May 2017 - 07:55 PM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users