Excelente o script, funfa perfeitamente!
Porém uma dúvida, o sistema troca a outfit dpois de casados? e o ring de pós married é criado após o casamento ou não está adicionado ao script?
Grato pelo post!
SEM MAIS
Por delton, 09 de jul. de 2009 em NPCs, monsters e raids
info
Grupo: Visconde
Registrado: 08/01/09
Posts: 331
Reputação: 0
Char no Tibia: Orcshaball

Excelente o script, funfa perfeitamente!
Porém uma dúvida, o sistema troca a outfit dpois de casados? e o ring de pós married é criado após o casamento ou não está adicionado ao script?
Grato pelo post!
SEM MAIS
info
Grupo: Visconde
Registrado: 16/11/07
Posts: 389
Reputação: +6
Gênero: Masculino
Char no Tibia: Tiger Darm

Como eu disse no início do tópico o script é antigo, porém adaptado para 8.50 =))
Delton~~
info
Grupo: Campones
Registrado: 15/12/08
Posts: 14
Reputação: 0

Funfa certinho...Vlw ! Gostei ;p
info
Grupo: Campones
Registrado: 30/09/07
Posts: 1
Reputação: 0
Char no Tibia: Rhyrus Tera

eu usei o seu script aki no meu ot porem quando o player vai la e fala 1 fala
hi
marry
na parte do yes quando ele fala n acontece nada sera que no seu script n ta faltando a parte do sim?
info
Grupo: Campones
Registrado: 11/07/07
Posts: 50
Reputação: 0
Gênero: Masculino
Char no Tibia: Drafenous

Onde está esse function ?
E como adiciona o status no site/mysql ?
Editado Agosto 6 por godviollator
info
Grupo: Banidos
Registrado: 07/02/08
Posts: 25
Reputação: +1
Char no Tibia: Volis Xedria

Meu tambem dá o mesmo erro do Drigao
ele para ' yes '
e depois nao fala mais nada ![]()
info
Grupo: Barão
Registrado: 06/07/08
Posts: 206
Reputação: +14
Char no Tibia: Nao Jogo tibia

[08/08/2009 21:25:59] Lua Script Error: [Npc interface] [08/08/2009 21:25:59] data/npc/scripts/casamento.lua:onCreatureSay [08/08/2009 21:25:59] luaGetPlayerNameByGUID(). Player not found [08/08/2009 21:25:59] Lua Script Error: [Npc interface] [08/08/2009 21:25:59] data/npc/scripts/casamento.lua:onCreatureSay [08/08/2009 21:25:59] data/npc/scripts/casamento.lua:58: attempt to concatenate local 'marryname' (a nil value) [08/08/2009 21:25:59] stack traceback: [08/08/2009 21:25:59] data/npc/scripts/casamento.lua:58: in function 'callback' [08/08/2009 21:25:59] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay' [08/08/2009 21:25:59] data/npc/scripts/casamento.lua:8: in function <data/npc/scripts/casamento.lua:8>
Alguem sabe o que esta errado ae ?
info
Grupo: Campones
Registrado: 18/03/08
Posts: 10
Reputação: +1
Char no Tibia: Manfz

MEU DEU O MESMO ERRO DE CIMA /\
COMO ARRUMA?
info
Grupo: Barão
Registrado: 06/07/08
Posts: 206
Reputação: +14
Char no Tibia: Nao Jogo tibia

Agora consegui ir ate a parte q fala o nome da noiva mas quando eu axei q daria certo fui surpreendido por este erro ;/
[19/08/2009 01:20:59] Lua Script Error: [Npc interface] [19/08/2009 01:20:59] data/npc/scripts/casamento.lua:onCreatureSay [19/08/2009 01:20:59] luaGetPlayerNameByGUID(). Player not found [19/08/2009 01:20:59] Lua Script Error: [Npc interface] [19/08/2009 01:20:59] data/npc/scripts/casamento.lua:onCreatureSay [19/08/2009 01:20:59] data/npc/scripts/casamento.lua:87: attempt to concatenate local 'partnername' (a nil value) [19/08/2009 01:20:59] stack traceback: [19/08/2009 01:20:59] data/npc/scripts/casamento.lua:87: in function 'callback' [19/08/2009 01:20:59] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay' [19/08/2009 01:20:59] data/npc/scripts/casamento.lua:8: in function <data/npc/scripts/casamento.lua:8> [19/08/2009 01:22:18] Lua Script Error: [Npc interface] [19/08/2009 01:22:18] data/npc/scripts/casamento.lua:onCreatureSay [19/08/2009 01:22:18] data/lib/function.lua:465: attempt to concatenate local 'player' (a nil value) [19/08/2009 01:22:18] stack traceback: [19/08/2009 01:22:18] data/lib/function.lua:465: in function 'getPlayerMarriage' [19/08/2009 01:22:18] data/npc/scripts/casamento.lua:76: in function 'callback' [19/08/2009 01:22:18] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay' [19/08/2009 01:22:18] data/npc/scripts/casamento.lua:8: in function <data/npc/scripts/casamento.lua:8>
Fiz tudo q c falo delton tabela, npc, talkaction , mas n fumfo,e obviamante se fumfasse 100% c tinha posto o npc no thyrania, mas e isso uma hora ele fumfa xD thx.
Olha Denton tenho maior respeito por vc, em primeiro lugar por eu ser gaucho como vc,ou por vc ser gaucho como eu ja q tenho 28 anos =p, mas em fim isso n importa, em segundo por vc se dedicar para um projeto amplo e complexo como o thyrania, mas sinceramente se for pra abandonar os topicos como voce tem feito, seria mais responsavel e humano colar o link do otland. Compreendo que teoricamente, eu disse teoricamente ning tem o direito de te cobrar nada ja q vc esta trazendo uma info, com os devidos creditos, mas por outro lado e meio estranho voce trazer com tamanha magnitude uma info que eu testei de todas as formas possiveis, inclusive na sua plataforma (que ja n uso mais).Seria ate um tanto obvio ja que seu thyrania tem as funçoes, npc, que tivessee este recurso implantado no mapa, porem n tem.Dae vem meu menisfesto, estou aki me sentindo um primata, no seu topico, e claro o minimo q eu espero e q vc tenha testado isso, e simplismente n consigo fazer essa joça fumfar, serei eu um ignorante, ja que ninguem se presta a compartilhar experiencia alguma comigo ou sera voce precipitado de postar algo q voce n tenha 100% de conhecimento, nao digo nem 100% de conhecimento, mas pelo menos testado ou se nao assumir alguma responsa por ter trazido a info ao xtibia e me dar algum tipo de retorno, por mais humeilde q seja, como por exemplo , n sei cara!!!
Editado Agosto 21 por dgprado
info
Grupo: Campones
Registrado: 23/01/08
Posts: 41
Reputação: +2
Char no Tibia: Gripi Suina

Aqui funfo de boa quanto no TFS 3.4 quanto no 3.5, ah e funfo tambem no thyranic 8.5 que o delton posto na sesçao de download.
Por mim o script ta aprovado!
Att, Leleo
@delton
po tem como me ajudar a transformar esse codigo em sqlite?
ta em mysql...
ALTER TABLE `players` ADD `marrystatus` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `marriage`;
info
Grupo: Barão
Registrado: 18/10/09
Posts: 246
Reputação: +26
Gênero: Masculino
Char no Tibia: Aran Than

Onde tem que adicionar esse
ALTER TABLE `players` ADD `marrystatus` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `marriage`;
Eu sei que é no MySQL, mais explica melhor ai.
Aqui eu flao Yes, depois ele não fala mais nada.
info
Grupo: Visconde
Registrado: 16/11/07
Posts: 389
Reputação: +6
Gênero: Masculino
Char no Tibia: Tiger Darm
Bom, Godely criou o sistema de casamento para o TFS, mas é um pouco antigo, porém foi adaptado para Tibia 8.50 :positive:
Adicione isso no 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 FALSE end end function addMarryStatus(player,partner) db.executeQuery("UPDATE `players` SET `marrystatus` = " .. partner .. " WHERE `id` = " .. player .. ";") return TRUE end function doCancelMarryStatus(player) db.executeQuery("UPDATE `players` SET `marrystatus` = 0 WHERE `id` = " .. player .. ";") return TRUE end function getMarryStatus(player) local stat = db.getResult("SELECT `id` FROM `players` WHERE `marrystatus` = " .. player .. ";") if(stat:getID() == -1) then return FALSE else local info = stat:getDataInt("id") return info end end function getOwnMarryStatus(player) local stat = db.getResult("SELECT `marrystatus` FROM `players` WHERE `id` = " .. player .. ";") if(stat:getID() == -1) then return FALSE else local info = stat:getDataInt("marrystatus") return info end end function isOnline(player) local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";") local on = rows:getDataInt("online") if on ~= 0 then return TRUE else return FALSE end endAgora vá para data/npc e crie um arquivo chamado: Priest.lua, e adicione isso:
Agora vá para data/npc/scripts e crie um arquivo chamado: wedding.lua e adicione:
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, 'marry') or msgcontains(msg, 'marriage') then if getPlayerStorageValue(cid,3066) == -1 then selfSay('Would you like to get married?', 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('You already set a wedding date with {' .. newpartner .. '}, now I must talk to your partner. Do you want to {cancel} it?', cid) talkState[talkUser] = 5 else setPlayerStorageValue(cid,3066,-1) selfSay('Would you like to get married?', cid) talkState[talkUser] = 1 end elseif getPlayerStorageValue(cid,3066) == 2 then selfSay('You are already married. If you want to {divorce}, just say it.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'divorce') then if getPlayerStorageValue(cid,3066) == 2 then selfSay('Would you like to divorce of your partner?', cid) talkState[talkUser] = 6 else selfSay('You are not married. If you want to get married, just say {marry}.', 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('And what\'s the name of your future partner?', cid) talkState[talkUser] = 2 else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} has set a wedding date with you. Do you want to {proceed} or {cancel} the wedding?', 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('A player with that name does not exists.', cid) talkState[talkUser] = 0 elseif sid == fid then selfSay('Don\'t worry, you will always be married with yourself, kid.', 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('You\'ve just set a wedding date with {' .. p .. '}.', cid) talkState[talkUser] = 0 else local partnername = getPlayerNameByGUID(ownstatus) selfSay('{' .. p .. '} has already set a wedding date with {' .. partnername .. '}.', cid) talkState[talkUser] = 0 end else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} has set a wedding date with you. Do you want to {proceed} or {cancel} the wedding?', cid) talkState[talkUser] = 4 end else local pname = getPlayerNameByGUID(pmarriage) selfSay('Sorry, but {' .. p .. '} is already married to {' .. pname .. '}.', cid) talkState[talkUser] = 0 end end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'proceed') then local fid = getPlayerGUID(cid) local sid = getMarryStatus(fid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) if isOnline(fid) == TRUE and isOnline(sid) == TRUE then local tmf = getCreaturePosition(cid) local tms = getCreaturePosition(pid) 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)) if getDistanceBetween(tmf, tms) <= 3 then setPlayerStorageValue(cid,3066,2) setPlayerStorageValue(pid,3066,2) doCancelMarryStatus(fid) doCancelMarryStatus(sid) setPlayerPartner(cid,sid) setPlayerPartner(pid,fid) doCreatureSay(cid, text[chance1], TALKTYPE_ORANGE_1) doCreatureSay(pid, text[chance2], TALKTYPE_ORANGE_1) doSendMagicEffect(tmf, 35) doSendMagicEffect(tms, 35) selfSay('Congratulations! Now you may kiss your partner! Everytime you wanna make this effect, just say {love}. You must be close to your partner.', cid) talkState[talkUser] = 0 else selfSay('Your partner must be close to you so you can marry!', cid) talkState[talkUser] = 0 end else selfSay('You and your new partner must be online at the same time.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'cancel') 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('You just canceled your wedding date with {' .. marryname .. '}.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 5 then if msgcontains(msg, 'cancel') 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) selfSay('You\'ve just divorced of your old partner.', cid) talkState[talkUser] = 0 else selfSay('You and your new partner must be online at the same time.', cid) talkState[talkUser] = 0 end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())Agora, adicione para seu MySQL database o que está escrito abaixo:
Em data/talkactions/talkactions.xml adicione:
Em data/talkactions/scripts crie um arquivo chamado love.lua e adicione:
function onSay(cid, words, param) -- Exhausted Settings -- local exhausted_seconds = 1 -- How many seconds player will be exhausted -- local exhausted_storagevalue = 9847 -- Storage Value to store exhaust. It MUST be unused! -- -- Exhausted Settings END -- 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 if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) doCreatureSay(cid, text[chance1], TALKTYPE_ORANGE_1) doCreatureSay(pid, text[chance2], TALKTYPE_ORANGE_1) doSendMagicEffect(tmf, 35) doSendMagicEffect(tms, 35) else doPlayerSendCancel(cid, "You are exhausted.") return TRUE end end end end endFoi adicionado exhaust para que os chars não façam SPAM, e dê lag no server.
Pronto!
Como funciona?
Você pode se divorciar caso o "fogo da paixão" acabe xD
Script funciona com gesior acc maker (Apenas mostra se o char está casado ou não)
Todos os créditos para Godely.
Coments
Editado Julho 9 por delton