How to make Skill Book sellable with vendors?

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

How to make Skill Book sellable with vendors?

Post by Vexy » Fri Dec 08, 2023 10:27 am

I tried to make Skill book's stats same as amulet in misc.txt but it does nothing, I also tried to add that in gamble but also no succed. Please hint...

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Fri Dec 08, 2023 11:17 am

Hi Vexy, what is the Skill Book supposed to do? Is it like a charm? Is it worn as an amulet?

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Fri Dec 08, 2023 11:37 am

Hi Cypress, Skill Book is an item which Radament drops in act2. If rightclicked - it gives +1 skillpoint

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Fri Dec 08, 2023 12:00 pm

You'll want to add the item to gamble.txt based on its code. So in misc.txt, Book of Skill has code=ass. So you'll want to add a row to gamble.txt with code=ass. But what do you mean by it does nothing? Is it supposed to give unlimited skill points? Or is it supposed to behave like the regular Radament's Book of Skill that can only be used once after killing him?

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Fri Dec 08, 2023 1:03 pm

Character says "I can't" and skill is not given, book won't dissapear. Yeah I added in gamble
Book of Skill ass
line, but it won't appear at gamble

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Fri Dec 08, 2023 10:56 pm

The Book of Skill requires you to kill Radament before you can use it. Not sure why it won't appear in gambling, can you post the entire line for Book of Skill in misc.txt?

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Sat Dec 09, 2023 6:34 pm

Well Actually after all it appears in shop and I can buy it, but I still get "I can't" when trying use it.
Book of Skill1 1 0 0 0 0 1 1 0 1 2 2 ass tbk ass 16 2 2 1 1 1 flpbbk invsbk 0 xxx 1 spot item_book 12 item_book 0 0 5 0 0 0 0 0 0 0 0 -1 10 0 0 0 non 0 255 255 2 4 255 255 3 5 3 5 255 255 255 3 5 255 255 255 255 2 3 255 255 2 3 255 255 255 2 3 255 0 0 0 xxx xxx 1 1

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Sat Dec 09, 2023 6:39 pm

the key columns are pspell, typem spawnable and questdiffcheck. (to make item appear) But sadly appeared item does nothing. I guess same goes with potion of live too. I want to make a way to convert player's gold to stats.

OrderOfTheScribble
Posts: 38
Joined: Wed Apr 05, 2023 7:35 pm
United States of America

Re: How to make Skill Book sellable with vendors?

Post by OrderOfTheScribble » Sat Dec 09, 2023 7:58 pm

You can make your own items give things like skill points and max HP in Misc.txt using pSpell 3 and the correct stat. For example, if you want to make a softcoded version of the Book of Skill and have it look just like the one Radament drops, the way to do that is to clone the Book of Skill and then modify the clone as follows:
  • Delete the entries for quest and questdiffcheck, and set the item type to something other than ques. misc should be a fine item type for this.
  • Change the code to one that doesn't exist anywhere else in Misc.txt, Weapons.txt, or Armor.txt.
  • Set spawnable to 1 and cost to the amount of gold you want vendors to charge for a skill point.
  • Set pspell to 3, stat1 to newskills, and calc1 to 1. This means that when the item is right clicked, the player gains a skill point.
  • For each vendor you want to be able to sell this item, set the min and max for that vendor to 1. If you want the player to be able to buy multiples of the item, set PermStoreItem to 1.
The key is pspell 3, which allows an item to give a permanent stat when used. pspell 3 can also be used to give things like stat points (statpts), XP (experience), max HP (maxhp; not sure if this is given in points or 1/256), or even attributes (e.g. stat=strength and calc=5 would give a permanent +5 to Strength).
Last edited by OrderOfTheScribble on Mon Dec 11, 2023 12:10 am, edited 1 time in total.

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Sat Dec 09, 2023 11:18 pm

Thank you for reply. So pspell is 3? Hmm. Now Char does not say "I can't" but still neither skill is given or book disappear. Do I need to change neighbor field state? Is it a digit or a text buff?
BTW: setting type to misc make it dissapear from shop. I used(with no point) spot(stamina potion)
Also if I set code to some unknown - it makes item's picture transparent.

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Sun Dec 10, 2023 2:21 am

You'll need useable=1 as well to be able to consume it.

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Sun Dec 10, 2023 12:41 pm

yes ofc it is set to 1.

OrderOfTheScribble
Posts: 38
Joined: Wed Apr 05, 2023 7:35 pm
United States of America

Re: How to make Skill Book sellable with vendors?

Post by OrderOfTheScribble » Mon Dec 11, 2023 12:13 am

Could you post the row of the skill book clone in Misc.txt? I was able to clone the Book of Skill per what I said above, generate it with a test recipe, and use it.

Edit: I was able to successfully buy a Book of Skill clone from Akara with the type set to misc after editing ItemTypes.txt to set StorePage to misc in the row for the misc item type.

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Mon Dec 11, 2023 7:15 am

OrderOfTheScribble, can you copy your new lines then? Mine is
Book of Skill1 1 0 1 0 0 1 1 0 1 90 2 zvz tbk ass 16 2 2 1 0 0 flpbbk invsbk 0 xxx 1 elix item_book 12 item_book 0 0 5 0 0 0 0 0 0 0 0 -1 3 healthpot 1 UseBookOfSkill UseBookOfSkillController 4 0 0 0 non 0 1 1 255 255 2 4 255 255 3 5 3 5 255 255 255 3 5 255 255 255 255 2 3 255 255 2 3 255 255 255 2 3 255 0 0 0 xxx xxx

I do can buy it from Akara, But when I rightclick it in inventory - AISB it gives book sound and does nothing

OrderOfTheScribble
Posts: 38
Joined: Wed Apr 05, 2023 7:35 pm
United States of America

Re: How to make Skill Book sellable with vendors?

Post by OrderOfTheScribble » Mon Dec 11, 2023 8:44 am

When posting a row from a txt file, it's best to leave it tabbed (copying directly from the editor you're using to the text form should work), otherwise it won't paste properly into the editor. WIth that said, here's the row I used:

Code: Select all

Test Book	Book of Skill		1	0	0	0	999	1	0	1	50000			m07	tbk	ass	16	2	2	0	0	0	flpbbk	invsbk			0	xxx			1	0	misc		item_book	12	item_book	1	0	5	0	0	0	0	0	0	0			0	-1	3					newskills	1								0	0	0	non	0					255					255	1	1			255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx			1			0
Looking at your row and comparing it to mine, it looks like you're using healthpot as the stat when it should be newskills.

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Mon Dec 11, 2023 11:03 am

test book and next field book of skill? In which file I should write it? "Code" in itemtypes.txt or "compactsave" in misc.txt?
Can you just copy whole the line or attach txt file?

btw I'm using text editor for editing rows and notepad+ to copy line.

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Tue Dec 12, 2023 12:29 am

* aw and I use Ressurected game, if they differ in these files

Vexy
Posts: 11
Joined: Fri Dec 08, 2023 10:22 am

Re: How to make Skill Book sellable with vendors?

Post by Vexy » Sun Dec 17, 2023 4:44 pm

No one knows? I'm first who came with idea to buy skill books?(

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Tue Dec 19, 2023 11:42 pm

Post your row that isn't working, in code display: that is the button above your post that looks like </>. And also include your columns.

Also, you don't need to make multiple posts, editing your post bumps the thread.

User avatar
Katsuni
Posts: 9
Joined: Fri Aug 25, 2017 8:35 am
Canada

Re: How to make Skill Book sellable with vendors?

Post by Katsuni » Mon May 27, 2024 5:40 pm

Well I'm trying to do the same thing for a skill book and a stat book, and have run into a few of the same problems. Solved some of them, but there's a new roadblock. So... I guess I'm resurrecting the old thread because a lot of the same information previously will still be relevant and it never seemed to get fully answered.

The first issue that Vexy had with type "misc" seems to be related to the "type" field in particular. When I tried "misc" for the field, it didn't display in the store, which turned out to be an issue with itemTypes.txt not having "misc" have a store page so it couldn't be displayed on any of the tabs because it didn't know where to put it. Setting the store page to "misc" for the "misc" item type (confusing, I know), it at least shows up in the store now, but it just has the name of the item in-game as "An evil force" and you can't do anything with the item despite all the other fields appear to be accurate.

I'd tried a few things previous to this, like trying to use it as a "scro" for scroll type, and it turns out it... "works" in that it refuses to let you use it in town, but if you go out of town it creates a town portal regardless of what the item stats are set to in misc.txt, and changing it to "elix" does the "An evil force" problem as well.

As far as I can tell, the "type" field isn't actually just the type of item, but it sometimes forces specific items to manifest based on the type itself, which doesn't seem like this should be the case, especially when identify and town portal scrolls both use the same "type" as "scro" but it defaults to town portal somehow which doesn't actually make sense how that's happening.

I'd thought maybe I'd somehow picked a copy for the "code" field, but ctrl+F of misc.txt, armor.txt and weapons.txt show no results over than the attempted books, so that shouldn't be the problem.

So currently I have the item(s) able to be purchased from a store, with a low cost (5 gold) for ease of testing. Any fields that were on other items that seemed important were copy/pasted over to make sure there wouldn't be any errors with missing necessary data, so it's possible there's something copied over that shouldn't exist, but I checked against several items in misc.txt to make sure it should be okay (the book of skill being the primary check, but also verified with the "standard" item (row 152) and several of the runes and the health potions to make sure there wasn't anything weird that needed to be added or omitted. As far as I can tell, this "should" work, but my suspicion is the "type" field is at fault somehow because of its behaviour in testing.

Anyway, here's the code for both items with the fields listed, hopefully something in this makes sense to someone who has a much better idea of what they're doing than I do.

Code: Select all

name	*name	szFlavorText	compactsave	version	level	levelreq	rarity	spawnable	speed	nodurability	cost	gamble cost	code	alternategfx	namestr	component	invwidth	invheight	hasinv	gemsockets	gemapplytype	flippyfile	invfile	uniqueinvfile	special	Transmogrify	TMogType	TMogMin	TMogMax	useable	throwable	type	type2	dropsound	dropsfxframe	usesound	unique	transparent	transtbl	lightradius	belt	autobelt	stackable	minstack	maxstack	spawnstack	quest	questdiffcheck	missiletype	spellicon	pSpell	state	cstate1	cstate2	len	stat1	calc1	stat2	calc2	stat3	calc3	spelldesc	spelldescstr	spelldesccalc	durwarning	qntwarning	gemoffset	BetterGem	bitfield1	CharsiMin	CharsiMax	CharsiMagicMin	CharsiMagicMax	CharsiMagicLvl	GheedMin	GheedMax	GheedMagicMin	GheedMagicMax	GheedMagicLvl	AkaraMin	AkaraMax	AkaraMagicMin	AkaraMagicMax	AkaraMagicLvl	FaraMin	FaraMax	FaraMagicMin	FaraMagicMax	FaraMagicLvl	LysanderMin	LysanderMax	LysanderMagicMin	LysanderMagicMax	LysanderMagicLvl	DrognanMin	DrognanMax	DrognanMagicMin	DrognanMagicMax	DrognanMagicLvl	HraltiMin	HraltiMax	HraltiMagicMin	HraltiMagicMax	HraltiMagicLvl	AlkorMin	AlkorMax	AlkorMagicMin	AlkorMagicMax	AlkorMagicLvl	OrmusMin	OrmusMax	OrmusMagicMin	OrmusMagicMax	OrmusMagicLvl	ElzixMin	ElzixMax	ElzixMagicMin	ElzixMagicMax	ElzixMagicLvl	AshearaMin	AshearaMax	AshearaMagicMin	AshearaMagicMax	AshearaMagicLvl	CainMin	CainMax	CainMagicMin	CainMagicMax	CainMagicLvl	HalbuMin	HalbuMax	HalbuMagicMin	HalbuMagicMax	HalbuMagicLvl	MalahMin	MalahMax	MalahMagicMin	MalahMagicMax	MalahMagicLvl	LarzukMin	LarzukMax	LarzukMagicMin	LarzukMagicMax	LarzukMagicLvl	DrehyaMin	DrehyaMax	DrehyaMagicMin	DrehyaMagicMax	DrehyaMagicLvl	JamellaMin	JamellaMax	JamellaMagicMin	JamellaMagicMax	JamellaMagicLvl	Source Art	Game Art	Transform	InvTrans	SkipName	NightmareUpgrade	HellUpgrade	mindam	maxdam	PermStoreItem	multibuy	Nameable	*eol

Book of Infinite Knowledge	Book of Infinite Knowledge		1	0	0	0	999	1	0	1	5		bik		bik	16	2	2	0	0	0	flpbbk	invsbk			0	xxx			1	0	misc		item_book	12	item_book	0	0	0	0	0	0	0	0	0	0			0	-1	3	newskills	1												0	0	0	non	0					255					255	1	1			255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx			1	1		0

Book of Infinite Physique	Book of Infinite Physique		1	0	0	0	999	1	0	1	5		bip		bip	16	2	2	0	0	0	flpbbk	invsbk			0	xxx			1	0	misc		item_book	12	item_book	0	0	0	0	0	0	0	0	0	0			0	-1	3	statpts	5												0	0	0	non	0					255					255	1	1			255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx			1	1		0

User avatar
Cypress
Moderator
Champion of the Light
Posts: 493
Joined: Fri Dec 01, 2017 2:08 am

Re: How to make Skill Book sellable with vendors?

Post by Cypress » Tue May 28, 2024 11:09 am

Hi Katsuni, you have pspell=newskills and cstate1=1. That should be pspell=3, stat1=newskills and calc1=1. Likewise for the stat book. Like so:

Code: Select all

name	*name	szFlavorText	compactsave	version	level	levelreq	rarity	spawnable	speed	nodurability	cost	gamble cost	code	alternategfx	namestr	component	invwidth	invheight	hasinv	gemsockets	gemapplytype	flippyfile	invfile	uniqueinvfile	special	Transmogrify	TMogType	TMogMin	TMogMax	useable	throwable	type	type2	dropsound	dropsfxframe	usesound	unique	transparent	transtbl	lightradius	belt	autobelt	stackable	minstack	maxstack	spawnstack	quest	questdiffcheck	missiletype	spellicon	pSpell	state	cstate1	cstate2	len	stat1	calc1	stat2	calc2	stat3	calc3	spelldesc	spelldescstr	spelldesccalc	durwarning	qntwarning	gemoffset	BetterGem	bitfield1	CharsiMin	CharsiMax	CharsiMagicMin	CharsiMagicMax	CharsiMagicLvl	GheedMin	GheedMax	GheedMagicMin	GheedMagicMax	GheedMagicLvl	AkaraMin	AkaraMax	AkaraMagicMin	AkaraMagicMax	AkaraMagicLvl	FaraMin	FaraMax	FaraMagicMin	FaraMagicMax	FaraMagicLvl	LysanderMin	LysanderMax	LysanderMagicMin	LysanderMagicMax	LysanderMagicLvl	DrognanMin	DrognanMax	DrognanMagicMin	DrognanMagicMax	DrognanMagicLvl	HraltiMin	HraltiMax	HraltiMagicMin	HraltiMagicMax	HraltiMagicLvl	AlkorMin	AlkorMax	AlkorMagicMin	AlkorMagicMax	AlkorMagicLvl	OrmusMin	OrmusMax	OrmusMagicMin	OrmusMagicMax	OrmusMagicLvl	ElzixMin	ElzixMax	ElzixMagicMin	ElzixMagicMax	ElzixMagicLvl	AshearaMin	AshearaMax	AshearaMagicMin	AshearaMagicMax	AshearaMagicLvl	CainMin	CainMax	CainMagicMin	CainMagicMax	CainMagicLvl	HalbuMin	HalbuMax	HalbuMagicMin	HalbuMagicMax	HalbuMagicLvl	MalahMin	MalahMax	MalahMagicMin	MalahMagicMax	MalahMagicLvl	LarzukMin	LarzukMax	LarzukMagicMin	LarzukMagicMax	LarzukMagicLvl	DrehyaMin	DrehyaMax	DrehyaMagicMin	DrehyaMagicMax	DrehyaMagicLvl	JamellaMin	JamellaMax	JamellaMagicMin	JamellaMagicMax	JamellaMagicLvl	Source Art	Game Art	Transform	InvTrans	SkipName	NightmareUpgrade	HellUpgrade	mindam	maxdam	PermStoreItem	multibuy	Nameable	*eol	
																																																																																																																																																																								
Book of Infinite Knowledge	Book of Infinite Knowledge		1	0	0	0	999	1	0	1	5		bik		bik	16	2	2	0	0	0	flpbbk	invsbk			0	xxx			1	0	misc		item_book	12	item_book	0	0	0	0	0	0	0	0	0	0			0	-1	3					newskills	1								0	0	0	non	0					255					255	1	1			255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx			1	1		0	
																																																																																																																																																																								
Book of Infinite Physique	Book of Infinite Physique		1	0	0	0	999	1	0	1	5		bip		bip	16	2	2	0	0	0	flpbbk	invsbk			0	xxx			1	0	misc		item_book	12	item_book	0	0	0	0	0	0	0	0	0	0			0	-1	3					statpts	5								0	0	0	non	0					255					255	1	1			255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx			1	1		0	

User avatar
Katsuni
Posts: 9
Joined: Fri Aug 25, 2017 8:35 am
Canada

Re: How to make Skill Book sellable with vendors?

Post by Katsuni » Tue May 28, 2024 4:00 pm

Cypress wrote:
Tue May 28, 2024 11:09 am
Hi Katsuni, you have pspell=newskills and cstate1=1. That should be pspell=3, stat1=newskills and calc1=1. Likewise for the stat book. Like so:
...Oops. That explains an awful lot >.> It's almost like putting things in the correct fields helps. Who would'a thunk?

It still calls it an "evil force" but they actually function properly now after a very fast test. Thank you ever so much for catching that as I probably would have kept misreading where I was putting them over and over again and never realized cstate1 is not stat1. I'll accept it as a win, even if it's a bit weird. Rather than try to remember which is which, I'll just double the cost and combine them into a single book so I know it does both then. I'll hunt down the issue with the naming later!

Post Reply

Return to “General Mod Making”