annotate UI/UIArena.cpp @ 2412:e7a551f458e1

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