get cell ID

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
Hello guys.

Can someone give support related to the file skill.c?

I want to return the ID of a clicked cell.

This code I know returns a mob id.

Skill-> area_temp [1] = bl-> id;


How to return the id of a cell?

PS:  Must be within the method skill_castend_pos2(){}
I'm doing a damage skill in area.



thanks 

 
I guess you meant (x,y) of a cell but if you really want an ID (of map->cell[]) you would do (x + y * map->list[m].xs).

If you just want x,y then you don't need to do anything fancy since skill_castend_pos2 already has access to x,y

 
Last edited by a moderator:
I guess you meant (x,y) of a cell but if you really want an ID (of map->cell[]) you would do (x + y * map->list[m].xs).

If you just want x,y then you don't need to do anything fancy since skill_castend_pos2 already has access to x,y
Ah yes, I understood.

I'm trying to do the following meko.

Esou trying to make a similar skill LG_CANNONSPEAR
However, the difference is that the click must be in the area.

(the LG_CANNONSPEAR the click must be on some mob.)

The idea is to get the x, y of the cell clicked,
Get the x, y of the player
And make a FOR () to go by checking cell by cell during that path.
If find any ENEMY during this path, then it deals damage.
skill_ilustrate_ingles.jpg

The Cannon Spear skill performs the following function:
And also her for the first Mobs she finds.
It uses a foreachinpath () to traverse this path.

skill->area_temp[1] = bl->id;
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);



I'm really confused how to do this.
I've been trying several functions for some days without success.

 
Back
Top