willunited Posted August 27, 2012 Author Share Posted August 27, 2012 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 FunctionWhen i atack a player with a skill,server crash. Link to comment Share on other sites More sharing options...
Joyce Posted August 27, 2012 Share Posted August 27, 2012 With what error exactly? Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Author Share Posted August 27, 2012 Subscript out of range Link to comment Share on other sites More sharing options...
tslusny Posted August 27, 2012 Share Posted August 27, 2012 To what line in IDE is it pointing? Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Author Share Posted August 27, 2012 This one:x = Player(Index).Stat(Stat) Link to comment Share on other sites More sharing options...
tslusny Posted August 27, 2012 Share Posted August 27, 2012 so i think you named some stat incorrectlytry replacestrengthwithstrenght Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Author Share Posted August 27, 2012 Doenst work Link to comment Share on other sites More sharing options...
blkcrow Posted August 27, 2012 Share Posted August 27, 2012 Edit: Nevermind ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Author Share Posted August 27, 2012 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 FunctionNow 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 More sharing options...
MCADAMS Posted August 27, 2012 Share Posted August 27, 2012 May or may not be interfering with something you've already added (just because I see checkpoints.ini in the debug line.) Link to comment Share on other sites More sharing options...
willunited Posted August 27, 2012 Author Share Posted August 27, 2012 I found the error!My name contains [ADM].It bug the checkpoints.ini.But the system of real spell def doesnt work =\ Link to comment Share on other sites More sharing options...
MCADAMS Posted August 27, 2012 Share Posted August 27, 2012 Couldn't you just make a stat (say, magic defense) and add that to the equation for spell damage? Have magic defense = players endurance x .25 or something 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