|
|
@ -11,7 +11,6 @@ package engine.devcmd.cmds; |
|
|
|
|
|
|
|
|
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.ItemBase; |
|
|
|
|
|
|
|
import engine.objects.ItemFactory; |
|
|
|
import engine.objects.ItemFactory; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
|
|
|
|
|
|
|
@ -27,28 +26,20 @@ public class CreateItemCmd extends AbstractDevCmd { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void _doCmd(PlayerCharacter pc, String[] words, |
|
|
|
protected void _doCmd(PlayerCharacter pc, String[] words, |
|
|
|
AbstractGameObject target) { |
|
|
|
AbstractGameObject target) { |
|
|
|
|
|
|
|
|
|
|
|
if (words.length < 2) { |
|
|
|
if (words.length < 2) { |
|
|
|
this.sendUsage(pc); |
|
|
|
this.sendUsage(pc); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
int id; |
|
|
|
|
|
|
|
id = ItemBase.getIDByName(words[0]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (id == 0) |
|
|
|
int templateID = Integer.parseInt(words[0]); |
|
|
|
id = Integer.parseInt(words[0]); |
|
|
|
|
|
|
|
if (id == 7) { |
|
|
|
|
|
|
|
this.throwbackInfo(pc, "use /addgold to add gold....."); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int size = 1; |
|
|
|
int size = 1; |
|
|
|
|
|
|
|
|
|
|
|
if (words.length < 3) { |
|
|
|
if (words.length == 2) |
|
|
|
size = Integer.parseInt(words[1]); |
|
|
|
size = Integer.parseInt(words[1]); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemFactory.fillInventory(pc, id, size); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemFactory.fillInventory(pc, templateID, size); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|