Ola pessoal blz então meu primeiro tuto aqui
eu vi esse tutorial aqui porem ele estava
meio zuado e faltando algumas coisas
então venho aqui posta ele mais
arrumadinho espero que gostem
vamos la
Cliente side
em modConstants Abaixo de:
- Código:
Public Const ITEM_TYPE_SPELL As Byte = 8
Coloque:
- Código:
Public Const ITEM_TYPE_STAT_RESET As Byte = 9
Em frmEditor_Item no cmbType's list adicionar na list ResetarStatus
Serve side:
abaixo de :
- Código:
Public Const ITEM_TYPE_SPELL As Byte = 8
colocar:
- Código:
Public Const ITEM_TYPE_STAT_RESET As Byte = 9
Em modPlayer na sub UseItem
abaixo de:
- 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 adicione:
- Código:
Case ITEM_TYPE_STAT_RESET
If GetPlayerResets(Index) >= 1 Then
filename = App.Path & "\data\classes.ini"
Call SetPlayerStat(Index, Agility, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Agility")))
Call SetPlayerStat(Index, Strength, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Strength")))
Call SetPlayerStat(Index, Intelligence, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Intelligence")))
Call SetPlayerStat(Index, Endurance, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Endurance")))
Call SetPlayerStat(Index, Willpower, Val(GetVar(filename, "CLASS" & GetPlayerClass(Index), "Willpower")))
If Not GetPlayerPOINTS(Index) > 0 Then
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
Else
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
End If
Call TakeInvItem(Index, Player(Index).Inv(invNum).Num, 0)
' send the sound
SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, itemnum
Call PlayerMsg(Index, "Seus Pontos foram Resetados!", BrightGreen)
Else
Call PlayerMsg(Index, "Você deve ter mais de 1 reset para reseta seus status!", BrightRed)
End If
lembrando que esse codigo ai e pra que ja tem reset em seu projeto caso queiram
usar so pra level e so altera ali em
- Código:
If Not GetPlayerPOINTS(Index) > 0 Then
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
Else
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerLevel(Index) - 1) * 1))
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + ((GetPlayerResets(Index) * 1000) * 1))
End If
dareis os creditos as pessoas que foram citadas no outro tutorial ja que não sei a origem certa dele
Créditos:
- Helling por postar
- mmearrccii por fazer
-a mim por arruma e corrigir ele