Browse Source

custom races

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
7153216f09
  1. 3
      src/engine/Enum.java
  2. 4
      src/engine/InterestManagement/HeightMap.java
  3. 2
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  4. 4
      src/engine/net/client/msg/CityZoneMsg.java
  5. 3
      src/engine/net/client/msg/login/CommitNewCharacterMsg.java
  6. 50
      src/engine/objects/Race.java
  7. 4
      src/engine/objects/Zone.java

3
src/engine/Enum.java

@ -152,7 +152,8 @@ public class Enum {
NEPHFEMALE(2026, MonsterType.Nephilim, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.1f), NEPHFEMALE(2026, MonsterType.Nephilim, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.1f),
HALFGIANTFEMALE(2027, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.15f), HALFGIANTFEMALE(2027, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.FEMALE, 1.15f),
VAMPMALE(2028, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.MALE, 1), VAMPMALE(2028, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.MALE, 1),
VAMPFEMALE(2029, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.FEMALE, 1); VAMPFEMALE(2029, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.FEMALE, 1),
SAETOR(1999, MonsterType.Monster, RunSpeed.STANDARD, CharacterSex.MALE, 0.80000001f);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private static HashMap<Integer, RaceType> _raceTypeByID = new HashMap<>(); private static HashMap<Integer, RaceType> _raceTypeByID = new HashMap<>();

4
src/engine/InterestManagement/HeightMap.java

@ -116,8 +116,8 @@ public class HeightMap {
this.heightMapID = 999999; this.heightMapID = 999999;
this.maxHeight = 5; // for real... this.maxHeight = 5; // for real...
int halfExtentsX = (int) Enum.CityBoundsType.GRID.extents; int halfExtentsX = (int) Enum.CityBoundsType.ZONE.extents;
int halfExtentsY = (int) Enum.CityBoundsType.GRID.extents; int halfExtentsY = (int) Enum.CityBoundsType.ZONE.extents;
this.zoneLoadID = 0; this.zoneLoadID = 0;
this.seaLevel = 0; this.seaLevel = 0;
this.outsetX = 128; this.outsetX = 128;

2
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -805,7 +805,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
// Update guild binds and tags // Update guild binds and tags
//load the new city on the clients //load the new city on the clients
CityZoneMsg czm = new CityZoneMsg(1, treeObject.getLoc().x, treeObject.getLoc().y, treeObject.getLoc().z, cityObject.getCityName(), zoneObject, Enum.CityBoundsType.GRID.extents, Enum.CityBoundsType.GRID.extents); CityZoneMsg czm = new CityZoneMsg(1, treeObject.getLoc().x, treeObject.getLoc().y, treeObject.getLoc().z, cityObject.getCityName(), zoneObject, Enum.CityBoundsType.ZONE.extents, Enum.CityBoundsType.ZONE.extents);
DispatchMessage.dispatchMsgToAll(czm); DispatchMessage.dispatchMsgToAll(czm);
GuildManager.updateAllGuildBinds(playerNation, cityObject); GuildManager.updateAllGuildBinds(playerNation, cityObject);

4
src/engine/net/client/msg/CityZoneMsg.java

@ -43,8 +43,8 @@ public class CityZoneMsg extends ClientNetMsg {
this.locY = locY; this.locY = locY;
this.locZ = locZ; this.locZ = locZ;
this.name = name; this.name = name;
this.radiusX = Enum.CityBoundsType.GRID.extents; this.radiusX = Enum.CityBoundsType.ZONE.extents;
this.radiusZ = Enum.CityBoundsType.GRID.extents; this.radiusZ = Enum.CityBoundsType.ZONE.extents;
this.unknown01 = 0; this.unknown01 = 0;
} }

3
src/engine/net/client/msg/login/CommitNewCharacterMsg.java

@ -15,6 +15,7 @@ import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.client.Protocol; import engine.net.client.Protocol;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.objects.Race;
public class CommitNewCharacterMsg extends ClientNetMsg { public class CommitNewCharacterMsg extends ClientNetMsg {
@ -175,7 +176,7 @@ public class CommitNewCharacterMsg extends ClientNetMsg {
public int getRace() { public int getRace() {
for (int i = 0; i < 23; i++) for (int i = 0; i < 23; i++)
if (this.runes[i] > 1999 && this.runes[i] < 2030) if(Race.getRace(this.runes[i]) != null)
return this.runes[i]; return this.runes[i];
return 0; return 0;
} }

50
src/engine/objects/Race.java

@ -12,6 +12,7 @@ package engine.objects;
import engine.Enum; import engine.Enum;
import engine.Enum.RaceType; import engine.Enum.RaceType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3f;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -107,8 +108,57 @@ public class Race {
} }
//Custom Race constructor
Race(int id, String name, String description, Vector3f str,Vector3f dex, Vector3f con, Vector3f intel, Vector3f spi,byte startingPoints,int token, short healthBonus, short stamBonus,float minHeight, short manaBonus,ArrayList<BaseClass> baseClasses,ArrayList<SkillReq> skillsGranted,ArrayList<PowerReq> powersGranted,ArrayList<MobBaseEffects> effectsList){
this.raceRuneID = id;
this.raceType = Enum.RaceType.getRaceTypebyRuneID(raceRuneID);
this.name = name;
this.description = description;
this.strStart = (short)str.x;
this.strMin = (short)str.y;
this.strMax = (short)str.z;
this.dexStart = (short)dex.x;
this.dexMin = (short)dex.y;
this.dexMax = (short)dex.z;
this.conStart = (short)con.x;
this.conMin = (short)con.y;
this.conMax = (short)con.z;
this.intStart = (short)intel.x;
this.intMin = (short)intel.y;
this.intMax = (short)intel.z;
this.spiStart = (short)spi.x;
this.spiMin = (short)spi.y;
this.spiMax = (short)spi.z;
this.token = token;
this.healthBonus = healthBonus;
this.manaBonus = manaBonus;
this.staminaBonus = stamBonus;
this.startingPoints = startingPoints;
this.raceType = RaceType.getRaceTypebyRuneID(this.raceRuneID);
this.minHeight = minHeight;
this.strHeightMod = 0.005882f;
this.hairStyles = null;
this.beardStyles = null;
this.skinColors = null;
this.beardColors = null;
this.hairColors = null;
this.baseClasses = baseClasses;
this.skillsGranted = skillsGranted;
this.powersGranted = powersGranted;
this.effectsList = effectsList;
}
public static void loadAllRaces() { public static void loadAllRaces() {
Race._raceByID = DbManager.RaceQueries.LOAD_ALL_RACES(); Race._raceByID = DbManager.RaceQueries.LOAD_ALL_RACES();
//create Saetor race
ArrayList<BaseClass> baseClassesSaetor = new ArrayList<>();
ArrayList<SkillReq> skillsGrantedSaetor = new ArrayList<>();
ArrayList<PowerReq> powersGrantedSaetor = new ArrayList<>();
ArrayList<MobBaseEffects> effectsListSaetor = new ArrayList<>();
Race saetor = new Race(1999,"Saetor","Half goat half man, the Saetor race does the bidding of the Choas Gods.",new Vector3f(35,30,85),new Vector3f(55,50,120),new Vector3f(50,45,115),new Vector3f(45,40,110),new Vector3f(35,30,85),(byte)10,19991999,(short)0,(short)0,5.0f,(short)0,baseClassesSaetor,skillsGrantedSaetor,powersGrantedSaetor,effectsListSaetor);
Race._raceByID.put(1999,saetor);
} }
public static Race getRace(int id) { public static Race getRace(int id) {

4
src/engine/objects/Zone.java

@ -113,8 +113,8 @@ public class Zone extends AbstractGameObject {
if (zone.playerCityID > 0) { if (zone.playerCityID > 0) {
writer.put((byte) 1); // Player City - True writer.put((byte) 1); // Player City - True
writer.putFloat(Enum.CityBoundsType.GRID.extents); writer.putFloat(Enum.CityBoundsType.ZONE.extents);
writer.putFloat(Enum.CityBoundsType.GRID.extents); writer.putFloat(Enum.CityBoundsType.ZONE.extents);
} else } else
writer.put((byte) 0); // Player City - False writer.put((byte) 0); // Player City - False

Loading…
Cancel
Save