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

2 Values in one function?


willunited
 Share

Recommended Posts

I did it for evolution of classes:

Example:Fighter->Warrior->Knight/Puncher

(i tried GetPlayerEvolution = 1 And GetPlayerEvolution = 9 but doenst work).

```
Function GetPlayerEvolution(ByVal index As Long) As Long

Select Case GetPlayerClass(index)

Case 1

GetPlayerEvolution = 1

Case 2

GetPlayerEvolution = 2

Case 3

GetPlayerEvolution = 3

Case 4

GetPlayerEvolution = 4

Case 5

GetPlayerEvolution = 5

Case 6

GetPlayerEvolution = 6

Case 7

GetPlayerEvolution = 7

Case 8

GetPlayerEvolution = 8

Case 9

GetPlayerEvolution = 1 And 9

Case 10

GetPlayerEvolution = 2 And 10

Case 11

GetPlayerEvolution = 3 And 11

Case 12

GetPlayerEvolution = 4 And 12

Case 13

GetPlayerEvolution = 5 And 13

Case 14

GetPlayerEvolution = 6 And 14

Case 15

GetPlayerEvolution = 7 And 15

Case 16

GetPlayerEvolution = 8 And 16

Case 17

GetPlayerEvolution = 1 And 9 And 17

Case 18

GetPlayerEvolution = 1 And 9 And 18

Case 19

GetPlayerEvolution = 2 And 10 And 19

Case 20

GetPlayerEvolution = 2 And 10 And 20

Case 21

GetPlayerEvolution = 4 And 12 And 21

Case 22

GetPlayerEvolution = 4 And 12 And 22

Case 23

GetPlayerEvolution = 5 And 13 And 23

Case 24

GetPlayerEvolution = 5 And 13 And 24

Case 25

GetPlayerEvolution = 6 And 14 And 25

Case 26

GetPlayerEvolution = 6 And 14 And 26

Case 27

GetPlayerEvolution = 7 And 15 And 27

Case 28

GetPlayerEvolution = 7 And 15 And 28

Case 29

GetPlayerEvolution = 8 And 16 And 29

Case 30

GetPlayerEvolution = 8 And 16 And 30

Case 31

GetPlayerEvolution = 3 And 11 And 31

Case 32

GetPlayerEvolution = 3 And 11 And 32

End Select

End Function
```

And in UseItem sub:

```
If Item(itemnum).ClassReq > 0 Then

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

PlayerMsg index, "Hidden", BrightRed

Exit Sub

End If

End If
```
Link to comment
Share on other sites

oh I'm an idiot just seen the

If Item(itemnum).ClassReq > 0 Then

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

PlayerMsg index, "Hidden", BrightRed

Exit Sub

End If

End If

How about this ;

If Item(itemnum).ClassReq > 0 Then

If Not GetPlayerEvolution(index) = Item(itemnum).ClassReq or Not GetPlayerEvolution2(index) = Item(itemnum).ClassReq or Not GetPlayerEvolution2(index) = Item(itemnum).ClassReq or Then

PlayerMsg index, "Hidden", BrightRed

Exit Sub

End If

End If

Then do the

GetPlayerEvolution sub 3 times

with the other 2 equaling the other values…..

Something to this effect >.>
Link to comment
Share on other sites

Well the only solution I can think of is 3 get functions or something like this

If Item(itemnum).ClassReq > 0 Then

Select Case Item(itemnum).ClassReq

Case 1

If GetPlayerClass(index) <> 1 and GetPlayerClass(index) <> 9 and GetPlayerClass(index) <> 17 and GetPlayerClass(index) <> 18 then

PlayerMsg index, "Hidden", BrightRed

Exit Sub

End If

Case 2

If GetPlayerClass(index) <> 2 and GetPlayerClass(index) <> 10 and GetPlayerClass(index) <> 19 and GetPlayerClass(index) <> 20 then

PlayerMsg index, "Hidden", BrightRed

Exit Sub

End If

Case 3

ETC…

End Select

End If

This work?

Ditch the get evolution function?

It would now select which class.req the item has then see if a player is that level or the corresponding evolution levels. It's a bit more typing and I hate using select case but at least it'd work lol.
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...