Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TheDarkTournament


Link
 Share

Recommended Posts

  • 2 weeks later...
Why are you on Contestant List DeathTheKid? ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) you may cheat LOL

Edit: 3k Real cash? ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)
Link to comment
Share on other sites

Here is my tutorial , A basic linear system created by me

works 90% , i still haven't test it on Players

client rec

create a checkbox on spell editor and name it chkLinear

find this on ItemEditorInit

```

If .IsAoE Then

frmEditor_Spell.chkAOE.Value = 1

frmEditor_Spell.scrlAOE.Value = .AoE

Else

frmEditor_Spell.chkAOE.Value = 0

End If

```

replace it with

```

If .IsAoE Then

frmEditor_Spell.chkAOE.Value = 1

frmEditor_Spell.chkLinear.Value = 0

frmEditor_Spell.scrlAOE.Value = .AoE

ElseIf .Linear Then

frmEditor_Spell.chkAOE.Value = 0

frmEditor_Spell.chkLinear.Value = 1

Else

frmEditor_Spell.chkLinear.Value = 0

frmEditor_Spell.chkAOE.Value = 0

End If

```

replace chkAoE value with this

```

If chkAOE.Value = 0 Then

Spell(EditorIndex).IsAoE = False

Else

chkLinear.Value = 0

Spell(EditorIndex).Linear = False

Spell(EditorIndex).IsAoE = True

End If

```

double click chkLinear and add this

```

If chkLinear.Value = 0 Then

Spell(EditorIndex).Linear = False

Else

chkAOE.Value = 0

Spell(EditorIndex).Linear = True

Spell(EditorIndex).IsAoE = False

fraAoe.Visible = False

End If

```

on both server and client add this on itemrec

```

Linear As Boolean

```

server side

find this

```

' find out what kind of spell it is! self cast, target or AOE

If Spell(spellnum).Range > 0 Then

' ranged attack, single target or aoe?

If Not Spell(spellnum).IsAoE Then

SpellCastType = 2 ' targetted

Else

SpellCastType = 3 ' targetted aoe

End If

Else

If Not Spell(spellnum).IsAoE Then

SpellCastType = 0 ' self-cast

Else

SpellCastType = 1 ' self-cast AoE

End If

End If

```

replace it with

```

' find out what kind of spell it is! self cast, target or AOE

If Spell(spellnum).Range > 0 Then

If Spell(spellnum).Linear Then

SpellCastType = 4

Else

' ranged attack, single target or aoe?

If Not Spell(spellnum).IsAoE Then

SpellCastType = 2 ' targetted

Else

SpellCastType = 3 ' targetted aoe

End If

End If

Else

If Not Spell(spellnum).IsAoE Then

SpellCastType = 0 ' self-cast

Else

SpellCastType = 1 ' self-cast AoE

End If

End If

```

after this

```

Case 2, 3 ' targeted & targeted AOE

' check if have target

If Not target > 0 Then

PlayerMsg Index, "You do not have a target.", White

End If

If targetType = TARGET_TYPE_PLAYER Then

' if have target, check in range

If Not isInRange(Range, GetPlayerX(Index), GetPlayerY(Index), GetPlayerX(target), GetPlayerY(target)) Then

PlayerMsg Index, "Target not in range.", White

Else

' go through spell types

If Spell(spellnum).Type <> SPELL_TYPE_DAMAGEHP And Spell(spellnum).Type <> SPELL_TYPE_DAMAGEMP Then

HasBuffered = True

Else

If CanPlayerAttackPlayer(Index, target, True) Then

HasBuffered = True

End If

End If

End If

ElseIf targetType = TARGET_TYPE_NPC Then

' if have target, check in range

If Not isInRange(Range, GetPlayerX(Index), GetPlayerY(Index), MapNpc(mapNum).Npc(target).x, MapNpc(mapNum).Npc(target).y) Then

PlayerMsg Index, "Target not in range.", White

HasBuffered = False

Else

' go through spell types

If Spell(spellnum).Type <> SPELL_TYPE_DAMAGEHP And Spell(spellnum).Type <> SPELL_TYPE_DAMAGEMP Then

HasBuffered = True

Else

If CanPlayerAttackNpc(Index, target, True) Then

HasBuffered = True

End If

End If

End If

End If

```

add this

```

Case 4 ' linear

HasBuffered = True

```

at public castspell add this Dim

```

Dim LinearRange As Long

Dim LinearX As Long

Dim LinearY As Long

```

find this at public cast spell

```

' find out what kind of spell it is! self cast, target or AOE

If Spell(spellnum).Range > 0 Then

' ranged attack, single target or aoe?

If Not Spell(spellnum).IsAoE Then

SpellCastType = 2 ' targetted

Else

SpellCastType = 3 ' targetted aoe

End If

Else

If Not Spell(spellnum).IsAoE Then

SpellCastType = 0 ' self-cast

Else

SpellCastType = 1 ' self-cast AoE

End If

End If

```

replace it with

```

' find out what kind of spell it is! self cast, target or AOE

If Spell(spellnum).Range > 0 Then

If Spell(spellnum).Linear Then

SpellCastType = 4 ' linear

Else

' ranged attack, single target or aoe?

If Not Spell(spellnum).IsAoE Then

SpellCastType = 2 ' targetted

Else

SpellCastType = 3 ' targetted aoe

End If

End If

Else

If Not Spell(spellnum).IsAoE Then

SpellCastType = 0 ' self-cast

Else

SpellCastType = 1 ' self-cast AoE

End If

End If

```

find

```

Case 2 ' targetted

If targetType = 0 Then Exit Sub

If target = 0 Then Exit Sub

If targetType = TARGET_TYPE_PLAYER Then

x = GetPlayerX(target)

y = GetPlayerY(target)

Else

x = MapNpc(mapNum).Npc(target).x

y = MapNpc(mapNum).Npc(target).y

End If

If Not isInRange(Range, GetPlayerX(Index), GetPlayerY(Index), x, y) Then

PlayerMsg Index, "Target not in range.", White

SendClearSpellBuffer Index

Exit Sub

End If

Select Case Spell(spellnum).Type

Case SPELL_TYPE_DAMAGEHP

If targetType = TARGET_TYPE_PLAYER Then

If CanPlayerAttackPlayer(Index, target, True) Then

If Vital > 0 Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, target

PlayerAttackPlayer Index, target, Vital, spellnum

DidCast = True

End If

End If

Else

If CanPlayerAttackNpc(Index, target, True) Then

If Vital > 0 Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_NPC, target

PlayerAttackNpc Index, target, Vital, spellnum

DidCast = True

End If

End If

End If

Case SPELL_TYPE_DAMAGEMP, SPELL_TYPE_HEALMP, SPELL_TYPE_HEALHP

If Spell(spellnum).Type = SPELL_TYPE_DAMAGEMP Then

VitalType = Vitals.mp

increment = False

DidCast = True ' <--- Fixed!

ElseIf Spell(spellnum).Type = SPELL_TYPE_HEALMP Then

VitalType = Vitals.mp

increment = True

DidCast = True ' <--- Fixed!

ElseIf Spell(spellnum).Type = SPELL_TYPE_HEALHP Then

VitalType = Vitals.HP

increment = True

DidCast = True ' <--- Fixed!

End If

If targetType = TARGET_TYPE_PLAYER Then

If Spell(spellnum).Type = SPELL_TYPE_DAMAGEMP Then

If CanPlayerAttackPlayer(Index, target, True) Then

SpellPlayer_Effect VitalType, increment, target, Vital, spellnum

End If

Else

SpellPlayer_Effect VitalType, increment, target, Vital, spellnum

End If

Else

If Spell(spellnum).Type = SPELL_TYPE_DAMAGEMP Then

If CanPlayerAttackNpc(Index, target, True) Then

SpellNpc_Effect VitalType, increment, target, Vital, spellnum, mapNum

End If

Else

SpellNpc_Effect VitalType, increment, target, Vital, spellnum, mapNum

End If

End If

End Select

```

add this below it

```

Case 4 ' linear

For LinearRange = 1 To Spell(spellnum).Range

If GetPlayerDir(Index) = DIR_DOWN Then

x = GetPlayerX(Index)

y = GetPlayerY(Index) + LinearRange

ElseIf GetPlayerDir(Index) = DIR_UP Then

x = GetPlayerX(Index)

y = GetPlayerY(Index) - LinearRange

ElseIf GetPlayerDir(Index) = DIR_LEFT Then

x = GetPlayerX(Index) - LinearRange

y = GetPlayerY(Index)

ElseIf GetPlayerDir(Index) = DIR_RIGHT Then

x = GetPlayerX(Index) + LinearRange

y = GetPlayerY(Index)

End If

Select Case Spell(spellnum).Type

Case SPELL_TYPE_DAMAGEHP

DidCast = True

For LinearX = 1 To Spell(spellnum).Range

For LinearY = 1 To Spell(spellnum).Range

If GetPlayerDir(Index) = DIR_UP Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - LinearY

ElseIf GetPlayerDir(Index) = DIR_DOWN Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + LinearY

ElseIf GetPlayerDir(Index) = DIR_LEFT Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) - LinearX, GetPlayerY(Index)

ElseIf GetPlayerDir(Index) = DIR_RIGHT Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) + LinearX, GetPlayerY(Index)

End If

Next

Next

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

If i <> Index Then

If GetPlayerMap(i) = GetPlayerMap(Index) Then

If GetPlayerX(i) = x And GetPlayerY(i) = y Then

If CanPlayerAttackPlayer(Index, i, True) Then

PlayerAttackPlayer Index, i, Vital, spellnum

End If

End If

End If

End If

End If

Next

For i = 1 To MAX_MAP_NPCS

If MapNpc(mapNum).Npc(i).Num > 0 Then

If MapNpc(mapNum).Npc(i).Vital(HP) > 0 Then

If MapNpc(mapNum).Npc(i).x = x And MapNpc(mapNum).Npc(i).y = y Then

If CanPlayerAttackNpc(Index, i, True) Then

PlayerAttackNpc Index, i, Vital, spellnum

End If

End If

End If

End If

Next

Case SPELL_TYPE_HEALHP, SPELL_TYPE_HEALMP, SPELL_TYPE_DAMAGEMP

If Spell(spellnum).Type = SPELL_TYPE_HEALHP Then

VitalType = Vitals.HP

increment = True

ElseIf Spell(spellnum).Type = SPELL_TYPE_HEALMP Then

VitalType = Vitals.mp

increment = True

ElseIf Spell(spellnum).Type = SPELL_TYPE_DAMAGEMP Then

VitalType = Vitals.mp

increment = False

End If

For LinearX = 1 To Spell(spellnum).Range

For LinearY = 1 To Spell(spellnum).Range

If GetPlayerDir(Index) = DIR_UP Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) - LinearY

ElseIf GetPlayerDir(Index) = DIR_DOWN Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index), GetPlayerY(Index) + LinearY

ElseIf GetPlayerDir(Index) = DIR_LEFT Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) - LinearX, GetPlayerY(Index)

ElseIf GetPlayerDir(Index) = DIR_RIGHT Then

SendAnimation mapNum, Spell(spellnum).SpellAnim, GetPlayerX(Index) + LinearX, GetPlayerY(Index)

End If

Next

Next

DidCast = True

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

If i <> Index Then

If GetPlayerMap(i) = GetPlayerMap(Index) Then

If GetPlayerX(i) = x And GetPlayerY(i) = y Then

SpellPlayer_Effect VitalType, increment, i, Vital, spellnum

End If

End If

End If

End If

Next

For i = 1 To MAX_MAP_NPCS

If MapNpc(mapNum).Npc(i).Num > 0 Then

If MapNpc(mapNum).Npc(i).Vital(HP) > 0 Then

If MapNpc(mapNum).Npc(i).x = x And MapNpc(mapNum).Npc(i).y = y Then

SpellNpc_Effect VitalType, increment, i, Vital, spellnum, mapNum

End If

End If

End If

Next

End Select

Next

```

![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) it's a basic code

idk if i miss something
Link to comment
Share on other sites

> Read… Don't use "tl:dr"

The point of explaining it is so people who don't understand what the concept of this is can get the gist of it. I'm sure DeathTheKid knows what it is, but what about the people reviewing your work?
Link to comment
Share on other sites

> The point of explaining it is so people who don't understand what the concept of this is can get the gist of it. I'm sure DeathTheKid knows what it is, but what about the people reviewing your work?

A Linear Spell that doesn't need to create any new subs or function to work.. And it has a Animation on each tile on the range of linear spell..

You can create linear spell by checking the chkLinear and adding Range.

That's what you two wants?
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...