if (instance && DamageMultiplier > 1) {
hpDamage *= DamageMultiplier;
shieldDamage *= DamageMultiplier;
}
try thisC++:if (instance && DamageMultiplier > 1) { hpDamage *= DamageMultiplier; shieldDamage *= DamageMultiplier; }
It must be so, you haven't provided all the necessary arguments to the ApplyAttackDamage method yet.
In the switch construction, value has an integer type, which means that it would be more correct to specify the type not float (real) but int (integer), It's certainly not a bug, but still.
float DamageMultiplier;
void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule);
void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule){
if (instance != NULL && DamageMultiplier > 1){
return old_ApplyAttackDamage(instance,int hpDamage * DamageMultiplier ,int shieldDamage * DamageMultiplier,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule);
}
return old_ApplyAttackDamage(instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule);
}
HOOK("OFFSETS",ApplyAttackDamage,old_ApplyAttackDamage);
switch(featNum):
case 10:
if (value >= 1){
DamageMultiplier = value;
}
break;
try this
C++:float DamageMultiplier; void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule){ if (instance != NULL && DamageMultiplier > 1){ return old_ApplyAttackDamage(instance,int hpDamage * DamageMultiplier ,int shieldDamage * DamageMultiplier,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); } return old_ApplyAttackDamage(instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); } HOOK("OFFSETS",ApplyAttackDamage,old_ApplyAttackDamage); switch(featNum): case 10: if (value >= 1){ DamageMultiplier = value; } break;
C++:if (instance && DamageMultiplier > 1) { hpDamage *= DamageMultiplier; shieldDamage *= DamageMultiplier; }
It must be so, you haven't provided all the necessary arguments to the ApplyAttackDamage method yet.
In the switch construction, value has an integer type, which means that it would be more correct to specify the type not float (real) but int (integer), It's certainly not a bug, but still.
int DamageMultiplier = 1;
void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* BattleUnitController,void* UnitMoveType,void* DamageTypeEnum,bool showUiMessaging,bool canCounterAttack,void* BattleEffectDO,bool fromDestroyModule);
void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* BattleUnitController,void* UnitMoveType,void* DamageTypeEnum,bool showUiMessaging,bool canCounterAttack,void* BattleEffectDO,bool fromDestroyModule)
{
if (instance != NULL && DamageMultiplier > 1)
{
return old_ApplyAttackDamage(instance, hpDamage * DamageMultiplier , shieldDamage * DamageMultiplier, isCrit, BattleUnitController, UnitMoveType, DamageTypeEnum, showUiMessaging, canCounterAttack, BattleEffectDO, fromDestroyModule);
}
return old_ApplyAttackDamage(instance, hpDamage, shieldDamage, isCrit, BattleUnitController, UnitMoveType, DamageTypeEnum, showUiMessaging, canCounterAttack, BattleEffectDO, fromDestroyModule);
}
HOOK("0xd92288", ApplyAttackDamage, old_ApplyAttackDamage);
switch (featNum) {
case 11:
if (value >= 1) {
DamageMultiplier = value;
}
break;
This is normal when modding, is all about try and error. Just keep searching it until u find the right oneany other clue ?
you need to make a function pointerThank you for the answers.
I can't even build LGL Mod Menu with this code, it does not understand "BattleUnitController", "attacker", "UnitMoveType", "moveType" etc.
"BattleUnitController" and so on are lib classes
"attacker" and so on are lib parameters
It didn't worked neither but I guess it also about void calling..
So I've tryied the following:
C++:int DamageMultiplier = 1; void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* BattleUnitController,void* UnitMoveType,void* DamageTypeEnum,bool showUiMessaging,bool canCounterAttack,void* BattleEffectDO,bool fromDestroyModule); void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* BattleUnitController,void* UnitMoveType,void* DamageTypeEnum,bool showUiMessaging,bool canCounterAttack,void* BattleEffectDO,bool fromDestroyModule) { if (instance != NULL && DamageMultiplier > 1) { return old_ApplyAttackDamage(instance, hpDamage * DamageMultiplier , shieldDamage * DamageMultiplier, isCrit, BattleUnitController, UnitMoveType, DamageTypeEnum, showUiMessaging, canCounterAttack, BattleEffectDO, fromDestroyModule); } return old_ApplyAttackDamage(instance, hpDamage, shieldDamage, isCrit, BattleUnitController, UnitMoveType, DamageTypeEnum, showUiMessaging, canCounterAttack, BattleEffectDO, fromDestroyModule); } HOOK("0xd92288", ApplyAttackDamage, old_ApplyAttackDamage); switch (featNum) { case 11: if (value >= 1) { DamageMultiplier = value; } break;
I can build the Mod Menu and recompile the apk with this one but it's not working, any other clue ?
try this
C++:float DamageMultiplier; void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule){ if (instance != NULL && DamageMultiplier > 1){ return old_ApplyAttackDamage(instance,int hpDamage * DamageMultiplier ,int shieldDamage * DamageMultiplier,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); } return old_ApplyAttackDamage(instance,int hpDamage,int shieldDamage,bool isCrit,BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType,bool showUiMessaging,bool canCounterAttack,[Optional] BattleEffectDO sourceEffect,bool fromDestroyModule); } HOOK("OFFSETS",ApplyAttackDamage,old_ApplyAttackDamage); switch(featNum): case 10: if (value >= 1){ DamageMultiplier = value; } break;
You say its not recomended , but it works for me so i dont care ,this is not recommended
He said that bcs the sample u give wont be able to compile it is bcs thisYou say its not recomended , but it works for me so i dont care ,
BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType
yea i mean , its work for me because most of my mod was have somethink like that in the dump , so yea need to cast all the think into hook variableHe said that bcs the sample u give wont be able to compile it is bcs this
C++:BattleUnitController attacker,BattleUnitController target,UnitMoveType moveType,DamageTypeEnum damageType
Enum is usually Int, If u not sure just put void
float DamageMultiplier;
void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* attacker,void* target,void* moveType,int damageType,bool showUiMessaging,bool canCounterAttack,[Optional] void* sourceEffect,bool fromDestroyModule);
void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* attacker,void* target,void* moveType,int damageType,bool showUiMessaging,bool canCounterAttack,[Optional] void* sourceEffect,bool fromDestroyModule){
if (instance != NULL && DamageMultiplier > 1){
return old_ApplyAttackDamage(instance,int hpDamage * DamageMultiplier ,int shieldDamage * DamageMultiplier,isCrit,attacker,target,damageType,showUiMessaging,canCounterAttack,[Optional] sourceEffect,fromDestroyModule);
}
return old_ApplyAttackDamage(instance,hpDamage,shieldDamage,isCrit,attacker,target,moveType,damageType,showUiMessaging,canCounterAttack,[Optional] sourceEffect,fromDestroyModule);
}
HOOK("OFFSETS",ApplyAttackDamage,old_ApplyAttackDamage);
switch(featNum):
case 10:
if (value >= 1){
DamageMultiplier = value;
}
break;
[/QUOTE]try this , this is was improved version
C++:float DamageMultiplier; void (*old_ApplyAttackDamage)(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* attacker,void* target,void* moveType,int damageType,bool showUiMessaging,bool canCounterAttack,[Optional] void* sourceEffect,bool fromDestroyModule); void ApplyAttackDamage(void *instance,int hpDamage,int shieldDamage,bool isCrit,void* attacker,void* target,void* moveType,int damageType,bool showUiMessaging,bool canCounterAttack,[Optional] void* sourceEffect,bool fromDestroyModule){ if (instance != NULL && DamageMultiplier > 1){ return old_ApplyAttackDamage(instance,int hpDamage * DamageMultiplier ,int shieldDamage * DamageMultiplier,isCrit,attacker,target,damageType,showUiMessaging,canCounterAttack,[Optional] sourceEffect,fromDestroyModule); } return old_ApplyAttackDamage(instance,hpDamage,shieldDamage,isCrit,attacker,target,moveType,damageType,showUiMessaging,canCounterAttack,[Optional] sourceEffect,fromDestroyModule); } HOOK("OFFSETS",ApplyAttackDamage,old_ApplyAttackDamage); switch(featNum): case 10: if (value >= 1){ DamageMultiplier = value; } break;
this is not recommended, why should type void return? and consuming too much space should be easy, just replace the parameter with a damagemultiplier.
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies