Reformatting @_@
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
16671ef54f
commit
711d01a128
@ -412,8 +412,8 @@ void set_all_offline(int id) {
|
|||||||
/*---------------------------------------------------
|
/*---------------------------------------------------
|
||||||
Make a data line for friends list
|
Make a data line for friends list
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
|
int mmo_friends_list_data_str(char *str, struct mmo_charstatus *p)
|
||||||
int mmo_friends_list_data_str(char *str, struct mmo_charstatus *p) {
|
{
|
||||||
int i;
|
int i;
|
||||||
char *str_p = str;
|
char *str_p = str;
|
||||||
str_p += sprintf(str_p, "%d", p->char_id);
|
str_p += sprintf(str_p, "%d", p->char_id);
|
||||||
@ -435,14 +435,6 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
|
|||||||
int i,j;
|
int i,j;
|
||||||
char *str_p = str;
|
char *str_p = str;
|
||||||
|
|
||||||
/* We shouldn't need this anymore... [Skotlex]
|
|
||||||
// on multi-map server, sometimes it's posssible that last_point become void. (reason???) We check that to not lost character at restart.
|
|
||||||
if (!p->last_point.map) {
|
|
||||||
p->last_point.map = mapindex_name2id(MAP_PRONTERA);
|
|
||||||
p->last_point.x = 273;
|
|
||||||
p->last_point.y = 354;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
str_p += sprintf(str_p,
|
str_p += sprintf(str_p,
|
||||||
"%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d" //Up to Zeny field
|
"%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d" //Up to Zeny field
|
||||||
"\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" //Up to Skill Point
|
"\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" //Up to Skill Point
|
||||||
@ -648,33 +640,6 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
p->account_id = tmp_int[1];
|
p->account_id = tmp_int[1];
|
||||||
p->char_num = tmp_int[2];
|
p->char_num = tmp_int[2];
|
||||||
p->class_ = tmp_int[3];
|
p->class_ = tmp_int[3];
|
||||||
/* Unneeded unless you are running a real old character database now.
|
|
||||||
//Temporal fix until all chars are reverted from peco-flying-class to
|
|
||||||
//normal classes. [Skotlex]
|
|
||||||
switch (p->class_) {
|
|
||||||
case JOB_KNIGHT2: //Job_Knight2
|
|
||||||
p->class_ = JOB_KNIGHT;
|
|
||||||
break;
|
|
||||||
case JOB_CRUSADER2: //Job_Crusader2
|
|
||||||
p->class_ = JOB_CRUSADER;
|
|
||||||
break;
|
|
||||||
case JOB_LORD_KNIGHT2: //Job_Lord_Knight2
|
|
||||||
p->class_ = JOB_LORD_KNIGHT;
|
|
||||||
break;
|
|
||||||
case JOB_PALADIN2: //Job_Paladin2
|
|
||||||
p->class_ = JOB_PALADIN;
|
|
||||||
break;
|
|
||||||
case JOB_BABY_KNIGHT2: //Job_Baby_Knight2
|
|
||||||
p->class_ = JOB_BABY_KNIGHT;
|
|
||||||
break;
|
|
||||||
case JOB_BABY_CRUSADER2: //Job_Baby_Crusader2
|
|
||||||
p->class_ = JOB_BABY_CRUSADER;
|
|
||||||
break;
|
|
||||||
case JOB_STAR_GLADIATOR2: //Job_Star_Gladiator2
|
|
||||||
p->class_ = JOB_STAR_GLADIATOR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
p->base_level = tmp_int[4];
|
p->base_level = tmp_int[4];
|
||||||
p->job_level = tmp_int[5];
|
p->job_level = tmp_int[5];
|
||||||
p->base_exp = tmp_uint[0];
|
p->base_exp = tmp_uint[0];
|
||||||
|
@ -23,8 +23,7 @@ static void* create_scdata(DBKey key, va_list args) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Loads status change data of the player given. [Skotlex]
|
* Loads status change data of the player given. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct scdata* status_search_scdata(int aid, int cid)
|
struct scdata* status_search_scdata(int aid, int cid)
|
||||||
{
|
{
|
||||||
struct scdata *data;
|
struct scdata *data;
|
||||||
@ -35,8 +34,7 @@ struct scdata* status_search_scdata(int aid, int cid)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Deletes status change data of the player given. [Skotlex]
|
* Deletes status change data of the player given. [Skotlex]
|
||||||
* Should be invoked after the data of said player was successfully loaded.
|
* Should be invoked after the data of said player was successfully loaded.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void status_delete_scdata(int aid, int cid)
|
void status_delete_scdata(int aid, int cid)
|
||||||
{
|
{
|
||||||
struct scdata *scdata = idb_remove(scdata_db, cid);
|
struct scdata *scdata = idb_remove(scdata_db, cid);
|
||||||
@ -87,8 +85,7 @@ static int inter_scdata_fromstr(char *line, struct scdata *sc_data)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Loads all scdata from the given filename.
|
* Loads all scdata from the given filename.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void status_load_scdata(const char* filename)
|
void status_load_scdata(const char* filename)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -138,8 +135,7 @@ static int inter_status_save_sub(DBKey key, void *data, va_list ap) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Saves all scdata to the given filename.
|
* Saves all scdata to the given filename.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void inter_status_save()
|
void inter_status_save()
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -155,8 +151,7 @@ void inter_status_save()
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Initializes db.
|
* Initializes db.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void status_init()
|
void status_init()
|
||||||
{
|
{
|
||||||
scdata_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
|
scdata_db = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_BASE,sizeof(int));
|
||||||
@ -165,8 +160,7 @@ void status_init()
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Frees up memory.
|
* Frees up memory.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int scdata_db_final(DBKey k,void *d,va_list ap)
|
static int scdata_db_final(DBKey k,void *d,va_list ap)
|
||||||
{
|
{
|
||||||
struct scdata *data = (struct scdata*)d;
|
struct scdata *data = (struct scdata*)d;
|
||||||
@ -178,10 +172,10 @@ static int scdata_db_final(DBKey k,void *d,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Final cleanup.
|
* Final cleanup.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void status_final(void)
|
void status_final(void)
|
||||||
{
|
{
|
||||||
scdata_db->destroy(scdata_db, scdata_db_final);
|
scdata_db->destroy(scdata_db, scdata_db_final);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //ENABLE_SC_SAVING
|
#endif //ENABLE_SC_SAVING
|
||||||
|
@ -171,8 +171,7 @@ int inter_accreg_save(void) {
|
|||||||
#endif //TXT_SQL_CONVERT
|
#endif //TXT_SQL_CONVERT
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 設定ファイルを読み込む
|
* 設定ファイルを読み込む
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int inter_config_read(const char *cfgName) {
|
static int inter_config_read(const char *cfgName) {
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -533,14 +532,6 @@ int mapif_parse_WisRequest(int fd) {
|
|||||||
}
|
}
|
||||||
//Not found.
|
//Not found.
|
||||||
return mapif_wis_fail(fd, RFIFOP(fd, 4));
|
return mapif_wis_fail(fd, RFIFOP(fd, 4));
|
||||||
|
|
||||||
/* Scrapped since now we know where characters are online in. [Skotlex]
|
|
||||||
wd = mapif_create_whisper(fd, RFIFOP(fd, 4), RFIFOP(fd,28), RFIFOP(fd,52), RFIFOW(fd,2)-52);
|
|
||||||
if (!wd) return 0;
|
|
||||||
idb_put(wis_db, wd->id, wd);
|
|
||||||
mapif_wis_message(wd);
|
|
||||||
return 0;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wisp/page transmission result
|
// Wisp/page transmission result
|
||||||
|
@ -300,7 +300,8 @@ struct party_data *inter_party_fromsql(int party_id)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
int inter_party_sql_init(void){
|
int inter_party_sql_init(void)
|
||||||
|
{
|
||||||
//memory alloc
|
//memory alloc
|
||||||
party_db_ = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
|
party_db_ = db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
|
||||||
party_pt = (struct party_data*)aCalloc(sizeof(struct party_data), 1);
|
party_pt = (struct party_data*)aCalloc(sizeof(struct party_data), 1);
|
||||||
|
@ -189,9 +189,9 @@ int inter_accreg_sql_init(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* read config file
|
* read config file
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
static int inter_config_read(const char *cfgName)
|
||||||
static int inter_config_read(const char *cfgName) {
|
{
|
||||||
int i;
|
int i;
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -34,8 +34,7 @@ static void* create_item(DBKey key, va_list args) {
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* DBの検索
|
* DBの検索
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct item_data* itemdb_search(int nameid)
|
struct item_data* itemdb_search(int nameid)
|
||||||
{
|
{
|
||||||
return idb_ensure(item_db,nameid,create_item);
|
return idb_ensure(item_db,nameid,create_item);
|
||||||
@ -43,8 +42,7 @@ struct item_data* itemdb_search(int nameid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isequip(int nameid)
|
int itemdb_isequip(int nameid)
|
||||||
{
|
{
|
||||||
int type=itemdb_type(nameid);
|
int type=itemdb_type(nameid);
|
||||||
@ -54,8 +52,7 @@ int itemdb_isequip(int nameid)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isequip2(struct item_data *data)
|
int itemdb_isequip2(struct item_data *data)
|
||||||
{
|
{
|
||||||
if(data) {
|
if(data) {
|
||||||
@ -72,8 +69,7 @@ int itemdb_isequip2(struct item_data *data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* アイテムデータベースの読み込み
|
* アイテムデータベースの読み込み
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_readdb(void)
|
static int itemdb_readdb(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -202,8 +198,7 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void do_final_itemdb(void)
|
void do_final_itemdb(void)
|
||||||
{
|
{
|
||||||
if(item_db){
|
if(item_db){
|
||||||
|
@ -69,8 +69,7 @@ sigfunc *compat_signal(int signo, sigfunc *func)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* CORE : Signal Sub Function
|
* CORE : Signal Sub Function
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
static void sig_proc(int sn)
|
static void sig_proc(int sn)
|
||||||
{
|
{
|
||||||
static int is_called = 0;
|
static int is_called = 0;
|
||||||
@ -174,8 +173,7 @@ const char* get_svn_revision(void)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* CORE : Display title
|
* CORE : Display title
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
static void display_title(void)
|
static void display_title(void)
|
||||||
{
|
{
|
||||||
//ClearScreen(); // clear screen and go up/left (0, 0 position in text)
|
//ClearScreen(); // clear screen and go up/left (0, 0 position in text)
|
||||||
@ -213,8 +211,7 @@ void usercheck(void)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* CORE : MAINROUTINE
|
* CORE : MAINROUTINE
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
{// initialize program arguments
|
{// initialize program arguments
|
||||||
|
@ -189,7 +189,8 @@ static void block_free(struct block* p);
|
|||||||
static void memmgr_info(void);
|
static void memmgr_info(void);
|
||||||
static unsigned int memmgr_usage_bytes = 0;
|
static unsigned int memmgr_usage_bytes = 0;
|
||||||
|
|
||||||
void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
|
void* _mmalloc(size_t size, const char *file, int line, const char *func )
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
struct block *block;
|
struct block *block;
|
||||||
size_t size_hash;
|
size_t size_hash;
|
||||||
@ -291,13 +292,15 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func ) {
|
void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func )
|
||||||
|
{
|
||||||
void *p = _mmalloc(num * size,file,line,func);
|
void *p = _mmalloc(num * size,file,line,func);
|
||||||
memset(p,0,num * size);
|
memset(p,0,num * size);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func ) {
|
void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func )
|
||||||
|
{
|
||||||
size_t old_size;
|
size_t old_size;
|
||||||
if(memblock == NULL) {
|
if(memblock == NULL) {
|
||||||
return _mmalloc(size,file,line,func);
|
return _mmalloc(size,file,line,func);
|
||||||
@ -318,7 +321,8 @@ void* _mrealloc(void *memblock, size_t size, const char *file, int line, const c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
|
char* _mstrdup(const char *p, const char *file, int line, const char *func )
|
||||||
|
{
|
||||||
if(p == NULL) {
|
if(p == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
@ -329,7 +333,8 @@ char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _mfree(void *ptr, const char *file, int line, const char *func ) {
|
void _mfree(void *ptr, const char *file, int line, const char *func )
|
||||||
|
{
|
||||||
struct unit_head *head;
|
struct unit_head *head;
|
||||||
size_t size_hash;
|
size_t size_hash;
|
||||||
|
|
||||||
@ -420,7 +425,8 @@ void _mfree(void *ptr, const char *file, int line, const char *func ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 現在の状況を表示する */
|
/* 現在の状況を表示する */
|
||||||
static void memmgr_info(void) {
|
static void memmgr_info(void)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
struct block *p;
|
struct block *p;
|
||||||
ShowInfo("** Memory Manager Information **\n");
|
ShowInfo("** Memory Manager Information **\n");
|
||||||
@ -461,7 +467,8 @@ static void memmgr_info(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ブロックを確保する */
|
/* ブロックを確保する */
|
||||||
static struct block* block_malloc(void) {
|
static struct block* block_malloc(void)
|
||||||
|
{
|
||||||
if(block_unused != NULL) {
|
if(block_unused != NULL) {
|
||||||
/* ブロック用の領域は確保済み */
|
/* ブロック用の領域は確保済み */
|
||||||
struct block* ret = block_unused;
|
struct block* ret = block_unused;
|
||||||
@ -523,7 +530,8 @@ static struct block* block_malloc(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void block_free(struct block* p) {
|
static void block_free(struct block* p)
|
||||||
|
{
|
||||||
/* free() せずに、未使用フラグを付けるだけ */
|
/* free() せずに、未使用フラグを付けるだけ */
|
||||||
p->unit_size = 0;
|
p->unit_size = 0;
|
||||||
/* 未使用ポインターを更新する */
|
/* 未使用ポインターを更新する */
|
||||||
|
@ -64,7 +64,8 @@ int mapindex_addmap(int index, const char *name)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short mapindex_name2id(const char* name) {
|
unsigned short mapindex_name2id(const char* name)
|
||||||
|
{
|
||||||
//TODO: Perhaps use a db to speed this up? [Skotlex]
|
//TODO: Perhaps use a db to speed this up? [Skotlex]
|
||||||
int i;
|
int i;
|
||||||
char map_name[MAP_NAME_LENGTH_EXT];
|
char map_name[MAP_NAME_LENGTH_EXT];
|
||||||
@ -91,7 +92,8 @@ unsigned short mapindex_name2id(const char* name) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* mapindex_id2name(unsigned short id) {
|
const char* mapindex_id2name(unsigned short id)
|
||||||
|
{
|
||||||
if (id > MAX_MAPINDEX || !indexes[id].exists) {
|
if (id > MAX_MAPINDEX || !indexes[id].exists) {
|
||||||
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", id);
|
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache.\n", id);
|
||||||
return indexes[0].name; //Theorically this should never happen, hence we return this string to prevent null pointer crashes.
|
return indexes[0].name; //Theorically this should never happen, hence we return this string to prevent null pointer crashes.
|
||||||
@ -99,7 +101,8 @@ const char* mapindex_id2name(unsigned short id) {
|
|||||||
return indexes[id].name;
|
return indexes[id].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mapindex_init(void) {
|
void mapindex_init(void)
|
||||||
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char line[1024];
|
char line[1024];
|
||||||
int last_index = -1;
|
int last_index = -1;
|
||||||
@ -130,5 +133,6 @@ void mapindex_init(void) {
|
|||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mapindex_final(void) {
|
void mapindex_final(void)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ static void nullpo_info_core(const char *file, int line, const char *func,
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* Nullチェック 及び 情報出力
|
* Nullチェック 及び 情報出力
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
int nullpo_chk_f(const char *file, int line, const char *func, const void *target,
|
int nullpo_chk_f(const char *file, int line, const char *func, const void *target,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -41,8 +40,7 @@ int nullpo_chk(const char *file, int line, const char *func, const void *target)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* nullpo情報出力(外部呼出し向けラッパ)
|
* nullpo情報出力(外部呼出し向けラッパ)
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
void nullpo_info_f(const char *file, int line, const char *func,
|
void nullpo_info_f(const char *file, int line, const char *func,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
@ -61,8 +59,7 @@ void nullpo_info(const char *file, int line, const char *func)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* nullpo情報出力(Main)
|
* nullpo情報出力(Main)
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
static void nullpo_info_core(const char *file, int line, const char *func,
|
static void nullpo_info_core(const char *file, int line, const char *func,
|
||||||
const char *fmt, va_list ap)
|
const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
|
@ -137,8 +137,7 @@ unsigned int gettick(void)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* CORE : Timer Heap
|
* CORE : Timer Heap
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
/// Adds a timer to the timer_heap
|
/// Adds a timer to the timer_heap
|
||||||
static void push_timer_heap(int tid)
|
static void push_timer_heap(int tid)
|
||||||
{
|
{
|
||||||
@ -197,8 +196,7 @@ static void push_timer_heap(int tid)
|
|||||||
|
|
||||||
/*==========================
|
/*==========================
|
||||||
* Timer Management
|
* Timer Management
|
||||||
*--------------------------
|
*--------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
/// Returns a free timer id.
|
/// Returns a free timer id.
|
||||||
static int acquire_timer(void)
|
static int acquire_timer(void)
|
||||||
|
@ -261,7 +261,8 @@ int already_exit_function = 0; // sometimes, the exit function is called twice..
|
|||||||
//------------------------------
|
//------------------------------
|
||||||
// Writing function of logs file
|
// Writing function of logs file
|
||||||
//------------------------------
|
//------------------------------
|
||||||
int ladmin_log(char *fmt, ...) {
|
int ladmin_log(char *fmt, ...)
|
||||||
|
{
|
||||||
FILE *logfp;
|
FILE *logfp;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
@ -289,7 +290,8 @@ int ladmin_log(char *fmt, ...) {
|
|||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
// Function to return ordonal text of a number.
|
// Function to return ordonal text of a number.
|
||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
char* makeordinal(int number) {
|
char* makeordinal(int number)
|
||||||
|
{
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
return "";
|
return "";
|
||||||
@ -315,7 +317,8 @@ char* makeordinal(int number) {
|
|||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
// Function to test of the validity of an account name (return 0 if incorrect, and 1 if ok)
|
// Function to test of the validity of an account name (return 0 if incorrect, and 1 if ok)
|
||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
int verify_accountname(char* account_name) {
|
int verify_accountname(char* account_name)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; account_name[i]; i++) {
|
for(i = 0; account_name[i]; i++) {
|
||||||
@ -359,7 +362,8 @@ int verify_accountname(char* account_name) {
|
|||||||
//----------------------------------
|
//----------------------------------
|
||||||
// Sub-function: Input of a password
|
// Sub-function: Input of a password
|
||||||
//----------------------------------
|
//----------------------------------
|
||||||
int typepasswd(char * password) {
|
int typepasswd(char * password)
|
||||||
|
{
|
||||||
char password1[1023], password2[1023];
|
char password1[1023], password2[1023];
|
||||||
int letter;
|
int letter;
|
||||||
int i;
|
int i;
|
||||||
@ -415,7 +419,8 @@ int typepasswd(char * password) {
|
|||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Sub-function: Test of the validity of password (return 0 if incorrect, and 1 if ok)
|
// Sub-function: Test of the validity of password (return 0 if incorrect, and 1 if ok)
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
int verify_password(char * password) {
|
int verify_password(char * password)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; password[i]; i++) {
|
for(i = 0; password[i]; i++) {
|
||||||
@ -459,7 +464,8 @@ int verify_password(char * password) {
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Sub-function: Check the name of a command (return complete name)
|
// Sub-function: Check the name of a command (return complete name)
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
int check_command(char * command) {
|
int check_command(char * command)
|
||||||
|
{
|
||||||
// help
|
// help
|
||||||
if (strncmp(command, "aide", 2) == 0 && strncmp(command, "aide", strlen(command)) == 0) // not 1 letter command: 'aide' or 'add'?
|
if (strncmp(command, "aide", 2) == 0 && strncmp(command, "aide", strlen(command)) == 0) // not 1 letter command: 'aide' or 'add'?
|
||||||
strcpy(command, "aide");
|
strcpy(command, "aide");
|
||||||
@ -561,7 +567,8 @@ int check_command(char * command) {
|
|||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
// Sub-function: Display commands of ladmin
|
// Sub-function: Display commands of ladmin
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
void display_help(char* param, int language) {
|
void display_help(char* param, int language)
|
||||||
|
{
|
||||||
char command[1023];
|
char command[1023];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1087,7 +1094,8 @@ void display_help(char* param, int language) {
|
|||||||
//-----------------------------
|
//-----------------------------
|
||||||
// Sub-function: add an account
|
// Sub-function: add an account
|
||||||
//-----------------------------
|
//-----------------------------
|
||||||
int addaccount(char* param, int emailflag) {
|
int addaccount(char* param, int emailflag)
|
||||||
|
{
|
||||||
char name[1023], sex[1023], email[1023], password[1023];
|
char name[1023], sex[1023], email[1023], password[1023];
|
||||||
// int i;
|
// int i;
|
||||||
WFIFOHEAD(login_fd,91);
|
WFIFOHEAD(login_fd,91);
|
||||||
@ -1133,19 +1141,6 @@ int addaccount(char* param, int emailflag) {
|
|||||||
return 102;
|
return 102;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for(i = 0; name[i]; i++) {
|
|
||||||
if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_", name[i]) == NULL) {
|
|
||||||
if (defaultlanguage == 'F') {
|
|
||||||
ShowMessage("Caractère interdit (%c) trouvé dans le nom du compte (%d%s caractère).\n", name[i], i+1, makeordinal(i+1));
|
|
||||||
ladmin_log("Caractère interdit (%c) trouvé dans le nom du compte (%d%s caractère)." RETCODE, name[i], i+1, makeordinal(i+1));
|
|
||||||
} else {
|
|
||||||
ShowMessage("Illegal character (%c) found in the account name (%d%s character).\n", name[i], i+1, makeordinal(i+1));
|
|
||||||
ladmin_log("Illegal character (%c) found in the account name (%d%s character)." RETCODE, name[i], i+1, makeordinal(i+1));
|
|
||||||
}
|
|
||||||
return 101;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
sex[0] = TOUPPER(sex[0]);
|
sex[0] = TOUPPER(sex[0]);
|
||||||
if (strchr("MF", sex[0]) == NULL) {
|
if (strchr("MF", sex[0]) == NULL) {
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
@ -1216,7 +1211,8 @@ int addaccount(char* param, int emailflag) {
|
|||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
// Sub-function: Add/substract time to the final date of a banishment of an account
|
// Sub-function: Add/substract time to the final date of a banishment of an account
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
int banaddaccount(char* param) {
|
int banaddaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], modif[1023];
|
char name[1023], modif[1023];
|
||||||
int year, month, day, hour, minute, second;
|
int year, month, day, hour, minute, second;
|
||||||
char * p_modif;
|
char * p_modif;
|
||||||
@ -1420,7 +1416,8 @@ int banaddaccount(char* param) {
|
|||||||
// Sub-function of sub-function banaccount, unbanaccount or bansetaccount
|
// Sub-function of sub-function banaccount, unbanaccount or bansetaccount
|
||||||
// Set the final date of a banishment of an account
|
// Set the final date of a banishment of an account
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
int bansetaccountsub(char* name, char* date, char* time) {
|
int bansetaccountsub(char* name, char* date, char* time)
|
||||||
|
{
|
||||||
int year, month, day, hour, minute, second;
|
int year, month, day, hour, minute, second;
|
||||||
time_t ban_until_time; // # of seconds 1/1/1970 (timestamp): ban time limit of the account (0 = no ban)
|
time_t ban_until_time; // # of seconds 1/1/1970 (timestamp): ban time limit of the account (0 = no ban)
|
||||||
struct tm *tmtime;
|
struct tm *tmtime;
|
||||||
@ -1564,7 +1561,8 @@ int bansetaccountsub(char* name, char* date, char* time) {
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// Sub-function: Set the final date of a banishment of an account (ban)
|
// Sub-function: Set the final date of a banishment of an account (ban)
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
int banaccount(char* param) {
|
int banaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], date[1023], time[1023];
|
char name[1023], date[1023], time[1023];
|
||||||
|
|
||||||
memset(name, '\0', sizeof(name));
|
memset(name, '\0', sizeof(name));
|
||||||
@ -1600,7 +1598,8 @@ int banaccount(char* param) {
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Sub-function: Set the final date of a banishment of an account (banset)
|
// Sub-function: Set the final date of a banishment of an account (banset)
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
int bansetaccount(char* param) {
|
int bansetaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], date[1023], time[1023];
|
char name[1023], date[1023], time[1023];
|
||||||
|
|
||||||
memset(name, '\0', sizeof(name));
|
memset(name, '\0', sizeof(name));
|
||||||
@ -1639,7 +1638,8 @@ int bansetaccount(char* param) {
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// Sub-function: unbanishment of an account (unban)
|
// Sub-function: unbanishment of an account (unban)
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
int unbanaccount(char* param) {
|
int unbanaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
|
|
||||||
memset(name, '\0', sizeof(name));
|
memset(name, '\0', sizeof(name));
|
||||||
@ -1676,7 +1676,8 @@ int unbanaccount(char* param) {
|
|||||||
// Sub-function: Asking to check the validity of a password
|
// Sub-function: Asking to check the validity of a password
|
||||||
// (Note: never send back a password with login-server!! security of passwords)
|
// (Note: never send back a password with login-server!! security of passwords)
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
int checkaccount(char* param) {
|
int checkaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], password[1023];
|
char name[1023], password[1023];
|
||||||
WFIFOHEAD(login_fd,50);
|
WFIFOHEAD(login_fd,50);
|
||||||
|
|
||||||
@ -1727,7 +1728,8 @@ int checkaccount(char* param) {
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
// Sub-function: Asking for deletion of an account
|
// Sub-function: Asking for deletion of an account
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
int delaccount(char* param) {
|
int delaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
char letter;
|
char letter;
|
||||||
char confirm[1023];
|
char confirm[1023];
|
||||||
@ -1798,7 +1800,8 @@ int delaccount(char* param) {
|
|||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
// Sub-function: Asking to modification of an account e-mail
|
// Sub-function: Asking to modification of an account e-mail
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
int changeemail(char* param) {
|
int changeemail(char* param)
|
||||||
|
{
|
||||||
char name[1023], email[1023];
|
char name[1023], email[1023];
|
||||||
WFIFOHEAD(login_fd,66);
|
WFIFOHEAD(login_fd,66);
|
||||||
|
|
||||||
@ -1873,7 +1876,8 @@ int changeemail(char* param) {
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// Sub-function: Asking of the number of online players
|
// Sub-function: Asking of the number of online players
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int getlogincount(void) {
|
int getlogincount(void)
|
||||||
|
{
|
||||||
WFIFOHEAD(login_fd,2);
|
WFIFOHEAD(login_fd,2);
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
ladmin_log("Envoi d'un requête au serveur de logins pour obtenir le nombre de joueurs en jeu." RETCODE);
|
ladmin_log("Envoi d'un requête au serveur de logins pour obtenir le nombre de joueurs en jeu." RETCODE);
|
||||||
@ -1891,7 +1895,8 @@ int getlogincount(void) {
|
|||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
// Sub-function: Asking to modify the GM level of an account
|
// Sub-function: Asking to modify the GM level of an account
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
int changegmlevel(char* param) {
|
int changegmlevel(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
int GM_level;
|
int GM_level;
|
||||||
WFIFOHEAD(login_fd,27);
|
WFIFOHEAD(login_fd,27);
|
||||||
@ -1947,7 +1952,8 @@ int changegmlevel(char* param) {
|
|||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
// Sub-function: Asking to obtain an account id
|
// Sub-function: Asking to obtain an account id
|
||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
int idaccount(char* param) {
|
int idaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
WFIFOHEAD(login_fd,26);
|
WFIFOHEAD(login_fd,26);
|
||||||
|
|
||||||
@ -1991,7 +1997,8 @@ int idaccount(char* param) {
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Sub-function: Asking to displaying information about an account (by its id)
|
// Sub-function: Asking to displaying information about an account (by its id)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int infoaccount(int account_id) {
|
int infoaccount(int account_id)
|
||||||
|
{
|
||||||
WFIFOHEAD(login_fd,6);
|
WFIFOHEAD(login_fd,6);
|
||||||
if (account_id < 0) {
|
if (account_id < 0) {
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
@ -2021,7 +2028,8 @@ int infoaccount(int account_id) {
|
|||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
// Sub-function: Send a broadcast message
|
// Sub-function: Send a broadcast message
|
||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
int sendbroadcast(short type, char* message) {
|
int sendbroadcast(short type, char* message)
|
||||||
|
{
|
||||||
int len = strlen(message);
|
int len = strlen(message);
|
||||||
WFIFOHEAD(login_fd,9+len);
|
WFIFOHEAD(login_fd,9+len);
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
@ -2058,7 +2066,8 @@ int sendbroadcast(short type, char* message) {
|
|||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
// Sub-function: Change language of displaying
|
// Sub-function: Change language of displaying
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
int changelanguage(char* language) {
|
int changelanguage(char* language)
|
||||||
|
{
|
||||||
if (strlen(language) == 0) {
|
if (strlen(language) == 0) {
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
ShowMessage("Entrez une langue svp.\n");
|
ShowMessage("Entrez une langue svp.\n");
|
||||||
@ -2100,7 +2109,8 @@ int changelanguage(char* language) {
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Sub-function: Asking to Displaying of the accounts list
|
// Sub-function: Asking to Displaying of the accounts list
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
int listaccount(char* param, int type) {
|
int listaccount(char* param, int type)
|
||||||
|
{
|
||||||
//int list_first, list_last, list_type; // parameter to display a list of accounts
|
//int list_first, list_last, list_type; // parameter to display a list of accounts
|
||||||
int i;
|
int i;
|
||||||
WFIFOHEAD(login_fd,10);
|
WFIFOHEAD(login_fd,10);
|
||||||
@ -2165,7 +2175,8 @@ int listaccount(char* param, int type) {
|
|||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
// Sub-function: Asking to modify a memo field
|
// Sub-function: Asking to modify a memo field
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
int changememo(char* param) {
|
int changememo(char* param)
|
||||||
|
{
|
||||||
char name[1023], memo[1023];
|
char name[1023], memo[1023];
|
||||||
WFIFOHEAD(login_fd,28+255);
|
WFIFOHEAD(login_fd,28+255);
|
||||||
|
|
||||||
@ -2224,7 +2235,8 @@ int changememo(char* param) {
|
|||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
// Sub-function: Asking to obtain an account name
|
// Sub-function: Asking to obtain an account name
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
int nameaccount(int id) {
|
int nameaccount(int id)
|
||||||
|
{
|
||||||
WFIFOHEAD(login_fd,6);
|
WFIFOHEAD(login_fd,6);
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
@ -2254,7 +2266,8 @@ int nameaccount(int id) {
|
|||||||
// Sub-function: Asking to modify a password
|
// Sub-function: Asking to modify a password
|
||||||
// (Note: never send back a password with login-server!! security of passwords)
|
// (Note: never send back a password with login-server!! security of passwords)
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
int changepasswd(char* param) {
|
int changepasswd(char* param)
|
||||||
|
{
|
||||||
char name[1023], password[1023];
|
char name[1023], password[1023];
|
||||||
WFIFOHEAD(login_fd,50);
|
WFIFOHEAD(login_fd,50);
|
||||||
|
|
||||||
@ -2306,7 +2319,8 @@ int changepasswd(char* param) {
|
|||||||
// Sub-function: Request to login-server to reload GM configuration file
|
// Sub-function: Request to login-server to reload GM configuration file
|
||||||
// this function have no answer
|
// this function have no answer
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int reloadGM(void) {
|
int reloadGM(void)
|
||||||
|
{
|
||||||
WFIFOHEAD(login_fd,2);
|
WFIFOHEAD(login_fd,2);
|
||||||
WFIFOW(login_fd,0) = 0x7955;
|
WFIFOW(login_fd,0) = 0x7955;
|
||||||
WFIFOSET(login_fd,2);
|
WFIFOSET(login_fd,2);
|
||||||
@ -2329,7 +2343,8 @@ int reloadGM(void) {
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// Sub-function: Asking to modify the sex of an account
|
// Sub-function: Asking to modify the sex of an account
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int changesex(char* param) {
|
int changesex(char* param)
|
||||||
|
{
|
||||||
char name[1023], sex[1023];
|
char name[1023], sex[1023];
|
||||||
WFIFOHEAD(login_fd,27);
|
WFIFOHEAD(login_fd,27);
|
||||||
|
|
||||||
@ -2386,7 +2401,8 @@ int changesex(char* param) {
|
|||||||
// Sub-function of sub-function changestate, blockaccount or unblockaccount
|
// Sub-function of sub-function changestate, blockaccount or unblockaccount
|
||||||
// Asking to modify the state of an account
|
// Asking to modify the state of an account
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
int changestatesub(char* name, int state, char* error_message7) {
|
int changestatesub(char* name, int state, char* error_message7)
|
||||||
|
{
|
||||||
char error_message[1023]; // need to use, because we can modify error_message7
|
char error_message[1023]; // need to use, because we can modify error_message7
|
||||||
WFIFOHEAD(login_fd,50);
|
WFIFOHEAD(login_fd,50);
|
||||||
|
|
||||||
@ -2470,7 +2486,8 @@ int changestatesub(char* name, int state, char* error_message7) {
|
|||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Sub-function: Asking to modify the state of an account
|
// Sub-function: Asking to modify the state of an account
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
int changestate(char* param) {
|
int changestate(char* param)
|
||||||
|
{
|
||||||
char name[1023], error_message[1023];
|
char name[1023], error_message[1023];
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
@ -2504,7 +2521,8 @@ int changestate(char* param) {
|
|||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// Sub-function: Asking to unblock an account
|
// Sub-function: Asking to unblock an account
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
int unblockaccount(char* param) {
|
int unblockaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
|
|
||||||
memset(name, '\0', sizeof(name));
|
memset(name, '\0', sizeof(name));
|
||||||
@ -2538,7 +2556,8 @@ int unblockaccount(char* param) {
|
|||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
// Sub-function: Asking to unblock an account
|
// Sub-function: Asking to unblock an account
|
||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
int blockaccount(char* param) {
|
int blockaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
|
|
||||||
memset(name, '\0', sizeof(name));
|
memset(name, '\0', sizeof(name));
|
||||||
@ -2572,7 +2591,8 @@ int blockaccount(char* param) {
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// Sub-function: Add/substract time to the validity limit of an account
|
// Sub-function: Add/substract time to the validity limit of an account
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
int timeaddaccount(char* param) {
|
int timeaddaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], modif[1023];
|
char name[1023], modif[1023];
|
||||||
int year, month, day, hour, minute, second;
|
int year, month, day, hour, minute, second;
|
||||||
char * p_modif;
|
char * p_modif;
|
||||||
@ -2775,7 +2795,8 @@ int timeaddaccount(char* param) {
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// Sub-function: Set a validity limit of an account
|
// Sub-function: Set a validity limit of an account
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
int timesetaccount(char* param) {
|
int timesetaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023], date[1023], time[1023];
|
char name[1023], date[1023], time[1023];
|
||||||
int year, month, day, hour, minute, second;
|
int year, month, day, hour, minute, second;
|
||||||
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
time_t connect_until_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
|
||||||
@ -2941,7 +2962,8 @@ int timesetaccount(char* param) {
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Sub-function: Asking to displaying information about an account (by its name)
|
// Sub-function: Asking to displaying information about an account (by its name)
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
int whoaccount(char* param) {
|
int whoaccount(char* param)
|
||||||
|
{
|
||||||
char name[1023];
|
char name[1023];
|
||||||
WFIFOHEAD(login_fd,26);
|
WFIFOHEAD(login_fd,26);
|
||||||
|
|
||||||
@ -2984,7 +3006,8 @@ int whoaccount(char* param) {
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Sub-function: Asking of the version of the login-server
|
// Sub-function: Asking of the version of the login-server
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
int checkloginversion(void) {
|
int checkloginversion(void)
|
||||||
|
{
|
||||||
WFIFOHEAD(login_fd,2);
|
WFIFOHEAD(login_fd,2);
|
||||||
if (defaultlanguage == 'F')
|
if (defaultlanguage == 'F')
|
||||||
ladmin_log("Envoi d'un requête au serveur de logins pour obtenir sa version." RETCODE);
|
ladmin_log("Envoi d'un requête au serveur de logins pour obtenir sa version." RETCODE);
|
||||||
@ -3003,7 +3026,8 @@ int checkloginversion(void) {
|
|||||||
// this function wait until user type a command
|
// this function wait until user type a command
|
||||||
// and analyse the command.
|
// and analyse the command.
|
||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
int prompt(void) {
|
int prompt(void)
|
||||||
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char *p;
|
char *p;
|
||||||
@ -4162,7 +4186,8 @@ int parse_fromlogin(int fd)
|
|||||||
//------------------------------------
|
//------------------------------------
|
||||||
// Function to connect to login-server
|
// Function to connect to login-server
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
int Connect_login_server(void) {
|
int Connect_login_server(void)
|
||||||
|
{
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
ShowMessage("Essai de connection au server de logins...\n");
|
ShowMessage("Essai de connection au server de logins...\n");
|
||||||
ladmin_log("Essai de connection au server de logins..." RETCODE);
|
ladmin_log("Essai de connection au server de logins..." RETCODE);
|
||||||
@ -4211,7 +4236,8 @@ int Connect_login_server(void) {
|
|||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
// Reading general configuration file
|
// Reading general configuration file
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
int ladmin_config_read(const char *cfgName) {
|
int ladmin_config_read(const char *cfgName)
|
||||||
|
{
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
@ -4291,13 +4317,15 @@ int ladmin_config_read(const char *cfgName) {
|
|||||||
// Function called when the server
|
// Function called when the server
|
||||||
// has received a crash signal.
|
// has received a crash signal.
|
||||||
//------------------------------
|
//------------------------------
|
||||||
void do_abort(void) {}
|
void do_abort(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
// Function called at exit of the server
|
// Function called at exit of the server
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
void do_final(void) {
|
void do_final(void)
|
||||||
|
{
|
||||||
if (already_exit_function == 0) {
|
if (already_exit_function == 0) {
|
||||||
|
|
||||||
if (defaultlanguage == 'F') {
|
if (defaultlanguage == 'F') {
|
||||||
|
@ -166,7 +166,8 @@ int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
|
|||||||
//------------------------------
|
//------------------------------
|
||||||
// Writing function of logs file
|
// Writing function of logs file
|
||||||
//------------------------------
|
//------------------------------
|
||||||
int login_log(char *fmt, ...) {
|
int login_log(char *fmt, ...)
|
||||||
|
{
|
||||||
if (log_login) {
|
if (log_login) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
time_t raw_time;
|
time_t raw_time;
|
||||||
@ -257,7 +258,8 @@ static int sync_ip_addresses(int tid, unsigned int tick, int id, int data)
|
|||||||
// Determine if an account (id) is a GM account
|
// Determine if an account (id) is a GM account
|
||||||
// and returns its level (or 0 if it isn't a GM account or if not found)
|
// and returns its level (or 0 if it isn't a GM account or if not found)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int isGM(int account_id) {
|
int isGM(int account_id)
|
||||||
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for(i=0; i < GM_num; i++)
|
for(i=0; i < GM_num; i++)
|
||||||
if(gm_account_db[i].account_id == account_id)
|
if(gm_account_db[i].account_id == account_id)
|
||||||
@ -309,7 +311,8 @@ void addGM(uint32 account_id, int level)
|
|||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Reading function of GM accounts file (and their level)
|
// Reading function of GM accounts file (and their level)
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
int read_gm_account(void) {
|
int read_gm_account(void)
|
||||||
|
{
|
||||||
char line[512];
|
char line[512];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int account_id, level;
|
int account_id, level;
|
||||||
@ -494,7 +497,8 @@ int check_ladminip(uint32 ip)
|
|||||||
// and returns index if only 1 account is found
|
// and returns index if only 1 account is found
|
||||||
// and similar to the searched name.
|
// and similar to the searched name.
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
int search_account_index(char* account_name) {
|
int search_account_index(char* account_name)
|
||||||
|
{
|
||||||
unsigned int i, quantity;
|
unsigned int i, quantity;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
@ -523,7 +527,8 @@ int search_account_index(char* account_name) {
|
|||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
// Create a string to save the account in the account file
|
// Create a string to save the account in the account file
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
int mmo_auth_tostr(char* str, struct auth_data* p) {
|
int mmo_auth_tostr(char* str, struct auth_data* p)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
char *str_p = str;
|
char *str_p = str;
|
||||||
|
|
||||||
@ -946,7 +951,8 @@ void mmo_auth_sync(void)
|
|||||||
// immediatly and set the minimum of
|
// immediatly and set the minimum of
|
||||||
// authentifications to its initialization value.
|
// authentifications to its initialization value.
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int check_auth_sync(int tid, unsigned int tick, int id, int data) {
|
int check_auth_sync(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
// we only save if necessary:
|
// we only save if necessary:
|
||||||
// we have do some authentifications without do saving
|
// we have do some authentifications without do saving
|
||||||
if (auth_before_save_file < AUTH_BEFORE_SAVE_FILE ||
|
if (auth_before_save_file < AUTH_BEFORE_SAVE_FILE ||
|
||||||
@ -1009,7 +1015,8 @@ void send_GM_accounts(void)
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// Check if GM file account have been changed
|
// Check if GM file account have been changed
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int check_GM_file(int tid, unsigned int tick, int id, int data) {
|
int check_GM_file(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
struct stat file_stat;
|
struct stat file_stat;
|
||||||
long new_time;
|
long new_time;
|
||||||
|
|
||||||
@ -3656,7 +3663,8 @@ int login_config_read(const char* cfgName)
|
|||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
// Displaying of configuration warnings
|
// Displaying of configuration warnings
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
void display_conf_warnings(void) {
|
void display_conf_warnings(void)
|
||||||
|
{
|
||||||
if (admin_state != 0 && admin_state != 1) {
|
if (admin_state != 0 && admin_state != 1) {
|
||||||
ShowWarning("Invalid value for admin_state parameter -> setting to 0 (no remote admin).\n");
|
ShowWarning("Invalid value for admin_state parameter -> setting to 0 (no remote admin).\n");
|
||||||
admin_state = 0;
|
admin_state = 0;
|
||||||
@ -3768,7 +3776,8 @@ void display_conf_warnings(void) {
|
|||||||
//-------------------------------
|
//-------------------------------
|
||||||
// Save configuration in log file
|
// Save configuration in log file
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
void save_config_in_log(void) {
|
void save_config_in_log(void)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// a newline in the log...
|
// a newline in the log...
|
||||||
@ -3906,7 +3915,8 @@ void save_config_in_log(void) {
|
|||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
// Function called at exit of the server
|
// Function called at exit of the server
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
void do_final(void) {
|
void do_final(void)
|
||||||
|
{
|
||||||
int i, fd;
|
int i, fd;
|
||||||
ShowInfo("Terminating...\n");
|
ShowInfo("Terminating...\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -45,8 +45,7 @@ int battle_getcurrentskill(struct block_list *bl)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Get random targetting enemy
|
* Get random targetting enemy
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int battle_gettargeted_sub(struct block_list *bl, va_list ap)
|
static int battle_gettargeted_sub(struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct block_list **bl_list;
|
struct block_list **bl_list;
|
||||||
@ -206,8 +205,7 @@ int battle_delay_damage (unsigned int tick, struct block_list *src, struct block
|
|||||||
* Does attribute fix modifiers.
|
* Does attribute fix modifiers.
|
||||||
* Added passing of the chars so that the status changes can affect it. [Skotlex]
|
* Added passing of the chars so that the status changes can affect it. [Skotlex]
|
||||||
* Note: Passing src/target == NULL is perfectly valid, it skips SC_ checks.
|
* Note: Passing src/target == NULL is perfectly valid, it skips SC_ checks.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_attr_fix(struct block_list *src, struct block_list *target, int damage,int atk_elem,int def_type, int def_lv)
|
int battle_attr_fix(struct block_list *src, struct block_list *target, int damage,int atk_elem,int def_type, int def_lv)
|
||||||
{
|
{
|
||||||
struct status_change *sc=NULL, *tsc=NULL;
|
struct status_change *sc=NULL, *tsc=NULL;
|
||||||
@ -257,8 +255,7 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ƒ_ƒ??[ƒW?Å?IŒvŽZ
|
* ƒ_ƒ??[ƒW?Å?IŒvŽZ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
|
int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL;
|
struct map_session_data *sd = NULL;
|
||||||
@ -514,8 +511,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Calculates GVG related damage adjustments.
|
* Calculates GVG related damage adjustments.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
|
int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
|
||||||
{
|
{
|
||||||
struct mob_data *md = NULL;
|
struct mob_data *md = NULL;
|
||||||
@ -583,8 +579,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* HP/SP‹zŽû‚ÌŒvŽZ
|
* HP/SP‹zŽû‚ÌŒvŽZ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int battle_calc_drain(int damage, int rate, int per)
|
static int battle_calc_drain(int damage, int rate, int per)
|
||||||
{
|
{
|
||||||
int diff = 0;
|
int diff = 0;
|
||||||
@ -603,8 +598,7 @@ static int battle_calc_drain(int damage, int rate, int per)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ?C—ûƒ_ƒ??[ƒW
|
* ?C—ûƒ_ƒ??[ƒW
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
|
int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
|
||||||
{
|
{
|
||||||
int damage,skill;
|
int damage,skill;
|
||||||
@ -787,8 +781,7 @@ static int battle_calc_base_damage(struct status_data *status, struct weapon_atk
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Consumes ammo for the given skill.
|
* Consumes ammo for the given skill.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
|
void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
|
||||||
{
|
{
|
||||||
int qty=1;
|
int qty=1;
|
||||||
@ -856,8 +849,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
|
|||||||
#define damage_div_fix(dmg, div) { if (div > 1) (dmg)*=div; else if (div < 0) (div)*=-1; }
|
#define damage_div_fix(dmg, div) { if (div > 1) (dmg)*=div; else if (div < 0) (div)*=-1; }
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* battle_calc_weapon_attack (by Skotlex)
|
* battle_calc_weapon_attack (by Skotlex)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static struct Damage battle_calc_weapon_attack(
|
static struct Damage battle_calc_weapon_attack(
|
||||||
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int wflag)
|
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int wflag)
|
||||||
{
|
{
|
||||||
@ -2113,8 +2105,7 @@ static struct Damage battle_calc_weapon_attack(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* battle_calc_magic_attack [DracoRPG]
|
* battle_calc_magic_attack [DracoRPG]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct Damage battle_calc_magic_attack(
|
struct Damage battle_calc_magic_attack(
|
||||||
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
|
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
|
||||||
{
|
{
|
||||||
@ -2435,8 +2426,7 @@ struct Damage battle_calc_magic_attack(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ‚»‚Ì‘¼ƒ_ƒ??[ƒWŒvŽZ
|
* ‚»‚Ì‘¼ƒ_ƒ??[ƒWŒvŽZ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct Damage battle_calc_misc_attack(
|
struct Damage battle_calc_misc_attack(
|
||||||
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
|
struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
|
||||||
{
|
{
|
||||||
@ -2658,10 +2648,8 @@ struct Damage battle_calc_misc_attack(
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ƒ_ƒ??[ƒWŒvŽZˆêЇ?ˆ—?—p
|
* ƒ_ƒ??[ƒWŒvŽZˆêЇ?ˆ—?—p
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag)
|
||||||
struct Damage battle_calc_attack( int attack_type,
|
|
||||||
struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag)
|
|
||||||
{
|
{
|
||||||
struct Damage d;
|
struct Damage d;
|
||||||
switch(attack_type){
|
switch(attack_type){
|
||||||
@ -2783,8 +2771,7 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int rdamage, int ldamage,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ’Ê?í?UŒ‚?ˆ—?‚܂Ƃß
|
* ’Ê?í?UŒ‚?ˆ—?‚܂Ƃß
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag)
|
int battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL, *tsd = NULL;
|
struct map_session_data *sd = NULL, *tsd = NULL;
|
||||||
@ -3050,8 +3037,7 @@ struct block_list* battle_get_master(struct block_list *src)
|
|||||||
* 1: flag holds true (is enemy, party, etc)
|
* 1: flag holds true (is enemy, party, etc)
|
||||||
* -1: flag fails
|
* -1: flag fails
|
||||||
* 0: Invalid target (non-targetable ever)
|
* 0: Invalid target (non-targetable ever)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_check_target( struct block_list *src, struct block_list *target,int flag)
|
int battle_check_target( struct block_list *src, struct block_list *target,int flag)
|
||||||
{
|
{
|
||||||
int m,state = 0; //Initial state none
|
int m,state = 0; //Initial state none
|
||||||
@ -3323,8 +3309,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ŽË’ö”»’è
|
* ŽË’ö”»’è
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
int battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, src);
|
nullpo_retr(0, src);
|
||||||
@ -3635,7 +3620,6 @@ static const struct battle_data_short {
|
|||||||
{ "title_lvl7", &battle_config.title_lvl7}, // [Lupus]
|
{ "title_lvl7", &battle_config.title_lvl7}, // [Lupus]
|
||||||
{ "title_lvl8", &battle_config.title_lvl8}, // [Lupus]
|
{ "title_lvl8", &battle_config.title_lvl8}, // [Lupus]
|
||||||
|
|
||||||
{ "duel_enable", &battle_config.duel_enable}, // [LuzZza]
|
|
||||||
{ "duel_allow_pvp", &battle_config.duel_allow_pvp}, // [LuzZza]
|
{ "duel_allow_pvp", &battle_config.duel_allow_pvp}, // [LuzZza]
|
||||||
{ "duel_allow_gvg", &battle_config.duel_allow_gvg}, // [LuzZza]
|
{ "duel_allow_gvg", &battle_config.duel_allow_gvg}, // [LuzZza]
|
||||||
{ "duel_allow_teleport", &battle_config.duel_allow_teleport}, // [LuzZza]
|
{ "duel_allow_teleport", &battle_config.duel_allow_teleport}, // [LuzZza]
|
||||||
@ -3710,7 +3694,8 @@ static const struct battle_data_int {
|
|||||||
{ "hvan_explosion_intimate", &battle_config.hvan_explosion_intimate }, //[orn]
|
{ "hvan_explosion_intimate", &battle_config.hvan_explosion_intimate }, //[orn]
|
||||||
};
|
};
|
||||||
|
|
||||||
int battle_set_value(const char* w1, const char* w2) {
|
int battle_set_value(const char* w1, const char* w2)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < sizeof(battle_data_short) / (sizeof(battle_data_short[0])); i++)
|
for(i = 0; i < sizeof(battle_data_short) / (sizeof(battle_data_short[0])); i++)
|
||||||
if (strcmpi(w1, battle_data_short[i].str) == 0) {
|
if (strcmpi(w1, battle_data_short[i].str) == 0) {
|
||||||
@ -3725,7 +3710,8 @@ int battle_set_value(const char* w1, const char* w2) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int battle_get_value(const char* w1) {
|
int battle_get_value(const char* w1)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < sizeof(battle_data_short) / (sizeof(battle_data_short[0])); i++)
|
for(i = 0; i < sizeof(battle_data_short) / (sizeof(battle_data_short[0])); i++)
|
||||||
if (strcmpi(w1, battle_data_short[i].str) == 0) {
|
if (strcmpi(w1, battle_data_short[i].str) == 0) {
|
||||||
@ -3738,7 +3724,8 @@ int battle_get_value(const char* w1) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void battle_set_defaults() {
|
void battle_set_defaults()
|
||||||
|
{
|
||||||
battle_config.warp_point_debug=0;
|
battle_config.warp_point_debug=0;
|
||||||
battle_config.enable_critical=BL_PC;
|
battle_config.enable_critical=BL_PC;
|
||||||
battle_config.mob_critical_rate=100;
|
battle_config.mob_critical_rate=100;
|
||||||
@ -4065,7 +4052,6 @@ void battle_set_defaults() {
|
|||||||
battle_config.title_lvl7 = 80;
|
battle_config.title_lvl7 = 80;
|
||||||
battle_config.title_lvl8 = 99;
|
battle_config.title_lvl8 = 99;
|
||||||
|
|
||||||
battle_config.duel_enable = 1;
|
|
||||||
battle_config.duel_allow_pvp = 0;
|
battle_config.duel_allow_pvp = 0;
|
||||||
battle_config.duel_allow_gvg = 0;
|
battle_config.duel_allow_gvg = 0;
|
||||||
battle_config.duel_allow_teleport = 0;
|
battle_config.duel_allow_teleport = 0;
|
||||||
@ -4300,8 +4286,7 @@ void battle_validate_conf() {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ?Ý’èƒtƒ@ƒCƒ‹‚ð“Ç‚Ý?ž‚Þ
|
* ?Ý’èƒtƒ@ƒCƒ‹‚ð“Ç‚Ý?ž‚Þ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int battle_config_read(const char *cfgName)
|
int battle_config_read(const char *cfgName)
|
||||||
{
|
{
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
@ -4334,11 +4319,13 @@ int battle_config_read(const char *cfgName)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_init_battle(void) {
|
void do_init_battle(void)
|
||||||
|
{
|
||||||
delay_damage_ers = ers_new(sizeof(struct delay_damage));
|
delay_damage_ers = ers_new(sizeof(struct delay_damage));
|
||||||
add_timer_func_list(battle_delay_damage_sub, "battle_delay_damage_sub");
|
add_timer_func_list(battle_delay_damage_sub, "battle_delay_damage_sub");
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_final_battle(void) {
|
void do_final_battle(void)
|
||||||
|
{
|
||||||
ers_destroy(delay_damage_ers);
|
ers_destroy(delay_damage_ers);
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,6 @@ extern struct Battle_Config {
|
|||||||
unsigned short title_lvl7; // Players titles [Lupus]
|
unsigned short title_lvl7; // Players titles [Lupus]
|
||||||
unsigned short title_lvl8; // Players titles [Lupus]
|
unsigned short title_lvl8; // Players titles [Lupus]
|
||||||
|
|
||||||
unsigned short duel_enable; // [LuzZza]
|
|
||||||
unsigned short duel_allow_pvp; // [LuzZza]
|
unsigned short duel_allow_pvp; // [LuzZza]
|
||||||
unsigned short duel_allow_gvg; // [LuzZza]
|
unsigned short duel_allow_gvg; // [LuzZza]
|
||||||
unsigned short duel_allow_teleport; // [LuzZza]
|
unsigned short duel_allow_teleport; // [LuzZza]
|
||||||
|
@ -107,8 +107,7 @@ CCMD_FUNC(hominfo);
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*CharCommandInfo charcommand_info[]構造体の定義
|
*CharCommandInfo charcommand_info[]構造体の定義
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
// First char of commands is configured in charcommand_athena.conf. Leave # in this list for default value.
|
// First char of commands is configured in charcommand_athena.conf. Leave # in this list for default value.
|
||||||
// to set default level, read charcommand_athena.conf first please.
|
// to set default level, read charcommand_athena.conf first please.
|
||||||
@ -212,7 +211,8 @@ static CharCommandInfo charcommand_info[] = {
|
|||||||
{ CharCommand_Unknown, NULL, 1, NULL }
|
{ CharCommand_Unknown, NULL, 1, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
int get_charcommand_level(const CharCommandType type) {
|
int get_charcommand_level(const CharCommandType type)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; charcommand_info[i].type != CharCommand_None; i++)
|
for (i = 0; charcommand_info[i].type != CharCommand_None; i++)
|
||||||
@ -222,7 +222,8 @@ int get_charcommand_level(const CharCommandType type) {
|
|||||||
return 100; // 100: command can not be used
|
return 100; // 100: command can not be used
|
||||||
}
|
}
|
||||||
|
|
||||||
CharCommandType is_charcommand_sub(const int fd, struct map_session_data* sd, const char* str, int gmlvl) {
|
CharCommandType is_charcommand_sub(const int fd, struct map_session_data* sd, const char* str, int gmlvl)
|
||||||
|
{
|
||||||
CharCommandInfo info;
|
CharCommandInfo info;
|
||||||
CharCommandType type;
|
CharCommandType type;
|
||||||
|
|
||||||
@ -271,9 +272,9 @@ CharCommandType is_charcommand_sub(const int fd, struct map_session_data* sd, co
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*is_charcommand @コマンドに存在するかどうか確認する
|
*is_charcommand @コマンドに存在するかどうか確認する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
CharCommandType is_charcommand(const int fd, struct map_session_data* sd, const char* message)
|
||||||
CharCommandType is_charcommand(const int fd, struct map_session_data* sd, const char* message) {
|
{
|
||||||
const char* str = message;
|
const char* str = message;
|
||||||
int s_flag = 0;
|
int s_flag = 0;
|
||||||
|
|
||||||
@ -303,9 +304,9 @@ CharCommandType is_charcommand(const int fd, struct map_session_data* sd, const
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
CharCommandType charcommand(struct map_session_data* sd, const int level, const char* message, CharCommandInfo* info)
|
||||||
CharCommandType charcommand(struct map_session_data* sd, const int level, const char* message, CharCommandInfo* info) {
|
{
|
||||||
char* p = (char *)message;
|
char* p = (char *)message;
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
@ -352,9 +353,9 @@ CharCommandType charcommand(struct map_session_data* sd, const int level, const
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
static CharCommandInfo* get_charcommandinfo_byname(const char* name)
|
||||||
static CharCommandInfo* get_charcommandinfo_byname(const char* name) {
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; charcommand_info[i].type != CharCommand_Unknown; i++)
|
for (i = 0; charcommand_info[i].type != CharCommand_Unknown; i++)
|
||||||
@ -366,9 +367,9 @@ static CharCommandInfo* get_charcommandinfo_byname(const char* name) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_config_read(const char *cfgName)
|
||||||
int charcommand_config_read(const char *cfgName) {
|
{
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
CharCommandInfo* p;
|
CharCommandInfo* p;
|
||||||
FILE* fp;
|
FILE* fp;
|
||||||
@ -409,11 +410,8 @@ int charcommand_config_read(const char *cfgName) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 対象キャラクターを転職させる upper指定で転生や養子も可能
|
* 対象キャラクターを転職させる upper指定で転生や養子も可能
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_jobchange(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_jobchange(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[100];
|
char character[100];
|
||||||
struct map_session_data* pl_sd;
|
struct map_session_data* pl_sd;
|
||||||
@ -478,11 +476,8 @@ int charcommand_jobchange(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_petrename(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_petrename(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -521,11 +516,8 @@ int charcommand_petrename(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_petfriendly(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_petfriendly(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int friendly = 0;
|
int friendly = 0;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -576,11 +568,8 @@ int charcommand_petfriendly(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_stats(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_stats(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
char job_jobname[100];
|
char job_jobname[100];
|
||||||
@ -653,11 +642,8 @@ int charcommand_stats(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Reset
|
* Character Reset
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_reset(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_reset(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
char output[200];
|
char output[200];
|
||||||
@ -693,11 +679,8 @@ int charcommand_reset(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_option(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_option(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
int opt1 = 0, opt2 = 0, opt3 = 0;
|
int opt1 = 0, opt2 = 0, opt3 = 0;
|
||||||
@ -734,11 +717,8 @@ int charcommand_option(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_save(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_save(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char map_name[MAP_NAME_LENGTH_EXT];
|
char map_name[MAP_NAME_LENGTH_EXT];
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -789,8 +769,7 @@ int charcommand_save(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
//** Character Stats All by fritz
|
//** Character Stats All by fritz
|
||||||
int charcommand_stats_all(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
int charcommand_stats_all(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
{
|
{
|
||||||
@ -835,8 +814,7 @@ int charcommand_stats_all(const int fd, struct map_session_data* sd, const char*
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* CharSpiritBall Function by PalasX
|
* CharSpiritBall Function by PalasX
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int charcommand_spiritball(const int fd, struct map_session_data* sd,const char* command, const char* message)
|
int charcommand_spiritball(const int fd, struct map_session_data* sd,const char* command, const char* message)
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -876,11 +854,8 @@ int charcommand_spiritball(const int fd, struct map_session_data* sd,const char*
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #itemlist <character>: Displays the list of a player's items.
|
* #itemlist <character>: Displays the list of a player's items.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_itemlist(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_itemlist(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
struct item_data *item_data, *item_temp;
|
struct item_data *item_data, *item_temp;
|
||||||
@ -1005,10 +980,8 @@ int charcommand_itemlist(
|
|||||||
* #effect by [MouseJstr]
|
* #effect by [MouseJstr]
|
||||||
*
|
*
|
||||||
* Create a effect localized on another character
|
* Create a effect localized on another character
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_effect(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_effect(const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd = NULL;
|
struct map_session_data *pl_sd = NULL;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -1034,12 +1007,8 @@ int charcommand_effect(const int fd, struct map_session_data* sd,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #storagelist <character>: Displays the items list of a player's storage.
|
* #storagelist <character>: Displays the items list of a player's storage.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_storagelist(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int
|
|
||||||
charcommand_storagelist(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -1119,8 +1088,7 @@ charcommand_storagelist(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void charcommand_giveitem_sub(struct map_session_data *sd,struct item_data *item_data,int number)
|
||||||
charcommand_giveitem_sub(struct map_session_data *sd,struct item_data *item_data,int number)
|
|
||||||
{
|
{
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
int loop = 1, get_count = number,i;
|
int loop = 1, get_count = number,i;
|
||||||
@ -1150,11 +1118,8 @@ charcommand_giveitem_sub(struct map_session_data *sd,struct item_data *item_data
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* #item command (usage: #item <name/id_of_item> <quantity> <player>)
|
* #item command (usage: #item <name/id_of_item> <quantity> <player>)
|
||||||
* by MC Cameri
|
* by MC Cameri
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_item(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_item(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char item_name[100];
|
char item_name[100];
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -1249,11 +1214,8 @@ int charcommand_item(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #warp/#rura/#rura+ <mapname> <x> <y> <char name>
|
* #warp/#rura/#rura+ <mapname> <x> <y> <char name>
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_warp(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_warp(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char map_name[MAP_NAME_LENGTH_EXT];
|
char map_name[MAP_NAME_LENGTH_EXT];
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -1308,11 +1270,8 @@ int charcommand_warp(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #zeny <charname>
|
* #zeny <charname>
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_zeny(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_zeny(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -1353,12 +1312,8 @@ int charcommand_zeny(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #fakename <char name> <fake name>
|
* #fakename <char name> <fake name>
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_fakename(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
|
|
||||||
int charcommand_fakename(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char name[NAME_LENGTH];
|
char name[NAME_LENGTH];
|
||||||
@ -1405,11 +1360,8 @@ int charcommand_fakename(
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* #baselvl <#> <nickname>
|
* #baselvl <#> <nickname>
|
||||||
* Transferred by: Kevin
|
* Transferred by: Kevin
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_baselevel(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_baselevel(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1480,11 +1432,8 @@ int charcommand_baselevel(
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* #jlvl <#> <nickname>
|
* #jlvl <#> <nickname>
|
||||||
* Transferred by: Kevin
|
* Transferred by: Kevin
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_joblevel(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_joblevel(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1556,11 +1505,8 @@ int charcommand_joblevel(
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* #questskill <skill_#> <nickname>
|
* #questskill <skill_#> <nickname>
|
||||||
* Transferred by: Kevin
|
* Transferred by: Kevin
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_questskill(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_questskill(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1602,11 +1548,8 @@ int charcommand_questskill(
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* #lostskill <skill_#> <nickname>
|
* #lostskill <skill_#> <nickname>
|
||||||
* Transferred by: Kevin
|
* Transferred by: Kevin
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_lostskill(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_lostskill(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1648,11 +1591,8 @@ int charcommand_lostskill(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Skill Reset
|
* Character Skill Reset
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_skreset(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_skreset(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1683,11 +1623,8 @@ int charcommand_skreset(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Stat Reset
|
* Character Stat Reset
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_streset(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_streset(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1718,11 +1655,8 @@ int charcommand_streset(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Model by chbrules
|
* Character Model by chbrules
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_model(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_model(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int hair_style = 0, hair_color = 0, cloth_color = 0;
|
int hair_style = 0, hair_color = 0, cloth_color = 0;
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -1741,19 +1675,10 @@ int charcommand_model(
|
|||||||
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE &&
|
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE &&
|
||||||
hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR &&
|
hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR &&
|
||||||
cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
|
cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
|
||||||
/* Removed this check for being too strange. [Skotlex]
|
|
||||||
if (cloth_color != 0 &&
|
|
||||||
pl_sd->status.sex == 1 &&
|
|
||||||
(pl_sd->status.class_ == JOB_ASSASSIN || pl_sd->status.class_ == JOB_ROGUE)) {
|
|
||||||
clif_displaymessage(fd, msg_txt(35)); // You can't use this command with this class.
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
*/
|
|
||||||
pc_changelook(pl_sd, LOOK_HAIR, hair_style);
|
pc_changelook(pl_sd, LOOK_HAIR, hair_style);
|
||||||
pc_changelook(pl_sd, LOOK_HAIR_COLOR, hair_color);
|
pc_changelook(pl_sd, LOOK_HAIR_COLOR, hair_color);
|
||||||
pc_changelook(pl_sd, LOOK_CLOTHES_COLOR, cloth_color);
|
pc_changelook(pl_sd, LOOK_CLOTHES_COLOR, cloth_color);
|
||||||
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
||||||
return -1;
|
return -1;
|
||||||
@ -1768,11 +1693,8 @@ int charcommand_model(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Skill Point (Rewritten by [Yor])
|
* Character Skill Point (Rewritten by [Yor])
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_skpoint(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_skpoint(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1813,11 +1735,8 @@ int charcommand_skpoint(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Character Status Point (rewritten by [Yor])
|
* Character Status Point (rewritten by [Yor])
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_stpoint(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_stpoint(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
@ -1858,11 +1777,8 @@ int charcommand_stpoint(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* charchangesex command (usage: charchangesex <player_name>)
|
* charchangesex command (usage: charchangesex <player_name>)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_changesex(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_changesex(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char player[NAME_LENGTH];
|
char player[NAME_LENGTH];
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
@ -1889,11 +1805,8 @@ int charcommand_changesex(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Feel (SG save map) Reset
|
* Feel (SG save map) Reset
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_feelreset(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_feelreset(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
char output[200];
|
char output[200];
|
||||||
@ -1926,11 +1839,8 @@ int charcommand_feelreset(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* #help - Char commands [Kayla]
|
* #help - Char commands [Kayla]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_help(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_help(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char buf[2048], w1[2048], w2[2048];
|
char buf[2048], w1[2048], w2[2048];
|
||||||
int i, gm_level;
|
int i, gm_level;
|
||||||
@ -1967,11 +1877,8 @@ int charcommand_help(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Loads a character back to their save point [HiddenDragon]
|
* Loads a character back to their save point [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_load(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_load(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int m;
|
int m;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2015,11 +1922,8 @@ int charcommand_load(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Changes the targets speed [HiddenDragon]
|
* Changes the targets speed [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_speed(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_speed(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int speed;
|
int speed;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2063,11 +1967,8 @@ int charcommand_speed(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Opens their storage [HiddenDragon]
|
* Opens their storage [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_storage(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_storage(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
|
|
||||||
@ -2109,11 +2010,8 @@ int charcommand_storage(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Opens their guild storage
|
* Opens their guild storage
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_guildstorage(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_guildstorage(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct storage *stor; //changes from Freya/Yor
|
struct storage *stor; //changes from Freya/Yor
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2164,11 +2062,8 @@ int charcommand_guildstorage(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Applies GM Hide to a character [HiddenDragon]
|
* Applies GM Hide to a character [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_hide(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_hide(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
|
|
||||||
@ -2215,11 +2110,8 @@ int charcommand_hide(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Resurrects a dead character [HiddenDragon]
|
* Resurrects a dead character [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_alive(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_alive(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
|
|
||||||
@ -2254,11 +2146,8 @@ int charcommand_alive(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Heals someone's HP and SP [HiddenDragon]
|
* Heals someone's HP and SP [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_heal(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_heal(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int hp = 0, sp = 0; // [Valaris] thanks to fov
|
int hp = 0, sp = 0; // [Valaris] thanks to fov
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2340,11 +2229,8 @@ int charcommand_heal(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Creates items as specified [HiddenDragon]
|
* Creates items as specified [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_item2(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_item2(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct item item_tmp;
|
struct item item_tmp;
|
||||||
struct item_data *item_data;
|
struct item_data *item_data;
|
||||||
@ -2436,11 +2322,8 @@ int charcommand_item2(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Reset a character's items [HiddenDragon]
|
* Reset a character's items [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_itemreset(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_itemreset(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2487,11 +2370,8 @@ int charcommand_itemreset(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Refine their items [HiddenDragon]
|
* Refine their items [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_refine(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_refine(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int i,j, position = 0, refine = 0, current_position, final_refine;
|
int i,j, position = 0, refine = 0, current_position, final_refine;
|
||||||
int count;
|
int count;
|
||||||
@ -2595,11 +2475,8 @@ int charcommand_refine(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Produce a manufactured item in their inventory [HiddenDragon]
|
* Produce a manufactured item in their inventory [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_produce(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_produce(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char item_name[100];
|
char item_name[100];
|
||||||
int item_id, attribute = 0, star = 0;
|
int item_id, attribute = 0, star = 0;
|
||||||
@ -2679,11 +2556,8 @@ int charcommand_produce(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Changes a character's stats [HiddenDragon
|
* Changes a character's stats [HiddenDragon
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_param(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_param(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int index, value = 0, new_value;
|
int index, value = 0, new_value;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -2758,11 +2632,8 @@ int charcommand_param(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Levels up a character's guild [HiddenDragon]
|
* Levels up a character's guild [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_guildlevelup(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_guildlevelup(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int level = 0;
|
int level = 0;
|
||||||
short added_level;
|
short added_level;
|
||||||
@ -2818,11 +2689,8 @@ int charcommand_guildlevelup(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Opens a hatch window for them [HiddenDragon]
|
* Opens a hatch window for them [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_hatch(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_hatch(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -2856,11 +2724,8 @@ int charcommand_hatch(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change target pet's hunger [HiddenDragon]
|
* Change target pet's hunger [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_pethungry(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_pethungry(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int hungry;
|
int hungry;
|
||||||
struct pet_data *pd;
|
struct pet_data *pd;
|
||||||
@ -2911,11 +2776,8 @@ int charcommand_pethungry(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Give all skills to target [HiddenDragon]
|
* Give all skills to target [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_allskill(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_allskill(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
|
|
||||||
@ -2951,8 +2813,7 @@ int charcommand_allskill(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change target's clothing color [HiddenDragon]
|
* Change target's clothing color [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int charcommand_dye(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
int charcommand_dye(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
{
|
{
|
||||||
int cloth_color = 0;
|
int cloth_color = 0;
|
||||||
@ -2994,8 +2855,7 @@ int charcommand_dye(const int fd, struct map_session_data* sd, const char* comma
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change target's hair style [HiddenDragon]
|
* Change target's hair style [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int charcommand_hair_style(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
int charcommand_hair_style(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
{
|
{
|
||||||
int hair_style = 0;
|
int hair_style = 0;
|
||||||
@ -3023,17 +2883,10 @@ int charcommand_hair_style(const int fd, struct map_session_data* sd, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
|
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
|
||||||
/* Removed because this check is TOO strange. [Skotlex]
|
|
||||||
if (hair_style != 0 && sd->status.sex == 1 && (sd->status.class_ == JOB_ASSASSIN || sd->status.class_ == JOB_ROGUE)) { //???
|
|
||||||
clif_displaymessage(fd, msg_txt(35)); // You can't use this command with this class.
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
*/
|
|
||||||
pc_changelook(pl_sd, LOOK_HAIR, hair_style);
|
pc_changelook(pl_sd, LOOK_HAIR, hair_style);
|
||||||
clif_displaymessage(pl_sd->fd, msg_txt(36)); // Appearence changed.
|
clif_displaymessage(pl_sd->fd, msg_txt(36)); // Appearence changed.
|
||||||
if (pl_sd->fd != fd)
|
if (pl_sd->fd != fd)
|
||||||
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
||||||
return -1;
|
return -1;
|
||||||
@ -3044,8 +2897,7 @@ int charcommand_hair_style(const int fd, struct map_session_data* sd, const char
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change target's hair color [HiddenDragon]
|
* Change target's hair color [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int charcommand_hair_color(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
int charcommand_hair_color(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
{
|
{
|
||||||
int hair_color = 0;
|
int hair_color = 0;
|
||||||
@ -3075,17 +2927,10 @@ int charcommand_hair_color(const int fd, struct map_session_data* sd, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
|
if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
|
||||||
/* Removed for being such a strange check. [Skotlex]
|
|
||||||
if (hair_color != 0 && sd->status.sex == 1 && (sd->status.class_ == JOB_ASSASSIN || sd->status.class_ == JOB_ROGUE)) {
|
|
||||||
clif_displaymessage(fd, msg_txt(35)); // You can't use this command with this class.
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
*/
|
|
||||||
pc_changelook(pl_sd, LOOK_HAIR_COLOR, hair_color);
|
pc_changelook(pl_sd, LOOK_HAIR_COLOR, hair_color);
|
||||||
clif_displaymessage(pl_sd->fd, msg_txt(36)); // Appearence changed.
|
clif_displaymessage(pl_sd->fd, msg_txt(36)); // Appearence changed.
|
||||||
if (pl_sd->fd != fd)
|
if (pl_sd->fd != fd)
|
||||||
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
|
||||||
return -1;
|
return -1;
|
||||||
@ -3096,11 +2941,8 @@ int charcommand_hair_color(const int fd, struct map_session_data* sd, const char
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change all target's stats [HiddenDragon]
|
* Change all target's stats [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_allstats(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_allstats(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int index, count, value = 0, max, new_value;
|
int index, count, value = 0, max, new_value;
|
||||||
short* status[6];
|
short* status[6];
|
||||||
@ -3174,11 +3016,8 @@ int charcommand_allstats(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Gives/Removes a peco from a player [HiddenDragon]
|
* Gives/Removes a peco from a player [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_mount_peco(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_mount_peco(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -3235,10 +3074,8 @@ int charcommand_mount_peco(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Remove items from a player (now a char command) [HiddenDragon]
|
* Remove items from a player (now a char command) [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_delitem(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_delitem(const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
char item_name[100];
|
char item_name[100];
|
||||||
@ -3342,12 +3179,9 @@ static void get_jail_time(int jailtime, int* year, int* month, int* day, int* ho
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Jail a player for a certain amount of time [Coltaro]
|
* Jail a player for a certain amount of time [Coltaro]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_jailtime(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_jailtime(
|
{
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
|
||||||
struct map_session_data* pl_sd;
|
struct map_session_data* pl_sd;
|
||||||
int year, month, day, hour, minute;
|
int year, month, day, hour, minute;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -3392,11 +3226,8 @@ int charcommand_jailtime(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Disguises a player [HiddenDragon]
|
* Disguises a player [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_disguise(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_disguise(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int mob_id;
|
int mob_id;
|
||||||
char mob_name[NAME_LENGTH];
|
char mob_name[NAME_LENGTH];
|
||||||
@ -3460,11 +3291,8 @@ int charcommand_disguise(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Undisguises a player [HiddenDragon]
|
* Undisguises a player [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_undisguise(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_undisguise(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data* pl_sd;
|
struct map_session_data* pl_sd;
|
||||||
@ -3506,11 +3334,8 @@ int charcommand_undisguise(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Displays contents of target's cart [HiddenDragon]
|
* Displays contents of target's cart [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_cart_list(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_cart_list(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char outputtmp[200];
|
char outputtmp[200];
|
||||||
char output[200];
|
char output[200];
|
||||||
@ -3598,11 +3423,8 @@ static int charcommand_stopattack(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Enable a player to kill players even when not in pvp [HiddenDragon]
|
* Enable a player to kill players even when not in pvp [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_killer(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_killer(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -3646,11 +3468,8 @@ int charcommand_killer(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Enable other players to kill target even when not in pvp [HiddenDragon]
|
* Enable other players to kill target even when not in pvp [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_killable(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_killable(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -3694,11 +3513,8 @@ int charcommand_killable(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Refreshes target [HiddenDragon]
|
* Refreshes target [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_refresh(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_refresh(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -3728,11 +3544,8 @@ int charcommand_refresh(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* View target's exp [HiddenDragon]
|
* View target's exp [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_exp(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_exp(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char output[200];
|
char output[200];
|
||||||
double nextb, nextj;
|
double nextb, nextj;
|
||||||
@ -3775,12 +3588,8 @@ int charcommand_exp(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Makes monsters ignore target [HiddenDragon]
|
* Makes monsters ignore target [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_monsterignore(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
|
|
||||||
int charcommand_monsterignore(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -3821,11 +3630,8 @@ int charcommand_monsterignore(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change target's size [HiddenDragon]
|
* Change target's size [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_size(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_size(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int size=0;
|
int size=0;
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
@ -3880,11 +3686,8 @@ int charcommand_size(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Level up target's homunculus [HiddenDragon]
|
* Level up target's homunculus [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_homlevel(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_homlevel(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
TBL_HOM * hd;
|
TBL_HOM * hd;
|
||||||
int level = 0, i = 0;
|
int level = 0, i = 0;
|
||||||
@ -3934,11 +3737,8 @@ int charcommand_homlevel(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Evolve target's homunculus [HiddenDragon]
|
* Evolve target's homunculus [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_homevolution(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_homevolution(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
char character[NAME_LENGTH];
|
char character[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
struct map_session_data *pl_sd;
|
||||||
@ -3983,11 +3783,8 @@ int charcommand_homevolution(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Create a homunculus for target [HiddenDragon]
|
* Create a homunculus for target [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_makehomun(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_makehomun(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int homunid;
|
int homunid;
|
||||||
|
|
||||||
@ -4034,11 +3831,8 @@ int charcommand_makehomun(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change Target's homunculus' friendlyness [HiddenDragon]
|
* Change Target's homunculus' friendlyness [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_homfriendly(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_homfriendly(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int friendly = 0;
|
int friendly = 0;
|
||||||
|
|
||||||
@ -4085,11 +3879,8 @@ int charcommand_homfriendly(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Modify target's homunculus hunger [HiddenDragon]
|
* Modify target's homunculus hunger [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_homhungry(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_homhungry(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
int hungry = 0;
|
int hungry = 0;
|
||||||
|
|
||||||
@ -4139,11 +3930,8 @@ int charcommand_homhungry(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Show target's homunculus stats [HiddenDragon]
|
* Show target's homunculus stats [HiddenDragon]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int charcommand_hominfo(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
||||||
int charcommand_hominfo(
|
|
||||||
const int fd, struct map_session_data* sd,
|
|
||||||
const char* command, const char* message)
|
|
||||||
{
|
{
|
||||||
struct homun_data *hd;
|
struct homun_data *hd;
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
|
@ -19,8 +19,7 @@ int chat_triggerevent(struct chat_data *cd);
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* chatroom creation
|
* chatroom creation
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_createchat(struct map_session_data* sd,int limit, int pub, char* pass, char* title, int titlelen)
|
int chat_createchat(struct map_session_data* sd,int limit, int pub, char* pass, char* title, int titlelen)
|
||||||
{
|
{
|
||||||
struct chat_data *cd;
|
struct chat_data *cd;
|
||||||
@ -68,8 +67,7 @@ int chat_createchat(struct map_session_data* sd,int limit, int pub, char* pass,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 既存チャットルームに参加
|
* 既存チャットルームに参加
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_joinchat(struct map_session_data* sd, int chatid, char* pass)
|
int chat_joinchat(struct map_session_data* sd, int chatid, char* pass)
|
||||||
{
|
{
|
||||||
struct chat_data *cd;
|
struct chat_data *cd;
|
||||||
@ -173,8 +171,7 @@ int chat_leavechat(struct map_session_data* sd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* チャットルームの持ち主を譲る
|
* チャットルームの持ち主を譲る
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_changechatowner(struct map_session_data *sd,char *nextownername)
|
int chat_changechatowner(struct map_session_data *sd,char *nextownername)
|
||||||
{
|
{
|
||||||
struct chat_data *cd;
|
struct chat_data *cd;
|
||||||
@ -219,8 +216,7 @@ int chat_changechatowner(struct map_session_data *sd,char *nextownername)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* チャットの状態(タイトル等)を変更
|
* チャットの状態(タイトル等)を変更
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_changechatstatus(struct map_session_data *sd,int limit,int pub,char* pass,char* title,int titlelen)
|
int chat_changechatstatus(struct map_session_data *sd,int limit,int pub,char* pass,char* title,int titlelen)
|
||||||
{
|
{
|
||||||
struct chat_data *cd;
|
struct chat_data *cd;
|
||||||
@ -247,8 +243,7 @@ int chat_changechatstatus(struct map_session_data *sd,int limit,int pub,char* pa
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* チャットルームから蹴り出す
|
* チャットルームから蹴り出す
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_kickchat(struct map_session_data *sd,char *kickusername)
|
int chat_kickchat(struct map_session_data *sd,char *kickusername)
|
||||||
{
|
{
|
||||||
struct chat_data *cd;
|
struct chat_data *cd;
|
||||||
@ -334,8 +329,7 @@ int chat_deletenpcchat(struct npc_data* nd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 規定人数以上でイベントが定義されてるなら実行
|
* 規定人数以上でイベントが定義されてるなら実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chat_triggerevent(struct chat_data *cd)
|
int chat_triggerevent(struct chat_data *cd)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, cd);
|
nullpo_retr(0, cd);
|
||||||
|
115
src/map/chrif.c
115
src/map/chrif.c
@ -378,8 +378,7 @@ int chrif_connectack(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_sendmapack(int fd)
|
int chrif_sendmapack(int fd)
|
||||||
{
|
{
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
@ -403,8 +402,7 @@ int chrif_sendmapack(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Request sc_data from charserver [Skotlex]
|
* Request sc_data from charserver [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_scdata_request(int account_id, int char_id)
|
int chrif_scdata_request(int account_id, int char_id)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_SC_SAVING
|
#ifdef ENABLE_SC_SAVING
|
||||||
@ -421,8 +419,7 @@ int chrif_scdata_request(int account_id, int char_id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* new auth system [Kevin]
|
* new auth system [Kevin]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void chrif_authreq(struct map_session_data *sd)
|
void chrif_authreq(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
struct auth_node *auth_data;
|
struct auth_node *auth_data;
|
||||||
@ -454,7 +451,8 @@ void chrif_authreq(struct map_session_data *sd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//character selected, insert into auth db
|
//character selected, insert into auth db
|
||||||
void chrif_authok(int fd) {
|
void chrif_authok(int fd)
|
||||||
|
{
|
||||||
struct auth_node *auth_data;
|
struct auth_node *auth_data;
|
||||||
TBL_PC* sd;
|
TBL_PC* sd;
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
@ -520,15 +518,15 @@ int auth_db_cleanup_sub(DBKey key,void *data,va_list ap)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int auth_db_cleanup(int tid, unsigned int tick, int id, int data) {
|
int auth_db_cleanup(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
auth_db->foreach(auth_db, auth_db_cleanup_sub);
|
auth_db->foreach(auth_db, auth_db_cleanup_sub);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip)
|
int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip)
|
||||||
{
|
{
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
@ -550,8 +548,7 @@ int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* キャラ名問い合わせ
|
* キャラ名問い合わせ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_searchcharid(int char_id)
|
int chrif_searchcharid(int char_id)
|
||||||
{
|
{
|
||||||
if( !char_id )
|
if( !char_id )
|
||||||
@ -568,8 +565,7 @@ int chrif_searchcharid(int char_id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* GMに変化要求
|
* GMに変化要求
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_changegm(int id, const char *pass, int len)
|
int chrif_changegm(int id, const char *pass, int len)
|
||||||
{
|
{
|
||||||
if (battle_config.etc_log)
|
if (battle_config.etc_log)
|
||||||
@ -589,8 +585,7 @@ int chrif_changegm(int id, const char *pass, int len)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change Email
|
* Change Email
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_changeemail(int id, const char *actual_email, const char *new_email)
|
int chrif_changeemail(int id, const char *actual_email, const char *new_email)
|
||||||
{
|
{
|
||||||
if (battle_config.etc_log)
|
if (battle_config.etc_log)
|
||||||
@ -617,8 +612,7 @@ int chrif_changeemail(int id, const char *actual_email, const char *new_email)
|
|||||||
* 3: unblock
|
* 3: unblock
|
||||||
* 4: unban
|
* 4: unban
|
||||||
* 5: changesex
|
* 5: changesex
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_char_ask_name(int id, char * character_name, short operation_type, int year, int month, int day, int hour, int minute, int second)
|
int chrif_char_ask_name(int id, char * character_name, short operation_type, int year, int month, int day, int hour, int minute, int second)
|
||||||
{
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
@ -644,9 +638,9 @@ int chrif_char_ask_name(int id, char * character_name, short operation_type, int
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 性別変化要求
|
* 性別変化要求
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int chrif_changesex(int id, int sex)
|
||||||
int chrif_changesex(int id, int sex) {
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
|
|
||||||
WFIFOHEAD(char_fd, 9);
|
WFIFOHEAD(char_fd, 9);
|
||||||
@ -672,8 +666,7 @@ int chrif_changesex(int id, int sex) {
|
|||||||
* 1: player not found
|
* 1: player not found
|
||||||
* 2: gm level too low
|
* 2: gm level too low
|
||||||
* 3: login-server offline
|
* 3: login-server offline
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_char_ask_name_answer(int fd)
|
int chrif_char_ask_name_answer(int fd)
|
||||||
{
|
{
|
||||||
int acc;
|
int acc;
|
||||||
@ -776,8 +769,7 @@ int chrif_char_ask_name_answer(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* End of GM change (@GM) (modified by Yor)
|
* End of GM change (@GM) (modified by Yor)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_changedgm(int fd)
|
int chrif_changedgm(int fd)
|
||||||
{
|
{
|
||||||
int acc, level;
|
int acc, level;
|
||||||
@ -803,8 +795,7 @@ int chrif_changedgm(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 性別変化終了 (modified by Yor)
|
* 性別変化終了 (modified by Yor)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_changedsex(int fd)
|
int chrif_changedsex(int fd)
|
||||||
{
|
{
|
||||||
int acc, sex, i;
|
int acc, sex, i;
|
||||||
@ -875,8 +866,7 @@ int chrif_changedsex(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 離婚情報同期要求
|
* 離婚情報同期要求
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_divorce(int char_id, int partner_id)
|
int chrif_divorce(int char_id, int partner_id)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL;
|
struct map_session_data *sd = NULL;
|
||||||
@ -901,8 +891,7 @@ int chrif_divorce(int char_id, int partner_id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Disconnection of a player (account has been deleted in login-server) by [Yor]
|
* Disconnection of a player (account has been deleted in login-server) by [Yor]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_accountdeletion(int fd)
|
int chrif_accountdeletion(int fd)
|
||||||
{
|
{
|
||||||
int acc;
|
int acc;
|
||||||
@ -929,8 +918,7 @@ int chrif_accountdeletion(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Disconnection of a player (account has been banned of has a status, from login-server) by [Yor]
|
* Disconnection of a player (account has been banned of has a status, from login-server) by [Yor]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_accountban(int fd)
|
int chrif_accountban(int fd)
|
||||||
{
|
{
|
||||||
int acc;
|
int acc;
|
||||||
@ -1047,8 +1035,7 @@ int chrif_disconnectplayer(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Request to reload GM accounts and their levels: send to char-server by [Yor]
|
* Request to reload GM accounts and their levels: send to char-server by [Yor]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_reloadGMdb(void)
|
int chrif_reloadGMdb(void)
|
||||||
{
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
@ -1062,8 +1049,7 @@ int chrif_reloadGMdb(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Receiving GM accounts and their levels from char-server by [Yor]
|
* Receiving GM accounts and their levels from char-server by [Yor]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_recvgmaccounts(int fd)
|
int chrif_recvgmaccounts(int fd)
|
||||||
{
|
{
|
||||||
ShowInfo("From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd));
|
ShowInfo("From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd));
|
||||||
@ -1072,8 +1058,7 @@ int chrif_recvgmaccounts(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Request/Receive top 10 Fame character list
|
* Request/Receive top 10 Fame character list
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int chrif_updatefamelist(struct map_session_data *sd)
|
int chrif_updatefamelist(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
@ -1261,8 +1246,7 @@ int chrif_load_scdata(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Send rates and motd to char server [Wizputer]
|
* Send rates and motd to char server [Wizputer]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate)
|
int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
@ -1301,9 +1285,7 @@ int chrif_load_scdata(int fd)
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
* Tell char-server charcter disconnected [Wizputer]
|
* Tell char-server charcter disconnected [Wizputer]
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int chrif_char_offline(struct map_session_data *sd)
|
int chrif_char_offline(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
@ -1319,9 +1301,9 @@ int chrif_char_offline(struct map_session_data *sd)
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
* Tell char-server to reset all chars offline [Wizputer]
|
* Tell char-server to reset all chars offline [Wizputer]
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
int chrif_flush_fifo(void)
|
||||||
int chrif_flush_fifo(void) {
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
|
|
||||||
set_nonblocking(char_fd, 0);
|
set_nonblocking(char_fd, 0);
|
||||||
@ -1333,9 +1315,9 @@ int chrif_flush_fifo(void) {
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
* Tell char-server to reset all chars offline [Wizputer]
|
* Tell char-server to reset all chars offline [Wizputer]
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
int chrif_char_reset_offline(void)
|
||||||
int chrif_char_reset_offline(void) {
|
{
|
||||||
chrif_check(-1);
|
chrif_check(-1);
|
||||||
|
|
||||||
WFIFOHEAD(char_fd, 2);
|
WFIFOHEAD(char_fd, 2);
|
||||||
@ -1347,8 +1329,7 @@ int chrif_char_reset_offline(void) {
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
* Tell char-server charcter is online [Wizputer]
|
* Tell char-server charcter is online [Wizputer]
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int chrif_char_online(struct map_session_data *sd)
|
int chrif_char_online(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
@ -1363,7 +1344,8 @@ int chrif_char_online(struct map_session_data *sd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int chrif_disconnect(int fd) {
|
int chrif_disconnect(int fd)
|
||||||
|
{
|
||||||
if(fd == char_fd) {
|
if(fd == char_fd) {
|
||||||
char_fd = 0;
|
char_fd = 0;
|
||||||
ShowWarning("Map Server disconnected from Char Server.\n\n");
|
ShowWarning("Map Server disconnected from Char Server.\n\n");
|
||||||
@ -1395,8 +1377,7 @@ void chrif_update_ip(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int chrif_parse(int fd)
|
int chrif_parse(int fd)
|
||||||
{
|
{
|
||||||
int packet_len, cmd;
|
int packet_len, cmd;
|
||||||
@ -1475,7 +1456,8 @@ int chrif_parse(int fd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int send_usercount_tochar(int tid, unsigned int tick, int id, int data) {
|
int send_usercount_tochar(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
int count;
|
int count;
|
||||||
static int last_count = 0;
|
static int last_count = 0;
|
||||||
|
|
||||||
@ -1497,9 +1479,9 @@ int send_usercount_tochar(int tid, unsigned int tick, int id, int data) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* timer関数
|
* timer関数
|
||||||
* 今このmap鯖に繋がっているクライアント人数をchar鯖へ送る
|
* 今このmap鯖に繋がっているクライアント人数をchar鯖へ送る
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int send_users_tochar(int tid, unsigned int tick, int id, int data)
|
||||||
int send_users_tochar(int tid, unsigned int tick, int id, int data) {
|
{
|
||||||
int count, users=0, i;
|
int count, users=0, i;
|
||||||
struct map_session_data **all_sd;
|
struct map_session_data **all_sd;
|
||||||
|
|
||||||
@ -1523,9 +1505,9 @@ int send_users_tochar(int tid, unsigned int tick, int id, int data) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* timer関数
|
* timer関数
|
||||||
* char鯖との接続を確認し、もし切れていたら再度接続する
|
* char鯖との接続を確認し、もし切れていたら再度接続する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int check_connect_char_server(int tid, unsigned int tick, int id, int data)
|
||||||
int check_connect_char_server(int tid, unsigned int tick, int id, int data) {
|
{
|
||||||
static int displayed = 0;
|
static int displayed = 0;
|
||||||
if (char_fd <= 0 || session[char_fd] == NULL) {
|
if (char_fd <= 0 || session[char_fd] == NULL) {
|
||||||
if (!displayed) {
|
if (!displayed) {
|
||||||
@ -1567,7 +1549,8 @@ int check_connect_char_server(int tid, unsigned int tick, int id, int data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int auth_db_final(DBKey k,void *d,va_list ap) {
|
int auth_db_final(DBKey k,void *d,va_list ap)
|
||||||
|
{
|
||||||
struct auth_node *node=(struct auth_node*)d;
|
struct auth_node *node=(struct auth_node*)d;
|
||||||
if (node->char_dat)
|
if (node->char_dat)
|
||||||
aFree(node->char_dat);
|
aFree(node->char_dat);
|
||||||
@ -1576,8 +1559,7 @@ int auth_db_final(DBKey k,void *d,va_list ap) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 終了
|
* 終了
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_final_chrif(void)
|
int do_final_chrif(void)
|
||||||
{
|
{
|
||||||
if (char_fd > 0)
|
if (char_fd > 0)
|
||||||
@ -1588,8 +1570,7 @@ int do_final_chrif(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_chrif(void)
|
int do_init_chrif(void)
|
||||||
{
|
{
|
||||||
add_timer_func_list(check_connect_char_server, "check_connect_char_server");
|
add_timer_func_list(check_connect_char_server, "check_connect_char_server");
|
||||||
|
1438
src/map/clif.c
1438
src/map/clif.c
File diff suppressed because it is too large
Load Diff
@ -86,8 +86,7 @@ int guild_checkskill(struct guild *g,int id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* guild_skill_tree.txt reading - from jA [Komurka]
|
* guild_skill_tree.txt reading - from jA [Komurka]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int guild_read_guildskill_tree_db(void)
|
int guild_read_guildskill_tree_db(void)
|
||||||
{
|
{
|
||||||
int i,k,id=0,ln=0;
|
int i,k,id=0,ln=0;
|
||||||
@ -131,8 +130,7 @@ int guild_read_guildskill_tree_db(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Guild skill check - from jA [Komurka]
|
* Guild skill check - from jA [Komurka]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int guild_check_skill_require(struct guild *g,int id)
|
int guild_check_skill_require(struct guild *g,int id)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -1118,7 +1116,8 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_expcache(DBKey key, va_list args) {
|
static void* create_expcache(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct guild_expcache *c;
|
struct guild_expcache *c;
|
||||||
struct map_session_data *sd = va_arg(args, struct map_session_data*);
|
struct map_session_data *sd = va_arg(args, struct map_session_data*);
|
||||||
|
|
||||||
@ -1233,7 +1232,8 @@ int guild_get_alliance_count(struct guild *g,int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Blocks all guild skills which have a common delay time.
|
// Blocks all guild skills which have a common delay time.
|
||||||
void guild_block_skill(struct map_session_data *sd, int time) {
|
void guild_block_skill(struct map_session_data *sd, int time)
|
||||||
|
{
|
||||||
int skill_num[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL };
|
int skill_num[] = { GD_BATTLEORDER, GD_REGENERATION, GD_RESTORE, GD_EMERGENCYCALL };
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
|
@ -45,7 +45,8 @@ extern int char_fd; // inter server
|
|||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
// inter serverへの送信
|
// inter serverへの送信
|
||||||
|
|
||||||
int CheckForCharServer(void) {
|
int CheckForCharServer(void)
|
||||||
|
{
|
||||||
return ((char_fd <= 0) || session[char_fd] == NULL || session[char_fd]->wdata == NULL);
|
return ((char_fd <= 0) || session[char_fd] == NULL || session[char_fd]->wdata == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +177,8 @@ int intif_announce(const char* mes,int len, unsigned long color, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The transmission of Wisp/Page to inter-server (player not found on this server)
|
// The transmission of Wisp/Page to inter-server (player not found on this server)
|
||||||
int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len) {
|
int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len)
|
||||||
|
{
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
if (CheckForCharServer())
|
if (CheckForCharServer())
|
||||||
return 0;
|
return 0;
|
||||||
@ -202,7 +204,8 @@ int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int me
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The reply of Wisp/page
|
// The reply of Wisp/page
|
||||||
int intif_wis_replay(int id, int flag) {
|
int intif_wis_replay(int id, int flag)
|
||||||
|
{
|
||||||
if (CheckForCharServer())
|
if (CheckForCharServer())
|
||||||
return 0;
|
return 0;
|
||||||
WFIFOHEAD(inter_fd,7);
|
WFIFOHEAD(inter_fd,7);
|
||||||
@ -218,7 +221,8 @@ int intif_wis_replay(int id, int flag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The transmission of GM only Wisp/Page from server to inter-server
|
// The transmission of GM only Wisp/Page from server to inter-server
|
||||||
int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes) {
|
int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes)
|
||||||
|
{
|
||||||
int mes_len;
|
int mes_len;
|
||||||
if (CheckForCharServer())
|
if (CheckForCharServer())
|
||||||
return 0;
|
return 0;
|
||||||
@ -237,7 +241,8 @@ int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int intif_regtostr(char* str, struct global_reg *reg, int qty) {
|
int intif_regtostr(char* str, struct global_reg *reg, int qty)
|
||||||
|
{
|
||||||
int len =0, i;
|
int len =0, i;
|
||||||
|
|
||||||
for (i = 0; i < qty; i++) {
|
for (i = 0; i < qty; i++) {
|
||||||
@ -837,8 +842,9 @@ int intif_homunculus_requestdelete(int homun_id)
|
|||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
// Packets receive from inter server
|
// Packets receive from inter server
|
||||||
|
|
||||||
// Wisp/Page reception
|
// Wisp/Page reception // rewritten by [Yor]
|
||||||
int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
|
int intif_parse_WisMessage(int fd)
|
||||||
|
{
|
||||||
struct map_session_data* sd;
|
struct map_session_data* sd;
|
||||||
char *wisp_source;
|
char *wisp_source;
|
||||||
char name[NAME_LENGTH];
|
char name[NAME_LENGTH];
|
||||||
@ -876,7 +882,8 @@ int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wisp/page transmission result reception
|
// Wisp/page transmission result reception
|
||||||
int intif_parse_WisEnd(int fd) {
|
int intif_parse_WisEnd(int fd)
|
||||||
|
{
|
||||||
struct map_session_data* sd;
|
struct map_session_data* sd;
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
|
|
||||||
@ -889,7 +896,8 @@ int intif_parse_WisEnd(int fd) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
|
static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
|
||||||
|
{
|
||||||
int min_gm_level = va_arg(va, int);
|
int min_gm_level = va_arg(va, int);
|
||||||
char *wisp_name;
|
char *wisp_name;
|
||||||
char *message;
|
char *message;
|
||||||
@ -903,7 +911,9 @@ static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Received wisp message from map-server via char-server for ALL gm
|
// Received wisp message from map-server via char-server for ALL gm
|
||||||
int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
|
// 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
|
||||||
|
int mapif_parse_WisToGM(int fd)
|
||||||
|
{
|
||||||
int min_gm_level, mes_len;
|
int min_gm_level, mes_len;
|
||||||
char Wisp_name[NAME_LENGTH];
|
char Wisp_name[NAME_LENGTH];
|
||||||
char mbuf[255];
|
char mbuf[255];
|
||||||
@ -927,7 +937,8 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B
|
|||||||
}
|
}
|
||||||
|
|
||||||
// アカウント変数通知
|
// アカウント変数通知
|
||||||
int intif_parse_Registers(int fd) {
|
int intif_parse_Registers(int fd)
|
||||||
|
{
|
||||||
int j,p,len,max, flag;
|
int j,p,len,max, flag;
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
struct global_reg *reg;
|
struct global_reg *reg;
|
||||||
@ -979,7 +990,8 @@ int intif_parse_Registers(int fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 倉庫データ受信
|
// 倉庫データ受信
|
||||||
int intif_parse_LoadStorage(int fd) {
|
int intif_parse_LoadStorage(int fd)
|
||||||
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
|
@ -366,7 +366,8 @@ void do_init_irc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//NAMES Packet(353) parser [Zido]
|
//NAMES Packet(353) parser [Zido]
|
||||||
int parse_names_packet(char *str) {
|
int parse_names_packet(char *str)
|
||||||
|
{
|
||||||
char *tok;
|
char *tok;
|
||||||
char source[256];
|
char source[256];
|
||||||
char numeric[10];
|
char numeric[10];
|
||||||
@ -395,7 +396,8 @@ int parse_names_packet(char *str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//User access level prefix parser [Zido]
|
//User access level prefix parser [Zido]
|
||||||
int parse_names(char *str) {
|
int parse_names(char *str)
|
||||||
|
{
|
||||||
char *tok;
|
char *tok;
|
||||||
if (str == NULL) return 0; //Nothing to parse!
|
if (str == NULL) return 0; //Nothing to parse!
|
||||||
tok=strtok(str," ");
|
tok=strtok(str," ");
|
||||||
@ -447,7 +449,8 @@ int parse_names(char *str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Store user's access level [Zido]
|
//Store user's access level [Zido]
|
||||||
int set_access(char *nick,int newlevel) {
|
int set_access(char *nick,int newlevel)
|
||||||
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
||||||
@ -465,7 +468,8 @@ int set_access(char *nick,int newlevel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Returns users access level [Zido]
|
//Returns users access level [Zido]
|
||||||
int get_access(char *nick) {
|
int get_access(char *nick)
|
||||||
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
||||||
@ -477,7 +481,8 @@ int get_access(char *nick) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int irc_rmnames() {
|
int irc_rmnames()
|
||||||
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
for(i=0;i<=MAX_CHANNEL_USERS;i++) {
|
||||||
@ -491,7 +496,8 @@ int irc_rmnames() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int irc_read_conf(char *file) {
|
int irc_read_conf(char *file)
|
||||||
|
{
|
||||||
FILE *fp=NULL;
|
FILE *fp=NULL;
|
||||||
char w1[256];
|
char w1[256];
|
||||||
char w2[256];
|
char w2[256];
|
||||||
|
@ -23,8 +23,7 @@ struct item_data dummy_item; //This is the default dummy item used for non-exist
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 名前で検索用
|
* 名前で検索用
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
// name = item alias, so we should find items aliases first. if not found then look for "jname" (full name)
|
// name = item alias, so we should find items aliases first. if not found then look for "jname" (full name)
|
||||||
int itemdb_searchname_sub(DBKey key,void *data,va_list ap)
|
int itemdb_searchname_sub(DBKey key,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
@ -49,8 +48,7 @@ int itemdb_searchname_sub(DBKey key,void *data,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 名前で検索
|
* 名前で検索
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct item_data* itemdb_searchname(const char *str)
|
struct item_data* itemdb_searchname(const char *str)
|
||||||
{
|
{
|
||||||
struct item_data *item=NULL, *item2=NULL;
|
struct item_data *item=NULL, *item2=NULL;
|
||||||
@ -75,8 +73,7 @@ static int itemdb_searchname_array_sub(DBKey key,void * data,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Founds up to N matches. Returns number of matches [Skotlex]
|
* Founds up to N matches. Returns number of matches [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_searchname_array(struct item_data** data, int size, const char *str)
|
int itemdb_searchname_array(struct item_data** data, int size, const char *str)
|
||||||
{
|
{
|
||||||
return item_db->getall(item_db,(void**)data,size,itemdb_searchname_array_sub,str);
|
return item_db->getall(item_db,(void**)data,size,itemdb_searchname_array_sub,str);
|
||||||
@ -85,8 +82,7 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 箱系アイテム検索
|
* 箱系アイテム検索
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_searchrandomid(int group)
|
int itemdb_searchrandomid(int group)
|
||||||
{
|
{
|
||||||
if(group<1 || group>=MAX_ITEMGROUP) {
|
if(group<1 || group>=MAX_ITEMGROUP) {
|
||||||
@ -124,8 +120,7 @@ int itemdb_group_bonus(const int itemgrouphealrate[MAX_ITEMGROUP], int itemid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* DBの存在確認
|
* DBの存在確認
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct item_data* itemdb_exists(int nameid)
|
struct item_data* itemdb_exists(int nameid)
|
||||||
{
|
{
|
||||||
struct item_data* id;
|
struct item_data* id;
|
||||||
@ -140,8 +135,7 @@ struct item_data* itemdb_exists(int nameid)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Converts the jobid from the format in itemdb
|
* Converts the jobid from the format in itemdb
|
||||||
* to the format used by the map server. [Skotlex]
|
* to the format used by the map server. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask)
|
static void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -199,7 +193,8 @@ static void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask)
|
|||||||
bclass[0] |= 1<<MAPID_NINJA;
|
bclass[0] |= 1<<MAPID_NINJA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_dummy_data(void) {
|
static void create_dummy_data(void)
|
||||||
|
{
|
||||||
memset(&dummy_item, 0, sizeof(struct item_data));
|
memset(&dummy_item, 0, sizeof(struct item_data));
|
||||||
dummy_item.nameid=500;
|
dummy_item.nameid=500;
|
||||||
dummy_item.weight=1;
|
dummy_item.weight=1;
|
||||||
@ -210,7 +205,8 @@ static void create_dummy_data(void) {
|
|||||||
dummy_item.view_id = UNKNOWN_ITEM_ID;
|
dummy_item.view_id = UNKNOWN_ITEM_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_item_data(DBKey key, va_list args) {
|
static void* create_item_data(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
id=(struct item_data *)aCalloc(1,sizeof(struct item_data));
|
id=(struct item_data *)aCalloc(1,sizeof(struct item_data));
|
||||||
id->nameid = key.i;
|
id->nameid = key.i;
|
||||||
@ -221,8 +217,7 @@ static void* create_item_data(DBKey key, va_list args) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Loads (and creates if not found) an item from the db.
|
* Loads (and creates if not found) an item from the db.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct item_data* itemdb_load(int nameid)
|
struct item_data* itemdb_load(int nameid)
|
||||||
{
|
{
|
||||||
struct item_data *id = idb_ensure(item_db,nameid,create_item_data);
|
struct item_data *id = idb_ensure(item_db,nameid,create_item_data);
|
||||||
@ -237,7 +232,8 @@ struct item_data* itemdb_load(int nameid)
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* return_dummy_data(DBKey key, va_list args) {
|
static void* return_dummy_data(DBKey key, va_list args)
|
||||||
|
{
|
||||||
if (battle_config.error_log)
|
if (battle_config.error_log)
|
||||||
ShowWarning("itemdb_search: Item ID %d does not exists in the item_db. Using dummy data.\n", key.i);
|
ShowWarning("itemdb_search: Item ID %d does not exists in the item_db. Using dummy data.\n", key.i);
|
||||||
dummy_item.nameid = key.i;
|
dummy_item.nameid = key.i;
|
||||||
@ -246,8 +242,7 @@ static void* return_dummy_data(DBKey key, va_list args) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Loads an item from the db. If not found, it will return the dummy item.
|
* Loads an item from the db. If not found, it will return the dummy item.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct item_data* itemdb_search(int nameid)
|
struct item_data* itemdb_search(int nameid)
|
||||||
{
|
{
|
||||||
return idb_ensure(item_db,nameid,return_dummy_data);
|
return idb_ensure(item_db,nameid,return_dummy_data);
|
||||||
@ -255,8 +250,7 @@ struct item_data* itemdb_search(int nameid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns if given item is a player-equippable piece.
|
* Returns if given item is a player-equippable piece.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isequip(int nameid)
|
int itemdb_isequip(int nameid)
|
||||||
{
|
{
|
||||||
int type=itemdb_type(nameid);
|
int type=itemdb_type(nameid);
|
||||||
@ -272,8 +266,7 @@ int itemdb_isequip(int nameid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Alternate version of itemdb_isequip
|
* Alternate version of itemdb_isequip
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isequip2(struct item_data *data)
|
int itemdb_isequip2(struct item_data *data)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, data);
|
nullpo_retr(0, data);
|
||||||
@ -288,9 +281,8 @@ int itemdb_isequip2(struct item_data *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns if given item's type is stackable.
|
* Returns if given item's type is stackable.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isstackable(int nameid)
|
int itemdb_isstackable(int nameid)
|
||||||
{
|
{
|
||||||
int type=itemdb_type(nameid);
|
int type=itemdb_type(nameid);
|
||||||
@ -306,9 +298,8 @@ int itemdb_isstackable(int nameid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Alternate version of itemdb_isstackable
|
* Alternate version of itemdb_isstackable
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isstackable2(struct item_data *data)
|
int itemdb_isstackable2(struct item_data *data)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, data);
|
nullpo_retr(0, data);
|
||||||
@ -326,8 +317,7 @@ int itemdb_isstackable2(struct item_data *data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Trade Restriction functions [Skotlex]
|
* Trade Restriction functions [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused)
|
int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused)
|
||||||
{
|
{
|
||||||
return (item && (!(item->flag.trade_restriction&1) || gmlv >= item->gm_lv_trade_override));
|
return (item && (!(item->flag.trade_restriction&1) || gmlv >= item->gm_lv_trade_override));
|
||||||
@ -384,8 +374,7 @@ int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(stru
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Specifies if item-type should drop unidentified.
|
* Specifies if item-type should drop unidentified.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int itemdb_isidentified(int nameid)
|
int itemdb_isidentified(int nameid)
|
||||||
{
|
{
|
||||||
int type=itemdb_type(nameid);
|
int type=itemdb_type(nameid);
|
||||||
@ -401,8 +390,7 @@ int itemdb_isidentified(int nameid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* アイテム使用可能フラグのオーバーライド
|
* アイテム使用可能フラグのオーバーライド
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_read_itemavail (void)
|
static int itemdb_read_itemavail (void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -520,8 +508,7 @@ static void itemdb_read_itemgroup(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 装備制限ファイル読み出し
|
* 装備制限ファイル読み出し
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_read_noequip(void)
|
static int itemdb_read_noequip(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -566,8 +553,7 @@ static int itemdb_read_noequip(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Reads item trade restrictions [Skotlex]
|
* Reads item trade restrictions [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_read_itemtrade(void)
|
static int itemdb_read_itemtrade(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -612,8 +598,7 @@ static int itemdb_read_itemtrade(void)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* Applies gender restrictions according to settings. [Skotlex]
|
* Applies gender restrictions according to settings. [Skotlex]
|
||||||
*======================================
|
*======================================*/
|
||||||
*/
|
|
||||||
static int itemdb_gendercheck(struct item_data *id)
|
static int itemdb_gendercheck(struct item_data *id)
|
||||||
{
|
{
|
||||||
if (id->nameid == WEDDING_RING_M) //Grom Ring
|
if (id->nameid == WEDDING_RING_M) //Grom Ring
|
||||||
@ -630,9 +615,8 @@ static int itemdb_gendercheck(struct item_data *id)
|
|||||||
#ifndef TXT_ONLY
|
#ifndef TXT_ONLY
|
||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* SQL
|
* SQL
|
||||||
*===================================
|
*======================================*/
|
||||||
*/
|
|
||||||
static int itemdb_read_sqldb(void)
|
static int itemdb_read_sqldb(void)
|
||||||
{
|
{
|
||||||
unsigned short nameid;
|
unsigned short nameid;
|
||||||
@ -812,8 +796,7 @@ static int itemdb_read_sqldb(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* アイテムデータベースの読み込み
|
* アイテムデータベースの読み込み
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_readdb(void)
|
static int itemdb_readdb(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -989,8 +972,7 @@ static int itemdb_readdb(void)
|
|||||||
|
|
||||||
/*====================================
|
/*====================================
|
||||||
* Removed item_value_db, don't re-add
|
* Removed item_value_db, don't re-add
|
||||||
*------------------------------------
|
*------------------------------------*/
|
||||||
*/
|
|
||||||
static void itemdb_read(void)
|
static void itemdb_read(void)
|
||||||
{
|
{
|
||||||
#ifndef TXT_ONLY
|
#ifndef TXT_ONLY
|
||||||
@ -1008,8 +990,7 @@ static void itemdb_read(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Initialize / Finalize
|
* Initialize / Finalize
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int itemdb_final_sub (DBKey key,void *data,va_list ap)
|
static int itemdb_final_sub (DBKey key,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
int flag;
|
int flag;
|
||||||
|
@ -42,7 +42,8 @@ time_t curtime;
|
|||||||
//12 - Log rare items (if their drop chance <= rare_log )
|
//12 - Log rare items (if their drop chance <= rare_log )
|
||||||
|
|
||||||
//check if this item should be logged according the settings
|
//check if this item should be logged according the settings
|
||||||
int should_log_item(int filter, int nameid, int amount) {
|
int should_log_item(int filter, int nameid, int amount)
|
||||||
|
{
|
||||||
struct item_data *item_data;
|
struct item_data *item_data;
|
||||||
if ((item_data= itemdb_exists(nameid)) == NULL) return 0;
|
if ((item_data= itemdb_exists(nameid)) == NULL) return 0;
|
||||||
if ((filter&1) || // Filter = 1, we log any item
|
if ((filter&1) || // Filter = 1, we log any item
|
||||||
|
352
src/map/map.c
352
src/map/map.c
@ -176,8 +176,7 @@ int enable_grf = 0; //To enable/disable reading maps from GRF files, bypassing m
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 全map鯖?計での接??設定
|
* 全map鯖?計での接??設定
|
||||||
* (char鯖から送られてくる)
|
* (char鯖から送られてくる)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void map_setusers(int fd)
|
void map_setusers(int fd)
|
||||||
{
|
{
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
@ -191,14 +190,15 @@ void map_setusers(int fd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 全map鯖?計での接??取得 (/wへの?答用)
|
* 全map鯖?計での接??取得 (/wへの?答用)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_getusers(void)
|
||||||
int map_getusers(void) {
|
{
|
||||||
return map_users;
|
return map_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Distance functions, taken from http://www.flipcode.com/articles/article_fastdistance.shtml
|
//Distance functions, taken from http://www.flipcode.com/articles/article_fastdistance.shtml
|
||||||
int check_distance(int dx, int dy, int distance) {
|
int check_distance(int dx, int dy, int distance)
|
||||||
|
{
|
||||||
#ifdef CIRCULAR_AREA
|
#ifdef CIRCULAR_AREA
|
||||||
//In this case, we just do a square comparison. Add 1 tile grace for diagonal range checks.
|
//In this case, we just do a square comparison. Add 1 tile grace for diagonal range checks.
|
||||||
return (dx*dx + dy*dy <= distance*distance + (dx&&dy?1:0));
|
return (dx*dx + dy*dy <= distance*distance + (dx&&dy?1:0));
|
||||||
@ -209,7 +209,8 @@ int check_distance(int dx, int dy, int distance) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int distance(int dx, int dy) {
|
unsigned int distance(int dx, int dy)
|
||||||
|
{
|
||||||
#ifdef CIRCULAR_AREA
|
#ifdef CIRCULAR_AREA
|
||||||
unsigned int min, max;
|
unsigned int min, max;
|
||||||
|
|
||||||
@ -244,8 +245,7 @@ unsigned int distance(int dx, int dy) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* blockをfreeするときfreeの?わりに呼ぶ
|
* blockをfreeするときfreeの?わりに呼ぶ
|
||||||
* ロックされているときはバッファにためる
|
* ロックされているときはバッファにためる
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_freeblock (struct block_list *bl)
|
int map_freeblock (struct block_list *bl)
|
||||||
{
|
{
|
||||||
nullpo_retr(block_free_lock, bl);
|
nullpo_retr(block_free_lock, bl);
|
||||||
@ -264,8 +264,7 @@ int map_freeblock (struct block_list *bl)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* blockのfreeを一市Iに禁止する
|
* blockのfreeを一市Iに禁止する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_freeblock_lock (void)
|
int map_freeblock_lock (void)
|
||||||
{
|
{
|
||||||
return ++block_free_lock;
|
return ++block_free_lock;
|
||||||
@ -275,8 +274,7 @@ int map_freeblock_lock (void)
|
|||||||
* blockのfreeのロックを解除する
|
* blockのfreeのロックを解除する
|
||||||
* このとき、ロックが完全になくなると
|
* このとき、ロックが完全になくなると
|
||||||
* バッファにたまっていたblockを全部削除
|
* バッファにたまっていたblockを全部削除
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_freeblock_unlock (void)
|
int map_freeblock_unlock (void)
|
||||||
{
|
{
|
||||||
if ((--block_free_lock) == 0) {
|
if ((--block_free_lock) == 0) {
|
||||||
@ -318,16 +316,14 @@ int map_freeblock_timer (int tid, unsigned int tick, int id, int data)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* map[]のblock_listから?がっている場合に
|
* map[]のblock_listから?がっている場合に
|
||||||
* bl->prevにbl_headのアドレスを入れておく
|
* bl->prevにbl_headのアドレスを入れておく
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static struct block_list bl_head;
|
static struct block_list bl_head;
|
||||||
|
|
||||||
#ifdef CELL_NOSTACK
|
#ifdef CELL_NOSTACK
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* These pair of functions update the counter of how many objects
|
* These pair of functions update the counter of how many objects
|
||||||
* lie on a tile.
|
* lie on a tile.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void map_addblcell(struct block_list *bl)
|
void map_addblcell(struct block_list *bl)
|
||||||
{
|
{
|
||||||
if(bl->m<0 || bl->x<0 || bl->x>=map[bl->m].xs
|
if(bl->m<0 || bl->x<0 || bl->x>=map[bl->m].xs
|
||||||
@ -350,8 +346,7 @@ void map_delblcell(struct block_list *bl)
|
|||||||
* Adds a block to the map.
|
* Adds a block to the map.
|
||||||
* If flag is 1, then the block was just added
|
* If flag is 1, then the block was just added
|
||||||
* otherwise it is part of a transition.
|
* otherwise it is part of a transition.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_addblock_sub (struct block_list *bl, int flag)
|
int map_addblock_sub (struct block_list *bl, int flag)
|
||||||
{
|
{
|
||||||
int m, x, y, pos;
|
int m, x, y, pos;
|
||||||
@ -410,8 +405,7 @@ int map_addblock_sub (struct block_list *bl, int flag)
|
|||||||
* Removes a block from the map.
|
* Removes a block from the map.
|
||||||
* If flag is 1, then the block is removed for good
|
* If flag is 1, then the block is removed for good
|
||||||
* otherwise it is part of a transition.
|
* otherwise it is part of a transition.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_delblock_sub (struct block_list *bl, int flag)
|
int map_delblock_sub (struct block_list *bl, int flag)
|
||||||
{
|
{
|
||||||
int b;
|
int b;
|
||||||
@ -463,9 +457,9 @@ int map_delblock_sub (struct block_list *bl, int flag)
|
|||||||
* Moves a block a x/y target position. [Skotlex]
|
* Moves a block a x/y target position. [Skotlex]
|
||||||
* Pass flag as 1 to prevent doing skill_unit_move checks
|
* Pass flag as 1 to prevent doing skill_unit_move checks
|
||||||
* (which are executed by default on BL_CHAR types)
|
* (which are executed by default on BL_CHAR types)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
|
||||||
int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
|
{
|
||||||
int x0 = bl->x, y0 = bl->y;
|
int x0 = bl->x, y0 = bl->y;
|
||||||
struct status_change *sc = NULL;
|
struct status_change *sc = NULL;
|
||||||
int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
|
int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
|
||||||
@ -523,8 +517,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 周?のPC人?を?える (unused)
|
* 周?のPC人?を?える (unused)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_countnearpc (int m, int x, int y)
|
int map_countnearpc (int m, int x, int y)
|
||||||
{
|
{
|
||||||
int bx, by, c = 0;
|
int bx, by, c = 0;
|
||||||
@ -552,9 +545,9 @@ int map_countnearpc (int m, int x, int y)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Counts specified number of objects on given cell.
|
* Counts specified number of objects on given cell.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_count_oncell(int m, int x, int y, int type)
|
||||||
int map_count_oncell(int m, int x, int y, int type) {
|
{
|
||||||
int bx,by;
|
int bx,by;
|
||||||
struct block_list *bl=NULL;
|
struct block_list *bl=NULL;
|
||||||
int i,c;
|
int i,c;
|
||||||
@ -615,10 +608,9 @@ struct skill_unit *map_find_skill_unit_oncell(struct block_list *target,int x,in
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Adapted from foreachinarea for an easier invocation. [Skotlex]
|
* Adapted from foreachinarea for an easier invocation. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_foreachinrange(int (*func)(struct block_list*,va_list),struct block_list *center, int range,int type,...)
|
||||||
|
{
|
||||||
int map_foreachinrange(int (*func)(struct block_list*,va_list),struct block_list *center, int range,int type,...) {
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int bx,by,m;
|
int bx,by,m;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
@ -690,9 +682,9 @@ int map_foreachinrange(int (*func)(struct block_list*,va_list),struct block_list
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Same as foreachinrange, but there must be a shoot-able range between center and target to be counted in. [Skotlex]
|
* Same as foreachinrange, but there must be a shoot-able range between center and target to be counted in. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_foreachinshootrange(int (*func)(struct block_list*,va_list),struct block_list *center, int range,int type,...)
|
||||||
int map_foreachinshootrange(int (*func)(struct block_list*,va_list),struct block_list *center, int range,int type,...) {
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int bx,by,m;
|
int bx,by,m;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
@ -770,9 +762,9 @@ int map_foreachinshootrange(int (*func)(struct block_list*,va_list),struct block
|
|||||||
* map m (x0,y0)-(x1,y1)?の全objに?して
|
* map m (x0,y0)-(x1,y1)?の全objに?して
|
||||||
* funcを呼ぶ
|
* funcを呼ぶ
|
||||||
* type!=0 ならその種類のみ
|
* type!=0 ならその種類のみ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_foreachinarea(int (*func)(struct block_list*,va_list),int m,int x0,int y0,int x1,int y1,int type,...)
|
||||||
int map_foreachinarea(int (*func)(struct block_list*,va_list),int m,int x0,int y0,int x1,int y1,int type,...) {
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int bx,by;
|
int bx,by;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
@ -846,9 +838,9 @@ int map_foreachinarea(int (*func)(struct block_list*,va_list),int m,int x0,int y
|
|||||||
* ?してfuncを呼ぶ
|
* ?してfuncを呼ぶ
|
||||||
*
|
*
|
||||||
* dx,dyは-1,0,1のみとする(どんな値でもいいっぽい?)
|
* dx,dyは-1,0,1のみとする(どんな値でもいいっぽい?)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_foreachinmovearea(int (*func)(struct block_list*,va_list),struct block_list *center,int range, int dx,int dy,int type,...)
|
||||||
int map_foreachinmovearea(int (*func)(struct block_list*,va_list),struct block_list *center,int range, int dx,int dy,int type,...) {
|
{
|
||||||
int bx,by,m;
|
int bx,by,m;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
struct block_list *bl=NULL;
|
struct block_list *bl=NULL;
|
||||||
@ -986,7 +978,8 @@ int map_foreachinmovearea(int (*func)(struct block_list*,va_list),struct block_l
|
|||||||
// which only checks the exact single x/y passed to it rather than an
|
// which only checks the exact single x/y passed to it rather than an
|
||||||
// area radius - may be more useful in some instances)
|
// area radius - may be more useful in some instances)
|
||||||
//
|
//
|
||||||
int map_foreachincell(int (*func)(struct block_list*,va_list),int m,int x,int y,int type,...) {
|
int map_foreachincell(int (*func)(struct block_list*,va_list),int m,int x,int y,int type,...)
|
||||||
|
{
|
||||||
int bx,by;
|
int bx,by;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
struct block_list *bl=NULL;
|
struct block_list *bl=NULL;
|
||||||
@ -1042,8 +1035,7 @@ int map_foreachincell(int (*func)(struct block_list*,va_list),int m,int x,int y,
|
|||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
* For checking a path between two points (x0, y0) and (x1, y1)
|
* For checking a path between two points (x0, y0) and (x1, y1)
|
||||||
*------------------------------------------------------------
|
*------------------------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y0,int x1,int y1,int range,int type,...)
|
int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y0,int x1,int y1,int range,int type,...)
|
||||||
{
|
{
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
@ -1224,7 +1216,8 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy of map_foreachincell, but applied to the whole map. [Skotlex]
|
// Copy of map_foreachincell, but applied to the whole map. [Skotlex]
|
||||||
int map_foreachinmap(int (*func)(struct block_list*,va_list),int m,int type,...) {
|
int map_foreachinmap(int (*func)(struct block_list*,va_list),int m,int type,...)
|
||||||
|
{
|
||||||
int b, bsize;
|
int b, bsize;
|
||||||
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
int returnCount =0; //total sum of returned values of func() [Skotlex]
|
||||||
struct block_list *bl=NULL;
|
struct block_list *bl=NULL;
|
||||||
@ -1283,9 +1276,9 @@ int map_foreachinmap(int (*func)(struct block_list*,va_list),int m,int type,...)
|
|||||||
* object[]への保存とid_db登?まで
|
* object[]への保存とid_db登?まで
|
||||||
*
|
*
|
||||||
* bl->idもこの中で設定して問題無い?
|
* bl->idもこの中で設定して問題無い?
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_addobject(struct block_list *bl)
|
||||||
int map_addobject(struct block_list *bl) {
|
{
|
||||||
int i;
|
int i;
|
||||||
if( bl == NULL ){
|
if( bl == NULL ){
|
||||||
ShowWarning("map_addobject nullpo?\n");
|
ShowWarning("map_addobject nullpo?\n");
|
||||||
@ -1310,9 +1303,9 @@ int map_addobject(struct block_list *bl) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 一三bjectの解放
|
* 一三bjectの解放
|
||||||
* map_delobjectのfreeしないバ?ジョン
|
* map_delobjectのfreeしないバ?ジョン
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_delobjectnofree(int id)
|
||||||
int map_delobjectnofree(int id) {
|
{
|
||||||
if(objects[id]==NULL)
|
if(objects[id]==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1335,9 +1328,9 @@ int map_delobjectnofree(int id) {
|
|||||||
* object dataのfree、object[]へのNULL代入
|
* object dataのfree、object[]へのNULL代入
|
||||||
*
|
*
|
||||||
* addとの??性が無いのが?になる
|
* addとの??性が無いのが?になる
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_delobject(int id)
|
||||||
int map_delobject(int id) {
|
{
|
||||||
struct block_list *obj = objects[id];
|
struct block_list *obj = objects[id];
|
||||||
|
|
||||||
if(obj==NULL)
|
if(obj==NULL)
|
||||||
@ -1352,9 +1345,9 @@ int map_delobject(int id) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 全一三bj相手にfuncを呼ぶ
|
* 全一三bj相手にfuncを呼ぶ
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...)
|
||||||
void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...) {
|
{
|
||||||
int i;
|
int i;
|
||||||
int blockcount=bl_list_count;
|
int blockcount=bl_list_count;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -1393,9 +1386,9 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...) {
|
|||||||
*
|
*
|
||||||
* 後者は、map_clearflooritem(id)へ
|
* 後者は、map_clearflooritem(id)へ
|
||||||
* map.h?で#defineしてある
|
* map.h?で#defineしてある
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data)
|
||||||
int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data) {
|
{
|
||||||
struct flooritem_data *fitem=NULL;
|
struct flooritem_data *fitem=NULL;
|
||||||
|
|
||||||
fitem = (struct flooritem_data *)objects[id];
|
fitem = (struct flooritem_data *)objects[id];
|
||||||
@ -1418,9 +1411,9 @@ int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data) {
|
|||||||
* (m,x,y) locates a random available free cell around the given coordinates
|
* (m,x,y) locates a random available free cell around the given coordinates
|
||||||
* to place an BL_ITEM object. Scan area is 9x9, returns 1 on success.
|
* to place an BL_ITEM object. Scan area is 9x9, returns 1 on success.
|
||||||
* x and y are modified with the target cell when successful.
|
* x and y are modified with the target cell when successful.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_searchrandfreecell(int m,int *x,int *y,int stack)
|
||||||
int map_searchrandfreecell(int m,int *x,int *y,int stack) {
|
{
|
||||||
int free_cell,i,j;
|
int free_cell,i,j;
|
||||||
int free_cells[9][2];
|
int free_cells[9][2];
|
||||||
|
|
||||||
@ -1464,9 +1457,9 @@ static int map_count_sub(struct block_list *bl,va_list ap)
|
|||||||
* &1 = random cell must be around given m,x,y, not around src
|
* &1 = random cell must be around given m,x,y, not around src
|
||||||
* &2 = the target should be able to walk to the target tile.
|
* &2 = the target should be able to walk to the target tile.
|
||||||
* &4 = there shouldn't be any players around the target tile (use the no_spawn_on_player setting)
|
* &4 = there shouldn't be any players around the target tile (use the no_spawn_on_player setting)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx, int ry, int flag)
|
||||||
int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx, int ry, int flag) {
|
{
|
||||||
int tries, spawn=0;
|
int tries, spawn=0;
|
||||||
int bx, by;
|
int bx, by;
|
||||||
int rx2 = 2*rx+1;
|
int rx2 = 2*rx+1;
|
||||||
@ -1534,10 +1527,10 @@ int map_search_freecell(struct block_list *src, int m, short *x,short *y, int rx
|
|||||||
*
|
*
|
||||||
* item_dataはamount以外をcopyする
|
* item_dataはamount以外をcopyする
|
||||||
* type flag: &1 MVP item. &2 do stacking check.
|
* type flag: &1 MVP item. &2 do stacking check.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,struct map_session_data *first_sd,
|
int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,struct map_session_data *first_sd,
|
||||||
struct map_session_data *second_sd,struct map_session_data *third_sd,int type) {
|
struct map_session_data *second_sd,struct map_session_data *third_sd,int type)
|
||||||
|
{
|
||||||
int r;
|
int r;
|
||||||
unsigned int tick;
|
unsigned int tick;
|
||||||
struct flooritem_data *fitem=NULL;
|
struct flooritem_data *fitem=NULL;
|
||||||
@ -1595,16 +1588,18 @@ int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,struct
|
|||||||
return fitem->bl.id;
|
return fitem->bl.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_charid2nick(DBKey key, va_list args) {
|
static void* create_charid2nick(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct charid2nick *p;
|
struct charid2nick *p;
|
||||||
p = (struct charid2nick *)aCallocA(1, sizeof (struct charid2nick));
|
p = (struct charid2nick *)aCallocA(1, sizeof (struct charid2nick));
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* charid_dbへ追加(返信待ちがあれば返信)
|
* charid_dbへ追加(返信待ちがあれば返信)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void map_addchariddb(int charid, char *name)
|
||||||
void map_addchariddb(int charid, char *name) {
|
{
|
||||||
struct charid2nick *p;
|
struct charid2nick *p;
|
||||||
int req = 0;
|
int req = 0;
|
||||||
|
|
||||||
@ -1622,9 +1617,9 @@ void map_addchariddb(int charid, char *name) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* charid_dbへ追加(返信要求のみ)
|
* charid_dbへ追加(返信要求のみ)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_reqchariddb(struct map_session_data * sd,int charid)
|
||||||
int map_reqchariddb(struct map_session_data * sd,int charid) {
|
{
|
||||||
struct charid2nick *p=NULL;
|
struct charid2nick *p=NULL;
|
||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
@ -1639,9 +1634,9 @@ int map_reqchariddb(struct map_session_data * sd,int charid) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* id_dbへblを追加
|
* id_dbへblを追加
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void map_addiddb(struct block_list *bl)
|
||||||
void map_addiddb(struct block_list *bl) {
|
{
|
||||||
nullpo_retv(bl);
|
nullpo_retv(bl);
|
||||||
|
|
||||||
if (bl->type == BL_PC)
|
if (bl->type == BL_PC)
|
||||||
@ -1651,9 +1646,9 @@ void map_addiddb(struct block_list *bl) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* id_dbからblを削除
|
* id_dbからblを削除
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void map_deliddb(struct block_list *bl)
|
||||||
void map_deliddb(struct block_list *bl) {
|
{
|
||||||
nullpo_retv(bl);
|
nullpo_retv(bl);
|
||||||
|
|
||||||
if (bl->type == BL_PC)
|
if (bl->type == BL_PC)
|
||||||
@ -1665,10 +1660,9 @@ void map_deliddb(struct block_list *bl) {
|
|||||||
* PCのquit?理 map.c?分
|
* PCのquit?理 map.c?分
|
||||||
*
|
*
|
||||||
* quit?理の主?が違うような?もしてきた
|
* quit?理の主?が違うような?もしてきた
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_quit(struct map_session_data *sd)
|
||||||
int map_quit(struct map_session_data *sd) {
|
{
|
||||||
|
|
||||||
if(!sd->state.auth) { //Removing a player that hasn't even finished loading
|
if(!sd->state.auth) { //Removing a player that hasn't even finished loading
|
||||||
TBL_PC *sd2 = map_id2sd(sd->status.account_id);
|
TBL_PC *sd2 = map_id2sd(sd->status.account_id);
|
||||||
if (sd->pd) unit_free(&sd->pd->bl,-1);
|
if (sd->pd) unit_free(&sd->pd->bl,-1);
|
||||||
@ -1733,14 +1727,16 @@ int map_quit(struct map_session_data *sd) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void map_quit_ack(struct map_session_data *sd) {
|
void map_quit_ack(struct map_session_data *sd)
|
||||||
|
{
|
||||||
if (sd && sd->state.finalsave) {
|
if (sd && sd->state.finalsave) {
|
||||||
idb_remove(pc_db,sd->status.account_id);
|
idb_remove(pc_db,sd->status.account_id);
|
||||||
aFree(sd);
|
aFree(sd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_reconnect_map_sub(DBKey key,void *data,va_list va) {
|
static int do_reconnect_map_sub(DBKey key,void *data,va_list va)
|
||||||
|
{
|
||||||
struct map_session_data *sd = (TBL_PC*)data;
|
struct map_session_data *sd = (TBL_PC*)data;
|
||||||
if (sd->state.finalsave) {
|
if (sd->state.finalsave) {
|
||||||
sd->state.finalsave = 0;
|
sd->state.finalsave = 0;
|
||||||
@ -1750,25 +1746,25 @@ static int do_reconnect_map_sub(DBKey key,void *data,va_list va) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_reconnect_map(void) {
|
void do_reconnect_map(void)
|
||||||
|
{
|
||||||
pc_db->foreach(pc_db,do_reconnect_map_sub);
|
pc_db->foreach(pc_db,do_reconnect_map_sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* id番?のPCを探す。居なければNULL
|
* id番?のPCを探す。居なければNULL
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
struct map_session_data * map_id2sd(int id)
|
||||||
struct map_session_data * map_id2sd(int id) {
|
{
|
||||||
// Now using pc_db to handle all players, should be quicker than both previous methods at a small expense of more memory. [Skotlex]
|
|
||||||
if (id <= 0) return NULL;
|
if (id <= 0) return NULL;
|
||||||
return (struct map_session_data*)idb_get(pc_db,id);
|
return (struct map_session_data*)idb_get(pc_db,id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* char_id番?の名前を探す
|
* char_id番?の名前を探す
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
char * map_charid2nick(int id)
|
||||||
char * map_charid2nick(int id) {
|
{
|
||||||
struct charid2nick *p = (struct charid2nick*)idb_get(charid_db,id);
|
struct charid2nick *p = (struct charid2nick*)idb_get(charid_db,id);
|
||||||
|
|
||||||
if(p==NULL)
|
if(p==NULL)
|
||||||
@ -1776,7 +1772,8 @@ char * map_charid2nick(int id) {
|
|||||||
return p->nick;
|
return p->nick;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct map_session_data * map_charid2sd(int id) {
|
struct map_session_data * map_charid2sd(int id)
|
||||||
|
{
|
||||||
int i, users;
|
int i, users;
|
||||||
struct map_session_data **all_sd;
|
struct map_session_data **all_sd;
|
||||||
|
|
||||||
@ -1794,9 +1791,9 @@ struct map_session_data * map_charid2sd(int id) {
|
|||||||
* Search session data from a nick name
|
* Search session data from a nick name
|
||||||
* (without sensitive case if necessary)
|
* (without sensitive case if necessary)
|
||||||
* return map_session_data pointer or NULL
|
* return map_session_data pointer or NULL
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
struct map_session_data * map_nick2sd(const char *nick)
|
||||||
struct map_session_data * map_nick2sd(const char *nick) {
|
{
|
||||||
int i, users;
|
int i, users;
|
||||||
struct map_session_data *pl_sd = NULL, **pl_allsd;
|
struct map_session_data *pl_sd = NULL, **pl_allsd;
|
||||||
|
|
||||||
@ -1835,8 +1832,7 @@ struct map_session_data * map_nick2sd(const char *nick) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* id番?の物を探す
|
* id番?の物を探す
|
||||||
* 一三bjectの場合は配列を引くのみ
|
* 一三bjectの場合は配列を引くのみ
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct block_list * map_id2bl(int id)
|
struct block_list * map_id2bl(int id)
|
||||||
{
|
{
|
||||||
struct block_list *bl=NULL;
|
struct block_list *bl=NULL;
|
||||||
@ -1861,9 +1857,9 @@ static int map_getallpc_sub(DBKey key,void * data,va_list ap)
|
|||||||
* Returns an array of all players in the server (includes non connected ones) [Skotlex]
|
* Returns an array of all players in the server (includes non connected ones) [Skotlex]
|
||||||
* The int pointer given returns the count of elements in the array.
|
* The int pointer given returns the count of elements in the array.
|
||||||
* If null is passed, it is requested that the memory be freed (for shutdown), and null is returned.
|
* If null is passed, it is requested that the memory be freed (for shutdown), and null is returned.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
struct map_session_data** map_getallusers(int *users)
|
||||||
struct map_session_data** map_getallusers(int *users) {
|
{
|
||||||
static struct map_session_data **all_sd=NULL;
|
static struct map_session_data **all_sd=NULL;
|
||||||
static unsigned int all_count = 0;
|
static unsigned int all_count = 0;
|
||||||
|
|
||||||
@ -1893,7 +1889,8 @@ struct map_session_data** map_getallusers(int *users) {
|
|||||||
return all_sd;
|
return all_sd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void map_foreachpc(int (*func)(DBKey,void*,va_list),...) {
|
void map_foreachpc(int (*func)(DBKey,void*,va_list),...)
|
||||||
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap,func);
|
va_start(ap,func);
|
||||||
pc_db->vforeach(pc_db,func,ap);
|
pc_db->vforeach(pc_db,func,ap);
|
||||||
@ -1902,9 +1899,9 @@ void map_foreachpc(int (*func)(DBKey,void*,va_list),...) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* id_db?の全てにfuncを?行
|
* id_db?の全てにfuncを?行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_foreachiddb(int (*func)(DBKey,void*,va_list),...)
|
||||||
int map_foreachiddb(int (*func)(DBKey,void*,va_list),...) {
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap,func);
|
va_start(ap,func);
|
||||||
@ -1915,9 +1912,9 @@ int map_foreachiddb(int (*func)(DBKey,void*,va_list),...) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* map.npcへ追加 (warp等の領域持ちのみ)
|
* map.npcへ追加 (warp等の領域持ちのみ)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_addnpc(int m,struct npc_data *nd)
|
||||||
int map_addnpc(int m,struct npc_data *nd) {
|
{
|
||||||
int i;
|
int i;
|
||||||
if(m<0 || m>=map_num)
|
if(m<0 || m>=map_num)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1942,7 +1939,8 @@ int map_addnpc(int m,struct npc_data *nd) {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
void map_removenpc(void) {
|
void map_removenpc(void)
|
||||||
|
{
|
||||||
int i,m,n=0;
|
int i,m,n=0;
|
||||||
|
|
||||||
for(m=0;m<map_num;m++) {
|
for(m=0;m<map_num;m++) {
|
||||||
@ -1967,9 +1965,7 @@ void map_removenpc(void) {
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
* Dynamic Mobs [Wizputer]
|
* Dynamic Mobs [Wizputer]
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
// allocates a struct when it there is place free in the cache,
|
// allocates a struct when it there is place free in the cache,
|
||||||
// and returns NULL otherwise
|
// and returns NULL otherwise
|
||||||
// -- i'll just leave the old code in case it's needed ^^;
|
// -- i'll just leave the old code in case it's needed ^^;
|
||||||
@ -2007,7 +2003,8 @@ void map_spawnmobs(int m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int mob_cache_cleanup_sub(struct block_list *bl, va_list ap) {
|
int mob_cache_cleanup_sub(struct block_list *bl, va_list ap)
|
||||||
|
{
|
||||||
struct mob_data *md = (struct mob_data *)bl;
|
struct mob_data *md = (struct mob_data *)bl;
|
||||||
nullpo_retr(0, md);
|
nullpo_retr(0, md);
|
||||||
|
|
||||||
@ -2064,9 +2061,9 @@ void map_removemobs(int m)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* map名からmap番?へ?換
|
* map名からmap番?へ?換
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_mapname2mapid(const char* name)
|
||||||
int map_mapname2mapid(const char* name) {
|
{
|
||||||
unsigned short map_index;
|
unsigned short map_index;
|
||||||
map_index = mapindex_name2id(name);
|
map_index = mapindex_name2id(name);
|
||||||
if (!map_index)
|
if (!map_index)
|
||||||
@ -2076,9 +2073,9 @@ int map_mapname2mapid(const char* name) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns the map of the given mapindex. [Skotlex]
|
* Returns the map of the given mapindex. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_mapindex2mapid(unsigned short mapindex)
|
||||||
int map_mapindex2mapid(unsigned short mapindex) {
|
{
|
||||||
struct map_data *md=NULL;
|
struct map_data *md=NULL;
|
||||||
|
|
||||||
if (!mapindex)
|
if (!mapindex)
|
||||||
@ -2107,9 +2104,9 @@ int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Checks if both dirs point in the same direction.
|
* Checks if both dirs point in the same direction.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_check_dir(int s_dir,int t_dir)
|
||||||
int map_check_dir(int s_dir,int t_dir) {
|
{
|
||||||
if(s_dir == t_dir)
|
if(s_dir == t_dir)
|
||||||
return 0;
|
return 0;
|
||||||
switch(s_dir) {
|
switch(s_dir) {
|
||||||
@ -2152,9 +2149,9 @@ int map_check_dir(int s_dir,int t_dir) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns the direction of the given cell in absolute relation to the char
|
* Returns the direction of the given cell in absolute relation to the char
|
||||||
* (regardless of where the char is facing)
|
* (regardless of where the char is facing)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_calc_dir( struct block_list *src,int x,int y)
|
||||||
int map_calc_dir( struct block_list *src,int x,int y) {
|
{
|
||||||
int dir=0;
|
int dir=0;
|
||||||
int dx,dy;
|
int dx,dy;
|
||||||
|
|
||||||
@ -2187,9 +2184,9 @@ int map_calc_dir( struct block_list *src,int x,int y) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Randomizes target cell x,y to a random walkable cell that
|
* Randomizes target cell x,y to a random walkable cell that
|
||||||
* has the same distance from object as given coordinates do. [Skotlex]
|
* has the same distance from object as given coordinates do. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_random_dir(struct block_list *bl, short *x, short *y)
|
||||||
int map_random_dir(struct block_list *bl, short *x, short *y) {
|
{
|
||||||
struct walkpath_data wpd;
|
struct walkpath_data wpd;
|
||||||
short xi = *x-bl->x;
|
short xi = *x-bl->x;
|
||||||
short yi = *y-bl->y;
|
short yi = *y-bl->y;
|
||||||
@ -2221,9 +2218,7 @@ int map_random_dir(struct block_list *bl, short *x, short *y) {
|
|||||||
// gat系
|
// gat系
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* (m,x,y)の状態を調べる
|
* (m,x,y)の状態を調べる
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int map_getcell(int m,int x,int y,cell_t cellchk)
|
int map_getcell(int m,int x,int y,cell_t cellchk)
|
||||||
{
|
{
|
||||||
return (m < 0 || m >= MAX_MAP_PER_SERVER) ? 0 : map_getcellp(&map[m],x,y,cellchk);
|
return (m < 0 || m >= MAX_MAP_PER_SERVER) ? 0 : map_getcellp(&map[m],x,y,cellchk);
|
||||||
@ -2300,8 +2295,7 @@ int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* (m,x,y)の状態を設定する
|
* (m,x,y)の状態を設定する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void map_setcell(int m,int x,int y,int cell)
|
void map_setcell(int m,int x,int y,int cell)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
@ -2354,7 +2348,8 @@ void map_setcell(int m,int x,int y,int cell)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void* create_map_data_other_server(DBKey key, va_list args) {
|
static void* create_map_data_other_server(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct map_data_other_server *mdos;
|
struct map_data_other_server *mdos;
|
||||||
unsigned short mapindex = (unsigned short)key.ui;
|
unsigned short mapindex = (unsigned short)key.ui;
|
||||||
mdos=(struct map_data_other_server *)aCalloc(1,sizeof(struct map_data_other_server));
|
mdos=(struct map_data_other_server *)aCalloc(1,sizeof(struct map_data_other_server));
|
||||||
@ -2362,10 +2357,10 @@ static void* create_map_data_other_server(DBKey key, va_list args) {
|
|||||||
memcpy(mdos->name, mapindex_id2name(mapindex), MAP_NAME_LENGTH);
|
memcpy(mdos->name, mapindex_id2name(mapindex), MAP_NAME_LENGTH);
|
||||||
return mdos;
|
return mdos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 他鯖管理のマップをdbに追加
|
* 他鯖管理のマップをdbに追加
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
|
|
||||||
int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
|
int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
|
||||||
{
|
{
|
||||||
struct map_data_other_server *mdos=NULL;
|
struct map_data_other_server *mdos=NULL;
|
||||||
@ -2386,9 +2381,9 @@ int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 他鯖管理のマップを全て削除
|
* 他鯖管理のマップを全て削除
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_eraseallipport_sub(DBKey key,void *data,va_list va)
|
||||||
int map_eraseallipport_sub(DBKey key,void *data,va_list va) {
|
{
|
||||||
struct map_data_other_server *mdos = (struct map_data_other_server*)data;
|
struct map_data_other_server *mdos = (struct map_data_other_server*)data;
|
||||||
if(mdos->gat == NULL) {
|
if(mdos->gat == NULL) {
|
||||||
db_remove(map_db,key);
|
db_remove(map_db,key);
|
||||||
@ -2397,7 +2392,8 @@ int map_eraseallipport_sub(DBKey key,void *data,va_list va) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_eraseallipport(void) {
|
int map_eraseallipport(void)
|
||||||
|
{
|
||||||
map_db->foreach(map_db,map_eraseallipport_sub);
|
map_db->foreach(map_db,map_eraseallipport_sub);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -2424,7 +2420,6 @@ int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Map cache reading
|
* Map cache reading
|
||||||
*===========================================*/
|
*===========================================*/
|
||||||
|
|
||||||
int map_readfromcache(struct map_data *m, FILE *fp)
|
int map_readfromcache(struct map_data *m, FILE *fp)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2458,7 +2453,8 @@ int map_readfromcache(struct map_data *m, FILE *fp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_addmap(char *mapname) {
|
int map_addmap(char *mapname)
|
||||||
|
{
|
||||||
if (strcmpi(mapname,"clear")==0) {
|
if (strcmpi(mapname,"clear")==0) {
|
||||||
map_num=0;
|
map_num=0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -2482,8 +2478,8 @@ static void map_delmapid(int id)
|
|||||||
map_num--;
|
map_num--;
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_delmap(char *mapname) {
|
int map_delmap(char *mapname)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (strcmpi(mapname, "all") == 0) {
|
if (strcmpi(mapname, "all") == 0) {
|
||||||
@ -2510,7 +2506,8 @@ int map_delmap(char *mapname) {
|
|||||||
* Assumed path for file is data/mapname.rsw
|
* Assumed path for file is data/mapname.rsw
|
||||||
* Credits to LittleWolf
|
* Credits to LittleWolf
|
||||||
*/
|
*/
|
||||||
int map_waterheight(char *mapname) {
|
int map_waterheight(char *mapname)
|
||||||
|
{
|
||||||
char fn[256];
|
char fn[256];
|
||||||
char *rsw, *found;
|
char *rsw, *found;
|
||||||
float whtemp;
|
float whtemp;
|
||||||
@ -2549,8 +2546,7 @@ int map_waterheight(char *mapname) {
|
|||||||
|
|
||||||
/*==================================
|
/*==================================
|
||||||
* .GAT format
|
* .GAT format
|
||||||
*----------------------------------
|
*----------------------------------*/
|
||||||
*/
|
|
||||||
int map_readgat (struct map_data *m)
|
int map_readgat (struct map_data *m)
|
||||||
{
|
{
|
||||||
char fn[256];
|
char fn[256];
|
||||||
@ -2590,8 +2586,7 @@ int map_readgat (struct map_data *m)
|
|||||||
|
|
||||||
/*======================================
|
/*======================================
|
||||||
* Initiate maps loading stage
|
* Initiate maps loading stage
|
||||||
*--------------------------------------
|
*--------------------------------------*/
|
||||||
*/
|
|
||||||
int map_readallmaps (void)
|
int map_readallmaps (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2709,8 +2704,7 @@ static int char_ip_set = 0;
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Console Command Parser [Wizputer]
|
* Console Command Parser [Wizputer]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int parse_console(char* buf)
|
int parse_console(char* buf)
|
||||||
{
|
{
|
||||||
char type[64];
|
char type[64];
|
||||||
@ -2774,9 +2768,9 @@ int parse_console(char* buf)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 設定ファイルを?み?む
|
* 設定ファイルを?み?む
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int map_config_read(char *cfgName)
|
||||||
int map_config_read(char *cfgName) {
|
{
|
||||||
char line[1024], w1[1024], w2[1024], *ptr;
|
char line[1024], w1[1024], w2[1024], *ptr;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
@ -2970,8 +2964,8 @@ int inter_config_read(char *cfgName)
|
|||||||
/*=======================================
|
/*=======================================
|
||||||
* MySQL Init
|
* MySQL Init
|
||||||
*---------------------------------------*/
|
*---------------------------------------*/
|
||||||
int map_sql_init(void){
|
int map_sql_init(void)
|
||||||
|
{
|
||||||
mysql_init(&mmysql_handle);
|
mysql_init(&mmysql_handle);
|
||||||
|
|
||||||
//DB connection start
|
//DB connection start
|
||||||
@ -3014,7 +3008,8 @@ int map_sql_init(void){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_sql_close(void){
|
int map_sql_close(void)
|
||||||
|
{
|
||||||
mysql_close(&mmysql_handle);
|
mysql_close(&mmysql_handle);
|
||||||
ShowStatus("Close Map DB Connection....\n");
|
ShowStatus("Close Map DB Connection....\n");
|
||||||
|
|
||||||
@ -3027,8 +3022,8 @@ int map_sql_close(void){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int log_sql_init(void){
|
int log_sql_init(void)
|
||||||
|
{
|
||||||
mysql_init(&logmysql_handle);
|
mysql_init(&logmysql_handle);
|
||||||
|
|
||||||
//DB connection start
|
//DB connection start
|
||||||
@ -3099,6 +3094,7 @@ int map_db_final(DBKey k,void *d,va_list ap)
|
|||||||
aFree(mdos);
|
aFree(mdos);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nick_db_final(void *k,void *d,va_list ap)
|
int nick_db_final(void *k,void *d,va_list ap)
|
||||||
{
|
{
|
||||||
char *p = (char *) d;
|
char *p = (char *) d;
|
||||||
@ -3106,7 +3102,8 @@ int nick_db_final(void *k,void *d,va_list ap)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cleanup_sub(struct block_list *bl, va_list ap) {
|
int cleanup_sub(struct block_list *bl, va_list ap)
|
||||||
|
{
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
|
|
||||||
switch(bl->type) {
|
switch(bl->type) {
|
||||||
@ -3133,11 +3130,13 @@ int cleanup_sub(struct block_list *bl, va_list ap) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cleanup_db_sub(DBKey key,void *data,va_list va) {
|
static int cleanup_db_sub(DBKey key,void *data,va_list va)
|
||||||
|
{
|
||||||
return cleanup_sub((struct block_list*)data, NULL);
|
return cleanup_sub((struct block_list*)data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cleanup_db_subpc(DBKey key,void *data,va_list va) {
|
static int cleanup_db_subpc(DBKey key,void *data,va_list va)
|
||||||
|
{
|
||||||
struct map_session_data *sd = (TBL_PC*)data;
|
struct map_session_data *sd = (TBL_PC*)data;
|
||||||
if (!sd->state.finalsave)
|
if (!sd->state.finalsave)
|
||||||
{ //Error?
|
{ //Error?
|
||||||
@ -3151,9 +3150,9 @@ static int cleanup_db_subpc(DBKey key,void *data,va_list va) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* map鯖終了・理
|
* map鯖終了・理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void do_final(void)
|
||||||
void do_final(void) {
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
struct map_session_data **pl_allsd;
|
struct map_session_data **pl_allsd;
|
||||||
|
|
||||||
@ -3241,7 +3240,8 @@ static int map_abort_sub(DBKey key,void * data,va_list ap)
|
|||||||
// Function called when the server
|
// Function called when the server
|
||||||
// has received a crash signal.
|
// has received a crash signal.
|
||||||
//------------------------------
|
//------------------------------
|
||||||
void do_abort(void) {
|
void do_abort(void)
|
||||||
|
{
|
||||||
//Save all characters and then flush the inter-connection.
|
//Save all characters and then flush the inter-connection.
|
||||||
if (!chrif_isconnect())
|
if (!chrif_isconnect())
|
||||||
{
|
{
|
||||||
@ -3256,9 +3256,9 @@ void do_abort(void) {
|
|||||||
|
|
||||||
/*======================================================
|
/*======================================================
|
||||||
* Map-Server Version Screen [MC Cameri]
|
* Map-Server Version Screen [MC Cameri]
|
||||||
*------------------------------------------------------
|
*------------------------------------------------------*/
|
||||||
*/
|
void map_helpscreen(int flag)
|
||||||
void map_helpscreen(int flag) { // by MC Cameri
|
{
|
||||||
puts("Usage: map-server [options]");
|
puts("Usage: map-server [options]");
|
||||||
puts("Options:");
|
puts("Options:");
|
||||||
puts(CL_WHITE" Commands\t\t\tDescription"CL_RESET);
|
puts(CL_WHITE" Commands\t\t\tDescription"CL_RESET);
|
||||||
@ -3282,9 +3282,9 @@ void map_helpscreen(int flag) { // by MC Cameri
|
|||||||
|
|
||||||
/*======================================================
|
/*======================================================
|
||||||
* Map-Server Version Screen [MC Cameri]
|
* Map-Server Version Screen [MC Cameri]
|
||||||
*------------------------------------------------------
|
*------------------------------------------------------*/
|
||||||
*/
|
void map_versionscreen(int flag)
|
||||||
void map_versionscreen(int flag) {
|
{
|
||||||
printf("CL_WHITE" "eAthena version %d.%02d.%02d, Athena Mod version %d" CL_RESET"\n",
|
printf("CL_WHITE" "eAthena version %d.%02d.%02d, Athena Mod version %d" CL_RESET"\n",
|
||||||
ATHENA_MAJOR_VERSION, ATHENA_MINOR_VERSION, ATHENA_REVISION,
|
ATHENA_MAJOR_VERSION, ATHENA_MINOR_VERSION, ATHENA_REVISION,
|
||||||
ATHENA_MOD_VERSION);
|
ATHENA_MOD_VERSION);
|
||||||
|
190
src/map/mob.c
190
src/map/mob.c
@ -60,8 +60,7 @@ static struct eri *item_drop_list_ers;
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Local prototype declaration (only required thing)
|
* Local prototype declaration (only required thing)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_makedummymobdb(int);
|
static int mob_makedummymobdb(int);
|
||||||
static int mob_spawn_guardian_sub(int,unsigned int,int,int);
|
static int mob_spawn_guardian_sub(int,unsigned int,int,int);
|
||||||
int mobskill_use(struct mob_data *md,unsigned int tick,int event);
|
int mobskill_use(struct mob_data *md,unsigned int tick,int event);
|
||||||
@ -69,8 +68,7 @@ int mob_skillid2skillidx(int class_,int skillid);
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Mob is searched with a name.
|
* Mob is searched with a name.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mobdb_searchname(const char *str)
|
int mobdb_searchname(const char *str)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -100,8 +98,7 @@ static int mobdb_searchname_array_sub(struct mob_db* mob, const char *str)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Founds up to N matches. Returns number of matches [Skotlex]
|
* Founds up to N matches. Returns number of matches [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
|
int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
|
||||||
{
|
{
|
||||||
int count = 0, i;
|
int count = 0, i;
|
||||||
@ -121,8 +118,7 @@ int mobdb_searchname_array(struct mob_db** data, int size, const char *str)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Id Mob is checked.
|
* Id Mob is checked.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mobdb_checkid(const int id)
|
int mobdb_checkid(const int id)
|
||||||
{
|
{
|
||||||
if (mob_db(id) == mob_dummy)
|
if (mob_db(id) == mob_dummy)
|
||||||
@ -134,8 +130,7 @@ int mobdb_checkid(const int id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns the view data associated to this mob class.
|
* Returns the view data associated to this mob class.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct view_data * mob_get_viewdata(int class_)
|
struct view_data * mob_get_viewdata(int class_)
|
||||||
{
|
{
|
||||||
if (mob_db(class_) == mob_dummy)
|
if (mob_db(class_) == mob_dummy)
|
||||||
@ -144,9 +139,9 @@ struct view_data * mob_get_viewdata(int class_)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Cleans up mob-spawn data to make it "valid"
|
* Cleans up mob-spawn data to make it "valid"
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int mob_parse_dataset(struct spawn_data *data)
|
||||||
int mob_parse_dataset(struct spawn_data *data) {
|
{
|
||||||
int i;
|
int i;
|
||||||
//FIXME: This implementation is not stable, npc scripts will stop working once MAX_MOB_DB changes value! [Skotlex]
|
//FIXME: This implementation is not stable, npc scripts will stop working once MAX_MOB_DB changes value! [Skotlex]
|
||||||
if(data->class_ > 2*MAX_MOB_DB){ // large/tiny mobs [Valaris]
|
if(data->class_ > 2*MAX_MOB_DB){ // large/tiny mobs [Valaris]
|
||||||
@ -197,8 +192,7 @@ int mob_parse_dataset(struct spawn_data *data) {
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Generates the basic mob data using the spawn_data provided.
|
* Generates the basic mob data using the spawn_data provided.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct mob_data* mob_spawn_dataset(struct spawn_data *data)
|
struct mob_data* mob_spawn_dataset(struct spawn_data *data)
|
||||||
{
|
{
|
||||||
struct mob_data *md = aCalloc(1, sizeof(struct mob_data));
|
struct mob_data *md = aCalloc(1, sizeof(struct mob_data));
|
||||||
@ -244,10 +238,9 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data)
|
|||||||
* &4: Selected monster should not be a boss type
|
* &4: Selected monster should not be a boss type
|
||||||
* &8: Selected monster must give base exp.
|
* &8: Selected monster must give base exp.
|
||||||
* lv: Mob level to check against
|
* lv: Mob level to check against
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int mob_get_random_id(int type, int flag, int lv)
|
||||||
|
{
|
||||||
int mob_get_random_id(int type, int flag, int lv) {
|
|
||||||
struct mob_db *mob;
|
struct mob_db *mob;
|
||||||
int i=0, class_;
|
int i=0, class_;
|
||||||
if(type < 0 || type >= MAX_RANDOMMONSTER) {
|
if(type < 0 || type >= MAX_RANDOMMONSTER) {
|
||||||
@ -308,8 +301,7 @@ struct mob_data *mob_once_spawn_sub(struct block_list *bl, int m,
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* The MOB appearance for one time (for scripts)
|
* The MOB appearance for one time (for scripts)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_once_spawn (struct map_session_data *sd, const char *mapname,
|
int mob_once_spawn (struct map_session_data *sd, const char *mapname,
|
||||||
short x, short y, const char *mobname, int class_, int amount, const char *event)
|
short x, short y, const char *mobname, int class_, int amount, const char *event)
|
||||||
{
|
{
|
||||||
@ -361,8 +353,7 @@ int mob_once_spawn (struct map_session_data *sd, const char *mapname,
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* The MOB appearance for one time (& area specification for scripts)
|
* The MOB appearance for one time (& area specification for scripts)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_once_spawn_area(struct map_session_data *sd,const char *mapname,
|
int mob_once_spawn_area(struct map_session_data *sd,const char *mapname,
|
||||||
int x0,int y0,int x1,int y1,
|
int x0,int y0,int x1,int y1,
|
||||||
const char *mobname,int class_,int amount,const char *event)
|
const char *mobname,int class_,int amount,const char *event)
|
||||||
@ -403,8 +394,7 @@ int mob_once_spawn_area(struct map_session_data *sd,const char *mapname,
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Set a Guardian's guild data [Skotlex]
|
* Set a Guardian's guild data [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_spawn_guardian_sub(int tid,unsigned int tick,int id,int data)
|
static int mob_spawn_guardian_sub(int tid,unsigned int tick,int id,int data)
|
||||||
{ //Needed because the guild_data may not be available at guardian spawn time.
|
{ //Needed because the guild_data may not be available at guardian spawn time.
|
||||||
struct block_list* bl = map_id2bl(id);
|
struct block_list* bl = map_id2bl(id);
|
||||||
@ -456,8 +446,7 @@ static int mob_spawn_guardian_sub(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Summoning Guardians [Valaris]
|
* Summoning Guardians [Valaris]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobname, int class_, const char* event, int guardian)
|
int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobname, int class_, const char* event, int guardian)
|
||||||
{
|
{
|
||||||
struct mob_data *md=NULL;
|
struct mob_data *md=NULL;
|
||||||
@ -548,8 +537,7 @@ int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobnam
|
|||||||
* - MSS_LOOT: Looking for item, path must be easy.
|
* - MSS_LOOT: Looking for item, path must be easy.
|
||||||
* - MSS_RUSH: Chasing attacking player, path is complex
|
* - MSS_RUSH: Chasing attacking player, path is complex
|
||||||
* - MSS_FOLLOW: Initiative/support seek, path is complex
|
* - MSS_FOLLOW: Initiative/support seek, path is complex
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state)
|
int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state)
|
||||||
{
|
{
|
||||||
int easy = 0;
|
int easy = 0;
|
||||||
@ -571,8 +559,7 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Links nearby mobs (supportive mobs)
|
* Links nearby mobs (supportive mobs)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_linksearch(struct block_list *bl,va_list ap)
|
int mob_linksearch(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -603,8 +590,7 @@ int mob_linksearch(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* mob spawn with delay (timer function)
|
* mob spawn with delay (timer function)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_delayspawn(int tid, unsigned int tick, int m, int n)
|
static int mob_delayspawn(int tid, unsigned int tick, int m, int n)
|
||||||
{
|
{
|
||||||
struct block_list *bl = map_id2bl(m);
|
struct block_list *bl = map_id2bl(m);
|
||||||
@ -615,8 +601,7 @@ static int mob_delayspawn(int tid, unsigned int tick, int m, int n)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* spawn timing calculation
|
* spawn timing calculation
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_setdelayspawn(struct mob_data *md)
|
int mob_setdelayspawn(struct mob_data *md)
|
||||||
{
|
{
|
||||||
unsigned int spawntime, spawntime1, spawntime2, spawntime3;
|
unsigned int spawntime, spawntime1, spawntime2, spawntime3;
|
||||||
@ -647,8 +632,7 @@ static int mob_count_sub(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Mob spawning. Initialization is also variously here.
|
* Mob spawning. Initialization is also variously here.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_spawn (struct mob_data *md)
|
int mob_spawn (struct mob_data *md)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
@ -723,8 +707,7 @@ int mob_spawn (struct mob_data *md)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Determines if the mob can change target. [Skotlex]
|
* Determines if the mob can change target. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_can_changetarget(struct mob_data* md, struct block_list* target, int mode)
|
static int mob_can_changetarget(struct mob_data* md, struct block_list* target, int mode)
|
||||||
{
|
{
|
||||||
// if the monster was provoked ignore the above rule [celest]
|
// if the monster was provoked ignore the above rule [celest]
|
||||||
@ -756,8 +739,7 @@ static int mob_can_changetarget(struct mob_data* md, struct block_list* target,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Determination for an attack of a monster
|
* Determination for an attack of a monster
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_target(struct mob_data *md,struct block_list *bl,int dist)
|
int mob_target(struct mob_data *md,struct block_list *bl,int dist)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, md);
|
nullpo_retr(0, md);
|
||||||
@ -781,8 +763,7 @@ int mob_target(struct mob_data *md,struct block_list *bl,int dist)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* The ?? routine of an active monster
|
* The ?? routine of an active monster
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
|
static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -834,8 +815,7 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* chase target-change routine.
|
* chase target-change routine.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_hard_changechase(struct block_list *bl,va_list ap)
|
static int mob_ai_sub_hard_changechase(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -864,8 +844,7 @@ static int mob_ai_sub_hard_changechase(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* loot monster item search
|
* loot monster item search
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
|
static int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data* md;
|
struct mob_data* md;
|
||||||
@ -905,8 +884,7 @@ static int mob_ai_sub_hard_warpsearch(struct block_list *bl,va_list ap)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Processing of slave monsters
|
* Processing of slave monsters
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
|
static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
|
||||||
{
|
{
|
||||||
struct block_list *bl;
|
struct block_list *bl;
|
||||||
@ -992,8 +970,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
|
|||||||
* This also triggers idle skill/movement since the AI can get stuck
|
* This also triggers idle skill/movement since the AI can get stuck
|
||||||
* when trying to pick new targets when the current chosen target is
|
* when trying to pick new targets when the current chosen target is
|
||||||
* unreachable.
|
* unreachable.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_unlocktarget(struct mob_data *md,int tick)
|
int mob_unlocktarget(struct mob_data *md,int tick)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, md);
|
nullpo_retr(0, md);
|
||||||
@ -1035,8 +1012,7 @@ int mob_unlocktarget(struct mob_data *md,int tick)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Random walk
|
* Random walk
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_randomwalk(struct mob_data *md,int tick)
|
int mob_randomwalk(struct mob_data *md,int tick)
|
||||||
{
|
{
|
||||||
const int retrycount=20;
|
const int retrycount=20;
|
||||||
@ -1089,8 +1065,7 @@ int mob_randomwalk(struct mob_data *md,int tick)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* AI of MOB whose is near a Player
|
* AI of MOB whose is near a Player
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
|
static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -1345,8 +1320,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Serious processing for mob in PC field of view (foreachclient)
|
* Serious processing for mob in PC field of view (foreachclient)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
|
static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
|
||||||
{
|
{
|
||||||
unsigned int tick;
|
unsigned int tick;
|
||||||
@ -1358,8 +1332,7 @@ static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Negligent mode MOB AI (PC is not in near)
|
* Negligent mode MOB AI (PC is not in near)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_sub_lazy(DBKey key,void * data,va_list ap)
|
static int mob_ai_sub_lazy(DBKey key,void * data,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md = (struct mob_data *)data;
|
struct mob_data *md = (struct mob_data *)data;
|
||||||
@ -1425,8 +1398,7 @@ static int mob_ai_sub_lazy(DBKey key,void * data,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Negligent processing for mob outside PC field of view (interval timer function)
|
* Negligent processing for mob outside PC field of view (interval timer function)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_lazy(int tid,unsigned int tick,int id,int data)
|
static int mob_ai_lazy(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
map_foreachiddb(mob_ai_sub_lazy,tick);
|
map_foreachiddb(mob_ai_sub_lazy,tick);
|
||||||
@ -1435,8 +1407,7 @@ static int mob_ai_lazy(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Serious processing for mob in PC field of view (interval timer function)
|
* Serious processing for mob in PC field of view (interval timer function)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
|
static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1450,8 +1421,7 @@ static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Initializes the delay drop structure for mob-dropped items.
|
* Initializes the delay drop structure for mob-dropped items.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static struct item_drop* mob_setdropitem(int nameid, int qty)
|
static struct item_drop* mob_setdropitem(int nameid, int qty)
|
||||||
{
|
{
|
||||||
struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
|
struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
|
||||||
@ -1465,8 +1435,7 @@ static struct item_drop* mob_setdropitem(int nameid, int qty)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Initializes the delay drop structure for mob-looted items.
|
* Initializes the delay drop structure for mob-looted items.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static struct item_drop* mob_setlootitem(struct item* item)
|
static struct item_drop* mob_setlootitem(struct item* item)
|
||||||
{
|
{
|
||||||
struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
|
struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
|
||||||
@ -1477,8 +1446,7 @@ static struct item_drop* mob_setlootitem(struct item* item)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* item drop with delay (timer function)
|
* item drop with delay (timer function)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
|
static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
struct item_drop_list *list;
|
struct item_drop_list *list;
|
||||||
@ -1501,9 +1469,7 @@ static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
|
|||||||
* Sets the item_drop into the item_drop_list.
|
* Sets the item_drop into the item_drop_list.
|
||||||
* Also performs logging and autoloot if enabled.
|
* Also performs logging and autoloot if enabled.
|
||||||
* rate is the drop-rate of the item, required for autoloot.
|
* rate is the drop-rate of the item, required for autoloot.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
* by [Skotlex]
|
|
||||||
*/
|
|
||||||
static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate)
|
static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate)
|
||||||
{
|
{
|
||||||
if(log_config.enable_logs&0x10)
|
if(log_config.enable_logs&0x10)
|
||||||
@ -1576,8 +1542,7 @@ int mob_convertslave(struct mob_data *md)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_deleteslave_sub(struct block_list *bl,va_list ap)
|
int mob_deleteslave_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -1595,8 +1560,7 @@ int mob_deleteslave_sub(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_deleteslave(struct mob_data *md)
|
int mob_deleteslave(struct mob_data *md)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, md);
|
nullpo_retr(0, md);
|
||||||
@ -1734,8 +1698,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Signals death of mob. type&1 -> no drops, type&2 -> no exp
|
* Signals death of mob. type&1 -> no drops, type&2 -> no exp
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
||||||
{
|
{
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
@ -2322,8 +2285,7 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Pick a random class for the mob
|
* Pick a random class for the mob
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_random_class (int *value, size_t count)
|
int mob_random_class (int *value, size_t count)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, value);
|
nullpo_retr(0, value);
|
||||||
@ -2345,8 +2307,7 @@ int mob_random_class (int *value, size_t count)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Change mob base class
|
* Change mob base class
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_class_change (struct mob_data *md, int class_)
|
int mob_class_change (struct mob_data *md, int class_)
|
||||||
{
|
{
|
||||||
unsigned int tick = gettick();
|
unsigned int tick = gettick();
|
||||||
@ -2413,8 +2374,7 @@ int mob_class_change (struct mob_data *md, int class_)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* mob回復
|
* mob回復
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void mob_heal(struct mob_data *md,unsigned int heal)
|
void mob_heal(struct mob_data *md,unsigned int heal)
|
||||||
{
|
{
|
||||||
if(md->guardian_data && md->guardian_data->number < MAX_GUARDIANS)
|
if(md->guardian_data && md->guardian_data->number < MAX_GUARDIANS)
|
||||||
@ -2427,8 +2387,7 @@ void mob_heal(struct mob_data *md,unsigned int heal)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Added by RoVeRT
|
* Added by RoVeRT
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_warpslave_sub(struct block_list *bl,va_list ap)
|
int mob_warpslave_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data *md=(struct mob_data *)bl;
|
struct mob_data *md=(struct mob_data *)bl;
|
||||||
@ -2449,8 +2408,7 @@ int mob_warpslave_sub(struct block_list *bl,va_list ap)
|
|||||||
* Added by RoVeRT
|
* Added by RoVeRT
|
||||||
* Warps slaves. Range is the area around the master that they can
|
* Warps slaves. Range is the area around the master that they can
|
||||||
* appear in randomly.
|
* appear in randomly.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_warpslave(struct block_list *bl, int range)
|
int mob_warpslave(struct block_list *bl, int range)
|
||||||
{
|
{
|
||||||
if (range < 1)
|
if (range < 1)
|
||||||
@ -2461,8 +2419,7 @@ int mob_warpslave(struct block_list *bl, int range)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 画面内の取り巻きの数計算用(foreachinarea)
|
* 画面内の取り巻きの数計算用(foreachinarea)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_countslave_sub(struct block_list *bl,va_list ap)
|
int mob_countslave_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
@ -2477,16 +2434,15 @@ int mob_countslave_sub(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 画面内の取り巻きの数計算
|
* 画面内の取り巻きの数計算
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_countslave(struct block_list *bl)
|
int mob_countslave(struct block_list *bl)
|
||||||
{
|
{
|
||||||
return map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id);
|
return map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Summons amount slaves contained in the value[5] array using round-robin. [adapted by Skotlex]
|
* Summons amount slaves contained in the value[5] array using round-robin. [adapted by Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
||||||
{
|
{
|
||||||
struct mob_data *md;
|
struct mob_data *md;
|
||||||
@ -2585,8 +2541,7 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,int skill_id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*MOBskillから該当skillidのskillidxを返す
|
*MOBskillから該当skillidのskillidxを返す
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_skillid2skillidx(int class_,int skillid)
|
int mob_skillid2skillidx(int class_,int skillid)
|
||||||
{
|
{
|
||||||
int i, max = mob_db(class_)->maxskill;
|
int i, max = mob_db(class_)->maxskill;
|
||||||
@ -2605,8 +2560,7 @@ int mob_skillid2skillidx(int class_,int skillid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Friendly Mob whose HP is decreasing by a nearby MOB is looked for.
|
* Friendly Mob whose HP is decreasing by a nearby MOB is looked for.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_getfriendhprate_sub(struct block_list *bl,va_list ap)
|
int mob_getfriendhprate_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
int min_rate, max_rate,rate;
|
int min_rate, max_rate,rate;
|
||||||
@ -2648,8 +2602,7 @@ static struct block_list *mob_getfriendhprate(struct mob_data *md,int min_rate,i
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Check hp rate of its master
|
* Check hp rate of its master
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct block_list *mob_getmasterhpltmaxrate(struct mob_data *md,int rate)
|
struct block_list *mob_getmasterhpltmaxrate(struct mob_data *md,int rate)
|
||||||
{
|
{
|
||||||
if (md && md->master_id > 0) {
|
if (md && md->master_id > 0) {
|
||||||
@ -2662,8 +2615,7 @@ struct block_list *mob_getmasterhpltmaxrate(struct mob_data *md,int rate)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* What a status state suits by nearby MOB is looked for.
|
* What a status state suits by nearby MOB is looked for.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mob_getfriendstatus_sub(struct block_list *bl,va_list ap)
|
int mob_getfriendstatus_sub(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
int cond1,cond2;
|
int cond1,cond2;
|
||||||
@ -2696,6 +2648,7 @@ int mob_getfriendstatus_sub(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mob_data *mob_getfriendstatus(struct mob_data *md,int cond1,int cond2)
|
struct mob_data *mob_getfriendstatus(struct mob_data *md,int cond1,int cond2)
|
||||||
{
|
{
|
||||||
struct mob_data *fr=NULL;
|
struct mob_data *fr=NULL;
|
||||||
@ -2709,8 +2662,7 @@ struct mob_data *mob_getfriendstatus(struct mob_data *md,int cond1,int cond2)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Skill use judging
|
* Skill use judging
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mobskill_use(struct mob_data *md, unsigned int tick, int event)
|
int mobskill_use(struct mob_data *md, unsigned int tick, int event)
|
||||||
{
|
{
|
||||||
struct mob_skill *ms;
|
struct mob_skill *ms;
|
||||||
@ -2911,8 +2863,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Skill use event processing
|
* Skill use event processing
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int mobskill_event(struct mob_data *md, struct block_list *src, unsigned int tick, int flag)
|
int mobskill_event(struct mob_data *md, struct block_list *src, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
int target_id, res = 0;
|
int target_id, res = 0;
|
||||||
@ -3176,8 +3127,7 @@ int mob_script_callback(struct mob_data *md, struct block_list *target, short ac
|
|||||||
//
|
//
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Since un-setting [ mob ] up was used, it is an initial provisional value setup.
|
* Since un-setting [ mob ] up was used, it is an initial provisional value setup.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_makedummymobdb(int class_)
|
static int mob_makedummymobdb(int class_)
|
||||||
{
|
{
|
||||||
if (mob_dummy != NULL)
|
if (mob_dummy != NULL)
|
||||||
@ -3459,8 +3409,7 @@ int mob_parse_dbrow(char** str)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* mob_db.txt reading
|
* mob_db.txt reading
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_readdb(void)
|
static int mob_readdb(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -3512,8 +3461,7 @@ static int mob_readdb(void)
|
|||||||
#ifndef TXT_ONLY
|
#ifndef TXT_ONLY
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* SQL reading
|
* SQL reading
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_read_sqldb(void)
|
static int mob_read_sqldb(void)
|
||||||
{
|
{
|
||||||
char *mob_db_name[] = { mob_db_db, mob_db2_db };
|
char *mob_db_name[] = { mob_db_db, mob_db2_db };
|
||||||
@ -3548,8 +3496,7 @@ static int mob_read_sqldb(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* MOB display graphic change data reading
|
* MOB display graphic change data reading
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_readdb_mobavail(void)
|
static int mob_readdb_mobavail(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -3620,8 +3567,7 @@ static int mob_readdb_mobavail(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Reading of random monster data
|
* Reading of random monster data
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_read_randommonster(void)
|
static int mob_read_randommonster(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -3670,8 +3616,7 @@ static int mob_read_randommonster(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* mob_skill_db.txt reading
|
* mob_skill_db.txt reading
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_readskilldb(void)
|
static int mob_readskilldb(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -3960,8 +3905,7 @@ static int mob_readskilldb(void)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* mob_race_db.txt reading
|
* mob_race_db.txt reading
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int mob_readdb_race(void)
|
static int mob_readdb_race(void)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -4035,8 +3979,7 @@ void mob_reload(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Circumference initialization of mob
|
* Circumference initialization of mob
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_mob(void)
|
int do_init_mob(void)
|
||||||
{ //Initialize the mob database
|
{ //Initialize the mob database
|
||||||
memset(mob_db_data,0,sizeof(mob_db_data)); //Clear the array
|
memset(mob_db_data,0,sizeof(mob_db_data)); //Clear the array
|
||||||
@ -4072,8 +4015,7 @@ int do_init_mob(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Clean memory usage.
|
* Clean memory usage.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_final_mob(void)
|
int do_final_mob(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
136
src/map/npc.c
136
src/map/npc.c
@ -82,8 +82,7 @@ struct view_data* npc_get_viewdata(int class_)
|
|||||||
* NPCの無効化/有効化
|
* NPCの無効化/有効化
|
||||||
* npc_enable
|
* npc_enable
|
||||||
* npc_enable_sub 有効時にOnTouchイベントを実行
|
* npc_enable_sub 有効時にOnTouchイベントを実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_enable_sub( struct block_list *bl, va_list ap )
|
int npc_enable_sub( struct block_list *bl, va_list ap )
|
||||||
{
|
{
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
@ -141,8 +140,7 @@ int npc_enable(const char *name,int flag)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* NPCを名前で探す
|
* NPCを名前で探す
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct npc_data* npc_name2id(const char *name)
|
struct npc_data* npc_name2id(const char *name)
|
||||||
{
|
{
|
||||||
return (struct npc_data *) strdb_get(npcname_db,(unsigned char*)name);
|
return (struct npc_data *) strdb_get(npcname_db,(unsigned char*)name);
|
||||||
@ -150,8 +148,7 @@ struct npc_data* npc_name2id(const char *name)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* イベントキューのイベント処理
|
* イベントキューのイベント処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_dequeue(struct map_session_data *sd)
|
int npc_event_dequeue(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
@ -187,8 +184,7 @@ int npc_event_dequeue(struct map_session_data *sd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* イベントの遅延実行
|
* イベントの遅延実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_timer(int tid,unsigned int tick,int id,int data)
|
int npc_event_timer(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
unsigned char *eventname = (unsigned char *)data;
|
unsigned char *eventname = (unsigned char *)data;
|
||||||
@ -278,11 +274,11 @@ int npc_timer(int tid,unsigned int tick,int id,int data) // Added by RoVeRT
|
|||||||
aFree((void*)data);
|
aFree((void*)data);
|
||||||
return 0;
|
return 0;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* イベント用ラベルのエクスポート
|
* イベント用ラベルのエクスポート
|
||||||
* npc_parse_script->strdb_foreachから呼ばれる
|
* npc_parse_script->strdb_foreachから呼ばれる
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_export(char *lname,void *data,va_list ap)
|
int npc_event_export(char *lname,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
int pos=(int)data;
|
int pos=(int)data;
|
||||||
@ -315,8 +311,7 @@ int npc_event_export(char *lname,void *data,va_list ap)
|
|||||||
int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned char *); //[Lance]
|
int npc_event_sub(struct map_session_data *, struct event_data *, const unsigned char *); //[Lance]
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 全てのNPCのOn*イベント実行
|
* 全てのNPCのOn*イベント実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_doall_sub(DBKey key,void *data,va_list ap)
|
int npc_event_doall_sub(DBKey key,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
const char*p = key.str;
|
const char*p = key.str;
|
||||||
@ -393,8 +388,7 @@ int npc_event_do(const unsigned char *name)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 時計イベント実行
|
* 時計イベント実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_do_clock(int tid,unsigned int tick,int id,int data)
|
int npc_event_do_clock(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
time_t timer;
|
time_t timer;
|
||||||
@ -437,8 +431,7 @@ int npc_event_do_clock(int tid,unsigned int tick,int id,int data)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* OnInitイベント実行(&時計イベント開始)
|
* OnInitイベント実行(&時計イベント開始)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event_do_oninit(void)
|
int npc_event_do_oninit(void)
|
||||||
{
|
{
|
||||||
// int c = npc_event_doall("OnInit");
|
// int c = npc_event_doall("OnInit");
|
||||||
@ -452,8 +445,7 @@ int npc_event_do_oninit(void)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* OnTimer NPC event - by RoVeRT
|
* OnTimer NPC event - by RoVeRT
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_addeventtimer(struct npc_data *nd,int tick,const char *name)
|
int npc_addeventtimer(struct npc_data *nd,int tick,const char *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -542,8 +534,7 @@ int npc_do_ontimer(int npc_id, int option)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマーイベント用ラベルの取り込み
|
* タイマーイベント用ラベルの取り込み
|
||||||
* npc_parse_script->strdb_foreachから呼ばれる
|
* npc_parse_script->strdb_foreachから呼ばれる
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_timerevent_import(char *lname,void *data,va_list ap)
|
int npc_timerevent_import(char *lname,void *data,va_list ap)
|
||||||
{
|
{
|
||||||
int pos=(int)data;
|
int pos=(int)data;
|
||||||
@ -582,8 +573,7 @@ struct timer_event_data {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマーイベント実行
|
* タイマーイベント実行
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_timerevent(int tid,unsigned int tick,int id,int data)
|
int npc_timerevent(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
int next,t,old_rid,old_timer;
|
int next,t,old_rid,old_timer;
|
||||||
@ -643,8 +633,7 @@ int npc_timerevent(int tid,unsigned int tick,int id,int data)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマーイベント開始
|
* タイマーイベント開始
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_timerevent_start(struct npc_data *nd, int rid)
|
int npc_timerevent_start(struct npc_data *nd, int rid)
|
||||||
{
|
{
|
||||||
int j,n, next;
|
int j,n, next;
|
||||||
@ -700,8 +689,7 @@ int npc_timerevent_start(struct npc_data *nd, int rid)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマーイベント終了
|
* タイマーイベント終了
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_timerevent_stop(struct npc_data *nd)
|
int npc_timerevent_stop(struct npc_data *nd)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd =NULL;
|
struct map_session_data *sd =NULL;
|
||||||
@ -733,9 +721,9 @@ int npc_timerevent_stop(struct npc_data *nd)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Aborts a running npc timer that is attached to a player.
|
* Aborts a running npc timer that is attached to a player.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void npc_timerevent_quit(struct map_session_data *sd)
|
||||||
void npc_timerevent_quit(struct map_session_data *sd) {
|
{
|
||||||
struct TimerData *td;
|
struct TimerData *td;
|
||||||
struct npc_data* nd;
|
struct npc_data* nd;
|
||||||
struct timer_event_data *ted;
|
struct timer_event_data *ted;
|
||||||
@ -787,8 +775,7 @@ void npc_timerevent_quit(struct map_session_data *sd) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマー値の所得
|
* タイマー値の所得
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_gettimerevent_tick(struct npc_data *nd)
|
int npc_gettimerevent_tick(struct npc_data *nd)
|
||||||
{
|
{
|
||||||
int tick;
|
int tick;
|
||||||
@ -801,8 +788,7 @@ int npc_gettimerevent_tick(struct npc_data *nd)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* タイマー値の設定
|
* タイマー値の設定
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_settimerevent_tick(struct npc_data *nd,int newtimer)
|
int npc_settimerevent_tick(struct npc_data *nd,int newtimer)
|
||||||
{
|
{
|
||||||
int flag;
|
int flag;
|
||||||
@ -829,8 +815,8 @@ int npc_settimerevent_tick(struct npc_data *nd,int newtimer)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int npc_event_sub(struct map_session_data *sd, struct event_data *ev, const unsigned char *eventname){
|
int npc_event_sub(struct map_session_data *sd, struct event_data *ev, const unsigned char *eventname)
|
||||||
|
{
|
||||||
if ( sd->npc_id!=0) {
|
if ( sd->npc_id!=0) {
|
||||||
//Enqueue the event trigger.
|
//Enqueue the event trigger.
|
||||||
int i;
|
int i;
|
||||||
@ -854,8 +840,7 @@ int npc_event_sub(struct map_session_data *sd, struct event_data *ev, const unsi
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* イベント型のNPC処理
|
* イベント型のNPC処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_event (struct map_session_data *sd, const unsigned char *eventname, int mob_kill)
|
int npc_event (struct map_session_data *sd, const unsigned char *eventname, int mob_kill)
|
||||||
{
|
{
|
||||||
struct event_data *ev=strdb_get(ev_db,(unsigned char*)eventname);
|
struct event_data *ev=strdb_get(ev_db,(unsigned char*)eventname);
|
||||||
@ -932,8 +917,7 @@ int npc_command(struct map_session_data* sd, const char* npcname, const char* co
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 接触型のNPC処理
|
* 接触型のNPC処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_touch_areanpc(struct map_session_data *sd,int m,int x,int y)
|
int npc_touch_areanpc(struct map_session_data *sd,int m,int x,int y)
|
||||||
{
|
{
|
||||||
int i,f=1;
|
int i,f=1;
|
||||||
@ -1098,8 +1082,7 @@ int npc_check_areanpc(int flag,int m,int x,int y,int range)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 近くかどうかの判定
|
* 近くかどうかの判定
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_checknear2(struct map_session_data *sd,struct block_list *bl)
|
int npc_checknear2(struct map_session_data *sd,struct block_list *bl)
|
||||||
{
|
{
|
||||||
nullpo_retr(1, sd);
|
nullpo_retr(1, sd);
|
||||||
@ -1144,8 +1127,7 @@ TBL_NPC *npc_checknear(struct map_session_data *sd,struct block_list *bl)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* NPCのオープンチャット発言
|
* NPCのオープンチャット発言
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_globalmessage(const char *name,const char *mes)
|
int npc_globalmessage(const char *name,const char *mes)
|
||||||
{
|
{
|
||||||
struct npc_data *nd=(struct npc_data *) strdb_get(npcname_db,(unsigned char*)name);
|
struct npc_data *nd=(struct npc_data *) strdb_get(npcname_db,(unsigned char*)name);
|
||||||
@ -1162,8 +1144,7 @@ int npc_globalmessage(const char *name,const char *mes)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* クリック時のNPC処理
|
* クリック時のNPC処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_click(struct map_session_data *sd,struct npc_data *nd)
|
int npc_click(struct map_session_data *sd,struct npc_data *nd)
|
||||||
{
|
{
|
||||||
nullpo_retr(1, sd);
|
nullpo_retr(1, sd);
|
||||||
@ -1195,8 +1176,7 @@ int npc_click(struct map_session_data *sd,struct npc_data *nd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_scriptcont(struct map_session_data *sd,int id)
|
int npc_scriptcont(struct map_session_data *sd,int id)
|
||||||
{
|
{
|
||||||
nullpo_retr(1, sd);
|
nullpo_retr(1, sd);
|
||||||
@ -1223,8 +1203,7 @@ int npc_scriptcont(struct map_session_data *sd,int id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_buysellsel(struct map_session_data *sd,int id,int type)
|
int npc_buysellsel(struct map_session_data *sd,int id,int type)
|
||||||
{
|
{
|
||||||
struct npc_data *nd;
|
struct npc_data *nd;
|
||||||
@ -1254,9 +1233,7 @@ int npc_buysellsel(struct map_session_data *sd,int id,int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//npc_buylist for script-controlled shops.
|
//npc_buylist for script-controlled shops.
|
||||||
static int npc_buylist_sub(
|
static int npc_buylist_sub(struct map_session_data *sd, int n, unsigned short *item_list, struct npc_data *nd)
|
||||||
struct map_session_data *sd,int n,
|
|
||||||
unsigned short *item_list, struct npc_data *nd)
|
|
||||||
{
|
{
|
||||||
unsigned char npc_ev[51];
|
unsigned char npc_ev[51];
|
||||||
int i;
|
int i;
|
||||||
@ -1273,8 +1250,7 @@ static int npc_buylist_sub(
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
|
int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
|
||||||
{
|
{
|
||||||
struct npc_data *nd;
|
struct npc_data *nd;
|
||||||
@ -1371,8 +1347,7 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_selllist(struct map_session_data *sd,int n,unsigned short *item_list)
|
int npc_selllist(struct map_session_data *sd,int n,unsigned short *item_list)
|
||||||
{
|
{
|
||||||
double z;
|
double z;
|
||||||
@ -1498,7 +1473,8 @@ int npc_remove_map(struct npc_data *nd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int npc_unload_ev(DBKey key,void *data,va_list ap) {
|
static int npc_unload_ev(DBKey key,void *data,va_list ap)
|
||||||
|
{
|
||||||
struct event_data *ev=(struct event_data *)data;
|
struct event_data *ev=(struct event_data *)data;
|
||||||
unsigned char *npcname=va_arg(ap,unsigned char *);
|
unsigned char *npcname=va_arg(ap,unsigned char *);
|
||||||
|
|
||||||
@ -1654,8 +1630,7 @@ void npc_delsrcfile(const char* name)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* warp行解析
|
* warp行解析
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_parse_warp (char *w1,char *w2,char *w3,char *w4)
|
int npc_parse_warp (char *w1,char *w2,char *w3,char *w4)
|
||||||
{
|
{
|
||||||
int x, y, xs, ys, to_x, to_y, m;
|
int x, y, xs, ys, to_x, to_y, m;
|
||||||
@ -1717,8 +1692,7 @@ int npc_parse_warp (char *w1,char *w2,char *w3,char *w4)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* shop行解析
|
* shop行解析
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4)
|
static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4)
|
||||||
{
|
{
|
||||||
#define MAX_SHOPITEM 100
|
#define MAX_SHOPITEM 100
|
||||||
@ -1816,8 +1790,7 @@ static int npc_parse_shop (char *w1, char *w2, char *w3, char *w4)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* NPCのラベルデータコンバート
|
* NPCのラベルデータコンバート
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_convertlabel_db (DBKey key, void *data, va_list ap)
|
int npc_convertlabel_db (DBKey key, void *data, va_list ap)
|
||||||
{
|
{
|
||||||
const char *lname = (const char*)key.str;
|
const char *lname = (const char*)key.str;
|
||||||
@ -1861,9 +1834,9 @@ int npc_convertlabel_db (DBKey key, void *data, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* script行解析
|
* script行解析
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
static void npc_parse_script_line(unsigned char *p,int *curly_count,int line)
|
||||||
static void npc_parse_script_line(unsigned char *p,int *curly_count,int line) {
|
{
|
||||||
int i = strlen((char *)p),j;
|
int i = strlen((char *)p),j;
|
||||||
int string_flag = 0;
|
int string_flag = 0;
|
||||||
static int comment_flag = 0;
|
static int comment_flag = 0;
|
||||||
@ -2277,8 +2250,7 @@ void npc_movenpc(struct npc_data *nd, int x, int y)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* function行解析
|
* function行解析
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *first_line, FILE *fp, int *lines,const char* file)
|
static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *first_line, FILE *fp, int *lines,const char* file)
|
||||||
{
|
{
|
||||||
unsigned char *srcbuf, *p;
|
unsigned char *srcbuf, *p;
|
||||||
@ -2360,8 +2332,7 @@ static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *fir
|
|||||||
* If cached =1, it is a dynamic cached mob
|
* If cached =1, it is a dynamic cached mob
|
||||||
* index points to the index in the mob_list of the map_data cache.
|
* index points to the index in the mob_list of the map_data cache.
|
||||||
* -1 indicates that it is not stored on the map.
|
* -1 indicates that it is not stored on the map.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int npc_parse_mob2 (struct spawn_data *mob, int index)
|
int npc_parse_mob2 (struct spawn_data *mob, int index)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2511,8 +2482,7 @@ int npc_parse_mob (char *w1, char *w2, char *w3, char *w4)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* マップフラグ行の解析
|
* マップフラグ行の解析
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
|
static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
|
||||||
{
|
{
|
||||||
int m;
|
int m;
|
||||||
@ -2765,8 +2735,7 @@ static int npc_parse_mapflag (char *w1, char *w2, char *w3, char *w4)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Setting up map cells
|
* Setting up map cells
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int npc_parse_mapcell (char *w1, char *w2, char *w3, char *w4)
|
static int npc_parse_mapcell (char *w1, char *w2, char *w3, char *w4)
|
||||||
{
|
{
|
||||||
int m, cell, x, y, x0, y0, x1, y1;
|
int m, cell, x, y, x0, y0, x1, y1;
|
||||||
@ -2976,10 +2945,9 @@ void npc_read_event_script(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
static int npc_cleanup_sub (struct block_list *bl, va_list ap)
|
||||||
|
{
|
||||||
static int npc_cleanup_sub (struct block_list *bl, va_list ap) {
|
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
|
|
||||||
switch(bl->type) {
|
switch(bl->type) {
|
||||||
@ -2994,7 +2962,8 @@ static int npc_cleanup_sub (struct block_list *bl, va_list ap) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int npc_cleanup_dbsub(DBKey key,void * data,va_list ap) {
|
static int npc_cleanup_dbsub(DBKey key,void * data,va_list ap)
|
||||||
|
{
|
||||||
return npc_cleanup_sub((struct block_list*)data, 0);
|
return npc_cleanup_sub((struct block_list*)data, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3073,8 +3042,7 @@ int npc_reload (void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 終了
|
* 終了
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_final_npc(void)
|
int do_final_npc(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -3134,8 +3102,7 @@ static void npc_debug_warps(void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* npc初期化
|
* npc初期化
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_npc(void)
|
int do_init_npc(void)
|
||||||
{
|
{
|
||||||
struct npc_src_list *file;
|
struct npc_src_list *file;
|
||||||
@ -3223,7 +3190,8 @@ int do_init_npc(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// [Lance]
|
// [Lance]
|
||||||
int npc_changename(const char *name, const char *newname, short look){
|
int npc_changename(const char *name, const char *newname, short look)
|
||||||
|
{
|
||||||
struct npc_data *nd= (struct npc_data *) strdb_remove(npcname_db,(unsigned char*)name);
|
struct npc_data *nd= (struct npc_data *) strdb_remove(npcname_db,(unsigned char*)name);
|
||||||
if (nd==NULL)
|
if (nd==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -113,7 +113,8 @@ struct npc_parse {
|
|||||||
* This does NOT do the list management
|
* This does NOT do the list management
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void finalize_pcrematch_entry(struct pcrematch_entry *e) {
|
void finalize_pcrematch_entry(struct pcrematch_entry *e)
|
||||||
|
{
|
||||||
//TODO: For some odd reason this causes a already-free'd error under Windows, but not *nix! [Skotlex]
|
//TODO: For some odd reason this causes a already-free'd error under Windows, but not *nix! [Skotlex]
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if (e->pcre_) {
|
if (e->pcre_) {
|
||||||
@ -176,7 +177,8 @@ static struct pcrematch_set * lookup_pcreset(struct npc_data *nd,int setid)
|
|||||||
* if the setid does not exist, this will silently return
|
* if the setid does not exist, this will silently return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void activate_pcreset(struct npc_data *nd,int setid) {
|
static void activate_pcreset(struct npc_data *nd,int setid)
|
||||||
|
{
|
||||||
struct pcrematch_set *pcreset;
|
struct pcrematch_set *pcreset;
|
||||||
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
||||||
if (npcParse == NULL)
|
if (npcParse == NULL)
|
||||||
@ -209,7 +211,8 @@ static void activate_pcreset(struct npc_data *nd,int setid) {
|
|||||||
* if the setid does not exist, this will silently return
|
* if the setid does not exist, this will silently return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void deactivate_pcreset(struct npc_data *nd,int setid) {
|
static void deactivate_pcreset(struct npc_data *nd,int setid)
|
||||||
|
{
|
||||||
struct pcrematch_set *pcreset;
|
struct pcrematch_set *pcreset;
|
||||||
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
||||||
if (npcParse == NULL)
|
if (npcParse == NULL)
|
||||||
@ -244,7 +247,8 @@ static void deactivate_pcreset(struct npc_data *nd,int setid) {
|
|||||||
/**
|
/**
|
||||||
* delete a set of patterns.
|
* delete a set of patterns.
|
||||||
*/
|
*/
|
||||||
static void delete_pcreset(struct npc_data *nd,int setid) {
|
static void delete_pcreset(struct npc_data *nd,int setid)
|
||||||
|
{
|
||||||
int active = 1;
|
int active = 1;
|
||||||
struct pcrematch_set *pcreset;
|
struct pcrematch_set *pcreset;
|
||||||
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
|
||||||
@ -294,7 +298,8 @@ static void delete_pcreset(struct npc_data *nd,int setid) {
|
|||||||
/**
|
/**
|
||||||
* create a new pattern entry
|
* create a new pattern entry
|
||||||
*/
|
*/
|
||||||
static struct pcrematch_entry *create_pcrematch_entry(struct pcrematch_set * set) {
|
static struct pcrematch_entry *create_pcrematch_entry(struct pcrematch_set * set)
|
||||||
|
{
|
||||||
struct pcrematch_entry * e = (struct pcrematch_entry *)
|
struct pcrematch_entry * e = (struct pcrematch_entry *)
|
||||||
aCalloc(sizeof(struct pcrematch_entry), 1);
|
aCalloc(sizeof(struct pcrematch_entry), 1);
|
||||||
struct pcrematch_entry * last = set->head_;
|
struct pcrematch_entry * last = set->head_;
|
||||||
@ -476,7 +481,8 @@ int mob_chat_sub(struct block_list *bl, va_list ap){
|
|||||||
|
|
||||||
// Various script builtins used to support these functions
|
// Various script builtins used to support these functions
|
||||||
|
|
||||||
int buildin_defpattern(struct script_state *st) {
|
int buildin_defpattern(struct script_state *st)
|
||||||
|
{
|
||||||
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
||||||
const char *pattern=conv_str(st,& (st->stack->stack_data[st->start+3]));
|
const char *pattern=conv_str(st,& (st->stack->stack_data[st->start+3]));
|
||||||
const char *label=conv_str(st,& (st->stack->stack_data[st->start+4]));
|
const char *label=conv_str(st,& (st->stack->stack_data[st->start+4]));
|
||||||
@ -487,7 +493,8 @@ int buildin_defpattern(struct script_state *st) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int buildin_activatepset(struct script_state *st) {
|
int buildin_activatepset(struct script_state *st)
|
||||||
|
{
|
||||||
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
||||||
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
||||||
|
|
||||||
@ -496,7 +503,8 @@ int buildin_activatepset(struct script_state *st) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int buildin_deactivatepset(struct script_state *st) {
|
int buildin_deactivatepset(struct script_state *st)
|
||||||
|
{
|
||||||
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
||||||
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
||||||
|
|
||||||
@ -505,7 +513,8 @@ int buildin_deactivatepset(struct script_state *st) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int buildin_deletepset(struct script_state *st) {
|
int buildin_deletepset(struct script_state *st)
|
||||||
|
{
|
||||||
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
int setid=conv_num(st,& (st->stack->stack_data[st->start+2]));
|
||||||
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
struct npc_data *nd=(struct npc_data *)map_id2bl(st->oid);
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ int party_send_xy_timer(int tid,unsigned int tick,int id,int data);
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Fills the given party_member structure according to the sd provided.
|
* Fills the given party_member structure according to the sd provided.
|
||||||
* Used when creating/adding people to a party. [Skotlex]
|
* Used when creating/adding people to a party. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
static void party_fill_member(struct party_member *member, struct map_session_data *sd)
|
||||||
static void party_fill_member(struct party_member *member, struct map_session_data *sd) {
|
{
|
||||||
member->account_id = sd->status.account_id;
|
member->account_id = sd->status.account_id;
|
||||||
member->char_id = sd->status.char_id;
|
member->char_id = sd->status.char_id;
|
||||||
memcpy(member->name, sd->status.name, NAME_LENGTH);
|
memcpy(member->name, sd->status.name, NAME_LENGTH);
|
||||||
@ -45,8 +45,7 @@ static void party_fill_member(struct party_member *member, struct map_session_da
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* <EFBFBD>I—¹
|
* <EFBFBD>I—¹
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void do_final_party(void)
|
void do_final_party(void)
|
||||||
{
|
{
|
||||||
party_db->destroy(party_db,NULL);
|
party_db->destroy(party_db,NULL);
|
||||||
@ -182,7 +181,8 @@ int party_recv_noinfo(int party_id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_party(DBKey key, va_list args) {
|
static void* create_party(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct party_data *p;
|
struct party_data *p;
|
||||||
p=(struct party_data *)aCalloc(1,sizeof(struct party_data));
|
p=(struct party_data *)aCalloc(1,sizeof(struct party_data));
|
||||||
return p;
|
return p;
|
||||||
|
@ -32,8 +32,7 @@ const char walk_choices [3][3] =
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 経路探索補助heap push
|
* 経路探索補助heap push
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static void push_heap_path(int *heap,struct tmp_path *tp,int index)
|
static void push_heap_path(int *heap,struct tmp_path *tp,int index)
|
||||||
{
|
{
|
||||||
int i,h;
|
int i,h;
|
||||||
@ -50,8 +49,7 @@ static void push_heap_path(int *heap,struct tmp_path *tp,int index)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 経路探索補助heap update
|
* 経路探索補助heap update
|
||||||
* costが減ったので根の方へ移動
|
* costが減ったので根の方へ移動
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static void update_heap_path(int *heap,struct tmp_path *tp,int index)
|
static void update_heap_path(int *heap,struct tmp_path *tp,int index)
|
||||||
{
|
{
|
||||||
int i,h;
|
int i,h;
|
||||||
@ -72,8 +70,7 @@ static void update_heap_path(int *heap,struct tmp_path *tp,int index)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 経路探索補助heap pop
|
* 経路探索補助heap pop
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int pop_heap_path(int *heap,struct tmp_path *tp)
|
static int pop_heap_path(int *heap,struct tmp_path *tp)
|
||||||
{
|
{
|
||||||
int i,h,k;
|
int i,h,k;
|
||||||
@ -104,8 +101,7 @@ static int pop_heap_path(int *heap,struct tmp_path *tp)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 現在の点のcost計算
|
* 現在の点のcost計算
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int calc_cost(struct tmp_path *p,int x1,int y1)
|
static int calc_cost(struct tmp_path *p,int x1,int y1)
|
||||||
{
|
{
|
||||||
int xd,yd;
|
int xd,yd;
|
||||||
@ -119,8 +115,7 @@ static int calc_cost(struct tmp_path *p,int x1,int y1)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 必要ならpathを追加/修正する
|
* 必要ならpathを追加/修正する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int add_path(int *heap,struct tmp_path *tp,int x,int y,int dist,int before,int cost)
|
static int add_path(int *heap,struct tmp_path *tp,int x,int y,int dist,int before,int cost)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -159,8 +154,7 @@ static int add_path(int *heap,struct tmp_path *tp,int x,int y,int dist,int befor
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* (x,y)が移動不可能地帯かどうか
|
* (x,y)が移動不可能地帯かどうか
|
||||||
* flag 0x10000 遠距離攻撃判定
|
* flag 0x10000 遠距離攻撃判定
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int can_place(struct map_data *m,int x,int y,int flag)
|
static int can_place(struct map_data *m,int x,int y,int flag)
|
||||||
{
|
{
|
||||||
if(map_getcellp(m,x,y,CELL_CHKPASS))
|
if(map_getcellp(m,x,y,CELL_CHKPASS))
|
||||||
@ -177,8 +171,7 @@ static int can_place(struct map_data *m,int x,int y,int flag)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* (x0,y0)から(x1,y1)へ1歩で移動可能か計算
|
* (x0,y0)から(x1,y1)へ1歩で移動可能か計算
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int can_move(struct map_data *m,int x0,int y0,int x1,int y1,int flag)
|
static int can_move(struct map_data *m,int x0,int y0,int x1,int y1,int flag)
|
||||||
{
|
{
|
||||||
if(x1<0 || y1<0 || x1>=m->xs || y1>=m->ys)
|
if(x1<0 || y1<0 || x1>=m->xs || y1>=m->ys)
|
||||||
@ -202,8 +195,7 @@ static int can_move(struct map_data *m,int x0,int y0,int x1,int y1,int flag)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* (x0,y0)から(dx,dy)方向へcountセル分
|
* (x0,y0)から(dx,dy)方向へcountセル分
|
||||||
* 吹き飛ばしたあとの座標を所得
|
* 吹き飛ばしたあとの座標を所得
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
||||||
{
|
{
|
||||||
struct map_data *md;
|
struct map_data *md;
|
||||||
@ -243,8 +235,7 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 遠距離攻撃が可能かどうかを返す
|
* 遠距離攻撃が可能かどうかを返す
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,cell_t flag)
|
int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,cell_t flag)
|
||||||
{
|
{
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
@ -312,9 +303,7 @@ int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* path探索 (x0,y0)->(x1,y1)
|
* path探索 (x0,y0)->(x1,y1)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2)
|
int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2)
|
||||||
{
|
{
|
||||||
int heap[MAX_HEAP+1];
|
int heap[MAX_HEAP+1];
|
||||||
@ -483,12 +472,8 @@ int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
|
|
||||||
* path探索 (x0,y0)->(x1,y1)
|
* path探索 (x0,y0)->(x1,y1)
|
||||||
|
*------------------------------------------*/
|
||||||
*------------------------------------------
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef PATH_STANDALONETEST
|
#ifdef PATH_STANDALONETEST
|
||||||
char gat[64][64]={
|
char gat[64][64]={
|
||||||
@ -502,8 +487,7 @@ struct map_data map[1];
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 経路探索ルーチン単体テスト用main関数
|
* 経路探索ルーチン単体テスト用main関数
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void main(int argc,char *argv[])
|
void main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
struct walkpath_data wpd;
|
struct walkpath_data wpd;
|
||||||
|
411
src/map/pc.c
411
src/map/pc.c
File diff suppressed because it is too large
Load Diff
@ -130,8 +130,7 @@ int pet_unlocktarget(struct pet_data *pd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Pet Attack Skill [Skotlex]
|
* Pet Attack Skill [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int pet_attackskill(struct pet_data *pd, int target_id)
|
int pet_attackskill(struct pet_data *pd, int target_id)
|
||||||
{
|
{
|
||||||
struct block_list *bl;
|
struct block_list *bl;
|
||||||
@ -204,8 +203,7 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Pet SC Check [Skotlex]
|
* Pet SC Check [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int pet_sc_check(struct map_session_data *sd, int type)
|
int pet_sc_check(struct map_session_data *sd, int type)
|
||||||
{
|
{
|
||||||
struct pet_data *pd;
|
struct pet_data *pd;
|
||||||
@ -1109,8 +1107,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* pet bonus giving skills [Valaris] / Rewritten by [Skotlex]
|
* pet bonus giving skills [Valaris] / Rewritten by [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
|
int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd=map_id2sd(id);
|
struct map_session_data *sd=map_id2sd(id);
|
||||||
@ -1155,8 +1152,7 @@ int pet_skill_bonus_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* pet recovery skills [Valaris] / Rewritten by [Skotlex]
|
* pet recovery skills [Valaris] / Rewritten by [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int pet_recovery_timer(int tid,unsigned int tick,int id,int data)
|
int pet_recovery_timer(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd=map_id2sd(id);
|
struct map_session_data *sd=map_id2sd(id);
|
||||||
@ -1224,8 +1220,7 @@ int pet_heal_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* pet support skills [Skotlex]
|
* pet support skills [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
|
int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd=map_id2sd(id);
|
struct map_session_data *sd=map_id2sd(id);
|
||||||
@ -1274,8 +1269,7 @@ int pet_skill_support_timer(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*ペットデータ読み込み
|
*ペットデータ読み込み
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int read_petdb()
|
int read_petdb()
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -1370,8 +1364,7 @@ int read_petdb()
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* スキル関係初期化処理
|
* スキル関係初期化処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_pet(void)
|
int do_init_pet(void)
|
||||||
{
|
{
|
||||||
memset(pet_db,0,sizeof(pet_db));
|
memset(pet_db,0,sizeof(pet_db));
|
||||||
|
665
src/map/script.c
665
src/map/script.c
File diff suppressed because it is too large
Load Diff
232
src/map/skill.c
232
src/map/skill.c
@ -705,7 +705,8 @@ const char* skill_get_name( int id ){
|
|||||||
return skill_db[id].name;
|
return skill_db[id].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skill_tree_get_max(int id, int b_class){
|
int skill_tree_get_max(int id, int b_class)
|
||||||
|
{
|
||||||
int i, skillid;
|
int i, skillid;
|
||||||
for(i=0;(skillid=skill_tree[b_class][i].id)>0;i++)
|
for(i=0;(skillid=skill_tree[b_class][i].id)>0;i++)
|
||||||
if (id == skillid) return skill_tree[b_class][i].max;
|
if (id == skillid) return skill_tree[b_class][i].max;
|
||||||
@ -974,8 +975,7 @@ struct skill_unit_layout *skill_get_unit_layout (int skillid, int skilllv, struc
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_additional_effect (struct block_list* src, struct block_list *bl, int skillid, int skilllv, int attack_type, unsigned int tick)
|
int skill_additional_effect (struct block_list* src, struct block_list *bl, int skillid, int skilllv, int attack_type, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd=NULL, *dstsd=NULL;
|
struct map_session_data *sd=NULL, *dstsd=NULL;
|
||||||
@ -1854,9 +1854,7 @@ int skill_blown (struct block_list *src, struct block_list *target, int count)
|
|||||||
* packet shouldn't display a skill animation)
|
* packet shouldn't display a skill animation)
|
||||||
* flag&0x2000 is used to signal that the skilllv should be passed as -1 to the
|
* flag&0x2000 is used to signal that the skilllv should be passed as -1 to the
|
||||||
* client (causes player characters to not scream skill name)
|
* client (causes player characters to not scream skill name)
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int skill_attack (int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
|
int skill_attack (int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
struct Damage dmg;
|
struct Damage dmg;
|
||||||
@ -2207,8 +2205,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
|
|||||||
* T =タ?ゲット選?用(BCT_*)
|
* T =タ?ゲット選?用(BCT_*)
|
||||||
* ffff=自由に使用可能
|
* ffff=自由に使用可能
|
||||||
* 0 =予約?B0に固定
|
* 0 =予約?B0に固定
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_area_temp[8];
|
static int skill_area_temp[8];
|
||||||
static int skill_unit_temp[64]; /* For storing skill_unit ids as players move in/out of them. [Skotlex] */
|
static int skill_unit_temp[64]; /* For storing skill_unit ids as players move in/out of them. [Skotlex] */
|
||||||
static int skill_unit_index=0; //Well, yeah... am too lazy to pass pointers around :X
|
static int skill_unit_index=0; //Well, yeah... am too lazy to pass pointers around :X
|
||||||
@ -2386,8 +2383,7 @@ int skill_guildaura_sub (struct block_list *bl, va_list ap)
|
|||||||
* Flag:
|
* Flag:
|
||||||
* &1: finished casting the skill (invoke hp/sp/item consumption)
|
* &1: finished casting the skill (invoke hp/sp/item consumption)
|
||||||
* &2: picked menu entry (Warp Portal, Teleport and other menu based skills)
|
* &2: picked menu entry (Warp Portal, Teleport and other menu based skills)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_check_condition_hom (struct homun_data *hd, int skill, int lv, int type)
|
static int skill_check_condition_hom (struct homun_data *hd, int skill, int lv, int type)
|
||||||
{
|
{
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
@ -2506,9 +2502,9 @@ static int skill_check_condition_hom (struct homun_data *hd, int skill, int lv,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*=========================================================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*/
|
*------------------------------------------*/
|
||||||
int skill_area_sub_count (struct block_list *src, struct block_list *target, int skillid, int skilllv, unsigned int tick, int flag)
|
int skill_area_sub_count (struct block_list *src, struct block_list *target, int skillid, int skilllv, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
if(skill_area_temp[0] < 0xffff)
|
if(skill_area_temp[0] < 0xffff)
|
||||||
@ -2541,8 +2537,7 @@ int skill_count_water (struct block_list *src, int range)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_timerskill (int tid, unsigned int tick, int id, int data)
|
static int skill_timerskill (int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
struct block_list *src = map_id2bl(id),*target;
|
struct block_list *src = map_id2bl(id),*target;
|
||||||
@ -2634,8 +2629,7 @@ static int skill_timerskill (int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_addtimerskill (struct block_list *src, unsigned int tick, int target, int x,int y, int skill_id, int skill_lv, int type, int flag)
|
int skill_addtimerskill (struct block_list *src, unsigned int tick, int target, int x,int y, int skill_id, int skill_lv, int type, int flag)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2663,8 +2657,7 @@ int skill_addtimerskill (struct block_list *src, unsigned int tick, int target,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_cleartimerskill (struct block_list *src)
|
int skill_cleartimerskill (struct block_list *src)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2699,8 +2692,7 @@ static int skill_reveal_trap (struct block_list *bl, va_list ap)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
|
int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL, *tsd = NULL;
|
struct map_session_data *sd = NULL, *tsd = NULL;
|
||||||
@ -3301,8 +3293,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
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 *sd = NULL;
|
||||||
@ -4568,7 +4559,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
clif_skill_fail(sd,skillid,0,0); //Nothing stripped.
|
clif_skill_fail(sd,skillid,0,0); //Nothing stripped.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* PotionPitcher */
|
|
||||||
case AM_BERSERKPITCHER:
|
case AM_BERSERKPITCHER:
|
||||||
case AM_POTIONPITCHER:
|
case AM_POTIONPITCHER:
|
||||||
{
|
{
|
||||||
@ -5051,7 +5041,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// parent-baby skills
|
// parent-baby skills
|
||||||
case WE_BABY:
|
case WE_BABY:
|
||||||
if(sd){
|
if(sd){
|
||||||
struct map_session_data *f_sd = pc_get_father(sd);
|
struct map_session_data *f_sd = pc_get_father(sd);
|
||||||
@ -5623,8 +5613,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castend_id (int tid, unsigned int tick, int id, int data)
|
int skill_castend_id (int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
struct block_list *target, *src = map_id2bl(id);
|
struct block_list *target, *src = map_id2bl(id);
|
||||||
@ -5847,8 +5836,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castend_pos (int tid, unsigned int tick, int id, int data)
|
int skill_castend_pos (int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
struct block_list* src = map_id2bl(id);
|
struct block_list* src = map_id2bl(id);
|
||||||
@ -5966,8 +5954,7 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int skilllv, unsigned int tick, int flag)
|
int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int skilllv, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd=NULL;
|
struct map_session_data *sd=NULL;
|
||||||
@ -6346,8 +6333,7 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castend_map (struct map_session_data *sd, int skill_num, const char *map)
|
int skill_castend_map (struct map_session_data *sd, int skill_num, const char *map)
|
||||||
{
|
{
|
||||||
int x=0,y=0;
|
int x=0,y=0;
|
||||||
@ -6525,8 +6511,7 @@ int skill_dance_overlap(struct skill_unit *unit, int flag)
|
|||||||
* Converts this group information so that it is handled
|
* Converts this group information so that it is handled
|
||||||
* as a Dissonance or Ugly Dance cell.
|
* as a Dissonance or Ugly Dance cell.
|
||||||
* Flag: 0 - Convert, 1 - Revert, 2 - Initialize.
|
* Flag: 0 - Convert, 1 - Revert, 2 - Initialize.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
#define skill_dance_switch(unit, group, flag) (((group)->state.song_dance&0x1 && (unit)->val2&UF_ENSEMBLE)?skill_dance_switch_sub(unit, group, flag):0)
|
#define skill_dance_switch(unit, group, flag) (((group)->state.song_dance&0x1 && (unit)->val2&UF_ENSEMBLE)?skill_dance_switch_sub(unit, group, flag):0)
|
||||||
static int skill_dance_switch_sub(struct skill_unit *unit, struct skill_unit_group *group, int flag)
|
static int skill_dance_switch_sub(struct skill_unit *unit, struct skill_unit_group *group, int flag)
|
||||||
{
|
{
|
||||||
@ -6578,8 +6563,7 @@ static int skill_dance_switch_sub(struct skill_unit *unit, struct skill_unit_gro
|
|||||||
* Initializes and sets a ground skill.
|
* Initializes and sets a ground skill.
|
||||||
* flag&1 is used to determine when the skill 'morphs' (Warp portal becomes active, or Fire Pillar becomes active)
|
* flag&1 is used to determine when the skill 'morphs' (Warp portal becomes active, or Fire Pillar becomes active)
|
||||||
* flag&2 is used to determine if this skill was casted with Magic Power active.
|
* flag&2 is used to determine if this skill was casted with Magic Power active.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid, int skilllv, int x, int y, int flag)
|
struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid, int skilllv, int x, int y, int flag)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *group;
|
struct skill_unit_group *group;
|
||||||
@ -6964,8 +6948,7 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *sg;
|
struct skill_unit_group *sg;
|
||||||
@ -7106,8 +7089,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *sg;
|
struct skill_unit_group *sg;
|
||||||
@ -7518,8 +7500,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *sg;
|
struct skill_unit_group *sg;
|
||||||
@ -7566,8 +7547,7 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Triggered when a char steps out of a skill group [Skotlex]
|
* Triggered when a char steps out of a skill group [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int tick)
|
static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct status_change *sc;
|
struct status_change *sc;
|
||||||
@ -7664,8 +7644,7 @@ static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int
|
|||||||
* flag values:
|
* flag values:
|
||||||
* flag&1: Invoke onplace function (otherwise invoke onout)
|
* flag&1: Invoke onplace function (otherwise invoke onout)
|
||||||
* flag&4: Invoke a onleft call (the unit might be scheduled for deletion)
|
* flag&4: Invoke a onleft call (the unit might be scheduled for deletion)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_effect (struct block_list *bl, va_list ap)
|
int skill_unit_effect (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit;
|
struct skill_unit *unit;
|
||||||
@ -7713,8 +7692,7 @@ int skill_unit_effect (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* If flag, this is a forced delete, otherwise, it's natural expiration.
|
* If flag, this is a forced delete, otherwise, it's natural expiration.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_onlimit (struct skill_unit *src, unsigned int tick, int flag)
|
int skill_unit_onlimit (struct skill_unit *src, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *sg;
|
struct skill_unit_group *sg;
|
||||||
@ -7761,8 +7739,7 @@ int skill_unit_onlimit (struct skill_unit *src, unsigned int tick, int flag)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int damage, unsigned int tick)
|
int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int damage, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *sg;
|
struct skill_unit_group *sg;
|
||||||
@ -7786,9 +7763,7 @@ int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int dam
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
static int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
|
static int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
int *c, skillid;
|
int *c, skillid;
|
||||||
@ -7856,8 +7831,7 @@ static int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Checks and stores partners for ensemble skills [Skotlex]
|
* Checks and stores partners for ensemble skills [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_check_pc_partner (struct map_session_data *sd, int skill_id, int* skill_lv, int range, int cast_flag)
|
int skill_check_pc_partner (struct map_session_data *sd, int skill_id, int* skill_lv, int range, int cast_flag)
|
||||||
{
|
{
|
||||||
static int c=0;
|
static int c=0;
|
||||||
@ -7905,9 +7879,7 @@ int skill_check_pc_partner (struct map_session_data *sd, int skill_id, int* skil
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
static int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap)
|
static int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
int *c,src_id,mob_class,skill;
|
int *c,src_id,mob_class,skill;
|
||||||
@ -7932,8 +7904,7 @@ static int skill_check_condition_mob_master_sub (struct block_list *bl, va_list
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Determines if a given skill should be made to consume ammo
|
* Determines if a given skill should be made to consume ammo
|
||||||
* when used by the player. [Skotlex]
|
* when used by the player. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_isammotype (TBL_PC *sd, int skill)
|
int skill_isammotype (TBL_PC *sd, int skill)
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
@ -7951,8 +7922,7 @@ int skill_isammotype (TBL_PC *sd, int skill)
|
|||||||
* Flag:
|
* Flag:
|
||||||
* &1: finished casting the skill (invoke hp/sp/item consumption)
|
* &1: finished casting the skill (invoke hp/sp/item consumption)
|
||||||
* &2: picked menu entry (Warp Portal, Teleport and other menu based skills)
|
* &2: picked menu entry (Warp Portal, Teleport and other menu based skills)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_check_condition (struct map_session_data *sd, int skill, int lv, int type)
|
int skill_check_condition (struct map_session_data *sd, int skill, int lv, int type)
|
||||||
{
|
{
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
@ -8684,9 +8654,6 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
|
|||||||
if(index[i] >= 0)
|
if(index[i] >= 0)
|
||||||
pc_delitem(sd,index[i],amount[i],0);
|
pc_delitem(sd,index[i],amount[i],0);
|
||||||
}
|
}
|
||||||
// Ammo is now reduced in battle_calc_weapon_attack. [Skotlex]
|
|
||||||
// if (ammo && battle_config.arrow_decrement)
|
|
||||||
// pc_delitem(sd,sd->equip_index[10],ammo_qty,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type&2)
|
if(type&2)
|
||||||
@ -8704,8 +8671,7 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
||||||
{
|
{
|
||||||
int time = skill_get_cast(skill_id, skill_lv);
|
int time = skill_get_cast(skill_id, skill_lv);
|
||||||
@ -8736,8 +8702,7 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Does cast-time reductions based on sc data.
|
* Does cast-time reductions based on sc data.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_castfix_sc (struct block_list *bl, int time)
|
int skill_castfix_sc (struct block_list *bl, int time)
|
||||||
{
|
{
|
||||||
struct status_change *sc = status_get_sc(bl);
|
struct status_change *sc = status_get_sc(bl);
|
||||||
@ -8760,8 +8725,7 @@ int skill_castfix_sc (struct block_list *bl, int time)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
|
int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
|
||||||
{
|
{
|
||||||
int delaynochange = skill_get_delaynodex(skill_id, skill_lv);
|
int delaynochange = skill_get_delaynodex(skill_id, skill_lv);
|
||||||
@ -8834,8 +8798,7 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
*
|
*
|
||||||
*----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_brandishspear_first (struct square *tc, int dir, int x, int y)
|
void skill_brandishspear_first (struct square *tc, int dir, int x, int y)
|
||||||
{
|
{
|
||||||
nullpo_retv(tc);
|
nullpo_retv(tc);
|
||||||
@ -8941,8 +8904,7 @@ void skill_brandishspear_first (struct square *tc, int dir, int x, int y)
|
|||||||
|
|
||||||
/*=========================================
|
/*=========================================
|
||||||
*
|
*
|
||||||
*-----------------------------------------
|
*-----------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_brandishspear_dir (struct square *tc, int dir, int are)
|
void skill_brandishspear_dir (struct square *tc, int dir, int are)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
@ -8972,8 +8934,7 @@ void skill_brandishspear_dir (struct square *tc, int dir, int are)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Weapon Repair [Celest/DracoRPG]
|
* Weapon Repair [Celest/DracoRPG]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_repairweapon (struct map_session_data *sd, int idx)
|
void skill_repairweapon (struct map_session_data *sd, int idx)
|
||||||
{
|
{
|
||||||
int material;
|
int material;
|
||||||
@ -9018,8 +8979,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Item Appraisal
|
* Item Appraisal
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_identify (struct map_session_data *sd, int idx)
|
void skill_identify (struct map_session_data *sd, int idx)
|
||||||
{
|
{
|
||||||
int flag=1;
|
int flag=1;
|
||||||
@ -9037,8 +8997,7 @@ void skill_identify (struct map_session_data *sd, int idx)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Weapon Refine [Celest]
|
* Weapon Refine [Celest]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_weaponrefine (struct map_session_data *sd, int idx)
|
void skill_weaponrefine (struct map_session_data *sd, int idx)
|
||||||
{
|
{
|
||||||
int i = 0, ep = 0, per;
|
int i = 0, ep = 0, per;
|
||||||
@ -9107,8 +9066,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_autospell (struct map_session_data *sd, int skillid)
|
int skill_autospell (struct map_session_data *sd, int skillid)
|
||||||
{
|
{
|
||||||
int skilllv;
|
int skilllv;
|
||||||
@ -9151,8 +9109,7 @@ int skill_autospell (struct map_session_data *sd, int skillid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Sitting skills functions.
|
* Sitting skills functions.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_sit_count (struct block_list *bl, va_list ap)
|
static int skill_sit_count (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
@ -9245,8 +9202,7 @@ int skill_sit (struct map_session_data *sd, int type)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_frostjoke_scream (struct block_list *bl, va_list ap)
|
int skill_frostjoke_scream (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct block_list *src;
|
struct block_list *src;
|
||||||
@ -9280,8 +9236,7 @@ int skill_frostjoke_scream (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_unitsetmapcell (struct skill_unit *src, int skill_num, int skill_lv, int flag)
|
void skill_unitsetmapcell (struct skill_unit *src, int skill_num, int skill_lv, int flag)
|
||||||
{
|
{
|
||||||
int i,x,y,range = skill_get_unit_range(skill_num,skill_lv);
|
int i,x,y,range = skill_get_unit_range(skill_num,skill_lv);
|
||||||
@ -9296,8 +9251,7 @@ void skill_unitsetmapcell (struct skill_unit *src, int skill_num, int skill_lv,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Sets a map cell around the caster, according to the skill's splash range.
|
* Sets a map cell around the caster, according to the skill's splash range.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_setmapcell (struct block_list *src, int skill_num, int skill_lv, int flag)
|
void skill_setmapcell (struct block_list *src, int skill_num, int skill_lv, int flag)
|
||||||
{
|
{
|
||||||
int i,x,y,range = skill_get_splash(skill_num, skill_lv);
|
int i,x,y,range = skill_get_splash(skill_num, skill_lv);
|
||||||
@ -9312,8 +9266,7 @@ void skill_setmapcell (struct block_list *src, int skill_num, int skill_lv, int
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_attack_area (struct block_list *bl, va_list ap)
|
int skill_attack_area (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct block_list *src,*dsrc;
|
struct block_list *src,*dsrc;
|
||||||
@ -9348,8 +9301,7 @@ int skill_attack_area (struct block_list *bl, va_list ap)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_clear_group (struct block_list *bl, int flag)
|
int skill_clear_group (struct block_list *bl, int flag)
|
||||||
{
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
struct unit_data *ud = unit_bl2ud(bl);
|
||||||
@ -9386,8 +9338,7 @@ int skill_clear_group (struct block_list *bl, int flag)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Returns the first element field found [Skotlex]
|
* Returns the first element field found [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct skill_unit_group *skill_locate_element_field(struct block_list *bl)
|
struct skill_unit_group *skill_locate_element_field(struct block_list *bl)
|
||||||
{
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
struct unit_data *ud = unit_bl2ud(bl);
|
||||||
@ -9443,8 +9394,7 @@ int skill_greed (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_cell_overlap(struct block_list *bl, va_list ap)
|
int skill_cell_overlap(struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
int skillid;
|
int skillid;
|
||||||
@ -9538,8 +9488,7 @@ int skill_cell_overlap(struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* variation of skill_cell_overlap
|
* variation of skill_cell_overlap
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_ganbatein (struct block_list *bl, va_list ap)
|
int skill_ganbatein (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit;
|
struct skill_unit *unit;
|
||||||
@ -9558,8 +9507,7 @@ int skill_ganbatein (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap)
|
int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap)
|
||||||
{
|
{
|
||||||
struct mob_data* md;
|
struct mob_data* md;
|
||||||
@ -9580,8 +9528,7 @@ int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 謖<EFBFBD>ョ夂ッ<EFBFBD>峇蜀<EFBFBD>〒src縺ォ蟇セ縺励※譛牙柑縺ェ繧ソ繝シ繧イ繝<EFBFBD>ヨ縺ョbl縺ョ謨ー繧呈焚縺医k(foreachinarea)
|
* 謖<EFBFBD>ョ夂ッ<EFBFBD>峇蜀<EFBFBD>〒src縺ォ蟇セ縺励※譛牙柑縺ェ繧ソ繝シ繧イ繝<EFBFBD>ヨ縺ョbl縺ョ謨ー繧呈焚縺医k(foreachinarea)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_count_target (struct block_list *bl, va_list ap)
|
int skill_count_target (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct block_list *src = va_arg(ap,struct block_list *);
|
struct block_list *src = va_arg(ap,struct block_list *);
|
||||||
@ -9591,8 +9538,7 @@ int skill_count_target (struct block_list *bl, va_list ap)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_trap_splash (struct block_list *bl, va_list ap)
|
int skill_trap_splash (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct block_list *src;
|
struct block_list *src;
|
||||||
@ -9656,8 +9602,7 @@ int skill_trap_splash (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_enchant_elemental_end (struct block_list *bl, int type)
|
int skill_enchant_elemental_end (struct block_list *bl, int type)
|
||||||
{
|
{
|
||||||
struct status_change *sc;
|
struct status_change *sc;
|
||||||
@ -9726,17 +9671,10 @@ int skill_check_cloaking(struct block_list *bl, struct status_change *sc)
|
|||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
*----------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void skill_stop_dancing (struct block_list *src)
|
void skill_stop_dancing (struct block_list *src)
|
||||||
{
|
{
|
||||||
struct status_change* sc;
|
struct status_change* sc;
|
||||||
@ -9773,8 +9711,7 @@ void skill_stop_dancing (struct block_list *src)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2)
|
struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit;
|
struct skill_unit *unit;
|
||||||
@ -9824,8 +9761,7 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* if flag =1 -> forced removal, 0 is for natural expiration.
|
* if flag =1 -> forced removal, 0 is for natural expiration.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_delunit (struct skill_unit *unit, int flag)
|
int skill_delunit (struct skill_unit *unit, int flag)
|
||||||
{
|
{
|
||||||
struct skill_unit_group *group;
|
struct skill_unit_group *group;
|
||||||
@ -9875,8 +9811,7 @@ int skill_delunit (struct skill_unit *unit, int flag)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int skill_unit_group_newid = MAX_SKILL_DB;
|
static int skill_unit_group_newid = MAX_SKILL_DB;
|
||||||
struct skill_unit_group *skill_initunitgroup (struct block_list *src, int count, int skillid, int skilllv, int unit_id, int limit, int interval)
|
struct skill_unit_group *skill_initunitgroup (struct block_list *src, int count, int skillid, int skilllv, int unit_id, int limit, int interval)
|
||||||
{
|
{
|
||||||
@ -9932,8 +9867,7 @@ struct skill_unit_group *skill_initunitgroup (struct block_list *src, int count,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* If flag, this is a forced deletion, otherwise it's natural expiration.
|
* If flag, this is a forced deletion, otherwise it's natural expiration.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_delunitgroup (struct block_list *src, struct skill_unit_group *group, int flag)
|
int skill_delunitgroup (struct block_list *src, struct skill_unit_group *group, int flag)
|
||||||
{
|
{
|
||||||
struct unit_data *ud;
|
struct unit_data *ud;
|
||||||
@ -10008,8 +9942,7 @@ int skill_delunitgroup (struct block_list *src, struct skill_unit_group *group,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_clear_unitgroup (struct block_list *src)
|
int skill_clear_unitgroup (struct block_list *src)
|
||||||
{
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(src);
|
struct unit_data *ud = unit_bl2ud(src);
|
||||||
@ -10023,8 +9956,7 @@ int skill_clear_unitgroup (struct block_list *src)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick)
|
struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick)
|
||||||
{
|
{
|
||||||
int i,j=-1,k,s,id;
|
int i,j=-1,k,s,id;
|
||||||
@ -10067,8 +9999,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_lis
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_timer_sub_onplace (struct block_list *bl, va_list ap)
|
int skill_unit_timer_sub_onplace (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit;
|
struct skill_unit *unit;
|
||||||
@ -10096,8 +10027,7 @@ int skill_unit_timer_sub_onplace (struct block_list *bl, va_list ap)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_timer_sub (struct block_list *bl, va_list ap)
|
int skill_unit_timer_sub (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit;
|
struct skill_unit *unit;
|
||||||
@ -10191,8 +10121,7 @@ int skill_unit_timer_sub (struct block_list *bl, va_list ap)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_timer (int tid, unsigned int tick, int id, int data)
|
int skill_unit_timer (int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
map_freeblock_lock();
|
map_freeblock_lock();
|
||||||
@ -10206,8 +10135,7 @@ int skill_unit_timer (int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_move_sub (struct block_list *bl, va_list ap)
|
int skill_unit_move_sub (struct block_list *bl, va_list ap)
|
||||||
{
|
{
|
||||||
struct skill_unit *unit = (struct skill_unit *)bl;
|
struct skill_unit *unit = (struct skill_unit *)bl;
|
||||||
@ -10315,8 +10243,7 @@ int skill_unit_move_sub (struct block_list *bl, va_list ap)
|
|||||||
* flag&2: this function is being invoked twice as a bl moves, store in memory the affected
|
* flag&2: this function is being invoked twice as a bl moves, store in memory the affected
|
||||||
* units to figure out when they have left a group.
|
* units to figure out when they have left a group.
|
||||||
* flag&4: Force a onleft event (triggered when the bl is killed, for example)
|
* flag&4: Force a onleft event (triggered when the bl is killed, for example)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_move (struct block_list *bl, unsigned int tick, int flag)
|
int skill_unit_move (struct block_list *bl, unsigned int tick, int flag)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
@ -10346,8 +10273,7 @@ int skill_unit_move (struct block_list *bl, unsigned int tick, int flag)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_unit_move_unit_group (struct skill_unit_group *group, int m, int dx, int dy)
|
int skill_unit_move_unit_group (struct skill_unit_group *group, int m, int dx, int dy)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
@ -10435,15 +10361,9 @@ int skill_unit_move_unit_group (struct skill_unit_group *group, int m, int dx, i
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger, int qty)
|
int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger, int qty)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
@ -10497,8 +10417,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty)
|
int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty)
|
||||||
{
|
{
|
||||||
int slot[3];
|
int slot[3];
|
||||||
@ -10893,8 +10812,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_blockpc_end (int tid, unsigned int tick, int id, int data)
|
int skill_blockpc_end (int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = map_id2sd(id);
|
struct map_session_data *sd = map_id2sd(id);
|
||||||
@ -10955,10 +10873,6 @@ int skill_blockmerc_start(struct homun_data *hd, int skillid, int tick) //[orn]
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -11255,8 +11169,7 @@ void skill_init_unit_layout (void)
|
|||||||
* produce_db.txt
|
* produce_db.txt
|
||||||
* create_arrow_db.txt
|
* create_arrow_db.txt
|
||||||
* abra_db.txt
|
* abra_db.txt
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int skill_readdb (void)
|
int skill_readdb (void)
|
||||||
{
|
{
|
||||||
int i,j,k,l,m;
|
int i,j,k,l,m;
|
||||||
@ -11680,8 +11593,7 @@ void skill_reload (void)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_skill (void)
|
int do_init_skill (void)
|
||||||
{
|
{
|
||||||
skill_readdb();
|
skill_readdb();
|
||||||
|
@ -88,7 +88,8 @@ static void set_sc(int skill, int sc, int icon, unsigned int flag)
|
|||||||
|
|
||||||
//Initializes the StatusIconChangeTable variable. May seem somewhat slower than directly defining the array,
|
//Initializes the StatusIconChangeTable variable. May seem somewhat slower than directly defining the array,
|
||||||
//but it is much less prone to errors. [Skotlex]
|
//but it is much less prone to errors. [Skotlex]
|
||||||
void initChangeTables(void) {
|
void initChangeTables(void)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < SC_MAX; i++)
|
for (i = 0; i < SC_MAX; i++)
|
||||||
StatusIconChangeTable[i] = SI_BLANK;
|
StatusIconChangeTable[i] = SI_BLANK;
|
||||||
@ -485,7 +486,8 @@ int SkillStatusChangeTable(int skill)
|
|||||||
return SkillStatusChangeTableArray[sk];
|
return SkillStatusChangeTableArray[sk];
|
||||||
}
|
}
|
||||||
int StatusIconChangeTable[SC_MAX]; //Stores the icon that should be associated to this status change.
|
int StatusIconChangeTable[SC_MAX]; //Stores the icon that should be associated to this status change.
|
||||||
static void initDummyData(void) {
|
static void initDummyData(void)
|
||||||
|
{
|
||||||
memset(&dummy_status, 0, sizeof(dummy_status));
|
memset(&dummy_status, 0, sizeof(dummy_status));
|
||||||
dummy_status.hp =
|
dummy_status.hp =
|
||||||
dummy_status.max_hp =
|
dummy_status.max_hp =
|
||||||
@ -507,8 +509,7 @@ static void initDummyData(void) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 精錬ボーナス
|
* 精錬ボーナス
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_getrefinebonus(int lv,int type)
|
int status_getrefinebonus(int lv,int type)
|
||||||
{
|
{
|
||||||
if (lv >= 0 && lv < 5 && type >= 0 && type < 3)
|
if (lv >= 0 && lv < 5 && type >= 0 && type < 3)
|
||||||
@ -933,8 +934,7 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
|
|||||||
* src MAY be null to indicate we shouldn't check it, this is a ground-based skill attack.
|
* src MAY be null to indicate we shouldn't check it, this is a ground-based skill attack.
|
||||||
* target MAY Be null, in which case the checks are only to see
|
* target MAY Be null, in which case the checks are only to see
|
||||||
* whether the source can cast or not the skill on the ground.
|
* whether the source can cast or not the skill on the ground.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag)
|
int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag)
|
||||||
{
|
{
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
@ -1435,7 +1435,6 @@ int status_calc_mob(struct mob_data* md, int first)
|
|||||||
//Skotlex: Calculates the stats of the given pet.
|
//Skotlex: Calculates the stats of the given pet.
|
||||||
int status_calc_pet(struct pet_data *pd, int first)
|
int status_calc_pet(struct pet_data *pd, int first)
|
||||||
{
|
{
|
||||||
|
|
||||||
nullpo_retr(0, pd);
|
nullpo_retr(0, pd);
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
@ -3111,8 +3110,7 @@ void status_calc_bl(struct block_list *bl, unsigned long flag)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Apply shared stat mods from status changes [DracoRPG]
|
* Apply shared stat mods from status changes [DracoRPG]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static unsigned short status_calc_str(struct block_list *bl, struct status_change *sc, int str)
|
static unsigned short status_calc_str(struct block_list *bl, struct status_change *sc, int str)
|
||||||
{
|
{
|
||||||
if(!sc || !sc->count)
|
if(!sc || !sc->count)
|
||||||
@ -3923,8 +3921,7 @@ static unsigned short status_calc_mode(struct block_list *bl, struct status_chan
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Quick swap of adelay/speed when starting ending SA_FREECAST
|
* Quick swap of adelay/speed when starting ending SA_FREECAST
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void status_freecast_switch(struct map_session_data *sd)
|
void status_freecast_switch(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
struct status_data *status;
|
struct status_data *status;
|
||||||
@ -3969,8 +3966,7 @@ const char * status_get_name(struct block_list *bl)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 対象のClassを返す(汎用)
|
* 対象のClassを返す(汎用)
|
||||||
* 戻りは整数で0以上
|
* 戻りは整数で0以上
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_get_class(struct block_list *bl)
|
int status_get_class(struct block_list *bl)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
@ -3987,8 +3983,7 @@ int status_get_class(struct block_list *bl)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 対象のレベルを返す(汎用)
|
* 対象のレベルを返す(汎用)
|
||||||
* 戻りは整数で0以上
|
* 戻りは整数で0以上
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_get_lv(struct block_list *bl)
|
int status_get_lv(struct block_list *bl)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
@ -4522,8 +4517,7 @@ int status_get_sc_def(struct block_list *bl, int type, int rate, int tick, int f
|
|||||||
* &2: Tick should not be reduced (by vit, luk, lv, etc)
|
* &2: Tick should not be reduced (by vit, luk, lv, etc)
|
||||||
* &4: sc_data loaded, no value has to be altered.
|
* &4: sc_data loaded, no value has to be altered.
|
||||||
* &8: rate should not be reduced
|
* &8: rate should not be reduced
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_start(struct block_list *bl,int type,int rate,int val1,int val2,int val3,int val4,int tick,int flag)
|
int status_change_start(struct block_list *bl,int type,int rate,int val1,int val2,int val3,int val4,int tick,int flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL;
|
struct map_session_data *sd = NULL;
|
||||||
@ -6008,8 +6002,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ステータス異常全解除
|
* ステータス異常全解除
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_clear(struct block_list *bl,int type)
|
int status_change_clear(struct block_list *bl,int type)
|
||||||
{
|
{
|
||||||
struct status_change* sc;
|
struct status_change* sc;
|
||||||
@ -6066,8 +6059,7 @@ int status_change_clear(struct block_list *bl,int type)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ステータス異常終了
|
* ステータス異常終了
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_end( struct block_list* bl , int type,int tid )
|
int status_change_end( struct block_list* bl , int type,int tid )
|
||||||
{
|
{
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
@ -6534,8 +6526,7 @@ int kaahi_heal_timer(int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ステータス異常終了タイマー
|
* ステータス異常終了タイマー
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_timer(int tid, unsigned int tick, int id, int data)
|
int status_change_timer(int tid, unsigned int tick, int id, int data)
|
||||||
{
|
{
|
||||||
int type = data;
|
int type = data;
|
||||||
@ -6916,8 +6907,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* ステータス異常タイマー範囲処理
|
* ステータス異常タイマー範囲処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_timer_sub(struct block_list *bl, va_list ap )
|
int status_change_timer_sub(struct block_list *bl, va_list ap )
|
||||||
{
|
{
|
||||||
struct block_list *src;
|
struct block_list *src;
|
||||||
@ -6980,8 +6970,7 @@ int status_change_timer_sub(struct block_list *bl, va_list ap )
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Clears buffs/debuffs of a character.
|
* Clears buffs/debuffs of a character.
|
||||||
* type&1 -> buffs, type&2 -> debuffs
|
* type&1 -> buffs, type&2 -> debuffs
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int status_change_clear_buffs (struct block_list *bl, int type)
|
int status_change_clear_buffs (struct block_list *bl, int type)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -7280,7 +7269,8 @@ static int status_calc_sigma(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int status_readdb(void) {
|
int status_readdb(void)
|
||||||
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char line[1024], path[1024],*p;
|
char line[1024], path[1024],*p;
|
||||||
@ -7417,8 +7407,7 @@ int status_readdb(void) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* スキル関係初期化処理
|
* スキル関係初期化処理
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_status(void)
|
int do_init_status(void)
|
||||||
{
|
{
|
||||||
add_timer_func_list(status_change_timer,"status_change_timer");
|
add_timer_func_list(status_change_timer,"status_change_timer");
|
||||||
|
@ -25,8 +25,7 @@ static struct dbt *guild_storage_db;
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 倉庫内アイテムソート
|
* 倉庫内アイテムソート
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_comp_item(const void *_i1, const void *_i2)
|
int storage_comp_item(const void *_i1, const void *_i2)
|
||||||
{
|
{
|
||||||
struct item *i1 = (struct item *)_i1;
|
struct item *i1 = (struct item *)_i1;
|
||||||
@ -55,8 +54,7 @@ void storage_gsortitem (struct guild_storage* gstor)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 初期化とか
|
* 初期化とか
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int do_init_storage(void) // map.c::do_init()から呼ばれる
|
int do_init_storage(void) // map.c::do_init()から呼ばれる
|
||||||
{
|
{
|
||||||
storage_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
|
storage_db=db_alloc(__FILE__,__LINE__,DB_INT,DB_OPT_RELEASE_DATA,sizeof(int));
|
||||||
@ -95,7 +93,8 @@ void do_reconnect_storage(void)
|
|||||||
guild_storage_db->foreach(guild_storage_db, storage_reconnect_sub, 1);
|
guild_storage_db->foreach(guild_storage_db, storage_reconnect_sub, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_storage(DBKey key, va_list args) {
|
static void* create_storage(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
stor = (struct storage *) aCallocA (sizeof(struct storage), 1);
|
stor = (struct storage *) aCallocA (sizeof(struct storage), 1);
|
||||||
stor->account_id = key.i;
|
stor->account_id = key.i;
|
||||||
@ -123,8 +122,7 @@ int storage_delete(int account_id)
|
|||||||
* 0 - success
|
* 0 - success
|
||||||
* 1 - fail
|
* 1 - fail
|
||||||
* 2 - Storage requested from char-server (will open automatically later)
|
* 2 - Storage requested from char-server (will open automatically later)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storageopen(struct map_session_data *sd)
|
int storage_storageopen(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -159,8 +157,8 @@ int storage_storageopen(struct map_session_data *sd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// helper function
|
// helper function
|
||||||
int compare_item(struct item *a, struct item *b) {
|
int compare_item(struct item *a, struct item *b)
|
||||||
|
{
|
||||||
if (a->nameid == b->nameid &&
|
if (a->nameid == b->nameid &&
|
||||||
a->identify == b->identify &&
|
a->identify == b->identify &&
|
||||||
a->refine == b->refine &&
|
a->refine == b->refine &&
|
||||||
@ -175,8 +173,7 @@ int compare_item(struct item *a, struct item *b) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Internal add-item function.
|
* Internal add-item function.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int storage_additem(struct map_session_data *sd,struct storage *stor,struct item *item_data,int amount)
|
static int storage_additem(struct map_session_data *sd,struct storage *stor,struct item *item_data,int amount)
|
||||||
{
|
{
|
||||||
struct item_data *data;
|
struct item_data *data;
|
||||||
@ -228,8 +225,7 @@ static int storage_additem(struct map_session_data *sd,struct storage *stor,stru
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Internal del-item function
|
* Internal del-item function
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int storage_delitem(struct map_session_data *sd,struct storage *stor,int n,int amount)
|
static int storage_delitem(struct map_session_data *sd,struct storage *stor,int n,int amount)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -251,8 +247,7 @@ static int storage_delitem(struct map_session_data *sd,struct storage *stor,int
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Add an item to the storage from the inventory.
|
* Add an item to the storage from the inventory.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storageadd(struct map_session_data *sd,int index,int amount)
|
int storage_storageadd(struct map_session_data *sd,int index,int amount)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -282,8 +277,7 @@ int storage_storageadd(struct map_session_data *sd,int index,int amount)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Retrieve an item from the storage.
|
* Retrieve an item from the storage.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storageget(struct map_session_data *sd,int index,int amount)
|
int storage_storageget(struct map_session_data *sd,int index,int amount)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -311,8 +305,7 @@ int storage_storageget(struct map_session_data *sd,int index,int amount)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Move an item from cart to storage.
|
* Move an item from cart to storage.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount)
|
int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -340,8 +333,7 @@ int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Get from Storage to the Cart
|
* Get from Storage to the Cart
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storagegettocart(struct map_session_data *sd,int index,int amount)
|
int storage_storagegettocart(struct map_session_data *sd,int index,int amount)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -370,8 +362,7 @@ int storage_storagegettocart(struct map_session_data *sd,int index,int amount)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Modified By Valaris to save upon closing [massdriller]
|
* Modified By Valaris to save upon closing [massdriller]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storageclose(struct map_session_data *sd)
|
int storage_storageclose(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -394,8 +385,7 @@ int storage_storageclose(struct map_session_data *sd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* When quitting the game.
|
* When quitting the game.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int storage_storage_quit(struct map_session_data *sd, int flag)
|
int storage_storage_quit(struct map_session_data *sd, int flag)
|
||||||
{
|
{
|
||||||
struct storage *stor;
|
struct storage *stor;
|
||||||
@ -473,7 +463,8 @@ int storage_storage_saved(int account_id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* create_guildstorage(DBKey key, va_list args) {
|
static void* create_guildstorage(DBKey key, va_list args)
|
||||||
|
{
|
||||||
struct guild_storage *gs = NULL;
|
struct guild_storage *gs = NULL;
|
||||||
gs = (struct guild_storage *) aCallocA(sizeof(struct guild_storage), 1);
|
gs = (struct guild_storage *) aCallocA(sizeof(struct guild_storage), 1);
|
||||||
gs->guild_id=key.i;
|
gs->guild_id=key.i;
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Initiates a trade request.
|
* Initiates a trade request.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd)
|
||||||
void trade_traderequest(struct map_session_data *sd, struct map_session_data *target_sd) {
|
{
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
@ -89,9 +89,9 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
|
|||||||
* 4: Cancel
|
* 4: Cancel
|
||||||
* Weird enough, the client should only send 3/4
|
* Weird enough, the client should only send 3/4
|
||||||
* and the server is the one that can reply 0~2
|
* and the server is the one that can reply 0~2
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_tradeack(struct map_session_data *sd, int type)
|
||||||
void trade_tradeack(struct map_session_data *sd, int type) {
|
{
|
||||||
struct map_session_data *tsd;
|
struct map_session_data *tsd;
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
|
|
||||||
@ -159,9 +159,9 @@ void trade_tradeack(struct map_session_data *sd, int type) {
|
|||||||
* Check here hacker for duplicate item in trade
|
* Check here hacker for duplicate item in trade
|
||||||
* normal client refuse to have 2 same types of item (except equipment) in same trade window
|
* normal client refuse to have 2 same types of item (except equipment) in same trade window
|
||||||
* normal client authorise only no equiped item and only from inventory
|
* normal client authorise only no equiped item and only from inventory
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int impossible_trade_check(struct map_session_data *sd)
|
||||||
int impossible_trade_check(struct map_session_data *sd) {
|
{
|
||||||
struct item inventory[MAX_INVENTORY];
|
struct item inventory[MAX_INVENTORY];
|
||||||
char message_to_gm[200];
|
char message_to_gm[200];
|
||||||
int i, index;
|
int i, index;
|
||||||
@ -221,9 +221,9 @@ int impossible_trade_check(struct map_session_data *sd) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Checks if trade is possible (against zeny limits, inventory limits, etc)
|
* Checks if trade is possible (against zeny limits, inventory limits, etc)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
|
||||||
int trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
|
{
|
||||||
struct item inventory[MAX_INVENTORY];
|
struct item inventory[MAX_INVENTORY];
|
||||||
struct item inventory2[MAX_INVENTORY];
|
struct item inventory2[MAX_INVENTORY];
|
||||||
struct item_data *data;
|
struct item_data *data;
|
||||||
@ -310,9 +310,9 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Adds an item/qty to the trade window [rewrite by Skotlex]
|
* Adds an item/qty to the trade window [rewrite by Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_tradeadditem(struct map_session_data *sd, int index, int amount)
|
||||||
void trade_tradeadditem(struct map_session_data *sd, int index, int amount) {
|
{
|
||||||
struct map_session_data *target_sd;
|
struct map_session_data *target_sd;
|
||||||
struct item *item;
|
struct item *item;
|
||||||
int trade_i, trade_weight;
|
int trade_i, trade_weight;
|
||||||
@ -402,9 +402,9 @@ void trade_tradeadditem(struct map_session_data *sd, int index, int amount) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 'Ok' button on the trade window is pressed.
|
* 'Ok' button on the trade window is pressed.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_tradeok(struct map_session_data *sd)
|
||||||
void trade_tradeok(struct map_session_data *sd) {
|
{
|
||||||
struct map_session_data *target_sd;
|
struct map_session_data *target_sd;
|
||||||
|
|
||||||
if(sd->state.deal_locked || !sd->state.trading)
|
if(sd->state.deal_locked || !sd->state.trading)
|
||||||
@ -422,9 +422,9 @@ void trade_tradeok(struct map_session_data *sd) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 'Cancel' is pressed. (or trade was force-cancelled by the code)
|
* 'Cancel' is pressed. (or trade was force-cancelled by the code)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_tradecancel(struct map_session_data *sd)
|
||||||
void trade_tradecancel(struct map_session_data *sd) {
|
{
|
||||||
struct map_session_data *target_sd;
|
struct map_session_data *target_sd;
|
||||||
int trade_i;
|
int trade_i;
|
||||||
|
|
||||||
@ -472,9 +472,9 @@ void trade_tradecancel(struct map_session_data *sd) {
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Žæˆø‹–‘ø(trade‰Ÿ‚µ)
|
* Žæˆø‹–‘ø(trade‰Ÿ‚µ)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
void trade_tradecommit(struct map_session_data *sd)
|
||||||
void trade_tradecommit(struct map_session_data *sd) {
|
{
|
||||||
struct map_session_data *tsd;
|
struct map_session_data *tsd;
|
||||||
int trade_i;
|
int trade_i;
|
||||||
int flag;
|
int flag;
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
const int dirx[8]={0,-1,-1,-1,0,1,1,1};
|
const int dirx[8]={0,-1,-1,-1,0,1,1,1};
|
||||||
const int diry[8]={1,1,0,-1,-1,-1,0,1};
|
const int diry[8]={1,1,0,-1,-1,-1,0,1};
|
||||||
|
|
||||||
struct unit_data* unit_bl2ud(struct block_list *bl) {
|
struct unit_data* unit_bl2ud(struct block_list *bl)
|
||||||
|
{
|
||||||
if( bl == NULL) return NULL;
|
if( bl == NULL) return NULL;
|
||||||
if( bl->type == BL_PC) return &((struct map_session_data*)bl)->ud;
|
if( bl->type == BL_PC) return &((struct map_session_data*)bl)->ud;
|
||||||
if( bl->type == BL_MOB) return &((struct mob_data*)bl)->ud;
|
if( bl->type == BL_MOB) return &((struct mob_data*)bl)->ud;
|
||||||
@ -271,7 +272,8 @@ static int unit_delay_walktoxy_timer(int tid, unsigned int tick, int id, int dat
|
|||||||
//&1 -> 1/0 = easy/hard
|
//&1 -> 1/0 = easy/hard
|
||||||
//&2 -> force walking
|
//&2 -> force walking
|
||||||
//&4 -> Delay walking if the reason you can't walk is the canwalk delay
|
//&4 -> Delay walking if the reason you can't walk is the canwalk delay
|
||||||
int unit_walktoxy( struct block_list *bl, int x, int y, int flag) {
|
int unit_walktoxy( struct block_list *bl, int x, int y, int flag)
|
||||||
|
{
|
||||||
struct unit_data *ud = NULL;
|
struct unit_data *ud = NULL;
|
||||||
struct status_change *sc = NULL;
|
struct status_change *sc = NULL;
|
||||||
|
|
||||||
@ -332,7 +334,8 @@ static int unit_walktobl_sub(int tid,unsigned int tick,int id,int data)
|
|||||||
|
|
||||||
// Chases a tbl. If the flag&1, use hard-path seek,
|
// Chases a tbl. If the flag&1, use hard-path seek,
|
||||||
// if flag&2, start attacking upon arrival within range, otherwise just walk to that character.
|
// if flag&2, start attacking upon arrival within range, otherwise just walk to that character.
|
||||||
int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int flag) {
|
int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int flag)
|
||||||
|
{
|
||||||
struct unit_data *ud = NULL;
|
struct unit_data *ud = NULL;
|
||||||
struct status_change *sc = NULL;
|
struct status_change *sc = NULL;
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
@ -619,8 +622,7 @@ int unit_warp(struct block_list *bl,int m,short x,short y,int type)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 歩行停止
|
* 歩行停止
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_stop_walking(struct block_list *bl,int type)
|
int unit_stop_walking(struct block_list *bl,int type)
|
||||||
{
|
{
|
||||||
struct unit_data *ud;
|
struct unit_data *ud;
|
||||||
@ -661,8 +663,8 @@ int unit_stop_walking(struct block_list *bl,int type)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unit_skilluse_id(struct block_list *src, int target_id, int skill_num, int skill_lv) {
|
int unit_skilluse_id(struct block_list *src, int target_id, int skill_num, int skill_lv)
|
||||||
|
{
|
||||||
if(skill_num < 0) return 0;
|
if(skill_num < 0) return 0;
|
||||||
|
|
||||||
return unit_skilluse_id2(
|
return unit_skilluse_id2(
|
||||||
@ -682,8 +684,7 @@ int unit_is_walking(struct block_list *bl)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Determines if the bl can move based on status changes. [Skotlex]
|
* Determines if the bl can move based on status changes. [Skotlex]
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_can_move(struct block_list *bl)
|
int unit_can_move(struct block_list *bl)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd;
|
struct map_session_data *sd;
|
||||||
@ -748,8 +749,7 @@ int unit_can_move(struct block_list *bl)
|
|||||||
* Applies walk delay to character, considering that
|
* Applies walk delay to character, considering that
|
||||||
* if type is 0, this is a damage induced delay: if previous delay is active, do not change it.
|
* if type is 0, this is a damage induced delay: if previous delay is active, do not change it.
|
||||||
* if type is 1, this is a skill induced delay: walk-delay may only be increased, not decreased.
|
* if type is 1, this is a skill induced delay: walk-delay may only be increased, not decreased.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type)
|
int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type)
|
||||||
{
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
struct unit_data *ud = unit_bl2ud(bl);
|
||||||
@ -777,7 +777,8 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int skill_lv, int casttime, int castcancel) {
|
int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int skill_lv, int casttime, int castcancel)
|
||||||
|
{
|
||||||
struct unit_data *ud;
|
struct unit_data *ud;
|
||||||
struct status_data *tstatus;
|
struct status_data *tstatus;
|
||||||
struct status_change *sc;
|
struct status_change *sc;
|
||||||
@ -1042,7 +1043,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int unit_skilluse_pos(struct block_list *src, int skill_x, int skill_y, int skill_num, int skill_lv) {
|
int unit_skilluse_pos(struct block_list *src, int skill_x, int skill_y, int skill_num, int skill_lv)
|
||||||
|
{
|
||||||
if(skill_num < 0)
|
if(skill_num < 0)
|
||||||
return 0;
|
return 0;
|
||||||
return unit_skilluse_pos2(
|
return unit_skilluse_pos2(
|
||||||
@ -1052,7 +1054,8 @@ int unit_skilluse_pos(struct block_list *src, int skill_x, int skill_y, int skil
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
int unit_skilluse_pos2( struct block_list *src, int skill_x, int skill_y, int skill_num, int skill_lv, int casttime, int castcancel) {
|
int unit_skilluse_pos2( struct block_list *src, int skill_x, int skill_y, int skill_num, int skill_lv, int casttime, int castcancel)
|
||||||
|
{
|
||||||
struct map_session_data *sd = NULL;
|
struct map_session_data *sd = NULL;
|
||||||
struct unit_data *ud = NULL;
|
struct unit_data *ud = NULL;
|
||||||
struct status_change *sc;
|
struct status_change *sc;
|
||||||
@ -1164,7 +1167,8 @@ int unit_stop_attack(struct block_list *bl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Means current target is unattackable. For now only unlocks mobs.
|
//Means current target is unattackable. For now only unlocks mobs.
|
||||||
int unit_unattackable(struct block_list *bl) {
|
int unit_unattackable(struct block_list *bl)
|
||||||
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
struct unit_data *ud = unit_bl2ud(bl);
|
||||||
if (ud) {
|
if (ud) {
|
||||||
ud->target = 0;
|
ud->target = 0;
|
||||||
@ -1181,9 +1185,7 @@ int unit_unattackable(struct block_list *bl) {
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* 攻撃要求
|
* 攻撃要求
|
||||||
* typeが1なら継続攻撃
|
* typeが1なら継続攻撃
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
|
|
||||||
int unit_attack(struct block_list *src,int target_id,int continuous)
|
int unit_attack(struct block_list *src,int target_id,int continuous)
|
||||||
{
|
{
|
||||||
struct block_list *target;
|
struct block_list *target;
|
||||||
@ -1263,8 +1265,7 @@ int unit_cancel_combo(struct block_list *bl)
|
|||||||
}
|
}
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
|
int unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
|
||||||
{
|
{
|
||||||
struct walkpath_data wpd;
|
struct walkpath_data wpd;
|
||||||
@ -1283,8 +1284,7 @@ int unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y)
|
int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y)
|
||||||
{
|
{
|
||||||
struct walkpath_data wpd;
|
struct walkpath_data wpd;
|
||||||
@ -1328,8 +1328,7 @@ int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, i
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* PCの攻撃 (timer関数)
|
* PCの攻撃 (timer関数)
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
|
static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
|
||||||
{
|
{
|
||||||
struct block_list *target;
|
struct block_list *target;
|
||||||
@ -1445,7 +1444,8 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int unit_attack_timer(int tid,unsigned int tick,int id,int data) {
|
static int unit_attack_timer(int tid,unsigned int tick,int id,int data)
|
||||||
|
{
|
||||||
struct block_list *bl;
|
struct block_list *bl;
|
||||||
bl = map_id2bl(id);
|
bl = map_id2bl(id);
|
||||||
if(bl && unit_attack_timer_sub(bl, tid, tick) == 0)
|
if(bl && unit_attack_timer_sub(bl, tid, tick) == 0)
|
||||||
@ -1457,8 +1457,7 @@ static int unit_attack_timer(int tid,unsigned int tick,int id,int data) {
|
|||||||
* Cancels an ongoing skill cast.
|
* Cancels an ongoing skill cast.
|
||||||
* flag&1: Cast-Cancel invoked.
|
* flag&1: Cast-Cancel invoked.
|
||||||
* flag&2: Cancel only if skill is cancellable.
|
* flag&2: Cancel only if skill is cancellable.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_skillcastcancel(struct block_list *bl,int type)
|
int unit_skillcastcancel(struct block_list *bl,int type)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = NULL;
|
struct map_session_data *sd = NULL;
|
||||||
@ -1506,7 +1505,8 @@ int unit_skillcastcancel(struct block_list *bl,int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unit_data の初期化処理
|
// unit_data の初期化処理
|
||||||
void unit_dataset(struct block_list *bl) {
|
void unit_dataset(struct block_list *bl)
|
||||||
|
{
|
||||||
struct unit_data *ud;
|
struct unit_data *ud;
|
||||||
nullpo_retv(ud = unit_bl2ud(bl));
|
nullpo_retv(ud = unit_bl2ud(bl));
|
||||||
|
|
||||||
@ -1551,8 +1551,7 @@ int unit_counttargeted(struct block_list* bl, int target_lv)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
*
|
*
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2)
|
int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, target);
|
nullpo_retr(0, target);
|
||||||
@ -1565,8 +1564,7 @@ int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 見た目のサイズを変更する
|
* 見た目のサイズを変更する
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
int unit_changeviewsize(struct block_list *bl,short size)
|
int unit_changeviewsize(struct block_list *bl,short size)
|
||||||
{
|
{
|
||||||
nullpo_retr(0, bl);
|
nullpo_retr(0, bl);
|
||||||
@ -1590,9 +1588,9 @@ int unit_changeviewsize(struct block_list *bl,short size)
|
|||||||
* if clrtype is 1 (death), appropiate cleanup is performed.
|
* if clrtype is 1 (death), appropiate cleanup is performed.
|
||||||
* Otherwise it is assumed bl is being warped.
|
* Otherwise it is assumed bl is being warped.
|
||||||
* On-Kill specific stuff is not performed here, look at status_damage for that.
|
* On-Kill specific stuff is not performed here, look at status_damage for that.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int unit_remove_map(struct block_list *bl, int clrtype)
|
||||||
int unit_remove_map(struct block_list *bl, int clrtype) {
|
{
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
struct unit_data *ud = unit_bl2ud(bl);
|
||||||
struct status_change *sc = status_get_sc(bl);
|
struct status_change *sc = status_get_sc(bl);
|
||||||
nullpo_retr(0, ud);
|
nullpo_retr(0, ud);
|
||||||
@ -1738,10 +1736,9 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
|
|||||||
* if unit is on map, it is removed using the clrtype specified
|
* if unit is on map, it is removed using the clrtype specified
|
||||||
* If clrtype is <0, no saving is performed. This is only for non-authed
|
* If clrtype is <0, no saving is performed. This is only for non-authed
|
||||||
* objects that shouldn't be on a map yet.
|
* objects that shouldn't be on a map yet.
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
int unit_free(struct block_list *bl, int clrtype)
|
||||||
|
{
|
||||||
int unit_free(struct block_list *bl, int clrtype) {
|
|
||||||
struct unit_data *ud = unit_bl2ud( bl );
|
struct unit_data *ud = unit_bl2ud( bl );
|
||||||
nullpo_retr(0, ud);
|
nullpo_retr(0, ud);
|
||||||
|
|
||||||
@ -1922,7 +1919,8 @@ int unit_free(struct block_list *bl, int clrtype) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_init_unit(void) {
|
int do_init_unit(void)
|
||||||
|
{
|
||||||
add_timer_func_list(unit_attack_timer, "unit_attack_timer");
|
add_timer_func_list(unit_attack_timer, "unit_attack_timer");
|
||||||
add_timer_func_list(unit_walktoxy_timer,"unit_walktoxy_timer");
|
add_timer_func_list(unit_walktoxy_timer,"unit_walktoxy_timer");
|
||||||
add_timer_func_list(unit_walktobl_sub, "unit_walktobl_sub");
|
add_timer_func_list(unit_walktobl_sub, "unit_walktobl_sub");
|
||||||
@ -1930,7 +1928,8 @@ int do_init_unit(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_final_unit(void) {
|
int do_final_unit(void)
|
||||||
|
{
|
||||||
// nothing to do
|
// nothing to do
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,7 @@
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 露店閉鎖
|
* 露店閉鎖
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void vending_closevending(struct map_session_data *sd)
|
void vending_closevending(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
@ -34,8 +33,7 @@ void vending_closevending(struct map_session_data *sd)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 露店アイテムリスト要求
|
* 露店アイテムリスト要求
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void vending_vendinglistreq(struct map_session_data *sd,int id)
|
void vending_vendinglistreq(struct map_session_data *sd,int id)
|
||||||
{
|
{
|
||||||
struct map_session_data *vsd;
|
struct map_session_data *vsd;
|
||||||
@ -51,8 +49,7 @@ void vending_vendinglistreq(struct map_session_data *sd,int id)
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 露店アイテム購入
|
* 露店アイテム購入
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned char *p)
|
void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned char *p)
|
||||||
{
|
{
|
||||||
int i, j, w, new_ = 0, blank, vend_list[MAX_VENDING];
|
int i, j, w, new_ = 0, blank, vend_list[MAX_VENDING];
|
||||||
@ -208,8 +205,7 @@ void vending_purchasereq(struct map_session_data *sd,int len,int id,unsigned cha
|
|||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* 露店開設
|
* 露店開設
|
||||||
*------------------------------------------
|
*------------------------------------------*/
|
||||||
*/
|
|
||||||
void vending_openvending(struct map_session_data *sd,int len,char *message,int flag,unsigned char *p)
|
void vending_openvending(struct map_session_data *sd,int len,char *message,int flag,unsigned char *p)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -31,7 +31,8 @@ int (*add_timer_interval)(unsigned int,int (*)(int,unsigned int,int,int),int,int
|
|||||||
//Used to output 'I'm Alive' every few seconds
|
//Used to output 'I'm Alive' every few seconds
|
||||||
//Intended to let frontends know if the app froze
|
//Intended to let frontends know if the app froze
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int imalive_timer(int tid, unsigned int tick, int id, int data){
|
int imalive_timer(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
printf("I'm Alive\n");
|
printf("I'm Alive\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -40,7 +41,8 @@ int imalive_timer(int tid, unsigned int tick, int id, int data){
|
|||||||
//Flush stdout
|
//Flush stdout
|
||||||
//stdout buffer needs flushed to be seen in GUI
|
//stdout buffer needs flushed to be seen in GUI
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int flush_timer(int tid, unsigned int tick, int id, int data){
|
int flush_timer(int tid, unsigned int tick, int id, int data)
|
||||||
|
{
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,15 @@ PLUGIN_EVENTS_TABLE = {
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(MINGW)
|
#if defined(_WIN32) || defined(MINGW)
|
||||||
int sig_init() {
|
int sig_init()
|
||||||
|
{
|
||||||
ShowError("sig: This plugin is not supported - Enable 'exchndl' instead!\n");
|
ShowError("sig: This plugin is not supported - Enable 'exchndl' instead!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int sig_final() { return 0; }
|
int sig_final() { return 0; }
|
||||||
#elif defined (__NETBSD__) || defined (__FREEBSD__)
|
#elif defined (__NETBSD__) || defined (__FREEBSD__)
|
||||||
int sig_init() {
|
int sig_init()
|
||||||
|
{
|
||||||
ShowError("sig: This plugin is not supported!\n");
|
ShowError("sig: This plugin is not supported!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ char *account_txt = "../save/account.txt";
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// Function to suppress control characters in a string.
|
// Function to suppress control characters in a string.
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
int remove_control_chars(unsigned char *str) {
|
int remove_control_chars(unsigned char *str)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
int change = 0;
|
int change = 0;
|
||||||
|
|
||||||
@ -29,8 +30,8 @@ int remove_control_chars(unsigned char *str) {
|
|||||||
return change;
|
return change;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
char username[24];
|
char username[24];
|
||||||
char password[24];
|
char password[24];
|
||||||
char sex[2];
|
char sex[2];
|
||||||
|
@ -31,7 +31,8 @@ char t_name[256];
|
|||||||
#define SQL_CONF_NAME "conf/inter_athena.conf"
|
#define SQL_CONF_NAME "conf/inter_athena.conf"
|
||||||
#define INTER_CONF_NAME "conf/inter_athena.conf"
|
#define INTER_CONF_NAME "conf/inter_athena.conf"
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
int convert_init(void){
|
int convert_init(void)
|
||||||
|
{
|
||||||
char line[65536];
|
char line[65536];
|
||||||
int ret;
|
int ret;
|
||||||
int set,tmp_int[2], lineno, count;
|
int set,tmp_int[2], lineno, count;
|
||||||
@ -265,8 +266,8 @@ int convert_init(void){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_init(int argc, char **argv){
|
int do_init(int argc, char **argv)
|
||||||
|
{
|
||||||
char_config_read((argc>1)?argv[1]:CHAR_CONF_NAME);
|
char_config_read((argc>1)?argv[1]:CHAR_CONF_NAME);
|
||||||
mapindex_init();
|
mapindex_init();
|
||||||
sql_config_read((argc>2)?argv[2]:SQL_CONF_NAME);
|
sql_config_read((argc>2)?argv[2]:SQL_CONF_NAME);
|
||||||
@ -280,4 +281,4 @@ int do_init(int argc, char **argv){
|
|||||||
|
|
||||||
void do_abort(void) {}
|
void do_abort(void) {}
|
||||||
|
|
||||||
void do_final (void) {}
|
void do_final(void) {}
|
||||||
|
@ -161,7 +161,8 @@ int mmo_auth_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int login_config_read(const char *cfgName){
|
int login_config_read(const char *cfgName)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
char line[1024], w1[1024], w2[1024];
|
char line[1024], w1[1024], w2[1024];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user