Mindee-BOT

Mindee-BOT Community => Share => Scripting => Useful Parts => Topic started by: =Mindee= on January 07, 2021, 06:48:48 pm

Title: [Share] Kill counter (No exp)
Post by: =Mindee= 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

Title: Re: [Share] Kill counter (No exp)
Post by: rocketm2 on January 08, 2021, 12:59:21 am
 [hhhfgh]