Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NOALIGN struct _BinTree_
- {
- _BinTree_* left;
- _BinTree_* parent;
- _BinTree_* right;
- _char_ name[12];
- _dword_ name_end;
- _BinTreeItem_* item;
- _dword_ field_20;
- // my
- inline _BinTreeItem_* FindItem(char* name)
- {
- if (name)
- {
- _BinTree_* search_result = CALL_2(_BinTree_*, __thiscall, 0x55EE00, this, name);
- if ((search_result == this->parent) || (_strcmpi(name, search_result->name) < 0))
- return NULL;
- return search_result->item;
- }
- else
- return NULL;
- }
- inline void AddItem(_BinTreeItem_* item, char* name)
- {
- _ptr_ buf[2];
- char named_item_block[20];
- MemCopy(named_item_block, name, 12);
- *(_dword_*)(named_item_block + 12) = 0;
- *(_BinTreeItem_**)(named_item_block + 16) = item;
- CALL_3(void, __thiscall, 0x55DDF0, this, buf, named_item_block);
- }
- };
- ...
- NOALIGN struct _TxtLine_
- {
- //int Exist; // 1=выделена память, 0=нет
- //char **Start;
- //char **Stop;
- //char **End;
- _List_<_cstr_> items;
- };
- #define o_LoadTxt(name) CALL_1(_Txt_*, __fastcall, 0x55C2B0, name)
- NOALIGN struct _Txt_ : public _BinTreeItem_
- {
- _List_<_TxtLine_*> Lines;
- //_TxtLine_** StartLine; // +20 ук на первую строку
- //_TxtLine_** StopLine; // +24 ук на строку за последней
- inline static _Txt_* Load(char* filename) {return o_LoadTxt(filename);}
- inline char* GetString(int index) { return *(char **)(*(_ptr_*)((_ptr_)(this) + 32) + (_dword_)(index)*4);}
- };
- ...
- int __stdcall ReadSptraitsLineHook(HiHook* h, _Txt_** file_ptr, int spell, int line_num)
- {
- _Txt_* file = *file_ptr;
- char* anim_ix = file->Lines[line_num]->items[33];
- /*
- char mess[255];
- sprintf(mess,"%s %i", anim_ix, atoi(anim_ix) );
- MessageBoxA(0,(LPCSTR)mess,"",0);*/
- if(*anim_ix)
- o_Spell[spell].animation_ix = atoi(anim_ix);
- o_Spell[spell].flags = 0;
- for(int i = 0; i!=32; i++)
- {
- char* flag = file->Lines[line_num]->items[35+i];
- if(*flag)
- o_Spell[spell].flags |= 1 << i;
- }
- return CALL_3(int,__cdecl,h->GetOriginalFunc(),file_ptr,spell,line_num);
- }
- ....
- patcher->WriteHiHook(0x775990,SPLICE_,EXTENDED_, CDECL_, (void*)ReadSptraitsLineHook);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement