summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt9
-rw-r--r--conf-tmpl/battle/items.conf8
-rw-r--r--db/Changelog.txt3
-rw-r--r--db/item_db.txt2
-rw-r--r--sql-files/item_db.sql2
-rw-r--r--src/map/battle.c28
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/map.h3
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/skill.c14
-rw-r--r--src/map/status.c4
11 files changed, 47 insertions, 40 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 82d333462..264615fd7 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,15 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/06/16
+ * Modified the bNoMagicDamage/bNoWeaponDamage bonuses to be a 0-100
+ setting. Meaning you can do bonus bNoMagicDamage,50; To make all magic
+ damage be reduced by half. This bonus stack, so two cards with
+ bNoMagicDamage,50 will give magic immunity. [Skotlex]
+ * Removed setting gtb_pvp_only and replaced it with gtb_sc_immunity which
+ specifies the threshold before the bNoMagicDamage starts blocking support
+ statuses as well. ie: gtb_sc_imunity: 75 will mean that "bonus
+ bNoMagicDamage,70;" reduces magic damage by 70%, but does not blocks heal
+ or support status, while "bonus bNoMagicDamage,80;" does. [Skotlex]
* Removed db_tables.sql as it's no longer used. [Skotlex]
* the mvp_sd is removed when the mob is the emperium and there's no
killer/exp-awarded (assumed killed by script), this prevents the on-kill
diff --git a/conf-tmpl/battle/items.conf b/conf-tmpl/battle/items.conf
index 4e790c3ea..b3243c188 100644
--- a/conf-tmpl/battle/items.conf
+++ b/conf-tmpl/battle/items.conf
@@ -76,10 +76,10 @@ item_use_interval: 100
// The ghostring fix makes mob attacks not be affected by ghostring armor wearing players.
mob_ghostring_fix: yes
-// Does the Golden Thief Bug card only work during pvp?
-// no or 0 - gtb works all the time
-// 1 - 100 - percentage of magic damage reduced only during pvp (or gvg)
-gtb_pvp_only: no
+//Required level of bNoMagicDamage before Status Changes are blocked (Golden Thief Bug card).
+//For example, if left at 50. An item can give bNoMagicDamage,40;
+// which reduces magic damage by 40%, but does not blocks status changes.
+gtb_sc_immunity: 50
// Enable autospell card effects to stack?
// NOTE: Different cards that grant the same skill will both
diff --git a/db/Changelog.txt b/db/Changelog.txt
index bf8bb560a..9940bb9a2 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -24,6 +24,9 @@
-----
=========================
+
+06/16
+ - Updated GTB's card script to be "bonus bNoMagicDamage,100;" [Skotlex]
06/14
* Fixed the awfully coded Baseball Cap script [Playtester]
- please use CONSTANTS!
diff --git a/db/item_db.txt b/db/item_db.txt
index 0a2895077..82ca770ba 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1265,7 +1265,7 @@
4125,Deviace_Card,Deviace Card,6,,10,10,,,,,,,,2,,,,,{ bonus2 bAddRace,RC_DemiHuman,7; bonus2 bAddRace,RC_Brute,7; bonus2 bAddRace,RC_Plant,7; bonus2 bAddRace,RC_Insect,7; },{},{}
4126,Minorous_Card,Minorous Card,6,,10,10,,,,,,,,2,,,,,{ bonus2 bAddSize,2,15; bonus bBaseAtk,5; },{},{}
4127,Nightmare_Card,Nightmare Card,6,,10,10,,,,,,,,769,,,,,{ bonus2 bResEff,Eff_Sleep,10000; bonus bAgi,1; },{},{}
-4128,Golden_Thief_Bug_Card,Golden Thief Bug Card,6,,10,10,,,,,,,,32,,,,,{ bonus bNoMagicDamage,0; bonus bUseSPrate,100; },{},{}
+4128,Golden_Thief_Bug_Card,Golden Thief Bug Card,6,,10,10,,,,,,,,32,,,,,{ bonus bNoMagicDamage,100; bonus bUseSPrate,100; },{},{}
4129,Bapho_Jr._Card,Bapho Jr. Card,6,,10,10,,,,,,,,4,,,,,{ bonus bAgi,3; bonus bCritical,1; },{},{}
4130,Scorpion_King_Card,Scorpion King Card,6,,10,10,,,,,,,,2,,,,,{ bonus2 bAddEle,Ele_Undead,20; },{},{}
4131,Moonlight_Flower_Card,Moonlight Flower Card,6,,10,10,,,,,,,,64,,,,,{ bonus bSpeedRate,25; },{},{}
diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql
index d2e3f0edb..4625058af 100644
--- a/sql-files/item_db.sql
+++ b/sql-files/item_db.sql
@@ -1293,7 +1293,7 @@ REPLACE INTO `item_db` VALUES (4124,'Medusa_Card','Medusa Card',6,NULL,10,10,NUL
REPLACE INTO `item_db` VALUES (4125,'Deviace_Card','Deviace Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,' bonus2 bAddRace,RC_DemiHuman,7; bonus2 bAddRace,RC_Brute,7; bonus2 bAddRace,RC_Plant,7; bonus2 bAddRace,RC_Insect,7; ',NULL,NULL);
REPLACE INTO `item_db` VALUES (4126,'Minorous_Card','Minorous Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,' bonus2 bAddSize,2,15; bonus bBaseAtk,5; ',NULL,NULL);
REPLACE INTO `item_db` VALUES (4127,'Nightmare_Card','Nightmare Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,769,NULL,NULL,NULL,NULL,' bonus2 bResEff,Eff_Sleep,10000; bonus bAgi,1; ',NULL,NULL);
-REPLACE INTO `item_db` VALUES (4128,'Golden_Thief_Bug_Card','Golden Thief Bug Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,32,NULL,NULL,NULL,NULL,' bonus bNoMagicDamage,0; bonus bUseSPrate,100; ',NULL,NULL);
+REPLACE INTO `item_db` VALUES (4128,'Golden_Thief_Bug_Card','Golden Thief Bug Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,32,NULL,NULL,NULL,NULL,' bonus bNoMagicDamage,100; bonus bUseSPrate,100; ',NULL,NULL);
REPLACE INTO `item_db` VALUES (4129,'Bapho_Jr._Card','Bapho Jr. Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,NULL,NULL,NULL,' bonus bAgi,3; bonus bCritical,1; ',NULL,NULL);
REPLACE INTO `item_db` VALUES (4130,'Scorpion_King_Card','Scorpion King Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,' bonus2 bAddEle,Ele_Undead,20; ',NULL,NULL);
REPLACE INTO `item_db` VALUES (4131,'Moonlight_Flower_Card','Moonlight Flower Card',6,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,64,NULL,NULL,NULL,NULL,' bonus bSpeedRate,25; ',NULL,NULL);
diff --git a/src/map/battle.c b/src/map/battle.c
index 7ca35dc6e..b7350fbd4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -300,6 +300,9 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
return 0;
}
+ if(sc->data[SC_HERMODE].timer != -1 && flag&BF_MAGIC)
+ return 0;
+
if(sc->data[SC_FOGWALL].timer != -1 && flag&BF_MAGIC
&& rand()%100 < 75 && !(skill_get_inf(skill_num)&INF_GROUND_SKILL))
return 0;
@@ -313,7 +316,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
status_change_end(bl, SC_KAUPE, -1);
return 0;
}
-
+
//Now damage increasing effects
if(sc->data[SC_AETERNA].timer!=-1 && skill_num != PA_PRESSURE && skill_num != PF_SOULBURN){
damage<<=1;
@@ -382,6 +385,14 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
if((--sci->val3)<=0 || (sci->val2<=0) || skill_num == AL_HOLYLIGHT)
status_change_end(bl, SC_KYRIE, -1);
}
+
+ //Special no damage states
+ if(flag&BF_WEAPON && sd && sd->special_state.no_weapon_damage)
+ damage -= damage*sd->special_state.no_weapon_damage/100;
+
+ if(flag&BF_MAGIC && sd && sd->special_state.no_magic_damage)
+ damage -= damage*sd->special_state.no_magic_damage/100;
+
if (damage <= 0) return 0;
}
@@ -1076,11 +1087,6 @@ static struct Damage battle_calc_weapon_attack(
flag.hit =1;
} //End hit/miss calculation
- if(tsd && tsd->special_state.no_weapon_damage) {
- if (wd.div_ < 0) wd.div_*=-1;
- return wd;
- }
-
if (flag.hit && !flag.infdef) //No need to do the math for plants
{ //Hitting attack
@@ -2354,12 +2360,6 @@ struct Damage battle_calc_magic_attack(
if (flag.infdef && ad.damage > 0)
ad.damage = 1;
- if (tsd && status_isimmune(target)) {
- if (sd && battle_config.gtb_pvp_only) { // [MouseJstr]
- MATK_RATE(100 - battle_config.gtb_pvp_only);
- } else ad.damage = 0;
- }
-
ad.damage=battle_calc_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag);
if (map_flag_gvg(target->m))
ad.damage=battle_calc_gvg_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag);
@@ -3280,7 +3280,7 @@ static const struct battle_data_short {
{ "item_auto_get", &battle_config.item_auto_get },
{ "drop_rate0item", &battle_config.drop_rate0item },
{ "pvp_exp", &battle_config.pvp_exp },
- { "gtb_pvp_only", &battle_config.gtb_pvp_only },
+ { "gtb_sc_immunity", &battle_config.gtb_sc_immunity},
{ "guild_max_castles", &battle_config.guild_max_castles },
{ "death_penalty_type", &battle_config.death_penalty_type },
{ "death_penalty_base", &battle_config.death_penalty_base },
@@ -3675,7 +3675,7 @@ void battle_set_defaults() {
battle_config.base_exp_rate=100;
battle_config.job_exp_rate=100;
battle_config.pvp_exp=1;
- battle_config.gtb_pvp_only=0;
+ battle_config.gtb_sc_immunity=50;
battle_config.death_penalty_type=0;
battle_config.death_penalty_base=0;
battle_config.death_penalty_job=0;
diff --git a/src/map/battle.h b/src/map/battle.h
index c926b3599..0d1669deb 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -124,7 +124,7 @@ extern struct Battle_Config {
unsigned short death_penalty_type;
unsigned short death_penalty_base,death_penalty_job;
unsigned short pvp_exp; // [MouseJstr]
- unsigned short gtb_pvp_only; // [MouseJstr]
+ unsigned short gtb_sc_immunity;
int zeny_penalty;
unsigned short restart_hp_rate;
unsigned short restart_sp_rate;
diff --git a/src/map/map.h b/src/map/map.h
index 4fa89f7aa..4fcc1ff22 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -494,14 +494,13 @@ struct map_session_data {
struct guild *gmaster_flag;
} state;
struct {
+ unsigned char no_weapon_damage, no_magic_damage;
unsigned killer : 1;
unsigned killable : 1;
unsigned restart_full_recover : 1;
unsigned no_castcancel : 1;
unsigned no_castcancel2 : 1;
unsigned no_sizefix : 1;
- unsigned no_magic_damage : 1;
- unsigned no_weapon_damage : 1;
unsigned no_gemstone : 1;
unsigned intravision : 1; // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
} special_state;
diff --git a/src/map/pc.c b/src/map/pc.c
index e42aa454f..eeecf6a70 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1550,12 +1550,16 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
sd->special_state.no_sizefix = 1;
break;
case SP_NO_MAGIC_DAMAGE:
- if(sd->state.lr_flag != 2)
- sd->special_state.no_magic_damage = 1;
+ if(sd->state.lr_flag == 2)
+ break;
+ val+= sd->special_state.no_magic_damage;
+ sd->special_state.no_magic_damage = cap_value(val,0,100);
break;
case SP_NO_WEAPON_DAMAGE:
- if(sd->state.lr_flag != 2)
- sd->special_state.no_weapon_damage = 1;
+ if(sd->state.lr_flag == 2)
+ break;
+ val+= sd->special_state.no_weapon_damage;
+ sd->special_state.no_weapon_damage = cap_value(val,0,100);
break;
case SP_NO_GEMSTONE:
if(sd->state.lr_flag != 2)
diff --git a/src/map/skill.c b/src/map/skill.c
index 2db04b974..48cab9cd4 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2427,8 +2427,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
if (status_isdead(src) || (src != bl && status_isdead(bl)))
return 1;
- if (skillid && skill_get_type(skillid) == BF_MAGIC &&
- !battle_config.gtb_pvp_only && status_isimmune(bl)) {
+ if (skillid && skill_get_type(skillid) == BF_MAGIC && status_isimmune(bl))
+ {
if (sd) clif_skill_fail(sd,skillid,0,0);
//GTB makes all targetted skills silently fail.
return 1;
@@ -3855,11 +3855,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
}
break;
- case BS_HAMMERFALL: /* ハンマーフォール */
- if(dstsd && dstsd->special_state.no_weapon_damage) {
- clif_skill_nodamage(src,bl,skillid,skilllv,0);
- break;
- }
+ case BS_HAMMERFALL:
clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start(bl,SC_STUN,(20 + 10 * skilllv),skilllv,skill_get_time2(skillid,skilllv)));
break;
@@ -4778,10 +4774,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case NPC_LICK:
- if (dstsd && dstsd->special_state.no_weapon_damage ) {
- clif_skill_nodamage(src,bl,skillid,skilllv,0);
- break;
- }
status_zap(bl, 0, 100);
clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start(bl,type,(skilllv*5),skilllv,skill_get_time2(skillid,skilllv)));
diff --git a/src/map/status.c b/src/map/status.c
index 7e7cadfb6..5cfc34f64 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3670,8 +3670,8 @@ int status_isimmune(struct block_list *bl)
{
struct status_change *sc =status_get_sc(bl);
if (bl->type == BL_PC &&
- ((struct map_session_data *)bl)->special_state.no_magic_damage)
- return 1;
+ ((TBL_PC*)bl)->special_state.no_magic_damage)
+ return ((TBL_PC*)bl)->special_state.no_magic_damage > battle_config.gtb_sc_immunity;
if (sc && sc->count && sc->data[SC_HERMODE].timer != -1)
return 1;
return 0;