
kawpek
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
kawpek deu reputação a Sekk em Mudar elemento da WandOlá galera, nunca postei aqui no fórum pra tentar ajudar a turma.... Bom, esses dias eu estava procurando uma talkaction aqui no fórum, que mude o elemento da wand... Eu não achei nenhum tópico, porém, achei uma resposta em um tópico e eu decidi postar aqui no fórum. Se estiver na seção errada, por favor, mova para a correta, ou se ja tiver um tutorial assim aqui, pode deletar se possível.
Bom vamos lá:
1 - Vá em data/creaturescripts/scripts/login.lua e adicione a seguinte tag antes do último "Return True":
2 - Vá em data/items/items.xml e adicione isso, ou edite o item desejado:
3 - Vá em data/talkactions/talkactions.xml e adicione a seguinte tag:
Ainda em talkactions, abra a pasta scripts e crie um arquivo chamado wand.lua e coloque o seguinte código dentro deste arquivo:
4 - Vá em data/weapons/weapons.xml e adicione a seguinte tag:
Ainda em weapons, abra a pasta scripts e crie um arquivo chamado wand1.lua e coloque o seguinte código dentro do mesmo:
Pronto, basta você retirar o item do loot dos monstros, editar ao seu gosto a wand, e ser feliz com ela
Créditos:
Zaruss por postar esse script na resposta de um tópico aqui no TK
jvcasarin(EU) por postar um tópico aqui no TK
Se te ajudei, dê um REP+ ai
-
kawpek deu reputação a Cat em [Pedido] Reflection Bootsbom eu pelo menos conheço só essa:
(é adicionado em itens.xml no item)
<attribute key="reflectpercentall" value="30"/> <attribute key="reflectchanceall" value="30"/> e tem o sistema do matheusmklao
Vá na pasta data/lib e crie um arquivo chamado de ReflectLib.lua e adicione isso dentro:
function isHandedWeapon(itemuid) local typee = getItemWeaponType(itemuid) or 0 if typee >= 1 and typee <= 6 then return CONST_SLOT_RIGHT end return -1 end function getItemType(itemid) local slottypes = {"head", "body", "legs", "feet", "ring", "necklace"} local consts = { ["head"] = CONST_SLOT_HEAD, ["armor"] = CONST_SLOT_ARMOR, ["legs"] = CONST_SLOT_LEGS, ["feet"] = CONST_SLOT_FEET, ["ring"] = CONST_SLOT_RING, ["necklace"] = CONST_SLOT_NECKLACE } local arq = io.open("data/items/items.xml", "r"):read("*all") local attributes = arq:match('<item id="' .. itemid .. '".+name="' .. getItemNameById(itemid) ..'">(.-)</item>') local slot = "" for i,x in pairs(slottypes) do if attributes:find(x) then slot = x break end end if slot == "body" then slot = "armor" end return consts[slot] end function addReflectCharges(item, charges, reflectpercent) if charges ~= "inf" then charges = charges+1 doItemSetAttribute(item, "mcharges", charges) doItemSetAttribute(item, "charges", charges) doItemSetAttribute(item, "name", getItemNameById(getThing(item).itemid) .. " that is brand-new") else doItemSetAttribute(item, "charges", -1) doItemSetAttribute(item, "mcharges", "inf") end doItemSetAttribute(item, "reflect", reflectpercent) doItemSetAttribute(item, "description", "That item reflects " .. reflectpercent .. " percent of physical damage.") end function renewCharges(item) if getItemAttribute(item, "charges") and getItemAttribute(item, "mcharges") ~= "inf" then doItemSetAttribute(item, "charges", getItemAttribute(item, "mcharges")) doItemSetAttribute(item, "name", getItemNameById(getThing(item).itemid) .. " that is brand-new") end end Agora vá em data/creaturescripts/scripts e adicione o script reflectDamage.lua com esse script:
function onStatsChange(cid, attacker, type, combat, value) local slots = {CONST_SLOT_HEAD, CONST_SLOT_NECKLACE, CONST_SLOT_ARMOR, CONST_SLOT_RIGHT, CONST_SLOT_LEFT, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_RING} local reflectpercent = 0 local itens = {} for i = 1, #slots do if getPlayerSlotItem(cid, slots[i]).uid > 1 and (getItemType(getPlayerSlotItem(cid, slots[i]).itemid) == slots[i] or isInArray({CONST_SLOT_RIGHT, CONST_SLOT_LEFT}, isHandedWeapon(getPlayerSlotItem(cid, slots[i]).uid))) and getItemAttribute(getPlayerSlotItem(cid, slots[i]).uid, "mcharges") and (getItemAttribute(getPlayerSlotItem(cid, slots[i]).uid, "charges") > 1 or getItemAttribute(getPlayerSlotItem(cid, slots[i]).uid, "mcharges") == "inf") then reflectpercent = reflectpercent+getItemAttribute(getPlayerSlotItem(cid, slots[i]).uid, "reflect") table.insert(itens, getPlayerSlotItem(cid, slots[i])) end end if combat == 1 and reflectpercent > 0 then if math.ceil(-value*((100-reflectpercent)/100)) < 0 then doCreatureAddHealth(cid, math.ceil(-value*((100-reflectpercent)/100))) doSendAnimatedText(getCreaturePosition(cid), math.ceil(value*((100-reflectpercent)/100)), COLOR_RED) local a = doCreateItem(2019, 2, getCreaturePosition(cid)) doSendMagicEffect(getCreaturePosition(cid), 0) doDecayItem(a) else doSendMagicEffect(getCreaturePosition(cid), 3) end if math.ceil(-value*(reflectpercent/100)) < 0 then doCreatureAddHealth(attacker, math.ceil(-value*(reflectpercent/100))) doSendAnimatedText(getCreaturePosition(attacker), math.ceil(value*(reflectpercent/100)), COLOR_GREY) local a = doCreateItem(2019, 2, getCreaturePosition(attacker)) doSendMagicEffect(getCreaturePosition(attacker), 9) doDecayItem(a) end for i,x in pairs(itens) do if getItemAttribute(x.uid, "mcharges") ~= "inf" then doItemSetAttribute(x.uid, "charges", getItemAttribute(x.uid, "charges")-1) doItemSetAttribute(x.uid, "name", getItemNameById(x.itemid) .. " that has " .. getItemAttribute(x.uid, "charges")-1 .. " charge" .. (getItemAttribute(x.uid, "charges")-1 > 1 and "s" or "") .. " left") end end else return TRUE end end Agora na mesma pasta, procure por login.lua, e antes do ultimo return true, adicione essa linha:
registerCreatureEvent(cid, "ReflectDamage") Agora vá em creaturescripts.xml e adicione esta tag:
<event type="statschange" name="ReflectDamage" event="script" value="reflectDamage.lua"/>