[EO] Transformation spell

Tested, working 100%

CLIENT SIDE

Open Spell Editor and add:

label:
name - lblSprite
caption - Transformation sprite:

scroll bar:
name - scrlSprite

Add to your scrollbar:

    lblSprite.Caption = "Transformation sprite: " & scrlSprite.Value
    Spell(EditorIndex).Sprite = scrlSprite.Value

Go to modGameEditors, find sub:
SpellEditorInit

In this sub find:

        .scrlStun.Value = Spell(EditorIndex).StunDuration

Add:

        .scrlSprite.Value = Spell(EditorIndex).Sprite

Go to modTypes, find:

Private Type SpellRec

Add to this type:

    Sprite As Long

SERVER SIDE

Go to modTypes, find:

Private Type SpellRec

Add to this type:

    Sprite As Long

In modPlayer in Sub CastSpell find:

        Case 0 ' self-cast target
            Select Case Spell(spellnum).Type
                Case SPELL_TYPE_HEALHP
                    SpellPlayer_Effect Vitals.HP, True, Index, Vital, spellnum
                    DidCast = True
                Case SPELL_TYPE_HEALMP
                    SpellPlayer_Effect Vitals.MP, True, Index, Vital, spellnum
                    DidCast = True
                Case SPELL_TYPE_WARP
                    SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                    PlayerWarp Index, Spell(spellnum).Map, Spell(spellnum).x, Spell(spellnum).y
                    SendAnimation GetPlayerMap(Index), Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                    DidCast = True
            End Select

Change for this:

        Case 0 ' self-cast target
            Select Case Spell(spellnum).Type
                Case SPELL_TYPE_HEALHP
                    SpellPlayer_Effect Vitals.HP, True, Index, Vital, spellnum
                    If Spell(spellnum).Sprite > 0 Then
                        SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                        SetPlayerSprite Index, Spell(spellnum).Sprite
                        Call SendPlayerData(Index)
                    End If
                    DidCast = True
                Case SPELL_TYPE_HEALMP
                    SpellPlayer_Effect Vitals.MP, True, Index, Vital, spellnum
                    If Spell(spellnum).Sprite > 0 Then
                        SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                        SetPlayerSprite Index, Spell(spellnum).Sprite
                        Call SendPlayerData(Index)
                    End If
                    DidCast = True
                Case SPELL_TYPE_WARP
                    SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                    PlayerWarp Index, Spell(spellnum).Map, Spell(spellnum).x, Spell(spellnum).y
                    SendAnimation GetPlayerMap(Index), Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                    DidCast = True
            End Select

It is all! Now when you use addhp and addmp spell and if you set sprite in spell editor > than 0 your sprite change to this what is in spell editor 😉

:icon_surprised:

I’ve been wanting this for so long now! Hopefully I can get it to work. Doesn’t look to hard so I will try and if I get any bugs I’ll let ya know.

When im Compiling server,i get
Compile Error:
Case witchout Select Case.
i did all what u said 😕
Pls help 😐

Although I appreciate this tutorial, could anybody tell me what fuction it has, other than the use with buffs or showoff appearances? Sorry, I’m just unsure as to add this code to my EO source, if there’s no purpose.  :azn:

You could edit it to work as a completely different spell, and have classes transform and get buffs from it, really it could be used for lots of things, as can any code. You could turn it into a system where you transform into an animal and move faster, etc.

~Urame

I’m not able to make this transformation spell (don’t know why) … Can someone pass me a ready engine with this system? Thanks!

this code works great but i see one problem. well not really a problem, once u use the spell you do not return back to your original sprite

@Reflow:

this code works great but i see one problem. well not really a problem, once u use the spell you do not return back to your original sprite

create a way to save the player’s sprite number and a counter.

I suggest you to add something like buff to stats if you transform to bear you will be stronger in attacks and more defense but slower. 😉

I cant find the Sub CastSpell anywhere , its in the server side right?

@ChrisWR:

I cant find the Sub CastSpell anywhere , its in the server side right?

Server side -> modCombat
Its under Sub BufferSpell

Thnx erwin , found the code compiled the server file but im having trouble with the client side.

If frmEditor_Conv.Visible = False Then Exit Sub

Compile Error Variable not Defined
Did i mess up on the label and scrollbar?

Nevermind , this is for the conversation system i believe , ill post the question there if i cant figure it out. XD

that has nothing to do with this tutorial… are u using EO or CS:DE? just saw ur edit =p

There’s no place to return to normal sprite, such as transformation.
ex
Sprite = 3
after the term is again the sprite class

I finished client side, and as I was compiling “.scrlSprite” got highlighted and I got an error. “Compile error: method or data member not found”. I looked around and can’t seem to realize why it wouldn’t recognize the variable. Thoughts?

Did you add the scrlSprite scrollbar to the spell editor?

Yup. Yes, I did.

@Qazek:

In modPlayer in Sub CastSpell find:

^Unrelated to my previous problem, it’s modCombat and not modPlayer. Anyway, I got it. Nice edit, thanks. :3

Client Side

Go to PlayerRec and find

Sprite As Long

add below it

Spriteold As Long

Server Side

Go to PlayerRec and find

Sprite As Long

add below it

Spriteold As Long

Go to Sub JoinGame Place

SetPlayerSpriteOld index, Player(index).Sprite

after

Call SendHotbar(index)

Search for

Sub SetPlayerSprite(ByVal index As Long, ByVal Sprite As Long)

after that sub paste

Sub SetPlayerSpriteOld(ByVal index As Long, ByVal Sprite As Long)
    Player(index).Spriteold = Sprite
End Sub

replace all the

If Spell(spellnum).Sprite > 0 Then
                        SendAnimation MapNum, Spell(spellnum).SpellAnim, 0, 0, TARGET_TYPE_PLAYER, Index
                        SetPlayerSprite Index, Spell(spellnum).Sprite
                        Call SendPlayerData(Index)
                    End If

with

If Spell(spellNum).Sprite > 0 Then
                        If Player(index).Sprite = Player(index).Spriteold Then
                            SetPlayerSpriteOld index, Player(index).Sprite
                            SetPlayerSprite index, Spell(spellNum).Sprite
                            Call SendPlayerData(index)
                        Else
                            SetPlayerSprite index, Player(index).Spriteold
                            Call SendPlayerData(index)
                        End If
                    End If

Now when you cast the spell the second time it’ll return you to your previous sprite.

Works for me let me know if it works for you guys… might not being as I have Transform set as a different spell type.

Place
SetPlayerSprite index, Player(index).Spriteold
        Before
’ Check if player was the only player on the map and stop npc processing if so

So it sets your sprite back to what it was when you logged in, when you log out.

Only problem I can think of is multiple transformations will mess with it. xD

Edit: never mind its easy enough to fix have it so you change back to normal sprite before changing to next one and so it records your normal sprite before you transform - and as far as i know it now works. 🙂

Log in to reply