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

kira423

Members
  • Posts

    279
  • Joined

  • Last visited

    Never

Posts posted by kira423

  1. Ok so this is like my 2nd tutorial and probably one of the simplest you will see me post. Basically I have modified the way EXP is calculated once a player is so many levels higher than the NPC that that player kills.

    THERE ARE 2 WAYS OF DOING THIS

    * NOTE THIS AFFECTS PARTY EXP SHARING TOO

    Server Side only

    **Way #1** (Only scales the Exp when the attacking player is so many levels higher than the NPC)

    In **ModCombat** in **Sub PlayerAttackNpc** find
    ```
    ' Make sure we dont get less then 0
            If exp < 0 Then
                exp = 1
            End If
    ```
    Under Add

    ```
    'Make sure higher level players aren't camping on lower level creatures for EXP
        If NPC(npcNum).Level - 5 < GetPlayerLevel(attacker) Then
            exp = Round(NPC(npcNum).exp / GetPlayerLevel(attacker))
        End If
    ```
    –------------------------------------------------------------

    **Way #2** (Always scales your Exp)

    In the same file and sub as above find

    ```
    ' Calculate exp to give attacker
            exp = Npc(npcNum).exp
    ```
    change to

    ```
    exp = Round(NPC(npcNum).exp / GetPlayerLevel(attacker))
    ```

    Here is a little breakdown for those of you who have no idea what this code is saying, so you can modify it to your needs.

    In the code (WAY #1) **- 5** signifies how many levels different the player has to be from the NPC in order for the EXP scaling to take effect. You can make this number whatever number you wish.

    The exp is equal to the amount of exp that you put in for your NPC to have DIVIDED (/) by the attacking players level, meaning if you are level 100 and the NPC gives you 100 EXP you will only gain 1 EXP when you kill that creature.

    If you are in a party the exp is divided as stated above, and then split between all of the party members.

    I am not sure as to why I explained all of that as it doesn't take rocket science to know >.<
  2. I fixed the issue I was having, thanks Scott and Deathbeam for clarifying what I did wrong

    to get it working properly

    Server side find this in ModServerTCP

    ```
    If Player(index).GuildFileId > 0 Then
            If TempPlayer(index).TmpGuildSlot > 0 Then
                Buffer.WriteByte 1
                Buffer.WriteString GuildData(TempPlayer(index).TmpGuildSlot).Guild_Name
            End If
        Else
            Buffer.WriteByte 0
        End If
    ```
    under add

    ```
    If Player(index).GuildFileId > 0 Then
            If TempPlayer(index).TmpGuildSlot > 0 Then
                Buffer.WriteByte 1
                Buffer.WriteLong Player(index).GuildMemberId
            End If
        Else
            Buffer.WriteByte 0
        End If
    ```
    Save and compile

    then Client side find this in ModTypes

    ```
    GuildName As String
    ```
    under add

    ```
    GuildMemberId As Long
    ```
    in ModHandleData find

    ```
    If Buffer.ReadByte = 1 Then
            Player(i).GuildName = Buffer.ReadString
        Else
            Player(i).GuildName = vbNullString
        End If
    ```
    under add

    ```
    If Buffer.ReadByte = 1 Then
            Player(i).GuildMemberId = Buffer.ReadLong
        Else
            Player(i).GuildMemberId = 0
        End If
    ```
    Finally in ModGeneral find

    ```
    If GuildData.Guild_Members(MyIndex).Rank > 5 Then
    frmMain.lblGuildDisband.visible = True
            Else
                frmMain.lblGuildDisband.visible = False
            End If
    ```
    and change to

    ```
            If Player(MyIndex).GuildMemberId > 0 Then
        If GuildData.Guild_Members(Player(MyIndex).GuildMemberId).Rank > 5 Then
                frmMain.lblGuildDisband.visible = True
            Else
                frmMain.lblGuildDisband.visible = False
            End If
            End If
    ```<– This implements what Scott said below
  3. @devilfrenzy:

    > Can not find it. Help me !!
    > Now in Sub LoadGui search for
    >
    > Code: [Select]
    > frmMain.picOptions.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\options.jpg")

    It's in ModGeneral, just use cntrl+f make sure you click Current Project and it searches all of the files in the project
  4. @devilfrenzy:

    > i get an error for variable not defined
    >
    > ReOrderChat Header & Name & ": " & message, colour

    Make sure you are putting that line in **ModHandleData** in the **HandleSayMsg Sub** and not the

    AddText Sub in ModText
  5. There isn't anywhere I see in Server that sends the guildname… and where at in serve is SendPlayerData because all I see is```
    Sub SendPlayerData(ByVal index As Long)
        Dim packet As String
        SendDataToMap GetPlayerMap(index), PlayerData(index)
    End Sub
    ```
    in ModServerTCP.. I am still a little new to this

    EDIT

    is this the code you are talking about editing server side

    ```
    If Player(index).GuildFileId > 0 Then
            If TempPlayer(index).TmpGuildSlot > 0 Then
                Buffer.WriteByte 1
                Buffer.WriteString GuildData(TempPlayer(index).TmpGuildSlot).Guild_Name
            End If
        Else
            Buffer.WriteByte 0
        End If
    ```
  6. @ ^ I already assessed this in my last post -.-

    I have found a problem though

    This line seems to not be doing its job!

    ```
    If GuildData.Guild_Members(MyIndex).Rank > 5 Then
    ```
    There is a guild member who is rank 1 and they can see the Disband Label.. although it does them no good to click it cause it obviously won't let them disband a guild they didn't create.

    I am not sure if it is cause I edited the lbls a little bit or what I have is the same as yours except I added

    .lblGuAdmin.Visible = True (which it shows up for the Rank 1 user as well *I DO have it set to false in frmMain as well as in the ELSE for this IF*)

    which adding that really shouldn't have bothered anything it was simply adding that line, I have tried fixing it, but it doesn't matter what I do it doesn't fix it… I tried taking the label I added out but the Disband label still shows even with the original code.
  7. Unfortunetly that's not the one I found the other day, this one is great too, but I want one that's outside of the main GUI, but if I cannot find the other one then this is the one I will use, thanks for the help though
  8. The other day I was browsing the forums and I saw a thread explaining how to make a help menu EXE file that opened when /help was typed in or a button was hit, and now I cannot find it anywhere!! I bookmarked it, but between then and now I got a new computer and no longer have the bookmark -.-

    If anyone knows which topic I am referring to could you please please please link it!

    Thank you so much!!
  9. This may be a dumb question, as I am probable just overlooking something, but how on earth do I get rid of the grey around the shop/trade/bank screens.. it may have something to do with picScreen but I am not 100% sure, any help with this is super appreciated!
  10. If I am understanding your question correctly you are wanting to change the color shown above the head when in combat.

    There is more than one code that does this. What you want to do is open up your server.vbp and go to modCombat

    Find

    ```
    ' Check for a weapon and say damage
    SendActionMsg MapNum, "-" & Damage, BrightRed, 1, (MapNpc(MapNum).NPC(MapNpcNum).x * 32), (MapNpc(MapNum).NPC(MapNpcNum).y * 32)
    ```
    In PlayerAttackNpc

    and just change BrightRed to the color you want it to show as. This changes the color for "- (damage)" when a player attacks and NPC

    to change the color shown when an NPC attacks a player find

    ```
    ' Say damage
    SendActionMsg GetPlayerMap(Victim), "-" & Damage, BrightRed, 1, (GetPlayerX(Victim) * 32), (GetPlayerY(Victim) * 32)
    ```
    In NpcAttackPlayer. Again change BrightRed to the color you want shown.

    Then In PlayerAttackPlayer

    Find

    ```
    SendActionMsg GetPlayerMap(Victim), "-" & Damage, BrightRed, 1, (GetPlayerX(Victim) * 32), (GetPlayerY(Victim) * 32)
    ```
    Again BrightRed is the color.

    There are 2 SendActionMsg in each of these subs, but I am pretty sure the ones I listed above are the only ones that need to be changed, but if that doesn't work try changing both in each sub.
  11. This is probably a pretty dumb question, but it may be possible.

    I am wanting to make it to where the required 'tool' doesn't have to be a weapon type item to work.
    I have added in extra equip slots, and I am wanting to use a different item type, in this case its called resource tool. I am still able to select it as the correct tool type but when I interact with the resource it says it's not the right type of tool.

    I hope that makes sense… does anyone know how I can make it to where it doesn't have to be a weapon to work?
  12. Okay so when I save a blank serial it will save, and it will give out the item when the player hits the claim button with a blank text box, but it WILL NOT save a serial that has a number as it crashes the server, I am a bit of a newb so looking at the code I have no idea what the issue is, but it seems to me that something that is being sent (the serial 'name') to the server isn't defined for it to save.
×
×
  • Create New...