/// <summary> /// Calling this is much more effective than calling the two functions separately. /// </summary> /// <param name="type"></param> /// <param name="prefix"></param> public void SetDefaultsAndPrefix(int type, int prefix) { Context.RunByHookOnUpdate(AssemblySnippet.FromCode( new AssemblyCode[] { Instruction.Create("push ecx"), Instruction.Create("push edx"), TypedInternalObject.GetMethodCall("Terraria.Item.SetDefaults(Int32)").Call(false, null, null, new object[] { type }), TypedInternalObject.GetMethodCall("Terraria.Item.Prefix(Int32)").Call(false, null, null, new object[] { prefix }), Instruction.Create("pop edx"), Instruction.Create("pop ecx") })); }
public void SetDefaults(int type) { Context.RunByHookOnUpdate(TypedInternalObject.GetMethodCall("Terraria.Item.SetDefaults(Int32)") .Call(true, null, null, new object[] { type })); }
public void SetPrefix(int prefix) { Context.RunByHookOnUpdate(TypedInternalObject.GetMethodCall("Terraria.Item.Prefix(Int32)") .Call(true, null, null, new object[] { prefix })); }
public void AddBuff(int type, int time, bool quiet = false) { Context.RunByHookOnUpdate(TypedInternalObject.GetMethodCall("Terraria.NPC.AddBuff(Int32, Int32, Boolean)") .Call(true, null, null, new object[] { type, time, quiet })); }