Sfoglia il codice sorgente

- Minor cleanups
- Adjusted menu-based skills so you can't reuse the same skill until you've dealt with the menu.
- Adjust autospells so that removing an autospell works when the script of the card that removes the autospell is triggered before the script that adds the spell.
- The "requested name of gm-hidden char" warning will not be displayed when the object in question is an NPC (since you can use Intravision to do this).
- Corrected the header format for invisible npcs.
- Venom Knife no longer takes into accounts cards or EDP.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9905 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 18 anni fa
parent
commit
cf8685131d
9 ha cambiato i file con 47 aggiunte e 18 eliminazioni
  1. 10 0
      Changelog-Trunk.txt
  2. 1 1
      doc/script_commands.txt
  3. 1 1
      src/login/login.c
  4. 5 1
      src/map/battle.c
  5. 16 4
      src/map/clif.c
  6. 11 3
      src/map/pc.c
  7. 2 5
      src/map/script.c
  8. 0 3
      src/map/skill.c
  9. 1 0
      src/map/unit.c

+ 10 - 0
Changelog-Trunk.txt

@@ -3,6 +3,16 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/02/24
+	* Adjusted menu-based skills so you can't reuse the same skill until you've
+	  dealt with the menu.
+	* Adjust autospells so that removing an autospell works when the script of
+	  the card that removes the autospell is triggered before the script that
+	  adds the spell.
+	* The "requested name of gm-hidden char" warning will not be displayed when
+	  the object in question is an NPC (since you can use Intravision to do
+	  this).
+	* Venom Knife no longer takes into accounts cards or EDP.
 2007/02/23
 	* Guild expulsion now will fail when the character to be kicked is in a
 	  guild castle (rather than checking for the character doing the expulsion)

+ 1 - 1
doc/script_commands.txt

@@ -329,7 +329,7 @@ moment - if you need that, try it and tell us of the results.
 
 ** Define a 'floating' NPC object.
 
--%TAB%script%TAB%-1,{<code>}
+-%TAB%script%TAB%<NPC Name>%TAB%-1,{<code>}
 
 This will define an NPC object not triggerable by normal means. This would 
 normally mean it's pointless since it can't do anything, but there are 

+ 1 - 1
src/login/login.c

@@ -3031,7 +3031,7 @@ int parse_admin(int fd) {
 int lan_subnetcheck(long *p) {
 
 	int i;
-	unsigned char *sbn, *msk, *src = (unsigned char *)p;
+	unsigned char *sbn, *msk/*, *src = (unsigned char *)p*/;
 	
 	for(i=0; i<subnet_count; i++) {
 	

+ 5 - 1
src/map/battle.c

@@ -1377,6 +1377,9 @@ static struct Damage battle_calc_weapon_attack(
 				case AS_SONICBLOW:
 					skillratio += -50+5*skill_lv;
 					break;
+				case AS_VENOMKNIFE:
+					flag.cardfix = 0;
+					break;
 				case TF_SPRINKLESAND:
 					skillratio += 30;
 					break;
@@ -1639,7 +1642,8 @@ static struct Damage battle_calc_weapon_attack(
 
 			if(sc->data[SC_EDP].timer != -1 &&
 			  	skill_num != ASC_BREAKER &&
-				skill_num != ASC_METEORASSAULT)
+				skill_num != ASC_METEORASSAULT &&
+				skill_num != AS_VENOMKNIFE)
 				ATK_ADDRATE(sc->data[SC_EDP].val3);
 		}
 

+ 16 - 4
src/map/clif.c

@@ -8489,8 +8489,10 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
 	if (!bl) return;
 
 	sc = status_get_sc(bl);
-	if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) && pc_isGM(sd) < battle_config.hack_info_GM_level)
-	{
+	if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) &&
+		bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple
+		pc_isGM(sd) < battle_config.hack_info_GM_level
+	) {
 		//GM characters (with client side GM enabled are able to see invisible stuff) [Lance]
 		//Asked name of invisible player, this shouldn't be possible!
 		//Possible bot? Thanks to veider and qspirit
@@ -9703,14 +9705,17 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
 	
 	if(target_id<0 && -target_id == sd->bl.id) // for disguises [Valaris]
 		target_id = sd->bl.id;
-		
+	
+	if(sd->menuskill_id)
+		return; //Can't use skills while a menu is open.
+	
 	if (sd->skillitem == skillnum) {
 		if (skilllv != sd->skillitemlv)
 			skilllv = sd->skillitemlv;
 		unit_skilluse_id(&sd->bl, target_id, skillnum, skilllv);
 		return;
 	}
-		
+
 	sd->skillitem = sd->skillitemlv = 0;
 	if (skillnum == MO_EXTREMITYFIST) {
 		if ((sd->sc.data[SC_COMBO].timer == -1 ||
@@ -9801,7 +9806,11 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
 	if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
 		return;
 	
+	if(sd->menuskill_id)
+		return; //Can't use skills while a menu is open.
+
 	pc_delinvincibletimer(sd);
+
 	if (sd->skillitem == skillnum) {
 		if (skilllv != sd->skillitemlv)
 			skilllv = sd->skillitemlv;
@@ -9864,6 +9873,9 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
 	if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
 		return;
 	
+	if(sd->menuskill_id && sd->menuskill_id != RFIFOW(fd,2))
+		return; //Can't use skills while a menu is open.
+
 	pc_delinvincibletimer(sd);
 
 	skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4));

+ 11 - 3
src/map/pc.c

@@ -1193,7 +1193,7 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
 	if (i<0) return 0; //Nothing to substract from.
 
 	j = i;
-	for(; i>=0 && rate > 0; i--)
+	for(; i>=0 && rate>0; i--)
 	{
 		if (spell[i].id != id || spell[i].lv != lv) continue;
 		if (rate >= spell[i].rate) {
@@ -1207,6 +1207,13 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
 			rate = 0;
 		}
 	}
+	if (rate > 0 && ++j < max)
+	{	 //Tag this as "pending" autospell to remove.
+		spell[j].id = id;
+		spell[j].lv = lv;
+		spell[j].rate = -rate;
+		spell[j].card_id = 0;
+	}
 	return rate;
 }
 
@@ -1216,12 +1223,13 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor
 		pc_bonus_autospell_del(spell, max, id, lv, -rate, card_id);
 
 	for (i = 0; i < max && spell[i].id; i++) {
-		if (spell[i].card_id == card_id &&
+		if ((spell[i].card_id == card_id || !spell[i].card_id) &&
 			spell[i].id == id && spell[i].lv == lv)
 		{
-			if (!battle_config.autospell_stacking)
+			if (!battle_config.autospell_stacking && spell[i].rate > 0)
 				return 0;
 			rate += spell[i].rate;
+			if (rate < 0) card_id = 0; //Reduced from debted autospell.
 			break;
 		}
 	}

+ 2 - 5
src/map/script.c

@@ -12936,16 +12936,13 @@ BUILDIN_FUNC(getvariableofnpc)
 			st->state = END;
 			return 1;
 		}
-		else if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL )
+		if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL )
 		{// NPC not found or has no script
 			ShowError("script: getvariableofnpc: can't find npc %s\n", npc_name);
 			st->state = END;
 			return 1;
 		}
-		else
-		{// push variable reference
-			push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars );
-		}
+		push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars );
 	}
 	return 0;
 }

+ 0 - 3
src/map/skill.c

@@ -851,9 +851,6 @@ int skillnotok (int skillid, struct map_session_data *sd)
 	if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond)
 		return 0;  // gm's can do anything damn thing they want
 
-	if(sd->menuskill_id && skillid != sd->menuskill_id)
-		return 1; //Can't use skills while a menu is open.
-
 	// Check skill restrictions [Celest]
 	if(!map_flag_vs(m) && skill_get_nocast (skillid) & 1)
 		return 1;

+ 1 - 0
src/map/unit.c

@@ -809,6 +809,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
 		//Target_id checking.
 		if(skillnotok(skill_num, sd)) // [MouseJstr]
 			return 0;
+
 		switch(skill_num)
 		{	//Check for skills that auto-select target
 		case MO_CHAINCOMBO: