Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Editing data.enc

Newbie Spellweaver
Joined
Jul 31, 2013
Messages
99
Reaction score
2
Can someone pass me the link of any tutorial of how to edit the data.enc? or explain me? Thank you.
 
Junior Spellweaver
Joined
Jan 16, 2014
Messages
150
Reaction score
189
//--------------------------------------##
// Game: CABAL Online
// File Format: Data.ENC
// Description: Adds a text entry and adjusts the chunk size accordingly.
//--------------------------------------##
// Author: Yamachi
// Team: Forge
// Website:
//--------------------------------------##

Assert(exists(estType), "No template results found. Please run the appropriate template before attempting to run this script again.");
Assert(estType == "Data.ENC", "File format not supported.");

int chunk = InputNumber("Please choose the chunk to add a text entry to.", "Chunk (1 = EFX, 2 = WAV):", "1");
Assert(chunk != BAD_VALUE, "No chunk was selected.");
Assert(0 < chunk < 3, "Invalid chunk specified.");

string entry = InputString("Please provide the text to insert.", "Text:", "");
Assert(entry != "", "No text specified.");

int64 start;

if (chunk == 1) {
start = startof(WAV);
} else {
start = FileSize();
}

InsertBytes(start, 2 + Strlen(entry));
WriteShort(start, Strlen(entry));
WriteString(start + 2, entry);

if (chunk == 1) {
EFX.chunk_size += Strlen(entry);
} else {
WAV.chunk_size += Strlen(entry);
}

// Refresh
RunTemplate("Cabal_data.enc.bt");
 
Last edited:
Upvote 0

eci

Experienced Elementalist
Joined
Sep 20, 2013
Messages
229
Reaction score
195
Code:
//--------------------------------------##
// Game: CABAL Online
// File Format: Data.ENC
// Description: Adds a text entry and adjusts the chunk size accordingly.
//--------------------------------------##
// Author: Yamachi
// Team: Forge
// Website: http://forge-dev.com
//--------------------------------------##

Assert(exists(estType), "No template results found.  Please run the appropriate template before attempting to run this script again.");
Assert(estType == "Data.ENC", "File format not supported.");

int chunk = InputNumber("Please choose the chunk to add a text entry to.", "Chunk (1 = EFX, 2 = WAV):", "1");
Assert(index != BAD_VALUE, "No chunk was selected.");
Assert(0 < index < 3, "Invalid chunk specified.");

string entry = InputString("Please provide the text to insert.", "Text:", "");
Assert(entry != "", "No text specified.");

int64 start;

if (chunk == 1) {
    start = startof(WAV);
} else {
    start = FileSize();
}

InsertBytes(start, 2 + Strlen(entry));
WriteShort(start, Strlen(entry));
WriteString(start + 2, entry);

if (chunk == 1) {
    EFX.chunk_size += 2 + Strlen(entry);
} else {
    WAV.chunk_size += 2 + Strlen(entry);
}

// Refresh
RunTemplate("Cabal_data.enc.bt");

I will try it later :)
 
Upvote 0
Joined
May 21, 2011
Messages
418
Reaction score
73
I know how to use it, I know it does with data.enc because I ran this script and gave an error
ran the usual script data.enc and then ran this script and gave the error
 
Upvote 0
Junior Spellweaver
Joined
Jan 16, 2014
Messages
150
Reaction score
189
I know how to use it, I know it does with data.enc because I ran this script and gave an error
ran the usual script data.enc and then ran this script and gave the error

What was the error? I don't have any Cabal clients installed, so I was unable to test the script.

EDIT: Fixed the script... I overlooked some variable names when I copy-pasted >_>
 
Last edited:
Upvote 0
Joined
Aug 3, 2011
Messages
963
Reaction score
506
//--------------------------------------##
// Game: CABAL Online
// File Format: Data.ENC
// Description: Adds a text entry and adjusts the chunk size accordingly.
//--------------------------------------##
// Author: Yamachi
// Team: Forge
// Website:
//--------------------------------------##

Assert(exists(estType), "No template results found. Please run the appropriate template before attempting to run this script again.");
Assert(estType == "Data.ENC", "File format not supported.");

int chunk = InputNumber("Please choose the chunk to add a text entry to.", "Chunk (1 = EFX, 2 = WAV):", "1");
Assert(chunk != BAD_VALUE, "No chunk was selected.");
Assert(0 < chunk < 3, "Invalid chunk specified.");

string entry = InputString("Please provide the text to insert.", "Text:", "");
Assert(entry != "", "No text specified.");

int64 start;

if (chunk == 1) {
start = startof(WAV);
} else {
start = FileSize();
}

InsertBytes(start, 2 + Strlen(entry));
WriteShort(start, Strlen(entry));
WriteString(start + 2, entry);

if (chunk == 1) {
EFX.chunk_size += Strlen(entry);
} else {
WAV.chunk_size += Strlen(entry);
}

// Refresh
RunTemplate("Cabal_data.enc.bt");

This script perfectly worked. Just notice on my first error. Cabal_data.enc.bt and this script should be on the same folder to avoid error cause of this function.
// Refresh
RunTemplate("Cabal_data.enc.bt")

Just FYI for the others :)
 
  • Like
Reactions: eci
Upvote 0
Joined
May 21, 2011
Messages
418
Reaction score
73
error when trying to use this script

I solved the error was because I was running as template had not noticed that it was supposed to run as script thanks for this script
 
Last edited:
Upvote 0
Elite Diviner
Joined
Nov 13, 2015
Messages
463
Reaction score
19
//--------------------------------------##
// Game: CABAL Online
// File Format: Data.ENC
// Description: Adds a text entry and adjusts the chunk size accordingly.
//--------------------------------------##
// Author: Yamachi
// Team: Forge
// Website:
//--------------------------------------##

Assert(exists(estType), "No template results found. Please run the appropriate template before attempting to run this script again.");
Assert(estType == "Data.ENC", "File format not supported.");

int chunk = InputNumber("Please choose the chunk to add a text entry to.", "Chunk (1 = EFX, 2 = WAV):", "1");
Assert(chunk != BAD_VALUE, "No chunk was selected.");
Assert(0 < chunk < 3, "Invalid chunk specified.");

string entry = InputString("Please provide the text to insert.", "Text:", "");
Assert(entry != "", "No text specified.");

int64 start;

if (chunk == 1) {
start = startof(WAV);
} else {
start = FileSize();
}

InsertBytes(start, 2 + Strlen(entry));
WriteShort(start, Strlen(entry));
WriteString(start + 2, entry);

if (chunk == 1) {
EFX.chunk_size += Strlen(entry);
} else {
WAV.chunk_size += Strlen(entry);
}

// Refresh
RunTemplate("Cabal_data.enc.bt");

thanks! script worked but after more lines like 2513 it will give me char text[length]; and can't do adding anymore, error continues pop-up
 
Upvote 0
Back
Top