Repository reorganisation
Unified kotlin and java into just src/main Unified the rs09 and core packages Took all content out of the core package, and placed it into the new content package Reorganised all source code relating to content to be easier to find and explore
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
/**
|
||||
* @author Emperor
|
||||
*/
|
||||
public enum BarType {
|
||||
|
||||
/**
|
||||
* Bronze Interface
|
||||
*/
|
||||
BRONZE(2349, 12.5, "Bronze Smithing"),
|
||||
|
||||
/**
|
||||
* Blurite
|
||||
*/
|
||||
BLURITE(9467, 16, "Blurite Smithing"),
|
||||
|
||||
/**
|
||||
* Iron
|
||||
*/
|
||||
IRON(2351, 25, "Iron Smithing"),
|
||||
|
||||
/**
|
||||
* Steel
|
||||
*/
|
||||
STEEL(2353, 37.5, "Steel Smithing"),
|
||||
|
||||
/**
|
||||
* Mithril
|
||||
*/
|
||||
MITHRIL(2359, 50, "Mithril Smithing"),
|
||||
|
||||
/**
|
||||
* Adamant
|
||||
*/
|
||||
ADAMANT(2361, 62.5, "Adamant Smithing"),
|
||||
|
||||
/**
|
||||
* Runite
|
||||
*/
|
||||
RUNITE(2363, 75, "Runite Smithing");
|
||||
|
||||
/**
|
||||
* The bar type id.
|
||||
*/
|
||||
private int bar;
|
||||
|
||||
/**
|
||||
* The bar's name.
|
||||
*/
|
||||
private String string;
|
||||
|
||||
/**
|
||||
* The amount of experience gained
|
||||
*/
|
||||
private double experience;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code BarType} {@code Object}.
|
||||
* @param bar the bar.
|
||||
* @param experience the exp.
|
||||
* @param string the string.
|
||||
*/
|
||||
private BarType(int bar, double experience, String string) {
|
||||
this.bar = bar;
|
||||
this.string = string;
|
||||
this.experience = experience;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive's the bar's type.
|
||||
* @return bar type id;
|
||||
*/
|
||||
public int getBarType() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retreive's the bar's name.
|
||||
* @return the bar's name.
|
||||
*/
|
||||
public String getBarName() {
|
||||
return string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the exp.
|
||||
* @return the exp.
|
||||
*/
|
||||
public double getExperience() {
|
||||
return experience;
|
||||
}
|
||||
|
||||
public static BarType getBarTypeForId(int itemId) {
|
||||
switch (itemId) {
|
||||
case 2349:
|
||||
return BarType.BRONZE;
|
||||
case 2351:
|
||||
return BarType.IRON;
|
||||
case 2353:
|
||||
return BarType.STEEL;
|
||||
case 2359:
|
||||
return BarType.MITHRIL;
|
||||
case 2361:
|
||||
return BarType.ADAMANT;
|
||||
case 2363:
|
||||
return BarType.RUNITE;
|
||||
case 9467:
|
||||
return BarType.BLURITE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,920 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import core.game.node.entity.player.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Emperor
|
||||
* @author 'Vexia
|
||||
*/
|
||||
public enum Bars {
|
||||
|
||||
/**
|
||||
* Bronze Dagger
|
||||
*/
|
||||
BRONZE_DAGGER(BarType.BRONZE, SmithingType.TYPE_DAGGER, 1205, 1),
|
||||
|
||||
/**
|
||||
* Bronze Axe
|
||||
*/
|
||||
BRONZE_AXE(BarType.BRONZE, SmithingType.TYPE_AXE, 1351, 1),
|
||||
|
||||
/**
|
||||
* Bronze Mace
|
||||
*/
|
||||
BRONZE_MACE(BarType.BRONZE, SmithingType.TYPE_MACE, 1422, 2),
|
||||
|
||||
/**
|
||||
* Bronze Medium helm
|
||||
*/
|
||||
BRONZE_MED_HELM(BarType.BRONZE, SmithingType.TYPE_MEDIUM_HELM, 1139, 3),
|
||||
|
||||
/**
|
||||
* Bronze Crossbow Bolt
|
||||
*/
|
||||
BRONZE_CROSSBOW_BOLT(BarType.BRONZE, SmithingType.TYPE_CROSSBOW_BOLT, 9375, 3),
|
||||
|
||||
/**
|
||||
* Bronze Sword
|
||||
*/
|
||||
BRONZE_SWORD(BarType.BRONZE, SmithingType.TYPE_SWORD, 1277, 4),
|
||||
|
||||
/**
|
||||
* Bronze Dart Tips
|
||||
*/
|
||||
BRONZE_DART_TIPS(BarType.BRONZE, SmithingType.TYPE_DART_TIP, 819, 4),
|
||||
|
||||
/**
|
||||
* Bronze Nails
|
||||
*/
|
||||
BRONZE_NAILS(BarType.BRONZE, SmithingType.TYPE_NAIL, 4819, 4),
|
||||
|
||||
/**
|
||||
* Bronze Wire
|
||||
*/
|
||||
BRONZE_WIRE(BarType.BRONZE, SmithingType.TYPE_WIRE, 1794, 4),
|
||||
|
||||
/**
|
||||
* Bronze Arrow Tips
|
||||
*/
|
||||
BRONZE_ARROW_TIPS(BarType.BRONZE, SmithingType.TYPE_ARROW_TIP, 39, 5),
|
||||
|
||||
/**
|
||||
* Bronze Scimitar
|
||||
*/
|
||||
BRONZE_SCIMITAR(BarType.BRONZE, SmithingType.TYPE_SCIMITAR, 1321, 5),
|
||||
|
||||
/**
|
||||
* Bronze Crossbow Limbs
|
||||
*/
|
||||
BRONZE_CROSSBOW_LIMBS(BarType.BRONZE, SmithingType.TYPE_CROSSBOW_LIMB, 9420, 6),
|
||||
|
||||
/**
|
||||
* Bronze longsword
|
||||
*/
|
||||
BRONZE_LONGSWORD(BarType.BRONZE, SmithingType.TYPE_LONGSWORD, 1291, 6),
|
||||
|
||||
/**
|
||||
* Bronze ThrowingKnife
|
||||
*/
|
||||
BRONZE_THROWINGKNFIE(BarType.BRONZE, SmithingType.TYPE_THROWING_KNIFE, 864, 7),
|
||||
|
||||
/**
|
||||
* Bronze Full helmet
|
||||
*/
|
||||
BRONZE_FULL_HELM(BarType.BRONZE, SmithingType.TYPE_FULL_HELM, 1155, 7),
|
||||
|
||||
/**
|
||||
* Bronze Square Shield
|
||||
*/
|
||||
BRONZE_SQUARE_SHIELD(BarType.BRONZE, SmithingType.TYPE_SQUARE_SHIELD, 1173, 8),
|
||||
|
||||
/**
|
||||
* Bronze Warhammer
|
||||
*/
|
||||
BRONZE_WAR_HAMMER(BarType.BRONZE, SmithingType.TYPE_WARHAMMER, 1337, 9),
|
||||
|
||||
/**
|
||||
* Bronze BattleAxe
|
||||
*/
|
||||
BRONZE_BATTLEAXE(BarType.BRONZE, SmithingType.TYPE_BATTLE_AXE, 1375, 10),
|
||||
|
||||
/**
|
||||
* Bronze ChainBody
|
||||
*/
|
||||
BRONZE_CHAINBODY(BarType.BRONZE, SmithingType.TYPE_CHAINBODY, 1103, 11),
|
||||
|
||||
/**
|
||||
* Bronze KitShield
|
||||
*/
|
||||
BRONZE_KITESHIELD(BarType.BRONZE, SmithingType.TYPE_KITE_SHIELD, 1189, 12),
|
||||
|
||||
/**
|
||||
* Bronze Claws
|
||||
*/
|
||||
BRONZE_CLAWS(BarType.BRONZE, SmithingType.TYPE_CLAWS, 3095, 13),
|
||||
|
||||
/**
|
||||
* Bronze 2h
|
||||
*/
|
||||
BRONZE_TWO_HANDED(BarType.BRONZE, SmithingType.TYPE_TWO_HAND_SWORD, 1307, 14),
|
||||
|
||||
/**
|
||||
* Bronze PlateSkirt
|
||||
*/
|
||||
BRONZE_PLATE_SKIRT(BarType.BRONZE, SmithingType.TYPE_PLATE_SKIRT, 1087, 16),
|
||||
|
||||
/**
|
||||
* Bronze PlateLegs
|
||||
*/
|
||||
BRONZE_PLATELEGS(BarType.BRONZE, SmithingType.TYPE_PLATELEG, 1075, 16),
|
||||
|
||||
/**
|
||||
* Bronze PlateBody
|
||||
*/
|
||||
BRONZE_PLATEBODY(BarType.BRONZE, SmithingType.TYPE_PLATEBODY, 1117, 18),
|
||||
|
||||
/**
|
||||
* Bronze Pickaxe
|
||||
*/
|
||||
BRONZE_PICKAXE(BarType.BRONZE, SmithingType.TYPE_PICKAXE, 1265, 5),
|
||||
|
||||
/**
|
||||
* Iron Dagger
|
||||
*/
|
||||
IRON_DAGGER(BarType.IRON, SmithingType.TYPE_DAGGER, 1203, 15),
|
||||
|
||||
/**
|
||||
* Iron Hatchet
|
||||
*/
|
||||
IRON_AXE(BarType.IRON, SmithingType.TYPE_AXE, 1349, 16),
|
||||
|
||||
/**
|
||||
* Iron Mace
|
||||
*/
|
||||
IRON_MACE(BarType.IRON, SmithingType.TYPE_MACE, 1420, 17),
|
||||
|
||||
/**
|
||||
* Iron Med Helm
|
||||
*/
|
||||
IRON_MED_HELM(BarType.IRON, SmithingType.TYPE_MEDIUM_HELM, 1137, 18),
|
||||
|
||||
/**
|
||||
* Iron Bolt
|
||||
*/
|
||||
IRON_BOLT(BarType.IRON, SmithingType.TYPE_CROSSBOW_BOLT, 9377, 18),
|
||||
|
||||
/**
|
||||
* Iron Sword
|
||||
*/
|
||||
IRON_SWORD(BarType.IRON, SmithingType.TYPE_SWORD, 1279, 19),
|
||||
|
||||
/**
|
||||
* Iron Dart Tips
|
||||
*/
|
||||
IRON_DART_TIPS(BarType.IRON, SmithingType.TYPE_DART_TIP, 820, 19),
|
||||
|
||||
/**
|
||||
* Iron Nails
|
||||
*/
|
||||
IRON_NAILS(BarType.IRON, SmithingType.TYPE_NAIL, 4820, 19),
|
||||
|
||||
/**
|
||||
* Iron Split
|
||||
*/
|
||||
IRON_SPIT(BarType.IRON, SmithingType.TYPE_SPIT_IRON, 7225, 16),
|
||||
|
||||
/**
|
||||
* Iron Arrow Tips
|
||||
*/
|
||||
IRON_ARROW_TIPS(BarType.IRON, SmithingType.TYPE_ARROW_TIP, 40, 20),
|
||||
|
||||
/**
|
||||
* Iron Scimitar
|
||||
*/
|
||||
IRON_SCIMITAR(BarType.IRON, SmithingType.TYPE_SCIMITAR, 1323, 20),
|
||||
|
||||
/**
|
||||
* Iron Crossbow Limbs
|
||||
*/
|
||||
IRON_CROSSBOW_LimbS(BarType.IRON, SmithingType.TYPE_CROSSBOW_LIMB, 9423, 23),
|
||||
|
||||
/**
|
||||
* Iron LongSword
|
||||
*/
|
||||
IRON_LONGSWORD(BarType.IRON, SmithingType.TYPE_LONGSWORD, 1293, 21),
|
||||
|
||||
/**
|
||||
* Iron Knife
|
||||
*/
|
||||
IRON_KNIFE(BarType.IRON, SmithingType.TYPE_THROWING_KNIFE, 863, 22),
|
||||
|
||||
/**
|
||||
* Iron Full Helm
|
||||
*/
|
||||
IRON_FULL_HELM(BarType.IRON, SmithingType.TYPE_FULL_HELM, 1153, 22),
|
||||
|
||||
/**
|
||||
* Iron Square Shield
|
||||
*/
|
||||
IRON_SQUARE_SHIELD(BarType.IRON, SmithingType.TYPE_SQUARE_SHIELD, 1175, 23),
|
||||
|
||||
/**
|
||||
* Oil Lantern Frame
|
||||
*/
|
||||
OIL_LANTERN_FRAME(BarType.IRON, SmithingType.TYPE_OIL_LANTERN, 4540, 26),
|
||||
/**
|
||||
* Iron WarHammer
|
||||
*/
|
||||
IRON_WARHAMMER(BarType.IRON, SmithingType.TYPE_WARHAMMER, 1335, 24),
|
||||
|
||||
/**
|
||||
* Iron Battleaxe
|
||||
*/
|
||||
IRON_BATTLEAXE(BarType.IRON, SmithingType.TYPE_BATTLE_AXE, 1363, 25),
|
||||
|
||||
/**
|
||||
* Iron ChainBody
|
||||
*/
|
||||
IRON_CHAINBODY(BarType.IRON, SmithingType.TYPE_CHAINBODY, 1101, 26),
|
||||
|
||||
/**
|
||||
* Iron Kite Shield
|
||||
*/
|
||||
IRON_KITE_SHIELD(BarType.IRON, SmithingType.TYPE_KITE_SHIELD, 1191, 27),
|
||||
|
||||
/**
|
||||
* Iron Claws
|
||||
*/
|
||||
IRON_CLAWS(BarType.IRON, SmithingType.TYPE_CLAWS, 3096, 28),
|
||||
|
||||
/**
|
||||
* Iron 2H
|
||||
*/
|
||||
IRON_TWO_HANDED_SWORD(BarType.IRON, SmithingType.TYPE_TWO_HAND_SWORD, 1309, 29),
|
||||
|
||||
/**
|
||||
* Iron PlateSkirt
|
||||
*/
|
||||
IRON_PLATESKIRT(BarType.IRON, SmithingType.TYPE_PLATE_SKIRT, 1081, 31),
|
||||
|
||||
/**
|
||||
* Iron PlateLegs
|
||||
*/
|
||||
IRON_PLATELEGS(BarType.IRON, SmithingType.TYPE_PLATELEG, 1067, 31),
|
||||
|
||||
/**
|
||||
* Iron PlateBody
|
||||
*/
|
||||
IRON_PLATEBODY(BarType.IRON, SmithingType.TYPE_PLATEBODY, 1115, 33),
|
||||
|
||||
/**
|
||||
* Iron PickAxe
|
||||
*/
|
||||
IRON_PICKAXE(BarType.IRON, SmithingType.TYPE_PICKAXE, 1267, 20),
|
||||
|
||||
/**
|
||||
* Steel Dagger
|
||||
*/
|
||||
STEEL_DAGGER(BarType.STEEL, SmithingType.TYPE_DAGGER, 1207, 30),
|
||||
|
||||
/**
|
||||
* Steel Axe
|
||||
*/
|
||||
STEEL_AXE(BarType.STEEL, SmithingType.TYPE_AXE, 1353, 31),
|
||||
|
||||
/**
|
||||
* Steel Mace
|
||||
*/
|
||||
STEEL_MACE(BarType.STEEL, SmithingType.TYPE_MACE, 1424, 32),
|
||||
|
||||
/**
|
||||
* Steel Medium Helm
|
||||
*/
|
||||
STEEL_MED_HELM(BarType.STEEL, SmithingType.TYPE_MEDIUM_HELM, 1141, 33),
|
||||
|
||||
/**
|
||||
* Steel CrossBow bolts
|
||||
*/
|
||||
STEEL_CROSSBOW_BOLT(BarType.STEEL, SmithingType.TYPE_CROSSBOW_BOLT, 9378, 33),
|
||||
|
||||
/**
|
||||
* Steel Sword
|
||||
*/
|
||||
STEEL_SWORD(BarType.STEEL, SmithingType.TYPE_SWORD, 1281, 34),
|
||||
|
||||
/**
|
||||
* Steel Dart Tips
|
||||
*/
|
||||
STEEL_DART_TIPS(BarType.STEEL, SmithingType.TYPE_DART_TIP, 821, 34),
|
||||
|
||||
/**
|
||||
* Steel Nails
|
||||
*/
|
||||
STEEL_NAILS(BarType.STEEL, SmithingType.TYPE_NAIL, 1539, 34),
|
||||
|
||||
/**
|
||||
* Steel ArrowTips
|
||||
*/
|
||||
STEEL_ARROW_TIPS(BarType.STEEL, SmithingType.TYPE_ARROW_TIP, 41, 35),
|
||||
|
||||
/**
|
||||
* Steel Scimitar
|
||||
*/
|
||||
STEEL_SCIMITAR(BarType.STEEL, SmithingType.TYPE_SCIMITAR, 1325, 35),
|
||||
|
||||
/**
|
||||
* Steel Crossbow Limbs
|
||||
*/
|
||||
STEEL_CROSSBOW_LIMBS(BarType.STEEL, SmithingType.TYPE_CROSSBOW_LIMB, 9425, 36),
|
||||
|
||||
/**
|
||||
* Steel LongSword
|
||||
*/
|
||||
STEEL_LONGSWORD(BarType.STEEL, SmithingType.TYPE_LONGSWORD, 1295, 36),
|
||||
|
||||
/**
|
||||
* Steel Knife
|
||||
*/
|
||||
STEEL_THROWING_KNIFE(BarType.STEEL, SmithingType.TYPE_THROWING_KNIFE, 865, 37),
|
||||
|
||||
/**
|
||||
* Steel Full Helm
|
||||
*/
|
||||
STEEL_FULL_HELM(BarType.STEEL, SmithingType.TYPE_FULL_HELM, 1157, 37),
|
||||
|
||||
/**
|
||||
* Steel Studs
|
||||
*/
|
||||
STEEL_STUDS(BarType.STEEL, SmithingType.TYPE_STUDS, 2370, 36),
|
||||
|
||||
/**
|
||||
* Steel Square Shield
|
||||
*/
|
||||
STEEL_SQUARE_SHIELD(BarType.STEEL, SmithingType.TYPE_SQUARE_SHIELD, 1177, 38),
|
||||
|
||||
/**
|
||||
* Steel Lantern
|
||||
*/
|
||||
STEEL_LANTERN(BarType.STEEL, SmithingType.TYPE_LANTERN, 4527, 49),
|
||||
|
||||
STEEL_BULLSEYE(BarType.STEEL, SmithingType.TYPE_BULLSEYE, 4544, 49),
|
||||
|
||||
/**
|
||||
* Steel WarHammer
|
||||
*/
|
||||
STEEL_WARHAMMER(BarType.STEEL, SmithingType.TYPE_WARHAMMER, 1339, 39),
|
||||
|
||||
/**
|
||||
* Steel battle axe
|
||||
*/
|
||||
STEEL_BATTLE_AXE(BarType.STEEL, SmithingType.TYPE_BATTLE_AXE, 1365, 40),
|
||||
|
||||
/**
|
||||
* Steel ChainBody
|
||||
*/
|
||||
STEEL_CHAINBODY(BarType.STEEL, SmithingType.TYPE_CHAINBODY, 1105, 41),
|
||||
|
||||
/**
|
||||
* Steel Kite Shield
|
||||
*/
|
||||
STEEL_KITE_SHIELD(BarType.STEEL, SmithingType.TYPE_KITE_SHIELD, 1193, 42),
|
||||
|
||||
/**
|
||||
* Steel Claws
|
||||
*/
|
||||
STEEL_CLAWS(BarType.STEEL, SmithingType.TYPE_CLAWS, 3097, 43),
|
||||
|
||||
/**
|
||||
* Steel 2h
|
||||
*/
|
||||
STEEL_TWO_HANDED_SWORD(BarType.STEEL, SmithingType.TYPE_TWO_HAND_SWORD, 1311, 44),
|
||||
|
||||
/**
|
||||
* Steel plate skirt
|
||||
*/
|
||||
STEEL_PLATE_SKIRT(BarType.STEEL, SmithingType.TYPE_PLATE_SKIRT, 1083, 46),
|
||||
|
||||
/**
|
||||
* Steel platelegs
|
||||
*/
|
||||
STEEL_PLATELEGS(BarType.STEEL, SmithingType.TYPE_PLATELEG, 1069, 46),
|
||||
|
||||
/**
|
||||
* Steel platebody
|
||||
*/
|
||||
STEEL_PLATEBODY(BarType.STEEL, SmithingType.TYPE_PLATEBODY, 1119, 48),
|
||||
|
||||
/**
|
||||
* Steel pickaxe
|
||||
*/
|
||||
STEEL_PICKAXE(BarType.STEEL, SmithingType.TYPE_PICKAXE, 1269, 35),
|
||||
|
||||
/**
|
||||
* Mithril Dagger
|
||||
*/
|
||||
MITHRIL_DAGGER(BarType.MITHRIL, SmithingType.TYPE_DAGGER, 1209, 50),
|
||||
|
||||
/**
|
||||
* Mithril Hatchet
|
||||
*/
|
||||
MITHRIL_HATCHET(BarType.MITHRIL, SmithingType.TYPE_AXE, 1355, 51),
|
||||
|
||||
/**
|
||||
* Mithril Mace
|
||||
*/
|
||||
MITHRIL_MACE(BarType.MITHRIL, SmithingType.TYPE_MACE, 1428, 52),
|
||||
|
||||
/**
|
||||
* Mithril Med Helm
|
||||
*/
|
||||
MITHRIL_MED_HELM(BarType.MITHRIL, SmithingType.TYPE_MEDIUM_HELM, 1143, 53),
|
||||
|
||||
/**
|
||||
* Mithril Crossbow Bolt
|
||||
*/
|
||||
MITHRIL_CROSSBOW_BOLT(BarType.MITHRIL, SmithingType.TYPE_CROSSBOW_BOLT, 9379, 53),
|
||||
|
||||
/**
|
||||
* Mithril Sword
|
||||
*/
|
||||
MITHRIL_SWORD(BarType.MITHRIL, SmithingType.TYPE_SWORD, 1285, 54),
|
||||
|
||||
/**
|
||||
* Mithril Dart Tips
|
||||
*/
|
||||
MITHRIL_DART_TIPS(BarType.MITHRIL, SmithingType.TYPE_DART_TIP, 822, 54),
|
||||
|
||||
/**
|
||||
* Mithril Nails
|
||||
*/
|
||||
MITHRIL_NAILS(BarType.MITHRIL, SmithingType.TYPE_NAIL, 4822, 54),
|
||||
|
||||
/**
|
||||
* Mithril Arrow Tips
|
||||
*/
|
||||
MITHRIL_ARROW_TIPS(BarType.MITHRIL, SmithingType.TYPE_ARROW_TIP, 42, 55),
|
||||
|
||||
/**
|
||||
* Mithril Scimitar
|
||||
*/
|
||||
MITHRIL_SCIMITAR(BarType.MITHRIL, SmithingType.TYPE_SCIMITAR, 1329, 55),
|
||||
|
||||
/**
|
||||
* Mithril Crossbow Limbs
|
||||
*/
|
||||
MITHRIL_CROSSBOW_LIMBS(BarType.MITHRIL, SmithingType.TYPE_CROSSBOW_LIMB, 9427, 56),
|
||||
|
||||
/**
|
||||
* Mithril LongSword
|
||||
*/
|
||||
MITHRIL_LONGSWORD(BarType.MITHRIL, SmithingType.TYPE_LONGSWORD, 1299, 56),
|
||||
|
||||
/**
|
||||
* Mithril Knife
|
||||
*/
|
||||
MITHRIL_KNIFE(BarType.MITHRIL, SmithingType.TYPE_THROWING_KNIFE, 866, 57),
|
||||
|
||||
/**
|
||||
* Mithril Full Helm
|
||||
*/
|
||||
MITHRIL_FULL_HELM(BarType.MITHRIL, SmithingType.TYPE_FULL_HELM, 1159, 57),
|
||||
|
||||
/**
|
||||
* Mithril SquareShield
|
||||
*/
|
||||
MITHRIL_SQUARE_SHIELD(BarType.MITHRIL, SmithingType.TYPE_SQUARE_SHIELD, 1181, 58),
|
||||
|
||||
/**
|
||||
* Mithril Grapple Tips
|
||||
*/
|
||||
MITHRIL_GRAPPLE_TIPS(BarType.MITHRIL, SmithingType.TYPE_GRAPPLE_TIP, 9416, 59),
|
||||
|
||||
/**
|
||||
* Mithril Warhammer
|
||||
*/
|
||||
MITHRIL_WARHAMMER(BarType.MITHRIL, SmithingType.TYPE_WARHAMMER, 1343, 59),
|
||||
|
||||
/**
|
||||
* Mithril BattleAxe
|
||||
*/
|
||||
MITHRIL_BATTLEAXE(BarType.MITHRIL, SmithingType.TYPE_BATTLE_AXE, 1369, 60),
|
||||
|
||||
/**
|
||||
* Mithril ChainBody
|
||||
*/
|
||||
MITHRIL_CHAINBODY(BarType.MITHRIL, SmithingType.TYPE_CHAINBODY, 1109, 61),
|
||||
|
||||
/**
|
||||
* Mithril KiteShield
|
||||
*/
|
||||
MITHRIL_KITE_SHIELD(BarType.MITHRIL, SmithingType.TYPE_KITE_SHIELD, 1197, 62),
|
||||
|
||||
/**
|
||||
* Mithril Claws
|
||||
*/
|
||||
MITHRIL_CLAWS(BarType.MITHRIL, SmithingType.TYPE_CLAWS, 3099, 63),
|
||||
|
||||
/**
|
||||
* Mithril 2H
|
||||
*/
|
||||
MITHRIL_TWO_HANDED_SWORD(BarType.MITHRIL, SmithingType.TYPE_TWO_HAND_SWORD, 1315, 64),
|
||||
|
||||
/**
|
||||
* Mithril PlateSkirt
|
||||
*/
|
||||
MITHRIL_PLATESKIRT(BarType.MITHRIL, SmithingType.TYPE_PLATE_SKIRT, 1085, 66),
|
||||
|
||||
/**
|
||||
* Mithril PlateLegs
|
||||
*/
|
||||
MITHRIL_PLATELEGS(BarType.MITHRIL, SmithingType.TYPE_PLATELEG, 1071, 66),
|
||||
|
||||
/**
|
||||
* Mithril PlateBody
|
||||
*/
|
||||
MITHRIL_PLATEBODY(BarType.MITHRIL, SmithingType.TYPE_PLATEBODY, 1121, 68),
|
||||
|
||||
/**
|
||||
* Mithril PickAxe
|
||||
*/
|
||||
MITHRIL_PICKAXE(BarType.MITHRIL, SmithingType.TYPE_PICKAXE, 1273, 55),
|
||||
|
||||
/**
|
||||
* Adamant Dagger
|
||||
*/
|
||||
ADAMANT_DAGGER(BarType.ADAMANT, SmithingType.TYPE_DAGGER, 1211, 70),
|
||||
|
||||
/**
|
||||
* Adamant Hatchet
|
||||
*/
|
||||
ADAMANT_AXE(BarType.ADAMANT, SmithingType.TYPE_AXE, 1357, 71),
|
||||
|
||||
/**
|
||||
* Adamant Mace
|
||||
*/
|
||||
ADAMANT_MACE(BarType.ADAMANT, SmithingType.TYPE_MACE, 1430, 72),
|
||||
|
||||
/**
|
||||
* Adamant Med Helm
|
||||
*/
|
||||
ADAMANT_MEDIUM_HELM(BarType.ADAMANT, SmithingType.TYPE_MEDIUM_HELM, 1145, 73),
|
||||
|
||||
/**
|
||||
* Adamant Crossbow Bolt
|
||||
*/
|
||||
ADAMANT_BOLT(BarType.ADAMANT, SmithingType.TYPE_CROSSBOW_BOLT, 9380, 73),
|
||||
|
||||
/**
|
||||
* Adamant Sword
|
||||
*/
|
||||
ADAMANT_SWORD(BarType.ADAMANT, SmithingType.TYPE_SWORD, 1287, 74),
|
||||
|
||||
/**
|
||||
* Adamant Dart Tips
|
||||
*/
|
||||
ADAMANT_DART_TIPS(BarType.ADAMANT, SmithingType.TYPE_DART_TIP, 823, 74),
|
||||
|
||||
/**
|
||||
* Adamant Nails
|
||||
*/
|
||||
ADAMANT_NAILS(BarType.ADAMANT, SmithingType.TYPE_NAIL, 4823, 74),
|
||||
|
||||
/**
|
||||
* Adamant Arrow Tips
|
||||
*/
|
||||
ADAMANT_ARROW_TIPS(BarType.ADAMANT, SmithingType.TYPE_ARROW_TIP, 43, 75),
|
||||
|
||||
/**
|
||||
* Adamant Scmitar
|
||||
*/
|
||||
ADAMANT_SCIMITAR(BarType.ADAMANT, SmithingType.TYPE_SCIMITAR, 1331, 75),
|
||||
|
||||
/**
|
||||
* Adamant Crossbow Limbs
|
||||
*/
|
||||
ADAMANT_LIMBS(BarType.ADAMANT, SmithingType.TYPE_CROSSBOW_LIMB, 9429, 76),
|
||||
|
||||
/**
|
||||
* Adamant LongSword
|
||||
*/
|
||||
ADAMANT_LONGSWORD(BarType.ADAMANT, SmithingType.TYPE_LONGSWORD, 1301, 76),
|
||||
|
||||
/**
|
||||
* Adamant Knife
|
||||
*/
|
||||
ADAMANT_KNIFE(BarType.ADAMANT, SmithingType.TYPE_THROWING_KNIFE, 867, 77),
|
||||
|
||||
/**
|
||||
* Adamant Full Helm
|
||||
*/
|
||||
ADAMANT_FULL_HELM(BarType.ADAMANT, SmithingType.TYPE_FULL_HELM, 1161, 77),
|
||||
|
||||
/**
|
||||
* Adamant Square Shield
|
||||
*/
|
||||
ADAMANT_SQUARE_SHIELD(BarType.ADAMANT, SmithingType.TYPE_SQUARE_SHIELD, 1183, 78),
|
||||
|
||||
/**
|
||||
* Adamant Warhammer
|
||||
*/
|
||||
ADAMANT_WARHAMMER(BarType.ADAMANT, SmithingType.TYPE_WARHAMMER, 1345, 79),
|
||||
|
||||
/**
|
||||
* Adamant BattleAxe
|
||||
*/
|
||||
ADAMANT_BATTLEAXE(BarType.ADAMANT, SmithingType.TYPE_BATTLE_AXE, 1371, 80),
|
||||
|
||||
/**
|
||||
* Adamant ChainBody
|
||||
*/
|
||||
ADAMANT_CHAINBODY(BarType.ADAMANT, SmithingType.TYPE_CHAINBODY, 1111, 81),
|
||||
|
||||
/**
|
||||
* Adamant KiteShield
|
||||
*/
|
||||
ADAMANT_KITESHIELD(BarType.ADAMANT, SmithingType.TYPE_KITE_SHIELD, 1199, 82),
|
||||
|
||||
/**
|
||||
* Adamant Claws
|
||||
*/
|
||||
ADAMANT_CLAWS(BarType.ADAMANT, SmithingType.TYPE_CLAWS, 3100, 83),
|
||||
|
||||
/**
|
||||
* Adamant 2H
|
||||
*/
|
||||
ADAMANT_TWO_HANDED_SWORD(BarType.ADAMANT, SmithingType.TYPE_TWO_HAND_SWORD, 1317, 84),
|
||||
|
||||
/**
|
||||
* Adamant PlateSkirt
|
||||
*/
|
||||
ADAMANT_PLATE_SKIRT(BarType.ADAMANT, SmithingType.TYPE_PLATE_SKIRT, 1091, 86),
|
||||
|
||||
/**
|
||||
* Adamant PlateLegs
|
||||
*/
|
||||
ADAMANT_PLATE_LEGS(BarType.ADAMANT, SmithingType.TYPE_PLATELEG, 1073, 86),
|
||||
|
||||
/**
|
||||
* Adamant PlateBody
|
||||
*/
|
||||
ADAMANT_PLATE_BODY(BarType.ADAMANT, SmithingType.TYPE_PLATEBODY, 1123, 88),
|
||||
|
||||
/**
|
||||
* Adamant PickAxe
|
||||
*/
|
||||
ADAMANT_PICKAXE(BarType.ADAMANT, SmithingType.TYPE_PICKAXE, 1271, 75),
|
||||
|
||||
/**
|
||||
* Rune Dagger
|
||||
*/
|
||||
RUNE_DAGGER(BarType.RUNITE, SmithingType.TYPE_DAGGER, 1213, 85),
|
||||
|
||||
/**
|
||||
* Rune Hatchet
|
||||
*/
|
||||
RUNITE_AXE(BarType.RUNITE, SmithingType.TYPE_AXE, 1359, 86),
|
||||
|
||||
/**
|
||||
* Rune Mace
|
||||
*/
|
||||
RUNITE_MACE(BarType.RUNITE, SmithingType.TYPE_MACE, 1432, 87),
|
||||
|
||||
/**
|
||||
* Rune Med Helm
|
||||
*/
|
||||
RUNITE_MEDIUM_HELM(BarType.RUNITE, SmithingType.TYPE_MEDIUM_HELM, 1147, 88),
|
||||
|
||||
/**
|
||||
* Rune Crossbow Bolt
|
||||
*/
|
||||
RUNITE_BOLT(BarType.RUNITE, SmithingType.TYPE_CROSSBOW_BOLT, 9381, 88),
|
||||
|
||||
/**
|
||||
* Rune Sword
|
||||
*/
|
||||
RUNITE_SWORD(BarType.RUNITE, SmithingType.TYPE_SWORD, 1289, 89),
|
||||
|
||||
/**
|
||||
* Rune Dart Tips
|
||||
*/
|
||||
RUNITE_DART_TIPS(BarType.RUNITE, SmithingType.TYPE_DART_TIP, 824, 89),
|
||||
|
||||
/**
|
||||
* Rune Nails
|
||||
*/
|
||||
RUNITE_NAILS(BarType.RUNITE, SmithingType.TYPE_NAIL, 4824, 89),
|
||||
|
||||
/**
|
||||
* Rune Arrow Tips
|
||||
*/
|
||||
RUNITE_ARROW_TIPS(BarType.RUNITE, SmithingType.TYPE_ARROW_TIP, 44, 90),
|
||||
|
||||
/**
|
||||
* Rune Scmitar
|
||||
*/
|
||||
RUNITE_SCIMITAR(BarType.RUNITE, SmithingType.TYPE_SCIMITAR, 1333, 90),
|
||||
|
||||
/**
|
||||
* Rune Crossbow Limbs
|
||||
*/
|
||||
RUNITE_LIMBS(BarType.RUNITE, SmithingType.TYPE_CROSSBOW_LIMB, 9431, 91),
|
||||
|
||||
/**
|
||||
* Rune LongSword
|
||||
*/
|
||||
RUNITE_LONGSWORD(BarType.RUNITE, SmithingType.TYPE_LONGSWORD, 1303, 91),
|
||||
|
||||
/**
|
||||
* Rune Knife
|
||||
*/
|
||||
RUNITE_KNIFE(BarType.RUNITE, SmithingType.TYPE_THROWING_KNIFE, 868, 92),
|
||||
|
||||
/**
|
||||
* Rune Full Helm
|
||||
*/
|
||||
RUNITE_FULL_HELM(BarType.RUNITE, SmithingType.TYPE_FULL_HELM, 1163, 92),
|
||||
|
||||
/**
|
||||
* Rune Square Shield
|
||||
*/
|
||||
RUNITE_SQUARE_SHIELD(BarType.RUNITE, SmithingType.TYPE_SQUARE_SHIELD, 1185, 93),
|
||||
|
||||
/**
|
||||
* Rune Warhammer
|
||||
*/
|
||||
RUNITE_WARHAMMER(BarType.RUNITE, SmithingType.TYPE_WARHAMMER, 1347, 94),
|
||||
|
||||
/**
|
||||
* Rune BattleAxe
|
||||
*/
|
||||
RUNITE_BATTLEAXE(BarType.RUNITE, SmithingType.TYPE_BATTLE_AXE, 1373, 95),
|
||||
|
||||
/**
|
||||
* Rune ChainBody
|
||||
*/
|
||||
RUNITE_CHAINBODY(BarType.RUNITE, SmithingType.TYPE_CHAINBODY, 1113, 96),
|
||||
|
||||
/**
|
||||
* Rune KiteShield
|
||||
*/
|
||||
RUNITE_KITESHIELD(BarType.RUNITE, SmithingType.TYPE_KITE_SHIELD, 1201, 97),
|
||||
|
||||
/**
|
||||
* Rune Claws
|
||||
*/
|
||||
RUNITE_CLAWS(BarType.RUNITE, SmithingType.TYPE_CLAWS, 3101, 98),
|
||||
|
||||
/**
|
||||
* Rune 2H
|
||||
*/
|
||||
RUNITE_TWO_HANDED_SWORD(BarType.RUNITE, SmithingType.TYPE_TWO_HAND_SWORD, 1319, 99),
|
||||
|
||||
/**
|
||||
* Rune PlateSkirt
|
||||
*/
|
||||
RUNITE_PLATE_SKIRT(BarType.RUNITE, SmithingType.TYPE_PLATE_SKIRT, 1093, 99),
|
||||
|
||||
/**
|
||||
* Rune PlateLegs
|
||||
*/
|
||||
RUNITE_PLATE_LEGS(BarType.RUNITE, SmithingType.TYPE_PLATELEG, 1079, 99),
|
||||
|
||||
/**
|
||||
* Rune PlateBody
|
||||
*/
|
||||
RUNITE_PLATE_BODY(BarType.RUNITE, SmithingType.TYPE_PLATEBODY, 1127, 99),
|
||||
|
||||
/**
|
||||
* Rune PickAxe
|
||||
*/
|
||||
RUNITE_PICKAXE(BarType.RUNITE, SmithingType.TYPE_PICKAXE, 1275, 90),
|
||||
|
||||
/**
|
||||
* Blurite CrossBow bolts
|
||||
*/
|
||||
BLURITE_CROSSBOW_BOLT(BarType.BLURITE, SmithingType.TYPE_CROSSBOW_BOLT, 9376, 8),
|
||||
|
||||
/**
|
||||
* Blurite Crossbow Limbs
|
||||
*/
|
||||
BLURITE_CROSSBOW_LIMBS(BarType.BLURITE, SmithingType.TYPE_CROSSBOW_LIMB, 9422, 13);
|
||||
|
||||
/**
|
||||
* A map of object ids to primary ingredients.
|
||||
*/
|
||||
private static Map<Short, Bars> bars = new HashMap<Short, Bars>();
|
||||
|
||||
/**
|
||||
* Gets a bar by an item id.
|
||||
* @param item The item id.
|
||||
* @return The bar or <code>null</code> if the object is not a bar.
|
||||
*/
|
||||
public static Bars forId(int item) {
|
||||
for (Bars bar : Bars.values()) {
|
||||
if (bar.getProduct() == item) {
|
||||
return bar;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the herb mapping.
|
||||
*/
|
||||
static {
|
||||
for (Bars bar : Bars.values()) {
|
||||
bars.put((short) bar.getProduct(), bar);
|
||||
}
|
||||
}
|
||||
|
||||
private BarType Btype;
|
||||
private SmithingType Stype;
|
||||
private int product;
|
||||
private int level;
|
||||
|
||||
private Bars(BarType Btype, SmithingType Stype, int productId, int level) {
|
||||
this.Btype = Btype;
|
||||
this.Stype = Stype;
|
||||
this.product = productId;
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public BarType getBarType() {
|
||||
return Btype;
|
||||
}
|
||||
|
||||
public SmithingType getSmithingType() {
|
||||
return Stype;
|
||||
}
|
||||
|
||||
public int getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public static boolean constructInterface(Player player, int itemId) {
|
||||
switch (itemId) {
|
||||
case 2349:
|
||||
case 2351:
|
||||
case 2353:
|
||||
case 2359:
|
||||
case 2361:
|
||||
case 2363:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Bars[] getBars(BarType type) {
|
||||
List<Bars> bars = new ArrayList<Bars>();
|
||||
for (Bars bar : Bars.values()) {
|
||||
if (bar.getBarType() == type) {
|
||||
bars.add(bar);
|
||||
}
|
||||
}
|
||||
Bars[] barss = new Bars[bars.size()];
|
||||
for (int i = 0; i < bars.size(); i++) {
|
||||
barss[i] = bars.get(i);
|
||||
}
|
||||
return barss;
|
||||
}
|
||||
|
||||
public static int getItemId(int buttonId, BarType type) {
|
||||
for (Bars bar : Bars.values()) {
|
||||
if (bar.getBarType() != type) {
|
||||
continue;
|
||||
}
|
||||
for (int i : bar.getSmithingType().getButton()) {
|
||||
if (buttonId == i) {
|
||||
return bar.getProduct();
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int getIndex(Player player, int buttonId, BarType type) {
|
||||
int index = 0;
|
||||
for (Bars bar : Bars.values()) {
|
||||
if (bar.getBarType() != type) {
|
||||
continue;
|
||||
}
|
||||
bar = Bars.forId(bar.getProduct());
|
||||
for (int i = 0; i < bar.getSmithingType().getButton().length; i++) {
|
||||
if (buttonId != bar.getSmithingType().getButton()[i]) {
|
||||
index++;
|
||||
return index;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import core.game.dialogue.DialoguePlugin;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.plugin.Initializable;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
|
||||
/**
|
||||
* Represents the dialogue plugin used for making a dragon shield.
|
||||
* @author 'Vexia
|
||||
* @version 1.0
|
||||
*/
|
||||
@Initializable
|
||||
public final class DragonShieldDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Represents the item shield parts.
|
||||
*/
|
||||
private static final Item[] SHIELD_PARTS = new Item[] { new Item(2366), new Item(2368) };
|
||||
|
||||
/**
|
||||
* Represents th edraconic visage item.
|
||||
*/
|
||||
private static final Item DRACONIC_VISAGE = new Item(11286);
|
||||
|
||||
/**
|
||||
* Represents the anti dragon fire shield.
|
||||
*/
|
||||
private static final Item ANTI_DRAGONSHIELD = new Item(1540);
|
||||
|
||||
/**
|
||||
* Represents the dragon fire shield item.
|
||||
*/
|
||||
private static final Item DRAGON_FIRESHIELD = new Item(11284);
|
||||
|
||||
/**
|
||||
* Represents the shield item.
|
||||
*/
|
||||
private static final Item SQ_SHIELD = new Item(1187);
|
||||
|
||||
/**
|
||||
* Represents the hammering animation.
|
||||
*/
|
||||
private static Animation ANIMATION = new Animation(898);
|
||||
|
||||
/**
|
||||
* Represents the shield type.
|
||||
*/
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DragonShieldDialogue} {@code Object}.
|
||||
*/
|
||||
public DragonShieldDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DragonShieldDialogue} {@code Object}.
|
||||
* @param player the player.
|
||||
*/
|
||||
public DragonShieldDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new DragonShieldDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
type = (int) args[0];
|
||||
if (type == 1) {
|
||||
interpreter.sendDialogue("You set to work trying to fix the ancient shield. It's seen some", "heavy reward and needs some serious work doing to it.");
|
||||
stage = 0;
|
||||
} else {
|
||||
interpreter.sendDialogue("You set to work, trying to attach the ancient draconic", "visage to your anti-dragonbreath shield. It's not easy to", "work with the ancient artifact and it takes all of your", "skills as a master smith.");
|
||||
stage = 10;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
player.lock(5);
|
||||
player.animate(ANIMATION);
|
||||
interpreter.sendDialogue("Even for an experienced armourer it is not an easy task, but", "eventually it is ready. You have restored the dragon square shield to", "its former glory.");
|
||||
if (player.getInventory().remove(SHIELD_PARTS)) {
|
||||
player.getInventory().add(SQ_SHIELD);
|
||||
}
|
||||
player.getSkills().addExperience(Skills.SMITHING, 75, true);
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
end();
|
||||
break;
|
||||
case 10:
|
||||
player.lock(5);
|
||||
player.animate(ANIMATION);
|
||||
interpreter.sendDialogue("Even for an experienced armourer it is not an easy task, but", "eventually it is ready. You have crafted the", "draconic visage and anti-dragonbreath shield into a", "dragonfire shield.");
|
||||
if (player.getInventory().remove(DRACONIC_VISAGE, ANTI_DRAGONSHIELD)) {
|
||||
player.getInventory().add(DRAGON_FIRESHIELD);
|
||||
}
|
||||
player.getSkills().addExperience(Skills.SMITHING, 2000);
|
||||
stage = 1;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 82127843 };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import content.global.skill.smithing.smelting.Bar;
|
||||
import core.cache.def.impl.SceneryDefinition;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.interaction.NodeUsageEvent;
|
||||
import core.game.interaction.OptionHandler;
|
||||
import core.game.interaction.UseWithHandler;
|
||||
import core.game.node.Node;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.diary.DiaryType;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.system.task.Pulse;
|
||||
import core.game.world.GameWorld;
|
||||
import core.game.world.map.Location;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.plugin.Initializable;
|
||||
import core.plugin.Plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents the plugin used for the furnace.
|
||||
* @author Vexia
|
||||
*/
|
||||
@Initializable
|
||||
public final class FurnaceOptionPlugin extends OptionHandler {
|
||||
|
||||
/**
|
||||
* Represents the animation to use.
|
||||
*/
|
||||
private static final Animation ANIMATION = new Animation(833);
|
||||
|
||||
/**
|
||||
* Represents the items used for the tutorial island (ores).
|
||||
*/
|
||||
private static final Item[] ITEMS = new Item[] { new Item(438, 1), new Item(436, 1) };
|
||||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
SceneryDefinition.setOptionHandler("smelt", this);
|
||||
SceneryDefinition.setOptionHandler("smelt-ore", this);
|
||||
SceneryDefinition.forId(3044).getHandlers().put("option:use", this);
|
||||
SceneryDefinition.forId(21303).getHandlers().put("option:use", this);
|
||||
new SmeltUseWithHandler().newInstance(arg);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(final Player player, Node node, String option) {
|
||||
if (node.getId() == 26814 && !player.getAchievementDiaryManager().getDiary(DiaryType.VARROCK).isComplete(0)) {
|
||||
player.sendMessage("You need to have completed the easy tasks in the Varrock Diary in order to use this.");
|
||||
return true;
|
||||
}
|
||||
show(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the items.
|
||||
* @param player the player.
|
||||
*/
|
||||
private static void show(final Player player) {
|
||||
player.getInterfaceManager().openChatbox(311);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2349, 150, 311, 4);
|
||||
if (player.getQuestRepository().isComplete("The Knight's Sword")) {
|
||||
player.getPacketDispatch().sendString("<br><br><br><br><col=000000>Blurite", 311, 20);
|
||||
}
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(Bar.BLURITE.getProduct().getId(), 150, 311, 5);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(Bar.IRON.getProduct().getId(), 150, 311, 6);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2355, 150, 311, 7);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2353, 150, 311, 8);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2357, 150, 311, 9);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2359, 150, 311, 10);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2361, 150, 311, 11);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(2363, 150, 311, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to handle the tutorial island interaction.
|
||||
* @param player the player.
|
||||
*/
|
||||
private final void handleTutorialIsland(final Player player) {
|
||||
if (player.getInventory().containItems(438, 436)) {
|
||||
player.animate(ANIMATION);
|
||||
GameWorld.getPulser().submit(new Pulse(2, player) {
|
||||
@Override
|
||||
public boolean pulse() {
|
||||
player.getInventory().remove(ITEMS);
|
||||
player.getInventory().add(Bar.BRONZE.getProduct());
|
||||
player.getSkills().addExperience(Skills.SMITHING, Bar.BRONZE.getExperience());
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the plugin used to handle the ore on the furance.
|
||||
* @author 'Vexia
|
||||
* @version 1.0
|
||||
*/
|
||||
public final static class SmeltUseWithHandler extends UseWithHandler {
|
||||
|
||||
/**
|
||||
* Represents the ids.
|
||||
*/
|
||||
public static final int[] furnaceIDS = new int[] { 4304, 6189, 11010, 11666, 12100, 12809, 14921, 18497, 26814, 30021, 30510, 36956, 37651 };
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmeltUseWithHandler} {@code Object}.
|
||||
*/
|
||||
public SmeltUseWithHandler() {
|
||||
super(getIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
for (int i : furnaceIDS) {
|
||||
addHandler(i, OBJECT_TYPE, this);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(NodeUsageEvent event) {
|
||||
if (event.getUsedWith().getId() == 26814 && !event.getPlayer().getAchievementDiaryManager().getDiary(DiaryType.VARROCK).isComplete(0)) {
|
||||
event.getPlayer().sendMessage("You need to have completed the easy tasks in the Varrock Diary in order to use this.");
|
||||
return true;
|
||||
}
|
||||
show(event.getPlayer());
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ore ids.
|
||||
* @return the ids.
|
||||
*/
|
||||
public static final int[] getIds() {
|
||||
List<Integer> ids = new ArrayList<>(10);
|
||||
for (Bar bar : Bar.values()) {
|
||||
for (Item i : bar.getOres()) {
|
||||
ids.add(i.getId());
|
||||
}
|
||||
}
|
||||
int[] array = new int[ids.size()];
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
array[i] = ids.get(i);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getDestination(Node node, Node n) {
|
||||
if (node instanceof Player && ((Player) node).getZoneMonitor().isInZone("Donator Zone")) {
|
||||
return n.getLocation().transform(1, 2, 0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import content.global.skill.smithing.smelting.Bar;
|
||||
import core.game.component.Component;
|
||||
import core.game.container.access.InterfaceContainer;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
import core.tools.StringUtils;
|
||||
|
||||
/**
|
||||
* Represents the builder class to view the correct information, on the
|
||||
* interface of smithing, ie, the items ammount, and name.
|
||||
* @author 'Vexia
|
||||
*/
|
||||
public final class SmithingBuilder {
|
||||
|
||||
/**
|
||||
* The bar type.
|
||||
*/
|
||||
private BarType type;
|
||||
|
||||
/**
|
||||
* The bar used.
|
||||
*/
|
||||
private Bar bar;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmithingBuilder.java} {@code Object}.
|
||||
* @param item the item.
|
||||
*/
|
||||
public SmithingBuilder(Item item) {
|
||||
this.bar = Bar.forId(item.getId());
|
||||
this.type = BarType.getBarTypeForId(item.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the interface of the smithing.
|
||||
* @param player the player.
|
||||
*/
|
||||
public void build(Player player) {
|
||||
player.getGameAttributes().removeAttribute("smith-type");
|
||||
player.getGameAttributes().setAttribute("smith-type", type);
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 267, false);// pickaxe
|
||||
final Bars bars[] = Bars.getBars(type);
|
||||
for (int i = 0; i < bars.length; i++) {
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_GRAPPLE_TIP) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 169, false);
|
||||
}
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_DART_TIP) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 65, false);
|
||||
}
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_SPIT_IRON || bars[i].getSmithingType() == SmithingType.TYPE_WIRE || bars[i].getSmithingType() == SmithingType.TYPE_BULLSEYE) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 89, false);
|
||||
}
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_CLAWS) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 209, false);
|
||||
}
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_LANTERN || bars[i].getSmithingType() == SmithingType.TYPE_OIL_LANTERN) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 161, false);
|
||||
}
|
||||
if (bars[i].getSmithingType() == SmithingType.TYPE_STUDS) {
|
||||
player.getPacketDispatch().sendInterfaceConfig(300, 169, false);
|
||||
}
|
||||
String color = "";
|
||||
if (player.getSkills().getLevel(Skills.SMITHING) < bars[i].getLevel()) {
|
||||
} else {
|
||||
color = "<col=FFFFFF>";
|
||||
}
|
||||
player.getPacketDispatch().sendString(color + StringUtils.formatDisplayName(bars[i].getSmithingType().name().replace("TYPE_", "")), 300, bars[i].getSmithingType().getName());
|
||||
if (player.getInventory().contains(bars[i].getBarType().getBarType(), bars[i].getSmithingType().getRequired())) {
|
||||
color = "<col=2DE120>";
|
||||
} else {
|
||||
color = null;
|
||||
}
|
||||
if (color != null) {
|
||||
String amt = bars[i].getSmithingType().getRequired() > 1 ? "s" : "";
|
||||
player.getPacketDispatch().sendString(color + String.valueOf(bars[i].getSmithingType().getRequired()) + " Bar" + amt, 300, bars[i].getSmithingType().getName() + 1);
|
||||
}
|
||||
InterfaceContainer.generateItems(player, new Item[] { new Item(bars[i].getProduct(), bars[i].getSmithingType().getProductAmount()) }, new String[] { "" }, 300, bars[i].getSmithingType().getChild() - 1);
|
||||
}
|
||||
player.getPacketDispatch().sendString(type.getBarName(), 300, 15);
|
||||
player.getInterfaceManager().open(new Component(300));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type.
|
||||
* @return the type.
|
||||
*/
|
||||
public BarType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bar.
|
||||
* @return the bar.
|
||||
*/
|
||||
public Bar getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import content.global.skill.skillcapeperks.SkillcapePerks;
|
||||
import core.game.event.ResourceProducedEvent;
|
||||
import core.cache.def.impl.ItemDefinition;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.diary.DiaryType;
|
||||
import core.game.node.entity.skill.SkillPulse;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.world.map.Location;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.tools.StringUtils;
|
||||
|
||||
/**
|
||||
* Represents the pulse used to smith a bar.
|
||||
*
|
||||
* @author 'Vexia
|
||||
*/
|
||||
public class SmithingPulse extends SkillPulse<Item> {
|
||||
|
||||
/**
|
||||
* Represents the animation to use.
|
||||
*/
|
||||
private static final Animation ANIMATION = new Animation(898);
|
||||
|
||||
/**
|
||||
* Represents the bar being made.
|
||||
*/
|
||||
private final Bars bar;
|
||||
|
||||
/**
|
||||
* Represents the amount to make.
|
||||
*/
|
||||
private int amount;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmithingPulse} {@code Object}.
|
||||
*
|
||||
* @param player the player.
|
||||
* @param item the item.
|
||||
*/
|
||||
public SmithingPulse(Player player, Item item, Bars bar, int amount) {
|
||||
super(player, item);
|
||||
this.bar = bar;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRequirements() {
|
||||
if (!player.getInventory().contains(bar.getBarType().getBarType(), bar.getSmithingType().getRequired() * amount)) {
|
||||
amount = player.getInventory().getAmount(new Item(bar.getBarType().getBarType()));
|
||||
}
|
||||
player.getInterfaceManager().close();
|
||||
if (player.getSkills().getLevel(Skills.SMITHING) < bar.getLevel()) {
|
||||
player.getDialogueInterpreter().sendDialogue("You need a Smithing level of " + bar.getLevel() + " to make a " + ItemDefinition.forId(bar.getProduct()).getName() + ".");
|
||||
return false;
|
||||
}
|
||||
if (!player.getInventory().contains(bar.getBarType().getBarType(), bar.getSmithingType().getRequired())) {
|
||||
player.getDialogueInterpreter().sendDialogue("You don't have enough " + ItemDefinition.forId(bar.getBarType().getBarType()).getName().toLowerCase() + "s to make a " + bar.getSmithingType().name().replace("TYPE_", "").replace("_", " ").toLowerCase() + ".");
|
||||
return false;
|
||||
}
|
||||
if (!player.getInventory().contains(2347, 1) && !SkillcapePerks.isActive(SkillcapePerks.BAREFISTED_SMITHING,player)) {
|
||||
player.getDialogueInterpreter().sendDialogue("You need a hammer to work the metal with.");
|
||||
return false;
|
||||
}
|
||||
if (!player.getQuestRepository().isComplete("The Tourist Trap") && bar.getSmithingType() == SmithingType.TYPE_DART_TIP) {
|
||||
player.getDialogueInterpreter().sendDialogue("You need to complete Tourist Trap to smith dart tips.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animate() {
|
||||
if(SkillcapePerks.isActive(SkillcapePerks.BAREFISTED_SMITHING,player)){
|
||||
player.animate(new Animation(2068)); //Torag's Hammer animation lol
|
||||
return;
|
||||
}
|
||||
player.animate(ANIMATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reward() {
|
||||
if (getDelay() == 1) {
|
||||
setDelay(4);
|
||||
return false;
|
||||
}
|
||||
player.getInventory().remove(new Item(bar.getBarType().getBarType(), bar.getSmithingType().getRequired()));
|
||||
final Item item = new Item(node.getId(), bar.getSmithingType().getProductAmount());
|
||||
player.getInventory().add(item);
|
||||
player.dispatch(new ResourceProducedEvent(item.getId(), 1, player, bar.getBarType().getBarType()));
|
||||
player.getSkills().addExperience(Skills.SMITHING, bar.getBarType().getExperience() * bar.getSmithingType().getRequired(), true);
|
||||
String message = StringUtils.isPlusN(ItemDefinition.forId(bar.getProduct()).getName().toLowerCase()) ? "an" : "a";
|
||||
player.getPacketDispatch().sendMessage("You hammer the " + bar.getBarType().getBarName().toLowerCase().replace("smithing", "") + "and make " + message + " " + ItemDefinition.forId(bar.getProduct()).getName().toLowerCase() + ".");
|
||||
|
||||
if (bar == Bars.BLURITE_CROSSBOW_LIMBS
|
||||
&& player.getLocation().withinDistance(new Location(3000, 3145, 0), 10)) { // near Thurgo's anvil
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.FALADOR, 1, 9);
|
||||
}
|
||||
|
||||
// Smith a steel longsword on the anvil in the jailhouse<br><br>sewers
|
||||
if (bar == Bars.STEEL_LONGSWORD && player.getLocation().withinDistance(Location.create(3112, 9688, 0))) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 2, 0);
|
||||
}
|
||||
|
||||
// Smith an adamantite medium helm on the south-east anvil in<br><br>Varrock, next to Aubury's Rune Shop
|
||||
if (bar == Bars.ADAMANT_MEDIUM_HELM && player.getLocation().withinDistance(Location.create(3247, 3404, 0))) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.VARROCK, 2, 3);
|
||||
}
|
||||
|
||||
amount--;
|
||||
return amount < 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void message(int type) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
package content.global.skill.smithing;
|
||||
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
|
||||
/**
|
||||
* Represents a type of smithing.
|
||||
* @author Emperor
|
||||
*/
|
||||
public enum SmithingType {
|
||||
|
||||
/**
|
||||
* Dagger
|
||||
*/
|
||||
TYPE_DAGGER(1, 18, 19, new int[] { 24, 23, 22, 21 }, 1),
|
||||
|
||||
/**
|
||||
* Axe
|
||||
*/
|
||||
TYPE_AXE(1, 26, 27, new int[] { 32, 31, 30, 29 }, 1),
|
||||
|
||||
/**
|
||||
* Mace
|
||||
*/
|
||||
TYPE_MACE(1, 34, 35, new int[] { 40, 39, 38, 37 }, 1),
|
||||
|
||||
/**
|
||||
* Med helm
|
||||
*/
|
||||
TYPE_MEDIUM_HELM(1, 42, 43, new int[] { 48, 47, 46, 45 }, 1),
|
||||
|
||||
/**
|
||||
* Crossbow bolt
|
||||
*/
|
||||
TYPE_CROSSBOW_BOLT(1, 50, 51, new int[] { 56, 55, 54, 53 }, 10),
|
||||
|
||||
/**
|
||||
* Sword
|
||||
*/
|
||||
TYPE_SWORD(1, 58, 59, new int[] { 64, 63, 62, 61 }, 1),
|
||||
|
||||
/**
|
||||
* Dart tips
|
||||
*/
|
||||
TYPE_DART_TIP(1, 66, 67, new int[] { 72, 71, 70, 69 }, 10),
|
||||
|
||||
/**
|
||||
* Nails
|
||||
*/
|
||||
TYPE_NAIL(1, 74, 75, new int[] { 80, 79, 78, 77 }, 15),
|
||||
|
||||
/**
|
||||
* Bullseye
|
||||
*/
|
||||
TYPE_BULLSEYE(1, 90, 91, new int[] { 96, 95, 94, 93 }, 1),
|
||||
|
||||
/**
|
||||
* Spit Iron
|
||||
*/
|
||||
TYPE_SPIT_IRON(1, 90, 91, new int[] { 96, 95, 94, 93 }, 1),
|
||||
/**
|
||||
*
|
||||
*/
|
||||
TYPE_WIRE(1, 90, 91, new int[] { 96, 95, 94, 93 }, 1),
|
||||
|
||||
/**
|
||||
* Arrow Tips
|
||||
*/
|
||||
TYPE_ARROW_TIP(1, 106, 107, new int[] { 112, 111, 110, 109 }, 15),
|
||||
|
||||
/**
|
||||
* Scimitar
|
||||
*/
|
||||
TYPE_SCIMITAR(2, 114, 115, new int[] { 120, 119, 118, 117 }, 1),
|
||||
|
||||
/**
|
||||
* Crossbow Limbs
|
||||
*/
|
||||
TYPE_CROSSBOW_LIMB(1, 122, 123, new int[] { 128, 127, 126, 125 }, 1),
|
||||
|
||||
/**
|
||||
* LongSword
|
||||
*/
|
||||
TYPE_LONGSWORD(2, 130, 131, new int[] { 136, 135, 134, 133 }, 1),
|
||||
|
||||
/**
|
||||
* Throwing Knife
|
||||
*/
|
||||
TYPE_THROWING_KNIFE(1, 138, 139, new int[] { 144, 143, 142, 141 }, 5),
|
||||
|
||||
/**
|
||||
* Full helm
|
||||
*/
|
||||
TYPE_FULL_HELM(2, 146, 147, new int[] { 152, 151, 150, 149 }, 1),
|
||||
|
||||
/**
|
||||
* Square Shield
|
||||
*/
|
||||
TYPE_SQUARE_SHIELD(2, 154, 155, new int[] { 160, 159, 158, 157 }, 1),
|
||||
|
||||
/**
|
||||
* Latern
|
||||
*/
|
||||
TYPE_LANTERN(1, 162, 163, new int[] { 168, 167, 166, 165 }, 1),
|
||||
|
||||
/**
|
||||
* Oil Lantern
|
||||
*/
|
||||
TYPE_OIL_LANTERN(1,162,163,new int[] {168,167,166,165},1),
|
||||
|
||||
/**
|
||||
* Grapple Tips
|
||||
*/
|
||||
TYPE_GRAPPLE_TIP(1, 170, 171, new int[] { 175, 176, 175, 174, 173 }, 1),
|
||||
|
||||
/**
|
||||
* The studs type.
|
||||
*/
|
||||
TYPE_STUDS(1, 170, 171, new int[] { 175, 176, 174, 173, 172 }, 1),
|
||||
|
||||
/**
|
||||
* Warhammer
|
||||
*/
|
||||
TYPE_WARHAMMER(3, 178, 179, new int[] { 184, 183, 182, 181 }, 1),
|
||||
|
||||
/**
|
||||
* Battle axe
|
||||
*/
|
||||
TYPE_BATTLE_AXE(3, 186, 187, new int[] { 192, 191, 190, 189 }, 1),
|
||||
|
||||
/**
|
||||
* Chainbody
|
||||
*/
|
||||
TYPE_CHAINBODY(3, 194, 195, new int[] { 200, 199, 198, 197 }, 1),
|
||||
|
||||
/**
|
||||
* Kite shield
|
||||
*/
|
||||
TYPE_KITE_SHIELD(3, 202, 203, new int[] { 208, 207, 206, 205 }, 1),
|
||||
|
||||
/**
|
||||
* Claws
|
||||
*/
|
||||
TYPE_CLAWS(2, 210, 211, new int[] { 216, 215, 214, 213 }, 1),
|
||||
|
||||
/**
|
||||
* 2H
|
||||
*/
|
||||
TYPE_TWO_HAND_SWORD(3, 218, 219, new int[] { 224, 223, 222, 221 }, 1),
|
||||
|
||||
/**
|
||||
* Plate Skirt
|
||||
*/
|
||||
TYPE_PLATE_SKIRT(3, 226, 227, new int[] { 232, 231, 230, 229 }, 1),
|
||||
|
||||
/**
|
||||
* Platelegs
|
||||
*/
|
||||
TYPE_PLATELEG(3, 234, 235, new int[] { 240, 239, 238, 237 }, 1),
|
||||
|
||||
/**
|
||||
* Platebody
|
||||
*/
|
||||
TYPE_PLATEBODY(5, 242, 243, new int[] { 248, 247, 246, 245 }, 1),
|
||||
|
||||
/**
|
||||
* Pickaxe
|
||||
*/
|
||||
TYPE_PICKAXE(2, 267, 268, new int[] { 273, 272, 271, 270 }, 1);
|
||||
|
||||
private final int name;
|
||||
|
||||
private final int[] button;
|
||||
|
||||
private final int child;
|
||||
|
||||
private final int required;
|
||||
|
||||
private final int product_amount;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmithingType.java} {@code Object}.
|
||||
* @param requiredBars bars.
|
||||
* @param interfaceChild the interface child.
|
||||
* @param nameChild the name child.
|
||||
* @param buttonId the button id.
|
||||
* @param productedAmount the producted amount.
|
||||
*/
|
||||
SmithingType(int requiredBars, int interfaceChild, int nameChild, int[] buttonId, int productedAmount) {
|
||||
this.name = nameChild;
|
||||
this.button = buttonId;
|
||||
this.child = interfaceChild;
|
||||
this.required = requiredBars;
|
||||
this.product_amount = productedAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name.
|
||||
*/
|
||||
public int getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the button.
|
||||
*/
|
||||
public int[] getButton() {
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the child.
|
||||
*/
|
||||
public int getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the required.
|
||||
*/
|
||||
public int getRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the product_amount.
|
||||
*/
|
||||
public int getProductAmount() {
|
||||
return product_amount;
|
||||
}
|
||||
|
||||
public static int forButton(Player player, Bars bar, int button, int item) {
|
||||
int count = 0;
|
||||
if (bar == null) {
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < bar.getSmithingType().getButton().length; i++) {
|
||||
if (bar.getSmithingType().getButton()[i] != button) {
|
||||
count++;
|
||||
} else {
|
||||
if (count == 0) {
|
||||
count = 1;
|
||||
} else if (count == 1) {
|
||||
count = 5;
|
||||
} else if (count == 2) {
|
||||
count = -1;
|
||||
} else if (count == 3) {
|
||||
count = player.getInventory().getAmount(new Item(item));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package content.global.skill.smithing.smelting;
|
||||
|
||||
import core.game.node.item.Item;
|
||||
|
||||
/**
|
||||
* Represents the <b>Bar</b> that can be created during a <p> Smelting </p>
|
||||
* session.
|
||||
* @author 'Vexia
|
||||
*/
|
||||
public enum Bar {
|
||||
BRONZE(1, 6.2, new Item(2349, 1), new Item(436, 1), new Item(438, 1)),
|
||||
BLURITE(8, 8, new Item(9467, 1), new Item(668, 1)),
|
||||
IRON(15, 12.5, new Item(2351, 1), new Item(440)),
|
||||
SILVER(20, 13.7, new Item(2355, 1), new Item(442, 1)),
|
||||
STEEL(30, 17.5, new Item(2353, 1), new Item(453, 2), new Item(440, 1)),
|
||||
GOLD(40, 22.5, new Item(2357, 1), new Item(444, 1)),
|
||||
MITHRIL(50, 30, new Item(2359, 1), new Item(447, 1), new Item(453, 4)),
|
||||
ADAMANT(70, 37.5, new Item(2361, 1), new Item(449, 1), new Item(453, 6)),
|
||||
RUNITE(85, 50, new Item(2363, 1), new Item(451, 1), new Item(453, 8));
|
||||
|
||||
/**
|
||||
* The ore required.
|
||||
*/
|
||||
private final Item[] ores;
|
||||
|
||||
/**
|
||||
* The product gained.
|
||||
*/
|
||||
private final Item product;
|
||||
|
||||
/**
|
||||
* The level required.
|
||||
*/
|
||||
private final int level;
|
||||
|
||||
/**
|
||||
* The experience gained.
|
||||
*/
|
||||
private final double experience;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code Bar} {@code Object}.
|
||||
* @param level the level.
|
||||
* @param experience the experience.
|
||||
* @param product the product.
|
||||
* @param ores the ores.
|
||||
*/
|
||||
Bar(int level, double experience, Item product, Item... ores) {
|
||||
this.level = level;
|
||||
this.experience = experience;
|
||||
this.product = product;
|
||||
this.ores = ores;
|
||||
}
|
||||
|
||||
public static Bar forId(int id) {
|
||||
for (Bar bar : Bar.values()) {
|
||||
if (bar.getProduct().getId() == id) {
|
||||
return bar;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Bar forOre(int id) {
|
||||
for (Bar bar : Bar.values()) {
|
||||
for (Item i : bar.getOres()) {
|
||||
if (i.getId() == id) {
|
||||
return bar;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ores.
|
||||
*/
|
||||
public Item[] getOres() {
|
||||
return ores;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the product.
|
||||
*/
|
||||
public Item getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the level.
|
||||
*/
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the experience.
|
||||
*/
|
||||
public double getExperience() {
|
||||
return experience;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package content.global.skill.smithing.smelting;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
import core.api.EquipmentSlot;
|
||||
import core.game.event.ResourceProducedEvent;
|
||||
import core.game.container.impl.EquipmentContainer;
|
||||
import org.rs09.consts.Items;
|
||||
import core.game.world.map.Location;
|
||||
import core.game.node.entity.skill.SkillPulse;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.diary.DiaryType;
|
||||
import core.game.node.item.Item;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.context.Graphics;
|
||||
import core.tools.RandomFunction;
|
||||
import core.tools.StringUtils;
|
||||
|
||||
/**
|
||||
* Represents the pulse used to smelt.
|
||||
*
|
||||
* @author 'Vexia
|
||||
*/
|
||||
public class SmeltingPulse extends SkillPulse<Item> {
|
||||
|
||||
/**
|
||||
* The ring of forging item.
|
||||
*/
|
||||
private static final Item RING_OF_FORGING = new Item(2568);
|
||||
|
||||
/**
|
||||
* Represents the bar to make.
|
||||
*/
|
||||
private final Bar bar;
|
||||
|
||||
/**
|
||||
* Represents if using the super heat spell.
|
||||
*/
|
||||
private final boolean superHeat;
|
||||
|
||||
/**
|
||||
* The ticks passed.
|
||||
*/
|
||||
private int ticks;
|
||||
|
||||
/**
|
||||
* Represents the amount to produce.
|
||||
*/
|
||||
private int amount;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmeltingPulse} {@code Object}.
|
||||
*
|
||||
* @param player the player.
|
||||
* @param node the node.
|
||||
* @param bar the bar.
|
||||
* @param amount the amount.
|
||||
*/
|
||||
public SmeltingPulse(Player player, Item node, Bar bar, int amount) {
|
||||
super(player, node);
|
||||
this.bar = bar;
|
||||
this.amount = amount;
|
||||
this.superHeat = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SmeltingPulse} {@code Object}.
|
||||
*
|
||||
* @param player the player.
|
||||
* @param node the node.
|
||||
* @param bar the bar.
|
||||
* @param amount the amount.
|
||||
* @param heat the heat.
|
||||
*/
|
||||
public SmeltingPulse(Player player, Item node, Bar bar, int amount, boolean heat) {
|
||||
super(player, node);
|
||||
this.bar = bar;
|
||||
this.amount = amount;
|
||||
this.superHeat = heat;
|
||||
this.resetAnimation = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRequirements() {
|
||||
player.getInterfaceManager().closeChatbox();
|
||||
if (bar == null || player == null) {
|
||||
return false;
|
||||
}
|
||||
if (bar == Bar.BLURITE && !player.getQuestRepository().isComplete("The Knight's Sword")) {
|
||||
return false;
|
||||
}
|
||||
if (player.getSkills().getLevel(Skills.SMITHING) < bar.getLevel()) {
|
||||
player.getPacketDispatch().sendMessage("You need a Smithing level of at least " + bar.getLevel() + " in order to smelt " + bar.getProduct().getName().toLowerCase().replace("bar", "") + ".");
|
||||
player.getInterfaceManager().closeChatbox();
|
||||
return false;
|
||||
}
|
||||
for (Item item : bar.getOres()) {
|
||||
if (!player.getInventory().contains(item.getId(), item.getAmount())) {
|
||||
player.getPacketDispatch().sendMessage("You do not have the required ores to make this bar.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animate() {
|
||||
if (ticks == 0 || ticks % 5 == 0) {
|
||||
if (superHeat) {
|
||||
player.visualize(Animation.create(725), new Graphics(148, 96));
|
||||
} else {
|
||||
player.animate(Animation.create(3243)); // Used to be 899 but that looked wonky and broken
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reward() {
|
||||
if (!superHeat && ++ticks % 5 != 0) {
|
||||
return false;
|
||||
}
|
||||
if (!superHeat) {
|
||||
player.getPacketDispatch().sendMessage("You place the required ores and attempt to create a bar of " + StringUtils.formatDisplayName(bar.toString().toLowerCase()) + ".");
|
||||
}
|
||||
for (Item i : bar.getOres()) {
|
||||
if (!player.getInventory().remove(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (success(player)) {
|
||||
// Varrock Armour secondary reward
|
||||
int amt = (player.getInventory().freeSlots() != 0 && !superHeat
|
||||
&& player.getLocation().withinDistance(Location.create(3107, 3500, 0)) // edgeville furnace
|
||||
&& player.getInventory().containsItems(bar.getOres())
|
||||
&& player.getAchievementDiaryManager().getDiary(DiaryType.VARROCK).getLevel() != -1
|
||||
&& player.getAchievementDiaryManager().checkSmithReward(bar)
|
||||
&& RandomFunction.random(100) <= 10) ? 2 : 1;
|
||||
if (amt != 1) {
|
||||
if (!player.getInventory().remove(bar.getOres())) {
|
||||
amt = 1;
|
||||
} else {
|
||||
player.sendMessage("The magic of the Varrock armour enables you to smelt 2 bars at the same time.");
|
||||
}
|
||||
}
|
||||
player.getInventory().add(new Item(bar.getProduct().getId(), amt));
|
||||
player.dispatch(new ResourceProducedEvent(bar.getProduct().getId(), 1, player, -1));
|
||||
double xp = bar.getExperience() * amt;
|
||||
// Goldsmith gauntlets
|
||||
if (((player.getEquipment().get(EquipmentContainer.SLOT_HANDS) != null
|
||||
&& player.getEquipment().get(EquipmentContainer.SLOT_HANDS).getId() == Items.GOLDSMITH_GAUNTLETS_776))
|
||||
&& bar.getProduct().getId() == 2357) {
|
||||
xp = 56.2 * amt;
|
||||
}
|
||||
player.getSkills().addExperience(Skills.SMITHING, xp, true);
|
||||
if (!superHeat) {
|
||||
player.getPacketDispatch().sendMessage("You retrieve a bar of " + bar.getProduct().getName().toLowerCase().replace(" bar", "") + ".");
|
||||
}
|
||||
|
||||
// Smelt a steel bar in the Lumbridge furnace
|
||||
if (bar == Bar.STEEL && player.getLocation().withinDistance(Location.create(3226, 3254, 0))) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 1, 5);
|
||||
}
|
||||
// Smelt a silver bar in the Lumbridge furnace
|
||||
if (bar == Bar.SILVER && player.getLocation().withinDistance(Location.create(3226, 3254, 0))) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 2, 7);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("The ore is too impure and you fail to refine it.");
|
||||
}
|
||||
amount--;
|
||||
return amount < 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the player has a ring of forging.
|
||||
*
|
||||
* @param player the player.
|
||||
* @return {@code True} if so.
|
||||
*/
|
||||
public boolean hasForgingRing(Player player) {
|
||||
return player.getEquipment().containsItem(RING_OF_FORGING);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the forging is a succes.
|
||||
*
|
||||
* @param player the player.
|
||||
* @return {@code True} if success.
|
||||
*/
|
||||
public boolean success(Player player) {
|
||||
if (bar == Bar.IRON && !superHeat) {
|
||||
if (hasForgingRing(player)) {
|
||||
Item ring = getItemFromEquipment(player, EquipmentSlot.RING);
|
||||
if(ring != null){
|
||||
if(getCharge(ring) == 1000) setCharge(ring, 140);
|
||||
adjustCharge(ring, -1);
|
||||
if(getCharge(ring) == 0){
|
||||
player.getEquipment().remove(ring);
|
||||
sendMessage(player, "Your ring of forging uses up its last charge and disintegrates.");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return RandomFunction.getRandom(100) <= (player.getSkills().getLevel(Skills.SMITHING) >= 45 ? 80 : 50);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user