Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; damage notifier v0.6b, coded by Guardian Angel
- ; online survey: https://docs.google.com/spreadsheet/viewform?formkey=dHI2c2kzZW95MmdrSkxWMjFoUEtLZ0E6MQ
- ; contact & cooperate [email protected]
- InitGameMod PROTO
- jGetDamageEvent PROTO
- .data
- _STR_spFLOAT db "%.2f",0
- _STR_CTT db "CreateTextTag",0
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- _WT_tt db ")Htexttag;",0
- _WT_r db ")R",0
- _WT_u db ")Hunit;",0
- _WT_v db ")V",0
- _WT_s db ")S",0
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- pGame_jGetEventDamage dd 03C3C40h
- pGame_jGetEventTargetUnit dd 03C3D00h
- pGame_jGetTriggerUnit dd 03BB240h
- pGame_jCreateTextTag dd 03BC580h
- pGame_jSetTextTagText dd 03BC5D0h
- pGame_jSetTextTagPosUnit dd 03CB890h
- pGame_jSetTextTagColor dd 03BC6A0h
- pGame_jSetTextTagPermanent dd 03BC7C0h
- pGame_jSetTextTagVelocity dd 03BC700h
- pGame_jSetTextTagLifespan dd 03BC820h
- pGame_jSetTextTagFadepoint dd 03BC850h
- pGame_jSetTextTagVisibility dd 03BC760h
- pGame_jSetTextTagPos dd 03BC610h
- pGame_jSetTextTagSuspended dd 03BC790h
- pGame_jR2S dd 03BAAF0h
- pGame_p459150 dd 0459150h
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- float_003 dd 0.03
- float_0 dd 0.0
- float_05 dd 0.05
- float_1 dd 1.0
- float_2 dd 2.0
- ; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
- .data?
- oldprot dd ?
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- InitGameMod proc
- sub esp, 6h
- mov eax, dword ptr ds:[hGameP]
- push eax
- mov ebx, dword ptr ds:[pGame_jGetEventDamage]
- add ebx, 15h
- add eax, ebx
- mov dword ptr ds:[pGame_jGetEventDamage], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jGetEventTargetUnit]
- add eax, ebx
- mov dword ptr ds:[pGame_jGetEventTargetUnit], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jGetTriggerUnit]
- add eax, ebx
- mov dword ptr ds:[pGame_jGetTriggerUnit], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jCreateTextTag]
- add eax, ebx
- mov dword ptr ds:[pGame_jCreateTextTag], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagText]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagText], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagPosUnit]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagPosUnit], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagColor]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagColor], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagPermanent]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagPermanent], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagVelocity]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagVelocity], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagLifespan]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagLifespan], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagFadepoint]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagFadepoint], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagVisibility]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagVisibility], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagPos]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagPos], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jSetTextTagSuspended]
- add eax, ebx
- mov dword ptr ds:[pGame_jSetTextTagSuspended], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_jR2S]
- add eax, ebx
- mov dword ptr ds:[pGame_jR2S], eax
- pop eax
- push eax
- mov ebx, dword ptr ds:[pGame_p459150]
- add eax, ebx
- mov dword ptr ds:[pGame_p459150], eax
- pop eax ;free the stack
- push esp
- push PAGE_EXECUTE_READWRITE
- push 6
- push pGame_jGetEventDamage
- call VirtualProtect
- lea eax, jGetDamageEvent
- sub eax, pGame_jGetEventDamage
- sub eax, 5
- mov oldprot, eax
- push 4
- lea eax, oldprot
- push eax
- mov eax, esp
- add eax, 9
- push eax
- call crt_memcpy
- add esp, 0Ch
- mov byte ptr ss:[esp], 0E9h
- mov byte ptr ss:[esp+5], 90h
- push 6
- mov eax, esp
- add eax, 4
- push eax
- push pGame_jGetEventDamage
- call crt_memcpy
- add esp, 0Ch
- add esp, 6h
- ret
- InitGameMod endp
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
- jGetDamageEvent proc
- OPTION PROLOGUE:NONE
- OPTION EPILOGUE:NONE
- pushad
- lea eax, dword ptr ds:[eax+30h]
- push eax ;dmg val
- lea esi, _WT_tt
- call pGame_jCreateTextTag
- push eax ;texttag
- mov ecx, dword ptr ds:[hGameP]
- add ecx, 0ADA848h
- mov ecx, dword ptr ds:[ecx]
- mov ecx, dword ptr ds:[ecx+14h]
- mov ecx, dword ptr ds:[ecx+0Ch]
- mov ecx, dword ptr ds:[ecx]
- mov esi, ecx
- mov ebx, eax
- lea edi, _STR_CTT
- push edi
- call pGame_p459150
- lea esi, _WT_u
- call pGame_jGetTriggerUnit ;get the unit
- push eax
- sub esp, 100h
- mov edi, esp
- push edi ;strbuf
- push 0
- push 0
- mov eax, dword ptr ss:[esp+100h+14h]
- fld dword ptr ss:[eax]
- fstp qword ptr ss:[esp]
- lea eax, _STR_spFLOAT
- push eax
- push edi
- call crt_sprintf
- add esp, 10h
- pop edi ;restore strbuf pointer
- sub esp, 20h ;fuck that
- mov dword ptr ss:[esp+1Ch], edi ;fuck that
- lea edi, dword ptr ss:[esp+1Ch] ;fuck that
- mov dword ptr ss:[esp+8], esp ;fuck that
- mov edi, esp ;fuck that
- lea eax, float_003
- push eax ;size
- push edi ;strbuf
- push dword ptr ss:[esp+100h+0Ch+20h] ;tagtext
- lea edi, _STR_w3WTF1
- lea esi, _WT_v
- call pGame_jSetTextTagText
- add esp, 0Ch
- add esp, 20h ;restore the stack
- add esp, 100h ;restore the st
- ;
- lea eax, float_0
- push eax ;zOffset
- push dword ptr ss:[esp+4h] ;hUnit
- push dword ptr ss:[esp+0Ch] ;tagtext
- lea esi, _WT_v
- call pGame_jSetTextTagPosUnit
- add esp, 10h
- push 0FFh
- push 0
- push 0
- push 0FFh
- push dword ptr ss:[esp+10h]
- lea esi, _WT_v
- call pGame_jSetTextTagColor
- add esp, 14h
- lea eax, float_05
- push eax ;float1
- push eax ;float2
- push dword ptr ss:[esp+8h] ;tagtext
- lea esi, _WT_v
- call pGame_jSetTextTagVelocity
- add esp, 0Ch
- lea eax, float_1
- push eax ;float1
- push dword ptr ss:[esp+4h] ;tagtext
- lea esi, _WT_v
- call pGame_jSetTextTagFadepoint
- add esp, 8h
- lea eax, float_2
- push eax ;float1
- push dword ptr ss:[esp+4h] ;tagtext
- lea esi, _WT_v
- call pGame_jSetTextTagLifespan
- add esp, 8h
- push 0 ;false
- push dword ptr ss:[esp+4h] ;tagtext
- lea esi, _WT_v
- call pGame_jSetTextTagPermanent
- add esp, 8h
- push 0 ;false
- push dword ptr ss:[esp+4h] ;texttag
- lea esi, _WT_v
- call pGame_jSetTextTagVisibility
- add esp, 8h
- push 1 ;true
- push dword ptr ss:[esp+4h] ;texttag
- lea esi, _WT_v
- call pGame_jSetTextTagVisibility
- add esp, 8h
- push 0 ;false
- push dword ptr ss:[esp+4h] ;texttag
- lea esi, _WT_v
- call pGame_jSetTextTagSuspended
- add esp, 8h
- add esp, 8h
- popad ;restore registers
- mov eax, dword ptr ds:[eax+30h]
- ret
- jGetDamageEvent endp
- ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
Advertisement
Add Comment
Please, Sign In to add comment