From 2330caaf0c26c03119f908e739f8b685e90323dc Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 19 Dec 2013 11:33:10 +0700 Subject: [PATCH 1/2] * Fixed bugreport http://rathena.org/board/tracker/issue-8360-error-report-0000-still-images/ Signed-off-by: Cydh Ramdh --- npc/pre-re/guides/guides_payon.txt | 4 ++-- npc/re/guides/guides_payon.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npc/pre-re/guides/guides_payon.txt b/npc/pre-re/guides/guides_payon.txt index 65eb350b46..a3a0f5efdf 100644 --- a/npc/pre-re/guides/guides_payon.txt +++ b/npc/pre-re/guides/guides_payon.txt @@ -186,7 +186,7 @@ payon,162,67,4 script Guide#pay 708,{ break; } } - cutin "pay_soldier",255; + cutin "",255; end; } @@ -291,6 +291,6 @@ pay_arche,85,30,2 script Guide#2pay 708,{ break; } } - cutin "pay_soldier",255; + cutin "",255; end; } diff --git a/npc/re/guides/guides_payon.txt b/npc/re/guides/guides_payon.txt index 670da11105..ca0224f5bf 100644 --- a/npc/re/guides/guides_payon.txt +++ b/npc/re/guides/guides_payon.txt @@ -178,8 +178,8 @@ payon,163,64,3 script Guide#01payon::GuidePayon 708,{ case 4: mes "[Payon Guide]"; mes "Enjoy your stay."; - close; - cutin "pay_soldier",255; + close2; + cutin "",255; end; } } @@ -287,7 +287,7 @@ pay_arche,86,33,4 script Guide#05payon 708,{ mes "[Payon Guide]"; mes "Enjoy your stay."; close2; - cutin "pay_soldier",255; + cutin "",255; end; } } From 432cdb768645a576a3bbb4e9940b186ccfa5b4ad Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Thu, 19 Dec 2013 12:59:26 +0700 Subject: [PATCH 2/2] Implemented 'devotion_rdamage' on conf/battle/skill.conf for suggestion on http://rathena.org/board/topic/78620-renewal-devotion/ // Using 'old' behavior for devotion vs reflect damage? (Note 2) // Default is 0 (official). If 'devotion_rdamage' is > 0 (chance to devot the reflected damage), // when player with devotion attacks player with reflect damage ability (item bonus or skill), // the damage will be taken by the person who provides devotion instead the attacker. devotion_rdamage: 0 Signed-off-by: Cydh Ramdh --- conf/battle/skill.conf | 6 ++++++ src/map/battle.c | 33 ++++++++++++++++++++++++++------- src/map/battle.h | 1 + src/map/skill.c | 4 ++-- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index e941632bb3..0092876cfb 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -181,6 +181,12 @@ gx_disptype: 1 // Max Level Difference for Devotion devotion_level_difference: 10 +// Using 'old' behavior for devotion vs reflect damage? (Note 2) +// Default is 0 (official). If 'devotion_rdamage' is > 0 (chance to devot the reflected damage), +// when player with devotion attacks player with reflect damage ability (item bonus or skill), +// the damage will be taken by the person who provides devotion instead the attacker. +devotion_rdamage: 0 + // If no than you can use the ensemble skills alone. (Note 1) player_skill_partner_check: yes diff --git a/src/map/battle.c b/src/map/battle.c index 0f75cc932e..76f7fc1b37 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4477,11 +4477,20 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr // Item reflect gets calculated first rdamage = battle_calc_return_damage(target, src, &damage, wd->flag, skill_id, 0); if( rdamage > 0 ) { - //Use Reflect Shield to signal this kind of skill trigger. [Skotlex] - rdelay = clif_damage(src, src, tick, wd->amotion, sstatus->dmotion, rdamage, 1, 4, 0); + bool isDevotRdamage = false; + //Get info if the attacker has Devotion from other player + struct status_change *ssc = NULL; + struct block_list *d_bl = NULL; + if (battle_config.devotion_rdamage && battle_config.devotion_rdamage > rand()%100) { + ssc = status_get_sc(src);; + if (ssc && ssc->data[SC_DEVOTION] && (d_bl = map_id2bl(ssc->data[SC_DEVOTION]->val1))) + isDevotRdamage = true; + } + rdelay = clif_damage(src, (!isDevotRdamage) ? src : d_bl, tick, wd->amotion, sstatus->dmotion, rdamage, 1, 4, 0); if( tsd ) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src)); - battle_delay_damage(tick, wd->amotion,target,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true); - skill_additional_effect(target, src, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick); + //Use Reflect Shield to signal this kind of skill trigger. [Skotlex] + battle_delay_damage(tick, wd->amotion,target,(!isDevotRdamage) ? src : d_bl,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true); + skill_additional_effect(target, (!isDevotRdamage) ? src : d_bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick); } // Calculate skill reflect damage separately @@ -4489,6 +4498,15 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr struct status_data *tstatus = status_get_status_data(target); rdamage = battle_calc_return_damage(target, src, &damage, wd->flag, skill_id, 1); if( rdamage > 0 ) { + bool isDevotRdamage = false; + //Get info if the attacker has Devotion from other player + struct status_change *ssc = NULL; + struct block_list *d_bl = NULL; + if (battle_config.devotion_rdamage && battle_config.devotion_rdamage > rand()%100) { + ssc = status_get_sc(src);; + if (ssc && ssc->data[SC_DEVOTION] && (d_bl = map_id2bl(ssc->data[SC_DEVOTION]->val1))) + isDevotRdamage = true; + } //if(tsc->data[SC__SHADOWFORM]) { // struct block_list *s_bl = map_id2bl(tsc->data[SC__SHADOWFORM]->val2); // if(s_bl) @@ -4500,11 +4518,11 @@ void battle_do_reflect(int attack_type, struct Damage *wd, struct block_list* sr if(attack_type == BF_WEAPON && tsc->data[SC_REFLECTDAMAGE] ) // Don't reflect your own damage (Grand Cross) map_foreachinshootrange(battle_damage_area,target,skill_get_splash(LG_REFLECTDAMAGE,1),BL_CHAR,tick,target,wd->amotion,sstatus->dmotion,rdamage,tstatus->race); else if(attack_type == BF_WEAPON || attack_type == BF_MISC) { - rdelay = clif_damage(src, src, tick, wd->amotion, sstatus->dmotion, rdamage, 1, 4, 0); + rdelay = clif_damage(src, (!isDevotRdamage) ? src : d_bl, tick, wd->amotion, sstatus->dmotion, rdamage, 1, 4, 0); if( tsd ) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src)); // It appears that official servers give skill reflect damage a longer delay - battle_delay_damage(tick, wd->amotion,target,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true); - skill_additional_effect(target, src, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick); + battle_delay_damage(tick, wd->amotion,target,(!isDevotRdamage) ? src : d_bl,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,rdelay,true); + skill_additional_effect(target, (!isDevotRdamage) ? src : d_bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick); } } } @@ -7264,6 +7282,7 @@ static const struct _battle_data { { "emblem_transparency_limit", &battle_config.emblem_transparency_limit, 80, 0, 100, }, { "discount_item_point_shop", &battle_config.discount_item_point_shop, 0, 0, 3, }, { "update_enemy_position", &battle_config.update_enemy_position, 0, 0, 1, }, + { "devotion_rdamage", &battle_config.devotion_rdamage, 0, 0, 100, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index a51fbc13ab..04b7094839 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -514,6 +514,7 @@ extern struct Battle_Config int emblem_transparency_limit; int discount_item_point_shop; int update_enemy_position; + int devotion_rdamage; } battle_config; void do_init_battle(void); diff --git a/src/map/skill.c b/src/map/skill.c index 5cd364e50f..3279d23cb4 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2657,7 +2657,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list * //Reduction: 6% + 6% every 20% dmg.damage -= dmg.damage * (6 * (1+per)) / 100; } - } + } #endif } if(tsc && tsc->data[SC_MAGICROD] && src == dsrc) { @@ -5952,7 +5952,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui mer->devotion_flag = 1; // Mercenary Devoting Owner clif_skill_nodamage(src, bl, skill_id, skill_lv, - sc_start4(src,bl, type, 100, src->id, i, skill_get_range2(src,skill_id,skill_lv),0, skill_get_time2(skill_id, skill_lv))); + sc_start4(src, bl, type, 100, src->id, i, skill_get_range2(src,skill_id,skill_lv),0, skill_get_time2(skill_id, skill_lv))); clif_devotion(src, NULL); } break;