Support sealing mob skill
This commit is contained in:
@@ -257,6 +257,7 @@ public class CommandsExecutor {
|
|||||||
addCommand("id", 2, IdCommand.class);
|
addCommand("id", 2, IdCommand.class);
|
||||||
addCommand("gachalist", GachaListCommand.class);
|
addCommand("gachalist", GachaListCommand.class);
|
||||||
addCommand("loot", LootCommand.class);
|
addCommand("loot", LootCommand.class);
|
||||||
|
addCommand("mobskill", MobSkillCommand.class);
|
||||||
|
|
||||||
commandsNameDesc.add(levelCommandsCursor);
|
commandsNameDesc.add(levelCommandsCursor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package client.command.commands.gm2;
|
||||||
|
|
||||||
|
import client.Character;
|
||||||
|
import client.Client;
|
||||||
|
import client.command.Command;
|
||||||
|
import server.life.MobSkill;
|
||||||
|
import server.life.MobSkillFactory;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
public class MobSkillCommand extends Command {
|
||||||
|
{
|
||||||
|
setDescription("Apply a mob skill to all mobs on the map. Args: <mob skill id> <skill level>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(Client client, String[] params) {
|
||||||
|
if (params.length < 2) {
|
||||||
|
throw new IllegalArgumentException("Mob skill command requires two args: mob skill id and level");
|
||||||
|
}
|
||||||
|
|
||||||
|
String skillId = params[0];
|
||||||
|
String skillLevel = params[1];
|
||||||
|
MobSkill mobSkill = MobSkillFactory.getMobSkill(Integer.parseInt(skillId), Integer.parseInt(skillLevel));
|
||||||
|
if (mobSkill == null) {
|
||||||
|
throw new IllegalArgumentException("Mob skill not found. Id: %s, level: %s".formatted(skillId, skillLevel));
|
||||||
|
}
|
||||||
|
|
||||||
|
Character chr = client.getPlayer();
|
||||||
|
chr.getMap().getAllMonsters().forEach(monster -> mobSkill.applyEffect(chr, monster, false, Collections.emptyList()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -243,6 +243,9 @@ public class MobSkill {
|
|||||||
case 156:
|
case 156:
|
||||||
stats.put(MonsterStatus.SPEED, x);
|
stats.put(MonsterStatus.SPEED, x);
|
||||||
break;
|
break;
|
||||||
|
case 157:
|
||||||
|
stats.put(MonsterStatus.SEAL_SKILL, x);
|
||||||
|
break;
|
||||||
case 200: // summon
|
case 200: // summon
|
||||||
int skillLimit = this.getLimit();
|
int skillLimit = this.getLimit();
|
||||||
MapleMap map = monster.getMap();
|
MapleMap map = monster.getMap();
|
||||||
|
|||||||
@@ -1448,7 +1448,7 @@ public class Monster extends AbstractLoadedLife {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseSkill(MobSkill toUse, boolean apply) {
|
public boolean canUseSkill(MobSkill toUse, boolean apply) {
|
||||||
if (toUse == null) {
|
if (toUse == null || isBuffed(MonsterStatus.SEAL_SKILL)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user