annotate GUI/UI/UIArena.cpp @ 2501:0ff6a9e9bf7f

GUI folger
author Ritor1
date Fri, 19 Sep 2014 04:21:12 +0600
parents
children a77c34acdbc9
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
7 #include "../../Engine/mm7_data.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
8 #include "../../Engine/Graphics/Sprites.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
9
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
10 #include "../../GUIWindow.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
11 #include "../../GUIFont.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
12 #include "../../Engine/Party.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
13 #include "../../AudioPlayer.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
14 #include "../../Engine/Graphics/Outdoor.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
15 #include "../../Engine/LOD.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
16 #include "../../Engine/Objects/Actor.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
17 #include "../../Engine/Events.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
18 #include "../../Engine/Graphics/Viewport.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
19 #include "../../Engine/texts.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
20 #include "../../Engine/MM7.h"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
21
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
22 std::array<Vec2_int_, 20> pMonsterArenaPlacements =
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
23 {{
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
24 Vec2_int_(1524, 8332),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
25 Vec2_int_(2186, 8844),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
26 Vec2_int_(3219, 9339),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
27 Vec2_int_(4500, 9339),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
28 Vec2_int_(5323, 9004),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
29 Vec2_int_(0x177D, 0x2098),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
30 Vec2_int_(0x50B, 0x1E15),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
31 Vec2_int_(0x18FF, 0x1E15),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
32 Vec2_int_(0x50B, 0xD69),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
33 Vec2_int_(0x18FF, 0x1B15),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
34 Vec2_int_(0x50B, 0x1021),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
35 Vec2_int_(0x18FF, 0x1848),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
36 Vec2_int_(0x50B, 0x12D7),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
37 Vec2_int_(0x18FF, 0x15A3),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
38 Vec2_int_(0x50B, 0x14DB),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
39 Vec2_int_(0x18FF, 0x12D7),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
40 Vec2_int_(0x50B, 0x1848),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
41 Vec2_int_(0x18FF, 0x1021),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
42 Vec2_int_(0x50B, 0x1B15),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
43 Vec2_int_(0x18FF, 0xD69),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
44 }}
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
45 ;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
46
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
47 //----- (004BBCDD) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
48 void Arena_SelectionFightLevel()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
49 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
50 signed int v0; // ebp@3
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
51 GUIButton *v5; // eax@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
52 GUIButton *v6; // esi@19
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
53
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
54 if ( pParty->field_7B5_in_arena_quest )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
55 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
56 if ( pParty->field_7B5_in_arena_quest == -1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
57 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
58 uDialogueType = DIALOGUE_ARENA_ALREADY_WON;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
59 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
60 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
61 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
62 v0 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
63 for (size_t i = 0; i < uNumActors; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
64 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
65 if ( pActors[i].uAIState == Dead
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
66 || pActors[i].uAIState == Removed
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
67 || pActors[i].uAIState == Disabled
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
68 || pActors[i].uSummonerID != 0 && PID_TYPE(pActors[i].uSummonerID) == OBJECT_Player)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
69 ++v0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
70 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
71 if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
72 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
73 uDialogueType = DIALOGUE_ARENA_REWARD;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
74 ++*((char *)&pParty->monster_for_hunting_killed[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);//Ritor1:I dont know
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
75 for ( uint i= 0; i < 4; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
76 pParty->pPlayers[i].SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
77 pParty->PartyFindsGold(gold_transaction_amount, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
78 pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
79 pParty->field_7B5_in_arena_quest = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
80 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
81 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
82 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
83 uDialogueType = DIALOGUE_ARENA_WELCOME;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
84 pParty->vPosition.x = 3849;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
85 pParty->vPosition.y = 5770;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
86 pParty->vPosition.z = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
87 pParty->uFallStartY = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
88 pParty->sRotationY = 512;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
89 pParty->sRotationX = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
90 pParty->uFallSpeed = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
91 pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
92 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
93 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
94 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
95 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
96 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
97 uDialogueType = DIALOGUE_ARENA_WELCOME;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
98 v5 = pDialogueWindow->pControlsHead;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
99 if ( v5 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
100 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
101 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
102 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
103 v6 = v5->pNext;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
104 free(v5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
105 v5 = v6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
106 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
107 while ( v6 );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
108 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
109 pDialogueWindow->pControlsHead = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
110 pDialogueWindow->pControlsTail = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
111 pDialogueWindow->uNumControls = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
112 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
113 pGlobalTXT_LocalizationStrings[79], //Close, Закрыть
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
114 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
115 pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 85, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
116 pDialogueWindow->CreateButton(480, 190, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 86, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
117 pDialogueWindow->CreateButton(480, 220, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 87, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
118 pDialogueWindow->CreateButton(480, 250, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 88, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
119 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
120 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
121 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
122
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
123
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
124 //----- (004BC109) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
125 void ArenaFight()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
126 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
127 int v0; // edi@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
128 char *v1; // eax@7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
129 int v3; // eax@10
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
130 signed int v4; // esi@10
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
131 signed int v6; // ebx@34
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
132 signed int v13; // eax@49
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
133 int v14; // esi@49
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
134 int v15; // edx@50
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
135 int v16; // eax@51
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
136 signed int v17; // ecx@51
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
137 int v18; // edx@53
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
138 int i; // edi@55
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
139 signed int v22; // [sp-4h] [bp-144h]@51
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
140 __int16 v23[100]; // [sp+Ch] [bp-134h]@39
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
141 GUIWindow window; // [sp+D4h] [bp-6Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
142 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
143 int v26; // [sp+134h] [bp-Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
144 int num_monsters; // [sp+13Ch] [bp-4h]@17
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
145
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
146 v26 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
147 pParty->field_7B5_in_arena_quest = uDialogueType;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
148 memcpy(&window, pDialogueWindow, sizeof(window));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
149 window.uFrameWidth = game_viewport_width;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
150 window.uFrameZ = 452;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
151 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;// Пожалуйста, подождите пока я вызываю существ. Удачи.
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
152 pRenderer->BeginSceneD3D();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
153
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
154 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
155 pIndoor->Draw();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
156 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
157 pOutdoor->Draw();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
158
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
159 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
160 pRenderer->BeginScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
161 //if ( pRenderer->pRenderD3D )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
162 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
163 pViewport->uViewportBR_X - pViewport->uViewportTL_X,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
164 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
165 0x7FF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
166
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
167 Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
168 pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
169
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
170 pRenderer->DrawTextureIndexed(8, 347 - v0, pTexture_591428);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
171 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Пожалуйста, подождите пока я вызываю существ. Удачи.
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
172 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
173 pRenderer->EndScene();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
174 pRenderer->Present();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
175 pParty->vPosition.x = 3849;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
176 pParty->vPosition.y = 5770;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
177 pParty->vPosition.z = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
178 pParty->uFallStartY = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
179 pParty->sRotationY = 512;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
180 pParty->sRotationX = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
181 pParty->uFallSpeed = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
182 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
183 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
184 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
185 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
186 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
187 ++pMessageQueue_50CBD0->uNumMessages;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
188 }*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
189 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
190 //v2 = pParty->pPlayers.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
191 for ( uint i = 0; i < 4; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
192 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
193 v3 = pParty->pPlayers[i].GetActualLevel();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
194 v4 = v26;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
195 if ( v3 > v26 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
196 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
197 v26 = pParty->pPlayers[i].GetActualLevel();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
198 v4 = pParty->pPlayers[i].GetActualLevel();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
199 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
200 //++v2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
201 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
202 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
203 if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
204 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
205 num_monsters = v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
206 v4 /= 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
207 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
208 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
209 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
210 //v5 = (signed __int64)((double)v26 * 1.5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
211 num_monsters = (int)((double)v26 * 1.5);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
212 v4 /= 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
213 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
214 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
215 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
216 //LODWORD(v5) = 2 * v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
217 num_monsters = 2 * v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
218 v4 /= 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
219 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
220 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
221 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
222 num_monsters = 2 * v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
223 v4 /= 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
224 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
225 if ( v4 < 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
226 v4 = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
227 if ( v4 > 100 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
228 v4 = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
229 if ( num_monsters > 100 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
230 num_monsters = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
231 if ( v4 < 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
232 v4 = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
233 if ( num_monsters < 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
234 num_monsters = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
235 v6 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
236 //v27 = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
237 //v7 = (char *)&pMonsterStats->pInfos[1].uLevel;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
238 for ( uint i = 1; i <= 258; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
239 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
240 if ( pMonsterStats->pInfos[i].uAIType != 1 )//if ( v7[8] != 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
241 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
242 if ( !MonsterStats::BelongsToSupertype(pMonsterStats->pInfos[i].uID, MONSTER_SUPERTYPE_8) ) //!MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
243 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
244 //v8 = (unsigned __int8)pMonsterStats->pInfos[i].uLevel;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
245 if ( pMonsterStats->pInfos[i].uLevel >= v4 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
246 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
247 if ( pMonsterStats->pInfos[i].uLevel <= num_monsters )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
248 v23[v6++] = i;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
249 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
250 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
251 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
252 // ++v27;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
253 //v7 += 88;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
254 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
255 //while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
256 num_monsters = 6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
257 if ( v6 < 6 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
258 num_monsters = v6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
259 //v9 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
260 if ( num_monsters > 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
261 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
262 for ( uint i = 0; i < num_monsters; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
263 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
264 //v10 = rand();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
265 //++v9;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
266 //v12 = __OFSUB__(v9, num_monsters);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
267 //v11 = v9 - num_monsters < 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
268 //*((short *)&window.pControlsTail + v9 + 1) = v23[rand() % v6];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
269 monster_ids[i] = v23[rand() % v6];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
270 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
271 //while ( v11 ^ v12 );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
272 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
273 if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
274 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
275 v16 = rand();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
276 v17 = 3;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
277 v22 = 50;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
278 v18 = v16 % v17;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
279 v13 = v22;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
280 v14 = v18 + 6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
281 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
282 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
283 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
284 v16 = rand();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
285 v17 = 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
286 v22 = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
287 v18 = v16 % v17;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
288 v13 = v22;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
289 v14 = v18 + 6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
290 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
291 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
292 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
293 v15 = rand() % 11;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
294 v13 = 200;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
295 v14 = v15 + 10;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
296 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
297 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
298 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
299 if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
300 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
301 v13 = 500;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
302 v14 = 20;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
303 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
304 //else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
305 //{
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
306 //v14 = v27;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
307 //v13 = gold_transaction_amount;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
308 //}
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
309 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
310 gold_transaction_amount = v26 * v13;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
311 for ( i = 0; i < v14; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
312 Actor::Arena_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
313 pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
314 }