Jump to content

Adding items to the world, maybe as quest rewards?


subtledoctor

Recommended Posts

I'm in the process of adding learnable bard songs to the game, and it is pushing me into areas I am not used to. I know how to add stuff to stores, but I think it would be cool to give (some of) them as quest rewards. Like, a special Mirror Image song to be given at the end of the Astral Prison quest. Any suggestions? I'm looking for a combination of easy and cool.

 

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

 

But it might be more interesting to pop it into the player's (or Haer'Dalis') inventory during the conversation with Raelis. Is that difficult? (Is the answer "go look at the Branwen mod?")

 

I have an undead-related song that I think should go on a corpse under the Athkatla sewers - the leavings of a failed adventurer, like you sometimes find in IWD. How do I identify a loot pile (I guess it's technically a container?) in an area, and add an item to it?

Link to comment

How do I identify a loot pile (I guess it's technically a container?) in an area, and add an item to it?

The old approach is to take a look up the container name in Near Infinity, and use the area script for example to add it in, the container name is "Chest 7" in Near Infinity in this example, and the area is the first SoA dungeon, .tp2 code:

		EXTEND_BOTTOM ~ar0602.bcs~ ~Impilation/Item/AR0602.baf~
.baf code:

IF
  Global("IJ#BAC9","GLOBAL",0)
THEN
  RESPONSE #100
    SetGlobal("IJ#BAC9","GLOBAL",1)
    ActionOverride("Chest 7",CreateItem("IJ#brac9",0,0,0)) 
END

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

Yeah that's right. It also done easily by just copying the char and ADD_CRE_ITEM -macro.

 

To add the item to a container, you could copy the .are -file and add the item bitwise... and make a horrible mess out of it if it fails to account any resource. :devlook:

Of course weidu also has a ADD_AREA_ITEM macro/patch function, that has container_to_add_to -variable, which is far less likely to fail than just the bitwise added resource.

 

To add items to the rewards, you just need to edit the dialog file of the quest... which is not where my expertise lies.

Link to comment
But it might be more interesting to pop it into the player's (or Haer'Dalis') inventory during the conversation with Raelis. Is that difficult?

Maybe here? (Original dialogue)

~A reward for your troubles... and then my troupe and I must return home. There is little else to keep us here. We shall wait until you depart.~

__________________________________________________

Create a file raelisadd.d with any of those options

 

 

 

//Easy (just adds the item in PC inventory as additional reward)

ADD_TRANS_ACTION Raelis BEGIN 85 END BEGIN 0 END ~ GiveItemCreate("MyThing",Player1,1,0,0)~

 

//Easy and cool (adds some dialogue and gives item to PC or Haerdalis - but only if he is in your party - but you can extend this at your liking and also add an option for Haerdalis not in party etc,etc)

 

I_C_T Raelis 85 HaerGetScroll

==HaerdaJ IF~InParty("Haerdalis") IsValidForPartyDialogue("Haerdalis")~THEN~Has our helpful sparrow not deserved something special, Raelis?~

==Raelis IF~InParty("Haerdalis") IsValidForPartyDialogue("Haerdalis")~THEN~Right, a bard's gift is adequate for <CHARNAME>'s help.~DO ~GiveItemCreate("MyThing",Player1,1,0,0)~ // or GiveItemCreate("MyThing","Haerdalis",1,0,0)

END

 

 

 

 

In your tp2 Have a

COMPILE ~Mymod/dialogues/raelisadd.d~

__________________________________________________________________

 

I suppose I could just add it to the Demon Knight... it would just drop as loot then, right?

In your tp2

 

COPY_EXISTING ~pwarden.cre~ ~override~

ADD_CRE_ITEM ~MyItem~ #0 #0 #0 ~IDENTIFIED~ ~inv11~

Link to comment

It's functionally like a spell scroll: single-use, then it disappears. I copied a scroll and edited it to remove the Learn Spell ability and keep the 'use from quickslot' ability. Do scrolls have charges?

 

@Roxanne thank you! I have just coded up a version that adds it to the demon knight, then saw this, and adding it to Raelis does seem easy. I'm always terrified of doing stuff like that - when my little mods have bugs they tend to only produce a bit of weird text, or an item that misfires or something. But when mods have bugs that affect major NPCs, that can be game-stopping. So I have always steered clear of this kind of thing. But, that seems manageable.

Link to comment

Do scrolls have charges?

Check what happens in a EE game, when you use this:

C:CreateItem("MyItem",5,0,0)

And if you don't have a EE game, just replace the first C: with CLUAConsole: ...

So in a sense yes.

But the difference between #0 and #1 should be negligee-able in your item. Now, were it a wand of fireball, there would be a difference between #0 and #30.

Link to comment

Archived

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

×
×
  • Create New...