Vodkart 1515 Postado Junho 20, 2012 Share Postado Junho 20, 2012 (editado) Muito interessante , mas se o player pode utilizar o comando com battle ficaria bem feio . rs mas quem disse que pode? if isPlayerPzLocked(cid) == FALSE and isInArray({SKULL_NONE,SKULL_YELLOW}, getCreatureSkullType(cid)) then faz checar essa função. Editado Junho 20, 2012 por Vodkart Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1281841 Compartilhar em outros sites More sharing options...
KUNGLOW 14 Postado Junho 21, 2012 Share Postado Junho 21, 2012 Teria como faze ele pro npc ativar e desativar o PVP? Cobrando uma taxa de 100k pra ativa e de 300 pra desativa sendo que so pode desativar 1 semana depois. E que precise de lvl 100+ Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282185 Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Junho 21, 2012 Share Postado Junho 21, 2012 Teria como faze ele pro npc ativar e desativar o PVP? Cobrando uma taxa de 100k pra ativa e de 300 pra desativa sendo que so pode desativar 1 semana depois. E que precise de lvl 100+ wtf? uma semana é muito tempo cara. Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282216 Compartilhar em outros sites More sharing options...
rDs7008 47 Postado Junho 21, 2012 Share Postado Junho 21, 2012 Creio que ele está querendo deixar parecido com o PVP mode do Perfect World E vodkart, me chamou msn e pediu pra mim responder... agora responde lá --' Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282220 Compartilhar em outros sites More sharing options...
1579091 109 Postado Junho 21, 2012 Share Postado Junho 21, 2012 Legal, mais foge muito do padrão do tibia, mas cada um tem seu gosto neh.. Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282231 Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Junho 21, 2012 Share Postado Junho 21, 2012 Teria como faze ele pro npc ativar e desativar o PVP? Cobrando uma taxa de 100k pra ativa e de 300 pra desativa sendo que so pode desativar 1 semana depois. E que precise de lvl 100+ Mods: <?xml version="1.0" encoding="UTF-8"?> <mod name="Pvp Mode" version="1.0" author="Gevox" contact="xtibia.com" enabled="yes"> <config name="pvpmode_func"><![CDATA[ function getPlayerPVPMode(cid) local check = db.getResult("SELECT `pvpmode` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") return check:getDataInt("pvpmode") <= 0 and 0 or check:getDataInt("pvpmode") end function setPlayerPVPMode(cid, value) db.executeQuery("UPDATE `players` SET `pvpmode` = "..value.." WHERE `id` = "..getPlayerGUID(cid)) end ]]></config> <event type="login" name="PvpModeRegister" event="script"><![CDATA[ domodlib('pvpmode_func') function onLogin(cid) registerCreatureEvent(cid, "pvpProtection") if getPlayerPVPMode(cid) == 1 then doCreatureSetSkullType(cid, 1) end return true end]]></event> <event type="combat" name="pvpProtection" event="script"><![CDATA[ domodlib('pvpmode_func') if isPlayer(cid) and isPlayer(target) then if getPlayerPVPMode(cid) == 1 or getPlayerPVPMode(target) == 1 then doPlayerSendCancel(cid, "You may not attack this player.") return false end end return true ]]></event> </mod> npc: domodlib('pvpmode_func') 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 local msg = string.lower(msg) local config = { price = {[0] = 100000,[1] = 300000}, level = 100, days = 7, storage = 321523 } if isInArray({"change","trocar", "pvp", "pk"}, msg) then npcHandler:say("You want "..(getPlayerPVPMode(cid) == 0 and "enable" or "disable").." your pvp now for "..config.price[getPlayerPVPMode(cid)].." gp(s)? {yes}", cid) talkState[talkUser] = 1 elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerLevel(cid) >= config.level then if getPlayerStorageValue(cid,config.storage) <= os.time() then if doPlayerRemoveMoney(cid, config.price[getPlayerPVPMode(cid)]) then setPlayerPVPMode(cid, getPlayerPVPMode(cid) == 0 and 1 or 0) doCreatureSetSkullType(cid, getPlayerPVPMode(cid) == 1 and 1 or 0) setPlayerStorageValue(cid, config.storage, os.time()+config.days*86400) npcHandler:say("Now you set pvp mode to "..(getPlayerPVPMode(cid) == 0 and "off" or "on")..".", cid) else npcHandler:say("Sorry, You don't have money!", cid) talkState[talkUser] = 0 end else npcHandler:say("Sorry, but you must wait until "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." to change your pvp again!", cid) talkState[talkUser] = 0 end else npcHandler:say("Sorry, You need level "..config.level.." or more to change your pvp!", cid) talkState[talkUser] = 0 end elseif isInArray({"no","nao"}, msg) then selfSay("Then not.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282327 Compartilhar em outros sites More sharing options...
KUNGLOW 14 Postado Junho 22, 2012 Share Postado Junho 22, 2012 (editado) Irei testar o mesmo. Editado Junho 22, 2012 por KUNGLOW Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1282791 Compartilhar em outros sites More sharing options...
Ghostblaze 6 Postado Janeiro 15, 2014 Share Postado Janeiro 15, 2014 Bom... obrigado ae Link para o comentário https://xtibia.com/forum/topic/188354-pvp-system-control/page/2/#findComment-1603300 Compartilhar em outros sites More sharing options...
Posts Recomendados