diff --git a/db/pre-re/status.yml b/db/pre-re/status.yml index a56e6ac703..7fd5a119ad 100644 --- a/db/pre-re/status.yml +++ b/db/pre-re/status.yml @@ -327,7 +327,7 @@ Body: OnTouch: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -591,7 +591,7 @@ Body: RemoveOnDamaged: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true End: Dancing: true - Status: Loud @@ -733,7 +733,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true MinDuration: 5000 - Status: Keeping DurationLookup: NPC_KEEPING @@ -959,7 +959,7 @@ Body: States: NoMove: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Bladestop Icon: EFST_BLADESTOP DurationLookup: MO_BLADESTOP @@ -976,7 +976,7 @@ Body: NoClearbuff: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Fireweapon Icon: EFST_PROPERTYFIRE DurationLookup: SA_FLAMELAUNCHER @@ -1188,7 +1188,7 @@ Body: Flags: NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Guildaura Flags: NoDispell: true @@ -1280,7 +1280,7 @@ Body: OnTouch: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -1300,7 +1300,7 @@ Body: Opt3: Marionette: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Marionette2 Icon: EFST_MARIONETTE @@ -1315,7 +1315,7 @@ Body: Opt3: Marionette: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Changeundead Icon: EFST_PROPERTYUNDEAD @@ -1387,7 +1387,7 @@ Body: DurationLookup: CR_DEVOTION Flags: NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapIgnoreLevel: true - Status: Sacrifice DurationLookup: PA_SACRIFICE @@ -1467,7 +1467,7 @@ Body: Flags: NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Shadowweapon Icon: EFST_PROPERTYDARK DurationLookup: TK_SEVENWIND @@ -1645,7 +1645,7 @@ Body: NoClearance: true NoSave: true NoRemoveOnDead: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Closeconfine2 Icon: EFST_RG_CCONFINE_S DurationLookup: RG_CLOSECONFINE @@ -1658,7 +1658,7 @@ Body: NoClearance: true NoSave: true NoRemoveOnDead: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Dancing Icon: EFST_BDPLAYING @@ -1674,7 +1674,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true RequireWeapon: true OverlapIgnoreLevel: true - Status: Elementalchange @@ -1838,7 +1838,7 @@ Body: StopWalking: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Debuff: true - Status: Spurt Icon: EFST_STRUP @@ -2155,7 +2155,6 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true RemoveOnMapWarp: true - Status: Sun_Comfort Icon: EFST_SUN_COMFORT @@ -2373,7 +2372,7 @@ Body: Vit: true Int: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true Fail: Change: true - Status: Bloodlust @@ -3186,7 +3185,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Bite Icon: EFST_WUGBITE DurationLookup: RA_WUGBITE @@ -3218,7 +3217,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Acceleration Icon: EFST_ACCELERATION DurationLookup: NC_ACCELERATION @@ -3300,7 +3299,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Stealthfield Icon: EFST_STEALTHFIELD DurationLookup: NC_STEALTHFIELD @@ -3323,7 +3322,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Overheat Icon: EFST_OVERHEAT Flags: @@ -3743,7 +3742,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Debuff: true Fail: Hallucinationwalk: true @@ -4132,7 +4131,7 @@ Body: NoBanishingBuster: true NoClearance: true StopAttacking: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Cursedcircle_Target Icon: EFST_CURSEDCIRCLE_TARGET DurationLookup: SR_CURSEDCIRCLE @@ -4476,7 +4475,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: _Bodypaint Icon: EFST_BODYPAINT DurationLookup: SC_BODYPAINT @@ -4616,7 +4615,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: _Bloodylust Icon: EFST_BLOODYLUST DurationLookup: SC_BLOODYLUST @@ -5209,7 +5208,7 @@ Body: Flags: StopWalking: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Tinder_Breaker2 Icon: EFST_TINDER_BREAKER DurationLookup: MH_TINDER_BREAKER @@ -5220,7 +5219,7 @@ Body: Flags: StopWalking: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Cbc Icon: EFST_CBC @@ -5758,7 +5757,7 @@ Body: Flags: NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true - Status: Mtf_Aspd2 @@ -6081,7 +6080,6 @@ Body: Flags: StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true RemoveOnMapWarp: true - Status: Su_Stoop Icon: EFST_SU_STOOP @@ -6638,7 +6636,7 @@ Body: NoBanishingBuster: true NoClearance: true NoClearbuff: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Entry_Queue_Apply_Delay Icon: EFST_ENTRY_QUEUE_APPLY_DELAY Flags: @@ -6710,7 +6708,7 @@ Body: Icon: EFST_FLASHKICK DurationLookup: SJ_FLASHKICK Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -6727,7 +6725,7 @@ Body: NoClearance: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Fail: Bite: true - Status: Starstance diff --git a/db/re/status.yml b/db/re/status.yml index 4cc7adc4fd..c1cf276c2b 100644 --- a/db/re/status.yml +++ b/db/re/status.yml @@ -338,7 +338,7 @@ Body: OnTouch: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -605,7 +605,7 @@ Body: RemoveOnDamaged: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true End: Dancing: true - Status: Loud @@ -749,7 +749,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true MinDuration: 5000 - Status: Keeping DurationLookup: NPC_KEEPING @@ -975,7 +975,7 @@ Body: States: NoMove: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Bladestop Icon: EFST_BLADESTOP DurationLookup: MO_BLADESTOP @@ -992,7 +992,7 @@ Body: NoClearbuff: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Fireweapon Icon: EFST_PROPERTYFIRE DurationLookup: SA_FLAMELAUNCHER @@ -1296,7 +1296,7 @@ Body: OnTouch: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -1316,7 +1316,7 @@ Body: Opt3: Marionette: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Marionette2 Icon: EFST_MARIONETTE @@ -1331,7 +1331,7 @@ Body: Opt3: Marionette: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Changeundead Icon: EFST_PROPERTYUNDEAD @@ -1403,7 +1403,7 @@ Body: DurationLookup: CR_DEVOTION Flags: NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapIgnoreLevel: true - Status: Sacrifice DurationLookup: PA_SACRIFICE @@ -1483,7 +1483,7 @@ Body: Flags: NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Shadowweapon Icon: EFST_PROPERTYDARK DurationLookup: TK_SEVENWIND @@ -1642,7 +1642,7 @@ Body: NoClearance: true NoSave: true NoRemoveOnDead: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Closeconfine2 Icon: EFST_RG_CCONFINE_S DurationLookup: RG_CLOSECONFINE @@ -1655,7 +1655,7 @@ Body: NoClearance: true NoSave: true NoRemoveOnDead: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Dancing Icon: EFST_BDPLAYING @@ -1671,7 +1671,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true RequireWeapon: true OverlapIgnoreLevel: true - Status: Elementalchange @@ -1947,7 +1947,7 @@ Body: StopWalking: true NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Debuff: true - Status: Spurt Icon: EFST_STRUP @@ -2269,7 +2269,6 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true RemoveOnMapWarp: true - Status: Sun_Comfort Icon: EFST_SUN_COMFORT @@ -2485,7 +2484,7 @@ Body: Vit: true Int: true Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true Fail: Change: true - Status: Bloodlust @@ -3298,7 +3297,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Bite Icon: EFST_WUGBITE DurationLookup: RA_WUGBITE @@ -3330,7 +3329,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Acceleration Icon: EFST_ACCELERATION DurationLookup: NC_ACCELERATION @@ -3417,7 +3416,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Stealthfield Icon: EFST_STEALTHFIELD DurationLookup: NC_STEALTHFIELD @@ -3441,7 +3440,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Overheat Icon: EFST_OVERHEAT Flags: @@ -3883,7 +3882,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Debuff: true Fail: Hallucinationwalk: true @@ -4277,7 +4276,7 @@ Body: NoBanishingBuster: true NoClearance: true StopAttacking: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true SendVal3: true - Status: Cursedcircle_Target Icon: EFST_CURSEDCIRCLE_TARGET @@ -4622,7 +4621,7 @@ Body: NoBanishingBuster: true NoClearance: true NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true SendVal3: true - Status: _Bodypaint Icon: EFST_BODYPAINT @@ -4773,7 +4772,7 @@ Body: NoDispell: true NoBanishingBuster: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: _Bloodylust Icon: EFST_BLOODYLUST DurationLookup: SC_BLOODYLUST @@ -5446,7 +5445,7 @@ Body: Flee: true Flags: NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Tinder_Breaker2 Icon: EFST_TINDER_BREAKER DurationLookup: MH_TINDER_BREAKER @@ -5454,7 +5453,7 @@ Body: Flee: true Flags: NoSave: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true OverlapFail: true - Status: Cbc Icon: EFST_CBC @@ -5993,7 +5992,7 @@ Body: Flags: NoSave: true NoClearance: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true - Status: Extremityfist2 @@ -6327,7 +6326,6 @@ Body: Flags: StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true RemoveOnMapWarp: true - Status: Su_Stoop Icon: EFST_SU_STOOP @@ -6907,7 +6905,7 @@ Body: NoBanishingBuster: true NoClearance: true NoClearbuff: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true - Status: Entry_Queue_Apply_Delay Icon: EFST_ENTRY_QUEUE_APPLY_DELAY Flags: @@ -6979,7 +6977,7 @@ Body: Icon: EFST_FLASHKICK DurationLookup: SJ_FLASHKICK Flags: - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true @@ -6998,7 +6996,7 @@ Body: NoClearance: true StopAttacking: true RemoveOnDamaged: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true Fail: Bite: true - Status: Starstance @@ -7559,7 +7557,7 @@ Body: BlEffect: true DisplayPc: true OverlapIgnoreLevel: true - RemoveOnChangeMap: true + RemoveOnMapWarp: true NoBanishingBuster: true NoDispell: true NoClearance: true diff --git a/doc/status.txt b/doc/status.txt index d27addbb55..7ed425763d 100644 --- a/doc/status.txt +++ b/doc/status.txt @@ -227,7 +227,6 @@ Flags: Various status flags for specific status change events. RemoveOnRefresh - Removed by RK_REFRESH. RemoveOnLuxAnima - Removed by RK_LUXANIMA. RemoveOnMapWarp - Removed when warping to another map. - RemoveOnChangeMap - Removed when changing map-server. RemoveChemicalProtect - Removed by AM_CP_ARMOR/AM_CP_HELM/AM_CP_SHIELD/AM_CP_WEAPON. RemoveElementalOption - Removed by elemental changing modes/quitting/EL_TIDAL_WEAPON/EL_WATER_SCREEN on the master and elemental. RemoveOnUnequip - Removed when unequipping any type of equipment. diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 86f546a0ba..074680c08a 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -6428,7 +6428,7 @@ enum e_setpos pc_setpos(struct map_session_data* sd, unsigned short mapindex, in npc_script_event(sd, NPCE_LOGOUT); //remove from map, THEN change x/y coordinates - unit_remove_map_pc(sd,clrtype); + unit_remove_map_pc(sd,clrtype,true); sd->mapindex = mapindex; sd->bl.x=x; sd->bl.y=y; diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 8d0ce8f5b8..942e25ec3e 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -8967,7 +8967,6 @@ export_constant(SCF_SETSTAND); export_constant(SCF_FAILEDMADO); export_constant(SCF_DEBUFF); - export_constant(SCF_REMOVEONCHANGEMAP); export_constant(SCF_REMOVEONMAPWARP); export_constant(SCF_REMOVECHEMICALPROTECT); export_constant(SCF_OVERLAPFAIL); diff --git a/src/map/status.hpp b/src/map/status.hpp index 6f7840bf9d..f7a0a650a9 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -2824,7 +2824,6 @@ enum e_status_change_flag : uint16 { SCF_SETSTAND, SCF_FAILEDMADO, SCF_DEBUFF, - SCF_REMOVEONCHANGEMAP, SCF_REMOVEONMAPWARP, SCF_REMOVECHEMICALPROTECT, SCF_OVERLAPFAIL, diff --git a/src/map/unit.cpp b/src/map/unit.cpp index a3a10c1ab9..8d84d08f86 100644 --- a/src/map/unit.cpp +++ b/src/map/unit.cpp @@ -3022,7 +3022,7 @@ int unit_changetarget(struct block_list *bl, va_list ap) { * @param file, line, func: Call information for debug purposes * @return Success(1); Couldn't be removed or bl was free'd(0) */ -int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func) +int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func, bool changeZone) { struct unit_data *ud = unit_bl2ud(bl); struct status_change *sc = status_get_sc(bl); @@ -3052,13 +3052,12 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, ud->attackabletime = ud->canmove_tick /*= ud->canact_tick*/ = gettick(); if(sc && sc->count ) { // map-change/warp dispells. - status_db.removeByStatusFlag(bl, { SCF_REMOVEONCHANGEMAP }); + if (changeZone) // Zone change calls the general NoSave statuses. + status_db.removeByStatusFlag(bl, { SCF_NOSAVE }); + + if (bl->type != BL_PC) // Players are cleared in pc_setpos. + status_db.removeByStatusFlag(bl, { SCF_REMOVEONMAPWARP }); - // Ensure the bl is a PC; if so, we'll handle the removal of cloaking and cloaking exceed later - if ( bl->type != BL_PC ) { - status_change_end(bl, SC_CLOAKING, INVALID_TIMER); - status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); - } if (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF) status_change_end(bl, SC_GOSPEL, INVALID_TIMER); if (sc->data[SC_PROVOKE] && sc->data[SC_PROVOKE]->val4 == 1) @@ -3111,12 +3110,6 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, if( !sd->npc_ontouch_.empty() ) npc_touchnext_areanpc(sd,true); - // Check if warping and not changing the map. - if ( sd->state.warping && !sd->state.changemap ) { - status_change_end(bl, SC_CLOAKING, INVALID_TIMER); - status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); - } - sd->npc_shopid = 0; sd->adopt_invite = 0; @@ -3306,25 +3299,25 @@ void unit_refresh(struct block_list *bl, bool walking) { * 0: Assume bl is being warped * 1: Death, appropriate cleanup performed */ -void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype) +void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype, bool changeZone) { - unit_remove_map(&sd->bl,clrtype); + unit_remove_map(&sd->bl,clrtype, changeZone); //CLR_RESPAWN is the warp from logging out, CLR_TELEPORT is the warp from teleporting, but pets/homunc need to just 'vanish' instead of showing the warping animation. if (clrtype == CLR_RESPAWN || clrtype == CLR_TELEPORT) clrtype = CLR_OUTSIGHT; if(sd->pd) - unit_remove_map(&sd->pd->bl, clrtype); + unit_remove_map(&sd->pd->bl, clrtype, changeZone); if(hom_is_active(sd->hd)) - unit_remove_map(&sd->hd->bl, clrtype); + unit_remove_map(&sd->hd->bl, clrtype, changeZone); if(sd->md) - unit_remove_map(&sd->md->bl, clrtype); + unit_remove_map(&sd->md->bl, clrtype, changeZone); if(sd->ed) - unit_remove_map(&sd->ed->bl, clrtype); + unit_remove_map(&sd->ed->bl, clrtype, changeZone); } /** diff --git a/src/map/unit.hpp b/src/map/unit.hpp index 19228475ab..bcf172f2f8 100644 --- a/src/map/unit.hpp +++ b/src/map/unit.hpp @@ -162,11 +162,13 @@ void unit_skillunit_maxcount(unit_data& ud, uint16 skill_id, int& maxcount); // Remove unit struct unit_data* unit_bl2ud(struct block_list *bl); -void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype); +void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype, bool changeZone = false); void unit_refresh(struct block_list *bl, bool walking = false); void unit_free_pc(struct map_session_data *sd); -#define unit_remove_map(bl,clrtype) unit_remove_map_(bl,clrtype,__FILE__,__LINE__,__func__) -int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func); +int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func, bool changeZone = false); +static int unit_remove_map(block_list *bl, clr_type clrtype, bool changeZone = false) { + return unit_remove_map_(bl, clrtype, __FILE__, __LINE__, __func__, changeZone); +} int unit_free(struct block_list *bl, clr_type clrtype); int unit_changeviewsize(struct block_list *bl,short size); int unit_changetarget(struct block_list *bl,va_list ap);