summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/guild2/schg_cas01.txt24
-rw-r--r--npc/guild2/schg_cas02.txt26
-rw-r--r--npc/guild2/schg_cas03.txt26
-rw-r--r--src/map/map.c6
-rw-r--r--src/map/party.c3
-rw-r--r--src/map/skill.c9
-rw-r--r--src/map/unit.c1
7 files changed, 46 insertions, 49 deletions
diff --git a/npc/guild2/schg_cas01.txt b/npc/guild2/schg_cas01.txt
index 46dbcda48..b5036406a 100644
--- a/npc/guild2/schg_cas01.txt
+++ b/npc/guild2/schg_cas01.txt
@@ -1188,8 +1188,7 @@ OnDisable:
// Barrier Summoners
schg_cas01,2,1,0 script #sch01_RL00 -1,{
OnEnable:
- setcell "schg_cas01",114,48,126,48,cell_walkable,0;
- setcell "schg_cas01",114,48,126,48,cell_shootable,0;
+ setwall "schg_cas01",114,48,13,6,0,"sch01_RL00";
guardian "schg_cas01",115,49," ",1905,"#sch01_RL00::OnBarrierDestroyed"; //24;
guardian "schg_cas01",117,49," ",1905,"#sch01_RL00::OnBarrierDestroyed"; //25;
guardian "schg_cas01",119,49," ",1905,"#sch01_RL00::OnBarrierDestroyed"; //26;
@@ -1199,8 +1198,7 @@ OnEnable:
end;
OnDisable:
- setcell "schg_cas01",114,48,126,48,cell_walkable,1;
- setcell "schg_cas01",114,48,126,48,cell_shootable,1;
+ delwall "sch01_RL00";
killmonster "schg_cas01","#sch01_RL00::OnBarrierDestroyed";
end;
@@ -1211,7 +1209,7 @@ OnBarrierDestroyed:
schg_cas01,2,2,0 script #sch01_RL01 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas01",114,51,126,51,cell_walkable,0;
+ setwall "schg_cas01",114,51,13,6,1,"sch01_RL01";
guardian "schg_cas01",115,50," ",1905,"#sch01_RL01::OnBarrierDestroyed"; //30;
guardian "schg_cas01",117,50," ",1905,"#sch01_RL01::OnBarrierDestroyed"; //31;
guardian "schg_cas01",119,50," ",1905,"#sch01_RL01::OnBarrierDestroyed"; //32;
@@ -1225,12 +1223,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc01[2],1;
mapannounce "schg_cas01","The 1st Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas01",114,51,126,51,cell_walkable,1;
+ delwall "sch01_RL01";
}
end;
OnDisable:
- setcell "schg_cas01",114,51,126,51,cell_walkable,1;
+ delwall "sch01_RL01";
killmonster "schg_cas01","#sch01_RL01::OnBarrierDestroyed";
end;
}
@@ -1238,7 +1236,7 @@ OnDisable:
schg_cas01,2,3,0 script #sch01_RL02 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas01",114,154,126,154,cell_walkable,0;
+ setwall "schg_cas01",114,154,13,6,1,"sch01_RL02";
guardian "schg_cas01",115,153," ",1905,"#sch01_RL02::OnBarrierDestroyed"; //36;
guardian "schg_cas01",117,153," ",1905,"#sch01_RL02::OnBarrierDestroyed"; //37;
guardian "schg_cas01",119,153," ",1905,"#sch01_RL02::OnBarrierDestroyed"; //38;
@@ -1252,12 +1250,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc01[3],1;
mapannounce "schg_cas01","The 2nd Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas01",114,154,126,154,cell_walkable,1;
+ delwall "sch01_RL02";
}
end;
OnDisable:
- setcell "schg_cas01",114,154,126,154,cell_walkable,1;
+ delwall "sch01_RL02";
killmonster "schg_cas01","#sch01_RL02::OnBarrierDestroyed";
end;
}
@@ -1265,7 +1263,7 @@ OnDisable:
schg_cas01,2,4,0 script #sch01_RL03 -1,{
OnEnable:
set .MyMobCount,4;
- setcell "schg_cas01",116,241,126,241,cell_walkable,0;
+ setwall "schg_cas01",116,241,11,6,1,"sch01_RL03";
guardian "schg_cas01",116,240," ",1905,"#sch01_RL03::OnBarrierDestroyed"; //42;
guardian "schg_cas01",118,240," ",1905,"#sch01_RL03::OnBarrierDestroyed"; //43;
guardian "schg_cas01",120,240," ",1905,"#sch01_RL03::OnBarrierDestroyed"; //44;
@@ -1277,12 +1275,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc01[4],1;
mapannounce "schg_cas01","The 3rd Fortress Gate is destroyed!",bc_map,"0x00ff00";
- setcell "schg_cas01",116,241,126,241,cell_walkable,1;
+ delwall "sch01_RL03";
}
end;
OnDisable:
- setcell "schg_cas01",116,241,126,241,cell_walkable,1;
+ delwall "sch01_RL03";
killmonster "schg_cas01","#sch01_RL03::OnBarrierDestroyed";
end;
}
diff --git a/npc/guild2/schg_cas02.txt b/npc/guild2/schg_cas02.txt
index fe87d89f4..a009ea410 100644
--- a/npc/guild2/schg_cas02.txt
+++ b/npc/guild2/schg_cas02.txt
@@ -486,7 +486,7 @@ OnGuardianDied:
set .MyMobCount,.MyMobCount-1;
if (.MyMobCount < 2) {
set .MyMobCount,.MyMobCount+1;
- guardian "schg_cas02",334,119,"Guardian Soldier",1899,"#sch02_gard02::OnGuardianDied"; //10;
+ guardian "schg_cas02",334,119,"Guardian Soldier",1899,"#sch02_gard01::OnGuardianDied"; //10;
}
end;
@@ -1189,8 +1189,7 @@ OnDisable:
schg_cas02,2,1,0 script #sch02_RL00 -1,{
OnEnable:
- setcell "schg_cas02",290,98,290,105,cell_walkable,0;
- setcell "schg_cas02",290,98,290,105,cell_shootable,0;
+ setwall "schg_cas02",290,98,8,0,0,"sch02_RL00";
guardian "schg_cas02",289,98," ",1905,"#sch02_RL00::OnBarrierDestroyed"; //24;
guardian "schg_cas02",289,100," ",1905,"#sch02_RL00::OnBarrierDestroyed"; //25;
guardian "schg_cas02",289,102," ",1905,"#sch02_RL00::OnBarrierDestroyed"; //26;
@@ -1198,8 +1197,7 @@ OnEnable:
end;
OnDisable:
- setcell "schg_cas02",290,98,290,105,cell_walkable,1;
- setcell "schg_cas02",290,98,290,105,cell_shootable,1;
+ delwall "sch02_RL00";
killmonster "schg_cas02","#sch02_RL00::OnBarrierDestroyed";
end;
@@ -1210,7 +1208,7 @@ OnBarrierDestroyed:
schg_cas02,2,2,0 script #sch02_RL01 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas02",279,98,279,105,cell_walkable,0;
+ setwall "schg_cas02",279,98,8,0,1,"sch02_RL01";
guardian "schg_cas02",280,98," ",1905,"#sch02_RL01::OnBarrierDestroyed"; //28;
guardian "schg_cas02",280,100," ",1905,"#sch02_RL01::OnBarrierDestroyed"; //29;
guardian "schg_cas02",280,102," ",1905,"#sch02_RL01::OnBarrierDestroyed"; //30;
@@ -1224,12 +1222,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc02[2],1;
mapannounce "schg_cas02","The 1st Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas02",279,98,279,105,cell_walkable,1;
+ delwall "sch02_RL01";
}
end;
OnDisable:
- setcell "schg_cas02",279,98,279,105,cell_walkable,1;
+ delwall "sch02_RL01";
killmonster "schg_cas02","#sch02_RL01::OnBarrierDestroyed";
end;
}
@@ -1237,7 +1235,7 @@ OnDisable:
schg_cas02,2,3,0 script #sch02_RL02 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas02",230,213,230,218,cell_walkable,0;
+ setwall "schg_cas02",230,213,6,0,1,"sch02_RL02";
guardian "schg_cas02",231,214," ",1905,"#sch02_RL02::OnBarrierDestroyed"; //34;
guardian "schg_cas02",231,216," ",1905,"#sch02_RL02::OnBarrierDestroyed"; //35;
guardian "schg_cas02",231,218," ",1905,"#sch02_RL02::OnBarrierDestroyed"; //36;
@@ -1251,12 +1249,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc02[3],1;
mapannounce "schg_cas02","The 2nd Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas02",230,213,230,218,cell_walkable,1;
+ delwall "sch02_RL02";
}
end;
OnDisable:
- setcell "schg_cas02",230,213,230,218,cell_walkable,1;
+ delwall "sch02_RL02";
killmonster "schg_cas02","#sch02_RL02::OnBarrierDestroyed";
end;
}
@@ -1264,7 +1262,7 @@ OnDisable:
schg_cas02,2,4,0 script #sch02_RL03 -1,{
OnEnable:
set .MyMobCount,4;
- setcell "schg_cas02",160,141,165,141,cell_walkable,0;
+ setwall "schg_cas02",160,141,6,6,1,"sch02_RL03";
guardian "schg_cas02",160,140," ",1905,"#sch02_RL03::OnBarrierDestroyed"; //40;
guardian "schg_cas02",162,140," ",1905,"#sch02_RL03::OnBarrierDestroyed"; //41;
guardian "schg_cas02",164,140," ",1905,"#sch02_RL03::OnBarrierDestroyed"; //42;
@@ -1276,12 +1274,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc02[4],1;
mapannounce "schg_cas02","The 3rd Fortress Gate is destroyed!",bc_map,"0x00ff00";
- setcell "schg_cas02",160,141,165,141,cell_walkable,1;
+ delwall "sch02_RL03";
}
end;
OnDisable:
- setcell "schg_cas02",160,141,165,141,cell_walkable,1;
+ delwall "sch02_RL03";
killmonster "schg_cas02","#sch02_RL03::OnBarrierDestroyed";
end;
}
diff --git a/npc/guild2/schg_cas03.txt b/npc/guild2/schg_cas03.txt
index b5b0ef6b9..d67e25cae 100644
--- a/npc/guild2/schg_cas03.txt
+++ b/npc/guild2/schg_cas03.txt
@@ -567,7 +567,7 @@ OnGuardianDied:
Onreset:
stopnpctimer;
- killmonster "schg_cas03","#sch03_gard03::OnGuardianDied";
+ killmonster "schg_cas03","#sch03_gard02::OnGuardianDied";
end;
}
@@ -1191,16 +1191,14 @@ OnDisable:
schg_cas03,2,1,0 script #sch03_RL00 -1,{
OnEnable:
- setcell "schg_cas03",326,301,331,301,cell_walkable,0;
- setcell "schg_cas03",326,301,331,301,cell_shootable,0;
+ setwall "schg_cas03",326,301,6,6,0,"sch03_RL00";
guardian "schg_cas03",326,300," ",1905,"#sch03_RL00::OnBarrierDestroyed"; //24;
guardian "schg_cas03",328,300," ",1905,"#sch03_RL00::OnBarrierDestroyed"; //25;
guardian "schg_cas03",330,300," ",1905,"#sch03_RL00::OnBarrierDestroyed"; //26;
end;
OnDisable:
- setcell "schg_cas03",326,301,331,301,cell_walkable,1;
- setcell "schg_cas03",326,301,331,301,cell_shootable,1;
+ delwall "sch03_RL00";
killmonster "schg_cas03","#sch03_RL00::OnBarrierDestroyed";
end;
@@ -1211,7 +1209,7 @@ OnBarrierDestroyed:
schg_cas03,2,2,0 script #sch03_RL01 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas03",325,277,332,277,cell_walkable,0;
+ setwall "schg_cas03",325,277,8,6,1,"sch03_RL01";
guardian "schg_cas03",326,278," ",1905,"#sch03_RL01::OnBarrierDestroyed"; //27;
guardian "schg_cas03",328,278," ",1905,"#sch03_RL01::OnBarrierDestroyed"; //28;
guardian "schg_cas03",330,278," ",1905,"#sch03_RL01::OnBarrierDestroyed"; //29;
@@ -1225,12 +1223,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc03[2],1;
mapannounce "schg_cas03","The 1st Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas03",325,277,332,277,cell_walkable,1;
+ delwall "sch03_RL01";
}
end;
OnDisable:
- setcell "schg_cas03",325,277,332,277,cell_walkable,1;
+ delwall "sch03_RL01";
killmonster "schg_cas03","#sch03_RL01::OnBarrierDestroyed";
end;
}
@@ -1238,7 +1236,7 @@ OnDisable:
schg_cas03,2,3,0 script #sch03_RL02 -1,{
OnEnable:
set .MyMobCount,6;
- setcell "schg_cas03",200,230,200,237,cell_walkable,0;
+ setwall "schg_cas03",200,230,8,0,1,"sch03_RL02";
guardian "schg_cas03",201,231," ",1905,"#sch03_RL02::OnBarrierDestroyed"; //33;
guardian "schg_cas03",201,233," ",1905,"#sch03_RL02::OnBarrierDestroyed"; //34;
guardian "schg_cas03",201,235," ",1905,"#sch03_RL02::OnBarrierDestroyed"; //35;
@@ -1252,12 +1250,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc03[3],1;
mapannounce "schg_cas03","The 2nd Fortress Gate is destroyed.",bc_map,"0x00ff00";
- setcell "schg_cas03",200,230,200,237,cell_walkable,1;
+ delwall "sch03_RL02";
}
end;
OnDisable:
- setcell "schg_cas03",200,230,200,237,cell_walkable,1;
+ delwall "sch03_RL02";
killmonster "schg_cas03","#sch03_RL02::OnBarrierDestroyed";
end;
}
@@ -1265,7 +1263,7 @@ OnDisable:
schg_cas03,2,4,0 script #sch03_RL03 -1,{
OnEnable:
set .MyMobCount,4;
- setcell "schg_cas03",285,198,285,205,cell_walkable,0;
+ setwall "schg_cas03",285,198,8,0,1,"sch03_RL03";
guardian "schg_cas03",284,199," ",1905,"#sch03_RL03::OnBarrierDestroyed"; //39;
guardian "schg_cas03",284,201," ",1905,"#sch03_RL03::OnBarrierDestroyed"; //40;
guardian "schg_cas03",284,203," ",1905,"#sch03_RL03::OnBarrierDestroyed"; //41;
@@ -1277,12 +1275,12 @@ OnBarrierDestroyed:
if (.MyMobCount == 0) {
setarray $agit_sc03[4],1;
mapannounce "schg_cas03","The 3rd Fortress Gate is destroyed!",bc_map,"0x00ff00";
- setcell "schg_cas03",285,198,285,205,cell_walkable,1;
+ delwall "sch03_RL03";
}
end;
OnDisable:
- setcell "schg_cas03",285,198,285,205,cell_walkable,1;
+ delwall "sch03_RL03";
killmonster "schg_cas03","#sch03_RL03::OnBarrierDestroyed";
end;
}
diff --git a/src/map/map.c b/src/map/map.c
index bbff98410..8a74bcca1 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1518,8 +1518,6 @@ int map_quit(struct map_session_data *sd)
if (sd->npc_timer_id != -1) //Cancel the event timer.
npc_timerevent_quit(sd);
- if( sd->state.bg_id )
- bg_team_leave(sd,1);
npc_script_event(sd, NPCE_LOGOUT);
//Unit_free handles clearing the player related data,
@@ -3275,6 +3273,7 @@ int map_instance_destroy_timer(int tid, unsigned int tick, int id, intptr data)
void map_instance_destroy(int instance_id)
{
int last = 0, type;
+ struct party_data *p;
time_t now = time(NULL);
if( !instance_id || !instance[instance_id].name_id )
@@ -3312,6 +3311,9 @@ void map_instance_destroy(int instance_id)
instance[instance_id].ivar = NULL;
instance[instance_id].svar = NULL;
+ if( instance[instance_id].party_id && (p = party_search(instance[instance_id].party_id)) != NULL )
+ p->instance_id = 0;
+
ShowInfo("[Instance] Destroyed %s.\n", instance[instance_id].name);
memset( &instance[instance_id], 0x00, sizeof(instance[0]) );
}
diff --git a/src/map/party.c b/src/map/party.c
index a71344ed7..ae9685075 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -557,7 +557,10 @@ int party_broken(int party_id)
return 0;
if( p->instance_id )
+ {
+ instance[p->instance_id].party_id = 0;
map_instance_destroy( p->instance_id );
+ }
for(i=0;i<MAX_PARTY;i++){
if(p->data[i].sd!=NULL){
diff --git a/src/map/skill.c b/src/map/skill.c
index 4e4cf1734..4629e9f6e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1112,13 +1112,10 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
continue; // No target
if( rand()%1000 > sd->autospell3[i].rate )
continue;
- if( !battle_check_range(&sd->bl, bl, skill_get_range2(&sd->bl, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) )
- continue;
+ tbl = (sd->autospell3[i].id < 0) ? &sd->bl : bl;
- if( sd->autospell3[i].id < 0 )
- tbl = &sd->bl;
- else
- tbl = bl;
+ if( !battle_check_range(&sd->bl, tbl, skill_get_range2(&sd->bl, skill,skilllv) + (skill == RG_CLOSECONFINE?0:1)) )
+ continue;
sd->state.autocast = 1;
skill_consume_requirement(sd,skill,skilllv,1);
diff --git a/src/map/unit.c b/src/map/unit.c
index 4fce9b2d7..f19eb4d4a 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1976,6 +1976,7 @@ int unit_free(struct block_list *bl, int clrtype)
guild_send_memberinfoshort(sd,0);
pc_cleareventtimer(sd);
pc_inventory_rental_clear(sd);
+ if( sd->state.bg_id ) bg_team_leave(sd,1);
pc_delspiritball(sd,sd->spiritball,1);
if( sd->reg )