Ir para conteúdo

Furabio

Conde
  • Total de itens

    962
  • Registro em

  • Última visita

  • Dias Ganhos

    11

Tudo que Furabio postou

  1. Posta o character.php aqui em spoiler ou o arquivo em questão que fica a par de criar os characters.
  2. https://theme.wordpress.com/themes/sort/free/
  3. Temos um grupo no skype onde focamos aprender programação se for do seus interesse basta me adicionar, que eu os coloco no grupo.
  4. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  5. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  6. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  7. Estou disponível para ajudar no projeto, te adicionarei no skype.
  8. Acompanhando lindoso, sucesso no servidor.
  9. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  10. Fiz minha versão mais simples e fiz outro !stamina pois o do caronte não vai fazer o que o tu pede : local items = { ["!machete"] = {32301, 2420}, ["!shovel"] = {32302, 2554}, ["!rope"] = {32303, 2120}, } function onSay(player, words) for i, v in pairs(items) do if words == i then if getCreatureStorage(player, v[1]) <= os.time() then doCreatureSetStorage(player, v[1], os.time() + (60 * 60 * 24)) doPlayerAddItem(player, v[2], 1) break else doPlayerSendCancel(player, "You need wait " .. math.floor((getCreatureStorage(player, v[1]) - os.time() ) / 60 / 60) .. " hours, to get another ".. string.sub(words, 2) .."." ) return false end end end return false end <talkaction words="!machete;!shovel;!rope" event="script" value="ARQUIVO.lua"/> !stamina : local time = 10 -- 10 Horas function onSay(player, words) if getPlayerStamina(player) <= (60*time) then -- 600 Stamina = 10 Hours doPlayerAddStamina(player, (60*42)) -- 2520 Stamina = 42 Hours doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS) else doPlayerSendCancel(player, "Sua stamina deve estar abaixo de " .. time .." horas para o comando ser usado.") end return true end <talkaction words="!stamina" event="script" value="ARQUIVO.lua"/> abrçs Tópico movido para a seção de dúvidas e pedidos resolvidos.
  11. Conte-nos como resolveu o problema e qual era também, outras pessoas podem ter a mesma dúvida.
  12. Esse script não funciona de nenhuma forma no seu tfs 1.1, dps eu troco as funções dele e posto aqui pra tu funcionando.
  13. Numa época de mentiras universais dizer a verdade é um ato revolucionário - George Orwell
  14. Muito bom, parabéns ao participantes.
  15. Eu estava afim de fazer isso já à algum tempo, mas por conta da preguiça não fiz, ai vasculhando em outro fórum, vi que um membro fez o auto-complete de funções no Sublime Text, uma dos melhores editores de texto para programadores(disponível em todos os OS), e pensei em compartilhar com vocês, todos os créditos fica a merci de Jetro. Para instalar : - Abra o sublime, vá em Preferences, dps em Browse Packages. - Abra a pasta User, e cole o arquivo tfs.sublime-completions no local. - Depois só fechar e abrir o sublime, que estará com o auto-complete. Link tfs.sublime-completions : https://github.com/jangeldevelopment/Sublime-Text-TFS-Autocompletion/archive/master.zip Link do Sublime(pra quem se interessar) : http://www.sublimetext.com/2 GitHub : https://github.com/jangeldevelopment/Sublime-Text-TFS-Autocompletion
  16. return false, tb faz isso
  17. Muito boa a entrevista.
  18. Bom script, se o script não for de sua autoria, lembre-se de colocar os devidos créditos, pois já vi esse script em um outro fórum, criado por um colega meu.
  19. Basicamente é um sistema onde permite chuva e solte raios em determinado local do mapa, use sua criatividade ao usar o sistema. Features : Chuva só nos jogadores, para economizar memória do servidor, em vez de enviar todo o mapa. Se não tiver um telhado, vai enviar o efeito dentro do local mesmo. Assim, se você estiver sob um teto, vai enviar para fora do local. Quando água bate no chão, envia o efeito de splash. Efeito do trovão causa dano. Em global.lua adicione : weatherConfig = { groundEffect = CONST_ME_LOSEENERGY, fallEffect = CONST_ANI_ICE, thunderEffect = true, minDMG = 5, maxDMG = 10 } function Player.sendWeatherEffect(self, groundEffect, fallEffect, thunderEffect) local position, random = self:getPosition(), math.random position.x = position.x + random(-4, 4) position.y = position.y + random(-4, 4) local fromPosition = Position(position.x + 1, position.y, position.z) fromPosition.x = position.x - 7 fromPosition.y = position.y - 5 local tile, getGround for Z = 1, 7 do fromPosition.z = Z position.z = Z tile = Tile(position) if tile then -- If there is a tile, stop checking floors fromPosition:sendDistanceEffect(position, fallEffect) position:sendMagicEffect(groundEffect, self) getGround = tile:getGround() if getGround and ItemType(getGround:getId()):getFluidSource() == 1 then position:sendMagicEffect(CONST_ME_WATERSPLASH, self) end break end end if thunderEffect and tile then if random(2) == 1 then local topCreature = tile:getTopCreature() if topCreature and topCreature:isPlayer() then position:sendMagicEffect(CONST_ME_BIGCLOUDS, self) doTargetCombatHealth(0, self, COMBAT_ENERGYDAMAGE, -weatherConfig.minDMG, -weatherConfig.maxDMG, CONST_ME_NONE) self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You were hit by lightning and lost some health.") end end end end modo de uso : player:sendWeatherEffect(weatherConfig.groundEffect, weatherConfig.fallEffect, weatherConfig.thunderEffect) Em breve vou fazer uns scripts bacana em cima desse sistema, aceito sugestões. Créditos : Printer.
  20. Um comando para GOD, que permiti trocar o seu looktype, para o de um monstro ou de um player em questão. /looktype id /looktype monstername /looktype id, playername /looktype monstername, playername Exemplo: /looktype 262 /looktype Silver Rabbit /looktype 262, Limos /looktype Silver Rabbit, Limos looktype.lua function onSay(cid, words, param) local player = Player(cid) if not player:getGroup():getAccess() then return true end local t = param:split(",") local lookType = tonumber(t[1]) if not lookType then lookType = MonsterType(t[1]) and MonsterType(t[1]):getOutfit().lookType if not lookType then player:sendCancelMessage("A monster with that name does not exist.") return false end end if t[2] then playerx, player = player, Player(t[2]:gsub("^%s*(.-)%s*$", "%1")) if not player then playerx:sendCancelMessage("A player with that name does not exist or is not online.") return false end end if lookType >= 0 and lookType ~= 1 and lookType ~= 135 and lookType ~= 411 and lookType ~= 415 and lookType ~= 424 and (lookType <= 160 or lookType >= 192) and lookType ~= 439 and lookType ~= 440 and lookType ~= 468 and lookType ~= 469 and (lookType < 474 or lookType > 485) and lookType ~= 501 and lookType ~= 518 and lookType ~= 519 and lookType ~= 520 and lookType ~= 524 and lookType ~= 525 and lookType ~= 536 and lookType ~= 543 and lookType ~= 549 and lookType ~= 576 and lookType ~= 581 and lookType ~= 582 and lookType <= 595 then local playerOutfit = player:getOutfit() playerOutfit.lookType = lookType player:setOutfit(playerOutfit) else player = playerx or player player:sendCancelMessage("A look type with that id does not exist.") end return false end Créditos : Limos
  21. !exp: !mana: talkactions.xml <talkaction words="!exp" script="expmana.lua"/> <talkaction words="!mana" script="expmana.lua"/> expmana.lua function onSay(player, words, param) local p = player local s = function(p, lv) local k = Game.getExperienceStage(lv) local st = p:getStamina() if st > 2400 then return k*1.5 .. " (stamina bonus)" elseif st < 1 then return 0 .. " (out of stamina)" elseif st < 841 then return k*0.5 .. " (stamina penalty)" else return k end end if words == "!exp" then local lv = p:getLevel() p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You need " .. ((50 * lv^3) - (150 * lv^2) + (400 * lv)) / 3 - p:getExperience() .. " experience more, for " .. lv+1 .. " level.") p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current rate: x" .. s(p, lv)) return false end p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to spend " .. math.ceil((p:getVocation():getRequiredManaSpent(p:getBaseMagicLevel() + 1) - p:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC)) .. " mana more, for next magic level.") return false end Créditos : zbisu.
  22. xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="NPCNAME" script="bless_heal.lua" walkinterval="2000" floorchange="0" speechbubble="1"> <health now="100" max="100"/> <look type="138" head="58" body="114" legs="87" addons="3"/> <parameters> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;blessings" /> <parameter key="keyword_reply1" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> <parameter key="keyword_reply2" value="I can grant you blessings such as {Wisdom} {of} {Solitude}, {Spark} {of} {The} {Phoenix}, our {Fire} {of} {Two} {Suns}, {Spiritual} {Shielding} and {The Embrace}. I can also grant you {all} of these blessings, just ask me." /> </parameters> </npc> bless_heal.lua 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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = cid local p = Player(cid) local heal = false local hp = p:getHealth() if msgcontains(msg, "heal") then if getCreatureCondition(cid, CONDITION_FIRE) then selfSay("You are burning. I will help you.", cid) doRemoveCondition(cid, CONDITION_FIRE) heal = true elseif getCreatureCondition(cid, CONDITION_POISON) then selfSay("You are poisoned. I will cure you.", cid) doRemoveCondition(cid, CONDITION_POISON) heal = true elseif getCreatureCondition(cid, CONDITION_ENERGY) then selfSay("You are electrificed. I will help you.", cid) doRemoveCondition(cid, CONDITION_ENERGY) heal = true elseif getCreatureCondition(cid, CONDITION_PARALYZE) then selfSay("You are paralyzed. I will cure you.", cid) doRemoveCondition(cid, CONDITION_PARALYZE) heal = true elseif getCreatureCondition(cid, CONDITION_DROWN) then selfSay("You are drowing. I will help you.", cid) doRemoveCondition(cid, CONDITION_DROWN) heal = true elseif getCreatureCondition(cid, CONDITION_FREEZING) then selfSay("You are cold! I will help you.", cid) doRemoveCondition(cid, CONDITION_FREEZING) heal = true elseif getCreatureCondition(cid, CONDITION_BLEEDING) then selfSay("You are bleeding! I will help you.", cid) doRemoveCondition(cid, CONDITION_BLEEDING) heal = true elseif getCreatureCondition(cid, CONDITION_DAZZLED) then selfSay("You are dazzled! Do not mess with holy creatures anymore!", cid) doRemoveCondition(cid, CONDITION_DAZZLED) heal = true elseif getCreatureCondition(cid, CONDITION_CURSED) then selfSay("You are cursed! I will remove it.", cid) doRemoveCondition(cid, CONDITION_CURSED) heal = true elseif hp < 65 then selfSay("You are looking really bad. Let me heal your wounds.", cid) p:addHealth(65 - hp) heal = true elseif hp < 2000 then selfSay("I did my best to fix your wounds.", cid) p:addHealth(2000 - hp) heal = true end if heal then p:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) else local msgheal = { "You aren't looking really bad, " .. getCreatureName(cid) .. ". I only help in cases of real emergencies. Raise your health simply by eating {food}.", "Seriously? It's just a scratch", "Don't be a child. You don't need any help with your health.", "I'm not an expert. If you need help find a medic.", "Don't even waste my time, I have bigger problems than your scratched armor." } selfSay("" .. msgheal[math.random(1, #msgheal)] .. "", cid) end return true end if msgcontains(msg, "yes") and talkState[talkUser] > 90 and talkState[talkUser] < 96 then if getPlayerBlessing(cid, talkState[talkUser] - 90) then selfSay("You already have this blessing!", cid) else b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end if doPlayerRemoveMoney(cid, b_price) then selfSay("You have been blessed by one of the five gods!", cid) doPlayerAddBlessing(cid, talkState[talkUser] - 90) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("I'm sorry. We need money to keep this temple up.", cid) end end talkState[talkUser] = 0 return true end if msgcontains(msg, "yes") and talkState[talkUser] == 96 then havebless = {} for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end if #havebless == 5 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end b_price = ((5 - #havebless) * b_price) if doPlayerRemoveMoney(cid, b_price) then selfSay("You have been blessed by the five gods!", cid) for i = 1, 5 do doPlayerAddBlessing(cid, i) end doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else selfSay("I'm sorry. We need money to keep this temple up.", cid) end talkState[talkUser] = 0 return true end if msgcontains(msg, "all") then havebless = {} b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end for i = 1, 5 do if(getPlayerBlessing(cid, i)) then table.insert(havebless,i) end end b_price = ((5 - #havebless) * b_price) if b_price == 0 then selfSay('You already have all available blessings.',cid) talkState[talkUser] = 0 return true end selfSay('Do you want to receive all blessings for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 96 return true end local blesskeywords = {'wisdom', 'spark', 'fire', 'spiritual', 'embrace'} local blessnames = {'Wisdom of Solitude', 'Spark of The Phoenix', 'Fire of Two Suns', 'Spiritual Shielding', 'The Embrace'} for i = 1, #blesskeywords do if msgcontains(msg, blesskeywords[i]) then b_price = (2000 + ((math.min(130, getPlayerLevel(cid)) - 30) * 200)) if b_price < 2000 then b_price = 2000 end selfSay('Do you want me to grant you ' .. blessnames[i] .. ' blessing for ' .. b_price .. ' gold?',cid) talkState[talkUser] = 90 + i return true end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Créditos : zbisu
  23. rank in-game de level, ml , skill, etc ... 13:13 Top players on server, frags, paladin: [1] [Test ze Spacjami] [5] [2] [Zbizo3] [1] talkactions.xml <talkaction words="!rank" separator=" " script="rank.lua"/> rank.lua local top = 10 local rankcolor = MESSAGE_STATUS_CONSOLE_ORANGE local errorcolor = MESSAGE_STATUS_CONSOLE_BLUE local popup = true -- set to false if you want it in local chat local exhaustvalue = 78692 -- storage to avoid command spam local exhausttime = 5 -- seconds before you may request rank again local maxgroup = 1 -- set to 2 to include gms, 3 to include gods local ranks = { ['level'] = 1, ['lvl'] = 1, ['exp'] = 1, ['xp'] = 1, ['magic'] = 2, ['ml'] = 2, ['bank'] = 3, ['balance'] = 3, ['cash'] = 3, ['money'] = 3, ['gp'] = 3, ['fist'] = 4, ['club'] = 5, ['sword'] = 6, ['axe'] = 7, ['distance'] = 8, ['dist'] = 8, ['shielding'] = 9, ['shield'] = 9, ['fishing'] = 10, ['fish'] = 10, ['frags'] = 11 } local voc = { ['none'] = 0, ['sorcerer'] = {1, 5}, ['ms'] = {1, 5}, ['druid'] = {2, 6}, ['ed'] = {2, 6}, ['paladin'] = {3, 7}, ['rp'] = {3, 7}, ['knight'] = {4, 8}, ['ek'] = {4, 8} } local stats = { -- {"order by this", "show this first"} [1] = {"experience", "level"}, [2] = {"manaspent", "maglevel"}, [3] = {"balance"}, [4] = {"skill_fist"}, [5] = {"skill_club"}, [6] = {"skill_sword"}, [7] = {"skill_axe"}, [8] = {"skill_dist"}, [9] = {"skill_shielding"}, [10] = {"skill_fishing"} } local stats_names = { [1] = {"exp", "level"}, [2] = {"mana spent", "magic level"}, [3] = {"account balance"}, [4] = {"fist fighting"}, [5] = {"club fighting"}, [6] = {"sword fighting"}, [7] = {"axe fighting"}, [8] = {"distance fighting"}, [9] = {"shielding"}, [10] = {"fishing"}, [11] = {"frags"} } local stats_short = { [1] = {"xp: ", ""}, [2] = {"mana: ", ""}, [3] = {""}, [4] = {""}, [5] = {""}, [6] = {""}, [7] = {""}, [8] = {""}, [9] = {""}, [10] = {""}, [11] = {""} } function table.find(table, value) for i, v in pairs(table) do if v == value then return i end end return nil end function getHighest(check, values) local highest = 0 local highestVal = nil local highestI = nil for i = 1, #values do if check[values[i]] > highest then highest = check[values[i]] highestVal = values[i] highestI = i end end return {highest, highestVal, highestI} end function getTopFraggers(vocs) local fraggers = {} local resultId = db.storeQuery("SELECT `player_id`, `killed_by` FROM `player_deaths` WHERE `is_player` = 1") if resultId then repeat table.insert(fraggers, result.getDataString(resultId, "killed_by")) until not result.next(resultId) result.free(resultId) end local fraggers_names = {} for i = 1, #fraggers do if not table.find(fraggers_names, fraggers[i]) then table.insert(fraggers_names, fraggers[i]) end end local fraggers_total = {} for i = 1, #fraggers do for j = 1, #fraggers_names do if fraggers_names[j] == fraggers[i] then if not fraggers_total[fraggers_names[j]] then fraggers_total[fraggers_names[j]] = 0 end fraggers_total[fraggers_names[j]] = fraggers_total[fraggers_names[j]] + 1 end end end local place = 0 local fraggers_top = {} repeat local v = getHighest(fraggers_total, fraggers_names) if not v[2] then break end if vocs then local resultId = db.storeQuery("SELECT `vocation` FROM `players` WHERE `name` = '" .. v[2] .. "' LIMIT 1") if isInArray(vocs, result.getDataInt(resultId, "vocation")) then place = place + 1 table.insert(fraggers_top, {v[1], v[2]}) end else place = place + 1 table.insert(fraggers_top, {v[1], v[2]}) end table.remove(fraggers_names, v[3]) until (place == top) or (not v[3]) local msg = "" for i = 1, #fraggers_top do if fraggers_top[i][2] then msg = msg .. "\n[" .. i .. "] [" .. fraggers_top[i][2] .. "] [" .. fraggers_top[i][1] .. "]" else break end end return msg end function onSay(player, words, param) if player:getStorageValue(exhaustvalue) >= os.time() then player:sendTextMessage(errorcolor, "Please do not spam.") return false end player:setStorageValue(exhaustvalue, os.time() + exhausttime) local split = param:split(",") if #split == 0 then local ranks2 = {} for i = 1, #stats_names do table.insert(ranks2, stats_names[i][#stats_names[i]]) end player:popupFYI("Example: " .. words .. " balance, knight(optional)\n\nAvailable ranks:\n" .. table.concat(ranks2, "\n")) return false end for i = 1, #split do split[i] = split[i]:gsub("^%s*(.-)%s*$", "%1") end if ranks[split[1]] then local msg = "Top players on server, " .. stats_names[ranks[split[1]]][#stats_names[ranks[split[1]]]] .. (voc[split[2]] and (", " .. split[2]) or "") .. ":" if ranks[split[1]] == 11 then if popup then player:popupFYI(msg .. getTopFraggers(voc[split[2]])) else player:sendTextMessage(rankcolor, msg .. getTopFraggers(voc[split[2]])) end return false else local resultId = db.storeQuery("SELECT `name`, `" .. table.concat(stats[ranks[split[1]]], "`, `") .. "` FROM `players` WHERE `group_id` <= " .. maxgroup .. (voc[split[2]] and (" AND `vocation` IN (" .. table.concat(voc[split[2]], ",") .. ")") or "") .. " ORDER BY `" .. stats[ranks[split[1]]][#stats[ranks[split[1]]]] .. "` DESC LIMIT " .. top) local place = 0 repeat place = place + 1 msg = msg .. "\n[" .. place .. "] [" .. result.getDataString(resultId, "name") .. "] " for i = 1, #stats[ranks[split[1]]] do local s = #stats[ranks[split[1]]] + 1 - i msg = msg .. "[" .. stats_short[ranks[split[1]]][s] .. result.getDataInt(resultId, stats[ranks[split[1]]][s]) .. "]" .. (s > 1 and " " or "") end until not result.next(resultId) result.free(resultId) if popup then player:popupFYI(msg) else player:sendTextMessage(rankcolor, msg) end end return false end player:sendTextMessage(errorcolor, "Incorrect list name. Execute command without parameters to see available lists.") return false end Créditos: zbisu
  24. Os items para receber o addon é configurável. talkactions.XML <talkaction words="!rank" separator=" " script="buyaddon.lua"/> buyaddon.lua local text = '--Addon List--\n!buyaddon "citizen\n!buyaddon "hunter\n!buyaddon "mage\n!buyaddon "knight\n!buyaddon "summoner\n!buyaddon "warrior\n!buyaddon "barbarian\n!buyaddon "druid\n!buyaddon "wizard\n!buyaddon "oriental\n!buyaddon "pirate\n!buyaddon "assassin\n!buyaddon "beggar\n!buyaddon "beggar\n!buyaddon "shaman\n!buyaddon "norseman\n!buyaddon "nightmare\n!buyaddon "jester\n!buyaddon "brotherhood\n!buyaddon "warmaster\n--Addon List End--' function onSay(cid, words, param) local player = Player(cid) local cfg = { ["citizen"] = { outfit = { male = 128, female = 136, addon = 3, storage = 10031 }, items = { {5878,100} } }, ["hunter"] = { outfit = { male = 129, female = 137, addon = 3, storage = 10032 }, items = { {5876, 100},{5948, 100} } }, ["mage"] = { outfit = { male = 130, female = 138, addon = 3, storage = 10033 }, items = { {2160,10} } }, ["knight"] = { outfit = { male = 131, female = 139, addon = 3, storage = 10034 }, items = { {5880,100},{5893, 100} } }, ["summoner"] = { outfit = { male = 133, female = 141, addon = 3, storage = 10035 }, items = { {2160,10} } }, ["warrior"] = { outfit = { male = 134, female = 142, addon = 3, storage = 10036 }, items = { {5925, 100},{5899, 100},{5919, 1},{5880, 100} } }, ["barbarian"] = { outfit = { male = 147, female = 143, addon = 3, storage = 10037 }, items = { {5911, 50},{5910, 50},{5879, 100} } }, ["druid"] = { outfit = { male = 148, female = 144, addon = 3, storage = 10038 }, items = { {5896, 50},{5897, 50} } }, ["wizard"] = { outfit = { male = 149, female = 145, addon = 3, storage = 10039 }, items = { {2536, 1},{2492, 1},{2488, 1},{2123, 1},{5922, 50} } }, ["oriental"] = { outfit = { male = 150, female = 146, addon = 3, storage = 10040 }, items = { {5883, 100},{5895, 100},{5912, 100} } }, ["pirate"] = { outfit = { male = 151, female = 155, addon = 3, storage = 10041 }, items = { {6098, 100},{6126, 100},{6097, 100} } }, ["assassin"] = { outfit = { male = 152, female = 156, addon = 3, storage = 10042 }, items = { {5898, 30},{5882, 10},{5881, 30},{5895, 20},{5905, 10} } }, ["beggar"] = { outfit = { male = 153, female = 157, addon = 3, storage = 10043 }, items = { {5878, 50},{2743, 30},{5913, 20},{5894, 10} } }, ["shaman"] = { outfit = { male = 154, female = 158, addon = 3, storage = 10044 }, items = { {3955,5},{5810, 5},{3966, 5},{3967, 5} } }, ["norseman"] = { outfit = { male = 251, female = 252, addon = 3, storage = 10045 }, items = { {7290,15} } }, ["nightmare"] = { outfit = { male = 268, female = 269, addon = 3, storage = 10046 }, items = { {6500,200} } }, ["jester"] = { outfit = { male = 273, female = 270, addon = 3, storage = 10047 }, items = { {2160, 25} } }, ["brotherhood"] = { outfit = { male = 278, female = 279, addon = 3, storage = 10048 }, items = { {6500,200} } } } local v, removeItems = cfg[param], 0, 0 if(param == "") then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Please type !addon "outfit') player:showTextDialog( 5914, text) return false end if (v == nil) then player:sendTextMessage(MESSAGE_INFO_DESCR, "There is no such as outfit named "..param..", here is the list of available outfit.") player:showTextDialog(5914, text) return false end if(player:getStorageValue(v.outfit.storage) < 1) then for i = 1, #v.items do if(player:getItemCount(v.items[i][1]) >= v.items[i][2]) then removeItems = removeItems+1 end end if(removeItems == #v.items) then if(player:getSex(cid) == 1) then player:addOutfitAddon(v.outfit.male, v.outfit.addon) elseif(player:getSex(cid) == 0) then player:addOutfitAddon( v.outfit.female, v.outfit.addon) end for i = 1, #v.items do player:removeItem( v.items[i][1], v.items[i][2]) end player:sendTextMessage(MESSAGE_INFO_DESCR, "Enjoy your new addons to your "..param.." outfit!") player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW) player:setStorageValue( v.outfit.storage, 1) else for i = 1, #v.items do player:sendTextMessage(MESSAGE_INFO_DESCR, "Tu necesitas " .. v.items[i][2] .. "x " .. ItemType(v.items[i][1]):getName() .. " para obtener el "..param.." addon.") end end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Usted ya obtuvo el "..param..".") end return false end Créditos : david.
  25. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) local talkState = {} local rtnt = {} 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 npcHandler:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. I need your help and I'll reward you with nice addons if you help me! Just say {addons} or {help} if you don't know what to do.") addoninfo = { ['first citizen addon'] = {cost = 0, items = {{5878,20}}, outfit_female = 136, outfit_male = 128, addon = 1, storageID = 10042}, ['second citizen addon'] = {cost = 0, items = {{5890,50}, {5902,25}, {2480,1}}, outfit_female = 136, outfit_male = 128, addon = 2, storageID = 10043}, ['first hunter addon'] = {cost = 0, items = {{5876,50}, {5948,50}, {5891,5}, {5887,1}, {5889,1}, {5888,1}}, outfit_female = 137, outfit_male = 129, addon = 1, storageID = 10044}, ['second hunter addon'] = {cost = 0, items = {{5875,1}}, outfit_female = 137, outfit_male = 129, addon = 2, storageID = 10045}, ['first knight addon'] = {cost = 0, items = {{5880,50}, {5892,1}}, outfit_female = 139, outfit_male = 131, addon = 1, storageID = 10046}, ['second knight addon'] = {cost = 0, items = {{5893,50}, {11422,1}, {5885,1}, {5887,1}}, outfit_female = 139, outfit_male = 131, addon = 2, storageID = 10047}, ['first mage addon'] = {cost = 0, items = {{2182,1}, {2186,1}, {2185,1}, {8911,1}, {2181,1}, {2183,1}, {2190,1}, {2191,1}, {2188,1}, {8921,1}, {2189,1}, {2187,1}, {2392,30}, {5809,1}, {2193,20}}, outfit_female = 138, outfit_male = 130, addon = 1, storageID = 10048}, ['second mage addon'] = {cost = 0, items = {{5903,1}}, outfit_female = 138, outfit_male = 130, addon = 2, storageID = 10049}, ['first summoner addon'] = {cost = 0, items = {{5878,20}}, outfit_female = 141, outfit_male = 133, addon = 1, storageID = 10050}, ['second summoner addon'] = {cost = 0, items = {{5894,35}, {5911,20}, {5883,40}, {5922,35}, {5879,10}, {5881,30}, {5882,40}, {2392,3}, {5905,30}}, outfit_female = 141, outfit_male = 133, addon = 2, storageID = 10051}, ['first barbarian addon'] = {cost = 0, items = {{5884,1}, {5885,1}, {5910,25}, {5911,25}, {5886,10}}, outfit_female = 147, outfit_male = 143, addon = 1, storageID = 10011}, ['second barbarian addon'] = {cost = 0, items = {{5880,25}, {5892,1}, {5893,25}, {5876,25}}, outfit_female = 147, outfit_male = 143, addon = 2, storageID = 10012}, ['first druid addon'] = {cost = 0, items = {{5896,20}, {5897,20}}, outfit_female = 148, outfit_male = 144, addon = 1, storageID = 10013}, ['second druid addon'] = {cost = 0, items = {{5906,100}}, outfit_female = 148, outfit_male = 144, addon = 2, storageID = 10014}, ['first nobleman addon'] = {cost = 300000, items = {}, outfit_female = 140, outfit_male = 132, addon = 1, storageID = 10015}, ['second nobleman addon'] = {cost = 300000, items = {}, outfit_female = 140, outfit_male = 132, addon = 2, storageID = 10016}, ['first oriental addon'] = {cost = 0, items = {{5945,1}}, outfit_female = 150, outfit_male = 146, addon = 1, storageID = 10017}, ['second oriental addon'] = {cost = 0, items = {{5883,30}, {5895,30}, {5891,2}, {5912,30}}, outfit_female = 150, outfit_male = 146, addon = 2, storageID = 10018}, ['first warrior addon'] = {cost = 0, items = {{5925,40}, {5899,40}, {5884,1}, {5919,1}}, outfit_female = 142, outfit_male = 134, addon = 1, storageID = 10019}, ['second warrior addon'] = {cost = 0, items = {{5880,40}, {5887,1}}, outfit_female = 142, outfit_male = 134, addon = 2, storageID = 10020}, ['first wizard addon'] = {cost = 0, items = {{2536,1}, {2492,1}, {2488,1}, {2123,1}}, outfit_female = 149, outfit_male = 145, addon = 1, storageID = 10021}, ['second wizard addon'] = {cost = 0, items = {{5922,40}}, outfit_female = 149, outfit_male = 145, addon = 2, storageID = 10022}, ['first assassin addon'] = {cost = 0, items = {{5912,20}, {5910,20}, {5911,20}, {5913,20}, {5914,20}, {5909,20}, {5886,10}}, outfit_female = 156, outfit_male = 152, addon = 1, storageID = 10023}, ['second assassin addon'] = {cost = 0, items = {{5804,1}, {5930,10}}, outfit_female = 156, outfit_male = 152, addon = 2, storageID = 10024}, ['first beggar addon'] = {cost = 0, items = {{5878,30}, {5921,20}, {5913,10}, {5894,10}}, outfit_female = 157, outfit_male = 153, addon = 1, storageID = 10025}, ['second beggar addon'] = {cost = 0, items = {{5883,30}, {2160,2}}, outfit_female = 157, outfit_male = 153, addon = 2, storageID = 10026}, ['first pirate addon'] = {cost = 0, items = {{6098,30}, {6126,30}, {6097,30}}, outfit_female = 155, outfit_male = 151, addon = 1, storageID = 10027}, ['second pirate addon'] = {cost = 0, items = {{6101,1}, {6102,1}, {6100,1}, {6099,1}}, outfit_female = 155, outfit_male = 151, addon = 2, storageID = 10028}, ['first shaman addon'] = {cost = 0, items = {{5810,5}, {3955,5}, {5015,1}}, outfit_female = 158, outfit_male = 154, addon = 1, storageID = 10029}, ['second shaman addon'] = {cost = 0, items = {{3966,5}, {3967,5}}, outfit_female = 158, outfit_male = 154, addon = 2, storageID = 10030}, ['first norseman addon'] = {cost = 0, items = {{7290,5}}, outfit_female = 252, outfit_male = 251, addon = 1, storageID = 10031}, ['second norseman addon'] = {cost = 0, items = {{7290,10}}, outfit_female = 252, outfit_male = 251, addon = 2, storageID = 10032}, ['first jester addon'] = {cost = 0, items = {{5912,20}, {5913,20}, {5914,20}, {5909,20}}, outfit_female = 270, outfit_male = 273, addon = 1, storageID = 10033}, ['second jester addon'] = {cost = 0, items = {{5912,20}, {5910,20}, {5911,20}, {5912,20}}, outfit_female = 270, outfit_male = 273, addon = 2, storageID = 10034}, ['first demonhunter addon'] = {cost = 0, items = {{5905,30}, {5906,40}, {5954,20}, {6500,50}}, outfit_female = 288, outfit_male = 289, addon = 1, storageID = 10035}, ['second demonhunter addon'] = {cost = 0, items = {{5906,50}, {6500,200}}, outfit_female = 288, outfit_male = 289, addon = 2, storageID = 10036}, ['first nightmare addon'] = {cost = 0, items = {{6500,750}}, outfit_female = 269, outfit_male = 268, addon = 1, storageID = 10037}, ['second nightmare addon'] = {cost = 0, items = {{6500,750}}, outfit_female = 269, outfit_male = 268, addon = 2, storageID = 10038}, ['first brotherhood addon'] = {cost = 0, items = {{6500,750}}, outfit_female = 279, outfit_male = 278, addon = 1, storageID = 10039}, ['second brotherhood addon'] = {cost = 0, items = {{6500,750}}, outfit_female = 279, outfit_male = 278, addon = 2, storageID = 10040}, ['first yalaharian addon'] = {cost = 0, items = {{9955,1}}, outfit_female = 324, outfit_male = 325, addon = 1, storageID = 10041}, ['second yalaharian addon'] = {cost = 0, items = {{9955,1}}, outfit_female = 324, outfit_male = 325, addon = 2, storageID = 10041} -- next storage 10052 -- next storage 10052 -- next storage 10052 -- next storage 10052 -- next storage 10052 -- next storage 10052 -- next storage 10052 -- } local o = {'citizen', 'hunter', 'knight', 'mage', 'nobleman', 'summoner', 'warrior', 'barbarian', 'druid', 'wizard', 'oriental', 'pirate', 'assassin', 'beggar', 'shaman', 'norseman', 'nighmare', 'jester', 'yalaharian', 'brotherhood'} function creatureSayCallback(cid, type, msg) local talkUser = cid if(not npcHandler:isFocused(cid)) then return false end if addoninfo[msg] ~= nil then if (getPlayerStorageValue(cid, addoninfo[msg].storageID) ~= -1) then npcHandler:say('You already have this addon!', cid) npcHandler:resetNpc() else local itemsTable = addoninfo[msg].items local items_list = '' if table.maxn(itemsTable) > 0 then for i = 1, table.maxn(itemsTable) do local item = itemsTable items_list = items_list .. item[2] .. ' ' .. ItemType(item[1]):getName() if i ~= table.maxn(itemsTable) then items_list = items_list .. ', ' end end end local text = '' if (addoninfo[msg].cost > 0) then text = addoninfo[msg].cost .. ' gp' elseif table.maxn(addoninfo[msg].items) then text = items_list elseif (addoninfo[msg].cost > 0) and table.maxn(addoninfo[msg].items) then text = items_list .. ' and ' .. addoninfo[msg].cost .. ' gp' end npcHandler:say('For ' .. msg .. ' you will need ' .. text .. '. Do you have it all with you?', cid) rtnt[talkUser] = msg talkState[talkUser] = addoninfo[msg].storageID return true end elseif msgcontains(msg, "yes") then if (talkState[talkUser] > 10010 and talkState[talkUser] < 10100) then local items_number = 0 if table.maxn(addoninfo[rtnt[talkUser]].items) > 0 then for i = 1, table.maxn(addoninfo[rtnt[talkUser]].items) do local item = addoninfo[rtnt[talkUser]].items if (getPlayerItemCount(cid,item[1]) >= item[2]) then items_number = items_number + 1 end end end if(getPlayerMoney(cid) >= addoninfo[rtnt[talkUser]].cost) and (items_number == table.maxn(addoninfo[rtnt[talkUser]].items)) then doPlayerRemoveMoney(cid, addoninfo[rtnt[talkUser]].cost) if table.maxn(addoninfo[rtnt[talkUser]].items) > 0 then for i = 1, table.maxn(addoninfo[rtnt[talkUser]].items) do local item = addoninfo[rtnt[talkUser]].items doPlayerRemoveItem(cid,item[1],item[2]) end end doPlayerAddOutfit(cid, addoninfo[rtnt[talkUser]].outfit_male, addoninfo[rtnt[talkUser]].addon) doPlayerAddOutfit(cid, addoninfo[rtnt[talkUser]].outfit_female, addoninfo[rtnt[talkUser]].addon) setPlayerStorageValue(cid,addoninfo[rtnt[talkUser]].storageID,1) npcHandler:say('Here you are.', cid) else npcHandler:say('You do not have needed items!', cid) end rtnt[talkUser] = nil talkState[talkUser] = 0 npcHandler:resetNpc() return true end elseif msgcontains(msg, "addon") then npcHandler:say('I can give you addons for {' .. table.concat(o, "}, {") .. '} outfits.', cid) rtnt[talkUser] = nil talkState[talkUser] = 0 npcHandler:resetNpc() return true elseif msgcontains(msg, "help") then npcHandler:say('To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.', cid) rtnt[talkUser] = nil talkState[talkUser] = 0 npcHandler:resetNpc() return true else if talkState[talkUser] ~= nil then if talkState[talkUser] > 0 then npcHandler:say('Come back when you get these items.', cid) rtnt[talkUser] = nil talkState[talkUser] = 0 npcHandler:resetNpc() return true end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  • Quem Está Navegando   0 membros estão online

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