Postado Agosto 14, 2012 12 anos Olá, amiguinhos doTK vim aqui trazer outro script primeiramente va em data/creaturescripts/scripts crie um arquivo chamado reflectionSystem.lua e adicione isso dentro: Mostrar conteúdo oculto function onStatsChange(cid, attacker, type, combat, value) local table = { [COMBAT_FIREDAMAGE] = {efect = 36, s_effect = 3, dmg = COMBAT_FIREDAMAGE}, [COMBAT_ICEDAMAGE] = {efect = 42, s_effect = 28, dmg = COMBAT_ICEDAMAGE}, [COMBAT_POISONDAMAGE] = {efect = 45, s_effect = 38, dmg = COMBAT_POISONDAMAGE}, [COMBAT_DEATHDAMAGE] = {efect = 17, s_effect = 31, dmg = COMBAT_DEATHDAMAGE}, [COMBAT_ENERGYDAMAGE] = {efect = 11, s_effect = 35, dmg = COMBAT_ENERGYDAMAGE}, [COMBAT_HOLYDAMAGE] = {efect = 49, s_effect = 37, dmg = COMBAT_HOLYDAMAGE}, [COMBAT_PHYSICALDAMAGE] = {efect = CONST_ME_EXPLOSIONAREA, s_effect = CONST_ANI_EXPLOSION, dmg = COMBAT_PHYSICALDAMAGE} } local a = table[combat] if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then if a and isPlayer(cid) and isPlayer(attacker) then if getPlayerStorageValue(cid, 19273) > 0 then doSendDistanceShoot(getPlayerPosition(cid), getPlayerPosition(attacker), a.s_effect) doTargetCombatHealth(cid, attacker, a.dmg, -value, -value, a.efect) if getCreatureCondition(attacker, CONDITION_MANASHIELD) or getPlayerSlotItem(attacker, CONST_SLOT_RING).itemid == 2167 then addEvent(doTargetCombatMana, 100, attacker, getPlayerPosition(attacker), 0, -value, -value, a.efect) end setPlayerStorageValue(cid, 19273, getPlayerStorageValue(cid, 19273) - 1) doPlayerSendTextMessage(cid, 27, getPlayerStorageValue(cid, 19273) > 0 and "Agora você tem [".. getPlayerStorageValue(cid, 19273) .. "] cargas para refletir" or "suas cargas acabaram") return true end end end return true end depois va em creaturescripts.xml e adicione essa linha: <event type="statschange" name="reflector" event="script" value="reflectionSystem.lua"/> em login.lua registerCreatureEvent(cid, "reflector") se você quiser com talkaction va em /data/talkactions/scripts crie um arquivo chamado reflectTalk.lua e adicione isso dentro: <talkaction words="!reflect" event="script" value="reflectTalk.lua"/> se você quiser item va em /data/actions/scripts crie um arquivo chamado actionReflect.lua e adicione isso dentro: <action itemid="id_do_item" event="script" value="actionReflect.lua"/> Observações: Não foi testado Quiserem postar em outros fórums podem postar Oque ele Faz Bom você usa o comando !comando ou da use em um item ai você refletira os ataques recebidos ou seja quem te atacou recebera o mesmo ataque você pode mudar quantas cargas tera no script ~~ Créditos ~~ Vodkart ( Arrumar uns erros ) Skyforever (Criar o script) --------------------------- Mostrar conteúdo oculto function onSay(cid, words, param) local cargas = 10 -- quantas vezes ira refletir if getPlayerStorageValue(cid, 19273) <= 0 and getPlayerStorageValue(cid, 19274) - os.time() < 0 then setPlayerStorageValue(cid, 19273, cargas) setPlayerStorageValue(cid, 19274, os.time() + 300*1000) else doPlayerSendTextMessage(cid, 28, "Você só podera usar denovo daqui [".. getPlayerStorageValue(cid, 19274) - os.time() .. "] Segundos.") end return true end em talkactions.xml Mostrar conteúdo oculto function onUse(cid, item) local cargas = 10 -- quantas vezes ira refletir if getPlayerStorageValue(cid, 19273) <= 0 and getPlayerStorageValue(cid, 19274) - os.time() < 0 then setPlayerStorageValue(cid, 19273, cargas) setPlayerStorageValue(cid, 19274, os.time() + 300*1000 ) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, 28, "Você só podera usar denovo daqui [".. getPlayerStorageValue(cid, 19274) - os.time() .. "] Segundos.") end return true end actions.xml Editado Agosto 19, 2012 12 anos por Skyforever (veja o histórico de edições)
Postado Agosto 19, 2012 12 anos Autor @ UP ! Bom para o tópico PS:Testado e agora está 100% Editado Agosto 19, 2012 12 anos por Skyforever (veja o histórico de edições)
Postado Junho 14, 2014 10 anos Em 19/08/2012 em 23:18, Skyforever disse: @ UP ! Bom para o tópico PS:Testado e agora está 100% desculpe estar revivendo o topico mais é possivel não remover o iten e dar pra usar de 5 em 5 minutos com 15 cargas ??? id do iten é 11439 .... na aba do action/scripts obrigado pela contribuiçao
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.