Help !!! doubts quickly

and the next I wanted a system that spell appears in the class that I have not selected the option “not allowed to use?” and LV that I put on the bar levreq

when the class reaches lv such that I put in the bar levreq character appears in the chat you just learned a new spell

sorry for english!!!

Couple of things:

Firstly, don’t make the title of your topic “Helpp!!! pl00xxxx!!!” - that is not helpful. It doesn’t describe the issue at all. It’s just annoying for others.

Secondly don’t start your topic as a follow on from other random post “… and the next”? That doesn’t help either.

Try splitting your questions up into more than 1 sentence. At the moment I have no idea what you’re asking.

Goose is right, it is difficult to understand you. The better you express yourself, the better able others are to help.

This time it worked out, because I am somewhat fluent in gibberish. ; ]

It sounds like you want players to be given spells when they level up and meet the requirements you’ve put in the spell editor. To do this, you’ll have to check requirements for every spell when a player levels up and give them whatever spell they can use but do not have. Please note that where this is an automatic process, any overpowered spells that would normally not be released into the game will go straight into player’s spellbooks, unless their access requirement is above the player.

Add this sub in modPlayer:


Sub SpellsOnLevel(ByVal Index As Long)

Dim n As Long

    For n = 1 To MAX_SPELLS

        ' access requirement

        If Not GetPlayerAccess(Index) >= Spell(n).AccessReq Then

            Exit Sub

        End If

        ' Get the spell num

        If Spell(n) > 0 Then

        ' Make sure they are the right class

            If Spell(n).ClassReq = GetPlayerClass(Index) Or Spell(n).ClassReq = 0 Then

            ' Make sure they are the right level

                i = Spell(n).LevelReq

                If i <= GetPlayerLevel(Index) Then

                    i = FindOpenSpellSlot(Index)

                    ' Make sure they have an open spell slot

                    If i > 0 Then

                    ' Make sure they dont already have the spell

                        If Not HasSpell(Index, n) Then

                            Call SetPlayerSpell(Index, i, n)

                            Call PlayerMsg(Index, "You feel the rush of knowledge fill your mind. You can now use " & Trim$(Spell(n).Name) & ".", BrightGreen)

                            ' update 'em

                            Call SendPlayerSpells(Index)

                        End If

                    End If

                End If

            End If

        End If

    Next

End Sub

If you Sub SetPlayerLevel is unedited, just replace it with this:


Public Sub CheckPlayerLevelUp(ByVal Index As Long)

Dim i As Long

Dim expRollover As Long

Dim LevelCount As Long

    LevelCount = 0

    Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index)

	    expRollover = GetPlayerExp(Index) - GetPlayerNextLevel(Index)

	    ' can level up?

	    If Not SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Then

		    Exit Sub

	    End If

	    Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 3)

	    Call SetPlayerExp(Index, expRollover)

	    LevelCount = LevelCount + 1

    Loop

    If LevelCount > 0 Then

	    If LevelCount = 1 Then

		    ' singular

		    GlobalMsg GetPlayerName(Index) & " has gained " & LevelCount & " level!", Brown

	    Else

		    ' plural

		    GlobalMsg GetPlayerName(Index) & " has gained " & LevelCount & " levels!", Brown

	    End If

	    For i = 1 To Vitals.Vital_Count - 1

		    SendVital Index, i

	    Next

'here's where you check if they get any new spells.

	    Call SpellsonLevel(Index)

	    SendEXP Index

	    SendPlayerData Index

    End If

End Sub

Otherwise, if you have edited your level up sub, add in Call SpellsOnLevel(Index) somewhere before SendPlayerData Index.

Log in to reply