
aoliveira
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
aoliveira deu reputação a Markin em [Talkaction] Reparar soft e firewalker boots.Sei que é dois scripts insignificantes, ja deve ter aqui seila, mais eu fiz pro meu ot e vo deixar aqui se alguem precisar.
primeiro vai em talkactions/scripts crie um arquivo .lua e renomeio para soft (soft.lua) e adicione isso dentro:
function onSay(cid, words, param) if getPlayerItemCount(cid,10021) >= 1 then if getPlayerItemCount(cid,2160) >= 5 then doPlayerRemoveItem(cid, 10021,1) doPlayerRemoveItem(cid, 2160,5) doPlayerAddItem(cid, 6132,1) doPlayerSendTextMessage(cid, 18, "You repaired soft for 50k!") doSendMagicEffect(getCreaturePosition(cid),29) else doPlayerSendTextMessage(cid, 18, "You need 50k for repair soft boots.") end else doPlayerSendTextMessage(cid, 18, "You need one pair of worn soft boots for repair.") end return TRUE end agora em talkactions.xml adicione a tag: <talkaction words="!soft" event="script" value="soft.lua"/> Primeiro script ok. ------------------------------------------------------------------ Agora o da firewalker boots. Em talkactions/scripts crie um arquivo .lua e renomeio para firewalker (firewalker.lua) e adicione isso dentro: function onSay(cid, words, param) if getPlayerItemCount(cid,10022) >= 1 then if getPlayerItemCount(cid,2160) >= 5 then doPlayerRemoveItem(cid, 10022,1) doPlayerRemoveItem(cid, 2160,5) doPlayerAddItem(cid, 9933,1) doPlayerSendTextMessage(cid, 18, "You repaired firewalker boots for 50k!") doSendMagicEffect(getCreaturePosition(cid),29) else doPlayerSendTextMessage(cid, 18, "You need 50k for repair firewalker boots.") end else doPlayerSendTextMessage(cid, 18, "You need one pair of worn firewalker boots for repair.") end return TRUE end em talkactions.xml adicione a seguinte tag: <talkaction words="!firewalker" event="script" value="firewalker.lua"/>
bye ;*
-
aoliveira deu reputação a tigerx2 em [Talkaction] !aol elaboradoTodo ot apelado ou global precisa desse comando, mas o meu eh um pouco melhor T.T
Em talkactions/scripts:
local config = {
level = 10, -- level minimo
price = 10000, -- preço unidade
effect = CONST_ME_POFF, -- efeito ao comprar aol
id = 2173 -- id do item comprado (aol no caso)
}
function onSay(cid, words, param)
if param == "" and doPlayerRemoveMoney(cid,config.price)and getPlayerLevel(cid) >= config.level then
doPlayerAddItem(cid, config.id)
doSendMagicEffect(getThingPos(cid), config.effect)
elseif not isNumeric(param) or tonumber(param) < 0 then
doPlayerSendCancel(cid, "Command positive numeric param is required.")
else
local config2 = {
error = "You do not have enought level "..config.level.." or money ("..config.price*param.."gps)",
msg = "You bought "..param.." amulet of loss, it costs "..(tonumber(param)*config.price).."gps."
}
if getPlayerLevel(cid) >= config.level and doPlayerRemoveMoney(cid, config.price*tonumber(param)) then
doSendMagicEffect(getThingPos(cid), config.effect)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config2.msg)
for i = 1,param do
doPlayerAddItem(cid, config.id, 1)
end
else
doPlayerSendCancel(cid, config2.error)
end
end
return true
end[/PHP]
Talkactions.xml:
[PHP]<talkaction words="!aol;/aol" event="script" value="aol.lua"/>
Obs: Esse script nao eh do lá aquelas coisas mas me ensinou algumas coisas (:
Obs2: Faz um tempo legal que fiz esse script.
-
aoliveira deu reputação a ViitinG em [creaturescripts] Recompensa por level para X vocationsPara quem não sabe como funciona o script : Cada vocation ao atingir X level ganha uma X recompensa(podendo ganhar mais de um item por level).
• Adicionando o script •
Em "data/creaturescripts/scripts/vocreward.lua" :
local c = { [{1,5}] = { [13] = {items = {{itemid = 2191, count = 1}}, storage = 40953}, [19] = {items = {{itemid = 2188, count = 1}}, storage = 40954}, [22] = {items = {{itemid = 8921, count = 1}}, storage = 40955}, [26] = {items = {{itemid = 2189, count = 1}}, storage = 40956}, [33] = {items = {{itemid = 2187, count = 1}, {itemid = 2152, count = 25}}, storage = 40957}, [37] = {items = {{itemid = 8920, count = 1}, {itemid = 2152, count = 50}}, storage = 40958}, [42] = {items = {{itemid = 8922, count = 1}, {itemid = 2160, count = 1}}, storage = 40959} }, [{2,6}] = { [13] = {items = {{itemid = 2186, count = 1}}, storage = 40953}, [19] = {items = {{itemid = 2185, count = 1}}, storage = 40954}, [22] = {items = {{itemid = 8911, count = 1}}, storage = 40955}, [26] = {items = {{itemid = 2181, count = 1}}, storage = 40956}, [33] = {items = {{itemid = 2183, count = 1}, {itemid = 2152, count = 25}}, storage = 40957}, [37] = {items = {{itemid = 8912, count = 1}, {itemid = 2152, count = 50}}, storage = 40958}, [42] = {items = {{itemid = 8910, count = 1}, {itemid = 2160, count = 1}}, storage = 40959} }, [{3,7}] = { [12] = {items = {{itemid = 2389, count = 5}}, storage = 40953}, [16] = {items = {{itemid = 2389, count = 10}}, storage = 40954}, [20] = {items = {{itemid = 3965, count = 10}}, storage = 40955}, [25] = {items = {{itemid = 7378, count = 10}}, storage = 40956}, [30] = {items = {{itemid = 2456, count = 1}, {itemid = 2544, count = 100}}, storage = 40957}, [35] = {items = {{itemid = 7364, count = 100}, {itemid = 2152, count = 75}}, storage = 40958}, [40] = {items = {{itemid = 7365, count = 100}, {itemid = 2160, count = 1}}, storage = 40959} }, [{4,8}] = { [15] = {items = {{itemid = 2409, count = 1}}, storage = 40953}, [30] = {items = {{itemid = 2392, count = 1}, {itemid = 2152, count = 75}}, storage = 40957}, [40] = {items = {{itemid = 2407, count = 1}, {itemid = 2160, count = 1}}, storage = 40959} } } function onAdvance(cid, skill, oldlevel, newlevel) if skill ~= SKILL__LEVEL then return true end for voc, x in pairs(c) do if isInArray(voc, getPlayerVocation(cid)) then for level, z in pairs(x) do if newlevel >= level and getPlayerStorageValue(cid, z.storage) ~= 1 then local text = "" for v = 1, #z.items do count, info = z.items[v].count, getItemInfo(z.items[v].itemid) local ret = ", " if v == 1 then ret = "" elseif v == #z.items then ret = " and " end text = text .. ret text = text .. (count > 1 and count or info.article).." "..(count > 1 and info.plural or info.name) doPlayerAddItem(cid, z.items[v].itemid, z.items[v].count) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens, voce alcancou o level "..level.." e obteve "..text..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW) setPlayerStorageValue(cid, z.storage, 1) end end end end return true end Em "data/creaturescripts/creaturescripts.xml" :
<event type="advance" name="VocReward" event="script" value="vocreward.lua"/> Em "data/creaturescripts/scripts/login.lua" :
registerCreatureEvent(cid, "VocReward") • Configurando •