Selaa lähdekoodia

* Fixed SC_CHANGEUNDEAD behavior: Blessing and Increase AGI deals 1 damage and does not apply buffs to those inflicted by it.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12862 54d463be-8e91-2dee-dedb-b68131a5f0ec
sketchyphoenix 17 vuotta sitten
vanhempi
commit
7173c6123f
2 muutettua tiedostoa jossa 17 lisäystä ja 2 poistoa
  1. 1 0
      Changelog-Trunk.txt
  2. 16 2
      src/map/skill.c

+ 1 - 0
Changelog-Trunk.txt

@@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2008/06/19
 	* Added Sirius_White's fix for sense working on emperium. (bugreport: 1679) [SketchyPhoenix]
+	* Fixed SC_CHANGEUNDEAD behavior: Blessing and Increase AGI deals 1 damage and does not apply buffs to those inflicted by it.
 2008/06/18
 	* Added a fix for refresh properly displaying dead and sitting players. [SketchyPhoenix]
 	* Fixed basilica behavior not knocking back monsters 2 cells should one attempt to enter the field.

+ 16 - 2
src/map/skill.c

@@ -278,8 +278,11 @@ int skill_calc_heal (struct block_list *src, struct block_list *target, int skil
 }
 
 // Making plagiarize check its own function [Aru]
-int can_copy (struct map_session_data *sd, int skillid)
+int can_copy (struct map_session_data *sd, int skillid, struct block_list* bl)
 {
+	struct status_change* sc;
+	sc = status_get_sc(bl);
+	
 	// Never copy NPC/Wedding Skills
 	if (skill_get_inf2(skillid)&(INF2_NPC_SKILL|INF2_WEDDING_SKILL))
 		return 0;
@@ -293,6 +296,10 @@ int can_copy (struct map_session_data *sd, int skillid)
 			return (sd->status.class_ == JOB_STALKER);
 	}
 
+	//don't copy increase agi or blessing from someone who is inflicted with sc_changeundead
+	if ((skillid == AL_INCAGI || skillid == AL_BLESSING) && sd->sc.data[SC_CHANGEUNDEAD])
+		return 0;
+		
 	return 1;
 }
 
@@ -1465,6 +1472,9 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
 	}
 
 	damage = dmg.damage + dmg.damage2;
+	
+	if (skillid == AL_INCAGI || skillid == AL_BLESSING && tsd->sc.data[SC_CHANGEUNDEAD])
+		damage = 1;
 
 	if (damage > 0 && dmg.flag&BF_WEAPON && src != bl && src == dsrc &&
 		skillid != WS_CARTTERMINATION) // FIXME(?): Quick and dirty check, but HSCR does bypass Shield Reflect... so I make it bypass the whole reflect thing [DracoRPG]
@@ -1611,7 +1621,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
 		&& damage < tsd->status.hp)
 	{	//Updated to not be able to copy skills if the blow will kill you. [Skotlex]
 		if ((!tsd->status.skill[skillid].id || tsd->status.skill[skillid].flag >= 13) &&
-			can_copy(tsd,skillid))	// Split all the check into their own function [Aru]
+			can_copy(tsd,skillid,bl))	// Split all the check into their own function [Aru]
 		{
 			int lv = skilllv;
 			if (tsd->cloneskill_id && tsd->status.skill[tsd->cloneskill_id].flag == 13){
@@ -3293,6 +3303,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 
 	case AL_INCAGI:
 	case AL_BLESSING:
+		if (dstsd != NULL && tsc->data[SC_CHANGEUNDEAD]) {
+			skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
+			break;
+		}
 	case PR_SLOWPOISON:
 	case PR_IMPOSITIO:
 	case PR_LEXAETERNA: