From 190d79777c5d6c29d1a61e5135eedc7c1db9a094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 5 Jun 2010 02:25:51 +0200 Subject: [PATCH] game: Add working Leave Counter function. Also fix leaving Lumilass. --- include/maps.hrl | 9 ++++++++- src/egs_game.erl | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/maps.hrl b/include/maps.hrl index 0c695be..5cbb8c4 100644 --- a/include/maps.hrl +++ b/include/maps.hrl @@ -36,7 +36,7 @@ { [1100000,11, 101], [{name, "Colony 2nd, Items Shop"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-11.nbl"}, {entries, [0]}] }, { [1100000,12, 101], [{name, "Colony 2nd, Weapons Shop"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-12.nbl"}, {entries, [1]}] }, { [1100000,13, 101], [{name, "Colony 2nd, Armors Shop"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-13.nbl"}, {entries, [2]}] }, - { [1100000,11, 102], [{name, "Colony 3rd, Lumilass"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-11.nbl"}, {entries, [2]}] }, + { [1100000,11, 102], [{name, "Colony 3rd, Lumilass"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-11.nbl"}, {entries, [2,7,8]}] }, { [1100000,12, 102], [{name, "Colony 3rd, Clothes Shop"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-12.nbl"}, {entries, [1]}] }, { [1100000,13, 102], [{name, "Colony 3rd, Parts Shop"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-13.nbl"}, {entries, [0]}] }, { [1100000,11, 103], [{name, "Colony Club"}, {quest, "data/lobby/colony.quest.nbl"}, {zone, "data/lobby/colony.zone-11.nbl"}, {entries, [0,1]}] }, @@ -107,3 +107,10 @@ { [1104000,0,900], [{name, "Spaceport"}, {quest, "data/lobby/spaceport.quest.nbl"}, {zone, "data/lobby/spaceport.zone.nbl"}, {entries, [0]}] } ]). + +%% EGS counters settings. Associate counter QuestID with the QuestID and ZoneID of the lobby containing the counter. + +-define(COUNTERS, [ + { 10497, [1100000, 0] }, % Colony 4th Floor + { 731394, [1100000,11] } % Colony 3rd, Lumilass +]). diff --git a/src/egs_game.erl b/src/egs_game.erl index 2082dd0..05eb02a 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -633,6 +633,13 @@ handle(16#0811, CSocket, GID, _, Orig) -> log(GID, "mission counter (~b,~b,~b,~b)", [Quest,MapType, MapNumber, MapEntry]), counter_load(CSocket, GID, Quest, MapType, MapNumber, MapEntry); +%% @doc Leave mission counter handler. Lobby values depend on which counter was entered. + +handle(16#0812, CSocket, GID, _, _) -> + User = egs_db:users_select(GID), + [QuestID, ZoneID] = proplists:get_value(User#users.quest, ?COUNTERS, [1100000, 0]), + lobby_load(CSocket, GID, QuestID, ZoneID, User#users.maptype, User#users.mapnumber); + %% @doc Start mission handler. Packet contains the selected mission number. %% @todo Load more than one mission.