Forráskód Böngészése

- 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://svn.code.sf.net/p/rathena/svn/trunk@6406 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 éve
szülő
commit
f95ab0abbe
6 módosított fájl, 35 hozzáadás és 2 törlés
  1. 5 0
      Changelog-Trunk.txt
  2. 7 1
      src/map/battle.c
  3. 1 0
      src/map/battle.h
  4. 2 1
      src/map/guild.c
  5. 14 0
      src/map/script.c
  6. 6 0
      src/map/skill.c

+ 5 - 0
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]

+ 7 - 1
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);

+ 1 - 0
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]

+ 2 - 1
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;

+ 14 - 0
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*"},
@@ -6321,6 +6323,18 @@ int buildin_resetskill(struct script_state *st)
 	return 0;
 }
 
+/*==========================================
+ * 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;
+}
+
 /*==========================================
  *
  *------------------------------------------

+ 6 - 0
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){