Makers Brasil
Bem Vindos a Maker´s Brasil (um forum para criação de servidores 2D e 3D)Nos desejamos boa sorte no seu projeto!

Spell Linear

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Spell Linear

Mensagem por spectrus em Dom Jul 03, 2011 2:48 pm

Bem devido a muitos pedidos eu irei postar um tuto de spell
linear, porem ele não pega em eclipse origins, nem elysium, isso é para
responder possíveis perguntas, ele irá pegar nos outros demais
eclipse's, stable, 2.7 e assim vai.

Spell Linear



Client Side

Va no frmSpellEditor e adicione no cmbType + uma list chamada "Linear"

Logo vá no modConstant e procure por

Código:
Public Const SPELL_TYPE_SCRIPTED = 6
e embaixo dele add:
Public Const SPELL_TYPE_LINEAR = 7
Client Side Finalized
----------------------
Server Side

No final de modGameLogic add
Código:
Sub Linear(Byval Index as Integer,Byval Range as Byte,Byval Damage as Long,byval Spell as integer)
Dim I as byte
dim Map as integer
Dim Dir as byte
Dim X as byte
dim Y as byte

Dir = getplayerdir(index)
x = getplayerx(index)
y = getplayery(index)
Map = getplayermap(index)
For I = 1 to Range

select case Dir
Case 0
Call SpellAnim(spell , Index, X, Y - i)
Call CheckAttackNPC(index, Map, X, Y - i, Damage)

Case 1
Call SpellAnim(spell , Index, X, Y + i)
Call CheckAttackNPC(index, Map, X, Y + i, Damage)

Case 2
Call SpellAnim(spell, Index, X - i, Y)
Call CheckAttackNPC(index, Map, X - i, Y, Damage)

Case 3
Call SpellAnim(spell, Index, X + i, Y)
Call CheckAttackNPC(index, Map, X + i, Y, Damage)

End Select
Next I

End Sub

Sub SpellAnim(ByVal SpellNum As Long,byval Index as integer, ByVal X As Long, ByVal Y As Long)
    Call SendDataToMap(getplayermap(index), "scriptspellanim" & SEP_CHAR & SpellNum & SEP_CHAR & Spell(SpellNum).SpellAnim & SEP_CHAR & Spell(SpellNum).SpellTime & SEP_CHAR & Spell(SpellNum).SpellDone & SEP_CHAR & X & SEP_CHAR & Y & SEP_CHAR & Spell(SpellNum).Big & END_CHAR)
End Sub

Sub CheckAttackNPC(byval Index as integer,Byval map as integer,byval x as integer,byval y as integer,byval Damage as integer)
dim count as Integer
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
Call CheckAttackPlayer(index, map, x, y, Damage)
End Sub

Sub CheckAttackPlayer(byval index as integer,byval map as integer,byval x as integer,byval y as integer,byval Damage as long)
dim count as integer
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
If GetMapMoral(GetPlayerMap(index)) = 0 Then
Call DamagePlayer(index, count, Damage)
else
Call PlayerMsg(index, "Safe Zone!", 12)
end if
end if
end if
end if
count = count + 1
loop
End Sub

Sub DamageNPC(ByVal Index As Long, ByVal NPCnum As Long, ByVal Damage As Long)
    Call AttackNpc(Index, NPCnum, Damage)
    Call SendDataTo(Index, "BLITPLAYERDMG" & SEP_CHAR & Damage & SEP_CHAR & NPCnum & END_CHAR)
End Sub

Sub DamagePlayer(ByVal Index As Long, ByVal PIndex As Long, ByVal Damage As Long)
    Call AttackPlayer(Index, PIndex, Damage)
End Sub

Public Function GetMapMoral(ByVal MapNum As Long) As Byte
    GetMapMoral = Map(MapNum).Moral
End Function

Function GetNpcX(ByVal MapNum As Long, ByVal MapNpcNum As Long)

    If MapNpcNum < 1 Or MapNpcNum > 25 Then
    Else
        GetNpcX = MapNPC(MapNum, MapNpcNum).X
    End If

End Function


Function GetNpcY(ByVal MapNum As Long, ByVal MapNpcNum As Long)

    If MapNpcNum > 0 Then
        GetNpcY = MapNPC(MapNum, MapNpcNum).Y
    End If

End Function
Agora no mesmo module procure pela a sub CastSpell e embaixo de:
Código:
If Spell(SpellNum).Type = SPELL_TYPE_SCRIPTED Then

        MyScript.ExecuteStatement "Scripts\Main.ess", "ScriptedSpell " & Index & "," & Spell(SpellNum).Data1

        Exit Sub
    End If

colocar
Código:
If Spell(SpellNum).Type = SPELL_TYPE_LINEAR Then
Call Lienar(Index, SpelL(SpellNum).Range, SpelL(SpellNum).Data1, SpellNum)
Exit Sub
end If[b]
[/b]Server Side Finalized

Sistema pronto!


Divulgue nosso Forum!
[Você precisa estar registrado e conectado para ver este link.]
Código:
[url=http://makersbrasil.forumeiros.com/]
src="http://img841.imageshack.us/img841/9522/92324935.png"
border="0">[/url]



E meu fan? entao use:

Código:
[img]http://www.baixa.la/arquivos/3908525_imagem.gif[/img]

Sign:
Spoiler:




spectrus
Administrador
Administrador

Mensagens : 299
Estrelas Makers : 1466
Creditos : 49
Data de inscrição : 01/01/2011
Idade : 23
Localização : V.da conquista bahia

Voltar ao Topo Ir em baixo

Re: Spell Linear

Mensagem por thales12 em Dom Jul 03, 2011 2:50 pm

Boa boa meu garoto ...
daki a pouco tu vai ta programando mais doq eu ! e.e
+1 CRED

thales12
Moderador
Moderador

Mensagens : 184
Estrelas Makers : 406
Creditos : 55
Data de inscrição : 22/03/2011
Idade : 22
Localização : Rio de Janeiro

http://www.rdmgames.tk

Voltar ao Topo Ir em baixo

Re: Spell Linear

Mensagem por teteu em Dom Jul 17, 2011 10:36 am

Arrume seu tutorial dessa forma ou nao funcionara
Spell Linear

Client Side

Va no frmSpellEditor e adicione no cmbType + uma list chamada "Linear"

Logo vá no modConstant e procure por [/b]
Código:
Public Const SPELL_TYPE_SCRIPTED = 6
e embaixo dele add:
Código:
Public Const SPELL_TYPE_LINEAR = 7
Client Side Finalized
----------------------
Server Side
Procure:
Código:
Public Const SPELL_TYPE_SCRIPTED = 6
e embaixo dele add:
Código:
Public Const SPELL_TYPE_LINEAR = 7

No final de modGameLogic add
Código:
Sub Linear(Byval Index as Integer,Byval Range as Byte,Byval Damage as Long,byval Spell as integer)
Dim I as byte
dim Map as integer
Dim Dir as byte
Dim X as byte
dim Y as byte

Dir = getplayerdir(index)
x = getplayerx(index)
y = getplayery(index)
Map = getplayermap(index)
For I = 1 to Range

select case Dir
Case 0
Call SpellAnim(spell , Index, X, Y - i)
Call CheckAttackNPC(index, Map, X, Y - i, Damage)

Case 1
Call SpellAnim(spell , Index, X, Y + i)
Call CheckAttackNPC(index, Map, X, Y + i, Damage)

Case 2
Call SpellAnim(spell, Index, X - i, Y)
Call CheckAttackNPC(index, Map, X - i, Y, Damage)

Case 3
Call SpellAnim(spell, Index, X + i, Y)
Call CheckAttackNPC(index, Map, X + i, Y, Damage)

End Select
Next I

End Sub

Sub SpellAnim(ByVal SpellNum As Long,byval Index as integer, ByVal X As Long, ByVal Y As Long)
    Call SendDataToMap(getplayermap(index), "scriptspellanim" & SEP_CHAR & SpellNum & SEP_CHAR & Spell(SpellNum).SpellAnim & SEP_CHAR & Spell(SpellNum).SpellTime & SEP_CHAR & Spell(SpellNum).SpellDone & SEP_CHAR & X & SEP_CHAR & Y & SEP_CHAR & Spell(SpellNum).Big & END_CHAR)
End Sub

Sub CheckAttackNPC(byval Index as integer,Byval map as integer,byval x as integer,byval y as integer,byval Damage as integer)
dim count as Integer
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
Call CheckAttackPlayer(index, map, x, y, Damage)
End Sub

Sub CheckAttackPlayer(byval index as integer,byval map as integer,byval x as integer,byval y as integer,byval Damage as long)
dim count as integer
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
If GetMapMoral(GetPlayerMap(index)) = 0 Then
Call DamagePlayer(index, count, Damage)
else
Call PlayerMsg(index, "Safe Zone!", 12)
end if
end if
end if
end if
count = count + 1
loop
End Sub

Sub DamageNPC(ByVal Index As Long, ByVal NPCnum As Long, ByVal Damage As Long)
    Call AttackNpc(Index, NPCnum, Damage)
    Call SendDataTo(Index, "BLITPLAYERDMG" & SEP_CHAR & Damage & SEP_CHAR & NPCnum & END_CHAR)
End Sub

Sub DamagePlayer(ByVal Index As Long, ByVal PIndex As Long, ByVal Damage As Long)
    Call AttackPlayer(Index, PIndex, Damage)
End Sub

Public Function GetMapMoral(ByVal MapNum As Long) As Byte
    GetMapMoral = Map(MapNum).Moral
End Function

Function GetNpcX(ByVal MapNum As Long, ByVal MapNpcNum As Long)

    If MapNpcNum < 1 Or MapNpcNum > 25 Then
    Else
        GetNpcX = MapNPC(MapNum, MapNpcNum).X
    End If

End Function


Function GetNpcY(ByVal MapNum As Long, ByVal MapNpcNum As Long)

    If MapNpcNum > 0 Then
        GetNpcY = MapNPC(MapNum, MapNpcNum).Y
    End If

End Function
Agora no mesmo module procure pela a sub CastSpell e embaixo de:
Código:
If Spell(SpellNum).Type = SPELL_TYPE_SCRIPTED Then

        MyScript.ExecuteStatement "Scripts\Main.ess", "ScriptedSpell " & Index & "," & Spell(SpellNum).Data1

        Exit Sub
    End If

colocar
Código:
If Spell(SpellNum).Type = SPELL_TYPE_LINEAR Then
Call Linear(Index, SpelL(SpellNum).Range, SpelL(SpellNum).Data1, SpellNum)
Exit Sub
end If[b]
[/b]Server Side Finalized

Sistema pronto!


E como a intenção de todos nos é ajudar + 1 credito.

teteu
Modelador
Modelador

Mensagens : 4
Estrelas Makers : 8
Creditos : 2
Data de inscrição : 03/07/2011

Voltar ao Topo Ir em baixo

Re: Spell Linear

Mensagem por Conteúdo patrocinado Hoje à(s) 8:43 pm


Conteúdo patrocinado


Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum