Ao atacar mudar outfit

Allangod
em Scripts
  • 1
  • 2

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Gostaria de pedir um system que ao atacar usando arma melee (De perto) o player mudaria de outfit por um segundo (Copiando a cor do outfit normal, pq normalmente ele fica cinza).

Que nem esse video aqui

Eu sei que ja tem um Attack System aki no xtibia mas nao funfo aqui (Nenhum player consegue pegar target de ngm,ou seja, nao ataca).

Podem olhar se quiserem http://www.xtibia.co...-attack-system/

Uso forgotten server 8.54.

Vlws e REP+ para quem conseguir.

Oneshot

avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 05/07/09Posts: 1347

local outfits = {
       [136] = 137,
       [128] = 129,
}

function onAttack(cid, target)
       local tmp = getCreatureOutfit(cid)
       if outfits[tmp.lookType] then
               tmp.lookType = outfits[tmp.lookType]
               doSetCreatureOutfit(cid, tmp, 900)
       end
       return true
end

 

registerCreatureEvent(cid, "AttackAnimation")

 

<event type="attack" name="AttackAnimation" event="script" value="attackanimation.lua"/>

 

Testado e funcional.

 

Coloquei como exemplo, se o jogador está com a outfit Citizen, muda para Hunter por 900 milissegundos, ficaria bem mais realista se mudasse conforme o attackspeed do jogador, mas não existe uma função que retorne o attackspeed.

 

Abraços.

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Puts cara muito bom! Tem como modificar pra tpw... só trocar de roupa se tiver colado no cara?

tonynamoral

Administrador DragonHeart
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/09/10Posts: 319Char no Tibia: lest sarif

E como faz para o player trocar de outfit de acordo com a direçao dele?

sign1z.png

Clique na imagem e veja nosso TOPICO OFFICIAL

Snowsz

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 22/01/12Posts: 121Char no Tibia: Not...

Use getPlayerLookDir(cid)

Oi '-'

tonynamoral

Administrador DragonHeart
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/09/10Posts: 319Char no Tibia: lest sarif

Nao teria como usar tabelas para isso?

sign1z.png

Clique na imagem e veja nosso TOPICO OFFICIAL

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

pra soh mudar quando ta perto coloca..

if getDistanceBetween(getPlayerPosition(cid), getPlayerPosition(target)) > 1 then
return true
end

 

tony

da sim pra usar tabelas pra isso...

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

tonynamoral

Administrador DragonHeart
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/09/10Posts: 319Char no Tibia: lest sarif

local outfits = {

[123] = {[0] , lookType = 124}

}

local get = getCreatureOutfit(cid)

local dir = getCreatureLookDir(cid)

 

doSetCreatureOutfit(cid,outfits[get][dir].lookType,-1)

 

assim?

sign1z.png

Clique na imagem e veja nosso TOPICO OFFICIAL

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

hã.. nao! kk +/- assim..

 

local outfits = {
[123] = {
		  [0] = {lookType = 124},
		  [1] = {lookType = 125},
		  [2] = {lookType = 126},
		  [3] = {lookType = 127},
		},
[150] = {
		  [0] = {lookType = 151},
		  [1] = {lookType = 152},
		  [2] = {lookType = 153},
		  [3] = {lookType = 154},
		},
}
local get = getCreatureOutfit(cid)
local dir = getCreatureLookDir(cid)

if outfits[get.lookType] then
doSetCreatureOutfit(cid, outfits[get.lookType][dir], 900)
end

 

 

edit: odeio esse CODE --' bem q podiam da um jeito nele kk

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

tonynamoral

Administrador DragonHeart
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/09/10Posts: 319Char no Tibia: lest sarif

tyyyyyyy

sign1z.png

Clique na imagem e veja nosso TOPICO OFFICIAL

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Pra finalizar tem como vc fazer igualzinho esse só q só troca a outfit se for de perto?

Igual a esse \/ só q só usar se tiver de perto

 

 

 

local outfits = {

[136] = 137,

[128] = 129,

}

 

function onAttack(cid, target)

local tmp = getCreatureOutfit(cid)

if outfits[tmp.lookType] then

tmp.lookType = outfits[tmp.lookType]

doSetCreatureOutfit(cid, tmp, 900)

end

return true

end

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

ja flei q eh soh por isso..

if getDistanceBetween(getPlayerPosition(cid), getPlayerPosition(target)) > 1 then
return true
end

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Assim?

local outfits = {

[136] = 137,

[128] = 129,

}

 

function onAttack(cid, target)

if getDistanceBetween(getPlayerPosition(cid), getPlayerPosition(target)) > 1 then

return true

end

local tmp = getCreatureOutfit(cid)

if outfits[tmp.lookType] then

tmp.lookType = outfits[tmp.lookType]

doSetCreatureOutfit(cid, tmp, 900)

end

return true

end

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

em tese, sim

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Ok, vou testar e jaja te falo

 

Funfo perfeitamente. Ja dei meu REP+ pro Oneshot e amanha dou pra vc slicer

Podem mover

  • 1
  • 2