
Tudo que Wise postou
-
(Resolvido)Aol Duração 30 Death
Testei desse modo. As charges bugaram e deixaram o item infinito, por isso não indiquei essas tags.
-
(Resolvido)Red Aol?
function onDeath(cid) redaol = {2173, 100} stor = 98765 slot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE) if slot.itemid == redaol[1] and getCreatureSkullType(cid) == SKULL_RED then if getPlayerStorageValue(cid, stor) < 1 then setPlayerStorageValue(cid, stor, redaol[2] - 1) elseif getPlayerStorageValue(cid, stor) == 1 then setPlayerStorageValue(cid, stor, -1) doRemoveItem(slot.uid) else setPlayerStorageValue(cid, stor, getPlayerStorageValue(cid, stor) - 1) end end return true end Não se esqueça de registrar o creature event death em login.lua Não precisa adicionar as charges, pode retirar a tag se quiser. Apenas certifique-se de que há a seguinte tag no seu red aol em items.xml: <attribute key="preventDrop" value="1" />
-
(Resolvido)Aol Duração 30 Death
Tente: function onDeath(cid) aol = 2173 slot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE) if slot.itemid == aol and getItemAttribute(slot.uid, 'charges') == 1 then doRemoveItem(slot.uid) end return true end PS: Não se esqueça de registrar o creature event death em login.lua Se não obtiver sucesso, outro método possível seria por storage: function onDeath(cid) aol = {2173, 30} stor = 76543 slot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE) if slot.itemid == aol[1] then if getPlayerStorageValue(cid, stor) < 1 then setPlayerStorageValue(cid, stor, aol[2] - 1) elseif getPlayerStorageValue(cid, stor) == 1 then setPlayerStorageValue(cid, stor, -1) doRemoveItem(slot.uid) else setPlayerStorageValue(cid, stor, getPlayerStorageValue(cid, stor) - 1) end end return true end Novamente: Não se esqueça de registrar o creature event death em login.lua Certifique-se de que há a seguinte tag no seu amulet of loss em items.xml (por precaução): <attribute key="preventDrop" value="1" />
-
Correção, e pedido...?
Bom, eu fiz pra como sendo outra talkaction. Você não disse que queria assim no seu post principal. Por isso, tente ser mais específico. Depois edito.
- (Resolvido)Erro no distro, ao exitar em non pvp e pvp
- (Resolvido)Erro no distro, ao exitar em non pvp e pvp
-
level minimo war
@danihcv Tente: function onDeath(cid) lvl = 1000 if getPlayerLevel(cid) < lvl then doPlayerAddExperience(cid, (getExperienceForLevel(lvl) - getPlayerExperience(cid))) end return true end
-
Correção, e pedido...?
Tente: function onSay(cid) text = 'Information about frags\n\nFrags to Red Skull:\nDaily - '..getConfigValue('fragsToRedSkull')..' frags\nWeekly - '..getConfigValue('fragsSecondToRedSkull')..' frags\nMonthly - '..getConfigValue('fragsThirdToRedSkull')..' frags\n\nFrags to Black Skull:\nDaily - '..getConfigValue('fragsToBlackSkull')..' frags\nWeekly - '..getConfigValue('fragsSecondToBlackSkull')..' frags\nMonthly - '..getConfigValue('fragsThirdToBlackSkull')..' frags' doPlayerPopupFYI(cid, text) return true end
-
[PEDIDO] Quest Log.xml
É exatamente essa a utilidade do quests.xml (data\XML), fazer esse armazenamento de informações/valores e exibir a quest conforme for estipulada.
-
(Resolvido)[AJUDA] Configurar quantidade alavanca.
Com certeza, @Gantz. Eu só falei pra ele mesmo, caso seja assim.
-
(Resolvido)[AJUDA] Configurar quantidade alavanca.
Caso for adicionar somente um item, simplifique. Estabeleça a tabela anterior e mude os parâmetros da função doPlayerAddItem para: doPlayerAddItem(cid, lever[item.actionid][2], 1)
-
(Resolvido)[PROBLEMA] Area of Effect
Funções e callbacks, principalmente.
-
(Resolvido)[Pedido] Ver Mana do Player
Desconsidere, respirei pouco haha
-
(Resolvido)[PROBLEMA] Area of Effect
Como o @xWhiteWolf disse, caso seu servidor tenha o creature event statschange: function onStatsChange(cid, attacker, type, combat, value) storage = 12345 if value > 0 and type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS) then if isPlayer(attacker) and getPlayerStorageValue(attacker, storage) == getPlayerStorageValue(cid, storage) then return false end end return true end Senão: local storage = 12345 function onCombat(cid, target) if isPlayer(target) and getPlayerStorageValue(target, storage) == getPlayerStorageValue(cid, storage) then return false end return true end function onAttack(cid, target) if isPlayer(target) and getPlayerStorageValue(target, storage) == getPlayerStorageValue(cid, storage) then return false end return true end function onTarget(cid, target) if isPlayer(target) and getPlayerStorageValue(target, storage) == getPlayerStorageValue(cid, storage) then return false end return true end PS: não se esqueça de registrar os creature events em login.lua
-
[DUVIDA] Como criar quest grande?
monsterportal.lua (data\creaturescripts\scripts): local boss = { ['ghazbaran'] = {destiny = {x=123, y=456, z=7}, time = 50, portalid = 1387}, -- time in seconds ['morgaroth'] = {destiny = {x=123, y=456, z=7}, time = 50, portalid = 1387}, ['apocalypse'] = {destiny = {x=123, y=456, z=7}, time = 50, portalid = 1387} } function removePortal(pos, pid) portal = getTileItemById(pos, pid) if portal.uid > 0 then doRemoveItem(portal.uid) end return true end function onDeath(cid) b = boss[getCreatureName(cid):lower()] pos = getCreaturePosition(cid) if b then doSendMagicEffect(pos, CONST_ME_TELEPORT) doCreateTeleport(b.portalid, b.destiny, pos) addEvent(removePortal, b.time*1000, pos, b.portalid) doCreatureSay(cid, 'Fast, the portal will disappear in '..b.time..'!!', TALKTYPE_ORANGE_1) end return true end Tag - creaturescripts.xml (data\creaturescripts): <event type="death" name="MonsterPortal" event="script" value="monsterportal.lua"/> Registre o creature event no(s) arquivo(s) XML do(s) monstro(s) configurado(s) na tabela do creaturescript: <script> <event name="MonsterPortal"/> </script>
-
(Resolvido)[DUVIDA] Alterações nos scripts de outras versões
Não há local com mais garantia de se encontrar essas informações, do que em sua source.
-
AutoEquipar clickando em um Item[AJUDA]
Se você fizer isso, vai simplesmente abri-la, já que é um container. Talvez seja possível, com grandes alterações.
-
(Resolvido)[Pedido] Ver Mana do Player
Não atualizou aqui, desculpe.
-
(Resolvido)Pedido EXIT SIMPLES
Esses erros indicam que você não estipulou o nome do arquivo corretamente, na tag ou no próprio nome do arquivo Lua mesmo. Verifique e iguale-os. ~ Melhor, faz de um modo mais simples: kicktile.lua (data\movements\scripts): function onStepIn(cid) time = 1 -- in minutes addEvent(function() if isCreature(cid) then doRemoveCreature(cid) end end, time * 60 * 1000) return true end Tag - movements.xml (data\movements): <movevent type="StepIn" actionid="54321" event="script" value="kicktile.lua"/>
-
(Resolvido)[PEDIDO] Modificando o Exiva
Já na source, em game.cpp: Procure por: switch(direction) { case DIR_N: ss << "north"; break; case DIR_S: ss << "south"; break; case DIR_E: ss << "east"; break; case DIR_W: ss << "west"; break; case DIR_NE: ss << "north-east"; break; case DIR_NW: ss << "north-west"; break; case DIR_SE: ss << "south-east"; break; case DIR_SW: ss << "south-west"; break; default: break; } Substitua por: switch(direction) { case DIR_N: ss << "north [/\]"; break; case DIR_S: ss << "south [\/]"; break; case DIR_E: ss << "east [>]"; break; case DIR_W: ss << "west [<]"; break; case DIR_NE: ss << "north-east [/\][>]"; break; case DIR_NW: ss << "north-west [/\][<]"; break; case DIR_SE: ss << "south-east [\/][>]"; break; case DIR_SW: ss << "south-west [\/][<]"; break; default: break; }
-
(Resolvido)Pedido EXIT SIMPLES
Relaxa. Confira se fez tudo certo no creature script que eu fiz, pois não vejo erros. Enquanto ao que você pediu uma explicação. Códigos do membro Gantz. kicktile.lua (data\movements\scripts): kick_time = 60 function kick_time_by_pos(cid, ml, kicktime, postile) if not isCreature(cid) then return true end if ml == kicktime then return doRemoveCreature(cid) end if getThingPos(cid).x ~= postile.x or getThingPos(cid).y ~= postile.y or getThingPos(cid).z ~= postile.z then return true end addEvent(kick_time_by_pos, 1, cid, ml+1, kicktime, postile) return true end function onStepIn(cid, item, position, fromPosition) return kick_time_by_pos(cid, 0, kick_time * 10000, position) end Tag - movements.xml (data\movements): <movevent type="StepIn" actionid="65432" event="script" value="kicktile.lua"/> Adicione o action ID 65432 ao tile, fim.
-
(Resolvido)Pedido EXIT SIMPLES
Fez tudo correto? O kicktime é em minutos, então no caso, você teria de esperar os 10 minutos no tile com o action ID 54321 para ser "kickado". O action ID você determina na tag, em movements.xml <movevent type="StepIn" actionid="ACTIONID" event="script" value="FILENAME.lua"/> E sim, são 60 segundos.
-
(Resolvido)problema com tabelas
@xWhiteWolf Obrigado mais uma vez.
-
(Resolvido)sqm com trap
Disponha ;] Vou dar uma olhada nele depois. Se o pedido foi atendido, por favor clique no botão que está localizado abaixo do post de quem te ajudou. Automaticamente ele irá ficar destacado como a melhor resposta e o tópico ficará com o prefixo "Resolvido" no início do título.
-
(Resolvido)problema com tabelas
Ficou um pouco confuso, mas vou fazer como entendi você. Tente o seguinte. Adicione o player guid (player ID) à tabela e faça dos valores uma string (pegando os nomes dos players pelos guids), pra ser enviada como uma lista de nomes na talkaction. Ex: table.insert(players_id, getPlayerGUID(cid)) function onSay(cid) if #players_id > 0 then list = '' for i = 1, #players_id do name = players_id[i] list = list.. getPlayerNameByGUID(name) ..'' if i ~= #players_id then list = list ..', ' else list = list ..'.' end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Name of the players in the table: '.. list) else doPlayerSendCancel(cid, 'There are no elements in the table.') end return true end