Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
imported>JustinOther
m (→‎Script to make an item cast a spell: Condensed properties, optimized slightly via removal of unnecessary '&&')
imported>Sollar
Line 822: Line 822:


Function FeedCompanion()
Function FeedCompanion()
ObjectReference foodItem = None
AddInventoryEventFilter(FoodList)
int indexPos = FoodList.GetSize()
ShowGiftMenu(True, FoodList, False, False)
While(indexPos > 0)
RemoveAllInventoryEventFilters()
indexPos -= 1
foodItem = FoodList.GetAt(indexPos) as ObjectReference
AddInventoryEventFilter(foodItem)
EndWhile
Self.ShowGiftMenu(true, FoodList, false, False)
Self.RemoveAllInventoryEventFilters()
EndFunction
EndFunction


Line 836: Line 830:
If akSourceContainer == Game.GetPlayer()
If akSourceContainer == Game.GetPlayer()
self.RemoveItem(akBaseItem,aiItemCount)
self.RemoveItem(akBaseItem,aiItemCount)
If hasBeenFedToday == False
If !hasBeenFedToday
hasBeenFedToday=True
hasBeenFedToday=True
EndIf
EndIf
Anonymous user

Navigation menu