summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-15 18:56:54 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-15 18:56:54 +0000
commitea2ae867ed32cdea9107b446ee7cdfe3a2be6d95 (patch)
tree43aab9b4180d956488810f96da7a003ba6c2d28e /src/map/pc.c
parentaf3903eef455c03277036c972bc8c53e6ddacd28 (diff)
downloadhercules-ea2ae867ed32cdea9107b446ee7cdfe3a2be6d95.tar.gz
hercules-ea2ae867ed32cdea9107b446ee7cdfe3a2be6d95.tar.bz2
hercules-ea2ae867ed32cdea9107b446ee7cdfe3a2be6d95.tar.xz
hercules-ea2ae867ed32cdea9107b446ee7cdfe3a2be6d95.zip
- Made the warm skills BF_WEAPON type so that they may trigger effect cards.
- Also changed their pl to -1 so they carry the elemeso they carry the element. - Warm skills now damage other players for 60sp per hit. - Warm skill damage interval decreased to 100ms instead of 1000ms. - TK_DODGE now only dodges ranged weapon attacks, while under Spurt mode it dodges everything. - Cleaned up and expanded the sc_def_rate battle config. The new battle flags are mob_sc_def_rate, pc_sc_def_rate, mob_max_sc_def, pc_max_sc_def - Modified Marionette Control so that the max bonus stats you get is capped to your server's defined max stats instead of 99. - Mobs are no longer affected by the vs_traps_bctall switch. - Added function pc_damage_sp to damage the SP of players. - Modified Warm skills so that it only hurts SP of players while attacking/knocking back mobs. - Autospell loop breaks after one skill is successful. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5288 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index fe435d73f..7604c8dd7 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5272,6 +5272,33 @@ static int pc_respawn(int tid,unsigned int tick,int id,int data)
}
return 0;
}
+
+/*==========================================
+ * Damages a player's SP, returns remaining SP. [Skotlex]
+ * damage is absolute damage, rate is % damage (100 = 100%)
+ * Returns remaining SP, or -1 if the player did not have enough SP to substract from.
+ *------------------------------------------
+ */
+int pc_damage_sp(struct map_session_data *sd, int damage, int rate)
+{
+ if (!sd->status.sp)
+ return 0;
+
+ if (rate)
+ damage += (rate*(sd->status.sp-damage)/sd->status.max_sp)/100;
+
+ if (sd->status.sp >= damage){
+ sd->status.sp -= damage;
+ clif_updatestatus(sd,SP_SP);
+ return sd->status.sp;
+ }
+ if (sd->status.sp) {
+ sd->status.sp = 0;
+ clif_updatestatus(sd,SP_SP);
+ return -1;
+ }
+ return 0;
+}
/*==========================================
* pcにダメ?ジを?える
*------------------------------------------
@@ -5918,14 +5945,11 @@ int pc_heal(struct map_session_data *sd,int hp,int sp)
nullpo_retr(0, sd);
- if(pc_checkoverhp(sd)) {
- if(hp > 0)
- hp = 0;
- }
- if(pc_checkoversp(sd)) {
- if(sp > 0)
- sp = 0;
- }
+ if(hp > 0 && pc_checkoverhp(sd))
+ hp = 0;
+
+ if(sp > 0 && pc_checkoversp(sd))
+ sp = 0;
if(sd->sc.count && sd->sc.data[SC_BERSERK].timer!=-1) //バ?サ?ク中は回復させないらしい
return 0;