Nardoth
Members-
Content Count
26 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Staff Applications
Calendar
Everything posted by Nardoth
-
[2014-02-05] Backslide and Shadow Jump Animations - gone?
Nardoth replied to bWolfie's question in Client-Side Support
This fix uses timer functions and still causes the client to render the initial direction for a milisecond when you use shadow jump on a cell that is too close to you, still it's good to go. At unit.c define the following function: int unit_settimeddir(int tid, int64 tick, int id, intptr_t data){ struct block_list *src; src = map->id2bl(id); if (src == NULL){ ShowDebug("unit_settimeddir: src == NULL (tid=%d, id=%d)\n", tid, id); return 0;// not found } unit->setdir(src,data);//data will be the direction return 1; } This is a function of the defined type TimerFunc which means it can be used by the timer functions after we define a name for it. But first we need to define in unit_defaults: unit->settimeddir = unit_settimeddir; and at do_init_unit: timer->add_func_list(unit->settimeddir,"unit_settimeddir"); Then we go to unit.h and define inside the struct unit_interface: int (*settimeddir)(int tid, int64 tick, int id, intptr_t data); Now or function is ready to be used. At skill.c in skill_castend_pos2 go to the case NJ_SHADOWJUMP and make it look like this: case NJ_SHADOWJUMP: { uint8 d = map->calc_dir(src,x,y); if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } timer->add(tick+10,unit->settimeddir,src->id,(intptr_t)d); status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); } break; So at 10 ticks later (used 10 because I feel it's safer) the function will be executed, chaging the direction the src is facing. -
[2014-02-05] Backslide and Shadow Jump Animations - gone?
Nardoth replied to bWolfie's question in Client-Side Support
EDIT: THIS FIX IS DEPRECATED. I did a fix using timer functions which will be in the next post. Don't use this as it will sometimes cause a "miss" animation when using the skill. Managed to do a temporal fix on NJ_SHADOWJUMP. I realized that it does change the direction of the caster but it is never shown to the clients, even if you try it by sending a packet on the same tick. For some reason it sets itself to the direction = 6 at the end of the tick. So what I have done is change the direction a little later. For this, I still don't know how to use timer functions, so I use clif_delay_damage and clif_delay_damage_sub whenever I need that. clif_delay_damage calls clif_delay_damage_sub at the tick it is set to with a packet of data that holds multiple variables and we can take advantage of it. The fix is the following: In skill.c at the case NJ_SHADOWJUMP in skill_castend_pos2 make it look like this: case NJ_SHADOWJUMP: { uint8 d = map->calc_dir(src,x,y); if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } clif->delay_damage(tick+10,src,src,d,skill_id,0,1,0); status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); } break; At clif.c in clif_delay_damage_sub (the sub, not the other) add at the start of the codestruct map_session_data *sd; sd=map->id2sd(dd->p.GID);//dd->p.GID is the id of the caster sent from clif_delay_damage if (sd){ if (dd->p.attackedMT==NJ_SHADOWJUMP && dd->p.count==1){//this is the "sdelay" variable where we used the skill_id, the count=1 is a security measure in the case the sdelay of the true use of the packet is =NJ_SHADOWJUMP unit->setdir(&sd->bl,dd->p.attackMT);//this is the "ddelay" variable where we used the direction ers_free(clif->delayed_damage_ers,dd);//It does this at the end, I guess it frees some memory return 0; } } This will solve the problem until it is fixed. Probably the best way to solve it would be using timer functions but I don't know how do they work, actually I'm not even sure what language is this. -
[2014-02-05] Backslide and Shadow Jump Animations - gone?
Nardoth replied to bWolfie's question in Client-Side Support
Triangulated the problem with the direction in NJ_SHADOWJUMP and found out this: At map.c, in map_moveblock the following lines are causing the problem: if (moveblock) map->delblock(bl); #ifdef CELL_NOSTACK else map->update_cell_bl(bl, false); #endif bl->x = x1;//this one bl->y = y1;//and this one, if (moveblock) map->addblock(bl); #ifdef CELL_NOSTACK else map->update_cell_bl(bl, true); #endif Weird. Tried different things, nothing solved it so I have no idea what to do. -
[2014-02-05] Backslide and Shadow Jump Animations - gone?
Nardoth replied to bWolfie's question in Client-Side Support
At skill.c : For Back Slide change in skill_castend_nodamage_id case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex] clif->skill_nodamage(src,bl,skill_id,skill_lv,1); skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit->getdir(bl),0); clif->fixpos(bl); break; to case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex] //clif->skill_nodamage(src,bl,skill_id,skill_lv,1); skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit->getdir(bl),0); clif->fixpos(bl); clif->skill_nodamage(src,bl,skill_id,skill_lv,1); break; For Shadow Jump I couldn't solve the direction, but for the animation change at skill_castend_pos2 to this: case NJ_SHADOWJUMP: if( !map_flag_gvg2(src->m) && !map->list[src->m].flag.battleground ) { //You don't move on GVG grounds. unit->movepos(src, x, y, 1, 0); clif->slide(src,x,y); } status_change_end(src, SC_HIDING, INVALID_TIMER); clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); break; Don't forget to recompile. -
Hi, reviving this topic because it already has some background of what I'm doing. I used the plugin and succesfully generated the navigation files. However it never uses the airship, the boats or kafra for transportation, it always choose the path by walking, no matter what option I set on the navigation window. Is there a fix for this?
-
Watch out for the bug in which if you try to restore the costume having another item of the same kind in the inventory, it will fail to restore the costume. What this does is delete the item in the inventory and replace it for a new one, and it may cause to lose cards and refine on that item. A simple solution is to use the condition countitem(item_id)>1 to stop the script if the player has more than one of these items.
-
Go to skill_check_condition_castend at skill.c and look for case AM_CANNIBALIZE: Below that you will see maxcount = 6-skill_lv; change it to maxcount = 2; save and recompile.
-
can you help me? I've never done a new custom skill, just edited existing ones so I don't know the preliminar steps. Also you need to be more specific. Check for a tutorial in how to add a new custom skill.
-
I'm having this issue now, does somebody know how to solve it? I do not have any errors on my console, and I did not edit the itemskill function script nor the clif_item_skill function. I'm using 20140205 Ragexe version. One thing I noted is that after using a magnifier, I couldn't use the skill Appraisal by itself until I used something else like a fly wing, if it helps to know what's going on. The issue happens with items with itemskill script in general. The functions I mentioned are being called and are passing the variables properly. EDIT: Found the problem, was calling skill->check_condition_castbegin at clif_parse_UseSkillToId.
-
For some reason, when I try to use a magnifier, flywing, Yggdrasil leaf and other items like them, they would be consumed and no skill will happen. There are no errors when loading the server nor when using the items. I updated my hercules like 2 weeks ago but I don't remember if I had this problem before, didn't check. Also I never edited the itemskill script command nor the functions it uses as far as I can recall. wat do? UPDATE: I checked my previous version of hercules that was like a year old and the bug is still there. PACKETVER is 20140205. UPDATE 2: Used an unmodified version, bug was gone. Must be something I made, no idea what could be causing it since I didn't messed up with that :/ LAST UPDATE: Found the problem, was calling skill->check_condition_castbegin at clif_parse_UseSkillToId and ToPos too.
-
I actually writed it in the code, after the nullpo, you just need to copy and paste. Anyways I checked it, it doesn't work, The function is for older client versions. There are other functions too like clif_hp_meter and the like but I can't figure out how to do it, every mob still has the hp bar.
-
Try navigating to the function clif_monster_hp_bar in clif.c and add a condition for the mob to be a mvp. Something like md->state.boss void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) { struct packet_monster_hp p; nullpo_retv(md); nullpo_retv(sd); if(md->state.boss){ p.PacketType = monsterhpType; p.GID = md->bl.id; p.HP = md->status.hp; p.MaxHP = md->status.max_hp; clif->send(&p, sizeof(p), &sd->bl, SELF); } } PD: Don't forget to recompile.
-
Custom Skill Unit Follow Character (like Bragi)
Nardoth replied to joecalis's question in Source Support
Try to check if there is a block_list related to the unit that you can slide to the proper position using clif->slide (and checking if it can be moved using unit->movepos -
what are the drawbacks of doing this? Will the client experience more lag? What else?
-
In skill_castend_pos2. But as I said it doesn't work properly because it's like it stops everything during those 2 seconds until the loop ends. Probably the best thing would be to call clif->delaydamage and adapt the code to that function.
-
As a comment in some function say: // skill->area_temp[0] holds number of targets in area // skill->area_temp[1] holds the id of the original target // skill->area_temp[2] counts how many targets have already been processed That's all I know about it. We have to mess with the timer in order to get the skill to display properly, but I have made something that may help you wich is different from what we have done: { int i=0; int64 delay=tick; int64 temp=tick; do{ if (timer->gettick()!=temp) temp=timer->gettick(); else continue; //we need this because sometimes tick gets called too fast and it puts the same pillar over and over if (temp>=delay){ struct skill_unit_group *su; su=skill->unitsetting(src,WZ_FIREPILLAR,1,x+i,y+i,0); delay += 300; //Put a pillar of lvl 1 in the x+i,y+i diagonal (for testing purposes) su->limit = 400; //Pillar disappears after 0.4 seconds i++; } }while(temp<tick+2000); //Execute in 2 seconds } The problem with this script is that it kind of stops everything until it ends the do loop, because it's not executing at every tick, but it may help as a start. You will also need a way to determine if it hits a target for it to stop placing more pillars. map->foreachinpath solved that problem in some way but can't be used here or the targets will be hit twice. Timed stuff and functions with va_args variables are my weak point and I can't help you with that but maybe you can flood your clif_delay_damage function with code that has nothing to do with what it does now to solve that problem. I used that function for that in some ocassion. That function is called at the tick it's set to in the variable.
-
For the duration of the skill, you can change it from the skill_db.conf in your db/re folder. To remove previous bombs, go to skill_unitsetting in skill.c and navigate to where the "case GS_GROUNDDRIFT:" is. Add skill->clear_group(src, 1); after that. I didn't test it but maybe you need to check if there is a bomb placed so it doesn't crash or something like that. Also make sure it does not remove bombs from other gunslingers.
-
To set a new skill for any job you just have to navigate to your db/(pre-)re folder and edit skill_db.conf That file handles what skill is being used by whom. Study how the AM_CANNIBALIZE works in the source and use it as a base to start a new skill, or edit that one, but you will have to set conditions everywhere if the base class of an user is alchemist or priest, and as far as I know, you won't be able to edit the skill icon to show two different sprites.
-
In castend_pos2 there are already variables x and y that are set as parameters of the function, these are the coordinates of the cell the player casted the skill on, so you just have to replace bl->x and bl->y for just x and y respectively. But then again, in NJ_KAMAITACHI the animation does not show up when there are no enemies in the area. The loop should advance from the last cell the animation showed up to the next one, until it hit's a target or reach the range of the skill, and then continue. I will let you do the math about how to calculate which cell it should go, probably you will have to mess with some conditions about the direction where the target cell is from your point of view. It would look something like this: for(i=0;i<range;i++){ if (0<map->foreachinpath(skill->attack_area,src->m,previous_cellx(i),previous_celly(i),next_cellx(i),next_celly(i), skill->get_splash(skill_id, skill_lv),skill->get_maxcount(skill_id,skill_lv), skill- >splash_target(src),skill->get_type(skill_id),src,src,skill_id,skill_lv,tick,flag,BCT_ENEMY)) continue; } Using the firepillar will be more tricky, since what it does is place a unit on the cell with skill->unitsetting if I guess correctly. If that's the case, maybe it will help you to set a variable of the struct skill_unit_group to that unit of firepillar, and set it's alive parameter to a lower number so it does not persist after the skill is done casting and it disappears quickly. PD: My main language is spanish, but I can understand you pretty well.
-
Hi, is there a way to make an invisible npc such that you can walk over it instead of pushing you to a free cell? It seems like FAKE_NPC pushes you away. Also is there a way to open the bank in a script the same way you open the auction with the command "openauction" ? EDIT: Already solved it, someone close this.
-
I know what you are trying to do, what I said was about that. You need to study how kamaitachi works. It uses the map->foreachinpath function to attack to everyone in it's path. That function returns the total amount of damage done in the area, so you may use that to know if it already hit something in a convenient loop (i.e. looping at every cell in the path). To set kamaitachi as a ground skill you go to your skill_db.conf and replace Enemy: true to Place: true, but after you do that the skill will stop calling skill->castend_damage_id to use skill->castend_pos2 (and because of that it will stop calling map->foreachinpath unless you set it to do that in castend_pos2). To loop at everycell in it's range you will have to get the direction the src is facing and calculate the next coordinate it should be heading. Check the available functions in unit.c (or by typing unit-> ). It seems to me that this is a very inefficient way to do it but I bet it will do the trick and is the best thing I know to do with the tools we have. The only problem with this method is that the skill animation wont show up if the skill fails to find an target. The animation is called by clif->skill_damage but it needs a block_list as a target and you only have the coordinates x,y of the targeted cell. In the other hand, using the caster's block_list (src) as a target will make the animation head always to east, which is an issue. I don't know about you but I never learn C, or C++, or whatever this language is (actually the only language I'm not afraid to say I know a bit is fortran), but after learning I can use printf("string") or printf("%d",int i) my understanding speed of this code increased greatly. It may be helpful to you. The output will be print in the map-server console and to write a new line use printf("\n") to make it readable. It helps to find bugs in your code about what it is doing or where it's crashing. Trial and error will help you a lot.
-
Go to the skill_db.conf in your db/re (or pre-re) folder and comment out "UF_NOFOOTSET: true" in the skill. However cast time and delay for the skill are too short, so I would suggest not doing that because it would lead into imbalance.
-
I think your best bet would be to check on ninja's Kamaitachi (NJ_KAMAITACHI) and make it cast on ground, but also it bypasses through every enemy so you should make it stop as soon as it hits 1 target.
-
When a magic skill is casted on an enemy of my map_session_data *sd I can get both the skill id and target with sd->ud.skill_id and sd->ud.skill_target but this is not the case on a melee or ground targeted skill (it returns 0 with that method, for some reason). How do I get both of those variables in those cases? EDIT: Close this thread, I solved it.
-
If I'm not mistaken, basically you want the following jobs to have the bonus on rebirth: Every Rebirth job Every Baby Third Job except Baby Expanded Super Novice So your rule should be sd->class_&JOBL_UPPER || ( sd->class_&(JOBL_THIRD|JOBL_BABY) && MAPID_SUPER_BABY_E!=sd->class_&MAPID_SUPER_BABY_E) And it would look like this sd->status.status_point = statp[sd->status.base_level] + ( (sd->class_&JOBL_UPPER || ( sd->class_&(JOBL_THIRD|JOBL_BABY) && MAPID_SUPER_BABY_E!=sd->class_&MAPID_SUPER_BABY_E)) ? 52 : 0 )