def Shoot(player, belt, target): if player == target: return if target.invulnerable or target.gm: return elif belt.hastag('remaining_uses') and belt.gettag('remaining_uses') < 1: player.socket.clilocmessage( 1063297 ) # You have no shuriken in your ninja belt! elif belt.hastag('using'): player.socket.clilocmessage( 1063298 ) # You cannot throw another shuriken yet. elif not hasHandFree(player, belt): player.socket.clilocmessage( 1063299 ) # You must have a free hand to throw shuriken. elif not player.distanceto(target) > 2: player.socket.clilocmessage( 1063303 ) # Your target is too close! else: belt.settag('using', 1) player.turnto(target) player.reveal() player.action(9) # 26 if mounted! player.soundeffect(0x23A) player.movingeffect(0x27AC, target, False, False, 1) if player.checkskill(NINJITSU, -100, 650): target.addtimer(1000, onShurikenHit, [player.serial, belt.serial]) else: ConsumeUse(belt) belt.addtimer(2500, ResetUsing, [])
def Shoot(player, belt, target): if player == target: return if target.invulnerable or target.gm: return elif belt.hastag('remaining_uses') and belt.gettag('remaining_uses') < 1: player.socket.clilocmessage( 1063297) # You have no shuriken in your ninja belt! elif belt.hastag('using'): player.socket.clilocmessage( 1063298) # You cannot throw another shuriken yet. elif not hasHandFree(player, belt): player.socket.clilocmessage( 1063299) # You must have a free hand to throw shuriken. elif not player.distanceto(target) > 2: player.socket.clilocmessage(1063303) # Your target is too close! else: belt.settag('using', 1) player.turnto(target) player.reveal() player.action(9) # 26 if mounted! player.soundeffect(0x23A) player.movingeffect(0x27AC, target, False, False, 1) if player.checkskill(NINJITSU, -100, 650): target.addtimer(1000, onShurikenHit, [player.serial, belt.serial]) else: ConsumeUse(belt) belt.addtimer(2500, ResetUsing, [])
def onUse(char, item): if not item.layer > 0: return if item.hastag('remaining_uses') and item.gettag('remaining_uses') < 1: char.socket.clilocmessage( 1063297 ) # You have no shuriken in your ninja belt! elif item.hastag('using'): char.socket.clilocmessage( 1063298 ) # You cannot throw another shuriken yet. elif not hasHandFree(char, item): char.socket.clilocmessage( 1063299 ) # You must have a free hand to throw shuriken. else: char.socket.attachtarget( 'ninja_belt.callback', [item.serial] ) return True
def onUse(char, item): if not item.layer > 0: return if item.hastag('remaining_uses') and item.gettag('remaining_uses') < 1: char.socket.clilocmessage( 1063297) # You have no shuriken in your ninja belt! elif item.hastag('using'): char.socket.clilocmessage( 1063298) # You cannot throw another shuriken yet. elif not hasHandFree(char, item): char.socket.clilocmessage( 1063299) # You must have a free hand to throw shuriken. else: char.socket.attachtarget('ninja_belt.callback', [item.serial]) return True
def canUsePotion( char, item ): if not hasHandFree(char, item): # You must have a free hand to drink a potion. char.socket.clilocmessage( 0x7A99C ) return False return True