Jump to content
  • 0

skill for checking cell and mob


Tio Akima

Question


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  191
  • Reputation:   138
  • Joined:  09/24/12
  • Last Seen:  

Hello guys
I'm trying to make a course analysis skill.
To count how many monsters were found between the player and the cell clicked.
The player clicks somewhere on the map, and checks (cell by cell) on that route.
  If I find any mobs in the cell then it displays on the console for me:

example:

Printf ("% d Mob found", count);

I know that (src-> x,src-> y) are the coordinates of the skill invoker
And (x, y) are the coordinates of the clicked cell.

Now I need to make a for() to go check cell by cell until it reaches the target cell.
But how to do that? I'm having a hard time
Can someone help me?

Or does anyone know a function to do this?

For those who understand the language C, it should be super easy to do that.

I think logic is something like this:

		case TEST:	
	
		int mob,x,y; 
		int dir = map->calc_dir(src,x,y); //Calculate direction
	
				for () { 	//Looping for traversing cells by cell

					x += dirx[dir];
					y += diry[dir];

						if(){    //If you have a Mob in the cell
							printf(" %d Mob found, mob"); //mensage in console
							mob++;
							}

				}
                  
          break;

Someone can help me, please, I do not know who to ask for help.
 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

Sniper's Sharpshooting has a similar effect. It uses a function called map_foreachinpath, which might be something to look into.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...