Client.
Procure por:
Em frmEditor_Item no cmbType's list adicionar na list Pacote
Server.
Procure por:
Depois vai na "modPlayer"
Procure por:
antes do End select
Procure por:
- Código:
Public Const ITEM_TYPE_SPELL As Byte = 8
- Código:
Public Const ITEM_TYPE_STAT_PACOTE As Byte = 9
Em frmEditor_Item no cmbType's list adicionar na list Pacote
Server.
Procure por:
- Código:
Public Const ITEM_TYPE_SPELL As Byte = 8
- Código:
Public Const ITEM_TYPE_STAT_PACOTE As Byte = 9
Depois vai na "modPlayer"
Procure por:
- Código:
Case ITEM_TYPE_SPELL
' 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
' Get the spell num
n = Item(itemnum).Data1
If n > 0 Then
' Make sure they are the right class
If Spell(n).ClassReq = GetPlayerClass(index) Or Spell(n).ClassReq = 0 Then
' Make sure they are the right level
i = Spell(n).LevelReq
If i <= GetPlayerLevel(index) Then
i = FindOpenSpellSlot(index)
' Make sure they have an open spell slot
If i > 0 Then
' Make sure they dont already have the spell
If Not HasSpell(index, n) Then
Call SetPlayerSpell(index, i, n)
Call SendAnimation(GetPlayerMap(index),Item itemnum).Animation, 0, 0, TARGET_TYPE_PLAYER, index)
Call TakeInvItem(index, itemnum, 0)
Call PlayerMsg(index, "You feel the rush of knowledge fill your mind. You can now use " & Trim$(Spell(n).Name) & ".", BrightGreen)
Else
Call PlayerMsg(index, "You already have knowledge of this skill.", BrightRed)
End If
Else
Call PlayerMsg(index, "You cannot learn any more skills.", BrightRed)
End If
Else
Call PlayerMsg(index, "You must be level " & i & " to learn this skill.", BrightRed)
End If
Else
Call PlayerMsg(index, "This spell can only be learned by " & CheckGrammar(GetClassName(Spell(n).ClassReq)) & ".", BrightRed)
End If
End If
' send the sound
SendPlayerSound index, GetPlayerX(index), GetPlayerY(index), SoundEntity.seItem, itemnum
antes do End select
- Código:
'###Item premiado###
Case ITEM_TYPE_STAT_PACOTE
n = Random(1, 50) 'Vai procurar um item do 1 ao 50 e dar ao player,
'Itens aleatorios
If n = "1" Then 'Random 1
Call GiveInvItem(Index, 1, 2) 'Aqui vc escolhe o item que quer dar, num 1 o id, num 2 a quantidade
Call PlayerMsg(Index, "Você recebeu 100k de Ryou", BrightGreen) 'msg
End If
If n = "2" Then 'Random 2
Call GiveInvItem(Index, 1, 500000)
Call PlayerMsg(Index, "Você recebeu 500k de Ryou", BrightGreen)
End If
If n = "3" Then 'Random 3
Call GiveInvItem(Index, 1, 1000000)
Call PlayerMsg(Index, "Você recebeu 1m de Ryou", BrightGreen)
End If
If n = "4" Then 'Random 4
Call GiveInvItem(Index, 62, 1)
Call PlayerMsg(Index, "Você recebeu 1 Barra de ouro!", BrightGreen)
End If
If n = "5" Then 'Random 5
Call GiveInvItem(Index, 26, 1)
Call PlayerMsg(Index, "Você recebeu 1 Box Reset", BrightGreen)
'Tentaiva falhada
Else
Call PlayerMsg(Index, "Você não teve sorte!", BrightRed)
'Função que remove o item
Call TakeInvItem(Index, Player(Index).Inv(invNum).Num, 1)
'Animação ao usar o item, troque o numeto 42 pelo qual vc quiser usar.
SendAnimation GetPlayerMap(Index), 42, 0, 0, TARGET_TYPE_PLAYER, Index
Creditos: Irin.
Nexus Games.
https://nexusgames2d.blogspot.com/
Última edição por irintomaz em Ter Mar 28, 2023 1:40 pm, editado 1 vez(es)