Histórico de Curtidas
-
Bolletox recebeu reputação de Master68 em [Erro] - alavanca addon@Master68 Antes disso
if player:getStorageValue(10001) == -1 then Coloque isso local player = Player(player)
-
Bolletox recebeu reputação de bpm91 em bota de areia@bpm91 Veja se é assim que voce quer
local speedGain = 10000 -- speed que o player irá ganhar local sands = {231,104} -- Id das areias local id_boot = 2643 -- ID da boots function onStepIn(cid, item, position, fromPosition) if(isInArray(sands, item.itemid)) then if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then doChangeSpeed(cid, speedGain) end else return false end return true end function onStepOut(cid, item, position, fromPosition) if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= id_boot then if (getCreatureSpeed(cid) > getCreatureBaseSpeed(cid)) then doChangeSpeed(cid, -speedGain) end else return false end return true end
XML
<movevent type="StepIn" itemid="231;104" event="script" value="botaAreia.lua"/> <movevent type="StepOut" itemid="231;104" event="script" value="botaAreia.lua"/>
Lembre de adicionar os ids do tile no itemid do XML no StepIn e StepOut.
-
Bolletox recebeu reputação de Mathias Kenfi em (Resolvido)Teleport que remove storage@bpm91 Tenta ai
function onStepIn(cid, item) local storages = {1991,1992,1993,1994,1995,1996,1997} -- Storages aqui if (isPlayer(cid)) then for i=1,#storages do if (getPlayerStorageValue(cid, storages[i]) >= 1) then setPlayerStorageValue(cid, storages[i], -1) end end end end
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Teleport que remove storage@bpm91 Veja se funciona, não testei
Crie arquivo chamado tpStorages.lua em data/moveevents
function onStepIn(cid, item) local storages = {1001,1002,1003,1004,1005,1006,1007,1008} -- Storages que serão removidos if isPlayer(cid) then for i = 1, #storages do setPlayerStorageValue(cid, i, 0) end end return true end
XML
<movevent type="StepIn" actionid="8887" event="script" value="tpStorages.lua"/>
Adicione a actionid 8887 no teleport
-
Bolletox recebeu reputação de Vandrow em (Resolvido)Ao invés de Curar, Danificar.@Vandrow
Veja se funciona, eu nao testei
local pos={ {x=33036, y=32813, z=9}, {x=33038, y=32813, z=9}, {x=0, y=0, z=0}} function onThink(interval) for _, v in pairs(pos) do doSendMagicEffect(v,13) doSendAnimatedText(v, '', 30) doCombatAreaHealth(cid, 1, v, {1}, -200, -200, 12) end return true end
-
Bolletox recebeu reputação de KotZletY em (Resolvido)Alavanca e Teleport@bpm91 Veja se agora vai, eu coloquei todos os scripts dos camps em 1 script apenas. Creio que agora vai funcionar.
Crie 1 script só chamado bansheeQuest.lua e coloque isso dentro:
No XML cole isso lá:
Em moveevents crie script chamado fogoAzul.lua:
XML em moveevents coloque este:
-
Bolletox recebeu reputação de KotZletY em (Resolvido)Alavanca e Teleport@bpm91 Veja ai se vai
function onStepIn(cid, item, frompos, item2, topos) playerpos = getPlayerPosition(cid) novapos2 = {x = 32216, y = 31833, z = 15} novapos3 = {x = 32217, y = 31840, z = 15} if item.actionid == 9020 and isPlayer(cid) then queststatus = getPlayerStorageValue(cid, 9012) if queststatus == -1 then getThingfromPos(playerpos) setPlayerStorageValue(cid, 9012, 1) doSummonCreature("Warlock", novapos2) doSummonCreature("Warlock", novapos3) end return false end return true end
-
Bolletox recebeu reputação de KotZletY em (Resolvido)Alavanca e Teleport@bpm91 Acho que é isso
local positionCurrent = {x=32268, y=31856, z=15} -- Posicao para onde o player vai se estiver correto a sequencia local positionFail = {x=32184, y=31940, z=14} -- Posicao que o player vai se estiver errada a combinacao if isPlayer(cid) and getPlayerStorageValue(cid,42501) <= -1 then doTeleportThing(cid, positionCurrent) doSendMagicEffect(getThingPos(cid), 12) setPlayerStorageValue(cid,32901,1) setPlayerStorageValue(cid,42501,1) else doTeleportThing(cid, positionFail) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.") end return 0 end
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Alavanca e TeleportTeste ai pra ver se vai, caso nao for explique um pouco melhor como funciona o script pra eu pensar de outro jeito.
Script do fogo apagado
function onUse(cid, item, fromPosition, itemEx, toPosition) --FOGO OFF local gatepos = {x=32313, y=31976, z=13, stackpos=1} --Pos do Campfire que nao acende local getgate = getThingfromPos(gatepos) local time = 300 -- 60 = 1min -- Time para acender denovo local f = function(p) doTransformItem(getTileItemById(p, 1946).uid, 1945) doCreateItem(1423,1,gatepos) end if item.itemid == 1945 and item.uid == 43995 and getTileItemById(gatepos, 1423).uid > 0 then doRemoveItem(getTileItemById(gatepos, 1423).uid) doCreateItem(1421, gatepos) doTransformItem(item.uid, item.itemid+1) e = addEvent(f, time * 1000, fromPosition) else if item.itemid == 1946 and item.uid == 43995 and getTileItemById(gatepos, 1421).uid > 0 then doRemoveItem(getTileItemById(gatepos, 1421).uid) doCreateItem(1423, gatepos) doTransformItem(item.uid,item.itemid-1) stopEvent(e) e = 0 end end return 1 end Script do fogo aceso
function onUse(cid, item, fromPosition, itemEx, toPosition) --FOGO ON local gatepos = {x=32313, y=31975, z=13, stackpos=1} --Pos do Campfire que Acende local getgate = getThingfromPos(gatepos) local time = 300 -- 60 = 1min -- Time para acender denovo local f = function(p) doTransformItem(getTileItemById(p, 1946).uid, 1945) doCreateItem(1423,1,gatepos) end if item.itemid == 1945 and item.uid == 43994 and getTileItemById(gatepos, 1423).uid > 0 then doRemoveItem(getTileItemById(gatepos, 1423).uid) doCreateItem(1421, gatepos) doTransformItem(item.uid, item.itemid+1) e = addEvent(f, time * 1000, fromPosition) else if item.itemid == 1946 and item.uid == 43994 and getTileItemById(gatepos, 1421).uid > 0 then doRemoveItem(getTileItemById(gatepos, 1421).uid) doCreateItem(1423, gatepos) doTransformItem(item.uid,item.itemid-1) stopEvent(e) e = 0 end end return 1 end Script Fogo Azul
function onStepIn(cid, item, fromPosition, toPosition) local positionCurrent = {x=160, y=54, z=7} -- Posicao para onde o player vai se estiver correto a sequencia local positionFail = {x=160,y=54,z=7} -- Posicao que o player vai se estiver errada a combinacao --#--Posicões das alavancas--#-- switch1 = {x=32310, y=31975, z=13, stackpos=1} switch2 = {x=32310, y=31976, z=13, stackpos=1} switch3 = {x=32312, y=31975, z=13, stackpos=1} switch4 = {x=32312, y=31976, z=13, stackpos=1} switch5 = {x=32314, y=31975, z=13, stackpos=1} switch6 = {x=32314, y=31976, z=13, stackpos=1} getswitch1 = getThingfromPos(switch1) getswitch2 = getThingfromPos(switch2) getswitch3 = getThingfromPos(switch3) getswitch4 = getThingfromPos(switch4) getswitch5 = getThingfromPos(switch5) getswitch6 = getThingfromPos(switch6) --#--------------------------#-- if isPlayer(cid) then if getswitch1.itemid == 1946 and getswitch2.itemid == 1946 and getswitch3.itemid == 1946 and getswitch4.itemid == 1946 and getswitch5.itemid == 1945 and getswitch6.itemid == 1945 then doTeleportThing(cid, positionCurrent) doSendMagicEffect(getThingPos(cid), 12) setPlayerStorageValue(cid,10004,1) setPlayerStorageValue(cid, 10004, 1) else doTeleportThing(cid, positionFail) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.") end end return 0 end
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Alavanca e Teleport@bpm91 Acho que é isso
local positionCurrent = {x=32268, y=31856, z=15} -- Posicao para onde o player vai se estiver correto a sequencia local positionFail = {x=32184, y=31940, z=14} -- Posicao que o player vai se estiver errada a combinacao if isPlayer(cid) and getPlayerStorageValue(cid,42501) <= -1 then doTeleportThing(cid, positionCurrent) doSendMagicEffect(getThingPos(cid), 12) setPlayerStorageValue(cid,32901,1) setPlayerStorageValue(cid,42501,1) else doTeleportThing(cid, positionFail) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.") end return 0 end
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Alavanca e Teleport@bpm91 Veja ai se vai
function onStepIn(cid, item, frompos, item2, topos) playerpos = getPlayerPosition(cid) novapos2 = {x = 32216, y = 31833, z = 15} novapos3 = {x = 32217, y = 31840, z = 15} if item.actionid == 9020 and isPlayer(cid) then queststatus = getPlayerStorageValue(cid, 9012) if queststatus == -1 then getThingfromPos(playerpos) setPlayerStorageValue(cid, 9012, 1) doSummonCreature("Warlock", novapos2) doSummonCreature("Warlock", novapos3) end return false end return true end
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Alavanca e Teleport@bpm91 Sim.
-
Bolletox recebeu reputação de bpm91 em (Resolvido)Alavanca e Teleport@bpm91 Veja se agora vai, eu coloquei todos os scripts dos camps em 1 script apenas. Creio que agora vai funcionar.
Crie 1 script só chamado bansheeQuest.lua e coloque isso dentro:
No XML cole isso lá:
Em moveevents crie script chamado fogoAzul.lua:
XML em moveevents coloque este:
-
Bolletox recebeu reputação de Cat em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX
Vamos lá:
1° Passo: Vá na pasta data/npc e crie os 5 npcs:
EX do npc que vai dar a Promotion Super
Explicação:
Em Verde vai ser o Nome do Npc.
Em Azul vai ser a palavra-chave que o player vai ter que dizer (Se voce alterar aqui terá que alterar no Script lá).
2° Passo: Depois de Criado os 5 NPC's vá para a pasta data/XML e abra o vocations.xml:
Aqui voce tera que criar as 5 promotions vou deixar um exemplo.
Explicando:
Em Roxo será os ID's das vocações em ordem crescente. Veja qual é o ID da ultima vocação do seu server e vá seguindo em ordem (1,2,3,4,5,6,7,8..).
Em Vermelho você coloca o mesmo ID da vocação. Ex O Super Paladin tem o ID 11 então o fromvoc será o ID 11 também.
Em Laranja será o nome que ira aparecer quando o player der Look.
O resto é meio que auto explicativo o que faz. Se nao souber da uma pesquisada no forum.
3° Passo
Depois de criar os NPC's e as vocações vai na pasta data/npc/scripts e crie um arquivo chamado vocations.lua e cole isso dentro.
Explicando:
[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR}
Em Verde serão os ID da Vocação ATUAL que o Player. Ex: O player é Druid então será o ID 2, veja no XML vocations. (Eu deixei com a vocação normal 1-Sorcerer, 2-Druid,3- Paladin, 4-Knight).
Em Azul é o ID da Vocação que o Player irá ganhar.
Em Vermelho é aquela palavra-chave de quando foi criado os NPC's. (Se você mudou a palavra-chave quando criou o Npc então você terá que mudar aqui também, porque isso sera o que o player terá que dizer para ganhar a promotion).
-
Bolletox recebeu reputação de Cat em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX
Substitua o que esta no arquivo vocations.lua por esse:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function changeVocation(cid) if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 9 or getPlayerVocation(cid) == 13 or getPlayerVocation(cid) == 17 or getPlayerVocation(cid) == 21 or getPlayerVocation(cid) == 25 then return "Sorcerer" end if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 10 or getPlayerVocation(cid) == 14 or getPlayerVocation(cid) == 18 or getPlayerVocation(cid) == 22 or getPlayerVocation(cid) == 26 then return "Druid" end if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 11 or getPlayerVocation(cid) == 15 or getPlayerVocation(cid) == 19 or getPlayerVocation(cid) == 23 or getPlayerVocation(cid) == 27 then return "Paladin" end if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 12 or getPlayerVocation(cid) == 16 or getPlayerVocation(cid) == 20 or getPlayerVocation(cid) == 24 or getPlayerVocation(cid) == 28 then return "Knight" end end local vocStage1 = { --[ID DA VOCATION ATUAL DO PLAYER] = {prom = ID DA VOCACAO QUE O PLAYER VAI GANHAR} --EX: [99] = {promo = 102} [1] = {prom = 9}, [2] = {prom = 10}, [3] = {prom = 11}, [4] = {prom = 12}, } local vocStage2 = { [9] = {prom = 13}, [10] = {prom = 14}, [11] = {prom = 15}, [12] = {prom = 16}, } local vocStage3 = { [13] = {prom = 17}, [14] = {prom = 18}, [15] = {prom = 19}, [16] = {prom = 20}, } local vocStage4 = { [17] = {prom = 21}, [18] = {prom = 22}, [19] = {prom = 23}, [20] = {prom = 24}, } local vocStage5 = { [21] = {prom = 25}, [22] = {prom = 26}, [23] = {prom = 27}, [24] = {prom = 28} } function vocationStage1(cid, message, keywords, parameters, node) if vocStage1[getPlayerVocation(cid)] ~= vocStage1[getPlayerVocation(cid)].prom then doPlayerSetVocation(cid, vocStage1[getPlayerVocation(cid)].prom) selfSay("Voce foi promovido para a classe Super de Promotion!", cid) doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Super " ..changeVocation(cid), MESSAGE_INFO_DESCR) doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN) end end function vocationStage2(cid, message, keywords, parameters, node) if vocStage2[getPlayerVocation(cid)] ~= vocStage2[getPlayerVocation(cid)].prom then doPlayerSetVocation(cid, vocStage2[getPlayerVocation(cid)].prom) selfSay("Voce foi promovido para a classe Hyper de Promotion!", cid) doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Hyper " ..changeVocation(cid), MESSAGE_INFO_DESCR) doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN) end end function vocationStage3(cid, message, keywords, parameters, node) if vocStage3[getPlayerVocation(cid)] ~= vocStage3[getPlayerVocation(cid)].prom then doPlayerSetVocation(cid, vocStage3[getPlayerVocation(cid)].prom) selfSay("Voce foi promovido para a classe Stronger de Promotion!", cid) doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Stronger " ..changeVocation(cid), MESSAGE_INFO_DESCR) doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN) end end function vocationStage4(cid, message, keywords, parameters, node) if vocStage4[getPlayerVocation(cid)] ~= vocStage4[getPlayerVocation(cid)].prom then doPlayerSetVocation(cid, vocStage4[getPlayerVocation(cid)].prom) selfSay("Voce foi promovido para a classe OverPower de Promotion!", cid) doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para OverPower " ..changeVocation(cid), MESSAGE_INFO_DESCR) doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN) end end function vocationStage5(cid, message, keywords, parameters, node) if vocStage5[getPlayerVocation(cid)] ~= vocStage5[getPlayerVocation(cid)].prom then doPlayerSetVocation(cid, vocStage5[getPlayerVocation(cid)].prom) selfSay("Voce foi promovido para a classe Supreme de Promotion!", cid) doBroadcastMessage("O player "..getCreatureName(cid).." foi promovido para Supreme "..changeVocation(cid), MESSAGE_INFO_DESCR) doSendMagicEffect(getThingPos(cid), CONST_ME_SOUND_GREEN) end end local node1 = keywordHandler:addKeyword({'super promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supers?'}) node1:addChildKeyword({'yes'}, vocationStage1, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true}) local node2 = keywordHandler:addKeyword({'hyper promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Hypers?'}) node2:addChildKeyword({'yes'}, vocationStage2, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true}) local node3 = keywordHandler:addKeyword({'stronger promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Strongers?'}) node3:addChildKeyword({'yes'}, vocationStage3, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true}) local node4 = keywordHandler:addKeyword({'overpower promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes OverPowers?'}) node4:addChildKeyword({'yes'}, vocationStage4, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true}) local node5 = keywordHandler:addKeyword({'supreme promote'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer ser promovido para as vocacoes Supremes?'}) node5:addChildKeyword({'yes'}, vocationStage5, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Good Bye.', reset = true}) npcHandler:addModule(FocusModule:new())
-
Bolletox recebeu reputação de Cat em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX Manda seu vocations.xml pra eu dar uma olhada
-
Bolletox recebeu reputação de Cat em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX Tenta esse
<?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="10" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="10" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="10" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="70" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.3" club="1.3" sword="1.3" axe="1.3" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="33" gainhpticks="3" gainhpamount="150" gainmanaticks="2" gainmanaamount="277" manamultiplier="1.1" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="33" gainhpticks="3" gainhpamount="150" gainmanaticks="2" gainmanaamount="277" manamultiplier="1.1" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="10" gainhp="15" gainmana="15" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="250" manamultiplier="1.4" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="10" gainhp="20" gainmana="5" gainhpticks="2" gainhpamount="245" gainmanaticks="2" gainmanaamount="200" manamultiplier="3.0" attackspeed="150" soulmax="210" gainsoulticks="15" fromvoc="4" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="9" name="Super Sorcerer" description="a super sorcerer" needpremium="1" gaincap="10" gainhp="7" gainmana="38" gainhpticks="3" gainhpamount="180" gainmanaticks="2" gainmanaamount="295" manamultiplier="1.2" attackspeed="245" soulmax="210" gainsoulticks="18" fromvoc="9" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="10" name="Super Druid" description="an super druid" needpremium="1" gaincap="10" gainhp="7" gainmana="38" gainhpticks="3" gainhpamount="180" gainmanaticks="2" gainmanaamount="295" manamultiplier="1.2" attackspeed="245" soulmax="210" gainsoulticks="18" fromvoc="10" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="11" name="Super Paladin" description="an super paladin" needpremium="1" gaincap="10" gainhp="20" gainmana="20" gainhpticks="2" gainhpamount="270" gainmanaticks="2" gainmanaamount="265" manamultiplier="1.4" attackspeed="1000" soulmax="210" gainsoulticks="18" fromvoc="11" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.2" shielding="1.2" fishing="1.1" experience="1.0"/> </vocation> <vocation id="12" name="Super Knight" description="a super knight" needpremium="1" gaincap="10" gainhp="22" gainmana="8" gainhpticks="2" gainhpamount="260" gainmanaticks="2" gainmanaamount="210" manamultiplier="3.0" attackspeed="200" soulmax="210" gainsoulticks="18" fromvoc="12" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> </vocations>
-
Bolletox recebeu reputação de Cat em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX
-
Bolletox recebeu reputação de BilauX em (Resolvido)Npc ou item Que muda vocação em piramide - tfs 04@BilauX Tenta esse
<?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="10" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="3" gainhpamount="50" gainmanaticks="3" gainmanaamount="70" manamultiplier="1.1" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="10" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="60" gainmanaticks="3" gainmanaamount="60" manamultiplier="1.4" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="10" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="70" gainmanaticks="3" gainmanaamount="50" manamultiplier="3.0" attackspeed="150" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.3" club="1.3" sword="1.3" axe="1.3" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="33" gainhpticks="3" gainhpamount="150" gainmanaticks="2" gainmanaamount="277" manamultiplier="1.1" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="33" gainhpticks="3" gainhpamount="150" gainmanaticks="2" gainmanaamount="277" manamultiplier="1.1" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="10" gainhp="15" gainmana="15" gainhpticks="2" gainhpamount="250" gainmanaticks="2" gainmanaamount="250" manamultiplier="1.4" attackspeed="150" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="10" gainhp="20" gainmana="5" gainhpticks="2" gainhpamount="245" gainmanaticks="2" gainmanaamount="200" manamultiplier="3.0" attackspeed="150" soulmax="210" gainsoulticks="15" fromvoc="4" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="9" name="Super Sorcerer" description="a super sorcerer" needpremium="1" gaincap="10" gainhp="7" gainmana="38" gainhpticks="3" gainhpamount="180" gainmanaticks="2" gainmanaamount="295" manamultiplier="1.2" attackspeed="245" soulmax="210" gainsoulticks="18" fromvoc="9" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="10" name="Super Druid" description="an super druid" needpremium="1" gaincap="10" gainhp="7" gainmana="38" gainhpticks="3" gainhpamount="180" gainmanaticks="2" gainmanaamount="295" manamultiplier="1.2" attackspeed="245" soulmax="210" gainsoulticks="18" fromvoc="10" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="11" name="Super Paladin" description="an super paladin" needpremium="1" gaincap="10" gainhp="20" gainmana="20" gainhpticks="2" gainhpamount="270" gainmanaticks="2" gainmanaamount="265" manamultiplier="1.4" attackspeed="1000" soulmax="210" gainsoulticks="18" fromvoc="11" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.2" shielding="1.2" fishing="1.1" experience="1.0"/> </vocation> <vocation id="12" name="Super Knight" description="a super knight" needpremium="1" gaincap="10" gainhp="22" gainmana="8" gainhpticks="2" gainhpamount="260" gainmanaticks="2" gainmanaamount="210" manamultiplier="3.0" attackspeed="200" soulmax="210" gainsoulticks="18" fromvoc="12" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> </vocations>
-
Bolletox recebeu reputação de eunaosei123 em (Resolvido)Sistema de Exausted@damiaotorres
function onUse(cid, item, fromPosition, itemEx, toPosition) local porcentagem = math.random(1, 10) local exhausted_seconds = 10 -- Segundos de exhausted local exhausted_storage = 74800 if(os.time() < getPlayerStorageValue(cid, exhausted_storage)) then doSendMagicEffect(fromPosition, CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted".. exhausted_seconds .. " seconds") else doCreatureAddHealth(cid, getCreatureMaxHealth(cid) * (porcentagem / 10)) setPlayerStorageValue(cid, exhausted_storage, os.time() + exhausted_seconds) doSendAnimatedText(getThingPos(cid), "Pérola", 71) doSendMagicEffect(getCreaturePosition(cid), 29) doPlayerSendTextMessage(cid,19, porcentagem.."% do seu hp total foi healado!") doRemoveItem(item.uid, 1) end return true end
-
Bolletox recebeu reputação de Neto340 em (Resolvido)Dungeon Fire RPG - Ajuda -- ATUALIZAÇÃO@Neto340 Não garanto que vá funcionar pois eu testei em server 8.6.
pos_teleport = { createPos = {x=165,y=67,z=7,stackpos=1}, -- posição aonde será criado o teleport toPos = {x=160,y=54,z=7} -- para onde vai levar o player } pos = { -- Posições da pedras, Pedra 1,2,3,4 --Adiciona outra pos ['exemplo_nome'] = {x=XXXXX,y=XXXXX,z=XXXXX} ['pedra1'] = {x=162,y=70,z=7}, ['pedra2'] = {x=164,y=70,z=7}, ['pedra3'] = {x=166,y=70,z=7}, ['pedra4'] = {x=168,y=70,z=7} } local stone_default = 1304 -- ID stone normal local stone_echanted = 1355 -- ID stone encantada local id_item_use = 7760 -- ID do item que vai ser usar (Enchanted Small Ruby) local count = 4 -- Quantidade de Enchanted Small Ruby local time = 3 -- Tempo para voltar as pedras e sumir o teleport local teleport = 1387 -- ID teleport function onUse(cid, item, fromPosition, itemEx, toPosition) if not isPlayer(cid) then return false end if itemEx.uid == 6454 and getPlayerItemCount(cid,id_item_use) >= count then doTransform() doPlayerRemoveItem(cid,id_item_use,count) end end function doTransform() for k,v in pairs(pos) do doTransformItem(getTileItemById(v, stone_default).uid,stone_echanted) end doCreateTeleport(teleport,pos_teleport.toPos,pos_teleport.createPos) addEvent(function() for k,v in pairs(pos) do doTransformItem(getTileItemById(v, stone_echanted).uid,stone_default) end doRemoveItem(getTileItemById(pos_teleport.createPos,teleport).uid,1) doSendMagicEffect(pos_teleport.createPos,10) end,1000 * time) end XML:
<action itemid="7760" event="script" value="stones.lua"/> OBS: Coloque o UNIQUEID da pedra com o numero 6454 para que o script funcione!
-
Bolletox deu reputação a Tadelho em Alvos específicos em spells de área!Conforme tive uma dúvida outro dia, consegui obter uma solução satisfatória e, sabendo que pode ser a dúvida de mais gente, resolvi compartilhar na forma deste pequeno tutorial.
A ideia é muito simples: fazer com que uma spell de área atinga apenas alguns alvos conforme uma característica específica. Isso pode ser bastante útil para diversas ideias, além do script base servir para tantos outros efeitos interessantes.
Atenção, fiz os scripts para: TFS 0.4.0
Teremos como base para esse exemplo a magia "divine caldera", o famoso "exevo mas san".
Nela teremos o seguinte script:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 4, 6) local area = createCombatArea(AREA_CIRCLE3X3) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end
Desta forma, a magia atingirá todos os alvos em sua área de alcance. Mas queremos mudar isso, queremos que ela atinja alvos específicos, e aqui entram algumas ideias, por exemplo: podemos fazer com que ela acerte apenas players de um determinado level, players de uma determinada vocação, players com um determinado access, ou mesmo uma storage, ou ainda, como no exemplo que darei a seguir, fazer com que a magia acerte apenas alvos com um determinado nome (no caso, serão criaturas e não players).
Para isso, utilizaremos uma função, "onTargetCreature(cid, target)" e depois a chamaremos como parâmetro de um "setCombatCallback(combat, key, function_name)".
Na função onTargetCreature nós faremos a verificação desejada. Por exemplo, no código a seguir eu quero que a minha spell atinja apenas criaturas com o nome de "rat" ou "cave rat", então ficaria assim:
function onTargetCreature(cid, target) local creatures = {"rat", "cave rat"} if isMonster(target) and isInArray(creatures, getCreatureName(target)) then doTargetCombatHealth(cid, target, type, min, max, effect) end end Traduzindo: eu criei uma tabela local com os nomes desejados, verifiquei se o alvo era um monstro e se o nome do monstro constava na minha tabela recém criada. Sendo verdadeiro, acionei a função doTargetCombatHealth(cid, target, type, min, max, effect). -- Lembrando que conforme o tipo da sua magia você vai alterar os parâmetros dessa função para que ela tenha as animações e o dano compatíveis com o seu gosto/objetivo.
Outro detalhe é que nesse trecho de código acima é que é feita a verificação que eu desejo. Eu poderia ao invés disso verificar se é um jogador e se a vocação dele tem o id 1 ou 2, por exemplo. Ficaria:
function onTargetCreature(cid, target) local vocations = {1, 2} if isPlayer(target) and isInArray(vocations, getPlayerVocation(target)) then doTargetCombatHealth(cid, target, type, min, max, effect) end end Ou verificar um level, para que a magia só funcione em alvos acima do level X, etc. Exemplo:
function onTargetCreature(cid, target) local level = 80 if isPlayer(target) and getPlayerLevel(target) >= 80 then doTargetCombatHealth(cid, target, type, min, max, effect) end end
Feita a função, faremos aquilo que mencionei: a chamaremos como parâmetro da função "setCombatCallback" para o nosso "combat". Fica assim:
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
Feito isso, pronto! Basta chamarmos a spell normalmente.
Exemplo de tudo pronto para uma magia "exevo mas san" que só acerte os ratos e tira de 10 a 20 de vida:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA) local area = createCombatArea(AREA_CIRCLE3X3) setCombatArea(combat, area) function onTargetCreature(cid, target) local creatures = {"rat", "cave rat"} if isMonster(target) and isInArray(creatures, getCreatureName(target)) then doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, -10, -20, CONST_ME_HOLYAREA) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Agora é com a criatividade de vocês!
Até a próxima!