• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Focus on Center-- Sprite

Koncu

New Member
Joined
May 25, 2010
Messages
28
Reaction score
0
Hi,

Just want to know how you can change the 'index' or whatever you call it of the spell effect/sprite.

I have this spell with the following dimensions:
32x5 (width)
32x3 (height)

Whenever I try to run it, it starts to run properly but not in the right position as it starts from right-bottom corner of the sprite (target based spell). Here is a little drawing to demonstrate that;

- blue circle (selected target)
- black squares (the entire spell)

gEDGsJt.png


Now what I wanted to do is to make the spell start with center coordinates, so when the target is selected, it will play this way;

kh38EAC.png.


here is my code if needed;

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 29)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -90.2, 1, -95.2, 1)

function onCastSpell(cid, var)
local position1 = Player(cid):getPosition()
doSendMagicEffect(position1, 5)
return doCombat(cid, combat, var)
end

Any help appreciated
 
Ypu can try something like:
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 29)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -90.2, 1, -95.2, 1)

function onCastSpell(cid, var)
local position1 = Player(cid):getPosition()
local newPos = {x = position1.x + 1, y = position1.y + 2, z = position1.z}
doSendMagicEffect(newPos, 5)
return doCombat(cid, combat, var)
end

But, if effect is that big, i don't know if it's gonna work as you intend, anyway.
 
Back
Top