forked from MagicBane/Server
FatBoy-DOTC
6 months ago
4 changed files with 67 additions and 1 deletions
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.devcmd.cmds; |
||||
|
||||
import engine.InterestManagement.WorldGrid; |
||||
import engine.devcmd.AbstractDevCmd; |
||||
import engine.gameManager.BuildingManager; |
||||
import engine.gameManager.ChatManager; |
||||
import engine.gameManager.DbManager; |
||||
import engine.mbEnums; |
||||
import engine.objects.*; |
||||
|
||||
public class SetRaceCmd extends AbstractDevCmd { |
||||
|
||||
public SetRaceCmd() { |
||||
super("setRace"); |
||||
} |
||||
|
||||
@Override |
||||
protected void _doCmd(PlayerCharacter player, String[] words, |
||||
AbstractGameObject target) { |
||||
|
||||
int newRace = Integer.parseInt(words[0]); |
||||
|
||||
if(target.getObjectType().equals(mbEnums.GameObjectType.NPC) == false){ |
||||
throwbackError(player, "You Must Target An NPC"); |
||||
} |
||||
|
||||
NPC npc = (NPC)target; |
||||
npc.loadID = newRace; |
||||
DbManager.NPCQueries.UPDATE_RACE(npc,newRace); |
||||
} |
||||
|
||||
@Override |
||||
protected String _getHelpString() { |
||||
return "Sets NPC race"; |
||||
} |
||||
|
||||
@Override |
||||
protected String _getUsageString() { |
||||
return "' /setrace ID'"; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue