|
|
|
@ -27,8 +27,14 @@ EndEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event OnLocationChange(Location akOldLoc, Location akNewLoc) |
|
|
|
|
|
|
|
|
|
bAtHome = akNewLoc && akNewLoc.HasKeyword(LocTypePlayerHouse) |
|
|
|
|
RegisterForSingleUpdate(3.0) ; wait until followers load into the location |
|
|
|
|
endEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event OnUpdate() |
|
|
|
|
|
|
|
|
|
;Debug.Notification("Follower index: " + iFollowerIndex) |
|
|
|
|
|
|
|
|
|
int iCurrentFollowers = 0; |
|
|
|
|
Actor[] aFollowers = Eddoursul_Functions.GetPlayerFollowers() |
|
|
|
@ -37,9 +43,12 @@ Event OnLocationChange(Location akOldLoc, Location akNewLoc) |
|
|
|
|
i -= 1 |
|
|
|
|
if ! aFollowers[i].IsDead() && ! aFollowers[i].IsDisabled() |
|
|
|
|
iCurrentFollowers += aFollowers[i].GetFormID() |
|
|
|
|
;Debug.Notification("Follower ID: " + aFollowers[i].GetFormID()) |
|
|
|
|
endif |
|
|
|
|
endwhile |
|
|
|
|
|
|
|
|
|
;Debug.Notification("New follower index: " + iCurrentFollowers) |
|
|
|
|
|
|
|
|
|
if iCurrentFollowers == iFollowerIndex |
|
|
|
|
return |
|
|
|
|
endif |
|
|
|
@ -72,7 +81,7 @@ Event OnLocationChange(Location akOldLoc, Location akNewLoc) |
|
|
|
|
Eddoursul_Functions.AddAllFormsToList(ETR_ItemsNew, 27, None, ETR_ExcludeFromNew) ; books |
|
|
|
|
Eddoursul_Functions.AddAllFormsToList(ETR_ItemsNew, 32, None, ETR_ExcludeFromNew) ; misc items |
|
|
|
|
|
|
|
|
|
endEvent |
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) |
|
|
|
@ -85,14 +94,17 @@ event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemRefe |
|
|
|
|
endif |
|
|
|
|
elseif ETR_PersistentStorageList.HasForm(akDestContainer) |
|
|
|
|
ETR_ItemsFound.RemoveAddedForm(akBaseItem) |
|
|
|
|
ETR_ItemsNew.RemoveAddedForm(akBaseItem) |
|
|
|
|
ETR_ItemsStored.AddForm(akBaseItem) |
|
|
|
|
Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsStored") |
|
|
|
|
return |
|
|
|
|
elseif bAtHome && akDestContainer.GetParentCell() != PlayerRef.GetParentCell() |
|
|
|
|
return |
|
|
|
|
endif |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
if bAtHome && (! akDestContainer || akDestContainer.GetParentCell() == PlayerRef.GetParentCell()) && Eddoursul_Functions.HasRefInCell(akBaseItem, None, true, ETR_PersistentStorageList) |
|
|
|
|
if bAtHome && (akDestContainer || Eddoursul_Functions.HasRefInCell(akBaseItem, None, true, ETR_PersistentStorageList)) |
|
|
|
|
|
|
|
|
|
ETR_ItemsFound.RemoveAddedForm(akBaseItem) |
|
|
|
|
ETR_ItemsStored.AddForm(akBaseItem) |
|
|
|
|
|
|
|
|
|
ObjectReference cellStorage = Eddoursul_Functions.GetOrCreateCellStorage(PlayerRef, ETR_PersistentStorageList, ETR_CellStorageContainer) |
|
|
|
|
|
|
|
|
@ -102,7 +114,6 @@ event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemRefe |
|
|
|
|
|
|
|
|
|
elseif PlayerRef.GetItemCount(akBaseItem) == 0 && Eddoursul_Functions.GetItemCountInActors(Eddoursul_Functions.GetPlayerFollowers(), akBaseItem) == 0 |
|
|
|
|
|
|
|
|
|
Debug.Notification("Moving " + akBaseItem.GetName() + " to ETR_ItemsNew") |
|
|
|
|
ETR_ItemsFound.RemoveAddedForm(akBaseItem) |
|
|
|
|
ETR_ItemsStored.RemoveAddedForm(akBaseItem) |
|
|
|
|
ETR_ItemsNew.AddForm(akBaseItem) |
|
|
|
|