summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-09 22:56:59 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-09 22:56:59 +0000
commit059ae946435c89351b95d9a647e7cc37541ba5e2 (patch)
treee01aff2c310feccd086dc8c2c48e6bd42521cf41
parent68c4c735455439e9c849b4c81d8a598e76d90c57 (diff)
downloadhercules-059ae946435c89351b95d9a647e7cc37541ba5e2.tar.gz
hercules-059ae946435c89351b95d9a647e7cc37541ba5e2.tar.bz2
hercules-059ae946435c89351b95d9a647e7cc37541ba5e2.tar.xz
hercules-059ae946435c89351b95d9a647e7cc37541ba5e2.zip
- Spring cleaning of various source files
- Removed unused src/map/config/Skills/Mage_Classes.h file git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15837 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/Makefile.in2
-rw-r--r--src/map/battle.c42
-rw-r--r--src/map/config/Core.h13
-rw-r--r--src/map/config/Data/Const.h17
-rw-r--r--src/map/config/Renewal.h86
-rw-r--r--src/map/config/Secure.h13
-rw-r--r--src/map/config/Skills/General.h10
-rw-r--r--src/map/config/Skills/Mage_Classes.h11
-rw-r--r--src/map/config/Skills/Swordsman_Classes.h19
-rw-r--r--src/map/itemdb.c4
-rw-r--r--src/map/itemdb.h2
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/mob.c6
-rw-r--r--src/map/party.c8
-rw-r--r--src/map/party.h4
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/pet.h2
-rw-r--r--src/map/skill.c24
-rw-r--r--src/map/skill.h2
-rw-r--r--src/map/status.c220
-rw-r--r--src/map/status.h12
22 files changed, 239 insertions, 276 deletions
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 16675086d..2821b7985 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -41,7 +41,7 @@ MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
log.h mail.h date.h unit.h homunculus.h mercenary.h quest.h instance.h mapreg.h \
buyingstore.h searchstore.h duel.h pc_groups.h \
config/Core.h config/Renewal.h config/Secure.h config/Data/Const.h \
- config/Skills/General.h config/Skills/Mage_Classes.h config/Skills/Swordsman_Classes.h
+ config/Skills/General.h config/Skills/Swordsman_Classes.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
diff --git a/src/map/battle.c b/src/map/battle.c
index ef64469b7..e1cb5859c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -389,7 +389,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
/**
* in RE, SW possesses a lifetime equal to 3 times the caster's health
**/
- #if REMODE
+ #ifdef RENEWAL
if ( ( group->val2 - damage) > 0 ) {
group->val2 -= damage;
d->dmg_lv = ATK_BLOCK;
@@ -593,7 +593,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
/**
* In renewal steel body reduces all incoming damage by 1/10
**/
-#if REMODE
+#ifdef RENEWAL
if( sc->data[SC_STEELBODY] ) {
damage = damage > 10 ? damage / 10 : 1;
}
@@ -820,7 +820,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
if(class_ == MOBID_EMPERIUM && flag&BF_SKILL) {
//Skill immunity.
switch (skill_num) {
-#if isOFF(REMODE)
+#ifndef RENEWAL
case MO_TRIPLEATTACK:
#endif
case HW_GRAVITATION:
@@ -925,7 +925,7 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
switch(weapon)
{
case W_1HSWORD:
- #if REMODE
+ #ifdef RENEWAL
if((skill = pc_checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill * 3);
#endif
@@ -934,7 +934,7 @@ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int
damage += (skill * 4);
break;
case W_2HSWORD:
- #if REMODE
+ #ifdef RENEWAL
if((skill = pc_checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill * 3);
#endif
@@ -1241,7 +1241,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
//Since these do not consume ammo, they need to be explicitly set as arrow attacks.
flag.arrow = 1;
break;
-#if isOFF(REMODE)
+#ifndef RENEWAL
case PA_SHIELDCHAIN:
case CR_SHIELDBOOMERANG:
#endif
@@ -1423,7 +1423,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
{ //Hit/Flee calculation
short
flee = tstatus->flee,
-#if REMODE
+#ifdef RENEWAL
hitrate = 0; //Default hitrate
#else
hitrate = 80; //Default hitrate
@@ -1661,7 +1661,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
break;
case AC_SHOWER:
case MA_SHOWER:
- #if REMODE
+ #ifdef RENEWAL
skillratio += 50+10*skill_lv;
#else
skillratio += -25+5*skill_lv;
@@ -1768,7 +1768,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
case CR_HOLYCROSS:
{
int ratio = 35*skill_lv;
- #if REMODE
+ #ifdef RENEWAL
if(sd && sd->status.weapon == W_2HSPEAR)
ratio *= 2;
#endif
@@ -2290,17 +2290,15 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
if (sc) {
if(sc->data[SC_TRUESIGHT])
ATK_ADDRATE(2*sc->data[SC_TRUESIGHT]->val1);
- #if RE_EDP == 0
- /**
- * In RE EDP doesn't affect your final damage but your atk and weapon atk
- **/
+#ifndef RENEWAL_EDP
+ // renewal EDP doesn't affect your final damage but your atk and weapon atk
if(sc->data[SC_EDP] &&
skill_num != ASC_BREAKER &&
skill_num != ASC_METEORASSAULT &&
skill_num != AS_SPLASHER &&
skill_num != AS_VENOMKNIFE)
ATK_ADDRATE(sc->data[SC_EDP]->val3);
- #endif
+#endif
}
switch (skill_num) {
@@ -2436,7 +2434,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
vit_def += def1*battle_config.weapon_defense_type;
def1 = 0;
}
- #if REMODE
+ #ifdef RENEWAL
/**
* In Renewal 100% damage reduction is 900 DEF
* Formula: (1+(900-def1)/9)%
@@ -2546,7 +2544,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
wd.damage2 += battle_attr_fix(src, target, damage, sc->data[SC_WATK_ELEMENT]->val1, tstatus->def_ele, tstatus->ele_lv);
}
}
- #if REMODE
+ #ifdef RENEWAL
/**
* In RE Shield Bommerang takes weapon element only for damage calculation,
* - resist calculation is always against neutral
@@ -3036,7 +3034,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
break;
default:
{
- #if REMODE //Renewal MATK Appliance according to doddler (?title=Renewal_Changes#Upgrade_MATK)
+ #ifdef RENEWAL //Renewal MATK Appliance according to doddler (?title=Renewal_Changes#Upgrade_MATK)
/**
* min: (weaponMATK+upgradeMATK) * 2 + 1.5 * statusMATK
* max: [weaponMATK+upgradeMATK+(wMatk*wLvl)/10] * 2 + 1.5 * statusMATK
@@ -3074,7 +3072,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
/**
* in Renewal Thunder Storm boost is 100% (in pre-re, 80%)
**/
- #if isOFF(REMODE)
+ #ifndef RENEWAL
case MG_THUNDERSTORM:
skillratio -= 20;
break;
@@ -3138,7 +3136,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
case NJ_RAIGEKISAI:
skillratio += 60 + 40*skill_lv;
break;
- #if REMODE
+ #ifdef RENEWAL
case NJ_HUUJIN:
skillratio += 50;
break;
@@ -3374,7 +3372,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
//mdef2-= mdef2* i/100;
}
}
- #if REMODE
+ #ifdef RENEWAL
/**
* RE MDEF Reduction (from doddler:?title=Renewal_Changes#MDEF)
* Damage from magic = Magic Attack * 111.5/(111.5+eMDEF)
@@ -3548,7 +3546,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
switch( skill_num )
{
-#if REMODE
+#ifdef RENEWAL
case HT_LANDMINE:
case MA_LANDMINE:
case HT_BLASTMINE:
@@ -3698,7 +3696,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
else {
short
flee = tstatus->flee,
-#if REMODE
+#ifdef RENEWAL
hitrate = 0; //Default hitrate
#else
hitrate = 80; //Default hitrate
diff --git a/src/map/config/Core.h b/src/map/config/Core.h
index a5db0f1ff..95c3ee8ed 100644
--- a/src/map/config/Core.h
+++ b/src/map/config/Core.h
@@ -1,5 +1,8 @@
-#ifndef _RRCONFIGS_
-#define _RRCONFIGS_
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CONFIG_CORE_H_
+#define _CONFIG_CORE_H_
+
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
@@ -32,7 +35,5 @@
* Constants come last; so they process anything that could've been modified in early includes
**/
#include "./Data/Const.h"
-/**
- * End of File
- **/
-#endif
+
+#endif // _CONFIG_CORE_H_
diff --git a/src/map/config/Data/Const.h b/src/map/config/Data/Const.h
index 2071a4a8c..8b9980252 100644
--- a/src/map/config/Data/Const.h
+++ b/src/map/config/Data/Const.h
@@ -1,5 +1,8 @@
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
#ifndef _RRCONFIGS_CONST_
#define _RRCONFIGS_CONST_
+
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
@@ -12,13 +15,13 @@
/**
* "Constants"
**/
-#if RECASTING
+#ifdef RENEWAL_CAST
- #if REMODE == 0
- #error RECASTING requires REMODE enabled
+ #ifndef RENEWAL
+ #error RENEWAL_CAST requires RENEWAL enabled
#endif
- #define CONST_CASTRATE_SCALE RECASTING_VMIN
+ #define CONST_CASTRATE_SCALE RENEWAL_CAST_VMIN
/**
* Cast Rate Formula: (DEX x 2)+INT
**/
@@ -31,8 +34,6 @@
#define CONST_CASTRATE_CALC (status_get_dex(bl))
#endif
-#define isOFF(def) (def == 0)
-
/**
* "Sane Checks" to save you from compiling with cool bugs
**/
@@ -46,7 +47,7 @@
/**
* Path within the /db folder to (non-)renewal specific db files
**/
-#if REMODE
+#ifdef RENEWAL
#define DBPATH "re/"
#else
#define DBPATH "pre-re/"
@@ -55,7 +56,7 @@
/**
* DefType
**/
-#if REMODE
+#ifdef RENEWAL
typedef short defType;
#define DEFTYPE_MIN SHRT_MIN
#define DEFTYPE_MAX SHRT_MAX
diff --git a/src/map/config/Renewal.h b/src/map/config/Renewal.h
index 81aaea9ad..938c8b29a 100644
--- a/src/map/config/Renewal.h
+++ b/src/map/config/Renewal.h
@@ -1,5 +1,8 @@
-#ifndef _RRCONFIGS_RE_
-#define _RRCONFIGS_RE_
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CONFIG_RENEWAL_H_
+#define _CONFIG_RENEWAL_H_
+
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
@@ -9,51 +12,44 @@
* @INFO: This file holds general-purpose renewal settings, for class-specific ones check /src/map/config/Skills folder
**/
-/**
- * Game Server Mode
- * @values: 1 or 0
- * 1 : renewal support, such as renewal-exclusive formulas
- * -> Note some features may be enabled/disabled at this file despite this setting being ON
- * 0 : renewal support disabled, use original formulas
- **/
-#define REMODE 1
+/// game renewal server mode
+/// (disable by commenting the line)
+///
+/// leave this line to enable renewal specific support such as renewal formulas
+#define RENEWAL
-/**
- * Renewal Cast Time
- * @values: 1 (enabled) or 0 (disabled)
- * 1 : Cast Time is decreased by DEX*2+INT, 20% of the cast time is not reduced by stats,
- * - for example, on a skill whose cast time is 10s, only 8s may be reduced. other 2s are
- * - part of a "fixed cast time" that is only reduced by special items and skills (such as
- * - Arch Bishop's Sacrament skill).
- * 0 : the old cast time method, influenced by dex, items and skills.
- **/
-#define RECASTING 1
+/// renewal cast time
+/// (disable by commenting the line)
+///
+/// leave this line to enable renewal casting time algorithms
+/// cast time is decreased by DEX * 2 + INT while 20% of the cast time is not reduced by stats.
+/// example:
+/// on a skill whos cast time is 10s, only 8s may be reduced. the other 2s are part of a
+/// "fixed cast time" which can only be reduced by specialist items and skills
+#define RENEWAL_CAST
-/**
- * Renewal Drop Rate Modifier
- * @values: 1 (enabled) or 0 (disabled)
- * - When enabled a modifier based on difference between the player and the monster level is applied,
- * - based on the http://irowiki.org/wiki/Drop_System#Level_Factor table
- **/
-#define RE_DROP_MOD 1
+/// renewal drop rate algorithms
+/// (disable by commenting the line)
+///
+/// leave this line to enable renewal item drop rate algorithms
+/// while enabled a special modified based on the difference between the player and monster level is applied
+/// based on the http://irowiki.org/wiki/Drop_System#Level_Factor table
+#define RENEWAL_DROP
-/**
- * Renewal Cast Time : Variable-Free
- * - Value required for no variable cast time with stats.
- * - Formula: (casterDex x 2) + (casterInt)
- * Default: 530
- **/
-#define RECASTING_VMIN 530
+/// renewal cast time variable cast requirement
+///
+/// this is the value required for no variable cast-time with stats.
+/// formula: (DEX * 2) + INT
+/// default: 530
+#define RENEWAL_CAST_VMIN 530
-/**
- * Renewal Enchant Deadly Poison Change
- * - In RE EDP no longer increases final damage by 400%.
- * - it increases your weapon atk and your stat atk
- * - it doesn't affect grimtooth
- **/
-#define RE_EDP 1
+/// renewal enchant deadly poison algorithm
+///
+/// leave this line to enable the renewed EDP algorithm
+/// under renewal mode:
+/// - damage is NOT increased by 400%
+/// - it does NOT affect grimtooth
+/// - weapon and status ATK are increased
+#define RENEWAL_EDP
-/**
- * End of File
- **/
-#endif
+#endif // _CONFIG_RENEWAL_H_
diff --git a/src/map/config/Secure.h b/src/map/config/Secure.h
index 1cf945083..e2b000440 100644
--- a/src/map/config/Secure.h
+++ b/src/map/config/Secure.h
@@ -1,5 +1,8 @@
-#ifndef _RRCONFIGS_SECURE_
-#define _RRCONFIGS_SECURE_
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CONFIG_SECURE_H_
+#define _CONFIG_SECURE_H_
+
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
@@ -27,8 +30,4 @@
**/
#define SECURE_NPCTIMEOUT_INTERVAL 1
-
-/**
- * End of File
- **/
-#endif
+#endif // _CONFIG_SECURE_H_
diff --git a/src/map/config/Skills/General.h b/src/map/config/Skills/General.h
index d06b7842d..746630845 100644
--- a/src/map/config/Skills/General.h
+++ b/src/map/config/Skills/General.h
@@ -1,5 +1,8 @@
-#ifndef _RRCONFIGS_SKILLS_GENERAL_
-#define _RRCONFIGS_SKILLS_GENERAL_
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CONFIG_GENERAL_H_
+#define _CONFIG_GENERAL_H_
+
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
@@ -18,4 +21,5 @@
**/
#include "Mage_Classes.h"
#include "Swordsman_Classes.h"
-#endif
+
+#endif // _CONFIG_GENERAL_H_
diff --git a/src/map/config/Skills/Mage_Classes.h b/src/map/config/Skills/Mage_Classes.h
deleted file mode 100644
index 65d7f88e8..000000000
--- a/src/map/config/Skills/Mage_Classes.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _RRCONFIGS_SKILLS_MAGE_
-#define _RRCONFIGS_SKILLS_MAGE_
-/**
- * rAthena configuration file (http://rathena.org)
- * For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
- **/
-
-/**
- * No settings past this point
- **/
-#endif
diff --git a/src/map/config/Skills/Swordsman_Classes.h b/src/map/config/Skills/Swordsman_Classes.h
index 91edb7167..44ae922d5 100644
--- a/src/map/config/Skills/Swordsman_Classes.h
+++ b/src/map/config/Skills/Swordsman_Classes.h
@@ -1,17 +1,16 @@
-#ifndef _RRCONFIGS_SKILLS_SWORDS_
-#define _RRCONFIGS_SKILLS_SWORDS_
+// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+#ifndef _CONFIG_SKILLS_SWORDS_H_
+#define _CONFIG_SKILLS_SWORDS_H_
/**
* rAthena configuration file (http://rathena.org)
* For detailed guidance on these check http://rathena.org/wiki/SRC/map/config/
**/
-/**
- * (Rune Knight) the maximum rune items a character may have of the same type
- * Default: 20
- **/
+/// rune knight
+///
+/// maximum number of runes that a rune knight character can carry at any given time
+/// default: 20
#define MAX_RUNE 20
-/**
- * No settings past this point
- **/
-#endif
+#endif // _CONFIG_SKILLS_SWORDS_H_
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 73ab0de91..d2386cad0 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -799,7 +799,7 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr
id->value_buy, id->value_sell, nameid, id->jname);
id->weight = atoi(str[6]);
-#if REMODE
+#ifdef RENEWAL
itemdb_re_split_atoi(str[7],&id->atk,&id->matk);
#else
id->atk = atoi(str[7]);
@@ -985,7 +985,7 @@ static int itemdb_readdb(void)
*======================================*/
static int itemdb_read_sqldb(void)
{
-#if REMODE
+#ifdef RENEWAL
const char* item_db_name[] = { item_db_db, item_db_re_db, item_db2_db };
#else
const char* item_db_name[] = { item_db_db, item_db2_db };
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index bcf9fad9f..632cbd42e 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -106,7 +106,7 @@ struct item_data {
int elv;
int wlv;
int view_id;
-#if REMODE
+#ifdef RENEWAL
int matk;//[RRInd] -- used in RE for matk
#endif
diff --git a/src/map/map.c b/src/map/map.c
index dadc0e4e8..fd0d43aa4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3833,7 +3833,7 @@ int do_init(int argc, char *argv[])
}
map_config_read(MAP_CONF_NAME);
-#if REMODE
+#ifdef RENEWAL
/**
* to make pre-re conflict safe
**/
diff --git a/src/map/mob.c b/src/map/mob.c
index 3f6cb6cb7..8bd47990f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2188,7 +2188,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(base_exp || job_exp)
{
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
-#if REMODE
+#ifdef RENEWAL
if(!md->db->mexp)
party_renewal_exp_mod(&base_exp,&job_exp,tmpsd[i]->status.base_level,md->level);
#endif
@@ -2215,7 +2215,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
struct item_drop *ditem;
struct item_data* it = NULL;
int drop_rate;
-#if RE_DROP_MOD
+#ifdef RENEWAL_DROP
int drop_modifier = mvp_sd ? party_renewal_drop_mod(mvp_sd->status.base_level - md->level) :
second_sd ? party_renewal_drop_mod(second_sd->status.base_level - md->level) :
third_sd ? party_renewal_drop_mod(third_sd->status.base_level - md->level) : 100;
@@ -2261,7 +2261,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
// Increase drop rate if user has SC_ITEMBOOST
if (sd && sd->sc.data[SC_ITEMBOOST]) // now rig the drop rate to never be over 90% unless it is originally >90%.
drop_rate = max(drop_rate,cap_value((int)(0.5+drop_rate*(sd->sc.data[SC_ITEMBOOST]->val1)/100.),0,9000));
-#if RE_DROP_MOD
+#ifdef RENEWAL_DROP
if(drop_modifier != 100 && !md->db->mexp)
drop_rate = drop_rate * drop_modifier / 100;
#endif
diff --git a/src/map/party.c b/src/map/party.c
index 8158e1afb..7d77affbd 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -904,7 +904,7 @@ int party_send_xy_clear(struct party_data *p)
}
return 0;
}
-#if RE_DROP_MOD
+#ifdef RENEWAL_DROP
/**
* Renewal Drop Modifier
**/
@@ -926,7 +926,7 @@ int party_renewal_drop_mod(int diff) {
return 50;
}
#endif
-#if REMODE
+#ifdef RENEWAL
/**
* Renewal Experience Earning Mode
**/
@@ -961,7 +961,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
{
struct map_session_data* sd[MAX_PARTY];
unsigned int i, c;
-#if REMODE
+#ifdef RENEWAL
int src_lvl = status_get_lv(src);
#endif
nullpo_ret(p);
@@ -991,7 +991,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
}
for (i = 0; i < c; i++) {
-#if REMODE
+#ifdef RENEWAL
party_renewal_exp_mod(&base_exp,&job_exp,sd[i]->status.base_level,src_lvl);
#endif
pc_gainexp(sd[i], src, base_exp, job_exp, false);
diff --git a/src/map/party.h b/src/map/party.h
index 62ab28ec0..f782384a3 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -92,10 +92,10 @@ void party_booking_update(struct map_session_data *sd, short* job);
void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount);
bool party_booking_delete(struct map_session_data *sd);
-#if REMODE
+#ifdef RENEWAL
void party_renewal_exp_mod(unsigned int *base_exp, unsigned int *job_exp, int lvl, int moblvl);
#endif
-#if RE_DROP_MOD
+#ifdef RENEWAL_DROP
int party_renewal_drop_mod(int diff);
#endif
diff --git a/src/map/pc.c b/src/map/pc.c
index 8c815c37e..dd1c19c49 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2047,11 +2047,11 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
case SP_DEF1:
if(sd->state.lr_flag != 2) {
bonus = status->def + val;
- #if REMODE
+#ifdef RENEWAL
status->def = cap_value(bonus, SHRT_MIN, SHRT_MAX);
- #else
+#else
status->def = cap_value(bonus, CHAR_MIN, CHAR_MAX);
- #endif
+#endif
}
break;
case SP_DEF2:
@@ -2063,11 +2063,11 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
case SP_MDEF1:
if(sd->state.lr_flag != 2) {
bonus = status->mdef + val;
- #if REMODE
+#ifdef RENEWAL
status->mdef = cap_value(bonus, SHRT_MIN, SHRT_MAX);
- #else
+#else
status->mdef = cap_value(bonus, CHAR_MIN, CHAR_MAX);
- #endif
+#endif
if( sd->state.lr_flag == 3 ) {//Shield, used for royal guard
sd->shieldmdef += bonus;
}
@@ -5487,7 +5487,7 @@ int pc_need_status_point(struct map_session_data* sd, int type, int val)
swap(low, high);
for ( ; low < high; low++ )
-#if REMODE //Renewal Stat Cost Formula
+#ifdef RENEWAL // renewal status point cost formula
sp += (low < 100) ? (2 + (low - 1) / 10) : (16 + 4 * ((low - 100) / 5));
#else
sp += ( 1 + (low + 9) / 10 );
diff --git a/src/map/pc.h b/src/map/pc.h
index d14941bb4..38a954b0f 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -653,7 +653,7 @@ enum e_pc_permission {
)
// clientside atk display macros (values to the left/right of the "+")
-#if REMODE
+#ifdef RENEWAL
#define pc_leftside_atk(sd) ((sd)->battle_status.batk)
#define pc_rightside_atk(sd) ((sd)->battle_status.rhw.atk + (sd)->battle_status.lhw.atk + (sd)->battle_status.rhw.atk2 + (sd)->battle_status.lhw.atk2)
#else
diff --git a/src/map/pet.h b/src/map/pet.h
index 52f4999df..b46f55229 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -44,7 +44,7 @@ struct pet_bonus {
unsigned short type; //bStr, bVit?
unsigned short val; //Qty
unsigned short duration; //in secs
- unsigned short delay; //Time before recasting (secs)
+ unsigned short delay; //Time before RENEWAL_CAST (secs)
int timer;
};
diff --git a/src/map/skill.c b/src/map/skill.c
index c646a9f09..14ed17c64 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -217,7 +217,7 @@ int skill_get_unit_bl_target( int id ) { skill_get (skill_db[id].unit_target&
int skill_get_unit_flag( int id ) { skill_get (skill_db[id].unit_flag, id, 1); }
int skill_get_unit_layout_type( int id ,int lv ){ skill_get (skill_db[id].unit_layout_type[lv-1], id, lv); }
int skill_get_cooldown( int id ,int lv ) { skill_get (skill_db[id].cooldown[lv-1], id, lv); }
-#if RECASTING
+#ifdef RENEWAL_CAST
int skill_get_fixed_cast( int id ,int lv ){ skill_get (skill_db[id].fixed_cast[lv-1], id, lv); }
#endif
int skill_tree_get_max(int id, int b_class)
@@ -377,7 +377,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, int skill
default:
if (skill_lv >= battle_config.max_heal_lv)
return battle_config.max_heal;
- #if REMODE
+ #ifdef RENEWAL
/**
* Renewal Heal Formula (from Doddler)
* TODO: whats that( 1+ %Modifier / 100 ) ? currently using 'x1' (100/100) until found out
@@ -839,7 +839,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
/**
* Storm Gust counter was dropped in renewal
**/
- #if REMODE
+ #ifdef RENEWAL
sc_start(bl,SC_FREEZE,65-(5*skilllv),skilllv,skill_get_time2(skillid,skilllv));
#else
//Tharis pointed out that this is normal freeze chance with a base of 300%
@@ -6451,7 +6451,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
/**
* Renewal dropped the 3/4 hp requirement
**/
- #if isOFF(REMODE)
+ #ifndef RENEWAL
|| tstatus-> hp > tstatus->max_hp*3/4
#endif
) {
@@ -9442,7 +9442,7 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
switch( skillid ) {
case MG_SAFETYWALL:
- #if REMODE
+ #ifdef RENEWAL
/**
* According to data provided in RE, SW life is equal to 3 times caster's health
**/
@@ -10111,7 +10111,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
{
int heal = skill_calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true);
struct mob_data *md = BL_CAST(BL_MOB, bl);
-#if REMODE
+#ifdef RENEWAL
if( md && md->class_ == MOBID_EMPERIUM )
break;
#endif
@@ -10186,7 +10186,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
/**
* The storm gust counter was dropped in renewal
**/
- #if isOFF(REMODE)
+ #ifndef RENEWAL
case WZ_STORMGUST: //SG counter does not reset per stormgust. IE: One hit from a SG and two hits from another will freeze you.
if (tsc)
tsc->sg_counter++; //SG hit counter.
@@ -10306,7 +10306,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
case UNT_APPLEIDUN: //Apple of Idun [Skotlex]
{
int heal;
-#if REMODE
+#ifdef RENEWAL
struct mob_data *md = BL_CAST(BL_MOB, bl);
if( md && md->class_ == MOBID_EMPERIUM )
break;
@@ -12141,7 +12141,7 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
*------------------------------------------*/
int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_lv) {
struct status_change *sc = status_get_sc(bl);
-#if RECASTING
+#ifdef RENEWAL_CAST
int fixed = skill_get_fixed_cast(skill_id, skill_lv);
if( !fixed ) {
fixed = skill_get_cast(skill_id, skill_lv);
@@ -12162,7 +12162,7 @@ int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_l
}
if (sc->data[SC_POEMBRAGI])
time -= time * sc->data[SC_POEMBRAGI]->val2 / 100;
-#if RECASTING
+#ifdef RENEWAL_CAST
if( sc->data[SC__LAZINESS] )
fixed += fixed * sc->data[SC__LAZINESS]->val2 / 100;
/**
@@ -12172,7 +12172,7 @@ int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_l
fixed -= fixed * sc->data[SC_SECRAMENT]->val2 / 100;
#endif
}
-#if RECASTING
+#ifdef RENEWAL_CAST
/**
* WL_RADIUS decreases 10/15/20% fixed cast time from warlock skills
**/
@@ -15558,7 +15558,7 @@ static bool skill_parse_row_castdb(char* split[], int columns, int current)
skill_split_atoi(split[4],skill_db[i].upkeep_time);
skill_split_atoi(split[5],skill_db[i].upkeep_time2);
skill_split_atoi(split[6],skill_db[i].cooldown);
-#if RECASTING
+#ifdef RENEWAL_CAST
skill_split_atoi(split[7],skill_db[i].fixed_cast);
#endif
return true;
diff --git a/src/map/skill.h b/src/map/skill.h
index 8dc9da1cc..1275b3910 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -94,7 +94,7 @@ struct s_skill_db {
int range[MAX_SKILL_LEVEL],hit,inf,element[MAX_SKILL_LEVEL],nk,splash[MAX_SKILL_LEVEL],max;
int num[MAX_SKILL_LEVEL];
int cast[MAX_SKILL_LEVEL],walkdelay[MAX_SKILL_LEVEL],delay[MAX_SKILL_LEVEL];
-#if RECASTING
+#ifdef RENEWAL_CAST
int fixed_cast[MAX_SKILL_LEVEL];
#endif
int upkeep_time[MAX_SKILL_LEVEL],upkeep_time2[MAX_SKILL_LEVEL],cooldown[MAX_SKILL_LEVEL];
diff --git a/src/map/status.c b/src/map/status.c
index cfa387a96..65b595eb3 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -63,7 +63,7 @@ static struct {
static int atkmods[3][MAX_WEAPON_TYPE]; // ATKTCYC(size_fix.txt)
static char job_bonus[CLASS_COUNT][MAX_LEVEL];
-#if REMODE
+#ifdef RENEWAL
enum {
SHIELD_ASPD,
RE_JOB_DB_MAX,
@@ -883,10 +883,8 @@ void initChangeTables(void)
StatusChangeFlagTable[SC_DROCERA_HERB_STEAMED] |= SCB_AGI;
StatusChangeFlagTable[SC_PUTTI_TAILS_NOODLES] |= SCB_LUK;
-#if RE_EDP
- /**
- * In RE EDP increases your atk and weapon atk
- **/
+#ifdef RENEWAL_EDP
+ // renewal EDP increases your atk and weapon atk
StatusChangeFlagTable[SC_EDP] |= SCB_BATK|SCB_WATK;
#endif
if( !battle_config.display_hallucination ) //Disable Hallucination.
@@ -1645,26 +1643,26 @@ int status_base_amotion_pc(struct map_session_data* sd, struct status_data* stat
// raw delay adjustment from bAspd bonus
amotion+= sd->aspd_add;
-#if REMODE
- /**
- * Bearing a shield decreases your ASPD by a fixed value depending on your class
- **/
+
+#ifdef RENEWAL
if( sd->status.shield )
+ {// bearing a shield decreases your ASPD by a fixed value depending on your class
amotion += re_job_db[pc_class2idx(sd->status.class_)][SHIELD_ASPD];
- /**
- * RE Absolute aspd modifiers
- **/
- if( sd->sc.count ) {
+ }
+
+ if( sd->sc.count )
+ {// renewal absolute ASPD modifiers
int i;
if ( sd->sc.data[i=SC_ASPDPOTION3] ||
- sd->sc.data[i=SC_ASPDPOTION2] ||
- sd->sc.data[i=SC_ASPDPOTION1] ||
- sd->sc.data[i=SC_ASPDPOTION0] )
+ sd->sc.data[i=SC_ASPDPOTION2] ||
+ sd->sc.data[i=SC_ASPDPOTION1] ||
+ sd->sc.data[i=SC_ASPDPOTION0] )
amotion -= sd->sc.data[i]->val1*10;
if( sd->sc.data[SC_SPEARQUICKEN] )
amotion -= 70;
}
#endif
+
return amotion;
}
@@ -1707,24 +1705,24 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct
static inline unsigned short status_base_matk_max(const struct status_data* status)
{
- #if REMODE
- return status->matk_max;//In RE maximum MATK signs weapon matk, which we store in this var
- #else //Original Max MATK Formula
- return status->int_+(status->int_/5)*(status->int_/5);
- #endif
+#ifdef RENEWAL
+ return status->matk_max; // in RE maximum MATK signs weapon matk, which we store in this var
+#else
+ return status->int_+(status->int_/5)*(status->int_/5);
+#endif
}
-#if REMODE
+#ifdef RENEWAL
static inline unsigned short status_base_matk_min(const struct status_data* status, int lvl)
#else
static inline unsigned short status_base_matk_min(const struct status_data* status)
#endif
{
- #if REMODE //Renewal MATK Formula
- return status->int_+(status->int_/2)+(status->dex/5)+(status->luk/3)+(lvl/4);
- #else //Original Min MATK Formula
- return status->int_+(status->int_/7)*(status->int_/7);
- #endif
+#ifdef RENEWAL
+ return status->int_+(status->int_/2)+(status->dex/5)+(status->luk/3)+(lvl/4);
+#else
+ return status->int_+(status->int_/7)*(status->int_/7);
+#endif
}
@@ -1737,19 +1735,19 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int lev
status->hit = status->flee =
status->def2 = status->mdef2 =
status->cri = status->flee2 = 0;
-#if REMODE
+#ifdef RENEWAL
status->matk_min = status_base_matk_min(status, level);
#else
status->matk_min = status_base_matk_min(status);
#endif
status->matk_max = status_base_matk_max(status);
-#if REMODE //Renewal Formulas
+#ifdef RENEWAL // renewal formulas
status->hit += level + status->dex + status->luk/3 + 175; //base level + ( every 1 dex = +1 hit ) + (every 3 luk = +1 hit) + 175
status->flee += level + status->agi + status->luk/5 + 100; //base level + ( every 1 agi = +1 flee ) + (every 5 luk = +1 flee) + 100
status->def2 += (int)(((float)level + status->vit)/2 + ((float)status->agi/5)); //base level + (every 2 agi = +1 def) + (every 5 agi = +1 def)
status->mdef2 += (int)(status->int_ + ((float)level/4) + ((float)status->dex/5) + ((float)status->vit/5)); //(every 4 base level = +1 mdef) + (every 1 int = +1 mdef) + (every 5 dex = +1 mdef) + (every 5 vit = +1 mdef)
-#else //Old Formulas
+#else
status->hit += level + status->dex;
status->flee += level + status->agi;
status->def2 += status->vit;
@@ -1771,9 +1769,11 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int lev
status->batk = cap_value(temp, 0, USHRT_MAX);
} else
status->batk = status_base_atk(bl, status);
-#if REMODE //Renewal ATK Bonus Formula (after atk is calculated)
+
+#ifdef RENEWAL // renewal attack bonus formula
status->batk += (int)((float)status->luk/3 + (float)level/4); //(every 3 luk = + 1ATK) + (every 4 base level = +1 ATK)
#endif
+
if (status->cri)
switch (bl->type) {
case BL_MOB:
@@ -1932,7 +1932,7 @@ int status_calc_mob_(struct mob_data* md, bool first)
ShowError("status_calc_mob: No castle set at map %s\n", map[md->bl.m].name);
else
if(gc->castle_id < 24 || md->class_ == MOBID_EMPERIUM) {
-#if REMODE
+#ifdef RENEWAL
status->max_hp += 50 * gc->defense;
status->max_sp += 70 * gc->defense;
#else
@@ -2336,22 +2336,20 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
wa->atk += sd->inventory_data[index]->atk;
if ( (r = sd->status.inventory[index].refine) )
wa->atk2 = refine_info[wlv].bonus[r-1] / 100;
- #if REMODE
- /**
- * in RE matk_max is used as the weapon's matk.
- * += is used so that two-wield weapons (in the case of, say, sinx) bonus stack.
- **/
+
+#ifdef RENEWAL
+ // in renewal max MATK is the weapon MATK
status->matk_max += sd->inventory_data[index]->matk;
- /**
- * Refine Bonus
- **/
- if (r)
+
+ if( r )
+ {// renewal magic attack refine bonus
status->matk_max += refine_info[wlv].bonus[r-1] / 100;
- /**
- * In RE weapon level is used in several areas, this way we save performance
- **/
+ }
+
+ // record the weapon level for future usage
status->wlv = wlv;
- #endif
+#endif
+
//Overrefine bonus.
if (r)
wd->overrefine = refine_info[wlv].randombonus_max[r-1] / 100;
@@ -2413,13 +2411,10 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
status->def += (refinedef+50)/100;
- #if REMODE
- /**
- * in RE matk_max is used as the weapon's matk.
- * sp_weapon_matk is 'bonus bWeaponMatk,<boost>'
- **/
- status->matk_max += sd->sp_weapon_matk;
- #endif
+#ifdef RENEWAL
+ // increment the weapon ATK using the MATK max value
+ status->matk_max += sd->sp_weapon_matk;
+#endif
//Parse Cards
for(i=0;i<EQI_MAX-1;i++) {
@@ -2738,16 +2733,15 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
i = status->def * sd->def_rate/100;
status->def = cap_value(i, DEFTYPE_MIN, DEFTYPE_MAX);
}
-#if isOFF(REMODE)
- /**
- * The following setting does not affect Renewal Mode
- **/
+
+#ifndef RENEWAL
if (!battle_config.weapon_defense_type && status->def > battle_config.max_def)
{
status->def2 += battle_config.over_def_bonus*(status->def -battle_config.max_def);
status->def = (unsigned char)battle_config.max_def;
}
#endif
+
// ----- EQUIPMENT-MDEF CALCULATION -----
// Apply relative modifiers from equipment
@@ -2757,16 +2751,15 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
i = status->mdef * sd->mdef_rate/100;
status->mdef = cap_value(i, DEFTYPE_MIN, DEFTYPE_MAX);
}
-#if isOFF(REMODE)
- /**
- * The following setting does not affect Renewal Mode
- **/
+
+#ifndef RENEWAL
if (!battle_config.magic_defense_type && status->mdef > battle_config.max_def)
{
status->mdef2 += battle_config.over_def_bonus*(status->mdef -battle_config.max_def);
status->mdef = (signed char)battle_config.max_def;
}
#endif
+
// ----- ASPD CALCULATION -----
// Unlike other stats, ASPD rate modifiers from skills/SCs/items/etc are first all added together, then the final modifier is applied
@@ -3002,12 +2995,11 @@ int status_calc_homunculus_(struct homun_data *hd, bool first)
status->adelay = status->amotion; //It seems adelay = amotion for Homunculus.
status_calc_misc(&hd->bl, status, hom->level);
-#if REMODE
- /**
- * In RE Mode matk_max is used as source of weaponMATK, but homuns don't have it -- so we swap the values here.
- **/
+
+#ifdef RENEWAL
status->matk_max = status->matk_min;
#endif
+
status_cpy(&hd->battle_status, status);
return 1;
}
@@ -3470,33 +3462,29 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
}
if(flag&SCB_MATK) {
- //New matk
- #if REMODE
+#ifdef RENEWAL
status->matk_min = status_base_matk_min(status,status_get_lv(bl));
- /**
- * in RE matk_min is used as character's base matk
- * sp_base_matk is 'bonus bMatk,<boost>'
- **/
if( sd )
status->matk_min += sd->sp_base_matk;
- #else
+#else
status->matk_min = status_base_matk_min(status);
- #endif
+#endif
status->matk_max = status_base_matk_max(status);
if( bl->type&BL_PC && sd->matk_rate != 100 )
{
//Bonuses from previous matk
- #if isOFF(REMODE) //Only changed in non-re [RRInd]
+#ifndef RENEWAL // only changed in non-renewal [Ind]
status->matk_max = status->matk_max * sd->matk_rate/100;
- #endif
+#endif
status->matk_min = status->matk_min * sd->matk_rate/100;
}
status->matk_min = status_calc_matk(bl, sc, status->matk_min);
- #if isOFF(REMODE) //Only changed in non-re [RRInd]
- status->matk_max = status_calc_matk(bl, sc, status->matk_max);
- #endif
+
+#ifndef RENEWAL // only changed in non-renewal [Ind]
+ status->matk_max = status_calc_matk(bl, sc, status->matk_max);
+#endif
if( bl->type&BL_HOM && battle_config.hom_setting&0x20 ) //Hom Min Matk is always the same as Max Matk
status->matk_min = status->matk_max;
@@ -3641,7 +3629,7 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
clif_updatestatus(sd,SP_SPEED);
if(b_status.batk != status->batk
-#if !REMODE
+#ifndef RENEWAL
|| b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk
#endif
)
@@ -3651,8 +3639,8 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
clif_updatestatus(sd,SP_DEF1);
if(b_status.rhw.atk2 != status->rhw.atk2 || b_status.lhw.atk2 != status->lhw.atk2
-#if REMODE
- || b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk
+#ifdef RENEWAL
+ || b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk
#endif
)
clif_updatestatus(sd,SP_ATK2);
@@ -4064,10 +4052,8 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
batk += sc->data[SC_FULL_SWING_K]->val1;
if(sc->data[SC_ODINS_POWER])
batk += 70;
-#if RE_EDP
- /**
- * in RE EDP increases your base atk by atk x Skill Level.
- **/
+#ifdef RENEWAL_EDP
+ // renewal EDP increases your base atk by atk x skill level
if( sc->data[SC_EDP] )
batk = batk * sc->data[SC_EDP]->val1;
#endif
@@ -4142,10 +4128,8 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan
if( sc && sc->data[SC_TIDAL_WEAPON] )
watk += watk * sc->data[SC_TIDAL_WEAPON]->val2 / 100;
-#if RE_EDP
- /**
- * in RE EDP increases your weapon atk by watk x Skill Level - 1
- **/
+#ifdef RENEWAL_EDP
+ // renewal EDP increases your weapon atk by watk x Skill Level - 1
if( sc->data[SC_EDP] && sc->data[SC_EDP]->val1 > 1 )
watk = watk * (sc->data[SC_EDP]->val1 - 1);
#endif
@@ -4211,7 +4195,7 @@ static signed short status_calc_critical(struct block_list *bl, struct status_ch
critical += 100;
if(sc->data[SC__UNLUCKY])
critical -= critical * sc->data[SC__UNLUCKY]->val2 / 100;
-#if REMODE
+#ifdef RENEWAL
if (sc->data[SC_SPEARQUICKEN])
critical += 3*sc->data[SC_SPEARQUICKEN]->val1*10;
#endif
@@ -4320,7 +4304,7 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change
flee += flee * sc->data[SC_ZEPHYR]->val2 / 100;
if( sc->data[SC_MARSHOFABYSS] )
flee -= (9 * sc->data[SC_MARSHOFABYSS]->val3 / 10 + sc->data[SC_MARSHOFABYSS]->val2 / 10) * (bl->type == BL_MOB ? 2 : 1);
-#if REMODE
+#ifdef RENEWAL
if( sc->data[SC_SPEARQUICKEN] )
flee += 2 * sc->data[SC_SPEARQUICKEN]->val1;
#endif
@@ -4355,10 +4339,8 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc,
return 100;
if(sc->data[SC_KEEPING])
return 90;
-/**
- * In renewal it no longer provides 90 def
- **/
-#if isOFF(REMODE)
+
+#ifndef RENEWAL // does not provide 90 DEF in renewal mode
if(sc->data[SC_STEELBODY])
return 90;
#endif
@@ -4470,13 +4452,12 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc,
return 0;
if(sc->data[SC_BARRIER])
return 100;
-/**
- * In renewal it no longer provides 90 mdef
- **/
-#if isOFF(REMODE)
+
+#ifndef RENEWAL // no longer provides 90 MDEF in renewal mode
if(sc->data[SC_STEELBODY])
return 90;
#endif
+
if(sc->data[SC_ARMORCHANGE])
mdef += sc->data[SC_ARMORCHANGE]->val3;
if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
@@ -4703,12 +4684,10 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
/// Note that the scale of aspd_rate is 1000 = 100%.
static short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int aspd_rate)
{
-#if isOFF(REMODE)
- /**
- * this variable is not used unless in non-RE
- **/
+#ifndef RENEWAL
int i;
#endif
+
if(!sc || !sc->count)
return cap_value(aspd_rate,0,SHRT_MAX);
@@ -4738,7 +4717,7 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change *
max < sc->data[SC_ADRENALINE]->val3)
max = sc->data[SC_ADRENALINE]->val3;
-#if isOFF(REMODE)
+#ifndef RENEWAL
if(sc->data[SC_SPEARQUICKEN] &&
max < sc->data[SC_SPEARQUICKEN]->val2)
max = sc->data[SC_SPEARQUICKEN]->val2;
@@ -4779,16 +4758,15 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change *
else if(sc->data[SC_MADNESSCANCEL])
aspd_rate -= 200;
}
-#if isOFF(REMODE)
- /**
- * in RE they give a fixed boost -- we do so along SERVICE4U in status_base_amotion_pc
- **/
- if(sc->data[i=SC_ASPDPOTION3] ||
+
+#ifndef RENEWAL // non-renewal variable ASPD improvement
+ if( sc->data[i=SC_ASPDPOTION3] ||
sc->data[i=SC_ASPDPOTION2] ||
sc->data[i=SC_ASPDPOTION1] ||
- sc->data[i=SC_ASPDPOTION0])
+ sc->data[i=SC_ASPDPOTION0] )
aspd_rate -= sc->data[i]->val2;
#endif
+
if(sc->data[SC_DONTFORGETME])
aspd_rate += 10 * sc->data[SC_DONTFORGETME]->val2;
if(sc->data[SC_LONGING])
@@ -6495,24 +6473,24 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_VOLCANO:
val2 = val1*10; //Watk increase
- #if isOFF(REMODE)
+#ifndef RENEWAL
if (status->def_ele != ELE_FIRE)
val2 = 0;
- #endif
+#endif
break;
case SC_VIOLENTGALE:
val2 = val1*3; //Flee increase
- #if isOFF(REMODE)
+ #ifndef RENEWAL
if (status->def_ele != ELE_WIND)
val2 = 0;
#endif
break;
case SC_DELUGE:
val2 = deluge_eff[val1-1]; //HP increase
- #if isOFF(REMODE)
+#ifndef RENEWAL
if(status->def_ele != ELE_WATER)
val2 = 0;
- #endif
+#endif
break;
case SC_SUITON:
if (!val2 || (sd && (sd->class_&MAPID_UPPERMASK) == MAPID_NINJA)) {
@@ -6534,7 +6512,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_MERC_QUICKEN:
val2 = 300;
break;
-#if isOFF(REMODE)
+#ifndef RENEWAL
case SC_SPEARQUICKEN:
val2 = 200+10*val1;
break;
@@ -6556,10 +6534,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_EXPLOSIONSPIRITS:
val2 = 75 + 25*val1; //Cri bonus
break;
-#if isOFF(REMODE)
- /**
- * Only in non-RE it's var is changed
- **/
+#ifndef RENEWAL
case SC_ASPDPOTION0:
case SC_ASPDPOTION1:
case SC_ASPDPOTION2:
@@ -10047,7 +10022,7 @@ int status_get_refine_chance(enum refine_type wlv, int refine)
* size_fix.txt - size adjustment table for weapons
* refine_db.txt - refining data table
*------------------------------------------*/
-#if REMODE
+#ifdef RENEWAL
static bool status_readdb_job_re(char* fields[], int columns, int current) {
int idx, class_;
unsigned int i;
@@ -10066,6 +10041,7 @@ static bool status_readdb_job_re(char* fields[], int columns, int current) {
return true;
}
#endif
+
static bool status_readdb_job1(char* fields[], int columns, int current)
{// Job-specific values (weight, HP, SP, ASPD)
int idx, class_;
@@ -10170,7 +10146,7 @@ int status_readdb(void)
memset(hp_coefficient2, 0, sizeof(hp_coefficient2));
memset(sp_coefficient, 0, sizeof(sp_coefficient));
memset(aspd_base, 0, sizeof(aspd_base));
-#if REMODE
+#ifdef RENEWAL
memset(re_job_db, 0, sizeof(re_job_db));
#endif
// job_db2.txt
@@ -10198,7 +10174,7 @@ int status_readdb(void)
sv_readdb(db_path, "job_db1.txt", ',', 5+MAX_WEAPON_TYPE, 5+MAX_WEAPON_TYPE, -1, &status_readdb_job1);
sv_readdb(db_path, "job_db2.txt", ',', 1, 1+MAX_LEVEL, -1, &status_readdb_job2);
sv_readdb(db_path, "size_fix.txt", ',', MAX_WEAPON_TYPE, MAX_WEAPON_TYPE, ARRAYLENGTH(atkmods), &status_readdb_sizefix);
-#if REMODE
+#ifdef RENEWAL
sv_readdb(db_path, DBPATH"job_db_extra.txt", ',', 1+RE_JOB_DB_MAX, 1+RE_JOB_DB_MAX, -1, &status_readdb_job_re);
#endif
sv_readdb(db_path, DBPATH"refine_db.txt", ',', 4+MAX_REFINE, 4+MAX_REFINE, ARRAYLENGTH(refine_info), &status_readdb_refine);
diff --git a/src/map/status.h b/src/map/status.h
index 61854ffb5..9b90c88b7 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -15,10 +15,10 @@ struct status_change;
* Max Refine available to your server
* Changing this limit requires edits to refine_db.txt
**/
-#if REMODE
-#define MAX_REFINE 20
+#ifdef RENEWAL
+# define MAX_REFINE 20
#else
-#define MAX_REFINE 10
+# define MAX_REFINE 10
#endif
enum refine_type {
@@ -1481,7 +1481,7 @@ struct status_data {
unsigned char
def_ele, ele_lv,
-#if REMODE
+#ifdef RENEWAL
/**
* in RE weapon level is used in several areas, keeping it here saves performance
**/
@@ -1554,7 +1554,7 @@ struct status_change {
/**
* The Storm Gust counter was dropped in renewal
**/
-#if isOFF(REMODE)
+#ifndef RENEWAL
unsigned char sg_counter; //Storm gust counter (previous hits from storm gust)
#endif
struct status_change_entry *data[SC_MAX];
@@ -1630,7 +1630,7 @@ unsigned char status_calc_attack_element(struct block_list *bl, struct status_ch
#define status_get_race(bl) status_get_status_data(bl)->race
#define status_get_size(bl) status_get_status_data(bl)->size
#define status_get_mode(bl) status_get_status_data(bl)->mode
-#if REMODE
+#ifdef RENEWAL
/**
* in RE weapon level is used in several areas, keeping it here saves performance
**/