#edit
I managed to get it to work , but now the problem is that I can't remove the red square when the player stops attacking
I have the sendCreatureSquare function in my server's source, but I don't know how to make just whoever is attacking see and mark who is being targeted.
I managed to get it to work , but now the problem is that I can't remove the red square when the player stops attacking
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
function sendTarget(cid, target)
local msg = NetworkMessage()
msg:addByte(0x93)
msg:addU32(target)
msg:addByte(0x02)
msg:addByte(180)
msg:sendToPlayer(cid)
end
function onCastSpell(creature, var)
local playerPos = creature:getPosition()
local target = creature:getTarget()
local targetPos = target:getPosition()
local path = target:getPathTo(playerPos, 0, 1, true, true, 100)
target:say("TAUNT", TALKTYPE_MONSTER_SAY)
target:setTarget(creature)
sendTarget(target:getId(), creature:getId())
for i = 1, #path do
addEvent(function()
if path ~= nil then
doMoveCreature(target, path[i])
end
end, 250 * i)
end
print(#path)
return combat:execute(creature, var)
end
Post automatically merged:
I have the sendCreatureSquare function in my server's source, but I don't know how to make just whoever is attacking see and mark who is being targeted.
Last edited: