From ffcebec91192484588b2a5853782d026e5370f0c Mon Sep 17 00:00:00 2001 From: Lance Date: Fri, 26 May 2006 09:46:45 +0000 Subject: * Mob control engine tested 99% working so far. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6770 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/sample/monster_controller.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'npc/sample/monster_controller.cpp') diff --git a/npc/sample/monster_controller.cpp b/npc/sample/monster_controller.cpp index 58b5693a8..479320f2f 100644 --- a/npc/sample/monster_controller.cpp +++ b/npc/sample/monster_controller.cpp @@ -44,6 +44,39 @@ prontera.gat,180,200,4 script Monster Controller 123,{ return; } + if(getarraysize(.ai_action) == 4){ + announce "[Mob Control] AI Action Received from " + .ai_action[AI_ACTION_SRC] + "!",bc_all; + switch(.ai_action[AI_ACTION_TAR_TYPE]){ + case AI_ACTION_TAR_TYPE_PC: + set .@action_from$, "Player"; + set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); + break; + case AI_ACTION_TAR_TYPE_MOB: + set .@action_from$, "Monster"; + set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; + break; + case AI_ACTION_TAR_TYPE_PET: + set .@action_from$, "Pet"; + set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; + break; + case AI_ACTION_TAR_TYPE_HOMUN: + set .@action_from$, "Homunculus"; + set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; + break; + default: + set .@action_from$, "Unknown"; + set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; + break; + } + if(.ai_action[AI_ACTION_TYPE] == AI_ACTION_TYPE_ATTACK) + set .@action_type$, "attacked by"; + else + set .@action_type$, "detected"; + announce "Action " + .@action_type$ + " [" + .@action_from$ + "] " + .@action_name$ + "!", bc_all; + deletearray .ai_action, 4; + end; + } + L_MainMenu: mes "[Monster Controller]"; mes "Current active monsters:"; -- cgit v1.2.3-70-g09d2