SU

Fight System 0.0.2

Por Subwat, 13 de dez. de 2010 em Actions e Talkactions

script
20
6.1k
SubwatS
13 de dezembro de 2010 às 21:37

•••Bom Pessoal Já postei a versão anterior a alguns meses desse script que eu criei.. o vodkart deu uma modificada no script (melhorou o script),e depois trabalhei um pouco no script que ele melhorou e aqui está o resultado "Fight System 0.0.2".

 

•••Vá em talkactions/Scripts/ crie Um arquivo Chamado FIGHTSYSTEM.LUA cole isso dentro:

--Fight System by Subwat 0.0.2-- 

function onSay(cid, words, param) 

config = {  
level1= 10, -- level necessario do player 1 pra usar o fight system.   
level2= 10, -- level necessario do player 2 pra usar o fight system.   
pid=getPlayerGUID(cid), -- não mecha   
premium = "yes", -- se precisa ser premium account ("yes" or "no")  
redskull="yes", -- players com red skull podem usar o fight system? ("yes" or "no").   
prot="no", -- players precisam estar em protection zone pra usar o fight system? ("yes" or "no").   
bat="no", --players precisam estar sem fight pra huntar? ("yes" or "no"). 
Posplayer1 = {x=288, y=433, z=6}, -- para onde o jogador que deu fight sera levado 
Posplayer2 = {x=295, y=433, z=6}, -- para onde o jogador que aceitou fight sera levado 
RemoveItem = "yes", -- se ira remover o item ("yes" or "no") 
item = 2160, -- id do item 
storage = 9696 
}   


if words == '!fight' or param == "/fight" then 


local player = getPlayerByName(param)   
local pid = getPlayerByNameWildcard(param)   
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then   
doPlayerPopupFYI(cid, "Este Jogador Não está Online Ou Não existe.")   
return TRUE   
end  


if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then   
doPlayerPopupFYI(cid,"apenas player sem red skull podem Usar Fight System.")   

elseif (getPlayerLevel(cid) < config.level1) then 
doPlayerPopupFYI(cid,"você precisa ter level " .. config.level1 .. " pra usar o fight system.") 

elseif (getPlayerLevel(player) < config.level2 ) then 
doPlayerPopupFYI(cid,"o jogador não tem level " .. config.level2 .. " para vc dar fight system.")   

elseif(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then   
doPlayerPopupFYI(cid,"você precisa estar em protection zone pra usar o fight system.")   

elseif(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then   
doPlayerPopupFYI(cid,"você precisa estar sem battler pra usar o fight system.")   

elseif(config.redskull == "no") and (getCreatureSkullType(player) == 4) then   
doPlayerPopupFYI(cid,"o outro player precisa estar sem red skull usar o fight system.")   

elseif(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(player)) == FALSE) then   
doPlayerPopupFYI(cid,"o outro player precisa estar em protection zone pra usar o fight system.")   

elseif(config.bat == "yes") and (getCreatureCondition(player, CONDITION_INFIGHT) == TRUE) then   
doPlayerPopupFYI(cid,"o outro player precisa estar sem battler pra usar o fight system.")   

elseif(config.premium == "yes") and (not isPremium(cid)) then 
doPlayerPopupFYI(cid, "apenas players com premium account podem dar fight.") 

elseif(config.RemoveItem == "yes") and (doPlayerRemoveItem(cid, config.item, 1) == FALSE) then 
doPlayerPopupFYI(cid, "Desculpe,voce não tem 1 " .. getItemNameById(config.item) .. " para dar fight.") 
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) 

elseif isPlayer(player) then  
doPlayerPopupFYI(cid,"Voce acaba de Desafiar o Player chamado " .. getPlayerName(player) .."  espere ele aceitar.")       
doPlayerPopupFYI(player,getCreatureName(cid) .. ' Acaba De Dar Fight em Você,o pvp entre os dois não resultará em skulls deseja aceitar? diga !aceitar se não diga !recusar.') 
setPlayerStorageValue(player, config.storage, 1) 
doTeleportThing(cid,config.Posplayer1) 
doCreatureSetSkullType(cid, 2) 
end 
return TRUE 
end 


if words == '!aceitar' or param == "!accept" then 
if getPlayerStorageValue(cid,config.storage) >= 1 then 
doPlayerPopupFYI(cid, "o jogador aceito,começara o DESAFIO!.") 
setPlayerStorageValue(cid, config.storage, -1)  
doCreatureSetSkullType(cid, 2)  

doTeleportThing(cid,config.Posplayer2) 
doTeleportThing(cid,config.Posplayer1) 
else 
doPlayerPopupFYI(cid, "Desculpe,voce não foi envitado para a Luta.") 
end 
return TRUE 
end 

if words == '!recusar' or param == "!recuse" then 
if getPlayerStorageValue(cid,config.storage) >= 1 then 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "você recusou o a Luta.") 
setPlayerStorageValue(cid, config.storage, -1) 
end 
return TRUE 
end 

return TRUE   
end

 

•••Cole está tag em talkactions.xml:

<talkaction words="!fight;!aceitar;!recusar;/recuse;/fight" event="script" value="FIGHTSYSTEM.lua"/>

 

•••COMO FUNCIONA?

digite !fight Nome do jogador há desafiar.

e o jogador desafiado receberá a proposta de luta e deverá digitar !aceitar para aceitar a luta ou !recusar para cancelar a luta.

 

•••OBS: você deverá configurar as posições aonde os players seram teleportados para a luta ache está tag no inicio do script e modifique Posplayer1 = {x=288, y=433, z=6}, -- para onde o jogador que deu fight sera levado

Posplayer2 = {x=295, y=433, z=6}, -- para onde o jogador que aceitou fight sera levado .

 

créditos:

Subwat

Vodkart

 

TESTEM E COMENTEM VLW ATT :)

fsgF
13 de dezembro de 2010 às 21:45

Nossa SubWat, cada vez melhor! Muito legal o script, seria bem legal fazer um evento de luta. Ficaria bem legal, mas é difícil servidores fazer isto agora.

Muito bom!

Abraços.

4 meses depois...
HuntreH
09 de abril de 2011 às 08:40

como eu adpto isso para um server de pokemon??gostei mt do seu script ^^

quero bota para server de pokemon helps ''

SubwatS
09 de abril de 2011 às 18:42

bah nem sei como funciona um server de pokemon. =/

HuntreH
14 de abril de 2011 às 18:03

hmm tu nao consegue monta 1 script de duelo?tipow que funcione assim , clica no outro player apareçer duel dai tu clica la e dps tu escolhe quantos pokemons que usa (maximo 6) dai começa?

 

se tiver me manda por PRIVATE vlww ai

pelo script qw

coyotestarkC
20 de abril de 2011 às 13:51

nhaaaa no meu ot nao funfa.

20 de abril de 2011 às 18:48

Olha cara, pelo que eu vi ai não deve funcionar o script, mas não testei nem nada, da uma olhada ai.

 

Até mais.

2 meses depois...
leozinhoacL
13 de junho de 2011 às 22:40

mano tem como vc fazer o vencedor voltar para o templo depois q acabar o duel? eu fiz 1 arena mais nao qro por teleport pro cara nao fugir ;D

14 de junho de 2011 às 12:26

Pelo que eu vi o Script parace ser Bom ^^

ninexinN
14 de junho de 2011 às 21:14

muito bom cara vou testar aqui vlw

StigalS
20 de junho de 2011 às 01:12

#Pergunta

 

É Funcional Em "8.54" e Em Servidores De "Pokemon Online!"

 

Responder Mais Rapido Possivel!

 

:XTibia_smile:

1 mês depois...
rino268R
06 de julho de 2011 às 15:15

Esse fight system n é mt bom não....

testei aqui sabe q bug q eu descobri fale assim

!fight SEUNOME

!accept

e veja o bug ¬¬''

mas já vale a iniciativa dos caras de criar 1 script assim e também outra coisa q n gostei foi.

vc pode ficar !fight >>TOP<< qts vezes vc quiser enchendo o saco do cara...

então tem mt coisa a ser melhorada ainda mas fica a seu critério cara..

flw abrass.

CyberOTC
06 de julho de 2011 às 21:01

MT BOM VLW +REP

Editado Julho 6 por CyberOT

TiagohellsT
07 de julho de 2011 às 19:58

Consegui adaptalo para um duel sistem de pokemon só falta os ultimos acabamentos.. Rep++

gynhoG
07 de julho de 2011 às 20:44

Muito bom o script parabens!!!