免费教程_免费网赚教程_破解版软件-寂涯网络学习基地

当前位置: 主页 > 系统综合 > 软件破解 > 浅谈魔兽争霸 DotA外挂制作(8)

浅谈魔兽争霸 DotA外挂制作(8)

时间:2011-11-08 13:29来源:未知 整理:寂涯网络 点击:


LOCAL utf8 [400h]:BYTE
LOCAL junk:DWORD
  ;native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real
duration, string message returns nothing

 pushad
 GetBase
  RLCInvoke MultiByteToWideChar,CP_ACP,NULL,pString,-1,addr unicode,400h
  RLCInvoke WideCharToMultiByte,CP_UTF8,NULL,addr unicode, -1, addr utf8,
400h, NULL, NULL
 lea ecx, utf8
 GameCall PSaveString
 push eax ; string id -> SIdToPointer
 mov ecx, 1
 GameCall PGetCurrentJassEnv
 mov ecx, eax ; jassenv -> SIdToPointer
 GameCall PSIdToPointer
 push eax ; message -> DisplayTimedTextToPlayer
 fild dwDuration
 fstp dwDuration
 lea eax, dwDuration
push eax ; duration-> DisplayTimedTextToPlayer
 xor eax, eax

 lea ecx, junk
 mov [ecx], eax
 push ecx ; y -> DisplayTimedTextToPlayer
 push ecx ; x -> DisplayTimedTextToPlayer
 GameCall JNGetLocalPlayer
 push eax ; player -> DisplayTimedTextToPlayer
 GameCall JNDisplayTimedTextToPlayer
 add esp, 20
 popad
 ret
DisplayText endp
;SetUnitX的 Hook,用来获取英雄的unit值
;native SetUnitX takes unit whichUnit, real newX returns nothing
JNSetUnitXHook proc whichUnit:DWORD, pnewX:DWORD
 pushad
 GetBase
 push 0 ; type = hero
 push whichUnit
 GameCall JNIsUnitType

 mov esi, eax
 GameCall JNIsUnitIllusion
 not eax
 and esi, eax
 add esp, 8
 mov edx, whichUnit

.if esi
 lea esi, RLC(dwHeroIds)
  .while 1
   lodsd
   .break .if !eax
   .if eax == edx
    jmp _end
   .endif
  .endw
  mov eax, edx
  lea edi, [esi-4]
  stosd
 .endif
_end:
 popad
 leave
 GetBase eax
 GetGameAddr JNSetUnitX, eax, eax

 jmp eax
JNSetUnitXHook endp
;CreateItem的Hook,用来提示神符位置
;native CreateItem takes integer itemid, real x, real y returns item
JNCreateItemHook proc itemid:DWORD, x:DWORD, y:DWORD
LOCAL buf[400h]:BYTE
 pushad
 GetBase
 mov eax, itemid
 .if eax == 'I00K'
  lea edx, RLC(T("|c000042ff双倍伤害|r"))
  mov esi, 0000042ffh
  jmp powerup
.elseif eax == 'I006'
  lea edx, RLC(T("|c00ff0303极速|r"))
  mov esi, 000ff0303h
  jmp powerup
 .elseif eax == 'I007'   lea edx, RLC(T("|c00fffc01幻象|r"))
  mov esi, 000fffc01h
  jmp powerup
 .elseif eax == 'I008'
  lea edx, RLC(T("|cff00ff00回复|r"))
  mov esi, 0ff00ff00h
  jmp powerup

 .elseif eax == 'I00J'
  lea edx, RLC(T("|cff99ccff隐形|r"))
  mov esi, 0ff99ccffh
  jmp powerup
 .endif
jmp _end
powerup:
 mov eax, y
 mov eax, [eax]
 push eax
  fld DWORD ptr [esp]
 fistp DWORD ptr [esp]
 pop eax
 ;这里不能简单的判断神符的坐标是正还是负来判断神符是在上路还是下路,因为
使用瓶子内的神符实际上是创建一个神符然后立即吃掉,所以会误报。
 .if eax == -2832
  lea ecx, RLC(T("下路"))  

 .elseif eax == 1648
  lea ecx, RLC(T("上路"))
 .else
  jmp _end
 .endif
lea eax, RLC(T("神符 %s 在 |cfffffc00%s|r 刷新了!"))
 RLCInvoke wsprintf, addr buf, eax, edx, ecx
 add esp, 16 ;wsprintf是 C调用约定的
 invoke DisplayText, addr buf, 10
 mov eax, x
 mov ecx, [eax]
 mov eax, y
 mov edx, [eax]
  invoke PingMiniMapEx, ecx, edx, 41800000h, esi, 1 ; 10.0
 jmp _end
_end:
 popad
 leave
 GetBase eax

 GetGameAddr JNCreateItem, eax, eax
 jmp eax
JNCreateItemHook endp
;CreateUnit的Hook,用来决定游戏状态,添加AddNativesHook,提示Roshan复活
;native CreateUnit takes player id, integer unitid, real x, real y, real face
returns unit

本页地址 http://www.jybase.net/ruanjianpojie/20111109592.html

百度搜索更多

谷歌搜索更多

顶一下
(4)
100%
踩一下
(0)
0%
------分隔线----------------------------

评价:
昵称: 验证码:点击我更换图片
推荐内容
赞助商
赞助商


关于本站免责声明视频更新google百度地图视频地图RRS订阅

如有什么问题请在本站留言,或发邮件到 hxt167#foxmail.com