mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-28 00:17:23 +00:00
265 lines
8.3 KiB
Python
265 lines
8.3 KiB
Python
|
components = {
|
||
|
'COMPONENT_TYPE_CONTROLLABLE_PHYSICS': 1,
|
||
|
'COMPONENT_TYPE_RENDER': 2,
|
||
|
'COMPONENT_TYPE_SIMPLE_PHYSICS': 3,
|
||
|
'COMPONENT_TYPE_CHARACTER': 4,
|
||
|
'COMPONENT_TYPE_SCRIPT': 5,
|
||
|
'COMPONENT_TYPE_BOUNCER': 6,
|
||
|
'COMPONENT_TYPE_DESTROYABLE': 7,
|
||
|
'COMPONENT_TYPE_GHOST': 8,
|
||
|
'COMPONENT_TYPE_SKILL': 9,
|
||
|
'COMPONENT_TYPE_SPAWNER': 10,
|
||
|
'COMPONENT_TYPE_ITEM': 11,
|
||
|
'COMPONENT_TYPE_MODULAR_BUILD': 12,
|
||
|
'COMPONENT_TYPE_BUILD_CONTROLLER': 13,
|
||
|
'COMPONENT_TYPE_REBUILD_ACTIVATOR': 14,
|
||
|
'COMPONENT_TYPE_ICON_ONLY': 15,
|
||
|
'COMPONENT_TYPE_VENDOR': 16,
|
||
|
'COMPONENT_TYPE_INVENTORY': 17,
|
||
|
'COMPONENT_TYPE_PROJECTILE_PHYSICS': 18,
|
||
|
'COMPONENT_TYPE_SHOOTING_GALLERY': 19,
|
||
|
'COMPONENT_TYPE_RIGID_BODY_PHANTOM_PHYSICS': 20,
|
||
|
'COMPONENT_TYPE_DROP_EFFECT': 21,
|
||
|
'COMPONENT_TYPE_CHEST': 22,
|
||
|
'COMPONENT_TYPE_COLLECTIBLE': 23,
|
||
|
'COMPONENT_TYPE_BLUEPRINT': 24,
|
||
|
'COMPONENT_TYPE_MOVING_PLATFORM': 25,
|
||
|
'COMPONENT_TYPE_PET': 26,
|
||
|
'COMPONENT_TYPE_PLATFORM_BOUNDARY': 27,
|
||
|
'COMPONENT_TYPE_MODULE': 28,
|
||
|
'COMPONENT_TYPE_ARCADE': 29,
|
||
|
'COMPONENT_TYPE_HAVOK_VEHICLE_PHYSICS': 30,
|
||
|
'COMPONENT_TYPE_MOVEMENT_AI': 31,
|
||
|
'COMPONENT_TYPE_EXHIBIT': 32,
|
||
|
'COMPONENT_TYPE_OVERHEAD_ICON': 33,
|
||
|
'COMPONENT_TYPE_PET_CONTROL': 34,
|
||
|
'COMPONENT_TYPE_MINIFIG': 35,
|
||
|
'COMPONENT_TYPE_PROPERTY': 36,
|
||
|
'COMPONENT_TYPE_PET_CREATOR': 37,
|
||
|
'COMPONENT_TYPE_MODEL_BUILDER': 38,
|
||
|
'COMPONENT_TYPE_SCRIPTED_ACTIVITY': 39,
|
||
|
'COMPONENT_TYPE_PHANTOM_PHYSICS': 40,
|
||
|
'COMPONENT_TYPE_SPRING_PAD': 41,
|
||
|
'COMPONENT_TYPE_MODEL': 42,
|
||
|
'COMPONENT_TYPE_PROPERTY_ENTRANCE': 43,
|
||
|
'COMPONENT_TYPE_FX': 44,
|
||
|
'COMPONENT_TYPE_PROPERTY_MANAGEMENT': 45,
|
||
|
'COMPONENT_TYPE_VEHICLE_PHYSICS': 46,
|
||
|
'COMPONENT_TYPE_PHYSICS_SYSTEM': 47,
|
||
|
'COMPONENT_TYPE_REBUILD': 48,
|
||
|
'COMPONENT_TYPE_SWITCH': 49,
|
||
|
'COMPONENT_TYPE_ZONE_CONTROL': 50,
|
||
|
'COMPONENT_TYPE_CHANGELING': 51,
|
||
|
'COMPONENT_TYPE_CHOICE_BUILD': 52,
|
||
|
'COMPONENT_TYPE_PACKAGE': 53,
|
||
|
'COMPONENT_TYPE_SOUND_REPEATER': 54,
|
||
|
'COMPONENT_TYPE_SOUND_AMBIENT_2D': 55,
|
||
|
'COMPONENT_TYPE_SOUND_AMBIENT_3D': 56,
|
||
|
'COMPONENT_TYPE_PRECONDITION': 57,
|
||
|
'COMPONENT_TYPE_PLAYER_FLAG': 58,
|
||
|
'COMPONENT_TYPE_CUSTOM_BUILD_ASSEMBLY': 59,
|
||
|
'COMPONENT_TYPE_BASE_COMBAT_AI': 60,
|
||
|
'COMPONENT_TYPE_MODULE_ASSEMBLY': 61,
|
||
|
'COMPONENT_TYPE_SHOWCASE_MODEL_HANDLER': 62,
|
||
|
'COMPONENT_TYPE_RACING_MODULE': 63,
|
||
|
'COMPONENT_TYPE_GENERIC_ACTIVATOR': 64,
|
||
|
'COMPONENT_TYPE_PROPERTY_VENDOR': 65,
|
||
|
'COMPONENT_TYPE_HF_LIGHT_DIRECTION_GADGET': 66,
|
||
|
'COMPONENT_TYPE_ROCKET_LAUNCH': 67,
|
||
|
'COMPONENT_TYPE_ROCKET_LANDING_COMPONENT': 68,
|
||
|
'COMPONENT_TYPE_TRIGGER': 69,
|
||
|
'COMPONENT_TYPE_DROPPED_LOOT': 70,
|
||
|
'COMPONENT_TYPE_RACING_CONTROL': 71,
|
||
|
'COMPONENT_TYPE_FACTION_TRIGGER': 72,
|
||
|
'COMPONENT_TYPE_MISSION_OFFER': 73,
|
||
|
'COMPONENT_TYPE_RACING_STATS': 74,
|
||
|
'COMPONENT_TYPE_LUP_EXHIBIT': 75,
|
||
|
'COMPONENT_TYPE_BBB': 76,
|
||
|
'COMPONENT_TYPE_SOUND_TRIGGER': 77,
|
||
|
'COMPONENT_TYPE_PROXIMITY_MONITOR': 78,
|
||
|
'COMPONENT_TYPE_RACING_SOUND_TRIGGER': 79,
|
||
|
'COMPONENT_TYPE_CHAT': 80,
|
||
|
'COMPONENT_TYPE_FRIENDS_LIST': 81,
|
||
|
'COMPONENT_TYPE_GUILD': 82,
|
||
|
'COMPONENT_TYPE_LOCAL_SYSTEM': 83,
|
||
|
'COMPONENT_TYPE_MISSION': 84,
|
||
|
'COMPONENT_TYPE_MUTUABLE_MODEL_BEHAVIORS': 85,
|
||
|
'COMPONENT_TYPE_PATHFINDING_CONTROL': 86,
|
||
|
'COMPONENT_TYPE_PLAYER_PET_TAMING': 87,
|
||
|
'COMPONENT_TYPE_PROPERTY_EDITOR': 88,
|
||
|
'COMPONENT_TYPE_SKINNED_RENDER': 89,
|
||
|
'COMPONENT_TYPE_SLASH_COMMAND': 90,
|
||
|
'COMPONENT_TYPE_STATUS_EFFECT': 91,
|
||
|
'COMPONENT_TYPE_TEAMS': 92,
|
||
|
'COMPONENT_TYPE_TEXT_EFFECT': 93,
|
||
|
'COMPONENT_TYPE_TRADE': 94,
|
||
|
'COMPONENT_TYPE_USER_CONTROL': 95,
|
||
|
'COMPONENT_TYPE_IGNORE_LIST': 96,
|
||
|
'COMPONENT_TYPE_ROCKET_LAUNCH_LUP': 97,
|
||
|
'COMPONENT_TYPE_BUFF': 98,
|
||
|
'COMPONENT_TYPE_INTERACTION_MANAGER': 99,
|
||
|
'COMPONENT_TYPE_DONATION_VENDOR': 100,
|
||
|
'COMPONENT_TYPE_COMBAT_MEDIATOR': 101,
|
||
|
'COMPONENT_TYPE_ACHIEVEMENT_VENDOR': 102,
|
||
|
'COMPONENT_TYPE_GATE_RUSH': 103,
|
||
|
'COMPONENT_TYPE_RAIL_ACTIVATOR': 104,
|
||
|
'COMPONENT_TYPE_ROLLER': 105,
|
||
|
'COMPONENT_TYPE_PLAYER_FORCED_MOVEMENT': 106,
|
||
|
'COMPONENT_TYPE_CRAFTING': 107,
|
||
|
'COMPONENT_TYPE_POSSESSABLE': 108,
|
||
|
'COMPONENT_TYPE_LEVEL_PROGRESSION': 109,
|
||
|
'COMPONENT_TYPE_POSSESSOR': 110,
|
||
|
'COMPONENT_TYPE_MOUNT_CONTROL': 111,
|
||
|
'UNKNOWN_112': 112,
|
||
|
'COMPONENT_TYPE_PROPERTY_PLAQUE': 113,
|
||
|
'COMPONENT_TYPE_BUILD_BORDER': 114,
|
||
|
'UNKNOWN_115': 115,
|
||
|
'COMPONENT_TYPE_CULLING_PLANE': 116,
|
||
|
'INVALID': 4294967295
|
||
|
}
|
||
|
|
||
|
component_initialization_order = [
|
||
|
'COMPONENT_TYPE_POSSESSABLE',
|
||
|
'COMPONENT_TYPE_BLUEPRINT',
|
||
|
'COMPONENT_TYPE_MODULE_ASSEMBLY',
|
||
|
'COMPONENT_TYPE_CONTROLLABLE_PHYSICS',
|
||
|
'COMPONENT_TYPE_PROJECTILE_PHYSICS',
|
||
|
'COMPONENT_TYPE_PHYSICS_SYSTEM',
|
||
|
'COMPONENT_TYPE_VEHICLE_PHYSICS',
|
||
|
'COMPONENT_TYPE_HAVOK_VEHICLE_PHYSICS',
|
||
|
'COMPONENT_TYPE_RIGID_BODY_PHANTOM_PHYSICS',
|
||
|
'COMPONENT_TYPE_SIMPLE_PHYSICS',
|
||
|
'COMPONENT_TYPE_PHANTOM_PHYSICS',
|
||
|
'COMPONENT_TYPE_DESTROYABLE',
|
||
|
'COMPONENT_TYPE_MINIFIG',
|
||
|
'COMPONENT_TYPE_CHARACTER',
|
||
|
'COMPONENT_TYPE_PLAYER_FORCED_MOVEMENT',
|
||
|
'COMPONENT_TYPE_POSSESSOR',
|
||
|
'COMPONENT_TYPE_MOUNT_CONTROL',
|
||
|
'COMPONENT_TYPE_PET',
|
||
|
'COMPONENT_TYPE_INVENTORY',
|
||
|
'COMPONENT_TYPE_PROXIMITY_MONITOR',
|
||
|
'COMPONENT_TYPE_MOVEMENT_AI',
|
||
|
'COMPONENT_TYPE_SCRIPT',
|
||
|
'COMPONENT_TYPE_SKILL',
|
||
|
'COMPONENT_TYPE_BASE_COMBAT_AI',
|
||
|
'COMPONENT_TYPE_SPAWNER',
|
||
|
'COMPONENT_TYPE_ITEM',
|
||
|
'COMPONENT_TYPE_REBUILD',
|
||
|
'COMPONENT_TYPE_BUILD_BORDER',
|
||
|
'COMPONENT_TYPE_MODULE',
|
||
|
'COMPONENT_TYPE_BUILD_CONTROLLER',
|
||
|
'COMPONENT_TYPE_REBUILD_ACTIVATOR',
|
||
|
'COMPONENT_TYPE_MODULAR_BUILD',
|
||
|
'COMPONENT_TYPE_MISSION_OFFER',
|
||
|
'COMPONENT_TYPE_VENDOR',
|
||
|
'COMPONENT_TYPE_DONATION_VENDOR',
|
||
|
'COMPONENT_TYPE_ACHIEVEMENT_VENDOR',
|
||
|
'COMPONENT_TYPE_SHOOTING_GALLERY',
|
||
|
'COMPONENT_TYPE_ROLLER',
|
||
|
'COMPONENT_TYPE_SCRIPTED_ACTIVITY',
|
||
|
'COMPONENT_TYPE_COLLECTIBLE',
|
||
|
'COMPONENT_TYPE_MOVING_PLATFORM',
|
||
|
'COMPONENT_TYPE_CHANGELING',
|
||
|
'COMPONENT_TYPE_CHOICE_BUILD',
|
||
|
'COMPONENT_TYPE_PACKAGE',
|
||
|
'COMPONENT_TYPE_PLATFORM_BOUNDARY',
|
||
|
'COMPONENT_TYPE_HF_LIGHT_DIRECTION_GADGET',
|
||
|
'COMPONENT_TYPE_CULLING_PLANE',
|
||
|
'COMPONENT_TYPE_EXHIBIT',
|
||
|
'COMPONENT_TYPE_LUP_EXHIBIT',
|
||
|
'COMPONENT_TYPE_PROPERTY',
|
||
|
'COMPONENT_TYPE_PROPERTY_PLAQUE',
|
||
|
'COMPONENT_TYPE_MODEL',
|
||
|
'COMPONENT_TYPE_PROPERTY_ENTRANCE',
|
||
|
'COMPONENT_TYPE_ROCKET_LAUNCH_LUP',
|
||
|
'COMPONENT_TYPE_PROPERTY_MANAGEMENT',
|
||
|
'COMPONENT_TYPE_RAIL_ACTIVATOR',
|
||
|
'COMPONENT_TYPE_BOUNCER',
|
||
|
'COMPONENT_TYPE_SPRING_PAD',
|
||
|
'COMPONENT_TYPE_SWITCH',
|
||
|
'COMPONENT_TYPE_ZONE_CONTROL',
|
||
|
'COMPONENT_TYPE_MODEL_BUILDER',
|
||
|
'COMPONENT_TYPE_SOUND_REPEATER',
|
||
|
'COMPONENT_TYPE_CHEST',
|
||
|
'COMPONENT_TYPE_SHOWCASE_MODEL_HANDLER',
|
||
|
'COMPONENT_TYPE_ARCADE',
|
||
|
'COMPONENT_TYPE_RENDER',
|
||
|
'COMPONENT_TYPE_SOUND_AMBIENT_2D',
|
||
|
'COMPONENT_TYPE_SOUND_AMBIENT_3D',
|
||
|
'COMPONENT_TYPE_SOUND_TRIGGER',
|
||
|
'COMPONENT_TYPE_RACING_SOUND_TRIGGER',
|
||
|
'COMPONENT_TYPE_CUSTOM_BUILD_ASSEMBLY',
|
||
|
'COMPONENT_TYPE_GENERIC_ACTIVATOR',
|
||
|
'COMPONENT_TYPE_PROPERTY_VENDOR',
|
||
|
'COMPONENT_TYPE_ROCKET_LAUNCH',
|
||
|
'COMPONENT_TYPE_ROCKET_LANDING_COMPONENT',
|
||
|
'COMPONENT_TYPE_FACTION_TRIGGER',
|
||
|
'COMPONENT_TYPE_RACING_CONTROL',
|
||
|
'COMPONENT_TYPE_GATE_RUSH',
|
||
|
'COMPONENT_TYPE_BBB',
|
||
|
'COMPONENT_TYPE_CRAFTING'
|
||
|
]
|
||
|
component_order_as_ints = {}
|
||
|
|
||
|
component_int_to_name = {}
|
||
|
|
||
|
for component in component_initialization_order:
|
||
|
component_order_as_ints[components[component]] = component
|
||
|
|
||
|
for component in components:
|
||
|
component_int_to_name[components[component]] = component
|
||
|
|
||
|
class GameObject:
|
||
|
type = ""
|
||
|
|
||
|
class ObjectLoadState:
|
||
|
createdGameObject = GameObject()
|
||
|
components = []
|
||
|
hasPhysicsComponent = False
|
||
|
hasDestroyable = False
|
||
|
hasPathfindingComponent = False
|
||
|
hasProximityMonitorComponent = False
|
||
|
hasScriptComponent = False
|
||
|
hasDroppedLootComponent = False
|
||
|
hasModelbehaviors = False
|
||
|
somethingOrNothing = False
|
||
|
physicsComponentId = -1
|
||
|
|
||
|
# Begin custom attributes
|
||
|
serializedOrder = []
|
||
|
hasMissionOffer = False
|
||
|
|
||
|
class NiPoint3:
|
||
|
x = 0.0
|
||
|
y = 0.0
|
||
|
z = 0.0
|
||
|
|
||
|
class NiQuaternion:
|
||
|
w = 0.0
|
||
|
x = 0.0
|
||
|
y = 0.0
|
||
|
z = 0.0
|
||
|
|
||
|
class LoadObject:
|
||
|
objId = 0
|
||
|
owner = 0
|
||
|
lotToSpawn = 0
|
||
|
isLocalPlayer = False
|
||
|
hasDropEffect = False
|
||
|
bIsSmashable = False
|
||
|
dynamicPhysics = False
|
||
|
spawnPosition = NiPoint3()
|
||
|
spawnRotation = NiQuaternion()
|
||
|
scale = 0.0
|
||
|
legoBrickID = 0
|
||
|
legoColorID = 0
|
||
|
configData = {}
|
||
|
isHFPaletteObject = False
|
||
|
objType = 0
|
||
|
useSimplePhysics = False
|
||
|
bDelayedLoad = False
|
||
|
|
||
|
# Don't know the name yet of this
|
||
|
field8_0x20 = True
|