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

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents d569340b05ff
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 #include <stdlib.h>
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
7 #include "Engine/Engine.h"
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
8 #include "Engine/LOD.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
9 #include "Engine/texts.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
10 #include "Engine/stru6.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
11 #include "Engine/Graphics/Overlays.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
12 #include "Engine/Graphics/Indoor.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
13 #include "Engine/Objects/SpriteObject.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
14 #include "Engine/Objects/ObjectList.h"
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
15 #include "Engine/Objects/Actor.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 #include "Spells.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 #include "../Party.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 #include "../OurMath.h"
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
20
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
21 #include "Media/Audio/AudioPlayer.h"
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
24 std::array<TownPortalData, 6> TownPortalList = // 4ECBB8
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 {{
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0}
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 }} ;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
34 struct SpellStats *pSpellStats = nullptr;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
37 std::array<stru324_spell_id_to_sprite_mapping, 103> spell_sprite_mapping = // 4E3ACC
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 {{
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
39 { SPRITE_SPELL_0, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
40 { SPRITE_SPELL_FIRE_TORCH_LIGHT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
41 { SPRITE_SPELL_FIRE_FIRE_BOLT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
42 { SPRITE_SPELL_FIRE_PROTECTION_FROM_FIRE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
43 { SPRITE_SPELL_FIRE_FIRE_AURA, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
44 { SPRITE_SPELL_FIRE_HASTE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
45 { SPRITE_SPELL_FIRE_FIREBALL, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
46 { SPRITE_SPELL_FIRE_FIRE_SPIKE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
47 { SPRITE_SPELL_FIRE_IMMOLATION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
48 { SPRITE_SPELL_FIRE_METEOR_SHOWER, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
49 { SPRITE_SPELL_FIRE_INFERNO, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
50 { SPRITE_SPELL_FIRE_INCINERATE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
51
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
52 { SPRITE_SPELL_AIR_WIZARD_EYE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
53 { SPRITE_SPELL_AIR_FEATHER_FALL, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
54 { SPRITE_SPELL_AIR_PROTECTION_FROM_AIR, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
55 { SPRITE_SPELL_AIR_SPARKS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
56 { SPRITE_SPELL_AIR_JUMP, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
57 { SPRITE_SPELL_AIR_SHIELD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
58 { SPRITE_SPELL_AIR_LIGHNING_BOLT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
59 { SPRITE_SPELL_AIR_INVISIBILITY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
60 { SPRITE_SPELL_AIR_IMPLOSION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
61 { SPRITE_SPELL_AIR_FLY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
62 { SPRITE_SPELL_AIR_STARBURST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
63
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
64 { SPRITE_SPELL_WATER_AWAKEN, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
65 { SPRITE_SPELL_WATER_POISON_SPRAY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
66 { SPRITE_SPELL_WATER_PROTECTION_FROM_WATER, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
67 { SPRITE_SPELL_WATER_ICE_BOLT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
68 { SPRITE_SPELL_WATER_WATER_WALK, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
69 { SPRITE_SPELL_WATER_RECHARGE_ITEM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
70 { SPRITE_SPELL_WATER_ACID_BURST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
71 { SPRITE_SPELL_WATER_ENCHANT_ITEM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
72 { SPRITE_SPELL_WATER_TOWN_PORTAL, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
73 { SPRITE_SPELL_WATER_ICE_BLAST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
74 { SPRITE_SPELL_WATER_LLOYDS_BEACON, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
75
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
76 { SPRITE_SPELL_EARTH_STUN, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
77 { SPRITE_SPELL_EARTH_SLOW, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
78 { SPRITE_SPELL_EARTH_PROTECTION_FROM_EARTH, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
79 { SPRITE_SPELL_EARTH_DEADLY_SWARM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
80 { SPRITE_SPELL_EARTH_STONESKIN, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
81 { SPRITE_SPELL_EARTH_BLADES, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
82 { SPRITE_SPELL_EARTH_STONE_TO_FLESH, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
83 { SPRITE_SPELL_EARTH_ROCK_BLAST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
84 { SPRITE_SPELL_EARTH_TELEKINESIS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
85 { SPRITE_SPELL_EARTH_DEATH_BLOSSOM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
86 { SPRITE_SPELL_EARTH_MASS_DISTORTION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
87
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
88 { SPRITE_SPELL_SPIRIT_DETECT_LIFE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
89 { SPRITE_SPELL_SPIRIT_BLESS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
90 { SPRITE_SPELL_SPIRIT_FATE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
91 { SPRITE_SPELL_SPIRIT_TURN_UNDEAD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
92 { SPRITE_SPELL_SPIRIT_REMOVE_CURSE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
93 { SPRITE_SPELL_SPIRIT_PRESERVATION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
94 { SPRITE_SPELL_SPIRIT_HEROISM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
95 { SPRITE_SPELL_SPIRIT_SPIRIT_LASH, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
96 { SPRITE_SPELL_SPIRIT_RAISE_DEAD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
97 { SPRITE_SPELL_SPIRIT_SHARED_LIFE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
98 { SPRITE_SPELL_SPIRIT_RESSURECTION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
99
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
100 { SPRITE_SPELL_MIND_REMOVE_FEAR, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
101 { SPRITE_SPELL_MIND_MIND_BLAST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
102 { SPRITE_SPELL_MIND_PROTECTION_FROM_MIND, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
103 { SPRITE_SPELL_MIND_TELEPATHY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
104 { SPRITE_SPELL_MIND_CHARM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
105 { SPRITE_SPELL_MIND_CURE_PARALYSIS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
106 { SPRITE_SPELL_MIND_BERSERK, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
107 { SPRITE_SPELL_MIND_MASS_FEAR, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
108 { SPRITE_SPELL_MIND_CURE_INSANITY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
109 { SPRITE_SPELL_MIND_PSYCHIC_SHOCK, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
110 { SPRITE_SPELL_MIND_ENSLAVE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
111
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
112 { SPRITE_SPELL_BODY_CURE_WEAKNESS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
113 { SPRITE_SPELL_BODY_FIRST_AID, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
114 { SPRITE_SPELL_BODY_PROTECTION_FROM_BODY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
115 { SPRITE_SPELL_BODY_HARM, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
116 { SPRITE_SPELL_BODY_REGENERATION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
117 { SPRITE_SPELL_BODY_CURE_POISON, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
118 { SPRITE_SPELL_BODY_HAMMERHANDS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
119 { SPRITE_SPELL_BODY_CURE_DISEASE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
120 { SPRITE_SPELL_BODY_PROTECTION_FROM_MAGIC, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
121 { SPRITE_SPELL_BODY_FLYING_FIST, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
122 { SPRITE_SPELL_BODY_POWER_CURE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
123
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
124 { SPRITE_SPELL_LIGHT_LIGHT_BOLT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
125 { SPRITE_SPELL_LIGHT_DESTROY_UNDEAD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
126 { SPRITE_SPELL_LIGHT_DISPEL_MAGIC, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
127 { SPRITE_SPELL_LIGHT_PARALYZE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
128 { SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
129 { SPRITE_SPELL_LIGHT_DAY_OF_THE_GODS, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
130 { SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
131 { SPRITE_SPELL_LIGHT_DAY_OF_PROTECTION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
132 { SPRITE_SPELL_LIGHT_HOUR_OF_POWER, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
133 { SPRITE_SPELL_LIGHT_SUNRAY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
134 { SPRITE_SPELL_LIGHT_DIVINE_INTERVENTION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
135
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
136 { SPRITE_SPELL_DARK_REANIMATE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
137 { SPRITE_SPELL_DARK_TOXIC_CLOUD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
138 { SPRITE_SPELL_DARK_VAMPIRIC_WEAPON, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
139 { SPRITE_SPELL_DARK_SHRINKING_RAY, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
140 { SPRITE_SPELL_DARK_SHARPMETAL, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
141 { SPRITE_SPELL_DARK_CONTROL_UNDEAD, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
142 { SPRITE_SPELL_DARK_PAIN_REFLECTION, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
143 { SPRITE_SPELL_DARK_SACRIFICE, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
144 { SPRITE_SPELL_DARK_DRAGON_BREATH, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
145 { SPRITE_SPELL_DARK_ARMAGEDDON, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
146 { SPRITE_SPELL_DARK_SOULDRINKER, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
147
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
148 { SPRITE_SPELL_BOW_ARROW, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
149 { SPRITE_SPELL_101, 0 },
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
150 { SPRITE_SPELL_LASER_PROJECTILE, 0 }
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
151 }};
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
152
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
153
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
154
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
155 SpellData::SpellData( __int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
156 __int16 inNormalLevelRecovery, __int16 inExpertLevelRecovery, __int16 inMasterLevelRecovery, __int16 inMagisterLevelRecovery,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
157 __int8 inbaseDamage, __int8 inbonusSkillDamage, __int16 instats ):
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
158 uNormalLevelMana(innormalMana),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
159 uExpertLevelMana(inExpertLevelMana),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
160 uMasterLevelMana(inMasterLevelMana),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
161 uMagisterLevelMana(inMagisterLevelMana),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
162 uNormalLevelRecovery(inNormalLevelRecovery),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
163 uExpertLevelRecovery(inExpertLevelRecovery),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
164 uMasterLevelRecovery(inMasterLevelRecovery),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
165 uMagisterLevelRecovery(inMagisterLevelRecovery),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
166 baseDamage(inbaseDamage),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
167 bonusSkillDamage(inbonusSkillDamage),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
168 stats(instats)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
169 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
170
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
171 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
172
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
173 //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1!
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
174 std::array<SpellData, 100> pSpellDatas={{
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
175 SpellData(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
176
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
177 SpellData(1, 1, 1, 1, 60, 60, 60, 40, 0, 0, 0),//0 fire
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
178 SpellData(2, 2, 2, 2, 110, 110, 100, 90, 3, 3, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
179 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
180 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
181 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
182 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 6, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
183 SpellData(10, 10, 10, 10, 150, 150, 150, 150, 0, 6, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
184 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 6, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
185 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 8, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
186 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 12, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
187 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 15, 15, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
188
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
189 SpellData(1, 1, 1, 0, 60, 60, 60, 60, 0, 0, 0), //1 air
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
190 SpellData(2, 2, 2, 2, 120, 120, 120, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
191 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
192 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 2, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
193 SpellData(5, 5, 5, 5, 90, 90, 70, 50, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
194 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
195 SpellData(10, 10, 10, 10, 100, 100, 90, 70, 0, 8, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
196 SpellData(15, 15, 15, 15, 200, 200, 200, 200, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
197 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 10, 10, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
198 SpellData(25, 25, 25, 25, 250, 250, 250, 250, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
199 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 20, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
200
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
201 SpellData(1, 1, 1, 1, 60, 60, 60, 20, 0, 0, 0), //2 water
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
202 SpellData(2, 2, 2, 2, 110, 100, 90, 70, 2, 2, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
203 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
204 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 4, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
205 SpellData(5, 5, 5, 5, 150, 150, 150, 150, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
206 SpellData(8, 8, 8, 8, 200, 200, 200, 200, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
207 SpellData(10, 10, 10, 10, 100, 100, 90, 80, 9, 9, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
208 SpellData(15, 15, 15, 15, 140, 140, 140, 140, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
209 SpellData(20, 20, 20, 20, 200, 200, 200, 200, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
210 SpellData(25, 25, 25, 25, 80, 80, 80, 80, 12, 3, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
211 SpellData(30, 30, 30, 30, 250, 250, 250, 250, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
212
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
213 SpellData(1, 1, 1, 1, 80, 80, 80, 80, 0, 0, 0), //3 earth
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
214 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
215 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
216 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 5, 3, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
217 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
218 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 9, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
219 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
220 SpellData(15, 15, 15, 15, 90, 90, 90, 80, 0, 8, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
221 SpellData(20, 20, 20, 20, 150, 150, 150, 150, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
222 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 20, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
223 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 25, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
224
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
225 SpellData(1, 1, 1, 1, 100, 100, 100, 100, 0, 0, 0), //4 spirit
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
226 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
227 SpellData(3, 3, 3, 3, 90, 90, 90, 90, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
228 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
229 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
230 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
231 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
232 SpellData(15, 15, 15, 15, 100, 100, 100, 100, 10, 8, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
233 SpellData(20, 20, 20, 20, 240, 240, 240, 240, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
234 SpellData(25, 25, 25, 25, 150, 150, 150, 150, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
235 SpellData(30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
236
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
237 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //5 mind
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
238 SpellData(2, 2, 2, 2, 110, 110, 110, 110, 3, 3, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
239 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
240 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
241 SpellData(5, 5, 5, 5, 100, 100, 100, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
242 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
243 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
244 SpellData(15, 15, 15, 15, 80, 80, 80, 80, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
245 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
246 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 12, 12, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
247 SpellData(30, 30, 30, 30, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
248
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
249 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //6 body
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
250 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
251 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
252 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 8, 2, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
253 SpellData(5, 5, 5, 5, 110, 110, 110, 110, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
254 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
255 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
256 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
257 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
258 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 30, 5, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
259 SpellData(30, 30, 30, 30, 100, 100, 100, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
260
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
261 SpellData(5, 5, 5, 5, 110, 100, 90, 80, 0, 4, 0), //7 light
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
262 SpellData(10, 10, 10, 10, 120, 110, 100, 90, 16, 16, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
263 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
264 SpellData(20, 20, 20, 20, 160, 140, 120, 100, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
265 SpellData(25, 25, 25, 25, 140, 140, 140, 140, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
266 SpellData(30, 30, 30, 30, 500, 500, 500, 500, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
267 SpellData(35, 35, 35, 35, 135, 135, 120, 100, 25, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
268 SpellData(40, 40, 40, 40, 500, 500, 500, 500, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
269 SpellData(45, 45, 45, 45, 250, 250, 250, 250, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
270 SpellData(50, 50, 50, 50, 150, 150, 150, 135, 20, 20, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
271 SpellData(55, 55, 55, 55, 300, 300, 300, 300, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
272
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
273 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0), //8 dark
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
274 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 25, 10, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
275 SpellData(20, 20, 20, 20, 120, 100, 90, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
276 SpellData(25, 25, 25, 25, 120, 120, 120, 120, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
277 SpellData(30, 30, 30, 30, 90, 90, 80, 70, 6, 6, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
278 SpellData(35, 35, 35, 35, 120, 120, 100, 80, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
279 SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
280 SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
281 SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
282 SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0),
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
283 SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0)
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
284 }};
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
285
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
286 std::array<SPELL_TYPE, 25> wand_spell_ids =
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
287 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
288 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
289 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
290 // 140 Fairy Wand of Light 141 Fairy Wand of Ice 142 Fairy Wand of Lashing 143 Fairy Wand of Mind 144 Fairy Wand of Swarms
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
291 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
292 // 145 Alacorn Wand of Fireballs 146 Alacorn Wand of Acid 147 Alacorn Wand of Lightning 148 Alacorn Wand of Blades 149 Alacorn Wand of Charms
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
293 SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
294 // 150 Arcane Wand of Blasting 151 Arcane Wand of The Fist 152 Arcane Wand of Rocks 153 Arcane Wand of Paralyzing 154 Arcane Wand of Clouds
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
295 SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
296 // 155 Mystic Wand of Implosion 156 Mystic Wand of Distortion 157 Mystic Wand of Sharpmetal 158 Mystic Wand of Shrinking 159 Mystic Wand of Incineration
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
297 SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
298 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
299
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
300
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
301 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
302
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
303 { 0, 0, 17, 13, 115, 2, 217, 15,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
304 299, 6, 28, 125, 130, 133, 294, 114,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
305 11, 232, 134, 233, 237, 171, 296, 231},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
306
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
307 { 0, 0, 19, 9, 117, 3, 206, 13,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
308 285, 7, 16, 123, 113, 101, 201, 118,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
309 317, 110, 11, 230, 149, 236, 296, 234},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
310
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
311 { 0, 0, 17, 9, 140, 0, 210, 34,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
312 293, 5, 15, 98, 78, 121, 175, 136,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
313 301, 115, 15, 226, 154, 225, 272, 220},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
314
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
315 { 0, 0, 7, 9, 156, 2, 277, 9,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
316 11, 117, 111, 82, 180, 102, 303, 108,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
317 10, 229, 120, 221, 201, 217, 296, 225},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
318
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
319 { 0, 0, 18, 8, 89, 15, 192, 14,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
320 292, 7, 22, 129, 125, 146, 217, 136,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
321 305, 115, 22, 226, 174, 237, 290, 231},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
322
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
323 { 0, 0, 18, 12, 148, 9, 292, 7,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
324 17, 122, 121, 99, 220, 87, 293, 112,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
325 13, 236, 128, 213, 220, 223, 315, 223},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
326
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
327 { 0, 0, 23, 14, 127, 8, 204, 0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
328 306, 8, 14, 115, 122, 132, 200, 116,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
329 293, 122, 20, 228, 154, 228, 294, 239},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
330
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
331 { 0, 0, 19, 14, 124, 10, 283, 12,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
332 8, 105, 113, 89, 190, 82, 298, 108,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
333 18, 181, 101, 204, 204, 203, 285, 218},
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
334
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
335 { 0, 0, 18, 17, 110, 16, 201, 15,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
336 307, 15, 18, 148, 125, 166, 201, 123,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
337 275, 120, 28, 235, 217, 222, 324, 216}}};
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
338
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
339
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
340 //----- (0042EB31) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
341 bool SpellBuff::NotExpired()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
342 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
343 return (signed __int64)this->uExpireTime > 0 ? true:false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
344 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
345
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
346
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
347 //----- (00458585) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
348 void SpellBuff::Reset()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
349 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
350 uSkill = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
351 uPower = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
352 uExpireTime = 0i64;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
353 uCaster = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
354 uFlags = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
355 if (uOverlayID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
356 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
357 pOtherOverlayList->pOverlays[uOverlayID - 1].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
358 pOtherOverlayList->bRedraw = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
359 uOverlayID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
360 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
361 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
362
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
363 //----- (004585CA) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
364 bool SpellBuff::IsBuffExpiredToTime( __int64 time_end )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
365 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
366 if (uExpireTime && (uExpireTime < time_end))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
367 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
368 uExpireTime = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
369 uPower = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
370 uSkill = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
371 uOverlayID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
372 return true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
373 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
374 return false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
375 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
376
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
377 //----- (004584E0) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
378 bool SpellBuff::Apply( signed __int64 uExpireTime, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
379 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
380 if (this->uExpireTime && (uExpireTime < this->uExpireTime))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
381 return false;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
382
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
383 this->uSkill = uSkillLevel;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
384 this->uPower = uPower;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
385 this->uExpireTime = uExpireTime;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
386 if (this->uOverlayID && this->uOverlayID != uOverlayID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
387 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
388 pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
389 pOtherOverlayList->bRedraw = true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
390 this->uOverlayID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
391 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
392 this->uOverlayID = uOverlayID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
393 this->uCaster = caster;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
394
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
395 return true;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
396 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
397
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
398 //----- (0045384A) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
399 void SpellStats::Initialize()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
400 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
401 std::map<std::string, SPELL_SCHOOL, ci_less> spellSchoolMaps;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
402 spellSchoolMaps["fire"] = SPELL_SCHOOL_FIRE;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
403 spellSchoolMaps["air"] = SPELL_SCHOOL_AIR;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
404 spellSchoolMaps["water"] = SPELL_SCHOOL_WATER;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
405 spellSchoolMaps["earth"] = SPELL_SCHOOL_EARTH;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
406 spellSchoolMaps["spirit"] = SPELL_SCHOOL_SPIRIT;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
407 spellSchoolMaps["mind"] = SPELL_SCHOOL_MIND;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
408 spellSchoolMaps["body"] = SPELL_SCHOOL_BODY;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
409 spellSchoolMaps["light"] = SPELL_SCHOOL_LIGHT;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
410 spellSchoolMaps["dark"] = SPELL_SCHOOL_DARK;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
411 spellSchoolMaps["magic"] = SPELL_SCHOOL_MAGIC;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
412
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
413 char* test_string;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
414
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
415 free(pSpellsTXT_Raw);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
416 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
417
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
418 strtok(pSpellsTXT_Raw, "\r");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
419 for(int i=1; i<100; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
420 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
421 if (((i % 11) - 1 )==0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
422 strtok(NULL, "\r");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
423 test_string=strtok(NULL, "\r")+1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
424 auto tokens = Tokenize(test_string, '\t');
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
425 pInfos[i].pName=RemoveQuotes(tokens[2]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
426 auto findResult = spellSchoolMaps.find(tokens[3]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
427 pInfos[i].uSchool = findResult == spellSchoolMaps.end() ? SPELL_SCHOOL_NONE : findResult->second;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
428 pInfos[i].pShortName=RemoveQuotes(tokens[4]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
429 pInfos[i].pDescription=RemoveQuotes(tokens[5]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
430 pInfos[i].pBasicSkillDesc=RemoveQuotes(tokens[6]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
431 pInfos[i].pExpertSkillDesc=RemoveQuotes(tokens[7]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
432 pInfos[i].pMasterSkillDesc=RemoveQuotes(tokens[8]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
433 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(tokens[9]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
434 pSpellDatas[i].stats |= strchr(tokens[10], 'm') || strchr(tokens[10], 'M') ? 1 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
435 pSpellDatas[i].stats |= strchr(tokens[10], 'e') || strchr(tokens[10], 'E') ? 2 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
436 pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
437 pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
438 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
439 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
440 //----- (00448DF8) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
441 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
442 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
443 int v9; // esi@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
444 signed __int64 v10; // st7@4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
445 signed __int64 v11; // st6@4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
446 signed __int64 v12; // st5@4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
447 double v13; // st7@6
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
448 int v14; // ST44_4@7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
449 uint skillMasteryPlusOne; // ebx@9
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
450 uint v16; // edx@15
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
451 int i; // esi@42
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
452 int j; // esi@60
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
453 unsigned __int64 v36; // qax@99
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
454 // SpellBuff *v37; // ecx@99
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
455 int v38; // esi@103
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
456 signed __int64 v39; // qax@105
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
457 int v42; // esi@111
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
458 int v43; // ebx@111
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
459 int v47; // [sp-4h] [bp-B8h]@35
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
460 int v49; // [sp+0h] [bp-B4h]@35
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
461 int v55; // [sp+28h] [bp-8Ch]@7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
462 unsigned int yaw; // [sp+30h] [bp-84h]@7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
463 int pitch; // [sp+34h] [bp-80h]@7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
464 int v60; // [sp+ACh] [bp-8h]@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
465 int a6_4; // [sp+C8h] [bp+14h]@117
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
466 int a7c; // [sp+CCh] [bp+18h]@29
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
467 int a7d; // [sp+CCh] [bp+18h]@55
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
468 signed __int64 xSquared; // [sp+D0h] [bp+1Ch]@6
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
469 int a8b; // [sp+D0h] [bp+1Ch]@37
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
470 int a8c; // [sp+D0h] [bp+1Ch]@55
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
471 signed __int64 ySquared; // [sp+D4h] [bp+20h]@6
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
472
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
473 v9 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
474 skillMasteryPlusOne = uSkillLevel + 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
475 //spellnum_ = uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
476 v60 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
477 if ( tox || toy || toz )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
478 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
479 v10 = tox - fromx;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
480 v11 = toy - fromy;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
481 v12 = toz - fromz;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
482 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
483 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
484 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
485 v10 = pParty->vPosition.x - fromx;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
486 v11 = pParty->vPosition.y - fromy;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
487 v12 = (pParty->vPosition.z + pParty->sEyelevel) - fromz;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
488 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
489 v13 = sqrt(long double(v10 * v10 + v11 * v11 + v12 * v12));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
490 if ( v13 <= 1.0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
491 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
492 v55 = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
493 yaw = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
494 pitch = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
495 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
496 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
497 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
498 v55 = (int)v13;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
499 ySquared = v11 * v11;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
500 xSquared = v10 * v10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
501 v14 = (int)sqrt(long double(xSquared + ySquared));
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
502 yaw = stru_5C6E00->Atan2((int)v10, (int)v11);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
503 pitch = stru_5C6E00->Atan2(v14, (int)v12);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
504 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
505 Assert(skillMasteryPlusOne > 0 && skillMasteryPlusOne <= 4, "Invalid mastery level");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
506
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
507 SpriteObject a1; // [sp+38h] [bp-7Ch]@12
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
508 //SpriteObject::SpriteObject(&a1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
509
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
510 switch ( uSpellID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
511 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
512 case SPELL_FIRE_FIRE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
513 case SPELL_FIRE_FIREBALL:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
514 case SPELL_AIR_LIGHNING_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
515 case SPELL_WATER_ICE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
516 case SPELL_WATER_ACID_BURST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
517 case SPELL_WATER_ICE_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
518 case SPELL_EARTH_BLADES:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
519 case SPELL_EARTH_ROCK_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
520 case SPELL_WATER_POISON_SPRAY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
521 case SPELL_AIR_SPARKS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
522 case SPELL_EARTH_DEATH_BLOSSOM:
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
523 a1.uType = spell_sprite_mapping[uSpellID].uSpriteType;
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2549
diff changeset
524 a1.containing_item.Reset();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
525 a1.spell_id = uSpellID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
526 a1.spell_level = uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
527 a1.spell_skill = skillMasteryPlusOne;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
528 v16 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
529 while (v16 < pObjectList->uNumObjects)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
530 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
531 if ( a1.uType == pObjectList->pObjects[v16].uObjectID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
532 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
533 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
534 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
535 v16++;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
536 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
537 a1.uObjectDescID = v16;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
538 a1.vPosition.x = fromx;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
539 a1.vPosition.y = fromy;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
540 a1.vPosition.z = fromz;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
541 a1.uAttributes = 16;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
542 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
543 a1.field_60_distance_related_prolly_lod = v55;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
544 a1.uSpriteFrameID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
545 a1.spell_caster_pid = 8000 | OBJECT_Item;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
546 a1.uSoundID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
547 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
548 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
549
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
550 switch ( uSpellID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
551 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
552 case SPELL_FIRE_FIRE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
553 case SPELL_FIRE_FIREBALL:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
554 case SPELL_AIR_LIGHNING_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
555 case SPELL_WATER_ICE_BOLT:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
556 case SPELL_WATER_ACID_BURST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
557 case SPELL_WATER_ICE_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
558 case SPELL_EARTH_BLADES:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
559 case SPELL_EARTH_ROCK_BLAST:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
560 //v20 = yaw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
561 a1.spell_target_pid = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
562 a1.uFacing = yaw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
563 a1.uSoundID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
564 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
565 a1.Create(yaw, pitch, v49, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
566 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
567 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
568 case SPELL_WATER_POISON_SPRAY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
569 switch ( skillMasteryPlusOne )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
570 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
571 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
572 v60 = 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
573 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
574 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
575 v60 = 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
576 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
577 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
578 v60 = 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
579 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
580 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
581 v60 = 7;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
582 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
583 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
584 a1.spell_target_pid = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
585 a1.uFacing = yaw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
586 if ( v60 == 1 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
587 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
588 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
589 a1.Create(yaw, pitch, v49, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
590 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
591 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
592 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
593 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
594 a8b = a7c / (v60 - 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
595 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
596 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
597 a1.uFacing = i + yaw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
598 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
599 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
600 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
601 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
602 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
603 case SPELL_AIR_SPARKS:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
604 switch ( skillMasteryPlusOne )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
605 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
606 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
607 v60 = 3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
608 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
609 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
610 v60 = 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
611 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
612 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
613 v60 = 7;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
614 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
615 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
616 v60 = 9;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
617 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
618 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
619 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
620 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
621 a1.spell_target_pid = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
622 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
623 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
624 a1.uFacing = j + yaw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
625 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
626 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
627 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
628 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
629 case SPELL_EARTH_DEATH_BLOSSOM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
630 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
631 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
632 a1.spell_target_pid = 4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
633 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
634 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
635 a1.Create(yaw, v47, v49, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
636 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
637 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
638
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
639 case SPELL_FIRE_HASTE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
640 if ( skillMasteryPlusOne > 0 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
641 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
642 if ( skillMasteryPlusOne <= 2 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
643 v9 = 60 * (uSkill + 60);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
644 else if ( skillMasteryPlusOne == 3 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
645 v9 = 180 * (uSkill + 20);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
646 else if ( skillMasteryPlusOne == 4 )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
647 v9 = 240 * (uSkill + 15);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
648 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
649 for (uint i = 0; i < 4; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
650 if (pParty->pPlayers[i].IsWeak())
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
651 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
652 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), skillMasteryPlusOne, 0, 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
653 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
654 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
655 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
656 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
657 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//çâóê àëòàðÿ
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
658 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
659 case SPELL_AIR_SHIELD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
660 case SPELL_EARTH_STONESKIN:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
661 case SPELL_SPIRIT_HEROISM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
662 switch ( skillMasteryPlusOne )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
663 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
664 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
665 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
666 v9 = 300 * (uSkill + 12);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
667 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
668 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
669 v9 = 900 * (uSkill + 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
670 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
671 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
672 v9 = 3600 * (uSkill + 1);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
673 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
674 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
675 switch ( uSpellID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
676 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
677 case SPELL_AIR_SHIELD:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
678 v60 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
679 uSkill = 14;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
680 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
681 case SPELL_EARTH_STONESKIN:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
682 v60 = uSkill + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
683 uSkill = 15;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
684 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
685 case SPELL_SPIRIT_HEROISM:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
686 v60 = uSkill + 5;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
687 uSkill = 9;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
688 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
689 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
690 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
691 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
692 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
693 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
694 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
695 pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
696 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
697 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
698 case SPELL_FIRE_IMMOLATION:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
699 if (skillMasteryPlusOne == 4)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
700 v38 = 600 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
701 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
702 v38 = 60 * uSkill;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
703 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
704 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
705 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
706 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
707 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
708 v36 = pParty->uTimePlayed + v39;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
709 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(v36, skillMasteryPlusOne, uSkill, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
710 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
711 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
712 case SPELL_FIRE_PROTECTION_FROM_FIRE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
713 case SPELL_AIR_PROTECTION_FROM_AIR:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
714 case SPELL_WATER_PROTECTION_FROM_WATER:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
715 case SPELL_EARTH_PROTECTION_FROM_EARTH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
716 case SPELL_MIND_PROTECTION_FROM_MIND:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
717 case SPELL_BODY_PROTECTION_FROM_BODY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
718 a6_4 = 3600 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
719 switch (skillMasteryPlusOne)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
720 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
721 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
722 v60 = uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
723 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
724 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
725 v60 = 2 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
726 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
727 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
728 v60 = 3 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
729 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
730 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
731 v60 = 4 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
732 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
733 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
734 switch ( uSpellID )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
735 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
736 case SPELL_FIRE_PROTECTION_FROM_FIRE:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
737 uSkill = PARTY_BUFF_RESIST_FIRE;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
738 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
739 case SPELL_AIR_PROTECTION_FROM_AIR:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
740 uSkill = PARTY_BUFF_RESIST_AIR;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
741 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
742 case SPELL_WATER_PROTECTION_FROM_WATER:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
743 uSkill = PARTY_BUFF_RESIST_WATER;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
744 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
745 case SPELL_EARTH_PROTECTION_FROM_EARTH:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
746 uSkill = PARTY_BUFF_RESIST_EARTH;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
747 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
748 case SPELL_MIND_PROTECTION_FROM_MIND:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
749 uSkill = PARTY_BUFF_RESIST_MIND;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
750 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
751 case SPELL_BODY_PROTECTION_FROM_BODY:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
752 uSkill = PARTY_BUFF_RESIST_BODY;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
753 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
754 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
755 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
756 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
757 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
758 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
759 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
760 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
761 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
762 case SPELL_LIGHT_DAY_OF_THE_GODS :
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
763 switch (skillMasteryPlusOne)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
764 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
765 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
766 v42 = 10800 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
767 v43 = 3 * uSkill + 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
768 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
769 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
770 v42 = 18000 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
771 v43 = 5 * uSkill + 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
772 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
773 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
774 v42 = 14400 * uSkill;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
775 v43 = 4 * uSkill + 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
776 break;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
777 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
778 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
779 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
780 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
781 pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
782 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
783 v36 = pParty->uTimePlayed + v39;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
784 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(v36, skillMasteryPlusOne, v43, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
785 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
786 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
787 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
788 return;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
789 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
790 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
791 //----- (00427769) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
792 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
793 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
794 return ( pSpellDatas[uSpellID].stats & 0xC ) != 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
795 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
796 //----- (0043AFE3) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
797 int _43AFE3_calc_spell_damage(int spellId, int spellLevel, signed int skillMastery, int currentHp)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
798 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
799 int result; // eax@1
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
800 unsigned int v5; // [sp-4h] [bp-8h]@9
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
801
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
802 result = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
803 if ( spellId == SPELL_FIRE_FIRE_SPIKE )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
804 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
805 switch (skillMastery)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
806 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
807 case 1:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
808 case 2:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
809 v5 = 6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
810 case 3:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
811 v5 = 8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
812 case 4:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
813 v5 = 10;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
814 default:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
815 return 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
816 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
817 result = GetDiceResult(spellLevel, v5);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
818 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
819 else if ( spellId == SPELL_EARTH_MASS_DISTORTION )
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
820 result = currentHp * (pSpellDatas[SPELL_EARTH_MASS_DISTORTION].baseDamage + 2 * spellLevel) / 100;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
821 else
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
822 result = pSpellDatas[spellId].baseDamage
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
823 + GetDiceResult(spellLevel, pSpellDatas[spellId].bonusSkillDamage);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
824
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
825 return result;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
826 }