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

[EO] Titles 1.2


iHero
 Share

Recommended Posts

**Images**

**Log - Version 1.0 to Version 1.2**

* Correção - Ao remover algum titulo sobrecarregar o servidor;
* Nova formula de recompeça dos titulos;
* Agora o titulo pode ser arrastado para a hotbar;
* Menssagens quando usar/remover um titulo;
* Remover o titulo que está usando;

**Anexos**

* [Full System](http://www.mediafire.com/?6c7oigess19miys)
* [Extras](http://www.mediafire.com/?lvaga8mat7vyevl)

**Beginning**

First download the file _Extras_, which is found in _Annexes_, extract it and add formulas and modules in your game.

**Server~Side**

> frmServer

Create a commandButton with the following settings:

> Name: cmdReloadTitulos
>
> Caption: Titulos

Inside it add:

```
Dim i As Long

Call LoadTitulos

Call TextAdd("All Titulos reloaded.")

For i = 1 To Player_HighIndex

If IsPlaying(i) Then

SendTitulos i

End If

Next
```

> modCombat

Replace _Function GetPlayerMaxVital_ by:

```
Function GetPlayerMaxVital(ByVal index As Long, ByVal Vital As Vitals) As Long

Dim x As Long, i As Long, n As Long

If index > MAX_PLAYERS Then Exit Function

Select Case Vital

Case HP

x = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Endurance) / 2)) * 15 + 150

Case MP

x = ((GetPlayerLevel(index) / 2) + (GetPlayerStat(index, Intelligence) / 2)) * 5 + 25

End Select

For i = 1 To MAX_PLAYER_TITULOS

If GetPlayerTitulo(index, i) > 0 Then

If Titulo(GetPlayerTitulo(index, i)).Passivo = True Then

x = x + Titulo(GetPlayerTitulo(index, i)).VitalRec(Vital)

End If

End If

Next

If GetPlayerTUsando(index) > 0 Then

x = x + Titulo(GetPlayerTUsando(index)).VitalRec(Vital)

end if

GetPlayerMaxVital = x

End Function
```

> modDataBase

Look for:

```
' set start spells

If Class(ClassNum).startSpellCount > 0 Then

For n = 1 To Class(ClassNum).startSpellCount

If Class(ClassNum).StartSpell(n) > 0 Then

' spell exist?

If Len(Trim$(Spell(Class(ClassNum).StartItem(n)).Name)) > 0 Then

Player(index).Spell(n) = Class(ClassNum).StartSpell(n)

End If

End If

Next

End If
```

Below add:

```
' set start titulos

For n = 1 To MAX_TITULOS

If Len(Trim$(Titulo(n).Nome)) > 0 Then

If Titulo(n).Tipo = TITULO_TYPE_INICIAL Then

Call SetPlayerTitulo(index, FindOpenTituloSlot(index), n)

End If

End If

Next
```

> modEnumerations

Look for:

```
' Make sure SMSG_COUNT is below everything else
```

Add up:

```
STituloEditor

SUpdateTitulo

STitulos
```

Look for:

```
' Make sure CMSG_COUNT is below everything else
```

Add up:

```
CRequestEditTitulo

CSaveTitulo

CRequestTitulos

CSwapTituloSlots

CTituloComando
```

Look for:

```
Public Enum SoundEntity

seAnimation = 1

seItem

seNpc

seResource

seSpell
```

Below add:

```
seTitulo
```

> modGeneral

Look for:

```
ChkDir App.Path & "\Data\", "spells\"
```

Below add:

```
ChkDir App.Path & "\Data\", "titulos\"
```

Look for:

```
Call SetStatus("Clearing animations...")

Call ClearAnimations
```

Below add:

```
Call SetStatus("Clearing titulos...")

Call ClearTitulos
```

Look for:

```
Call SetStatus("Loading animations...")

Call LoadAnimations
```

Below add:

```
Call SetStatus("Loading titulos...")

Call LoadTitulos
```

> modHandleData

Look for:

```
HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)
```

Below add:

```
HandleDataSub(CRequestEditTitulo) = GetAddress(AddressOf HandleRequestEditTitulo)

HandleDataSub(CSaveTitulo) = GetAddress(AddressOf HandleSaveTitulo)

HandleDataSub(CRequestTitulos) = GetAddress(AddressOf HandleRequestTitulos)

HandleDataSub(CSwapTituloSlots) = GetAddress(AddressOf HandleSwapTituloSlots)

HandleDataSub(CTituloComando) = GetAddress(AddressOf HandleTituloComando)
```

Look for:

```
' Send the update

'Call SendStats(Index)
```

Below add:

```
CheckTitulo index
```

Look for:

```
Case 2 ' spell

If Slot > 0 And Slot <= MAX_PLAYER_SPELLS And Player(index).Spell(Slot) Then

If Len(Trim$(Spell(Player(index).Spell(Slot)).Name)) > 0 Then

If FindHotbar(index, Player(index).Spell(Slot), SType) = False Then

Player(index).Hotbar(hotbarNum).Slot = Player(index).Spell(Slot)

Player(index).Hotbar(hotbarNum).SType = SType

End If

End If

End If
```

Below add:

```
Case 3 ' titulo

If Slot > 0 And Slot <= MAX_PLAYER_TITULOS Then

If GetPlayerTitulo(index, Slot) > 0 Then

If Len(Trim$(Titulo(GetPlayerTitulo(index, Slot)).Nome)) > 0 Then

Player(index).Hotbar(hotbarNum).Slot = GetPlayerTitulo(index, Slot)

Player(index).Hotbar(hotbarNum).SType = SType

End If

End If

End If
```

> modPlayer

Look for:

```
Call SendHotbar(index)
```

Below add:

```
Call SendTitulos(index)
```

Look for:

```
If level_count > 0 Then

If level_count = 1 Then

'singular

GlobalMsg GetPlayerName(index) & " has gained " & level_count & " level!", Brown

Else

'plural

GlobalMsg GetPlayerName(index) & " has gained " & level_count & " levels!", Brown

End If
```

Below add:

```
CheckTitulo index
```

Replace _Function GetplayerStat_ by:

```
Public Function GetPlayerStat(ByVal index As Long, ByVal Stat As Stats) As Long

Dim x As Long, i As Long

If index > MAX_PLAYERS Then Exit Function

x = Player(index).Stat(Stat)

For i = 1 To MAX_PLAYER_TITULOS

If GetPlayerTitulo(index, i) > 0 Then

If Titulo(GetPlayerTitulo(index, i)).Passivo = True Then

x = x + Titulo(GetPlayerTitulo(index, i)).StatRec(Stat)

End If

End If

Next

If GetPlayerTUsando(index) > 0 Then x = x + Titulo(GetPlayerTUsando(index)).StatRec(Stat)

For i = 1 To Equipment.Equipment_Count - 1

If Player(index).Equipment(i) > 0 Then

If Item(Player(index).Equipment(i)).Add_Stat(Stat) > 0 Then

x = x + Item(Player(index).Equipment(i)).Add_Stat(Stat)

End If

End If

Next

GetPlayerStat = x

End Function
```

> modServerTcp

Look for:

```
Buffer.WriteLong GetPlayerPK(index)
```

Below add:

```
Buffer.WriteLong GetPlayerTUsando(index)

For i = 1 To MAX_PLAYER_TITULOS

Buffer.WriteLong GetPlayerTitulo(index, i)

Next
```

> modTypes

Above Type PlayerRec add:

```
Private Type PlayerTituloRec

Titulo(1 To MAX_PLAYER_TITULOS) As Long

Usando As Long

End Type
```

At the end of Type PlayerRec before the End Type, add:

```
' Titulo

Titulo As PlayerTituloRec
```
Link to comment
Share on other sites

@Whack:

> Title editor. Pretty cool, good job.

Thank you

@Lenn:

> A title system. It's just not been translated.

No, it was I who made ​​the system

@GustavoNunes:

> Bom sistema, espero ver mais desses por aqui..

A um brasileiro, obrigado.
Link to comment
Share on other sites

@GuardianBR:

> Good job Ricardo, thanks for sharing your knowledge. :)

Thank you, my brother

@Likestodraw:

> This looks AMAZING, but would it be possible for you to translate?

I'm traveling, but I will provide.@WillMaia:

> Cool IHero!!
>
> Legal em cara ^^ parabéns.

Thank you WillMaia

@onzinho:

> not work.
> something is missing in your tutorial, here accuse many errors.
> add it in a pure engine for you to see both errors.

Impossible, I will check. You download the attachment? If yes, what is the error and which line the error?
Link to comment
Share on other sites

iHero, I'm adding again and compared with their source.
the code and very interesting, with a little more than implement is perfect.

–---------Edit---------------------------------

in server

Run-time error '9':

Subscript out of range

in Sub JoinGame

line: For i = 0 To ResourceCache(GetPlayerMap(index)).Resource_Count
Link to comment
Share on other sites

@onzinho:

> iHero, I'm adding again and compared with their source.
> the code and very interesting, with a little more than implement is perfect.
>
> –---------Edit---------------------------------
>
> in server
>
> Run-time error '9':
>
> Subscript out of range
>
> in Sub JoinGame
>
> line: For i = 0 To ResourceCache(GetPlayerMap(index)).Resource_Count

Hm, well I never understood this error, try deleting the maps and resources.
Link to comment
Share on other sites

Okay, GuardianBR translated into English frmEditor_Titulo. He not only translated label names, texts, and others. Only translated the interface, but is already something. xD

Already changed the topic, both the full system as the extras are correct.
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...