Jump to content

Lighta

Developer
  • Posts

    737
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Lighta

  1. hmm I just check how to not add an arg, we could do it by define but that may be too weak/tricky. So ye we probably need one, but I was thinking of sending sd or char_id or mmo and do the langage treatement in the msg_txt function rather then for each line. like const char* _msg_txt(struct mmo_charstatus *mmc,int msg_number,int size, char *** msg_table) { char output[128] = "??"; uint8 lang = mmc->lang; if (msg_number >= 0 && msg_number < size){ if(msg_table[lang][msg_number] != NULL && msg_table[lang][msg_number][0] != '\0') output[128] = msg_table[lang][msg_number]; else if(msg_table[0][msg_number] != NULL && msg_table[0][msg_number][0] != '\0') //fallback output[128] = msg_table[0][msg_number]; } return output[128]; } point was doing the langage treatement in the msg_txt function rather then at each call. Yes for login that may be annoying, well we don't necessarly need multiple table for login, probably the default would suffice.
  2. Hoi, nice idea I had the same actually but never finish it, anyway here my input/ remark on this : - not official blabla, so I was thinking of just a mod but I'm agreeing with Euphy stating it's a good plus so we might put in in svn. (ok but then I think we need #define to not increase ram consumtion for people who's interested in 1 lang only. (each lang take 1 more msg_conf comsumtion, not that big but there no reason to increase it if you wont use it especially when is not that hard to prevent it...) - we was thinking of #define LANG (bitmask) so you can choose wich lang to choose. - if msg from user lang not define return default lang msg. (fallback) That general concept now to speak more about diff : -I don't like new structure of msg_txt(lang,int), I think lang could be taken in msg_txt() fonction without being assign as argument. -store data is duplicated, I mean on each serv you have assigned a var to config wich lang you want. (duplication => posssible mistmatch => possible failure), I personnaly hate duplication for this. I was thinking mmo_status could do it fine. mmo is char wide yeah but since we have one at the time I think it's ok, we wont lose ram. - New row in login is good but that could be stored as global_reg as well. Global_reg table offert the possibility of scripts/atcommand interaction while login table shouldn't if we want to respect schema/server independancy. Plus present to not need a whole new colum for that. That all anyway thx Lilith, didn't have time to properly try it yet but I'll.
  3. @kamikaze666, unfortunatly no, but I think you mistunderstand, he want NPC_EARTHQUAKE to NOT bypass LP, setting this inf2 would have done just the contrary. But even so setting this inf2 will only work for AoE (skill_unit) skill, wich ain't coded like that for NPC_EARTHQUAKE, it's targeted on a zone. (weird ? ye I know). zhen said done but didn't provide it's solution wich is sad but I believe it could be done like this. @zhen yup sorry diN,t get wich skill you wanted. --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -3892,7 +3892,7 @@ sflag |= SD_LEVEL; // -1 will be used in packets instead of the skill level if( skill_area_temp[1] != bl->id && !(skill_get_inf2(skill_id)&INF2_NPC_SKILL) ) sflag |= SD_ANIMATION; // original target gets no animation (as well as all NPC skills) - + if(skill_id == NPC_EARTHQUAKE && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR)) break; //avoid damage heal = skill_attack(skill_get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag); if( skill_id == NPC_VAMPIRE_GIFT && heal > 0 ) { clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
  4. line specified don't match here so I'm suppose it's modified rA at best. I'd say sd=0x0 and pc_checkskill(sd,NV_BASIC) do the crashdump but can't really be sure here. (or was it that battle_config point to nothing too ??) rA have a nullpo check about the sd=NULL so it shouldn't crash but it seem he bypass it or you don't habe it. if( battle_config.basic_skill_check && sd && pc_checkskill(sd,NV_BASIC) < 1)
  5. let assum my_func = your custom finction. 1) Add my_func to timer_func_list : add_timer_func_list(my_func, "my_func_name"); 2) Ask a timered call : x = 200; //suppose we wanna call it in 200ms otherdata = 25<<16 | 10; //suppose we want to send 2 value 25 and 10 my_func->timer_id = add_timer(gettick() + x, my_func, bl->id, otherdata); 3)Function treatement : (exemple) int my_func(int tid, unsigned int tick, int id, intptr_t data) { TBL_PC *sd=map_id2sd(id); //this assum bl was BL_PC (os you can have all info about sd) if(sd->sc.data[sC_ASSUMPTIO]) foo; //got assumptio do foo. if((data&0x00FF) <= 10) foo; //does my second value was 10 and below ? (eg yes (10)) else if ((data&0xFF00) > 30) foo2; //does my 1st value was above 30 ? (eg no (25)) } yes 3rd part may be more hard to understand but without utilisy of my_func I can't give better exemple. Hope rest was clear =)
  6. in cli : mysql -u youruser -p yourdb < /path/to/my/sqlfile or in mysql shell : mysql > use yourdb; mysql > source /path/to/my/sqlfile both command will load file into <yourdb> executing the query in it thus updating your table. (for visual mode idk, open file take the queryand ask to execute it..) Error 17182, did you have modification on skill.c ?, those constant was remove on last version but he's attempting to use them that why he's failling. Please fix conflict or accept their-full to flush your file and take svn one. You could reput your mod afterward if so. Or take a quick look at changeset and reproduce the step. Also make sure your doing a clean build.
  7. use @setbattleflag meanwhile melv0, I'll check the issue later. eg: @setbattleflag castrate_dex_scale 200
  8. here the one I had done: /*========================================== * @item command (usage: @item <name/id_of_item> <quantity>) (modified by [Yor] for pet_egg) *------------------------------------------*/ ACMD_FUNC(item) { char item_name[100], string[30]; int number = 0, item_id, flag; struct item item_tmp; struct item_data *item_data; int get_count, i; int map_id = 0, guildid = 0, partyid = 0, type = 0; struct s_mapiterator* iter; TBL_PC *pl_sd; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof (item_name)); if (strstr(command, "party") != NULL) { //polymorph [Lighta] struct party_data *pd; if (sscanf(message, "%30s %30s %d", string, item_name, &number) < 2) { clif_displaymessage(fd, "Please, enter an item name/id (usage: @itemparty <partyname> <item name or ID> [quantity])"); return -1; } pd = party_searchname(string); if (pd) partyid = pd->party.party_id; else if (sd->status.party_id) partyid = sd->status.party_id; if (!partyid) { clif_displaymessage(fd, "Party not found!"); return -1; } type = 1; } else if (strstr(command, "guild") != NULL) { struct guild *g; if (sscanf(message, "%30s %30s %d", string, item_name, &number) < 2) { clif_displaymessage(fd, "Please, enter an item name/id (usage: @itemguild <guildname> <item name or ID> [quantity])"); return -1; } g = guild_searchname(string); if (g) guildid = g->guild_id; else if (sd->status.guild_id) guildid = sd->status.guild_id; if (!guildid) { clif_displaymessage(fd, "Guild not found!"); return -1; } type = 2; } else if (strstr(command, "map") != NULL) { if (sscanf(message, "%30s %30s %d", string, item_name, &number) < 2) { clif_displaymessage(fd, "Please, enter an item name/id (usage: @itemmap <mapname> <item name or ID> [quantity])"); return -1; } if ((map_id = map_mapname2mapid(string)) <= 0) //if map not found take current one map_id = sd->bl.m; type = 3; } else if (!message || !*message || (//normal command sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/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; iter = mapit_getallusers(); for (pl_sd = (TBL_PC*) mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*) mapit_next(iter)) { switch (type) { case 1: //team limited if (pl_sd->status.party_id != partyid) continue; break; case 2: //guild limited if (pl_sd->status.guild_id != guildid) continue; break; case 3: if (pl_sd->bl.m != map_id) continue; break; default: pl_sd = sd; } for (i = 0; i < number; i += get_count) { // if not pet egg if (!pet_create_egg(pl_sd, item_id)) { 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, LOG_TYPE_COMMAND))) clif_additem(pl_sd, 0, 0, flag); } } if (!type) break; //backward } mapit_free(iter); if (flag == 0) clif_displaymessage(fd, msg_txt(18)); // Item created. return 0; } There many iterator as you can see, you can use : @itemmap <mapname> <nameid> <amount> @itemguild <guildname> <nameid> <amount> @itemparty <partyname> <nameid> <amount> and ofc old one : @item <nameid> <amount>
  9. Lighta

    Chat

    change the value send to client in clif.c::clif_dispchat --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -3538,7 +3538,7 @@ WBUFL(buf, 4) = cd->owner->id; WBUFL(buf, 8) = cd->bl.id; WBUFW(buf,12) = cd->limit; - WBUFW(buf,14) = (cd->owner->type == BL_NPC) ? cd->users+1 : cd->users; + WBUFW(buf,14) = cd->users; WBUFB(buf,16) = type; memcpy((char*)WBUFP(buf,17), cd->title, strlen(cd->title)); // not zero-terminated nb. this will affect all npc chat but you can add more condition if you wish to
  10. that mean that monster is probably a summon mob or event or scripts or whatever. That mean he doesn't have a permanent spawn on any map. In current case you searching for an event monster, (E_RANDGRIS) no map spawn this, shouldn't you search for 1751 instead ?
  11. unable to reproduce mean that members/staff try to replicate your bug on their test server using same version as you on clean svn, (without any mod). And failed to conclude to same result, meaning that either your bug was false, like you forget you had done a command before blabla, or you have some mod that since we not have it can't correct it, Therefore it'd be more support oriented but it's also hard to help without seing the cause. Anyway I jsut tryed on r17170 without RENEWAL enable and couldn't confirm your issue neither, so upate to latest may solve your issue. nb : when you changing those #define setting, you need to recompile and relaunch server to take it in effect. (./athena-start stop && make clean sql && ./athena-start start)
  12. wow that was hard to catch. well as Rage said they all stuck with RENEWAL define, you could create a new define like REATK and use it on battle.c instead RENEWAL to choose what you want or not. But that not something I could give you an easy anwser, battle.c is closely dependant to skill.c wich is closely dependant to status.c, so if you modify those you should go step by step and see what it impact. Well I said battle cause I supposed you mean wanted the old calculation somewhat.. well you choosed what u want, main issue will be dependancies here.
  13. well it's a targeted skill that why it bypass LP, but here a quick way to do what u asked : --- Base (BASE) +++ Locally Modified (Based On LOCAL) @@ -3933,13 +3933,13 @@ break; skill_attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag); break; - + case WZ_EARTHSPIKE: + if(map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR)) break; case MG_SOULSTRIKE: case NPC_DARKSTRIKE: case MG_COLDBOLT: case MG_FIREBOLT: case MG_LIGHTNINGBOLT: - case WZ_EARTHSPIKE: we checking if target standing on LP, if so we prevent continuing trouht, so he's protected.
  14. if that on rA it's more a medium profile bug, so you could do a report and will get fixed right away. if not it obviously some custom and will be hard to help without seing the cause. (well at least fix it really). TxusToni patch could work. (well beside the u_ typo, wtf is that ?) Otherwise you could try to do something like this : sd->canskill_tick += 300; wich will add 300ms to the limit tick where you could reskill. ACMD_FUNC(refresh) { nullpo_retr(-1, sd); clif_refresh(sd); sd->ud.canact_tick += 300; sd->ud.canmove_tick += 300; return 0; } but that just a patch on the same vein as TxusToni one
  15. make sure you don't have old value in your db, I know you said you deleted all existing guild, but he take that 16 value from here. Judging from your old post I'm not sure if you really using sql or txt more, since it seem you had the old char_sql too. Assuming you really using sql you could verify like this : select * from guild where max_member > 11 so now we should have listed all guild that pop our error msg. (wich btw give no harm as it well handle, you'll just lose those extra member). and we could try a quick wich like this : update set max_member=11 from guild where max_member > 11 but I wonder how extra char will handle this, since char table still have a guil_id field. so you could take a look at our listed overflow guild join it with char.guild_id and remove the fucker. hope that will fix the issue. the mod src look fine.
  16. that wouldn't make sense to put it in the struct, that struct represent each item that are being sold in the shop. itemid, price, amount. you don't have a shop title for each item being sold, well you could but that useless. I don't get what u mean when u said save in db, atm you trying to setting it to a struct, well in abuse of langage we could said it's our itemtovend db, we not really saving it. It's only assign to ram. I need more info to help you correctly here. if you do want to save it really to your db, and I mean mysql db, you'll send to prepare a packet and an handle in char.c to save it, you can take exemple with inventory or auction. The name of shop are stored on sd->message yes.
  17. delete following line : <<<<<<< mine int inf2; ======== >>>>> r17165 if you did well you should just have (for all that section). uint32 inf2; This line that I told you to remove are added when you have a conflict on svn, (mean you locally changed a line that was change in latest svn revision, so he's asking you wich version yo choose your's or svn one ? that what is a conflict) We solve it manually here but you could use resolve conflict and choose wich block to take to fix it to. <<<<< mine to ====== mean that all lines between those markers are yours. from ======== to >>>> r17165 all those line was changed on revision r17165 from the svn you foloowing
  18. you could use : atcommand @unloadnpcfile npc/custom/warper.txt; "atcommand" it's a script npc command that allow you to use atcommand in script : http://rathena.org/wiki/Atcommand
  19. with their = solve conflict by taking conflicted line from svn. with mine = solve conflict by keeping my change for conflicted section. with their-full = solve conflict by flushing my file and take the one from svn. (even section without conflict will be lost) with mine-full = completly ignore that svn shit, "it's correct I'm telling u !"
  20. look more like a request then support, I'll give support anyway : thorn trap : search UNT_THORNS_TRAP on skill.c::skill_unit_onplace_timer -you can see duration is define with "int sec = skill_get_time2(sg->skill_id, sg->skill_lv);" so go in skill_cast_db.txt and change duration2 for your desired one (5s) - unit should already have no effect on allly etc but only affect ennemy, if not it's buggy but you can add a "battle_check_target" om that unit handler to force it to tread ennemy if you wish. -icon refer to status, don't you have the icone only when you step on it ?? you could send to client that status is finish even if it's not true just to make icone disapear with "clif_status_change(bl,SI_THORNTRAP,0,0,0,0,0);" heaven drive: -already the case, since once you get hit you'll be uncloack unhide, or are you implying cloaking exceed ? on skill.c::skill_additional_effect (wich mean our attack went trough target) add a "case WZ_HEAVENDRIVE:" and stop the status you want with "status_change_end(src, typeIwannaStop, INVALID_TIMER);" demonstration: -the unit seem already to be set to ennemy only for me, but you could add a "battle_check_target" just like we did for UNT_THORNS_TRAP on UNT_DEMONSTRATION. case UNT_TATAMIGAESHI: case UNT_DEMONSTRATION: + if(battle_check_target(ss,bl,BCT_ENEMY) > 0) skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0); break; oops that exemple not perfect cause it affect UNT_TATAMIGAESHI too, but it was just to show battle_check_target exemple on a unit. this should cover all what u ask.
  21. it's better to quote error if you want help on this as we don't all want to try it out to search trivial error. (and error message are usually descriptive enough). now MarkZ had the good idea the better way is to mark those ignore it in db so you can change it easely, but adding a whole new row for this is a little bit overkill. here the simplier way to do it, we'll add a new inf2 and set it on dragon breath as exemple : -declare new inf2 : skill.h::e_skill_inf2 add new inf2 with next bitmask : .... INF2_CHORUS_SKILL = 0x4000, // Chorus skill INF2_BYPASSPNEUMA = 0x8000, }; -use inf2 in code battle.c::battle_calc_damage if( ( !(skill_get_inf2(skill_id)&INF2_BYPASSPNEUMA) && sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) || sc->data[SC__MANHOLE] ) { d->dmg_lv = ATK_BLOCK; return 0; } -set dragon breath with this inf2 : 2008,9,6,2,3,0xC2,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x8000,0,misc,0, RK_DRAGONBREATH,Dragon Breath This step are the step you need to do and result you should have, here the current total diff. (unfortunatly diff won't match long, but if you understand the step you'll have no issue to update for latest version # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/pre-re/skill_db.txt --- db/pre-re/skill_db.txt Base (BASE) +++ db/pre-re/skill_db.txt Locally Modified (Based On LOCAL) @@ -38,6 +38,7 @@ // 0x1000- disable usage on enemies (for non-offensive skills). // 0x2000- skill ignores land protector (e.g. arrow shower) // 0x4000- chorus skill +// 0x8000- ignore pneuma // 13 maxcount: max amount of skill instances to place on the ground when // player_land_skill_limit/monster_land_skill_limit is enabled. For skills // that attack using a path, this is the path length to be used. @@ -685,7 +686,7 @@ 2005,1,6,2,4,0x2,2,5,1,no,0,0,0,weapon,3, RK_WINDCUTTER,Wind Cutter 2006,0,6,4,-1,0x2,5,5,1,no,0,0,0,weapon,0, RK_IGNITIONBREAK,Ignition Break 2007,0,0,0,0,0,0,5,0,no,0,0,0,weapon,0, RK_DRAGONTRAINING,Dragon Training -2008,9,6,2,3,0xC2,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0,0,misc,0, RK_DRAGONBREATH,Dragon Breath +2008,9,6,2,3,0xC2,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x8000,0,misc,0, RK_DRAGONBREATH,Dragon Breath 2009,0,6,4,0,0x3,3:4:5:6:7,5,1,no,0,0,0,none,0, RK_DRAGONHOWLING,Dragon Howling 2010,0,0,0,0,0,0,10,0,no,0,0,0,none,0, RK_RUNEMASTERY,Rune Mastery 2011,0,6,4,0,0x1,0,1,1,no,0,0,0,none,0, RK_MILLENNIUMSHIELD,Millenium Shield Index: db/re/skill_db.txt --- db/re/skill_db.txt Base (BASE) +++ db/re/skill_db.txt Locally Modified (Based On LOCAL) @@ -38,6 +38,7 @@ // 0x1000- disable usage on enemies (for non-offensive skills). // 0x2000- skill ignores land protector (e.g. arrow shower) // 0x4000- chorus skill +// 0x8000- ignore pneuma // 13 maxcount: max amount of skill instances to place on the ground when // player_land_skill_limit/monster_land_skill_limit is enabled. For skills // that attack using a path, this is the path length to be used. @@ -685,7 +686,7 @@ 2005,1,6,2,4,0x2,2,5,1,no,0,0,0,weapon,3, RK_WINDCUTTER,Wind Cutter 2006,0,6,4,-1,0x2,5,5,1,no,0,0,0,weapon,0, RK_IGNITIONBREAK,Ignition Break 2007,0,0,0,0,0,0,5,0,no,0,0,0,weapon,0, RK_DRAGONTRAINING,Dragon Training -2008,9,6,2,3,0xC2,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0,0,misc,0, RK_DRAGONBREATH,Dragon Breath +2008,9,6,2,3,0xC2,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0x8000,0,misc,0, RK_DRAGONBREATH,Dragon Breath 2009,0,6,4,0,0x3,3:4:5:6:7,5,1,no,0,0,0,none,0, RK_DRAGONHOWLING,Dragon Howling 2010,0,0,0,0,0,0,10,0,no,0,0,0,none,0, RK_RUNEMASTERY,Rune Mastery 2011,0,6,4,0,0x1,0,1,1,no,0,0,0,none,0, RK_MILLENNIUMSHIELD,Millenium Shield Index: src/map/battle.c --- src/map/battle.c Base (BASE) +++ src/map/battle.c Locally Modified (Based On LOCAL) @@ -829,7 +829,7 @@ status_change_end(bl, SC_SAFETYWALL, INVALID_TIMER); } - if( ( sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) || sc->data[SC__MANHOLE] ) { + if( ( !(skill_get_inf2(skill_id)&INF2_BYPASSPNEUMA) && sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) || sc->data[SC__MANHOLE] ) { d->dmg_lv = ATK_BLOCK; return 0; } Index: src/map/skill.h --- src/map/skill.h Base (BASE) +++ src/map/skill.h Locally Modified (Based On LOCAL) @@ -70,6 +70,7 @@ INF2_NO_ENEMY = 0x1000, INF2_NOLP = 0x2000, // Spells that can ignore Land Protector INF2_CHORUS_SKILL = 0x4000, // Chorus skill + INF2_BYPASSPNEUMA = 0x8000, }; //Walk intervals at which chase-skills are attempted to be triggered.
  22. not sure but I think it should be : - if(sscanf(line,"%[^:]: %[^:]:%[^:]:%[^\r\n]", w1, w2) != 2) { + if(sscanf(line,"%[^:] :%[^\r\n]", w1, w2) != 2) {
  23. DONT use "sleep" on the code you'll slow down all other thing. You'll have to understand how we deal with socket to get what I mean but best is to use the add timer wich will call your sub func at appopriate time. nb : sleep and usleep are different on OS : #ifdef WIN32 Sleep(1000); #else sleep(1); #endif
  24. may be added temporarly to svn imo with a #ifdef to be taken out quickly and not annoy other but I think some skill will bypass this, so it's not perfect, best then nothing I agree but if will need to fix for those remaning skills too.... In other hand updating it not very long, handler are well define everyone should be able to do it with basic C knowledge.
  25. was tryed currently on freebsd_9.1 (64); centos 6.3 (32); debian 6.0.3 (64); fedora 18 (64), and ubuntu 12.10 (64).
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.