

SkyLigh
Lorde-
Total de itens
2183 -
Registro em
-
Última visita
-
Dias Ganhos
23
Tudo que SkyLigh postou
-
Na pasta data/npc crie um arquivo xml e coloque esse código dentro <?xml version="1.0" encoding="UTF-8"?> <npc name="Apostador" script="data/npc/scripts/apostador_la.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="138" head="96" body="95" legs="0" feet="95" addons="0"/> <parameters> <parameter key="message_greet" value="Como vai? |PLAYERNAME|, Quer {apostar} comigo?" /> <parameter key="module_keywords" value="1" /> </parameters> </npc> Script do npc na pasta data/npc/scripts crie um arquivo .lua com o nome apostador_la.lua -- Preços das apostas -- price_21 = 1000 -- 1k ou 1000gold price_jogo6 = 5000 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, 'apostar')) then selfSay('Eu faço 2 jogos: {21},{Jogo do 6} escolha um deles!', cid) talkState[talkUser] = 5 elseif (msgcontains(msg, 'Jogo do 6') and talkState[talkUser] == 5) then selfSay('O Jogo do 6 funciona assim: Eu vou rodar um dado, e se cair no número 6 você ganha o sêxtuplo (6 vezes) do valor apostado.', cid) selfSay('Caso não caia no 6, você perde apenas o dinheiro da aposta.', cid) selfSay('Está pronto para {começar}?.', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'começar') and talkState[talkUser] == 3) then selfSay('Você possui o {dinheiro} da aposta ('..price_jogo6..')golds ?', cid) if doPlayerRemoveMoney(cid, price_jogo6) == TRUE then talkState[talkUser] = 2 else selfSay('Desculpe, mais você não tem dinheiro para apostar comigo.',cid) end elseif(msgcontains(msg, 'dinheiro') and talkState[talkUser] == 2) then sorteio6 = math.random(1,6) if sorteio6 == 6 then talkState[talkUser] = 3 selfSay('Parábens, o número sorteado foi 6 e você acaba de ganhar '..(price_jogo6*6) ..'golds, mais o dinheiro que você pagou da aposta.',cid) doPlayerAddMoney(cid,price_jogo6*6) else talkState[talkUser] = 2 selfSay('Que azar, o número sorteado foi '..sorteio6..', mais sorte na proxima.',cid) end elseif(msgcontains(msg, '21') and talkState[talkUser] == 5) then selfSay('O 21 funciona assim: Você ira ganhar 1 número e o número tem quer ser 21, ou chegar o mais próximo possível sem ultrapassar esse valor.', cid) selfSay('E a mesma coisa será feita comigo, ganharei 1 número.', cid) selfSay('Você pode ir comprando mais números dizendo [comprar] e se quiser parar é só dizer [parar].', cid) selfSay('Se você ganhar de mim, você leva o triplo do dinheiro apostado.', cid) selfSay('Está pronto para {começar}?.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'começar') and talkState[talkUser] == 0) then selfSay('Você possui o {dinheiro} da aposta ('..price_21..')golds ?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'dinheiro') and talkState[talkUser] == 1) then if doPlayerRemoveMoney(cid, price_21) == TRUE then talkState[talkUser] = 0 local mpn = math.random(1,21) setPlayerStorageValue(cid, 55411,mpn) local pn = getPlayerStorageValue(cid, 55411) selfSay('Seu número é '..pn..', quer comprar mais ou parar?',cid) else selfSay('Desculpe, mais você não tem dinheiro para apostar comigo.',cid) end elseif(msgcontains(msg, 'comprar') and talkState[talkUser] == 0) then local cp = math.random(1,10) setPlayerStorageValue(cid, 55411, (getPlayerStorageValue(cid, 55411))+cp) selfSay('Seu número é '..getPlayerStorageValue(cid, 55411)..', quer comprar mais ou parar?',cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'parar') and talkState[talkUser] == 0) then local npcn = math.random(15,21) setPlayerStorageValue(cid, 2224, npcn) if getPlayerStorageValue(cid, 55411) < getPlayerStorageValue(cid, 2224)then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) selfSay('Ganhei, mais sorte na proxima vez.',cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, 55411) == getPlayerStorageValue(cid, 2224) then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) selfSay('Empato, portanto ninguem ganha nada.',cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, 55411) > getPlayerStorageValue(cid, 2224) then selfSay('Meu número é '..getPlayerStorageValue(cid, 2224)..'.',cid) selfSay('Seu número final é '..getPlayerStorageValue(cid, 55411)..'.',cid) local somag = (price_21*3) selfSay('Você ganhou '..somag..'golds, mais os seus '..price_21..'golds de volta. Parábens !!!',cid) doPlayerAddMoney(cid, somag) doPlayerAddMoney(cid, price_21) talkState[talkUser] = 1 else selfSay('Desculpe, mais você não possui dinheiro está aposta',cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
que eu saiba mc é quando 1 pessoa está com 2 char logado
-
tenta remover os outros scripts de bless deixa só o que te mandei e o de talkaction
-
blessedplayer.lua (data\creaturescripts\scripts function onDeath(cid) for b = 1, 5 do if isPlayer(cid) and getPlayerBlessing(cid, b) and getCreatureSkullType(cid) < 4 then doCreatureSetDropLoot(cid, false) end end return true end creaturescripts.xml <event type="death" name="BlessedPlayer" event="script" value="blessedplayer.lua"/ Em login.lua registerCreatureEvent(cid, "BlessedPlayer")
-
Pode mandar uma print de como ficou seu coconfig.lua?
-
Não é pra alterar o número 10 por 0
-
Vai no config.lua e na linha deathLostPercent = 10 Para vê se vaí perder algo. E utilize o script que eu postei aqui no tópico
-
Se acontecer algum erro ou algo do tipo poste o erro ou uma print
-
blessedplayer.lua (data\creaturescripts\scripts function onDeath(cid) for b = 1, 5 do if isPlayer(cid) and getPlayerBlessing(cid, b) and getCreatureSkullType(cid) < 4 then doCreatureSetDropLoot(cid, false) end end return true end creaturescripts.xml <event type="death" name="BlessedPlayer" event="script" value="blessedplayer.lua"/Em login.lua registerCreatureEvent(cid, "BlessedPlayer")
-
talkaction Help comando para banir player no trade
tópico respondeu ao leandrozera de SkyLigh em Lixeira Pública
Por que você não muda o tfs ? -
talkaction Help comando para banir player no trade
tópico respondeu ao leandrozera de SkyLigh em Lixeira Pública
Agora vai eu acho function onSay(cid, words, param) local CHANNEL_HELP = 7 local player = Player(cid) 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_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT) condition:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP) 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) sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, target:getName() .. " has been muted by " .. player:getName() .. " for using Help Channel inappropriately.") 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_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, remove:getName() .. " has been unmuted by " .. player:getName() .. ".") remove:setStorageValue(storage, -1) else player:sendCancelMessage("A player " .. remove:getName() .. "is not mutated") end end return false end -
talkaction Help comando para banir player no trade
tópico respondeu ao leandrozera de SkyLigh em Lixeira Pública
Tente function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, 21, "explaining the talkaction") return true end local t = string.explode(param, ",") player = getPlayerByName(t[1]) local condition = createConditionObject(CONDITION_MUTED) if(not t[2] or t[2] == '') then doPlayerSendTextMessage(cid, 21, "explaining the talkaction") end if t[2] then time = tonumber(t[2]*1000) -- 10*1000 is 10 seconds. if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then setConditionParam(condition, CONDITION_PARAM_SUBID, 4) doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "You have been muted by " .. getPlayerName(cid) .. " for " .. t[2] .. " seconds.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " has been muted for " .. t[2] .. " seconds.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online or cannot be muted.") end end return true end Na linha setConditionParam(condition, CONDITION_PARAM_SUBID, 4)e onde esta 4 ponha o id do channel -
talkaction Help comando para banir player no trade
tópico respondeu ao leandrozera de SkyLigh em Lixeira Pública
Vi um post do vodkart tente isso vai nas sources e procure por player.cpp bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time){time = 0;if(hasFlag(PlayerFlag_CannotBeMuted))return false;int32_t muteTicks = 0;for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it){if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks)muteTicks = (*it)->getTicks();}time = (uint32_t)muteTicks / 1000;return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && !g_chat.isPrivateChannel(channelId)));}e troque porbool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time){time = 0;if(hasFlag(PlayerFlag_CannotBeMuted))return false;int32_t muteTicks = 0;for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it){if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks)muteTicks = (*it)->getTicks();}time = (uint32_t)muteTicks / 1000;return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && channelId != CHANNEL_DEFAULT && !g_chat.isPrivateChannel(channelId)));}obs: não tenho certeza se vai funcionar caso não funcione, desta maneira tenho ctz que vai: -
talkaction Help comando para banir player no trade
tópico respondeu ao leandrozera de SkyLigh em Lixeira Pública
Que eu saiba não existe código pra isso, mais existe código pra deixar o player mudo também seria útil não acha? Se quiser um script com a função: http://www.xtibia.com/forum/topic/100819-aplicar-muted-em-um-jogador/ -
Os 2 funcionaram?
-
Alguém joga? Quem joga deixa a socialclub ai em baixo fazendo favor e vms criar um comando?
-
Parabéns ficou pik
-
tenta esse em data/creaturescripts/scripts crie um arquivo .lua e renomeie para death_corpse e adicione isso dentro: function onDeath(cid, corpse) local table = { [1] = 1, --[vocation] = id do corpse [2] = 1, [3] = 1, [4] = 1 } doTransformItem(corpse.uid, table[getPlayerVocation(cid)] ) doDecayItem(corpse.uid) end em creaturescripts.xml essa tag <event type="death" name="deathCorpse" event="script" value="death_corpse.lua"/> em login.lua registerCreatureEvent(cid, "deathCorpse")
-
Tamanho 200x267 Tema Halo Pedido Foto de perfil Sem tipografia Cores de sua preferência
-
já tentou mudar os números só pra testar ?
-
[Encerrado] Preciso de um forgettenserver.s3db sem erros.
tópico respondeu ao NooFakee de SkyLigh em Tópicos Sem Resposta
http://speedy.sh/kXed3/forgottenserver.s3db -
Duvida sanada reportado
-
http://www.xtibia.com/forum/topic/101874-tutorial-1-script-de-invasao-para-ot-sql/
-
npc NPC Que Vende Stamina Refill {[by:Anderson.Souza]}
tópico respondeu ao AnndyI de SkyLigh em NPCs, monsters e raids
Se puder por uns quote dentro dos códigos- 5 respostas
-
- npc stamina refill tibia
- otserv
- (e 2 mais)
-
Xrunning tenho umas aqui que era do meu fórum mais como acabo pode usar . Admin - http://i.imgur.com/OEVMf0T.png Diretor - http://i.imgur.com/sCLlc2D.png Coordenador - http://i.imgur.com/HuPKhAb.png Moderador - http://i.imgur.com/5qqmPIj.png Sub-Moderador - http://i.imgur.com/cPnTZoC.png Estagiário - http://i.imgur.com/aNxEnfS.png Herói - http://i.imgur.com/VxDKcOU.png
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.