Username: Password:

Author Topic: [Share] Kill counter (No exp)  (Read 1501 times)

Offline =Mindee=

  • Commander Shepard
  • BOT Developer Administrator
  • Dragon
  • *****
  • Posts: 2,788
  • Cookies 9020
  • We'll bang, OKAY?
    • View Profile
    • http://mindee-bot.com
[Share] Kill counter (No exp)
« on: January 07, 2021, 06:48:48 PM »
This script counts kills when monsters disappears around character. No need to receive experience.
But this won't work if your character kills monster with spell at distance. It's impossible to count such kills without receiving experience.

Code: [Select]
LAST_UID = -1

def onReceiveEnemyHp(uid, hp_percent, name):
global LAST_UID
LAST_UID = uid

def onRemoveCreature(uid, name, looktype, entity_type, x, y, z):
if uid != LAST_UID:
return

if not (entity_type == 2 or entity_type == 4): # check if creature is a monster/boss
return

if IsInLine(x, y, z, script.GetX(), script.GetY(), script.GetZ()):
varname = 'killed_' + name
mobs = script.GetVar(varname) + 1
script.SetVar(varname, mobs)
script.StatusMessage('Killed: ' + name + ' \nTotal: ~' + str(mobs))

def IsInLine(x, y, z, x2, y2, z2):
xdif = abs(x - x2)
ydif = abs(y - y2)
return ((xdif == 1 and ydif == 0) or (xdif == 0 and ydif == 1)) and z == z2





Mindee-BOT creator, founder and developer.

Offline rocketm2

  • Administrator
  • Snake
  • *****
  • Posts: 71
  • Cookies 5
  • Lvl Up~
    • View Profile
Re: [Share] Kill counter (No exp)
« Reply #1 on: January 08, 2021, 12:59:21 AM »
 [hhhfgh]
Tibiame AutoHunt Service - Send PM~