Universo Games
Ola , Convidado

 Spell que Persegue Logo1110

Você ainda não e cadastrado então cadastre-se e veja todas as atualizações no Mundo RPG!!!
Universo Games
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Universo Games

Suporte e Desenvolvimento só no Universo Games
 
InícioInício  PortalPortal  EventosEventos  PublicaçõesPublicações  Últimas imagensÚltimas imagens  RegistarRegistar  EntrarEntrar  
Ola Convidado, Seja Bem vindo a equipe lhe deseja boa sorte no seu projeto!

 

  Spell que Persegue

Ir para baixo 
AutorMensagem
Lucas Roberto
Administrador
Administrador
Lucas Roberto


Mensagens : 711

 Spell que Persegue Empty
MensagemAssunto: Spell que Persegue    Spell que Persegue EmptyTer 12 Jul 2011, 21:46

Bom eu tinha postado em outro tópico só que pra deixar um pouco mais organizado to criando o tópico aqui

.::Descrição::.
•É uma spell onde você da target em algum player ou npc ela persegue até atingir


Va no Main.txt

no final adicione isto:

Código:
Sub HomingPlayer(index, Dist, Damage, map, x, y, target, Spell)
If Dist = 0 Then
Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell)
Else
If isplaying(target) = False Then
Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell)
Exit Sub
End If
Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell)
Call SpellAnim(Spell, map, x, y)
If StandingHere(map, x, y) <> "0" Then
Call CheckAttackNPC(index, map, x, y, Damage)
Call CheckAttackPlayer(index, map, x, y, Damage)
Exit Sub
End If
If map <= GetPlayerMap(target) Then
Exit Sub
End If
If x > GetPlayerX(target) Then
x = Int(x) + 1
End If
If x < GetPlayerX(target) Then
x = Int(x) + 1
End If
If Int(y) > GetPlayerY(target) Then
y = Int(y) + 1
End If
If Int(y) < GetPlayerY(target) Then
y = Int(y) + 1
End If
Dist = Int(Dist) - 1
Call SetTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell, 75)
End If
End Sub

Sub HomingNPC(index, Dist, Damage, map, x, y, target, Spell)
If Dist = 0 Then
Call RemoveTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell)
Else
Call RemoveTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell)
Call SpellAnim(Spell, map, x, y)
If StandingHere(map, x, y) > 0 Then
Call CheckAttackNPC(index, map, x, y, Damage)
Call CheckAttackPlayer(index, map, x, y, Damage)
Exit Sub
End If
If x > getnpcx(map, target) Then
x = x - 1
ElseIf x < getnpcx(map, target) Then
x = x + 1
End If
If y > getnpcy(map, target) Then
y = y - 1
ElseIf y < getnpcy(map, target) Then
y = y + 1
End If
Dist = Int(Dist) - 1
Call SetTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," &Target & "," & Spell, 75)
End If
End Sub

Sub CheckAttackNPC(index, map, x, y, Damage)
Dim count
count = 1
Do While count < 16
If getnpcx(map, count) = x and getnpcy(map, count) = y Then
Call DamageNPC(index, count, Damage)
Exit Sub
End If
count = count + 1
Loop
End Sub

Sub CheckAttackPlayer(index, map, x, y, Damage)
Dim count
count = 1
Do While count < 51
If count <> index Then
If isplaying(count) Then
If GetPlayerMap(count) = map and GetPlayerX(count) = x and GetPlayerY(count) = y Then
Call DamagePlayer(index, count, Damage)
End If
End If
End If
count = count + 1
Loop
End Sub

Sub CheckAnimNPC(index, map, x, y, Spell)
Dim count
count = 1
Do While count < 16
If getnpcx(map, count) = x and getnpcy(map, count) = y Then
Call SpellAnim(Spell, map, x, y)
Exit Sub
End If
count = count + 1
Loop
End Sub

Sub CheckAnimPlayer(index, map, x, y, Spell)
Dim count
count = 1
Do While count < 51
If count <> index Then
If isplaying(count) Then
If GetPlayerMap(count) = map and GetPlayerX(count) = x and GetPlayerY(count) = y Then
Call SpellAnim(Target, map, x, y)
End If
End If
End If
count = count + 1
Loop
End Sub

Código:
Sub XXXXX(index, Dist, Damage, SpellNo, Speed)
If getplayertarget(index) > 0 Then
Call SetTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & GetPlayerMap(index) & "," & getplayerdirx(index) & "," & getplayerdiry(index) & "," & GetPlayertarget(index) & "," & SpellNo, Speed)   
ElseIf getplayertargetnpc(index) > 0 Then
Call SetTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & GetPlayerMap(index) & "," & getplayerdirx(index) & "," & getplayerdiry(index) & "," & GetPlayertargetNPC(index) & "," & SpellNo, Speed)   
Else
Call PlayerMSG(index, "No Target Selected!", 4)
End If
End Sub

XXXXX= Nome Da Spell

Em seguida procure pela sub ScriptedSpell

e adicione:

Código:
Case Y 'spell perseguidora
Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
Call XXXXX(index, DISTANCIA, DAMAGE, Nº DA SPELL ANIMATION, VELOCIDADE)
Exit Sub

Y = Nº da SpellAnim

Créditos
dg1423 - Do forum oficial



Desculpe pelos os erros português.
Ir para o topo Ir para baixo
https://universogamesmmo.forumeiros.com
 
Spell que Persegue
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» [ALL]Spell Memorized
» Transformação por Spell
» Spell Linear
» [ALL]Memorize Spell
» Spell Linear 100%

Permissões neste sub-fórumNão podes responder a tópicos
Universo Games :: Criação de Jogos :: Eclipse :: Tutoriais :: Scripts-
Ir para: