Lilarcor_v4-1.esp 
-----------------
by Craig Critchfield (aka: Tundro Walker) - tundrowalker@ev1.net


NEW TO v4.1
-----------
Minor change/bug squishing.  Seems the way I scripted the Lil swords to remove from the player ended up making the player's encumberance zero-out to nothing.  

It was doing such, because I scripted the removal part to remove all instances of Lil whether the player had that version or not.  I thought the game would be smart enough to figure out that if the player doesn't have that item, then it won't do anything.  However, even when the player didn't have a version of Lil, the game "removed" it anyways, and subtracted the total weight of the removed version from the player's total weight carried.  Thus, for each of the 16 versions (8 2-handers & 8 1-handers), it was removing each one regardless of which one player had.

I fixed the scripting for this, and now it properly checks and removes only instances of Lil that it finds in the player's inventory.  I tested it out and it works fine, but let me know if you find a problem.


NEW TO v4.0
-----------
From 3.0, I made it where you can summon Lilarcor as a "Phantom Fighter" to go killin' with you.  I said 3.0 was likely the final one, but there was a bug in 3.0 that kept Lil from speaking after hitting lv 8.  So, I fixed that, got to tweakin' some, and before I knew it, there was no turning back from making a "phantom sword" companion option out of him.

BTW, the fact that Lilarcor's Phantom resembles a certain comic book character is merely coincidental.  (Heh-heh!  I was scrounging through Bethesda's original .nifs, swapping things out to see how it looked, and that's what I ended up with.)


IMPORTANT NOTE 1 - For folks with any old version, I once again recommend opening up your old saved game with the old mod, dumping Lil off somewhere, then doing a cell transition.  Save your game (in a new slot to be safe), then quit.  Restart Morrowind, unselecting the old 2.0 or 3.0 mod, and selecting the 4.0 mod.  Open up your fresh saved game, and go to Seyda Neen to pick up Lil at Arrille's again.

IMPORTANT NOTE 2 - The readme file for v3.0 still applies in the sense that Lil can change to become a 1-handed sword, he still plays "mood music", and you still have options to shut him up in combat and/or idle.  So, please read the 3.0 readme for past details.


* You can summon Lilarcor's phantom by casting his "Summon Lilarcor's Spirit" spell, and then selecting "Summon/Unsummon phantom" in the menu.  You get the "Summon Lilarcor's Spirit" spell automatically added to your spell list when you pick up Lil.  IF you put Lil down, you lose the spell.  However, if you summon his phantom, he disappears from your pack and his phantom appears to kick-ass with you.  With the phantom active, you still have the "Summon Lilarcor's Spirit" spell available to set options with.  You can also *talk* to Lilarcor's Phantom and set some options through his dialogue.

* Once active, you can deactivate the phantom by either talking to him and telling Lil to get back in your pack, or casting the "Summon Lilarcor's Spirit" spell again and selecting to "Summon/Unsummon phantom" in the menu.  Either way, the phantom will disappear, and the properly "handed" & levelled version of Lil you were using before you summoned his phantom will return to your pack.  (IE: If you were using a lv1, 1-handed Lil when you summoned his phantom, then when you unsummon his phantom, Lil will come back to your pack as 1-handed.  If Lil levelled up while in phantom mode, he'll return 1-handed as the proper level.  Likewise if you were using him 2-handed, he'll come back as 2-handed of the proper level.)

* As you can tell by that previous statement, Lilarcor *can* gain xp & level himself up in Phantom-mode.  When he's in combat, if he gets enough xp, he'll inform you that he has enough xp to level.  Then, when you and him find some idle time away from combat, he'll level up.  Not only does his sword-form upgrade, but his phantom form auto-adjusts his stats to become better when Lil upgrades as well.  So, phantom Lil will not only be more powerful sword-wise, but more effective skill wise, too.

* Phantom constantly checks Player's Speed & Athletics, and sets his own to x3 that of Player's so he can keep up.  Phantom attack, sneak & defense skills are based on what level Lil is at the moment (naturally).  The phantom gets +15 skill per level, so lv1=15, lv2=30, etc, etc.  At lv8, phantom has 120 skill in attack, sneak & block (IE: phantom kicks buku ass).

* If you get more then 1500 distance units away from the phantom, he deactivates and creates a new one of himself near you.  This is good in case he gets lost, gets stuck, or gets gung-ho about killing something when you're trying to run off.

* If you fly or levitate, phantom automatically deactivates & returns the appropriate handedness/level of Lil to your pack.  (NPC's don't levitate or fly in regular Morrowind, although they can in Tribunal.  I don't have Tribunal, so I solved the problem this way).

* If you water-walk, phantom will water-walk.  When yours turns off, so will phantom's.

* Phantom can breath under water, so he won't drown when you go deep-sea diving.  

* Phantom shrugs off Player hits, and won't attack Player if getting "friendly fire".  (Unfortunately, though, other NPC's seeing you beat up on phantom Lil will make them report it as a "crime".  I'm not sure how to work around this, so try not to use him as a punching bag too much.)

* Phantom is 100% resistant to magic, disease, blight, corprus, shock, normal weapons, etc, so he won't get messed up by such stuff.  Plus, phantom's Health/Fatigue are restored to 1000 each time his script runs through.  So even if he gets whacked on, he shrugs it off and won't die (and you won't have to heal/resurrect him).  However, on the remote chance that he *does* die somehow, phantom will deactivate and return proper handedness/level of Lil to Player's pack.  (IE: He's pretty damn self-sufficient.)

* Phantom's disposition automatically resets to 100 each time his script runs through, so even if Player taunts, intimidates or fails bribing him during dialogue & disposition ends up 0, he'll reset it & still like you.  (There's no reason to bribe, intimidate, taunt or admire him, so I'm not sure why you'd be doing it.  Only reason those options are still available in his Dialogue is because I didn't know of any way to switch them "off" to not show up for phantom.)

* Phantom Lil "sheathes" himself (his sword) after combat's over.  As such, I knew some loop-hole sniffing Player would see what happens when you pick the phantom's pocket.  Well, if you do it in the sight of other NPC's, they seem to think it's a crime (I'm not sure how to turn this off).  But, you *can* pick the phantoms pocket and take Lilarcor back.  If you do, phantom will deactivate, and you'll end up with a 2-handed version of whatever level Lil is currently at (since Lil's phantom *always* uses himself 2-handed...naturally!)

* As part of the "not just cool, but functional, too!" category, Phantom has a "Toggle Phantom Flames" option that you can select in dialogue with him.  Doing so will make him light up (literally!) and cast light (15 magnitude) around him.  Telling him to toggle a second time will make him "douse" himself and the light.  

* Phantom is "refreshed" upon cell changes (and if you get more then 1500 away from it), so you don't have to worry about repairing Lilarcor when he's in phantom mode.

Note 1, fire doesn't go out in water, so he's a good bodyguard AND night-light when you go deep-sea diving, heh-heh!  

Note 2, for those of you thinking "hey, make him play a sound like he's on fire when he's lit up!"  Well, I originally did, but when he's following you around and the fire noise is constantly crackling in your ear, it covers over other sounds you may be listening for and it just gets plain annoying.  So, I turned it off.  The lines of code are still in the Lil_Actor_Script, just need to be uncommented if you want him to make fire sound so bad when he lights up.


FIXES FROM 3.0
--------------

Several kind souls pointed out the fact that Lil didn't talk after he reached Level 8 in v3.0.  He'd get to the level, thunder after a bit, then stop talking.  I fixed this bug, and let's just say it was due to some overzealous streamlining on my part (since v3.0 was mostly a re-work of all the scripting).


BUGS / PROBLEMS / ANNOYANCES WITH v4.0
--------------------------------------

OPENING MOD IN TESCS WILL GET WARNING

The phantom's "outfit" is just using the old "body parts made from armor" trick.  IE: I made a "Lilarcor" race, then created body parts for it using Netch leather pieces and such.  Unfortunately, to get the gloves/hands to work right, I had to do the double hand trick, IE: make Hands1st (using a hands/gloves.1st.nif file), then make a Hands2nd (using the second .nif file).  It works ok, but if you open the mod, you'll get a warning message saying there's already a previous "hand" body part for Lil_Actor race.  Annoying, but oh well.  Just click to keep the program going and you can screw with the mod just fine.


'GHOST' SOLIDIFIES SOMETIMES

I tried using "SetChameleon, 50" in the phantom's script, but it didn't seem to 'ghost' the npc.  So, I had to rely upon the "Spellmaking > ghost ability" (which the Azura's cave ghosts use).  The phantom looks specteral, but after summoning him for the first time, if you ask him to "toggle his flames", he goes solid.  He also seems to go solid if he upgrades the sword while carrying it.  Since both the "flames" and the sword are objects getting added to the phantom's inventory, I guess this has something to do with using AddItem on a 'ghosted' person.


PHANTOM IDLE/ATTACK SPEECH OVERLAPS

The phantom uses the SayDone and detection of the Lil's DisintegrateWeapon enchantment flag (Lil's combat frenzy enchantment) to see if he should be doing combat speech or idle banter.  However, I also used Attack Dialogue Voices.  While these seem to check SayDone to keep from over-running speech already going, there are rare instances where they seem to overlap idle banter (most likely on occasions where the idle banter starts running the moment the Player starts combat with something...Lil will pipe in with combat speech, and they may overlap each other).

Also, as player changes cells, the actor disables and a new one enables.  As such, the new one's timer = 0, effectively reseting it.  So, if the Player's moving fast, all the actor "refreshing" can potentially keep actor timers from ever hitting 20, so it will seem like idle banter is off, or only running once in a blue moon, even when Player's told Lil to idle banter up a storm.  

I tried a lower setting, but at low skill levels, the actor has trouble hitting in combat.  As such, his idle banter Timer can rack up since he hasn't scored a hit to reset it.  If he misses a lot, the idle banter Timer will think he's out of combat (because he hasn't hit anything), and he'll spout off idle banter in the middle of a fight (which is awkward).  Or, worse, if he's ready to upgrade, the actor's sword will upgrade in the middle of a fight, which makes it disappear from his hands even though he still keeps the "wielding sword" pose.  He'll continue hitting folks with an invisible sword that's not there until combat is over.  This is really wierd looking, and may even still happen if the actor misses a lot and the idle banter Timer goes over 20!  But, I'm not sure of a better way to solve this problem.


POSSIBLE PLAYER/PHANTOM SPEECH OVERLAPS

Because Lil's speech can come from both the Player (when carrying the sword), or the phantom (when the phantom's activated), there can be times of speech "overlap".  EG: If the phantom's saying something (like idle banter), and the Player recalls Lil to his/her pack, the phantom may continue finishing their speech while the Player ends up queuing another by equipping Lil on their paperdoll.


WON'T FIGHT OCCASIONALLY

I noticed if you go around beating up on innocent folks (not that I was wholesale slaughtering the townsfolk of Seyda Neen on a regular basis while testing Lil...no, not me!), Lil's phantom may simply stand around staring at you with the sword drawn, but not attacking after a while.

I'm pretty sure this means he'd like to kick your ass, but his scripting gives him a "prime directive" to auto-stop combat when Player attacks him or if he's trying to attack the Player.  I'm not sure if he stands around because he was hit by the Player too much (which I doubt, cause I checked this), or if it's because the Player has too high of a crime rating (from hitting/killing innocent people), and Lil (being an NPC) wants to retaliate against the Player like regular law-abiding NPC's that notice the Player being an assaulting/murdering git.

Anyways, the work around to this is to just go to another cell, and Lil will "refresh" (his old phantom deactivates and a new one appears every time player enters a new cell).  Or, you can unsummon him, then summon him again.


PROBLEM WITH TELEPORTATION / "FAST" TRAVEL (Silt Strider, Boat)

When Player does any cell change while phantom Lil is following, a global script (Lil_Global_ActorOn) deactivates the previous phantom & creates a new one next to Player to "refresh" him.  This is done to refresh him, keep him from getting lost, and to ensure he goes with you between interior-to-exterior cell transitions (and vice-versa), instead of having to be sure his ass is right next to the door before you enter/exit some place.

While this cell change "refreshing" works for normal "foot" travel cell transitions, it only works sometimes for "fast" travel, and seems to never work for teleportation travel.  In other words, sometimes after "fast" travel, and (almost?) always after teleportation, the phantom won't be respawned next to you.

I can't seem to get any scripting to fix this.  I thought it was due to the "Loading" progress meter taking a while and possibly scripts were still running while it was (IE: if that were the case, then my global script would be creating a new phantom in the player's old cell, then when the player reached their new cell, the phantom wouldn't be there.)  So, I tried a delay Timer with the global script, but to no avail.  Teleportation cell changes just won't let him activate on the other end once you've arrived.

Anyays, there's several work-arounds for this.  

1) (Most obvious) Unsummon Lil's phantom before you do any teleporting or "fast" travel.  This gets annoying, though, since you have to remember to do so.

2) Teleport / "Fast" Travel as usual, and when you arrive at your destination, cast Lil's "Summon Lilarcor's Spirit" spell to bring up his options menu if his phantom's not around.  Select "Summon/Unsummon phantom", and the global script will return the proper Lil to you, and set it so you can summon him again.  (The old phantom in your previous cell will auto-deactivate since you did a cell change, so don't worry about him.)

3) Teleport / "Fast" Travel as usual, and after arriving at your destination, if the phantom's not with you, simply walk/run somewhere to do a non-teleport cell change (IE: travel over land a bit to an adjacent exterior cell, or go inside to an interior cell, or outside to an exterior cell, etc).  The moment you enter a new cell, the global script will recognize the flags indicating the phantom's supposed to be hanging around, and create a new one next to you that will work like normal.


DISABLED NPC PHANTOMS PILE UP

I use the "Disable" function a lot to disable old phantoms and create new ones, especially when:

A) player unsummons Lil (old phantom is disable)

B) player gets greater then 1500 distance away from phantom...the distant phantom disables and a new one is created next to player

C) player changes cells and the old phantom following him is disabled while a new one is created next to PC (kinda like Mad_Maxx's riding objects, where the object is refreshed each cell in order to keep it's bearings with you)

The problem is, after a while, all these disabled NPC's start to pile up.  I know Tribunal has a SetDelete command that can be used to actually delete out disabled things from the game world.  But, I don't have Tribunal, so I did the best I knew how to do with what I had.  So, what I did was:

1) Make sure to set actor health to -100 before they're disabled.  IE: kill them before disabling.  I know corpses w/o "persistance" checked will decay over time, but I'm not sure if disabled corpses will or not.  But, I'm hoping it does.

2) The phantom script is (naturally) designed to cut out first thing if the actor's disabled.  But, they can still pile up.  Oh well.


MISC COMMENTS
-------------
I'm only using original Morrowind (no Tribunal or Blood Moon), so follower/companion options were a bit limited.  Like any smart person, I checked out how others did things first to get a good start, figure out what problems may exist, and see how they over-came them.  I namely checked out:

* UlfGeir's "Slave Warrior Jessica" mod (v1.1) -- I remember Slave Warrior Jessica was the first well-done companion mod created when folks were starting to get into (and getting good at) scripting.  She wandered the country-side with me when I was playing Morrowind a year or so ago, so it was good to check her out (uh, no pun intended).  Scoping out UlfGeir's mod helped me figure out the dialogue system, so it helped out a lot.

* ???'s "Companion Iekknat" mod -- I checked it out because it worked with Morrowind w/o needing Tribunal/Bloodmoon.  I didn't actually play Morrowind and go get the character to see how he operated.  I just looked through the scripting/dialogue and go the idea of what he did.  Helped out a lot with learning to use/create dialogue, as well, so thanks to whomever created the mod (there was no name in the readme file, so I can't tell).

* I tried checking out the "Indiana James" & "Laura Craft" mods, since from the sounds of it, they're some of the most advanced companion mods you can get.  I wanted to see how they managed to solve certain problems, like accidentally hitting the NPC and pissing it off, or it roaming off/getting lost and then having to hunt it down, or stealing from it and pissing it off, etc.  Thought I'd save myself lots of time trying to re-invent the wheel if I could look over their scripts and then modify or adapt what they did to work for a phantom sword you can summon/unsummon.  Alas, I don't have Tribunal or Blood Moon, though, so I couldn't check them out (rats!)


But, in reading the descriptions of Indiana James/Laura Craft, the ideas were dead-on, pointing out what needs to be done to make a good, self-sufficient companion that does what it's supposed to do: help you out rather then you having to baby sit it.  So, I started with the base of Jessica & Iekknat to learn dialogue and implemented ideas from Indiana/Laura.  EG: Warping the NPC to Player if the distance between the 2 was too great, shutting down hostility towards Player if you accidentally tag the NPC, etc.  Again, not my original ideas, just me taking notice of other good companion mods and implementing the ideas in mine because they're good ideas!  I'm not sure if the way I implemented them is different or similar to other folks' companion mods, but I feel the results are near the same (IE: A companion that sticks with the Player, takes care of himself, takes care of "refreshing/repairing" his own weapons & gear, etc.)

What I had to add was the leveling up/swapping out of the sword while the phantom used him, and also options to deactivate the phantom and return the sword if the player chose such or did something to prevent the phantom from following (like levitating, flying, etc)

Regardless, the point is, most of the ideas in this mod were originated in other companion mods.  I don't consider it "plagirizing" their work if I admit that the ideas weren't original.  I may have implemented them differently from others, but the concept was the same.