Explorar o código

* Updated sample script mob_controller.cpp to the latest standards.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7206 54d463be-8e91-2dee-dedb-b68131a5f0ec
Lance %!s(int64=19) %!d(string=hai) anos
pai
achega
cd2524149a
Modificáronse 2 ficheiros con 24 adicións e 3 borrados
  1. 1 0
      npc/Changelog.txt
  2. 23 3
      npc/sample/monster_controller.cpp

+ 1 - 0
npc/Changelog.txt

@@ -37,6 +37,7 @@ Musashiden
 Date		Added
 ======
 06/16
+	* Updated sample script mob_controller.cpp to the latest standards. [Lance]
 	* Commited Silent's Fix to the duplicate NPCs [Playtester]
 	- needs testing
 	- can't be fully fixed because of length limitation of names

+ 23 - 3
npc/sample/monster_controller.cpp

@@ -33,6 +33,15 @@ prontera.gat,180,200,4	script	Monster Controller	123,{
 		set .@mob_size, getarraysize(.mc_moblist);
 		set .mc_moblist[.@mob_size], spawnmob("Slave - " + .@mob_size, getarg(0), "prontera.gat", 180, 200);
 		mobattach .mc_moblist[.@mob_size];
+		setmobdata .mc_moblist[.@mob_size], 25, 
+			AI_ACTION_TYPE_ATTACK|
+			AI_ACTION_TYPE_DETECT|
+            AI_ACTION_TYPE_DEAD|
+			AI_ACTION_TYPE_ASSIST|
+			AI_ACTION_TYPE_KILL|
+            AI_ACTION_TYPE_UNLOCK|
+            AI_ACTION_TYPE_WALKACK|
+            AI_ACTION_TYPE_WARPACK);
 		return;
 	}
 
@@ -45,7 +54,7 @@ prontera.gat,180,200,4	script	Monster Controller	123,{
 	}
 
 	if(getarraysize(.ai_action) == 4){
-		announce "[Mob Control] AI Action Received from " + .ai_action[AI_ACTION_SRC] + "!",bc_all;
+		mapannounce "prontera.gat", "[Mob Control] AI Action Received from " + .ai_action[AI_ACTION_SRC] + "!",16;
 		switch(.ai_action[AI_ACTION_TAR_TYPE]){
 			case AI_ACTION_TAR_TYPE_PC:
 				set .@action_from$, "Player";
@@ -88,9 +97,15 @@ prontera.gat,180,200,4	script	Monster Controller	123,{
 			case AI_ACTION_TYPE_KILL:
 				set .@action_type$, "Killed";
 				break;
+			case AI_ACTION_TYPE_WALKACK:
+				set .@action_type$, "Completed Walking";
+				break;
+			case AI_ACTION_TYPE_WARPACK:
+				set .@action_type$, "Warped";
+				break;
 		}
 
-		announce "Details - " + .@action_type$ + " [" + .@action_from$ + "] " + .@action_name$ + "!", bc_all;
+		mapannounce "prontera.gat", "Details - " + .@action_type$ + " [" + .@action_from$ + "] " + .@action_name$ + "!", 16;
 		deletearray .ai_action, 4;
 		end;
 	}
@@ -128,7 +143,7 @@ L_MainMenu:
 	}
 
 L_AttackMenu:
-	switch(select("Walk","Follow","Attack","Stop","Defend","Talk","Emote","Random Walk","Back")){
+	switch(select("Walk","Follow","Attack","Stop","Defend","Talk","Emote","Random Walk","Callback","Back")){
 		case 1: // Walk
 			set .@src, make_menu();
 			input .@x;
@@ -169,6 +184,11 @@ L_AttackMenu:
 			input .@flag;
 			mobrandomwalk .@src, .@flag;
 			break;
+		case 9:
+			set .@src, make_menu();
+			input .@flag;
+			setmobdata .@src, 25, .@flag;
+			break;
 		case 9:
 			next;
 			goto L_MainMenu;