1 | <?php namespace FreedomCore\TrinityCore\Character\Classes; |
||
19 | class Boost |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * SOAPClient Instance |
||
24 | * @var SOAPClient|null |
||
25 | */ |
||
26 | protected $client = null; |
||
27 | |||
28 | /** |
||
29 | * GearSets Instance |
||
30 | * @var GearSets|null |
||
31 | */ |
||
32 | protected $gear = null; |
||
33 | |||
34 | /** |
||
35 | * Title of the message |
||
36 | * @var null|string |
||
37 | */ |
||
38 | protected $messageTitle = null; |
||
39 | |||
40 | /** |
||
41 | * Body of the message |
||
42 | * @var null|string |
||
43 | */ |
||
44 | protected $messageBody = null; |
||
45 | |||
46 | /** |
||
47 | * Character super class reference |
||
48 | * @var Character|null |
||
49 | */ |
||
50 | protected $super = null; |
||
51 | |||
52 | /** |
||
53 | * Character Instance |
||
54 | * @var null|CharacterModel |
||
55 | */ |
||
56 | protected $character = null; |
||
57 | |||
58 | /** |
||
59 | * Boost Data Array |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $boostData = [ |
||
63 | 'level' => 0, |
||
64 | 'spec' => 0, |
||
65 | 'gear' => [] |
||
66 | ]; |
||
67 | |||
68 | /** |
||
69 | * Professions boost for level |
||
70 | * @var array |
||
71 | */ |
||
72 | protected $professionsBoost = [ |
||
73 | 90 => 600, |
||
74 | 100 => 700 |
||
75 | ]; |
||
76 | |||
77 | /** |
||
78 | * Money boost for level |
||
79 | * @var array |
||
80 | */ |
||
81 | protected $moneyBoost = [ |
||
82 | 90 => 1500000, |
||
83 | 100 => 5000000 |
||
84 | ]; |
||
85 | |||
86 | /** |
||
87 | * Boost constructor. |
||
88 | * @param Character $character |
||
89 | * @param SOAPClient $client |
||
90 | */ |
||
91 | public function __construct(Character $character, SOAPClient $client) |
||
98 | |||
99 | /** |
||
100 | * Get Client Instance |
||
101 | * @return SOAPClient |
||
102 | */ |
||
103 | public function getClient() : SOAPClient |
||
107 | |||
108 | /** |
||
109 | * Get Gear Instance |
||
110 | * @return GearSets |
||
111 | */ |
||
112 | public function getGear() : GearSets |
||
116 | |||
117 | /** |
||
118 | * Get message title |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getMessageTitle() : string |
||
125 | |||
126 | /** |
||
127 | * Get message body |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getMessageBody() : string |
||
134 | |||
135 | /** |
||
136 | * Set Client Instance |
||
137 | * @param SOAPClient $client |
||
138 | * @return Boost |
||
139 | */ |
||
140 | public function setClient(SOAPClient $client) : Boost |
||
145 | |||
146 | /** |
||
147 | * Set Gear Instance |
||
148 | * @param GearSets $gearSets |
||
149 | * @return Boost |
||
150 | */ |
||
151 | public function setGear(GearSets $gearSets) : Boost |
||
156 | |||
157 | /** |
||
158 | * Set message title |
||
159 | * @param string $title |
||
160 | * @return Boost |
||
161 | */ |
||
162 | public function setMessageTitle(string $title) : Boost |
||
167 | |||
168 | /** |
||
169 | * Set message body |
||
170 | * @param string $body |
||
171 | * @return Boost |
||
172 | */ |
||
173 | public function setMessageBody(string $body) : Boost |
||
178 | |||
179 | /** |
||
180 | * Specify the level we want to boost character to |
||
181 | * @param int $level |
||
182 | * @return Boost |
||
183 | */ |
||
184 | public function boostTo(int $level) : Boost |
||
193 | |||
194 | /** |
||
195 | * Select spec for character |
||
196 | * @param int $spec |
||
197 | * @return Boost |
||
198 | */ |
||
199 | public function withSpec(int $spec) : Boost |
||
213 | |||
214 | /** |
||
215 | * Actually boost character |
||
216 | * @param bool $boostProfessions |
||
217 | * @throws \Exception |
||
218 | * @return bool |
||
219 | */ |
||
220 | public function boost(bool $boostProfessions = false) : bool |
||
241 | |||
242 | /** |
||
243 | * Validate message structure |
||
244 | */ |
||
245 | private function validateMessageStructure() |
||
254 | |||
255 | /** |
||
256 | * Send old items to the character via in-game mail system |
||
257 | * @param bool $deleteItems |
||
258 | * @throws \Exception |
||
259 | */ |
||
260 | private function sendOldItemsToCharacter(bool $deleteItems = true) |
||
300 | |||
301 | /** |
||
302 | * Delete item reference and item inventory entry |
||
303 | * @param ItemInstance $instance |
||
304 | * @throws \Exception |
||
305 | */ |
||
306 | protected function deleteItemInstance(ItemInstance $instance) |
||
311 | |||
312 | /** |
||
313 | * Equip new items on the character |
||
314 | * @param Item $item |
||
315 | * @return int |
||
316 | */ |
||
317 | protected function createItemInstance(Item $item) |
||
334 | |||
335 | /** |
||
336 | * Boost characters professions |
||
337 | */ |
||
338 | protected function boostProfessions() |
||
354 | } |
||
355 |