From 5d2225fbbf84324c1cf370bb11776b1c0a671b4a Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 30 Oct 2006 17:53:18 +0000 Subject: - Set the inf2 to encore skills of Wand of Hermode - Modified battle_calc_return_damage to take the skill id as well, now magic damage return will not work on skills tagged as ground or self targetted. - Fixed Gank not working at all with the default max steal tries setting. - Soul Drain won't work with skills tagged as self-targetted. - Improved the Suiton code so that the walk/agi penalty only applies to enemies of whoever casted the skill. - Moved the initial status_calc_pc call to when you finish loading the map, should fix equipment scripts which are based on character variables not working. - Some cleanup of the clif_parse_LoadEndAck function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9099 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 8 +++--- src/map/battle.h | 2 +- src/map/clif.c | 74 ++++++++++++++++++++++++++++---------------------------- src/map/pc.c | 4 --- src/map/skill.c | 14 ++++++++--- src/map/status.c | 11 +++++---- 6 files changed, 59 insertions(+), 54 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index 6a4dbf98f..6d6c928d7 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2761,7 +2761,7 @@ struct Damage battle_calc_attack( int attack_type, return d; } -int battle_calc_return_damage(struct block_list *bl, int *damage, int flag) { +int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag) { struct map_session_data *sd=NULL; struct status_change *sc; int rdamage = 0; @@ -2793,7 +2793,9 @@ int battle_calc_return_damage(struct block_list *bl, int *damage, int flag) { // magic_damage_return by [AppleGirl] and [Valaris] if(flag&BF_MAGIC) { - if(sd && sd->magic_damage_return && rand()%100 < sd->magic_damage_return) + if(sd && sd->magic_damage_return && + !(skill_get_inf(skill)&(INF_GROUND_SKILL|INF_SELF_SKILL)) && + rand()%100 < sd->magic_damage_return) { //Bounces back full damage, you take none. rdamage = *damage; *damage = 0; @@ -2980,7 +2982,7 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, damage = wd.damage + wd.damage2; if (damage > 0 && src != target) { - rdamage = battle_calc_return_damage(target, &damage, wd.flag); + rdamage = battle_calc_return_damage(target, 0, &damage, wd.flag); if (rdamage > 0) { rdelay = clif_damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0); //Use Reflect Shield to signal this kind of skill trigger. [Skotlex] diff --git a/src/map/battle.h b/src/map/battle.h index b27a27878..423591481 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -25,7 +25,7 @@ struct block_list; struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag); -int battle_calc_return_damage(struct block_list *bl, int *damage, int flag); +int battle_calc_return_damage(struct block_list *bl, int skill, int *damage, int flag); void battle_drain(struct map_session_data *sd, struct block_list *tbl, int rdamage, int ldamage, int race, int boss); diff --git a/src/map/clif.c b/src/map/clif.c index 6bfe4ef50..ef1499cd9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8218,11 +8218,30 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if(sd->npc_id) npc_event_dequeue(sd); if(sd->state.connect_new) { + status_calc_pc(sd,1); + + if (sd->sc.option&OPTION_FALCON) + clif_status_load(&sd->bl, SI_FALCON, 1); + if (sd->sc.option&OPTION_RIDING) + clif_status_load(&sd->bl, SI_RIDING, 1); + + //Auron reported that This skill only triggers when you logon on the map o.O [Skotlex] + if ((i = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) { + if(sd->bl.m == sd->feel_map[0].m + || sd->bl.m == sd->feel_map[1].m + || sd->bl.m == sd->feel_map[2].m) + sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i)); + } + clif_skillinfoblock(sd); clif_updatestatus(sd,SP_NEXTBASEEXP); clif_updatestatus(sd,SP_NEXTJOBEXP); clif_updatestatus(sd,SP_SKILLPOINT); clif_initialstatus(sd); + //Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex] + //[LuzZza] + //clif_guild_send_onlineinfo(sd); + } else { //For some reason the client "loses" these on map-change. clif_updatestatus(sd,SP_STR); @@ -8298,6 +8317,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_send_petdata(sd,0,0); clif_send_petdata(sd,5,battle_config.pet_hair_style); clif_send_petstatus(sd); + + if(sd->state.connect_new && sd->pd->pet.intimate > 900) + clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd)); } //homunculus [blackhole89] @@ -8311,9 +8333,23 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_homskillinfoblock(sd); } + // view equipment item +#if PACKETVER < 4 + clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); + clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield); +#else + clif_changelook(&sd->bl,LOOK_WEAPON,0); +#endif + + if(sd->vd.cloth_color) + clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF); + + if(sd->status.manner < 0) + sc_start(&sd->bl,SC_NOCHAT,100,0,0); + if(sd->state.connect_new) { - sd->state.connect_new = 0; //Delayed night effect on log-on fix for the glow-issue. Thanks to Larry. + sd->state.connect_new = 0; if (night_flag) { char tmpstr[1024]; strcpy(tmpstr, msg_txt(500)); // Actually, it's the night... @@ -8322,28 +8358,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if (map[sd->bl.m].flag.nightenabled) add_timer(gettick()+1000,clif_nighttimer,sd->bl.id,0); } - -// if(sd->status.class_ != sd->vd.class_) -// clif_refreshlook(&sd->bl,sd->bl.id,LOOK_BASE,sd->vd.class_,SELF); - - if (sd->sc.option&OPTION_FALCON) - clif_status_load(&sd->bl, SI_FALCON, 1); - if (sd->sc.option&OPTION_RIDING) - clif_status_load(&sd->bl, SI_RIDING, 1); - - //Auron reported that This skill only triggers when you logon on the map o.O [Skotlex] - if ((i = pc_checkskill(sd,SG_KNOWLEDGE)) > 0) { - if(sd->bl.m == sd->feel_map[0].m - || sd->bl.m == sd->feel_map[1].m - || sd->bl.m == sd->feel_map[2].m) - sc_start(&sd->bl, SC_KNOWLEDGE, 100, i, skill_get_time(SG_KNOWLEDGE, i)); - } - - if(sd->status.pet_id > 0 && sd->pd && sd->pd->pet.intimate > 900) - clif_pet_emotion(sd->pd,(sd->pd->pet.class_ - 100)*100 + 50 + pet_hungry_val(sd->pd)); - //Removed, for some reason chars get stuck on map-change when you send this packet!? [Skotlex] - //[LuzZza] - //clif_guild_send_onlineinfo(sd); //On Login Script. npc_script_event(sd, NPCE_LOGIN); } else @@ -8360,20 +8374,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_status_load(&sd->bl, SI_NIGHT, 0); } - // view equipment item -#if PACKETVER < 4 - clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); - clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield); -#else - clif_changelook(&sd->bl,LOOK_WEAPON,0); -#endif - - if(sd->vd.cloth_color) - clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF); - - if(sd->status.manner < 0) - sc_start(&sd->bl,SC_NOCHAT,100,0,0); - // Lance if(sd->state.event_loadmap && map[sd->bl.m].flag.loadevent){ pc_setregstr(sd, add_str("@maploaded$"), map[sd->bl.m].name); diff --git a/src/map/pc.c b/src/map/pc.c index 3f9e5eb3d..210181527 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -705,8 +705,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t sd->state.event_kill_pc = 1; sd->state.event_disconnect = 1; sd->state.event_kill_mob = 1; - - status_calc_pc(sd,1); sd->state.auth = 1; //Do not auth him until the initial stats have been placed. { //Add IP field @@ -749,8 +747,6 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1); } - if(sd->status.manner < 0) //Needed or manner will always be negative. - sc_start(&sd->bl,SC_NOCHAT,100,0,0); return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index 8559581cb..3c8a956e8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1023,7 +1023,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int skill_castend_damage_id(src,bl,HT_BLITZBEAT,(skillstate.steal_flagstatus.weapon != W_BOW && + if(dstmd && sd->status.weapon != W_BOW && (skill=pc_checkskill(sd,RG_SNATCHER)) > 0 && (skill*15 + 55) + pc_checkskill(sd,TF_STEAL)*10 > rand()%1000) { if(pc_steal_item(sd,bl,pc_checkskill(sd,TF_STEAL))) @@ -1520,7 +1520,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * } if(sd && skillid && attack_type&BF_MAGIC && status_isdead(bl) && - skill_get_inf(skillid)!=INF_GROUND_SKILL && + !(skill_get_inf(skillid)&(INF_GROUND_SKILL|INF_SELF_SKILL)) && (rate=pc_checkskill(sd,HW_SOULDRAIN))>0 ){ //Soul Drain should only work on targetted spells [Skotlex] if (pc_issit(sd)) pc_setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex] @@ -1888,7 +1888,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds damage = dmg.damage + dmg.damage2; if (damage > 0 && src != bl && src == dsrc) - rdamage = battle_calc_return_damage(bl, &damage, dmg.flag); + rdamage = battle_calc_return_damage(bl, skillid, &damage, dmg.flag); //Skill hit type type=(skillid==0)?5:skill_get_hit(skillid); @@ -6877,11 +6877,17 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned case UNT_VOLCANO: case UNT_DELUGE: case UNT_VIOLENTGALE: - case UNT_SUITON: if(sc && sc->data[type].timer==-1) sc_start(bl,type,100,sg->skill_lv,sg->limit); break; + case UNT_SUITON: + if(sc && sc->data[type].timer==-1) + sc_start4(bl,type,100,sg->skill_lv, + battle_check_target(&src->bl,bl,BCT_ENEMY)>0?1:0, //Send val3 =1 to reduce agi. + 0,0,sg->limit); + break; + case UNT_RICHMANKIM: case UNT_ETERNALCHAOS: case UNT_DRUMBATTLEFIELD: diff --git a/src/map/status.c b/src/map/status.c index 126ee5ae1..8ee4d5780 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3150,7 +3150,7 @@ static unsigned short status_calc_agi(struct block_list *bl, struct status_chang agi -= sc->data[SC_DECREASEAGI].val2; if(sc->data[SC_QUAGMIRE].timer!=-1) agi -= sc->data[SC_QUAGMIRE].val2; - if(sc->data[SC_SUITON].timer!=-1 && sc->data[SC_SUITON].val3) // does not affect players when not in PVP nor WoE. Does not affect Ninjas. + if(sc->data[SC_SUITON].timer!=-1 && sc->data[SC_SUITON].val3) agi -= sc->data[SC_SUITON].val2; if(sc->data[SC_MARIONETTE].timer!=-1) agi -= (sc->data[SC_MARIONETTE].val3>>8)&0xFF; @@ -4919,11 +4919,12 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val val2 = 0; break; case SC_SUITON: - val2 = 0; //Agi penalty - val3 = 0; //Walk speed penalty - if (status_get_class(bl) == JOB_NINJA || - (sd && !map_flag_vs(bl->m))) + if (!val2 || (sd && (sd->class_&MAPID_UPPERMASK) == MAPID_NINJA)) { + //No penalties. + val2 = 0; //Agi penalty + val3 = 0; //Walk speed penalty break; + } val3 = 50; val2 = 3*((val1+1)/3); if (val1 > 4) val2--; -- cgit v1.2.3-60-g2f50