changeset 2240:1fc4223bddf6

dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
author Grumpy7
date Sun, 23 Feb 2014 18:40:29 +0100
parents 699bd6ee5ad0
children 9df0477a5e2b
files GUIWindow.h mm7_4.cpp mm7_unsorted_subs.h
diffstat 3 files changed, 12 insertions(+), 311 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Sun Feb 23 15:54:00 2014 +0100
+++ b/GUIWindow.h	Sun Feb 23 18:40:29 2014 +0100
@@ -239,6 +239,7 @@
   DIALOGUE_EVT_F = 0x18,
   DIALOGUE_76 = 76,
   DIALOGUE_PROFESSION_DETAILS = 77,
+  DIALOGUE_SKILL_TRAINER = 78,
   DIALOGUE_84 = 84,
   DIALOGUE_ARENA_SELECT_PAGE = 85,
   DIALOGUE_ARENA_SELECT_SQUIRE = 86,
--- a/mm7_4.cpp	Sun Feb 23 15:54:00 2014 +0100
+++ b/mm7_4.cpp	Sun Feb 23 18:40:29 2014 +0100
@@ -1877,90 +1877,13 @@
   switch (dword_F8B1AC_award_bit_number)
   {
     case PLAYER_SKILL_STAFF:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_SWORD:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_DAGGER:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_AXE:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_SPEAR:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_BOW:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_MACE:
+    case PLAYER_SKILL_ARMSMASTER:
       switch (masteryLevelBeingTaught)
       {
       case 2:
@@ -1989,47 +1912,8 @@
       }
       break;
     case PLAYER_SKILL_SHIELD:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 3000;
-        break;
-      case 4:
-        gold_transaction_amount = 7000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_LEATHER:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 3000;
-        break;
-      case 4:
-        gold_transaction_amount = 7000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_CHAIN:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 3000;
-        break;
-      case 4:
-        gold_transaction_amount = 7000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_PLATE:
       switch (masteryLevelBeingTaught)
       {
@@ -2045,89 +1929,11 @@
       }
       break;
     case PLAYER_SKILL_FIRE:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_AIR:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_WATER:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_EARTH:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_SPIRIT:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_MIND:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 1000;
-        break;
-      case 3:
-        gold_transaction_amount = 4000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_BODY:
       switch (masteryLevelBeingTaught)
       {
@@ -2181,6 +1987,13 @@
       }
       break;
     case PLAYER_SKILL_ITEM_ID:
+    case PLAYER_SKILL_REPAIR:
+    case PLAYER_SKILL_MEDITATION:
+    case PLAYER_SKILL_PERCEPTION:
+    case PLAYER_SKILL_TRAP_DISARM:
+    case PLAYER_SKILL_MONSTER_ID:
+    case PLAYER_SKILL_STEALING:
+    case PLAYER_SKILL_ALCHEMY:
       switch (masteryLevelBeingTaught)
       {
       case 2:
@@ -2210,20 +2023,6 @@
         break;
       }
       break;
-    case PLAYER_SKILL_REPAIR:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_BODYBUILDING:
       switch (masteryLevelBeingTaught)
       {
@@ -2240,54 +2039,12 @@
         break;
       }
       break;
-    case PLAYER_SKILL_MEDITATION:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
-    case PLAYER_SKILL_PERCEPTION:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_DIPLOMACY:
       Error("Diplomacy not used");
       break;
     case PLAYER_SKILL_TIEVERY:
       Error("Thievery not used");
       break;
-    case PLAYER_SKILL_TRAP_DISARM:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_DODGE:
       switch (masteryLevelBeingTaught)
       {
@@ -2320,62 +2077,6 @@
         break;
       }
       break;
-    case PLAYER_SKILL_MONSTER_ID:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
-    case PLAYER_SKILL_ARMSMASTER:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 2000;
-        break;
-      case 3:
-        gold_transaction_amount = 5000;
-        break;
-      case 4:
-        gold_transaction_amount = 8000;
-        break;
-      }
-      break;
-    case PLAYER_SKILL_STEALING:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
-    case PLAYER_SKILL_ALCHEMY:
-      switch (masteryLevelBeingTaught)
-      {
-      case 2:
-        gold_transaction_amount = 500;
-        break;
-      case 3:
-        gold_transaction_amount = 2500;
-        break;
-      case 4:
-        gold_transaction_amount = 6000;
-        break;
-      }
-      break;
     case PLAYER_SKILL_LEARNING:
       switch (masteryLevelBeingTaught)
       {
@@ -2438,14 +2139,13 @@
 
 
 //----- (004B3FE5) --------------------------------------------------------
-void __fastcall _4B3FE5_training_dialogue(int a4)
+void _4B3FE5_training_dialogue(int a4)
 {
   const char *v2; // edi@1
 
   __debugbreak();
-  uDialogueType = 78;
+  uDialogueType = DIALOGUE_SKILL_TRAINER;
   current_npc_text = (char *)pNPCTopics[a4 + 168].pText;
-  _4B254D_SkillMasteryTeacher(a4);
   pDialogueWindow->Release();
   pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, a4, 0);
   pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169,  35,   1,  0, UIMSG_Escape, 0,   0,
--- a/mm7_unsorted_subs.h	Sun Feb 23 15:54:00 2014 +0100
+++ b/mm7_unsorted_subs.h	Sun Feb 23 18:40:29 2014 +0100
@@ -163,7 +163,7 @@
 void FillAviableSkillsToTeach(int _this);
 void sub_4B3E1E();
 void DrawJoinGuildWindow(int pEventCode);
-void __fastcall _4B3FE5_training_dialogue(int a4);
+void _4B3FE5_training_dialogue(int a4);
 void NPCHireableDialogPrepare();
 void _4B4224_UpdateNPCTopics(int _this);
 void __fastcall DrawTextAtStatusBar(const char *Str, int a5);