Olá queria pedir pa alguem me ajudar a achar ou passar o script tipo a wand ta batendo Ice eu escrevo !wand Fire dai ela muda se alguem me ajudar dou REP+
data/weapons
Adicione. wand.lua
w = {
[12031] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
[12032] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
[12033] = {ef = 45, sh = 38, dmg = COMBAT_POISONDAMAGE},
[12034] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
[12035] = {ef = 11, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
[12036] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}
function onUseWeapon(cid, var)
min, max = 260, 300 -- dano minimo e maximo
target = getCreatureTarget(cid)
for stor, info in pairs(w) do
if getPlayerStorageValue(cid, stor) == 1 then
if target ~= 0 then
doSendDistanceShoot(getThingPos(cid), getThingPos(target), info.sh)
addEvent(doAreaCombatHealth, 100, cid, info.dmg, getThingPos(target), 0, -min, -max, info.ef)
end
end
end
return true
end
Adicione esta tag no weapons.xml, alterando o level, mana e o ID da wand de acordo cm sua vontade.
<wand id="7958" level="xx" mana="xx" min="0" max="0" type="earth" event="script" value="wand.lua"> <!-- wand of effects -->
<vocation id="1"/>
<vocation id="2"/>
<vocation id="5"/>
<vocation id="6"/>
</wand>
Em data/talkactions/scripts, adicionar
function onSay(cid, words, param)
local param = string.lower(param)
local table = {
["fire"] = 12031,
["ice"] = 12032,
["earth"] = 12033,
["death"] = 12034,
["energy"] = 12035,
["holy"] = 12036
}
local id = 0 --- aqui vai o id da wand
local a = table[param]
if (param == "") then do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Elementos: Fire, Ice, Earth, Death, Energy, Holy')
end
return true
end
if getPlayerItemCount(cid, id) >= 0 then
setPlayerStorageValue(cid, 12031, 0)
setPlayerStorageValue(cid, 12032, 0)
setPlayerStorageValue(cid, 12033, 0)
setPlayerStorageValue(cid, 12034, 0)
setPlayerStorageValue(cid, 12035, 0)
setPlayerStorageValue(cid, 12036, 0)
setPlayerStorageValue(cid, a, 1)
doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. param .. ".")
end
return true
end
e a tag a seguir, em talkactions.xml
<talkaction words="!wand" event="script" value="wand.lua"/>