summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-18 02:42:41 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-18 02:42:41 +0000
commit4b9deaad37eb140bc7e55b1caf82e4512f476075 (patch)
tree7c00fd111ee261428ee55eacaf0e4a6554735254 /src/map/battle.c
parent5ebc10a3af6608d47510c3f528c5794914490897 (diff)
downloadhercules-4b9deaad37eb140bc7e55b1caf82e4512f476075.tar.gz
hercules-4b9deaad37eb140bc7e55b1caf82e4512f476075.tar.bz2
hercules-4b9deaad37eb140bc7e55b1caf82e4512f476075.tar.xz
hercules-4b9deaad37eb140bc7e55b1caf82e4512f476075.zip
* [Removed]:
- Large part of scripted mob control commands are removed. - Large part of scripted player control commands are removed. - Scripted mob slaves changing master ID. [Added]: - Unit control commands. - CALLBACK_NPCCLICK for scripted mobs, added this to db/const.txt too. - Macro RECURSIVE_MASTER_CHECK in battle.c [Modified]: - buildin_skilluseid and buildin_skillusepos -> buildin_unitskilluseid and buildin_unitskillusepos. - md->callback_flag to short (double word). [Lance] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7233 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7d474d5ee..85a8310e0 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -25,6 +25,9 @@
#include "guild.h"
#include "party.h"
+// Recursive master check to prevent custom AIs from messing with each other.
+// #define RECURSIVE_MASTER_CHECK
+
#define is_boss(bl) status_get_mexp(bl) // Can refine later [Aru]
int attr_fix_table[4][ELE_MAX][ELE_MAX];
@@ -3094,8 +3097,24 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
case BL_MOB:
{
TBL_MOB*md = (TBL_MOB*)s_bl;
+#ifdef RECURSIVE_MASTER_CHECK
+ struct block_list *tmp_bl = NULL;
+ TBL_MOB *tmp_md = NULL;
+#endif
if (!agit_flag && md->guardian_data && md->guardian_data->guild_id)
return 0; //Disable guardians/emperium owned by Guilds on non-woe times.
+#ifdef RECURSIVE_MASTER_CHECK
+ tmp_md = md;
+ while(tmp_md->master_id && (tmp_bl = map_id2bl(tmp_md->master_id))){
+ if(t_bl->id == tmp_bl->id){
+ state |= BCT_PARTY;
+ break;
+ }
+ if(tmp_bl->type != BL_MOB)
+ break;
+ tmp_md = (TBL_MOB *)tmp_bl;
+ }
+#endif
if(md->state.killer) // Is on a rampage too :D
state |= BCT_ENEMY;
else if (!md->special_state.ai) { //Normal mobs.