diff options
author | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-06-01 23:01:54 +0000 |
---|---|---|
committer | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-06-01 23:01:54 +0000 |
commit | f1c4780376953eae3c5e38b7615c06e07b178431 (patch) | |
tree | f174d175dbf283294387ae724a01ccb8e3756427 /src | |
parent | ebab0958bab3daf5834d5805ef3425a11fffc3bb (diff) | |
download | hercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.gz hercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.bz2 hercules-f1c4780376953eae3c5e38b7615c06e07b178431.tar.xz hercules-f1c4780376953eae3c5e38b7615c06e07b178431.zip |
* Implemented the Manuk and Splendide item status effects, thanks to Epoque.
* Implemented Manuk and Splendide consumable items.
* Added Splendide and Manuk merchants.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14327 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 39 | ||||
-rw-r--r-- | src/map/mob.c | 4 | ||||
-rw-r--r-- | src/map/mob.h | 4 | ||||
-rw-r--r-- | src/map/status.c | 17 | ||||
-rw-r--r-- | src/map/status.h | 10 |
5 files changed, 73 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index a95e29079..b31847606 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -430,6 +430,23 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag damage >>= 2; //75% reduction } + // Compressed code, fixed by map.h [Epoque] + if (src->type == BL_MOB) { + int i; + if (sc->data[SC_MANU_DEF]) + for (i=0;ARRAYLENGTH(mob_manuk)>i;i++) + if (mob_manuk[i]==((TBL_MOB*)src)->class_) { + damage -= sc->data[SC_MANU_DEF]->val1*damage/100; + break; + } + if (sc->data[SC_SPL_DEF]) + for (i=0;ARRAYLENGTH(mob_splendide)>i;i++) + if (mob_splendide[i]==((TBL_MOB*)src)->class_) { + damage -= sc->data[SC_SPL_DEF]->val1*damage/100; + break; + } + } + if((sce=sc->data[SC_ARMOR]) && //NPC_DEFENDER sce->val3&flag && sce->val4&flag) damage -= damage*sc->data[SC_ARMOR]->val2/100; @@ -493,6 +510,28 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag { if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] ) damage += damage * 75 / 100; + // [Epoque] + if (bl->type == BL_MOB) + { + int i; + + if ( ((sce=sc->data[SC_MANU_ATK]) && (flag&BF_WEAPON)) || + ((sce=sc->data[SC_MANU_MATK]) && (flag&BF_MAGIC)) + ) + for (i=0;ARRAYLENGTH(mob_manuk)>i;i++) + if (((TBL_MOB*)bl)->class_==mob_manuk[i]) { + damage += damage*sce->val1/100; + break; + } + if ( ((sce=sc->data[SC_SPL_ATK]) && (flag&BF_WEAPON)) || + ((sce=sc->data[SC_SPL_MATK]) && (flag&BF_MAGIC)) + ) + for (i=0;ARRAYLENGTH(mob_splendide)>i;i++) + if (((TBL_MOB*)bl)->class_==mob_splendide[i]) { + damage += damage*sce->val1/100; + break; + } + } } if (battle_config.pk_mode && sd && bl->type == BL_PC && damage) diff --git a/src/map/mob.c b/src/map/mob.c index afe8adf5b..80251af1b 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -73,6 +73,10 @@ static struct { #define CLASSCHANGE_BOSS_NUM 21 +//Defines the Manuk/Splendide mob groups for the status reductions [Epoque] +const int mob_manuk[] = { 1986, 1987, 1988, 1989, 1990, 1997, 1998, 1999 }; +const int mob_splendide[] = { 1991, 1992, 1993, 1994, 1995 }; + /*========================================== * Local prototype declaration (only required thing) *------------------------------------------*/ diff --git a/src/map/mob.h b/src/map/mob.h index b7f193b5b..73efac73c 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -38,6 +38,10 @@ //Used to determine default enemy type of mobs (for use in eachinrange calls) #define DEFAULT_ENEMY_TYPE(md) (md->special_state.ai?BL_CHAR:BL_PC|BL_HOM|BL_MER) +//Externals for the status effects. [Epoque] +extern const int mob_manuk[]; +extern const int mob_splendide[]; + //Mob skill states. enum MobSkillState { MSS_ANY = -1, diff --git a/src/map/status.c b/src/map/status.c index af97372f6..72d020d5f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -476,6 +476,12 @@ void initChangeTables(void) StatusIconChangeTable[SC_LUKFOOD] = SI_FOODLUK; StatusIconChangeTable[SC_FLEEFOOD]= SI_FOODFLEE; StatusIconChangeTable[SC_HITFOOD] = SI_FOODHIT; + StatusIconChangeTable[SC_MANU_ATK] = SI_MANU_ATK; + StatusIconChangeTable[SC_MANU_DEF] = SI_MANU_DEF; + StatusIconChangeTable[SC_SPL_ATK] = SI_SPL_ATK; + StatusIconChangeTable[SC_SPL_DEF] = SI_SPL_DEF; + StatusIconChangeTable[SC_MANU_MATK] = SI_MANU_MATK; + StatusIconChangeTable[SC_SPL_MATK] = SI_SPL_MATK; //Cash Items StatusIconChangeTable[SC_EXPBOOST] = SI_EXPBOOST; StatusIconChangeTable[SC_ITEMBOOST] = SI_ITEMBOOST; @@ -5943,6 +5949,17 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val val2 = 20*val1; //% of life to be revived with break; + case SC_MANU_DEF: + case SC_MANU_ATK: + case SC_MANU_MATK: + val2 = 1; // Manuk group + break; + case SC_SPL_DEF: + case SC_SPL_ATK: + case SC_SPL_MATK: + val2 = 2; // Splendide group + break; + default: if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 ) { //Status change with no calc, no icon, and no skill associated...? diff --git a/src/map/status.h b/src/map/status.h index ae9cb0ee2..664fcd520 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -317,6 +317,12 @@ typedef enum sc_type { SC_HELLPOWER = 294, SC_INVINCIBLE, //295 SC_INVINCIBLEOFF, + SC_MANU_ATK, + SC_MANU_DEF, + SC_SPL_ATK, + SC_SPL_DEF, //300 + SC_MANU_MATK, + SC_SPL_MATK, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; @@ -706,13 +712,15 @@ enum si_type { SI_NEUTRALBARRIER_MASTER = 378, SI_STEALTHFIELD = 379, SI_STEALTHFIELD_MASTER = 380, +*/ SI_MANU_ATK = 381, SI_MANU_DEF = 382, SI_SPL_ATK = 383, SI_SPL_DEF = 384, - SI_REPRODUCE = 385, +// SI_REPRODUCE = 385, SI_MANU_MATK = 386, SI_SPL_MATK = 387, +/* SI_STR_SCROLL = 388, SI_INT_SCROLL = 389, SI_LG_REFLECTDAMAGE = 390, |