Didn't test, but this should work.
Code:if (itemName.contains("attack master cape")) { if (player.getSkills().getXP(Skills.ATTACK) < 104273167) { player.getPackets().sendGameMessage("You need to have an attack level of 120."); return false; }
|
Hey Guys
i have a 718 Server and i know how to add the capes in the game but not the req (104,273,167 experience and the Skill).
anyone can help me?
Didn't test, but this should work.
Code:if (itemName.contains("attack master cape")) { if (player.getSkills().getXP(Skills.ATTACK) < 104273167) { player.getPackets().sendGameMessage("You need to have an attack level of 120."); return false; }
I have add this to itemconstants here
https://gyazo.com/5843c2259627e8e3757775ffe7016c5d
but i got errors :c
src\com\rs\game\player\content\ItemConstants.java: 138: error: illegal start of expression
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\content\ItemConstants.java: 138: error: illegal start of expression
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\content\ItemConstants.java: 138: error: ';' expected
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\content\ItemConstants.java: 138: error: ')' expected
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\content\ItemConstants.java: 138: error: illegal start of expression
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\content\ItemConstants.java: 138: error: ';' expected
public static boolean isTradeable(Item item) {
^
src\com\rs\game\player\Player.java:2071: error: cannot find symbol
ItemConstants.isTradeable(equipment.getItem(i))) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Player.java:2082: error: cannot find symbol
ItemConstants.isTradeable(inventory.getItem(i))) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Player.java:2158: error: cannot find symbol
if (ItemConstants.isSafeOnDeath(equipment.getItem(i). getId()) || ItemConstants.isTradeable(equipment.getItem(i))) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Player.java:2168: error: cannot find symbol
if (ItemConstants.isSafeOnDeath(inventory.getItem(i). getId()) || ItemConstants.isTradeable(inventory.getItem(i))) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\PriceCheckManager.java:60: error: cannot find symbol
if (!ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Trade.java:108: error: cannot find symbol
if (!ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Trade.java:208: error: cannot find symbol
if (!ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\Trade.java:220: error: cannot find symbol
if (!ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\content\pet\PetManager.java :196: error: cannot find symbol
if (!ItemConstants.isTradeable(new Item(foodId))) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\npc\familiar\BeastOfBurden.java:11 2: error: cannot find symbol
if (!ItemConstants.isTradeable(item) || item.getId() == 4049 || (familiar.canStoreEssOnly() && item.getId() != 1436 && item .getId() != 7936) || ItemManager.getPrice(item.getId()) > 50000) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\World.java:1199: error: cannot find symbol
if (underGrave || !ItemConstants.isTradeable(floorItem)) {
^
symbol: method isTradeable(FloorItem)
location: class ItemConstants
src\com\rs\game\player\content\Shop.java:306: error: cannot find symbol
if (item.getDefinitions().isDestroyItem() || ItemConstants.getItemDefaultCharges(item.getId()) != -1 || !ItemConstants.isTradeable(item) || item.getId() == money) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\content\Shop.java:378: error: cannot find symbol
if (item.getDefinitions().isNoted() || !ItemConstants.isTradeable(item) || item.getId() == money) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\minigames\duel\DuelArena.java:158: error: cannot find symbol
if (!ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\game\player\content\ItemConstants.java: 110: error: cannot find symbol
if (player.getSkills().getXP(Skills.FISHING) < 104273167) {
^
symbol: variable Skills
location: class ItemConstants
src\com\rs\game\player\content\ItemConstants.java: 138: error: cannot find symbol
public static boolean isTradeable(Item item) {
^
symbol: variable Item
location: class ItemConstants
src\com\rs\utils\EconomyPrices.java:16: error: cannot find symbol
if (!ItemConstants.isTradeable(new Item(itemId, 1)))
^
symbol: method isTradeable(Item)
location: class ItemConstants
src\com\rs\net\decoders\handlers\InventoryOptionsH andler.java:781: error: cannot find symbol
if (ItemConstants.isTradeable(item)) {
^
symbol: method isTradeable(Item)
location: class ItemConstants
24 errors
https://gyazo.com/eeb6fb9d0e7b9553684a187043556e82
i only got so much errors if i add this
Add this
in your canWear class.Code:} else if (itemName.contains("attack master cape")) { if (player.getSkills().getXP(Skills.ATTACK) < 104273167) { player.sendMessage("You need to have an attack level of 120 to wear this."); return false; }
public static boolean canWear(Item item, Player player) {
String itemName = ItemDefinitions.getItemDefinitions(item.getId()).g etName().toLowerCase();
if (itemName.contains("completionist")) {
if (player.getSkills().getTotalLevel(player) < 2496) {
player.sendMessage("You need a total level of 2496 before you can wear this.");
return false;
}
} else if (itemName.contains("max")) {
if (player.getSkills().getTotalLevel(player) < 2475) {
player.sendMessage("You need a total level of 2475 before you can wear this.");
return false;
}
} else if (itemName.contains("fire cape")) {
if (!player.isCompletedFightCaves()) {
player.getPackets().sendGameMessage("You need to complete fightcaves before you can equip firecape.");
return false;
}
} else if (itemName.contains("blue cape") || itemName.contains("red cape")) {
if (!player.getQuestManager().completedQuest(Quests.N OMADS_REQUIEM)) {
player.getPackets().sendGameMessage("You need to have completed Nomad's Requiem miniquest to use this cape.");
return false;
}
}
return true;
}
here?
https://gyazo.com/eeb6fb9d0e7b9553684a187043556e82
i have add this there but i get errors if i add this
public static boolean canWear(Item item, Player player) {
String itemName = ItemDefinitions.getItemDefinitions(item.getId()).g etName().toLowerCase();
} else if (itemName.contains("Fishing Master Cape")) {
if (player.getSkills().getXP(Skills.FISHING) < 104273167) {
player.sendMessage("You need to have the Fishing level of 120 to wear this.");
return false;
}
if (itemName.contains("completionist")) {
if (player.getSkills().getTotalLevel(player) < 2496) {
player.sendMessage("You need a total level of 2496 before you can wear this.");
return false;
}
} else if (itemName.contains("max")) {
if (player.getSkills().getTotalLevel(player) < 2475) {
player.sendMessage("You need a total level of 2475 before you can wear this.");
return false;
}
} else if (itemName.contains("fire cape")) {
if (!player.isCompletedFightCaves()) {
player.getPackets().sendGameMessage("You need to complete fightcaves before you can equip firecape.");
return false;
}
} else if (itemName.contains("blue cape") || itemName.contains("red cape")) {
if (!player.getQuestManager().completedQuest(Quests.N OMADS_REQUIEM)) {
player.getPackets().sendGameMessage("You need to have completed Nomad's Requiem miniquest to use this cape.");
return false;
}
}
return true;
}
https://gyazo.com/4bb2091a978be9bfe07f968f36ba53c0
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |