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

[EO] LevelUp Item


hisherwin
 Share

Recommended Posts

So i finally update my Topic , sorry but i tried to do that Random Thing but it really suck , for real.. it make players get easy level hehehe..

So this update will allow you to set the item level up details by your choise , and if you say that this is an easy made , you got it wrong because there are more calculations needed to make it works , for example an item that give you 90 level but your level is 50 and max level is 100 .. what will happen? at my first try it failed , the item give 0 level.. so i calculate it to make it work!

Let's start ..

Server and Client Side~

at Item constants in modConstants add this value

```

Public Const ITEM_TYPE_LEVEL As Byte = *number of the next value*

```

Client Side~

Find

```

If (frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_SPELL) Then

frmEditor_Item.fraSpell.Visible = True

frmEditor_Item.scrlSpell.Value = .Data1

Else

frmEditor_Item.fraSpell.Visible = False

End If

```

Add this below it

```

If (frmEditor_Item.cmbType.ListIndex = ITEM_TYPE_LEVEL) Then

frmEditor_Item.fraLevel.Visible = True

frmEditor_Item.scrlLevelSet.Value = .Data1

Else

frmEditor_Item.fraLevel.Visible = False

End If

```

Next find

```

If (cmbType.ListIndex = ITEM_TYPE_SPELL) Then

fraSpell.Visible = True

Else

fraSpell.Visible = False

End If

```

Add this below it

```

If (cmbType.ListIndex = ITEM_TYPE_LEVEL) Then

fraLevel.Visible = True

Else

fraLevel.Visible = False

End If

```

at cmbType Add "Level" at the list

Form Work at Client Side~

Add a frame name it fraLevel

Add a label at the frame name it lblLevelSet

Add a scroll at the frame name it scrlLevelSet

Double Click the scrlLevelSet and add this

```

If scrlLevelSet.Value > 0 Then

lblLevelSet.Caption = "Level Give: " & scrlLevelSet.Value

End If

Item(EditorIndex).Data1 = scrlLevelSet.Value

```

Server Side~

Add this at Public Sub UseItem

```

Case ITEM_TYPE_LEVEL

' stat requirements

For i = 1 To Stats.Stat_Count - 1

If GetPlayerRawStat(index, i) < Item(itemnum).Stat_Req(i) Then

PlayerMsg index, "You do not meet the stat requirements to use this item.", BrightRed

Exit Sub

End If

Next

' level requirement

If GetPlayerLevel(index) < Item(itemnum).LevelReq Then

PlayerMsg index, "You do not meet the level requirement to use this item.", BrightRed

Exit Sub

End If

' class requirement

If Item(itemnum).ClassReq > 0 Then

If Not GetPlayerClass(index) = Item(itemnum).ClassReq Then

PlayerMsg index, "You do not meet the class requirement to use this item.", BrightRed

Exit Sub

End If

End If

' access requirement

If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then

PlayerMsg index, "You do not meet the access requirement to use this item.", BrightRed

Exit Sub

End If

If Item(itemnum).Data1 > 0 Then

If GetPlayerLevel(index) < MAX_LEVELS Then

If GetPlayerLevel(index) + Item(itemnum).Data1 >= MAX_LEVELS Then

SetPlayerLevel index, MAX_LEVELS

CheckPlayerLevelUp index

If Item(itemnum).Data1 = 1 Then

'singular

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " level!", Brown)

Else

'plural

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " levels!", Brown)

End If

Call TakeInvItem(index, itemnum, 0)

Exit Sub

Else

SetPlayerLevel index, GetPlayerLevel(index) + Item(itemnum).Data1

CheckPlayerLevelUp index

If Item(itemnum).Data1 = 1 Then

'singular

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " level!", Brown)

Else

'plural

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " levels!", Brown)

End If

Call TakeInvItem(index, itemnum, 0)

Exit Sub

End If

Else

PlayerMsg index, "You are at the max level.", BrightRed

Exit Sub

End If

Else

PlayerMsg index, "This is a incomplete item , Please report this to any Staff Members.", BrightRed

Exit Sub

End If

```

I added this

```

If Item(itemnum).Data1 = 1 Then

'singular

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " level!", Brown)

Else

'plural

Call PlayerMsg(index, "You gained " & Item(itemnum).Data1 & " levels!", Brown)

End If

```

because you don't recieve any Message after you use the item xD! if anyone can fix that , you can just fix it hehe..

Your done! I hope you credits me for this ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

Thank You~

~Sherwin
Link to comment
Share on other sites

  • 3 weeks later...
In the dragdown thing at the propertyes into the list…

Please learn first the basics...

![](http://www7.pic-upload.de/05.02.13/1g6d55vmm8.png)

[![](http://www7.pic-upload.de/thumb/05.02.13/1g6d55vmm8.png)](http://www.pic-upload.de/view-18013593/Unbenannt.png.html)

The code which you put there is to make the fralevel visible and invisible

And PS my item form looks different thay yours because i added much other stuff
Link to comment
Share on other sites

for example i make a sword.

first i choose weapon at the option list for create the sword then i save. no with level option like a normal sword.

then i use the sword and work perfecly. now here the part. when i go to the editor for change the sword option to level i choose that. next i save i go to use the sword but with that option dont let me use it. i doble click and nothing happend.

but if i do all right. u say when i use this item it give to me a level for example if im level 14 and i used that item give me and next level 15.
Link to comment
Share on other sites

nice work sherwin. cant wait for the update. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) just a thought but cant use also set it to give exp? reason even tho an item for level giving is great to have but its not something you want to float around alot b/c leveling go to fast. but an item for Exp will help in leveling but wont make it too fast. both are equaly useful xD. but great job with tut and cant wait for ur next update. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)!
Link to comment
Share on other sites

> nice work sherwin. cant wait for the update. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) just a thought but cant use also set it to give exp? reason even tho an item for level giving is great to have but its not something you want to float around alot b/c leveling go to fast. but an item for Exp will help in leveling but wont make it too fast. both are equaly useful xD. but great job with tut and cant wait for ur next update. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)!

I was busy on school so i can't update it earlier .. anyway giving exp? use Consume..

I finish the Set Level like you can set the item giving level for example an Gold Berry give 5 levels … but i'm still doing the random thing , too busy at school really D:
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...