TekaZudo
seuserver.com.br
DESCRIÇÃO
Anuncie aqui neste countdown e dê maior visibilidade ao seu lançamento |
Full Global • Custom Quests • Custom Outfits • Lottery System • Version 15x
Inicia em:
--
Participar
Solutions
-
.Foxxy's post in (Resolvido)[RESOLVIDO] Função de healar mana e life quando upa não funciona was marked as the answer@DiegoRulez Testei, mas ficou na mesma que o script anterior, sem erro na distro mas não funciona.
EDIT:
Problema resolvido seguindo as instruções do Membro @Cleiton Felipi em um outro post.
-
.Foxxy's post in (Resolvido)[Resolvido] - NPCs Aceitando Outro Gold was marked as the answerBoa Tarde @davidguimaraesdrum , acredito que dê pra fazer sem alterar nada na source, testa ai, mas antes , faça um BACKUP de todos os arquivos que você irá alterar.
No meu otserv eu possuo uma moda que equivale a 1kk (gold nugget), você precisará fazer alguns passos para que o npc aceite ela como novo gold, vamo lá:
OBS: Se você já fez algum desses processos, pode pular, acredito que pra vc só falta adicionar a tag do 4º passo, mas vou deixar completo caso alguém tenha duvida ou até você mesmo.
1º procure pelo arquivo chamado changegold.lua (provavelmente estará em /data/action/scripts/other), faça um backup desse arquivo, apague tudo de dentro dele e adicione:
local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_LIGHTBLUE
},
[9971] = {
from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
local coin = coins[item.itemid]
if(not coin) then
return false
end
if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, coin.to, 1)
doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
end
return true
end
2º vá em /data/action/scripts e crie um arquivo chamado novamoeda.lua e cole isso:
function onUse(cid, item, frompos, item2, topos)
if doRemoveItem(item.uid,1) then
doPlayerSendTextMessage(cid,22,"Voce trocou 1 gold ingot por 1kk.")
doPlayerAddItem(cid,2160,100)
end
end
3º adicione essa tag em data/action.xml
<action itemid="9971" script="novamoeda.lua" />
4º vá em items.xml, procure pelo id 9971 e adicione esta tag:
<attribute key="worth" value="1000000" />
ficará assim:
</item>
<item id="9971" article="a" name="gold ingot">
<attribute key="weight" value="10"/>
<attribute key="worth" value="1000000" />
creio que após isso, qualquer npc reconhecerá ela como uma moeda equivalente a 1kk, essa ultima função em item.xml é que indica o valor.
Se ajudei, REP+ haha
-
.Foxxy's post in (Resolvido)[[[ Save Player ]]]] was marked as the answer@Sekk e @Vitoxy , achei um script funcional aqui:
em creaturescripts/scripts crie "saveplayer.lua" e cole isso dentro:
local save = {}
function saveRepeat(cid)
if not isPlayer(cid) then return true end
doPlayerSave(cid)
doPlayerSendTextMessage(cid,19, 'Your character\'s progress is saved.')
doSendMagicEffect(getThingPos(cid), 11)
save[cid] = addEvent(saveRepeat, math.random(1,1) *60*1000, cid)
end
function onLogin(cid)
save[cid] = addEvent(saveRepeat, math.random(1,1)*60*1000, cid)
return true
end
function onLogout(cid)
stopEvent(save[cid])
return true
end
em creaturescripts.xml adicione as tag's:
<event type="login" name="savePlayer" event="script" value="savePlayer.lua" />
<event type="logout" name="savePlayer_L" event="script" value="savePlayer.lua" />
em creaturescripts/scripts/login.lua, cole isso antes do ultimo "return true":
registerCreatureEvent(cid, "savePlayer")
registerCreatureEvent(cid, "savePlayer_L")
Funcionando perfeitamente no TFS 0.3.6 - 8.54/8.60
Obrigado pela ajuda!!! Tmj!