enderalse/scripts/source/_00e_playerhousing_furnitureitem.psc

53 lines
1.9 KiB
Plaintext

scriptname _00E_Playerhousing_FurnitureItem extends ObjectReference
{A manipulatable housing object while being in the players inventory}
Actorbase Property _MANNEQUIN_toCreate auto
furniture Property _FURNITURE_toCreate auto
Container Property _CONTAINER_toCreate auto
Light Property _LIGHT_toCreate auto
MiscObject Property _MISC_toCreate Auto
Activator Property _ACTIVATOR_toCreate Auto
_00E_PlayerhousingMaster Property master Auto
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if akNewContainer == none
if master == none
Debug.messagebox("ERROR: PlayerhousingMaster property in Playerhousingfurnitureitem is missing, please write a bugticket")
return
endif
if master.canPlaceItem()
master.playerItemDropped(Self)
else
master.cannotPlaceObjectHere.show()
Game.getplayer().additem((self ), 1, true)
endif
endif
ENDevent
_00E_Playerhousing_Furniture function placeFurnitureAtMe()
_00E_Playerhousing_Furniture result = None
if _MANNEQUIN_toCreate
result = placeAtMe(_MANNEQUIN_toCreate, abForcePersist = true) as _00E_Playerhousing_Furniture
elseif _FURNITURE_toCreate
result = placeAtMe(_FURNITURE_toCreate) as _00E_Playerhousing_Furniture
elseif _CONTAINER_toCreate
result = placeAtMe(_CONTAINER_toCreate) as _00E_Playerhousing_Furniture
elseif _LIGHT_toCreate
result = placeAtMe(_LIGHT_toCreate) as _00E_Playerhousing_Furniture
elseif _ACTIVATOR_toCreate
result = placeAtMe(_ACTIVATOR_toCreate) as _00E_Playerhousing_Furniture
elseif _MISC_toCreate
result = placeAtMe(_MISC_toCreate) as _00E_Playerhousing_Furniture
else
Debug.MessageBox("ERROR: *_toCreate property in playerhousingfurnitureitem is missing, please write a bugticket")
return None
ENDif
if result == None
Debug.MessageBox("ERROR: *_toCreate property in playerhousingfurnitureitem is no furnitureitem, please write a bugticket")
Endif
result.furnitureItem = Self
return result
ENDfunction