Ir para conteúdo

DuuhCarvalho

Conde
  • Total de itens

    988
  • Registro em

  • Última visita

  • Dias Ganhos

    22

Tudo que DuuhCarvalho postou

  1. posta seu config.lua e manda o nome da database.
  2. -- config minlevel = 25 -- level para resetar price = 0 newlevel = 150 -- level após reset newexp = 36830000 -- nova experiencia após reset limitReset = 10 -- limite de resetes idCoins = 2160 -- id do premio(coins) que o player ganha quantCoins = 10 -- quantidade de coins que vai ganhar -- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid,36874,resets+1) return true end function getResets(cid) resets = getPlayerStorageValue(cid,36874) if resets < 0 then resets = 0 end return resets end 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, 'reset') then selfSay('Do you want to reset your character level? Your character will be logged off if you confirm. You must pay '..price..' gold coins to reset.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < price then selfSay('You must pay '..price..' gold coins to reset.', cid) elseif getPlayerLevel(cid) < minlevel then selfSay('You must be at least level '.. minlevel ..' to reset.', cid) else if getResets < limitReset then doPlayerRemoveMoney(cid,price) addReset(cid) playerid = getPlayerGUID(cid) doRemoveCreature(cid) doPlayerAddItem(cid, idCoins, quantCoins) db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."") else selfSay('You can no longer reset.', cid) end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'info') then selfSay('You have '..getResets(cid)..' reset(s).', cid) end return true end
  3. Nossa mano, desse jeito não tem como ajudar. Não entendi nada
  4. DuuhCarvalho

    Status

    não entendi a parte da proteção, é pra checar a proteção ice por exemplo de todos os item, e informar?
  5. testa isso aqui: local saga = {[1] = {{[1] = 180, lvl = 50}, {[2] = 438, lvl = 100}, {[3] = 182, lvl = 150}, effect = 10},[2] = {{[1] = 180, lvl = 50}, {[2] = 438, lvl = 100}, {[3] = 182, lvl = 150}, effect = 10},[3] = {{[1] = 180, lvl = 50}, {[2] = 438, lvl = 100}, {[3] = 182, lvl = 150}, effect = 10},[4] = {{[1] = 180, lvl = 50}, {[2] = 438, lvl = 100}, {[3] = 182, lvl = 150}, effect = 10},}--[vocation] = {{[saga 1] = 180, level(lvl) = 50}, {[saga 2] = 438, level = 100}}----------- se a vocação é 1 e o player tiver o level 50, ele pode usar a saga 1.function onSay(cid, words, param, channel)if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o número da saga que você deseja.")return trueendlocal t = string.explode(param, ",")local nSaga = tonumber(t[1])local vocation = getPlayerVocation(cid)if not saga[vocation] thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")return trueendif nSaga == nil or nSaga > #saga[vocation] or nSaga < 1 or type(nSaga) ~= 'number' thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga não existe.")return trueendfor i, pid in pairs(saga) do if i == vocation then if pid[nSaga] then if getPlayerLevel(cid) >= pid[nSaga].lvl then doSetCreatureOutfit(cid, {lookType = pid[nSaga][nSaga]}, -1) doSendMagicEffect(getThingPos(cid), pid.effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, você precisa de level "..pid[nSaga].lvl.." para usar essa saga.") end end endendreturn trueend
  6. --local toloot = << a tabela tá como comentário. Exclui os -- deixa assim : local toloot =
  7. globalevents/scripts: local config = { ["NPC's"] = {pos = {x= 154,y = 48,z= 7}, effect = 12}, ["NPC's"] = {pos = {x= 154,y = 48,z= 7}, effect = 12}, ["NPC's"] = {pos = {x= 154,y = 48,z= 7}, effect = 12}}function onThink(cid, interval, lastExecution) for i, pid in pairs(config) do doSendAnimatedText(pid.pos, i, math.random(1, 255)) doSendMagicEffect(pid.pos, pid.effect) end return trueend globalevents.xml <globalevent name="nomve do evento" interval="2" script="nome do arquivo.lua"/>
  8. em actions/scripts coloque isso: function onUse(cid, item, frompos, item2, topos)local pos = {{x= 160, y= 54, z= 7},{x= 160, y= 54, z= 7},{x= 160, y= 54, z= 7},{x= 160, y= 54, z= 7},{x= 160, y= 54, z= 7},{x= 160, y= 54, z= 7}}if item.itemid == 1945 then -- id da alavanda 1945 for i = 1, #pos do doSendMagicEffect(pos[i], 30) end doTransformItem(item.uid,item.itemid+1)elseif item.itemid == 1946 then -- id da alavanca 1946 for j = 1, #pos do doSendMagicEffect(pos[j], 30) end doTransformItem(item.uid,item.itemid-1)elsedoPlayerSendTextMessage(cid,22,"Sorry, not possible.")endreturn trueend em actions.xml coloque: <action actionid="id da action" script="arquivo.lua" /> e coloque no mapa a alavanca com a mesma action id da tag.
  9. Boa noite, preciso de uma ajuda com essa função doCreatureSetDropLoot, eu já tentei arrumar sozinho, mas não sou bom o suficiente. só o que eu quero é colocar um 3º parâmetro, que dê a possibilidade de colocar um slot especifico. doCreatureSetDropLoot(cid, doDropt[, slot]) Exemplo: doCreatureSetDropLoot(cid, false, CONST_SLOT_ARMOR) -- no caso coloco isso no preparedeath e o player cid não vai perder somente oq estiver no slot armor. sendo um parâmetro opcional. segue função: int32_t LuaScriptInterfaceluaDoCreatureSetDropLoot(lua_State* L){ //doCreatureSetDropLoot(cid, doDrop) bool doDrop = popNumber(L); ScriptEnviroment* env = getEnv(); if(Creature* creature = env->getCreatureByUID(popNumber(L))) { creature->setDropLoot(doDrop ? LOOT_DROP_FULL : LOOT_DROP_NONE); lua_pushboolean(L, true); } else { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } return 1;}
  10. como colocou a tag no actions.xml ? esqueci de setar uma storage.. mas ainda assim, manda a tag local timekick = 1 -- tempo em segundo para o player ser kickadolocal storage = 196768function onUse(cid, item) function removePlayer() if isPlayer(cid) then doRemoveCreature(cid) end endif getPlayerStorageValue(cid, storage) <= 0 thenif not getCreatureCondition(cid, CONDITION_INFIGHT) then db.executeQuery("UPDATE `players` SET `name` = '[LEGENDARY] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(getPlayerByNameWildcard(cid))..";") addEvent(removePlayer, timekick*1000) doPlayerSendTextMessage(cid, 25, "Você será kickado em "..timekick.." segundo(s) para que seu nome seja alterado, por favor, entre com sua senha novamente.") doSendMagicEffect(getCreaturePosition(cid), 35)else doPlayerSendCancel(cid, "Espere o Battle sai.") doSendMagicEffect(getCreaturePosition(cid), 2)endelse doPlayerSendCancel(cid, "Você já é um LEGENDARY")endreturn trueend
  11. sua vip é por storage ? se sim, qual? vai em creaturescript/scripts/login.lua, e antes do ultimo return true coloca isso: function onLogin(cid)local storage = (getPlayerAccountId(cid)+550)local days = 5if getGlobalStorageValue(storage) <= 0 then setGlobalStorageValue(storage, 1) addVipDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu "..days.." dias de VIP, bom jogo!")endreturn trueend
  12. algum erro? configurou certo ? ..
  13. @euller15 adiciona em data/actions/scripts.. em actions.xml, copia alguma tag já existente, só altera nmr do actionid ou uniqueid, coloca o mesmo no bau e pronto
  14. local timekick = 1 -- tempo em segundo para o player ser kickadofunction onUse(cid, item) function removePlayer() if isPlayer(cid) then doRemoveCreature(cid) end endif not getCreatureCondition(cid, CONDITION_INFIGHT) then db.executeQuery("UPDATE `players` SET `name` = '[LEGENDARY] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(getPlayerByNameWildcard(cid))..";") addEvent(removePlayer, timekick*1000) doPlayerSendTextMessage(cid, 25, "Você será kickado em "..timekick.." segundo(s) para que seu nome seja alterado, por favor, entre com sua senha novamente.") doSendMagicEffect(getCreaturePosition(cid), 35)else doPlayerSendCancel(cid, "Espere o Battle sai.") doSendMagicEffect(getCreaturePosition(cid), 2)endreturn trueend
  15. local outfit = 20 -- nmr do newtypelocal item1 = 12620local quant1 = 600local vocation547 = 547local pos = {x=655, y=399, z=7}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction santaNPC(cid, message, keywords, parameters, node)if(not npcHandler:isFocused(cid)) thenreturn falseendif(parameters.present == true) thenif(doPlayerRemoveItem(cid,item1,quant1) == true) thendoPlayerSetVocation(cid, 547)doSetCreatureOutfit(cid, {lookType = outfit}, -1)doTeleportThing(cid, pos)npcHandler:say('Voce agora é broly ultragod.',cid)elsenpcHandler:say('Voce nao tem 600 ultimate coins .',cid)endnpcHandler:resetNpc()return trueendendnpcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Voce quer ser {broly ultragod}?.")local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})local node = keywordHandler:addKeyword({'broly ultragod'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente ser broly ultragod?, você não ira se arrepender. {yes}'})node:addChildKeywordNode(yesNode)node:addChildKeywordNode(noNode)npcHandler:addModule(FocusModule:new())
  16. local outfit = 100function onEquip(cid, item) doSetCreatureOutfit(cid, {lookType = outfit}, -1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Equipado") doSendMagicEffect(getCreaturePosition(cid), 22)return trueendfunction onDeEquip(cid, item) doRemoveCondition(cid, CONDITION_OUTFIT)return trueend <movevent type="Equip" itemid="ID do Item" slot="SLOT do Item, armor, legs, shield" script="arquivo.lua"/> <movevent type="DeEquip" itemid="ID do Item" slot="SLOT do Item, armor, legs, shield" script="arquivo.lua"/>
  17. function onUse(cid, item, fromPosition, itemEx, toPosition)if getPlayerSex(cid) == 0 then if getPlayerStorageValue(cid, 181656) == 1 then doPlayerSendCancel(cid, 22, "Você já possue essa outfit.") else setPlayerStorageValue(cid, 181656, 1) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, 22, "Parabéns você ganhou a outfit Sr.Madruga.") endelse doPlayerSendCancel(cid, 22, "Apenas male")endreturn trueend
  18. para que ta feio mano. Muitos tem conta nos 2 fórum, ninguém liga pra isso. vejo mt conteúdo do xtibia lá, até mesmo meu, assim como tem conteúdo de lá aq. pq ta se doendo?
  19. DuuhCarvalho

    AJUDA

    skype duhw.carvalho. vai aparecer 2 na pesquisa, adiciona o que tem foto.
  20. DuuhCarvalho

    AJUDA

    function onSay(player, words, param) --[[ Config lugares]]-- local lugar = { ["demolay"] = {pos = {x=1229, y=990, z=7}}, ["fidelitas"] = {pos = {x=1023, y=1026, z=7}}, ["shopping"] = {pos = {x=1044, y=1052, z=7}}, ["tpfree"] = {pos = {x=1108, y=998, z=7}}, ["tpfree2"] = {pos = {x=1248, y=1070, z=7}}, ["tpvip2"] = {pos = {x=1249, y=1064, z=7}}, ["tpvip"] = {pos = {x=1108, y=1028, z=7}}, } if player:getCondition(CONDITION_INFIGHT) == true then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return false end if player:getPremiumDays() < 1 then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Apenas Vip's podem se teleportar.") return false end local a = lugar[param] if type(param) ~= 'string' then a = lugar[tostring(param)] end local tmp = player:getPosition() if not a then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que você pode ir são: demolay, fidelitas.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares que você pode ir são: shopping, tpfree, tpfree2, tpvip, tpvip2.") tmp:sendMagicEffect(CONST_ME_POFF) else tmp:sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(a.pos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end return true end
  21. DuuhCarvalho

    AJUDA

    certo function onSay(player, words, param) --[[ Config lugares]]-- local lugar = { ["demolay"] = {pos = {x=1229, y=990, z=7}}, ["fidelitas"] = {pos = {x=1023, y=1026, z=7}}, ["shopping"] = {pos = {x=1044, y=1052, z=7}}, ["tpfree"] = {pos = {x=1108, y=998, z=7}}, ["tpfree2"] = {pos = {x=1248, y=1070, z=7}}, ["tpvip2"] = {pos = {x=1249, y=1064, z=7}}, ["tpvip"] = {pos = {x=1108, y=1028, z=7}}, } if player:getCondition(CONDITION_INFIGHT) == true then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return false end if player:getPremiumDays() < 1 then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Apenas Vip's podem se teleportar.") return false end local a = lugar[tostring(param)] local tmp = player:getPosition() if not a then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que você pode ir são: demolay, fidelitas.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares que você pode ir são: shopping, tpfree, tpfree2, tpvip, tpvip2.") tmp:sendMagicEffect(CONST_ME_POFF) else tmp:sendMagicEffect(CONST_ME_TELEPORT) player:teleportTo(a.pos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end return false end
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...