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.
hello Nardoth
Thanks for answering, that our conversation is clarifying me some things.
good, I was all day today studying and testing things.
sorry, it's hard to speak English to me.
Come on.
To use the function map-> foreachinpath () in castend_pos2, as you said, it needs to be configured.
This is the part the code map->foreachinpath ()
map->foreachinpath(skill->attack_area,src->m,src->x,src->y,bl->x,bl->y,
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);
The part that needs to be set is part of setting the selected area:
bl->x
bl->y
You can not really use "bl-> x" and "bl-> y"
you need to define somehow
I tried to do is create a function in map.c and Map.h
this function:
Code:
int map_getbl( struct block_list *bl, int16 dx, int16 dy) {
int16 dx, dy;
dx = bl->x;
dy =bl->y;
return dx, dy;
}
So I could replace the map->foreachinpath ():
map->foreachinpath(skill->attack_area,src->m,src->x,src->y,map->getbl,bl->y... etc
But I'm still confused how to do this.
If you can auxilar me, I'm grateful.
------------------------------------------------------------------------------------------------------
Now, let the other doubts
I want do a ''For()'' in the skill FirePillar - WZ_FIREPILLAR
The idea is to launch the skill, and go repeating along the way until you reach the selected area.
Like this:
I have not done this for () to test, but I'm including in the conversation.
It is also the function skill_castend_pos2
I will also need to get the coordinates of the selected area and go running skill to get it