• 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!

Help removing charges of a ring in a spell

kimat

New Member
Joined
Jul 21, 2007
Messages
23
Reaction score
2
I have a script that u hit more with sd and a ring dissapear, but I want make it that remove 1 charge of the ring, thanks

Code:
-- config --
local percent = 50
local ring_id = 2357
-- config --

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
 
function Formula(cid)
  local min = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) *3) * 1.3 - 30
  local max = (getPlayerLevel(cid) * 2 + getPlayerMagLevel(cid) *3) * 1.6
  return min, max
end
 
function IncreaseRing(cid,min,max)
  if getPlayerStorageValue(cid,4554) == 1 then
    doPlayerRemoveItem(cid, ring_id, 1)
    return (min / 100) * percent + min,(max / 100) * percent + max
  end
  return min, max
end


function onCast(cid, target)
  local min,max = Formula(cid)
  min,max = IncreaseRing(cid, min, max)

  doTargetCombatHealth(0, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_MORTAREA)
end
 
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onCast")
 
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Back
Top