Sfoglia il codice sorgente

- Fixed summon mobs being able to cast "summon" skills.
- Summoned mobs will inherit the size and ai properties of the master.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5790 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 anni fa
parent
commit
15092b4955
3 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 2 0
      Changelog-Trunk.txt
  2. 2 0
      src/map/mob.c
  3. 9 0
      src/map/unit.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 
 
 2006/03/28
+	* Fixed summon mobs being able to cast "summon" skills. [Skotlex]
+	* Summoned mobs will inherit the size and ai properties of the master. [Skotlex]
 	* Added a debug function to locate all "looping warps". [Skotlex]
 	- Now will someone help cleanup those warps?
 	* Some cleanup of the skill-use functions in clif.c [Skotlex]

+ 2 - 0
src/map/mob.c

@@ -2503,6 +2503,8 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
 	data.x = md2->bl.x;
 	data.y = md2->bl.y;
 	data.num = 1;
+	data.state.size = md2->special_state.size;
+	data.state.ai = md2->special_state.ai;
 
 	if(mobdb_checkid(value[0]) == 0)
 		return 0;

+ 9 - 0
src/map/unit.c

@@ -773,6 +773,15 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
 		if (!skill_check_condition(sd, skill_num, skill_lv, 0))
 			return 0;	
 	}
+	//TODO: Add type-independant skill_check_condition function.
+	if (src->type == BL_MOB) {
+		switch (skill_num) {
+			case NPC_SUMMONSLAVE:
+			case NPC_SUMMONMONSTER:
+				if (((TBL_MOB*)src)->master_id)
+					return 0;
+		}
+	}
 
 	if(src->id != target_id &&
 		!battle_check_range(src,target,skill_get_range2(src, skill_num,skill_lv)