Postado Outubro 4, 2016 8 anos Wolf.. tem como da um help aqui? Gostaria que o dano da Spider fosse por function igual a esse. Citar function onGetFormulaValues(cid, level, maglevel) local min = (-level * 1 - maglevel * 4) * 1.0 local max = (-level * 2 - maglevel * 4) * 1.2 return min, max end setCombatCallback(poisonpowder, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") Tem como explicar como eu posso adicionar no script?
Postado Outubro 4, 2016 8 anos Autor o dano da spider ao explodir está na spell dela: doAreaCombatHealth(cid, 1, getThingPos(cid), area, -1, -30, 20) se você quer fazer depender do lvl e ml do player vc primeiro de tudo precisa pegar o player (q é o master da spider) local player = getCreatureMaster(cid) local min = 0 local max = 0 if isPlayer(player) then local ml, lvl = getCreatureMagicLevel(player), getCreatureLevel(player) min = (-lvl * 1 - ml * 4) * 1.0 max = (-lvl * 2 - ml * 4) * 1.2 else min = -1 max = -30 end doAreaCombatHealth(cid, 1, getThingPos(cid), area, min, max, 20) se nao der certo ou der algum erro bota um .uid depois de getCreatureMaster(cid)
Postado Outubro 4, 2016 8 anos Obrigado por responder. Ta dando esses seguintes erros. Quando tá local player = getCreatureMaster(cid), da esse seguinte erro. Citar [04/10/2016 12:54:14] [Error - Spell Interface] [04/10/2016 12:54:14] In a timer event called from: [04/10/2016 12:54:14] data/spells/scripts/attack/newspider.lua:onCastSpell [04/10/2016 12:54:14] Description: [04/10/2016 12:54:14] (luaGetCreatureMaster) Creature not found local player = getCreatureMaster(uid) Citar [04/10/2016 12:54:37] [Error - Spell Interface] [04/10/2016 12:54:37] In a timer event called from: [04/10/2016 12:54:37] data/spells/scripts/attack/newspider.lua:onCastSpell [04/10/2016 12:54:37] Description: [04/10/2016 12:54:37] data/spells/scripts/attack/newspider.lua:33: attempt to call global 'getCreatureMagicLevel' (a nil value) [04/10/2016 12:54:37] stack traceback: [04/10/2016 12:54:37] data/spells/scripts/attack/newspider.lua:33: in function <data/spells/scripts/attack/newspider.lua:26> E o script. local poisonpowder = createConditionObject(CONDITION_POISON) setConditionParam(poisonpowder, CONDITION_PARAM_DELAYED, 1) local damageTable = { {4, -3}, {9, -2}, {20, -1} } for i = 1, #damageTable do local t = damageTable[i] addDamageCondition(poisonpowder, t[1], 4000, t[2]) end local arr = { {0, 1, 0}, {1, 3, 1}, {0, 1, 0} } local area = createCombatArea(arr) function onCastSpell(cid, var) mayNotMove(cid, 1) addEvent(function() local player = getCreatureMaster(cid) local min = 0 local max = 0 if isPlayer(player) then local ml, lvl = getCreatureMagicLevel(player), getCreatureLevel(player) min = (-lvl * 1 - ml * 4) * 1.0 max = (-lvl * 2 - ml * 4) * 1.2 else min = -1 max = -30 end if isCreature(cid) then doAreaCombatCondition(cid, getThingPos(cid), area, poisonpowder, 255) doSendMagicEffect(getThingPos(cid), 16) doRemoveCreature(cid) end end, 2000) return true end Editado Outubro 4, 2016 8 anos por Hundra (veja o histórico de edições)
Postado Outubro 4, 2016 8 anos Autor Spoiler local poisonpowder = createConditionObject(CONDITION_POISON) setConditionParam(poisonpowder, CONDITION_PARAM_DELAYED, 1) local damageTable = { {4, -3}, {9, -2}, {20, -1} } for i = 1, #damageTable do local t = damageTable[i] addDamageCondition(poisonpowder, t[1], 4000, t[2]) end local arr = { {0, 1, 0}, {1, 3, 1}, {0, 1, 0} } local area = createCombatArea(arr) function onCastSpell(cid, var) mayNotMove(cid, 1) addEvent(function() if isCreature(cid) then local player = getCreatureMaster(cid) local min, max = 0, 0 if isPlayer(player) then local ml, lvl = getPlayerMagLevel(player), getPlayerLevel(player) min = (-lvl * 1 - ml * 4) * 1.0 max = (-lvl * 2 - ml * 4) * 1.2 else min = -1 max = -30 end doAreaCombatHealth(cid, 1, getThingPos(cid), area, min, max, 20) doAreaCombatCondition(cid, getThingPos(cid), area, poisonpowder, 255) doSendMagicEffect(getThingPos(cid), 16) doRemoveCreature(cid) end end, 2000) return true end usa a spell assim
Postado Outubro 4, 2016 8 anos KKkkkk, vlw Wolf.. E só mais 1 coisa.. Estou usando um ring que tem essa key. Citar <attribute key="increaseMagicPercent" value="110" /> Nas outras spell o dano aumenta de boas, mas por que nessa não? EDIT: Um detalhe também, o dano tá como PHYSICAL. Tem como mudar? Editado Outubro 4, 2016 8 anos por Hundra (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.