Placing leveled items outside of containers

From Morrowind Modding Wiki
Jump to: navigation, search

To place a leveled item outside of containers you have to do following steps:

1. Open CS.
2. Place "ex_ascadianisles_sleep" leveled creature where it will be easy to find it.
3. Open "ex_ascadianisles_sleep" leveled creature list.
4. Delete every entry in the list except "rat".
5. Save your plugin as "leveled item test.esp".
6. Open the plugin in Enchanted Editor.
7. Open "ex_ascadianisles_sleep" leveled creature list.
8. Replace "rat" with any other object ID.

You can also do it with tes3cmd:

1. Open CS.
2. Place "ex_ascadianisles_sleep" leveled creature where it will be easy to find it.
3. Open "ex_ascadianisles_sleep" leveled creature list.
4. Delete every entry in the list except "rat".
5. Save your plugin as "leveled item test.esp"
6. Download tes3cmd and extract it to your data files folder.
7. Create a new txt file, open it and paste this:

tes3cmd modify -type levc --id "ex_ascadianisles_sleep" --replace "/rat/chitin club/" "leveled item test.esp"

8. Change the txt file extension to bat.
9. Run the bat file. The "rat" entry in the leveled list will be replaced with "chitin club".
10. Test your "leveled item test.esp" plugin. Now a chitin club should appear instead of a rat when player approaches "ex_ascadianisles_sleep" leveled creature.

To modify any other leveled creature list open your bat file in a text editor and replace "ex_ascadianisles_sleep" with another leveled list ID. Replace "rat" with an ID from the leveled list and replace "chitin club" with a new object ID. This should work with any items that player can pick up and also with activators and static objects. But there is a drawback - every new object reference will have the same position. To be able to position them you can do this: place a dummy item in a cell and attach following script to it:

begin leveled_item_script
float posx
float posy
float posz
float anglez
long new_ref
short plevel

set anglez to random 360 ;random z angle
set plevel to ( player->getlevel )
set plevel to ( plevel - 1 ) 
ifx ( plevel ) 
else ;player level is 1
	set posx to 1 ;set x position
	set posy to 2 ;set y position
	set posz to 3 ;set z position
	setx new_ref to xPlace "chitin dagger" ;place new reference at player's feet
endif
set plevel to ( plevel - 2 )
ifx ( plevel )
else ;player level is 2
	set posx to 11 ;set x position
	set posy to 22 ;set y position
	set posz to 33 ;set z position
	setx new_ref to xPlace "chitin club" ;place new reference at player's feet
endif
set plevel to ( plevel - 3 )
ifx ( plevel )
else ;player level is 3
	set posx to 111 ;set x position
	set posy to 222 ;set y position
	set posz to 333 ;set z position
	setx new_ref to xPlace "wooden staff" ;place new reference at player's feet
endif

new_ref->xposition posx posy posz anglez ;position new reference
disable ;disable dummy reference
setdelete 1 ;delete  dummy reference

end

The script uses MWSE functions so you have to use MWEdit to compile it .