Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
* Added missing feature flag for the Auction System. (bugreport:8980) (Hercules 646f7e2)
* Some more clean ups to skills that have a sliding effect. Thanks to exneval.
* Adjusted Flash Combo damage for renewal.
* Moved Explosion Spirits timer and added extra check to avoid map server crashes.
  • Loading branch information
aleos89 committed May 17, 2014
1 parent e4ab3be commit 577079b
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 57 deletions.
7 changes: 6 additions & 1 deletion conf/battle/feature.conf
Expand Up @@ -16,9 +16,14 @@ feature.buying_store: on
feature.search_stores: on

// Atcommand suggestions (Note 1)
// Show suggestions when typing an incomplete command?
// If one type incomplete atcommand, it will suggest the complete ones.
feature.atcommand_suggestions: off

// Auction (Note 1)
// Feature became unstable on clients 2012 onwards (exact date not known),
// it has been fixed on clients 2013-05-15 onwards however.
feature.auction: on

// Warp suggestions (Note 1)
// Show suggestions when attempting to @warp to a non-existent map?
feature.warp_suggestions: off
Expand Down
5 changes: 4 additions & 1 deletion conf/msg_conf/map_msg.conf
Expand Up @@ -516,7 +516,10 @@
515: Your instance has been reloaded.
516: Instance database has been reloaded.

//517~534: free
//src/map/atcommand.c::ACMD_FUNC(auction)

This comment has been minimized.

Copy link
@cydh

cydh May 18, 2014

Contributor

this is weird @aleos89 xD
//@auction

This comment has been minimized.

Copy link
@euphyy

euphyy May 18, 2014

Contributor

Changed in 2688d78.

517: Auction System is disabled.

//518~534: free

// Bot detect messages (currently unused)
535: Possible use of BOT (99%% of chance) or modified client by '%s' (account: %d, char_id: %d). This player ask your name when you are hidden.
Expand Down
5 changes: 5 additions & 0 deletions src/map/atcommand.c
Expand Up @@ -8315,6 +8315,11 @@ ACMD_FUNC(auction)
{
nullpo_ret(sd);

if (!battle_config.feature_auction) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(517));
return 0;
}

clif_Auction_openwindow(sd);

return 0;
Expand Down
12 changes: 8 additions & 4 deletions src/map/battle.c
Expand Up @@ -1101,12 +1101,13 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
return 0;

if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rnd()%100 < sce->val1 ) {
int dx[8]={0,-1,-1,-1,0,1,1,1};
int dy[8]={1,1,0,-1,-1,-1,0,1};
int dx[8] = { 0,-1,-1,-1,0,1,1,1 };
int dy[8] = { 1,1,0,-1,-1,-1,0,1 };
uint8 dir = map_calc_dir(bl, src->x, src->y);

if( unit_movepos(bl, src->x-dx[dir], src->y-dy[dir], 1, 1) ) {
clif_slide(bl,src->x-dx[dir],src->y-dy[dir]);
clif_slide(bl,src->x, src->y);
clif_fixpos(bl); // The official server sends these two packets
unit_setdir(bl, dir);
}
d->dmg_lv = ATK_DEF;
Expand Down Expand Up @@ -4118,7 +4119,9 @@ struct Damage battle_attack_sc_bonus(struct Damage wd, struct block_list *src, s
}
if(sc->data[SC_FLASHCOMBO]) {
ATK_ADD(wd.damage, wd.damage2, sc->data[SC_FLASHCOMBO]->val2);
RE_ALLATK_ADD(wd, sc->data[SC_FLASHCOMBO]->val2);
#ifdef RENEWAL
ATK_ADD(wd.equipAtk, wd.equipAtk2, sc->data[SC_FLASHCOMBO]->val2);
#endif
}
if(sc->data[SC_MTF_RANGEATK] && (wd.flag&(BF_LONG|BF_MAGIC)) == BF_LONG) { // Monster Transformation bonus
ATK_ADDRATE(wd.damage, wd.damage2, 25);
Expand Down Expand Up @@ -7725,6 +7728,7 @@ static const struct _battle_data {
{ "item_flooritem_check", &battle_config.item_onfloor, 1, 0, 1, },
{ "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, },
{ "drop_rateincrease", &battle_config.drop_rateincrease, 0, 0, 1, },
{ "feature.auction", &battle_config.feature_auction, 0, 0, 2, },
{ "feature.banking", &battle_config.feature_banking, 1, 0, 1, },
#ifdef VIP_ENABLE
{ "vip_storage_increase", &battle_config.vip_storage_increase, 0, 0, MAX_STORAGE-MIN_STORAGE, },
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Expand Up @@ -505,6 +505,7 @@ extern struct Battle_Config
int item_onfloor; // Whether to drop an undroppable item on the map or destroy it if inventory is full.
int bowling_bash_area;
int drop_rateincrease;
int feature_auction;
int feature_banking;
int vip_storage_increase;
int vip_base_exp_increase;
Expand Down
16 changes: 16 additions & 0 deletions src/map/clif.c
Expand Up @@ -14615,6 +14615,9 @@ void clif_Auction_openwindow(struct map_session_data *sd)
if( sd->state.storage_flag || sd->state.vending || sd->state.buyingstore || sd->state.trading )
return;

if( !battle_config.feature_auction )
return;

WFIFOHEAD(fd,packet_len(0x25f));
WFIFOW(fd,0) = 0x25f;
WFIFOL(fd,2) = 0;
Expand Down Expand Up @@ -14705,6 +14708,9 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd){
int amount = RFIFOL(fd,info->pos[1]); // Always 1
struct item_data *item;

if( !battle_config.feature_auction )
return;

if( sd->auction.amount > 0 )
sd->auction.amount = 0;

Expand Down Expand Up @@ -14782,6 +14788,9 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
struct item_data *item;
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];

if( !battle_config.feature_auction )
return;

auction.price = RFIFOL(fd,info->pos[0]);
auction.buynow = RFIFOL(fd,info->pos[1]);
auction.hours = RFIFOW(fd,info->pos[2]);
Expand Down Expand Up @@ -14914,6 +14923,9 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd){
int price = RFIFOL(fd,info->pos[1]); // FIXME: bug #5071
int page = RFIFOW(fd,info->pos[3]);

if( !battle_config.feature_auction )
return;

clif_parse_Auction_cancelreg(fd, sd);

safestrncpy(search_text, (char*)RFIFOP(fd,info->pos[2]), sizeof(search_text));
Expand All @@ -14929,6 +14941,10 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd){
void clif_parse_Auction_buysell(int fd, struct map_session_data* sd)
{
short type = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]) + 6;

if( !battle_config.feature_auction )
return;

clif_parse_Auction_cancelreg(fd, sd);

intif_Auction_requestlist(sd->status.char_id, type, 0, "", 1);
Expand Down
5 changes: 5 additions & 0 deletions src/map/script.c
Expand Up @@ -16426,6 +16426,11 @@ BUILDIN_FUNC(openauction)
if( sd == NULL )
return 0;

if( !battle_config.feature_auction ) {
clif_colormes(sd, color_table[COLOR_RED], msg_txt(517));
return 0;
}

clif_Auction_openwindow(sd);

return SCRIPT_CMD_SUCCESS;
Expand Down
92 changes: 49 additions & 43 deletions src/map/skill.c
Expand Up @@ -3072,7 +3072,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *

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
clif_fixpos(src);
}
if (i < dmg.blewcount)
skill_addtimerskill(src, tick + 300 * ((flag&2) ? 1 : 2), bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag|4);
Expand Down Expand Up @@ -4108,8 +4108,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
uint8 dir = map_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_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 0, 1) ) {
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
}

// cause damage and knockback if the path to target was a straight one
if( path )
Expand Down Expand Up @@ -4224,7 +4226,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
// Ashura Strike still has slide effect in GVG
if ((mbl == src || (!map_flag_gvg2(src->m) && !map[src->m].flag.battleground)) &&
unit_movepos(src, mbl->x + x, mbl->y + y, 1, 1)) {
clif_slide(src, src->x, src->y);
clif_slide(src, mbl->x, mbl->y);
clif_fixpos(src);
clif_spiritball(src);
}
Expand Down Expand Up @@ -4640,9 +4642,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else
y = 0;
// Doesn't have slide effect in GVG
if (!map_flag_gvg2(src->m) && !map[src->m].flag.battleground &&
unit_movepos(src, bl->x + x, bl->y + y, 1, 1)) {
clif_slide(src, bl->x + x, bl->y + y);
if (!map_flag_gvg2(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x + x, bl->y + y, 1, 1)) {
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
clif_spiritball(src);
}
Expand Down Expand Up @@ -4716,8 +4717,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
{ //You don't move on GVG grounds.
short x, y;
map_search_freecell(bl, 0, &x, &y, 1, 1, 0);
if (unit_movepos(src, x, y, 0, 0))
clif_slide(src,src->x,src->y);
if (unit_movepos(src, x, y, 0, 0)) {
clif_slide(src, src->x, src->y);
clif_fixpos(src);
}
}
status_change_end(src, SC_HIDING, INVALID_TIMER);
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
Expand Down Expand Up @@ -4760,10 +4763,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else if( dir == 7 || dir < 2 ) y = -2;
else y = 0;

if( unit_movepos(src, bl->x+x, bl->y+y, 1, 1) )
{
clif_slide(src,bl->x+x,bl->y+y);
clif_fixpos(src); // the official server send these two packts.
if( unit_movepos(src, bl->x+x, bl->y+y, 1, 1) ) {
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
if( rnd()%100 < 4 * skill_lv )
skill_castend_damage_id(src,bl,GC_CROSSIMPACT,skill_lv,tick,flag);
Expand Down Expand Up @@ -4978,9 +4980,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
short y[8]={1,1,0,-1,-1,-1,0,1};
uint8 dir = map_calc_dir(bl, src->x, src->y);

if( unit_movepos(src, bl->x+x[dir], bl->y+y[dir], 1, 1) )
{
clif_slide(src, bl->x+x[dir], bl->y+y[dir]);
if( unit_movepos(src, bl->x+x[dir], bl->y+y[dir], 1, 1) ) {
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
}
Expand Down Expand Up @@ -5039,7 +5040,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
break;

case NC_MAGNETICFIELD:
if( !map[src->m].flag.pvp ) // Doesn't affect enemies on PvP maps
if( flag&1 && !map[src->m].flag.pvp ) // Doesn't affect enemies on PvP maps
sc_start2(src,bl,SC_MAGNETICFIELD,100,skill_lv,src->id,skill_get_time(skill_id,skill_lv));
break;
case SC_FATALMENACE:
Expand All @@ -5058,8 +5059,10 @@ 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) )
clif_slide(src,bl->x,bl->y);
if( !map_flag_gvg(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);
}
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;

Expand All @@ -5074,8 +5077,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint

case SR_KNUCKLEARROW:
if( !map_flag_gvg(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.
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
}

if( flag&1 )
Expand Down Expand Up @@ -5176,8 +5179,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else
y = 0;
if (unit_movepos(src,bl->x + x,bl->y + y,1,1)) {
clif_slide(src,bl->x + x,bl->y + y);
clif_fixpos(src); //The official server send these two packts.
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
}
}
Expand Down Expand Up @@ -5290,6 +5293,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint

if (skill_id == MH_TINDER_BREAKER && unit_movepos(src, bl->x, bl->y, 1, 1)) {
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
clif_skill_poseffect(src,skill_id,skill_lv,bl->x,bl->y,tick);
}
clif_skill_nodamage(src,bl,skill_id,skill_lv,
Expand Down Expand Up @@ -5949,15 +5953,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui

case TK_JUMPKICK:
/* Check if the target is an enemy; if not, skill should fail so the character doesn't unit_movepos (exploitable) */
if( battle_check_target(src, bl, BCT_ENEMY) > 0 )
{
if( unit_movepos(src, bl->x, bl->y, 1, 1) )
{
if( battle_check_target(src, bl, BCT_ENEMY) > 0 ) {
if( unit_movepos(src, bl->x, bl->y, 1, 1) ) {
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
}
}
else
} else
clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
break;

Expand Down Expand Up @@ -7261,9 +7263,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}

clif_skill_nodamage(src,bl,TK_HIGHJUMP,skill_lv,1);
if(!map_count_oncell(src->m,x,y,BL_PC|BL_NPC|BL_MOB) && map_getcell(src->m,x,y,CELL_CHKREACH)) {
clif_slide(src,x,y);
unit_movepos(src, x, y, 1, 0);
if(!map_count_oncell(src->m,x,y,BL_PC|BL_NPC|BL_MOB) && map_getcell(src->m,x,y,CELL_CHKREACH) && unit_movepos(src, x, y, 1, 0)) {
clif_slide(src, src->x, src->y);
clif_fixpos(src);
}
}
break;
Expand Down Expand Up @@ -8151,11 +8153,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui

if (unit_movepos(src,bl->x,bl->y,0,0)) {
clif_skill_nodamage(src,src,skill_id,skill_lv,1); // Homunc
clif_slide(src,bl->x,bl->y) ;
if (unit_movepos(bl,x,y,0,0))
{
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
if (unit_movepos(bl,x,y,0,0)) {
clif_skill_nodamage(bl,bl,skill_id,skill_lv,1); // Master
clif_slide(bl,x,y) ;
clif_slide(bl, x, y);
clif_fixpos(src);
}

//TODO: Shouldn't also players and the like switch targets?
Expand Down Expand Up @@ -8946,8 +8949,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
uint8 dir = (skill_id == NC_F_SIDESLIDE) ? (unit_getdir(src)+4)%8 : unit_getdir(src);
skill_blown(src,bl,skill_get_blewcount(skill_id,skill_lv),dir,0x1);
clif_slide(src,src->x,src->y);
clif_fixpos(src); //Aegis sent this packet
clif_slide(src, src->x, src->y);
clif_fixpos(src);
clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
Expand Down Expand Up @@ -9887,14 +9890,16 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui

if (unit_movepos(src,bl->x,bl->y,0,0)) {
clif_skill_nodamage(src,src,skill_id,skill_lv,1);
clif_slide(src,bl->x,bl->y) ;
clif_slide(src, bl->x, bl->y);
clif_fixpos(src);
sc_start(src,src,SC_CONFUSION,25,skill_lv,skill_get_time(skill_id,skill_lv));
if (unit_movepos(bl,x,y,0,0))
{
clif_skill_damage(bl,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, -1, 6);
if( bl->type == BL_PC && pc_issit((TBL_PC*)bl))
clif_sitting(bl); //Avoid sitting sync problem
clif_slide(bl,x,y) ;
clif_slide(bl, x, y);
clif_fixpos(bl);
sc_start(src,bl,SC_CONFUSION,75,skill_lv,skill_get_time(skill_id,skill_lv));
}
}
Expand Down Expand Up @@ -10958,9 +10963,9 @@ 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.
unit_movepos(src, x, y, 1, 0);
clif_slide(src,x,y);
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, x, y, 1, 0) ) { //You don't move on GVG grounds.
clif_slide(src, x, y);
clif_fixpos(src);
}
status_change_end(src, SC_HIDING, INVALID_TIMER);
break;
Expand Down Expand Up @@ -11402,7 +11407,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if (unit_movepos(src,x,y,1,1)) {
enum e_skill skill_use = GS_DESPERADO;
uint8 skill_use_lv = pc_checkskill(sd,skill_use);
clif_slide(src,x,y);
clif_slide(src, x, y);
clif_fixpos(src);
if (skill_check_condition_castend(sd,skill_use,skill_use_lv)) {
sd->skill_id_old = RL_FALLEN_ANGEL;
skill_castend_pos2(src,src->x,src->y,skill_use,skill_use_lv,tick,SD_LEVEL|SD_ANIMATION|SD_SPLASH);
Expand Down

0 comments on commit 577079b

Please sign in to comment.