jonathasbizerril 0 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 Olá galera eu quero um script que os shield possar refletir danos ! só isso mesmo Obrigado +repp pra quem conseguir me ajudar ! Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/ Compartilhar em outros sites More sharing options...
Session Start 125 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 poe isso em MODS... arquivo.XML <?xml version="1.0" encoding="UTF-8"?> <mod name="Reflect System" version="0.1" author="Aluccard and edited Cleberadm" contact="" enabled="yes"> <description> Script que funciona para refletir danos para as creatures que o atacar. </description> <event type="login" name="regReflectDamage" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid,"ReflectDamage") return true end ]]></event> <event type="statschange" name="ReflectDamage" event="script"><![CDATA[ local slotPos = {CONST_SLOT_SHIELD} function onStatsChange(cid, attacker, type, combat, value) local reflectPercent = 90 local dmg = value local playerPos = getCreaturePosition(cid) local attackerPos = getCreaturePosition(attacker) for i = 1, #slotPos do if getPlayerSlotItem(cid, slotPos[i]).uid > 1 then if getItemReflectPercent(getPlayerSlotItem(cid, slotPos[i]).uid) then reflectPercent = reflectPercent + getItemReflectPercent(getPlayerSlotItem(cid, slotPos[i]).uid) end end end if reflectPercent > 0 then dmg = math.ceil(-value*((100-reflectPercent)/100)) if (dmg < 0) then doSendAnimatedText(playerPos, -dmg, COLOR_GREEN) doSendMagicEffect(playerPos, 30) else doSendMagicEffect(playerPos, 10) end dmg = math.ceil(-value*(reflectPercent/100)) if (dmg < 0) then doCreatureAddHealth(attacker, dmg) doSendAnimatedText(attackerPos, -dmg, COLOR_GREEN) doSendDistanceShoot(playerPos, attackerPos, CONST_ANI_SUDDENDEATH) end else return true end end]]></event> </mod> Em data/lib ReflectLib.lua function getItemReflectPercent(itemuid) local item = {2514, 2520} --- adicione os IDS dos shields aqui. setItemAttribute(item.uid, "reflectPercent") doItemSetAttribute(item.uid, "description", "[Reflect: "..percent.."%]") doItemSetAttribute(item.uid, "reflectPercent", percent) return getItemAttribute(itemuid, "reflectPercent") end Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/#findComment-1554165 Compartilhar em outros sites More sharing options...
jonathasbizerril 0 Postado Agosto 25, 2013 Autor Share Postado Agosto 25, 2013 Obrigado vou testa já edito aqui [25/08/2013 04:36:35] buffer:onStatsChange [25/08/2013 04:36:35] Description: [25/08/2013 04:36:35] (luaDoCreatureAddHealth) Creature not found [25/08/2013 04:36:35] [Error - CreatureScript Interface] [25/08/2013 04:36:35] buffer:onStatsChange [25/08/2013 04:36:35] Description: [25/08/2013 04:36:35] (luaGetThingPosition) Thing not found [25/08/2013 04:36:35] [Error - CreatureScript Interface] [25/08/2013 04:36:35] buffer:onStatsChange [25/08/2013 04:36:35] Description: [25/08/2013 04:36:35] (luaDoCreatureAddHealth) Creature not found [25/08/2013 04:36:36] [Error - CreatureScript Interface] [25/08/2013 04:36:36] buffer:onStatsChange [25/08/2013 04:36:36] Description: [25/08/2013 04:36:36] (luaGetThingPosition) Thing not found [25/08/2013 04:36:36] [Error - CreatureScript Interface] [25/08/2013 04:36:36] buffer:onStatsChange [25/08/2013 04:36:36] Description: [25/08/2013 04:36:36] (luaDoCreatureAddHealth) Creature not found [25/08/2013 04:36:37] Osmoze efetuou login. [25/08/2013 04:36:38] [Error - CreatureScript Interface] [25/08/2013 04:36:38] buffer:onStatsChange [25/08/2013 04:36:38] Description: [25/08/2013 04:36:38] (luaGetThingPosition) Thing not found Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/#findComment-1554173 Compartilhar em outros sites More sharing options...
Session Start 125 Postado Agosto 25, 2013 Share Postado Agosto 25, 2013 <?xml version="1.0" encoding="UTF-8"?> <mod name="Reflect System" version="0.1" author="Aluccard / edited by Cleberadm" contact="" enabled="yes"> <description> Script que funciona para refletir danos para as creatures que o atacar. </description> <event type="login" name="regReflectDamage" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid,"ReflectDamage") return true end ]]></event> <event type="statschange" name="ReflectDamage" event="script"><![CDATA[ local slotPos = {CONST_SLOT_SHIELD} function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) or isMonster(attacker) then local reflectPercent = 100 local dmg = value local playerPos = getCreaturePosition(cid) local attackerPos = getCreaturePosition(attacker) for i = 1, #slotPos do if getPlayerSlotItem(cid, slotPos[i]).uid > 1 then if getItemReflectPercent(getPlayerSlotItem(cid, slotPos[i]).uid) then reflectPercent = reflectPercent + getItemReflectPercent(getPlayerSlotItem(cid, slotPos[i]).uid) end end end if reflectPercent > 0 then dmg = math.ceil(-value*((100-reflectPercent)/100)) if (dmg < 0) then doCreatureAddHealth(cid, dmg) doSendAnimatedText(playerPos, -dmg, COLOR_RED) doSendMagicEffect(playerPos, 0) else doSendMagicEffect(playerPos, 3) end dmg = math.ceil(-value*(reflectPercent/100)) if (dmg < 0) then doCreatureAddHealth(attacker, dmg) doSendAnimatedText(attackerPos, -dmg, COLOR_RED) doSendDistanceShoot(playerPos, attackerPos, CONST_ANI_SUDDENDEATH) end else return true end end end]]></event> </mod> Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/#findComment-1554186 Compartilhar em outros sites More sharing options...
jonathasbizerril 0 Postado Agosto 25, 2013 Autor Share Postado Agosto 25, 2013 não está aparecendo a descrição no shield e mesmo sem o shield ta refletindo :s Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/#findComment-1554322 Compartilhar em outros sites More sharing options...
Stigal 585 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/219990-encerrado-shield-reclect/#findComment-1735181 Compartilhar em outros sites More sharing options...
Posts Recomendados