From c25d6f5e6c3f092f70bf28cb0a3ac71e2ab89ead Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 15 Aug 2007 17:13:04 +0000 Subject: * Some serious code cleanups - adjusted @reloadbattleconf to not depend on variable ordering - changed all battle vars to 'int' (removes pointless duplicit coding) - added min, max and default columns to battle config data structure - added properly bounded values for these columns (or at least tried to) - battle-conf loading will now complain if it finds unknown settings, and will reject values that are outside of the allowed range - added CHATROOM_TITLE_SIZE and CHATROOM_PASS_SIZE - partially cleaned up chatroom manipulation code * Fixed 'Job_Professer' typo in mage jobchange quest git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11017 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/Changelog.txt | 1 + npc/jobs/1-1/mage.txt | 2 +- npc/jobs/novice/novice.txt | 2 +- npc/quests/skills/monk_skills.txt | 4 +- npc/sample/monster_controller.cpp | 198 -------------------------------------- npc/sample/monster_controller.txt | 198 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 203 insertions(+), 202 deletions(-) delete mode 100644 npc/sample/monster_controller.cpp create mode 100644 npc/sample/monster_controller.txt (limited to 'npc') diff --git a/npc/Changelog.txt b/npc/Changelog.txt index 39ebaea33..76ee0105c 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -1,6 +1,7 @@ Date Added ====== 2007/08/15 + * Fixed 'Job_Professer' typo in mage jobchange quest [ultramage] * Rev. 11016 Corrected a few bugs in the Acolyte Job Quest. (Crashy) [L0ne_W0lf] 2007/08/14 * Deleted an Unnecessary "next;" on Rachel Guide. [Samuray22] diff --git a/npc/jobs/1-1/mage.txt b/npc/jobs/1-1/mage.txt index 2be2c586d..5c9d35655 100644 --- a/npc/jobs/1-1/mage.txt +++ b/npc/jobs/1-1/mage.txt @@ -23,7 +23,7 @@ geffen_in,164,124,4 script Mage Guildsman 123,{ if (Upper == 1) { - if (ADVJOB == Job_High_Wizard || ADVJOB == Job_Professer) { + if (ADVJOB == Job_High_Wizard || ADVJOB == Job_Professor) { if (Class == Job_Novice_High) { mes "[Mage Guildsman]"; mes "Whoa, long time no see! But weren't you supposed to be dead?"; diff --git a/npc/jobs/novice/novice.txt b/npc/jobs/novice/novice.txt index 34111186e..26234cc44 100644 --- a/npc/jobs/novice/novice.txt +++ b/npc/jobs/novice/novice.txt @@ -2083,7 +2083,7 @@ new_zone02,17,182,6 script Helper#2 84,{ mes "Field Combat Training can be"; mes "actually pretty dangerous for"; mes "new adventurers. Let me give you"; - mes "a little more strenght through the"; + mes "a little more strength through the"; mes "power of my magic."; next; mes "[Elmeen]"; diff --git a/npc/quests/skills/monk_skills.txt b/npc/quests/skills/monk_skills.txt index 456e64d63..e17eae2f0 100644 --- a/npc/quests/skills/monk_skills.txt +++ b/npc/quests/skills/monk_skills.txt @@ -411,9 +411,9 @@ prt_monk,129,263,3 script Monk 823,{ mes "and you're good."; next; mes "[Monk]"; - mes "If you have enough strenght"; + mes "If you have enough strength"; mes "to kill Mandoragoras, it means"; - mes "you have heart and strenght"; + mes "you have heart and strength"; mes "to defeat other monsters"; mes "that pester the innocent"; mes "travelers."; diff --git a/npc/sample/monster_controller.cpp b/npc/sample/monster_controller.cpp deleted file mode 100644 index 4d368467c..000000000 --- a/npc/sample/monster_controller.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// Variables Logging: -// .mc_moblist[] - ID list of mobs -prontera,180,200,4 script Monster Controller 123,{ - function display_info { - getmobdata getarg(0), .@mob_data; - set .@array_size, getarraysize(.@mob_data); - for(set .@i, 0; .@i < .@array_size; set .@i, .@i + 1){ - mes .@i + " - " + .@mob_data[.@i]; - } - return; - } - - function remove_mob { - removemob getarg(0); - set .@mob_size, getarraysize(.mc_moblist); - for(set .@i, 0; .@i < .@mob_size; set .@i, .@i + 1){ - if(.mc_moblist[.@i] == getarg(0)) - deletearray .mc_moblist[.@i], 1; - } - } - - function make_menu { - set .@array_size, getarraysize(.mc_moblist); - set .@tmp_str$, ""; - for(set .@i, 0; .@i < .@array_size; set .@i, .@i + 1){ - set .@tmp_str$, .@tmp_str$ + .mc_moblist[.@i] + ":"; - } - select .@tmp_str$; - return .mc_moblist[@menu-1]; - } - - function summon_mob { - set .@mob_size, getarraysize(.mc_moblist); - set .mc_moblist[.@mob_size], spawnmob("Slave - " + .@mob_size, getarg(0), "prontera", 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; - } - - function list_mobs { - set .@mob_size, getarraysize(.mc_moblist); - for(set .@i, 0; .@i < .@mob_size; set .@i, .@i + 1){ - mes "- " + .mc_moblist[.@i]; - } - return; - } - - if(getarraysize(.ai_action) == 4){ - mapannounce "prontera", "[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"; - set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); - break; - case AI_ACTION_TAR_TYPE_MOB: - set .@action_from$, "Monster"; - set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); - break; - case AI_ACTION_TAR_TYPE_PET: - set .@action_from$, "Pet"; - set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); - break; - case AI_ACTION_TAR_TYPE_HOMUN: - set .@action_from$, "Homunculus"; - set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); - break; - default: - set .@action_from$, "Unknown"; - set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; - break; - } - - switch(.ai_action[AI_ACTION_TYPE]){ - case AI_ACTION_TYPE_ATTACK: - set .@action_type$, "Attacked by"; - break; - case AI_ACTION_TYPE_DETECT: - set .@action_type$, "Detected"; - break; - case AI_ACTION_TYPE_DEAD: - set .@action_type$, "Killed by"; - remove_mob .ai_action[AI_ACTION_SRC]; - break; - case AI_ACTION_TYPE_ASSIST: - set .@action_type$, "Assisting"; - break; - case AI_ACTION_TYPE_UNLOCK: - set .@action_type$, "Unlocked target"; - break; - 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; - } - - mapannounce "prontera", "Details - " + .@action_type$ + " [" + .@action_from$ + "] " + .@action_name$ + "!", 16; - deletearray .ai_action, 4; - end; - } - -L_MainMenu: - mes "[Monster Controller]"; - mes "Current active monsters:"; - list_mobs; - switch(select("Summon","Remove","Information","Actions")){ - case 1: // Summon - next; - mes "[Monster Controller]"; - mes "Monster ID -"; - input @mob_id; - next; - summon_mob @mob_id; - goto L_MainMenu; - break; - case 2: // Remove - remove_mob make_menu(); - next; - goto L_MainMenu; - break; - case 3: // Information - set .@tmp, make_menu(); - next; - mes "[Monster Info]"; - display_info .@tmp; - next; - goto L_MainMenu; - break; - case 4: // Actions - goto L_AttackMenu; - break; - } - -L_AttackMenu: - switch(select("Walk","Follow","Attack","Stop","Defend","Talk","Emote","Random Walk","Callback","Back")){ - case 1: // Walk - set .@src, make_menu(); - input .@x; - input .@y; - mobwalk .@src,.@x,.@y; // Mode 1: Walk to location. - break; - case 2: // Follow - set .@src, make_menu(); - input .@tar; - mobwalk .@src, .@tar; // Mode 2: Walk to target. - break; - case 3: // Attack - set .@src, make_menu(); - input .@tar; - mobattack .@src, .@tar; - break; - case 4: // Stop - set .@src, make_menu(); - mobstop .@src; - break; - case 5: // Defend/Assist - set .@src, make_menu(); - input .@tar; - mobassist .@src, .@tar; - break; - case 6: // Talk - set .@src, make_menu(); - input .@text$; - mobtalk .@src, .@text$; - break; - case 7: // Emote - set .@src, make_menu(); - input .@emote; - mobemote .@src, .@emote; - break; - case 8: - set .@src, make_menu(); - 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; - } - goto L_AttackMenu; -} \ No newline at end of file diff --git a/npc/sample/monster_controller.txt b/npc/sample/monster_controller.txt new file mode 100644 index 000000000..4d368467c --- /dev/null +++ b/npc/sample/monster_controller.txt @@ -0,0 +1,198 @@ +// Variables Logging: +// .mc_moblist[] - ID list of mobs +prontera,180,200,4 script Monster Controller 123,{ + function display_info { + getmobdata getarg(0), .@mob_data; + set .@array_size, getarraysize(.@mob_data); + for(set .@i, 0; .@i < .@array_size; set .@i, .@i + 1){ + mes .@i + " - " + .@mob_data[.@i]; + } + return; + } + + function remove_mob { + removemob getarg(0); + set .@mob_size, getarraysize(.mc_moblist); + for(set .@i, 0; .@i < .@mob_size; set .@i, .@i + 1){ + if(.mc_moblist[.@i] == getarg(0)) + deletearray .mc_moblist[.@i], 1; + } + } + + function make_menu { + set .@array_size, getarraysize(.mc_moblist); + set .@tmp_str$, ""; + for(set .@i, 0; .@i < .@array_size; set .@i, .@i + 1){ + set .@tmp_str$, .@tmp_str$ + .mc_moblist[.@i] + ":"; + } + select .@tmp_str$; + return .mc_moblist[@menu-1]; + } + + function summon_mob { + set .@mob_size, getarraysize(.mc_moblist); + set .mc_moblist[.@mob_size], spawnmob("Slave - " + .@mob_size, getarg(0), "prontera", 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; + } + + function list_mobs { + set .@mob_size, getarraysize(.mc_moblist); + for(set .@i, 0; .@i < .@mob_size; set .@i, .@i + 1){ + mes "- " + .mc_moblist[.@i]; + } + return; + } + + if(getarraysize(.ai_action) == 4){ + mapannounce "prontera", "[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"; + set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); + break; + case AI_ACTION_TAR_TYPE_MOB: + set .@action_from$, "Monster"; + set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); + break; + case AI_ACTION_TAR_TYPE_PET: + set .@action_from$, "Pet"; + set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); + break; + case AI_ACTION_TAR_TYPE_HOMUN: + set .@action_from$, "Homunculus"; + set .@action_name$, rid2name(.ai_action[AI_ACTION_TAR]); + break; + default: + set .@action_from$, "Unknown"; + set .@action_name$, ""+.ai_action[AI_ACTION_TAR]; + break; + } + + switch(.ai_action[AI_ACTION_TYPE]){ + case AI_ACTION_TYPE_ATTACK: + set .@action_type$, "Attacked by"; + break; + case AI_ACTION_TYPE_DETECT: + set .@action_type$, "Detected"; + break; + case AI_ACTION_TYPE_DEAD: + set .@action_type$, "Killed by"; + remove_mob .ai_action[AI_ACTION_SRC]; + break; + case AI_ACTION_TYPE_ASSIST: + set .@action_type$, "Assisting"; + break; + case AI_ACTION_TYPE_UNLOCK: + set .@action_type$, "Unlocked target"; + break; + 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; + } + + mapannounce "prontera", "Details - " + .@action_type$ + " [" + .@action_from$ + "] " + .@action_name$ + "!", 16; + deletearray .ai_action, 4; + end; + } + +L_MainMenu: + mes "[Monster Controller]"; + mes "Current active monsters:"; + list_mobs; + switch(select("Summon","Remove","Information","Actions")){ + case 1: // Summon + next; + mes "[Monster Controller]"; + mes "Monster ID -"; + input @mob_id; + next; + summon_mob @mob_id; + goto L_MainMenu; + break; + case 2: // Remove + remove_mob make_menu(); + next; + goto L_MainMenu; + break; + case 3: // Information + set .@tmp, make_menu(); + next; + mes "[Monster Info]"; + display_info .@tmp; + next; + goto L_MainMenu; + break; + case 4: // Actions + goto L_AttackMenu; + break; + } + +L_AttackMenu: + switch(select("Walk","Follow","Attack","Stop","Defend","Talk","Emote","Random Walk","Callback","Back")){ + case 1: // Walk + set .@src, make_menu(); + input .@x; + input .@y; + mobwalk .@src,.@x,.@y; // Mode 1: Walk to location. + break; + case 2: // Follow + set .@src, make_menu(); + input .@tar; + mobwalk .@src, .@tar; // Mode 2: Walk to target. + break; + case 3: // Attack + set .@src, make_menu(); + input .@tar; + mobattack .@src, .@tar; + break; + case 4: // Stop + set .@src, make_menu(); + mobstop .@src; + break; + case 5: // Defend/Assist + set .@src, make_menu(); + input .@tar; + mobassist .@src, .@tar; + break; + case 6: // Talk + set .@src, make_menu(); + input .@text$; + mobtalk .@src, .@text$; + break; + case 7: // Emote + set .@src, make_menu(); + input .@emote; + mobemote .@src, .@emote; + break; + case 8: + set .@src, make_menu(); + 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; + } + goto L_AttackMenu; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2