Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+81 -83
View File
@@ -7,7 +7,6 @@
// www.magicbane.com
package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
@@ -20,119 +19,118 @@ import engine.objects.PlayerCharacter;
public class SetNpcEquipSetCmd extends AbstractDevCmd {
public static int lastEquipSetID = 0;
public SetNpcEquipSetCmd() {
public static int lastEquipSetID = 0;
public SetNpcEquipSetCmd() {
super("setEquipSet");
this.addCmdString("equipset");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
// Arg Count Check
if (words.length != 1) {
this.sendUsage(pc);
return;
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
// Arg Count Check
if (words.length != 1) {
this.sendUsage(pc);
return;
}
if (target.getObjectType() != GameObjectType.NPC){
this.sendUsage(pc);
return;
}
if (target.getObjectType() != GameObjectType.NPC) {
this.sendUsage(pc);
return;
}
NPC npc = (NPC)target;
NPC npc = (NPC) target;
if (words[0].equalsIgnoreCase("next")){
if (words[0].equalsIgnoreCase("next")) {
if (SetNpcEquipSetCmd.lastEquipSetID >= 1222)
SetNpcEquipSetCmd.lastEquipSetID = 1;
else
SetNpcEquipSetCmd.lastEquipSetID++;
if (SetNpcEquipSetCmd.lastEquipSetID >= 1222)
SetNpcEquipSetCmd.lastEquipSetID = 1;
else
SetNpcEquipSetCmd.lastEquipSetID++;
boolean complete = false;
boolean complete = false;
while (complete == false){
complete = NPC.UpdateEquipSetID(npc, SetNpcEquipSetCmd.lastEquipSetID);
while (complete == false) {
complete = NPC.UpdateEquipSetID(npc, SetNpcEquipSetCmd.lastEquipSetID);
if (!complete){
SetNpcEquipSetCmd.lastEquipSetID++;
if (SetNpcEquipSetCmd.lastEquipSetID >= 1222)
SetNpcEquipSetCmd.lastEquipSetID = 1;
}
}
if (!complete) {
SetNpcEquipSetCmd.lastEquipSetID++;
if (SetNpcEquipSetCmd.lastEquipSetID >= 1222)
SetNpcEquipSetCmd.lastEquipSetID = 1;
}
}
if (complete){
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
this.throwbackInfo(pc, "Equipment Set Changed to " + SetNpcEquipSetCmd.lastEquipSetID );
}
if (complete) {
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
this.throwbackInfo(pc, "Equipment Set Changed to " + SetNpcEquipSetCmd.lastEquipSetID);
}
return;
}
return;
}
if (words[0].equalsIgnoreCase("last")) {
if (words[0].equalsIgnoreCase("last")){
if (SetNpcEquipSetCmd.lastEquipSetID <= 1)
SetNpcEquipSetCmd.lastEquipSetID = 1222;
else
SetNpcEquipSetCmd.lastEquipSetID--;
if (SetNpcEquipSetCmd.lastEquipSetID <= 1)
SetNpcEquipSetCmd.lastEquipSetID = 1222;
else
SetNpcEquipSetCmd.lastEquipSetID--;
boolean complete = false;
boolean complete = false;
while (complete == false) {
complete = NPC.UpdateEquipSetID(npc, SetNpcEquipSetCmd.lastEquipSetID);
while (complete == false){
complete = NPC.UpdateEquipSetID(npc, SetNpcEquipSetCmd.lastEquipSetID);
if (!complete) {
SetNpcEquipSetCmd.lastEquipSetID--;
if (SetNpcEquipSetCmd.lastEquipSetID <= 1)
SetNpcEquipSetCmd.lastEquipSetID = 1222;
}
if (!complete){
SetNpcEquipSetCmd.lastEquipSetID--;
if (SetNpcEquipSetCmd.lastEquipSetID <= 1)
SetNpcEquipSetCmd.lastEquipSetID = 1222;
}
}
}
if (complete){
this.throwbackInfo(pc, "Equipment Set Changed to " + SetNpcEquipSetCmd.lastEquipSetID );
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
}
if (complete) {
this.throwbackInfo(pc, "Equipment Set Changed to " + SetNpcEquipSetCmd.lastEquipSetID);
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
}
return;
}
return;
}
int equipSetID = 0;
int equipSetID = 0;
try {
equipSetID = Integer.parseInt(words[0]);
} catch (Exception e) {
this.throwbackError(pc, e.getMessage());
}
try{
equipSetID = Integer.parseInt(words[0]);
}catch(Exception e){
this.throwbackError(pc, e.getMessage());
}
if (!NPC.UpdateEquipSetID(npc, equipSetID)) {
this.throwbackError(pc, "Unable to find Equipset for ID " + equipSetID);
return;
}
if (!NPC.UpdateEquipSetID(npc, equipSetID)){
this.throwbackError(pc, "Unable to find Equipset for ID " + equipSetID );
return;
}
SetNpcEquipSetCmd.lastEquipSetID = equipSetID;
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
SetNpcEquipSetCmd.lastEquipSetID = equipSetID;
npc.equip = MobBase.loadEquipmentSet(npc.getEquipmentSetID());
WorldGrid.updateObject(npc);
this.throwbackInfo(pc, "Equipment Set Changed to " + equipSetID );
this.throwbackInfo(pc, "Equipment Set Changed to " + equipSetID);
}
}
@Override
protected String _getHelpString() {
return "Sets slot position for an NPC to 'slot'";
}
@Override
protected String _getHelpString() {
return "Sets slot position for an NPC to 'slot'";
}
@Override
protected String _getUsageString() {
return "' /changeslot slot'";
}
@Override
protected String _getUsageString() {
return "' /changeslot slot'";
}
}