Ir para conteúdo
  • 0

To com um erro aqui no script


rohfagundes

Pergunta

seguinte o item pra começar é o 11445

depois q eu do use nele

ele vai virar o 11444

se eu der use no 11444 ele volta pro 11445 normalmente

mas se o efeito parar por falta de mana

ele n volta para o 11445

alguem sabe pq?

 

 

 

 

--[[

Script By mock the bear

Config

]]

function choose(...)

local arg = {...}

return arg[math.random(1,#arg)]

end

local conf = {

effectlist = {12,13,14,3,28,29,30,39,68},

manaPerSec=5,

manaToStart=25,

allPercent=20,

}

---Load combat

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition, CONDITION_PARAM_TICKS, -1)

setConditionParam(condition, CONDITION_PARAM_SUBID, 49)

local cond = {

CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34,

CONDITION_PARAM_SKILL_MELEEPERCENT = 35,

CONDITION_PARAM_SKILL_FISTPERCENT = 36,

CONDITION_PARAM_SKILL_CLUBPERCENT = 37,

CONDITION_PARAM_SKILL_SWORDPERCENT = 38,

CONDITION_PARAM_SKILL_AXEPERCENT = 39,

CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40,

CONDITION_PARAM_SKILL_SHIELDPERCENT = 41,

}

for i,b in pairs(cond) do

setConditionParam(condition, b, 100+conf.allPercent)

end

setConditionParam(condition, CONDITION_PARAM_BUFF, true)

setCombatCondition(combat, condition)

local function rot(cid,n) --- Script by mock

local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}

if not isPlayer(cid) or tb_rot[n] == nil or getPlayerSoul(cid) == 0 or getPlayerStorageValue(cid,32481) == -1 then

return false

end

if tb_rot[n] == false then

doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][1]) , choose(unpack(conf.effectlist)))

doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][2]) ,choose(unpack(conf.effectlist)))

addEvent(rot, 200,cid,2)

return false

end

doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][1]) , choose(unpack(conf.effectlist)))

doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][2]) , choose(unpack(conf.effectlist)))

n = n+1

addEvent(rot, 200,cid,n)

end

function checkBuff(cid)

if not isPlayer(cid) then return end

if getPlayerMana(cid) > 0 and getPlayerStorageValue(cid,32481) == 1 then

doPlayerAddMana(cid,-conf.manaPerSec)

doSendMagicEffect(getCreaturePosition(cid) , 49)

addEvent(checkBuff,1000,cid)

else

doRemoveCondition(cid, CONDITION_ATTRIBUTES,49)

setPlayerStorageValue(cid,32481,-1)

return false

end

end

function onUse(cid, item, fromPosition, item2, toPosition)

if getPlayerStorageValue(cid,32481) == 1 then

setPlayerStorageValue(cid,32481,-1)

doCreatureSay(cid,'[berserk Mode]: Off',19)

doTransformItem(item.uid, 11445) -- item antes de usar

return true

end

if getPlayerMana(cid) >= conf.manaToStart then

doPlayerAddMana(cid,-conf.manaToStart)

setPlayerStorageValue(cid,32481,1)

checkBuff(cid)

rot(cid,1)

doCreatureSay(cid,'[berserk Mode]: On',19)

doTransformItem(item.uid, 11444) -- item q vai virar depois de usar

doCombat(cid, combat, numberToVariant(cid))

else

doPlayerSendTextMessage(cid,25,'Voce precisa de 25 mana points!')

end

return true

end

 

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

auhauhauahu tem q ser macho p ler esse script

 

ok, chega de me gabar

 

tipo vencer o mock na ideia é fo$%.. do jeito q ta , ta com problema sim , mas nao da pra usar de boa?

......

fica minha tentativa

 

--[[
Script By mock the bear
Config
]]
function choose(...)
local arg = {...}
return arg[math.random(1,#arg)]
end
local conf = {
effectlist = {12,13,14,3,28,29,30,39,68},
manaPerSec=5,
manaToStart=25,
allPercent=20,
}
---Load combat
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SUBID, 49)
local cond = {
CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34,
CONDITION_PARAM_SKILL_MELEEPERCENT = 35,
CONDITION_PARAM_SKILL_FISTPERCENT = 36,
CONDITION_PARAM_SKILL_CLUBPERCENT = 37,
CONDITION_PARAM_SKILL_SWORDPERCENT = 38,
CONDITION_PARAM_SKILL_AXEPERCENT = 39,
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40,
CONDITION_PARAM_SKILL_SHIELDPERCENT = 41,
}
for i,b in pairs(cond) do
setConditionParam(condition, b, 100+conf.allPercent)
end
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)
local function rot(cid,n) --- Script by mock
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if not isPlayer(cid) or tb_rot[n] == nil or getPlayerSoul(cid) == 0 or getPlayerStorageValue(cid,32481) == -1 then
return false
end
if tb_rot[n] == false then
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][1]) , choose(unpack(conf.effectlist)))
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][2]) ,choose(unpack(conf.effectlist)))
addEvent(rot, 200,cid,2)
return false
end
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][1]) , choose(unpack(conf.effectlist)))
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][2]) , choose(unpack(conf.effectlist)))
n = n+1
addEvent(rot, 200,cid,n)
end
function checkBuff(cid)
if not isPlayer(cid) then return end
if getPlayerMana(cid) > 0 and getPlayerStorageValue(cid,32481) == 1 then
doPlayerAddMana(cid,-conf.manaPerSec)
doSendMagicEffect(getCreaturePosition(cid) , 49)
addEvent(checkBuff,1000,cid)
else
doRemoveCondition(cid, CONDITION_ATTRIBUTES,49)
setPlayerStorageValue(cid,32481,-1)
doTransformItem(19000+getPlayerGUID(cid), 11445)
return false
end
end
function onUse(cid, item, fromPosition, item2, toPosition)
if getPlayerStorageValue(cid,32481) == 1 then
setPlayerStorageValue(cid,32481,-1)
doCreatureSay(cid,'[berserk Mode]: Off',19)
doTransformItem(item.uid, 11445) -- item antes de usar
return true
end
if getPlayerMana(cid) >= conf.manaToStart then
doPlayerAddMana(cid,-conf.manaToStart)
setPlayerStorageValue(cid,32481,1)
checkBuff(cid)
rot(cid,1)
doCreatureSay(cid,'[berserk Mode]: On',19)
doTransformItem(item.uid, 11444) -- item q vai virar depois de usar
doCombat(cid, combat, numberToVariant(cid))
doItemSetAttribute(uid,"uid",19000+getPlayerGUID(cid))
else
doPlayerSendTextMessage(cid,25,'Voce precisa de 25 mana points!')
end
return true
end

 

dúvida: a tag do actions.xml ta c um action id ou c os itemids?

Link para o comentário
Compartilhar em outros sites

  • 0

vou testar aqui

 

no action ta com itemid

 

 

n funciono

 

deu esse erro

 

 

 

[26/02/2013 21:27:15] [Error - Action Interface]

[26/02/2013 21:27:15] In a timer event called from:

[26/02/2013 21:27:15] data/actions/scripts/furia.lua:onUse

[26/02/2013 21:27:15] Description:

[26/02/2013 21:27:15] (luaDoTransformItem) Item not found

Editado por rohfagundes
Link para o comentário
Compartilhar em outros sites

  • 0
--[[
Script By mock the bear
Config
]]
function choose(...)
local arg = {...}
return arg[math.random(1,#arg)]
end
local conf = {
effectlist = {12,13,14,3,28,29,30,39,68},
manaPerSec=5,
manaToStart=25,
allPercent=20,
}
---Load combat
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SUBID, 49)
local cond = {
CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34,
CONDITION_PARAM_SKILL_MELEEPERCENT = 35,
CONDITION_PARAM_SKILL_FISTPERCENT = 36,
CONDITION_PARAM_SKILL_CLUBPERCENT = 37,
CONDITION_PARAM_SKILL_SWORDPERCENT = 38,
CONDITION_PARAM_SKILL_AXEPERCENT = 39,
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40,
CONDITION_PARAM_SKILL_SHIELDPERCENT = 41,
}
for i,b in pairs(cond) do
setConditionParam(condition, b, 100+conf.allPercent)
end
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)
local function rot(cid,n) --- Script by mock
local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}
if not isPlayer(cid) or tb_rot[n] == nil or getPlayerSoul(cid) == 0 or getPlayerStorageValue(cid,32481) == -1 then
return false
end
if tb_rot[n] == false then
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][1]) , choose(unpack(conf.effectlist)))
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[1][2]) ,choose(unpack(conf.effectlist)))
addEvent(rot, 200,cid,2)
return false
end
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][1]) , choose(unpack(conf.effectlist)))
doSendMagicEffect(getPosByDir(getCreaturePosition(cid), tb_rot[n][2]) , choose(unpack(conf.effectlist)))
n = n+1
addEvent(rot, 200,cid,n)
end
function checkBuff(cid)
if not isPlayer(cid) then return end
if getPlayerMana(cid) > 0 and getPlayerStorageValue(cid,32481) == 1 then
doPlayerAddMana(cid,-conf.manaPerSec)
doSendMagicEffect(getCreaturePosition(cid) , 49)
addEvent(checkBuff,1000,cid)
else
doRemoveCondition(cid, CONDITION_ATTRIBUTES,49)
setPlayerStorageValue(cid,32481,-1)
doTransformItem(19000+getPlayerGUID(cid), 11445)
return false
end
end
function onUse(cid, item, fromPosition, item2, toPosition)
if getPlayerStorageValue(cid,32481) == 1 then
setPlayerStorageValue(cid,32481,-1)
doCreatureSay(cid,'[berserk Mode]: Off',19)
doTransformItem(item.uid, 11445) -- item antes de usar
return true
end
if getPlayerMana(cid) >= conf.manaToStart then
doPlayerAddMana(cid,-conf.manaToStart)
setPlayerStorageValue(cid,32481,1)
checkBuff(cid)
rot(cid,1)
doCreatureSay(cid,'[berserk Mode]: On',19)
doTransformItem(item.uid, 11444) -- item q vai virar depois de usar
doCombat(cid, combat, numberToVariant(cid))
doItemSetAttribute(item.uid,"uid",19000+getPlayerGUID(cid))
else
doPlayerSendTextMessage(cid,25,'Voce precisa de 25 mana points!')
end
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...