def highAlch(mob, item): amt = int(item.getDefinition().getValue() * .75) cItems = MageTrainingArena.getCupboarditems() xmin = 1 xmax = 30 currency = 995 for i in cItems: if item.getId() == i: amt = Misc.random(xmin, xmax) currency = 8890 mob.getInventory().remove(Item(item.getId(), 1)) mob.getInventory().add(Item(currency, amt)) mob.playAnimation(Animation.create(713)) mob.playGraphics(Graphic.create(113, 0, 100)) mob.playSound(Sound.create(97, 1, 20)) mob.getSkills().addExperience(Skills.MAGIC, 50 * Constants.EXP_MODIFIER)
def objectOptionOne_staircase(player, obj): oloc = obj.getLocation() top = None if oloc.getZ() == 3: if oloc.getX() == 3558 and oloc.getY() == 9703: # Ahrim top = Location.create(Misc.random(3563, 3566), Misc.random(3286, 3290), 0) player.setTeleportTarget(top) elif oloc.getX() == 3557 and oloc.getY() == 9718: # Dharok top = Location.create(Misc.random(3573, 3576), Misc.random(3296, 3300), 0) player.setTeleportTarget(top) elif oloc.getX() == 3534 and oloc.getY() == 9705: # Guthan top = Location.create(Misc.random(3575, 3580), Misc.random(3280, 3285), 0) player.setTeleportTarget(top) elif oloc.getX() == 3546 and oloc.getY() == 9685: # Karil top = Location.create(Misc.random(3564, 3567), Misc.random(3273, 3277), 0) player.setTeleportTarget(top) elif oloc.getX() == 3565 and oloc.getY() == 9683: # Torag top = Location.create(Misc.random(3551, 3556), Misc.random(3281, 3284), 0) player.setTeleportTarget(top) elif oloc.getX() == 3578 and oloc.getY() == 9703: # Verac top = Location.create(Misc.random(3555, 3559), Misc.random(3296, 3300), 0) player.setTeleportTarget(top)
def item_interact_toy_horsey(player, item): player.playAnimation(Animation.create(ToyHorsey.getToyHorsey().getAnimation())) player.setForceChat(Misc.randomStringFromArray(ToyHorsey.getToyHorsey().getShoutMessages())) player.forceChat(player.getForcedChatMessage())