Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/10/12 in all areas

  1. Map of the week //===== rAthena Script ====================================================================== //= Map Of The Week v4.4 //===== Original By ========================================================================= //= Kaushik //===== Current Version: ==================================================================== //= 1.0 - Script Release. //= 1.1 - Added GM selection of Map Of The Week. //= 1.2 - Fixed Timer Selection of the Map is on Sunday @ 24:00 server time. //= 2.0 - Added Contract System. //= 2.1 - Fixed Contract Expiry (Set #MOTWC to 0 once contract is expired). //= 2.2 - Cleaned Script to remove some unneeded repertition and script. [ToastOfDoom] //= 2.3 - Added Bottle Grenade ingredients to the script as it was missed. //= 2.4 - Decreased the drop rate. //= 2.5 - Changed announce and dispbottom. //= 3.0 - Added Whisper Functions. (map, kills, contract, gm). //= 3.1 - Changed to dynamic Cost and Kills - @motwcost & @motwkill to your desired numbers. //= 3.2 - Added Menu To The NPC. //= 4.0 - Added GM commands to change random map, selected map & to Destroy all contracts. //= 4.1 - Removed SQL unwanted variable. //= 4.2 - Fixed script contract count variable. //= 4.3 - Fixed tweet to not give out contract if no map of the week is assigned. //= 4.4 - Fixed NPC Whisper //= 5.0 - Changed rewards to dynamic rewards [WIP]. //===== Compatible With: ==================================================================== //= Tested in SQL Revision 14435 //===== Description: ======================================================================== //= A Random Map Will be selected and edp, acid demo bottle ingredients are rewarded. //=========================================================================================== Features Selects a map every week in Prontera, Payon and Morroc Fields[Completed] Rewards given when killed a monster[Completed] Contract System[Completed] Limited Kills[Completed] Wisper System [Complete] Easy configuration of the Script[Complete] GM Commands[Complete] Changes Map Automatically Every Week[Completed] Rewards Can be set as required[Completed] Fun Unlimited[Completed] About: This script works like this after it selects a map by itself ( can change the time to test in the script search for OnClock) this map becomes map of the week and when u kill any monster in this map on random chances you get a reward which is also set in the script. Also there is a special function in this script it doesnt work for everyone a player has to first sign the Contract i.e he has to pay 200000Zeny for killing 10000 Monsters i.e after he kills 10000 monsters he wont be able to get any kind of rewards from that Map which is map of the week and it will be a normal map.. So if he needs to get rewards again he has to buy the contract again. Give reviews to motivate motw_v4.4.txt motw_v4.1.txt motw_v4.2.txt
    2 points
  2. Einige Leute von euch kennen das Script schon, hier einmal eine variante um die configuraton und Installation ein wenig zu Automatisieren. Die Datei einfach Speichern Unter... " rathena.sh " speichern, auf den server laden und mit chmod +x rathena.sh via console die nötigen rechte verpassen. #!/bin/bash echo "Installation starten." apt-get -y update apt-get -y install gcc apt-get -y install g++ apt-get -y install c++ apt-get -y install gpp apt-get -y install subversion apt-get -y install subversion-tools apt-get -y install libpcre++0 apt-get -y install libpcrecpp0 apt-get -y install mysql-server-5.1 apt-get -y install mysql-common apt-get -y install zlibc apt-get -y install zlib1g apt-get -y install zlib1g-dev apt-get -y install unrar echo "Benutzeraccount anlegen" read userna useradd -d /home/$userna/ -m $userna passwd $userna chown -R $userna /home/$userna/ echo "Benutzer angelegt";; echo "Verzeichnis wechseln";; cd /home/$userna/ echo "eAthena Download starten" svn co https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/ echo "rAthena Tunk geladen" cd /home/$userna/trunk echo "Projektdatein entfernen" rm -Rf *.sln *.bat *.dll *.dsw vcproj-6 vcproj-7.1 vcproj-8 vcproj-9 echo "Starte server installation" chmod 770 configure && ./configure echo "Nicht Vergessen, die rAthena Configs nach belieben an zu passen." echo "version 0.1 (c) by gomen" sleep 10
    2 points
  3. I looked and looked and it didn't seem like there was a post for this! If I'm wrong, I apologize! I figured it'd be neat to do a post your picture thread, so we can all look at eachother's mugs and make fun of eachother. Anyway, here's a picture from my wedding!
    1 point
  4. First, let me start off by saying.. I can't make new topics under the Source Discussion.. so I'm sorry for making a new topic here.. Anyways, although we're going Renewal, have you guys talked to Epoque for implementing his 50 new Item Bonuses into the new Revisions? Since Epoque already released them publicly to everyone on eAthena, I don't think it'll be bad if you guys actually implement these item bonuses into the new rAthena SVNs. -----> http://www.eathena.w...3&hl=repository Credits: Epoque of course. I wanted to add this topic under the suggestions but it doesnt go under Wiki or forum wise D: Once again! Im sorry for posting here D:!
    1 point
  5. With this modification you will have a new chat, like @main for another purposes. In this example I use @trading as an example. 1 -> Open src/map/atcommand.c and find: if(sd->state.mainchat) clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>. else clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>. } return 0; } Add below it: /*=================================== * Trading chat chat [darkmeistersp] * Usage: @trading <on|off|message> *-----------------------------------*/ ACMD_FUNC(trading) { if( message[0] ) { if(strcmpi(message, "on") == 0) { if(!sd->state.tradingchat) { sd->state.tradingchat = 1; clif_displaymessage(fd, msg_txt(950)); // trading chat has been activated. } else { clif_displaymessage(fd, msg_txt(951)); // trading chat already activated. } } else if(strcmpi(message, "off") == 0) { if(sd->state.tradingchat) { sd->state.tradingchat = 0; clif_displaymessage(fd, msg_txt(952)); // trading chat has been disabled. } else { clif_displaymessage(fd, msg_txt(953)); // trading chat already disabled. } } else { if(!sd->state.tradingchat) { sd->state.tradingchat = 1; clif_displaymessage(fd, msg_txt(950)); // trading chat has been activated. } if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) { clif_displaymessage(fd, msg_txt(957)); return -1; } sprintf(atcmd_output, msg_txt(956), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // trading chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0); } } else { if(sd->state.tradingchat) clif_displaymessage(fd, msg_txt(954)); // trading chat currently enabled. Usage: @trading <on|off>, @trading <message>. else clif_displaymessage(fd, msg_txt(955)); // trading chat currently disabled. Usage: @trading <on|off>, @trading <message>. } return 0; } Then you need to find this: { "font", 1,1, atcommand_font }, And add below it: { "trading", 1,1, atcommand_trading }, //[darkmeistersp] Save this file. 2-> Open src/map/clif.c and find: case CHAT_MAINCHAT: //[LuzZza] iter = mapit_getallusers(); while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) { if( tsd->state.mainchat && tsd->chatID == 0 && packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version WFIFOHEAD(tsd->fd, len); memcpy(WFIFOP(tsd->fd,0), buf, len); WFIFOSET(tsd->fd,len); } } mapit_free(iter); break; Add below it: case CHAT_TRADINGCHAT: //[darkmeistersp] iter = mapit_getallusers(); while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) { if( tsd->state.tradingchat && tsd->chatID == 0 && packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version WFIFOHEAD(tsd->fd, len); memcpy(WFIFOP(tsd->fd,0), buf, len); WFIFOSET(tsd->fd,len); } } mapit_free(iter); break; Now find this in the same file: WBUFW(buf,0)=0x8d; WBUFW(buf,2)=len+8; WBUFL(buf,4)=0; safestrncpy((char *) WBUFP(buf,8),message,len); clif_send(buf,WBUFW(buf,2),NULL,CHAT_MAINCHAT); } And add below it: /*========================================== * Send trading chat message [darkmeistersp] *------------------------------------------*/ void clif_TradingChatMessage(const char* message) { char buf[200]; int len; if(!message) return; len = strlen(message)+1; if (len+8 > sizeof(buf)) { ShowDebug("clif_TradingChatMessage: Received message too long (len %d): %sn", len, message); len = sizeof(buf)-8; } WBUFW(buf,0)=0x8d; WBUFW(buf,2)=len+8; WBUFL(buf,4)=0; strncpy((char *) WBUFP(buf,8),message,len); clif_send((unsigned char *) buf,WBUFW(buf,2),NULL,CHAT_TRADINGCHAT); } Now find the next code: // Chat logging type 'M' / Main Chat if( log_config.chat&1 || (log_config.chat&32 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("M", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); return; } And add below it: // Trading chat [darkmeistersp] if(strcmpi(target, trading_chat_nick) == 0) { if(!sd->state.tradingchat) clif_displaymessage(fd, msg_txt(958)); // You should enable trading chat with "@trading on" command. else { char output[256]; snprintf(output, ARRAYLENGTH(output), msg_txt(956), sd->status.name, message); intif_broadcast2(output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0); } } Save this file. 3-> Open src/map/clif.h and find this: CHAT_MAINCHAT, // everyone on main chat Add below it: CHAT_TRADINGCHAT, //[darkmeistersp] In the same file find this line: void clif_MainChatMessage(const char* message); //luzza And add below it: void clif_TradingChatMessage(const char* message); //[darkmeistersp] Save this file. 4-> Open src/map/map.c and find this: char main_chat_nick[16] = "Main"; Add below this: char trading_chat_nick[16] = "Trading"; //[darkmeistersp] In the same file find: if(strcmpi(w1, "main_chat_nick")==0) safestrncpy(main_chat_nick, w2, sizeof(main_chat_nick)); And add below it: if(strcmpi(w1, "trading_chat_nick")==0) //[darkmeistersp] safestrncpy(trading_chat_nick, w2, sizeof(trading_chat_nick)); Save this file. 5 -> Now open src/map/map.h and find: extern char main_chat_nick[16]; Add below it: extern char trading_chat_nick[16]; //[darkmeistersp] Save this file 6 -> Open src/map/pc.h and find: unsigned int mainchat :1; //[LuzZza] And add below it: unsigned int tradingchat :1; //[darkmeistersp] Save this file. 7 -> Open src/char/char.c and find: // check for reserved names if( strcmpi(name, main_chat_nick) == 0 || strcmpi(name, wisp_server_name) == 0 ) return -1; // nick reserved for internal server messages Replace it with: // check for reserved names if( strcmpi(name, main_chat_nick) == 0 || strcmpi(name, wisp_server_name) == 0 || strcmpi(name, trading_chat_nick) == 0) //[darkmeistersp] return -1; // nick reserved for internal server messages Save this file. 8-> Open src/char/inter.c and find: char main_chat_nick[16] = "Main"; Add below it: char trading_chat_nick[16] = "Trading"; //[darkmeistersp] Now find this in the same file: } else if(strcmpi(w1, "main_chat_nick")==0){ // Main chat nick [LuzZza] safestrncpy(main_chat_nick, w2, sizeof(main_chat_nick)); And add below it: } else if(strcmpi(w1, "trading_chat_nick")==0){ // trading chat nick [darkmeistersp] safestrncpy(trading_chat_nick, w2, sizeof(trading_chat_nick)); Save this file. 9-> Open src/char/inter.h and find: ​extern char main_chat_nick[16]; Add below it: extern char trading_chat_nick[16]; //[darkmeistersp] Save this file. 10-> Repeat the steps 7, 8 and 9 with the files char.c, inter.c and inter.h that are located in src/char_sql/ 11-> Open conf/msg_athena.conf and add at the end of the file: 950: Trading chat has been activated. 951: Trading chat already activated. 952: Trading chat has been disabled. 953: Trading chat already disabled. 954: Trading chat is currently enabled. Usage: @trading <on|off>, @trading <message>. 955: Trading chat is currently disabled. Usage: @trading <on|off>, @trading <message>. 956: %s :Trading: %s 957: You cannot use Trading chat while muted. 958: You should enable trading chat with "@trading on" command. Save this file. 12 -> Open conf/inter_athena.conf and find this: // Nick for sending mainchat // messages like whisper main_chat_nick: Main Add below it: // Nick trading chat [darkmeisterp] sell_chat_nick: trading Save this file. 13 -> Open conf/atcommand_athena.conf and add at the end of the file: //Trading chat trading: 1,1 That´s all. Now you must compile your server and your new chat is ready! Here you have the diff for this mod. Enjoy it! newchat.patch
    1 point
  6. On the Internet it is impossible to find a description of the format of this file type, namely Gravity Patch File. In developing KPatcher I gathered enough information that you could share it with the community. To simplify the writing and understanding of the text, we introduce a small definition for all GRF/GPF files and we will call them shortly - container. Version of the containers differ only by the methods encrypt the content. In his description, I will talk only about 0x200 version container. The description also is present code in C/C++ examples. So let's begin. To start analyze a simplified structure of the container: 1) Cap the container in which to store the number of files in a container, a compressed file table address container, the container version and a bit of official information; 2) The table container file contains the file name, file size, the compressed file size, compressed file size is aligned, the file position in the container and the attributes of a file in a container; 3) Compressed files. All this can be described as structures of the C/C++ To cap structure is as follows: struct grf_header { char Magic [16]; /// "Master of Magic" +\0 char Key [14]; /​​// 0x01 -&gt; 0x0E, or 0x00 -&gt; 0x00 (no encryption) uint32_t FileTableOffset; /// The location of the file table uint32_t Seed; /// What is the value of randomly uint32_t FilesCount; /// The actual number of files = FilesCount - Seed - 7 uint32_t Version; /// GRF file version: 0x102, 0x103, 0x200 }; We analyze this structure in more detail: 1) Magic [16] - an identifier that indicates the program running with a container that is in front of her GRF/GPF container, the keyword "Master of Magic"; 2) Key [14] - a key that tells what the data inside the container encryption, obsolete value is not used; 3) FileTableOffset - well, everything is clear, there is stored the offset location of the file table, I want to see that all the specified offset is not the beginning of the file, and the end cap of the container which is equal to 'sizeof (grf_header)' or 46; 4) Seed - a value that randomly invented by Koreans do not know why, probably used in conjunction with Key [14] in earlier versions of the container to protect the information inside the container, which is obsolete value is always 0; 5) FilesCount - the number of files in the container, this value is not absolute, but a bit distorted. The actual value can be obtained by doing a simple mathematical operation RealFilesCount = FilesCount - Seed - 7; 6) Version - this is how it was not hard to guess, the version container. Now, using this knowledge, try to read this information from any arbitrary container. To do this, I will use the programming language C/C++ #include <...> #include <...> #include <...> # Pragma pack (push, 1) /// Align in-memory structure of 1 byte struct grf_header { char Magic [16]; /// "Master of Magic" +\0 char Key [14]; /// 0x01 -&gt; 0x0E, or 0x00 -&gt; 0x00 (no encryption) uint32_t FileTableOffset; /// The location of the file table uint32_t Seed; /// What is the value of randomly uint32_t FilesCount; /// The actual number of files = FilesCount - Seed - 7 uint32_t Version; /// GRF file version: 0x102, 0x103, 0x200 }; # Pragma pack (pop) # Define GRF_HEADER "Master of Magic" # Define GRF_HEADER_SIZE 46 int main () { FILE * FD = NULL; struct grf_header Header = {0}; uint32_t RealFilesCount = 0; FD = fopen ("data.grf", "rb"); /// Read the header container fread (&amp; Header, GRF_HEADER_SIZE, 1, FD); /// Check if this is a GRF/GPF container or not if (strncmp (Header.Magic, GRF_HEADER, 16) { return 0; } /// Now the structure is stored Header informations about current container /// And can easily access them /// The variable is now RealFilesCount the actual number of files in a container /// On this can start reading the information about files RealFilesCount = Header.FilesCount - Header.Seed - 7; return 0; } In this example, I make out the structure of GRF/GPF files and shows how to use the C/C++, you can determine that this is the GRF/GPF file, which version of the file and how many files are contained in this container. And so, to deal with the basic description of the container and having considered the example of obtaining information about the container down to work with the data container. The first thing to get a table with data in the file container. Fully describe the entire structure of the table files can be very simple: table: [<zsize>. l <size>. l [<fname>. s <fentry> .17 b] *] fentry: [<zsize>. l <zsizeal>. l <size>. l <flags>. b <offset>. l] .17 b From this simple circuit structure is visible to full data is located on the very structure of the file table and file table With this information, can easily get information about all files stored in the container. Table with a container files can also be described as a structure: struct grf_fentry { uint32_t zSize; /// Size of packed data uint32_t zSizeAl; /// The same thing only with alignment uint32_t Size; /// Size of uncompressed data uint8_t Flags; /// Flag file (GRF_FLAG_FILE, GRF_FLAG_MIXCRYPT, GRF_FLAG_DES) uint32_t Offset; /// offset into the GRF file (starts immediately after grf_header) }; Describe in detail the structure, I will not, in the comments should explain everything quite clear. #include <...> #include <...> #include <...> .................................................. ................. int main () { .................................................. ......... uint8_t * pBuffer = NULL, * pZBuffer = NULL; uint32_t TableSize = 0, zTableSize = 0; /// Move the file pointer at the beginning of the file table fseek (FD, FileTableOffset + GRF_HEADER_SIZE, SEEK_SET); /// Read compressed and the actual size of the MFT if (! fread (&amp; zTableSize, 4, 1, FD) | |! fread (&amp; TableSize, 4, 1, FD)) { return 0; } /// Allocate the necessary memory volume and read the file table pBuffer = new uint8_t [TableSize]; pZBuffer = new uint8_t [zTableSize]; if (! fread (pZBuffer, zTableSize, 1, FD)) { delete [] pBuffer, delete [] pZBuffer; return 0; } /// Extract the file table /// If you want to use the code presented here will have to connect the library zlib /// This function is part of GrfLib for KPatcher /// The variable pBuffer now stored unpacked and ready to read the file table if (zio:: zlib_uncompress (pBuffer, TableSize, pZBuffer, zTableSize)! = TableSize) { delete [] pBuffer, delete [] pZBuffer; return 0; } delete [] pZBuffer; return 0; } We now have a fully ready to read the file table. Now it remains the case for small, properly read and write to it, we will write to the memory of which optionally can be written to a file. For that would work with the data it was convenient to define another structure that will remind you what struct grf_fentry, but will carry more useful information: struct _FileNode { std:: string FileName; /// File Name uint32_t NameHash; /// Hash the file name uint32_t FileOffset; /// file offset in a container uint32_t FileSize; /// Size uint32_t zFileSize; /// compressed file size uint32_t zFileSizeAl; /// compressed file size aligned uint8_t FileFlags; /// Flags file int32_t Cycle; /// Cycle (used for encrypted files) }; This structure can sozherzhat information about only one file, and must keep information about all files, but it requires some realties store, which will be convenient to work: typedef std:: list &lt;_FileNode&gt; _FilesList; Now that is all that is necessary, we can begin reading the information about files #include <...> #include <...> #include <...> .................................................. ................. .................................................. ................. struct grf_fentry { uint32_t zSize; /// Size of packed data uint32_t zSizeAl; /// The same thing only with alignment uint32_t Size; /// Size of uncompressed data uint8_t Flags; /// Flag file (GRF_FLAG_FILE, GRF_FLAG_MIXCRYPT, GRF_FLAG_DES) uint32_t Offset; /// offset into the GRF file (starts immediately after grf_header) }; # Define GRF_TABLE_SIZE 17 # Define GRF_FLAG_FILE a # Define GRF_FLAG_MIXCRYPT 2 # Define GRF_FLAG_DES 4 struct _FileNode { std:: string FileName; /// File Name uint32_t NameHash; /// Hash the file name uint32_t FileOffset; /// file offset in a container uint32_t FileSize; /// Size uint32_t zFileSize; /// compressed file size uint32_t zFileSizeAl; /// compressed file size aligned uint8_t FileFlags; /// Flags file int32_t Cycle; /// Cycle (used for encrypted files) }; typedef std:: list &lt;_FileNode&gt; _FilesList; int main () { .................................................. ......... .................................................. ......... _FilesList FilesList; for (uint32_t Offset = 0; Offset <tablesize;) {="" get="" the="" file="" name="" length="" size_t="" fn_size="strlen" ((char="" *)="" (pbuffer="" +="" offset));="" if="" (fn_size=""> = 0x100) { delete [] pBuffer; return 0; } grf_file_table FileEntry = {0}; /// Get a pointer to the file name char * FileName = (char *) (pBuffer + Offset); Offset + = FN_Size + 1; /// Get the file information memcpy (&amp; FileEntry, (pBuffer + Offset), GRF_TABLE_SIZE); Offset + = GRF_TABLE_SIZE; /// Skip the directories and files whose size is equal to 0 if (! (FileEntry.Flags &amp; GRF_FLAG_FILE) | | FileEntry.Size == 0) continue; /// Fill the structure with the file information _FileNode Node; Node.FileName.append (FileName, FN_Size); Node.FileFlags = FileEntry.Flags; Node.NameHash = zio:: zlib_crc32 (FileName, FN_Size); Node.FileOffset = FileEntry.Offset; Node.FileSize = FileEntry.Size; Node.zFileSize = FileEntry.zSize; Node.zFileSizeAl = FileEntry.zSizeAl; Node.Cycle = -1; /// Get the information needed to decrypt the file if (Node.FileFlags &amp; GRF_FLAG_MIXCRYPT) { Node.Cycle = 1; for (uint32_t i = 10; Node.zFileSize&gt; = i; i = i * 10) Node.Cycle + +; } if (Node.FileFlags &amp; GRF_FLAG_DES) Node.Cycle = 0; /// Add all the information on file in the repository. FilesList.push_back (Node); } return 0; } Now, the variable contains FilesList informations about each file in the container and can easily burn any data to a file. Now we can unite all that is written above together and we get: #include <stdio.h> #include <string.h> #include <string> #include <list> #include <stdint.h> #include <zlib.h> using namespace std; #pragma pack(push, 1) /// Align in-memory structure of 1 byte struct grf_header { char Magic[16]; /// "Master of Magic" +\0 char Key[14]; /// 0x01 -> 0x0E, or 0x00 -> 0x00 (no encryption) uint32_t FileTableOffset; /// The location of the file table uint32_t Seed; /// What is the value of randomly uint32_t FilesCount; /// The actual number of files = FilesCount - Seed - 7 uint32_t Version; /// GRF file version: 0x102, 0x103, 0x200 }; #pragma pack(pop) #define GRF_HEADER "Master of Magic" #define GRF_HEADER_SIZE 46 #pragma pack(push, 1) /// Align in-memory structure of 1 byte struct grf_fentry { uint32_t zSize; /// Size of packed data uint32_t zSizeAl; /// The same thing only with alignment uint32_t Size; /// Size of uncompressed data uint8_t Flags; /// Flag file (GRF_FLAG_FILE, GRF_FLAG_MIXCRYPT, GRF_FLAG_DES) uint32_t Offset; /// offset into the GRF file (starts immediately after grf_header) }; #pragma pack(pop) #define GRF_TABLE_SIZE 17 #define GRF_FLAG_FILE 1 #define GRF_FLAG_MIXCRYPT 2 #define GRF_FLAG_DES 4 struct _FileNode { std::string FileName; /// File Name uint32_t NameHash; /// Hash the file name uint32_t FileOffset; /// file offset in a container uint32_t FileSize; /// Size uint32_t zFileSize; /// compressed file size uint32_t zFileSizeAl; /// compressed file size aligned uint8_t FileFlags; /// Flags file int32_t Cycle; /// Cycle (used for encrypted files) }; typedef std::list <_FileNode> _FilesList; int main() { /// Some declarations FILE *FD = NULL; struct grf_header Header; uint32_t RealFilesCount = 0; uint8_t * pBuffer = NULL, * pZBuffer = NULL; uint32_t TableSize = 0, zTableSize = 0; _FilesList FilesList; FD = fopen("naoro.grf", "rb"); fread(&Header, GRF_HEADER_SIZE, 1, FD); if ( strncmp(Header.Magic, GRF_HEADER, 16) ) return 0; /// Now the structure is stored Header informations about current container /// And can easily access them /// The variable is now RealFilesCount the actual number of files in a container /// On this can start reading the information about files RealFilesCount = Header.FilesCount - Header.Seed - 7; /// Move the file pointer at the beginning of the file table fseek(FD, Header.FileTableOffset + GRF_HEADER_SIZE, SEEK_SET); /// Read compressed and the actual size of the MFT if ( !fread (&zTableSize, 4, 1, FD) || !fread (&TableSize, 4, 1, FD) ) { return 0; } /// Allocate the necessary memory volume and read the file table pBuffer = new uint8_t [TableSize]; pZBuffer = new uint8_t [zTableSize]; if( !fread (pZBuffer, zTableSize, 1, FD) ) { delete [] pBuffer, delete [] pZBuffer; return 0; } fclose(FD); /// Extract the file table /// If you want to use the code presented here will have to connect the library zlib /// This function is part of GrfLib for KPatcher /// The variable pBuffer now stored unpacked and ready to read the file table if ( uncompress((Bytef*)pBuffer, (uLongf*)&TableSize, (Bytef*)pZBuffer, zTableSize) != Z_OK ) { delete [] pBuffer, delete [] pZBuffer; return 0; } delete [] pZBuffer; for ( uint32_t Offset = 0; Offset < TableSize; ) { size_t FN_Size = strlen((char*)(pBuffer+Offset)); if ( FN_Size >= 0x100 ) { delete[] pBuffer; return 0; } grf_fentry FileEntry = {0}; /// Get a pointer to the file name char *FileName = (char*)(pBuffer+Offset); Offset += FN_Size + 1; /// Get the file information memcpy(&FileEntry, (pBuffer+Offset), GRF_TABLE_SIZE); Offset += GRF_TABLE_SIZE; /// Skip the directories and files whose size is equal to 0 if ( !(FileEntry.Flags&GRF_FLAG_FILE) || FileEntry.Size == 0 ) continue; /// Fill the structure with the file information _FileNode Node; Node.FileName.append(FileName, FN_Size); Node.FileFlags = FileEntry.Flags; Node.NameHash = crc32(0, (Bytef*)FileName, FN_Size); Node.FileOffset = FileEntry.Offset; Node.FileSize = FileEntry.Size; Node.zFileSize = FileEntry.zSize; Node.zFileSizeAl = FileEntry.zSizeAl; Node.Cycle = -1; /// Get the information needed to decrypt the file if ( Node.FileFlags&GRF_FLAG_MIXCRYPT ) { Node.Cycle = 1; for( uint32_t i = 10; Node.zFileSize >= i; i = i*10 ) Node.Cycle++; } if ( Node.FileFlags&GRF_FLAG_DES ) { Node.Cycle = 0; } /// Add all the information on file in the repository. FilesList.push_back(Node); } delete[] pBuffer; /// Creating empty file FD = fopen("files_list.txt", "w+"); _FilesList::iterator itr = FilesList.begin(); _FilesList::iterator itr_end = FilesList.end(); /// Fill the newly created file data. fprintf(FD, "FileName - FileSize - FilePos\n"); for ( ; itr != itr_end; itr++) fprintf(FD, "%s - %d - %d\n", itr->FileName.c_str(), itr->FileSize, itr->FileOffset+GRF_HEADER_SIZE); fclose(FD); return 0; } Fully working source code that reads the GRF/GPF file and prints the contents a file. main.rar
    1 point
  7. Figured I'd post it here too! A while ago there was a french website (i lost the link) that would organize your romodel.txt into categories so things were easier to find. Sadly, not all of us speak french. But I speak enough (and have help through google) to figure out what was what! This is sort of an old copy of romodel.txt, but its better than searching through endless amounts of gibberish. So here you go: Link Here All you need to do is copy paste it into your romodels.txt in your borf files and you'll be rearing to go. I've also uploaded my copy of romodels.txt to help you out if you can't figure it out romodels.txt
    1 point
  8. There is no other way - Gepard has already mentioned the only possible solution. Either use an existing anti-cheat-engine or get into programming and develop your own library.
    1 point
  9. Pues yo no creo que la sección hispana llegue a ningún sitio, es absurdo tener 2 comunidades hispanas del RO, no hay más que ver el número de post aquí y el número de redirecciones a DivineRO...
    1 point
  10. I greatly appriciate this forum come alive to support the making of private server of Renewal Ragnarok Online. I believe many of you reading this topic is Malaysian, Indonesian, Singaporean, and Brunei which Malay Language is part of your touge or it fluently spoken by you. To Admin: Please allow us to discuss in this topic in Malaysian / Indonesian language. Let say something useful.
    1 point
  11. @ Sanosol Lol that looks lol xD
    1 point
  12. Your method seems wrong, I think it would be easier to create new items for each refine level. And I'm sure the stackability is defined in the server Another method would be to change the type to be weapon with onequip to delete item, but that would make it in the wrong inventory section. The hex edit is quite advanced and to do this every client update would be a pain for anyone using this system Yom <3
    1 point
  13. its just the copy paste of the @main just change everything in main to smthing which you want....I had created @vending and @recruit....
    1 point
  14. Here: <?php /*SQL Configuration*/ $address = "localhost"; //Database Address $username = "root"; //Database Username $password = "root"; //Database Password $database = "test_3ceam"; //Database Name $connect = mysql_connect($address,$username,$password) or die("Cant connect to the database"); $select_db = mysql_select_db($database,$connect) or die("Failed to connect to the database"); /*SQL Query*/ $query = "SELECT * FROM `cp_news` ORDER BY modified DESC"; $sql = mysql_query($query) or die("Failed to make select query command"); ?> <html> <head> <title>Notice</title> <style type="text/css"> body { margin:0px; font-family:Arial,Tahoma,Verdanna; } th { font-weight:bolder; font-size:9pt; padding:5px; } td { padding:5px; font-size:9pt; } </style> </head> <body> <?php while($fetch = mysql_fetch_array($sql)){ ?> <table cellpadding="0" cellspacing="0" style="margin-bottom:10px;"> <tr> <th> [<?php echo htmlspecialchars($fetch['created']); ?>] - <?php echo htmlspecialchars($fetch['title']); ?> </th> </tr> <tr> <td> <?php echo $fetch['body']; ?> </td> </tr> <tr> <td align="right"> Posted by: <?php echo $fetch['author']; ?> </td> </tr> </table> <?php } ?> </body> </html>
    1 point
  15. We can actually put this in the Wiki ;O
    1 point
  16. Yeah !! I love Anime !!! xD Just some Recent Anime that i attracted with.. Hunter X Hunter 2011 Gundam Age Guilty Crown Fairy Tails Some of the Anime that i like since the past ... Gundam Seed / Destiny Gundam 00 Gundam W Hunter X Hunter Naruto Bleach Reborn One Piece Detective Conan There is alot more...xD just take some of it haha ~
    1 point
  17. Hunter X Hunter Iam glad that its not in hiatus
    1 point
×
×
  • Create New...