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

Items for 2 Classes


hagefade
 Share

Recommended Posts

@Animaru:

> Only by scripting.
>
> If would have to start with something like this ( I think)
>
> If class = 1
> then …..
>
> If class = 2
> then......
>
> else
> *You cant use this lol*
>
> Get a second opinion though. ;)

Incorrect.

It would be:

```
If GetPlayerClass=1
ElseIf GetPlayerClass=2

```
OR

```
If GetPlayerClass > 3
```
Will allow any class bellow class 3.
Link to comment
Share on other sites

@hagefade:

> KK for example if I wanted item 1 to be able to be used by class 8 and 10, how would I do it and where would I put it?

Hmm…

You would have to swap 8 to 9 and make it:

```
If GetPlayerClass < 8 then
```
OR:

```
If GetPlayerClass=8 and
ElseIf GetPlayerClass=10 then
```
It would be in sub onattack or scripted item I believe, not sure though..
Link to comment
Share on other sites

Actually bit, since it's a function, it would be GetPlayerClass(Index).
And it's best to do something like,
If GetPlayerClass(Index) = 8 And GetPlayerClass(Index) = 10 Then
  '…etc
End If

Either way, there's still no way to actually run a script when a player equips an item (not that I know of), so you won't be able to do that anyway.

My solution, which only works with weapons, is to throw this at the top of the OnAttack sub:
```
Dim weapon_slot
Dim player_weapon
weapon_slot=Int(GetPlayerWeaponSlot(index))
player_weapon=Int(GetPlayerInvItemNum(index, weapon_slot))

Select Case player_weapon
  Case 2 'Weapon number '2' is the club
    If GetPlayerClass(index) <> 0 Then
      Call PlayerMsg(index, "Only Pwnt can use this club!", 4)
      Exit Sub
    End If 
  Case 5 'Weapon number '5' is the wand.
    If GetPlayerClass(index) <> 1 Then
      Call PlayerMsg(index, "Only star can use this wand!", 4)
      Exit Sub   
    End If
End Select

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