Exemple #1
0
 /// <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")
     }));
 }
Exemple #2
0
 public void SetDefaults(int type)
 {
     Context.RunByHookOnUpdate(TypedInternalObject.GetMethodCall("Terraria.Item.SetDefaults(Int32)")
                               .Call(true, null, null, new object[] { type }));
 }
Exemple #3
0
 public void SetPrefix(int prefix)
 {
     Context.RunByHookOnUpdate(TypedInternalObject.GetMethodCall("Terraria.Item.Prefix(Int32)")
                               .Call(true, null, null, new object[] { prefix }));
 }
Exemple #4
0
 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 }));
 }