annotate Engine/Spells/CastSpellInfo.cpp @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents dd36326a9994
children
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3 #include <stdlib.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4 #include <crtdbg.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
6 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
7
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8 #include "CastSpellInfo.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 #include "../Objects/Actor.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10 #include "../Party.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
11 #include "IO/Mouse.h"
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
12 #include "Engine/stru6.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
13 #include "GUI/GUIWindow.h"
a77c34acdbc9 Media folder
Ritor1
parents: 2501
diff changeset
14 #include "Media/Audio/AudioPlayer.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 #include "../Graphics/Outdoor.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 #include "../Graphics/Overlays.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 #include "../Events.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 #include "../Graphics/Viewport.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 #include "../OurMath.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20 #include "../Objects/SpriteObject.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21 #include "../Objects/ObjectList.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 #include "../stru123.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 #include "../Timer.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24 #include "../Tables/IconFrameTable.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 #include "../Awards.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 #include "../TurnEngine/TurnEngine.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 #include "../texts.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 #include "../LOD.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 #include "../Graphics/Level/Decoration.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents: 2499
diff changeset
30 #include "..\..\GUI\UI\UIPartyCreation.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 const size_t CastSpellInfoCount = 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 std::array<CastSpellInfo, CastSpellInfoCount> pCastSpellInfo;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 //----- (00427E01) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 void CastSpellInfoHelpers::_427E01_cast_spell()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 int spell_level; // edi@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 CastSpellInfo *pCastSpell; // ebx@2
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 signed int v6; // eax@14
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 unsigned __int16 v11; // cx@45
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 signed int i; // esi@76
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43 // Actor *pActor; // edi@177
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44 int v61; // ecx@184
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 int v111; // eax@274
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
46 int dist_X; // eax@278
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 // int new_dist_Y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
48 int dist_Z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
49 // int v116; // edx@279
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
50 // int v117; // edx@281
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
51 // int v118; // edx@283
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
52 int v169; // eax@344
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
53 int v188; // esi@369
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54 int v189; // edi@369
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55 int v206; // eax@407
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56 double v241; // st7@478
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57 ItemGen *v245; // edi@492
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58 int v258; // ecx@514
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
59 char v259; // al@516
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
60 int v260; // eax@518
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
61 int v261; // esi@519
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
62 int v262; // edx@521
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
63 int *v263; // ecx@521
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
64 int v264; // esi@521
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
65 int v265; // edx@521
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
66 int *ii; // eax@522
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
67 int v267; // eax@524
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
68 int v268; // eax@524
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
69 int v278; // ecx@548
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
70 char v279; // al@550
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
71 int v280; // eax@552
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
72 int *v281; // esi@553
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
73 int v282; // edx@555
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
74 int *v283; // ecx@555
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
75 int v284; // esi@555
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
76 int v285; // edx@555
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
77 int *l; // eax@556
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
78 int v295; // edx@575
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
79 char v313; // al@606pGame->GetStru6()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
80 const char *v317; // ecx@617
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
81 // int v396; // eax@752
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
82 __int16 v448; // ax@864
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
83 DDM_DLV_Header *v613; // eax@1108
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
84 int v642; // edi@1156
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
85 int v643; // eax@1156
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
86 int v659; // [sp+0h] [bp-E84h]@123
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
87 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
88 int v666; // [sp+4h] [bp-E80h]@12
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
89 PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
90 int v679[800]; // [sp+14h] [bp-E70h]@515
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
91 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
92 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
93 Vec3_int_ v688; // [sp+D2Ch] [bp-158h]@943
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
94 Vec3_int_ v691; // [sp+D38h] [bp-14Ch]@137
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
95 Vec3_int_ v694; // [sp+D44h] [bp-140h]@982
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
96 Vec3_int_ v697; // [sp+D50h] [bp-134h]@129
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
97 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
98 Vec3_int_ v701; // [sp+D68h] [bp-11Ch]@286
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
99 Vec3_int_ v704; // [sp+D74h] [bp-110h]@132
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
100 Vec3_int_ v707; // [sp+D80h] [bp-104h]@1127
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
101 int v710; // [sp+D8Ch] [bp-F8h]@1156
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
102 int n; // [sp+DA0h] [bp-E4h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
103 AIDirection v715; // [sp+DA4h] [bp-E0h]@21
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
104 int mon_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
105 int dist_Y; // [sp+DD8h] [bp-ACh]@163
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
106 int v723; // [sp+E4Ch] [bp-38h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
107 ItemGen *_this; // [sp+E50h] [bp-34h]@23
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
108 int v725; // [sp+E54h] [bp-30h]@23
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
109 int buff_resist;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
110 bool spell_sound_flag; // [sp+E5Ch] [bp-28h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
111 Player *pPlayer; // [sp+E64h] [bp-20h]@8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
112 int v730; // [sp+E68h] [bp-1Ch]@53
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
113 ItemGen *v730c;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
114 int skill_level; // [sp+E6Ch] [bp-18h]@48
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
115 signed int v732; // [sp+E70h] [bp-14h]@325
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
116 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
117 int duration;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
118 signed int a2; // [sp+E7Ch] [bp-8h]@14
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
119 int amount; // [sp+E80h] [bp-4h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
120 int obj_type;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
121 ItemDesc* _item;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
122
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
123 SpriteObject pSpellSprite; // [sp+DDCh] [bp-A8h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
124
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
125 spell_level = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
126 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
127 LODWORD(v733) = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
128 v723 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
129 spell_sound_flag = false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
130 for(n = 0; n < CastSpellInfoCount; ++n)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
131 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
132 pCastSpell = &pCastSpellInfo[n];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
133 HIDWORD(v733) = (int)pCastSpell;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
134 if ( pCastSpell->uSpellID == 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
135 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
136
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
137 if (pParty->Invisible())
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
138 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
139
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
140 if ( pCastSpell->uFlags & ON_CAST_CastingInProgress )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
141 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
142 if ( !pParty->pPlayers[pCastSpell->uPlayerID].CanAct() )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
143 _427D48();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
144 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
145 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
146 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
147
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
148 a2 = pCastSpell->spell_target_pid;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
149 if (!pCastSpell->spell_target_pid)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
150 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
151 if (pCastSpell->uSpellID == SPELL_LIGHT_DESTROY_UNDEAD ||
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
152 pCastSpell->uSpellID == SPELL_SPIRIT_TURN_UNDEAD ||
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
153 pCastSpell->uSpellID == SPELL_DARK_CONTROL_UNDEAD )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
154 v666 = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
155 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
156 v666 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
157
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
158 a2 = stru_50C198.FindClosestActor(5120, 1, v666);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
159 v6 = pMouse->uPointingObjectID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
160 if ( pMouse->uPointingObjectID && PID_TYPE(v6) == OBJECT_Actor && pActors[PID_ID(v6)].CanAct() )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
161 a2 = pMouse->uPointingObjectID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
162 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
163
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
164
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
165 pSpellSprite.uType = spell_sprite_mapping[pCastSpell->uSpellID].uSpriteType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
166 if (pSpellSprite.uType != SPRITE_NULL)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
167 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
168 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
169 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
170 Actor::GetDirectionInfo(PID(OBJECT_Player, pCastSpell->uPlayerID + 1), a2, &v715, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
171 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
172 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
173 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
174 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
175 v715.uYawAngle = pParty->sRotationY;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
176 v715.uPitchAngle = pParty->sRotationX;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
177 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
178 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
179
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
180 v725 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
181 _this = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
182 if (pCastSpell->forced_spell_skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
183 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
184 v11 = pCastSpell->forced_spell_skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
185 v723 = v11 & 0x3F; // 6 bytes
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
186 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
187 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
188 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
189 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
190 //v667 = PLAYER_SKILL_STAFF;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
191 if (pCastSpell->uSpellID < SPELL_AIR_WIZARD_EYE)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
192 v667 = PLAYER_SKILL_FIRE;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
193 else if (pCastSpell->uSpellID < SPELL_WATER_AWAKEN)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
194 v667 = PLAYER_SKILL_AIR;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
195 else if (pCastSpell->uSpellID < SPELL_EARTH_STUN)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
196 v667 = PLAYER_SKILL_WATER;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
197 else if (pCastSpell->uSpellID < SPELL_SPIRIT_DETECT_LIFE)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
198 v667 = PLAYER_SKILL_EARTH;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
199 else if (pCastSpell->uSpellID < SPELL_MIND_REMOVE_FEAR)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
200 v667 = PLAYER_SKILL_SPIRIT;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
201 else if (pCastSpell->uSpellID < SPELL_BODY_CURE_WEAKNESS)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
202 v667 = PLAYER_SKILL_MIND;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
203 else if (pCastSpell->uSpellID < SPELL_LIGHT_LIGHT_BOLT)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
204 v667 = PLAYER_SKILL_BODY;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
205 else if (pCastSpell->uSpellID < SPELL_DARK_REANIMATE)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
206 v667 = PLAYER_SKILL_LIGHT;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
207 else if (pCastSpell->uSpellID < SPELL_BOW_ARROW)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
208 v667 = PLAYER_SKILL_DARK;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
209 else if (pCastSpell->uSpellID == SPELL_BOW_ARROW)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
210 v667 = PLAYER_SKILL_BOW;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
211 else if (pCastSpell->uSpellID == SPELL_101 || pCastSpell->uSpellID == SPELL_LASER_PROJECTILE )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
212 v667 = PLAYER_SKILL_BLASTER;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
213 else assert(false && "Unknown spell");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
214
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
215 v725 = v667;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
216 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
217 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
218 v11 = pPlayer->pActiveSkills[v725];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
219 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
220
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
221 skill_level = SkillToMastery(v11);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
222 if (pCastSpell->uSpellID < SPELL_BOW_ARROW )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
223 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
224 if (pCastSpell->forced_spell_skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
225 uRequiredMana = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
226 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
227 uRequiredMana = pSpellDatas[pCastSpell->uSpellID].mana_per_skill[skill_level - 1];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
228 sRecoveryTime = pSpellDatas[pCastSpell->uSpellID].recovery_per_skill[skill_level - 1];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
229 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
230
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
231 if (v725 == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
232 v725 == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
233 uRequiredMana = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
234
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
235 if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
236 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
237 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2); // "Not enough spell points"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
238 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
239 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
240 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
241 v730 = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
242 if (pPlayer->IsCursed() && pCastSpell->uSpellID < SPELL_BOW_ARROW && rand() % 100 < 50)//íåóäà÷íîå êàñòîâàíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
243 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
244 if (!pParty->bTurnBasedModeOn)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
245 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
246 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
247 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
248 pParty->pTurnBasedPlayerRecoveryTimes[pCastSpellInfo[n].uPlayerID] = 100;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
249 pPlayer->SetRecoveryTime(sRecoveryTime);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
250 pTurnEngine->ApplyPlayerAction();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
251 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
252 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // "Spell failed"
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
253 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
254 pCastSpellInfo[n].uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
255 pPlayer->sMana -= uRequiredMana;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
256 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
257 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
258
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
259 switch ( pCastSpell->uSpellID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
260 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
261 case SPELL_101:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
262 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
263 case SPELL_BOW_ARROW://ñòðåëüáà èç ëóêà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
264 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
265 amount = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
266 if ( SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
267 amount = 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
268 sRecoveryTime = pPlayer->GetAttackRecoveryTime(true);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
269 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
270 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
271 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
272 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
273 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
274 if ( pPlayer->WearsItem(ITEM_ARTEFACT_ULLYSES, EQUIP_BOW) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
275 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
276 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
277 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
278 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
279 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
280 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
281 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
282 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
283 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
284 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
285 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
286 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
287 memcpy(&pSpellSprite.containing_item, &pPlayer->pInventoryItemList[pPlayer->pEquipment.uBow - 1], sizeof(pSpellSprite.containing_item));
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
288 pSpellSprite.uAttributes = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
289 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
290 pSpellSprite.uAttributes = 260;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
291 for ( i = 0; i < amount; ++i )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
292 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
293 if ( i )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
294 pSpellSprite.vPosition.z += 32;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
295 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
296 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
297 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
298 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
299 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
300 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
301 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
302 case SPELL_LASER_PROJECTILE://ñòðåëüáà èç áëàñòåðà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
303 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
304 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
305 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
306 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
307 pSpellSprite.spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
308 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
309 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
310 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
311 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
312 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
313 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
314 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
315 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
316 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
317 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
318 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
319 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
320 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
321 memcpy(&pSpellSprite.containing_item, &pPlayer->pInventoryItemList[pPlayer->pEquipment.uMainHand - 1], sizeof(pSpellSprite.containing_item));
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
322 // &pParty->pPlayers[pCastSpell->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
323 // * pParty->pPlayers[pCastSpell->uPlayerID].pEquipment.uMainHand + 5], );
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
324 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
325 HIBYTE(pSpellSprite.uAttributes) |= 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
326 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
327 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
328 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
329 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
330 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
331 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
332 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
333 case SPELL_FIRE_TORCH_LIGHT://ñâåò ôàêåëà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
334 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
335 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
336 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
337 case 1: amount = 2; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
338 case 2: amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
339 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
340 case 4: amount = 4; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
341 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
342 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
343 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
344 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
345 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
346 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * spell_level * 4.2666669), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
347 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
348 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
349 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
350 case SPELL_FIRE_FIRE_SPIKE://îãíåííûé øèï
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
351 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
352 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
353 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
354 case 1: amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
355 case 2: amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
356 case 3: amount = 7; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
357 case 4: amount = 9; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
358 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
359 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
360 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
361 int _v733 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
362 for (uint i = 0; i < uNumSpriteObjects; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
363 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
364 SpriteObject* object = &pSpriteObjects[i];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
365 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
366 ++_v733;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
367 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
368 if ( _v733 > amount )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
369 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
370 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
371 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
372 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
373 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
374 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
375 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
376 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
377 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
378 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
379 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
380 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
381 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
382 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
383 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
384 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
385 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
386 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
387 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
388 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
389 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
390 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
391 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
392 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
393 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
394 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
395 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
396 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX + 10, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
397 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
398 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
399 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
400 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
401 case SPELL_AIR_IMPLOSION://Òî÷íûé âçðûâ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
402 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
403 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
404 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
405 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
406 if (!a2)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
407 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
408 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
409 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
410 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
411 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
412 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
413 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
414 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
415 v697.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
416 v697.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
417 v697.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
418 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
419 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
420 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
421 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
422 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
423 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
424 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
425 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
426 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
427 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
428 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
429 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
430 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
431 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
432 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
433 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, mon_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
434 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v697);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
435 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
436 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
437 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
438 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
439 case SPELL_EARTH_MASS_DISTORTION://Èçìåíåíèå âåñà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
440 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
441 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
442 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
443 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
444 if ( pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)3) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
445 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
446 pActors[mon_id].pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
447 v704.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
448 v704.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
449 v704.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
450 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
451 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
452 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
453 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
454 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
455 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
456 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
457 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
458 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
459 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
460 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
461 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
462 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
463 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
464 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
465 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, mon_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
466 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v704);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
467 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
468 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
469 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
470 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
471 case SPELL_LIGHT_DESTROY_UNDEAD://Óíè÷òîæåíèå íåæèòè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
472 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
473 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || PID_TYPE(a2) != OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
474 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
475 //v730 = a2 >> 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
476 //HIDWORD(v733) = (int)&pActors[PID_ID(a2)];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
477 v691.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
478 v691.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
479 v691.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
480 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
481 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
482 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
483 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
484 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
485 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
486 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
487 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
488 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
489 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
490 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
491 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
492 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
493 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
494 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
495 pSpellSprite.uAttributes |= 0x80u;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
496 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
497 int obj_id = pSpellSprite.Create(0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
498 if ( !MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
499 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
500 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
501 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
502 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
503 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
504 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
505 Actor::DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
506 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
507 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
508 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
509 case SPELL_FIRE_FIRE_BOLT://Óäàð îãíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
510 case SPELL_FIRE_FIREBALL://Îãíåííûé øàð
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
511 case SPELL_FIRE_INCINERATE://Èñïåïåëåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
512 case SPELL_AIR_LIGHNING_BOLT://Óäàð ìîëíèè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
513 case SPELL_WATER_ICE_BOLT://Ëüäÿíàÿ ìîëíèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
514 case SPELL_WATER_ICE_BLAST://Ëüäÿíîé âçðûâ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
515 case SPELL_EARTH_STUN://Îãëóøèòü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
516 case SPELL_EARTH_DEADLY_SWARM://Ðîé ñìåðòè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
517 case SPELL_MIND_MIND_BLAST://Óäàð ìûñëè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
518 case SPELL_MIND_PSYCHIC_SHOCK://Ïñèõè÷åñêèé øîê
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
519 case SPELL_BODY_HARM://Âðåä
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
520 case SPELL_LIGHT_LIGHT_BOLT://Ëó÷ ñâåòà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
521 case SPELL_DARK_DRAGON_BREATH://Äûõàíèå äðàêîíà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
522 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
523 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
524 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
525 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
526 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
527 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
528 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
529 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
530 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
531 pSpellSprite.vPosition.x = pParty->vPosition.x;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
532 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
533 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
534 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
535 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
536 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
537 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
538 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
539 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
540 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
541 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
542 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
543 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
544 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
545 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
546 if ( pCastSpell->uSpellID == SPELL_AIR_LIGHNING_BOLT )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
547 LOBYTE(pSpellSprite.uAttributes) |= 0x40;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
548 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
549 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
550 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
551 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
552 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
553 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
554 case SPELL_WATER_ACID_BURST://Âñïëåñê êèñëîòû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
555 case SPELL_EARTH_BLADES://Ëåçâèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
556 case SPELL_BODY_FLYING_FIST://Ëåòàþùèé êóëàê
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
557 case SPELL_DARK_TOXIC_CLOUD://Îáëàêî-òîêñèí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
558 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
559 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
560 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
561 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
562 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
563 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
564 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
565 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
566 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
567 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
568 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
569 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
570 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
571 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
572 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
573 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
574 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
575 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
576 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
577 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
578 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
579 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
580 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
581 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
582 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
583 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
584 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
585 case SPELL_LIGHT_SUNRAY://Ëó÷ Ñîëíöà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
586 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
587 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
588 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 21) )//òîëüêî â äíåâíîå âðåìÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
589 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
590 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
591 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
592 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
593 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
594 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
595 if ( pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
596 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
597 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
598 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
599 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
600 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
601 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
602 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
603 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
604 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
605 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
606 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
607 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
608 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
609 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
610 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
611 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
612 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
613 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
614 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
615 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
616 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
617 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
618 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
619 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
620 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
621 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
622 case SPELL_LIGHT_PARALYZE://Ïàðàëè÷
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
623 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
624 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
625 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
626 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
627 if (PID_TYPE(a2) == OBJECT_Actor && pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)9) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
628 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
629 Actor::AI_Stand(PID_ID(a2), 4, 0x80, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
630 pActors[mon_id].pActorBuffs[ACTOR_BUFF_PARALYZED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
631 pActors[mon_id].uAttributes |= ACTOR_AGGRESSOR;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
632 pActors[mon_id].vVelocity.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
633 pActors[mon_id].vVelocity.y = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
634 pEngine->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
635 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
636 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
637 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
638 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
639 case SPELL_EARTH_SLOW://Çàìåäëåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
640 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
641 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
642 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
643 case 1: LODWORD(v733) = 180 * spell_level; amount = 2; break;//LODWORD(v733)???íå ïðèìåíÿåòñÿ äàëåå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
644 case 2: LODWORD(v733) = 300 * spell_level; amount = 2; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
645 case 3: LODWORD(v733) = 300 * spell_level; amount = 4; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
646 case 4: LODWORD(v733) = 300 * spell_level; amount = 8; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
647 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
648 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
649 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
650 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
651 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
652 //v721 = 836 * PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
653 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
654 if (PID_TYPE(a2) == OBJECT_Actor && pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)3) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
655 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
656 pActors[mon_id].pActorBuffs[ACTOR_BUFF_SLOWED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
657 pActors[mon_id].uAttributes |= ACTOR_AGGRESSOR;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
658 pEngine->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
659 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
660 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
661 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
662 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
663 case SPELL_MIND_CHARM:// Î÷àðîâàíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
664 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
665 v61 = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
666 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
667 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
668 if ( pActors[v61].DoesDmgTypeDoDamage((DAMAGE_TYPE)7) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
669 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
670 uint power = 300 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
671 if ( skill_level == 2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
672 power = 600 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
673 else if ( skill_level == 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
674 power = 29030400;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
675
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
676 pActors[v61].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
677 pActors[v61].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
678 pActors[v61].pActorBuffs[ACTOR_BUFF_CHARM].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335), skill_level, 0, 0, 0);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
679 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
680 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
681 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
682 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
683 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
684 pSpellSprite.vPosition.x = pActors[v61].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
685 pSpellSprite.vPosition.y = pActors[v61].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
686 pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
687 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
688 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
689 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
690 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
691 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
692 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
693 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
694 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
695 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
696 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
697 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
698 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
699 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
700 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
701 case SPELL_DARK_SHRINKING_RAY://Ñæèìàþùèé ëó÷
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
702 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
703 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
704 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
705 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
706 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
707 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
708 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
709 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
710 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
711 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
712 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
713 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
714 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
715 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
716 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
717 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
718 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
719 pSpellSprite.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
720 pSpellSprite.spell_level = 300 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
721 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
722 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
723 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
724 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
725 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
726 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
727 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
728 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
729 case SPELL_FIRE_FIRE_AURA: //Àóðà îãíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
730 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
731 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
732 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
733 case 1: duration = 3600 * spell_level; amount = 10; break; //Îãíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
734 case 2: duration = 3600 * spell_level; amount = 11; break; //Îãíåííîãî æàðà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
735 case 3: duration = 3600 * spell_level; amount = 12; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
736 case 4: duration = 0; amount = 12; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
737 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
738 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
739 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
740 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
741 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
742 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
743 _item = &pItemsTable->pItems[v730c->uItemID];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
744 v730c->UpdateTempBonus(pParty->uTimePlayed);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
745 if ( v730c->uItemID < 64 || v730c->uItemID > 65
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
746 && !v730c->IsBroken()
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
747 && !v730c->special_enchantment
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
748 && !v730c->uEnchantmentType
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
749 && ( _item->uEquipType == EQUIP_SINGLE_HANDED || _item->uEquipType == EQUIP_TWO_HANDED || _item->uEquipType == EQUIP_BOW)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
750 && !pItemsTable->IsMaterialNonCommon(v730c) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
751 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
752 v730c->special_enchantment = (ITEM_ENCHANTMENT)amount;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
753 if ( skill_level != 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
754 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
755 v730c->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
756 v730c->uAttributes |= ITEM_TEMP_BONUS;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
757 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
758 v730c->uAttributes |= ITEM_AURA_EFFECT_RED;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
759 _50C9A8_item_enchantment_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
760 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
761 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
762 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
763 _50C9D0_AfterEnchClickEventId = 113;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
764 _50C9D4_AfterEnchClickEventSecondParam = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
765 _50C9D8_AfterEnchClickEventTimeout = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
766 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
767 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
768 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
769 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
770 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
771 case SPELL_BODY_REGENERATION://Ðåãåíåðàöèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
772 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
773 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
774 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
775 case 1: amount = 1; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
776 case 2: amount = 1; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
777 case 3: amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
778 case 4: amount = 10; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
779 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
780 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
781 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
782 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
783 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
784 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
785 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(3600 * spell_level) * 4.2666669), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
786 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
787 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
788 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
789 case SPELL_FIRE_PROTECTION_FROM_FIRE://Çàùèòà îò Îãíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
790 case SPELL_AIR_PROTECTION_FROM_AIR://Çâùèòà îò Âîçäóõà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
791 case SPELL_WATER_PROTECTION_FROM_WATER://Çàùèòà îò Âîäû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
792 case SPELL_EARTH_PROTECTION_FROM_EARTH://Çàùèòà îò Çåìëè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
793 case SPELL_MIND_PROTECTION_FROM_MIND://Çàùèòà îò Ìûñëè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
794 case SPELL_BODY_PROTECTION_FROM_BODY://Çàùèòà îò Òåëà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
795 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
796 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
797 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
798 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
799 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
800 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
801 case 4: amount = skill_level * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
802 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
803 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
804 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
805 switch (pCastSpell->uSpellID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
806 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
807 case SPELL_FIRE_PROTECTION_FROM_FIRE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
808 buff_resist = PARTY_BUFF_RESIST_FIRE;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
809 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
810 case SPELL_AIR_PROTECTION_FROM_AIR:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
811 buff_resist = PARTY_BUFF_RESIST_AIR;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
812 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
813 case SPELL_WATER_PROTECTION_FROM_WATER:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
814 buff_resist = PARTY_BUFF_RESIST_WATER;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
815 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
816 case SPELL_EARTH_PROTECTION_FROM_EARTH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
817 buff_resist = PARTY_BUFF_RESIST_EARTH;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
818 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
819 case SPELL_MIND_PROTECTION_FROM_MIND:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
820 buff_resist = PARTY_BUFF_RESIST_MIND;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
821 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
822 case SPELL_BODY_PROTECTION_FROM_BODY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
823 buff_resist = PARTY_BUFF_RESIST_BODY;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
824 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
825 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
826 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
827 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
828 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
829 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
830 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
831 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
832 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
833 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
834 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
835 //v90 = (double)(signed int)(3600 * spell_level) * 4.2666669;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
836 pParty->pPartyBuffs[buff_resist].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(3600 * spell_level) * 4.2666669), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
837 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
838 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
839 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
840 case SPELL_FIRE_HASTE://Ñïåøêà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
841 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
842 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
843 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
844 case 1: duration = 60 * (spell_level + 60); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
845 case 2: duration = 60 * (spell_level + 60); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
846 case 3: duration = 180 * (spell_level + 20); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
847 case 4: duration = 240 * (spell_level + 15); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
848 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
849 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
850 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
851 if ( pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
852 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
853 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
854 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
855 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
856 if ( pParty->pPlayers[pl_id].pConditions[Condition_Weak] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
857 spell_sound_flag = false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
858 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
859 if ( spell_sound_flag )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
860 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
861 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
862 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
863 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
864 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
865 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
866 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
867 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
868 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
869 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
870 case SPELL_SPIRIT_BLESS://Áëàãîñëîâåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
871 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
872 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
873 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
874 case 1: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
875 case 2: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
876 case 3: duration = 900 * (spell_level + 4); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
877 case 4: duration = 3600 * (spell_level + 1); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
878 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
879 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
880 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
881 amount = spell_level + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
882 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
883 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
884 if ( skill_level == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
885 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
886 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
887 v111 = pOtherOverlayList->_4418B1(10000, pCastSpell->uPlayerID_2 + 310, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
888 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
889 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), 1, amount, v111, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
890 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
891 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
892 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
893 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
894 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
895 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
896 v111 = pOtherOverlayList->_4418B1(10000, pl_id + 310, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
897 pParty->pPlayers[pl_id].pPlayerBuffs[1].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
898 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, v111, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
899 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
900 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
901 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
902 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
903 case SPELL_SPIRIT_SPIRIT_LASH://Ïëåòü Äóõà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
904 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
905 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
906 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
907 int mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
908 dist_X = abs(pActors[mon_id].vPosition.x - pParty->vPosition.x);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
909 dist_Y = abs(pActors[mon_id].vPosition.y - pParty->vPosition.y);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
910 dist_Z = abs(pActors[mon_id].vPosition.z - pParty->vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
911 int count = int_get_vector_length(dist_X, dist_Y, dist_Z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
912 if ( (double)count <= 307.2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
913 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
914 v701.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
915 v701.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
916 v701.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
917 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
918 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
919 pSpellSprite.spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
920 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
921 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
922 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
923 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
924 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
925 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
926 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
927 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
928 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
929 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
930 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
931 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z - (unsigned int)(signed __int64)((double)pActors[mon_id].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
932 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
933 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v701);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
934 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
935 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
936 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
937 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
938 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2);//"Íå ïîëó÷èëîñü!!!"
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
939 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
940 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
941 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
942 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
943 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
944 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
945 case SPELL_AIR_SHIELD://Ùèò
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
946 case SPELL_EARTH_STONESKIN://Êàìåííàÿ êîæà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
947 case SPELL_SPIRIT_HEROISM://Ãåðîèçì
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
948 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
949 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
950 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
951 case 1: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
952 case 2: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
953 case 3: duration = 900 * (spell_level + 4); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
954 case 4: duration = 3600 * (spell_level + 1); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
955 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
956 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
957 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
958 switch (pCastSpell->uSpellID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
959 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
960 case SPELL_AIR_SHIELD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
961 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
962 buff_resist = PARTY_BUFF_SHIELD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
963 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
964 case SPELL_EARTH_STONESKIN:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
965 amount = spell_level + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
966 buff_resist = PARTY_BUFF_STONE_SKIN;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
967 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
968 case SPELL_SPIRIT_HEROISM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
969 amount = spell_level + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
970 buff_resist = PARTY_BUFF_HEROISM;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
971 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
972 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
973 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
974 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
975 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
976 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
977 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
978 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
979 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
980 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
981 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
982 pParty->pPartyBuffs[buff_resist].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
983 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
984 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
985 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
986 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
987 case SPELL_FIRE_IMMOLATION://Êîëüöî îãíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
988 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
989 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
990 duration = 600 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
991 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
992 duration = 60 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
993 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
994 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
995 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
996 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
997 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
998 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
999 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1000 (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, spell_level, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1001 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1002 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1003 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1004 case SPELL_FIRE_METEOR_SHOWER://Ïîòîê ìåòåîðîâ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1005 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1006 //if (skill_level < 3)//äëÿ ìàñòåðà è ìàãèñòðà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1007 //break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1008 int meteor_num;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1009 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1010 meteor_num = 20;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1011 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1012 meteor_num = 16;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1013 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1014 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1015 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1016 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1017 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1018 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1019 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1020 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1021 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1022 obj_type = PID_TYPE(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1023 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1024 if (obj_type == OBJECT_Actor)//åñëè çàêë ïîñòàâèòü íà áûñòðîå çàêë., òî ìîæíî óêàçûâàòü êóäà êèäàòü ìåòåîðû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1025 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1026 dist_X = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1027 dist_Y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1028 dist_Z = pActors[mon_id].vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1029 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1030 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1031 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1032 dist_X = pParty->vPosition.x + fixpoint_mul(2048, stru_5C6E00->Cos(pParty->sRotationY));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1033 dist_Y = pParty->vPosition.y + fixpoint_mul(2048, stru_5C6E00->Sin(pParty->sRotationY));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1034 dist_Z = pParty->vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1035 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1036 unsigned __int64 k = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1037 int j = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1038 if ( meteor_num > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1039 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1040 v730 = obj_type == OBJECT_Actor ? a2 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1041 for ( meteor_num; meteor_num; meteor_num-- )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1042 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1043 a2 = rand() % 1000;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1044 if ( sqrt(((double)a2 - 2500) * ((double)a2 - 2500) + j * j + k * k) <= 1.0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1045 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1046 LODWORD(v687) = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1047 HIDWORD(v687) = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1048 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1049 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1050 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1051 HIDWORD(v687) = stru_5C6E00->Atan2((signed __int64)sqrt((float)(j * j + k * k)), (double)a2 - 2500);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1052 LODWORD(v687) = stru_5C6E00->Atan2(j, k);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1053 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1054 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1055 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1056 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1057 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1058 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1059 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1060 pSpellSprite.vPosition.x = dist_X;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1061 pSpellSprite.vPosition.y = dist_Y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1062 pSpellSprite.vPosition.z = a2 + dist_Z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1063 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1064 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1065 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1066 pSpellSprite.spell_target_pid = v730;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1067 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1068 pSpellSprite.uFacing = v687;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1069 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1070 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1071 pSpellSprite.uAttributes = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1072 if ( pSpellSprite.Create(v687, SHIDWORD(v687), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1073 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1074 j = rand() % 1024 - 512;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1075 k = rand() % 1024 - 512;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1076 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1077 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1078 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1079 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1080 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1081 case SPELL_FIRE_INFERNO://Àäñêèé îãîíü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1082 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1083 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1084 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1085 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1086 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1087 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1088 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1089 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1090 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1091 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1092 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport(4096);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1093 v700.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1094 v700.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1095 v700.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1096 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1097 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1098 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1099 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1100 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1101 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1102 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1103 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1104 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1105 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1106 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1107 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1108 for ( uint i = 0; i < mon_num; i++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1109 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1110 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1111 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1112 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[i]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1113 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[i]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1114 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[i], &v700);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1115 pEngine->GetStru6()->RenderAsSprite(&pSpellSprite);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1116 pEngine->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1E, 0x40);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1117 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1118 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1119 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1120 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1121 case SPELL_AIR_WIZARD_EYE://Îêî ÷àðîäåÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1122 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1123 duration = 3600 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1124 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1125 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1126 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1127 v169 = pOtherOverlayList->_4418B1(2000, pl_id + 100, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1128 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, v169, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1129 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1130 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1131 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1132 case SPELL_AIR_FEATHER_FALL://Ïàäåíèå ïåðà(ï¸ðûøêîì)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1133 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1134 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1135 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1136 case 1: duration = 300 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1137 case 2: duration = 600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1138 case 3: duration = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1139 case 4: duration = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1140 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1141 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1142 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1143 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1144 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1145 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1146 pOtherOverlayList->_4418B1(2010, pl_id + 100, 0, 65536);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1147 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1148 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1149 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1150 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1151
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1152 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1153 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1154 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1155 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1156 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1157 case SPELL_AIR_SPARKS://Èñêðû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1158 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1159 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1160 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1161 case 1: amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1162 case 2: amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1163 case 3: amount = 7; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1164 case 4: amount = 9; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1165 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1166 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1167 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1168 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1169 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1170 int _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1171 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1172 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1173 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1174 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1175 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1176 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1177 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1178 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1179 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1180 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1181 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1182 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1183 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1184 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1185 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1186 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1187 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1188 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1189 v188 = (signed int)_v726 / -2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1190 v189 = (signed int)_v726 / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1191 while ( v188 <= v189 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1192 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1193 pSpellSprite.uFacing = v188 + LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1194 if ( pSpellSprite.Create((signed __int16)(v188 + LOWORD(v715.uYawAngle)), v715.uPitchAngle,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1195 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, pCastSpell->uPlayerID + 1) != -1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1196 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1197 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1198 v188 += _v726 / (amount - 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1199 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1200 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1201 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1202 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1203 case SPELL_AIR_JUMP://Ïðûæîê
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1204 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1205 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1206 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1207 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1208 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1209 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1210 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1211 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1212 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1213 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1214 pOtherOverlayList->_4418B1(2040, pl_id + 100, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1215 pParty->uFlags |= 0x100;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1216 pParty->uFallSpeed = 1000;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1217 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1218 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1219 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1220 case SPELL_AIR_INVISIBILITY://Íåâèäèìîñòü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1221 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1222 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1223 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1224 case 1: duration = 600 * spell_level; amount = spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1225 case 2: duration = 600 * spell_level; amount = 2 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1226 case 3: duration = 600 * spell_level; amount = 3 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1227 case 4: duration = 3600 * spell_level; amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1228 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1229 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1230 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1231 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1232 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1233 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1234 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1235 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1236 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1237 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1238 if ( pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1239 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1240 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1241 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1242 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1243 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1244 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1245 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1246 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1247 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1248 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1249 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1250 case SPELL_AIR_FLY://Ïîë¸ò
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1251 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1252 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1253 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1254 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1255 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1256 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1257 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1258 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1259 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1260 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1261 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1262 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1263 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1264 if ( skill_level == 1 || skill_level == 2 || skill_level == 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1265 amount = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1266 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1267 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1268 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1269 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1270 for ( uint pl_id = 0; pl_id < 4; pl_id++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1271 pOtherOverlayList->_4418B1(2090, pl_id + 100, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1272 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1273 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1274 * 0.033333335), skill_level, amount, v206, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1275 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1276 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1277 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1278 case SPELL_AIR_STARBURST://Çâåçäîïàä
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1279 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1280 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1281 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1282 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1283 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1284 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1285 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1286 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1287 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1288 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1289 obj_type = PID_TYPE(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1290 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1291 if ( obj_type == OBJECT_Actor )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1292 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1293 dist_X = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1294 dist_Y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1295 dist_Z = pActors[mon_id].vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1296 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1297 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1298 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1299 dist_X = pParty->vPosition.x + fixpoint_mul(2048, stru_5C6E00->Cos(pParty->sRotationY));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1300 dist_Y = pParty->vPosition.y + fixpoint_mul(2048, stru_5C6E00->Sin(pParty->sRotationY));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1301 dist_Z = pParty->vPosition.z;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1302 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1303 unsigned __int64 k = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1304 int j = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1305 v730 = obj_type == OBJECT_Actor ? a2 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1306 for ( uint star_num = 20; star_num; star_num-- )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1307 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1308 a2 = rand() % 1000;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1309 if ( sqrt(((double)a2 + (double)dist_Z - (double)(dist_Z + 2500)) * ((double)a2 + (double)dist_Z - (double)(dist_Z + 2500))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1310 + j * j + k * k) <= 1.0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1311 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1312 LODWORD(v685) = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1313 HIDWORD(v685) = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1314 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1315 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1316 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1317 HIDWORD(v685) = stru_5C6E00->Atan2((signed __int64)sqrt((float)(j * j + k * k)), ((double)a2 + (double)dist_Z - (double)(dist_Z + 2500)));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1318 LODWORD(v685) = stru_5C6E00->Atan2(j, k);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1319 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1320 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1321 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1322 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1323 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1324 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1325 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1326 pSpellSprite.vPosition.x = dist_X;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1327 pSpellSprite.vPosition.y = dist_Y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1328 pSpellSprite.vPosition.z = (int)(a2 + (dist_Z + 2500));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1329 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1330 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1331 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1332 pSpellSprite.spell_target_pid = v730;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1333 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1334 pSpellSprite.uFacing = v685;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1335 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1336 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1337 pSpellSprite.uAttributes = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1338 if ( pSpellSprite.Create(v685, SHIDWORD(v685), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1339 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1340 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1341 j = rand() % 1024 - 512;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1342 k = rand() % 1024 - 512;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1343 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1344 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1345 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1346 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1347 case SPELL_WATER_AWAKEN://Ïðîáóæäåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1348 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1349 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1350 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1351 case 1: amount = 180 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1352 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1353 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1354 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1355 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1356 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1357 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1358 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1359 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1360 for( int i=0; i < 4; i++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1361 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1362 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1363 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1364 if ( pParty->pPlayers[i].pConditions[Condition_Sleep] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1365 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1366 pParty->pPlayers[i].pConditions[Condition_Sleep] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1367 pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1368 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1369 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1370 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1371 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1372 if ( pParty->pPlayers[i].DiscardConditionIfLastsLongerThan(Condition_Sleep, pParty->uTimePlayed -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1373 (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1374 pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1375 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1376 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1377 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1378 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1379 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1380 case SPELL_WATER_POISON_SPRAY://Ðàñïûëåíèå ÿäà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1381 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1382 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1383 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1384 case 1: amount = 1; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1385 case 2: amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1386 case 3: amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1387 case 4: amount = 7; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1388 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1389 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1390 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1391 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1392 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1393 signed int _v733 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1394 if ( amount == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1395 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1396 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1397 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1398 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1399 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1400 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1401 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1402 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1403 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1404 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1405 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1406 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1407 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1408 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1409 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1410 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1411 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1412 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1413 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1414 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1415 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1416 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1417 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1418 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1419 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1420 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1421 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1422 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1423 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1424 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1425 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1426 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1427 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1428 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1429 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1430 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1431 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1432 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1433 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1434 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1435 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1436 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1437 v188 = _v733 / -2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1438 v189 = _v733 / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1439 if ( v188 <= v189 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1440 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1441 do
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1442 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1443 pSpellSprite.uFacing = v188 + v715.uYawAngle;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1444 if ( pSpellSprite.Create(pSpellSprite.uFacing, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1445 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1446 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1447 v188 += _v733 / (amount - 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1448 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1449 while ( v188 <= v189 );
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1450 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1451 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1452 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1453 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1454 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1455 case SPELL_WATER_WATER_WALK://Õîæäåíèå ïî âîäå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1456 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1457 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1458 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1459 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1460 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1461 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1462 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1463 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1464 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1465 case 1: //break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1466 case 2: duration = 600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1467 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1468 case 4: duration = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1469 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1470 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1471 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1472 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1473 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1474 v169 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1475 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1476 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1477 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1478 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1479 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(duration << 7) * 0.033333335),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1480 skill_level, amount, v169, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1481 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1482 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1483 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1484 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1485 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1486 case SPELL_WATER_RECHARGE_ITEM://Ïåðåçàðÿäêà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1487 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1488 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1489 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1490 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1491 if ( v730c->GetItemEquipType() != 12 || v730c->uAttributes & 2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1492 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1493 _50C9D0_AfterEnchClickEventId = 113;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1494 _50C9D4_AfterEnchClickEventSecondParam = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1495 _50C9D8_AfterEnchClickEventTimeout = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1496 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1497 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1498 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1499 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1500 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1501 if ( skill_level == 1 || skill_level == 2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1502 v241 = (double)v723 * 0.0099999998 + 0.5;//50 %
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1503 else if ( skill_level == 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1504 v241 = (double)v723 * 0.0099999998 + 0.69999999;//30 %
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1505 else if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1506 v241 = (double)v723 * 0.0099999998 + 0.80000001;//20 %
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1507 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1508 v241 = 0.0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1509 if ( v241 > 1.0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1510 v241 = 1.0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1511 int uNewCharges = v730c->uMaxCharges * v241;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1512 v730c->uMaxCharges = uNewCharges;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1513 v730c->uNumCharges = uNewCharges;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1514 if ( uNewCharges <= 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1515 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1516 v730c = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1517 _50C9D0_AfterEnchClickEventId = 113;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1518 _50C9D4_AfterEnchClickEventSecondParam = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1519 _50C9D8_AfterEnchClickEventTimeout = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1520 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2);//Íå ïîëó÷èëîñü!!!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1521 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1522 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1523 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1524 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1525 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1526 v730c->uAttributes |= 0x40u;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1527 _50C9A8_item_enchantment_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1528 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1529 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1530 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1531 case SPELL_WATER_ENCHANT_ITEM://Òàëèñìàí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1532 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1533 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1534 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1535 uRequiredMana = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1536 amount = 10 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1537 bool item_not_broken = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1538 int rnd = rand() % 100;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1539 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID_2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1540 v245 = &pPlayer->pInventoryItemList[a2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1541 ItemDesc *_v725 = &pItemsTable->pItems[v245->uItemID];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1542 if ((skill_level == 1 || skill_level == 2 /*&& _v725->uEquipType > EQUIP_BOW*/ || skill_level == 3 || skill_level == 4) &&
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1543 v245->uItemID <= 134 &&
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
1544 v245->special_enchantment == 0 && v245->uEnchantmentType == 0 &&
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1545 v245->m_enchantmentStrength== 0 && !v245->IsBroken() ) //òðåáîâàíèÿ ê ïðåäìåòó
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1546 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1547 if ( (v245->GetValue() < 450 && ( skill_level == 1 || skill_level == 2 ))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1548 || (v245->GetValue() < 450 && (skill_level == 3|| skill_level == 4 ) && _v725->uEquipType >= EQUIP_SINGLE_HANDED && _v725->uEquipType <= EQUIP_BOW)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1549 || (v245->GetValue() < 250 && (skill_level == 3 || skill_level == 4 )&& _v725->uEquipType > EQUIP_BOW) )//Óñëîâèÿ ïîëîìêè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1550 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1551 if ( !(v245->uAttributes & 0x200) )// ïðåäìåò íå ñëîìàí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1552 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1553 v245->uAttributes |= 2;//òåïåðü ñëîìàí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1554 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1555 item_not_broken = false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1556 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1557 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1558 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1559 if ( rnd >= 10 * spell_level )//øàíñ íà ñðàáàòûâàíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1560 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1561 if ( !(v245->uAttributes & 0x200) )// ïðåäìåò íå ñëîìàí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1562 v245->uAttributes |= 2;//òåïåðü ñëîìàí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1563 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1564 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1565 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1566 if ( (rnd < 80 && (skill_level == 3 || skill_level == 4 )) || v245->GetValue() < 450 || (v245->GetValue() < 250
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1567 && (skill_level == 3 || skill_level == 4) && _v725->uEquipType >= EQUIP_SINGLE_HANDED && _v725->uEquipType <= EQUIP_BOW))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1568 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1569 v313 = _v725->uEquipType;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1570 if ( _v725->uEquipType >= EQUIP_ARMOUR && _v725->uEquipType <= EQUIP_AMULET )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1571 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1572 v295 = rand() % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1573 /*v245->uEnchantmentType = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1574 __debugbreak(); // castspellinfo.cpp(1971): warning C4700: uninitialized local variable 'v294' used
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1575 for ( kk = pItemsTable->pEnchantments[0].to_item[v245->GetItemEquipType() + 1];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1576 ;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1577 kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[v245->GetItemEquipType() + 1] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1578 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1579 ++v245->uEnchantmentType;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1580 if ( kk >= v295 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1581 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1582 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1583 v255 = 10;//pItemsTable->field_116D8[17];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1584 v256 = 10;//pItemsTable->field_116D8[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1585 v245->m_enchantmentStrength = v256 + rand() % (v255 - v256 + 1);*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1586 v245->uEnchantmentType = v295;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1587 v245->m_enchantmentStrength = pItemsTable->pEnchantments[v295].to_item[_v725->uEquipType - EQUIP_ARMOUR];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1588 v245->uAttributes |= 0x20u;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1589 _50C9A8_item_enchantment_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1590 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1591 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1592 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1593 else if ( skill_level == 3 || skill_level == 4)//for master & GM not refactored(äëÿ ìàñòåðà è ãðàíäà íå îòðåôàêòîðåíî)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1594 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1595 v258 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1596 v725 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1597 int _v733;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1598 if ( pItemsTable->pSpecialEnchantments_count > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1599 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1600 v730 = (int)&v679;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1601 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1602 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1603 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1604 if ( !v259 || v259 == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1605 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1606 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType() + 4] + v258 * 28);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1607 v725 += v260;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1608 if ( v260 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1609 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1610 v261 = v730;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1611 v730 += 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1612 *(int *)v261 = _v733;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1613 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1614 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1615 ++v258;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1616 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1617 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1618 v262 = rand() % v725;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1619 v263 = v679;
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
1620 v245->special_enchantment = (ITEM_ENCHANTMENT)v679[0];
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1621 v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1622 v265 = v262 + 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1623 if ( v264 < v265 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1624 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1625 for ( ii = v679; ; ii = (int *)v732 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1626 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1627 v267 = (int)(ii + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1628 v732 = v267;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1629 v268 = *(int *)v267;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1630 *(int *)(v245 + 12) = v268;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1631 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[v245->GetItemEquipType() + 4];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1632 if ( v264 >= v265 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1633 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1634 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1635 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1636 v278 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1637 v725 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1638 if ( pItemsTable->pSpecialEnchantments_count > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1639 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1640 int *_v730 = v679;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1641 for ( _v733 = 0; _v733 < pItemsTable->pSpecialEnchantments_count; ++_v733 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1642 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1643 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278].pBonusStatement);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1644 if ( !v279 || v279 == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1645 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1646 v280 = *(&pItemsTable->pSpecialEnchantments[v278].to_item_apply[v245->GetItemEquipType()]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1647 _v733 += v280;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1648 if ( v280 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1649 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1650 v281 = _v730;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1651 ++_v730;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1652 *v281 = _v733;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1653 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1654 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1655 ++v278;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1656 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1657 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1658 v282 = rand() % _v733;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1659 v283 = v679;
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
1660 v245->special_enchantment = (ITEM_ENCHANTMENT)v679[0];
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1661 v284 = pItemsTable->pSpecialEnchantments[*v283].to_item_apply[v245->GetItemEquipType() ];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1662 v285 = v282 + 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1663 for ( l = v679; v284 < v285; ++l )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1664 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
1665 v245->special_enchantment = (ITEM_ENCHANTMENT)*(l + 1);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1666 v284 += pItemsTable->pSpecialEnchantments[*(l+1)].to_item_apply[v245->GetItemEquipType()];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1667 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
1668 v245->special_enchantment = (ITEM_ENCHANTMENT)(v245->special_enchantment + 1);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1669 v245->uAttributes |= 0x20u;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1670 _50C9A8_item_enchantment_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1671 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1672 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1673 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1674 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1675 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1676 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1677 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1678 if ( spell_sound_flag == 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1679 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1680 v317 = pGlobalTXT_LocalizationStrings[428];//Íå ïîëó÷èëîñü!!!
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1681 if ( item_not_broken == false )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1682 v317 = pGlobalTXT_LocalizationStrings[585];//Ïðåäìåò íåäîñòàòî÷íî âûñîêîãî êà÷åñòâà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1683 ShowStatusBarString(v317, 2);
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1684 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1685 //v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1686 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1687 pParty->pPlayers[pCastSpell->uPlayerID_2].PlaySound(SPEECH_43, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1688 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1689 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1690 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1691 case SPELL_WATER_TOWN_PORTAL://Ïîðòàë ãîðîäà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1692 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1693 amount = 10 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1694 if ( pPlayer->sMana < (signed int)uRequiredMana )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1695 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1696 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && skill_level != 4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1697 || rand() % 100 >= amount && skill_level != 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1698 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1699 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1700 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1701 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1702 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1703 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1704 town_portal_caster_id = pCastSpell->uPlayerID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1705 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_OnCastTownPortal, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1706 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1707 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1708 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1709 case SPELL_WATER_LLOYDS_BEACON://Ìàÿê Ëëîéäà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1710 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1711 if ( !_stricmp(pCurrentMapName, "d05.blv") ) // Arena
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1712 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1713 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1714 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1715 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1716 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1717 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1718 if ( pPlayer->sMana >= (signed int)uRequiredMana )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1719 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1720 pEventTimer->Pause();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1721 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_OnCastLloydsBeacon, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1722 lloyds_beacon_spell_level = (signed int)(604800 * spell_level);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1723 _506348_current_lloyd_playerid = pCastSpell->uPlayerID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1724 ::uRequiredMana = uRequiredMana;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1725 ::sRecoveryTime = sRecoveryTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1726 lloyds_beacon_sound_id = pCastSpell->sound_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1727 lloyds_beacon_spell_id = pCastSpell->uSpellID;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1728 pCastSpell->uFlags |= ON_CAST_NoRecoverySpell;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1729 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1730 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1731 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1732 case SPELL_EARTH_STONE_TO_FLESH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1733 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1734 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1735 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1736 case 1: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1737 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1738 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1739 case 4: break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1740 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1741 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1742 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1743 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1744 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1745 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Pertified] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1746 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1747 if ( skill_level == 4 )//for GM
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1748 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1749 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Pertified] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1750 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1751 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1752 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1753 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1754 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Pertified, v663);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1755 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1756 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1757 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1758 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1759 case SPELL_EARTH_ROCK_BLAST://Âçðûâ êàìíÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1760 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1761 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1762 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1763 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1764 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1765 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1766 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1767 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1768 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1769 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1770 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1771 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1772 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1773 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1774 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1775 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1776 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1777 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1778 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1779 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1780 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1781 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1782 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX, v659, pCastSpell->uPlayerID + 1) != -1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1783 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1784 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1785 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1786 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1787 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1788 case SPELL_EARTH_DEATH_BLOSSOM: //Öâåòîê ñìåðòè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1789 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1790 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1791 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1792 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
1793 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1794 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1795 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1796 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1797 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1798 break;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1799 pSpellSprite.uType = SPRITE_SPELL_EARTH_DEATH_BLOSSOM;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1800 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1801 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1802 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1803 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1804 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1805 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1806 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1807 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1808 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1809 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1810 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1811 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1812 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1813 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1814 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1815 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1816 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1817 pSpellSprite.uAttributes = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1818 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1819 if ( pSpellSprite.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1820 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1821 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1822 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1823 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1824 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1825 case SPELL_SPIRIT_DETECT_LIFE: // Äåòåêòîð æèçíè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1826 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1827 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1828 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1829 case 1: amount = 600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1830 case 2: amount = 1800 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1831 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1832 case 4: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1833 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1834 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1835 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1836 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1837 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1838 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1839 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1840 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1841 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1842 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1843 (signed int)(signed __int64)((double)(signed int)((int)amount << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1844 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1845 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1846 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1847 case SPELL_SPIRIT_FATE:// Ñóäüáà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1848 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1849 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1850 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1851 case 1: amount = spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1852 case 2: amount = 2 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1853 case 3: amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1854 case 4: amount = 6 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1855 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1856 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1857 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1858 //LODWORD(v733) = 300;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1859 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1860 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1861 if ( pCastSpell->spell_target_pid == 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1862 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1863 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1864 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1865 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1866 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1867 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1868 if (PID_TYPE(pCastSpell->spell_target_pid) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1869 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1870 mon_id = PID_ID(pCastSpell->spell_target_pid);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1871 pActors[mon_id].pActorBuffs[ACTOR_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1872 pActors[mon_id].uAttributes |= ACTOR_AGGRESSOR;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1873 pEngine->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1874 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1875 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1876 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1877 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1878 case SPELL_SPIRIT_REMOVE_CURSE:// Ñíÿòèå ïîð÷è
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1879 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1880 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1881 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1882 case 1: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1883 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1884 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1885 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1886 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1887 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1888 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1889 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1890 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1891 if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1892 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1893 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1894 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1895 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1896 if ( skill_level == 4 )//GM
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1897 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1898 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1899 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1900 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1901 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1902 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Cursed] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1903 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1904 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1905 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1906 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1907 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1908 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1909 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1910 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1911 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1912 case SPELL_SPIRIT_PRESERVATION://Ñîõðàíåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1913 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1914 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1915 duration = 900 * (spell_level + 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1916 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1917 duration = 300 * (spell_level + 12);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1918 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1919 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1920 if ( skill_level == 1 || skill_level == 2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1921 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1922 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1923 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1924 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1925 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1926 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1927 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1928 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1929 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1930 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1931 pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1932 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1933 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1934 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1935 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1936 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1937 case SPELL_SPIRIT_TURN_UNDEAD://Áåã ìåðòâåöîâ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1938 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1939 if ( skill_level == 1 || skill_level == 2)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1940 duration = 60 * (spell_level + 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1941 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1942 duration = 300 * spell_level + 180;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1943 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1944 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1945 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport(4096);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
1946 pEngine->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFF, 192);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1947 //++pSpellSprite.uType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1948 pSpellSprite.uType = SPRITE_SPELL_SPIRIT_TURN_UNDEAD_1;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1949 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1950 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1951 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1952 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1953 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1954 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1955 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1956 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1957 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1958 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1959 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1960 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1961 for ( a2 = 0; a2 < mon_num; ++a2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1962 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1963 if ( MonsterStats::BelongsToSupertype(pActors[_50BF30_actors_in_viewport_ids[a2]].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1964 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1965 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1966 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1967 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1968 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1969 pSpellSprite.Create(0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1970 pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1971 (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1972 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1973 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1974 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1975 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1976 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1977 case SPELL_SPIRIT_RAISE_DEAD://Îæèâëåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1978 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1979 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1980 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1981 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1982 amount = 86400 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1983 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1984 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1985 pOtherOverlayList->_4418B1(5080, pCastSpell->uPlayerID_2 + 100, 0, 65536);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1986 if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1987 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1988 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1989 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1990 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1991 pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1992 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1993 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1994 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1995 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Unconcious] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1996 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1997 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1998 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1999 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Dead,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2000 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2001 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Unconcious,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2002 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2003 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2004 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Weak, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2005 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2006 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2007 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2008 case SPELL_SPIRIT_SHARED_LIFE://Îáùàÿ æèçíü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2009 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2010 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2011 amount = 4 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2012 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2013 amount = 3 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2014 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2015 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2016 int active_pl_num = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2017 signed int shared_life_count = amount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2018 int mean_life = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2019 int pl_array[4];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2020 for ( uint pl_id = 1; pl_id <= 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2021 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2022 if ( !pPlayers[pl_id]->pConditions[Condition_Dead] && !pPlayers[pl_id]->pConditions[Condition_Pertified]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2023 && !pPlayers[pl_id]->pConditions[Condition_Eradicated] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2024 pl_array[active_pl_num++] = pl_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2025 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2026 for ( uint i = 0; i < active_pl_num; i++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2027 shared_life_count += pPlayers[pl_array[i]]->sHealth;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2028 mean_life = (signed __int64)((double)shared_life_count / (double)active_pl_num);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2029 for ( uint i = 0; i < active_pl_num; i++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2030 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2031 pPlayers[pl_array[i]]->sHealth = mean_life;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2032 if ( pPlayers[pl_array[i]]->sHealth > pPlayers[pl_array[i]]->GetMaxHealth())
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2033 pPlayers[pl_array[i]]->sHealth = pPlayers[pl_array[i]]->GetMaxHealth();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2034 if ( pPlayers[pl_array[i]]->sHealth > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2035 pPlayers[pl_array[i]]->SetUnconcious(0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2036 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_array[i] - 1);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2037 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2038 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2039 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2040 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2041 case SPELL_SPIRIT_RESSURECTION://Âîñêðåñåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2042 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2043 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2044 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2045 case 1: amount = 180 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2046 case 2: amount = 10800 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2047 case 3: amount = 259200 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2048 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2049 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2050 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2051 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2052 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2053 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2054 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Eradicated]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2055 || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2056 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2057 if ( !(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak]) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2058 pParty->pPlayers[pCastSpell->uPlayerID_2].PlaySound(SPEECH_25, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2059 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2060 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2061 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Eradicated] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2062 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2063 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Unconcious] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2064 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2065 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2066 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2067 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( Condition_Eradicated,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2068 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2069 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( Condition_Dead,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2070 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2071 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( Condition_Unconcious,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2072 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2073 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2074 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Weak, 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2075 pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2076 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2077 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2078 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2079 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2080 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2081 case SPELL_MIND_CURE_PARALYSIS://ëå÷åíèå ïàðàëè÷à
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2082 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2083 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2084 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2085 case 1: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2086 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2087 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2088 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2089 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2090 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2091 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2092 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2093 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2094 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2095 if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Paralyzed] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2096 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2097 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2098 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2099 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2100 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2101 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2102 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Paralyzed] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2103 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2104 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2105 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2106 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Paralyzed,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2107 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2108 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2109 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2110 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2111 case SPELL_MIND_REMOVE_FEAR://Ñíÿòü ñòðàõ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2112 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2113 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2114 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2115 case 1: amount = 180 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2116 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2117 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2118 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2119 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2120 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2121 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2122 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2123 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2124 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2125 if ( !pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Fear] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2126 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2127 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2128 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2129 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2130 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2131 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2132 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Fear] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2133 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2134 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2135 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2136 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Fear,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2137 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2138 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2139 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2140 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2141 case SPELL_MIND_TELEPATHY://Òåëåïàòèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2142 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2143 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2144 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2145 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2146 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2147 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2148 if ( !pActors[mon_id].ActorHasItem() )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2149 pActors[mon_id].SetRandomGoldIfTheresNoItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2150 int gold_num = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2151 if ( pItemsTable->pItems[pActors[mon_id].ActorHasItems[3].uItemID].uEquipType == EQUIP_GOLD )
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
2152 gold_num = pActors[mon_id].ActorHasItems[3].special_enchantment;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2153 ItemGen item;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2154 item.Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2155 if (pActors[mon_id].uCarriedItemID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2156 item.uItemID = pActors[mon_id].uCarriedItemID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2157 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2158 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2159 for ( uint i = 0; i < 4; ++i )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2160 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2161 if ( pActors[mon_id].ActorHasItems[i].uItemID > 0 && pItemsTable->pItems[pActors[mon_id].ActorHasItems[i].uItemID].uEquipType != EQUIP_GOLD )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2162 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2163 memcpy(&item, &pActors[mon_id].ActorHasItems[i], sizeof(item));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2164 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2165 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2166 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2167 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2168 if ( gold_num > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2169 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2170 if (item.uItemID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2171 sprintf(pTmpBuf2.data(), "(%s), and %d gold", item.GetDisplayName(), gold_num);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2172 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2173 sprintf(pTmpBuf2.data(), "%d gold", gold_num);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2174 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2175 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2176 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2177 if (item.uItemID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2178 sprintf(pTmpBuf2.data(), "(%s)", item.GetDisplayName());
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2179 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2180 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2181 strcpy(pTmpBuf2.data(), "nothing");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2182 ShowStatusBarString(pTmpBuf2.data(), 2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2183 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2184 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2185 ShowStatusBarString(pTmpBuf2.data(), 2);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2186 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2187 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2188 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2189 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2190 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2191 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2192 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2193 pSpellSprite.vPosition.z = pActors[mon_id].uActorHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2194 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2195 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2196 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2197 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2198 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2199 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2200 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2201 LOBYTE(pSpellSprite.uAttributes) |= 0x80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2202 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2203 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2204 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2205 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2206 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2207 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2208 case SPELL_MIND_BERSERK://Áåðñåðê
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2209 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2210 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2211 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2212 case 1: amount = 300 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2213 case 2: amount = 300 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2214 case 3: amount = 600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2215 case 4: amount = 3600; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2216 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2217 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2218 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2219 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2220 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2221 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2222 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2223 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2224 //v730 = 836 * mon_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2225 if ( pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)7) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2226 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2227 pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2228 pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2229 pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2230 pActors[mon_id].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2231 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2232 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2233 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2234 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2235 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2236 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2237 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2238 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2239 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z + pActors[mon_id].uActorHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2240 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2241 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[mon_id].vPosition.x, pActors[mon_id].vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2242 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2243 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2244 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2245 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2246 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2247 LOBYTE(pSpellSprite.uAttributes) |= 0x80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2248 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2249 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2250 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2251 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2252 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2253 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2254 case SPELL_MIND_ENSLAVE://Ïîðàáîùåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2255 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2256 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2257 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2258 amount = 600 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2259 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2260 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2261 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2262 //v730 = 836 * mon_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2263 if ( MonsterStats::BelongsToSupertype(pActors[mon_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2264 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2265 if ( pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)7) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2266 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2267 pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2268 pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2269 pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2270 skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2271 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2272 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2273 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2274 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2275 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2276 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2277 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2278 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2279 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z + pActors[mon_id].uActorHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2280 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2281 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[mon_id].vPosition.x, pActors[mon_id].vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2282 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2283 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2284 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2285 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2286 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2287 LOBYTE(pSpellSprite.uAttributes) |= 0x80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2288 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2289 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2290 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2291 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2292 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2293 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2294 case SPELL_MIND_MASS_FEAR://Ìàññîâûé ñòðàõ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2295 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2296 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2297 amount = 300 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2298 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2299 amount = 180 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2300 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2301 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2302 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport(4096);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2303 pEngine->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0A, 192);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2304 //++pSpellSprite.uType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2305 pSpellSprite.uType = SPRITE_SPELL_MIND_MASS_FEAR_1;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2306 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2307 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2308 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2309 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2310 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2311 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2312 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2313 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2314 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2315 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2316 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2317 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2318 for ( a2 = 0; a2 < mon_num; ++a2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2319 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2320 if ( MonsterStats::BelongsToSupertype(pActors[_50BF30_actors_in_viewport_ids[a2]].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2321 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2322 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2323 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2324 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2325 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2326 pSpellSprite.Create(0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2327 if ( pActors[_50BF30_actors_in_viewport_ids[a2]].DoesDmgTypeDoDamage((DAMAGE_TYPE)7) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2328 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2329 pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2330 skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2331 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2332 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2333 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2334 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2335 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2336 case SPELL_MIND_CURE_INSANITY://Ëå÷åíèå Áåçóìèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2337 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2338 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2339 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2340 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2341 amount = 86400 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2342 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2343 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2344 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2345 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Insane] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2346 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2347 if ( !(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak]) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2348 pParty->pPlayers[pCastSpell->uPlayerID_2].PlaySound(SPEECH_25, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2349 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2350 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Insane] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2351 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2352 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Insane,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2353 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2354 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Weak, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2355 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2356 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2357 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2358 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2359 case SPELL_EARTH_TELEKINESIS://Òåëåêèíåç
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2360 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2361 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2362 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2363 case 1: amount = 2 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2364 case 2: amount = 2 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2365 case 3: amount = 3 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2366 case 4: amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2367 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2368 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2369 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2370 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2371 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2372 int obj_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2373 if (PID_TYPE(a2) == OBJECT_Item)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2374 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2375 if (pItemsTable->pItems[pSpriteObjects[obj_id].containing_item.uItemID].uEquipType == EQUIP_GOLD)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2376 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
2377 pParty->PartyFindsGold(pSpriteObjects[obj_id].containing_item.special_enchantment, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2378 viewparams->bRedrawGameUI = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2379 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2380 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2381 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2382 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[pSpriteObjects[obj_id].containing_item.uItemID].pUnidentifiedName);//Âû íàøëè ^Pv[%s]!
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2383 ShowStatusBarString(pTmpBuf2.data(), 2);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2384 if (!pParty->AddItemToParty(&pSpriteObjects[obj_id].containing_item))
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2385 pParty->SetHoldingItem(&pSpriteObjects[obj_id].containing_item);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2386 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2387 SpriteObject::OnInteraction(obj_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2388 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2389 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2390 pActors[obj_id].LootActor();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2391 if (PID_TYPE(a2) == OBJECT_Decoration)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2392 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2393 OpenedTelekinesis = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2394 if ( pLevelDecorations[obj_id].uEventID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2395 EventProcessor(pLevelDecorations[obj_id].uEventID, a2, 1);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2396 if (pLevelDecorations[pSpriteObjects[obj_id].containing_item.uItemID].IsInteractive())
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2397 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2398 activeLevelDecoration = &pLevelDecorations[obj_id];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2399 EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[obj_id]._idx_in_stru123 - 75] + 380, 0, 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2400 activeLevelDecoration = nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2401 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2402 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2403 if (PID_TYPE(a2) == OBJECT_BModel)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2404 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2405 OpenedTelekinesis = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2406 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2407 v448 = pIndoor->pFaceExtras[pIndoor->pFaces[obj_id].uFaceExtraID].uEventID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2408 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2409 v448 = pOutdoor->pBModels[a2 >> 9].pFaces[obj_id & 0x3F].sCogTriggeredID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2410 EventProcessor(v448, a2, 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2411 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2412 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2413 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2414 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2415 case SPELL_BODY_CURE_WEAKNESS://Ëå÷èòü Ñëàáîñòü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2416 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2417 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2418 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2419 case 1: amount = 180 * spell_level; break;//3 ìèíóòû * êîëè÷åñòâî î÷êîâ íàâûêà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2420 case 2: amount = 3600 * spell_level; break;//1 ÷àñ * êîëè÷åñòâî î÷êîâ íàâûêà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2421 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2422 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2423 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2424 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2425 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2426 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2427 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2428 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2429 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2430 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2431 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2432 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2433 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2434 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2435 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2436 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2437 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Weak,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2438 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2439 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2440 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2441 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2442 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2443 case SPELL_BODY_FIRST_AID://Ïåðâàÿ ïîìîùü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2444 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2445 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2446 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2447 case 1: amount = 2 * spell_level + 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2448 case 2: amount = 3 * spell_level + 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2449 case 3: amount = 4 * spell_level + 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2450 case 4: amount = 5 * spell_level + 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2451 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2452 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2453 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2454 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2455 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2456 if ( !pCastSpell->spell_target_pid )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2457 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2458 pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2459 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2460 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2461 if (PID_TYPE(pCastSpell->spell_target_pid) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2462 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2463 mon_id = PID_ID(pCastSpell->spell_target_pid);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2464 if ( pActors[mon_id].uAIState != Dead && pActors[mon_id].uAIState != Dying && pActors[mon_id].uAIState != Disabled
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2465 && pActors[mon_id].uAIState != Removed )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2466 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2467 pActors[mon_id].sCurrentHP += amount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2468 if ( pActors[mon_id].sCurrentHP > pActors[mon_id].pMonsterInfo.uHP )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2469 pActors[mon_id].sCurrentHP = pActors[mon_id].pMonsterInfo.uHP;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2470 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2471 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2472 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2473 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2474 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2475 case SPELL_BODY_CURE_POISON://Ëå÷åíèå Îòðàâëåíèÿ(Ïðîòèâîÿäèå)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2476 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2477 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2478 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2479 case 1: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2480 case 2: amount = 3600 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2481 case 3: amount = 86400 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2482 case 4: amount = 0; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2483 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2484 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2485 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2486 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2487 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2488 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2489 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Weak]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2490 || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Medium]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2491 || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Severe] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2492 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2493 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2494 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2495 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Weak] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2496 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Medium] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2497 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Severe] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2498 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2499 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2500 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2501 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Weak, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2502 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Medium, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2503 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Severe, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2504 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2505 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2506 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2507 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2508 case SPELL_BODY_PROTECTION_FROM_MAGIC://Çàùèòà îò ìàãèè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2509 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2510 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2511 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2512 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2513 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2514 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2515 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2516 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2517 (signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), skill_level, spell_level, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2518 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2519 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2520 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2521 case SPELL_BODY_HAMMERHANDS://Ðóêè-Ìîëîòû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2522 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2523 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2524 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2525 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2526 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2527 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2528 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2529 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2530 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2531 for ( uint pl_id = 0; pl_id < 4; pl_id++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2532 pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2533 (signed int)(signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), 4, spell_level, spell_level, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2534 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2535 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2536 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2537 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2538 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2539 (signed int)(signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), skill_level, spell_level, spell_level, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2540 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2541 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2542 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2543 case SPELL_BODY_CURE_DISEASE://Ëå÷èòü Áîëåçíü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2544 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2545 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2546 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2547 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2548 amount = 86400 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2549 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2550 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2551 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2552 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Weak]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2553 || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Medium]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2554 || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Severe] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2555 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2556 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2557 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2558 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Weak] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2559 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Medium] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2560 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Severe] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2561 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2562 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Weak,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2563 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2564 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Medium,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2565 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2566 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Severe,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2567 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2568 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2569 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2570 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2571 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2572 case SPELL_BODY_POWER_CURE://Èñöåëåíèå
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2573 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2574 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2575 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2576 for ( uint pl_id = 0; pl_id < 4; ++pl_id )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2577 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2578 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2579 pParty->pPlayers[pl_id].Heal(5 * spell_level + 10);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2580 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2581 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2582 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2583 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2584 case SPELL_LIGHT_DISPEL_MAGIC://Ñíÿòèå ÷àð
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2585 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2586 sRecoveryTime -= spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2587 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2588 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2589 pEngine->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0A, 192);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2590 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport(4096);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2591 //++pSpellSprite.uType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2592 pSpellSprite.uType = SPRITE_SPELL_LIGHT_DISPEL_MAGIC_1;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2593 v688.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2594 v688.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2595 v688.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2596 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2597 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2598 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2599 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2600 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2601 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2602 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2603 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2604 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2605 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2606 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2607 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2608 for ( a2 = 0; a2 < mon_num; ++a2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2609 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2610 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2611 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2612 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2613 (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2614 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2615 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[a2], &v688);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2616 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2617 for ( a2 = 0; a2 < mon_num; ++a2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2618 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2619 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2620 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2621 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2622 (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2623 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2624 pSpellSprite.Create(0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2625 for (int i = 0; i < 22; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2626 pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[i].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2627 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2628 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2629 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2630 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2631 case SPELL_LIGHT_SUMMON_ELEMENTAL://Ýëåìåíòàë
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2632 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2633 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2634 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2635 case 1: v733 = 300 * spell_level; amount = 1; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2636 case 2: v733 = 300 * spell_level; amount = 1; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2637 case 3: v733 = 900 * spell_level; amount = 3; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2638 case 4: v733 = 900 * spell_level; amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2639 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2640 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2641 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2642 int mon_num = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2643 for ( uint mon_id = 0; mon_id < uNumActors; mon_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2644 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2645 if ( pActors[mon_id].uAIState != Dead && pActors[mon_id].uAIState != Removed && pActors[mon_id].uAIState != Disabled
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2646 && PID(OBJECT_Player, pCastSpell->uPlayerID) == pActors[mon_id].uSummonerID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2647 ++mon_num;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2648 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2649 if ( mon_num >= amount )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2650 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2651 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2652 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2653 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2654 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2655 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2656 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2657 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2658 sub_44FA4C_spawn_light_elemental(pCastSpell->uPlayerID, skill_level, v733);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2659 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2660 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2661 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2662 case SPELL_LIGHT_DAY_OF_THE_GODS://Äåíü áîãîâ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2663 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2664 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2665 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2666 case 1: duration = 10800 * spell_level; amount = 3 * spell_level + 10; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2667 case 2: duration = 10800 * spell_level; amount = 3 * spell_level + 10; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2668 case 3: duration = 14400 * spell_level; amount = 4 * spell_level + 10; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2669 case 4: duration = 18000 * spell_level; amount = 5 * spell_level + 10; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2670 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2671 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2672 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2673 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2674 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2675 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2676 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2677 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2678 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2679 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2680 (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2681 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2682 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2683 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2684 case SPELL_LIGHT_PRISMATIC_LIGHT://Ñâåò ïðèçìû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2685 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2686 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2687 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2688 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2689 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2690 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2691 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2692 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2693 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2694 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2695 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport(4096);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2696 //++pSpellSprite.uType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2697 pSpellSprite.uType = SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT_1;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2698 v694.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2699 v694.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2700 v694.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2701 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2702 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2703 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2704 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2705 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2706 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2707 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2708 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2709 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2710 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2711 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2712 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2713 for ( uint mon_id = 0; mon_id < mon_num; mon_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2714 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2715 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2716 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2717 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.z -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2718 (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[mon_id]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2719 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[mon_id]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2720 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[mon_id], &v694);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2721 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2722 //v537 = pEngine->GetStru6();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2723 pEngine->GetStru6()->_4A8BFC();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2724 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2725 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2726 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2727 case SPELL_LIGHT_DAY_OF_PROTECTION://Äåíü çàùèòû
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2728 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2729 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2730 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2731 case 1: duration = 14400 * spell_level; amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2732 case 2: duration = 14400 * spell_level; amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2733 case 3: duration = 14400 * spell_level; amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2734 case 4: duration = 18000 * spell_level; amount = 5 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2735 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2736 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2737 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2738 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2739 break;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2740 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2741 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2742 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2743 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2744 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2745 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2746 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2747 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2748 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2749 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2750 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2751 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2752 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2753 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2754 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2755 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2756 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2757 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2758 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2759 (signed __int64)((double)(duration << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2760 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2761 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2762 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2763 case SPELL_LIGHT_HOUR_OF_POWER: //×àñ ìîãóùåñòâà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2764 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2765 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2766 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2767 case 1: duration = 4; amount = 4; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2768 case 2: duration = 4; amount = 4; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2769 case 3: duration = 12; amount = 12; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2770 case 4: duration = 20; amount = 15; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2771 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2772 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2773 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2774 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2775 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2776 bool player_weak = false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2777 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2778 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2779 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2780 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2781 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2782 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2783 pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2784 (signed __int64)((double)((300 * amount * spell_level + 60) << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2785 if ( pParty->pPlayers[pl_id].pConditions[Condition_Weak] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2786 player_weak = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2787 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2788 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2789 (signed __int64)((double)((300 * amount * spell_level + 60) << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2790 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2791 (signed __int64)((double)((300 * amount * spell_level + 60) << 7) * 0.033333335), skill_level, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2792 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2793 (signed __int64)((double)((300 * amount * spell_level + 60) << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2794 if ( !player_weak )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2795 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2796 (signed __int64)((double)((60 * (spell_level * duration + 60)) << 7) * 0.033333335), skill_level, spell_level + 5, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2797 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2798 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2799 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2800 case SPELL_LIGHT_DIVINE_INTERVENTION://Áîæåñòâåííîå âìåøàòåëüñòâî
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2801 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2802 //amount = 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2803 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2804 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2805 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2806 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2807 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2808 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2809 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2810 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2811 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2812 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2813 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2814 for ( uint buff_id = 0; buff_id <= 19; buff_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2815 pParty->pPlayers[pl_id].pConditions[buff_id] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2816 pParty->pPlayers[pl_id].sHealth = pParty->pPlayers[pl_id].GetMaxHealth();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2817 pParty->pPlayers[pl_id].sMana = pParty->pPlayers[pl_id].GetMaxMana();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2818 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2819 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2820 if ( pPlayer->sAgeModifier + 10 >= 120 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2821 pPlayer->sAgeModifier = 120;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2822 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2823 pPlayer->sAgeModifier = pPlayer->sAgeModifier + 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2824 sRecoveryTime += -5 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2825 ++pPlayer->uNumDivineInterventionCastsThisDay;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2826 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2827 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2828 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2829 case SPELL_DARK_REANIMATE: //Ðåàíèìàöèÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2830 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2831 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2832 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2833 case 1: amount = 2 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2834 case 2: amount = 3 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2835 case 3: amount = 4 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2836 case 4: amount = 5 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2837 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2838 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2839 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2840 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2841 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2842 if (!pCastSpell->spell_target_pid)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2843 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
2844 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2845 if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Dead] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2846 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2847 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Zombie, 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2848 ReloadPlayerPortraits(pCastSpell->uPlayerID_2, (pParty->pPlayers[pCastSpell->uPlayerID_2].GetSexByVoice() != 0) + 23);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2849 pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Zombie] = pParty->uTimePlayed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2850 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2851 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2852 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2853 mon_id = PID_ID(pCastSpell->spell_target_pid);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2854 if ( mon_id == -1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2855 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2856 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2857 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2858 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2859 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2860 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2861 if ( pActors[mon_id].sCurrentHP > 0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2862 || pActors[mon_id].uAIState != Dead && pActors[mon_id].uAIState != Dying )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2863 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2864 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2865 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2866 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2867 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2868 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2869 //++pSpellSprite.uType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2870 pSpellSprite.uType = SPRITE_SPELL_DARK_REANIMATE_1;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2871 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2872 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2873 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2874 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2875 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2876 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2877 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2878 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2879 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2880 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2881 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2882 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2883 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2884 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2885 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2886 (unsigned int)(signed __int64)((double)pActors[mon_id].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2887 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, mon_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2888 pSpellSprite.Create(0, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2889 if ( pActors[mon_id].pMonsterInfo.uLevel > amount )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2890 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2891 Actor::Resurrect(mon_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2892 pActors[mon_id].pMonsterInfo.uHostilityType = (MonsterInfo::HostilityRadius)0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2893 pActors[mon_id].pMonsterInfo.uTreasureDropChance = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2894 pActors[mon_id].pMonsterInfo.uTreasureDiceRolls = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2895 pActors[mon_id].pMonsterInfo.uTreasureDiceSides = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2896 pActors[mon_id].pMonsterInfo.uTreasureLevel = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2897 pActors[mon_id].pMonsterInfo.uTreasureType = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2898 pActors[mon_id].uAlly = 9999;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2899 pActors[mon_id].ResetAggressor();//~0x80000
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2900 pActors[mon_id].uGroup = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2901 pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2902 pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2903 pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2904 if ( pActors[mon_id].sCurrentHP > 10 * amount )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2905 pActors[mon_id].sCurrentHP = 10 * amount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2906 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2907 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2908 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2909 case SPELL_DARK_VAMPIRIC_WEAPON:// Îðóæèå-âàìïèð
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2910 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2911 amount = 16;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2912 if ( skill_level == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2913 duration = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2914 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2915 duration = 3600 * spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2916 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2917 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2918 ItemGen *item = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2919 item->UpdateTempBonus(pParty->uTimePlayed);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2920 if ( item->uItemID >= 64 && item->uItemID <= 65//blasters
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2921 || LOBYTE(item->uAttributes) & 2
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
2922 || item->special_enchantment != 0
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2923 || item->uEnchantmentType != 0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2924 || pItemsTable->pItems[item->uItemID].uEquipType != EQUIP_SINGLE_HANDED
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2925 && pItemsTable->pItems[item->uItemID].uEquipType != EQUIP_TWO_HANDED
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2926 && pItemsTable->pItems[item->uItemID].uEquipType != EQUIP_BOW
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2927 || pItemsTable->IsMaterialNonCommon(item) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2928 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2929 _50C9D0_AfterEnchClickEventId = 113;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2930 _50C9D4_AfterEnchClickEventSecondParam = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2931 _50C9D8_AfterEnchClickEventTimeout = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2932 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
2933 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2934 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2935 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2936 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
2937 item->special_enchantment = ITEM_ENCHANTMENT_VAMPIRIC;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2938 if ( skill_level != 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2939 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2940 item->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2941 item->uAttributes |= 8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2942 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2943 LOBYTE(item->uAttributes) |= 0x80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2944 _50C9A8_item_enchantment_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2945 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2946 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2947 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2948 case SPELL_DARK_SHARPMETAL://Øðàïíåëü
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2949 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2950 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2951 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2952 case 1: amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2953 case 2: amount = 5; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2954 case 3: amount = 7; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2955 case 4: amount = 9; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2956 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2957 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2958 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2959 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2960 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2961 signed int _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
2962 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2963 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2964 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2965 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2966 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2967 pSpellSprite.vPosition.x = pParty->vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2968 pSpellSprite.vPosition.y = pParty->vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2969 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2970 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2971 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2972 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2973 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2974 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2975 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2976 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2977 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2978 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2979 LOBYTE(pSpellSprite.uAttributes) |= 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2980 v188 = (signed int)_v726 / -2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2981 v189 = (signed int)_v726 / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2982 if ( v188 <= v189 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2983 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2984 do
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2985 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2986 pSpellSprite.uFacing = v188 + v715.uYawAngle;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2987 if ( pSpellSprite.Create(pSpellSprite.uFacing, v715.uPitchAngle,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2988 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, pCastSpell->uPlayerID + 1) != -1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2989 && pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2990 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2991 v188 += _v726 / (amount - 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2992 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2993 while ( v188 <= v189 );
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2994 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2995 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2996 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2997 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2998 case SPELL_DARK_CONTROL_UNDEAD://Ãëàâà íåæèòè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2999 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3000 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3001 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3002 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3003 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3004 case 1: duration = 180 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3005 case 2: duration = 180 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3006 case 3: duration = 300 * spell_level; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3007 case 4: duration = 29030400; break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3008 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3009 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3010 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3011 if (PID_TYPE(a2) == OBJECT_Actor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3012 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3013 mon_id = PID_ID(a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3014 if ( !MonsterStats::BelongsToSupertype(pActors[mon_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3015 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3016 if ( !pActors[mon_id].DoesDmgTypeDoDamage((DAMAGE_TYPE)10) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3017 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3018 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
3019 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3020 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3021 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3022 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3023 pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3024 pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3025 pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3026 (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3027 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3028 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3029 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3030 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3031 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3032 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3033 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3034 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z + pActors[mon_id].uActorHeight;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3035 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3036 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[mon_id].vPosition.x, pActors[mon_id].vPosition.y, pSpellSprite.vPosition.z);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3037 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3038 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3039 pSpellSprite.spell_target_pid = a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3040 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3041 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3042 LOBYTE(pSpellSprite.uAttributes) |= 0x80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3043 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3044 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3045 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3046 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3047 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3048 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3049 case SPELL_DARK_SACRIFICE://Æåðòâà
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3050 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3051 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3052 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3053 int hired_npc = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3054 memset(&achieved_awards, 0, 4000);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3055 for ( uint npc_id = 0; npc_id < 2; npc_id++ ) //êîëè÷åñòâî íàíÿòûõ ÍÏÑ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3056 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3057 if ( pParty->pHirelings[npc_id].pName != 0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3058 achieved_awards[hired_npc++] = (AwardType)(npc_id + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3059 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3060 /*if ( (signed int)pNPCStats->uNumNewNPCs > 0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3061 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3062 //AwardType *_v734 = &achieved_awards[_v733];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3063 for ( int npc_id = 0; npc_id < pNPCStats->uNumNewNPCs; ++npc_id )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3064 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3065 if ( pNPCStats->pNewNPCData[npc_id].uFlags & 0x80//hired(íà¸ìíûé)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3066 && (!pParty->pHirelings[0].pName
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3067 || strcmp(pNPCStats->pNewNPCData[npc_id].pName, pParty->pHirelings[0].pName))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3068 && (!pParty->pHirelings[1].pName
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3069 || strcmp(pNPCStats->pNewNPCData[npc_id].pName, pParty->pHirelings[1].pName)) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3070 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3071 //v607 = _v734;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3072 //++_v734;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3073 achieved_awards[hired_npc++] = (AwardType)(npc_id + 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3074 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3075 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3076 }*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3077 if ( pCastSpell->uPlayerID_2 != 4 && pCastSpell->uPlayerID_2 != 5
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3078 || achieved_awards[pCastSpell->uPlayerID_2 - 4] <= 0 || achieved_awards[pCastSpell->uPlayerID_2 - 4] >= 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3079 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3080 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
3081 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3082 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3083 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3084 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3085 pParty->pHirelings[achieved_awards[pCastSpell->uPlayerID_2 - 4] - 1].evt_A = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3086 pParty->pHirelings[achieved_awards[pCastSpell->uPlayerID_2 - 4] - 1].evt_B = 0;
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
3087 pParty->pHirelings[achieved_awards[pCastSpell->uPlayerID_2 - 4] - 1].evt_C = pIconsFrameTable->GetIcon("spell96")->GetAnimLength();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3088 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3089 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3090 pParty->pPlayers[pl_id].sHealth = pParty->pPlayers[pl_id].GetMaxHealth();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3091 pParty->pPlayers[pl_id].sMana = pParty->pPlayers[pl_id].GetMaxMana();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3092 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3093 v613 = &pOutdoor->ddm;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3094 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3095 v613 = &pIndoor->dlv;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3096 v613->uReputation += 15;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3097 if ( v613->uReputation > 10000 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3098 v613->uReputation = 10000;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3099 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3100 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3101 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3102 case SPELL_DARK_PAIN_REFLECTION://Îòðàæåíèå áîëè
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3103 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3104 switch (skill_level)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3105 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3106 case 1: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3107 case 2: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3108 case 3: duration = 300 * (spell_level + 12); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3109 case 4: duration = 900 * (spell_level + 4); break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3110 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3111 assert(false);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3112 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3113 amount = spell_level + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3114 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3115 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3116 if ( skill_level != 3 && skill_level != 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3117 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
3118 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3119 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3120 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3121 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3122 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3123 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3124 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3125 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
3126 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3127 pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed +
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3128 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3129 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3130 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3131 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3132 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3133 case SPELL_DARK_SOULDRINKER://Èñïèòü äóøó
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3134 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3135 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3136 break;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
3137
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2541
diff changeset
3138 int mon_num = pRenderer->_46À6ÀÑ_GetActorsInViewport((signed __int64)pIndoorCameraD3D->GetPickDepth());
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3139 v707.x = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3140 v707.y = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3141 v707.z = 0;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3142 pSpellSprite.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3143 pSpellSprite.spell_id = pCastSpell->uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3144 pSpellSprite.spell_level = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3145 pSpellSprite.spell_skill = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3146 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3147 pSpellSprite.uAttributes = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3148 pSpellSprite.uSectorID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3149 pSpellSprite.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3150 pSpellSprite.field_60_distance_related_prolly_lod = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3151 pSpellSprite.uFacing = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3152 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3153 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3154 amount = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3155 if ( mon_num > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3156 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3157 amount = (mon_num * (7 * spell_level + 25));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3158 for ( uint mon_id = 0; mon_id < mon_num; mon_id++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3159 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3160 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.x;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3161 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.y;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3162 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[mon_id]].vPosition.z -
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3163 (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[mon_id]].uActorHeight * -0.8);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3164 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[mon_id]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3165 Actor::DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[mon_id], &v707);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3166 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3167 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3168 int pl_num = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3169 int pl_array[4];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3170 for ( uint pl_id = 1; pl_id <= 4; ++pl_id )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3171 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3172 if ( !pPlayers[pl_id]->pConditions[Condition_Sleep] && !pPlayers[pl_id]->pConditions[Condition_Paralyzed]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3173 && !pPlayers[pl_id]->pConditions[Condition_Unconcious] && !pPlayers[pl_id]->pConditions[Condition_Dead]
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3174 && !pPlayers[pl_id]->pConditions[Condition_Pertified] && !pPlayers[pl_id]->pConditions[Condition_Eradicated] )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3175 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3176 pl_array[pl_num++] = pl_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3177 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3178 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3179 for ( uint j = 0; j < pl_num; j++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3180 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3181 pPlayers[pl_array[j]]->sHealth += (signed __int64)((double)(signed int)amount / (double)pl_num);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3182 if ( pPlayers[pl_array[j]]->sHealth > pPlayers[pl_array[j]]->GetMaxHealth())
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3183 pPlayers[pl_array[j]]->sHealth = pPlayers[pl_array[j]]->GetMaxHealth();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
3184 pEngine->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_array[j]);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3185 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2534
diff changeset
3186 pEngine->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 64);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3187 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3188 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3189 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3190 case SPELL_DARK_ARMAGEDDON://Àðìàãåääîí
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3191 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3192 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3193 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3194 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors!
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
3195 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3196 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3197 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3198 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3199 if ( skill_level == 4)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3200 amount = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3201 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3202 amount = 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3203 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3204 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3205 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
2534
1bcadc6dd203 enum SOUND_
Ritor1
parents: 2502
diff changeset
3206 pAudioPlayer->PlaySound(SOUND_spellfail0201, 0, 0, -1, 0, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3207 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3208 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3209 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3210 if ( !pPlayer->CanCastSpell(uRequiredMana) )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3211 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3212 pParty->armageddon_timer = 256;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3213 pParty->armageddonDamage = spell_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3214 ++pPlayer->uNumArmageddonCasts;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3215 if ( pParty->bTurnBasedModeOn == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3216 ++pTurnEngine->pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3217 for ( uint i = 0; i < 50; i++ )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3218 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3219 v642 = rand() % 4096 - 2048;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3220 v643 = rand();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3221 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, pParty->vPosition.y + (v643 % 4096 - 2048), &v710, 0);
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3222 SpriteObject::sub_42F7EB_DropItemAt(SPRITE_SPELL_EARTH_ROCK_BLAST, v642 + pParty->vPosition.x, pParty->vPosition.y + (v643 % 4096 - 2048), v732 + 16, rand() % 500 + 500, 1, 0, 0, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3223 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3224 spell_sound_flag = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3225 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3226 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3227 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3228 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3229 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3230
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3231 if (~pCastSpell->uFlags & ON_CAST_NoRecoverySpell)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3232 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3233 if ( sRecoveryTime < 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3234 sRecoveryTime = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3235 if ( pParty->bTurnBasedModeOn )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3236 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3237 //v645 = sRecoveryTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3238 pParty->pTurnBasedPlayerRecoveryTimes[pCastSpell->uPlayerID] = sRecoveryTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3239 pPlayer->SetRecoveryTime(sRecoveryTime);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3240 if ( !some_active_character )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3241 pTurnEngine->ApplyPlayerAction();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3242 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3243 else
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3244 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3245 pPlayer->PlaySound(SPEECH_49, 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3246 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3247 if (spell_sound_flag)
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3248 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3249
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3250 pCastSpell->uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3251 spell_level = v723;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3252 continue;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3253 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3254
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3255 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3256
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3257
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3258 //----- (00427DA0) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3259 size_t PushCastSpellInfo(uint16_t uSpellID, uint16_t uPlayerID, __int16 skill_level, uint16_t uFlags, int spell_sound_id)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3260 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3261 // uFlags: ON_CAST_*
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3262 for (size_t i = 0; i < CastSpellInfoCount; i++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3263 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3264 if (!pCastSpellInfo[i].uSpellID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3265 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3266 pCastSpellInfo[i].uSpellID = uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3267 pCastSpellInfo[i].uPlayerID = uPlayerID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3268 if (uFlags & 0x10)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3269 pCastSpellInfo[i].uPlayerID_2 = uPlayerID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3270 pCastSpellInfo[i].field_6 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3271 pCastSpellInfo[i].spell_target_pid = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3272 pCastSpellInfo[i].uFlags = uFlags;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3273 pCastSpellInfo[i].forced_spell_skill_level = skill_level;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3274 pCastSpellInfo[i].sound_id = spell_sound_id;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3275 return i;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3276 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3277 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3278 return -1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3279 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3280 //----- (00427D48) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3281 void CastSpellInfoHelpers::_427D48()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3282 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3283 for (size_t i = 0; i < CastSpellInfoCount; i++)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3284 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3285 if (pCastSpellInfo[i].uSpellID && pCastSpellInfo[i].uFlags & ON_CAST_CastingInProgress)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3286 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3287 pCastSpellInfo[i].uSpellID = 0;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3288 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3289 pGUIWindow_CastTargetedSpell = nullptr;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3290 pMouse->SetCursorBitmap("MICON1");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3291 GameUI_Footer_TimeLeft = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3292 _50C9A0_IsEnchantingInProgress = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3293 back_to_game();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3294 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3295 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3296 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3297 //----- (0042777D) --------------------------------------------------------
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3298 void _42777D_CastSpell_UseWand_ShootArrow(SPELL_TYPE spell, unsigned int uPlayerID, unsigned int a4, __int16 flags, int a6)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3299 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3300 unsigned __int16 v9; // cx@16
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3301 unsigned int v10; // eax@18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3302 unsigned __int8 v11; // sf@18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3303 unsigned __int8 v12; // of@18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3304 unsigned __int16 v13; // cx@21
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3305 unsigned int v14; // eax@23
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3306
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3307 //if ( pParty->bTurnBasedModeOn != 1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3308 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3309 if (pParty->bTurnBasedModeOn)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3310 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3311 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3312 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3313 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3314
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3315
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3316 //v6 = a5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3317 //v7 = &pParty->pPlayers[uPlayerID];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3318 assert(uPlayerID < 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3319 Player* player = &pParty->pPlayers[uPlayerID];
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3320 if (!(flags & 0x10))
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3321 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3322 switch (spell)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3323 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3324 case SPELL_SPIRIT_FATE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3325 case SPELL_BODY_FIRST_AID:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3326 case SPELL_DARK_REANIMATE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3327 //HIBYTE(v6) = HIBYTE(a5) | 1;
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3328 flags |= ON_CAST_MonsterSparkles;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3329 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3330
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3331 case SPELL_FIRE_FIRE_AURA:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3332 case SPELL_WATER_RECHARGE_ITEM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3333 case SPELL_WATER_ENCHANT_ITEM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3334 case SPELL_DARK_VAMPIRIC_WEAPON:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3335 flags |= ON_CAST_Enchantment;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3336 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3337
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3338 case SPELL_FIRE_FIRE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3339 case SPELL_FIRE_FIREBALL:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3340 case SPELL_FIRE_INCINERATE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3341 case SPELL_AIR_LIGHNING_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3342 case SPELL_AIR_IMPLOSION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3343 case SPELL_WATER_POISON_SPRAY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3344 case SPELL_WATER_ICE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3345 case SPELL_WATER_ACID_BURST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3346 case SPELL_WATER_ICE_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3347 case SPELL_EARTH_STUN:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3348 case SPELL_EARTH_SLOW:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3349 case SPELL_EARTH_DEADLY_SWARM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3350 case SPELL_EARTH_BLADES:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3351 case SPELL_EARTH_MASS_DISTORTION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3352 case SPELL_SPIRIT_SPIRIT_LASH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3353 case SPELL_MIND_MIND_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3354 case SPELL_MIND_CHARM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3355 case SPELL_MIND_PSYCHIC_SHOCK:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3356 case SPELL_BODY_HARM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3357 case SPELL_BODY_FLYING_FIST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3358 case SPELL_LIGHT_LIGHT_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3359 case SPELL_LIGHT_DESTROY_UNDEAD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3360 case SPELL_LIGHT_SUNRAY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3361 case SPELL_DARK_TOXIC_CLOUD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3362 case SPELL_DARK_SHRINKING_RAY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3363 case SPELL_DARK_SHARPMETAL:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3364 case SPELL_DARK_DRAGON_BREATH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3365 if ( !a6 )
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3366 flags |= ON_CAST_TargetCrosshair;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3367 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3368 case SPELL_MIND_TELEPATHY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3369 case SPELL_MIND_BERSERK:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3370 case SPELL_MIND_ENSLAVE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3371 case SPELL_LIGHT_PARALYZE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3372 case SPELL_DARK_CONTROL_UNDEAD:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3373 flags |= ON_CAST_TargetCrosshair;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3374 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3375
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3376 case SPELL_EARTH_TELEKINESIS:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3377 flags |= ON_CAST_Telekenesis;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3378 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3379
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3380 case SPELL_SPIRIT_BLESS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3381 if (a4 && ~a4 & 0x01C0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3382 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3383 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3384 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3385 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3386 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3387 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3388 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3389 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3390 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3391 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3392
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3393 case SPELL_SPIRIT_PRESERVATION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3394 v9 = a4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3395 if ( !a4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3396 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3397 //goto LABEL_18;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3398 v10 = SkillToMastery(v9);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3399 v12 = __OFSUB__(v10, 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3400 v11 = ((v10 - 3) & 0x80000000u) != 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3401 //goto LABEL_24;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3402 if ( v11 ^ v12 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3403 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3404 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3405 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3406 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3407 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3408
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3409 case SPELL_DARK_PAIN_REFLECTION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3410 v9 = a4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3411 if ( !a4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3412 v9 = player->pActiveSkills[PLAYER_SKILL_DARK];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3413 //LABEL_18:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3414 v10 = SkillToMastery(v9);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3415 v12 = __OFSUB__(v10, 3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3416 v11 = ((v10 - 3) & 0x80000000u) != 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3417 //goto LABEL_24;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3418 if ( v11 ^ v12 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3419 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3420 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3421 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3422 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3423 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3424
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3425 case SPELL_BODY_HAMMERHANDS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3426 v13 = a4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3427 if ( !a4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3428 v13 = player->pActiveSkills[PLAYER_SKILL_BODY];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3429 v14 = SkillToMastery(v13);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3430 v12 = __OFSUB__(v14, 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3431 v11 = ((v14 - 4) & 0x80000000u) != 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3432 //LABEL_24:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3433 if ( v11 ^ v12 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3434 //goto LABEL_25;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3435 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3436 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3437 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3438 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3439 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3440
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3441 case SPELL_EARTH_STONE_TO_FLESH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3442 case SPELL_SPIRIT_REMOVE_CURSE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3443 case SPELL_SPIRIT_RAISE_DEAD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3444 case SPELL_SPIRIT_RESSURECTION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3445 case SPELL_MIND_REMOVE_FEAR:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3446 case SPELL_MIND_CURE_PARALYSIS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3447 case SPELL_MIND_CURE_INSANITY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3448 case SPELL_BODY_CURE_WEAKNESS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3449 case SPELL_BODY_REGENERATION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3450 case SPELL_BODY_CURE_POISON:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3451 case SPELL_BODY_CURE_DISEASE:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3452 flags |= ON_CAST_WholeParty_BigImprovementAnim;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3453 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3454
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3455 case SPELL_DARK_SACRIFICE:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3456 flags |= ON_CAST_DarkSacrifice;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3457 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3458 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3459 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3460 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3461 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3462
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3463 // clear previous casts
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3464 if (flags & ON_CAST_CastingInProgress)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3465 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3466 for (uint i = 0; i < CastSpellInfoCount; ++i)
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3467 if (pCastSpellInfo[i].uFlags & ON_CAST_CastingInProgress)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3468 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3469 pCastSpellInfo[i].uSpellID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3470 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3471 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3472 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3473
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3474 CastSpellInfoHelpers::_427D48();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3475
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3476 int result = PushCastSpellInfo(spell, uPlayerID, a4, flags, a6);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3477 if ( result != -1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3478 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3479 if (flags & ON_CAST_WholeParty_BigImprovementAnim)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3480 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3481 if ( pGUIWindow_CastTargetedSpell )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3482 return;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3483 pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3484 pGUIWindow_CastTargetedSpell->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3485 pGUIWindow_CastTargetedSpell->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3486 pGUIWindow_CastTargetedSpell->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3487 pGUIWindow_CastTargetedSpell->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3488 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3489 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3490 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3491 if (flags & ON_CAST_TargetCrosshair)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3492 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3493 if ( pGUIWindow_CastTargetedSpell )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3494 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3495
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3496 pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3497 pGUIWindow_CastTargetedSpell->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3498 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3499 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3500 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3501 if (flags & ON_CAST_Telekenesis)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3502 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3503 if ( pGUIWindow_CastTargetedSpell )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3504 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3505
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3506 pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3507 pGUIWindow_CastTargetedSpell->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Telekinesis, 0, 0, "", 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3508 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3509 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3510 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3511 if (flags & ON_CAST_Enchantment)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3512 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3513 if ( pGUIWindow_CastTargetedSpell )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3514 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3515 ++pIcons_LOD->uTexturePacksCount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3516 if ( !pIcons_LOD->uNumPrevLoadedFiles )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3517 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3518 pGUIWindow_CastTargetedSpell = pCastSpellInfo[result].GetCastSpellInInventoryWindow();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3519 _50C9A0_IsEnchantingInProgress = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3520 some_active_character = uActiveCharacter;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3521 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3522 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3523 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3524 if (flags & ON_CAST_MonsterSparkles)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3525 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3526 if ( pGUIWindow_CastTargetedSpell )
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3527 return;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3528 pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3529 pGUIWindow_CastTargetedSpell->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3530 pGUIWindow_CastTargetedSpell->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3531 pGUIWindow_CastTargetedSpell->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3532 pGUIWindow_CastTargetedSpell->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3533 pGUIWindow_CastTargetedSpell->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3534 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3535 }
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
3536 if (flags & ON_CAST_DarkSacrifice && !pGUIWindow_CastTargetedSpell)
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3537 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3538 pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3539 pBtn_NPCLeft = pGUIWindow_CastTargetedSpell->CreateButton(469, 178,
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3540 ui_btn_npc_left->GetWidth(),
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3541 ui_btn_npc_left->GetHeight(),
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3542 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "",
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3543 ui_btn_npc_left, 0);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3544 pBtn_NPCRight = pGUIWindow_CastTargetedSpell->CreateButton(626, 178,
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3545 ui_btn_npc_right->GetWidth(),
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3546 ui_btn_npc_right->GetHeight(),
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3547 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "",
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2567
diff changeset
3548 ui_btn_npc_right, 0);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3549 pGUIWindow_CastTargetedSpell->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 4, 0x35u, "", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2544
diff changeset
3550 pGUIWindow_CastTargetedSpell->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 5, 0x36u, "", 0);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3551 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3552 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3553 }