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

MoveEvent If you wear a ring you hit more with SD

kimat

New Member
Joined
Jul 21, 2007
Messages
23
Reaction score
2
CREATED BY Helveg
Modified by Kimat (me)

Explication: When you wear item id 2357 then you hit more with sd and ring disappear.

Movements.xml
Code:
<movevent event="Equip" itemid="2357"  slot="ring" function="onEquip" script="SDRing.lua" />
<movevent event="DeEquip" itemid="2357"  slot="ring" function="onDeEquip" script="SDRing.lua" />
SDRing.lua
Code:
function onEquip(cid)
  setPlayerStorageValue(cid, 4554,1) -- ACTIVATE
  end
 
function onDeEquip(cid)
  setPlayerStorageValue(cid, 4554,-1) -- DEACTIVATE
end

SPELL SD

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
 
You can make this script without onEquip, simply getPlayerSlotItem(cid, SLOT_ID).itemid ;)

Nice anyways ;)
 
Would be good with other runes like hmm, gfbs, makes lots of items that each item increase it a tiny bit, makes a sorcerer be able to specialice in diffrent runes, sounds funny

Im tired of everybody using UE or SD all the time, thats why I like serious servers with expensive runes :p
 
Well I like it ! ;) Can you add also that if sorcerer or druid wear ring then hit more with sd, but if its paladin or something it hit normal?

Ah... there is a bug (?), no matter if you hit player or monster it get same damage... should be -50% damage when attacking player.
 
Last edited:
it disappear when i use one.

Because of this:
Code:
function IncreaseRing(cid,min,max)
  if getPlayerStorageValue(cid,4554) == 1 then
    [B]doPlayerRemoveItem(cid, ring_id, 1)[/B]
    return (min / 100) * percent + min,(max / 100) * percent + max
  end
  return min, max
end

Just remove it or comment (--)
 
Players on my server told me that this script has got a bug.
If someone hit another player from this rune he can go to the PZ...rotfl

TFS 0.2.10
 
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_MORTAREA)


/\ FIX ;)
 
This is a nice ring. I like the idea, How can i get it to work with HMM?
 
Or how to make charges or duration so it doesnt dissapear after one shot ?
 
uhm... easier way:
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 (getPlayerSlotItem(cid, SLOT_RING) == ring_id) 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
I am not 100% sure if it works, but you can try (you don't have to use movements here) but basically it's easier because you don't have to check and set storages ;)
 
Can some1 make this script with charges ??
For example, the ring will dissappear after 5 shots with sd.
 
Actually, class item is based on class thing ;) but lua function getPlayerSlotItem returns id of item.

It returns thing -.-

Fix
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)
  local ring = getPlayerSlotItem(cid, SLOT_RING)
  if (ring.itemid == ring_id) then
    doRemoveItem(ring.uid)
    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
 
Were do i paste this spell sd??

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)
  local ring = getPlayerSlotItem(cid, SLOT_RING)
  if (ring.itemid == ring_id) then
    doRemoveItem(ring.uid)
    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
 
reload the script as you say fixed set Movements & scripts where the script will spell SD;/

not work
 
Back
Top