
Tudo que Frenesy postou
- Trade OFF - Shop Offline
-
Aumentar Attack do monstro.
Não tenho planos pra compilar, por isso estou procurando uma alternativa em .lua mesmo. Minha ideia e bem simples: O jogador ganha 1 value da storage XXXX. A cada value da storage XXXX, aumenta 5 do ataque do monstro (no caso é um summon) O que você acha: dá pra reconhecer que seu summon está batendo em um monstro e alterar o value do dano que sai no monstro? Qual função do Creaturescript seria ideal para isso? onStatsChange? onCombat? Utilizo a base tfs 0.4. Existe essa função no TFS 0.4? Ou tem como adicionar ela na lib?
-
Aumentar Attack do monstro.
Tem como aumentar o ATK do monstro por .lua?
-
(Resolvido)NPC Focus
Obrigado pela resposta @Dragon Ball Hiper. Seu script não deu muito certo, mas pesquisei uma base diferente para o NPC. Me parece que funcionou, nos primeiros testes. Vou testar por mais alguns dias pra ter certeza.
-
(Resolvido)NPC Focus
Como faço para um NPC falar com 1 player por vez? Enquanto o NPC fala com um jogador, o outro deve esperar ele terminar.
-
Destroy()
ESSA É UMA PERGUNTA RELACIONADA A OTCLIENT. Estou usando o comando abaixo para destruir um item dentro de uma lista: marketPanel:recursiveGetChildById('vip90'):destroy() Quero simplesmente saber qual comando utilizo para criar esse item novamente. Simples assim. Alguém sabe?
-
Posição da Janela
Dois pedidos bem simples:. 1º Pedido: Como faço para a janela ser fixa abaixo do player? Eu consigo por uma janela qualquer abaixo do jogador, mas sempre que eu mudo, por exemplo, o tamanho do chat, a janela já não fica exatamente debaixo do jogador. Então eu gostaria de saber como faz pra janela ficar sempre fixa debaixo do player. 2º Pedido: Como faço pra uma janela ficar fixa no canto inferior direto do Client? Não quero a janela lá em baixo perto do relógio do PC, não. Eu quero a janela fixa sempre no canto, acima da janela do chat. Como faz? Agradeço desde já. Abraços!
-
[SERVIDOR ALTERNATIVO] Mapper
Up
-
(Resolvido)Erro Login.lua
local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) boost.addSkills(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end registerCreatureEvent(cid, "Biohazard") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "WeaponMana") registerCreatureEvent(cid, "showVoc") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "Outfit") registerCreatureEvent(cid, "MonsteDeath") registerCreatureEvent(cid, "ExameJouninDead") registerCreatureEvent(cid, "ExameJouninBoss") setPlayerStorageValue(cid, 8855, -1) registerCreatureEvent(cid, "Senha") registerCreatureEvent(cid, "eventotimes") registerCreatureEvent(cid, "ExpBonus") registerCreatureEvent(cid, "report") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "DeathHP") registerCreatureEvent(cid, "FirstItems") registerCreatureEvent(cid, "Reward") registerCreatureEvent(cid, "KamuiMuzan") registerCreatureEvent(cid, "UP") registerCreatureEvent(cid, "LookVoc") registerCreatureEvent(cid, "Niwdeath") registerCreatureEvent(cid, "Izanagi") registerCreatureEvent(cid, "Izanami") registerCreatureEvent(cid, "pvptarget") registerCreatureEvent(cid, "pvpstats") if getPlayerStorageValue(cid, 49607) == -1 then setPlayerStorageValue(cid, 49607, 0) end if getPlayerStorageValue(cid, 49608) ~= 0 then setPlayerStorageValue(cid, 49608, 0) end ---------- UCHIHAGAESHI ---------------- registerCreatureEvent(cid, "uchihagaeshi") if getPlayerStorageValue(cid, 3482101) ~= 0 then setPlayerStorageValue(cid, 3482101, 0) end -----------GRAN CASTLE ----------- registerCreatureEvent(cid, "Gran Tower") registerCreatureEvent(cid, "Gran Aura") registerCreatureEvent(cid, "Gran Aura Stats") registerCreatureEvent(cid, "Gran Aura Logout") registerCreatureEvent(cid, "Gran Tower Target") --- CRITICAL SYSTEM ---- registerCreatureEvent(cid, "critical") if getPlayerStorageValue(cid, 48903) == -1 then setPlayerStorageValue(cid, 48903, 0) end ---------- PlayerPort--------------- if getPlayerStorageValue(cid, 49708) ~= 0 then setPlayerStorageValue(cid, 49708, 0) end if getPlayerGuildId(cid) > 0 then local guild = getPlayerGuildId(cid) doGuildAddEnemy(guild, enemy, 0, WAR_GUILD) else end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_GREEN, "[Bem-Vindo ao Nto Fire]n/Para Ativar o PvP !Pvp on;!Pvp off/nVersao do Elfbot 8.80/nObrigado Por Jogar Nosso Servidor,Tenha um Bom Dia." ..player:getName()..'! now is: '.. os.date("%H:%M:%S", os.time())..'.') return true end
-
(Resolvido)Erro Login.lua
local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) boost.addSkills(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end registerCreatureEvent(cid, "Biohazard") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "WeaponMana") registerCreatureEvent(cid, "showVoc") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "Outfit") registerCreatureEvent(cid, "MonsteDeath") registerCreatureEvent(cid, "ExameJouninDead") registerCreatureEvent(cid, "ExameJouninBoss") setPlayerStorageValue(cid, 8855, -1) registerCreatureEvent(cid, "Senha") registerCreatureEvent(cid, "eventotimes") registerCreatureEvent(cid, "ExpBonus") registerCreatureEvent(cid, "report") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "DeathHP") registerCreatureEvent(cid, "FirstItems") registerCreatureEvent(cid, "Reward") registerCreatureEvent(cid, "KamuiMuzan") registerCreatureEvent(cid, "UP") registerCreatureEvent(cid, "LookVoc") registerCreatureEvent(cid, "Niwdeath") registerCreatureEvent(cid, "Izanagi") registerCreatureEvent(cid, "Izanami") registerCreatureEvent(cid, "pvptarget") registerCreatureEvent(cid, "pvpstats") if getPlayerStorageValue(cid, 49607) == -1 then setPlayerStorageValue(cid, 49607, 0) end if getPlayerStorageValue(cid, 49608) ~= 0 then setPlayerStorageValue(cid, 49608, 0) end ---------- UCHIHAGAESHI ---------------- registerCreatureEvent(cid, "uchihagaeshi") if getPlayerStorageValue(cid, 3482101) ~= 0 then setPlayerStorageValue(cid, 3482101, 0) end -----------GRAN CASTLE ----------- registerCreatureEvent(cid, "Gran Tower") registerCreatureEvent(cid, "Gran Aura") registerCreatureEvent(cid, "Gran Aura Stats") registerCreatureEvent(cid, "Gran Aura Logout") registerCreatureEvent(cid, "Gran Tower Target") --- CRITICAL SYSTEM ---- registerCreatureEvent(cid, "critical") if getPlayerStorageValue(cid, 48903) == -1 then setPlayerStorageValue(cid, 48903, 0) end ---------- PlayerPort--------------- if getPlayerStorageValue(cid, 49708) ~= 0 then setPlayerStorageValue(cid, 49708, 0) end if getPlayerGuildId(cid) > 0 then local guild = getPlayerGuildId(cid) doGuildAddEnemy(guild, enemy, 0, WAR_GUILD) else end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_GREEN, "[Bem-Vindo ao Nto Fire]n/Para Ativar o PvP !Pvp on;!Pvp off/nVersao do Elfbot 8.80/nObrigado Por Jogar Nosso Servidor,Tenha um Bom Dia." ..player:getName()..'! now is: '.. os.date("%H:%M:%S", os.time())..'.') return true end
-
getSpells
Quero criar um "if" dentro do OTClient onde verifique se o player tem uma magia específica. Apenas isso. Se o jogador tiver tal magia então -- Coisas Se não -- Coisas Lembrando que esse pedido é em OTClient, não no servidor. No servidor é mais fácil.
-
[SERVIDOR ALTERNATIVO] Mapper
UP
-
[SERVIDOR ALTERNATIVO] Mapper
Preciso de um Mapper para meu projeto (talvez mais de 1). O Link do projeto para darem uma olhada está aqui ou CLIQUE AQUI:
-
Erro Ao Logar
Vai em Movements.xml, dá Ctrl + F e procure por "portrait". Achando-a, exclua e reinicie o servidor, para ver se o erro persiste. Se ainda assim continuar dando erro, posta aqui esse "portrait.lua".
-
YALAHAR QUEST BUG
O teleport aparece depois de você fazer o quê? Falar com algum NPC? Matar um monstro?
-
YALAHAR QUEST BUG
Manda o script desse teleport aí pra gente da uma olhada.
-
Erro Ao Logar
Qual é cara, vai no seu Login.lua e deleta a função "doSendPlayerExtendedOpcode" que está na linha 60. Simples assim. Tenta aí.
-
Como por texto animado nesse script?
Que tal assim? local items = { --[itemid] = {chance, count}, [2160] = {50, 100}, [2158] = {70, 50}, } function onUse(cid, item) local number = math.random(1, 100) local _item = 0 for itemid, chance in pairs(items) do if _item == 0 then _item = itemid else local new_chance = (chance[1] - number) > 0 and chance[1] - number or number - chance[1] local old_chance = (items[_item][1] - number) > 0 and items[_item][1] - number or number - items[_item][1] if new_chance < old_chance then _item = itemid end end end if _item ~= 0 then local count = items[_item][2] if not isItemStackable(_item) then if count > 1 then for i = 1, count do doPlayerAddItem(cid, _item, 1) end else doPlayerAddItem(cid, _item, 1) end else doPlayerAddItem(cid, _item, count) end doPlayerSendTextMessage(cid, 27, "You received: "..count.."x "..getItemNameById(_item)..(count > 1 and "s" or "")..".") doCreatureSay(cid, "Você recebeu 100 crystal coins com 50% de chance", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) end return true end
-
(Resolvido)Venda de comandos por NPC, tem como?
kkkk Pois é, cara. A função "get" verificaria se ele já tem ou não a bless. Cara, eu vou fazer o seguinte. Eu vou DEDUZIR que essa benção que você quer seja a 6. Eu não tenho certeza, mas olhando o script da Ceremonial Ankh, aparece essa Bless 6. Deve ser elam já que as 5 primeiras são as bless normais. Sendo assim, teste esse: 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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, 'Blessing') or msgcontains(msg, 'blessing')) then selfSay('Vejamos, posso vender pra você {Bless} e também {Bless PvP}, o que deseja?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Comando') or msgcontains(msg, 'comando') or msgcontains(msg, 'Comando Bless') or msgcontains(msg, 'comando bless')) then selfSay('Eu posso vender para você o comando "!bless full". No entanto, ele custa {120.000 gold coin}. Deseja comprar?', cid) talkState[talkUser] = 2 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 2) then if getPlayerStorageValue(cid,834005) == 1 then selfSay('Você já comprou esse comando.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 120000) == TRUE then selfSay('Pronto! Agora você pode usar o comando {!bless}', cid) doSendMagicEffect(getPlayerPosition(cid), 49) setPlayerStorageValue(cid, 834005, 1) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) talkState[talkUser] = 0 end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 2) then selfSay('Sem problemas.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless') or msgcontains(msg, 'bless')) then selfSay('Eu posso lhe conceder todas as benções por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 3) then if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then selfSay('Você já tem todas as benções.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 3) then selfSay('Tudo bem, mas tenho novas coisas para vender.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless PvP') or msgcontains(msg, 'bless pvp')) then selfSay('Eu posso lhe conceder a Bless PvP por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 4 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 4) then if getPlayerBlessing(cid, 6) then selfSay('Você já tem todas as benções.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) -- doPlayerSetPVPBlessing(cid) doPlayerAddBlessing(cid, 6) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 4) then selfSay('Volte quando tiver interesse.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Venda de comandos por NPC, tem como?
Ele faz a verificação da Bless pra você não ter que comprar de novo. Sem essa verificação, ficaria assim: 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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, 'Blessing') or msgcontains(msg, 'blessing')) then selfSay('Vejamos, posso vender pra você {Bless} e também {Bless PvP}, o que deseja?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Comando') or msgcontains(msg, 'comando') or msgcontains(msg, 'Comando Bless') or msgcontains(msg, 'comando bless')) then selfSay('Eu posso vender para você o comando "!bless full". No entanto, ele custa {120.000 gold coin}. Deseja comprar?', cid) talkState[talkUser] = 2 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 2) then if getPlayerStorageValue(cid,834005) == 1 then selfSay('Você já comprou esse comando.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 120000) == TRUE then selfSay('Pronto! Agora você pode usar o comando {!bless}', cid) doSendMagicEffect(getPlayerPosition(cid), 49) setPlayerStorageValue(cid, 834005, 1) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) talkState[talkUser] = 0 end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 2) then selfSay('Sem problemas.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless') or msgcontains(msg, 'bless')) then selfSay('Eu posso lhe conceder todas as benções por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 3) then if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then selfSay('Você já tem todas as benções.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 3) then selfSay('Tudo bem, mas tenho novas coisas para vender.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless PvP') or msgcontains(msg, 'bless pvp')) then selfSay('Eu posso lhe conceder a Bless PvP por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 4 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 4) then if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerSetPVPBlessing(cid) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 4) then selfSay('Volte quando tiver interesse.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Venda de comandos por NPC, tem como?
Seu TFS não é o 0.4? Pesquisei e vi que os 0.4 tem o comando "getPlayerPVPBlessing(cid)" O Tópico da qual me mandou também se encontra essa função.
-
(Resolvido)Venda de comandos por NPC, tem como?
Ok, tenta isso. 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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, 'Blessing') or msgcontains(msg, 'blessing')) then selfSay('Vejamos, posso vender pra você {Bless} e também {Bless PvP}, o que deseja?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Comando') or msgcontains(msg, 'comando') or msgcontains(msg, 'Comando Bless') or msgcontains(msg, 'comando bless')) then selfSay('Eu posso vender para você o comando "!bless full". No entanto, ele custa {120.000 gold coin}. Deseja comprar?', cid) talkState[talkUser] = 2 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 2) then if getPlayerStorageValue(cid,834005) == 1 then selfSay('Você já comprou esse comando.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 120000) == TRUE then selfSay('Pronto! Agora você pode usar o comando {!bless}', cid) doSendMagicEffect(getPlayerPosition(cid), 49) setPlayerStorageValue(cid, 834005, 1) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) talkState[talkUser] = 0 end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 2) then selfSay('Sem problemas.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless') or msgcontains(msg, 'bless')) then selfSay('Eu posso lhe conceder todas as benções por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 3) then if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then selfSay('Você já tem todas as benções.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 3) then selfSay('Tudo bem, mas tenho novas coisas para vender.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Bless PvP') or msgcontains(msg, 'bless pvp')) then selfSay('Eu posso lhe conceder a Bless PvP por {50.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 4 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 4) then if getPlayerPVPBlessing(cid) == true then selfSay('Você já tem essa PvP Bless.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 50000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerSetPVPBlessing(cid) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 4) then selfSay('Volte quando tiver interesse.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Venda de comandos por NPC, tem como?
Isso mesmo. Cria ele e me diz como funciona que eu adiciono no NPC. Até lá... Vou ficar de devendo essa. Isso já está dentro da minha jurisdição (). Testa isso aqui: 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 doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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, 'Bless') or msgcontains(msg, 'bless')) then selfSay('Vejamos, posso vender pra você agora o Comando {bless full} ou {Blessing} e também {Bless PvP}, o que deseja?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'Comando') or msgcontains(msg, 'comando') or msgcontains(msg, 'Bless Full') or msgcontains(msg, 'bless full')) then selfSay('Eu posso vender para você o comando "!bless full". No entanto, ele custa {10.000 gold coin}. Deseja comprar?', cid) talkState[talkUser] = 2 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 2) then if getPlayerStorageValue(cid,834005) == 1 then selfSay('Você já comprou esse comando.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 10000) == TRUE then selfSay('Pronto! Agora você pode usar o comando {!bless full}', cid) doSendMagicEffect(getPlayerPosition(cid), 49) setPlayerStorageValue(cid, 834005, 1) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) talkState[talkUser] = 0 end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 2) then selfSay('Sem problemas.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'Blessing') or msgcontains(msg, 'blessing')) then selfSay('Eu posso lhe conceder todas as benções por {20.000 gold coin}. Deseja comprar? - [{Yes} | {No}]', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 3) then if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then selfSay('Você já tem todas as benções.', cid) talkState[talkUser] = 0 else if doPlayerRemoveMoney(cid, 20000) == TRUE then selfSay('Você agora está protegido!', cid) doSendMagicEffect(getPlayerPosition(cid), 49) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Você não tem o dinheiro necessário.', cid) end end elseif((msgcontains(msg, 'No') or msgcontains(msg, 'no')) and talkState[talkUser] == 3) then selfSay('Tudo bem, mas tenho novas coisas para vender.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Venda de comandos por NPC, tem como?
Aí já não é algo de NPC. Já é outra área com novos conhecimentos. Eu consigo o NPC, essa daí já terá que pedir ajuda pra alguém que entenda melhor. kkkk
-
(Resolvido)Venda de comandos por NPC, tem como?
Entendi, mas essa bless já tem no jogo? Qual é?