Selaa lähdekoodia

- Implemented Intravision as it should be. Thanks to HelloKitty2 for the captured packets.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9659 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 vuotta sitten
vanhempi
commit
29b474c8ab
4 muutettua tiedostoa jossa 11 lisäystä ja 57 poistoa
  1. 2 0
      Changelog-Trunk.txt
  2. 0 53
      src/map/clif.c
  3. 3 1
      src/map/pc.c
  4. 6 3
      src/map/status.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.
 
 2007/01/16
+	* Implemented Intravision as it should be. Thanks to HelloKitty2 for the
+	  captured packets.
 	* Some cleaning on the mob_ai to enable mobs to run away from their current
 	  target when they are rude-attacked by them.
 2007/01/15

+ 0 - 53
src/map/clif.c

@@ -278,59 +278,6 @@ int clif_send_sub(struct block_list *bl, va_list ap)
 		} else {
 			if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
 				memcpy(WFIFOP(fd,0), buf, len);
-				//Check if hidden, better to modify the char's buffer than the
-				//given buffer to prevent intravision affecting the packet as 
-				//it's being received by everyone. [Skotlex]
-				/* New implementation... not quite correct yet as the client no longer
-				 * displays correctly the SI_INTRAVISION effect.
-				if ((sd->special_state.intravision || sd->sc.data[SC_INTRAVISION].timer != -1 )
-						&& bl != src_bl && WFIFOW(fd,0) == 0x0196)
-				{	//New intravision method, just modify the status change/start packet. [Skotlex]
-					switch (WFIFOW(fd,2)) {
-						case SI_HIDING:
-						case SI_CLOAKING:
-						case SI_CHASEWALK:
-							WFIFOW(fd,2) = SI_INTRAVISION;
-					}
-				}
-				*/
-
-				// Previous implementation.
-				if ((sd->special_state.intravision || sd->sc.data[SC_INTRAVISION].timer != -1 ) && bl != src_bl) {
-
-					struct status_change *sc = status_get_sc(src_bl);
-					if(sc && (sc->option&(OPTION_HIDE|OPTION_CLOAK)))
-					{	//option‚Ì�C�³
-						switch(((unsigned short*)buf)[0])
-						{
-#if PACKETVER > 6
-							case 0x229:
-								WFIFOL(fd,10) &= ~(OPTION_HIDE|OPTION_CLOAK);
-								break;
-							case 0x22a:
-							case 0x22b:
-							case 0x22c:
-								WFIFOL(fd,12) &=~(OPTION_HIDE|OPTION_CLOAK);
-								break;
-#endif
-#if PACKETVER > 3
-							case 0x119:
-								WFIFOW(fd,10) &= ~(OPTION_HIDE|OPTION_CLOAK);
-								break;
-							case 0x1d8:
-							case 0x1d9:
-							case 0x1da:
-#endif
-							case 0x78:
-							case 0x79:
-							case 0x7a:
-							case 0x7b:
-							case 0x7c:
-								WFIFOW(fd,12) &=~(OPTION_HIDE|OPTION_CLOAK);
-								break;
-						}
-					}
-				}
 				WFIFOSET(fd,len);
 			}
 		}

+ 3 - 1
src/map/pc.c

@@ -1702,8 +1702,10 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
 			sd->special_state.no_gemstone = 1;
 		break;
 	case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
-		if(sd->state.lr_flag != 2)
+		if(sd->state.lr_flag != 2) {
 			sd->special_state.intravision = 1;
+			clif_status_load(&sd->bl, SI_INTRAVISION, 1);
+		}
 		break;
 	case SP_SPLASH_RANGE:
 		if(sd->state.lr_flag != 2 && sd->splash_range < val)

+ 6 - 3
src/map/status.c

@@ -417,7 +417,8 @@ void initChangeTables(void) {
 	StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION2;
 	StatusIconChangeTable[SC_INCSTR] = SI_INCSTR;
 	StatusIconChangeTable[SC_MIRACLE] = SI_SPIRIT;
-	
+	StatusIconChangeTable[SC_INTRAVISION] = SI_INTRAVISION;
+
 	//Other SC which are not necessarily associated to skills.
 	StatusChangeFlagTable[SC_ASPDPOTION0] = SCB_ASPD;
 	StatusChangeFlagTable[SC_ASPDPOTION1] = SCB_ASPD;
@@ -1606,6 +1607,9 @@ int status_calc_pc(struct map_session_data* sd,int first)
 	memset (&sd->right_weapon.overrefine, 0, sizeof(sd->right_weapon) - sizeof(sd->right_weapon.atkmods));
 	memset (&sd->left_weapon.overrefine, 0, sizeof(sd->left_weapon) - sizeof(sd->left_weapon.atkmods));
 
+	if (sd->special_state.intravision) //Clear status change.
+		clif_status_load(&sd->bl, SI_INTRAVISION, 0);
+
 	memset(&sd->special_state,0,sizeof(sd->special_state));
 	memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp)+sizeof(status->lhw)));
 	memset(status->lhw, 0, sizeof(struct weapon_atk));
@@ -5695,7 +5699,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 			val3 = BF_LONG; //Range
 			val4 = BF_WEAPON|BF_MISC; //Type
 			break;
-		case SC_INTRAVISION:
 		case SC_ARMOR_ELEMENT:
 			//Place here SCs that have no SCB_* data, no skill associated, no ICON
 			//associated, and yet are not wrong/unknown. [Skotlex]
@@ -5704,7 +5707,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
 			if (calc_flag == SCB_NONE &&
 				StatusSkillChangeTable[type]==0 &&
 				StatusIconChangeTable[type]==0)
-			{	//Status change with no calc, and no skill associated...? unknown?
+			{	//Status change with no calc, no icon, and no skill associated...? 
 				if(battle_config.error_log)
 					ShowError("UnknownStatusChange [%d]\n", type);
 				return 0;