Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Você não está conectado. Conecte-se ou registre-se

 » Engines » Elysium » Tutoriais » Spell Linear!

Spell Linear!

Ir para baixo  Mensagem [Página 1 de 1]

1Spell Linear! Empty Spell Linear! Sáb Dez 29, 2012 5:04 am

DrayonDuarte

DrayonDuarte

Introdução
Um sistema de magia reta bem util e simples.

1° Oque é Spell Linear?
é um sistema que manda a magia reta, estilo uma arrow

2° Por que postei?
por que, geral fica guardando esse sistema como se fosse uma coisa que ninguém devia saber avá, guarda sistemas é como a descriminação racial. Obs: na minha opinão.

Client~Side

Na frmSpellEditor na cmbType na Propriedade List abaixo de Summon (Create Pet) Adicione:
Código:
Linear


Procure por:
Código:
Public Const SPELL_TYPE_PET = 6


Abaixo adicione:
Código:
Public Const SPELL_TYPE_LINEAR = 7


Server~Side


Procure por:
Código:
Public Const SPELL_TYPE_PET = 6


Abaixo Adicione:
Código:
Public Const SPELL_TYPE_LINEAR = 7


Procure por:
Código:
Sub CastSpell(ByVal Index As Long, _


Abaixo de:
Código:
Dim Packet As String


Adicione:
Código:
Dim u As Long


Abaixo de:
Código:
' Checar se o timer está normal
If GetTickCount < Player(Index).AttackTimer + 1000 Then
Exit Sub
End If

Adicione:
Código:
If Spell(SpellNum).Type = SPELL_TYPE_LINEAR Then
x = GetPlayerX(Index)
y = GetPlayerY(Index)
For i = 1 To Spell(SpellNum).Range
Select Case GetPlayerDir(Index)
Case DIR_UP
y = y - 1
Case DIR_DOWN
y = y + 1
Case DIR_LEFT
x = x - 1
Case DIR_RIGHT
x = x + 1
End Select
Player(Index).Target = MakeLoc(x, y)
Player(Index).TargetType = TARGET_TYPE_LOCATION
N = MakeLoc(x, y)
If x = MAX_MAPX Or y = MAX_MAPY Or GetPlayery(index) = MAX_MAPY Or GetPlayerx(index) = MAX_MAPX Then Exit For
For u = 1 To MAX_MAP_NPCS

Damage = Int(GetPlayerMAGI(Index) / 4) +
Spell(SpellNum).Data1 - Int(Npc(MapNpc(GetPlayerMap(Index), u).num).DEF /
2) + (Rnd * 5) - 2
If MapNpc(GetPlayerMap(Index),
u).num > 0 And MapNpc(GetPlayerMap(Index), u).x = x And
MapNpc(GetPlayerMap(Index), u).y = y Then
If
Npc(MapNpc(GetPlayerMap(Index), u).num).Behavior <>
NPC_BEHAVIOR_FRIENDLY And Npc(MapNpc(GetPlayerMap(Index),
u).num).Behavior <> NPC_BEHAVIOR_SHOPKEEPER Then
If Damage > 0 Then
Call AttackNpc(Index, u, Damage)
Else

Call BattleMsg(Index, "A magia foi muito
fraca para machucar " & Trim$(Npc(MapNpc(GetPlayerMap(Index),
N).num).Name) & "!", BrightRed, 0)
End If
Else
Call PlayerMsg(Index, "Você não pode atacar um npc Amigo!", 4)
End If
Exit For
End If
Next

For u = 1 To MAX_PLAYERS
Damage = GetPlayerMAGI(Index) / 4 + Spell(SpellNum).Data1 - Int(GetPlayerstr(u) / 2) * (Rnd * 5) - 2

If IsPlaying(u) = True And GetPlayerMap(Index) =
GetPlayerMap(u) And GetPlayerX(u) = x And GetPlayerY(u) = y Then

If GetPlayerHP(u) > 0 And GetPlayerMap(Index) =
GetPlayerMap(u) And GetPlayerLevel(Index) >= 10 And GetPlayerLevel(u)
>= 10 And (Map(GetPlayerMap(Index)).Moral = MAP_MORAL_NONE Or
Map(GetPlayerMap(Index)).Moral = MAP_MORAL_NO_PENALTY) And
GetPlayerAccess(Index) <= 0 And GetPlayerAccess(u) <= 0 Then
If Damage > 0 Then
Call AttackPlayer(Index, u, Damage)
Else

Call BattleMsg(Index, "A magia foi muita
fraca e não feriu! " & GetPlayerName(u) & "!", BrightRed, 0)
End If
Else

Call PlayerMsg(Index, "Você não pode atacar
jogadores abaixo do nivel 10, maiores de accesso 2 e Quando não está
numa zona da porrada.", 4)
End If
Exit For
End If
Next u

Call SendDataToMap(GetPlayerMap(Index), "spellanim" &
SEP_CHAR & SpellNum & SEP_CHAR & Spell(SpellNum).SpellAnim
& SEP_CHAR & Spell(SpellNum).SpellTime & SEP_CHAR &
Spell(SpellNum).SpellDone & SEP_CHAR & Index & SEP_CHAR
& Player(Index).TargetType & SEP_CHAR & Player(Index).Target
& SEP_CHAR & Player(Index).CastedSpell & END_CHAR)
Next i

If Spell(SpellNum).sound > 0 Then Call
SendDataToMap(GetPlayerMap(Index), "sound" & SEP_CHAR & "Magic"
& Spell(SpellNum).sound & END_CHAR)
Call SetPlayerMP(Index, GetPlayerMP(Index) - Spell(SpellNum).MPCost)
Call SendMP(Index)
Exit Sub
End If


Créditos:
?
?
Não sei e acho que ninguém sabe quem foi o real criador.

Ir para o topo  Mensagem [Página 1 de 1]

 » Engines » Elysium » Tutoriais » Spell Linear!

Permissões neste sub-fórum
Não podes responder a tópicos