diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-12 21:16:44 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-12 21:16:44 +0000 |
commit | e0efeb4efc069f8bbcfd801c0d59c55b483115cb (patch) | |
tree | 5a422fb631a9e73aca6b1a33ff237c9c5e9481f0 /src/map/mob.c | |
parent | 0b960ee5b5373b5b8343e2310bc148a2c345bd61 (diff) | |
download | hercules-e0efeb4efc069f8bbcfd801c0d59c55b483115cb.tar.gz hercules-e0efeb4efc069f8bbcfd801c0d59c55b483115cb.tar.bz2 hercules-e0efeb4efc069f8bbcfd801c0d59c55b483115cb.tar.xz hercules-e0efeb4efc069f8bbcfd801c0d59c55b483115cb.zip |
- Reverted again the change that stuns the caster on Ske, Ska, Swoo when the target is a nonplayer (rather than always)
- Modified mob_spawn_once so that coordinates -1,-1 are "random around the player" while 0,0 are random around the whole map (regardless of whether there's a player attached or not)
- Knockback will no longer work on traps during woe.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6566 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index d6f68afac..708bb4a47 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -263,7 +263,8 @@ int mob_once_spawn (struct map_session_data *sd, char *mapname, {
struct mob_data *md = NULL;
struct spawn_data data;
- int m, count, lv = 255;
+ int m, count, lv = 255, rand_flag=0;
+
if(sd) lv = sd->status.base_level;
@@ -287,20 +288,25 @@ int mob_once_spawn (struct map_session_data *sd, char *mapname, }
strncpy(data.eventname, event, 50);
- if (x <= 0 || y <= 0) {
- if (sd)
- map_search_freecell(&sd->bl, m, &x, &y, 1, 1, 0);
- else
- if (!map_search_freecell(NULL, m, &x, &y, -1, -1, 1))
- return 0; //Not solved?
+ if (sd && (x < 0 || y < 0))
+ { //Locate spot around player.
+ map_search_freecell(&sd->bl, m, &x, &y, 1, 1, 0);
+ data.x = x;
+ data.y = y;
}
- data.x = x;
- data.y = y;
+
+ if (x <= 0 || y <= 0 || map_getcell(m,x,y,CELL_CHKNOREACH))
+ rand_flag = 1; //Randomize spot on map for each mob.
if (!mob_parse_dataset(&data))
return 0;
for (count = 0; count < amount; count++) {
+ if (rand_flag) { //Get a random cell for this mob.
+ map_search_freecell(NULL, m, &x, &y, -1, -1, 1);
+ data.x = x;
+ data.y = y;
+ }
md =mob_spawn_dataset (&data);
if (class_ < 0 && battle_config.dead_branch_active)
|