Kaynağa Gözat

- Estimation /Sense/ whatever will no longer hide the vit bonus to mdef2, as reported by Playtester.
- Updated Summon Flora to summon the max number of possible plants on one cast. It will consume as many bottles as monsters summoned. Also cleaned up the function to be usable by non players.
- Added function status_get_name


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

skotlex 18 yıl önce
ebeveyn
işleme
1b4521aff2
5 değiştirilmiş dosya ile 62 ekleme ve 3 silme
  1. 5 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/clif.c
  3. 35 2
      src/map/skill.c
  4. 20 0
      src/map/status.c
  5. 1 0
      src/map/status.h

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ 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/09/14
+	* Estimation /Sense/ whatever will no longer hide the vit bonus to mdef2,
+	  as reported by Playtester. [Skotlex]
+	* Updated Summon Flora to summon the max number of possible plants on one
+	  cast. It will consume as many bottles as monsters summoned. Also cleaned up
+	  the function to be usable by non players. [Skotlex]
 	* Shadow Jump no longer goes over walls. [Skotlex]
 	* battle_calc_gvg_damage will be invoked in gvg maps regardless of woe
 	  time. [Skotlex]

+ 1 - 1
src/map/clif.c

@@ -4926,7 +4926,7 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
 		+(battle_config.estimation_type&2?status->def2:0);
 	WBUFW(buf,14)=status->race;
 	WBUFW(buf,16)= (battle_config.estimation_type&1?status->mdef:0)
-  		+(battle_config.estimation_type&2?status->mdef2 - (status->vit>>1):0);
+  		+(battle_config.estimation_type&2?status->mdef2:0);
 	WBUFW(buf,18)= status->def_ele;
 	for(i=0;i<9;i++)
 		WBUFB(buf,20+i)= (unsigned char)battle_attr_fix(NULL,dst,100,i+1,status->def_ele, status->ele_lv);

+ 35 - 2
src/map/skill.c

@@ -6079,19 +6079,52 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
 		break;
 	case AM_SPHEREMINE:
 	case AM_CANNIBALIZE:
-		if(sd) {
+		{
 			int summons[5] = { 1020, 1068, 1118, 1500, 1368 };
 			int class_ = skillid==AM_SPHEREMINE?1142:summons[skilllv-1];
+			int count,range;
 			struct mob_data *md;
 
 			// Correct info, don't change any of this! [celest]
-			md = mob_once_spawn_sub(src, src->m, x, y, sd->status.name,class_,"");
+			md = mob_once_spawn_sub(src, src->m, x, y, status_get_name(src),class_,"");
 			if (md) {
 				md->master_id = src->id;
 				md->special_state.ai = skillid==AM_SPHEREMINE?2:3;
 				md->deletetimer = add_timer (gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, md->bl.id, 0);
 				mob_spawn (md); //Now it is ready for spawning.
 			}
+			count = 5-skilllv;
+			if (count < 1 || skillid == AM_SPHEREMINE)
+				break;
+			//Summon multiple floras based on SkillLV
+			if (sd &&
+				(i = skill_get_itemid(skillid, 0)) > 0 &&
+				(range = skill_get_itemqty(skillid, 0)) > 0
+			) {
+				//FIXME: Should this be expanded to check for all 10 possible items? [Skotlex]
+				i = pc_search_inventory(sd,i);
+				if (i == -1)
+					count = 0;
+				else if (sd->status.inventory[i].amount < count*range)
+					count = sd->status.inventory[i].amount/range;
+				if (count < 1) break;
+				pc_delitem(sd, i, count*range, 0);
+			}
+			range = 3+count/2; //Spread range is based on qty to be summoned.
+			for (; count > 0 ; count--)
+			{	//Summon additional creatures.
+				short xi, yi;
+				xi=x; yi=y;
+				map_search_freecell(src, src->m, &xi, &yi, range, range, 1);
+
+				md = mob_once_spawn_sub(src, src->m, xi, yi, status_get_name(src),class_,"");
+				if (md) {
+					md->master_id = src->id;
+					md->special_state.ai = skillid==AM_SPHEREMINE?2:3;
+					md->deletetimer = add_timer (gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, md->bl.id, 0);
+					mob_spawn (md); //Now it is ready for spawning.
+				}
+			}
 		}
 		break;
 

+ 20 - 0
src/map/status.c

@@ -1312,6 +1312,9 @@ int status_calc_mob(struct mob_data* md, int first)
 	if (flag&16 && mbl)
 	{	//Max HP setting from Summon Flora/marine Sphere
 		struct unit_data *ud = unit_bl2ud(mbl);
+		//Remove special AI when this is used by regular mobs.
+		if (mbl->type == BL_MOB && !((TBL_MOB*)mbl)->special_state.ai)
+			md->special_state.ai = 0;
 		if (ud)
 		{	// different levels of HP according to skill level
 			if (ud->skillid == AM_SPHEREMINE) {
@@ -3911,6 +3914,23 @@ void status_freecast_switch(struct map_session_data *sd)
 		clif_updatestatus(sd,SP_SPEED);
 }
 
+const char * status_get_name(struct block_list *bl)
+{
+	nullpo_retr(0, bl);
+	switch (bl->type) {
+	case BL_MOB:
+		return ((struct mob_data *)bl)->name;
+	case BL_PC:
+		return ((struct map_session_data *)bl)->status.name;
+	case BL_PET:
+		return ((struct pet_data *)bl)->pet.name;
+	case BL_HOM:
+		return ((struct homun_data *)bl)->master->homunculus.name;
+	default:
+		return "Unknown";
+	}
+}
+
 /*==========================================
  * 対象のClassを返す(汎用)
  * 戻りは整数で0以上

+ 1 - 0
src/map/status.h

@@ -559,6 +559,7 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
 struct regen_data *status_get_regen_data(struct block_list *bl);
 struct status_data *status_get_status_data(struct block_list *bl);
 struct status_data *status_get_base_status(struct block_list *bl);
+const char * status_get_name(struct block_list *bl);
 int status_get_class(struct block_list *bl);
 int status_get_lv(struct block_list *bl);
 #define status_get_range(bl) status_get_status_data(bl)->rhw.range