diff options
author | shennetsind <ind@henn.et> | 2013-09-09 21:57:14 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-09-09 21:57:14 -0300 |
commit | c1c3ef1e0b356aaa89d8fba6d63b86130e8aae9c (patch) | |
tree | 0376094ca0b4276df43ecba9b97e19bd779858fe | |
parent | 2ca326b3fa3853fbc06095dbbbfee537a0387b5f (diff) | |
download | hercules-c1c3ef1e0b356aaa89d8fba6d63b86130e8aae9c.tar.gz hercules-c1c3ef1e0b356aaa89d8fba6d63b86130e8aae9c.tar.bz2 hercules-c1c3ef1e0b356aaa89d8fba6d63b86130e8aae9c.tar.xz hercules-c1c3ef1e0b356aaa89d8fba6d63b86130e8aae9c.zip |
Fixed Bug #7335
Modified several gvg checks to include checking whether it is a guild castle ( map_flag_gvg2 does so and no it doesn't mean woe:se )
Special Thanks to kyeme.
http://hercules.ws/board/tracker/issue-7335-woe-castle-behavior/
Also follow up 24ced6fcef1a95a2abd0c60b4fe90cbbc3aea268 changed 512 with its constant, special thanks to EPuncker.
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/map/clif.c | 18 | ||||
-rw-r--r-- | src/map/pc.c | 20 | ||||
-rw-r--r-- | src/map/skill.c | 28 | ||||
-rw-r--r-- | src/map/status.c | 8 |
4 files changed, 35 insertions, 39 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 32291e68f..081260ddb 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4470,7 +4470,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic WBUFL(buf,14)=sdelay; WBUFL(buf,18)=ddelay; #if PACKETVER < 20071113 - if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { + if (battle_config.hide_woe_damage && map_flag_gvg2(src->m)) { WBUFW(buf,22)=damage?div:0; WBUFW(buf,27)=damage2?div:0; } else { @@ -4480,7 +4480,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic WBUFW(buf,24)=div; WBUFB(buf,26)=type; #else - if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { + if (battle_config.hide_woe_damage && map_flag_gvg2(src->m)) { WBUFL(buf,22)=damage?div:0; WBUFL(buf,29)=damage2?div:0; } else { @@ -5149,7 +5149,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int WBUFL(buf,12)=tick; WBUFL(buf,16)=sdelay; WBUFL(buf,20)=ddelay; - if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { + if (battle_config.hide_woe_damage && map_flag_gvg2(src->m)) { WBUFW(buf,24)=damage?div:0; } else { WBUFW(buf,24)=damage; @@ -5180,7 +5180,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int WBUFL(buf,12)=tick; WBUFL(buf,16)=sdelay; WBUFL(buf,20)=ddelay; - if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { + if (battle_config.hide_woe_damage && map_flag_gvg2(src->m)) { WBUFL(buf,24)=damage?div:0; } else { WBUFL(buf,24)=damage; @@ -6968,7 +6968,7 @@ void clif_sendegg(struct map_session_data *sd) nullpo_retv(sd); fd=sd->fd; - if (battle_config.pet_no_gvg && map_flag_gvg(sd->bl.m)) { //Disable pet hatching in GvG grounds during Guild Wars [Skotlex] + if (battle_config.pet_no_gvg && map_flag_gvg2(sd->bl.m)) { //Disable pet hatching in GvG grounds during Guild Wars [Skotlex] clif->message(fd, msg_txt(666)); return; } @@ -9433,7 +9433,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) { if (map[sd->bl.m].flag.gvg_dungeon) clif->map_property(sd, MAPPROPERTY_FREEPVPZONE); //TODO: Figure out the real packet to send here. - if( map_flag_gvg(sd->bl.m) ) + if( map_flag_gvg2(sd->bl.m) ) clif->map_property(sd, MAPPROPERTY_AGITZONE); // info about nearby objects @@ -9442,7 +9442,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) { // pet if( sd->pd ) { - if( battle_config.pet_no_gvg && map_flag_gvg(sd->bl.m) ) { //Return the pet to egg. [Skotlex] + if( battle_config.pet_no_gvg && map_flag_gvg2(sd->bl.m) ) { //Return the pet to egg. [Skotlex] clif->message(sd->fd, msg_txt(666)); pet_menu(sd, 3); //Option 3 is return to egg. } else { @@ -9559,7 +9559,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) { clif->equpcheckbox(sd); #endif if( (battle_config.bg_flee_penalty != 100 || battle_config.gvg_flee_penalty != 100) && - (map_flag_gvg(sd->state.pmap) || map_flag_gvg(sd->bl.m) || map[sd->state.pmap].flag.battleground || map[sd->bl.m].flag.battleground) ) + (map_flag_gvg2(sd->state.pmap) || map_flag_gvg2(sd->bl.m) || map[sd->state.pmap].flag.battleground || map[sd->bl.m].flag.battleground) ) status_calc_bl(&sd->bl, SCB_FLEE); //Refresh flee penalty if( iMap->night_flag && map[sd->bl.m].flag.nightenabled ) { //Display night. @@ -17172,7 +17172,7 @@ void clif_cashshop_db(void) { RECREATE(clif->cs.data[i], struct hCSData *, ++clif->cs.item_count[i]); CREATE(clif->cs.data[i][ clif->cs.item_count[i] - 1 ], struct hCSData , 1); - clif->cs.data[i][ clif->cs.item_count[i] - 1 ]->id = 512; + clif->cs.data[i][ clif->cs.item_count[i] - 1 ]->id = UNKNOWN_ITEM_ID; clif->cs.data[i][ clif->cs.item_count[i] - 1 ]->price = 999; } else { for(k = 0; k < item_count; k++) { diff --git a/src/map/pc.c b/src/map/pc.c index 917e5c4ce..d40f747a3 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4185,7 +4185,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) switch( nameid ) //@TODO, lot oh harcoded nameid here { case 605: // Anodyne - if( map_flag_gvg(sd->bl.m) ) + if( map_flag_gvg2(sd->bl.m) ) return 0; case 606: if( pc_issit(sd) ) @@ -4193,7 +4193,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) break; case 601: // Fly Wing case 12212: // Giant Fly Wing - if( map[sd->bl.m].flag.noteleport || map_flag_gvg(sd->bl.m) ) + if( map[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m) ) { clif->skill_mapinfomessage(sd,0); return 0; @@ -4218,7 +4218,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) case 12024: // Red Pouch case 12103: // Bloody Branch case 12109: // Poring Box - if( map[sd->bl.m].flag.nobranch || map_flag_gvg(sd->bl.m) ) + if( map[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m) ) return 0; break; case 12210: // Bubble Gum @@ -6909,7 +6909,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { if(battle_config.pc_invincible_time) pc->setinvincibletimer(sd, battle_config.pc_invincible_time); sc_start(&sd->bl,iStatus->skill2sc(MO_STEELBODY),100,1,skill->get_time(MO_STEELBODY,1)); - if(map_flag_gvg(sd->bl.m)) + if(map_flag_gvg2(sd->bl.m)) pc_respawn_timer(INVALID_TIMER, iTimer->gettick(), sd->bl.id, 0); return 0; } @@ -6918,7 +6918,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { // changed penalty options, added death by player if pk_mode [Valaris] if(battle_config.death_penalty_type && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE // only novices will receive no penalty - && !map[sd->bl.m].flag.noexppenalty && !map_flag_gvg(sd->bl.m) + && !map[sd->bl.m].flag.noexppenalty && !map_flag_gvg2(sd->bl.m) && !sd->sc.data[SC_BABY] && !sd->sc.data[SC_CASH_DEATHPENALTY]) { unsigned int base_penalty =0; @@ -7032,16 +7032,12 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } } //GvG - if( map_flag_gvg(sd->bl.m) ) - { + if( map_flag_gvg2(sd->bl.m) ) { iTimer->add_timer(tick+1, pc_respawn_timer, sd->bl.id, 0); return 1|8; - } - else if( sd->bg_id ) - { + } else if( sd->bg_id ) { struct battleground_data *bg = bg_team_search(sd->bg_id); - if( bg && bg->mapindex > 0 ) - { // Respawn by BG + if( bg && bg->mapindex > 0 ) { // Respawn by BG iTimer->add_timer(tick+1000, pc_respawn_timer, sd->bl.id, 0); return 1|8; } diff --git a/src/map/skill.c b/src/map/skill.c index f707395eb..d9df0b869 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -561,7 +561,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) } break; case GC_DARKILLUSION: - if( map_flag_gvg(m) ) { + if( map_flag_gvg2(m) ) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 1; } @@ -3579,7 +3579,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint uint8 dir = iMap->calc_dir(bl, src->x, src->y); // teleport to target (if not on WoE grounds) - if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 0, 1) ) + if( !map_flag_gvg2(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 0, 1) ) clif->slide(src, bl->x, bl->y); // cause damage and knockback if the path to target was a straight one @@ -3690,7 +3690,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint if( dir > 2 && dir < 6 ) y = -i; else if( dir == 7 || dir < 2 ) y = i; else y = 0; - if( (mbl == src || (!map_flag_gvg(src->m) && !map[src->m].flag.battleground) ) && // only NJ_ISSEN don't have slide effect in GVG + if( (mbl == src || (!map_flag_gvg2(src->m) && !map[src->m].flag.battleground) ) && // only NJ_ISSEN don't have slide effect in GVG unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) { clif->slide(src, src->x, src->y); clif->fixpos(src); @@ -4069,7 +4069,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint sc_start(src,SC_HIDING,100,skill_lv,skill->get_time(skill_id,skill_lv)); break; case NJ_KIRIKAGE: - if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground ) + if( !map_flag_gvg2(src->m) && !map[src->m].flag.battleground ) { //You don't move on GVG grounds. short x, y; iMap->search_freecell(bl, 0, &x, &y, 1, 1, 0); @@ -4350,7 +4350,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint } break; case LG_PINPOINTATTACK: - if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) ) + if( !map_flag_gvg2(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) ) clif->slide(src,bl->x,bl->y); skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); break; @@ -4375,7 +4375,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint break; case SR_KNUCKLEARROW: - if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) ) { + if( !map_flag_gvg2(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) ) { clif->slide(src,bl->x,bl->y); clif->fixpos(src); // Aegis send this packet too. } @@ -5125,7 +5125,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui break; case ALL_RESURRECTION: - if(sd && (map_flag_gvg(bl->m) || map[bl->m].flag.battleground)) + if(sd && (map_flag_gvg2(bl->m) || map[bl->m].flag.battleground)) { //No reviving in WoE grounds! clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; @@ -9166,7 +9166,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui case KO_KYOUGAKU: { int rate = max(5, (45 + 5 * skill_lv - status_get_int(bl) / 10)); - if( sd && !map_flag_gvg(src->m) ){ + if( sd && !map_flag_gvg2(src->m) ){ clif->skill_fail(sd, skill_id, USESKILL_FAIL_SIZE, 0); break; } @@ -9191,7 +9191,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui break; case KO_GENWAKU: - if ( !map_flag_gvg(src->m) && ( dstsd || dstmd ) && !(tstatus->mode&MD_PLANT) && battle->check_target(src,bl,BCT_ENEMY) > 0 ) { + if ( !map_flag_gvg2(src->m) && ( dstsd || dstmd ) && !(tstatus->mode&MD_PLANT) && battle->check_target(src,bl,BCT_ENEMY) > 0 ) { int x = src->x, y = src->y; if( sd && rnd()%100 > max(5, (45 + 5 * skill_lv) - status_get_int(bl) / 10) ){//[(Base chance of success) - ( target's int / 10)]%. clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); @@ -9980,7 +9980,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui } break; case NJ_SHADOWJUMP: - if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground ) { //You don't move on GVG grounds. + if( !map_flag_gvg2(src->m) && !map[src->m].flag.battleground ) { //You don't move on GVG grounds. unit_movepos(src, x, y, 1, 0); clif->slide(src,x,y); } @@ -10622,7 +10622,7 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, uint16 skill ARR_FIND(0, MAX_SKILL_ITEM_REQUIRE, i, req.itemid[i] && (req.itemid[i] == ITEMID_TRAP || req.itemid[i] == ITEMID_TRAP_ALLOY)); if( req.itemid[i] ) req_item = req.itemid[i]; - if( map_flag_gvg(src->m) || map[src->m].flag.battleground ) + if( map_flag_gvg2(src->m) || map[src->m].flag.battleground ) limit *= 4; // longer trap times in WOE [celest] if( battle_config.vs_traps_bctall && map_flag_vs(src->m) && (src->type&battle_config.vs_traps_bctall) ) target = BCT_ALL; @@ -11414,7 +11414,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns const struct TimerData* td = tsc->data[type]?iTimer->get_timer(tsc->data[type]->timer):NULL; if( td ) sec = DIFF_TICK(td->tick, tick); - if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type || !map_flag_gvg(src->bl.m) ) { + if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type || !map_flag_gvg2(src->bl.m) ) { unit_movepos(bl, src->bl.x, src->bl.y, 0, 0); clif->fixpos(bl); } @@ -12937,7 +12937,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id } break; case SR_CURSEDCIRCLE: - if (map_flag_gvg(sd->bl.m)) { + if (map_flag_gvg2(sd->bl.m)) { if (iMap->foreachinrange(mob_count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) { char output[128]; @@ -14035,7 +14035,7 @@ int skill_delay_fix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) time /= 2; break; case AS_SONICBLOW: - if (!map_flag_gvg(bl->m) && !map[bl->m].flag.battleground && sc->data[SC_SOULLINK]->val2 == SL_ASSASIN) + if (!map_flag_gvg2(bl->m) && !map[bl->m].flag.battleground && sc->data[SC_SOULLINK]->val2 == SL_ASSASIN) time /= 2; break; } diff --git a/src/map/status.c b/src/map/status.c index d656a8e3a..c280d80b8 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1207,7 +1207,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, if ((sce=sc->data[SC_ENDURE]) && !sce->val4 && !sc->data[SC_LKCONCENTRATION]) { //Endure count is only reduced by non-players on non-gvg maps. //val4 signals infinite endure. [Skotlex] - if (src && src->type != BL_PC && !map_flag_gvg(target->m) && !map[target->m].flag.battleground && --(sce->val2) < 0) + if (src && src->type != BL_PC && !map_flag_gvg2(target->m) && !map[target->m].flag.battleground && --(sce->val2) < 0) status_change_end(target, SC_ENDURE, INVALID_TIMER); } if ((sce=sc->data[SC_GRAVITATION]) && sce->val3 == BCT_SELF) { @@ -1301,7 +1301,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, } } - if( sc && sc->data[SC_KAIZEL] && !map_flag_gvg(target->m) ) + if( sc && sc->data[SC_KAIZEL] && !map_flag_gvg2(target->m) ) { //flag&8 = disable Kaizel int time = skill->get_time2(SL_KAIZEL,sc->data[SC_KAIZEL]->val1); //Look for Osiris Card's bonus effect on the character and revive 100% or revive normally @@ -4786,7 +4786,7 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change { if( bl->type == BL_PC ) { - if( map_flag_gvg(bl->m) ) + if( map_flag_gvg2(bl->m) ) flee -= flee * battle_config.gvg_flee_penalty/100; else if( map[bl->m].flag.battleground ) flee -= flee * battle_config.bg_flee_penalty/100; @@ -5593,7 +5593,7 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change * static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion) { - if( !sc || !sc->count || map_flag_gvg(bl->m) || map[bl->m].flag.battleground ) + if( !sc || !sc->count || map_flag_gvg2(bl->m) || map[bl->m].flag.battleground ) return cap_value(dmotion,0,USHRT_MAX); /** * It has been confirmed on official servers that MvP mobs have no dmotion even without endure |