bluenightzx Posted November 7, 2011 Author Share Posted November 7, 2011 i'm trying to do a algorith for each class on cast spell,it's a little akward to a melee class,have Int to increase their skills If Spell(spellnum).Type = SPELL_TYPE_DAMAGEHP Then Select Case GetPlayerClass(Index) Case 1 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.willpower / 2) Case 2 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.willpower / 2) Case 3 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.willpower / 2) Case 4 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.strength / 2) Case 5 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) Case 6 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.strength / 2) Case 7 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.strength / 2) Case 8 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) Case 9 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.willpower / 2) Case 10 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.strength) + GetPlayerStat(Index, Stats.strength / 2) Case 11 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.strength / 2) Case 12 Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) End Select End Ifbut then give mes RTE9-Subscript out of range,and then highlight thisPublic Function GetPlayerStat(ByVal Index As Long, ByVal Stat As Stats) As Long Dim x As Long, i As Long If Index > MAX_PLAYERS Then Exit Function x = Player(Index).Stat(Stat) For i = 1 To Equipment.Equipment_Count - 1 If Player(Index).Equipment(i) > 0 Then If Item(Player(Index).Equipment(i)).Add_Stat(Stat) > 0 Then Select Case Item(Player(Index).Equipment(i)).Rarity 'Add Cases as levels of rarity you want. Case 0 'Item Normal x = x + Item(Player(Index).Equipment(i)).Add_Stat(Stat) Case 1 'Item Excellent. I will add 5 extra points to all x = x + Item(Player(Index).Equipment(i)).Add_Stat(Stat) + 5 Case 2 'Item Master. I will add 15 extra points to all x = x + Item(Player(Index).Equipment(i)).Add_Stat(Stat) + 15 End Select End If End If Next GetPlayerStat = xEnd FunctionAt first i tried a simple "If getclass = x then"but wont work eitherwhat i'm doing wrong?thanks for the help Link to comment Share on other sites More sharing options...
bluenightzx Posted November 7, 2011 Author Share Posted November 7, 2011 never mind,just fixedif anyone wnats to use,heres the code If Spell(spellnum).Type = SPELL_TYPE_DAMAGEHP Then If GetPlayerClass(Index) = 5 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 6 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Strength) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 1 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 2 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.willpower) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 10 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Strength) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 11 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 4 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Strength) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 7 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Strength) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 9 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Agility) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 8 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) Else If GetPlayerClass(Index) = 12 Then Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) Else Vital = Vital * (Player(Index).Level / 2) + GetPlayerStat(Index, Stats.Intelligence) + GetPlayerStat(Index, Stats.willpower / 2) End If End If End If End If End If End If End If End If End If End If End If End If Link to comment Share on other sites More sharing options...
Wyvren Posted November 8, 2011 Share Posted November 8, 2011 where would I put this? :) Link to comment Share on other sites More sharing options...
Baron Posted November 8, 2011 Share Posted November 8, 2011 this would have to be edited into the source code using vb6.presumably something like this would go into the section that handles spell casting under EO (which im not hugely familiar with) Link to comment Share on other sites More sharing options...
Wyvren Posted November 8, 2011 Share Posted November 8, 2011 @Baron:> this would have to be edited into the source code using vb6.> > presumably something like this would go into the section that handles spell casting under EO (which im not hugely familiar with)I know it would have to be edited using VB6, I'm assuming its the CastSpell sub in modCombat, I'm going to fool around with this. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now