quando a transformação acaba os status não voltam corretamente
código de transformação
código de transformação
- Código:
With Spell(spellnum)
If .Type = SPELL_TYPE_TRANS Then
Call SetPlayerSprite(Index, Spell(spellnum).Trans)
Call SetPlayerStat(Index, Stats.Strength, GetPlayerRawStat(Index, Stats.Strength) + Spell(spellnum).Força)
Call SetPlayerStat(Index, Stats.Endurance, GetPlayerRawStat(Index, Stats.Endurance) + Spell(spellnum).Defesa)
Call SetPlayerStat(Index, Stats.Agility, GetPlayerRawStat(Index, Stats.Agility) + Spell(spellnum).Agilidade)
Call SetPlayerStat(Index, Stats.Willpower, GetPlayerRawStat(Index, Stats.Willpower) + Spell(spellnum).Willpower)
Call SetPlayerStat(Index, Stats.Intelligence, GetPlayerRawStat(Index, Stats.Intelligence) + Spell(spellnum).Inteligencia)
Call SetPlayerVital(Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) - MPCost)
Call SendVital(Index, Vitals.MP)
Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
TempPlayer(Index).Trans = GetTickCount + (Spell(spellnum).Tempo * 1000)
SendAnimation GetPlayerMap(Index), Spell(Index).Anima, 0, 0, TARGET_TYPE_PLAYER, Index
TempPlayer(Index).SpellCD(spellslot) = GetTickCount + (Spell(spellnum).CDTime * 1000)
Call PlayerMsg(Index, GetPlayerName(Index) & " - Você se Transformou! Para: " & Trim$(Spell(spellnum).Name), Cyan)
SendPlayerData Index
SavePlayer Index
SendStats Index
End If
End With
código de voltar ao normal
- Código:
Public Sub AcabarTrans(ByVal Index As Long)
If Index < 1 Or Index > MAX_PLAYERS Then Exit Sub
Call SetPlayerStat(Index, Stats.Strength, GetPlayerRawStat(Index, Stats.Strength) - Spell(Index).Força)
Call SetPlayerStat(Index, Stats.Endurance, GetPlayerRawStat(Index, Stats.Endurance) - Spell(Index).Defesa)
Call SetPlayerStat(Index, Stats.Agility, GetPlayerRawStat(Index, Stats.Agility) - Spell(Index).Agilidade)
Call SetPlayerStat(Index, Stats.Willpower, GetPlayerRawStat(Index, Stats.Willpower) - Spell(Index).Willpower)
Call SetPlayerStat(Index, Stats.Intelligence, GetPlayerRawStat(Index, Stats.Intelligence) - Spell(Index).Inteligencia)
SendAnimation GetPlayerMap(Index), Spell(Index).Anima, 0, 0, TARGET_TYPE_PLAYER, Index
Call PlayerMsg(Index, "O Tempo Limite da Sua Transformação Acabou...", DarkGrey)
TempPlayer(Index).Trans = 0
SendPlayerData Index
SavePlayer Index
SendStats Index
End Sub