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

Defining A Value? [SOLVED]


viciousdead
 Share

Recommended Posts

~~Ok, so I have ScrlEXPRATE.Value = EXPRATE and in another piece of code I have an equation(this just being part of it): EXPTOTAL = (EXPRATE * 100)

How do I define EXPRATE or w/e, all of this is server-sided.. I'm a bit confused.  :confused:
I get confused on the easy stuff guys, so over look me and don't be a t-bag. :embarrassed:~~

Currently the equation is like this:
        killxp = (GetPlayerLevel(Victim) * EXPTOTAL)
        EXPTOTAL = (EXPRATE * 100)
        EXPRATE = frmServer.ScrlEXP.Value
the scrlEXP.value is 0 so 0*100= 0 right?
Well I changed the 0 on the server control panel to like 10, and killed another person 10*100 = 1000 but it still gave me 0, how do I make it update the exp rate when I raise/lower it?
Link to comment
Share on other sites

Ok, I'm horrible at explaining things.

On my Server Control Panel, I have a scroll bar that changes the exp rate of PvP kills, the equation is like this:
killxp = GetPlayerLevel(Victim)(Exp Rate * 100)

killxp is the amount of experiance total you will receive for that kill. I have everything working except, the fact that when I change the Exp Rate on my Server Control Panel, the experience earned in-game doesn't *update*, it stays at 0..

![](http://www.freemmorpgmaker.com/files/imagehost/pics/acf4dabf0f3381a2bc469f05ec24ad47.png)
Link to comment
Share on other sites

@Captain:

> I'm not really understanding your question..
>
> Rewrite the whole post again without all the crosses.
>
> Edit
>
> To Define exprate you would put
>
> Dim Exprate as long
>
> Long being the type of variable.

I know that, I need to know how to update/refresh the exp rate, so that it reflects in-game… :o
Link to comment
Share on other sites

@Yukiyo:

> On the event where you change the scroll bar, send a packet to the client with it's value and have the client handle that value, and modify a global expratechange variable with it, which can be used in modCombat.

modCombat? I'm using the EO Side-scrolling client by MrMiguu… Outdated maybe?
Link to comment
Share on other sites

@Yukiyo:

> It's different in that version, kind of. xP I suggest upgrading to EO v2b and reading this: [[EO] Packet Tutorial](http://www.touchofdeathforums.com/smf/index.php/topic,69393.0.html)

Ok, I read that, but I still don't get why we have to Send a packet to make this work… It's not Client-sided in any way, its all Server Sided...

Scroll bar code for frmserver:

>! ```
Private Sub ScrlEXP_Change()
Dim EXPRATE As Long
If ScrlEXP.Value > 0 Then
EXPRATE = ScrlEXP.Value
lblEXP.Caption = "Exp Rate: " & ScrlEXP.Value
Else
EXPRATE = 0
lblEXP.Caption = "Exp Rate: Zero"
End If
End Sub
>! ```
Here is my modplayer script:

>! ```
Sub AttackPlayer(ByVal Attacker As Long, ByVal Victim As Long, ByVal Damage As Long, Optional ByVal spellnum As Long = 0)
    Dim exp As Long
    Dim killxp As Long
    Dim EXPTOTAL As Long
    Dim EXPRATE As Long
    Dim n As Long
    Dim i As Long
    Dim Buffer As clsBuffer
>!     ' Check for subscript out of range
    If IsPlaying(Attacker) = False Or IsPlaying(Victim) = False Or Damage < 0 Then
        Exit Sub
    End If
>!     ' Check for weapon
    n = 0
>!     If GetPlayerEquipment(Attacker, Weapon) > 0 Then
        n = GetPlayerEquipment(Attacker, Weapon)
    End If
>!     ' Send this packet so they can see the person attacking
    Set Buffer = New clsBuffer
    Buffer.WriteLong SAttack
    Buffer.WriteLong Attacker
    SendDataToMapBut Attacker, GetPlayerMap(Attacker), Buffer.ToArray()
    Set Buffer = Nothing
>!     If Damage >= GetPlayerVital(Victim, Vitals.HP) Then

        'Call PlayerMsg(Attacker, "You hit " & GetPlayerName(Victim) & " for " & Damage & " hit points.", White)
        'Call PlayerMsg(Victim, GetPlayerName(Attacker) & " hit you for " & Damage & " hit points.", BrightRed)
        SendActionMsg GetPlayerMap(Victim), "-" & Damage, BrightRed, 1, (GetPlayerX(Victim) * 32), (GetPlayerY(Victim) * 32)

        ' Calculate exp to give attacker
        exp = (GetPlayerExp(Victim) \ 10)
        ' Calculate exp of a kill
        killxp = (GetPlayerLevel(Victim) * EXPTOTAL)
        EXPTOTAL = (EXPRATE * 100)
        EXPRATE = frmServer.ScrlEXP.Value
>!         ' Make sure we dont get less then 0
        If exp < 0 Then
            exp = 0
        End If
>!         If exp = 0 Then
            Call PlayerMsg(Victim, "You lost no exp.", BrightRed)
            Call PlayerMsg(Attacker, "You received " & killxp & " exp for killing " & GetPlayerName(Victim) & ".", BrightBlue)
            Call SetPlayerExp(Attacker, GetPlayerExp(Attacker) + killxp)
            SendEXP Attacker
        Else
            Call SetPlayerExp(Victim, GetPlayerExp(Victim) - exp)
            SendEXP Victim
            Call PlayerMsg(Victim, GetPlayerName(Attacker) & " absorbed " & exp & " exp from you.", BrightRed)
            Call SetPlayerExp(Attacker, GetPlayerExp(Attacker) + killxp)
            Call SetPlayerExp(Attacker, GetPlayerExp(Attacker) + exp)
            SendEXP Attacker
            Call PlayerMsg(Attacker, "You received " & killxp & " exp for killing " & GetPlayerName(Victim) & ".", BrightBlue)
            Call PlayerMsg(Attacker, "You absorbed " & exp & " bonus exp from " & GetPlayerName(Victim) & ".", BrightGreen)
        End If
>!         ' Check for a level up
        Call CheckPlayerLevelUp(Attacker)
>!         ' Check if target is player who died and if so set target to 0
        If TempPlayer(Attacker).TargetType = TARGET_TYPE_PLAYER Then
            If TempPlayer(Attacker).Target = Victim Then
                TempPlayer(Attacker).Target = 0
                TempPlayer(Attacker).TargetType = TARGET_TYPE_NONE
            End If
        End If
>!         Call OnDeath(Victim)
    Else
        ' Player not dead, just do the damage
        Call SetPlayerVital(Victim, Vitals.HP, GetPlayerVital(Victim, Vitals.HP) - Damage)
        Call SendVital(Victim, Vitals.HP)
        SendActionMsg GetPlayerMap(Victim), "-" & Damage, BrightRed, 1, (GetPlayerX(Victim) * 32), (GetPlayerY(Victim) * 32)

        'if a stunning spell, stun the player
        If spellnum > 0 Then
            If Spell(spellnum).StunDuration > 0 Then StunPlayer Victim, spellnum
        End If
    End If
>!     ' Reset attack timer
    TempPlayer(Attacker).AttackTimer = GetTickCount
End Sub
```

Those are the ONLY scripts/codes I have changed, this is just dealing with the exp rate of pvp.
Link to comment
Share on other sites

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...