|
From: <ec...@us...> - 2002-12-03 03:36:46
|
Update of /cvsroot/decaldev/source/Decal
In directory sc8-pr-cvs1:/tmp/cvs-serv30213
Modified Files:
ACHooks.h ACHooks.cpp
Log Message:
Adding hooks:
GetSkill
GetAttribute
note: these won't work until Hazridi fixes the memlocs for my incompetent self
for this patch they are:
<memloc name="GetSkill" value="0059E0D0" />
<memloc name="GetAttribute" value="0059DB50" />
Index: ACHooks.h
===================================================================
RCS file: /cvsroot/decaldev/source/Decal/ACHooks.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ACHooks.h 28 Nov 2002 09:55:15 -0000 1.24
--- ACHooks.h 3 Dec 2002 03:36:37 -0000 1.25
***************
*** 155,158 ****
--- 155,164 ----
long m_lVitalBase;
+ bool m_bGetAttribute;
+ long m_lGetAttribute;
+
+ bool m_bGetSkill;
+ long m_lGetSkill;
+
public:
static cACHooks* s_pACHooks;
***************
*** 198,201 ****
--- 204,209 ----
STDMETHOD(SetAutorun)(VARIANT_BOOL bOnOff) ;
STDMETHOD(get_Vital)(long Vital, long* pVal);
+ STDMETHOD(get_Attribute)(long Attribute, long* pVal);
+ STDMETHOD(get_Skill)(long Skill, long* pVal);
STDMETHOD(LocalChatText)(BSTR Text);
STDMETHOD(LocalChatEmote)(BSTR EmoteText);
Index: ACHooks.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/Decal/ACHooks.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** ACHooks.cpp 28 Nov 2002 09:55:15 -0000 1.29
--- ACHooks.cpp 3 Dec 2002 03:36:37 -0000 1.30
***************
*** 53,56 ****
--- 53,58 ----
m_bSetAutorun = false;
m_bGetVital = false;
+ m_bGetAttribute = false;
+ m_bGetSkill = false;
m_Hooks = 0 ;
***************
*** 449,452 ****
--- 451,468 ----
}
}
+
+ if( QueryMemLoc( _bstr_t( "GetAttribute" ), &Val ) == S_OK )
+ {
+ m_lGetAttribute = Val;
+ m_bGetAttribute = true;
+ m_Hooks |= eGetAttribute;
+ }
+
+ if( QueryMemLoc( _bstr_t( "GetSkill" ), &Val ) == S_OK )
+ {
+ m_lGetSkill = Val;
+ m_bGetSkill = true;
+ m_Hooks |= eGetSkill;
+ }
}
***************
*** 1435,1438 ****
--- 1451,1499 ----
Internal_GetStat( p, 0, Vital, pVal, lBaseOrBuffed );
+
+ return S_OK;
+ }
+
+ STDMETHODIMP cACHooks::get_Attribute(long Attribute, long* pVal)
+ {
+ if( !m_bGetAttribute )
+ return S_FALSE;
+
+ if( (Attribute < 1) || (Attribute > 12) )
+ return E_INVALIDARG;
+
+ long lBaseOrBuffed = (Attribute > 6) ? 1 : 0;
+ if( lBaseOrBuffed )
+ Attribute -= 6;
+
+ qPointerList *p = reinterpret_cast< qPointerList * >( m_lVitalBase );
+ p = p->dd[0];
+
+ long ( __fastcall *Internal_GetAttribute )( qPointerList *, long, long, long *, long ) = reinterpret_cast< long ( __fastcall * )( qPointerList *, long, long, long *, long ) >( m_lGetAttribute );
+
+ Internal_GetAttribute( p, 0, Attribute, pVal, lBaseOrBuffed );
+
+ return S_OK;
+ }
+
+ STDMETHODIMP cACHooks::get_Skill(long Skill, long* pVal)
+ {
+ if( !m_bGetSkill )
+ return S_FALSE;
+
+ // error on out of range, the unused range for added skills, and other skill ids that Turbine skips
+ if((Skill < 1) || (Skill > 89) || ((Skill > 39) && (Skill < 50)) || (Skill == 8 ) || (Skill == 58) || (Skill == 17) || (Skill == 67) || (Skill == 25) || (Skill == 75) || (Skill == 26) || (Skill == 76))
+ return E_INVALIDARG;
+
+ long lBaseOrBuffed = (Skill > 50) ? 1 : 0;
+ if( lBaseOrBuffed )
+ Skill -= 50;
+
+ qPointerList *p = reinterpret_cast< qPointerList * >( m_lVitalBase );
+ p = p->dd[0];
+
+ long ( __fastcall *Internal_GetSkill )( qPointerList *, long, long, long *, long ) = reinterpret_cast< long ( __fastcall * )( qPointerList *, long, long, long *, long ) >( m_lGetSkill );
+
+ Internal_GetSkill( p, 0, Skill, pVal, lBaseOrBuffed );
return S_OK;
|