annotate UI/UIArena.cpp @ 2425:d922225a6081

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