diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-16 14:44:27 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-01-16 14:44:27 +0000 |
commit | d4e1028f77e7b03023901c16f6329414a8a3c24c (patch) | |
tree | 3774fe0e35508141be8b8c1cf5d2bee5940c1d9b /src/map | |
parent | 8ff8d0f9ee285452ba7820c3fb333eddb042272b (diff) | |
download | hercules-d4e1028f77e7b03023901c16f6329414a8a3c24c.tar.gz hercules-d4e1028f77e7b03023901c16f6329414a8a3c24c.tar.bz2 hercules-d4e1028f77e7b03023901c16f6329414a8a3c24c.tar.xz hercules-d4e1028f77e7b03023901c16f6329414a8a3c24c.zip |
- Implemented Intravision as it should be. Thanks to HelloKitty2 for the captured packets.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9659 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 53 | ||||
-rw-r--r-- | src/map/pc.c | 4 | ||||
-rw-r--r-- | src/map/status.c | 9 |
3 files changed, 9 insertions, 57 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 077bc4139..a7988b0f1 100644 --- a/src/map/clif.c +++ b/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); } } diff --git a/src/map/pc.c b/src/map/pc.c index a9f0f4d67..665056fb7 100644 --- a/src/map/pc.c +++ b/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) diff --git a/src/map/status.c b/src/map/status.c index b8572c0bf..4194b0c6b 100644 --- a/src/map/status.c +++ b/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; |