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

Hurting your party members


fafioso
 Share

Recommended Posts

[background=rgb(247, 247, 247)]It seems there is a bug in Eclipse Advanced where Area of effect abilities cast by someone in a [/background][background=yellow]party[/background][background=rgb(247, 247, 247)], hurts your [/background][background=yellow]party[/background][background=rgb(247, 247, 247)] members. The aoe part of abilities does not seem to verify if the target is a player. I know very little about programming but I know that if others test this they will have the same issue. Does someone know how to fix this?[/background]
Link to comment
Share on other sites

I should really look at the source code before I try to help but…

Here's what I think. In the damage calculation(probably modCombat or something), there would be check and stuff for the spell whether or not can it hit the NPC(maybe it's a friendly NPC) and stuff. Simply add a check to see if the target is a party member or not.

Or you can also do this for the way Map Type work. You know, like if it's a Safe Zone or PvP. If it's Safe Zone, no player can be hurt. If it's PvP, player can be hurt, if they're not in the same party, or guild or w.e.

Sincerely,

Rithy
Link to comment
Share on other sites

There isnt another way to do it unless its very versatile.

Heres the steps to sort it:

Load vb6, open the client source code, click the modules folder, open modcombat, click the drop down bar and find the section that handles AoE spells, click it. Then in the code find just before it sends the actual spell add: CheckAttack player(Index).Party

I have done this completely off the top of my head as I am not on my computer at the moment.
Link to comment
Share on other sites

```

' ############

' ## Spells ##

' ############

Public Sub BufferSpell(ByVal index As Long, ByVal spellslot As Long)

Dim spellnum As Long

Dim MPCost As Long

Dim LevelReq As Long

Dim mapNum As Long

Dim SpellCastType As Long

Dim ClassReq As Long

Dim AccessReq As Long

Dim Range As Long

Dim HasBuffered As Boolean

Dim targetType As Byte

Dim target As Long

' Prevent subscript out of range

If spellslot <= 0 Or spellslot > MAX_PLAYER_SPELLS Then Exit Sub

spellnum = GetPlayerSpell(index, spellslot)

mapNum = GetPlayerMap(index)

If spellnum <= 0 Or spellnum > MAX_SPELLS Then Exit Sub

' Make sure player has the spell

If Not HasSpell(index, spellnum) Then Exit Sub

' see if cooldown has finished

If TempPlayer(index).SpellCD(spellslot) > GetTickCount Then

PlayerMsg index, "Spell hasn't cooled down yet!", BrightRed

Exit Sub

End If

MPCost = Spell(spellnum).MPCost

' Check if they have enough MP

If GetPlayerVital(index, Vitals.MP) < MPCost Then

Call PlayerMsg(index, "Not enough mana!", BrightRed)

Exit Sub

End If

LevelReq = Spell(spellnum).LevelReq

' Make sure they are the right level

If LevelReq > GetPlayerLevel(index) Then

Call PlayerMsg(index, "You must be level " & LevelReq & " to cast this spell.", BrightRed)

Exit Sub

End If

AccessReq = Spell(spellnum).AccessReq

' make sure they have the right access

If AccessReq > GetPlayerAccess(index) Then

Call PlayerMsg(index, "You must be an administrator to cast this spell.", BrightRed)

Exit Sub

End If

ClassReq = Spell(spellnum).ClassReq

' make sure the classreq > 0

If ClassReq > 0 Then ' 0 = no req

If ClassReq <> GetPlayerClass(index) Then

Call PlayerMsg(index, "Only " & CheckGrammar(Trim$(Class(ClassReq).Name)) & " can use this spell.", BrightRed)

Exit Sub

End If

End If

' 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

targetType = TempPlayer(index).targetType

target = TempPlayer(index).target

Range = Spell(spellnum).Range

HasBuffered = False

Select Case SpellCastType

Case 0, 1 ' self-cast & self-cast AOE

HasBuffered = True

Case 2, 3 ' targeted & targeted AOE

' check if have target

If Not target > 0 Then

PlayerMsg index, "You do not have a target.", BrightRed

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.", BrightRed

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.", BrightRed

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

End Select

If HasBuffered Then

SendAnimation mapNum, Spell(spellnum).CastAnim, 0, 0, TARGET_TYPE_PLAYER, index

SendActionMsg mapNum, "Casting " & Trim$(Spell(spellnum).Name) & "!", BrightRed, ACTIONMSG_SCROLL, GetPlayerX(index) * 32, GetPlayerY(index) * 32

TempPlayer(index).spellBuffer.Spell = spellslot

TempPlayer(index).spellBuffer.Timer = GetTickCount

TempPlayer(index).spellBuffer.target = TempPlayer(index).target

TempPlayer(index).spellBuffer.tType = TempPlayer(index).targetType

Exit Sub

Else

SendClearSpellBuffer index

End If

End Sub

```

I found this. Is it the good part of the code? I tried to put CheckAttack player(Index).Party but it makes me an error : Compile error: Data or member not found
Link to comment
Share on other sites

  • 1 month 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...