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

[EO] Exp Multiplier Item


lexkymbeth
 Share

Recommended Posts

**Server & Client**

in **Private Type PlayerRec** add

```
ExpMultiplier as Long
ExpMultiplierTime as Long

```

in **Private Type ItemRec** add

```
addExpMultiplier As Long
addExpMultiplierTime As Long

```

**Server**

in **Sub ServerLoop** dim

```
Dim LastUpdateExpMod As Long

```
in **Sub ServerLoop** after the if statement **If Tick > LastUpdateSavePlayers Then**

```
If Tick > LastUpdateExpMod Then
UpdateExpMod
LastUpdateExpMod = GetTickCount + 60000
End If

```
in **modServerLoop** add

```
Private Sub UpdateExpMod()
Dim i As Long
For i = 1 To Player_HighIndex
If IsPlaying(i) Then
If Player(i).ExpMultiplierTime > 0 Then
Player(i).ExpMultiplierTime = Player(i).ExpMultiplierTime - 1
End If
End If
Next
End Sub

```
in **sub GivePlayerEXP** add after **' give the exp**

```
If Player(index).ExpMultiplierTime > 0 Then
exp = exp * Player(index).ExpMultiplier
End If

```
in **sub UseItem** add after the if statement **If Item(itemnum).AddEXP > 0 Then**

```
If Item(itemnum).addExpMultiplierTime > 0 Then
Player(index).ExpMultiplierTime = Item(itemnum).addExpMultiplierTime
Player(index).ExpMultiplier = Item(itemnum).addExpMultiplier
SendActionMsg GetPlayerMap(index), "x" & Item(itemnum).addExpMultiplier & " EXP", White, ACTIONMSG_SCROLL, GetPlayerX(index) * 32, GetPlayerY(index) * 32
End If

```
**Client**

in **frmEditor_Item** in frame **fraVitals **create two labels (lblExpTime "Multiplier Time: 0", lblExpMultiplier "Exp Multiplier: 0") and two scrlbars (scrlMultiplierTime,scrlMultiplier)

![](http://puu.sh/aEWbm/821e0f7982.png)

x2 click **scrlMultiplierTime** input

```
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
lblExpTime.Caption = "Multiplier Time: " & scrlMultiplierTime.Value
Item(EditorIndex).addExpMultiplierTime = scrlMultiplierTime.Value

' Error handler
Exit Sub
errorhandler:
HandleError "scrlMultiplierTime_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub

```
x2 click **scrlMultiplier** input

```
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
lblExpMultiplier.Caption = "Exp Multiplier: " & scrlMultiplier.Value
Item(EditorIndex).addExpMultiplier = scrlMultiplier.Value

' Error handler
Exit Sub
errorhandler:
HandleError "scrlMultiplier_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub

```
In **sub ItemEditorInit** in the if statement **If frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_CONSUME Then** under **frmEditor_Item.chkInstant.Value = .instaCast** add

```
frmEditor_Item.scrlMultiplier.Value = .addExpMultiplier
frmEditor_Item.scrlMultiplierTime.Value = .addExpMultiplierTime

```
**I may have forgot something, I coded the additions then did the tutorial if something is missing and it's not working please post something!**
Link to comment
Share on other sites

> Ok bugs: when u go to edit it in item editor after build, as soon as u change exp multiplier from 0 to 1 label changes to multiplier time and when u set it to 1 min and consume it, it lasts like 5 secs

1m = 60000ms so it ticks every one minute it should not last 5 seconds

```
If Tick > LastUpdateExpMod Then
UpdateExpMod
LastUpdateExpMod = GetTickCount + 60000
End If

```
Only ticks every 60000ms

Did you change this number?

–---------------------------------------------------------

Once you create the item and consume it, it gives you an exp buff for a set amount of time and a set amount of multiplier.
Link to comment
Share on other sites

> 1m = 60000ms so it ticks every one minute it should not last 5 seconds
>
>  
>
> ```
> If Tick > LastUpdateExpMod Then
> UpdateExpMod
> LastUpdateExpMod = GetTickCount + 60000
> End If
>
> ```
> Only ticks every 60000ms
>
> Did you change this number?
>
> –---------------------------------------------------------
>
> Once you create the item and consume it, it gives you an exp buff for a set amount of time and a set amount of multiplier.

well ill retry tutorial and let you know how it turns out!
Link to comment
Share on other sites

Ok I found the bug and here's the fix this is what it looks like without fix ' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

lblExpMultiplier.Caption = "Multiplier Time: " & scrlMultiplier.Value

Item(EditorIndex).addExpMultiplier = scrlMultiplier.Value

' Error handler

Exit Sub

errorhandler:

HandleError "scrlMultiplier_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

Where it says lblExpMultiplier.Caption= multiplier time just change multiplier time to Exp Multiplier compile and it will work perfect thank you lex for base you just made a simple mistake no worries lol
Link to comment
Share on other sites

  • 5 months later...
So what exactly does this do? give you an item that goes away after a while that gives you an exp multiplier? I like the concept. Maybe could add in some form of cool animation when it runs out. Idk. Totally going to use this though.
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...