summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 14:30:47 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 14:30:47 +0000
commitad245cf78e5433863b990b581483dcd1523526ce (patch)
tree1617d8451dda24f2ecf6980e6c1c52410a7ec18a
parentcd3c81a17469d5b519bfde36dfbdc565937b466e (diff)
downloadhercules-ad245cf78e5433863b990b581483dcd1523526ce.tar.gz
hercules-ad245cf78e5433863b990b581483dcd1523526ce.tar.bz2
hercules-ad245cf78e5433863b990b581483dcd1523526ce.tar.xz
hercules-ad245cf78e5433863b990b581483dcd1523526ce.zip
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7370 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt7
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/clif.c15
-rw-r--r--src/map/itemdb.c15
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/pc.c11
-rw-r--r--src/map/skill.c7
7 files changed, 34 insertions, 24 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 3afb89c1a..48e007584 100644
--- a/Changelog-Trunk.txt
+++ b/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.
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
* Map server will now resent the whole list of online characters to
char-server on reconnect when the kick_on_disconnect setting is active.
diff --git a/src/map/battle.c b/src/map/battle.c
index e74862b77..0e6b19073 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1367,8 +1367,6 @@ static struct Damage battle_calc_weapon_attack(
skillratio += 140+60*skill_lv;
break;
case BA_MUSICALSTRIKE:
- skillratio += 40*skill_lv-40;
- break;
case DC_THROWARROW:
skillratio += 50*skill_lv;
break;
diff --git a/src/map/clif.c b/src/map/clif.c
index 6521dca6c..30e0c1cd1 100644
--- a/src/map/clif.c
+++ b/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;
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;
}
@@ -8061,6 +8058,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->bl.prev != NULL)
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);
@@ -8240,8 +8244,9 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
else
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);
}
/*==========================================
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 7651535f1..80a58a520 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -285,7 +285,6 @@ static int itemdb_ispetequip(struct item_data *data)
}
}
-
/*==========================================
* Trade Restriction functions [Skotlex]
*------------------------------------------
@@ -598,7 +597,7 @@ static int itemdb_read_itemslottable(void)
struct item_data* item;
sscanf(p, "%d#%d#", &nameid, &equip);
item = itemdb_search(nameid);
- if (equip && item && itemdb_isequip2(item))
+ if (equip && item && itemdb_isequip2(item))
item->equip = equip;
p = strchr(p, 10);
if(!p) break;
@@ -1184,12 +1183,18 @@ void itemdb_reload(void)
void do_final_itemdb(void)
{
item_db->destroy(item_db, itemdb_final_sub, 1);
- if (dummy_item.script)
+ if (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);
- if (dummy_item.unequip_script)
+ dummy_item.equip_script = NULL;
+ }
+ if (dummy_item.unequip_script) {
script_free_code(dummy_item.unequip_script);
+ dummy_item.unequip_script = NULL;
+ }
}
int do_init_itemdb(void)
diff --git a/src/map/map.h b/src/map/map.h
index 116ff25fd..7cdbb00cf 100644
--- a/src/map/map.h
+++ b/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 blockedmove :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;
struct guild *gmaster_flag;
} state;
diff --git a/src/map/pc.c b/src/map/pc.c
index 417aab16f..63d097b14 100644
--- a/src/map/pc.c
+++ b/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);
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);
@@ -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)
unit_remove_map(&sd->pd->bl, clrtype);
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->bl.m = m;
diff --git a/src/map/skill.c b/src/map/skill.c
index a07db8ba0..7f460e507 100644
--- a/src/map/skill.c
+++ b/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;
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);
}
break;