Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/23/12 in Posts

  1. File Name: [Package] @itemmap & getitem_map() File Submitter: Xantara File Submitted: 18 Dec 2011 File Category: Source Modifications Content Author: Xantara Information This command will give a specific amount of specified items to all players on the map. I tried to make it a bit more challenging for myself so I have added the capability of giving the same party or guild members of that specific map as well. Makes it easier to script stuff such as events especially those including parties and guilds to participate. Atcommand version now available! Tested on rAthena Trunk 17062 Syntax Script Atcommand Documentation Script Example: Script Command (also found in doc/sample/npc_getitem_map.txt) // Sample NPC to test the custom getitem_map script command // Script and command created by Xantara prontera,156,170,3 script getitem_map test 120,{ mes "input item id"; next; input .@id; mes "input item amount"; next; input .@amt; mes "input type:"; mes "0=everyone, 1=party, 2=guild 3=bg"; next; input .@t; //getitem_map .@id,.@amt,strcharinfo(3),.@t,((.@t==1) ? getcharid(1) : (.@t==2) ? getcharid(2) : getcharid(4)); switch(.@t) { case 1: set .@type_id, getcharid(1); break; case 2: set .@type_id, getcharid(2); break; case 3: set .@type_id, getcharid(4); break; } getitem_map .@id,.@amt,strcharinfo(3),.@t,.@type_id; mes "done"; close; } Atcommand // Everyone one the same map as the who called this command will get 1 Jellopy (ID#607) @itemmap 607 // Everyone one the same map as the who called this command will get 5 Jellopy (ID#607) @itemmap 607 5 // Players who are in the party "myParty" and on the same map as the who called this command will get 2 Yggdrasil Berry (ID#608) @itemmap1 608 2, myParty // Players who are in the guild "hisGuild" and on the same map as the who called this command will get 3 Jellopy @itemmap2 "jellopy" 3, hisGuild Credits Created by Xantara BG Support Suggestion/Idea by Silvester Atcommand Suggestion/Idea by Mysterious Mirror http://downloads.artistic-coder.com/download.php?file=package_getitem_map_v2.0.1_%5BXantara%5D.patch This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Do not mirror without my consent. Click here to download this file
    1 point
  2. Smith Armor I decided to release this little mod as support to this new forum. Yay i'll be the first one making a source edit in here. Back on topic... This little mod will allow WhiteSmiths to have a new skill "Smith Armor" which will allow users to create elemental armors in the same way as they did with weapons. It will work in a similar fashion as to forge new Weapons. Just check the following screenshots to see how it will work. Steps 1- Go to yourserver/src/map/skill.h and find the following: ALL_REVERSEORCISH, ALL_WEWISH, ALL_SONKRAN, And paste below this: WS_SMITH_ARMOR = 998, Then save the file. 2- Go to yourserver/src/map/skill.c and find the following: } else { // Weapon Forging - skill bonuses are straight from kRO website, other things from a jRO calculator [DracoRPG] And replace it with this: } else if(itemdb_isequiptype(nameid) == 1){ // Weapon Forging - skill bonuses are straight from kRO website, other things from a jRO calculator [DracoRPG] Find this: if(pc_search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10 else if(pc_search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5 else if(pc_search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3 else if(pc_search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0? if(battle_config.wp_rate != 100) make_per = make_per * battle_config.wp_rate / 100; } Then paste below this: else { // Calc Smith Armor bonus make_per = sd->status.job_level*20 + status->dex*10 + status->luk*10; make_per += pc_checkskill(sd,skill_id)*500; // Smithing skills bonus: +5/+10/+15 if(pc_search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10 else if(pc_search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5 else if(pc_search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3 else if(pc_search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0? if(battle_config.wp_rate != 100) make_per = make_per * battle_config.wp_rate / 100; } Save this file. 3- Go to yourserver/src/map/itemdb.h and find this: int itemdb_isequip2(struct item_data *); Paste below this: int itemdb_isequiptype(int); Save this file. 4- Go to yourserver/src/map/itemdb.c and find this: /*========================================== * Alternate version of itemdb_isequip *------------------------------------------*/ int itemdb_isequip2(struct item_data *data) { nullpo_ret(data); switch(data->type) { case IT_WEAPON: case IT_ARMOR: case IT_AMMO: return 1; default: return 0; } } Then paste below this: /*========================================== * Return if weapon, armor or ammo. //by JakeRed *------------------------------------------*/ int itemdb_isequiptype(int nameid) { int type=itemdb_type(nameid); switch (type) { case IT_WEAPON: return 1; case IT_ARMOR: return 2; case IT_AMMO: return 3; default: return 0; } } Save this file. 5- Go to yourserver/db/skill_db.txt and find the following: 477,0,6,4,0,0x1,0,10,1,no,0,0,0,weapon,0, WS_WEAPONREFINE,Upgrade Weapon Then paste below this: 998,0,0,0,0,0,0,1,0,no,0,0,0,weapon,0, WS_SMITH_ARMOR,Smith Armor Save this file. 6- Go to yourserver/db/produce.txt and find this; //===== Elemental Converters === ItemLV=23 ===== //-- Fire Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Scorpion Tail 12114,23,1007,1,7433,1,904,3 //-- Water Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Snail's Shell 12115,23,1007,1,7433,1,946,3 //-- Earth Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Horn 12116,23,1007,1,7433,1,947,3 //-- Wind Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Rainbow Shell 12117,23,1007,1,7433,1,1013,3 //============================================== Then paste below this: //---- Armors ----------------------- //-- Tights <-- WS_SMITH_ARMOR & 1 Porcellio card, 3 Scorpion Tail <--- Examples of recipes for armors 2330,3,998,1,4337,1,904,3 //-- Chain Mail <-- WS_SMITH_ARMOR & 1 Porcellio card, 5 Scorpion Tail <--- Example of recipes for armors 2314,3,998,1,4437,1,904,5 //============================================== Save this file and recompile your server, if everything is correct it will not show any error. In produce.txt change the recipes and add as many recipes as you want to your skill. In step 2 you can change the chances of sucess and also if you want to ask for other items besides (Golden Anvil, Emperium Anvil,Oridecon Anvil) . Now that we ended with our server side modifications, we need to modify the Client, so here are the steps to modify the client side. 1- Go to yourdatafolder/lua files/skillid.lua and find this: KN_CHARGEATK = 1001, CR_SHRINK = 1002, AS_SONICACCEL = 1003, Above add this: WS_SMITH_ARMOR = 998, Save your file. 2- Go to yourdatafolder/lua files/skilltreeview.lua and find this: [JOBID.JT_BLACKSMITH_H] = { [21] = SKID.WS_CARTBOOST, [28] = SKID.WS_CARTTERMINATION, [22] = SKID.WS_MELTDOWN, [25] = SKID.WS_OVERTHRUSTMAX, [23] = SKID.WS_WEAPONREFINE }, And replace it with this: [JOBID.JT_BLACKSMITH_H] = { [21] = SKID.WS_CARTBOOST, [28] = SKID.WS_CARTTERMINATION, [22] = SKID.WS_MELTDOWN, [25] = SKID.WS_OVERTHRUSTMAX, [35] = SKID.WS_SMITH_ARMOR, [23] = SKID.WS_WEAPONREFINE }, Save your file. 3- Go to yourdatafolder/lua files/skillinfolist.lua and find: [sKID.WS_WEAPONREFINE] = { "WS_WEAPONREFINE"; SkillName = "Weapon Refine", MaxLv= 10, _NeedSkillList = { { SKID.BS_WEAPONRESEARCH,10 } } }, Paste below this: [sKID.WS_SMITH_ARMOR] = { "WS_SMITH_ARMOR"; SkillName = "Smith Armor", MaxLv = 1, _NeedSkillList = { { SKID.WS_WEAPONREFINE,10 } } }, Save the file. 4- Go to yourdatafolder/lua files/skilldescript.lua and find: [sKID.WS_WEAPONREFINE] = {[/b] [b] "Weapon Refine", "Max Level:^777777 10 ^000000", "Type:^000099 Passive ^000000", "Target:^777777 Self ^000000", "Effect:^777777 Enables you to refine weapons. Unlike Forging, this skill doesn't depend on DEX and LUK, but only on the character's job level.", "At job level 50, you have about the same chances of upgrading as Hollgrehenn.", "At job 70, you have an about 10% better success chance than Hollgrehenn.", "For level 1 Weapons, Phracon is needed.", "For level 2 Weapons, Emveretarcon is needed.", "For level 3/4 Weapons, Oridecon is needed. ^000000", "[LV 1]^777777 Up to +1 ^000000", "[LV 2]^777777 Up to +2 ^000000", "[LV 3]^777777 Up to +3 ^000000", "[LV 4]^777777 Up to +4 ^000000", "[LV 5]^777777 Up to +5 ^000000", "[LV 6]^777777 Up to +6 ^000000", "[LV 7]^777777 Up to +7 ^000000", "[LV 8]^777777 Up to +8 ^000000", "[LV 9]^777777 Up to +9 ^000000", "[LV 10]^777777 Up to +10 ^000000", }, Paste below this: [sKID.WS_SMITH_ARMOR] = {[/b] [b] "Smith Armor", "Max Level:^777777 1 ^000000", "Type:^000099 Passive ^000000", "Catalyst:^777777 Varies ^000000", "Effect:^777777 Allows character to forge Armors using a hammer. Skill Value is (5*SkillLV)%. Anvil, JobLV, DEX and LUK (in this order) further increase this chance. ^000000", "^000000[LV 1]^777777", "Tights", "1 Porcellio Card", "3 Scorpion Tails", "Chain Mail", "1 Porcellio Card", "5 Scorpion Tails", "^6699ffForging formula:", "Base % chance: Skill Value + JobLV * 0.2 + DEX * 0.1 + LUK * 0.1 + 50", "Normal Anvil +0%", "Oridecon Anvil +3%", "Golden Anvil +5%", "Emperium Anvil +10%", "LV 1 Weapon -0%", "LV 2 Weapon -20%", "LV 3 Weapon -30%", "Per Star Crumb -15%", "Elemental Stone -20% ^000000", }, Save the file. 5- Go to yourdatafolder/textures/À¯ÀúÀÎÅÍÆäÀ̽º/item/ and paste the icon for the skill provided in the following link: http://www.mediafire...om165c1&thumb=4 Test it and it must to work correctly. In order to get the skill Smith Armor it will be necessary to get Weapon Refine level 10. Change your killdescript.lua according to your likings. PS: If you dont know how to compile a server use the Wiki and "learn". PS2: It seems i'm unable to upload files compressed, so i had to upload it to mediafire. Regards, Client Side: http://www.mediafire...iadvqrec1yhgrjy Diff files: Smith_Armor_eAthena-trunk_14993.patch Smith_Armor_RR_Mod_rev_79.patch Smith_Armor_3CeAM-trunk_652.patch
    1 point
  3. Preamble I have written an achievement system I want to share with you. It is not the best way to solve achievement systems nor is it very efficient(though it might be more efficient than NPC scripting) and if you already have an achievement system(src or npc) and it's working for you, please don't change to mine. Mine is rather old(about half a year or more) and back then it was the first time I wrote something completly new for eAthena. What I did today was applying the system to rA and create a working diff. If you are willing to use this system then I beg you to report any bug found. Also, if there is enough demand, I might consider re-writing it from scratch, because I am overall unhappy with the system, but not really motivated to further work on it in greater detail. Also the code-style I used back then is totally going against the one I am using nowadays... Don't judge me! Functions There are pre-defined types of achievements in this system Monsterkill Achievements Itemfind Achievements (Only use this for Items NOT trade/drop/storage-able, or else it will result in abuse) Itemuse Achievements Explore Achievements Quest Achievements Special Achievements Let me explain them one after another: Monsterkill Achievements(0): Well, name says it mostly, but there is a bit more to it. You can define different types per achievement. The types are counting by ID(0), by size(1), by race(2), by element(3) or for all MvPs(4). And if player A has killed X monsters that meet the requirement, then he gets the achievement. Itemfind Achievements(1): Again, name says what it does. If you find certain items, you get the achievement. Make sure you only use it on non tradeable etc. items or it will be abused. It can also be filtered into types. They are the following: ID(0), Equip(1)[see item_db->equip), Type(2)[see item_db->type]. It will count if you drop it and pick it up again, so really, only use it on items not storageable, tradeable and dropable! Itemuse Achievements(2): Its porpuse is to count every item used. This achievement might be bugged, report anything you find fishy! It uses the same filtering as Itemfind, so please refer to that. Explore Achievements(3): When entering a map, the system checks whether the map is inside the database for explore achievements and if so, it sets the count. If the player visited all maps for one achievement, then he receives the achievement. Quest Achievements(4): When finishing certain quests, you are able to gain quest achievements. Simple as that! Special Achievements(5): This are achievements in the achievement database. But they are only applicable over @achieve from a GM or with the achieve script_command. This achievement has Event porpuses and is only added for a complete database for your website etc. Now comes the technical stuff... How to install the achievement system 1. Download the *.diff and the *.sql file(they are in the *.rar provided). 2. Import the *.sql into your rAthena database. 3. Apply the *.diff onto your rAthena server. 4. Check your ./conf/battle/exp.conf and ./conf/battle/misc.conf: Two new configs have been added: achievement_cutin_duration and achievement_exp_rate. Read the conf files for more information and change it to whatever you wish it to be. 5. Add the two new files ./src/map/achievement.c and ./src/map/achievement.h to your MAKEFILE or to your project solution and recompile! (^ Up to this point, I won't provide ANY support ^) How to add achievements Well, that is mainly why I would like to find another way of solving the achievement system. But currently it is like this: 1. Add your achievement to achievement_db. Here is a brief summary of the columns: If you chose 5 as type, you are nearly done, skip step 2. If you chose another type, please read on. 2. Go to the respective table of your chosen type: 0->mob_achievement 1->item_achievement 2->itemuse_achievement 3->explore_achievement 4->quest_achievement Now add an entry for your newly added achievement. The columns are rather similiar, but I'll explain in greater detail: mob_achievement: achievement_id: Set to ID assigned by achievement_db for your new achievement type: See description of Mobkill Achievements. There are numbers in brackets for each filtering type valueX: The value for what to filter. I.e. if you chose ID, then place an ID here. If you chose elements, place a number from the element enum here (see script_commands or src for reference) amountX: How many to kill itemfind_achievement: itemuse_achievement: achievement_id: Set to ID assigned by achievement_db for your new achievement type: See description of Itemfind Achievements. There are numbers in brackets for each filtering type valueX: The value for what to filter. I.e. if you chose ID, then place an ID here. amountX: How many to find/use explore_achievement: achievement_id: Set to ID assigned by achievement_db for your new achievement mapX: Name of the map. I.e. prontera quest_achievement: achievement_id: Set to ID assigned by achievement_db for your new achievement questX: ID of the quest 3. Last step is to reload the AchievementDB ingame via @reloadachievement or restart your server. Atcommands So, I added two atcommands working together with this System: @achieve <Achievement_ID> <Player_Name>. Give <Player_Name> Achievement with <Achievement_ID> as ID. IT DOES NOT CHECK WHETHER HE MEETS THE REQUIREMENTS! Built in for debugging and special achievements @reloadachievements. Reload the Achievement DBs. Helpfully if you added new achievements and don't want to restart the server. Scriptcommands *Achieve( <AchievementID>{, <Account_ID>}); Same as the Atcommand. If no account_id is given, use attached player. Does also not check if player meets requirements. Intended for special achievements *GetAchievementInfo(<AchievementID>, <flag>); Flag determines what to return: 0 = type, 1 = bexp, 2 = jexp, 3 = nameid, 4 = points, 5 = status 5 Only works with attached players and returns 1 if the player finished the achievement and 0 otherwise. *GetAchievementName(<AchievementID>); Returns the name of the achievement *GetAchievementCutin(<AchievementID>); Returns the name of the cutin of the achievement I think this is about all you need to know. Please report any bugs and post any suggestions. If you overwhelm me enough, I might rework it to be more user-friendly! Only post bugs and suggestions after you've read through the whole article. I will notive if you haven't. At last Download achievement.patch achievement.sql €dit: I really want to stress the following facts again: Read the whole article! Only use if you are unable to script/code a system that is suficient to suit your needs or this system matches your needs perfectly(well, w/e)! Report any found bug! €dit²: Forgot to mention. The last achievement is stored within the permanent playervariable "LastAchievement" and it stores the ID of the achievement. So you can check it via NPC script etc. Changelog: 1.0 FIrst version 1.1 Fixxed bug of not deleting the cutins properly [Thanks Dexter] 1.2 Fixxed cutin bug fully, fixxed typos in config
    1 point
  4. 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
  5. ------------------------------------------- -------------------------------------------- /lv This is a topic to surprise Jman in the morning when he wakes up, currently he is sleeping so he won't see this until he wakes up. ________________________________________________________________________________________________________________________________ This topic is to post what we love about our lovely admin Jman! I'll go first Jman, your are a great person, you made eAthena come back to life with rAthena. You've setup this great website and even setup your own IRC server for us so we didn't have to deal with the problems of the other network we were on. I love you Jman <3 Others join in and say what you love about Jman! X x X x X x X x X x X x X x X x X x X x X x X x X x X x X x X x X x
    1 point
  6. Say thanks if you use it. by the way i need updated msgstringtable.lua to test it. Special thanks to the following: Philip - thats my nickname, FatalError, Rytech, Chunkspy, Luadec 5.2, see attachment lua files.7z please post your comments if you found an error so that i can fix it. Next Released Decompiled Lua's for 2012-2-14bRagExeRE
    1 point
  7. The client (as for 2006) already calculates the average ping. It sends PACKET_CZ_REQUEST_TIME and stores the current client time. By the time PACKET_ZC_NOTIFY_TIME is received, the current client time is subtracted from the previously stored client time, calculating the time it takes to send and receive a packet (ping time + pong time). It also sends a different packet to the char-server (PACKET_PING). Character Server Packet Information (PACKET_PING) struct PACKET_PING { /* this+0x0 */ short PacketType; /* this+0x2 */ unsigned long AID; } HEADER_PING = 0x187, Zone Server Packet Information (PACKET_CZ_REQUEST_TIME & PACKET_ZC_NOTIFY_TIME) struct PACKET_CZ_REQUEST_TIME { /* this+0x0 */ short PacketType /* this+0x2 */ unsigned long clientTime } struct PACKET_ZC_NOTIFY_TIME { /* this+0x0 */ short PacketType /* this+0x2 */ unsigned long time } HEADER_CZ_REQUEST_TIME = 0x7e, HEADER_ZC_NOTIFY_TIME = 0x7f, To accomplish what you need, you need a packet sent by the server which is instantly replied by the client without any additional action. This could be done with some dummy packets such as HEADER_ZC_REASSEMBLY_CERTIFY and CZ_REASSEMBLY_IDENTITY. In the decompiled client from 2006, it does nothing (although it appears to be a check on whether the client's Import Address Table is modified or not, an anti-cheat feature) and it's safe to send it. struct PACKET_CZ_REASSEMBLY_IDENTITY::<unnamed-type-ImportAddressTableModify> { /* this(bf)+0x0:0x0 len(0x1) */ unsigned char Winsock /* this(bf)+0x0:0x1 len(0x1) */ unsigned char GDI32 /* this(bf)+0x0:0x2 len(0x1) */ unsigned char Debugging /* this(bf)+0x0:0x3 len(0x1) */ unsigned char ClientCheckSumError /* this(bf)+0x0:0x4 len(0x4) */ unsigned char Unused } struct PACKET_CZ_REASSEMBLY_IDENTITY { /* this+0x0 */ short PacketType /* this+0x2 */ unsigned short PacketLength /* this+0x4 */ struct PACKET_CZ_REASSEMBLY_IDENTITY::<unnamed-type-ImportAddressTableModify> ImportAddressTableModify } struct PACKET_ZC_REASSEMBLY_CERTIFY { /* this+0x0 */ short PacketType /* this+0x2 */ unsigned short PacketLength } HEADER_ZC_REASSEMBLY_CERTIFY = 0x308, HEADER_CZ_REASSEMBLY_IDENTITY = 0x332, So... Store current time → Send ZC_REASSEMBLY_CERTIFY → Receive CZ_REASSEMBLY_IDENTITY → Calculate ping+pong from (current time - stored time)
    1 point
  8. Patcher updated, Fixed bug when running on WinXP. Added German language. I hope more issues will not and can begin to optimize the code.
    1 point
  9. Leaving source discussion aside, I'd like to ask if you're going to mimic Gravity's client behavior strictly? From what you explained so far, I understood that graphics flaws and imperfections will be fixed. How about other unfeatures, like hardcoded sprite ranges?
    1 point
  10. LOL maybe its the other way around cause im me and once you talk to me you wont be able to leave me lol, jkjk not really, im like yay and happy to be part of this community.
    1 point
  11. /*========================================== * @itemmap * A way of giving items to all players on a whole map *------------------------------------------*/ ACMD_FUNC(itemmap) { struct map_session_data *pl_sd = NULL; struct s_mapiterator* iter; int j; int pl_GM_level, GM_level; int map_id = 0; char map_name[MAP_NAME_LENGTH]; char item_name[100]; int number = 0, item_id, flag; struct item item_tmp; struct item_data *item_data; int get_count, count=0; memset(item_name, '0', sizeof(item_name)); memset(map_name, '0', sizeof(map_name)); nullpo_retr(-1, sd); if (!message || !*message) return -1; if(sscanf(message, "%15s "%99[^"]" %d", map_name, item_name, &number) != 3 && sscanf(message, "%15s %99s %d", map_name, item_name, &number) != 3) { clif_displaymessage(fd, "Please, enter an item name/id (usage: @itemmap <mapname> <item name or ID> [quantity])."); return -1; } if (number <= 0) number = 1; if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. return -1; } item_id = item_data->nameid; get_count = number; //Check if it's stackable. if (!itemdb_isstackable2(item_data)) get_count = 1; GM_level = pc_isGM(sd); if (strstr(map_name, ".gat") == NULL && strstr(map_name, ".afm") == NULL && strlen(map_name) < MAP_NAME_LENGTH-4) // 16 - 4 (.gat) strcat(map_name, ".gat"); if ((map_id = map_mapname2mapid(map_name)) < 0) map_id = sd->bl.m; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->fd != fd && pc_isGM(sd) >= pc_isGM(pl_sd)) { pl_GM_level = pc_isGM(pl_sd); if (!((battle_config.hide_GM_session || (pl_sd->sc.option & OPTION_INVISIBLE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level if (pl_sd->bl.m == map_id) { // If the player is on the map for (j = 0; j < number; j += get_count) { memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; if ((flag = pc_additem(pl_sd, &item_tmp, get_count))) clif_additem(pl_sd, 0, 0, flag); } count ++; clif_displaymessage(pl_sd->fd, "Something is falling from the sky."); // Message for all players on the map (can't use "mercy.." because we can use a Support or a Attack skill with @skillmap) } } } } snprintf(atcmd_output, sizeof(atcmd_output) ,"You give the item to : %d players.", count); clif_displaymessage(fd, atcmd_output); return 0; }
    1 point
  12. done reporting http://rathena.org/b...command-issues/ hopefully, I contributed positively. Thanks Judas.
    1 point
×
×
  • Create New...