samuel157
/root
- Joined
- Mar 19, 2010
- Messages
- 447
- Solutions
- 3
- Reaction score
- 49
- Location
- São Paulo, Brazil
- GitHub
- Samuel10M
Need of "lifedrain" "poison" "outfit" "invisible" "drunk" "paralyze"
[TALKACTIONS] [WEAPPONs] 8.60 Need Script Weapon All Eement !wand "element"
[TALKACTIONS] [WEAPPONs] 8.60 Need Script Weapon All Eement !wand "element"
Lua:
function onSay(cid, words, param)
local param = string.lower(param)
local table = {
["fire"] = 12031,
["ice"] = 12032,
["earth"] = 12033,
["death"] = 12034,
["energy"] = 12035,
["holy"] = 12036,,
["physicaldamage"] = 12037,
["holy"] = 12038
}
local id = 7735 --- aqui vai o id da wand
local a = table[param]
if not a then
doPlayerSendTextMessage(cid, 28, "Digite !sam fire, ice earth, death, energy, holy e physicaldamage. Para coloca um efeito na sua Arma")
return true
end
if (param == "info") then
for element, stor in pairs(table) do
text = "Elementos: "..element..""
doPlayerPopupFYI(cid, text)
end
end
if getPlayerItemCount(cid, id) >= 1 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, 12037, 0)
setPlayerStorageValue(cid, a, 1)
doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da sua arma para ".. param .. ".")
else
doPlayerSendTextMessage(cid, 28, "Desculpe, mais você precisa ter a ".. getItemNameById(id) .. " para trocar o elemento.")
end
return true
end
Lua:
local min, max = 1700,1900 --Ataque mínino e ataque máximo
local w = {
[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
[3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE},
[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
[5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
[6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE},
[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}
function onUseWeapon(cid, var)
local effect = getPlayerStorageValue(cid, 4561)
local target = getCreatureTarget(cid)
if target ~= 0 then
local wx = w[effect] or w[math.random(#w)]
doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
end
return true
end
Lua:
local config = {
wand_id = 7424, --ID da wand
types = {
["all"] = -1, --Ataca os elementos aleatoriamente
["fire"] = 1,
["ice"] = 2,
["poison"] = 3,
["death"] = 4,
["energy"] = 5,
["physical"] = 6,
["holy"] = 7
}
}
function onSay(cid, words, param)
local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
if wand_left ~= config.wand_id and wand_right ~= config.wand_id then
doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(config.wand_id) .." para usar este comando.")
return true
end
if config.types[param] then
setPlayerStorageValue(cid, 4561, config.types[param])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sua wand ira atacar ".. param .. ".")
else
local str = ""
for i, _ in pairs(config.types) do
str = str .. ", ".. i
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Os elementos disponiveis sao: ".. string.sub(str, 3, #str) ..".")
end
return true
end
Last edited: