From 2678cc840bb707ff33378ba0d0cbfd8a737b5743 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Mon, 6 Sep 2010 19:15:17 +0000 Subject: * Implemented Icescope's fix for devotion, reflect damage is no longer absorbed by the devoter. (bugreport:3189) * As a folow up to r14301, increased MAX_REG_NUM to 256, to prevent possible data loss. * Touched up the endless tower script slightly. - Added ends to several NPCs which would allow you to restart timers. - Added some missing stopnpctimers to npcs. (bugreport:4418) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14400 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 3 +++ npc/Changelog.txt | 4 ++++ npc/instances/EndlessTower.txt | 25 ++++++++++++++++++++++++- src/common/mmo.h | 2 +- src/map/battle.c | 18 +++++++++++++++--- src/map/skill.c | 2 +- src/map/status.c | 3 ++- 7 files changed, 50 insertions(+), 7 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 375539af0..1d758875b 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,9 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2010/09/06 + * Rev. 14400 Implemented Icescope's fix for devotion, reflect damage is no longer absorbed by the devoter. (bugreport:3189) [L0ne_W0lf] + * As a folow up to r14301, increased MAX_REG_NUM to 256, to prevent possible data loss. 2010/08/28 * Force a map_quit() call on the session data after a block/ban/changesex/acc deletion to remove leftovers of a player's session caused by when the fd has already been set to eof (player is not connected) but session data is kept (e.g. autotrading). [Paradox924X] diff --git a/npc/Changelog.txt b/npc/Changelog.txt index e4cc9ace4..482b9aa2e 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -1,5 +1,9 @@ Date Added ====== +2010/09/06 + * Rev. 14400 Touched up the endless tower script slightly. [L0ne_W0lf] + - Added ends to several NPCs which would allow you to restart timers. + - Added some missing stopnpctimers to npcs. (bugreport:4418) 2010/08/28 * Rev. 14397 Removed a disablenpc from #102FShadowDust1. (bugreport:4415) [L0ne_W0lf] 2010/08/26 diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt index c7da75123..e10c2fefe 100644 --- a/npc/instances/EndlessTower.txt +++ b/npc/instances/EndlessTower.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= L0ne_W0lf //===== Current Version: ===================================== -//= 1.1 +//= 1.2 //===== Compatible With: ===================================== //= eAthena SVN //===== Description: ========================================= @@ -13,6 +13,8 @@ //===== Additional Comments: ================================= //= 1.0 First version. //= 1.1 Removed a disablenpc from #102FShadowDust1. (bugreport:4415) +//= 1.2 Added ends to several NPCs which would allow you to restart timers. +//= Added some missing stopnpctimers to npcs. (bugreport:4418) //============================================================ alberta,214,77,6 script Captain Janssen 709,{ @@ -480,6 +482,8 @@ e_tower,151,185,4 script Purification Stone#et2 844,{ } 1@tower,29,365,1 script #1F Controller 844,{ + end; + OnInstanceInit: areamonster "1@tower",7,351,17,387,"Metaling",1613,15,instance_npcname("#1F Controller", instance_id())+"::OnMyMobDead"; areamonster "1@tower",7,351,17,387,"Marin",1242,5,instance_npcname("#1F Controller", instance_id())+"::OnMyMobDead"; @@ -3818,6 +3822,8 @@ OnInstanceInit: } 6@tower,45,89,2 script Spring of Life#2 844,{ + end; + OnEnable: specialeffect EF_BUBBLE; initnpctimer; @@ -3830,6 +3836,8 @@ OnTimer2000: } 6@tower,45,89,2 script Spring of Life#3 844,{ + end; + OnEnable: specialeffect EF_BUBBLE; initnpctimer; @@ -3860,6 +3868,8 @@ OnMyMobDead: } 6@tower,156,151,2 script #1st Beeper 844,{ + end; + OnEnable: initnpctimer; end; @@ -3882,6 +3892,7 @@ OnTimer15500: OnTimer20500: instance_announce 0,"Let's see who runs fastest. Are you ready?",bc_map,"0x00ffcc"; + stopnpctimer; areamonster "6@tower",151,66,153,106,"Bone Guardian",1152,50,instance_npcname("#1st Beeper", instance_id())+"::OnMyMobDead"; areamonster "6@tower",158,66,160,106,"Bone Guardian",1152,50,instance_npcname("#1st Beeper", instance_id())+"::OnMyMobDead"; end; @@ -3898,6 +3909,8 @@ OnMyMobDead: } 6@tower,156,151,2 script #2nd Beeper 844,{ + end; + OnEnable: initnpctimer; end; @@ -3912,6 +3925,7 @@ OnTimer5500: OnTimer10500: instance_announce 0,"I demand an encore!",bc_map,"0x00ffcc"; + stopnpctimer; areamonster "6@tower",151,66,153,106,"Wind Guardian",1263,30,instance_npcname("#2nd Beeper", instance_id())+"::OnMyMobDead"; areamonster "6@tower",158,66,160,106,"Wind Guardian",1263,30,instance_npcname("#2nd Beeper", instance_id())+"::OnMyMobDead"; end; @@ -3928,6 +3942,8 @@ OnMyMobDead: } 6@tower,156,151,2 script #3rd Beeper 844,{ + end; + OnEnable: initnpctimer; end; @@ -3942,6 +3958,7 @@ OnTimer5500: OnTimer10500: instance_announce 0,"How would you like to play one more round?",bc_map,"0x00ffcc"; + stopnpctimer; areamonster "6@tower",151,66,153,106,"Sword Edge Guardian",1132,20,instance_npcname("#3rd Beeper", instance_id())+"::OnMyMobDead"; areamonster "6@tower",158,66,160,106,"Sword Edge Guardian",1132,20,instance_npcname("#3rd Beeper", instance_id())+"::OnMyMobDead"; end; @@ -3958,6 +3975,8 @@ OnMyMobDead: } 6@tower,156,151,2 script #4th Beeper 844,{ + end; + OnEnable: initnpctimer; end; @@ -4053,6 +4072,8 @@ OnTimer10500: } 6@tower,169,127,2 script #Effect30 844,{ + end; + OnInstanceInit: disablenpc instance_npcname("#Effect30", instance_id()); end; @@ -4069,6 +4090,8 @@ OnTimer1000: } 6@tower,169,127,2 script #Effect31 844,{ + end; + OnInstanceInit: disablenpc instance_npcname("#Effect31", instance_id()); end; diff --git a/src/common/mmo.h b/src/common/mmo.h index 7003d426e..f8ff895c5 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -90,7 +90,7 @@ #define ACCOUNT_REG_NUM 64 #define ACCOUNT_REG2_NUM 16 //Should hold the max of GLOBAL/ACCOUNT/ACCOUNT2 (needed for some arrays that hold all three) -#define MAX_REG_NUM 96 +#define MAX_REG_NUM 256 #define DEFAULT_WALK_SPEED 150 #define MIN_WALK_SPEED 0 #define MAX_WALK_SPEED 1000 diff --git a/src/map/battle.c b/src/map/battle.c index 064ac3a7c..66a64828c 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -164,7 +164,13 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr data) check_distance_bl(dat->src, target, dat->distance)) //Check to see if you haven't teleported. [Skotlex] { map_freeblock_lock(); - status_fix_damage(dat->src, target, dat->damage, dat->delay); + if(dat->skill_id != CR_REFLECTSHIELD) + status_fix_damage(dat->src, target, dat->damage, dat->delay); // We have to seperate here between reflect damage and others [icescope] + else + { + status_damage(dat->src, map_id2bl(dat->target), dat->damage, 0, dat->delay, 16); + dat->skill_id = 0; + } if( dat->attack_type && !status_isdead(target) ) skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,dat->dmg_lv,tick); if( dat->damage > 0 && dat->attack_type ) @@ -183,7 +189,13 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, if (!battle_config.delay_battle_damage) { map_freeblock_lock(); - status_fix_damage(src, target, damage, ddelay); + if(skill_id != CR_REFLECTSHIELD) + status_fix_damage(src, target, damage, ddelay); // We have to seperate here between reflect damage and others [icescope] + else + { + status_damage(src, target, damage, 0, ddelay, 16); + skill_id = 0; + } if( attack_type && !status_isdead(target) ) skill_additional_effect(src, target, skill_id, skill_lv, attack_type, dmg_lv, gettick()); if( damage > 0 && attack_type ) @@ -3216,7 +3228,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t if (rdamage > 0) { //By sending attack type "none" skill_additional_effect won't be invoked. [Skotlex] if(tsd && src != target) battle_drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src)); - battle_delay_damage(tick, wd.amotion, target, src, 0, 0, 0, rdamage, ATK_DEF, rdelay); + battle_delay_damage(tick, wd.amotion, target, src, 0, CR_REFLECTSHIELD, 0, rdamage, ATK_DEF, rdelay); // the skill id is needed we use CR_REFLECTSHIELD as default [icescope] } if (tsc) { diff --git a/src/map/skill.c b/src/map/skill.c index 0212516a5..4e43ce6ba 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1948,7 +1948,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds if( rdamage > 0 ) { if( dmg.amotion ) - battle_delay_damage(tick, dmg.amotion,bl,src,0,0,0,rdamage,ATK_DEF,0); + battle_delay_damage(tick, dmg.amotion,bl,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,0); // also here the reflect shield, but for skills [icescope] else status_fix_damage(bl,src,rdamage,0); clif_damage(src,src,tick, dmg.amotion,0,rdamage,dmg.div_>1?dmg.div_:1,4,0); diff --git a/src/map/status.c b/src/map/status.c index f65771045..1e40018a5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -640,6 +640,7 @@ int status_charge(struct block_list* bl, int hp, int sp) //If flag&2, fail if target does not has enough to substract. //If flag&4, if killed, mob must not give exp/loot. //If flag&8, sp loss on dead target. +//If flag&16, reflect damage is done, which can't be absorbed by Devotion. [icescope] int status_damage(struct block_list *src,struct block_list *target,int hp, int sp, int walkdelay, int flag) { struct status_data *status; @@ -680,7 +681,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s if( battle_config.invincible_nodamage && src && sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] ) hp = 1; - if( hp && !(flag&(1|8)) ) { + if( hp && !(flag&(1|8|16)) ) { if( sc ) { struct status_change_entry *sce; if( (sce = sc->data[SC_DEVOTION]) && src && battle_getcurrentskill(src) != PA_PRESSURE ) -- cgit v1.2.3-60-g2f50