Sfoglia il codice sorgente

- Added mob mode 0x4000, MD_TARGETWEAK: It makes aggro monsters only chase characters whose level is no higher than the monster's +5.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13867 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 16 anni fa
parent
commit
f5fa9d4daa
3 ha cambiato i file con 27 aggiunte e 17 eliminazioni
  1. 20 16
      doc/mob_db_mode_list.txt
  2. 6 1
      src/map/mob.c
  3. 1 0
      src/map/status.h

+ 20 - 16
doc/mob_db_mode_list.txt

@@ -13,21 +13,21 @@
 Bit Legend:
 -------------------------------------------------------------------------------
 
-MD_CANMOVE            | 0x0001 |    1
-MD_LOOTER             | 0x0002 |    2
-MD_AGGRESSIVE         | 0x0004 |    4
-MD_ASSIST             | 0x0008 |    8
-MD_CASTSENSOR_IDLE    | 0x0010 |   16
-MD_BOSS               | 0x0020 |   32
-MD_PLANT              | 0x0040 |   64
-MD_CANATTACK          | 0x0080 |  128
-MD_DETECTOR           | 0x0100 |  256
-MD_CASTSENSOR_CHASE   | 0x0200 |  512
-MD_CHANGECHASE        | 0x0400 | 1024
-MD_ANGRY              | 0x0800 | 2048
-MD_CHANGETARGET_MELEE | 0x1000 | 4096
-MD_CHANGETARGET_CHASE | 0x2000 | 8192
-
+MD_CANMOVE            | 0x0001 |      1
+MD_LOOTER             | 0x0002 |      2
+MD_AGGRESSIVE         | 0x0004 |      4
+MD_ASSIST             | 0x0008 |      8
+MD_CASTSENSOR_IDLE    | 0x0010 |     16
+MD_BOSS               | 0x0020 |     32
+MD_PLANT              | 0x0040 |     64
+MD_CANATTACK          | 0x0080 |    128
+MD_DETECTOR           | 0x0100 |    256
+MD_CASTSENSOR_CHASE   | 0x0200 |    512
+MD_CHANGECHASE        | 0x0400 |   1024
+MD_ANGRY              | 0x0800 |   2048
+MD_CHANGETARGET_MELEE | 0x1000 |   4096
+MD_CHANGETARGET_CHASE | 0x2000 |   8192
+MD_TARGETWEAK         | 0x4000 | 126384
 Explanation for modes:
 -------------------------------------------------------------------------------
 
@@ -70,6 +70,9 @@ Change Target Melee: Enables a mob to switch targets when attacked while
 Change Target Chase: Enables a mob to switch targets when attacked while
 	chasing another character.
 
+Target Weak: Allows aggressive monsters to only be aggressive against 
+   characters that aren't five or more levels above the monster's.
+
 Aegis Mob Types:
 -------------------------------------------------------------------------------
 
@@ -85,6 +88,7 @@ Aegis/eA (description)
 05: 0x2085 (aggro, change-target chase)
 06: 0x0000 (passive, immobile, can't attack) [plants]
 07: 0x108B (passive, looter, assist, change-target melee)
+08: 0x6085 (aggro, change-target chase, target weak enemies)
 09: 0x3095 (aggro, change-target melee/chase, cast sensor idle) [Guardian]
 10: 0x0084 (aggro, immobile)
 11: 0x0084 (aggro, immobile) [Guardian]
@@ -95,5 +99,5 @@ Aegis/eA (description)
 20: 0x3295 (aggro, change-target melee/chase, cast sensor idle/chase)
 21: 0x3695 (aggro, change-target melee/chase, cast sensor idle/chase, chase-change target)
 
-- Note that the detector bit due to being Insect/Demon, plant  and Boss mode
+- Note that the detector bit due to being Insect/Demon, plant and Boss mode
   bits need to be added independently of this list.

+ 6 - 1
src/map/mob.c

@@ -955,16 +955,21 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
 {
 	struct mob_data *md;
 	struct block_list **target;
+	int mode;
 	int dist;
 
 	nullpo_retr(0, bl);
 	md=va_arg(ap,struct mob_data *);
 	target= va_arg(ap,struct block_list**);
+	mode= va_arg(ap,int);
 
 	//If can't seek yet, not an enemy, or you can't attack it, skip.
 	if ((*target) == bl || !status_check_skilluse(&md->bl, bl, 0, 0))
 		return 0;
 
+	if ((mode&MD_TARGETWEAK) && status_get_lv(bl) >= md->level+5)
+		return 0;
+
 	if(battle_check_target(&md->bl,bl,BCT_ENEMY)<=0)
 		return 0;
 
@@ -1414,7 +1419,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
 
 	if ((!tbl && mode&MD_AGGRESSIVE) || md->state.skillstate == MSS_FOLLOW)
 	{
-		map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl);
+		map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl, mode);
 	}
 	else
 	if (mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW))

+ 1 - 0
src/map/status.h

@@ -668,6 +668,7 @@ extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% suc
 #define MD_ANGRY 0x0800
 #define MD_CHANGETARGET_MELEE 0x1000
 #define MD_CHANGETARGET_CHASE 0x2000
+#define MD_TARGETWEAK 0x4000
 #define MD_MASK 0xFFFF
 
 //Status change option definitions (options are what makes status changes visible to chars