diff --git a/src/engine/Enum.java b/src/engine/Enum.java index c1ef22b1..46a0e02c 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -88,28 +88,6 @@ public class Enum { } - public enum AggroType implements EnumBitSetHelper { - - // Used for MobBase NoAggro types - // *** WARNING: ENUM IS FRAGILE AS - // ORDINALS STORED IN DB. - - AELF, - ARACOIX, - CENTAUR, - DWARF, - ELF, - HALFGIANT, - HUMAN, - IREKEI, - MINO, - NEPH, - SHADE, - VAMP, - ARCHON; - - } - public enum CharacterSex { MALE, FEMALE, @@ -121,45 +99,45 @@ public class Enum { // RaceRuneID / AggroType, isFemale - AELFMALE(2000, AggroType.AELF, RunSpeed.STANDARD, CharacterSex.MALE,1.05f), - AELFFEMALE(2001, AggroType.AELF, RunSpeed.STANDARD, CharacterSex.FEMALE,1.05f), - ARACOIXMALE(2002, AggroType.ARACOIX, RunSpeed.STANDARD, CharacterSex.MALE,1), - ARACOIXFEMALE(2003, AggroType.ARACOIX, RunSpeed.STANDARD, CharacterSex.FEMALE,1), - CENTAURMALE(2004, AggroType.CENTAUR, RunSpeed.CENTAUR, CharacterSex.MALE,1.2f), - CENTAURFEMALE(2005, AggroType.CENTAUR, RunSpeed.CENTAUR, CharacterSex.FEMALE, 1.2f), - DWARFMALE(2006, AggroType.DWARF, RunSpeed.STANDARD, CharacterSex.MALE,0.80000001f), - ELFMALE(2008, AggroType.ELF, RunSpeed.STANDARD, CharacterSex.MALE, 1.4f), - ELFFEMALE(2009, AggroType.ELF, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), - HALFGIANTMALE(2010, AggroType.HALFGIANT, RunSpeed.STANDARD, CharacterSex.MALE, 1.15f), - HUMANMALE(2011, AggroType.HUMAN, RunSpeed.STANDARD, CharacterSex.MALE,1), - HUMANFEMALE(2012, AggroType.HUMAN, RunSpeed.STANDARD, CharacterSex.FEMALE,1), - IREKEIMALE(2013, AggroType.IREKEI, RunSpeed.STANDARD, CharacterSex.MALE,1.1f), - IREKEIFEMALE(2014, AggroType.IREKEI, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), - SHADEMALE(2015, AggroType.SHADE, RunSpeed.STANDARD, CharacterSex.MALE,1), - SHADEFEMALE(2016, AggroType.SHADE, RunSpeed.STANDARD, CharacterSex.FEMALE,1), - MINOMALE(2017, AggroType.MINO, RunSpeed.MINOTAUR, CharacterSex.MALE,1.3f), - ARCHONMALE(2018, AggroType.ARCHON, RunSpeed.STANDARD, CharacterSex.MALE,1), - HALEGIANTOLDMALE(2019, AggroType.HALFGIANT, RunSpeed.STANDARD, CharacterSex.MALE,1.15f), - CSRFEMALE(2020, AggroType.ARCHON, RunSpeed.STANDARD, CharacterSex.FEMALE,0.66000003f), - CSRMALE(2021, AggroType.ARCHON, RunSpeed.STANDARD, CharacterSex.MALE,1), - NEPHMALE(2025, AggroType.NEPH, RunSpeed.STANDARD, CharacterSex.MALE,1.1f), - NEPHFEMALE(2026, AggroType.NEPH, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), - HALFGIANTFEMALE(2027, AggroType.HALFGIANT, RunSpeed.STANDARD, CharacterSex.FEMALE,1.15f), - VAMPMALE(2028, AggroType.VAMP, RunSpeed.STANDARD, CharacterSex.MALE, 1), - VAMPFEMALE(2029, AggroType.VAMP, RunSpeed.STANDARD, CharacterSex.FEMALE,1); + AELFMALE(2000, MonsterType.Aelfborn, RunSpeed.STANDARD, CharacterSex.MALE,1.05f), + AELFFEMALE(2001, MonsterType.Aelfborn, RunSpeed.STANDARD, CharacterSex.FEMALE,1.05f), + ARACOIXMALE(2002, MonsterType.Aracoix, RunSpeed.STANDARD, CharacterSex.MALE,1), + ARACOIXFEMALE(2003, MonsterType.Aracoix, RunSpeed.STANDARD, CharacterSex.FEMALE,1), + CENTAURMALE(2004, MonsterType.Centaur, RunSpeed.CENTAUR, CharacterSex.MALE,1.2f), + CENTAURFEMALE(2005, MonsterType.Centaur, RunSpeed.CENTAUR, CharacterSex.FEMALE, 1.2f), + DWARFMALE(2006, MonsterType.Dwarf, RunSpeed.STANDARD, CharacterSex.MALE,0.80000001f), + ELFMALE(2008, MonsterType.Elf, RunSpeed.STANDARD, CharacterSex.MALE, 1.4f), + ELFFEMALE(2009, MonsterType.Elf, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), + HALFGIANTMALE(2010, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.MALE, 1.15f), + HUMANMALE(2011, MonsterType.Human, RunSpeed.STANDARD, CharacterSex.MALE,1), + HUMANFEMALE(2012, MonsterType.Human, RunSpeed.STANDARD, CharacterSex.FEMALE,1), + IREKEIMALE(2013, MonsterType.Irekei, RunSpeed.STANDARD, CharacterSex.MALE,1.1f), + IREKEIFEMALE(2014, MonsterType.Irekei, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), + SHADEMALE(2015, MonsterType.Shade, RunSpeed.STANDARD, CharacterSex.MALE,1), + SHADEFEMALE(2016, MonsterType.Shade, RunSpeed.STANDARD, CharacterSex.FEMALE,1), + MINOMALE(2017, MonsterType.Minotaur, RunSpeed.MINOTAUR, CharacterSex.MALE,1.3f), + ARCHONMALE(2018, MonsterType.Celestial, RunSpeed.STANDARD, CharacterSex.MALE,1), + HALEGIANTOLDMALE(2019, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.MALE,1.15f), + CSRFEMALE(2020, MonsterType.CSR, RunSpeed.STANDARD, CharacterSex.FEMALE,0.66000003f), + CSRMALE(2021, MonsterType.CSR, RunSpeed.STANDARD, CharacterSex.MALE,1), + NEPHMALE(2025, MonsterType.Nephilim, RunSpeed.STANDARD, CharacterSex.MALE,1.1f), + NEPHFEMALE(2026, MonsterType.Nephilim, RunSpeed.STANDARD, CharacterSex.FEMALE,1.1f), + HALFGIANTFEMALE(2027, MonsterType.HalfGiant, RunSpeed.STANDARD, CharacterSex.FEMALE,1.15f), + VAMPMALE(2028, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.MALE, 1), + VAMPFEMALE(2029, MonsterType.Vampire, RunSpeed.STANDARD, CharacterSex.FEMALE,1); @SuppressWarnings("unchecked") private static HashMap _raceTypeByID = new HashMap<>(); int runeID; - private AggroType aggroType; + private MonsterType monsterType; private CharacterSex characterSex; private RunSpeed runSpeed; private float scaleHeight; - RaceType(int runeID, AggroType aggroType, RunSpeed runspeed, CharacterSex characterSex, float scaleHeight) { + RaceType(int runeID, MonsterType aggroType, RunSpeed runspeed, CharacterSex characterSex, float scaleHeight) { this.runeID = runeID; - this.aggroType = aggroType; + this.monsterType = aggroType; this.runSpeed = runspeed; this.characterSex = characterSex; this.scaleHeight = scaleHeight; @@ -184,8 +162,8 @@ public class Enum { } } - public AggroType getAggroType() { - return aggroType; + public MonsterType getMonsterType() { + return monsterType; } public RunSpeed getRunSpeed() { diff --git a/src/engine/ai/MobileFSM.java b/src/engine/ai/MobileFSM.java index f3456e62..f82ce702 100644 --- a/src/engine/ai/MobileFSM.java +++ b/src/engine/ai/MobileFSM.java @@ -251,7 +251,7 @@ public class MobileFSM { } // No aggro for this race type - if (loadedPlayer.getRace().getRaceType().getAggroType().elementOf(aiAgent.getMobBase().getNoAggro())) + if (loadedPlayer.getRace().getRaceType().getMonsterType().elementOf(aiAgent.notEnemy)) continue; diff --git a/src/engine/db/handlers/dbMobBaseHandler.java b/src/engine/db/handlers/dbMobBaseHandler.java index 9914c782..6a7c5a69 100644 --- a/src/engine/db/handlers/dbMobBaseHandler.java +++ b/src/engine/db/handlers/dbMobBaseHandler.java @@ -189,28 +189,6 @@ public class dbMobBaseHandler extends dbHandlerBase { return (executeUpdate() > 0); } - public MobBase COPY_MOBBASE(MobBase toAdd, String name) { - prepareCallable("INSERT INTO `static_npc_mobbase` (`loadID`, `lootTableID`, `name`, `level`, `health`, `atr`, `defense`, `minDmg`,`maxDmg`, `goldMod`, `seeInvis`, `flags`, `noaggro`, `spawntime`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); - setInt(1, toAdd.getLoadID()); - setInt(2, toAdd.getLootTable()); - setString(3, (name.length() > 0) ? name : toAdd.getFirstName()); - setInt(4, toAdd.getLevel()); - setFloat(5, toAdd.getHealthMax()); - setInt(5, toAdd.getAtr()); - setInt(6, toAdd.getDefense()); - setFloat(7, toAdd.getMinDmg()); - setFloat(8, toAdd.getMaxDmg()); - setInt(9, toAdd.getGoldMod()); - setInt(10, toAdd.getSeeInvis()); - setLong(11, toAdd.getFlags().toLong()); - setLong(12, toAdd.getNoAggro().toLong()); - setInt(13, toAdd.getSpawnTime()); - int objectUUID = insertGetUUID(); - if (objectUUID > 0) - return GET_MOBBASE(objectUUID, true); - return null; - } - public boolean RENAME_MOBBASE(int ID, String newName) { prepareCallable("UPDATE `static_npc_mobbase` SET `name`=? WHERE `ID`=?;"); setString(1, newName); diff --git a/src/engine/devcmd/cmds/CopyMobCmd.java b/src/engine/devcmd/cmds/CopyMobCmd.java deleted file mode 100644 index fa68b709..00000000 --- a/src/engine/devcmd/cmds/CopyMobCmd.java +++ /dev/null @@ -1,84 +0,0 @@ -// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . -// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· -// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ -// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ -// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ -// Magicbane Emulator Project © 2013 - 2022 -// www.magicbane.com - - -package engine.devcmd.cmds; - -import engine.devcmd.AbstractDevCmd; -import engine.gameManager.ChatManager; -import engine.objects.AbstractGameObject; -import engine.objects.MobBase; -import engine.objects.PlayerCharacter; - -/** - * @author Eighty - * - */ -public class CopyMobCmd extends AbstractDevCmd { - - public CopyMobCmd() { - super("copymob"); - } - - @Override - protected void _doCmd(PlayerCharacter pc, String[] words, - AbstractGameObject target) { - if (words.length < 1) { - this.sendUsage(pc); - return; - } - - int loadID = 0; - String name = ""; - try { - loadID = Integer.parseInt(words[0]); - if (words.length > 1) { - name = words[1]; - for (int i=2; i flags; - private EnumBitSet noAggro; private int mask; private int goldMod; @@ -110,7 +109,6 @@ public class MobBase extends AbstractGameObject { } this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class); - this.noAggro = EnumBitSet.asEnumBitSet(rs.getLong("noaggro"), Enum.AggroType.class); this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class); this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class); @@ -247,10 +245,6 @@ public class MobBase extends AbstractGameObject { return this.flags; } - public EnumBitSet getNoAggro() { - return this.noAggro; - } - public int getGoldMod() { return this.goldMod; } @@ -284,9 +278,6 @@ public class MobBase extends AbstractGameObject { return DbManager.MobBaseQueries.GET_MOBBASE(id, forceDB); } - public static MobBase copyMobBase(MobBase mobbase, String name) { - return DbManager.MobBaseQueries.COPY_MOBBASE(mobbase, name); - } public static boolean renameMobBase(int ID, String newName) { return DbManager.MobBaseQueries.RENAME_MOBBASE(ID, newName);