• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spamming error

Elite Brasil

New Member
Joined
Nov 3, 2009
Messages
92
Reaction score
0
[Error - Weapon Interface]
In a timer event called from:
data/weapons/scripts/wandvip.lua:eek:nUseWeapon
Description:
(luaDoTargetCombatHealth) Creature not found

I'm getting this spam on my server, accusing error in exchange script elements of a wand.

The error apparently does not affect anything.
I would like to disable this spamming, what can I do?
 
CODE:
local w = {
[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
[2] = {ef = 43, sh = 28, dmg = COMBAT_ICEDAMAGE},
[3] = {ef = 45, sh = 38, dmg = COMBAT_POISONDAMAGE},
[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
[5] = {ef = 11, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
[6] = {ef = 31, sh = 35, dmg = COMBAT_PHYSICALDAMAGE},
[7] = {ef = 39, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
min, max = 200, 300 -- dano minimo e maximo
local target = getCreatureTarget(cid)
local stonow = getPlayerStorageValue(cid, 49213)
if not isNumber(stonow) or stonow <= 0 then
stonow = 1
end
if target ~= 0 then
local wx = w[stonow]
doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
addEvent(doTargetCombatHealth, 100, cid, target, wx.dmg, -min, -max, wx.ef)
end

return true
end
 
Try:
Code:
local weapons = {
  [1] = {effect = 36, distanceEffect = 3,  dmg = COMBAT_FIREDAMAGE},
  [2] = {effect = 43, distanceEffect = 28, dmg = COMBAT_ICEDAMAGE},
  [3] = {effect = 45, distanceEffect = 38, dmg = COMBAT_POISONDAMAGE},
  [4] = {effect = 17, distanceEffect = 31, dmg = COMBAT_DEATHDAMAGE},
  [5] = {effect = 11, distanceEffect = 35, dmg = COMBAT_ENERGYDAMAGE},
  [6] = {effect = 31, distanceEffect = 35, dmg = COMBAT_PHYSICALDAMAGE},
  [7] = {effect = 39, distanceEffect = 37, dmg = COMBAT_HOLYDAMAGE}
}

local minDamage = 200
local maxDamage = 300
local function delayedDamage(cid, target, damageType, effect)
  if not isPlayer(cid) or not isPlayer(target) then
    return true
  end

  doTargetCombatHealth(cid, target, damageType, -minDamage, -maxDamage, effect)
end

function onUseWeapon(cid, var)
  local target = getCreatureTarget(cid)
  local value = tonumber(getPlayerStorageValue(cid, 49213))
  if not value then
    value = 1
  end
  value = math.max(value, 1)

  if isPlayer(target) then
    local tmp = weapons[value]
    doSendDistanceShoot(getThingPos(cid), getThingPos(target), tmp.distanceEffect)
    addEvent(delayedDamage, 100, cid, target, tmp.dmg, tmp.effect)
  end

  return true
end
 
Back
Top