Compare commits
No commits in common. 'e5c1dc7bcb87df94a898376b30642c85de05d5f0' and '3649c629b709c67625a09150a3752107f4b873cc' have entirely different histories.
e5c1dc7bcb
...
3649c629b7
5 changed files with 0 additions and 77 deletions
@ -1,61 +0,0 @@ |
|||||||
package engine.devcmd.cmds; |
|
||||||
|
|
||||||
import engine.devcmd.AbstractDevCmd; |
|
||||||
import engine.gameManager.ZoneManager; |
|
||||||
import engine.objects.AbstractGameObject; |
|
||||||
import engine.objects.PlayerCharacter; |
|
||||||
import engine.objects.Zone; |
|
||||||
|
|
||||||
public class SetCampLevelCmd extends AbstractDevCmd { |
|
||||||
public SetCampLevelCmd() { super("setcamplevel"); } |
|
||||||
|
|
||||||
@Override |
|
||||||
protected void _doCmd(PlayerCharacter pcSender, String[] args, AbstractGameObject target) { |
|
||||||
|
|
||||||
if (args.length > 1) |
|
||||||
{ |
|
||||||
this.sendUsage(pcSender); |
|
||||||
} |
|
||||||
|
|
||||||
// Get the current occupied camp
|
|
||||||
Zone playerZone = ZoneManager.findSmallestZone(pcSender.loc); |
|
||||||
|
|
||||||
// Make sure that the zone we're targeting is valid for action
|
|
||||||
if (playerZone == null || |
|
||||||
playerZone.zoneMobSet.isEmpty() || |
|
||||||
playerZone.isPlayerCity()) |
|
||||||
{ |
|
||||||
throwbackError(pcSender, "Current zone must own mobs, and NOT be a city."); |
|
||||||
return; |
|
||||||
} |
|
||||||
|
|
||||||
int targetLevel = 0; |
|
||||||
if (args.length == 1) |
|
||||||
{ |
|
||||||
try |
|
||||||
{ |
|
||||||
targetLevel = Integer.parseInt(args[0]); |
|
||||||
} |
|
||||||
catch (NumberFormatException nfe) |
|
||||||
{ |
|
||||||
throwbackError(pcSender, "Argument MUST be integer. Received: " + args[0]); |
|
||||||
} |
|
||||||
catch (Exception e) |
|
||||||
{ |
|
||||||
throwbackError(pcSender, "Unknown command parsing provided camp level: " + args[0]); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
playerZone.setCampLvl(targetLevel); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
protected String _getUsageString() { |
|
||||||
return "Sets the level of the currently occupied camp to the desired level"; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
protected String _getHelpString() { |
|
||||||
return "'./setcamplevel levelNum'"; |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue