Postado Dezembro 15, 2016 8 anos Olá, estou usando atualmente em meu server o sistema de spells por trade, do vodkart: Eu editei um pouco e está assim no meu ot: 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 local shopWindow = {} local spells = { {id=1950, buy = 900, name = "Exori Mort", spell_name = "Death Strike", vocations = {1}, level = 9}, {id=6103, buy = 1500, name = "Exevo Flam Hur", spell_name = "Fire Wave", vocations = {1}, level = 9}, {id=1961, buy = 600, name = "Light Healing", spell_name = "Exura", vocations = {1}, level = 9}, {id=1986, buy = 2000, name = "Haste", spell_name = "Utani Hur", vocations = {1}, level = 19}, {id=1955, buy = 1400, name = "Cure Burning", spell_name = "Exana Flam", vocations = {1}, level = 19}, {id=1963, buy = 1400, name = "Cure Eletrification", spell_name = "Exana Vis", vocations = {1}, level = 19}, {id=1984, buy = 1600, name = "Cure Curse", spell_name = "Exana Mort", vocations = {1}, level = 19}, {id=12655, buy = 3600, name = "Intense Healing", spell_name = "Exura Gran", vocations = {1}, level = 29}, {id=1960, buy = 5000, name = "Energy Beam", spell_name = "Exexvo Vis Lux", vocations = {1}, level = 29}, {id=1959, buy = 6800, name = "Mort Wave", spell_name = "Exexvo Mort Hur", vocations = {1}, level = 29}, {id=1976, buy = 7450, name = "Energy Wave", spell_name = "Exexvo Vis Hur", vocations = {1}, level = 39}, {id=1965, buy = 5400, name = "Strong Energy Strike", spell_name = "Exori Gran Vis", vocations = {1}, level = 39}, {id=1983, buy = 5500, name = "Fire Spirit", spell_name = "Spirit", vocations = {1}, level = 39}, {id=1959, buy = 4400, name = "Magic Shield", spell_name = "Utamo Vita", vocations = {1}, level = 39}, {id=8190, buy = 18000, name = "Gran Mort Wave", spell_name = "Exevo Dead Hur", vocations = {1}, level = 49}, {id=1962, buy = 15000, name = "Strong Flame Strike", spell_name = "Exori Gran Flam", vocations = {1}, level = 49}, {id=1982, buy = 9200, name = "Strong Haste", spell_name = "Utani Gran Hur", vocations = {1}, level = 49}, {id=10062, buy = 45000, name = "Rage of the Skies", spell_name = "Exevo Gran Mas Vis", vocations = {1}, level = 59}, {id=10942, buy = 55000, name = "Hells Core", spell_name = "Exevo Gran Mas Flam", vocations = {1}, level = 59}, {id=11134, buy = 29000, name = "Dark", spell_name = "Dark Conjurer", vocations = {1}, level = 59} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if not getPlayerLearnedInstantSpell(cid, shopWindow[item].Words) then if getPlayerLevel(cid) >= shopWindow[item].Level then if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then doPlayerRemoveMoney(cid, shopWindow[item].Price) doPlayerLearnInstantSpell(cid, shopWindow[item].Words) npcHandler:say("você aprendeu uma nova magia chamada "..shopWindow[item].Words, cid) else npcHandler:say("você não tem a vocação para comprar está spell.", cid) end else npcHandler:say("você precisa ter level "..shopWindow[item].Level.." ou mais para comprar essa magia.", cid) end else npcHandler:say("você já aprendeu essa magia.", cid) end return true end if msgcontains(msg, 'trade') or msgcontains(msg, 'spells') then for var, item in pairs(spells) do shopWindow[item.id] = {Level = item.level, Vocs = item.vocations, item_id = item.id, Price = item.buy, subType = 0, Words = item.spell_name, SpellName = item.name} end openShopWindow(cid, spells, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) No meu server não tem promotion, e tem magias editadas como se percebe. Também já editei todas no spells.xml, para os players terem que comprarem pra usá-las. Eu to testando aqui e, só as duas primeiras spells da lista dão para comprar, as outras eu gasto dinheiro mas não consigo soltar a spells =x Att. João Pedro Veja! [Edron] Rotworm Cave [Zao] Killer Caiman Hunt [Liberty Bay] Zombies Achievements fáceis de conseguir [Ankramun] Terramite Cave
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.