Jump to content
  • 0
Tio Akima

get cell ID

Question

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 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0
11 minutes ago, meko said:

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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