Ir para conteúdo
  • 0

Colocar essa magia para poder usar sem esta em party HELP Vodkart


KennyConrad

Pergunta

gostaria de colocar essa spell pra poder usar sem presisar estar em party

 


local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

function onCastSpell(cid, var)
local pos = getCreaturePosition(cid)
if(getPlayerParty(cid) == nil) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local membersList = getPartyMembers(cid)
if(type(membersList) ~= 'table' or table.maxn(membersList) <= 1) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local affectedList = {}
for _, pid in ipairs(membersList) do
if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then
table.insert(affectedList, pid)
end
end

local tmp = table.maxn(affectedList)
if(tmp <= 1) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local mana = (tmp * 50)
if(getCreatureMana(cid) < mana) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

if(doCombat(cid, combat, var) ~= LUA_NO_ERROR) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

doCreatureAddMana(cid, -mana, FALSE)
doPlayerAddSpentMana(cid, mana)
for _, pid in ipairs(affectedList) do
doAddCondition(pid, condition)
end

return LUA_NO_ERROR
end

 

tag:

 


<instant name="habilidade para martelos" words="martelos-ja" lvl="32" mana="380"  aggressive="0" selftarget="1" exhaustion="1000" groups="3,3000" icon="45" needlearn="0" event="script" value="party/drunou support club.lua">
<vocation id="9"/>
<vocation id="10"/>
</instant>

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

14 respostass a esta questão

Posts Recomendados

  • 0
local combat = createCombatObject()

local area = createCombatArea(AREA_CROSS5X5)

setCombatArea(combat, area)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

 

local condition = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition, CONDITION_PARAM_SUBID, 1)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)

setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

 

local affectedList = {}

for _, pid in ipairs(membersList) do

if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then

table.insert(affectedList, pid)

end

end

 

local mana = (tmp * 50)

if(getCreatureMana(cid) < mana) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)

doSendMagicEffect(pos, CONST_ME_POFF)

return LUA_ERROR

end

 

if(doCombat(cid, combat, var) ~= LUA_NO_ERROR) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

doSendMagicEffect(pos, CONST_ME_POFF)

return LUA_ERROR

end

 

doCreatureAddMana(cid, -mana, FALSE)

doPlayerAddSpentMana(cid, mana)

for _, pid in ipairs(affectedList) do

doAddCondition(pid, condition)

end

 

return LUA_NO_ERROR

end

Link para o comentário
Compartilhar em outros sites

  • 0

deu esse erro aki

 


[8/2/2013 0:42:6] [Error - LuaInterface::loadFile] data/spells/scripts/party/drunou support club.lua:40: '<eof>' expected near 'end'
[8/2/2013 0:42:6] [Error - Event::checkScript] Cannot load script (data/spells/scripts/party/drunou support club.lua)
[8/2/2013 0:42:6] data/spells/scripts/party/drunou support club.lua:40: '<eof>' expected near 'end'

 

alguem ajuda por favor

Link para o comentário
Compartilhar em outros sites

  • 0

.

 

local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)
function onCastSpell(cid, var)
local affectedList = {}
for _, pid in ipairs(membersList) do
if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then
table.insert(affectedList, pid)
end
local mana = (tmp * 50)
if(getCreatureMana(cid) < mana) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end
if(doCombat(cid, combat, var) ~= LUA_NO_ERROR) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end
doCreatureAddMana(cid, -mana, FALSE)
doPlayerAddSpentMana(cid, mana)
for _, pid in ipairs(affectedList) do
doAddCondition(pid, condition)
end
return LUA_NO_ERROR
end
end

Link para o comentário
Compartilhar em outros sites

  • 0

deu esse erro quando usei a magia

 


[8/2/2013 21:59:52] [Error - Spell Interface] 
[8/2/2013 21:59:52] data/spells/scripts/party/drunou support club.lua:onCastSpell
[8/2/2013 21:59:52] Description: 
[8/2/2013 21:59:53] data/spells/scripts/party/drunou support club.lua:13: bad argument #1 to 'ipairs' (table expected, got nil)
[8/2/2013 21:59:53] stack traceback:
[8/2/2013 21:59:53]  [C]: in function 'ipairs'
[8/2/2013 21:59:53]  data/spells/scripts/party/drunou support club.lua:13: in function <data/spells/scripts/party/drunou support club.lua:11>

Link para o comentário
Compartilhar em outros sites

  • 0

local combat = createCombatObject()

local area = createCombatArea(AREA_CROSS5X5)

setCombatArea(combat, area)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

 

local condition = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition, CONDITION_PARAM_SUBID, 1)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)

setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

 

local affectedList = {}

for _, pid in ipairs(membersList) do

if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then

table.insert(affectedList, pid)

end

 

local mana = (tmp * 50)

if(getCreatureMana(cid) < mana) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)

doSendMagicEffect(pos, CONST_ME_POFF)

return LUA_ERROR

end

 

if(doCombat(cid, combat, var) ~= LUA_NO_ERROR) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

doSendMagicEffect(pos, CONST_ME_POFF)

return LUA_ERROR

end

 

doCreatureAddMana(cid, -mana, FALSE)

doPlayerAddSpentMana(cid, mana)

for _, pid in ipairs(affectedList) do

doAddCondition(pid, condition)

end

 

return LUA_NO_ERROR

end

Link para o comentário
Compartilhar em outros sites

  • 0

entenda, o jeito q vcs tao fazendo nunca vao funcionar..

me diz, onde nessa reply ./\ está declarado o memberlist? ¬¬

for _, pid in ipairs(membersList) do

 

pra arrumar é só verificar os players de tal area até tal area.. procura em algum sistema meu de guildwar sei la, q tem as linhas do codigo... ñ vo faze agora pq to sem server pra testar, e sem nenhum editor LUA, dae eu erro facil =/...

dica pra quem for arrumar: pega todas as pessoas de tal até tal posição, adiciona na tabela memberlist, e dps só continuar o script igual!

Link para o comentário
Compartilhar em outros sites

  • 0
local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

function onCastSpell(cid, var)
local pos = getCreaturePosition(cid)
if(getPlayerParty(cid) == nil) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local membersList = getPartyMembers(cid)
if(type(membersList) ~= 'table' or table.maxn(membersList) <= 1) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local affectedList = {}
for _, pid in ipairs(membersList) do
if(getDistanceBetween(getCreaturePosition(pid), pos) <= 36) then
table.insert(affectedList, pid)
end
end

local tmp = table.maxn(affectedList)
if(tmp <= 1) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOPARTYMEMBERSINRANGE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

local mana = (tmp * 50)
if(getCreatureMana(cid) < mana) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

if(doCombat(cid, combat, var) ~= LUA_NO_ERROR) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end

for i = 1, math.huge() do
while true do
repeat
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_NONE)
until false
end
end

doCreatureAddMana(cid, -mana, FALSE)
doPlayerAddSpentMana(cid, mana)
for _, pid in ipairs(affectedList) do
doAddCondition(pid, condition)
end

return LUA_NO_ERROR
end

Link para o comentário
Compartilhar em outros sites

  • 0

DAORA NÉ?

MAS FAZ ASSIM Ó

 

local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

function onCastSpell(cid, var)
while true do
repeat
for i = 1, #math.huge do
print("...")
doCombat(cid, combat, var)
end
until false
end
end

 

FICA MUINTO MELHR

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

  • 0

deu esse erro

 


[9/2/2013 10:39:52] [Error - Spell Interface] 
[9/2/2013 10:39:52] data/spells/scripts/party/drunou support club.lua:onCastSpell
[9/2/2013 10:39:52] Description: 
[9/2/2013 10:39:52] data/spells/scripts/party/drunou support club.lua:16: attempt to get length of field 'huge' (a number value)
[9/2/2013 10:39:52] stack traceback:
[9/2/2013 10:39:52]  data/spells/scripts/party/drunou support club.lua:16: in function <data/spells/scripts/party/drunou support club.lua:13>

Link para o comentário
Compartilhar em outros sites

  • 0

local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)

function onCastSpell(cid, var)
while true do
repeat
for i = 1, math.huge() do
print("...")
doCombat(cid, combat, var)
end
until false
end
end

 

Perdao eh asim

Link para o comentário
Compartilhar em outros sites

  • 0


[9/2/2013 13:31:15] [Error - Spell Interface] 
[9/2/2013 13:31:15] data/spells/scripts/party/drunou support club.lua:onCastSpell
[9/2/2013 13:31:15] Description: 
[9/2/2013 13:31:15] data/spells/scripts/party/drunou support club.lua:16: attempt to call field 'huge' (a number value)
[9/2/2013 13:31:15] stack traceback:
[9/2/2013 13:31:15]  data/spells/scripts/party/drunou support club.lua:16: in function <data/spells/scripts/party/drunou support club.lua:13>

 

resolvido podem fechar o topico eu mesmo consegui modificar a spell e foi tão facil nossa viu resolvi o problema com - de 5 minutos hehe fiz assim

 


local combat = createCombatObject()
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 30)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...