Browse Source

- Corrected Musical Strike having a different damage equation from Throw Arrow.
- Some minor cleanup of Soul Change
- Added state rewarp to players. It gets set when a pc_setpos call is triggered while the player is changing maps so that when the player finish loading the map, it is inmediately rewarped to where it has been rewarped/recalled to.


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

skotlex 19 years ago
parent
commit
6775ca1476
7 changed files with 34 additions and 24 deletions
  1. 7 0
      Changelog-Trunk.txt
  2. 0 2
      src/map/battle.c
  3. 10 5
      src/map/clif.c
  4. 10 5
      src/map/itemdb.c
  5. 1 0
      src/map/map.h
  6. 3 8
      src/map/pc.c
  7. 3 4
      src/map/skill.c

+ 7 - 0
Changelog-Trunk.txt

@@ -3,6 +3,13 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 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.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
+2006/05/28
+	* Corrected Musical Strike having a different damage equation from Throw
+	  Arrow. [Skotlex]
+	* Added state rewarp to players. It gets set when a pc_setpos call is
+	  triggered while the player is changing maps so that when the player finish
+	  loading the map, it is inmediately rewarped to where it has been
+	  rewarped/recalled to. [Skotlex]
 2006/05/27
 2006/05/27
 	* Map server will now resent the whole list of online characters to
 	* Map server will now resent the whole list of online characters to
 	  char-server on reconnect when the kick_on_disconnect setting is active.
 	  char-server on reconnect when the kick_on_disconnect setting is active.

+ 0 - 2
src/map/battle.c

@@ -1367,8 +1367,6 @@ static struct Damage battle_calc_weapon_attack(
 					skillratio += 140+60*skill_lv;
 					skillratio += 140+60*skill_lv;
 					break;
 					break;
 				case BA_MUSICALSTRIKE:
 				case BA_MUSICALSTRIKE:
-					skillratio += 40*skill_lv-40;
-					break;
 				case DC_THROWARROW:
 				case DC_THROWARROW:
 					skillratio += 50*skill_lv;
 					skillratio += 50*skill_lv;
 					break;
 					break;

+ 10 - 5
src/map/clif.c

@@ -1754,9 +1754,6 @@ int clif_changemap(struct map_session_data *sd, short map, int x, int y) {
 	WFIFOW(fd,20) = y;
 	WFIFOW(fd,20) = y;
 	WFIFOSET(fd, packet_len_table[0x91]);
 	WFIFOSET(fd, packet_len_table[0x91]);
 
 
-	if(pc_isdead(sd)) // If player is dead, and is spawned (such as @refresh) send death packet. [Valaris]
-		clif_clearchar_area(&sd->bl,1);
-
 	return 0;
 	return 0;
 }
 }
 
 
@@ -8061,6 +8058,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	
 	
 	if(sd->bl.prev != NULL)
 	if(sd->bl.prev != NULL)
 		return;
 		return;
+		
+	if (sd->state.rewarp)
+  	{	//Rewarp player.
+		sd->state.rewarp = 0;
+		clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
+		return;
+	}
 
 
 	if(sd->npc_id) npc_event_dequeue(sd);
 	if(sd->npc_id) npc_event_dequeue(sd);
 
 
@@ -8240,8 +8244,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	else
 	else
 		sd->areanpc_id = 0;
 		sd->areanpc_id = 0;
 
 
-	if (pc_isdead(sd)) //In case you warped dead.
-		clif_clearchar_area(&sd->bl, 1);
+  	// If player is dead, and is spawned (such as @refresh) send death packet. [Valaris]
+	if(pc_isdead(sd))
+		clif_clearchar_area(&sd->bl,1);
 }
 }
 
 
 /*==========================================
 /*==========================================

+ 10 - 5
src/map/itemdb.c

@@ -285,7 +285,6 @@ static int itemdb_ispetequip(struct item_data *data)
 	}
 	}
 }
 }
 
 
-
 /*==========================================
 /*==========================================
  * Trade Restriction functions [Skotlex]
  * Trade Restriction functions [Skotlex]
  *------------------------------------------
  *------------------------------------------
@@ -598,7 +597,7 @@ static int itemdb_read_itemslottable(void)
 		struct item_data* item;
 		struct item_data* item;
 		sscanf(p, "%d#%d#", &nameid, &equip);
 		sscanf(p, "%d#%d#", &nameid, &equip);
 		item = itemdb_search(nameid);
 		item = itemdb_search(nameid);
-		if (equip && item && itemdb_isequip2(item))			
+		if (equip && item && itemdb_isequip2(item))
 			item->equip = equip;
 			item->equip = equip;
 		p = strchr(p, 10);
 		p = strchr(p, 10);
 		if(!p) break;
 		if(!p) break;
@@ -1184,12 +1183,18 @@ void itemdb_reload(void)
 void do_final_itemdb(void)
 void do_final_itemdb(void)
 {
 {
 	item_db->destroy(item_db, itemdb_final_sub, 1);
 	item_db->destroy(item_db, itemdb_final_sub, 1);
-	if (dummy_item.script)
+	if (dummy_item.script) {
 		script_free_code(dummy_item.script);
 		script_free_code(dummy_item.script);
-	if (dummy_item.equip_script)
+		dummy_item.script = NULL;
+	}
+	if (dummy_item.equip_script) {
 		script_free_code(dummy_item.equip_script);
 		script_free_code(dummy_item.equip_script);
-	if (dummy_item.unequip_script)
+		dummy_item.equip_script = NULL;
+	}
+	if (dummy_item.unequip_script) {
 		script_free_code(dummy_item.unequip_script);
 		script_free_code(dummy_item.unequip_script);
+		dummy_item.unequip_script = NULL;
+	}
 }
 }
 
 
 int do_init_itemdb(void)
 int do_init_itemdb(void)

+ 1 - 0
src/map/map.h

@@ -493,6 +493,7 @@ struct map_session_data {
 		unsigned finalsave :1; //Signals whether the final save for the char was done or not yet. Meant to prevent exploits and the like. [Skotlex]
 		unsigned finalsave :1; //Signals whether the final save for the char was done or not yet. Meant to prevent exploits and the like. [Skotlex]
 		unsigned blockedmove :1;
 		unsigned blockedmove :1;
 		unsigned using_fake_npc :1;
 		unsigned using_fake_npc :1;
+		unsigned rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex]
 		unsigned short autoloot;
 		unsigned short autoloot;
 		struct guild *gmaster_flag;
 		struct guild *gmaster_flag;
 	} state;
 	} state;

+ 3 - 8
src/map/pc.c

@@ -3167,13 +3167,6 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
 		ShowDebug("pc_setpos: Passed mapindex(%d) is invalid!\n", mapindex);
 		ShowDebug("pc_setpos: Passed mapindex(%d) is invalid!\n", mapindex);
 		return 1;
 		return 1;
 	}
 	}
-	if(sd->state.auth && sd->bl.prev == NULL)
-	{	//Should NOT move a character while it is not in a map (changing between maps, for example)
-		//state.auth helps identifies if this is the initial setpos rather than a normal map-change set pos.
-		if (battle_config.etc_log)
-			ShowInfo("pc_setpos failed: Attempted to relocate player %s (%d:%d) while it is still between maps.\n", sd->status.name, sd->status.account_id, sd->status.char_id);
-		return 3;
-	}
 
 
 	m=map_mapindex2mapid(mapindex);
 	m=map_mapindex2mapid(mapindex);
 
 
@@ -3246,7 +3239,9 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
 		if(sd->status.pet_id > 0 && sd->pd)
 		if(sd->status.pet_id > 0 && sd->pd)
 			unit_remove_map(&sd->pd->bl, clrtype);
 			unit_remove_map(&sd->pd->bl, clrtype);
 		clif_changemap(sd,map[m].index,x,y); // [MouseJstr]
 		clif_changemap(sd,map[m].index,x,y); // [MouseJstr]
-	}
+	} else if(sd->state.auth)
+		//Tag player for rewarping after map-loading is done. [Skotlex]
+		sd->state.rewarp = 1;
 	
 	
 	sd->mapindex =  mapindex;
 	sd->mapindex =  mapindex;
 	sd->bl.m = m;
 	sd->bl.m = m;

+ 3 - 4
src/map/skill.c

@@ -5085,10 +5085,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 			}
 			}
 			sp1 = sstatus->sp;
 			sp1 = sstatus->sp;
 			sp2 = tstatus->sp;
 			sp2 = tstatus->sp;
-			status_zap(src, 0, sp1);
-			status_zap(bl, 0, sp2);
-			status_heal(src, 0, sp2, 3);
-			status_heal(bl, 0, sp1, 3);
+			//TODO: Will this work correctly once sp1/sp2 go above INT_MAX?
+			status_heal(src, 0, (signed int)(sp2-sp1), 3);
+			status_heal(bl, 0, (signed int)(sp1-sp2), 3);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 		}
 		}
 		break;
 		break;