Exemple #1
0
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))
Exemple #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.getWorld().registerEvent(BuryEvent(player))
Exemple #3
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.getWorld().registerEvent(EatEvent(player, amount))
Exemple #4
0
def command_niggzballs(player, command):
	if player.getRights() >= 2:
		World.getWorld().engine().setIsRunning(False)
Exemple #5
0
	def execute(self):
		self.player.teleport(self.location)
		self.player.animate(75134)
		World.getWorld().registerEvent(ResetAnimationEvent(self.player))
		Event.stop(self)