vendor sold armor and weapons have super AR

Open discussion forum. For topics that do not fit anywhere else.
Post Reply
rainmaker24
New User
Posts: 12
Joined: Sun Feb 27, 2011 11:24 am

vendor sold armor and weapons have super AR

Post by rainmaker24 »

working on asgard (ackadia/wod) 098 scripts. merchant sold armor and weapons have super duper AR.

.created items are fine, haven't tested crafted stuff

Anyone know what would cause this? Would the SEND_AOS_TOOLTIP flag that is on vendors cause this?
Zik
Novice Poster
Posts: 41
Joined: Sun Feb 07, 2010 9:39 am

Re: vendor sold armor and weapons have super AR

Post by Zik »

AR depends on:
- quality
- HP/MaxHp ratio (maxhp_mod is also involved in some way)
Check their hp. If it's more then maxhp AR would be higher.
Agata
Journeyman Poster
Posts: 63
Joined: Sun Oct 30, 2011 6:33 am

Re: vendor sold armor and weapons have super AR

Post by Agata »

This problem has to do with the items' quality. In the Ackadia and WoD scripts there is a section where the quality of the vendor items is being set to a random number between 50 and 99, and this becomes a "multiplier", so an item with quality 50 is 50 times as powerful as one with quality 1.

Here is the culprit:
\pkg\npcs\townfolk\merchants\mrcspawn.inc:

Code: Select all

function RestockInventory (merchanttype, byref inventory)
	UnloadConfigFile (":merchants:mrcspawn");
	var mrcspawn_cfg := ReadConfigFile(":merchants:mrcspawn");

	foreach item in ListRootItemsInContainer (inventory)
		DestroyItem (item);
	endforeach

	foreach productgroup in ProductGroups (mrcspawn_cfg, merchanttype)
		Restock (mrcspawn_cfg, inventory, productgroup);
	endforeach
// REMOVE EVERYTHING AFTER THIS AND BEFORE THE NEXT COMMENT
	foreach item in ListRootItemsInContainer ( inventory )
		if ( item.quality )
			item.quality := randomint (50) + 50;
			item.hp := item.maxhp;
		endif
	endforeach
// REMOVE EVERYTHING BEFORE THIS AND AFTER THE PREVIOUS COMMENT
endfunction
Post Reply