1 import {Monster, MonsterForList} from "../../shared/monsters";
2 import {SocketEvent} from "../../server/socket-event.server";
3 import {getMonsterList} from "../../server/monster";
5 export const exploreInCity: SocketEvent = {
6 eventName: 'city:explore',
7 handler: async (api, data: { args: string }) => {
8 // @TODO add check to make sure player is in this town and can actually explore this area
9 const locationId = parseInt(data.args);
11 if(!locationId || isNaN(locationId)) {
15 const monsters: Monster[] = await getMonsterList(locationId);
16 let monsterList: MonsterForList[] = monsters.map(monster => {
24 api.socket.emit('explore:fights', monsterList);