Ir para conteúdo
  • 0

bfs102030

Pergunta

Ola galera estou precisando de uma ajuda no meu script.

ele funciona basicamente como uma battle arena porem nao e de time contra time.É de player x player.

e quando um player mata outro ele recebe EXP.

quando o player entra na arena ele permanece com a mesma outfit que ele estava antes de entrar, mesma cor. addon etc.

e eu gostaria que fosse assim msm, porem descobri um bug, pois quando um player muda a cor da sua outfit colocando ela da mesma cor de outro jogador que tambem esta dentro da arena eles nao podem se atacar...

enfim este e oo bug !

OBS: toda a arena contem NO LOGOUT E PVP ZONE TOOL..

 

segue o script a parte no MOD pois creio que o erro esta ae porem nao sei onde.

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Jogos Vorazes System" version="1.0" enabled="yes">
<config name="battle-config"><![CDATA[
function msgForOthers(mensagem, classe)
if (not classe) then
classe = MSG_WHITE
end
for _, pid in ipairs(getPlayersOnline()) do
if (getPlayerStorageValue(pid, 5602) == 1) then
doPlayerSendChannelMessage(pid, "", mensagem, classe, FPS_CHANNEL)
end
end
return true
end
function doPlayerRemoveLethalConditions(cid) -- function by Rush Event.
local tmp = {1, 2, 4, 16, 32, 65, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536}
for i = 1, #tmp do
if (hasCondition(cid, tmp)) then
doRemoveCondition(cid, tmp)
end
end
return true
end
function closeEvent(cid)
setGlobalStorageValue(5600, -1)
setGlobalStorageValue(5601, -1)
for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(pid, "", ""..FPS_EVENTNAME.." foi fechado.", MSG_WHITE, FPS_CHANNEL)
if (getPlayerStorageValue(pid, 5602) == 1) then
doSendMagicEffect(getThingPos(pid), CONST_ME_POFF)
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
doCreatureAddHealth(pid, getCreatureMaxHealth(pid), false)
doCreatureAddMana(pid, getCreatureMaxMana(pid), false)
setPlayerStorageValue(pid, 5601, 0)
setPlayerStorageValue(pid, 5602, 0)
setPlayerStorageValue(pid, 5603, 0)
doPlayerSave(pid)
end
end
setGlobalStorageValue(5602, -1)
return true
end
MSG_WHITE = TALKTYPE_CHANNEL_MANAGEMENT or TALKTYPE_CHANNEL_W
MSG_RED = TALKTYPE_GAMEMASTER_CHANNEL or TALKTYPE_CHANNEL_RN
MSG_ORANGE = TALKTYPE_CHANNEL_ORANGE or TALKTYPE_CHANNEL_O
]]></config>
<talkaction log="yes" words="/fps" event="script"><![CDATA[
domodlib('battle-config')
function onSay(cid, words, param, channel)
if (param == "") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error, comando inválido.")
end
if (getPlayerAccess(cid) >= 3) then
if (string.lower(param) == "open") then
if (getGlobalStorageValue(5600) ~= 1) then
setGlobalStorageValue(5600, 1)
if (getGlobalStorageValue(5600) == 1) then
setGlobalStorageValue(5602, 0)
doBroadcastMessage(""..FPS_EVENTNAME.." foi aberto, fale com o NPC 'Jogos Vorazes Manager, Localizado no subsolo do dp de Thais'.", 22)
end
else
return true
end
return true
end
if (string.lower(param) == "close") then
if (getGlobalStorageValue(5600) ~= -1 and getGlobalStorageValue(5601) ~= 1) then
setGlobalStorageValue(5601, 1)
setPlayerStorageValue(cid, 5605, 1)
msgForOthers(""..FPS_FINISHTIME.." segundos restantes.")
addEvent(setPlayerStorageValue, FPS_FINISHTIME * 1000, cid, 5605, -1)
addEvent(closeEvent, FPS_FINISHTIME * 1000, cid)
else
doPlayerPopupFYI(cid, "AVISO :\n"..getCreatureName(cid)..", o portal encontra-se fechado atualmente.\nimpossivel fecha-lo duas vezes.")
return true
end
return true
end
local t = string.explode(param, ",")
local pid = getPlayerByName(t[2])
if (string.lower(t[1]) == "ban") then
if (not t[2] or tonumber(t[2])) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
return true
end
if (not isPlayer(pid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
return true
end
if (getPlayerStorageValue(pid, 5604) ~= 1) then
if (getPlayerStorageValue(pid, 5602) == 1) then
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
end
setPlayerStorageValue(pid, 5601, 0)
setPlayerStorageValue(pid, 5602, 0)
setPlayerStorageValue(pid, 5604, 1) -- blocked.
msgForOthers(""..t[2].." foi bloqueado(a).")
local ba_banr = "Admininstrador"
if (FPS_REVEALEDAFTERBANPLAYER) then
ba_banr = ""..getCreatureName(cid)..""
end
doPlayerPopupFYI(pid, "AVISO :\n O "..ba_banr.." bloqueou você.\nvocê está temporariamente bloqueado(a) de participar.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você bloqueou "..t[2]..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi bloqueado(a).")
return true
end
return true
end
if (string.lower(t[1]) == "unban") then
if (not t[2] or tonumber(t[2])) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
return true
end
if (not isPlayer(pid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
return true
end
if (getPlayerStorageValue(pid, 5604) == 1) then
setPlayerStorageValue(pid, 5604, 0) -- unblocked.
msgForOthers(""..t[2].." foi desbloqueado(a).")
doPlayerPopupFYI(pid, "AVISO :\nVocê foi desbloqueado(a).\nparticipe do "..FPS_EVENTNAME.." quando o mesmo estiver disponível.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou "..t[2]..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi desbloqueado(a).")
return true
end
return true
end
end
local ba_players = "Indisponível"
if (getGlobalStorageValue(5602) ~= -1) then
ba_players = tostring(getGlobalStorageValue(5602))
end
local limiteplayers = ""..ba_players.."/"..FPS_LIMITEPLAYERS..""
if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS) then
limiteplayers = "FULL/"..FPS_LIMITEPLAYERS..""
end
if (string.lower(param) == "status") then
local status = ""..FPS_EVENTNAME.." Status :\nOla "..getCreatureName(cid)..",\nveja algumas informações sobre o(a) "..FPS_EVENTNAME.."."
doShowTextDialog(cid, 2395, ""..status.."\n\nPontos : ("..getPlayerStorageValue(cid, 5601)..")\nJogadores : ["..limiteplayers.."]")
return true
end
return true
end
]]></talkaction>
<event type="preparedeath" name="FPSprepare" event="script"><![CDATA[
domodlib('battle-config')
function onPrepareDeath(cid, deathList)
local target = deathList[1]
if (getGlobalStorageValue(5600) == 1 and getPlayerStorageValue(cid, 5602) == 1) then
local i = 10
doPlayerOpenChannel(cid, FPS_CHANNEL)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerRemoveLethalConditions(cid)
if (isMonster(target)) then
addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." matou você.", MSG_RED, FPS_CHANNEL)
setPlayerStorageValue(cid, 5602, 0)
msgForOthers(""..getCreatureName(target).." matou "..getCreatureName(cid)..".")
setPlayerStorageValue(cid, 5602, 1)
setPlayerStorageValue(cid, 5601, 0)
return false
end
if (not isCreature(target)) then
addEvent(doPlayerSendChannelMessage, i, cid, "", "Voce cometeu suicídio.", MSG_RED, FPS_CHANNEL)
setPlayerStorageValue(cid, 5602, 0)
msgForOthers(""..getCreatureName(cid).." cometeu suicídio.")
setPlayerStorageValue(cid, 5602, 1)
setPlayerStorageValue(cid, 5601, 0)
return false
end
doPlayerOpenChannel(target, FPS_CHANNEL)
setPlayerStorageValue(target, 5601, getPlayerStorageValue(target, 5601)+1)
setPlayerStorageValue(cid, 5602, 0)
setPlayerStorageValue(target, 5602, 0)
msgForOthers(""..getCreatureName(target).." derrotou "..getCreatureName(cid)..".")
setPlayerStorageValue(target, 5602, 1)
setPlayerStorageValue(cid, 5602, 1)
addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." derrotou você.", MSG_RED, FPS_CHANNEL)
addEvent(doPlayerSendChannelMessage, i, target, "", "Você derrotou "..getCreatureName(cid)..".", MSG_ORANGE, FPS_CHANNEL)
dofile("config.lua")
local EXP = 0
if (FPS_ENABLEEXPERIENCE) then
EXP = rateExperience * getPlayerLevel(cid)
doPlayerAddExperience(target, EXP)
end
doSendAnimatedText(getThingPos(target), tostring(EXP), gainExperienceColor)
doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "Você ganhou "..EXP.." ponto(s) de experiência.")
setPlayerStorageValue(cid, 5601, 0)
return false
end
return true
end
]]></event>
<event type="logout" name="FPSlogout" event="script"><![CDATA[
domodlib('battle-config')
function onLogout(cid)
if (getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(cid, 5602) == 1 or getPlayerStorageValue(cid, 5605) == 1) then
doPlayerSendCancel(cid, "Aguarde "..FPS_FINISHTIME.." segundo(s).")
return false
end
if(getPlayerStorageValue(cid, 5602) == 1) then
setPlayerStorageValue(cid, 5601, 0)
setPlayerStorageValue(cid, 5602, 0)
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerSendChannelMessage(cid, "", "Você saiu do jogo.", MSG_WHITE, FPS_CHANNEL)
doPlayerRemoveLethalConditions(cid)
doPlayerSave(cid)
if (getPlayerAccess(cid) < 3) then
setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
msgForOthers(""..getCreatureName(cid).." saiu do jogo.")
end
return false
end
return true
end
]]></event>
<event type="combat" name="FPScombat" event="script"><![CDATA[
function onCombat(cid, target)
if(FPS_BLOCKIP) then
if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
end
for _, pid in ipairs(getPlayersOnline()) do
if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
return false
end
end
return true
end
]]></event>
<event type="attack" name="FPSattack" event="script"><![CDATA[
function onAttack(cid, target)
if(FPS_BLOCKIP) then
if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
end
for _, pid in ipairs(getPlayersOnline()) do
if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
return false
end
end
return true
end
]]></event>
<event type="login" name="FPSlogin" event="buffer"><![CDATA[
if (getPlayerStorageValue(cid, 5601) == -1) then
setPlayerStorageValue(cid, 5601, 0)
end
registerCreatureEvent(cid, "FPSprepare")
registerCreatureEvent(cid, "FPSlogout")
registerCreatureEvent(cid, "FPScombat")
registerCreatureEvent(cid, "PFSattack")
registerCreatureEvent(cid, "PFScast")
]]></event>
<globalevent name="FPS tips" interval="600000" event="script"><![CDATA[
domodlib('battle-config')
function onThink(interval)
local FPS_tips = {
"Atualmente existem "..getGlobalStorageValue(5602).." player(s) lutando, não deixe de participar.",
"Com o canal fechado, você não recebe informações dentro do jogo. deixe-o sempre aberto.",
"Cuidado ao ofender um jogador, você corre o risco de ser bloqueado(a).",
"Aperte 'CTRL + Q' caso você queira sair do jogo, você precisa está em protection zone.",
"Chame seus amigos e venha jogar, porquê aqui a diversão nunca acaba.",
"Dica : configure o comando '/fps status' como hotkey. Assim você poderá checar suas informações com facilidade."
}
if (getGlobalStorageValue(5600) == 1) then
msgForOthers(FPS_tips[math.random(1, #FPS_tips)])
end
return true
end
]]></globalevent>
</mod>

 

 

 

e se nao for pedir de mais e alguem souber me explicar tambem se a EXP que sera calculada 100x nesse script ?
é a rateExperience ou rateExperienceFromPlayers que esta no Config.lua
Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

Faz um teste pra mim, coloca outfit de cores diferentes porem a cor dos PÉS igual e vê se eles conseguem se atacar.

Algumas versões do 0.4 tem essa definição ridícula na source e, caso isso seja comprovado no seu caso, somente alteração dessa linha na source resolveria.

Link para o comentário
Compartilhar em outros sites

  • 0

mano fiz o teste que vc me falou e realmente oq vc disse confere.mudei as cores e dexei so a boots igual e n deu pra atacar.

eu coloquei tbm as outfits iguals e com as cores do addon igual tbm e so dexei a boots diferente ae deu pra atacar..e isso acontece tambem fora da arena nao esta dando pra atacar.

E eu nao sei mexer com edicao de sources...

 

eu estava falando com o Night Wolf membro ake do forum tbm, falando com ele sobre esse assunto do bug da cor das outfits e tbm sobre ele me ajudar a colocar pro eventoa brir automaticamente pois pra abrir ele e so com GM executando o /fps open e fps cloose para fechar entendeu.

E ele me mandou uma respostas assim..

 

 

pro primeiro erro dos times, vc precisa fazer um creaturescript
function onOutfit(cid, old, current)

se estiver dentro da arena retorna falso, do contrário retorna true.

Pro segundo é só fazer um global events q executa a talkaction.. ambos problemas vc acha exemplos no fórum..

 

Porem agora que eu descobri que fora da arena tbm esta dando esse bug da cor da boots igual n da pra atacar.e tbm acabei achando outro bug que quando os players saai da arena sem que o GM execute /fps close, quando um ataca o outro fora da arena e se matam eles estao ganhando XP tbm.. ou seja estou fudido. AFFF

se vc souber e puder me ajudar amigo eu serei muito grato.. se vc puder mexer nessas source pra mim e criar o Globalevents que abre e fexa oo eventgo ajudaria mt pois nao sei mexer com isso.. fico no aguardo de respostas sua ou de quem puder ajudar..

Link para o comentário
Compartilhar em outros sites

  • 0

A solucao do pronlema da bota e simples, uma linha que vc remove na source. So tenho que lembrar onde.

O outro problema não entendi direito qual é.

Link para o comentário
Compartilhar em outros sites

  • 0

entao mais nao sei mexer nas sources mano n sei nem como abrir elas e nem onde ficam..

 

o outro prolema e o segunte este evento nao é automatico e eu gostaria que fosse ..

porem nao sei como criar um script de global events para abri-lo pois este evento e aberto e fechado pelo GM pelo comando /fps open e /fps close..

e esta parte fica em MODS e nao sei como encaixar um script de globalevents la pra abrir e fecha o evento entendeu..me ajuda porfavor mano..

Link para o comentário
Compartilhar em outros sites

  • 0

Bom, você vai ter que aprender a abrir e compilar se quiser resolver esse problema.

Mas pra te ajudar, já vou te dizer onde e o que você tem que alterar, basta você aprender o resto.

 

Abra combat.cpp e procure pela função (tem duas canDoCombat, então olhe direito pra não errar)

 Combat::canDoCombat(const Creature* attacker, const Creature* target, bool isAggressive)

onde tem:

if((g_game.getWorldType() == WORLDTYPE_OPTIONAL && !Combat::isInPvpZone(attacker, target)
				&& !attackerPlayer->isEnemy(targetPlayer, true)) || isProtected(const_cast<Player*>(attackerPlayer),
				const_cast<Player*>(targetPlayer)) || (g_config.getBool(ConfigManager::CANNOT_ATTACK_SAME_LOOKFEET)
				&& attackerPlayer->getDefaultOutfit().lookFeet == targetPlayer->getDefaultOutfit().lookFeet)
				|| !attackerPlayer->canSeeCreature(targetPlayer))
				return RET_YOUMAYNOTATTACKTHISPLAYER;

Troque por:

if((g_game.getWorldType() == WORLDTYPE_OPTIONAL && !Combat::isInPvpZone(attacker, target)
				&& !attackerPlayer->isEnemy(targetPlayer, true)) || isProtected(const_cast<Player*>(attackerPlayer),
				const_cast<Player*>(targetPlayer)) || !attackerPlayer->canSeeCreature(targetPlayer))
				return RET_YOUMAYNOTATTACKTHISPLAYER;

Cara acabei de descobrir uma forma mais fácil de resolver isso, vou manter a sugestão anterior pq é util tb mas você pode simplesmente ir em config.lua e trocar:

noDamageToSameLookfeet = true

por:

noDamageToSameLookfeet = false

Espero ter ajudado.

Abraços,

Link para o comentário
Compartilhar em outros sites

  • 0

Funcionou o noDamageToSameLookfeet = false ..

 

so tem um problema agora a parte de abrir e fecha o evento pelo gm.. ficar entrando tod dia pra abrir o evento e canssativo.

 

se souber como fazer o script globalevent pra abrir toda dia em x Horario e fechar depois de x Tempo depois que foi aberto..

 

ake esta tudo que foi instalado no servdor a respeito deste evento.

 

creio que essa seja a parte principal

 

Mods

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Jogos Vorazes System" version="1.0" enabled="yes">
<config name="battle-config"><![CDATA[
function msgForOthers(mensagem, classe)
if (not classe) then
classe = MSG_WHITE
end
for _, pid in ipairs(getPlayersOnline()) do
if (getPlayerStorageValue(pid, 5602) == 1) then
doPlayerSendChannelMessage(pid, "", mensagem, classe, FPS_CHANNEL)
end
end
return true
end
function doPlayerRemoveLethalConditions(cid) -- function by Rush Event.
local tmp = {1, 2, 4, 16, 32, 65, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536}
for i = 1, #tmp do
if (hasCondition(cid, tmp)) then
doRemoveCondition(cid, tmp)
end
end
return true
end
function closeEvent(cid)
setGlobalStorageValue(5600, -1)
setGlobalStorageValue(5601, -1)
for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(pid, "", ""..FPS_EVENTNAME.." foi fechado.", MSG_WHITE, FPS_CHANNEL)
if (getPlayerStorageValue(pid, 5602) == 1) then
doSendMagicEffect(getThingPos(pid), CONST_ME_POFF)
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
doCreatureAddHealth(pid, getCreatureMaxHealth(pid), false)
doCreatureAddMana(pid, getCreatureMaxMana(pid), false)
setPlayerStorageValue(pid, 5601, 0)
setPlayerStorageValue(pid, 5602, 0)
setPlayerStorageValue(pid, 5603, 0)
doPlayerSave(pid)
end
end
setGlobalStorageValue(5602, -1)
return true
end
MSG_WHITE = TALKTYPE_CHANNEL_MANAGEMENT or TALKTYPE_CHANNEL_W
MSG_RED = TALKTYPE_GAMEMASTER_CHANNEL or TALKTYPE_CHANNEL_RN
MSG_ORANGE = TALKTYPE_CHANNEL_ORANGE or TALKTYPE_CHANNEL_O
]]></config>
<talkaction log="yes" words="/fps" event="script"><![CDATA[
domodlib('battle-config')
function onSay(cid, words, param, channel)
if (param == "") then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error, comando inválido.")
end
if (getPlayerAccess(cid) >= 3) then
if (string.lower(param) == "open") then
if (getGlobalStorageValue(5600) ~= 1) then
setGlobalStorageValue(5600, 1)
if (getGlobalStorageValue(5600) == 1) then
setGlobalStorageValue(5602, 0)
doBroadcastMessage(""..FPS_EVENTNAME.." foi aberto, fale com o NPC 'Jogos Vorazes Manager, Localizado no subsolo do dp de Thais'.", 22)
end
else
return true
end
return true
end
if (string.lower(param) == "close") then
if (getGlobalStorageValue(5600) ~= -1 and getGlobalStorageValue(5601) ~= 1) then
setGlobalStorageValue(5601, 1)
setPlayerStorageValue(cid, 5605, 1)
msgForOthers(""..FPS_FINISHTIME.." segundos restantes.")
addEvent(setPlayerStorageValue, FPS_FINISHTIME * 1000, cid, 5605, -1)
addEvent(closeEvent, FPS_FINISHTIME * 1000, cid)
else
doPlayerPopupFYI(cid, "AVISO :\n"..getCreatureName(cid)..", o portal encontra-se fechado atualmente.\nimpossivel fecha-lo duas vezes.")
return true
end
return true
end
local t = string.explode(param, ",")
local pid = getPlayerByName(t[2])
if (string.lower(t[1]) == "ban") then
if (not t[2] or tonumber(t[2])) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
return true
end
if (not isPlayer(pid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
return true
end
if (getPlayerStorageValue(pid, 5604) ~= 1) then
if (getPlayerStorageValue(pid, 5602) == 1) then
doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
end
setPlayerStorageValue(pid, 5601, 0)
setPlayerStorageValue(pid, 5602, 0)
setPlayerStorageValue(pid, 5604, 1) -- blocked.
msgForOthers(""..t[2].." foi bloqueado(a).")
local ba_banr = "Admininstrador"
if (FPS_REVEALEDAFTERBANPLAYER) then
ba_banr = ""..getCreatureName(cid)..""
end
doPlayerPopupFYI(pid, "AVISO :\n O "..ba_banr.." bloqueou você.\nvocê está temporariamente bloqueado(a) de participar.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você bloqueou "..t[2]..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi bloqueado(a).")
return true
end
return true
end
if (string.lower(t[1]) == "unban") then
if (not t[2] or tonumber(t[2])) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
return true
end
if (not isPlayer(pid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
return true
end
if (getPlayerStorageValue(pid, 5604) == 1) then
setPlayerStorageValue(pid, 5604, 0) -- unblocked.
msgForOthers(""..t[2].." foi desbloqueado(a).")
doPlayerPopupFYI(pid, "AVISO :\nVocê foi desbloqueado(a).\nparticipe do "..FPS_EVENTNAME.." quando o mesmo estiver disponível.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou "..t[2]..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi desbloqueado(a).")
return true
end
return true
end
end
local ba_players = "Indisponível"
if (getGlobalStorageValue(5602) ~= -1) then
ba_players = tostring(getGlobalStorageValue(5602))
end
local limiteplayers = ""..ba_players.."/"..FPS_LIMITEPLAYERS..""
if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS) then
limiteplayers = "FULL/"..FPS_LIMITEPLAYERS..""
end
if (string.lower(param) == "status") then
local status = ""..FPS_EVENTNAME.." Status :\nOla "..getCreatureName(cid)..",\nveja algumas informações sobre o(a) "..FPS_EVENTNAME.."."
doShowTextDialog(cid, 2395, ""..status.."\n\nPontos : ("..getPlayerStorageValue(cid, 5601)..")\nJogadores : ["..limiteplayers.."]")
return true
end
return true
end
]]></talkaction>
<event type="preparedeath" name="FPSprepare" event="script"><![CDATA[
domodlib('battle-config')
function onPrepareDeath(cid, deathList)
local target = deathList[1]
if (getGlobalStorageValue(5600) == 1 and getPlayerStorageValue(cid, 5602) == 1) then
local i = 10
doPlayerOpenChannel(cid, FPS_CHANNEL)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerRemoveLethalConditions(cid)
if (isMonster(target)) then
addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." matou você.", MSG_RED, FPS_CHANNEL)
setPlayerStorageValue(cid, 5602, 0)
msgForOthers(""..getCreatureName(target).." matou "..getCreatureName(cid)..".")
setPlayerStorageValue(cid, 5602, 1)
setPlayerStorageValue(cid, 5601, 0)
return false
end
if (not isCreature(target)) then
addEvent(doPlayerSendChannelMessage, i, cid, "", "Voce cometeu suicídio.", MSG_RED, FPS_CHANNEL)
setPlayerStorageValue(cid, 5602, 0)
msgForOthers(""..getCreatureName(cid).." cometeu suicídio.")
setPlayerStorageValue(cid, 5602, 1)
setPlayerStorageValue(cid, 5601, 0)
return false
end
doPlayerOpenChannel(target, FPS_CHANNEL)
setPlayerStorageValue(target, 5601, getPlayerStorageValue(target, 5601)+1)
setPlayerStorageValue(cid, 5602, 0)
setPlayerStorageValue(target, 5602, 0)
msgForOthers(""..getCreatureName(target).." derrotou "..getCreatureName(cid)..".")
setPlayerStorageValue(target, 5602, 1)
setPlayerStorageValue(cid, 5602, 1)
addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." derrotou você.", MSG_RED, FPS_CHANNEL)
addEvent(doPlayerSendChannelMessage, i, target, "", "Você derrotou "..getCreatureName(cid)..".", MSG_ORANGE, FPS_CHANNEL)
dofile("config.lua")
local EXP = 0
if (FPS_ENABLEEXPERIENCE) then
EXP = rateExperience * getPlayerLevel(cid)
doPlayerAddExperience(target, EXP)
end
doSendAnimatedText(getThingPos(target), tostring(EXP), gainExperienceColor)
doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "Você ganhou "..EXP.." ponto(s) de experiência.")
setPlayerStorageValue(cid, 5601, 0)
return false
end
return true
end
]]></event>
<event type="logout" name="FPSlogout" event="script"><![CDATA[
domodlib('battle-config')
function onLogout(cid)
if (getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(cid, 5602) == 1 or getPlayerStorageValue(cid, 5605) == 1) then
doPlayerSendCancel(cid, "Aguarde "..FPS_FINISHTIME.." segundo(s).")
return false
end
if(getPlayerStorageValue(cid, 5602) == 1) then
setPlayerStorageValue(cid, 5601, 0)
setPlayerStorageValue(cid, 5602, 0)
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerSendChannelMessage(cid, "", "Você saiu do jogo.", MSG_WHITE, FPS_CHANNEL)
doPlayerRemoveLethalConditions(cid)
doPlayerSave(cid)
if (getPlayerAccess(cid) < 3) then
setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
msgForOthers(""..getCreatureName(cid).." saiu do jogo.")
end
return false
end
return true
end
]]></event>
<event type="combat" name="FPScombat" event="script"><![CDATA[
function onCombat(cid, target)
if(FPS_BLOCKIP) then
if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
end
for _, pid in ipairs(getPlayersOnline()) do
if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
return false
end
end
return true
end
]]></event>
<event type="attack" name="FPSattack" event="script"><![CDATA[
function onAttack(cid, target)
if(FPS_BLOCKIP) then
if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
end
for _, pid in ipairs(getPlayersOnline()) do
if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
return false
end
end
return true
end
]]></event>
<event type="login" name="FPSlogin" event="buffer"><![CDATA[
if (getPlayerStorageValue(cid, 5601) == -1) then
setPlayerStorageValue(cid, 5601, 0)
end
registerCreatureEvent(cid, "FPSprepare")
registerCreatureEvent(cid, "FPSlogout")
registerCreatureEvent(cid, "FPScombat")
registerCreatureEvent(cid, "PFSattack")
registerCreatureEvent(cid, "PFScast")
]]></event>
<globalevent name="FPS tips" interval="600000" event="script"><![CDATA[
domodlib('battle-config')
function onThink(interval)
local FPS_tips = {
"Atualmente existem "..getGlobalStorageValue(5602).." player(s) lutando, não deixe de participar.",
"Com o canal fechado, você não recebe informações dentro do jogo. deixe-o sempre aberto.",
"Cuidado ao ofender um jogador, você corre o risco de ser bloqueado(a).",
"Aperte 'CTRL + Q' caso você queira sair do jogo, você precisa está em protection zone.",
"Chame seus amigos e venha jogar, porquê aqui a diversão nunca acaba.",
"Dica : configure o comando '/fps status' como hotkey. Assim você poderá checar suas informações com facilidade."
}
if (getGlobalStorageValue(5600) == 1) then
msgForOthers(FPS_tips[math.random(1, #FPS_tips)])
end
return true
end
]]></globalevent>
</mod>

 

 

 

data/Lib

 

 

 

--[[
'Jogos Vorazes' desenvolvido por Bruninho.
]]
FPS_EVENTNAME = "Jogos Vorazes" -- Nome do evento.
FPS_FINISHTIME = 1 -- Dentro do evento, jogadores não poderão atacar uns aos outros enquanto esse tempo não esgotar após o comando /fps close ser executado.
FPS_LIMITEPLAYERS = 26 -- Limite de jogadores.
FPS_SHOWGODNAMEAFTERBAN = false -- true = Mostra o nome do GM na mensagem do banido; false = Mostra o nome 'Admininstrador'.
FPS_ENABLEEXPERIENCE = true -- true = Habilita a experiência; false = Desabilita.
FPS_BLOCKIP = false -- true = Jogadores que tentarem usar MC pra ganhar exp fácil, não conseguirão atacar seus próprios chars; false = permite isso.
FPS_CHANNEL = 15 -- ID do Battle Arena Channel.
FPS_SPAWNPLAYER = {
{x = 32145, y = 32127, z = 6},
{x = 32133, y = 32115, z = 6},
{x = 32156, y = 32116, z = 6},
{x = 32145, y = 32155, z = 6},
{x = 32136, y = 32149, z = 6},
{x = 32154, y = 32149, z = 6},
{x = 32144, y = 32103, z = 6}
}

 

 

 

Data/Npc.xml

 

 

 

<?xml version="1.0"?>
<npc name="Jogos Vorazes Manager" floorchange="0" walkinterval="2000">
<health now="150" max="150"/>
<look type="266"/>
<interaction range="3" idletime="30" idleinterval="1500" defaultpublic="0">
<interact keywords="hi" focus="1">
<action name="script" value="hello"/>
<response><action name="script"><![CDATA[
local str = "Olá "..getCreatureName(cid)..""
if (getGlobalStorageValue(5600) ~= 1) then
selfSay(""..str..", infelizmente estamos indisponível. {bye}!", cid)
else
selfSay("Tem "..getGlobalStorageValue(5602).." player(s) lá dentro, deseja {Participar}?", cid)
return true
end
]]></action>
<interact keywords="participar">
<action name="script" value="join"/>
<response><action name="script"><![CDATA[
if (getGlobalStorageValue(5600) ~= 1) then
return true
end
if (getPlayerStorageValue(cid, 5604) == 1) then
selfSay("Sinto muito, você está temporariamente bloqueado(a).", cid)
return true
end
doPlayerOpenChannel(cid, FPS_CHANNEL)
selfSay("Confirme : {Ok} ou {Cancelar}?", cid)
]]></action>
<interact keywords="ok">
<action name="script" value="ok"/>
<response><action name="script"><![CDATA[
if (getGlobalStorageValue(5600) ~= 1) then
return true
end
if (getGlobalStorageValue(5601) == 1) then
selfSay("Já iremos fechar, volte outro dia!", cid)
return true
end
if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS and getPlayerAccess(cid) < 3) then
selfSay("Limite de jogadores alcançado, aguarde até que alguém saia.", cid)
return true
end
selfSay("Boa sorte!", cid)
if (getPlayerStorageValue(cid, 5602) ~= 1) then
domodlib('battle-config')
doPlayerSendChannelMessage(cid,"", "Você está participando do jogo.", MSG_WHITE, FPS_CHANNEL)
if (getPlayerAccess(cid) < 3) then
setGlobalStorageValue(5602, getGlobalStorageValue(5602)+1)
msgForOthers(""..getCreatureName(cid).." está participando do jogo.")
end
setPlayerStorageValue(cid, 5602, 1)
end
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerOpenChannel(cid, FPS_CHANNEL)
]]></action></response>
</interact>
<interact keywords="cancelar" focus="0">
<response text="Okay {|NAME|}, volte quando puder!"/>
</interact>
</response>
</interact>
<interact keywords="bye" focus="0">
<response text="Tchau, até breve!"/>
</interact>
</response>
</interact>
<interact event="onPlayerLeave" focus="0">
<response text="How rude!" public="1"/>
</interact>
</interaction>
</npc>

 

 

 

Data / Xml / Channels

 

 

 

<channel id="15" name="Battle Arena Channel"/>

 

 

 

bom e isso tudo sHSuhSUHS..desculpa encomodar vc pois n tenho a quem recorrer amigo

 

 

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...