summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-17 06:39:58 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-17 06:39:58 +0000
commit729424c1ebb6762f49b85c97d56dabb5975958a1 (patch)
tree78f8bd86c4b5c02e30e5838cb191109fe69f33b6
parent4fd1ecc58626ef3b2ce5668ec008315c4b7e35a7 (diff)
downloadhercules-729424c1ebb6762f49b85c97d56dabb5975958a1.tar.gz
hercules-729424c1ebb6762f49b85c97d56dabb5975958a1.tar.bz2
hercules-729424c1ebb6762f49b85c97d56dabb5975958a1.tar.xz
hercules-729424c1ebb6762f49b85c97d56dabb5975958a1.zip
* Final fix on Juperos NPC.
* Fix on initnpctimer not attaching rid. * Fix on OnTouch ignoring -1 NPCs. * Fix on @reloadscript crashing due to passing non BL_SKILL bl to a function that accepts only BL_SKILL bl. * Added area NPC detection in clif_parseLoadEndAck. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5638 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt6
-rw-r--r--npc/warps/dungeons/juperos.txt17
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/npc.c4
-rw-r--r--src/map/script.c1
6 files changed, 24 insertions, 12 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 5768e65cd..33c347406 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,12 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/17
+ * Final fix on Juperos NPC. [Lance]
+ * Fix on initnpctimer not attaching rid. [Lance]
+ * Fix on OnTouch ignoring -1 NPCs. [Lance]
+ * Fix on @reloadscript crashing due to passing non BL_SKILL bl to a function that accepts only BL_SKILL bl.
+ [Lance]
+ * Added area NPC detection in clif_parseLoadEndAck. [Lance]
* Fixed compiler warning in script.c get_mob_data. [Lance]
* Temperory resolved issues on Juperos until I get the exact description on the behaviour
in retail servers. [Lance]
diff --git a/npc/warps/dungeons/juperos.txt b/npc/warps/dungeons/juperos.txt
index 42c1433da..1882a3518 100644
--- a/npc/warps/dungeons/juperos.txt
+++ b/npc/warps/dungeons/juperos.txt
@@ -55,21 +55,19 @@ juperos_02.gat,129,150,0 script Juperos 111,{
mes "Are you sure you want to enter?";
next;
if(select("Yes","No") == 1){
- close2;
- set jupe_destination$, "jupe_ele.gat";
+ set jupe_destination$, "jupe_ele_r.gat";
set jupe_destination_x, 50;
set jupe_destination_y, 94;
+ close2;
warp "jupe_ele.gat",41,45;
end;
}
close;
}
-jupe_ele.gat,41,45,0 script detectionUnit -1,10,10{
- if(jupe_ele_timer == 0){
- set jupe_ele_timer, 1;
- initnpctimer;
- }
+jupe_ele.gat,41,45,0 script detectionUnit -1,20,20{
+OnTouch:
+ initnpctimer;
end;
OnTimer1000:
@@ -80,11 +78,10 @@ OnTimer1000:
OnTimer15000:
stopnpctimer;
setnpctimer 0;
- set jupe_ele_timer, 0;
+ warp jupe_destination$,jupe_destination_x,jupe_destination_y;
set jupe_destination$, "";
set jupe_destination_x, 0;
set jupe_destination_y, 0;
- warp jupe_destination$,jupe_destination_x,jupe_destination_y;
end;
}
@@ -92,10 +89,10 @@ jupe_ele_r.gat,50,98,0 script Juperos Elevator 111,{
mes "Are you sure you want to go up?";
next;
if(select("Yes","No") == 1){
- close2;
set jupe_destination$, "juperos_02.gat";
set jupe_destination_x, 129;
set jupe_destination_y, 147;
+ close2;
warp "jupe_ele.gat",41,45;
}
close;
diff --git a/src/map/clif.c b/src/map/clif.c
index 13e936f18..556a48f8d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8846,6 +8846,12 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]
map_foreachinarea(clif_getareachar,sd->bl.m,sd->bl.x-AREA_SIZE,sd->bl.y-AREA_SIZE,sd->bl.x+AREA_SIZE,sd->bl.y+AREA_SIZE,BL_ALL,sd);
+
+ // For automatic triggering of NPCs after map loading (so you don't need to walk 1 step first)
+ if (map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNPC))
+ npc_touch_areanpc(sd,sd->bl.m,sd->bl.x,sd->bl.y);
+ else
+ sd->areanpc_id = 0;
}
/*==========================================
diff --git a/src/map/map.c b/src/map/map.c
index ef67616c4..92bddc3c5 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1279,7 +1279,7 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...) {
for(i=2;i<=last_object_id;i++){
if(objects[i]){
- if(!(objects[i]->type&type))
+ if(!(objects[i]->type==type)) // Fixed [Lance]
continue;
if(bl_list_count>=BL_LIST_MAX) {
if(battle_config.error_log)
diff --git a/src/map/npc.c b/src/map/npc.c
index 1fc99de95..4e6842b97 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -777,6 +777,7 @@ int npc_settimerevent_tick(struct npc_data *nd,int newtimer)
flag= sd->npc_timer_id != -1 ;
} else
flag= nd->u.scr.timerid != -1 ;
+
if(flag)
npc_timerevent_stop(nd);
nd->u.scr.timer=newtimer;
@@ -1556,6 +1557,7 @@ int npc_unload (struct npc_data *nd)
}
}
}
+
aFree(nd);
return 0;
@@ -2033,7 +2035,7 @@ static int npc_parse_script (char *w1,char *w2,char *w3,char *w4,char *first_lin
if (xs >= 0) xs = xs * 2 + 1;
if (ys >= 0) ys = ys * 2 + 1;
- if (class_ >= 0) {
+ if (class_ >= -1) { // -1 NPCs use OnTouch [Lance]
for (i = 0; i < ys; i++) {
for (j = 0; j < xs; j++) {
if (map_getcell(m, x - xs/2 + j, y - ys/2 + i, CELL_CHKNOPASS))
diff --git a/src/map/script.c b/src/map/script.c
index 7de21a76f..4eeea13cb 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5659,6 +5659,7 @@ int buildin_initnpctimer(struct script_state *st)
else
nd=(struct npc_data *)map_id2bl(st->oid);
+ nd->u.scr.rid = st->rid;
npc_settimerevent_tick(nd,0);
npc_timerevent_start(nd, st->rid);
return 0;