Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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))
Ejemplo n.º 3
0
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))
Ejemplo n.º 4
0
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))
Ejemplo n.º 5
0
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))
Ejemplo n.º 6
0
def command_shutdown(player, command):
	if player.getRights() >= 2:
		World.getInstance().engine().setIsRunning(False)
Ejemplo n.º 7
0
 def execute(self):
     self.player.teleport(self.location)
     self.player.animate(75134)
     World.getInstance().registerEvent(ResetAnimationEvent(self.player))
     Event.stop(self)
Ejemplo n.º 8
0
	def execute(self):
		self.player.teleport(self.location)
		self.player.animate(75134)
		World.getInstance().registerEvent(ResetAnimationEvent(self.player))
		Event.stop(self)