View Single Post
  #2  
Old 09-09-2013, 09:08 AM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Smile You asked for it!

Quote:
Originally Posted by rikkaidd View Post
Thank you very much, I understand!
This is the only forum on modding "kings bounty",unfortunately there are not modding tutorials.
Today i almost went crazy for understand how to resurrect "black dragon" with "ressurrect spells" or "ability inquisitor",then I have got the conclusion :

not only i changes the level "blackdragons units" from 5 to 4,
I also had to remove its parameter "magic_immunit" in the "blackdragon. atom" file
file.
Hey, no problem - glad I can help.

Here are some things to consider with respect to what you changed (there is more than one way to implement changes, some better than others).

It would be best to keep Black Dragons as level 5 since you'll open them up to a great many spells that affect units only up to level 4. Also, changing them from "magic_immunitet" is also fraught with issues (as now all spells can affect them).

What you could do, instead, is find the Resurrection Spell in SPELLS.TXT (from AP):

Code:
spell_resurrection {
  category=s
  profit=4
  price=12000
  image=book_spell_resurrection.png
  button_image=book_scroll_resurrection.png
  label=SN_resurrection
  attack=scripted
  school=1
  hint_config=object_spell
  hint=spell_resurrection_hint
  hint_header=spell_resurrection_header
  
  scripted {
    always_hint=1
    log_label=null
    warning=warning_resurrect
    script_attack=spell_resurrection_attack
    script_calccells=calccells_all_need_resurrect_ally
    attack_cursor=magicstick
    ad_factor=0  // use attack/defense
    nfeatures=magic_immunitet,undead,plant,golem,pawn,boss,mech
  }
  params {
    duration=0
    rephits=200	// ñêîëüêî ëå÷èò
    lev_ref=100	// íà ñêîëüêî % ïîâûøàåòñÿ ñ óðîâíåì
    level=2,3,4
  }
  levels {
    // level = mana_cost, crystals_cost to upgrade from previous level
    1=10,10
    2=20,15
    3=30,25
  }
}
Note the nfeatures label? You simply remove magic_immunitet from that and then it will work on units that are immune to magic, but there is one other parameter that you need to look at and that is level - see where it is 2,3,4? Those are the level limits on the Resurrection spell for each spell level. So if you changed it to 2,4,5, for example, then at level 2 you could rez units up to level 4 and then at level 3 you could rez units up to level 5.

This is the trick of modding: know what is where. I learned how to mod simply by using a good grep tool and searching for stuff in the game files. I also used the forums but I did a lot of advanced stuff in my HOMM3 Babies mod that no one could help me with (so feel free to ask me questions). So for example, since you found BLACKDRAGON.ATOM, you could search for all the files that contain magic_immunitet and you'd find that it is referenced in quite a few files. So I encourage you to do that. Also search on my posts - I have a tutorial here and there.

[QUOTE=rikkaidd;509077]I would like to find a forum with good tutorials../QUOTE]

Check out this post: http://forum.1cpublishing.eu/showpos...92&postcount=1 and this topic: http://forum.1cpublishing.eu/showthread.php?t=28258

Quote:
Originally Posted by rikkaidd View Post
Ps: i have download KB_DB_EDIT, extrat all *loc file (of ses.kfs) ,in other root, and convert to txt all temple_love.... file..
If I do not mistake only this interests me is "temple_love.embryos.loc.txt",the others file , seem the 3d object position in the maps.
the system seems very complicated,sincerely i have not understood anything there ...if please, give me a tip-off on the modification of these laces codes:
Yes - you're in trouble now!

Quote:
Originally Posted by rikkaidd View Post
{ushop} they seem to be recruitable units in the temple,right?
Yes - great insight! Note that {ushop} defines the units available at that shop (or really the unit choices).

Now here's how it works:

Quote:
Originally Posted by rikkaidd View Post
Code:
						{Y}{ushop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 2 elements
						{
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {priest,500:5:2000,priest2,500:5:2000}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
								}
							}
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {paladin,200:500}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
								}
							}
						}
					}
				}
				{U}{chance} = {100}
				{U}{uid} = {2}
				{U}{wuid} = {4233223827}
				{A}{class} = {castle}
			}
The {Y}{ushop} is a section of a location on the map. A location has many sections under it, including ushop, but let's focus on ushop. The ushop is the units shop section (which you already figured out) under this location on the map and only lists units for that location (note though that there are possibly also items {itms} and spell scroll {spls} sections (usually above the {ushop} section) under this location). So looking at your example:

Unit choice #1:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {priest,500:5:2000,priest2,500:5:2000}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
								}
							}
And unit choice #2:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {paladin,200:500}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
								}
							}
These are essentially templates that you can use to modify unit choices.

You'll note that there are races, units, level, kolvo, and prob sections under each unit. With this you have great flexibility in adding all kinds of unit possibilities to a shop that can be quite random from game to game. The syntax, is very similar to what you'll see in ITEMS.TXT under the army choice for items that you fight to upgrade or pacify. Let's go through each one:
  • races - for specifying a choice of race or races for units in the shop (note that units should be left blank if you're specifying something here).
  • units - I think you can see that you can list specific units that are possible here. Note the syntax: UNIT_ATOM,MIN:INCREMENT:MAX
    • UNIT_ATOM - this is a valid ATOM file name, note one misspelling here and the game will crash if the ATOM file is not found
    • Interval - the number of available units possible:
      • MIN - minimum number of units that will appear at the shop
      • INCREMENT - the increment between the MIN and MAX (note 1 assumed if omitted)
      • MAX - maximum number of units that will appear at the shop
  • level - you can specify the level of units available (once again best to leave unit blank if you're going to specify a unit level)
  • kolvo - ranges of units if leaving unit blank (i.e. if you specify something for race and level, specify the numbers here, otherwise leave blank as numbers are specified in {unit})
  • prob - chance that this unit will appear if there is more than one choice (you usually see 10 here if this is always possible or there is an equal chance with another choice).

So let's breakdown what unit choice #1 means: There is a 10 out of 10 chance that unit slot #1 in the shop will sell either 500 to 2000 Priests in 5 unit increments or 500 to 2000 Inquisitors in 5 unit increments. So one game you could have 785 Priests and in another 1555 Inquisitors. Does this make sense? What about unit choice #2: There is a 10 out of 10 chance that the shop will sell 200 to 500 Paladins in 1 unit increments. So one game you could have 204 Paladins and another 497 in unit slot #2. It is important to note that *both* unit slots in the shop are filled every game with these choices.

Does this make sense? Say you want a shop to sell 100 to 150 level 1-2 Elven troops in 2 unit increments - how would you specify it?

Here is the answer:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {elf}
										{A}{units} = {}
										{A}{level} = {1:2}
										{A}{kolvo} = {100:2:150}
										{U}{prob} = {10}
									}
								}
							}
Does this make sense?

What do you think this means?

Code:
						{Y}{ushop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 2 elements
						{
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {archer,500:50:1000,skeleton,500:50:1000}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
								}
							}
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
							{
								{Y}{units}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 3 elements
								{
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {vampire,50:300,vampire2,50:300}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {10}
									}
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {}
										{A}{units} = {}
										{A}{level} = {}
										{A}{kolvo} = {}
										{U}{prob} = {3}
									}
									{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 5 elements
									{
										{A}{races} = {undead}
										{A}{units} = {}
										{A}{level} = {1:3}
										{A}{kolvo} = {90:300}
										{U}{prob} = {10}
									}
								}
							}
						}
If you look at this you'll note that there are two {Y}{units} sections just like in your example. The first section is for unit slot number #1 in that shop with a 10 out of 10 chance to sell either 500 to 1000 Skeleton Archers in 50 unit increments or 500 to 1000 Skeleton Warriors in 50 unit increments. Slot #2 has 3 choices: 1) 50 to 300 Vampires or Ancient Vampires in 1 unit increments with a 10 out of 23 chance, 2) nothing with a 3 out of 23 chance, and 3) 90 to 300 level 1 to 3 Undead units in 1 unit increments with a 10 out of 23 chance. Does this make sense?

Once again, the stuff you see in the LOC files are your templates, you can simply copy what you find to another shop location and change it to the way you want it.

Quote:
Originally Posted by rikkaidd View Post
this????{A}{class} = {box} is a normally box in the map?
Not necessarily, box could just be referencing an item - you need to look at the context in which it is used.

In the example you present, it is an item or spell being sold in a shop.

Quote:
Originally Posted by rikkaidd View Post
{A}{class} = {army}, is enemy in the map?
Yes, or let's say a potential army on the map. Note that the syntax here is identical to that in ITEMS.TXT.

Okay, now for items and spells - first items:

Code:
					{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 3 elements
					{
						{Y}{itms}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 1 elements
						{
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {skeleton_grave/30:60}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{25}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {vampire_grave/10:25}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{75}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {*}
										{A}{ir_level} = {*}
										{A}{ir_race} = {undead}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
						}
Can you break this into its 3 sections? Note that I added this section to the Dwarf Necromancer's shop in King's Bounty - The Legend in Kordar (KORDAR_2.EMBRYOS.LOC).

Here is section (for potential item) #1:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {skeleton_grave/30:60}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
Do you note similarities to the {ushop} section? Note that {choice} is the section that describes the possibilities for items. The probability is subtle, but do you see {Y}{10} under {choice} for its two sub-elements? There is also a {chance} section as well. The {chance} is the probability of this choice being available (and you'll note that it is set to 100%). There are two possibilities: 1) 30 to 60 Skeleton Graves (the coffin items you find in the Cemetary of Marshan Swamp for example) in 1 item increments with a 10 out of 20 chance and 2) nothing with a 10 out of 20 chance. So there is a 100% chance of possible item #1 occurring in the game and it has a 50% chance of providing 30 to 60 Skeleton Graves.

You should now be able to determine that item slot #2 has a 100% chance of providing either: 1) 10 to 25 Vampire Graves with a 25% (note the {Y}{25}) chance or 2) nothing with a 75% (note the {Y}{75}) chance.

Note that there is one critical difference between how ranges are specified in {ushop} versus {itms}: ITEM_NAME/RANGE. Note that ITEM_NAME must be in ITEMS.TXT (or one of the included files) and that you need to use a "/" instead of a "," to separate the name of the item from its range. This can bite you (I've been bitten!) if you're not careful (and of course the game crashes if you mess up).

Lastly, item slot #3 has a 50% chance of providing an Undead item of any type or level:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {*}
										{A}{ir_level} = {*}
										{A}{ir_race} = {undead}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
Make sense? I hope so, now on to spells:

Code:
						{Y}{spls}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 2 elements
						{
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {1}
										{A}{sr_level} = {*}
										{A}{sr_count} = {2:5}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 2 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {1/2}
										{A}{sr_level} = {*}
										{A}{sr_count} = {2:5}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
									{Y}{3}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {}
										{A}{sr_level} = {}
										{A}{sr_count} = {}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
						}
There are two spell slot sections, section #1:

Code:
							{Y}{-N/A-}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 9 elements
							{
								{A}{cont} = {}
								{A}{upds} = {}
								{A}{digi} = {}
								{U}{flgs} = {0}
								{Y}{choice}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 1 elements
								{
									{Y}{10}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{0} // 25 elements
									{
										{A}{atom} = {}
										{A}{script} = {}
										{U}{cmc} = {0}
										{A}{bp0} = {}
										{A}{bp1} = {}
										{A}{bp2} = {}
										{A}{bp3} = {}
										{A}{bp4} = {}
										{A}{bp5} = {}
										{A}{bp6} = {}
										{A}{bp7} = {}
										{A}{bp8} = {}
										{A}{bp9} = {}
										{A}{bp10} = {}
										{A}{bp11} = {}
										{A}{bp12} = {}
										{A}{bp13} = {}
										{A}{items} = {}
										{A}{ir_type} = {}
										{A}{ir_level} = {}
										{A}{ir_race} = {}
										{A}{sr_school} = {1}
										{A}{sr_level} = {*}
										{A}{sr_count} = {2:5}
										{Y}{bshop}, F_SORTED{0}, F_COMPACT_TAGS{1}, F_NONAMES{1} // 0 elements
										{
										}
									}
								}
								{U}{chance} = {100}
								{U}{uid} = {0}
								{U}{wuid} = {0}
								{A}{class} = {box}
							}
You'll note that the item and spell scroll sections are essentially identical save for their heading (itms or spls) and what is specified.

There is a 100% chance of selling 2 to 5 (the number is specified in {sr_count}) Distortion school (under {sr_school}) scrolls (0 = Order, 1 = Distortion, 2 = Chaos) of any spell (note "*" under {sr_level}) for spell slot #1. For spell slot #2 there is a 10 out of 13 chance to sell either 2 to 5 Distortion or Chaos school (note that a "/" separates school choices under {sr_school}) spells of any kind.

Once again find an {itms} or {spls} section in the LOC file and use it as your template. To determine what bp0 through bp13 mean, you'll need to go to the quest rewards files (*.QST - decompile one of those (its number matches its *.LNG - NUMBER.QST and then a corresponding ENG_QUEST_NUMBER.LNG (note that NUMBER is 0 padded if it is less than 10 digits))) and then go look at the reward in the game to decipher what {bp0} through {bp13} mean (there may also be an LUA function that deciphers them, but I don't know it offhand - someone might have posted them, too). They are things like runes, or gold, etc.

This is plenty of info to get you into trouble as now I've made you dangerous!

Remember to always work with backups, make one change and then try it out (the bummer is that you have to restart so pick a location that is easy to check out (can be reached very quickly in a new game) so that you can do some trial and error and see if your change works).

Note if you implement a lot of changes simultaneously and the game crashes you'll either have to remove everything and add it in one at a time or use a binary technique where you add half your changes until it crashes to find where your error is.

Feel free to ask more questions after you've had a chance to digest this information - note I don't know everything in these files, but I know how to copy and paste things and then change them. Note that you'll need the editor if you want to add new locations to a map as the information in the LOC file needs to be linked to the map (through the ID's, etc. listed in the other sections of that location).

Good luck!

/C\/C\
Reply With Quote