Browse Source

Removed leftover junk from mobbase.

master
MagicBot 2 years ago
parent
commit
4ae55b9bd8
  1. 8
      src/engine/db/handlers/dbMobBaseHandler.java
  2. 98
      src/engine/devcmd/cmds/AddMobPowerCmd.java
  3. 1
      src/engine/gameManager/DevCmdManager.java
  4. 10
      src/engine/objects/MobBase.java

8
src/engine/db/handlers/dbMobBaseHandler.java

@ -144,14 +144,6 @@ public class dbMobBaseHandler extends dbHandlerBase { @@ -144,14 +144,6 @@ public class dbMobBaseHandler extends dbHandlerBase {
}
public boolean ADD_MOBBASE_POWER(int mobBaseUUID, int token, int rank) {
prepareCallable("INSERT INTO `static_npc_mobbase_powers` (`mobbaseUUID`, `token`, `rank`) VALUES (?, ?, ?);");
setInt(1, mobBaseUUID);
setInt(2, token);
setInt(3, rank);
return (executeUpdate() > 0);
}
public boolean RENAME_MOBBASE(int ID, String newName) {
prepareCallable("UPDATE `static_npc_mobbase` SET `name`=? WHERE `ID`=?;");
setString(1, newName);

98
src/engine/devcmd/cmds/AddMobPowerCmd.java

@ -1,98 +0,0 @@ @@ -1,98 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager;
import engine.gameManager.PowersManager;
import engine.objects.AbstractGameObject;
import engine.objects.Mob;
import engine.objects.PlayerCharacter;
import engine.powers.PowersBase;
/**
*
* @author Eighty
*
*/
public class AddMobPowerCmd extends AbstractDevCmd {
public AddMobPowerCmd() {
super("addmobpower");
}
@Override
protected void _doCmd(PlayerCharacter pcSender, String[] args,
AbstractGameObject target) {
if(args.length != 2){
this.sendUsage(pcSender);
return;
}
if (target.getObjectType() != GameObjectType.Mob){
this.throwbackError(pcSender, "Target is not a valid Mob.");
return;
}
Mob mobTarget = (Mob)target;
int rank = 0;
String idString = args[0];
try{
rank = Integer.valueOf(args[1]);
}catch(Exception e){
this.throwbackInfo(pcSender, "Failed to Parse an Integer.");
return;
}
PowersBase pb = PowersManager.getPowerByIDString(idString);
if (pb == null){
this.throwbackError(pcSender, "not a valid Effect. IDString is Case Sensitive.");
return;
}
if (!DbManager.MobBaseQueries.ADD_MOBBASE_POWER(mobTarget.getMobBaseID(), pb.getToken(), rank)){
this.throwbackError(pcSender, "Failed to update Database");
}
mobTarget.getMobBase().updatePowers();
this.throwbackInfo(pcSender, "Successfuly added Power " + pb.getIDString() + " to Mobbase with UID " + mobTarget.getMobBaseID());
}
@Override
protected String _getUsageString() {
return "' /addmobpower poweridstring rank";
}
@Override
protected String _getHelpString() {
return "Temporarily add visual effects to Character";
}
}

1
src/engine/gameManager/DevCmdManager.java

@ -126,7 +126,6 @@ public enum DevCmdManager { @@ -126,7 +126,6 @@ public enum DevCmdManager {
DevCmdManager.registerDevCmd(new ShowOffsetCmd());
DevCmdManager.registerDevCmd(new RealmInfoCmd());
DevCmdManager.registerDevCmd(new RebootCmd());
DevCmdManager.registerDevCmd(new AddMobPowerCmd());
DevCmdManager.registerDevCmd(new SetMineTypeCmd());
DevCmdManager.registerDevCmd(new SetMineExpansion());
DevCmdManager.registerDevCmd(new SetForceRenameCityCmd());

10
src/engine/objects/MobBase.java

@ -44,7 +44,6 @@ public class MobBase extends AbstractGameObject { @@ -44,7 +44,6 @@ public class MobBase extends AbstractGameObject {
private float attackRange;
private boolean isNecroPet = false;
private MobBaseStats mobBaseStats;
private HashMap<Integer, Integer> staticPowers;
private float walk = 0;
private float run = 0;
@ -70,8 +69,6 @@ public class MobBase extends AbstractGameObject { @@ -70,8 +69,6 @@ public class MobBase extends AbstractGameObject {
this.goldMod = rs.getInt("goldMod");
this.spawnTime = rs.getInt("spawnTime");
LevelDefault levelDefault = LevelDefault.getLevelDefault(this.level);
this.healthMax = rs.getInt("health");
this.damageMin = rs.getFloat("minDmg");
this.damageMax = rs.getFloat("maxDmg");
@ -92,9 +89,8 @@ public class MobBase extends AbstractGameObject { @@ -92,9 +89,8 @@ public class MobBase extends AbstractGameObject {
this.hitBoxRadius = 5f;
this.mask = 0;
if (this.getObjectUUID() == 12021 || this.getObjectUUID() == 12022) {
if (this.getObjectUUID() == 12021 || this.getObjectUUID() == 12022)
this.isNecroPet = true;
}
if (Enum.MobFlagType.HUMANOID.elementOf(this.flags))
this.mask += MBServerStatics.MASK_HUMANOID;
@ -146,10 +142,6 @@ public class MobBase extends AbstractGameObject { @@ -146,10 +142,6 @@ public class MobBase extends AbstractGameObject {
return equip;
}
public void updatePowers() {
this.staticPowers = DbManager.MobBaseQueries.LOAD_STATIC_POWERS(this.getObjectUUID());
}
public void updateSpeeds(float walk, float walkCombat,float run, float runCombat){
this.walk = walk;
this.walkCombat = walkCombat;

Loading…
Cancel
Save