public static void GetFishingLevel(AutofisherTE te, Item bait, ref int fishingLevel) { var fishingRod = new Item(); fishingRod.SetDefaults(ItemID.MechanicsRod, true); object[] args = new object[] { te.Position.ToWorldCoordinates(), fishingRod, bait, fishingLevel }; var hookList = hooks[HookType.GetFishingLevel]; foreach (var hook in hookList) { hook.Invoke(null, args); } fishingLevel = (int)args[3]; }
public static void CatchFish(AutofisherTE te, Zone zone, Item bait, int power, int liquidType, int poolSize, int worldLayer, ref int caughtType, ref bool junk) { var fishingRod = new Item(); fishingRod.SetDefaults(ItemID.MechanicsRod, true); object[] args = new object[] { te.Position.ToWorldCoordinates(), (int)zone, fishingRod, bait, power, liquidType, poolSize, worldLayer, caughtType, junk }; var hookList = hooks[HookType.CatchFish]; foreach (var hook in hookList) { hook.Invoke(null, args); } caughtType = (int)args[8]; junk = (bool)args[9]; }