Changed Missionservice to use Datatable

Added Datatable for Terminaltypes
Changed Terminals to use Datatable
Changed Entertainermissions to use randomized Missions(still dont popup
in Mission browser)
This commit is contained in:
tacef
2014-08-11 21:58:01 +02:00
parent 98d16cfb3d
commit fc9fab4bcf
6 changed files with 48 additions and 8 deletions
@@ -1,7 +1,7 @@
import sys
from resources.datatables import TerminalType
def setup(core, object):
core.mapService.addLocation(object.getPlanet(), '@map_loc_cat_n:terminal_mission', object.getPosition().x, object.getPosition().z, 41, 44, 0)
object.setAttachment("terminalType", 1)
object.setAttachment("terminalType", TerminalType.GENERIC)
return
@@ -1,7 +1,8 @@
import sys
from resources.datatables import TerminalType
def setup(core, object):
object.setAttachment("terminalType", 4)
object.setAttachment("terminalType", TerminalType.ARTISAN)
core.mapService.addLocation(object.getPlanet(), '@map_loc_cat_n:terminal_mission_artisan', object.getPosition().x, object.getPosition().z, 41, 76, 0)
return
@@ -1,6 +1,7 @@
import sys
from resources.datatables import TerminalType
def setup(core, object):
object.setAttachment("terminalType", 2)
object.setAttachment("terminalType", TerminalType.BOUNTY)
core.mapService.addLocation(object.getPlanet(), '@map_loc_cat_n:terminal_mission_bounty', object.getPosition().x, object.getPosition().z, 41, 78, 0)
return
@@ -1,6 +1,7 @@
import sys
from resources.datatables import TerminalType
def setup(core, object):
object.setAttachment("terminalType", 3)
object.setAttachment("terminalType", TerminalType.ENTERTAINER)
core.mapService.addLocation(object.getPlanet(), '@map_loc_cat_n:terminal_mission_entertainer', object.getPosition().x, object.getPosition().z, 41, 75, 0)
return
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.datatables;
public class TerminalType {
public static final int GENERIC = 1;
public static final int BOUNTY = 2;
public static final int ENTERTAINER = 3;
public static final int ARTISAN = 4;
public static final int EXPLORER = 5;
}
+8 -3
View File
@@ -55,6 +55,7 @@ import resources.objects.creature.CreatureObject;
import resources.objects.mission.MissionObject;
import resources.objects.player.PlayerObject;
import resources.objects.tangible.TangibleObject;
import resources.datatables.TerminalType;
import engine.clientdata.StfTable;
import engine.clients.Client;
import engine.resources.common.CRC;
@@ -660,7 +661,8 @@ public class MissionService implements INetworkDispatch {
missionStf = "mission/mission_npc_dancer_neutral_easy";
}
mission.setMissionId(10);
mission.setMissionId(getRandomStringEntry(missionStf));
mission.setTitle("@" + missionStf + ":" + "m" + mission.getMissionId() + "t");
mission.setDescription("@" + missionStf + ":" + "m" + mission.getMissionId() + "o");
@@ -680,15 +682,18 @@ public class MissionService implements INetworkDispatch {
System.out.println("Profession: " + playera.getProfession());
System.out.println("Faction: " + creature.getFaction());
System.out.println("Difficulty: " + mission.getDifficultyLevel());
System.out.println("missionid: " + mission.getMissionId());
System.out.println("MissionTitle: " + mission.getTitle().getStfValue());
System.out.println("Missiondesc: " + mission.getDescription().getStfValue());
}
/*
public enum TerminalType {;
public static final int GENERIC = 1;
public static final int BOUNTY = 2;
public static final int ENTERTAINER = 3;
public static final int ARTISAN = 4;
public static final int EXPLORER = 5;
}
}*/
public Map<Long, BountyListItem> getBountyMap() {
return this.bountyMap;