summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 11:44:12 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 11:44:12 +0000
commitc883ca205971275e576d34b54304c3c5c30f3580 (patch)
tree4d0a218a184099c61a311d65b50e93973c4c773a /src/map
parent230ba4e3dd84a19f7dee67fdc97532e5869bef63 (diff)
downloadhercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.gz
hercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.bz2
hercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.xz
hercules-c883ca205971275e576d34b54304c3c5c30f3580.zip
* updated map server to jA1137~1159
* Some tidying up in mob.c and skill.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1342 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c71
-rw-r--r--src/map/atcommand.h4
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/clif.c56
-rw-r--r--src/map/guild.c20
-rw-r--r--src/map/mail.c39
-rw-r--r--src/map/map.c76
-rw-r--r--src/map/map.h15
-rw-r--r--src/map/mob.c76
-rw-r--r--src/map/mob.h1
-rw-r--r--src/map/party.c4
-rw-r--r--src/map/pc.c157
-rw-r--r--src/map/pc.h4
-rw-r--r--src/map/pet.c2
-rw-r--r--src/map/pet.h1
-rw-r--r--src/map/skill.c658
-rw-r--r--src/map/skill.h6
-rw-r--r--src/map/status.c11
-rw-r--r--src/map/status.h1
19 files changed, 703 insertions, 503 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index b236b211c..a420147bc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -10,6 +10,7 @@
#include "../common/nullpo.h"
#include "../common/mmo.h"
#include "../common/db.h"
+#include "../common/core.h"
#include "log.h"
#include "clif.h"
@@ -29,7 +30,6 @@
#include "script.h"
#include "npc.h"
#include "trade.h"
-#include "core.h"
#ifndef TXT_ONLY
#include "mail.h"
@@ -142,6 +142,10 @@ ACMD_FUNC(reloadmobdb);
ACMD_FUNC(reloadskilldb);
ACMD_FUNC(reloadscript);
ACMD_FUNC(reloadgmdb); // by Yor
+ACMD_FUNC(reloadatcommand);
+ACMD_FUNC(reloadbattleconf);
+ACMD_FUNC(reloadstatusdb);
+ACMD_FUNC(reloadpcdb);
ACMD_FUNC(mapexit);
ACMD_FUNC(idsearch);
ACMD_FUNC(mapinfo);
@@ -389,6 +393,10 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_ReloadSkillDB, "@reloadskilldb", 99, atcommand_reloadskilldb }, // admin command
{ AtCommand_ReloadScript, "@reloadscript", 99, atcommand_reloadscript }, // admin command
{ AtCommand_ReloadGMDB, "@reloadgmdb", 99, atcommand_reloadgmdb }, // admin command
+ { AtCommand_ReloadAtcommand, "@reloadatcommand", 99, atcommand_reloadatcommand },
+ { AtCommand_ReloadBattleConf, "@reloadbattleconf",99, atcommand_reloadbattleconf },
+ { AtCommand_ReloadStatusDB, "@reloadstatusdb", 99, atcommand_reloadstatusdb },
+ { AtCommand_ReloadPcDB, "@reloadpcdb", 99, atcommand_reloadpcdb },
{ AtCommand_CharModel, "@charmodel", 50, atcommand_charmodel },
{ AtCommand_CharSKPoint, "@charskpoint", 60, atcommand_charskpoint },
{ AtCommand_CharSTPoint, "@charstpoint", 60, atcommand_charstpoint },
@@ -5622,6 +5630,7 @@ int atcommand_reloadmobdb(
{
nullpo_retr(-1, sd);
mob_reload();
+ read_petdb();
clif_displaymessage(fd, msg_table[98]); // Monster database reloaded.
return 0;
@@ -5643,6 +5652,66 @@ int atcommand_reloadskilldb(
}
/*==========================================
+ * @reloadatcommand
+ * atcommand_athena.conf のリロード
+ *------------------------------------------
+ */
+int
+atcommand_reloadatcommand(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ atcommand_config_read(ATCOMMAND_CONF_FILENAME);
+ clif_displaymessage(fd, msg_table[254]);
+ return 0;
+}
+/*==========================================
+ * @reloadbattleconf
+ * battle_athena.conf のリロード
+ *------------------------------------------
+ */
+int
+atcommand_reloadbattleconf(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ battle_config_read(BATTLE_CONF_FILENAME);
+ clif_displaymessage(fd, msg_table[255]);
+ return 0;
+}
+/*==========================================
+ * @reloadstatusdb
+ * job_db1.txt job_db2.txt job_db2-2.txt
+ * refine_db.txt size_fix.txt
+ * のリロード
+ *------------------------------------------
+ */
+int
+atcommand_reloadstatusdb(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ status_readdb();
+ clif_displaymessage(fd, msg_table[256]);
+ return 0;
+}
+/*==========================================
+ * @reloadpcdb
+ * exp.txt skill_tree.txt attr_fix.txt
+ * のリロード
+ *------------------------------------------
+ */
+int
+atcommand_reloadpcdb(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ pc_readdb();
+ clif_displaymessage(fd, msg_table[257]);
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------
*/
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 6dcd6cc59..a9678d6a3 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -122,6 +122,10 @@ enum AtCommandType {
AtCommand_ReloadSkillDB,
AtCommand_ReloadScript,
AtCommand_ReloadGMDB,
+ AtCommand_ReloadAtcommand,
+ AtCommand_ReloadBattleConf,
+ AtCommand_ReloadStatusDB,
+ AtCommand_ReloadPcDB,
AtCommand_MapInfo,
AtCommand_Dye,
AtCommand_Hstyle,
diff --git a/src/map/battle.c b/src/map/battle.c
index 78d8215ab..aa30ef0a9 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -928,6 +928,7 @@ static struct Damage battle_calc_pet_weapon_attack(
break;
case AS_SPLASHER: /* ベナムスプラッシャー */
damage = damage*(200+20*skill_lv)/100;
+ hitrate = 1000000;
break;
}
if (div_flag && div_ > 1) { // [Skotlex]
@@ -1432,6 +1433,7 @@ static struct Damage battle_calc_mob_weapon_attack(
break;
case AS_SPLASHER: /* ベナムスプラッシャー */
damage = damage*(200+20*skill_lv)/100;
+ hitrate = 1000000;
break;
}
if (div_flag && div_ > 1) { // [Skotlex]
@@ -2291,6 +2293,8 @@ static struct Damage battle_calc_pc_weapon_attack(
case AS_SPLASHER: /* ベナムスプラッシャー */
damage = damage*(200+20*skill_lv+20*pc_checkskill(sd,AS_POISONREACT))/100;
damage2 = damage2*(200+20*skill_lv+20*pc_checkskill(sd,AS_POISONREACT))/100;
+ no_cardfix = 1;
+ hitrate = 1000000;
break;
case ASC_BREAKER: // -- moonsoul (special damage for ASC_BREAKER skill)
if(sd){
diff --git a/src/map/clif.c b/src/map/clif.c
index 7ebf11b8a..20db97554 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3706,7 +3706,8 @@ int clif_damage(struct block_list *src,struct block_list *dst,unsigned int tick,
if(type != 4 && dst->type == BL_PC && ((struct map_session_data *)dst)->special_state.infinite_endure)
type = 9;
if(sc_data) {
- if(type != 4 && sc_data[SC_ENDURE].timer != -1)
+ if(type != 4 && sc_data[SC_ENDURE].timer != -1 &&
+ (dst->type == BL_PC && !map[dst->m].flag.gvg))
type = 9;
if(sc_data[SC_HALLUCINATION].timer != -1) {
if(damage > 0)
@@ -9794,31 +9795,6 @@ void clif_parse_OpenVending(int fd,struct map_session_data *sd) {
}
/*==========================================
- * /monster /item rewriten by [Yor]
- *------------------------------------------
- */
-void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) {
- char monster_item_name[25];
-
- nullpo_retv(sd);
-
- memset(monster_item_name, '\0', sizeof(monster_item_name));
-
- if (battle_config.atc_gmonly == 0 || pc_isGM(sd)) {
- memcpy(monster_item_name, RFIFOP(fd,2), 24);
-
- if (mobdb_searchname(monster_item_name) != 0) {
- if (pc_isGM(sd) >= get_atcommand_level(AtCommand_Monster))
- atcommand_spawn(fd, sd, "@spawn", monster_item_name); // as @spawn
- } else if (itemdb_searchname(monster_item_name) != NULL) {
- if (pc_isGM(sd) >= get_atcommand_level(AtCommand_Item))
- atcommand_item(fd, sd, "@item", monster_item_name); // as @item
- }
-
- }
-}
-
-/*==========================================
* ギルドを作る
*------------------------------------------
*/
@@ -10099,6 +10075,31 @@ void clif_parse_Recall(int fd, struct map_session_data *sd) { // Added by RoVeRT
return;
}
+/*==========================================
+ * /monster /item rewriten by [Yor]
+ *------------------------------------------
+ */
+void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) {
+ char monster_item_name[25];
+
+ nullpo_retv(sd);
+
+ memset(monster_item_name, '\0', sizeof(monster_item_name));
+
+ if (battle_config.atc_gmonly == 0 || pc_isGM(sd)) {
+ memcpy(monster_item_name, RFIFOP(fd,2), 24);
+
+ if (mobdb_searchname(monster_item_name) != 0) {
+ if (pc_isGM(sd) >= get_atcommand_level(AtCommand_Monster))
+ atcommand_spawn(fd, sd, "@spawn", monster_item_name); // as @spawn
+ } else if (itemdb_searchname(monster_item_name) != NULL) {
+ if (pc_isGM(sd) >= get_atcommand_level(AtCommand_Item))
+ atcommand_item(fd, sd, "@item", monster_item_name); // as @item
+ }
+
+ }
+}
+
void clif_parse_GMHide(int fd, struct map_session_data *sd) { // Modified by [Yor]
nullpo_retv(sd);
@@ -10989,7 +10990,8 @@ static int packetdb_readdb(void)
{clif_parse_friends_list_add,"friendslistadd"},
{clif_parse_friends_list_remove,"friendslistremove"},
{clif_parse_GMkillall,"killall"},
- {clif_parse_GM_Monster_Item,"summon"},
+ {clif_parse_Recall,"summon"},
+ {clif_parse_GM_Monster_Item,"itemmonster"},
{clif_parse_Shift,"shift"},
{clif_parse_debug,"debug"},
diff --git a/src/map/guild.c b/src/map/guild.c
index c65c3963c..935377e19 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -386,7 +386,7 @@ int guild_check_member(const struct guild *g)
nullpo_retr(0, g);
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth && !sd->state.waitingdisconnect){
if(sd->status.guild_id==g->guild_id){
int j,f=1;
for(j=0;j<MAX_GUILD;j++){ // データがあるか
@@ -412,7 +412,7 @@ int guild_recv_noinfo(int guild_id)
int i;
struct map_session_data *sd;
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth && !sd->state.waitingdisconnect){
if(sd->status.guild_id==guild_id)
sd->status.guild_id=0;
}
@@ -442,9 +442,11 @@ int guild_recv_info(struct guild *sg)
for(i=bm=m=0;i<g->max_member;i++){ // sdの設定と人数の確認
if(g->member[i].account_id>0){
struct map_session_data *sd = map_id2sd(g->member[i].account_id);
- g->member[i].sd=(sd!=NULL &&
- sd->status.char_id==g->member[i].char_id &&
- sd->status.guild_id==g->guild_id)? sd:NULL;
+ if (sd && sd->status.char_id == g->member[i].char_id &&
+ sd->status.guild_id == g->guild_id &&
+ !sd->state.waitingdisconnect)
+ g->member[i].sd = sd;
+ else sd = NULL;
m++;
}else
g->member[i].sd=NULL;
@@ -795,9 +797,11 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
for(i=0;i<g->max_member;i++){ // sd再設定
struct map_session_data *sd= map_id2sd(g->member[i].account_id);
- g->member[i].sd=(sd!=NULL &&
- sd->status.char_id==g->member[i].char_id &&
- sd->status.guild_id==guild_id)?sd:NULL;
+ if (sd && sd->status.char_id == g->member[i].char_id &&
+ sd->status.guild_id == g->guild_id &&
+ !sd->state.waitingdisconnect)
+ g->member[i].sd = sd;
+ else sd = NULL;
}
// ここにクライアントに送信処理が必要
diff --git a/src/map/mail.c b/src/map/mail.c
index c7939cca1..46e80be9f 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -15,6 +15,7 @@
#include "clif.h"
#include "chrif.h"
#include "intif.h"
+#include "atcommand.h"
#include "pc.h"
#include "mail.h"
@@ -22,7 +23,7 @@ char mail_db[32] = "mail";
int MAIL_CHECK_TIME = 120000;
int mail_timer;
-extern char msg_table[1000][256]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
+//extern char *msg_table[1000]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
#ifdef MEMWATCH
#include "memwatch.h"
@@ -47,7 +48,7 @@ int mail_check(struct map_session_data *sd,int type)
if(mail_res) {
if (mysql_num_rows(mail_res) == 0) {
//clif_displaymessage(sd->fd,"You have no messages.");
- clif_displaymessage(sd->fd,msg_table[516]);
+ clif_displaymessage(sd->fd, msg_txt(516));
mysql_free_result(mail_res);
return 0;
@@ -69,18 +70,18 @@ int mail_check(struct map_session_data *sd,int type)
if(type==2 || type==3) {
if(atoi(mail_row[4])) {
//sprintf(message, "%d - From : %s (New - Priority)", i, mail_row[2]);
- sprintf(message, msg_table[511], i, mail_row[2]);
+ sprintf(message, msg_txt(511), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
} else {
//sprintf(message, "%d - From : %s (New)", i, mail_row[2]);
- sprintf(message, msg_table[512], i, mail_row[2]);
+ sprintf(message, msg_txt(512), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
}
}
} else if(type==2){
//sprintf(message, "%d - From : %s", i, mail_row[2]);
- sprintf(message, msg_table[513], i, mail_row[2]);
+ sprintf(message, msg_txt(513), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
}
}
@@ -93,18 +94,18 @@ int mail_check(struct map_session_data *sd,int type)
if(i>0 && new_>0 && type==1) {
//sprintf(message, "You have %d new messages.", new_);
- sprintf(message, msg_table[514], new_);
+ sprintf(message, msg_txt(514), new_);
clif_displaymessage(sd->fd, jstrescape(message));
}
if(i>0 && new_>0 && priority>0 && type==1) {
//sprintf(message, "You have %d unread priority messages.", priority);
- sprintf(message, msg_table[515], priority);
+ sprintf(message, msg_txt(515), priority);
clif_displaymessage(sd->fd, jstrescape(message));
}
if(!new_) {
//clif_displaymessage(sd->fd, "You have no new messages.");
- clif_displaymessage(sd->fd, msg_table[516]);
+ clif_displaymessage(sd->fd, msg_txt(516));
}
return 0;
@@ -129,7 +130,7 @@ int mail_read(struct map_session_data *sd, int message_id)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd, "Message not found.");
- clif_displaymessage(sd->fd, msg_table[517]);
+ clif_displaymessage(sd->fd, msg_txt(517));
return 0;
}
@@ -142,7 +143,7 @@ int mail_read(struct map_session_data *sd, int message_id)
}
//sprintf(message, "Reading message from %s", mail_row[2]);
- sprintf(message, msg_table[518], mail_row[2]);
+ sprintf(message, msg_txt(518), mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
sprintf(message, "%s", mail_row[3]);
@@ -179,7 +180,7 @@ int mail_delete(struct map_session_data *sd, int message_id)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd, "Message not found.");
- clif_displaymessage(sd->fd, msg_table[517]);
+ clif_displaymessage(sd->fd, msg_txt(517));
return 0;
}
@@ -187,14 +188,14 @@ int mail_delete(struct map_session_data *sd, int message_id)
if(!atoi(mail_row[2]) && atoi(mail_row[3])) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"Cannot delete unread priority mail.");
- clif_displaymessage(sd->fd,msg_table[519]);
+ clif_displaymessage(sd->fd,msg_txt(519));
return 0;
}
if(!atoi(mail_row[4])) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"You have recieved new mail, use @listmail before deleting.");
- clif_displaymessage(sd->fd,msg_table[520]);
+ clif_displaymessage(sd->fd,msg_txt(520));
return 0;
}
sprintf(tmp_msql,"DELETE FROM `%s` WHERE `message_id` = \"%d\"", mail_db, atoi(mail_row[0]));
@@ -204,7 +205,7 @@ int mail_delete(struct map_session_data *sd, int message_id)
return 0;
}
//else clif_displaymessage(sd->fd,"Message deleted.");
- else clif_displaymessage(sd->fd,msg_table[521]);
+ else clif_displaymessage(sd->fd,msg_txt(521));
}
mysql_free_result(mail_res);
@@ -222,14 +223,14 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
if(pc_isGM(sd) < 80 && sd->mail_counter > 0) {
//clif_displaymessage(sd->fd,"You must wait 10 minutes before sending another message");
- clif_displaymessage(sd->fd,msg_table[522]);
+ clif_displaymessage(sd->fd,msg_txt(522));
return 0;
}
if(strcmp(name,"*")==0) {
if(pc_isGM(sd) < 80) {
//clif_displaymessage(sd->fd, "Access Denied.");
- clif_displaymessage(sd->fd, msg_table[523]);
+ clif_displaymessage(sd->fd, msg_txt(523));
return 0;
}
else
@@ -248,7 +249,7 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"Character does not exist.");
- clif_displaymessage(sd->fd,msg_table[524]);
+ clif_displaymessage(sd->fd,msg_txt(524));
return 0;
}
@@ -273,7 +274,7 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
}
//clif_displaymessage(sd->fd,"Mail has been sent.");
- clif_displaymessage(sd->fd,msg_table[525]);
+ clif_displaymessage(sd->fd,msg_txt(525));
return 0;
}
@@ -310,7 +311,7 @@ int mail_check_timer(int tid,unsigned int tick,int id,int data)
sd->mail_counter--;
if(sd->status.account_id==atoi(mail_row[0]))
//clif_displaymessage(sd->fd, "You have new mail.");
- clif_displaymessage(sd->fd, msg_table[526]);
+ clif_displaymessage(sd->fd, msg_txt(526));
}
}
}
diff --git a/src/map/map.c b/src/map/map.c
index 19edfd08b..f04d64a79 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -110,6 +110,16 @@ int check_online_timer=0; // [Valaris]
#endif /* not TXT_ONLY */
+char *INTER_CONF_NAME;
+char *LOG_CONF_NAME;
+char *MAP_CONF_NAME;
+char *BATTLE_CONF_FILENAME;
+char *ATCOMMAND_CONF_FILENAME;
+char *CHARCOMMAND_CONF_FILENAME;
+char *SCRIPT_CONF_NAME;
+char *MSG_CONF_NAME;
+char *GRF_PATH_FILENAME;
+
#define USE_AFM
#define USE_AF2
@@ -1460,60 +1470,20 @@ int map_quit(struct map_session_data *sd) {
}
}
- if(sd->chatID) // チャットから出る
- chat_leavechat(sd);
-
- if(sd->trade_partner) // 取引を中?する
- trade_tradecancel(sd);
-
- if(sd->party_invite>0) // パ?ティ?誘を拒否する
- party_reply_invite(sd,sd->party_invite_account,0);
-
- if(sd->guild_invite>0) // ギルド?誘を拒否する
- guild_reply_invite(sd,sd->guild_invite,0);
- if(sd->guild_alliance>0) // ギルド同盟?誘を拒否する
- guild_reply_reqalliance(sd,sd->guild_alliance_account,0);
+ if(sd->sc_data && sd->sc_data[SC_BERSERK].timer!=-1) //バ?サ?ク中の終了はHPを100に
+ sd->status.hp = 100;
party_send_logout(sd); // パ?ティのログアウトメッセ?ジ送信
-
guild_send_memberinfoshort(sd,0); // ギルドのログアウトメッセ?ジ送信
-
- pc_cleareventtimer(sd); // イベントタイマを破棄する
-
- if(sd->state.storage_flag)
- storage_guild_storage_quit(sd,0);
- else
- storage_storage_quit(sd); // 倉庫を開いてるなら保存する
-
- // check if we've been authenticated [celest]
- if (sd->state.auth)
- skill_castcancel(&sd->bl,0); // 詠唱を中?する
-
skill_stop_dancing(&sd->bl,1);// ダンス/演奏中?
-
- if(sd->sc_data && sd->sc_data[SC_BERSERK].timer!=-1) //バ?サ?ク中の終了はHPを100に
- sd->status.hp = 100;
-
status_change_clear(&sd->bl,1); // ステ?タス異常を解除する
- skill_clear_unitgroup(&sd->bl); // スキルユニットグル?プの削除
- skill_cleartimerskill(&sd->bl);
-
- // check if we've been authenticated [celest]
- if (sd->state.auth) {
- pc_stop_walking(sd,0);
- pc_stopattack(sd);
- pc_delinvincibletimer(sd);
- }
+ pc_cleareventtimer(sd);
pc_delspiritball(sd,sd->spiritball,1);
- skill_gangsterparadise(sd,0);
- skill_unit_move(&sd->bl,gettick(),0);
if (sd->state.auth)
status_calc_pc(sd,4);
// skill_clear_unitgroup(&sd->bl); // [Sara-chan]
- clif_clearchar_area(&sd->bl,2);
-
if(sd->status.pet_id && sd->pd) {
pet_lootitem_drop(sd->pd,sd);
pet_remove_map(sd);
@@ -1530,11 +1500,11 @@ int map_quit(struct map_session_data *sd) {
if(pc_isdead(sd))
pc_setrestartvalue(sd,2);
+ pc_remove_map(sd,2);
pc_makesavestatus(sd);
chrif_save(sd);
storage_storage_dirty(sd);
storage_storage_save(sd);
- map_delblock(&sd->bl);
}
if( sd->npc_stackbuf && sd->npc_stackbuf != NULL) {
@@ -3266,15 +3236,15 @@ int do_init(int argc, char *argv[]) {
GC_enable_incremental();
#endif
- char *INTER_CONF_NAME="conf/inter_athena.conf";
- char *LOG_CONF_NAME="conf/log_athena.conf";
- char *MAP_CONF_NAME = "conf/map_athena.conf";
- char *BATTLE_CONF_FILENAME = "conf/battle_athena.conf";
- char *ATCOMMAND_CONF_FILENAME = "conf/atcommand_athena.conf";
- char *CHARCOMMAND_CONF_FILENAME = "conf/charcommand_athena.conf";
- char *SCRIPT_CONF_NAME = "conf/script_athena.conf";
- char *MSG_CONF_NAME = "conf/msg_athena.conf";
- char *GRF_PATH_FILENAME = "conf/grf-files.txt";
+ INTER_CONF_NAME="conf/inter_athena.conf";
+ LOG_CONF_NAME="conf/log_athena.conf";
+ MAP_CONF_NAME = "conf/map_athena.conf";
+ BATTLE_CONF_FILENAME = "conf/battle_athena.conf";
+ ATCOMMAND_CONF_FILENAME = "conf/atcommand_athena.conf";
+ CHARCOMMAND_CONF_FILENAME = "conf/charcommand_athena.conf";
+ SCRIPT_CONF_NAME = "conf/script_athena.conf";
+ MSG_CONF_NAME = "conf/msg_athena.conf";
+ GRF_PATH_FILENAME = "conf/grf-files.txt";
chrif_connected = 0;
diff --git a/src/map/map.h b/src/map/map.h
index b25e6f05a..81d1b8cbc 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -220,6 +220,7 @@ struct map_session_data {
struct skill_unit_group_tickset skillunittick[MAX_SKILLUNITGROUPTICKSET];
struct skill_timerskill skilltimerskill[MAX_SKILLTIMERSKILL];
char blockskill[MAX_SKILL]; // [celest]
+ //unsigned int skillstatictimer[MAX_SKILL];
unsigned short timerskill_count; // [celest]
int cloneskill_id;
int potion_hp,potion_sp,potion_per_hp,potion_per_sp;
@@ -490,7 +491,9 @@ struct mob_data {
struct skill_unit_group_tickset skillunittick[MAX_SKILLUNITGROUPTICKSET];
char npc_event[50];
unsigned char size;
- int owner;
+ short recall_flag;
+ int recallmob_count;
+ short recallcount;
};
struct pet_data {
struct block_list bl;
@@ -800,6 +803,16 @@ int cleanup_sub(struct block_list *bl, va_list ap);
void map_helpscreen(); // [Valaris]
int map_delmap(char *mapname);
+extern char *INTER_CONF_NAME;
+extern char *LOG_CONF_NAME;
+extern char *MAP_CONF_NAME;
+extern char *BATTLE_CONF_FILENAME;
+extern char *ATCOMMAND_CONF_FILENAME;
+extern char *CHARCOMMAND_CONF_FILENAME;
+extern char *SCRIPT_CONF_NAME;
+extern char *MSG_CONF_NAME;
+extern char *GRF_PATH_FILENAME;
+
#ifndef TXT_ONLY
// MySQL
diff --git a/src/map/mob.c b/src/map/mob.c
index 80cd6e346..b46b2a317 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -196,8 +196,8 @@ int mob_once_spawn (struct map_session_data *sd, char *mapname,
md->m = m;
md->x0 = x;
md->y0 = y;
- md->xs = 0;
- md->ys = 0;
+ //md->xs = 0;
+ //md->ys = 0;
md->spawndelay1 = -1; // 一度のみフラグ
md->spawndelay2 = -1; // 一度のみフラグ
@@ -297,14 +297,8 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname,
for(count=0;count<amount;count++){
struct guild_castle *gc;
md=(struct mob_data *) aCalloc(sizeof(struct mob_data), 1);
- if(md==NULL){
- printf("mob_spawn_guardian: out of memory !\n");
- exit(1);
- }
memset(md, '\0', sizeof *md);
-
-
mob_spawn_dataset(md,mobname,class_);
md->bl.m=m;
md->bl.x=x;
@@ -334,7 +328,6 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname,
if(guardian==5) { md->hp=gc->Ghp5; gc->GID5=md->bl.id; }
if(guardian==6) { md->hp=gc->Ghp6; gc->GID6=md->bl.id; }
if(guardian==7) { md->hp=gc->Ghp7; gc->GID7=md->bl.id; }
-
}
}
@@ -760,9 +753,6 @@ static int mob_timer(int tid,unsigned int tick,int id,int data)
nullpo_retr(1, md=(struct mob_data*)bl);
- if(!md->bl.type || md->bl.type!=BL_MOB)
- return 1;
-
if(md->timer != tid){
if(battle_config.error_log)
printf("mob_timer %d != %d\n",md->timer,tid);
@@ -1069,7 +1059,6 @@ int mob_stop_walking(struct mob_data *md,int type)
{
nullpo_retr(0, md);
-
if(md->state.state == MS_WALK || md->state.state == MS_IDLE) {
int dx=0,dy=0;
@@ -1405,6 +1394,18 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
if(!mmd || mmd->bl.type!=BL_MOB || mmd->bl.id!=md->master_id)
return 0;
+ // 呼び戻し
+ if(mmd->recall_flag == 1){
+ if (mmd->recallcount < (mmd->recallmob_count+2) ){
+ mob_warp(md,-1,mmd->bl.x,mmd->bl.y,3);
+ mmd->recallcount += 1;
+ } else{
+ mmd->recall_flag = 0;
+ mmd->recallcount=0;
+ }
+ md->state.master_check = 1;
+ return 0;
+ }
// Since it is in the map on which the master is not, teleport is carried out and it pursues.
if( mmd->bl.m != md->bl.m ){
mob_warp(md,mmd->bl.m,mmd->bl.x,mmd->bl.y,3);
@@ -1598,7 +1599,6 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
tick=va_arg(ap,unsigned int);
-
if(DIFF_TICK(tick,md->last_thinktime)<MIN_MOBTHINKTIME)
return 0;
md->last_thinktime=tick;
@@ -1898,19 +1898,20 @@ static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
static int mob_ai_sub_lazy(void * key,void * data,va_list app)
{
struct mob_data *md=(struct mob_data *)data;
+ struct mob_data *mmd=NULL;
unsigned int tick;
va_list ap;
nullpo_retr(0, md);
nullpo_retr(0, app);
-
- ap=va_arg(app,va_list);
+ nullpo_retr(0, ap=va_arg(app,va_list));
if(md->bl.type!=BL_MOB)
return 0;
- if(!md->bl.type || md->bl.type!=BL_MOB)
- return 0;
+ if (md->master_id > 0) {
+ mmd = (struct mob_data *)map_id2bl(md->master_id); //自分のBOSSの情報
+ }
tick=va_arg(ap,unsigned int);
@@ -1924,6 +1925,12 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app)
return 0;
}
+ // 取り巻きモンスターの処理(呼び戻しされた時)
+ if(mmd && md->state.special_mob_ai == 0 && mmd->recall_flag == 1) {
+ mob_ai_sub_hard_slavemob (md,tick);
+ return 0;
+ }
+
if(DIFF_TICK(md->next_walktime,tick)<0 &&
(mob_db[md->class_].mode&1) && mob_can_move(md) ){
@@ -2130,15 +2137,10 @@ int mob_catch_delete(struct mob_data *md,int type)
int mob_timer_delete(int tid, unsigned int tick, int id, int data)
{
- struct block_list *bl=map_id2bl(id);
- struct mob_data *md;
-
- nullpo_retr(0, bl);
+ struct mob_data *md=(struct mob_data *)map_id2bl(id);
+ nullpo_retr(0, md);
- md = (struct mob_data *)bl;
//for Alchemist CANNIBALIZE [Lupus]
-
-
mob_catch_delete(md,3);
return 0;
}
@@ -2476,10 +2478,6 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
// [MouseJstr]
if((map[md->bl.m].flag.pvp == 0) || (battle_config.pvp_exp == 1)) {
-/* if((double)max_hp < tdmg)
- dmg_rate = ((double)max_hp) / tdmg;
- else dmg_rate = 1;*/
-
// 経験値の分配
for(i=0;i<DAMAGELOG_SIZE;i++){
int pid,base_exp,job_exp,flag=1,zeny=0;
@@ -2490,7 +2488,6 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if (battle_config.exp_calc_type == 0) {
// jAthena's exp formula
- // per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./((double)max_hp) * dmg_rate;
per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./tdmg;
temp = (double)mob_db[md->class_].base_exp * per;
base_exp = (temp > 2147483647.)? 0x7fffffff:(int)temp;
@@ -2552,7 +2549,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
}
if((pid=tmpsd[i]->status.party_id)>0){ // パーティに入っている
- int j=0;
+ int j;
for(j=0;j<pnum;j++) // 公平パーティリストにいるかどうか
if(pt[j].id==pid)
break;
@@ -3006,7 +3003,6 @@ int mob_countslave_sub(struct block_list *bl,va_list ap)
nullpo_retr(0, c=va_arg(ap,int *));
nullpo_retr(0, md = (struct mob_data *)bl);
-
if( md->master_id==id )
(*c)++;
return 0;
@@ -3196,7 +3192,9 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data )
md->skilltimer=-1;
//沈黙や状態異常など
if(md->sc_data){
- if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 || md->sc_data[SC_ROKISWEIL].timer != -1 || md->sc_data[SC_STEELBODY].timer != -1)
+ if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 ||
+ (!(mob_db[md->class_].mode & 0x20) && md->sc_data[SC_ROKISWEIL].timer != -1) ||
+ md->sc_data[SC_STEELBODY].timer != -1)
return 0;
if(md->sc_data[SC_AUTOCOUNTER].timer != -1 && md->skillid != KN_AUTOCOUNTER) //オートカウンター
return 0;
@@ -3279,7 +3277,9 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data )
md->skilltimer=-1;
if(md->sc_data){
- if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 || md->sc_data[SC_ROKISWEIL].timer != -1 || md->sc_data[SC_STEELBODY].timer != -1)
+ if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 ||
+ (!(mob_db[md->class_].mode & 0x20) && md->sc_data[SC_ROKISWEIL].timer != -1) ||
+ md->sc_data[SC_STEELBODY].timer != -1)
return 0;
if(md->sc_data[SC_AUTOCOUNTER].timer != -1 && md->skillid != KN_AUTOCOUNTER) //オートカウンター
return 0;
@@ -3354,7 +3354,9 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx)
// 沈黙や異常
if(md->sc_data){
- if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 || md->sc_data[SC_ROKISWEIL].timer != -1 || md->sc_data[SC_STEELBODY].timer != -1)
+ if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 ||
+ (!(mob_db[md->class_].mode & 0x20) && md->sc_data[SC_ROKISWEIL].timer != -1) ||
+ md->sc_data[SC_STEELBODY].timer != -1)
return 0;
if(md->sc_data[SC_AUTOCOUNTER].timer != -1 && md->skillid != KN_AUTOCOUNTER) //オートカウンター
return 0;
@@ -3471,7 +3473,9 @@ int mobskill_use_pos( struct mob_data *md,
//沈黙や状態異常など
if(md->sc_data){
- if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 || md->sc_data[SC_ROKISWEIL].timer != -1 || md->sc_data[SC_STEELBODY].timer != -1)
+ if(md->opt1>0 || md->sc_data[SC_DIVINA].timer != -1 ||
+ (!(mob_db[md->class_].mode & 0x20) && md->sc_data[SC_ROKISWEIL].timer != -1) ||
+ md->sc_data[SC_STEELBODY].timer != -1)
return 0;
if(md->sc_data[SC_AUTOCOUNTER].timer != -1 && md->skillid != KN_AUTOCOUNTER) //オートカウンター
return 0;
diff --git a/src/map/mob.h b/src/map/mob.h
index aa5753902..e5e95879e 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -139,6 +139,7 @@ int mobskill_event(struct mob_data *md,int flag);
int mobskill_castend_id( int tid, unsigned int tick, int id,int data );
int mobskill_castend_pos( int tid, unsigned int tick, int id,int data );
int mob_summonslave(struct mob_data *md2,int *value,int amount,int flag);
+int mob_countslave(struct mob_data *md);
int mob_gvmobcheck(struct map_session_data *sd, struct block_list *bl);
void mob_reload(void);
diff --git a/src/map/party.c b/src/map/party.c
index e33dc37cc..17f0cf5eb 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -175,7 +175,7 @@ int party_recv_info(struct party *sp)
for(i=0;i<MAX_PARTY;i++){ // sdの設定
struct map_session_data *sd = map_id2sd(p->member[i].account_id);
- p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id)?sd:NULL;
+ p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id && !sd->state.waitingdisconnect)?sd:NULL;
}
clif_party_info(p,-1);
@@ -419,7 +419,7 @@ int party_recv_movemap(int party_id,int account_id,char *map,int online,int lv)
for(i=0;i<MAX_PARTY;i++){ // sd再設定
struct map_session_data *sd= map_id2sd(p->member[i].account_id);
- p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id)?sd:NULL;
+ p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id && !sd->state.waitingdisconnect)?sd:NULL;
}
party_send_xy_clear(p); // 座標再通知要請
diff --git a/src/map/pc.c b/src/map/pc.c
index 3dcb08f3b..b9185c8b8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -714,8 +714,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
sd->skilltimerskill[i].timer = -1;
sd->timerskill_count=0;
- for (i=0; i<MAX_SKILL; i++)
- sd->blockskill[i]=0;
+ memset(sd->blockskill,0,sizeof(sd->blockskill));
memset(&sd->dev,0,sizeof(struct square));
for(i = 0; i < 5; i++) {
@@ -2037,25 +2036,24 @@ int pc_skill(struct map_session_data *sd,int id,int level,int flag)
*/
int pc_blockskill_end(int tid,unsigned int tick,int id,int data)
{
- struct map_session_data *sd;
-
- nullpo_retr (-1, sd = map_id2sd(id));
- sd->blockskill[data] = 0;
+ struct map_session_data *sd = map_id2sd(id);
+ if (data <= 0 || data >= MAX_SKILL)
+ return 0;
+ if (sd) sd->blockskill[data] = 0;
return 1;
}
-void pc_blockskill_start (struct map_session_data *sd, int skillid, int tick)
+int pc_blockskill_start (struct map_session_data *sd, int skillid, int tick)
{
- nullpo_retv(sd);
+ nullpo_retr (-1, sd);
if (skillid >= 10000 && skillid < 10015)
skillid -= 9500;
else if (skillid < 1 || skillid > MAX_SKILL)
- return;
+ return -1;
sd->blockskill[skillid] = 1;
- add_timer(gettick()+tick,pc_blockskill_end,sd->bl.id,skillid);
- return;
+ return add_timer(gettick()+tick,pc_blockskill_end,sd->bl.id,skillid);
}
/*==========================================
@@ -2460,6 +2458,7 @@ int pc_useitem(struct map_session_data *sd,int n)
nullpo_retr(1, sd);
if(n >=0 && n < MAX_INVENTORY) {
+ char *script;
sd->itemid = sd->status.inventory[n].nameid;
amount = sd->status.inventory[n].amount;
if(sd->status.inventory[n].nameid <= 0 ||
@@ -2474,12 +2473,10 @@ int pc_useitem(struct map_session_data *sd,int n)
clif_useitemack(sd,n,0,0);
return 1;
}
-
- if(sd->inventory_data[n])
- run_script(sd->inventory_data[n]->use_script,0,sd->bl.id,0);
-
+ script = sd->inventory_data[n]->use_script;
amount = sd->status.inventory[n].amount;
clif_useitemack(sd,n,amount-1,1);
+ run_script(script,0,sd->bl.id,0);
pc_delitem(sd,n,1,1);
}
@@ -2878,40 +2875,53 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *bl)
//
//
/*==========================================
- * PCの位置設定
+ * PCをマップから離脱する
*------------------------------------------
*/
-int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrtype)
-{
- char mapname[24];
- int m=0,disguise=0;
+int pc_remove_map(struct map_session_data *sd,int clrtype) {
nullpo_retr(0, sd);
- if(sd->chatID) // チャットから出る
+ // map 上に登録されていない
+ if(!sd->bl.prev)
+ return 1;
+
+ // チャットから出る
+ if(sd->chatID)
chat_leavechat(sd);
- if(sd->trade_partner) // 取引を中?する
+
+ // 取引を中断する
+ if(sd->trade_partner)
trade_tradecancel(sd);
+
+ // 倉庫を開いてるなら保存する
if(sd->state.storage_flag)
storage_guild_storage_quit(sd,0);
else
- storage_storage_quit(sd); // 倉庫を開いてるなら保存する
+ storage_storage_quit(sd);
- if(sd->party_invite>0) // パ?ティ?誘を拒否する
+ // パーティ勧誘を拒否する
+ if(sd->party_invite>0)
party_reply_invite(sd,sd->party_invite_account,0);
- if(sd->guild_invite>0) // ギルド?誘を拒否する
+
+ // ギルド勧誘を拒否する
+ if(sd->guild_invite>0)
guild_reply_invite(sd,sd->guild_invite,0);
- if(sd->guild_alliance>0) // ギルド同盟?誘を拒否する
+
+ // ギルド同盟勧誘を拒否する
+ if(sd->guild_alliance>0)
guild_reply_reqalliance(sd,sd->guild_alliance_account,0);
- skill_castcancel(&sd->bl,0); // 詠唱中?
- pc_stop_walking(sd,0); // ?行中?
- pc_stopattack(sd); // 攻?中?
+ // check if we've been authenticated [celest]
+ //if (sd->state.auth) {
+ pc_stop_walking(sd,0); // 歩行中断
+ pc_stopattack(sd); // 攻撃中断
+ pc_delinvincibletimer(sd); // 無敵タイマー削除
+ //}
- if(pc_issit(sd)) {
- pc_setstand(sd);
- skill_gangsterparadise(sd,0);
- }
+ // ブレードストップを終わらせる
+ if(sd->sc_data[SC_BLADESTOP].timer!=-1)
+ status_change_end(&sd->bl,SC_BLADESTOP,-1);
if (sd->sc_count) {
if(sd->sc_data[SC_TRICKDEAD].timer != -1)
@@ -2933,6 +2943,35 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
}
}
+ // check if we've been authenticated [celest]
+ //if (sd->state.auth)
+ skill_castcancel(&sd->bl,0); // 詠唱中断
+ skill_gangsterparadise(sd,0); // ギャングスターパラダイス削除
+ skill_unit_move(&sd->bl,gettick(),0); // スキルユニットから離脱
+ skill_cleartimerskill(&sd->bl); // タイマースキルクリア
+ skill_clear_unitgroup(&sd->bl); // スキルユニットグループの削除
+
+ clif_clearchar_area(&sd->bl,clrtype&0xffff);
+ map_delblock(&sd->bl);
+ return 0;
+}
+
+/*==========================================
+ * PCの位置設定
+ *------------------------------------------
+ */
+int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrtype)
+{
+ char mapname[24];
+ int m=0,disguise=0;
+
+ nullpo_retr(0, sd);
+
+ if(pc_issit(sd)) {
+ pc_setstand(sd);
+ skill_gangsterparadise(sd,0);
+ }
+
if(sd->status.option&2)
status_change_end(&sd->bl, SC_HIDING, -1);
if(sd->status.option&4)
@@ -2940,11 +2979,6 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
if(sd->status.option&16384)
status_change_end(&sd->bl, SC_CHASEWALK, -1);
- if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0) {
- pet_stopattack(sd->pd);
- pet_changestate(sd->pd,MS_IDLE,0);
- }
-
if(sd->disguise) { // clear disguises when warping [Valaris]
clif_clearchar(&sd->bl, 9);
disguise=sd->disguise;
@@ -2960,14 +2994,9 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
m=map_mapname2mapid(mapname);
if(m<0){
- if(sd->mapname[0]){
+ //if(sd->mapname[0]){
int ip,port;
if(map_mapname2ipport(mapname,&ip,&port)==0){
- skill_stop_dancing(&sd->bl,1);
- skill_unit_move(&sd->bl,gettick(),0);
- clif_clearchar_area(&sd->bl,clrtype&0xffff);
- skill_gangsterparadise(sd,0);
- map_delblock(&sd->bl);
if(sd->status.pet_id > 0 && sd->pd) {
if(sd->pd->bl.m != m && sd->pet.intimate <= 0) {
pet_remove_map(sd);
@@ -2985,6 +3014,15 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
map_delblock(&sd->pd->bl);
}
}
+
+ party_send_logout(sd); // パーティのログアウトメッセージ送信
+ guild_send_memberinfoshort(sd,0); // ギルドのログアウトメッセージ送信
+ status_change_clear(&sd->bl,1); // ステータス異常を解除する
+ skill_stop_dancing(&sd->bl,1); // ダンス/演奏中断
+ pc_cleareventtimer(sd); // イベントタイマを破棄する
+ pc_delspiritball(sd,sd->spiritball,1); // 気功削除
+ pc_remove_map(sd,clrtype);
+
memcpy(sd->mapname,mapname,24);
sd->bl.x=x;
sd->bl.y=y;
@@ -2998,7 +3036,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
chrif_changemapserver(sd, mapname, x, y, ip, port);
return 0;
}
- }
+ //}
#if 0
clif_authfail_fd(sd->fd,0); // cancel
clif_setwaitclose(sd->fd);
@@ -3019,12 +3057,17 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
} while(map_getcell(m,x,y,CELL_CHKNOPASS));
}
- if(sd->mapname[0] && sd->bl.prev != NULL){
- skill_unit_move(&sd->bl,gettick(),0);
- clif_clearchar_area(&sd->bl,clrtype&0xffff);
- skill_gangsterparadise(sd,0);
- map_delblock(&sd->bl);
- // pet
+ if(m == sd->bl.m) {
+ // 同じマップなのでダンスユニット引き継ぎ
+ sd->to_x = x;
+ sd->to_y = y;
+ skill_stop_dancing(&sd->bl, 2); //移動先にユニットを移動するかどうかの判断もする
+ } else {
+ // 違うマップなのでダンスユニット削除
+ skill_stop_dancing(&sd->bl, 1);
+ }
+ if(sd->bl.prev != NULL){
+ pc_remove_map(sd,clrtype);
if(sd->status.pet_id > 0 && sd->pd) {
if(sd->pd->bl.m != m && sd->pet.intimate <= 0) {
pet_remove_map(sd);
@@ -3034,9 +3077,6 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
sd->petDB = NULL;
if(battle_config.pet_status_support)
status_calc_pc(sd,2);
- pc_makesavestatus(sd);
- chrif_save(sd);
- storage_storage_save(sd);
}
else if(sd->pet.intimate > 0) {
pet_stopattack(sd->pd);
@@ -3053,13 +3093,8 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
memcpy(sd->mapname,mapname,24);
sd->bl.m = m;
- sd->to_x = x;
- sd->to_y = y;
-
- // moved and changed dance effect stopping
-
- sd->bl.x = x;
- sd->bl.y = y;
+ sd->bl.x = x;
+ sd->bl.y = y;
if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 0) {
sd->pd->bl.m = m;
diff --git a/src/map/pc.h b/src/map/pc.h
index 1e5b3408f..b1db3a254 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -65,6 +65,7 @@ int pc_setsavepoint(struct map_session_data*,char*,int,int);
int pc_randomwarp(struct map_session_data *sd,int type);
int pc_memo(struct map_session_data *sd,int i);
int pc_randomwalk(struct map_session_data*,int tick);
+int pc_remove_map(struct map_session_data *sd,int clrtype);
int pc_checkadditem(struct map_session_data*,int,int);
int pc_inventoryblank(struct map_session_data*);
@@ -92,7 +93,7 @@ int pc_bonus3(struct map_session_data *sd,int,int,int,int);
int pc_bonus4(struct map_session_data *sd,int,int,int,int,int);
int pc_skill(struct map_session_data*,int,int,int);
-void pc_blockskill_start (struct map_session_data*,int,int); // [celest]
+int pc_blockskill_start (struct map_session_data*,int,int); // [celest]
int pc_insert_card(struct map_session_data *sd,int idx_card,int idx_equip);
@@ -202,6 +203,7 @@ int pc_delspiritball(struct map_session_data *sd,int,int);
int pc_eventtimer(int tid,unsigned int tick,int id,int data); // for npc_dequeue
+int pc_readdb(void);
int do_init_pc(void);
void do_final_pc(void);
diff --git a/src/map/pet.c b/src/map/pet.c
index 87257f6be..351782e7f 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -816,7 +816,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
pet_birth_process(sd);
else {
pet_data_init(sd);
- if(sd->bl.prev != NULL) {
+ if(sd->pd && sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
clif_spawnpet(sd->pd);
clif_send_petdata(sd,0,0);
diff --git a/src/map/pet.h b/src/map/pet.h
index 6f532b140..4d81583b1 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -61,6 +61,7 @@ int pet_mag_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
int pet_heal_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
int pet_skillattack_timer(int tid,unsigned int tick,int id,int data); // [Valaris]
+int read_petdb();
int do_init_pet(void);
int do_final_pet(void);
diff --git a/src/map/skill.c b/src/map/skill.c
index 8420f0ac5..40626fa57 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2757,20 +2757,16 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s
* スキル使用(詠唱完了、ID指定支援系)
*------------------------------------------
*/
-int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag )
+int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
{
- struct map_session_data *sd=NULL;
- struct map_session_data *dstsd=NULL;
- struct mob_data *md=NULL;
- struct mob_data *dstmd=NULL;
- int i,abra_skillid=0,abra_skilllv;
- int sc_def_vit,sc_def_mdef;
- int sc_dex,sc_luk;
- //クラスチェンジ用ボスモンスタ?ID
- int changeclass[]={1038,1039,1046,1059,1086,1087,1112,1115
- ,1157,1159,1190,1272,1312,1373,1492};
- int poringclass[]={1002};
-
+ struct map_session_data *sd = NULL;
+ struct map_session_data *dstsd = NULL;
+ struct mob_data *md = NULL;
+ struct mob_data *dstmd = NULL;
+ int i;
+ int sc_def_vit, sc_def_mdef;
+ int sc_dex, sc_luk;
+
if(skillid < 0)
{ // remove the debug print when this case is finished
printf("skill_castend_damage_id: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
@@ -2782,23 +2778,24 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
nullpo_retr(1, src);
nullpo_retr(1, bl);
- if(src->type==BL_PC)
- sd=(struct map_session_data *)src;
- else if(src->type==BL_MOB)
- md=(struct mob_data *)src;
+ if (src->type == BL_PC) {
+ nullpo_retr (1, sd = (struct map_session_data *)src);
+ } else if (src->type == BL_MOB) {
+ nullpo_retr (1, md = (struct mob_data *)src);
+ }
- sc_dex=status_get_mdef(bl);
- sc_luk=status_get_luk(bl);
- sc_def_vit = status_get_sc_def_vit(bl);
+ sc_dex = status_get_mdef (bl);
+ sc_luk = status_get_luk (bl);
+ sc_def_vit = status_get_sc_def_vit (bl);
sc_def_mdef = status_get_sc_def_mdef (bl);
- if(bl->type==BL_PC){
- nullpo_retr(1, dstsd=(struct map_session_data *)bl);
- }else if(bl->type==BL_MOB){
- nullpo_retr(1, dstmd=(struct mob_data *)bl);
+ if (bl->type == BL_PC){
+ nullpo_retr (1, dstsd = (struct map_session_data *)bl);
+ } else if (bl->type == BL_MOB){
+ nullpo_retr (1, dstmd = (struct mob_data *)bl);
}
- if(bl == NULL || bl->prev == NULL)
+ if(bl->prev == NULL)
return 1;
if(sd && pc_isdead(sd))
return 1;
@@ -2814,44 +2811,42 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
{
case AL_HEAL: /* ヒ?ル */
{
- int heal=skill_calc_heal( src, skilllv );
+ int heal = skill_calc_heal(src, skilllv);
int heal_get_jobexp;
int skill;
- struct pc_base_job s_class;
-
- if( dstsd && dstsd->special_state.no_magic_damage )
+
+ if (skilllv > 10)
+ heal = 9999; //9999ヒール
+ if (dstsd && dstsd->special_state.no_magic_damage)
heal=0; /* ?金蟲カ?ド(ヒ?ル量0) */
- if (sd){
- s_class = pc_calc_base_job(sd->status.class_);
- if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ
- heal += heal*skill*2/100;
- if(sd && dstsd && sd->status.partner_id == dstsd->status.char_id && s_class.job == 23 && sd->status.sex == 0) //自分も?象もPC、?象が自分のパ?トナ?、自分がスパノビ、自分が♀なら
+ if (sd) {
+ if ((skill = pc_checkskill(sd, HP_MEDITATIO)) > 0) // メディテイティオ
+ heal += heal * skill * 2 / 100;
+ if (sd && dstsd && sd->status.partner_id == dstsd->status.char_id &&
+ pc_calc_base_job2(sd->status.class_) == 23 && sd->status.sex == 0) //自分も?象もPC、?象が自分のパ?トナ?、自分がスパノビ、自分が♀なら
heal = heal*2; //スパノビの嫁が旦那にヒ?ルすると2倍になる
}
-
- clif_skill_nodamage(src,bl,skillid,heal,1);
+ clif_skill_nodamage (src, bl, skillid, heal, 1);
heal_get_jobexp = battle_heal(NULL,bl,heal,0,0);
// JOB??値獲得
- if(src->type == BL_PC && bl->type==BL_PC && heal > 0 && src != bl && battle_config.heal_exp > 0){
+ if(sd && dstsd && heal > 0 && sd != dstsd && battle_config.heal_exp > 0){
heal_get_jobexp = heal_get_jobexp * battle_config.heal_exp / 100;
- if(heal_get_jobexp <= 0)
+ if (heal_get_jobexp <= 0)
heal_get_jobexp = 1;
- pc_gainexp((struct map_session_data *)src,0,heal_get_jobexp);
+ pc_gainexp (sd, 0, heal_get_jobexp);
}
}
break;
case ALL_RESURRECTION: /* リザレクション */
- if(bl->type==BL_PC){
- int per=0;
- struct map_session_data *tsd = (struct map_session_data*)bl;
- nullpo_retr(1, tsd);
- if( (map[bl->m].flag.pvp) && tsd->pvp_point<0 )
+ if(dstsd) {
+ int per = 0;
+ if (map[bl->m].flag.pvp && dstsd->pvp_point < 0)
break; /* PVPで復活不可能?態 */
- if(pc_isdead(tsd)){ /* 死亡判定 */
+ if (pc_isdead(dstsd)) { /* 死亡判定 */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
switch(skilllv){
case 1: per=10; break;
@@ -2859,60 +2854,58 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case 3: per=50; break;
case 4: per=80; break;
}
- tsd->status.hp=tsd->status.max_hp*per/100;
- if(tsd->status.hp<=0) tsd->status.hp=1;
- if(tsd->special_state.restart_full_recover ){ /* オシリスカ?ド */
- tsd->status.hp=tsd->status.max_hp;
- tsd->status.sp=tsd->status.max_sp;
+ dstsd->status.hp = dstsd->status.max_hp * per / 100;
+ if (dstsd->status.hp <= 0) dstsd->status.hp = 1;
+ if (dstsd->special_state.restart_full_recover) { /* オシリスカ?ド */
+ dstsd->status.hp = dstsd->status.max_hp;
+ dstsd->status.sp = dstsd->status.max_sp;
}
- pc_setstand(tsd);
+ pc_setstand(dstsd);
if(battle_config.pc_invincible_time > 0)
- pc_setinvincibletimer(tsd,battle_config.pc_invincible_time);
- clif_updatestatus(tsd,SP_HP);
- clif_resurrection(&tsd->bl,1);
- if(src != bl && sd && battle_config.resurrection_exp > 0) {
+ pc_setinvincibletimer(dstsd, battle_config.pc_invincible_time);
+ clif_updatestatus(dstsd, SP_HP);
+ clif_resurrection(bl, 1);
+ if(sd && sd != dstsd && battle_config.resurrection_exp > 0) {
int exp = 0,jexp = 0;
- int lv = tsd->status.base_level - sd->status.base_level, jlv = tsd->status.job_level - sd->status.job_level;
+ int lv = dstsd->status.base_level - sd->status.base_level, jlv = dstsd->status.job_level - sd->status.job_level;
if(lv > 0) {
- exp = (int)((double)tsd->status.base_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
- if(exp < 1) exp = 1;
+ exp = (int)((double)dstsd->status.base_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
+ if (exp < 1) exp = 1;
}
if(jlv > 0) {
- jexp = (int)((double)tsd->status.job_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
- if(jexp < 1) jexp = 1;
+ jexp = (int)((double)dstsd->status.job_exp * (double)lv * (double)battle_config.resurrection_exp / 1000000.);
+ if (jexp < 1) jexp = 1;
}
if(exp > 0 || jexp > 0)
- pc_gainexp(sd,exp,jexp);
+ pc_gainexp (sd, exp, jexp);
}
}
}
break;
case AL_DECAGI: /* 速度減少 */
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if (dstsd && dstsd->special_state.no_magic_damage)
break;
- if( rand()%100 < (50+skilllv*3+(status_get_lv(src)+status_get_int(src)/5)-sc_def_mdef) ) {
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ if (rand() % 100 < (50 + skilllv * 3 + (status_get_lv(src) + status_get_int(src) / 5) - sc_def_mdef)) {
+ clif_skill_nodamage (src, bl, skillid, skilllv, 1);
+ status_change_start (bl, SkillStatusChangeTable[skillid], skilllv, 0, 0, 0, skill_get_time(skillid,skilllv), 0);
}
break;
case AL_CRUCIS:
- if(flag&1) {
- int race = status_get_race(bl),ele = status_get_elem_type(bl);
- if(battle_check_target(src,bl,BCT_ENEMY) && (race == 6 || battle_check_undead(race,ele))) {
- int slv=status_get_lv(src),tlv=status_get_lv(bl),rate;
- rate = 25 + skilllv*2 + slv - tlv;
- if(rand()%100 < rate)
+ if (flag & 1) {
+ int race = status_get_race (bl), ele = status_get_elem_type (bl);
+ if (battle_check_target (src, bl, BCT_ENEMY) && (race == 6 || battle_check_undead (race, ele))) {
+ int slv = status_get_lv (src),tlv = status_get_lv (bl);
+ int rate = 25 + skilllv*2 + slv - tlv;
+ if (rand()%100 < rate)
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,0,0);
}
- }
- else {
- int range = 15;
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ } else {
+ clif_skill_nodamage(src, bl, skillid, skilllv, 1);
map_foreachinarea(skill_area_sub,
- src->m,src->x-range,src->y-range,src->x+range,src->y+range,0,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
+ src->m, src->x-15, src->y-15, src->x+15, src->y+15, 0,
+ src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
skill_castend_nodamage_id);
}
break;
@@ -2920,78 +2913,90 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case PR_LEXDIVINA: /* レックスディビ?ナ */
{
struct status_change *sc_data = status_get_sc_data(bl);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ clif_skill_nodamage (src, bl, skillid, skilllv, 1);
+ if (dstsd && dstsd->special_state.no_magic_damage)
break;
- if(sc_data && sc_data[SC_DIVINA].timer != -1)
- status_change_end(bl,SC_DIVINA,-1);
- else if( rand()%100 < sc_def_vit ) {
+ if (sc_data && sc_data[SC_DIVINA].timer != -1)
+ status_change_end(bl,SC_DIVINA, -1);
+ else if (rand() % 100 < sc_def_vit) {
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
}
}
break;
+
case SA_ABRACADABRA:
- //require 1 yellow gemstone even with mistress card or Into the Abyss
- if ((i=pc_search_inventory(sd, 715)) < 0 ) { //bug fixed by Lupus (item pos can be 0, too!)
- clif_skill_fail(sd,sd->skillid,0,0);
- break;
+ {
+ int skill, abra_skillid = 0, abra_skilllv;
+ //require 1 yellow gemstone even with mistress card or Into the Abyss
+ if ((i = pc_search_inventory(sd, 715)) < 0 ) { //bug fixed by Lupus (item pos can be 0, too!)
+ clif_skill_fail(sd,sd->skillid,0,0);
+ break;
+ }
+ pc_delitem(sd, i, 1, 0);
+ do {
+ abra_skillid = skill_abra_dataset(skilllv);
+ } while (abra_skillid == 0);
+ skill = pc_checkskill(sd,SA_ABRACADABRA);
+ abra_skilllv = skill_get_max(abra_skillid) > skill ? skill : skill_get_max(abra_skillid);
+ clif_skill_nodamage (src, bl, skillid, skilllv, 1);
+ sd->skillitem = abra_skillid;
+ sd->skillitemlv = abra_skilllv;
+ clif_item_skill (sd, abra_skillid, abra_skilllv, "Abracadabra");
}
- //pc_delitem(sd, pc_search_inventory(sd, 715), 1, 0);
- pc_delitem(sd, i, 1, 0);
- //
- do{
- abra_skillid=skill_abra_dataset(skilllv);
- }while(abra_skillid == 0);
- abra_skilllv=skill_get_max(abra_skillid)>pc_checkskill(sd,SA_ABRACADABRA)?pc_checkskill(sd,SA_ABRACADABRA):skill_get_max(abra_skillid);
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- sd->skillitem=abra_skillid;
- sd->skillitemlv=abra_skilllv;
- clif_item_skill(sd,abra_skillid,abra_skilllv,"アブラカダブラ");
break;
+
case SA_COMA:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
- break;
- if(dstsd){
- dstsd->status.hp=1;
- dstsd->status.sp=1;
- clif_updatestatus(dstsd,SP_HP);
- clif_updatestatus(dstsd,SP_SP);
+ if (dstsd) {
+ if (dstsd->special_state.no_magic_damage)
+ break;
+ dstsd->status.hp = 1;
+ dstsd->status.sp = 1;
+ clif_updatestatus(dstsd, SP_HP);
+ clif_updatestatus(dstsd, SP_SP);
}
- if(dstmd) dstmd->hp=1;
+ if(dstmd) dstmd->hp = 1;
break;
case SA_FULLRECOVERY:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
- break;
- if(dstsd) pc_heal(dstsd,dstsd->status.max_hp,dstsd->status.max_sp);
- if(dstmd) dstmd->hp=status_get_max_hp(&dstmd->bl);
+ if (dstsd) {
+ if (dstsd->special_state.no_magic_damage)
+ break;
+ pc_heal (dstsd, dstsd->status.max_hp, dstsd->status.max_sp);
+ }
+ if (dstmd) dstmd->hp = status_get_max_hp(bl);
break;
case SA_SUMMONMONSTER:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if (sd) mob_once_spawn(sd,map[sd->bl.m].name,sd->bl.x,sd->bl.y,"--ja--",-1,1,"");
+ if (sd) mob_once_spawn(sd,map[src->m].name,src->x,src->y,"--ja--",-1,1,"");
break;
case SA_LEVELUP:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if (sd && pc_nextbaseexp(sd)) pc_gainexp(sd,pc_nextbaseexp(sd)*10/100,0);
+ if (sd && pc_nextbaseexp(sd)) pc_gainexp(sd, pc_nextbaseexp(sd) * 10 / 100, 0);
break;
-
case SA_INSTANTDEATH:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
if (sd) pc_damage(NULL,sd,sd->status.max_hp);
break;
-
case SA_QUESTION:
case SA_GRAVITY:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
break;
case SA_CLASSCHANGE:
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(dstmd) mob_class_change(dstmd,changeclass);
+ {
+ //クラスチェンジ用ボスモンスタ?ID
+ int changeclass[]={1038,1039,1046,1059,1086,1087,1112,1115
+ ,1157,1159,1190,1272,1312,1373,1492};
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ if(dstmd) mob_class_change(dstmd,changeclass);
+ }
break;
case SA_MONOCELL:
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(dstmd) mob_class_change(dstmd,poringclass);
+ {
+ int poringclass[]={1002};
+ clif_skill_nodamage(src,bl,skillid,skilllv,1);
+ if(dstmd) mob_class_change(dstmd,poringclass);
+ }
break;
case SA_DEATH:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -3008,15 +3013,16 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case SA_TAMINGMONSTER:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if (dstmd){
- for(i=0;i<MAX_PET_DB;i++){
- if(dstmd->class_ == pet_db[i].class_){
- pet_catch_process1(sd,dstmd->class_);
+ if (dstmd) {
+ for (i = 0; i < MAX_PET_DB; i++) {
+ if (dstmd->class_ == pet_db[i].class_) {
+ pet_catch_process1 (sd, dstmd->class_);
break;
}
}
}
break;
+
case AL_INCAGI: /* 速度?加 */
case AL_BLESSING: /* ブレッシング */
case PR_SLOWPOISON:
@@ -3025,23 +3031,22 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case PR_SUFFRAGIUM: /* サフラギウム */
case PR_BENEDICTIO: /* 聖?降福 */
case CR_PROVIDENCE: /* プロヴィデンス */
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage ){
+ if (dstsd && dstsd->special_state.no_magic_damage)
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- }else{
+ else {
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
break;
case CG_MARIONETTE: /* マリオネットコントロ?ル */
- if(sd && dstsd){
+ if (sd && dstsd){
struct status_change *sc_data = status_get_sc_data(src);
struct status_change *tsc_data = status_get_sc_data(bl);
int sc = SkillStatusChangeTable[skillid];
int sc2 = SC_MARIONETTE2;
- if((dstsd->bl.type!=BL_PC)
- || (sd->bl.id == dstsd->bl.id)
+ if ((sd == dstsd)
|| (!sd->status.party_id)
|| (sd->status.party_id != dstsd->status.party_id)) {
clif_skill_fail(sd,skillid,0,0);
@@ -3049,12 +3054,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
return 1;
}
if(sc_data && tsc_data){
- if(sc_data[sc].timer == -1 && tsc_data[sc2].timer == -1) {
+ if (sc_data[sc].timer == -1 && tsc_data[sc2].timer == -1) {
status_change_start (src,sc,skilllv,0,bl->id,0,skill_get_time(skillid,skilllv),0);
status_change_start (bl,sc2,skilllv,0,src->id,0,skill_get_time(skillid,skilllv),0);
}
else if (sc_data[sc].timer != -1 && tsc_data[sc2].timer != -1 &&
- sc_data[sc].val3 == bl->id && tsc_data[sc2].val3 == src->id) {
+ sc_data[sc].val3 == bl->id && tsc_data[sc2].val3 == src->id) {
status_change_end(src, sc, -1);
status_change_end(bl, sc2, -1);
}
@@ -3072,16 +3077,18 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case SA_FROSTWEAPON:
case SA_LIGHTNINGLOADER:
case SA_SEISMICWEAPON:
- if(bl->type==BL_PC) {
- struct map_session_data *sd2 = (struct map_session_data *)bl;
- if (sd2->special_state.no_magic_damage) {
+ if (dstsd) {
+ if (dstsd->special_state.no_magic_damage) {
clif_skill_nodamage(src,bl,skillid,skilllv,0);
break;
}
- if(sd2->status.weapon==0 || (sd && sd->status.party_id > 0 && sd->status.party_id != sd2->status.party_id) ||
- sd2->sc_data[SC_FLAMELAUNCHER].timer!=-1 || sd2->sc_data[SC_FROSTWEAPON].timer!=-1 ||
- sd2->sc_data[SC_LIGHTNINGLOADER].timer!=-1 || sd2->sc_data[SC_SEISMICWEAPON].timer!=-1 ||
- sd2->sc_data[SC_ENCPOISON].timer!=-1) {
+ if(dstsd->status.weapon == 0 ||
+ (sd && sd->status.party_id > 0 && sd->status.party_id != dstsd->status.party_id) ||
+ dstsd->sc_data[SC_FLAMELAUNCHER].timer != -1 ||
+ dstsd->sc_data[SC_FROSTWEAPON].timer != -1 ||
+ dstsd->sc_data[SC_LIGHTNINGLOADER].timer != -1 ||
+ dstsd->sc_data[SC_SEISMICWEAPON].timer != -1 ||
+ dstsd->sc_data[SC_ENCPOISON].timer != -1) {
if (sd) clif_skill_fail(sd,skillid,0,0);
clif_skill_nodamage(src,bl,skillid,skilllv,0);
break;
@@ -3090,14 +3097,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(skilllv < 5 && rand()%100 > (60+skilllv*10) ) { //fixed by Lupus (4 -> 5) or else it has 100% success even at lv4
if (sd) clif_skill_fail(sd,skillid,0,0);
clif_skill_nodamage(src,bl,skillid,skilllv,0);
- if(bl->type==BL_PC && battle_config.equipment_breaking) {
- struct map_session_data *sd2 = (struct map_session_data *)bl;
- if(sd && sd != sd2) clif_displaymessage(sd->fd,"You broke target's weapon");
- pc_breakweapon(sd2);
+ if(dstsd && battle_config.equipment_breaking) {
+ if(sd && sd != dstsd) clif_displaymessage(sd->fd,"You broke target's weapon");
+ pc_breakweapon(dstsd);
}
break;
- }
- else {
+ } else {
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
clif_skill_nodamage(src,bl,skillid,skilllv,1);
}
@@ -3105,18 +3110,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case PR_ASPERSIO: /* アスペルシオ */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if (dstsd && dstsd->special_state.no_magic_damage)
break;
- if(bl->type==BL_MOB)
+ if (dstmd)
break;
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
+
case PR_KYRIE: /* キリエエレイソン */
clif_skill_nodamage(bl,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if (dstsd && dstsd->special_state.no_magic_damage)
break;
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
+
case KN_AUTOCOUNTER: /* オ?トカウンタ? */
case KN_TWOHANDQUICKEN: /* ツ?ハンドクイッケン */
case CR_SPEARQUICKEN: /* スピアクイッケン */
@@ -3146,6 +3153,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
clif_skill_nodamage(src,bl,skillid,skilllv,1);
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
+
case SM_ENDURE: /* インデュア */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
@@ -3156,26 +3164,25 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case SM_AUTOBERSERK: // Celest
{
struct status_change *tsc_data = status_get_sc_data(bl);
- int sc=SkillStatusChangeTable[skillid];
+ int sc = SkillStatusChangeTable[skillid];
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( tsc_data ){
- if( tsc_data[sc].timer==-1 )
- status_change_start(bl,sc,skilllv,0,0,0,0,0);
- else
- status_change_end(bl, sc, -1);
- }
+ if (tsc_data && tsc_data[sc].timer != -1)
+ status_change_end(bl, sc, -1);
+ else
+ status_change_start(bl,sc,skilllv,0,0,0,0,0);
}
break;
case AS_ENCHANTPOISON: // Prevent spamming [Valaris]
- if(bl->type==BL_PC) {
- struct map_session_data *sd2=(struct map_session_data *)bl;
- if(sd2->sc_data[SC_FLAMELAUNCHER].timer!=-1 || sd2->sc_data[SC_FROSTWEAPON].timer!=-1 ||
- sd2->sc_data[SC_LIGHTNINGLOADER].timer!=-1 || sd2->sc_data[SC_SEISMICWEAPON].timer!=-1 ||
- sd2->sc_data[SC_ENCPOISON].timer!=-1) {
- clif_skill_nodamage(src,bl,skillid,skilllv,0);
- clif_skill_fail(sd,skillid,0,0);
- break;
+ if (dstsd) {
+ if(dstsd->sc_data[SC_FLAMELAUNCHER].timer != -1 ||
+ dstsd->sc_data[SC_FROSTWEAPON].timer != -1 ||
+ dstsd->sc_data[SC_LIGHTNINGLOADER].timer != -1 ||
+ dstsd->sc_data[SC_SEISMICWEAPON].timer != -1 ||
+ dstsd->sc_data[SC_ENCPOISON].timer != -1) {
+ clif_skill_nodamage(src,bl,skillid,skilllv,0);
+ clif_skill_fail(sd,skillid,0,0);
+ break;
}
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -3214,8 +3221,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
struct status_change *sc_data = status_get_sc_data(bl);
/* MVPmobと不死には?かない */
- if((bl->type==BL_MOB && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) //不死には?かない
- {
+ if((dstmd && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) { //不死には?かない
map_freeblock_unlock();
return 1;
}
@@ -3240,8 +3246,6 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if(dstmd) {
int range = skill_get_range(skillid,skilllv);
- if(range < 0)
- range = status_get_range(src) - (range + 1);
dstmd->state.provoke_flag = src->id;
mob_target(dstmd,src,range);
}
@@ -3251,27 +3255,27 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case CR_DEVOTION: /* ディボ?ション */
if(sd && dstsd){
//?生や養子の場合の元の職業を算出する
- struct pc_base_job dst_s_class = pc_calc_base_job(dstsd->status.class_);
-
- int lv = sd->status.base_level-dstsd->status.base_level;
- lv = (lv<0)?-lv:lv;
- if((dstsd->bl.type!=BL_PC) // 相手はPCじゃないとだめ
- ||(sd->bl.id == dstsd->bl.id) // 相手が自分はだめ
- ||(lv > battle_config.devotion_level_difference) // レベル差±10まで
- ||(!sd->status.party_id && !sd->status.guild_id) // PTにもギルドにも所?無しはだめ
- ||((sd->status.party_id != dstsd->status.party_id) // 同じパ?ティ?か、
- &&(sd->status.guild_id != dstsd->status.guild_id)) // 同じギルドじゃないとだめ
- ||(dst_s_class.job==14||dst_s_class.job==21)){ // クルセだめ
+ int s_class = pc_calc_base_job2 (dstsd->status.class_);
+
+ int lv = sd->status.base_level - dstsd->status.base_level;
+ if (lv < 0) lv = -lv;
+ if ((sd == dstsd) // 相手はPCじゃないとだめ
+ || (sd->bl.id == dstsd->bl.id) // 相手が自分はだめ
+ || (lv > battle_config.devotion_level_difference) // レベル差±10まで
+ || (!sd->status.party_id && !sd->status.guild_id) // PTにもギルドにも所?無しはだめ
+ || ((sd->status.party_id != dstsd->status.party_id) // 同じパ?ティ?か、
+ &&(sd->status.guild_id != dstsd->status.guild_id)) // 同じギルドじゃないとだめ
+ || (s_class == 14 || s_class == 21)) { // クルセだめ
clif_skill_fail(sd,skillid,0,0);
map_freeblock_unlock();
return 1;
}
- for(i=0;i<skilllv;i++){
- if(!sd->dev.val1[i]){ // 空きがあったら入れる
+ for (i = 0; i < skilllv; i++) {
+ if (!sd->dev.val1[i]) { // 空きがあったら入れる
sd->dev.val1[i] = bl->id;
sd->dev.val2[i] = bl->id;
break;
- }else if(i==skilllv-1){ // 空きがなかった
+ } else if (i == skilllv - 1) { // 空きがなかった
clif_skill_fail(sd,skillid,0,0);
map_freeblock_unlock();
return 1;
@@ -3281,30 +3285,34 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
clif_devotion(sd,bl->id);
status_change_start(bl,SkillStatusChangeTable[skillid],src->id,1,0,0,1000*(15+15*skilllv),0 );
}
- else clif_skill_fail(sd,skillid,0,0);
+ else clif_skill_fail(sd,skillid,0,0);
break;
+
case MO_CALLSPIRITS: // ?功
if(sd) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
pc_addspiritball(sd,skill_get_time(skillid,skilllv),skilllv);
}
break;
+
case CH_SOULCOLLECT: // 狂?功
if(sd) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- for(i=0;i<5;i++)
+ for (i = 0; i < 5; i++)
pc_addspiritball(sd,skill_get_time(skillid,skilllv),5);
}
break;
+
case MO_BLADESTOP: // 白刃取り
clif_skill_nodamage(src,bl,skillid,skilllv,1);
status_change_start(src,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
+
case MO_ABSORBSPIRITS: // ?奪
i=0;
- if(dstsd) {
- if((sd && sd == dstsd) || map[src->m].flag.pvp || map[src->m].flag.gvg) {
- if(dstsd->spiritball > 0) {
+ if (dstsd) {
+ if ((sd && sd == dstsd) || map[src->m].flag.pvp || map[src->m].flag.gvg) {
+ if (dstsd->spiritball > 0) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
i = dstsd->spiritball * 7;
pc_delspiritball(dstsd,dstsd->spiritball,0);
@@ -3314,14 +3322,14 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
i = sd->status.max_sp - sd->status.sp;
}
}
- } else if (dstmd){ //?象がモンスタ?の場合
+ } else if (dstmd) { //?象がモンスタ?の場合
//20%の確率で?象のLv*2のSPを回復する。成功したときはタ?ゲット(σ?Д?)σ????!!
- if(rand()%100<20){
- i=2*mob_db[dstmd->class_].lv;
+ if(rand() % 100 < 20) {
+ i = 2 * mob_db[dstmd->class_].lv;
mob_target(dstmd,src,0);
}
}
- if(i && sd){
+ if (i && sd){
sd->status.sp += i;
clif_heal(sd->fd,SP_SP,i);
} else clif_skill_nodamage(src,bl,skillid,skilllv,0);
@@ -3361,11 +3369,10 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case BS_HAMMERFALL: /* ハンマ?フォ?ル */
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_weapon_damage )
+ if(dstsd && dstsd->special_state.no_weapon_damage)
break;
- if( rand()%100 < (20+ 10*skilllv)*sc_def_vit/100 ) {
+ if(rand() % 100 < (20 + 10 * skilllv) * sc_def_vit / 100 )
status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
- }
break;
case RG_RAID: /* サプライズアタック */
@@ -3440,30 +3447,29 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case PR_MAGNIFICAT: /* マグニフィカ?ト */
case PR_GLORIA: /* グロリア */
case SN_WINDWALK: /* ウインドウォ?ク */
- if(sd == NULL || sd->status.party_id==0 || (flag&1) ){
+ if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
/* 個別の?理 */
clif_skill_nodamage(bl,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if(dstsd && dstsd->special_state.no_magic_damage)
break;
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
- }
- else{
+ } else if (sd) {
/* パ?ティ全?への?理 */
- party_foreachsamemap(skill_area_sub,
+ party_foreachsamemap (skill_area_sub,
sd,1,
src,skillid,skilllv,tick, flag|BCT_PARTY|1,
skill_castend_nodamage_id);
}
break;
+
case BS_ADRENALINE: /* アドレナリンラッシュ */
case BS_WEAPONPERFECT: /* ウェポンパ?フェクション */
case BS_OVERTHRUST: /* オ?バ?トラスト */
- if(sd == NULL || sd->status.party_id==0 || (flag&1) ){
+ if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
/* 個別の?理 */
clif_skill_nodamage(bl,bl,skillid,skilllv,1);
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,(src == bl)? 1:0,0,0,skill_get_time(skillid,skilllv),0);
- }
- else{
+ } else if (sd) {
/* パ?ティ全?への?理 */
party_foreachsamemap(skill_area_sub,
sd,1,
@@ -3479,30 +3485,24 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case CR_AUTOGUARD: /* オ?トガ?ド */
{
struct status_change *tsc_data = status_get_sc_data(bl);
- int sc=SkillStatusChangeTable[skillid];
+ int sc = SkillStatusChangeTable[skillid];
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( tsc_data ){
- if( tsc_data[sc].timer==-1 )
- /* 付加する */
- status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
- else
- /* 解除する */
- status_change_end(bl, sc, -1);
- }
+ if (tsc_data && tsc_data[sc].timer != -1)
+ status_change_end(bl, sc, -1);
+ else
+ status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
}
break;
case TF_HIDING: /* ハイディング */
{
struct status_change *tsc_data = status_get_sc_data(bl);
- int sc=SkillStatusChangeTable[skillid];
+ int sc = SkillStatusChangeTable[skillid];
clif_skill_nodamage(src,bl,skillid,-1,1);
- if(tsc_data && tsc_data[sc].timer!=-1 )
- /* 解除する */
+ if (tsc_data && tsc_data[sc].timer != -1)
status_change_end(bl, sc, -1);
else
- /* 付加する */
- status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
+ status_change_start(bl,sc,skilllv,0,0,0,skill_get_time(skillid,skilllv),0);
}
break;
@@ -3604,7 +3604,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case RG_STEALCOIN: // スティ?ルコイン
- if(sd) {
+ if(sd) {
if(pc_steal_coin(sd,bl)) {
int range = skill_get_range(skillid,skilllv);
if(range < 0)
@@ -3622,12 +3622,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
struct status_change *sc_data = status_get_sc_data(bl);
// Level 6-10 doesn't consume a red gem if it fails [celest]
int i, gem_flag = 1;
- if (bl->type==BL_MOB && status_get_mode(bl)&0x20) {
+ if (dstmd && status_get_mode(bl)&0x20) {
clif_skill_fail(sd,sd->skillid,0,0);
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if(dstsd && dstsd->special_state.no_magic_damage )
break;
if (sc_data && sc_data[SC_STONE].timer != -1) {
status_change_end(bl,SC_STONE,-1);
@@ -3701,7 +3701,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case WZ_ESTIMATION: /* モンスタ?情報 */
- if(src->type==BL_PC){
+ if(sd) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
clif_skill_estimation((struct map_session_data *)src,bl);
}
@@ -3730,20 +3730,20 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case AL_TELEPORT: /* テレポ?ト */
- if( sd ){
- if(map[sd->bl.m].flag.noteleport){ /* テレポ禁止 */
+ if(sd) {
+ if (map[sd->bl.m].flag.noteleport) { /* テレポ禁止 */
clif_skill_teleportmessage(sd,0);
break;
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( sd->skilllv==1 )
+ if(sd->skilllv == 1)
clif_skill_warppoint(sd,sd->skillid,"Random","","","");
- else{
+ else {
clif_skill_warppoint(sd,sd->skillid,"Random",
sd->status.save_point.map,"","");
}
- }else if( bl->type==BL_MOB )
- mob_warp((struct mob_data *)bl,-1,-1,-1,3);
+ } else if(dstmd)
+ mob_warp(dstmd,-1,-1,-1,3);
break;
case AL_HOLYWATER: /* アクアベネディクタ */
@@ -3827,7 +3827,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
strip_fix = status_get_dex(src) - status_get_dex(bl);
if(strip_fix < 0)
strip_fix=0;
- strip_per = 5+2*skilllv+strip_fix/5;
+ strip_per = 5+5*skilllv+strip_fix/5;
if (rand()%100 >= strip_per)
break;
@@ -3858,7 +3858,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
strip_fix = status_get_dex(src) - status_get_dex(bl);
if(strip_fix < 0)
strip_fix = 0;
- strip_per = 5+2*skilllv+strip_fix/5;
+ strip_per = 5+5*skilllv+strip_fix/5;
if (rand()%100 >= strip_per)
break;
strip_time = skill_get_time(skillid,skilllv)+strip_fix/2;
@@ -3967,7 +3967,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
{
int i;
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if(dstsd && dstsd->special_state.no_magic_damage )
break;
for(i=0;i<136;i++){
if(i==SC_RIDING || i== SC_FALCON || i==SC_HALLUCINATION || i==SC_WEIGHT50
@@ -3983,12 +3983,12 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case TF_BACKSLIDING: /* バックステップ */
battle_stopwalking(src,1);
skill_blown(src,bl,skill_get_blewcount(skillid,skilllv)|0x10000);
- if(src->type == BL_MOB)
- clif_fixmobpos((struct mob_data *)src);
- else if(src->type == BL_PET)
- clif_fixpetpos((struct pet_data *)src);
- else if(src->type == BL_PC)
+ if (sd)
clif_fixpos(src);
+ else if (md)
+ clif_fixmobpos(md);
+ else if (src->type == BL_PET)
+ clif_fixpetpos((struct pet_data *)src);
skill_addtimerskill(src,tick + 200,src->id,0,0,skillid,skilllv,0,flag);
break;
@@ -4067,7 +4067,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}
break;
case SA_MAGICROD:
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if (dstsd && dstsd->special_state.no_magic_damage )
break;
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
@@ -4133,7 +4133,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case NPC_HALLUCINATION:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if(dstsd && dstsd->special_state.no_magic_damage )
break;
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_get_time(skillid,skilllv),0 );
break;
@@ -4144,9 +4144,9 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
int skill_time = skill_get_time(skillid,skilllv);
clif_skill_nodamage(src,bl,skillid,skilllv,1);
status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_time,0 );
- if (src->type == BL_MOB)
- mob_changestate((struct mob_data *)src,MS_DELAY,skill_time);
- else if (src->type == BL_PC)
+ if (md)
+ mob_changestate(md,MS_DELAY,skill_time);
+ else if (sd)
sd->attackabletime = sd->canmove_tick = tick + skill_time;
}
break;
@@ -4155,7 +4155,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
{
int sc_def = 100 - status_get_mdef(bl);
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_magic_damage )
+ if(dstsd && dstsd->special_state.no_magic_damage )
break;
if(status_get_elem_type(bl) == 7 || status_get_race(bl) == 6)
break;
@@ -4176,10 +4176,11 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
break;
case NPC_LICK:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if( bl->type==BL_PC && ((struct map_session_data *)bl)->special_state.no_weapon_damage )
- break;
- if(dstsd)
+ if (dstsd) {
+ if (dstsd->special_state.no_weapon_damage )
+ break;
pc_heal(dstsd,0,-100);
+ }
if(rand()%100 < (skilllv*5)*sc_def_vit/100)
status_change_start(bl,SC_STAN,skilllv,0,0,0,skill_get_time2(skillid,skilllv),0);
break;
@@ -4200,6 +4201,57 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
mob_summonslave(md,mob_db[md->class_].skill[md->skillidx].val,skilllv,(skillid==NPC_SUMMONSLAVE)?1:0);
break;
+ case NPC_RECALL: //取り巻き呼び戻し
+ if(md) {
+ int mobcount;
+ md->recallcount = 0;//初期化
+ md->recall_flag = 0;
+ mobcount = mob_countslave(md);
+ if(mobcount > 0) {
+ md->recall_flag = 1; //mob.cの[取り巻きモンスターの処理]で利用
+ md->recallmob_count = mobcount;
+ }
+ }
+ break;
+
+ case NPC_RUNAWAY: //後退
+ if(md) {
+ int check;
+ int dist = skilllv;//後退する距離
+ check = md->dir; //自分がどの方向に向いてるかチェック
+ md->attacked_id = 0;
+ md->target_id = 0;
+ md->state.targettype = NONE_ATTACKABLE;
+ md->state.skillstate = MSS_IDLE;
+ switch (check) {
+ case 0: //自分の向いてる方向と逆に移動する
+ mob_walktoxy(md,md->bl.x,md->bl.y-dist,0);//そして、移動する
+ break;
+ case 1:
+ mob_walktoxy(md,md->bl.x-dist,md->bl.y-dist,0);
+ break;
+ case 2:
+ mob_walktoxy(md,md->bl.x+dist,md->bl.y,0);
+ break;
+ case 3:
+ mob_walktoxy(md,md->bl.x+dist,md->bl.y+dist,0);
+ break;
+ case 4:
+ mob_walktoxy(md,md->bl.x,md->bl.y+dist,0);
+ break;
+ case 5:
+ mob_walktoxy(md,md->bl.x-dist,md->bl.y+dist,0);
+ break;
+ case 6:
+ mob_walktoxy(md,md->bl.x-dist,md->bl.y,0);
+ break;
+ case 7:
+ mob_walktoxy(md,md->bl.x-dist,md->bl.y-dist,0);
+ break;
+ }
+ }
+ break;
+
case NPC_TRANSFORMATION:
case NPC_METAMORPHOSIS:
if(md)
@@ -4218,25 +4270,25 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
// Equipment breaking monster skills [Celest]
case NPC_BREAKWEAPON:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(bl->type == BL_PC && battle_config.equipment_breaking)
+ if(dstsd && battle_config.equipment_breaking)
pc_breakweapon(dstsd);
break;
case NPC_BREAKARMOR:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(bl->type == BL_PC && battle_config.equipment_breaking)
+ if(dstsd && battle_config.equipment_breaking)
pc_breakarmor(dstsd);
break;
case NPC_BREAKHELM:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(bl->type == BL_PC && battle_config.equipment_breaking)
+ if(dstsd && battle_config.equipment_breaking)
pc_breakhelm(dstsd);
break;
case NPC_BREAKSHIELD:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(bl->type == BL_PC && battle_config.equipment_breaking)
+ if(dstsd && battle_config.equipment_breaking)
pc_breakshield(dstsd);
break;
@@ -4384,7 +4436,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
struct status_change *sc_data = status_get_sc_data(bl);
/* MVPmobと不死には?かない */
- if((bl->type==BL_MOB && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) //不死には?かない
+ if((dstmd && status_get_mode(bl)&0x20) || battle_check_undead(status_get_race(bl),status_get_elem_type(bl))) //不死には?かない
{
map_freeblock_unlock();
return 1;
@@ -4408,12 +4460,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
status_change_end(bl,SC_SLEEP,-1);
}
- if(bl->type==BL_MOB) {
- int range = skill_get_range(skillid,skilllv);
- if(range < 0)
- range = status_get_range(src) - (range + 1);
- mob_target((struct mob_data *)bl,src,range);
- }
+ if(dstmd)
+ mob_target(dstmd,src,skill_get_range(skillid,skilllv));
}
break;
@@ -4814,13 +4862,20 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
break;
case BS_HAMMERFALL: /* ハンマ?フォ?ル */
- skill_area_temp[1]=src->id;
- skill_area_temp[2]=x;
- skill_area_temp[3]=y;
- map_foreachinarea(skill_area_sub,
- src->m,x-2,y-2,x+2,y+2,0,
- src,skillid,skilllv,tick, flag|BCT_ENEMY|2,
- skill_castend_nodamage_id);
+ {
+ int r = 2;
+ if (skilllv > 5) {
+ r = 14;
+ skilllv = 5; // スタン率上がりすぎるため計算はLv5で固定
+ }
+ skill_area_temp[1] = src->id;
+ skill_area_temp[2] = x;
+ skill_area_temp[3] = y;
+ map_foreachinarea (skill_area_sub,
+ src->m, x-r, y-r, x+r, y+r, 0,
+ src, skillid, skilllv, tick, flag|BCT_ENEMY|2,
+ skill_castend_nodamage_id);
+ }
break;
case HT_DETECTING: /* ディテクティング */
@@ -4933,49 +4988,39 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
pc_blockskill_start (sd, MO_EXTREMITYFIST, 2000);
break;
case AM_CANNIBALIZE: // バイオプラント
- if(sd){
- int mx,my,amount=6-skilllv,id=0;
+ if(sd) {
+ int id;
int summons[5] = { 1020, 1068, 1118, 1500, 1368 };
-
struct mob_data *md;
- for (i=0; i<amount; i++) { //Amount: 1 lev = 1 mob, 2=2, 3, 4, 5 [Lupus]
- mx = x;
- my = y;
- while (i && mx == x ) {
- mx += (rand()%(1+amount) - (1+amount)/2);
- }
- while (i && my == y) {
- my += (rand()%(1+amount) - (1+amount)/2);
- }
- id=mob_once_spawn(sd,"this",mx,my,"--ja--", summons[skilllv-1] ,1,"");
+ // Correct info, don't change any of this! [celest]
+ id = mob_once_spawn (sd, "this", x, y, "--ja--", summons[skilllv-1] ,1,"");
- if( (md=(struct mob_data *)map_id2bl(id)) !=NULL ){
- md->master_id=sd->bl.id;
- //md->hp=2210+skilllv*200; commented out, we use REAL hp of the mobs [Lupus]
- md->state.special_mob_ai=1;
- md->deletetimer=add_timer(gettick()+skill_get_time(skillid,skilllv),mob_timer_delete,id,0);
- }
- }
- //block skill
- //i can't check if the summoned mobs are dead.. to be able summon next... so i just disable skill [Lupus]
- pc_blockskill_start (sd, AM_CANNIBALIZE, skill_get_time(skillid,skilllv));
+ if( (md=(struct mob_data *)map_id2bl(id)) !=NULL ){
+ md->master_id = sd->bl.id;
+ // different levels of HP according to skill level
+ md->hp = 1500 + skilllv * 200 + sd->status.base_level * 10;
+ md->state.special_mob_ai = 1;
+ //非移動でアクティブで反撃する[0x0:非移動 0x1:移動 0x4:ACT 0x8:非ACT 0x40:反撃無 0x80:反撃有]
+ md->mode = 0x0 + 0x4 + 0x80;
+ md->deletetimer = add_timer (gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, id, 0);
+ }
+ // To-do: 召還されるモンスターには召還したプレーヤーの名前が付きます
+ // (attach name of player?)
clif_skill_poseffect(src,skillid,skilllv,x,y,tick);
}
break;
case AM_SPHEREMINE: // スフィア?マイン
if(sd){
- int mx,my,id=0;
+ int id;
struct mob_data *md;
- mx = x;// + (rand()%10 - 5);
- my = y;// + (rand()%10 - 5);
- id=mob_once_spawn(sd,"this",mx,my,"--ja--",1142,1,"");
+ id = mob_once_spawn(sd, "this", x, y, "--ja--", 1142, 1, "");
if( (md=(struct mob_data *)map_id2bl(id)) !=NULL ){
- md->master_id=sd->bl.id;
- md->hp=2000+skilllv*400;
- md->state.special_mob_ai=2;
- md->deletetimer=add_timer(gettick()+skill_get_time(skillid,skilllv),mob_timer_delete,id,0);
+ md->master_id = sd->bl.id;
+ md->hp = 2000 + skilllv * 400;
+ md->state.special_mob_ai = 2;
+ md->deletetimer = add_timer (gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, id, 0);
}
clif_skill_poseffect(src,skillid,skilllv,x,y,tick);
}
@@ -5172,6 +5217,14 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
if(skilllv >= 6)
range=2;
break;
+ case WZ_METEOR:
+ if (skilllv > 10) //広範囲メテオ
+ range = 10;
+ break;
+ case WZ_VERMILION:
+ if (skilllv > 10) //広範囲LOV
+ range = 25;
+ break;
case HT_SANDMAN: /* サンドマン */
case HT_CLAYMORETRAP: /* クレイモア?トラップ */
@@ -5783,7 +5836,13 @@ int skill_unit_onout(struct skill_unit *src,struct block_list *bl,unsigned int t
case 0xac: /* ハミング */
case 0xae: /* 幸運のキス */
case 0xaf: /* サ?ビスフォ?ユ? */
- status_change_start(bl,SkillStatusChangeTable[sg->skill_id],sg->skill_lv,0,0,0,20000,0 );
+ if (sg->src_id==bl->id) {
+ status_change_end(bl,type,-1);
+ break;
+ }
+ if (sc_data[type].timer!=-1 && sc_data[type].val4==(int)src) {
+ sc_data[type].timer = add_timer(20000+tick, status_change_timer, bl->id, type);
+ }
break;
case 0xb4: // Basilica
@@ -5833,6 +5892,7 @@ int skill_unit_effect(struct block_list *bl,va_list ap)
struct skill_unit_group *group;
int flag;
unsigned int tick;
+ static int called = 0;
nullpo_retr(0, bl);
nullpo_retr(0, ap);
@@ -5853,8 +5913,11 @@ int skill_unit_effect(struct block_list *bl,va_list ap)
else {
skill_unit_onout(unit,bl,tick);
unit = map_find_skill_unit_oncell(bl,bl->x,bl->y,group->skill_id,unit);
- if (unit)
+ if (unit && called == 0) {
+ called = 1;
skill_unit_onplace(unit,bl,tick);
+ called = 0;
+ }
}
return 0;
@@ -9059,6 +9122,23 @@ void skill_init_unit_layout()
memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
break;
}
+ case PA_GOSPEL:
+ {
+ static const int dx[] = {
+ -1, 0, 1,-1, 0, 1,-3,-2,-1, 0,
+ 1, 2, 3,-3,-2,-1, 0, 1, 2, 3,
+ -3,-2,-1, 0, 1, 2, 3,-1, 0, 1,
+ -1, 0, 1};
+ static const int dy[] = {
+ -3,-3,-3,-2,-2,-2,-1,-1,-1,-1,
+ -1,-1,-1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
+ 3, 3, 3};
+ skill_unit_layout[pos].count = 33;
+ memcpy(skill_unit_layout[pos].dx,dx,sizeof(dx));
+ memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
+ break;
+ }
default:
printf("unknown unit layout at skill %d\n",i);
break;
diff --git a/src/map/skill.h b/src/map/skill.h
index 4c0d0a8f7..91fe376b4 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -573,9 +573,13 @@ enum {
NPC_BREAKHELM,
NPC_BREAKSHIELD,
NPC_UNDEADATTACK,
- NPC_EXPLOSIONSPIRITS = 349,
+
+ NPC_RUNAWAY = 348,
+ NPC_EXPLOSIONSPIRITS,
NPC_INCAGI,
+ NPC_RECALL = 354,
+
LK_AURABLADE = 355,
LK_PARRYING,
LK_CONCENTRATION,
diff --git a/src/map/status.c b/src/map/status.c
index bc059e442..65f9e0cd4 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3189,18 +3189,18 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val
return 0;
if(bl->type == BL_PC)
if(pc_checkskill(sd,BS_HILTBINDING)>0)
- tick *= 1.1;
+ tick += tick / 10;
calc_flag = 1;
break;
case SC_WEAPONPERFECTION: /* ウェポンパ?フェクション */
if(bl->type == BL_PC)
if(pc_checkskill(sd,BS_HILTBINDING)>0)
- tick *= 1.1;
+ tick += tick / 10;
break;
case SC_OVERTHRUST: /* オ?バ?スラスト */
if(bl->type == BL_PC)
if(pc_checkskill(sd,BS_HILTBINDING)>0)
- tick *= 1.1;
+ tick += tick / 10;
*opt3 |= 2;
break;
case SC_MAXIMIZEPOWER: /* マキシマイズパワ?(SPが1減る時間,val2にも) */
@@ -3563,6 +3563,11 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val
tick = 1000;
break;
case SC_SILENCE: /* 沈?(レックスデビ?ナ) */
+ if (sc_data && sc_data[SC_GOSPEL].timer!=-1) {
+ skill_delunitgroup((struct skill_unit_group *)sc_data[SC_GOSPEL].val3);
+ status_change_end(bl,SC_GOSPEL,-1);
+ break;
+ }
if(!(flag&2)) {
int sc_def = 100 - status_get_vit(bl);
tick = tick * sc_def / 100;
diff --git a/src/map/status.h b/src/map/status.h
index a23394d6a..6c026081e 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -259,6 +259,7 @@ int status_getrefinebonus(int lv,int type);
int status_percentrefinery(struct map_session_data *sd,struct item *item);
extern int percentrefinery[5][10];
+int status_readdb(void);
int do_init_status(void);
#endif