Advertisement
Guest User

Code thing for tModLoader

a guest
Jun 19th, 2019
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using Terraria.ID;
  2. using Terraria.ModLoader;
  3. using Terraria;
  4.  
  5. namespace Runeblade.Items.Spells
  6. {
  7.     public class EnduranceSpell : ModItem
  8.     {
  9.         public override void SetStaticDefaults()
  10.         {
  11.             DisplayName.SetDefault("Endurance");
  12.             Tooltip.SetDefault("Spell"
  13.             +"\nDraws power from the heavens"
  14.             +"\nGrants the Endurance, Wrath, Ironskin, Beetle Endurance 3 and Inferno buffs for 2 minutes");
  15.         }
  16.         public override void SetDefaults()
  17.         {
  18.             item.potion = true;
  19.             item.value = 100000;
  20.             item.rare = 12;
  21.             item.maxStack = 1;
  22.             item.buffType = BuffID.Endurance;
  23.             item.buffTime = 7200;
  24.             item.noMelee = true;
  25.             item.useStyle = 4;
  26.             item.mana = 20;
  27.         }
  28.  
  29.         public virtual bool UseItem(Item item, Player player)
  30.         {
  31.             player.AddBuff(BuffID.Wrath, 7200, true);
  32.             player.AddBuff(BuffID.BeetleEndurance3, 7200, true);
  33.             player.AddBuff(BuffID.Inferno, 7200, true);
  34.             player.AddBuff(BuffID.Ironskin, 7200, true);
  35.             return true;
  36.         }
  37.  
  38.         public override void AddRecipes()
  39.         {
  40.             ModRecipe recipe = new ModRecipe(mod);
  41.             recipe.AddIngredient(null, "RunebladeEssence", 500);
  42.             recipe.AddIngredient(ItemID.ManaCrystal, 5);
  43.             recipe.AddIngredient(ItemID.SpellTome, 1);
  44.             recipe.SetResult(this);
  45.             recipe.AddRecipe();
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement