awsome its working.its the cashmanager methods .i tried messing with the health object and its methods but i cant seem to get my aob o work
my objective:player health should remain at 100 even after getting hit
object:Health
Method:OnEventPlayerDamage(class EventPlayerDamage e)
Here is the function
private void OnEventPlayerDamage(EventPlayerDamage e)
{
if (((e.victimId == this.playerId) && (this.GetHealth() > 0f)) && (Application.get_isEditor() || (BaseRoundMode.GetRoundState() == BaseRoundMode.RoundState.InProgress)))
{
this.SetHealth(this.GetHealth() - e.damage); <--------------------------------------------i tried to change 59 to 58 ,but nothing happens
if (base.get_enabled() && base.get_audio().get_enabled())
{
if (e.damageType == EventPlayerDamage.DamageTypes.Head)
{
base.get_audio().set_clip(this.headshot);
base.get_audio().set_pitch(1f);
base.get_audio().set_volume(1f);
base.get_audio().set_maxDistance(50f);
base.get_audio().Play();
}
else if (e.damage >= 10)
{
base.get_audio().set_clip(this.painBig);
base.get_audio().set_pitch(0.9f + ((((float) (e.damage - 0x19)) / 75f) * 0.2f));
base.get_audio().set_volume(0.9f);
base.get_audio().set_maxDistance(50f);
base.get_audio().Play();
}
else
{
base.get_audio().set_clip(this.painSmall);
base.get_audio().set_pitch(0.9f + ((((float) e.damage) / 25f) * 0.2f));
base.get_audio().set_volume(0.9f);
base.get_audio().set_maxDistance(50f);
base.get_audio().Play();
}
}
if ((this.playerId == PhotonHelper.localPlayer.playerId) && (this.GetHealth() <= 0f))
{
this.SetHealth(0f);
new EventDeath(this.playerId, e.attackerId, e.damageType, e.weaponType);
}
}
il code
IL_0038: /* 02 | */ ldarg.0
IL_0039: /* 02 | */ ldarg.0
IL_003a: /* 28 | (06)000C10 */ call instance float32 Health::GetHealth()
IL_003f: /* 03 | */ ldarg.1
IL_0040: /* 7B | (04)000EA9 */ ldfld int32 EventPlayerDamage::damage
IL_0045: /* 6B | */ conv.r4
IL_0046: /* 59 | */ sub
IL_0047: /* 28 | (06)000C11 */ call instance void Health::SetHealth(float32)
IL_004c: /* 02 | */ ldarg.0
IL_004d: /* 28 | (0A)00011A */ call instance bool [UnityEngine]UnityEngine.Behaviour::get_enabled()
IL_0052: /* 39 | 42010000 */ brfalse IL_0199
IL_0057: /* 02 | */ ldarg.0
/* 03 | */ ldarg.1
IL_0001: /* 7B | (04)000EAB */ ldfld int32 EventPlayerDamage::victimId
IL_0006: /* 02 | */ ldarg.0
IL_0007: /* 7B | (04)000DF8 */ ldfld int32 Health::playerId
IL_000c: /* 3B | 01000000 */ beq IL_0012
IL_0011: /* 2A | */ ret
IL_0012: /* 02 | */ ldarg.0
IL_0013: /* 28 | (06)000C10 */ call instance float32 Health::GetHealth()
IL_0018: /* 22 | 00000000 */ ldc.r4 0.0
IL_001d: /* 43 | C5010000 */ ble.un IL_01e7
IL_0022: /* 28 | (0A)0001F7 */ call bool [UnityEngine]UnityEngine.Application::get_isEditor()
IL_0027: /* 3A | 0C000000 */ brtrue IL_0038
IL_002c: /* 28 | (06)000D59 */ call valuetype BaseRoundMode/RoundState BaseRoundMode::GetRoundState()
IL_0031: /* 18 | */ ldc.i4.2
IL_0032: /* 3B | 01000000 */ beq IL_0038
IL_0037: /* 2A | */ ret
my aob:
7b ?? ?? ?? ?? 02 7b ?? ?? ?? ?? 3b ?? ?? ?? ?? 2a 02 28 ?? ?? ?? ?? 22 ?? ?? ?? ?? 43 ?? ?? ?? ?? 28 ?? ?? ?? ?? 3a ?? ?? ?? ?? 28 ?? ?? ?? ?? 18 3b ?? ?? ?? ?? 2a 02 02 28 ?? ?? ?? ?? 03 7b ?? ?? ?? ?? 6b 59 28 ?? ?? ?? ?? 02 28 ?? ?? ?? ?? 39 ?? ?? ?? ?? 02
Any help would be appreciated