So, I have an idea on how to do it, but I'm still getting used to rathena again, so just to check if anyone has something similar before I crack my brain into this.
In the cpp file:
I want to cast a skill that will spawn a poring, 2 cells from where the caster is, this poring will be frozen and in the second he spawns he will start casting something for 3 seconds (basicly just a timer above his head), after this he will die and a random mob will spawn from a certain array of mobs defined by me. If the poring dies in the middle, nothing will be spawned. I think I will use something like this:
If anyone can help me by anymeans or tell me if its impossible, I would be very appreciated.
int x = 0, y = 0, i = 0, master = 0;
struct map_session_data* pl_sd = NULL;
master = sd->bl.id;
do {
x = sd->bl.x + (rnd() % 10 - 5);
y = sd->bl.y + (rnd() % 10 - 5);
} while (map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS) && i++ < 10);
if (i >= 10) {
x = sd->bl.x;
y = sd->bl.y;
}
Question
ChokituBR
So, I have an idea on how to do it, but I'm still getting used to rathena again, so just to check if anyone has something similar before I crack my brain into this.
In the cpp file:
I want to cast a skill that will spawn a poring, 2 cells from where the caster is, this poring will be frozen and in the second he spawns he will start casting something for 3 seconds (basicly just a timer above his head), after this he will die and a random mob will spawn from a certain array of mobs defined by me. If the poring dies in the middle, nothing will be spawned. I think I will use something like this:
If anyone can help me by anymeans or tell me if its impossible, I would be very appreciated.
int x = 0, y = 0, i = 0, master = 0; struct map_session_data* pl_sd = NULL; master = sd->bl.id; do { x = sd->bl.x + (rnd() % 10 - 5); y = sd->bl.y + (rnd() % 10 - 5); } while (map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS) && i++ < 10); if (i >= 10) { x = sd->bl.x; y = sd->bl.y; }
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.