[EO 3.0]Random Logo Guild System[v.0.2]

INTRO :

“I am so tired of seeing my own guild.” That’s why I made this tutorial.

Here I add a logo on a guild that where the logo was obtained randomly.

!
What i Editing or adding?

  • Client : modConstants, modGrapichs, modDatabase, modGuild, modHandleData, modTypes, frmEditor_Item
  • **Server :**modConstants, modGuild, modServerTCP, modPlayer

Require : Scott guild system http://www.touchofde…eo-2030-guilds/
Difficulty : Medium

Date Fixed : none

Extra Files : none

Recomended : Start Over Fresh

Engine : EO 3.0, EA, All Version Suport Guild System in DX8

Notes :

This system must delete your guilds data in sever and your accounts

Version : v.0.2

  • Featured : adding a reset feature a guild logo with items
  • Convert v.0.1 to v.0.2 : Add the script with tag New!

Fix & Bugs :

  • Fix : add the script with tag Fix!
  • Bug : if the master of Guild to replace current logo guild, in guild members are online then the logo will not be edited directly, should re-Login to see how the change logo

Fixed Thank’s to DarkDino

CLIENT SIDE

first you need make new folder “guilds” in “data files\grapichs” and content with pictures

you can download in http://www.mediafire…j8lwhttvrxc3c9h

the icons or logo must 16x16 pixel

New!
Open modConstants find

Public Const ITEM_TYPE_SPELL As Byte = 7

add

Public Const ITEM_TYPE_LOGO_GUILD As Byte = 8
```open **modGraphics** find

Public Tex_Shadow As DX8TextureRec

add

Public Tex_Guild() As DX8TextureRec

Add/Declare in **Public Sub DrawPlayer**

Dim X2 As Long, Y2 As Long


Public NumProjectiles As Long

add

Public NumGuilds As Long


’ render the actual sprite
If GetTickCount > TempPlayer(Index).StartFlash Then
Call DrawSprite(Sprite, X, Y, rec)
TempPlayer(Index).StartFlash = 0
Else
Call DrawSprite(Sprite, X, Y, rec, True)
End If

add below it

GuildString = Player(Index).GuildName
x2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + TempPlayer(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18
y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + TempPlayer(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)

If Not Player(Index).GuildName = vbNullString Then
RenderTexture Tex_Guild(Player(Index).GuildLogo), x2, y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)
End If


GuildString = Player(Index).GuildName
X2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18
Y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)
If Not Player(Index).GuildName = vbNullString Then
RenderTexture Tex_Guild(Player(Index).GuildLogo), X2, Y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)
End If


For i = 1 To NumButtons_h
Tex_Buttons_h(i).Texture = 0
Next

add below

For i = 1 To NumGuilds
Tex_Guild(i).Texture = 0
Next


Call CheckProjectiles

add

Call CheckGuilds

Open **modDatabse** add in the bottom

Public Sub CheckGuilds()
Dim I As Long
’ If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo ErrorHandler
I = 1
NumGuilds = 1
ReDim Tex_Guild(1)
While FileExist(GFX_PATH & “guilds” & I & GFX_EXT)
ReDim Preserve Tex_Guild(NumGuilds)
NumTextures = NumTextures + 1
ReDim Preserve gTexture(NumTextures)
Tex_Guild(NumGuilds).filepath = App.Path & GFX_PATH & “guilds” & I & GFX_EXT
Tex_Guild(NumGuilds).Texture = NumTextures
NumGuilds = NumGuilds + 1
I = I + 1
Wend
NumGuilds = NumGuilds - 1
If NumGuilds = 0 Then Exit Sub
For I = 1 To NumGuilds
LoadTexture Tex_Guild(I)
Next
’ Error handler
Exit Sub
ErrorHandler:
HandleError “CheckGuilds”, “modDatabase”, Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub


in **GuildRec** find

Guild_Color As Integer

add below it

'logo guild
Guild_Logo As Long


GuildData.Guild_RecruitRank = Buffer.ReadInteger

add

GuildData.Guild_Logo = Buffer.ReadLong


Buffer.WriteString GuildData.Guild_MOTD

add

Buffer.WriteLong GuildData.Guild_Logo


If Buffer.ReadByte = 1 Then
Player(i).GuildName = Buffer.ReadString
Else
Player(i).GuildName = vbNullString
End If

replace with

If Buffer.ReadByte = 1 Then
Player(i).GuildName = Buffer.ReadString
Player(i).GuildLogo = Buffer.ReadLong 'guild logo
Else
Player(i).GuildName = vbNullString
Player(i).GuildLogo = 0
End If


add

GuildLogo As Long

CLIENT WORK**

Open **frmEditor_Item** in **cmbType** in the list add

Reset Guild Logo


**SERVER SIDE**

Open **modConstants** add it very bottom

Public Const MAX_GUILD_LOGO As Long = 10

find

ITEM_TYPE_SPELL As = 7

add

ITEM_TYPE_LOGO_GUILD As = 8


'logo guild
Guild_Logo As Long


GuildData(GuildSlot).Guild_Members(1).Online = True

add

GuildData(GuildSlot).Guild_Logo = rand(1, MAX_GUILD_LOGO)


PlayerMsg Founder_Index, "Welcome to " & GuildData(GuildSlot).Guild_Name & “.”, BrightGreen

add

PlayerMsg Founder_Index, “Your Guild Logo Randomly [” & GuildData(GuildSlot).Guild_Logo & “].”, BrightGreen


GuildData(Index).Guild_RecruitRank = 1

add

GuildData(Index).Guild_Logo = 0


Buffer.WriteInteger GuildData(GuildSlot).Guild_RecruitRank

add

Buffer.WriteLong GuildData(GuildSlot).Guild_Logo


If Player(Index).GuildFileId > 0 Then
If TempPlayer(Index).tmpGuildSlot > 0 Then
Buffer.WriteByte 1
Buffer.WriteString GuildData(TempPlayer(Index).tmpGuildSlot).Guild_Name
End If
Else
Buffer.WriteByte 0
End If

replace with

If Player(Index).GuildFileId > 0 Then
If TempPlayer(Index).tmpGuildSlot > 0 Then
Buffer.WriteByte 1
Buffer.WriteString GuildData(TempPlayer(Index).tmpGuildSlot).Guild_Name
Buffer.WriteLong GuildData(TempPlayer(Index).tmpGuildSlot).Guild_Logo
End If
Else
Buffer.WriteByte 0
Buffer.WriteLong 0
End If

Open **modPlayer** find

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, 1)
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

add in below

Case ITEM_TYPE_LOGO_GUILD

’ 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

'admin
If CheckGuildPermission(Index, 1) = True Then
SetGuildLogo TempPlayer(Index).tmpGuildSlot
Else
PlayerMsg Index, “Only Founder.”, BrightRed
Exit Sub
End If

SetGuildLogo GuildSlot

’ send the sound
SendPlayerSound Index, GetPlayerX(Index), GetPlayerY(Index), SoundEntity.seItem, ItemNum

in bottom **modPlayer** add

Sub SetGuildLogo(ByVal Index As Long)
Dim i As Long

i = rand(1, MAX_GUILD_LOGO)

If Index < 1 Or i > MAX_GUILD_LOGO Then Exit Sub
'prevent Hacking
If Not CheckGuildPermission(Index, 1) = True Then
PlayerMsg Index, “Only Founder.”, BrightRed
Exit Sub
End If

GuildData(Index).Guild_Logo = i
Call SaveGuild(Index)
Call SavePlayer(Index)

PlayerMsg Index, “Logo Guild Kamu Secara Acak [” & GuildData(Index).Guild_Logo & “].”, BrightGreen

'Update user for guild name display
Call SendPlayerData(Index)

End Sub

**WELL DONE**

make one for dx7 and i’ll love you xD

make one for dx7 and i’ll love you xD

You Just need Change the Script in modGraphics or in EO 2.0 modDirectDraw7 from DX8 to DX7

can this be added to ER or EA?

can this be added to ER or EA?

Work Great in EA

but ER if this Engine can add Guild System will surely work

require erwin guild system

http://www.touchofde…eo-2030-guilds/

Thanks for crediting me for something I didn’t make lol, it’s Scott’s system. ;)

Thanks for crediting me for something I didn’t make lol, it’s Scott’s system. ;)

wokwokw sorry technical errors

I wanted to make today an near same system xD But my guild icons wont be random and the players can add new / Choose

Thanks for the tutorial that maybe help me with my system 🙂

I wanted to make today an near same system xD But my guild icons wont be random and the players can add new / Choose

Thanks for the tutorial that maybe help me with my system 🙂

Sorry before it steals your ideas :D . But is not it more tense, when the guild logo icon found at random, if the other player can choose icons they would choose the good and ugly that certainly will not be selected.

Nah i wanted to do it like that :

1. Guild Icon folder

2. Players can put in there theyr own made icons 16x16

3. Ingame choose at the Guildwindow your icon -> Scrollbar or something else

4. It sends that icon to all which are in that guild (Or just to all its not so big xD)

5. It setts the icon too which the founder made (After relogin of course)

––> But an biiig problem i cant figure out how to let it draw on screen at DX7

Make the icon number chooseable is not so hard… it just wont draw on screen

Uploading own files is kinda stupid. What if one decides to make a 16x16 porno pic?

xD why should they do… and if so then i can disable it 😉

And ban the creator 😉

Edit–-

And by the way if someone do in an non Erotic ORPG an erotic picture then is he just stupide xD

Sexual references and textes will be warned and banned 😉 = Pictures too

Error in Call CheckGuilds :( sub or function! fix pls

Error in Call CheckGuilds :( sub or function! fix pls

Have you actually did this tutorial to:

http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/

Because it’s required. ;)

thanks but i have this guild system :(… problem is in this system

–------------------

Error1:

Call CheckGuild Error Sub or Function

Error 2:

TempPlayer Error Sub or Function


CLIENT SIDE

i fix, nice system :)

add in modDatabase:


Public Sub CheckGuilds()

Dim I As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo ErrorHandler

I = 1

NumGuilds = 1

ReDim Tex_Guild(1)

While FileExist(GFX_PATH & "guilds\" & I & GFX_EXT)

	 ReDim Preserve Tex_Guild(NumGuilds)

	 NumTextures = NumTextures + 1

	 ReDim Preserve gTexture(NumTextures)

	 Tex_Guild(NumGuilds).filepath = App.Path & GFX_PATH & "guilds\" & I & GFX_EXT

	 Tex_Guild(NumGuilds).Texture = NumTextures

	 NumGuilds = NumGuilds + 1

	 I = I + 1

Wend

NumGuilds = NumGuilds - 1

If NumGuilds = 0 Then Exit Sub

For I = 1 To NumGuilds

	 LoadTexture Tex_Guild(I)

Next

' Error handler

Exit Sub

ErrorHandler:

HandleError "CheckGuilds", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Add/Declare in Public Sub DrawPlayer


Dim X2 As Long, Y2 As Long

If have problems with TempPlayer, Replace all code with this:


GuildString = Player(Index).GuildName

X2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18

Y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)

If Not Player(Index).GuildName = vbNullString Then

RenderTexture Tex_Guild(Player(Index).GuildLogo), X2, Y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)

End If

SERVER SIDE

below this in ModConstant

Public Const ITEM_TYPE_SPELL As Byte = 7

Add this

Public Const ITEM_TYPE_LOGO_GUILD As Byte = 8

Good Luck!

Looks cool something like this was on my todo list, except I wanted to make a little painter tool ingame instead of uploading images, added it to theadditions section of my thread tho =).

thanks but i have this guild system :(… problem is in this system

–------------------

Error1:

Call CheckGuild Error Sub or Function

Error 2:

TempPlayer Error Sub or Function


CLIENT SIDE

i fix, nice system :)

add in modDatabase:


Public Sub CheckGuilds()

Dim I As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo ErrorHandler

I = 1

NumGuilds = 1

ReDim Tex_Guild(1)

While FileExist(GFX_PATH & "guilds\" & I & GFX_EXT)

	 ReDim Preserve Tex_Guild(NumGuilds)

	 NumTextures = NumTextures + 1

	 ReDim Preserve gTexture(NumTextures)

	 Tex_Guild(NumGuilds).filepath = App.Path & GFX_PATH & "guilds\" & I & GFX_EXT

	 Tex_Guild(NumGuilds).Texture = NumTextures

	 NumGuilds = NumGuilds + 1

	 I = I + 1

Wend

NumGuilds = NumGuilds - 1

If NumGuilds = 0 Then Exit Sub

For I = 1 To NumGuilds

	 LoadTexture Tex_Guild(I)

Next

' Error handler

Exit Sub

ErrorHandler:

HandleError "CheckGuilds", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Add/Declare in Public Sub DrawPlayer


Dim X2 As Long, Y2 As Long

If have problems with TempPlayer, Replace all code with this:


GuildString = Player(Index).GuildName

X2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18

Y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)

If Not Player(Index).GuildName = vbNullString Then

RenderTexture Tex_Guild(Player(Index).GuildLogo), X2, Y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)

End If

SERVER SIDE

below this in ModConstant

Public Const ITEM_TYPE_SPELL As Byte = 7

Add this

Public Const ITEM_TYPE_LOGO_GUILD As Byte = 8

Good Luck!

this tutorial should be done only after doing the refrence tutorial give by the OP.

thanks but i have this guild system :(… problem is in this system

–------------------

Error1:

Call CheckGuild Error Sub or Function

Error 2:

TempPlayer Error Sub or Function


CLIENT SIDE

i fix, nice system :)

add in modDatabase:


Public Sub CheckGuilds()

Dim I As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo ErrorHandler

I = 1

NumGuilds = 1

ReDim Tex_Guild(1)

While FileExist(GFX_PATH & "guilds\" & I & GFX_EXT)

	 ReDim Preserve Tex_Guild(NumGuilds)

	 NumTextures = NumTextures + 1

	 ReDim Preserve gTexture(NumTextures)

	 Tex_Guild(NumGuilds).filepath = App.Path & GFX_PATH & "guilds\" & I & GFX_EXT

	 Tex_Guild(NumGuilds).Texture = NumTextures

	 NumGuilds = NumGuilds + 1

	 I = I + 1

Wend

NumGuilds = NumGuilds - 1

If NumGuilds = 0 Then Exit Sub

For I = 1 To NumGuilds

	 LoadTexture Tex_Guild(I)

Next

' Error handler

Exit Sub

ErrorHandler:

HandleError "CheckGuilds", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

Add/Declare in Public Sub DrawPlayer


Dim X2 As Long, Y2 As Long

If have problems with TempPlayer, Replace all code with this:


GuildString = Player(Index).GuildName

X2 = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).xOffset + (PIC_X \ 2) - (getWidth(Font_Default, (Trim$(GuildString))) / 2) - 18

Y2 = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).yOffset - (Tex_Character(GetPlayerSprite(Index)).Height / 4)

If Not Player(Index).GuildName = vbNullString Then

RenderTexture Tex_Guild(Player(Index).GuildLogo), X2, Y2, 0, 0, 16, 16, 16, 16, D3DColorRGBA(255, 255, 255, 200)

End If

SERVER SIDE

below this in ModConstant

Public Const ITEM_TYPE_SPELL As Byte = 7

Add this

Public Const ITEM_TYPE_LOGO_GUILD As Byte = 8

Good Luck!

cool thank’s for fix this

Hey Guys!, in my project this is a problem : /

" http://imageshack.com/a/img854/2862/1br4.jpg "

how to fix ? give’m light plz… i tested change that for other “getplayer” or “TempPlayer” but, not compiled :xxx 'm “newbie” at this

Thax ^-^ - Grateful already

I think it is because you put that code in “drawnpc” and not “drawplayer”

Log in to reply