-
Notifications
You must be signed in to change notification settings - Fork 3
/
spelList.cpp
677 lines (616 loc) · 16.8 KB
/
spelList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
#include "stdafx.h"
extern BYTE *spellDefPtr;
BYTE **clientPlayerInfoPtr;
int (__cdecl *spellGetValidMB)(int Spell);
void *(__cdecl *gLoadImg)(const char *Name);
void (__cdecl *drawSetTextColor)(DWORD Color);
void (__cdecl *drawGetStringSize)(void *FontPtr,const wchar_t*String,
int *W,int *H,DWORD Flags);
void (__cdecl *drawString)(void *FontPtr,const wchar_t*String,int X,int Y);
void (__cdecl *drawUpdateMB)(int A,int B);
void (__cdecl *wndSetTooltip)(void *Wnd, const wchar_t *Str);
void (__cdecl *netSpellRewardCli)(int Spell, int newLevel,int ShowBook, int AddToBar);
int (__cdecl *audSyllStartSpeak)(int SpellN);/// íà÷èíàåò ãîâîðèòü ñïåëë
extern DWORD __cdecl mySpellGetFlags(int Spell);
extern int __cdecl mySpellIsEnabled(int Spell);
extern const wchar_t * __cdecl mySpellLoadName(int Spell);
DWORD *guiSpellListedNumbers;// Ìàññèâ ñïåëëîâ - áóäåì èç íåãî èñïîëüçîâàòü òîëüêî îäèí ýëåìåíò - 3é
DWORD *bookWndState;
DWORD *bookIsMonster;
DWORD *bookColorNormal;
DWORD *bookColorDisabled;
DWORD *bookSpellSelected;
DWORD *bookSpellDnDType; /// åñëè òàùàò êàêîé-òî ñïåëë
DWORD *bookSpellNumberDnD;/// êàêîé ñåé÷àñ ñïåëë òàùàò
int *bookSelSpell;/// Òåêóùèé îòêðûòé ñïåëë
int *bookPagesList;/// ñêîëüêî ñòðàíèö çàíèìàåò ñïèñîê ñïåëëîâ
int *bookLineHeight;
int *bookListHidden;/// ñòðàííûé ñ÷åò÷èê ñïåëëîâ - ïîõîæå ñêîëüêî íå ïîêàçûâàòü
int *bookListTotalCount;/// ñêîëüêî âñåãî ñïåëîâ
int mySelectedSpell;/// òåïåðü ýòà ïåðåìåííàÿ áóäåò ëèñòàòñÿ ïðè íàæàòèè ñòðåëîê
/*
0100 0000 - ñïåëë îáùèé
0200 0000 - ñïåëë ìàãà (1)
0400 0000 - ñïåëë êîíæà(2)
*/
/*
bookSpellList - ñïèñîê ñïåëîâ, ÈÇÂÅÑÒÍÛÕ ýòîìó èãðîêó, â ïîðÿäêå ñîðòèðîâêè
spellData - ñïèñîê âñåõ ñïåëîâ, íà äàííîì êëèåíòå, çäåñü æå õðàíèòñÿ, êàêèå èç íèõ èçâåñòíû ÄÀÍÍÎÌÓ èãðîêó
äëÿ óïðîùåíèÿ êîäà - êîãäà ëèñòàþò êíèæêó â ìàññèâ êëàäåì ñïåöèàëüíûé íîìåð 0x100
à ãåò-ôóíêöèè âîçâðàùàþò äàííûå ïî ÒÅÊÓÙÅÌÓ ñïåëëó èç mySelectedSpell
åùå ðàáîòà ïî îòîáðàæåíèþ ñïåëîâ:
- ïîïðàâèòü DnD èç îòêðûòîãî ÎÄÍÎÃÎ ñïåëëà
- â ñëó÷àå êëèåíòà èíèöèàëèçèðîâàòü ñïåëëû
- ñèíõðîíèçàöèþ
- ïðîâåðèòü ñàììîíû
- ïðîâåðèòü îïèñàëâî êðè÷åé
- ñäåëàòü àáèëêè âîèíà
- ïðîâåðèòü ðàñõîä ìàíû â îïèñàíèè
*/
namespace
{
void *myDragIcon=NULL;///èêîíêó äëÿ ïåðåíîñêè
int nextSpellIndex=0x101; /// íîìåð ñëåäóþùåãî ñïåëëà
bool spellIsSummon(int Spell)
{
//sfCreature
DWORD F=mySpellGetFlags(Spell);
const wchar_t *Name=mySpellLoadName(Spell);
Name++;
return (Spell >=75) && (Spell<114);
}
int __cdecl mySpellReward(int Spell,BYTE *PlayerInfo,int PlayerClass)
/// íàäëåæèò âåðíóòü 1 åñëè ñïåëë äîáàâëÿåòñÿ
/// 0 - åñëè íå äîáàâëÿåòñÿ (íàïðèìåð óæå áûë)
{
int Top=lua_gettop(L);
getClientVar("bookSpellList");
if (PlayerClass==0) // êîíâåðñèÿ àáèëîê â ñïåëëû
Spell+=ABIL_TO_SPELL;
int i,n=lua_objlen(L,-1);
for (i=1;i<=n+1;i++)
{
lua_rawgeti(L,-1,i);
if (lua_tointeger(L,-1)==Spell)
break;
lua_settop(L,Top+1);
}
if (i==n+1)
{
lua_rawseti(L,-2,i); // ñïåëëà íåáûëî - äîáàâëÿåì
lua_pushinteger(L,Spell);
}
getClientVar("spellData");
lua_pushinteger(L,Spell);
lua_gettable(L,-2);
if (lua_type(L,-1)==LUA_TNUMBER)/// Ëèáî òóò ÷èñëî - ëåâåë ñïåëëà
{
/// todo - ïîâûñèòü óðîâåíü
}
else
{
lua_getfield(L,-1,"level");
lua_pushinteger(L,lua_tointeger(L,-1)+1);
lua_getfield(L,-3,"level");
}
lua_settop(L,Top);
return 1;
}
void __declspec(naked) mySpellRewardPre()
// âûçûâàåòñÿ êîãäà êëèåíò ïîëó÷àåò íîâûé ÑÒÀÍÄÀÐÒÍÛÉ ñïåëë
// Çäåñü ìîæåò áûòü èíòåðåñíûì òîëüêî âîçìîæíîñòü ÍÅ ÄÀÒÜ ñïåëë èãðîêó
// åñëè ìû óæå åãî äàâàëè
{
__asm
{
pop eax // äîñòàåì àäðåñ âîçâðàòà
push ebx // êëàäåì èãðîêà
push ebp // êëàäåì ñïåëë
call mySpellReward
add esp,0xC
cmp ebp,0x22
jnz l1
mov ecx,eax /// äîáàâëÿåì òðàï
push 0x0045D0D4
ret
l1:
test eax,eax
jz l2
cmp [esp+0x1C],edi // ïàðàìåòð - îòêðûòü êíèãó èëè íåò
jz l2
push 0x0045D117 // ïîêàçûâàåì êíèãó
ret
l2:
push 0x0045D139 // íè÷åãî íå ïîêàçûâàåì
ret
};
}
void drawDefAbil(int Spell,int plrClass,int X,int Y)
{
}
void drawDefCreature(int Spell,int plrClass,int X,int Y)
{
drawSetTextColor(
((2==plrClass) && !mySpellIsEnabled(Spell))? // åñëè êîíæ
*bookColorDisabled:
*bookColorNormal
);
const wchar_t *Name=mySpellLoadName(Spell);
int W=0;
drawGetStringSize(NULL,Name,&W,NULL,0x80);
drawString(NULL,Name,X-W/2,Y);
}
void drawDefSpell(int Spell,int plrClass,int X,int Y)
{
drawSetTextColor(
!mySpellIsEnabled(Spell)?
*bookColorDisabled:
*bookColorNormal
);
const wchar_t *Name=mySpellLoadName(Spell);
int W=0;
drawGetStringSize(NULL,Name,&W,NULL,0x80);
drawString(NULL,Name,X-W/2,Y);
}
void drawUniItem(int X,int Y,bool isCreatures)
{
int i=-1;
lua_getfield(L,i--,"flags");
DWORD Flags=lua_tointeger(L,-1);
if ( (0!=Flags&sfCreature) ^ isCreatures )
return;
DWORD Color=*bookColorNormal;
lua_getfield(L,i--,"color");
if (lua_type(L,-1)==LUA_TNUMBER)
Color=lua_tointeger(L,-1);
lua_getfield(L,i--,"disabled");
drawSetTextColor(
0!=lua_toboolean(L,-1)?
*bookColorDisabled:
Color
);
wchar_t Name[120];
size_t Len=0;
lua_getfield(L,i--,"name");
const char *NameS=lua_tolstring(L,-1,&Len);
if (Len!=0)
{
if (Len>119)
Len=119;
mbstowcs(Name,NameS,120);
Name[Len]=0;
}
else
wcscpy(Name,L"(wrong)");
int W=0;
drawGetStringSize(NULL,Name,&W,NULL,0x80);
drawString(NULL,Name,X-W/2,Y);
}
void drawSpellList(int PageN,int LinesPerPage,int X,int Y)
{ /// Â ýòîé ôóíêöèè ìîæåò áûòü ñóùåñòâåííàÿ ïîòåðÿ áûñòðîäåéñòâèÿ
int Top=lua_gettop(L);
getClientVar("bookSpellList");
if (lua_type(L,-1)!=LUA_TTABLE)
{
lua_settop(L,Top);
return;
}
bool isCreatures=(1==*bookWndState);
int Count=lua_objlen(L,-1);// ñêîëüêî ñïåëëîâ íàì èçâåñòíî
*bookListTotalCount=Count;
*bookPagesList=1 + (Count+LinesPerPage)/LinesPerPage;
*bookListHidden=0;
int i=1+PageN*LinesPerPage*2,right=i+LinesPerPage;
if (i+2*LinesPerPage<Count)
Count=i-1+2*LinesPerPage;
X+=78;
Y+=19;
int Y0=Y;
int plrClass=(*clientPlayerInfoPtr)[0x8CB];
getClientVar("spellData");
if (lua_type(L,-1)!=LUA_TTABLE)
return;
for (;i<=Count;i++)
{
if (i==right)// ïåðåõîäèì íà ïðàâóþ ïîëîâèíó
{
X+=199-78;
Y=Y0;
}
lua_settop(L,Top+2);// spellData bookList
lua_rawgeti(L,-2,i);
int V=0;
V=lua_tointeger(L,-1);
lua_gettable(L,-2);
if (lua_type(L,-1)==LUA_TNUMBER) // ñòàíäàðòíûé ñïåëë
{
int Spell=lua_tointeger(L,-1);
if (spellIsSummon(Spell) ^ isCreatures)
continue;
if (isCreatures)
drawDefCreature(Spell,plrClass,X,Y);
else if (0==plrClass)
drawDefAbil(Spell,plrClass,X,Y);
else
drawDefSpell(Spell,plrClass,X,Y);
}
else if(lua_type(L,-1)==LUA_TTABLE)
drawUniItem(X,Y,isCreatures);
Y+=*bookLineHeight;
}
lua_settop(L,Top);
}
int __cdecl myBookUpdateList(int PlayerClass)
{
int Top=lua_gettop(L);
int Ret=0;
getClientVar("bookSpellList");
if (lua_type(L,-1)==LUA_TTABLE)
Ret=lua_objlen(L,-1);
lua_settop(L,Top);
return Ret;
}
void mySpellSelectOne()
{
*bookSelSpell=3;
guiSpellListedNumbers[3]=1;
int plrClass=(*clientPlayerInfoPtr)[0x8CB];
if (plrClass==0)
return; //TODO: äëÿ ÂÎÅÍÀ ïîêà íå çíàåì ÷åãî äåëàòü
guiSpellListedNumbers[3]=0x100; // äëÿ îñòàëüíûõ - ïîäñîâûâàåì ÂÈÐÒÓÀËÜÍÛÉ ñïåëë
}
void __declspec(naked) mySpellSelectOnePre()
{
__asm
{
push eax
call mySpellSelectOne
pop eax
cmp eax,1
jne l1
push 0x0045C00E
ret
l1:
push 0x0045C287
ret
}
}
/*
void *__cdecl getAbilIconForDnDPre(int Spell,int Enabled)
{
int Top=lua_gettop(L);
if (Spell==0x100)
{
getClientVar("bookSpellList");
if (lua_type(L,-1)!=LUA_TTABLE)
{
lua_settop(L,Top);
return 0;
}
lua_pushinteger(L,mySelectedSpell+1);
lua_gettable(L,-2);
Spell=lua_tointeger(L,-1);
lua_settop(L,Top);
}
if (Spell<0x100)
return spellAbilGetIcon(Spell,Enabled);
return myDragIcon;
}
void *__cdecl getSpellIconForDnDPre(int Spell)
{
int Top=lua_gettop(L);
if (Spell==0x100)
{
getClientVar("bookSpellList");
if (lua_type(L,-1)!=LUA_TTABLE)
{
lua_settop(L,Top);
return 0;
}
lua_pushinteger(L,mySelectedSpell+1);
lua_gettable(L,-2);
Spell=lua_tointeger(L,-1);
lua_settop(L,Top);
}
if (Spell<0x100)
return mySpellLoadIcon(Spell);
return myDragIcon;
}
*/
/// =1 - ñïåëë
/// =2 - àáèëêè
/// =3 - êðè÷à äëÿ ñàììîíà
void getSpellForDnD(int SelectedId,int Type)
{
int Top=lua_gettop(L);
int Spell=0;
getClientVar("bookSpellList");
if (lua_type(L,-1)!=LUA_TTABLE)
{
lua_settop(L,Top);
return;
}
getClientVar("spellData");
if (lua_type(L,-1)!=LUA_TTABLE)
{
lua_settop(L,Top);
return;
}
lua_pushinteger(L,SelectedId+1);
lua_gettable(L,-3);
if (lua_type(L,-1)!=LUA_TNUMBER)
{
lua_settop(L,Top);
return;
}
int X=0;
X=lua_tonumber(L,-1);
lua_gettable(L,-2);
if (lua_type(L,-1)==LUA_TNUMBER) // ñòàíäàðòíûé ñïåëë
{
lua_pushlightuserdata(L,&getSpellForDnD);
lua_pushnil(L);
lua_settable(L,LUA_REGISTRYINDEX);/// çàïèøåì âûáðàííûé ñïåëë
Spell=lua_tointeger(L,-1)+((Type==3)?0x4A:0);
/// Çäåñü íàäî ïðîâåðèòü ìîæåò òàì íîìåð ñëèøêîì áîëüøîé
}
else
{
lua_pushlightuserdata(L,&getSpellForDnD);
lua_pushvalue(L,-2);
lua_settable(L,LUA_REGISTRYINDEX);/// çàïèøåì âûáðàííûé ñïåëë
lua_getfield(L,-2,"index");
Spell=lua_tointeger(L,-1);
if (Spell<0x101)// Çàïèøåì íîâûé ñïåëë
{
lua_pushinteger(L,nextSpellIndex);
lua_setfield(L,-4,"index");
getClientVar("spellData");
lua_pushinteger(L,nextSpellIndex);
lua_pushvalue(L,-5);// èíäåêñ, òàáëèöà,ïóñòîé èíäåêñ,èêîíêà, ãëàâíàÿ òàáëèöà
lua_settable(L,-3);
Spell=nextSpellIndex++;
}
}
*bookSpellSelected=Spell;
*bookSpellDnDType=1;
*bookSpellNumberDnD=Spell;
lua_settop(L,Top);
drawUpdateMB(793,100);/// ìàãè÷åñêèå ÷èñëà, íå çíàþ ïî÷åìó òàêèå
return;
}
/* void __cdecl mySpellKeyPackSetSpell(keyPack *KeyPack,int NewSpell,int KeyN)
{
KeyPack->keyRowPtr[KeyN].Spell=NewSpell;
BYTE *P=(BYTE*)KeyPack->spellWndItemMB[KeyN];
if (NewSpell<0x100)
{
if (P!=NULL)
wndSetTooltip(P+24,spellLoadName(NewSpell));
if (clientPlayerInfoPtr!=0)
drawUpdateMB(794,100);/// ìàãè÷åñêèå ÷èñëà, íå çíàþ ïî÷åìó òàêèå
return;
}
//îñîáûé ñëó÷àé
int Top=lua_gettop(L);
lua_pushlightuserdata(L,&getSpellForDnD);
lua_gettable(L,LUA_REGISTRYINDEX);/// çàïèøåì âûáðàííûé ñïåëë
lua_getfield(L,-1,"name");
size_t Len;
const char *S=lua_tolstring(L,-1,&Len);
wchar_t Buf[200]=L"(Uni spell)";
if (Len>0)
mbstowcs(Buf,S,min(Len,199));
wndSetTooltip(P+24,Buf);
if (clientPlayerInfoPtr!=0)
drawUpdateMB(794,100);/// ìàãè÷åñêèå ÷èñëà, íå çíàþ ïî÷åìó òàêèå
lua_settop(L,Top);
return;
}*/
void __declspec(naked) getAbilForDnDPre()
{
__asm{
push 2
push ecx
call getSpellForDnD
add esp,8
mov ecx,eax
push 0x0045B85D
ret
};
}
void __declspec(naked) getCreaForDnDPre()
{
__asm{
push 3
push ecx
call getSpellForDnD
add esp,8
push 0x0045B85D
ret
};
}
void __declspec(naked) getSpellForDnDPre()
{
__asm{
push 1
push ecx
call getSpellForDnD
add esp,8
push 0x0045B85D
ret
};
}
void __declspec(naked) drawSpellListPre()
{
__asm{
push [esp+0x22C-0x214]
push [esp+0x230-0x218]
push ecx
push esi
call drawSpellList
add esp,0x10
push 0x0045C78D
ret
}
}
void onSpellStart(BYTE *Packet)
{
audSyllStartSpeak(*((DWORD*)Packet));
}
void onSpellSync(BYTE *Packet)
{
DWORD StartIdx=*((DWORD *)(Packet));
}
}
extern void InjectJumpTo(DWORD Addr,void *Fn);
extern void InjectOffs(DWORD Addr,void *Fn);
extern void InjectAddr(DWORD Addr,void *Fn);
void mapLoadSpells()
{
int Top=lua_gettop(L);
int plrClass=(*clientPlayerInfoPtr)[0x8CB];
luaL_loadstring(L,
"local l={...}; "
"table.sort(l[1],"
"function (a,b) "
"return spellInfo(a).name < spellInfo(b).name "
"end)"
);
lua_getfield(L,LUA_REGISTRYINDEX,"client");
lua_setfenv(L,-2);
getClientVar("bookSpellList");
int Cnt=1;
lua_pushinteger(L,0x101);
lua_rawseti(L,-2,Cnt++);
lua_pushinteger(L,0x102);
lua_rawseti(L,-2,Cnt++);
if (plrClass != 0)
{
for (int i=0;i<ABIL_TO_SPELL;i++) /// Âñå îáû÷íûå ñïåëëû
{
DWORD DW=mySpellGetFlags(i);
if ( (DW & 0x01000000) ||
((plrClass==1) && (DW & 0x02000000)) ||
((plrClass==2) && (DW & 0x04000000))
)
{
lua_pushinteger(L,i);
lua_rawseti(L,-2,Cnt++);
}
}
}
else
{
for (int i=0;i<5;i++) /// Âñå îáû÷íûå ñïåëëû
{
lua_pushinteger(L,i);
lua_rawseti(L,-2,Cnt++);
}
}
if (0!=lua_pcall(L,1,0,0))
{
const char *C=NULL;
C=lua_tostring(L,-1);
C++;
};
getClientVar("spellData");
lua_pushinteger(L,0x101);
lua_newtable(L);
lua_pushstring(L,"testSpell");
lua_setfield(L,-2,"name");
lua_pushinteger(L,40);
lua_setfield(L,-2,"mana");
lua_pushinteger(L,0x3080A0);
lua_setfield(L,-2,"color");
lua_pushinteger(L,0x01000008);// Îáùèé, ïëîùàäíûé
lua_setfield(L,-2,"flags");
//player,targX,targY,targetUnit,data -> success
if (0==luaL_loadstring(L,
"local me,tx,ty=... \n"
"local x,y = unitPos(me) \n"
"if not mapTraceRay(x,y,tx,ty,5) then return false end \n"
"soundMake(0x28,tx,ty) " // çâóê ñðàáàòûâàíèÿ ëîâóøêè
"netPointFx(0x89,tx,ty) "
// "soundSyll(me,1) "
"local r=createObject('waterbarrel',tx,ty) \n"
"unitDecay(r,600) return true"))
{
lua_setfield(L,-2,"servOnStart");
}
else
{
conPrintI(lua_tostring(L,-1));
lua_pop(L,1);
}
lua_settable(L,-3);
lua_settop(L,Top);
}
void spellGetInit();
void spellListInit()
{
ASSIGN(audSyllStartSpeak,0x0049BB80);
ASSIGN(clientPlayerInfoPtr,0x00853BB0);
ASSIGN(spellGetValidMB,0x00424B50);
ASSIGN(bookPagesList,0x006D3F30);
ASSIGN(bookIsMonster,0x006D3EEC);
ASSIGN(bookWndState,0x006D3EE8);
ASSIGN(bookColorNormal,0x006D3EF4);
ASSIGN(bookColorDisabled,0x006D3EF8);
ASSIGN(bookSpellSelected,0x006D417C);
ASSIGN(bookSelSpell,0x006D3F28);
ASSIGN(bookSpellNumberDnD,0x006E037C);
ASSIGN(bookSpellDnDType,0x006E0380);
ASSIGN(bookLineHeight,0x006D3E14);
ASSIGN(bookListTotalCount,0x006D4168);
ASSIGN(bookListHidden,0x006D416C);
ASSIGN(drawSetTextColor,0x00434390);
ASSIGN(drawGetStringSize,0x0043F840);
ASSIGN(drawString,0x0043F6E0);
ASSIGN(drawUpdateMB,0x00452D80);
ASSIGN(wndSetTooltip,0x0046B000);
ASSIGN(gLoadImg,0x0042F970);
ASSIGN(guiSpellListedNumbers,0x006D3F44);
ASSIGN(spellDefPtr,0x00663EF0);
bool useMySpells=false;
if (useMySpells)
{
//////// äðàãäðîï
/// 0045DCA0 - òàì ôóíêöèÿ, êîòîðàÿ âûçûâàåòñÿ ïðè ïîïûòêè áðîñèòü ñïåëë êóäà-ëèáî
/// - ñîîòâåòñòâåííî åå ïðàâèòü åñëè íàäî êèäàòü ñïåëëû â äðóãèå îêíà
///îáíîâëÿåò è ñ÷èòàåò ñêîëüêî åñòü ñïåëîâ è ò.ï.
InjectJumpTo(0x0045ADF0,myBookUpdateList);
///// ðèñîâàíèå ñïèñêà ñïåëëîâ/êðè÷åé
InjectJumpTo(0x0045BE60,drawSpellListPre);
InjectJumpTo(0x0045B76A,getAbilForDnDPre);
InjectJumpTo(0x0045B801,getCreaForDnDPre);
InjectJumpTo(0x0045B83A,getSpellForDnDPre);
//InjectJumpTo(0x0045DC40,mySpellKeyPackSetSpell);
/// èêîíêà â ïðîñìîòðå îòäåëüíîé êíèãè çà êîíæà è ìàãà
/// êðè÷è èäóò êàê ñïåëëû +74
InjectOffs(0x0045D0C1+1,&mySpellRewardPre);
// InjectOffs(0x004778E6+1,&getAbilIconForDnDPre);
// InjectOffs(0x004778FA+1,&getSpellIconForDnDPre);
InjectAddr(0x0045B93E+1,&mySelectedSpell);//ïóñòü bookMoveToPage ëèñòàåò íàøó ïåðåìåííóþ
InjectAddr(0x0045B2A7+1,&mySelectedSpell);//ïóñòü bookLeftProc ëèñòàåò íàøó ïåðåìåííóþ
InjectAddr(0x0045B2D6+1,&mySelectedSpell);//ïóñòü bookLeftProc ëèñòàåò íàøó ïåðåìåííóþ
InjectAddr(0x0045B103+2,&mySelectedSpell);//ïóñòü bookRightProc ëèñòàåò íàøó ïåðåìåííóþ
InjectAddr(0x0045B177+2,&mySelectedSpell);//ïóñòü bookRightProc ëèñòàåò íàøó ïåðåìåííóþ
InjectAddr(0x0045B18C+2,&mySelectedSpell);//ïóñòü bookRightProc ëèñòàåò íàøó ïåðåìåííóþ
InjectJumpTo(0x0045C005,mySpellSelectOnePre); // äæàìï íà óñòàíîâêó âèðòóàëüíîãî ñïåëà â ðåæèìå îäíîãî îáúåêòà
InjectJumpTo(0x0045FE6F,(void*)0x0045FE81);
spellGetInit();
netRegClientPacket(upSpellStart,onSpellStart);
netRegClientPacket(upSpellSync,onSpellSync);
//InjectJumpTo(0x0045C3A2,);
}
lua_createtable(L,256,0);
for (int i=1;i<ABIL_TO_SPELL+ 5 ;i++)
{
lua_pushinteger(L,i);
lua_rawseti(L,-2,i);
}
registerClientVar("spellData");/// Òóäà ïëþõàþòñÿ ÂÑÅ ñïåëëû êàêèå åñòü
lua_createtable(L,256,0);
registerClientVar("bookSpellList");
};