summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-14 00:05:13 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-14 00:05:13 +0000
commit5a1b01d69d45b054aef505abdb693c8fc3fdd213 (patch)
treea5c56c6e512a01c64d731c21f41d6ee6f76d6e2e /src/map/status.c
parentb833ae56df9190c62169bd321a1ae0ee93f1ce7b (diff)
downloadhercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.gz
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.bz2
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.tar.xz
hercules-5a1b01d69d45b054aef505abdb693c8fc3fdd213.zip
- Modified map_foreachinrange so that you can also specify the max length of the path to use. The max_count field in the skill_db is used to specify this range for path-type skills (Sharpshooting, Kamaitachi and the NPC Breath skills.
- Implemented the 'new' NPC skills described here: http://ro.doddlercon.com/wiki/index.php?title=Monster_Skills . It is mostly complete, but the new status changes (slow cast, critical wounds, etc) don't have any visual effects yet (icon or opt changes? I don't know if they should have). Also I could not find the unit_id for Evil Land, so it looks just like Sanctuary for now. Apart from those, the only skills which I couldn't get to display properly are the Breath skills (with the exception of Fire Breath). - skill_calc_heal now takes the target as argument to properly support Critical Wounds - battle_calc_return_damage now takes a flag to know if the attack was direct or not, needed since Magic Mirror also reflects indirect attacks. - cleaned up the 'description' field in skill.c, added skill_get_desc to it - Removed 'splash' support from Lex Divina as it is no longer needed. - Modified the way Sight/Sightblaster work so that the skill id is no longer guessed (needed to properly acquire the splash range for Wide Sight) - Corrected gtb_sc_immunity setting not taking effect if your block value was the same (that is, if the config said 30%, then you would only get status change immunity at 31%, nor 30%) - Uncommented the 'new' npc skills from mob_skill_db as they are implemented now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11000 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c58
1 files changed, 53 insertions, 5 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 7fb2c870e..37d37b3bf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -369,6 +369,26 @@ void initChangeTables(void)
set_sc(NJ_NEN, SC_NEN, SI_NEN, SCB_STR|SCB_INT);
set_sc(NJ_UTSUSEMI, SC_UTSUSEMI, SI_UTSUSEMI,SCB_NONE);
set_sc(NJ_BUNSINJYUTSU, SC_BUNSINJYUTSU, SI_BUNSINJYUTSU, SCB_DYE);
+
+ add_sc(NPC_ICEBREATH, SC_FREEZE);
+ add_sc(NPC_ACIDBREATH, SC_POISON);
+ add_sc(NPC_HELLJUDGEMENT, SC_CURSE);
+ add_sc(NPC_WIDESILENCE, SC_SILENCE);
+ add_sc(NPC_WIDEFREEZE, SC_FREEZE);
+ add_sc(NPC_WIDEBLEEDING, SC_BLEEDING);
+ add_sc(NPC_WIDESTONE, SC_STONE);
+ add_sc(NPC_WIDECONFUSE, SC_CONFUSION);
+ add_sc(NPC_WIDESLEEP, SC_SLEEP);
+ add_sc(NPC_WIDESIGHT, SC_SIGHT);
+ add_sc(NPC_EVILLAND, SC_BLIND);
+ add_sc(NPC_MAGICMIRROR, SC_MAGICMIRROR);
+ add_sc(NPC_SLOWCAST, SC_SLOWCAST);
+ add_sc(NPC_CRITICALWOUND, SC_CRITICALWOUND);
+ set_sc(NPC_STONESKIN, SC_ARMORCHANGE, SI_BLANK, SCB_DEF|SCB_MDEF|SCB_DEF2|SCB_MDEF2);
+ add_sc(NPC_ANTIMAGIC, SC_ARMORCHANGE);
+ add_sc(NPC_WIDECURSE, SC_CURSE);
+ add_sc(NPC_WIDESTUN, SC_STUN);
+
set_sc(CR_SHRINK, SC_SHRINK, SI_SHRINK, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE2, SI_CLOSECONFINE2, SCB_NONE);
set_sc(RG_CLOSECONFINE, SC_CLOSECONFINE, SI_CLOSECONFINE, SCB_FLEE);
@@ -3523,9 +3543,11 @@ static signed char status_calc_def(struct block_list *bl, struct status_change *
return 90;
if(sc->data[SC_STEELBODY].timer!=-1)
return 90;
+ if(sc->data[SC_ARMORCHANGE].timer!=-1)
+ def += def * sc->data[SC_ARMORCHANGE].val2/100;
if(sc->data[SC_DRUMBATTLE].timer!=-1)
def += sc->data[SC_DRUMBATTLE].val3;
- if (sc->data[SC_DEFENCE].timer != -1) //[orn]
+ if(sc->data[SC_DEFENCE].timer != -1) //[orn]
def += sc->data[SC_DEFENCE].val2 ;
if(sc->data[SC_INCDEFRATE].timer!=-1)
def += def * sc->data[SC_INCDEFRATE].val1/100;
@@ -3558,6 +3580,8 @@ static signed short status_calc_def2(struct block_list *bl, struct status_change
return 0;
if(sc->data[SC_ETERNALCHAOS].timer!=-1)
return 0;
+ if(sc->data[SC_ARMORCHANGE].timer!=-1)
+ def2 += def2 * sc->data[SC_ARMORCHANGE].val2/100;
if(sc->data[SC_SUN_COMFORT].timer!=-1)
def2 += sc->data[SC_SUN_COMFORT].val2;
if(sc->data[SC_ANGELUS].timer!=-1)
@@ -3596,6 +3620,8 @@ static signed char status_calc_mdef(struct block_list *bl, struct status_change
return 90;
if(sc->data[SC_SKA].timer != -1) // [marquis007]
return 90;
+ if(sc->data[SC_ARMORCHANGE].timer!=-1)
+ mdef += mdef * sc->data[SC_ARMORCHANGE].val3/100;
if(sc->data[SC_STONE].timer!=-1 && sc->opt1 == OPT1_STONE)
mdef += 25*mdef/100;
if(sc->data[SC_FREEZE].timer!=-1)
@@ -3613,6 +3639,8 @@ static signed short status_calc_mdef2(struct block_list *bl, struct status_chang
if(sc->data[SC_BERSERK].timer!=-1)
return 0;
+ if(sc->data[SC_ARMORCHANGE].timer!=-1)
+ mdef2 += mdef2 * sc->data[SC_ARMORCHANGE].val3/100;
if(sc->data[SC_MINDBREAKER].timer!=-1)
mdef2 -= mdef2 * sc->data[SC_MINDBREAKER].val3/100;
@@ -4192,7 +4220,7 @@ int status_isimmune(struct block_list *bl)
return 100;
if (bl->type == BL_PC &&
- ((TBL_PC*)bl)->special_state.no_magic_damage > battle_config.gtb_sc_immunity)
+ ((TBL_PC*)bl)->special_state.no_magic_damage >= battle_config.gtb_sc_immunity)
return ((TBL_PC*)bl)->special_state.no_magic_damage;
return 0;
}
@@ -5227,6 +5255,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_SIGHT: /* サイト/ルアフ */
case SC_RUWACH:
case SC_SIGHTBLASTER:
+ val3 = skill_get_splash(val2, val1); //Val2 should bring the skill-id.
val2 = tick/250;
tick = 10;
break;
@@ -5751,6 +5780,26 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
else if (val2 < 0)
val2 = rand()%ELE_MAX;
break;
+ case SC_CRITICALWOUND:
+ val2 = 10*val1; //Heal effectiveness decrease
+ break;
+ case SC_MAGICMIRROR:
+ case SC_SLOWCAST:
+ val2 = 20*val1; //Magic reflection/cast rate
+ break;
+
+ case SC_ARMORCHANGE:
+ if (val2 == NPC_ANTIMAGIC)
+ { //Boost mdef
+ val2 =-20;
+ val3 = 20;
+ } else { //Boost def
+ val2 = 20;
+ val3 =-20;
+ }
+ val2*=val1; //20% per level
+ val3*=val1;
+ break;
case SC_ARMOR_ELEMENT:
//Place here SCs that have no SCB_* data, no skill associated, no ICON
//associated, and yet are not wrong/unknown. [Skotlex]
@@ -6614,9 +6663,8 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
case SC_RUWACH:
case SC_SIGHTBLASTER:
{
- map_foreachinrange( status_change_timer_sub, bl,
- skill_get_splash(StatusSkillChangeTable[type], sc->data[type].val1),
- BL_CHAR, bl,sc,type,tick);
+ map_foreachinrange( status_change_timer_sub, bl,
+ sc->data[type].val3, BL_CHAR, bl,sc,type,tick);
if( (--sc->data[type].val2)>0 ){
sc->data[type].timer=add_timer( /* タイマ?再設定 */