Ir para conteúdo

comedinhasss

Herói
  • Total de itens

    520
  • Registro em

  • Última visita

  • Dias Ganhos

    7

Tudo que comedinhasss postou

  1. Adicione em function.lua function getPlayerMarriage(player) local rows = db.getResult("SELECT `marriage` FROM `players` WHERE `id` = " .. player .. ";") local marry = rows:getDataInt("marriage") if marry ~= 0 then return marry else return 0 endendfunction addMarryStatus(player,partner) db.executeQuery("UPDATE `players` SET `marrystatus` = " .. partner .. " WHERE `id` = " .. player .. ";")endfunction doCancelMarryStatus(player) db.executeQuery("UPDATE `players` SET `marrystatus` = 0 WHERE `id` = " .. player .. ";")endfunction getMarryStatus(player) local stat = db.getResult("SELECT `id` FROM `players` WHERE `marrystatus` = " .. player .. ";") if(stat:getID() == -1) then return 0 else local info = stat:getDataInt("id") return info endendfunction getOwnMarryStatus(player) local stat = db.getResult("SELECT `marrystatus` FROM `players` WHERE `id` = " .. player .. ";") if(stat:getID() == -1) then return 0 else local info = stat:getDataInt("marrystatus") return info endendfunction isOnline(player) local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";") local on = rows:getDataInt("online") if on ~= 0 then return 1 else return 0 endend Crie um npc: <?xml version="1.0" encoding="UTF-8"?> <npc name="Nome_Do_Npc" script="data/npc/scripts/wedding.lua" access="3" lookdir="2"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="57" head="20" body="30" legs="40" feet="50"/> <parameters> <parameter key="message_greet" value="Seja bem vindo |PLAYERNAME|! Eu posso te {casar}." /> <parameter key="module_keywords" value="1" /> </parameters> </npc> Script do npc: 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, 'casar') or msgcontains(msg, 'marriage') then if getPlayerStorageValue(cid,3066) == -1 then selfSay('Voce gostaria de se casar?', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid,3066) == 1 then local fid = getPlayerGUID(cid) local marrystatus = getOwnMarryStatus(fid) if marrystatus ~= 0 then local newpartner = getPlayerNameByGUID(marrystatus) selfSay('Voce ja definiu a data do casamento com {' .. newpartner .. '}, agora eu preciso conversar com seu parceiro. Voce quer {cancelar}?', cid) talkState[talkUser] = 5 else setPlayerStorageValue(cid,3066,-1) selfSay('Voce gostaria de se casar?', cid) talkState[talkUser] = 1 end elseif getPlayerStorageValue(cid,3066) == 2 then selfSay('Voce ja esta casado. Se voce quer {divorcio}, basta dizer.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'divorcio') then if getPlayerStorageValue(cid,3066) == 2 then selfSay('Voce tem certeza que quer se divorciar do seu parceiro?', cid) talkState[talkUser] = 6 else selfSay('Voce nao esta casado. Gostaria de se {casar}?', cid) talkState[talkUser] = 0 end end if talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) local marrystatus = getMarryStatus(fid) if marrystatus == FALSE then selfSay('E qual o nome do seu futuro parceiro?', cid) talkState[talkUser] = 2 else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} marcou a data do casamento com voce. Voce quer {continuar} ou {cancelar} o casamento?', cid) talkState[talkUser] = 4 end end elseif talkState[talkUser] == 2 then local p = msg local player = getPlayerName(cid) local fid = getPlayerGUID(cid) local sid = getPlayerGUIDByName(p) if sid == 0 then selfSay('Nao existe nenhum jogador com este nome.', cid) talkState[talkUser] = 0 elseif sid == fid then selfSay('Nao se preocupe, voce sempre estara casado com voce mesmo, garoto.', cid) talkState[talkUser] = 0 else local marrystatus = getMarryStatus(fid) local pmarriage = getPlayerMarriage(sid) local ownstatus = getOwnMarryStatus(cid) if pmarriage == FALSE then if marrystatus == FALSE then if ownstatus == FALSE then setPlayerStorageValue(cid,3066,1) addMarryStatus(fid,sid) selfSay('Voce acabou de marcar um casamento com {' .. p .. '}.', cid) talkState[talkUser] = 0 else local partnername = getPlayerNameByGUID(ownstatus) selfSay('{' .. p .. '} ja marcou a data do casamento com {' .. partnername .. '}.', cid) talkState[talkUser] = 0 end else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} marcou a data do casamento com voce. Voce deseja {continuar} ou {cancelar} o casamento?', cid) talkState[talkUser] = 4 end else local pname = getPlayerNameByGUID(pmarriage) selfSay('Desculpe, mas {' .. p .. '} esta casado com {' .. pname .. '}.', cid) talkState[talkUser] = 0 end end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'continuar') then local fid = getPlayerGUID(cid) local sid = getMarryStatus(fid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) local tmf = getCreaturePosition(cid) local tms = getCreaturePosition(pid) local text = {'Eu te amo!','Meu amor!','Minha paixao!'} local chance1 = math.random(1,table.getn(text)) local chance2 = math.random(1,table.getn(text)) local dateFormat = "%A %d"..getMonthDayEnding(os.date("%d")).." %B %Y" local ring = doPlayerAddItem(cid,10502,1) local ring2 = doPlayerAddItem(pid,10502,1) if isOnline(fid) == TRUE and isOnline(sid) == TRUE then if getDistanceBetween(tmf, tms) <= 3 then setPlayerStorageValue(cid,3066,2) setPlayerStorageValue(pid,3066,2) doCancelMarryStatus(fid) doCancelMarryStatus(sid) setPlayerPartner(cid,sid) setPlayerPartner(pid,fid) doPlayerAddOutfitId(cid,23,0) doPlayerAddOutfitId(pid,23,0) doItemSetAttribute(ring, "description", "" .. getCreatureName(cid) .. " & " .. getCreatureName(pid) .. " forever - married on " ..os.date(dateFormat).. ".") doItemSetAttribute(ring2, "description", "" .. getCreatureName(cid) .. " & " .. getCreatureName(pid) .. " forever - married on " ..os.date(dateFormat).. ".") doCreatureSay(cid, text[chance1], TALKTYPE_ORANGE_1) doCreatureSay(pid, text[chance2], TALKTYPE_ORANGE_1) doSendMagicEffect(tmf, 35) doSendMagicEffect(tms, 35) selfSay('Parabens! Agora ja podem se beijar! Sempre que quiser este efeito, basta dizer {love}. Voce precisa estar perto do seu parceiro.', cid) talkState[talkUser] = 0 else selfSay('Seu parceiro deve estar perto de voce para que voces possam se casar!', cid) talkState[talkUser] = 0 end else selfSay('Voce e seu novo parceiro devem estar online ao mesmo tempo.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'cancelar') then local fid = getPlayerGUID(cid) local sid = getMarryStatus(fid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) if isOnline(sid) == TRUE then setPlayerStorageValue(pid,3066,-1) end doCancelMarryStatus(sid) selfSay('Voce cancelou sua data de casamento com {' .. marryname .. '}.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 5 then if msgcontains(msg, 'cancelar') or msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) setPlayerStorageValue(cid,3066,-1) doCancelMarryStatus(fid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 6 then if msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) local sid = getPlayerPartner(cid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) if (isOnline(fid) == TRUE and isOnline(sid) == TRUE) then setPlayerStorageValue(cid,3066,-1) setPlayerStorageValue(pid,3066,-1) setPlayerPartner(cid,0) setPlayerPartner(pid,0) doPlayerAddOutfitId(cid,23,-1) doPlayerAddOutfitId(pid,23,-1) selfSay('Voce acabou de se divorciar do seu antigo parceiro.', cid) talkState[talkUser] = 0 else selfSay('Voce e seu parceiro deve estar online ao mesmo tempo.', cid) talkState[talkUser] = 0 end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Adicione na table se seu servidor for mysql: ALTER TABLE `players` ADD `marrystatus` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `marriage` ; Em talkactions.xml <talkaction words="love" script="love.lua"/> Adicione nos scripts: Love.lua function onSay(cid, words, param) local text = {'I love you!','My love!','Baby dear!'} local chance1 = math.random(1,table.getn(text)) local chance2 = math.random(1,table.getn(text)) local sid = getPlayerPartner(cid) if sid > 0 then if isOnline(sid) == TRUE then local sname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(sname) local tmf = getCreaturePosition(cid) local tms = getCreaturePosition(pid) if getDistanceBetween(tmf, tms) <= 3 then doCreatureSay(cid, text[chance1], TALKTYPE_ORANGE_1) doCreatureSay(pid, text[chance2], TALKTYPE_ORANGE_1) doSendMagicEffect(tmf, 35) doSendMagicEffect(tms, 35) return TRUE end end endend
  2. Exelente, agora os noobs iniciantes não terão problema caso tentarem os rakiar... Sei que é imposivel mais pode acontecer...
  3. Aleluia um tópico novo nesta área =OOO Dez de janero/fevereiro sem postarem alguma coisa que ajude o publico (só teve minha lista) Adicionado: http://www.xtibia.com/forum/topic/137518-lista-de-codes-atualizada/
  4. http://www.xtibia.com/forum/topic/137248-passando-um-otserv-para-860/ Denovo, tópico reformulado e bug das hotkeys adicionados para serem corrigidos...
    1. felzan

      felzan

      Sabe quando se bota um item(gold coin) na bag ele se auto reagrupa com os do mesmo tipo? como no gloibal?

    2. comedinhasss
  5. Atualizado, Agora para npc de addon... e para potions 100% igual ao global (Peguei da tfs 0.4)
  6. Devil pensei que tinha parado com o xtibia... (pediparaentranoseulugar) Bom o cara que postou isso e da otland.. é o mesmo que eu uso no alissow server só que esse é o mais avançado... O nome do criador do tópico é: Ninkobi, quem fez algumas edições que estão parecidas com o que você pegou foi o Master-m Se quiser também -- !buyBless by Piotrek1447 (Razer) local bless = {1, 2, 3, 4, 5} -- Dont touch this. local cost = 1 -- Price in gp. function onSay(cid, words, param) for i = 1, table.maxn(bless) do if(getPlayerBlessing(cid, bless[i])) then doPlayerSendCancel(cid, "You have already all blessings.") return end end if(doPlayerRemoveMoney(cid, cost) == TRUE) then for i = 1, table.maxn(bless) do doPlayerAddBlessing(cid, bless[i]) end doPlayerSendCancel(cid, "You bought all blessing.") else doPlayerSendCancel(cid, "You don\'t have enough money.") end end
  7. Exelente... Muito bom para os iniciantes de plantão =D
  8. Bom... Coloquei para ir até +10 não testei se o ataque está arrumado... eu fiz somente uma alteração... tipo ele almenta de 9 em 9 parece... dai eu vou ver aqui como colocar... --- Perfect refine system by Mock the bear (MTB). --- Email: [email]mock_#####@hotmail.com[/email] -- &a = weapon attack -- &d = weapon defense -- &s = shield defense -- &p = armor defense -- # = nivel do item -- @ = max level local gain = { gainArmor='&p+(1)',loseArmor='&p-(1)', gainShield='&s+#',loseShield='&s-(#+1)', gainAttack='&a+(1*(#))',loseAttack='&a-(1*(#+1))', gainDefense='&d+(1*(#))',loseDefense='&d-(1*(#+1))', chance='(100/math.sqrt((((@/4)+(#*2))/@)*#))', maxlvl = 10, blocked_ids = {8881} } local it = { --[itemid] = [percent] [8306] = 0, -- 0% additional [8305] = 100, -- 50% } if not setItemName then function setItemName(uid,name) return doItemSetAttribute(uid,'name',name) end function setItemArmor(uid,name) return doItemSetAttribute(uid,'armor',name) end function setItemDefense(uid,name) return doItemSetAttribute(uid,'defense',name) end function setItemAttack(uid,name) return doItemSetAttribute(uid,'attack',name) end function getItemAttack(uid) return getItemAttribute(uid,'attack') end function getItemDefense(uid) return getItemAttribute(uid,'defense') end function getItemArmor(uid) if type(uid) == 'number' then return getItemAttribute(uid,'armor') else return getItemInfo(uid.itemid).armor end end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 then return true end return false end local function getWeaponLevel(uid) -- Function by Mock the bear. uid = uid or 0 local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or '' local lvl = string.match(name,'%s%+(%d+)%s*') return tonumber(lvl) or 0 end local function doTransform(s,i) -- Function by Mock the bear. local c = string.gsub(s,'@',gain.maxlvl) local c = string.gsub(c,'&a',(getItemAttack(i.uid) ~= 0 and getItemAttack(i.uid) or getItemInfo(i.itemid).attack)) local c = string.gsub(c,'&d',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense)) local c = string.gsub(c,'&s',(getItemDefense(i.uid) ~= 0 and getItemDefense(i.uid) or getItemInfo(i.itemid).defense)) local c = string.gsub(c,'&p',(getItemArmor(i.uid) ~= 0 and getItemArmor(i.uid) or getItemInfo(i.itemid).armor)) local c = string.gsub(c,'#',getWeaponLevel(i)) local q = assert(loadstring('return '..c)) return math.floor(assert(q())) end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(gain.blocked_ids, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendTextMessage(cid, 24,"Você não pode refinar este item.") return TRUE end if isCreature(itemEx.uid) == TRUE then return FALSE end local level = getWeaponLevel(itemEx) local chance = doTransform(gain.chance,itemEx) if level == gain.maxlvl then doSendMagicEffect(toPosition, 2) return doPlayerSendTextMessage(cid, 24,"Seu item já está no nível máximo de upgrade.") end doPlayerSendTextMessage(cid, 24,"Tentando refinar com "..(chance+it[item.itemid] > 100 and 100 or chance+it[item.itemid]).."% de sucesso!") if chance+it[item.itemid] >= math.random(0,100) then local nm = getItemName(itemEx.uid) local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^ slot = slot~='' and ' '..slot or slot setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1)..slot) addEvent(doPlayerSendTextMessage,500,cid, 24,"Seu item foi refinado com sucesso para +"..(level+1)..slot..".") doSendMagicEffect(toPosition, 12) if isArmor(itemEx) then local get = doTransform(gain.gainArmor,itemEx) setItemArmor(itemEx.uid,get) elseif isBow(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx)) elseif isWeapon(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.gainDefense,itemEx)) elseif isShield(itemEx.uid) then setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx)) end else if level == 0 then addEvent(doPlayerSendTextMessage,500,cid, 24,"No effect.") doSendMagicEffect(toPosition, 2) elseif level > 0 then local nm = getItemName(itemEx.uid) local slot = nm:match('(%[.+%])') or '' ---If you server use slot system dont change it ^^ slot = slot~='' and ' '..slot or slot if level == 1 then setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..slot) addEvent(doPlayerSendTextMessage,500,cid, 24,"Seu item voltou ao normal.") else setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1)..slot) addEvent(doPlayerSendTextMessage,500,cid, 24,"Seu item voltou para +"..(level-1)..slot..".") end if isArmor(itemEx) then setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx)) elseif isWeapon(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx)) setItemDefense(itemEx.uid, doTransform(gain.loseDefense,itemEx)) elseif isBow(itemEx.uid) then setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx)) elseif isShield(itemEx.uid) then setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx)) end end doSendMagicEffect(toPosition, 9) end doRemoveItem(item.uid,1) return true end
  9. novo e-mail @xtibia.com =D

  10. Xtibia Atualizado (nova Skin) e fotinha do perfil tb.. Conexão de twtter com xtibia estabelecida

  11. Removido dos destaques por haver 2 e ser o mais atrasado
  12. tipo embaixo e o comano do que ele faz.. else if(tmpStrValue == "hitchance") você somente usa o que esta entre aspas hitchance <attribute key="hitchance" value="10"/> ficaria assim já falei isso por pm mais falo denovo =I
  13. Achei alguns... eles estão na programação do server: Ai estão até alguns que você não deve conhece... tem todos os atribultos do que vão fazer e tudo mais....
  14. Eu vou dar uma ajudada em progrmação.. so que ja recomendei pessoas para o cargo (secret) e estão sendo avaliados (eu axo)

  15. Ae passei pra colaborador de script... =I

  16. Nunca compilei em linux... Na otland... donator.... eles ajuda qualquer dúvida posta tudo o que tenque fazer
  17. é amigo... vida dura... Nunca compilei se quer 1 sv 7.9 pra baxo
  18. Ou esta faltando dlls ou você adicionou alguma lib errada
  19. Meu pc concerto... vo volta a posta coisas

  20. Na pasta principal das sources aparece o executavel... eu recomendo compia somene o yatc
  21. é um erro nas sources... eu esqueci como arruma se eu lembrar aqui te falo.... e da tfs 0.3.5 eu acho...
  22. comedinhasss

    Arena.

    Olá, meu computador está travando e eu vou reiniciar aqui... o alissow server aceita somente lvl 50+ mas... para por para falar quem ganhou o servidor terá que ter aguma funão que identifique o player e fale o nome dele
  • Quem Está Navegando   0 membros estão online

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