summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-09 00:26:36 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-11-09 00:26:36 +0000
commitbfb15e68b763800587fa57727fc4baaa0e5e2800 (patch)
treecc8f52cc370b811d5662c6c69fcabb1c94a1207f /src
parent9c8991447ced838c88037dbbf76cf04a970e25dd (diff)
downloadhercules-bfb15e68b763800587fa57727fc4baaa0e5e2800.tar.gz
hercules-bfb15e68b763800587fa57727fc4baaa0e5e2800.tar.bz2
hercules-bfb15e68b763800587fa57727fc4baaa0e5e2800.tar.xz
hercules-bfb15e68b763800587fa57727fc4baaa0e5e2800.zip
- Removed backup.pl (for TXT servers) and vs9-to-vs8.php (outdated versions);
- Merged @killmonster2 with @killmonster tid:73632; - Fixed bugreport:6764, auction code was misplaced; - Follow up to r16753 (bugreport:6523), fixed bugreport:6673, using Gravitational Field with Safety Wall would keep the character immobilized. Blame myself, thankyou Lunar for the fix; - Fixed bugreport:6514, @slaveclone wouldn't be targeted by monster. Thanks to zippy; - Fixed bugreport:6837, some code was duplicated; - Fixed bugreport:6768, removed some leftovers from TXT removal; - Fixed bugreport:6868, Unequipping a weapon with Incantation Samurai card will not kill you if you have less than 999 hp and are on a non-pvp map; - Fixed wrong bit field on ai field in mob_data structure. Credits to Ind. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16881 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/int_elemental.c3
-rw-r--r--src/char/int_guild.h4
-rw-r--r--src/char/int_party.h2
-rw-r--r--src/map/atcommand.c28
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/elemental.c10
-rw-r--r--src/map/elemental.h3
-rw-r--r--src/map/homunculus.c2
-rw-r--r--src/map/homunculus.h2
-rw-r--r--src/map/mail.c1
-rw-r--r--src/map/mercenary.c10
-rw-r--r--src/map/mercenary.h3
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/skill.c4
-rw-r--r--src/map/status.c10
15 files changed, 25 insertions, 65 deletions
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index d81e10f84..7c76c4496 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -90,8 +90,6 @@ bool mapif_elemental_delete(int ele_id) {
return true;
}
-#ifndef TXT_SQL_CONVERT
-
static void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) {
int size = sizeof(struct s_elemental) + 5;
@@ -161,4 +159,3 @@ int inter_elemental_parse_frommap(int fd) {
}
return 1;
}
-#endif //TXT_SQL_CONVERT
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 202b9b512..47c42dcc5 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -34,8 +34,4 @@ int inter_guild_charname_changed(int guild_id,int account_id, int char_id, char
int inter_guild_CharOnline(int char_id, int guild_id);
int inter_guild_CharOffline(int char_id, int guild_id);
-//For the TXT->SQL converter.
-int inter_guild_tosql(struct guild *g,int flag);
-int inter_guildcastle_tosql(struct guild_castle *gc);
-
#endif /* _INT_GUILD_SQL_H_ */
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 703cd5bd5..d8cdcdc6a 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -22,7 +22,5 @@ void inter_party_sql_final(void);
int inter_party_leave(int party_id,int account_id, int char_id);
int inter_party_CharOnline(int char_id, int party_id);
int inter_party_CharOffline(int char_id, int party_id);
-//Required for the TXT->SQL converter
-int inter_party_tosql(struct party *p, int flag, int index);
#endif /* _INT_PARTY_SQL_H_ */
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 45f14be6f..b7b59940e 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2179,12 +2179,11 @@ static int atkillmonster_sub(struct block_list *bl, va_list ap)
return 1;
}
-void atcommand_killmonster_sub(const int fd, struct map_session_data* sd, const char* message, const int drop)
+ACMD_FUNC(killmonster)
{
- int map_id;
+ int map_id, drop_flag;
char map_name[MAP_NAME_LENGTH_EXT];
-
- if (!sd) return;
+ nullpo_retr(-1, sd);
memset(map_name, '\0', sizeof(map_name));
@@ -2194,26 +2193,13 @@ void atcommand_killmonster_sub(const int fd, struct map_session_data* sd, const
if ((map_id = map_mapname2mapid(map_name)) < 0)
map_id = sd->bl.m;
}
+
+ drop_flag = strcmp(command+1, "killmonster2");
- map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, drop);
+ map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag);
clif_displaymessage(fd, msg_txt(165)); // All monsters killed!
- return;
-}
-
-ACMD_FUNC(killmonster)
-{
- atcommand_killmonster_sub(fd, sd, message, 1);
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------*/
-ACMD_FUNC(killmonster2)
-{
- atcommand_killmonster_sub(fd, sd, message, 0);
return 0;
}
@@ -8866,7 +8852,7 @@ void atcommand_basecommands(void) {
ACMD_DEF2("monstersmall", monster),
ACMD_DEF2("monsterbig", monster),
ACMD_DEF(killmonster),
- ACMD_DEF(killmonster2),
+ ACMD_DEF2("killmonster2", killmonster),
ACMD_DEF(refine),
ACMD_DEF(produce),
ACMD_DEF(memo),
diff --git a/src/map/battle.c b/src/map/battle.c
index 47f18e881..18aadf0ac 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5230,8 +5230,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if( !md->special_state.ai )
{ //Normal mobs
- if( (target->type == BL_MOB && t_bl->type == BL_PC && ((TBL_MOB*)target)->special_state.ai < 4) ||
- ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai ) )
+ if(
+ ( target->type == BL_MOB && t_bl->type == BL_PC && ( ((TBL_MOB*)target)->special_state.ai != 4 && ((TBL_MOB*)target)->special_state.ai != 1 ) ) ||
+ ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
+ )
state |= BCT_PARTY; //Normal mobs with no ai are friends.
else
state |= BCT_ENEMY; //However, all else are enemies.
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 3abab157f..1157e851e 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -457,13 +457,6 @@ int elemental_change_mode(struct elemental_data *ed, int mode) {
return 1;
}
-void elemental_damage(struct elemental_data *ed, int hp, int sp) {
- if( hp )
- clif_elemental_updatestatus(ed->master, SP_HP);
- if( sp )
- clif_elemental_updatestatus(ed->master, SP_SP);
-}
-
void elemental_heal(struct elemental_data *ed, int hp, int sp) {
if( hp )
clif_elemental_updatestatus(ed->master, SP_HP);
@@ -471,7 +464,7 @@ void elemental_heal(struct elemental_data *ed, int hp, int sp) {
clif_elemental_updatestatus(ed->master, SP_SP);
}
-int elemental_dead(struct elemental_data *ed, struct block_list *src) {
+int elemental_dead(struct elemental_data *ed) {
elemental_delete(ed, 1);
return 0;
}
@@ -645,7 +638,6 @@ static int elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list a
static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) {
map_foreachpc(elemental_ai_sub_foreachclient,tick);
-
return 0;
}
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 124c7ff83..698cf6fb9 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -67,9 +67,8 @@ int elemental_save(struct elemental_data *ed);
int elemental_change_mode_ack(struct elemental_data *ed, int mode);
int elemental_change_mode(struct elemental_data *ed, int mode);
-void elemental_damage(struct elemental_data *ed, int hp, int sp);
void elemental_heal(struct elemental_data *ed, int hp, int sp);
-int elemental_dead(struct elemental_data *ed, struct block_list *src);
+int elemental_dead(struct elemental_data *ed);
int elemental_delete(struct elemental_data *ed, int reply);
void elemental_summon_stop(struct elemental_data *ed);
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 46da045a4..081e7078e 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -85,7 +85,7 @@ void merc_damage(struct homun_data *hd) {
clif_hominfo(hd->master,hd,0);
}
-int merc_hom_dead(struct homun_data *hd, struct block_list *src)
+int merc_hom_dead(struct homun_data *hd)
{
//There's no intimacy penalties on death (from Tharis)
struct map_session_data *sd = hd->master;
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index 3470cd5f5..7ad9268b2 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -80,7 +80,7 @@ int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag); //alb
struct view_data* merc_get_hom_viewdata(int class_);
int hom_class2mapid(int hom_class);
void merc_damage(struct homun_data *hd);
-int merc_hom_dead(struct homun_data *hd, struct block_list *src);
+int merc_hom_dead(struct homun_data *hd);
void merc_hom_skillup(struct homun_data *hd,int skillnum);
int merc_hom_calc_skilltree(struct homun_data *hd);
int merc_hom_checkskill(struct homun_data *hd,int skill_id);
diff --git a/src/map/mail.c b/src/map/mail.c
index ce099d0a1..70c73c0a4 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -20,7 +20,6 @@ void mail_clear(struct map_session_data *sd)
sd->mail.index = 0;
sd->mail.amount = 0;
sd->mail.zeny = 0;
- sd->auction.amount = 0;
return;
}
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 45e8e04ce..832cc835b 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -344,14 +344,6 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
return 1;
}
-void mercenary_damage(struct mercenary_data *md, int hp, int sp)
-{
- if( hp )
- clif_mercenary_updatestatus(md->master, SP_HP);
- if( sp )
- clif_mercenary_updatestatus(md->master, SP_SP);
-}
-
void mercenary_heal(struct mercenary_data *md, int hp, int sp)
{
if( hp )
@@ -360,7 +352,7 @@ void mercenary_heal(struct mercenary_data *md, int hp, int sp)
clif_mercenary_updatestatus(md->master, SP_SP);
}
-int mercenary_dead(struct mercenary_data *md, struct block_list *src)
+int mercenary_dead(struct mercenary_data *md)
{
merc_delete(md, 1);
return 0;
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index 340ab1462..014bd8937 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -56,9 +56,8 @@ int merc_create(struct map_session_data *sd, int class_, unsigned int lifetime);
int merc_data_received(struct s_mercenary *merc, bool flag);
int mercenary_save(struct mercenary_data *md);
-void mercenary_damage(struct mercenary_data *md, int hp, int sp);
void mercenary_heal(struct mercenary_data *md, int hp, int sp);
-int mercenary_dead(struct mercenary_data *md, struct block_list *src);
+int mercenary_dead(struct mercenary_data *md);
int merc_delete(struct mercenary_data *md, int reply);
void merc_contract_stop(struct mercenary_data *md);
diff --git a/src/map/mob.h b/src/map/mob.h
index 797d2484b..d45962163 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -121,7 +121,7 @@ struct mob_data {
char name[NAME_LENGTH];
struct {
unsigned int size : 2; //Small/Big monsters.
- unsigned int ai : 3; //Special ai for summoned monsters.
+ unsigned int ai : 4; //Special ai for summoned monsters.
//0: Normal mob.
//1: Standard summon, attacks mobs.
//2: Alchemist Marine Sphere
diff --git a/src/map/skill.c b/src/map/skill.c
index 86516e337..7dcfa2552 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11902,8 +11902,8 @@ static int skill_unit_effect (struct block_list* bl, va_list ap)
skill_id = group->skill_id;
//Target-type check.
- if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) && (flag&4) ) {
- if( group->state.song_dance&0x1 || (group->src_id == bl->id && group->state.song_dance&0x2) )
+ if( !(group->bl_flag&bl->type && battle_check_target(&unit->bl,bl,group->target_flag)>0) ) {
+ if( flag&4 && ((group->src_id == bl->id && group->state.song_dance&0x2) || skill_get_inf2(skill_id)&INF2_SONG_DANCE) )
skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it.
} else {
if( flag&1 )
diff --git a/src/map/status.c b/src/map/status.c
index eff787956..e097dcdb1 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1224,8 +1224,8 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
case BL_PC: pc_damage((TBL_PC*)target,src,hp,sp); break;
case BL_MOB: mob_damage((TBL_MOB*)target, src, hp); break;
case BL_HOM: merc_damage((TBL_HOM*)target); break;
- case BL_MER: mercenary_damage((TBL_MER*)target,hp,sp); break;
- case BL_ELEM: elemental_damage((TBL_ELEM*)target,hp,sp); break;
+ case BL_MER: mercenary_heal((TBL_MER*)target,hp,sp); break;
+ case BL_ELEM: elemental_heal((TBL_ELEM*)target,hp,sp); break;
}
if( src && target->type == BL_PC && ((TBL_PC*)target)->disguise ) {// stop walking when attacked in disguise to prevent walk-delay bug
@@ -1248,9 +1248,9 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
switch (target->type) {
case BL_PC: flag = pc_dead((TBL_PC*)target,src); break;
case BL_MOB: flag = mob_dead((TBL_MOB*)target, src, flag&4?3:0); break;
- case BL_HOM: flag = merc_hom_dead((TBL_HOM*)target,src); break;
- case BL_MER: flag = mercenary_dead((TBL_MER*)target,src); break;
- case BL_ELEM: flag = elemental_dead((TBL_ELEM*)target,src); break;
+ case BL_HOM: flag = merc_hom_dead((TBL_HOM*)target); break;
+ case BL_MER: flag = mercenary_dead((TBL_MER*)target); break;
+ case BL_ELEM: flag = elemental_dead((TBL_ELEM*)target); break;
default: //Unhandled case, do nothing to object.
flag = 0;
break;