summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-30 08:16:31 +0000
committerKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-01-30 08:16:31 +0000
commitade714d129fe396f32009bcb7845b6c06e4e5398 (patch)
treea2cf79063d6281f40501719fd745e73451c446ed
parent102c2281c2eff9b87c4b6c4f78f3113e989d400d (diff)
downloadhercules-ade714d129fe396f32009bcb7845b6c06e4e5398.tar.gz
hercules-ade714d129fe396f32009bcb7845b6c06e4e5398.tar.bz2
hercules-ade714d129fe396f32009bcb7845b6c06e4e5398.tar.xz
hercules-ade714d129fe396f32009bcb7845b6c06e4e5398.zip
Implemented bonus2 bSPVanishRate for Dark Priest Card - it isn't finished - I get '[Warning]: pc_bonus2: unknown type 0 50 10!' ~.~
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5109 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--db/item_db.txt2
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/map.h5
-rw-r--r--src/map/pc.c6
5 files changed, 21 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 93c17a0e8..704d01dc2 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/01/30
+ * Implemented bonus2 bSPVanishRate for Dark Priest Card [Komurka]
+ - it isn't finished - I get '[Warning]: pc_bonus2: unknown type 0 50 10!' ><
* Applied lordalfa patch - you can now forbid usage of certain cards on PVP/GVG/WoE
defined in item_noequip.txt [Komurka]
diff --git a/db/item_db.txt b/db/item_db.txt
index 79fe109aa..1e484e130 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -1307,7 +1307,7 @@
4168,Dark_Lord_Card,Dark Lord Card,6,,10,10,,,,,,,,64,,,,,{ bonus4 bAutoSpellWhenHit,83,5,10,0; if(isequipped(4169)==0) end; bonus bMaxHPrate,20; bonus bMaxSPrate,20; }
4169,Dark_Illusion_Card,Dark Illusion Card,6,,10,10,,,,,,,,769,,,,,{ bonus bMaxHPrate,-10; bonus bMaxSPrate,-10; bonus bCastrate,-10-10*isequipped(4168); }
4170,Dark_Frame_Card,Dark Frame Card,6,,10,10,,,,,,,,16,,,,,{ bonus2 bAddEffWhenHit,Eff_Stone,2000; }
-4171,Dark_Priest_Card,Dark Priest Card,6,,10,10,,,,,,,,2,,,,,{ bonus3 bSPDrainRate,30,10,1; if(BaseJob==Job_Sage) bonus bSPGainValue,1; }
+4171,Dark_Priest_Card,Dark Priest Card,6,,10,10,,,,,,,,2,,,,,{ bonus2 bSPVanishRate,50,10; if(BaseJob==Job_Sage) bonus bSPGainValue,1; }
4172,The_Paper_Card,The Paper Card,6,,10,10,,,,,,,,2,,,,,{ bonus bCritAtkRate,20; bonus2 bSPDrainValue,-1,0; }
4173,Demon_Pungus_Card,Demon Pungus Card,6,,10,10,,,,,,,,16,,,,,{ bonus2 bAddEffWhenHit,Eff_Sleep,2000; }
4174,Deviling_Card,Deviling Card,6,,10,10,,,,,,,,4,,,,,{ bonus2 bSubEle,Ele_Neutral,50; bonus2 bSubEle,Ele_Water,-50; bonus2 bSubEle,Ele_Earth,-50; bonus2 bSubEle,Ele_Fire,-50; bonus2 bSubEle,Ele_Wind,-50; bonus2 bSubEle,Ele_Poison,-50; bonus2 bSubEle,Ele_Holy,-50; bonus2 bSubEle,Ele_Dark,-50; bonus2 bSubEle,Ele_Ghost,-50; bonus2 bSubEle,Ele_Undead,-50; }
diff --git a/src/map/battle.c b/src/map/battle.c
index 91563d939..1e1c16c7f 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3133,6 +3133,14 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
if (tsd && sd->sp_drain_type)
pc_heal(tsd, 0, -sp);
+
+ if (target && target->type == BL_PC && rand()%1000 < sd->sp_vanish_rate)
+ {
+ sp = tsd->status.hp * sd->sp_vanish_per/100;
+ if (sp > 0)
+ pc_heal(tsd, 0, -sp);
+
+ }
}
}
if (rdamage > 0) //By sending attack type "none" skill_additional_effect won't be invoked. [Skotlex]
diff --git a/src/map/map.h b/src/map/map.h
index c56e4c886..26e5875f4 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -341,6 +341,7 @@ struct weapon_data {
short sp_drain_rate;
short sp_drain_per;
short sp_drain_value;
+
short add_damage_classid[MAX_PC_BONUS];
int add_damage_classrate[MAX_PC_BONUS];
int add_damage_class_count;
@@ -623,6 +624,8 @@ struct map_session_data {
short hp_loss_type;
short sp_drain_type;
short sp_gain_value, hp_gain_value;
+ short sp_vanish_rate;
+ short sp_vanish_per;
short add_drop_count;
unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest]
unsigned short unbreakable_equip; //100% break resistance on certain equipment
@@ -1100,7 +1103,7 @@ enum {
SP_SP_GAIN_RACE, SP_SUBRACE2, SP_ADDEFF_WHENHIT_SHORT, // 2031-2033
SP_UNSTRIPABLE_WEAPON,SP_UNSTRIPABLE_ARMOR,SP_UNSTRIPABLE_HELM,SP_UNSTRIPABLE_SHIELD, // 2034-2037
SP_INTRAVISION, SP_ADD_MONSTER_DROP_ITEMGROUP, SP_SP_LOSS_RATE, // 2038-2040
- SP_ADD_SKILL_BLOW //2041
+ SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE //2041
};
enum {
diff --git a/src/map/pc.c b/src/map/pc.c
index 31269c150..a46f34611 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1843,6 +1843,12 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
}
sd->sp_drain_type = val;
break;
+ case SP_SP_VANISH_RATE:
+ if(sd->state.lr_flag != 2) {
+ sd->sp_vanish_rate += type2;
+ sd->sp_vanish_per += val;
+ }
+ break;
case SP_GET_ZENY_NUM:
if(sd->state.lr_flag != 2 && sd->get_zeny_rate < val)
{