A
Anderson17RJ
Guest
anyone can help me with this scrips that i created??
obviously not working, can you see what's wrong with them?
obviously not working, can you see what's wrong with them?
Код:
import gameserver.model.gameobjects.player.Player;
import gameserver.model.templates.WorldMapTemplate;
import gameserver.skill.model.Skill;
public class SkillRestriction {
private static final int RESTRICTED_MAP_ID = 1234; // restricted map id
private static final int RESTRICTED_SKILL_ID = 5678; // restricted skill id
public static boolean canUseSkill(Player player, SkillTemplate skillTemplate) {
WorldMapTemplate currentMap = player.getWorldMapInstance().getWorldMapTemplate();
int currentMapId = currentMap.getMapId();
if (currentMapId == RESTRICTED_MAP_ID && skillTemplate.getSkillId() == RESTRICTED_SKILL_ID) {
// Prevents use of Restricted Skill on Restricted Map
return false;
}
return true;
}
}