Ir para conteúdo

Posts Recomendados

Gostaria de juntar a minha spell de controlar o target com a talkaction makesay.

Seria assim, enquanto eu tiver controlando o inimigo eu automaticamente falaria por ele tambem (Estilo o makesay).

Ta ae a spell

 

 

local tempo = 10 * 1000 -- em ms

 

local function move(cid, target, lastCidPos, timeStart)

 

if not isCreature(cid) or not isCreature(target) then return end

 

if getCreatureLookDirection(target) ~= getCreatureLookDirection(cid) then

doCreatureSetLookDirection(target, getCreatureLookDirection(cid))

end

 

local cidPos = getCreaturePosition(cid)

 

if lastCidPos.x ~= cidPos.x or lastCidPos.y ~= cidPos.y then

local dir = getCreatureLookDirection(cid)

doTeleportThing(cid, lastCidPos, false)

doCreatureSetLookDirection(cid, dir)

local delta_x = cidPos.x - lastCidPos.x

local delta_y = cidPos.y - lastCidPos.y

local targetPos = getCreaturePosition(target)

targetPos.x = targetPos.x + delta_x

targetPos.y = targetPos.y + delta_y

if queryTileAddThing(target, targetPos) == RETURNVALUE_NOERROR then

doTeleportThing(target, targetPos)

end

end

 

if os.clock() - timeStart < tempo / 1000 then

addEvent(move, 1, cid, target, lastCidPos, timeStart)

else

doCreatureSetNoMove(target, 0)

doSendDistanceShoot(getThingPos(target), getThingPos(cid), 2)

doSendAnimatedText(getThingPos(target), "LIVRE", 215)

doPlayerSendCancel(cid, "You have lost control of "..getCreatureName(target)..".")

if isPlayer(target) then

doPlayerSendCancel(cid, "You've been freed from "..getPlayerName(cid).."'s Shadow Imitation Technique.")

setPlayerStorageValue(target, 14755, -1)

end

end

end

 

function onCastSpell(cid, var)

 

if exhaustion.get(cid, 23006) then

doPlayerSendCancel(cid, "O shinashin ainda nao esta pronto.")

return false

end

 

local target = getCreatureTarget(cid)

 

if not isCreature(target) then

doPlayerSendCancel(cid, "Voce precisa de um alvo para usar o shinashin no jutsu.")

return false

end

 

doCreatureSetNoMove(target, 1)

exhaustion.set(cid, 23006, 30)

doPlayerSendCancel(cid, "You have possessed "..getCreatureName(target)..".")

doSendAnimatedText(getCreaturePosition(target), "SHINASHIN!", 25)

 

if isPlayer(target) then

doPlayerSendCancel(target, "Voce esta sendo controlado pelo "..getPlayerName(cid)..".")

setPlayerStorageValue(target, 14755, 1)

end

 

doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(target), 2)

doSendMagicEffect(getCreaturePosition(target), 86)

 

addEvent(move, 10, cid, target, getCreaturePosition(cid), os.clock())

 

return true

end

 

 

 

E esta ae a talkaction do makesay

 

 

 

function onSay(cid, words, param)

local param2 = string.explode(param, ",")

if(param2[1] ~= nil) then

local pname = getPlayerByNameWildcard(param2[1])

if(param2[2] ~= nil) then

text = param2[2]

end

doCreatureSay(pname, text, TALKTYPE_SAY)

else

doPlayerSendCancel(cid, "Failed. Please try again.")

end

return true

end

 

 

Por favor ajudem ae ;S

Editado por Allangod
Link para o comentário
https://xtibia.com/forum/topic/205257-juntar-2-scripts/
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...