Solutions
-
Adriano SwaTT's post in (Resolvido)Erro nas portas com chaves was marked as the answerBoa tarde,
Em resumo quer que funcione como uma porta na vida real.
Ao usar a chave ela destranca e abre, ao usar a chave nela aberta ela fecha e tranca, ao fechá-la clicando diretamente nela, ela fecha mas não precisa usar chave para abrir novamente, ao usar chave nela fechada e destrancada, apenas trancá-la..
Segue o code.
local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) end local function doorEnter(cid, item, toPosition) doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) end function onUse(cid, item, fromPosition, itemEx, toPosition) if (doors[itemEx.itemid]) then if item.actionid > 0 then g = getItemAttribute(item.uid, "charges") if g == 1 then doTransformItem(item.uid, doors[item.itemid]) return TRUE end end end if(fromPosition.x ~= CONTAINER_POSITION and isPlayerPzLocked(cid) and getTileInfo(fromPosition).protection) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then if(gender ~= getPlayerSex(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local skull = item.actionid - 180 if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then if(skull ~= getCreatureSkullType(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local group = item.actionid - 150 if(group >= 0 and group < 30) then if(group > getPlayerGroupId(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return true end if(isInArray(specialDoors, item.itemid)) then if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end return true end if(isInArray(keys, item.itemid)) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then if getItemAttribute(itemEx.uid, "charges") == 1 then doItemSetAttribute(itemEx.uid, "charges", 0) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been locked up a closed door.") return true else doTransformItem(itemEx.uid, doors[itemEx.itemid]) return true end end doPlayerSendCancel(cid, "The key does not match.") return true end get = getDoorOpenBySwatt(cid, toPosition) if get > 0 then porta = getTileItemById(toPosition, get).uid act = getThing(porta).actionid if(item.actionid == act) then doItemSetAttribute(porta, "charges", 0) doTransformItem(porta, getThing(porta).itemid - 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been locked up this door.") return true else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This key isn't of this door.") return true end end return false end if(isInArray(horizontalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then local pzDoorPosition = getTileInfo(doorPosition).protection local pzNewPosition = getTileInfo(newPosition).protection if((pzDoorPosition and not pzNewPosition and doorCreature.uid ~= cid) or (not pzDoorPosition and pzNewPosition and doorCreature.uid == cid and isPlayerPzLocked(cid))) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doItemSetAttribute(item.uid, "charges", 1) doTransformItem(item.uid, item.itemid - 1) return true end if(isInArray(verticalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doItemSetAttribute(item.uid, "charges", 1) doTransformItem(item.uid, item.itemid - 1) return true end if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then if(item.actionid == 0) then doTransformItem(item.uid, doors[item.itemid]) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end return true end return false end function getDoorOpenBySwatt(cid, pos) value = 0 for x = 1, #verticalOpenDoors do if getTileItemById(pos, verticalOpenDoors[x]).uid > 0 then value = verticalOpenDoors[x] end end if value == 0 then for y = 1, #horizontalOpenDoors do if getTileItemById(pos, horizontalOpenDoors[y]).uid > 0 then value = horizontalOpenDoors[y] end end end return value end function getDoorClosedBySwatt(cid, pos) value = 0 for x = 1, #closingDoors do if getTileItemById(pos, closingDoors[x]).uid > 0 then value = closingDoors[x] end end return value end
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Adicionar Tempo Em Cima De TP was marked as the answerBoa noite,
Criei uma função para você, seu code ficará assim:
local tpId = 1387 local tps = { ["RB Goku SSJ4"] = {pos = {x=389, y=250, z=15}, toPos = {x=400, y=250, z=15}, time = 60}, ["RB Vegeta SSJ4"] = {pos = {x=412, y=250, z=15}, toPos = {x=426, y=250, z=15}, time = 60}, ["RB Gohan SSJ4"] = {pos = {x=438, y=250, z=15}, toPos = {x=449, y=250, z=15}, time = 60}, ["RB Trunks SSJ4"] = {pos = {x=461, y=250, z=15}, toPos = {x=377, y=271, z=15}, time = 60}, ["RB Raditz SSJ4"] = {pos = {x=389, y=271, z=15}, toPos = {x=400, y=271, z=15}, time = 60}, ["RB Broly SSJ4"] = {pos = {x=412, y=271, z=15}, toPos = {x=426, y=271, z=15}, time = 60}, ["RB Turles SSJ4"] = {pos = {x=438, y=271, z=15}, toPos = {x=449, y=271, z=15}, time = 60}, ["RB Bardock SSJ4"] = {pos = {x=461, y=271, z=15}, toPos = {x=419, y=232, z=15}, time = 60}, ["RB Gogeta SSJ4"] = {pos = {x=419, y=220, z=15}, toPos = {x=419, y=316, z=15}, time = 60}, ["Porunga"] = {pos = {x=419, y=295, z=15}, toPos = {x=419, y=400, z=13}, time = 60}, ["Fire Guardian1"] = {pos = {x=642, y=718, z=6}, toPos = {x=638, y=718, z=6}, time = 60}, ["Fire Guardian2"] = {pos = {x=636, y=730, z=5}, toPos = {x=636, y=732, z=5}, time = 60}, ["Fire Guardian3"] = {pos = {x=636, y=707, z=5}, toPos = {x=636, y=705, z=5}, time = 60}, ["Hawk"] = {pos = {x=648, y=841, z=3}, toPos = {x=646, y=841, z=3}, time = 60}, ["Warlock"] = {pos = {x=637, y=837, z=3}, toPos = {x=641, y=831, z=1}, time = 60}, ["Titanius"] = {pos = {x=459, y=1080, z=6}, toPos = {x=361, y=1107, z=5}, time = 300}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeTp, tp.time*1000, tp) addEvent(doCreateMonster, tp.time*1001, getCreatureName(cid), tp.pos) doRemainCount(tp.pos, tp.time, "Respawn", math.random(1,255)) end return TRUE end function doRemainCount(pos, tempo, texto, color) -- Created By Adriano Swatt for x = 0, tempo do addEvent(function() if x < tempo then doSendAnimatedText(pos, ""..(tempo - x).."", color) else doSendAnimatedText(pos, ""..texto.."", color) end end, 1000*x) end end
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Addon na Outfit was marked as the answerBoa noite,
Registre o action com a ID do item, conforme costume, e crie o arquivo lua para o referido..
Dar os 2 Addons:
Dar apenas o primeiro addon:
Dê um feedback.
EDITADO: Pequeno detalhe que mesmo já tendo todos addons ele removia o item.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Pedido was marked as the answerBoa noite,
Crie o seu NPC.xml do jeito que preferir e coloque o script abaixo em seu arquivo .lua:
Para configurar caso queira criar mais NPCs do gênero, basta alterar as linhas como mostra abaixo:
local itemID = {id = 12778, count = 2} -- ID do ITEM, Quantidade /&/ Storage de Segurança
local pokeBag = 2394 -- ID da Bag que será adicionada.
Obs: Coloquei "count = 2" para adicionar dois itens, mas pode colocar a quantidade que quiser, que no seu caso será 1.
Obs ²: Para ganhar os itens basta falar "start" ou "help" e confirmar com "yes".
Poste se funcionou corretamente pois não testei.
Abraços e Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[Erro] Configuração Lua + Site + Create Account was marked as the answerTente voltar o config.lua do seu servidor ao original "pvp" e na configuração do site, tente o abaixo:
$worlds = array(); $worlds[0] = array('GER', 'open'); /* $worlds[1] = array('GER', 'optional'); $worlds[2] = array('GER', 'hardcore'); $worlds[3] = array('USA', 'open'); $worlds[4] = array('USA', 'optional'); $worlds[5] = array('USA', 'hardcore'); */ $town = array( 1 => array( "name" => "Styller City", "x" => 160, "y" => 51, "z" => 7 ), );
Boa sorte.
================== EDITED
Basta mudar o que falei, volte seu arquivo ao original e editar como te mostrei.
É simples e não vai bugar o restante do seu site.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[ERRO] Não da o item na quantidade was marked as the answerTente assim:
local ids = {8306} -- ID do item que ganhará 10x local qtdd = 10 -- Quantidade de items ganhará dos declarados acima function onUse(cid, item, frompos, item2, topos) if item.uid == 1621 then queststatus = getPlayerStorageValue(cid,1621) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Voce ganhou seu premio!.") doPlayerAddItem(cid,2160,400) doPlayerAddItem(cid,11388,1) setPlayerStorageValue(cid,1621,1) if #ids == 1 then for i = 1, qtdd do doPlayerAddItem(cid, ids[1], i) end else for x = 1, #ids do for i = 1, qtdd do doPlayerAddItem(cid, ids[x], i) end end end else doPlayerSendTextMessage(cid,22,"Voce ja pegou o bonus") end else return false end return true end
Não testei.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Ring Anti-Paralyze was marked as the answerBoa noite, após alguns testes na distro Alissow 0.3.6...
Segue abaixo:
Primeiramente, precisaremos adicionar um pequeno detalhe à runa paralyze.
Em spells/scripts/support/paralyze rune.lua, adicione as funções em negrito e ficará como abaixo:
Agora em CreatureScripts.xml, adicione a tag abaixo:
<event type="combat" name="RingParalyze" event="script" value="ring_paralyze.lua" />
Agora o script ring_paralyze.lua terá o script abaixo:
Agora em login.lua, adicione a tag abaixo junto com as do gênero:
registerCreatureEvent(cid, "RingParalyze")
Boa sorte.
Aguardo retorno se foi útil.
-
Adriano SwaTT's post in (Resolvido)Anunciar morte was marked as the answerCerto, agora testei e funcionou perfeitamente.
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if not isPlayer(lastHitKiller[1]) and not isPlayer(getCreatureMaster(lastHitKiller[1])) then doBroadcastMessage("O jogador "..getCreatureName(cid).." [level: "..getPlayerLevel(cid).."] acaba de morrer para "..getCreatureName(lastHitKiller[1])..".", MESSAGE_STATUS_CONSOLE_ORANGE) end end return true end Registre em creaturescripts.xml a tag abaixo:
<event type="preparedeath" name="YouDead" event="script" value="youdead.lua"/> E em login.lua a tag:
registerCreatureEvent(cid, "YouDead") Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Uniqueid was marked as the answerBoa tarde,
conforme disse pelo skype, o que pretende fazer não irá ajudar mudando de actions para unique.
E como este pedido é para pedido plenamente particular, não creio que seja necessário postar o mesmo aqui pois não fará efeito para outros membros.
Sem mais,
Até breve.
-
Adriano SwaTT's post in (Resolvido)[Quest] Diaria Reset Storage was marked as the answertente assim:
local config = { premiumDays = 1, storageQuest = 9999, timeWait = 1, -- tempo em dias. staminaRefuel = 3, -- tempo que irá recuperar em horas } function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, config.storageQuest) < os.time()) then setPlayerStorageValue(cid, config.storageQuest, os.time() + (config.timeWait * 24 * 60 * 60 * 1000)) doPlayerSetStamina(cid, (getPlayerStamina(cid)) + (config.staminaRefuel * 60 * 60)) doSendMagicEffect(getThingPos(cid), 52) doPlayerAddPremiumDays(cid, config.premiumDays) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens! Voce acabou de receber um dia de GOLD CARD.") doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce ainda nao pode usar.") end return true end
Boa sorte,
caso não dê bolo um script pra você aqui.
Abraços.
-
Adriano SwaTT's post in (Resolvido)[Pedido] Bike System Poketibia was marked as the answerO script da bike ficará assim:
Agora em creaturescripts.xml adicione a tag:
<event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/>
E em SystemLogout.lua, adicione o script abaixo:
function onLogout(cid) if getPlayerStorageValue(cid, 12120) > 0 then return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false end return true end
Agora em login.lua, adicione a tag abaixo junto com as do gênero:
registerCreatureEvent(cid, "EventLogout")
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Usar X item apenas com X item was marked as the answerTente assim:
Registre a tag abaixo em creaturescripts.xml:
<event type="target" name="Weapons" event="script" value="weapons.lua" />
E o script abaixo, "weapons.lua", configurando a ID da arma com a ID da munição, conforme exemplo.
local bows = { [7438] = {2352}, -- Arma, Munição [5907] = {8304}, -- Arma, Munição [8851] = {6529}, -- Arma, Munição [5803] = {2547}, -- Arma, Munição } local slot = nil function onTarget(cid, target) if not bows[getPlayerSlotItem(cid, 5).itemid] and not bows[getPlayerSlotItem(cid, 6).itemid] then return true end if bows[getPlayerSlotItem(cid, 5).itemid] then slot = 5 elseif bows[getPlayerSlotItem(cid, 6).itemid] then slot = 6 end local bow = bows[getPlayerSlotItem(cid, slot).itemid] if bow then if (getPlayerSlotItem(cid, 10).itemid == bow[1]) then return true else doPlayerSendCancel(cid, "This ammunition is not for this weapon.") return false end end return true end Agora em login.lua da pasta creaturescripts/scripts, adicione a tag abaixo junto com as do gênero.
registerCreatureEvent(cid, "Weapons")
Salve e reinicie o server.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[Talkaction] !teleport (ignorar battle caso o player esteja no pz) was marked as the answerAh sim, entendi...
Faz sentido.
1 minuto já edito.
Tente assim:
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Tile Donate was marked as the answerBasta por action nos pisos e usar o script abaixo, que ficou um pouco diferente do Caronte.
function onStepIn(cid, item, position, fromPosition) if isPremium(cid) then doPlayerSendTextMessage(cid, 4, "Bem-vindo à área donate.") else doPlayerSendCancel(cid, "Você não é donate.") doTeleportThing(cid, fromPosition) end return true end Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Systema De Cassino was marked as the answerCara, experimente fazer isso...
Sabe a "function sumonarVerificar(cid, i)" dentro de cada script?
Mude a de cada script para:
Do script 1 para:
function sumonarVerificar1(cid, i) Do script 2 para:
function sumonarVerificar2(cid, i) Do script 3 para:
function sumonarVerificar3(cid, i) E é claro, lembre-se de mudar também nos locais onde chamam a função.
Teste novamente.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[AJUDA] Parte do script não funciona, URGENTE was marked as the answerFalha minha...
teste agora
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[Quest] Estátuas Vivas was marked as the answerDesculpe a demora, tive visitas em casa...
Enfim, testei e funcionou perfeitamente.
A tag em movements.xml será:
<movevent type="StepIn" actionid="12129" event="script" value="SurvivalStatues.lua"/>
SurvivalStatues.lua, na pasta Movements/scripts:
Agora vamos em CreatureScripts.xml e registre a tag abaixo:
<event type="kill" name="FinalBattle_Kill" event="script" value="SurvivalStatues.lua"/>
E em login.lua, registre a tag abaixo, junto com as do gênero:
registerCreatureEvent(cid, "FinalBattle_Kill")
E agora crie o arquivo SurvivalStatues.lua na mesma pasta:
Lembre-se de configurar tudo no início dos scripts.
Volte para dizer como foi.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Premium System was marked as the answerQual versão do seu servidor?
Tente este, originário deste tópico que adaptei para sua necessidade:
Registre as tags abaixo em seus respectivos lugares:
Creaturescripts.xml:
<event type="kill" name="Exp_Extra" event="script" value="extraexp.lua"/>
Login.lua:
player:registerEvent("Exp_Extra")
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)[ FAST HELP ] Coloca Nivel em um Teleport por NPC ! was marked as the answerBoa noite.
Teste assim.
local tab = { pos = {x = 275, y = 73, z = 7}, -- posição x, y, z do local a teleportar o player item = {2143, 500}, -- {itemID, count} level = 2000, -- level mínimo price = 1000 -- quantidade em crystal coins } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if (msgcontains(msg, 'teleport')) then talkState[talkUser] = 1 selfSay('Are you sure?', cid) selfSay('Remember..you need '..tab.item[2]..' '..getItemNameById(tab.item[1])..' and '..tab.price..' crystal coins to be teleported.', cid) elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerLevel(cid) >= tab.level then if (getPlayerItemCount(cid, tab.item[1]) >= tab.item[2] and doPlayerRemoveMoney(cid, tab.price * 10000)) then doTeleportThing(cid, tab.pos) doPlayerRemoveItem(cid, tab.item[1], tab.item[2]) doPlayerRemoveMoney(cid, tab.price * 10000) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) selfSay('Have a good trip.', cid) else talkState[talkUser] = 0 selfSay('I can not teleport you. You do not have the required items.', cid) end else selfSay('You need level '..tab.level..' to be teleported.', cid) end elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then talkState[talkUser] = 0 selfSay('Okay, maybe another time.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Arrumar script Reverter was marked as the answerBoa noite,
teste assim:
local config = { --[vocation id] = { level, nova voc, looktype, efeito} ---------- NARUTO ----------- [13] = { 500, 12, 54, 12}, [12] = { 400, 11, 494, 12}, [11] = { 350, 10, 291, 12}, [10] = { 300, 9, 179, 15}, [9] = { 250, 8, 25, 27}, [8] = { 200, 7, 49, 15}, [7] = { 150, 6, 40, 15}, [6] = { 125, 5, 92, 15}, [5] = { 100, 4, 31, 13}, [4] = { 75, 3, 18, 15}, [3] = { 50, 2, 91, 15}, [2] = { 25, 1, 71, 13},-- --------- SASUKE ----------- [27] = { 500, 26, 504, 261}, [26] = { 450, 25, 379, 261}, [25] = { 400, 24, 292, 261}, [24] = { 350, 23, 334, 27}, [23] = { 300, 22, 95, 263}, [22] = { 250, 21, 293, 13}, [21] = { 200, 20, 8, 263}, [20] = { 150, 19, 59, 263}, [19] = { 125, 18, 94, 263}, [18] = { 100, 17, 7, 13}, [17] = { 75, 16, 5, 263}, [16] = { 50, 15, 6, 263}, --------- SAKURA ----------- [42] = { 500, 41, 501, 13}, [41] = { 450, 40, 294, 27}, [40] = { 400, 39, 296, 27}, [39] = { 350, 38, 172, 13}, [38] = { 300, 37, 170, 27}, [37] = { 250, 36, 301, 13}, [36] = { 200, 35, 194, 13}, [35] = { 150, 34, 300, 27}, [34] = { 125, 33, 169, 13}, [33] = { 100, 32, 174, 13}, [32] = { 75, 31, 171, 13}, [31] = { 50, 30, 175, 13}, -------- ROCK LEE ----------- [57] = { 500, 56, 496, 73}, [56] = { 450, 55, 295, 73}, [55] = { 400, 54, 193, 73}, [54] = { 350, 53, 766, 73}, [53] = { 300, 52, 192, 73}, [52] = { 250, 51, 191, 73}, [51] = { 200, 50, 78, 73}, [50] = { 150, 49, 190, 73}, [49] = { 125, 48, 80, 73}, [48] = { 100, 47, 82, 73}, [47] = { 75, 46, 83, 73}, [46] = { 50, 45, 60, 73}, -------- KISAME ----------- [127] = { 500, 126, 692, 27}, [126] = { 400, 125, 556, 27}, [125] = { 300, 124, 555, 27}, [124] = { 250, 123, 554, 27}, [123] = { 200, 122, 553, 27}, [122] = { 150, 121, 551, 27}, [121] = { 125, 120, 691, 27}, [120] = { 100, 119, 690, 27}, [119] = { 75, 118, 689, 27}, [118] = { 50, 117, 688, 27}, -------- ITACHI ----------- [172] = { 500, 171, 511, 262}, [171] = { 450, 170, 472, 262}, [170] = { 400, 169, 298, 262}, [169] = { 350, 168, 322, 262}, [168] = { 300, 167, 297, 262}, [167] = { 250, 166, 100, 262}, [166] = { 200, 165, 283, 13}, [165] = { 150, 164, 282, 262}, [164] = { 125, 163, 99, 13}, [163] = { 100, 162, 98, 262}, [162] = { 75, 161, 284, 263}, [161] = { 50, 160, 97, 263}, --------- KILLER BEE ----------- [217] = { 500, 216, 350, 13}, [216] = { 450, 215, 740, 13}, [215] = { 400, 214, 739, 13}, [214] = { 350, 213, 717, 13}, [213] = { 300, 212, 738, 13}, [212] = { 250, 211, 737, 13}, [211] = { 200, 210, 736, 13}, [210] = { 150, 209, 735, 13}, [209] = { 125, 208, 734, 13}, [208] = { 100, 207, 733, 13}, [207] = { 75, 206, 732, 13}, [206] = { 50, 205, 729, 13}, [205] = { 25, 204, 714, 13}, -------- MADARA ----------- [262] = { 500, 261, 722, 13}, [261] = { 450, 260, 486, 13}, [260] = { 400, 259, 484, 13}, [259] = { 350, 258, 485, 13}, [258] = { 300, 257, 483, 13}, [257] = { 250, 256, 481, 13}, [256] = { 200, 255, 480, 13}, [255] = { 150, 254, 482, 13}, [254] = { 125, 253, 479, 13}, [253] = { 100, 252, 478, 13}, [252] = { 75, 251, 725, 13}, [251] = { 50, 250, 477, 13}, [250] = { 25, 249, 476, 13}, -------- MINATO ----------- [277] = { 500, 276, 709, 12}, [276] = { 450, 275, 708, 12}, [275] = { 400, 274, 707, 12}, [274] = { 350, 273, 599, 12}, [273] = { 300, 272, 598, 12}, [272] = { 250, 271, 596, 12}, [271] = { 200, 270, 565, 12}, [270] = { 150, 269, 564, 12}, [269] = { 125, 268, 563, 12}, [268] = { 100, 267, 562, 12}, [267] = { 75, 266, 561, 12}, [266] = { 50, 265, 560, 12}, [265] = { 25, 264, 559, 12}, -------- TOBIRAMA ----------- [304] = { 350, 303, 794, 27}, [303] = { 300, 302, 793, 27}, [302] = { 250, 301, 792, 27}, [301] = { 200, 300, 791, 27}, [300] = { 150, 299, 790, 27}, [299] = { 125, 298, 789, 27}, [298] = { 100, 297, 788, 27}, [297] = { 75, 296, 320, 27}, [296] = { 50, 295, 230, 27}, [295] = { 25, 294, 227, 27}, ---------- KANKURO ----------- [337] = { 500, 336, 666, 18}, [336] = { 450, 335, 662, 18}, [335] = { 400, 334, 625, 18}, [334] = { 350, 333, 637, 18}, [333] = { 300, 332, 548, 18}, [332] = { 250, 331, 624, 18}, [331] = { 200, 330, 623, 18}, [330] = { 150, 329, 602, 18}, [329] = { 125, 328, 603, 18}, [328] = { 100, 327, 600, 18}, [327] = { 75, 326, 621, 18}, [326] = { 50, 325, 620, 18}, [325] = { 25, 324, 619, 18}, ---------- ANBU ----------- [417] = { 500, 416, 273, 13}, [416] = { 450, 415, 163, 13}, [415] = { 400, 414, 159, 13}, [414] = { 350, 413, 148, 13}, [413] = { 300, 412, 148, 13}, [412] = { 250, 411, 147, 13}, [411] = { 200, 410, 147, 13}, [410] = { 150, 409, 463, 13}, [409] = { 125, 408, 463, 13}, [408] = { 100, 407, 16, 13}, [407] = { 75, 406, 16, 13}, [406] = { 50, 405, 123, 13}, [405] = { 25, 404, 123, 13} } function onSay(cid, words, param, channel) local from,to = {x=1001, y=705, z=7},{x=1031, y=737, z=7} -- começo e final do mapa local from2,to2 = {x=1011, y=705, z=6},{x=1031, y=738, z=6} -- começo e final do mapa local from3,to3 = {x=1012, y=706, z=5},{x=1032, y=739, z=5} -- começo e final do mapa local from4,to4 = {x=985, y=598, z=7},{x=1044, y=652, z=7} -- começo e final do mapa local from5,to5 = {x=986, y=615, z=6},{x=1039, y=647, z=7} -- começo e final do mapa local from6,to6 = {x=990, y=616, z=5},{x=1040, y=647, z=5} -- começo e final do mapa if isInRange(getCreaturePosition(cid), from, to) or isInRange(getCreaturePosition(cid), from2, to2) or isInRange(getCreaturePosition(cid), from3, to3) or isInRange(getCreaturePosition(cid), from4, to4) or isInRange(getCreaturePosition(cid), from5, to5) or isInRange(getCreaturePosition(cid), from6, to6) then doPlayerSendCancel(cid, "Você não pode se Reverter nesta área!") return true end doPlayerSay(cid, "Reverter") local voc = config[getPlayerVocation(cid)] if voc then if getPlayerLevel(cid) >= voc[1] then doPlayerSetVocation(cid, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você Reverteu!") local outfit = {lookType = voc[3]} doSetCreatureOutfit(cid, outfit, -1) local pos = getCreaturePosition(cid) doSendMagicEffect({x = pos.x, y = pos.y, z = pos.z}, voc[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Não da pra Reverter Tente Relogar.") end else doPlayerSendCancel(cid, "Você não pode se Reverter!") end return true end
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Maximum Health and Mana was marked as the answerBoa tarde,
fiz este correndo, mas creio que seja o suficiente ao que precisa.
Em CreatureScripts.xml registre a tag abaixo:
<event type="advance" name="LimitManaHealth" event="script" value="mana_health_limit.lua"/>
Agora crie o arquivo mana_health_limit.lua e coloque o código abaixo dentro:
local maxhealth = 10000 local maxmana = 10000 function onAdvance(cid, skill, oldLevel, newLevel) if getCreatureMaxHealth(cid) >= maxhealth or getCreatureMaxMana(cid) >= maxmana then setCreatureMaxHealth(cid, maxhealth) setCreatureMaxMana(cid, maxmana) end return true end
E por último, em login.lua, que se encontra dentro da pasta (data/creaturescripts/script), abra-o e registre a tag abaixo junto com as do gênero:
registerCreatureEvent(cid, "LimitManaHealth")
Não testei, mas me parece funcional.
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Sistema de Perda de Dodge was marked as the answerTem sim... 1 minuto.
#Edit:
local storagedodge = 98798644 -- Storage do Dodge function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if getPlayerStorageValue(cid, storagedodge) >= 1 then if (getCreatureSkullType(cid) == 3) or (getCreatureSkullType(cid) == 4) or (getCreatureSkullType(cid) == 5) then setPlayerStorageValue(cid, storagedodge, (getPlayerStorageValue(cid, storagedodge) - 1)) return true end end return true end
Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Sistema para evento programado com tps [8.60] was marked as the answerBoa noite.
Criei e testei o script, as funções básicas que precisa consegui executar com sucesso.
1. Ele cria os teleportes, cada um com uma ActionID diferente para que você possa criar um script para cada teleporte e assim configurar os requisitos para poder entrar.
2. Ele cria os teleportes no horário programado no GlobalEvents.xml, e a data fica configurada dentro do próprio script.
3. Ele remove os teleportes depois do tempo programado.
4. Ele bloqueia players que já acessaram um dos teleportes, já configurado para liberar a cada evento.
Vamos em GlobalEvents.xml e adicionar a tag abaixo:
<globalevent name="Teleports" time="12:00" event="script" value="teleports_progs.lua"/>
Agora na pasta scripts da referida, criaremos o arquivo "teleports_progs.lua" e adicionaremos o script abaixo:
--------- Script by: Adriano Swatt' ------ local dia = '1' -- qual dia do mês local horas = 12 -- hora do evento & horas para remover os tps local tp_id = 5023 -- ID do Teleport (Pode ser outro item, se desejar) local gstrg_control = 12129 -- Não precisa mexer (Global Storage de Controle de Acesso) local tp_pos = {{x=000, y=000, z=0}, {x=000, y=000, z=0}, {x=000, y=000, z=0}, {x=000, y=000, z=0}, {x=000, y=000, z=0}, {x=000, y=000, z=0}} -- Coordenada Onde Nascerá os TPs local tp_acts = {11111, 22222, 33333, 44444, 55555, 66666} -- ActionID para Cada TP (Terá que registrar em movements.xml as memas que colocar aqui) ----------- FIM DAS CONFIGURAÇÕES --------- function onTimer() local checkday = os.date("%d") if checkday == dia then for x = 1, #tp_pos do doItemSetAttribute(doCreateItem(tp_id, 1, tp_pos[x]), "aid", tp_acts[x]) end -- FOR addEvent(RemoveTps, horas * 60 * 60 * 1000) doBroadcastMessage("Hoje é dia "..checkday.." e são exatamente "..horas..":00 horas, os teleportes de bonus foram abertos e permanecerão por "..horas.." horas.") if getGlobalStorageValue(gstrg_control) <= 0 then setGlobalStorageValue(gstrg_control, 1) else setGlobalStorageValue(gstrg_control, (getGlobalStorageValue(gstrg_control) + 1)) end return true else doBroadcastMessage("Lembrem-se: Todo dia "..checkday.." às "..horas.." horas terá o evento dos teleportes.") end return true end function RemoveTps() for y = 1, #tp_pos do doRemoveItem(getTileItemById(tp_pos[y], tp_id).uid, 1) end -- FOR doBroadcastMessage("Os teleportes foram removidos, o evento abrirá novamente no próximo dia "..dia.." exatamente às "..horas..":00 horas.") return true end
Agora em Movements.xml adicionaremos a tag, como abaixo: (Substitua os números de acordo com que configurou o script anterior/acima)
<movevent type="StepIn" actionid="11111;22222;33333;44444;55555;66666" event="script" value="Teleports_Progs.lua"/>
E em scripts, criaremos o arquivo "Teleports_Progs.lua" e adicionaremos o código abaixo:
-------- Script by: Adriano Swatt' ------- local gstrg_control = 12129 -- Não precisa mexer (Global Storage de Controle de Acesso) local tp_exe = 11111 -- ID da ActionID do Teleport Exclusivo (Necessita 5 storages) local stors = {11111, 22222, 33333, 44444, 55555} -- Storages o player precisa para o teleport exclusivo local tp_acts = { [11111] = {{x=000, y=000, z=0}}, -- ActionID de cada teleport e coordenada pra onde o player irá (Tem que ser a mesma do outro script) [22222] = {{x=000, y=000, z=0}}, -- teleport 2 [33333] = {{x=000, y=000, z=0}}, -- teleport 3 [44444] = {{x=000, y=000, z=0}}, -- teleport 4 [55555] = {{x=000, y=000, z=0}}, -- teleport 5 [66666] = {{x=000, y=000, z=0}} -- teleport 6 } local msgs = { "Você não tem todas as quests necessárias.", -- Mensagem quando não tiver todas storages "Você já entrou em um dos teleportes bônus hoje.", -- Mensagem quando já tiver acessado um dos teleportes "Parabéns, você entrou no teleporte bônus." -- Mensagem ao entrar em algum teleporte } -- Mensagens ----------- FIM DAS CONFIGURAÇÕES --------- function onStepIn(cid, item, position, fromPosition) local tp_check = tp_acts[item.actionid] local gstrg = getGlobalStorageValue(gstrg_control) local getSto = getPlayerStorageValue if item.actionid ~= tp_exe then if tp_check then if getSto(cid, gstrg_control) < (gstrg) then doPlayerSendCancel(cid, msgs[3]) doTeleportThing(cid, tp_check[1]) setPlayerStorageValue(cid, gstrg_control, (getGlobalStorageValue(gstrg_control))) else doPlayerSendCancel(cid, msgs[2]) doTeleportThing(cid, fromPosition) end end else if getSto(cid, gstrg_control) < (gstrg) then if getSto(cid, stors[1]) >= 1 and getSto(cid, stors[2]) >= 1 and getSto(cid, stors[3]) >= 1 and getSto(cid, stors[4]) >= 1 and getSto(cid, stors[5]) >= 1 then doPlayerSendCancel(cid, msgs[3]) doTeleportThing(cid, tp_check[1]) setPlayerStorageValue(cid, gstrg_control, (getGlobalStorageValue(gstrg_control))) else doPlayerSendCancel(cid, msgs[1]) doTeleportThing(cid, fromPosition) end else doPlayerSendCancel(cid, msgs[2]) doTeleportThing(cid, fromPosition) end end return true end
Testei e funcionou perfeitamente.
Boa sorte.
Caso ocorra algum erro, ou até mesmo para agradecer, dê um FeedBack.
Abraços.
-
Adriano SwaTT's post in (Resolvido)Quest com 2 Baús was marked as the answerQuer o script ou saber como faz para não poder abrir ambos?
Dúvida:
Os sets de Pally e Kina são iguais?
Para bloquear após escolha:
Simples, basta adicionar uma storage ao player após escolher um, e que o baú bloqueie players que possuam esta storage.
Caso não saiba, peça e tento lhe ajudar.
Boa sorte.
#EDIT:
Tomei a liberdade de criar um esboço, creio que lhe ajudará.
-------- CONFIGURAÇÕES -------- local items = {ID_HELMET, ID_ARMOR, ID_LEGS, ID_BOOTS} -- ID dos items que ganhará local strg = 12128 -- Storage (NÃO MEXA) ---- FIM DAS CONFIGURAÇÕES ---- function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, strg) < 1 then setPlayerStorageValue(cid, strg, 1) doPlayerSendTextMessage(cid, 22, "Voce acabou de conseguir os seus primeiros items!") for x = 1, #items do local bag = doPlayerAddItem(cid, 2000, 1) doAddContainerItem(bag, items[x], 1) end else doPlayerSendCancel(cid, "Você já fez sua escolha.") end return true end Boa sorte.
-
Adriano SwaTT's post in (Resolvido)Me Ajuda Colocar Tempo nesse Scripts was marked as the answerBoa noite.
Teste este abaixo:
local tempo = 10 -- em segundos local strg = 12980 -- Storage onde salvará o tempo (Não Mexa) function onSay(cid, words, param) if not exhaustion.check(cid, strg) then if doPlayerRemoveItem(cid, 2160, 10) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce Desbugou!") doSendMagicEffect(getPlayerPosition(cid), 12) exhaustion.set(cid, strg, tempo) addLevel(cid, 1) else doPlayerSendCancel(cid, "Presisa De 10 Gold Para Desbugar!") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Presisa De 10 Gold Para Desbugar!") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Voce precisa aguardar "..exhaustion.get(cid, strg).." segundos para usar novamente.") end end
Boa sorte.