[GWA2] IsHardMode function help

06/06/2018 17:44 3vangelist#1
Hey all,

Wanted to run a quick one by you to save me some time pulling apart byte data to find out. I'm trying to create an IsHardMode function and wanted a hand :)

Hard mode in an explorable area was an easy one; just check for the Effect...

Code:
Func IsHardMode() ;~ Description: Check if hard mode is enabled via Effects
	Return Not IsArray(GetEffect(1912)) ; GetEffect returns array if skill not found
EndFunc
Wanted to expand this function to possibly check an offset to find out whether Hard mode is checked in an outpost - does anyone know the offset to check?

I'm thinking it might be some kind of offset in the same way we find out Titles...

Code:
Func GetLuxonFaction() ;~ Description: Returns current Luxon faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x758)
EndFunc   ;==>GetLuxonFaction
Func GetMaxLuxonFaction() ;~ Description: Returns max Luxon faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x7BC)
EndFunc   ;==>GetMaxLuxonFaction
Func GetBalthazarFaction() ;~ Description: Returns current Balthazar faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x798)
EndFunc   ;==>GetBalthazarFaction
Func GetMaxBalthazarFaction() ;~ Description: Returns max Balthazar faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x7C0)
EndFunc   ;==>GetMaxBalthazarFaction
Func GetImperialFaction() ;~ Description: Returns current Imperial faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x76C)
EndFunc   ;==>GetImperialFaction
Func GetMaxImperialFaction() ;~ Description: Returns max Imperial faction.
	Return MemoryRead(GetInstanceBasePtr() + 0x7C4)
EndFunc   ;==>GetMaxImperialFaction
If anyone can shed some light and same me a tonne of time I would really appreciate it - its going towards my contribution for GWA2.
06/06/2018 18:31 DerMoench14#2
Code:
;~ 	Description: Returns different States about Party. Check with BitAND.
;~ 	0x8 = Leader starts Mission / Leader is travelling with Party
;~ 	0x10 = Hardmode enabled
;~ 	0x20 = Party defeated
;~ 	0x40 = Guild Battle
;~ 	0x80 = Party Leader
;~ 	0x100 = Observe-Mode
Func GetPartyState($aFlag)
    Local $lOffset[4] = [0, 0x18, 0x4C, 0x14]
    Local $lBitMask = MemoryReadPtr($mBasePointer,$lOffset)
    Return BitAND($lBitMask[1], $aFlag) > 0
EndFunc   ;==>GetPartyState
Enjoy ;)
06/06/2018 18:33 3vangelist#3
Quote:
Originally Posted by DerMoench14 View Post
Code:
;~ 	Description: Returns different States about Party. Check with BitAND.
;~ 	0x8 = Leader starts Mission / Leader is travelling with Party
;~ 	0x10 = Hardmode enabled
;~ 	0x20 = Party defeated
;~ 	0x40 = Guild Battle
;~ 	0x80 = Party Leader
;~ 	0x100 = Observe-Mode
Func GetPartyState($aFlag)
    Local $lOffset[4] = [0, 0x18, 0x4C, 0x14]
    Local $lBitMask = MemoryReadPtr($mBasePointer,$lOffset)
    Return BitAND($lBitMask[1], $aFlag) > 0
EndFunc   ;==>GetPartyState
Enjoy ;)
Awesome, thanks :)
06/06/2018 23:51 tjubutsi#4
Wait, can party defeated be used to check if your resign went through?
06/07/2018 08:52 DerMoench14#5
Quote:
Originally Posted by tjubutsi View Post
Wait, can party defeated be used to check if your resign went through?
Yep :)
06/19/2018 07:42 phat34#6
... I believe this will solve my issue as well since _getpartydeadex seems to not work 100%...