def doCut(player, name, objID, x, y): level = player.playerLevel[8] if name == "TREE": player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_woodcutting_TREE", player, objID, x, y), random.randrange(1, 4)) elif name == "OAK": if level >= 15: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_woodcutting_OAK", player, objID, x, y), random.randrange(3, 6)) else: player.sendMessage("You need a woodcutting level of 15 to cut this tree.") elif name == "WILLOW": if level >= 30: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_woodcutting_WILLOW", player, objID, x, y), random.randrange(3, 8)) else: player.sendMessage("You need a woodcutting level of 30 to cut this tree.") elif name == "YEW": if level >= 60: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_woodcutting_YEW", player, objID, x, y), random.randrange(3, 12)) else: player.sendMessage("You need a woodcutting level of 60 to cut this tree.")
def doMine(player, name, objID, x, y): level = player.playerLevel[14] if name == "COPPER": player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_COPPER", player, objID, x, y), random.randrange(1, 4)) elif name == "TIN": player.sendMessage("Your swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_TIN", player, objID, x, y), random.randrange(1, 4)) elif name == "IRON": if level >= 15: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_IRON", player, objID, x, y), random.randrange(3, 6)) else: player.sendMessage("You need a mining level of 15 to mine this rock.") elif name == "SILVER": if level >= 20: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_SILVER", player, objID, x, y), random.randrange(4, 6)) else: player.sendMessage("You need a mining level of 20 to mine this rock.") elif name == "COAL": if level >= 30: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_COAL", player, objID, x, y), random.randrange(4, 9)) else: player.sendMessage("You need a mining level of 30 to mine this rock.") elif name == "GOLD": if level >= 40: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_GOLD", player, objID, x, y), random.randrange(5, 9)) else: player.sendMessage("You need a mining level of 40 to mine this rock.") elif name == "MITHRIL": if level >= 55: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_MITHRIL", player, objID, x, y), random.randrange(5, 13)) else: player.sendMessage("You need a mining level of 55 to mine this rock...") elif name == "ADAMANT": if level >= 70: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_ADAMANT", player, objID, x, y), random.randrange(8, 18)) else: player.sendMessage("You need a mining level of 70 to mine this rock.") elif name == "RUNITE": if level >= 85: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask(TaskFactory.getDelayedTask("callback_mining_RUNITE", player, objID, x, y), random.randrange(16, 32)) else: player.sendMessage("You need a mining level of 85 to mine this rock.")
def doCut(player, name, objID, x, y): level = player.playerLevel[8] if name == "TREE": player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_woodcutting_TREE", player, objID, x, y), random.randrange(1, 4)) elif name == "OAK": if level >= 15: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_woodcutting_OAK", player, objID, x, y), random.randrange(3, 6)) else: player.sendMessage( "You need a woodcutting level of 15 to cut this tree.") elif name == "WILLOW": if level >= 30: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_woodcutting_WILLOW", player, objID, x, y), random.randrange(3, 8)) else: player.sendMessage( "You need a woodcutting level of 30 to cut this tree.") elif name == "YEW": if level >= 60: player.sendMessage("You swing your axe at the tree...") player.setAnimation(867) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_woodcutting_YEW", player, objID, x, y), random.randrange(3, 12)) else: player.sendMessage( "You need a woodcutting level of 60 to cut this tree.")
def doMine(player, name, objID, x, y): level = player.playerLevel[14] if name == "COPPER": player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_COPPER", player, objID, x, y), random.randrange(1, 4)) elif name == "TIN": player.sendMessage("Your swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_TIN", player, objID, x, y), random.randrange(1, 4)) elif name == "IRON": if level >= 15: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_IRON", player, objID, x, y), random.randrange(3, 6)) else: player.sendMessage( "You need a mining level of 15 to mine this rock.") elif name == "SILVER": if level >= 20: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_SILVER", player, objID, x, y), random.randrange(4, 6)) else: player.sendMessage( "You need a mining level of 20 to mine this rock.") elif name == "COAL": if level >= 30: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_COAL", player, objID, x, y), random.randrange(4, 9)) else: player.sendMessage( "You need a mining level of 30 to mine this rock.") elif name == "GOLD": if level >= 40: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_GOLD", player, objID, x, y), random.randrange(5, 9)) else: player.sendMessage( "You need a mining level of 40 to mine this rock.") elif name == "MITHRIL": if level >= 55: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_MITHRIL", player, objID, x, y), random.randrange(5, 13)) else: player.sendMessage( "You need a mining level of 55 to mine this rock...") elif name == "ADAMANT": if level >= 70: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_ADAMANT", player, objID, x, y), random.randrange(8, 18)) else: player.sendMessage( "You need a mining level of 70 to mine this rock.") elif name == "RUNITE": if level >= 85: player.sendMessage("You swing your pickaxe at the rock...") player.setAnimation(0x554) TaskManager.registerClientTask( TaskFactory.getDelayedTask("callback_mining_RUNITE", player, objID, x, y), random.randrange(16, 32)) else: player.sendMessage( "You need a mining level of 85 to mine this rock.")