Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.wc.world.content.skill.woodcutting
- import java.util.HashMap
- import java.util.Map
- import com.wc.util.ItemNames
- import com.wc.world.content.skill.SkillConstants
- import com.wc.world.entity.player.Player
- import com.wc.world.model.item.Item
- import scala.reflect.{BeanProperty, BooleanBeanProperty}
- //remove if not needed
- import scala.collection.JavaConversions._
- object WoodcuttingData {
- object Tree extends Enumeration {
- val NORMAL = new Tree(1, 25, 1511, Array(1276, 1277, 1278, 1279, 1280, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1301, 1303, 1304, 1305, 1318, 1319, 1315, 1316, 1330, 1331, 1332, 1333, 1383, 1384, 2409, 2447, 2448, 3033, 3034, 3035, 3036, 3879, 3881, 3883, 3893, 3885, 3886, 3887, 3888, 3892, 3889, 3890, 3891, 3928, 3967, 3968, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 4060, 5004, 5005, 5045, 5902, 5903, 5904, 8973, 8974, 10041, 10081, 10082, 10664, 11112, 11510, 12559, 12560, 12732, 12895, 12896, 13412, 13411, 13419, 13843, 13844, 13845, 13847, 13848, 13849, 13850, 14308, 14309, 14513, 14514, 14515, 14521, 14564, 14565, 14566, 14593, 14594, 14595, 14600, 14635, 14636, 14637, 14642, 14664, 14665, 14666, 14693, 14694, 14695, 14696, 14701, 14738, 14796, 14797, 14798, 14799, 14800, 14801, 14802, 14803, 14804, 14805, 14806, 14807, 15489, 15776, 15777, 16264, 16265, 19165, 19166, 19167, 23381),
- 2400, 2400, 5)
- val OAK = new Tree(15, 37.5, 1521, Array(1281, 3037, 8462, 8463, 8464, 8465, 8466, 8467, 10083, 13413, 13420),
- 3000, 4000, 8)
- val WILLOW = new Tree(30, 67.5, 1519, Array(1308, 5551, 5552, 5553, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488, 8496, 8497, 8498, 8499, 8500, 8501, 13414, 13421),
- 3600, 8200, 10)
- val TEAK = new Tree(35, 85, 6333, Array(9036), 4200, 10200, 3)
- val MAPLE = new Tree(45, 100, 1517, Array(1307, 4674, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8454, 8455, 8456, 8457, 8458, 8459, 8460, 8461, 13415, 13423),
- 4200, 15000, 6)
- val MAHOGANY = new Tree(50, 125, 6332, Array(9034), 4200, 17600, 4)
- val YEW = new Tree(60, 4200, 1515, Array(1309, 8503, 8504, 8505, 8506, 8507, 8508, 8509, 8510, 8511, 8512, 8513, 13416, 13422),
- 4800, 22800, 9)
- val MAGIC = new Tree(75, 7990, 1513, Array(1306, 8396, 8397, 8398, 8399, 8400, 8401, 8402, 8403, 8404, 8405, 8406, 8407, 8408, 8409, 13417, 13424),
- 5400, 28400, 9)
- class Tree private (@BeanProperty var level: Int,
- @BeanProperty var exp: Double,
- @BeanProperty var product: Int,
- private var objectIds: Array[Int],
- @BeanProperty var lifeCycle: Int,
- @BeanProperty var respawnTimer: Int,
- @BeanProperty var logCount: Int) extends Val
- def forId(`object`: Int): Tree = trees.get(`object`)
- private val trees = new HashMap()
- for (tree <- Tree.values; `object` <- tree.objectIds) {
- trees.put(`object`, tree)
- }
- implicit def convertValue(v: Value): Tree = v.asInstanceOf[Tree]
- }
- object Hatchet extends Enumeration {
- val BRONZE_HATCHET = new Hatchet(ItemNames.BRONZE_AXE, 1, 879, 1000)
- val IRON_HATCHET = new Hatchet(ItemNames.IRON_HATCHET, 1, 877, 1250)
- val STEEL_HATCHET = new Hatchet(ItemNames.STEEL_AXE, 6, 875, 1500)
- val BLACK_HATCHET = new Hatchet(ItemNames.BLACK_AXE, 6, 873, 1750)
- val MITHRIL_HATCHET = new Hatchet(ItemNames.MITHRIL_AXE, 21, 871, 2000)
- val ADAMANT_HATCHET = new Hatchet(ItemNames.ADAMANT_AXE, 31, 869, 2250)
- val RUNE_HATCHET = new Hatchet(ItemNames.RUNE_AXE, 41, 867, 2500)
- val DRAGON_HATCHET = new Hatchet(ItemNames.DRAGON_HATCHET, 61, 2846, 2750)
- val INFERNO_ADZE = new Hatchet(ItemNames.INFERNO_ADZE, 61, 10251, 2750)
- class Hatchet private (@BeanProperty var item: Int,
- @BeanProperty var level: Int,
- @BeanProperty var animation: Int,
- @BeanProperty var speed: Int) extends Val
- def getHatchet(player: Player): Hatchet = {
- var best: Hatchet = null
- for (hatchet <- values if player.getInventory.contains(hatchet.getItem) || player.getEquipment.contains(hatchet.getItem)
- if hatchet.getLevel <=
- player.getSkills.getLevel(SkillConstants.WOODCUTTING) if best == null || hatchet.getLevel > best.getLevel) best = hatchet
- best
- }
- implicit def convertValue(v: Value): Hatchet = v.asInstanceOf[Hatchet]
- }
- object BirdNest extends Enumeration {
- val RED_EGG_BIRD_NEST = new BirdNest(ItemNames.BIRDS_NEST, 4, Array(5076))
- val GREEN_EGG_NEST = new BirdNest(ItemNames.BIRDS_NEST_1, 4, Array(5077))
- val PURPLE_EGG_NEST = new BirdNest(ItemNames.BIRDS_NEST_2, 4, Array(5078))
- val SEED_NEST = new BirdNest(ItemNames.BIRDS_NEST_3, 22, Array(5312, 5313, 5314, 5315, 5316, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5317))
- val RING_NEST = new BirdNest(ItemNames.BIRDS_NEST_4, 18, Array(1635, 1637, 1639, 1641, 1643))
- val RAVENS_NEST = new BirdNest(ItemNames.BIRDS_NEST_7, 8, Array(11964))
- val EMPTY_NEST = new BirdNest(ItemNames.BIRDS_NEST_6, 40, Array())
- class BirdNest private (private var nest: Int, private var drop_chance: Int, rewards: Array[Int])
- extends Val {
- private var reward: Array[Int] = rewards
- def getNest(): Item = new Item(nest)
- def getNestId(): Int = nest
- def getDropChance(): Int = drop_chance
- def getRewards(): Array[Int] = reward
- }
- var birdNests: Map[Integer, BirdNest] = new HashMap[Integer, BirdNest]()
- def forId(index: Int): BirdNest = birdNests.get(index)
- for (data <- values) {
- birdNests.put(data.ordinal(), data)
- birdNests.put(data.getNestId, data)
- }
- implicit def convertValue(v: Value): BirdNest = v.asInstanceOf[BirdNest]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement