Ir para conteúdo

Danilo Rodrigues

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Danilo Rodrigues recebeu reputação de r0bert0lol em [Gesior] PagSeguro automático! (100% funcional)   
    Tô com um probleminha. O ponto é depositado, porém ele só deposita um ponto. Como faço para colocar para depositar a quantidade que a pessoa doar?
  2. Gostei
    Danilo Rodrigues deu reputação a 9k22 em Married System [8.70]   
    Nome: Married System



    Versão: 8.70



    Executavel testado: Crystal server V1.0




    Bem, esse script eu fiz no meu projeto, arrumei ele completo para funcionar perfeitamente sem nenhum bug no 8.70, claro que consegui.


    Em data/npc crie um arquivo .xml e adicione:

    <?xml version="1.0" encoding="UTF-8"?> <npc name="Priest" script="data/npc/scripts/NOME_SCRIPT_NO_LUA.lua" walkinterval="0" floorchange="0"> <health now="200" max="200"/> <look type="57" head="20" body="30" legs="40" feet="50"/> </npc> Agora em data/npc/scripts crie um arquivo .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) 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)) local dateFormat = "%A %d"..getMonthDayEnding(os.date("%d")).." %B %Y" local ring = doPlayerAddItem(cid,2121,1) local ring2 = doPlayerAddItem(pid,2121,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) 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('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()) Em data/lib/functions.lua adicione no final (depois do END): 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 end Agora adicione a query(mysql): ALTER TABLE `players` ADD `marrystatus` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `marriage` ;


    Simples assim!
    Retirei todos os bugs, não apareçe nenhum erro no distro/executavel. Espero que gostem!
    PS: não sei se funfa nas versões anteriores ou superiores, não testei.

    Créditos: Mulizeu 80%
    Eu 20%
  3. Gostei
    Danilo Rodrigues deu reputação a Vodkart em (resolvido) Casamento   
    tenta executar essa query:


    ALTER TABLE `players` ADD `marrystatus` INT NOT NULL DEFAULT '0'
  4. Gostei
    Danilo Rodrigues deu reputação a Markin em [Resolvido] Bug itens Gesior   
    tenta criar ué.
    Ou então clica com o direito sobre alguma imagem do shop e verifique o diretório da imagem, abraço.
  5. Gostei
    Danilo Rodrigues deu reputação a Kimoszin em [CreatureEvent] Efeito no Player   
    Bom pessoal, criei esse script totalmente inutil e util para vocês, espero que gostem

    - Oque exatamente ele faz?
    Nada, ele só verifica se o player tem uma storage e se o player tiver, quando ele logar vai aparecer um efeito em um tempo configuravel,
    Por Exemplo, o player é VIP, ai o seu system vip tem uma storage, você adiciona essa storage no script e o player vai ficar com um efeito, ou ...
    Tem aquela super quest fodona em seu servidor, pq nao mostrar para os outros que aquele player conseguiu fazer? *-*

    - Nossa que legal, como posso ter isso no meu servidor?
    Simples amigo, basta você ir em \data\creaturescripts\scripts, depois adicionar um registro no login.lua e adicionar uma linha em creaturescripts.xml

    effect.lua

    local effect = 30 -- Efeito que vai usar local storage = 9994 -- Storage que o player precisa ter local tempo = 5 -- Tempo em segundos function onLogin(cid) if getPlayerStorageValue(cid, storage) == 1 then SendEffect(cid) end return TRUE end function SendEffect(cid) doSendMagicEffect(getCreaturePosition(cid), effect) addEvent(SendEffect, tempo*1000, cid) return TRUE end Agora adicione isso em login.lua registerCreatureEvent(cid, "Effect") Agora adicione esse code em creaturescripts.xml <event type="login" name="Effect" event="script" value="effect.lua"/>

    Uma Fotinho para ver, estou usando o efeito 30


    Abraços...
  6. Gostei
    Danilo Rodrigues deu reputação a Guilherme. em [CREATURE] OWNED!   
    OWNED!






    O Que Este Script Faz?


    Ao matar um player, aparecerá uma mensagem em cima do corpo com efeito de animação com o seguinte texto: OWNED!

    Bom, vamos ao SCRIPT:

    Vá em data/creaturescripts/scripts/preparedeath.lua e coloque isso:



    OBS:Se ele nao existir voce cria, mas se existir eu recomendo trokar no nome do script.lua e no login.lua registrar o evento com outro nome.

    Vá em data/creaturescripts/creaturescripts.xml e ABAIXO desta Tag:


    <event type="login" name="PlayerLogin" script="login.lua"/> ADICIONE ESTA: <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/> Agora é só ir em data/creaturescripts/scripts/login.lua e ABAIXO de: function onLogin(cid) ADICIONE ISTO: registerCreatureEvent(cid, "onPrepareDeath")

    Script Pronto! Desligue seu OT e Ligue de Novo para testar o Script.

    SCRIPT RETIRADO DE OUTRO FORUM, E ANTES QUE ALGUEM FALE MERDA RECLAME, OS CRÉDITOS ESTÃO DEVIDAMENTE COLOCADOS.
  7. Gostei
    Danilo Rodrigues deu reputação a Skyforever em Top Do Server   
    Olá, é um sistema que mostra quem é o novo top do servidor.

    vá em Pasta do seu OT/data/creaturescripts
    nome_do_script.lua

    function getTop() -- função by vodkart local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `level` DESC, `name` ASC;") if (query:getID() ~= -1) then return {query:getDataString("name"),query:getDataInt("level")} end return false end function onAdvance(cid, oldLevel, newLevel) if skill == 8 then local top = getTop() if newLevel > top[2] and getCreatureName(cid) ~= top[1] then broadcastMessage(getCreatureName(cid).." é o novo TOP do servidor ele está no level [" .. newLevel .. " ] .", 25) end end return true end creaturescripts.xml <event type="advance" name="checkNewTop" script="nome_do_script.lua"/> login.lua registerCreatureEvent(cid, "checkNewTop")

    É isso galerinha flws.
  8. Gostei
    Danilo Rodrigues deu reputação a Cat em [Resolvido] Encher life/mana ao upar   
    Como faço para fazer o char se curar toda vez que upa lvl? '-' Os chars tão estão se curando quando upam quis dizer não estão se curando' certo?
     
    vá em data/creaturescripts/scripts e crie um script com o nome hmup
    function onAdvance(cid, skill, oldlevel, newlevel) if skill == SKILL__LEVEL then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) end return TRUE end ainda em data/creaturescripts/script abra o login.lua e adicione em baixo das linhas
    registerCreatureEvent(cid, "hmup") em data/creaturescripts/creaturescripts.xml
    <event type="advance" name="hmup" event="script" value="hmup.lua"/>

Informação Importante

Confirmação de Termo