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

Real Spell Def


willunited
 Share

Recommended Posts

Im trying to make it but see this Sub:

> Public Function GetSpellBaseStat(ByVal Index As Long, ByVal SpellNum As Long, Optional ByVal Target As Long) As Long
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = TARGET_TYPE_PLAYER Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12 - GetPlayerStat(Target, Stats.Endurance) * 0.5
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 8 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 15 - GetPlayerStat(Target, Stats.Endurance) * 0.5
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12 - GetPlayerStat(Target, Stats.Endurance) * 0.5
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12 - GetPlayerStat(Target, Stats.Endurance) * 0.5
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12 - GetPlayerStat(Target, Stats.Endurance) * 0.5
>
> End Select
>
> End If
>
> End If
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = TARGET_TYPE_NPC Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 8 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 15
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> End Select
>
> End If
>
> End If
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = 0 Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 8 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 15
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> End Select
>
> End If
>
> End If
>
> End Function

When i atack a player with a skill,server crash.
Link to comment
Share on other sites

I removed real spell def,and put spell based spell depending of target type:

> Public Function GetSpellBaseStat(ByVal Index As Long, ByVal SpellNum As Long) As Long
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = TARGET_TYPE_PLAYER Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 3 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 20
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 4 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 4 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> End Select
>
> End If
>
> End If
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = TARGET_TYPE_NPC Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 12 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 20
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 7 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 7 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 9 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> End Select
>
> End If
>
> End If
>
> If SpellNum > 0 Then
>
> If TempPlayer(Index).targetType = 0 Then
>
> Select Case Spell(SpellNum).BaseStat
>
> Case 1
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.strength) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 2
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.intelligence) * 7 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 20
>
> Case 3
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Agility) * 6 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 4
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Endurance) * 7 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> Case 5
>
> GetSpellBaseStat = GetPlayerStat(Index, Stats.Willpower) * 5 + Spell(SpellNum).Vital + GetPlayerLevel(Index) * 12
>
> End Select
>
> End If
>
> End If
>
> End Function

Now the error is:

Type Mismatch.

Ide shows this line:

> Public Function ValCheckPoint(ByVal Index As Long) As Boolean
>
> If GetVar(App.Path & "\Data\accounts\checkpoints.ini", "*SERVEROPTIONS*", "" & GetPlayerName(Index)) = 1 Then
>
> ValCheckPoint = True
>
> Else
>
> ValCheckPoint = False
>
> End If
>
> End Function
Link to comment
Share on other sites

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...