diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-30 18:41:05 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-30 18:41:05 +0000 |
commit | 6699c90798b52154bf6d4cd62cf151b312a12db1 (patch) | |
tree | 4a7a83d78d89284f4d0e5a6eb991a6adf521a579 | |
parent | b5bfcd51b5544f76bf68c14d5c13f80d922290f0 (diff) | |
download | hercules-6699c90798b52154bf6d4cd62cf151b312a12db1.tar.gz hercules-6699c90798b52154bf6d4cd62cf151b312a12db1.tar.bz2 hercules-6699c90798b52154bf6d4cd62cf151b312a12db1.tar.xz hercules-6699c90798b52154bf6d4cd62cf151b312a12db1.zip |
- If someone is expulsed from a guild while the guild storage is open, it will be auto-closed now.
- Modified battle_consume_ammo to prevent consuming multiple arrows on AC_SHOWER.
- Readded script command skillpointcount. (who removed it? <.<)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6406 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 5 | ||||
-rw-r--r-- | src/map/battle.c | 8 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/guild.c | 3 | ||||
-rw-r--r-- | src/map/script.c | 14 | ||||
-rw-r--r-- | src/map/skill.c | 6 |
6 files changed, 35 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 38d34c56b..9574c5112 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,11 @@ 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/04/30
+ * If someone is expulsed from a guild while the guild storage is open, it
+ will be auto-closed now. [Skotlex]
+ * Modified battle_consume_ammo to prevent consuming multiple arrows on
+ AC_SHOWER. [Skotlex]
+ * Readded script command skillpointcount... [Skotlex]
* Fixed and enabled STEAL skill [Lupus]
* Implemented NJ_SHADOWJUMP. [blackhole89]
* Moved the soul-drain code to skill_counter_additionaleffect [Skotlex]
diff --git a/src/map/battle.c b/src/map/battle.c index 521753a25..c1c451471 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -934,12 +934,18 @@ static void battle_calc_base_damage(struct block_list *src, struct block_list *t * Consumes ammo for the given skill.
*------------------------------------------
*/
-static void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
+void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
{
int qty=1;
if (!battle_config.arrow_decrement)
return;
+ if (skill == AC_SHOWER) {
+ //Can't consume arrows this way as it triggers per target, gotta wait for the direct invocation with lv -1
+ if (lv > 0)
+ return;
+ lv *= -1;
+ }
if (skill)
{
qty = skill_get_ammo_qty(skill, lv);
diff --git a/src/map/battle.h b/src/map/battle.h index d0511eb53..96ea7eebc 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -90,6 +90,7 @@ int battle_check_undead(int race,int element); int battle_check_target(struct block_list *src, struct block_list *target,int flag);
int battle_check_range(struct block_list *src,struct block_list *bl,int range);
+void battle_consume_ammo(struct map_session_data* sd, int skill, int lv);
// ݒ
int battle_config_switch(const char *str); // [Valaris]
diff --git a/src/map/guild.c b/src/map/guild.c index 0c71ee293..820e17484 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -851,7 +851,8 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag, clif_guild_memberlist(online_member_sd);
if(sd != NULL && sd->status.guild_id == guild_id) {
-
+ if (sd->state.storage_flag == 2) //Close the guild storage.
+ storage_guild_storageclose(sd);
sd->status.guild_id=0;
sd->guild_emblem_id=0;
sd->state.guild_sent=0;
diff --git a/src/map/script.c b/src/map/script.c index 5880c0b81..f9a87e1be 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -271,6 +271,7 @@ int buildin_birthpet(struct script_state *st); int buildin_resetlvl(struct script_state *st);
int buildin_resetstatus(struct script_state *st);
int buildin_resetskill(struct script_state *st);
+int buildin_skillpointcount(struct script_state *st);
int buildin_changebase(struct script_state *st);
int buildin_changesex(struct script_state *st);
int buildin_waitingroom(struct script_state *st);
@@ -594,6 +595,7 @@ struct { {buildin_resetlvl,"resetlvl","i"},
{buildin_resetstatus,"resetstatus",""},
{buildin_resetskill,"resetskill",""},
+ {buildin_skillpointcount,"skillpointcount",""},
{buildin_changebase,"changebase","i"},
{buildin_changesex,"changesex",""},
{buildin_waitingroom,"waitingroom","si*"},
@@ -6322,6 +6324,18 @@ int buildin_resetskill(struct script_state *st) }
/*==========================================
+ * Counts total amount of skill points.
+ *------------------------------------------
+ */
+int buildin_skillpointcount(struct script_state *st)
+{
+ struct map_session_data *sd;
+ sd=script_rid2sd(st);
+ push_val(st->stack,C_INT,sd->status.skill_point + pc_resetskill(sd,2));
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------
*/
diff --git a/src/map/skill.c b/src/map/skill.c index c4ecd5960..1103d6c19 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2732,6 +2732,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s skill_castend_damage_id);
//Skill-attack at the end in case it has knockback. [Skotlex]
skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,0);
+ if (sd)
+ battle_consume_ammo(sd, skillid, -skilllv);
}
break;
@@ -6853,6 +6855,8 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign case UNT_ATTACK_SKILLS:
skill_attack(skill_get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+ if (sg->skill_id == AC_SHOWER)
+ sg->val2++; //Store count of hitted enemies to know when to delete an arrow.
break;
case UNT_FIREPILLAR_WAITING:
@@ -9476,6 +9480,8 @@ int skill_delunitgroup(struct block_list *src, struct skill_unit_group *group) status_change_end(src,SC_GOSPEL,-1);
}
}
+ if (group->skill_id == AC_SHOWER && group->val2 && src->type==BL_PC)
+ battle_consume_ammo((TBL_PC*)src, group->skill_id, -group->skill_lv); //Delete arrow if at least one target was hit.
group->alive_count=0;
if(group->unit!=NULL){
|