Spañish
Hola que tal recien encontre el codigo del item effect smoke en el cual el RGB es manejado desde un archivo ini pero como recien aprendo de programacion no e llegado a terminar el codigo ya que le hace falta los llamado de los tokens.
este codigo lo encontre en un post de effect smoke aclaro que el codigo es de un tipo llamado psicodelik creo yo que le hacen falta los llamados de los token algo que nose hacer
English
Hello, I just found the code of the item smoke effect in which the RGB is handled from an ini file but as I just learned from programming I did not get to finish the code since I need to call the tokens.
E
Code:.cpp #include "stdafx.h" //variavel global int variavelE; //struct _effect e[255]; //variaveis int pItemID_boots = 0; float R = 0.0f; float G = 0.0f; float B = 0.0f; void _loadfile_effect(char* filename) { Tokenizer token; TokenizerGroup group; TokenizerSection section; token.ParseFile(std::string(filename), group); if(group.GetSection(0, section)) { for(int i = 0; i < section.RowCount; i++) { e[variavelE].Boots = section.Rows[i].GetInt(0); e[variavelE].R = section.Rows[i].GetFloat(1); e[variavelE].G = section.Rows[i].GetFloat(2); e[variavelE].B = section.Rows[i].GetFloat(3); variavelE++; } } } //função refeita __declspec(naked) void DTset_effect() { __asm { // set:: boots MOV EAX,DWORD PTR SS:[EBP+8] MOVSX ECX,WORD PTR DS:[EAX+0x2D8] MOV pItemID_boots, ECX } for(int i = 0; i < variavelE; i++) { if(pItemID_boots == ITEM_GET(11, e[i].Boots)) { R = e[i].R; G = e[i].G; B = e[i].B; _asm { // R MOV ECX,DWORD PTR SS:[EBP+0xC] // struct RGB MOV EDX, R MOV DWORD PTR DS:[ECX+0x128],EDX // float =D // G MOV EDX,DWORD PTR SS:[EBP+0xC] // struct RGB MOV EAX, G MOV DWORD PTR DS:[EDX+0x12C],EAX // float =D // B MOV EAX,DWORD PTR SS:[EBP+0xC] // struct RGB MOV ECX, B MOV DWORD PTR DS:[EAX+0x130],ECX MOV ESI, 0x0052F273 JMP ESI } } } _asm { MOV EDI, 0x0052F76D JMP EDI } } ______________________________________ .h #include "stdafx.h" //struct struct _effect { int Boots; float R; float G; float B; }; //extern extern _effect e[255]; //função refeita __declspec() void DTset_effect(); //arquivo de leitura void _loadfile_effect(char* filename); ________________________________________ .cpp Hook //effect item //leitura do arquivo //_loadfile_effect(".\\DTserver\\scripts\\effects.dat"); //retira a verificação dos items //*(BYTE*)(0x0052F0FC) = 0xEB; //*(BYTE*)(0x0052F0FC+1) = 0x29; //WriteMemoryNop(0x0052F0FE, 41); //da hook do sistema //HookProc(0x0052F158, (DWORD)(&DTset_effect)); //WriteMemoryNop(0x0052F158+5, 278);




