def drink(player, id, slot, replace, stat, amount): if player.isBusy(): return item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() == 1: player.getInventory().getContainer().set(slot, None) player.getActionSender().sendMessage("You drink the " + item.getDefinition().getName() + ".") if replace != -1: player.getInventory().getContainer().set(slot, Item(replace, 1)) player.getInventory().refresh() World.getInstance().registerEvent(PotionEvent(player, stat, amount))
def teletab(player, id, slot, x, y, z): if player.isBusy(): return if player.isDead(): return if player.isTeleBlocked: player.getActionSender().sendMessage("You are teleblocked.") return item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() >= 1: player.getInventory().deleteItem(id, 1); player.getInventory().refresh() World.getWorld().registerEvent(TeleportEvent(player, x, y, z))
def bury(player, id, slot, xp): # check if the player is busy, if so do not complete the action if player.isBusy(): return # if the inventory contains the bones item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() == 1: # delete the bones player.getInventory().getContainer().set(slot, None) player.getInventory().refresh() # give the XP player.getSkills().addXp(Skills.PRAYER, xp) # send a message saying it is burying player.getActionSender().sendMessage("You start to dig a hole in the ground...") # register the bury event World.getInstance().registerEvent(BuryEvent(player))
def bury(player, id, slot, xp): # check if the player is busy, if so do not complete the action if player.isBusy(): return # if the inventory contains the bones item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() == 1: # delete the bones player.getInventory().getContainer().set(slot, None) player.getInventory().refresh() # give the XP player.getSkills().addXp(Skills.PRAYER, xp) # send a message saying it is burying player.getActionSender().sendMessage( "You start to dig a hole in the ground...") # register the bury event World.getInstance().registerEvent(BuryEvent(player))
def eat(player, id, slot, amount): # check if the player is busy, if so do not complete the action if player.isBusy(): return if player.isDead(): return # if the inventory contains the food item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() == 1: # delete the food player.getInventory().getContainer().set(slot, None) player.getInventory().refresh() # send a message saying it is eating player.combatDelay += 3 player.getActionSender().sendMessage("You eat the " + item.getDefinition().getName() + ".") # register the eating event World.getInstance().registerEvent(EatEvent(player, amount))
def eat(player, id, slot, amount): # check if the player is busy, if so do not complete the action if player.isBusy(): return if player.isDead(): return # if the inventory contains the food item = player.getInventory().getContainer().get(slot) if item.getId() == id and item.getAmount() == 1: # delete the food player.getInventory().getContainer().set(slot, None) player.getInventory().refresh() # send a message saying it is eating player.combatDelay += 3; player.getActionSender().sendMessage("You eat the " + item.getDefinition().getName() + ".") # register the eating event World.getInstance().registerEvent(EatEvent(player, amount))
def command_shutdown(player, command): if player.getRights() >= 2: World.getInstance().engine().setIsRunning(False)
def execute(self): self.player.teleport(self.location) self.player.animate(75134) World.getInstance().registerEvent(ResetAnimationEvent(self.player)) Event.stop(self)
def command_niggzballs(player, command): if player.getRights() >= 2: World.getWorld().engine().setIsRunning(False)