def gobject_info(world_session, args): try: if args: max_distance = int(args) else: max_distance = 10 found_count = 0 for guid, gobject in list( MapManager.get_surrounding_gameobjects( world_session.player_mgr).items()): distance = world_session.player_mgr.location.distance( gobject.location) if distance <= max_distance: found_count += 1 ChatManager.send_system_message( world_session, f'[{gobject.gobject_template.name}] - Guid: {gobject.guid & ~HighGuid.HIGHGUID_GAMEOBJECT}, ' f'Entry: {gobject.gobject_template.entry}, ' f'Display ID: {gobject.current_display_id}, ' f'X: {gobject.location.x}, ' f'Y: {gobject.location.y}, ' f'Z: {gobject.location.z}, ' f'O: {gobject.location.o}, ' f'Map: {gobject.map_}, ' f'Distance: {distance}') return 0, f'{found_count} game objects found within {max_distance} distance units.' except ValueError: return -1, 'please specify a valid distance.'
def _handle_use_goober(self, player): # Deadmines IronClad door (After triggering cannon) # TODO: This should be moved somewhere else to avoid hardcoding entries in the core GameObject manager. # Future instance/map scripts? if self.entry == 16398: # Cannon. # TODO, scripting, instancing, etc. iron_clad_doors = [go for go in MapManager.get_surrounding_gameobjects(self).values() if go.entry == 16397] if len(iron_clad_doors) > 0: self.send_custom_animation(0) iron_clad_doors[0].set_active() else: Logger.warning(f'Unimplemented gameobject use for type Goober entry {self.entry} name {self.gobject_template.name}') pass