Jump to content

Open Tibia Framework


Administrador

Recommended Posts

  • Administrador

 

OTF

 

 

Créditos: https://github.com/Mignari

 

 

Baixar

 

 

open-tibia-master.zip

 

 

 

 

 

1.0 - Um controle para mostrar a lista de sprites.

 

 

control1.png

 

 

 

 

 

 

 

1.1 - Um controle que mostra minimap e cores de luz

 

 

control2.png

 

 

 

 

 

 

 

1.2 - Um controle que mostra cores de outfits

 

 

control3.png

 

 

 

 

 

 

 

XML Exemplo de Formato

 

 


<versions>

<version value="1079" description="Client 10.79" dat="3A71" spr="557A5E34" otb="56" />

</versions>

 

 

 

 

Código

 

 


// path to the versions xml file.

string path = @"versions.xml";

 

// creates a VersionStorage instance.

OpenTibia.Core.VersionStorage versions = new OpenTibia.Core.VersionStorage();

 

// loads the xml

versions.Load(path);

 

// gets a version from the storage by the signatures.

OpenTibia.Core.Version version = versions.GetBySignatures(0x3A71, 0x557A5E34);

 

// gets all versions 10.79

System.Collections.Generic.List<OpenTibia.Core.Version> result = versions.GetByVersionValue(1079);

 

// adds a new version.

versions.AddVersion(new OpenTibia.Core.Version(1078, "Client 10.78", 0x39CC, 0x554C7373, 56));

 

// replaces a version by the signatures.

versions.ReplaceVersion(new OpenTibia.Core.Version(1078, "My description 10.78", 0x39CC, 0x554C7373, 56), 0x39CC, 0x554C7373);

 

// removes a version by the signatures.

versions.RemoveVersion(0x39CC, 0x554C7373);

 

// saves the xml.

versions.Save();

 

 

 

 

 

Carregando e compilando um arquivo SPR

 

 


// creates a Version 10.79.

OpenTibia.Core.Version version = new OpenTibia.Core.Version(1079, "Client 10.79", 0x3A71, 0x557A5E34, 0);

 

// the path to the spr file.

string path = @"C:\Clients\10.79\Tibia.spr";

 

// loads the spr file.

OpenTibia.Client.Sprites.SpriteStorage sprites = OpenTibia.Client.Sprites.SpriteStorage.Load(path, version);

 

// gets a sprite from the storage

OpenTibia.Client.Sprites.Sprite sprite = sprites.GetSprite(100);

 

// adding a sprite.

sprites.AddSprite(new OpenTibia.Client.Sprites.Sprite());

 

// replacing a sprite.

sprites.ReplaceSprite(new OpenTibia.Client.Sprites.Sprite(), 12);

 

// removing a sprite.

sprites.RemoveSprite(10);

 

// compiles the spr file.

sprites.Save();

 

 

 

 

Carregando e mostrando Sprites

 

 


// Assuming that you have a SpriteListBox named 'spriteListBox' in the form.

 

// creates a Version 10.79.

OpenTibia.Core.Version version = new OpenTibia.Core.Version(1079, "Client 10.79", 0x3A71, 0x557A5E34, 0);

 

// the path to the spr file.

string path = @"C:\Clients\10.79\Tibia.spr";

 

// loads the spr file.

OpenTibia.Client.Sprites.SpriteStorage sprites = OpenTibia.Client.Sprites.SpriteStorage.Load(path, version);

 

// gets 100 sprites from the storage and displays in the SpriteListBox

OpenTibia.Client.Sprites.Sprite[] list = new OpenTibia.Client.Sprites.Sprite[100];

 

for (uint i = 0; i < list.Length; i++)

{

list = sprites.GetSprite(i);

}

 

this.spriteListBox.AddRange(list);

 

 

 

control1.png.032f80b17a1bc23aa34befc6754a1a5a.png

control2.png.a0972937ac034d7384d4a84a6837d698.png

control3.png.61f7553b62afc9787785d515bb19348b.png

open-tibia-master.zip

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...