diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-06 18:38:51 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-06 18:38:51 +0000 |
commit | e7096ca70629c5fd5f824cec8e2d4307e8578913 (patch) | |
tree | ae574e1de73431050206ac7d01f3f04caaec7c41 /src/map/mob.c | |
parent | 86914c88410c49b2b84084f2165fc9b581f2986e (diff) | |
download | hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.gz hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.bz2 hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.tar.xz hercules-e7096ca70629c5fd5f824cec8e2d4307e8578913.zip |
- Added define clif_deadsit to send the dead state into player packets if the player is in trick dead state.
- Venom Splasher always hits (but splash damage targets can still avoid it)
- Using autoloot with no arguments now toggles it between @autoloot 0 and @autoloot 100%
- Falcon Assault now takes Blitz Beat lv5 as base damage.
- Fixed pc_makesavestatus not updating status.option correctly.
- Corrected Waterball so that higher levels can do insane amount of hits.
- Altered slave behaviour. No more random walking, will stay within 2 cells of their master.
- Reverted the Summon Slave behaviour to not adjust level based on number of current slaves.
- Coma no longer sends SP to 1.
- Updated Meteor so that when level 11 or more is casted, the area over which meteors fall is tripled.
- Dark elemental characters are now inmune to Curse.
- Fixed sc_data saving to sql buffer building method. Thanks to its_sparky.
- Changed the map zone reading from using pow to a bit shift.
- Experience has now been changed to unsigned int, and is read as such from the dbs.
- Increased HT_DETECTING seek range to 7x7
- Added function map_foreachinrange which actually checks distance of nearing objects (unlike for each in area which uses a square area), may come handy for future code.
- Corrected Venom Splasher: Being hit does not cancels it, works at 75% or less of target's HP, being hit normally while under the count has a chance of causing poison. Damage is +400% + 50*lv%
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5204 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index b40c18495..c0597eff1 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -39,6 +39,7 @@ #define MOB_LAZYMOVEPERC 50 // Move probability in the negligent mode MOB (rate of 1000 minute)
#define MOB_LAZYWARPPERC 20 // Warp probability in the negligent mode MOB (rate of 1000 minute)
+#define MOB_SLAVEDISTANCE 2 //Distance that slaves should keep from their master.
//Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex]
struct mob_db *mob_db_data[MAX_MOB_DB+1];
struct mob_db *mob_dummy = NULL; //Dummy mob to be returned when a non-existant one is requested.
@@ -1424,18 +1425,23 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick) if((!md->target_id || md->state.targettype == NONE_ATTACKABLE) && mob_can_move(md) &&
md->master_dist<md->db->range3 && (md->walkpath.path_pos>=md->walkpath.path_len || md->walkpath.path_len==0)){
int i=0,dx,dy,ret;
- if(md->master_dist>AREA_SIZE/2 && DIFF_TICK(md->next_walktime,tick)<3000) { //Allow it to cut down the walk time to chase back. [Skotlex]
+ if(md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0)
+ { //Chase back to Master's area also if standing on top of the master.
do {
if(i<=5){
dx=bl->x - md->bl.x;
dy=bl->y - md->bl.y;
- if(dx<0) dx+=(rand()%-dx)/2; //On the minimum, half the distance between slave/master. [Skotlex]
- else if(dx>0) dx-=(rand()%dx)/2;
- if(dy<0) dy+=(rand()%-dy)/2;
- else if(dy>0) dy-=(rand()%dy)/2;
+
+ if(dx<0) dx+=rand()%MOB_SLAVEDISTANCE +1;
+ else if(dx>0) dx-=rand()%MOB_SLAVEDISTANCE +1;
+
+ if(dy<0) dy+=rand()%MOB_SLAVEDISTANCE +1;
+ else if(dy>0) dy-=rand()%MOB_SLAVEDISTANCE +1;
+
}else{
- dx=bl->x - md->bl.x + rand()%11- 5;
- dy=bl->y - md->bl.y + rand()%11- 5;
+ ret = MOB_SLAVEDISTANCE*2+1;
+ dx=bl->x - md->bl.x + rand()%ret - MOB_SLAVEDISTANCE;
+ dy=bl->y - md->bl.y + rand()%ret - MOB_SLAVEDISTANCE;
}
ret=mob_walktoxy(md,md->bl.x+dx,md->bl.y+dy,0);
@@ -1854,7 +1860,8 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) return 0;
// Nothing else to do... except random walking.
- if (mode&MD_CANMOVE && mob_can_move(md))
+ // Slaves do not random walk! [Skotlex]
+ if (mode&MD_CANMOVE && mob_can_move(md) && !md->master_id)
{
if (DIFF_TICK(md->next_walktime, tick) > 7000 &&
(md->walkpath.path_len == 0 || md->walkpath.path_pos >= md->walkpath.path_len))
|