private static void OnSetCombatMode(void *pCreature, byte nNewMode, int bForceNewMode) { CNWSCreature creature = CNWSCreature.FromPointer(pCreature); if (creature == null) { Hook.CallOriginal(pCreature, nNewMode, bForceNewMode); return; } OnCombatModeToggle eventData = ProcessEvent(new OnCombatModeToggle { Creature = creature.ToNwObject <NwCreature>() !, NewMode = (CombatMode)nNewMode, ForceNewMode = bForceNewMode.ToBool(), });
private void OnCombatModeToggle(OnCombatModeToggle onToggle) { CNWSCreature creature = onToggle.Creature.Creature; // Flurry of blows automatic cancel if (onToggle.NewMode == CombatMode.None && onToggle.ForceNewMode && creature.m_nCombatMode == (byte)CombatMode.FlurryOfBlows) { if (creature.m_pStats.GetUseMonkAttackTables(0).ToBool()) { onToggle.PreventToggle = true; return; } } // Flurry of blows manual cancel if (onToggle.NewMode == CombatMode.FlurryOfBlows && !onToggle.ForceNewMode) { onToggle.NewMode = CombatMode.None; onToggle.ForceNewModeOverride = ForceNewModeOverride.Force; } if (onToggle.PreventToggle) { return; } // Flurry of blows manual activation. if (onToggle.NewMode == CombatMode.FlurryOfBlows && onToggle.ForceNewMode) { if (creature.m_pStats.GetUseMonkAttackTables(0).ToBool()) { creature.m_nCombatMode = (byte)CombatMode.FlurryOfBlows; creature.SetActivity(0x4000, 1); onToggle.PreventToggle = true; } } }