summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.c28
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/status.c18
3 files changed, 40 insertions, 8 deletions
diff --git a/src/map/map.c b/src/map/map.c
index fba8faa88..9cf047d56 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3156,6 +3156,34 @@ void do_final(void) {
ShowStatus("Successfully terminated.\n");
}
+static int map_abort_sub(DBKey key,void * data,va_list ap)
+{
+ struct map_session_data *sd = (TBL_PC*)data;
+
+ if (!sd->state.auth || sd->state.waitingdisconnect || sd->state.finalsave)
+ return 0;
+
+ chrif_save(sd,1);
+ return 1;
+}
+
+
+//------------------------------
+// Function called when the server
+// has received a crash signal.
+//------------------------------
+void do_abort(void) {
+ //Save all characters and then flush the inter-connection.
+ if (!chrif_isconnect())
+ {
+ ShowFatalError("Server has crashed without a connection to the char-server, character data can't be saved!\n");
+ return;
+ }
+ ShowError("Server received crash signal! Attempting to save all online characters!\n");
+ map_foreachpc(map_abort_sub);
+ chrif_flush_fifo();
+}
+
/*======================================================
* Map-Server Version Screen [MC Cameri]
*------------------------------------------------------
diff --git a/src/map/skill.c b/src/map/skill.c
index 5c77f186a..65cc19bcf 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4831,7 +4831,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case NPC_CHANGETELEKINESIS:
case NPC_CHANGEUNDEAD:
clif_skill_nodamage(src,bl,skillid,skilllv,
- sc_start4(bl, type, 100, skilllv, skillid, skill_get_pl(skillid,skilllv), 0,
+ sc_start2(bl, type, 100, skilllv, skill_get_pl(skillid,skilllv),
skill_get_time(skillid, skilllv)));
break;
diff --git a/src/map/status.c b/src/map/status.c
index b7c595d51..993be24ea 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3874,9 +3874,9 @@ static unsigned char status_calc_element(struct block_list *bl, struct status_ch
if( sc->data[SC_BENEDICTIO].timer!=-1 )
return ELE_HOLY;
if( sc->data[SC_CHANGEUNDEAD].timer!=-1)
- return sc->data[SC_CHANGEUNDEAD].val3;
+ return ELE_UNDEAD;
if( sc->data[SC_ELEMENTALCHANGE].timer!=-1)
- return sc->data[SC_ELEMENTALCHANGE].val3;
+ return sc->data[SC_ELEMENTALCHANGE].val2;
return cap_value(element,0,UCHAR_MAX);
}
@@ -3893,7 +3893,7 @@ static unsigned char status_calc_element_lv(struct block_list *bl, struct status
if( sc->data[SC_CHANGEUNDEAD].timer!=-1)
return 1;
if(sc->data[SC_ELEMENTALCHANGE].timer!=-1)
- return sc->data[SC_ELEMENTALCHANGE].val4;
+ return sc->data[SC_ELEMENTALCHANGE].val1;
return cap_value(lv,1,4);
}
@@ -5007,10 +5007,14 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
skill_enchant_elemental_end(bl,type);
break;
case SC_ELEMENTALCHANGE:
- //Val1 is skill level, val2 is skill that invoked this.
- if (!val3) //Val 3 holds the element, when not given, a random one is picked.
- val3 = rand()%ELE_MAX;
- val4 =1+rand()%4; //Elemental Lv is always a random value between 1 and 4.
+ //Val1 is elemental change level, val2 is eleemnt to use.
+ if (!val2) //Val 3 holds the element, when not given, a random one is picked.
+ val2 = rand()%ELE_MAX;
+ //Elemental Lv is always a random value between 1 and 4.
+ if (val1 == 1)
+ val1 =1+rand()%4;
+ else if (val1 > 4)
+ val1 = 4;
break;
case SC_PROVIDENCE:
val2=val1*5; //Race/Ele resist