Ir para conteúdo

Flavio S

Membro
  • Registro em

  • Última visita

Tudo que Flavio S postou

  1. Flavio S postou uma resposta no tópico em Ouvidoria
    Ué eu derrubei o tk e não fui banido EHUEEUH (comedinhas presenciou isso ele sabe...), ai uso uma outra account por motivos que não prefiro revelar, e tomo ban HEUHEUEHU, fala logo que tu não gostava de mim e já queria me banir a muito tempo luan, que fica mais bonito.
  2. Creio que seja esse ou não ? http://www.tibiaking.com/forum/topic/55543-tfs-1x-sistema-de-reset/
  3. Se foi feito pra tfs 1.1, acho que sim néh.
  4. A pedido desse tópico fiz a talkaction : http://www.tibiaking.com/forum/topic/55478-pedido-comando-de-mute-para-tutor/ data/talkactions/script/mute.lua TFS 1.1 : function onSay(player, words, param) local storage = 456112 if words == "/mute" then local mute = param:split(",") if mute[1] == nil or mute[1] == " " then player:sendCancelMessage("Invalid player specified.") return false end if mute[2] == nil or mute[2] == " " then player:sendCancelMessage("Invalid time specified.") return false end local target = Player(mute[1]) local time = tonumber(mute[2]) local condition = Condition(CONDITION_MUTED) condition:setParameter(CONDITION_PARAM_TICKS, time*60*1000) if player:getAccountType() < ACCOUNT_TYPE_TUTOR then return false end if target == nil then player:sendCancelMessage("A player with that name is not online.") return false end if target:getAccountType() >= ACCOUNT_TYPE_TUTOR then player:sendCancelMessage("Only player can be mutated") return false end target:addCondition(condition) target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been muted by " .. player:getName() .. " , to "..time.. " minutes.") player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You muted " .. target:getName() .." to "..time.." minutes.") target:setStorageValue(storage, 1) return false end if words == "/unmute" then local remove = Player(param) if player:getAccountType() < ACCOUNT_TYPE_TUTOR then return false end if remove == nil then player:sendCancelMessage("A player with that name is not online.") return false end if remove:getAccountType() >= ACCOUNT_TYPE_TUTOR then return false end if remove:getStorageValue(storage) == 1 then remove:removeCondition(CONDITION_MUTED) remove:setStorageValue(storage, -1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have unmute" .. remove:getName() ..".") remove:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been unmute by " .. player:getName() ..".") else player:sendCancelMessage("A player " .. remove:getName() .. "is not mutated") end end return false end TFS 1.0 : em talkactions.XML, adicione : <talkaction words="/mute" separator=" " script="mute.lua" /> <talkaction words="/unmute" separator=" " script="mute.lua" /> Modo de usar : /mute Linus, 1 /unmute Linus
  5. Os items para receber o addon é configurável. talkactions.XML <talkaction words="!buyaddon" 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.
  6. !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.
  7. 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 : Flavio S.
  8. 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
  9. varkhal.lua 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[i] 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[i] 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[i] 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()) varkhal.XML <?xml version="1.0" encoding="UTF-8"?> <npc name="Varkhal" script="varkhal.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100" /> <look type="128" head="94" body="66" legs="114" feet="95" addons="0" /> </npc> Créditos : ???
  10. Esse npc permite escolher qual task o player irá fazer : Adonai.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Adonai" script="tasks.lua" walkinterval="2000" speed ="0" floorchange="0"> <health now="100" max="100"/> <look type="433" head="58" body="113" legs="50" feet="78" addons="1" mount="688"/> </npc> tasks.lua local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local xmsg = {} 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 local storage = 62003 local monsters = { ["Dragons"] = {storage = 5010, mstorage = 19000, amount = 10, exp = 5000, items = {{id = 2157, count = 1}, {id = 2160, count = 3}}}, ["Dragon Lords"] = {storage = 5011, mstorage = 19001, amount = 10, exp = 10000, items = {{id = 2492, count = 1}, {id = 2160, count = 5}}}, ["Hydras"] = {storage = 5012, mstorage = 19002, amount = 10, exp = 18000, items = {{id = 2195, count = 1}, {id = 2157, count = 8}}}, ["Demons"] = {storage = 5013, mstorage = 19003, amount = 10, exp = 20000, items = {{id = 2520, count = 1}, {id = 2160, count = 10}}} } local function getItemsFromTable(itemtable) local text = "" for v = 1, #itemtable do count, info = itemtable[v].count, ItemType(itemtable[v].id) local ret = ", " if v == 1 then ret = "" elseif v == #itemtable then ret = " and " end text = text .. ret text = text .. (count > 1 and count or info:getArticle()).." "..(count > 1 and info:getPluralName() or info:getName()) end return text end local function Cptl(f, r) return f:upper()..r:lower() end function creatureSayCallback(cid, type, msg) local player, cmsg = Player(cid), msg:gsub("(%a)([%w_']*)", Cptl) if not npcHandler:isFocused(cid) then if msg == "hi" or msg == "hello" then npcHandler:addFocus(cid) if player:getStorageValue(storage) == -1 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. ", " text = text .. ""..x.amount.." {"..k.."}" end end if n > 1 then npcHandler:say("I have several tasks for you to kill monsters"..text..", which one do you choose? I can also show you a {list} with rewards and you can {stop} a task if you want.", cid) npcHandler.topic[cid] = 1 xmsg[cid] = msg elseif n == 1 then npcHandler:say("I have one last task for you"..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks, I have nothing for you to do anymore, good job though.", cid) end elseif player:getStorageValue(storage) == 1 then for k, x in pairs(monsters) do if player:getStorageValue(x.storage) == 1 then npcHandler:say("Did you kill "..x.amount.." "..k.."?", cid) npcHandler.topic[cid] = 2 xmsg[cid] = k end end end else return false end elseif monsters[cmsg] and npcHandler.topic[cid] == 1 then if player:getStorageValue(monsters[cmsg].storage) == -1 then npcHandler:say("Good luck, come back when you killed "..monsters[cmsg].amount.." "..cmsg..".", cid) player:setStorageValue(storage, 1) player:setStorageValue(monsters[cmsg].storage, 1) else npcHandler:say("You already did the "..cmsg.." mission.", cid) end npcHandler.topic[cid] = 0 elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then local x = monsters[xmsg[cid]] if player:getStorageValue(x.mstorage) >= x.amount then npcHandler:say("Good job, here is your reward, "..getItemsFromTable(x.items)..".", cid) for g = 1, #x.items do player:addItem(x.items[g].id, x.items[g].count) end player:addExperience(x.exp) player:setStorageValue(x.storage, 2) player:setStorageValue(storage, -1) npcHandler.topic[cid] = 3 else npcHandler:say("You didn't kill them all, you still need to kill "..x.amount -(player:getStorageValue(x.mstorage) + 1).." "..xmsg[cid]..".", cid) end elseif msgcontains(msg, "task") and npcHandler.topic[cid] == 3 then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" end end if text ~= "" then npcHandler:say("Want to do another task? You can choose "..text..".", cid) npcHandler.topic[cid] = 1 else npcHandler:say("You already did all tasks.", cid) end elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 1 then npcHandler:say("Ok then.", cid) npcHandler.topic[cid] = 0 elseif msgcontains(msg, "stop") then local text, n = "", 0 for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then n = n + 1 text = text .. (n == 1 and "" or ", ") text = text .. "{"..k.."}" if player:getStorageValue(x.storage) == 1 then player:setStorageValue(x.storage, -1) end end end if player:getStorageValue(storage) == 1 then npcHandler:say("Alright, let me know if you want to continue an other task, you can still choose "..text..".", cid) else npcHandler:say("You didn't start any new task yet, if you want to start one, you can choose "..text..".", cid) end player:setStorageValue(storage, -1) npcHandler.topic[cid] = 1 elseif msgcontains(msg, "list") then local text = "Tasks\n\n" for k, x in pairs(monsters) do if player:getStorageValue(x.mstorage) < x.amount then text = text ..k .." ["..(player:getStorageValue(x.mstorage) + 1).."/"..x.amount.."]:\n Rewards:\n "..getItemsFromTable(x.items).."\n "..x.exp.." experience \n\n" else text = text .. k .." [DONE]\n" end end player:showTextDialog(1949, "" .. text) npcHandler:say("Here you are.", cid) elseif msgcontains(msg, "bye") then npcHandler:say("Bye.", cid) npcHandler:releaseFocus(cid) else npcHandler:say("What?", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) creaturescripts.xml <event type="kill" name="Tasks" script="killtasks.lua"/> login.lua player:registerEvent("Tasks") killtasks.lua local config = { ['dragon'] = {amount = 10, storage = 19000, startstorage = 5010, startvalue = 1}, ['dragon lord'] = {amount = 10, storage = 19001, startstorage = 5011, startvalue = 1}, ['hydra'] = {amount = 10, storage = 19002, startstorage = 5012, startvalue = 1}, ['demon'] = {amount = 10, storage = 19003, startstorage = 5013, startvalue = 1} } function onKill(player, target) local monster = config[target:getName():lower()] if target:isPlayer() or not monster or target:getMaster() then return true end local stor = player:getStorageValue(monster.storage)+1 if stor < monster.amount and player:getStorageValue(monster.startstorage) >= monster.startvalue then player:setStorageValue(monster.storage, stor) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'Task message: '..(stor +1)..' of '..monster.amount..' '..target:getName()..'s killed.') end if (stor +1) == monster.amount then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Congratulations, you have killed '..(stor +1)..' '..target:getName()..'s and completed the '..target:getName()..'s mission.') player:setStorageValue(monster.storage, stor +1) end return true end ___________________________________________________________________________________________ Como funciona ? O NPC oferece-lhe várias task, você pode escolher qual você deseja fazer. Se você não matar todos os monstros, o NPC irá dizer-lhe quantos você ainda tem que matar. Você pode para ver a lista de recompensa e as tasks que você já fez. Você pode parar com as tasks e ir fazer outra e depois continuar a antiga. Ao terminar as task elas não serão mais mencionados pelo NPC mas será mostrado como terminado na lista. Quando terminar as task o npc, dirá que todas foram completadas. Créditos : Limos, Summ
  11. 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()) 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> Créditos : zbisu.

Informação Importante

Confirmação de Termo