Page 1 of 1

vendor sold armor and weapons have super AR

Posted: Tue Dec 03, 2013 3:21 am
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?

Re: vendor sold armor and weapons have super AR

Posted: Wed Dec 04, 2013 4:38 pm
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.

Re: vendor sold armor and weapons have super AR

Posted: Tue Jan 28, 2014 10:40 am
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