Standalone [1.3] tModLoader - A Modding API

is there a possibility to make an item drop from a certain enemy after defeating, for example, plantera?
ive tried to look it up in example mod but i didnt get a clue from that
 
is there a possibility to make an item drop from a certain enemy after defeating, for example, plantera?
ive tried to look it up in example mod but i didnt get a clue from that
Here's an example:
Code:
if (npc.type == NPCID.Spazmatism)
                    {
         if (NPC.downedPlantBoss)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chaparral"), 1);
 
i dont no why, but when i download the current downloadfile, its actually the v0.8.2.1, my game will change in 1.3.1.1.. is that right ? ^^ (i'm sorry for my bad english) :3
 
did the update come out yet or are we waiting for general game hooks or hooks for trees and cacti
[doublepost=1469194527,1469194485][/doublepost]my terraria tmodloader says its still 1.3.1.1
 
I have a problem:
I am getting an error that says
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\Items\Summoner\SuspiciousLookingCloud.cs(27,24) : error CS0161: 'LegendOfMutater.Items.Summoner.SuspiciousLookingCloud.UseItem(Terraria.Player)': not all code paths return a value

My code is:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LegendOfMutater.Items.Summoner
{
    public class SuspiciousLookingCloud : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Suspicious Looking Cloud";
            item.width = 20;
            item.height = 20;
            item.maxStack = 1;
            AddTooltip("Summons the Sky Lord");
            item.value = 1000;
            item.rare = 1;
            item.useAnimation = 30;
            item.useTime = 30;
            item.useStyle = 4;
            item.consumable = true;
        }
        public override bool CanUseItem(Player player)
        {
            return !NPC.AnyNPCs(mod.NPCType("SkyLord"));
        }
        public override bool UseItem(Player player)
        {
            NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord"));
            Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(2, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
[doublepost=1469201177,1469200988][/doublepost]Where is ma signature?
 
I have a problem:
I am getting an error that says
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\Items\Summoner\SuspiciousLookingCloud.cs(27,24) : error CS0161: 'LegendOfMutater.Items.Summoner.SuspiciousLookingCloud.UseItem(Terraria.Player)': not all code paths return a value

My code is:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LegendOfMutater.Items.Summoner
{
    public class SuspiciousLookingCloud : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Suspicious Looking Cloud";
            item.width = 20;
            item.height = 20;
            item.maxStack = 1;
            AddTooltip("Summons the Sky Lord");
            item.value = 1000;
            item.rare = 1;
            item.useAnimation = 30;
            item.useTime = 30;
            item.useStyle = 4;
            item.consumable = true;
        }
        public override bool CanUseItem(Player player)
        {
            return !NPC.AnyNPCs(mod.NPCType("SkyLord"));
        }
        public override bool UseItem(Player player)
        {
            NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord"));
            Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(2, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
[doublepost=1469201177,1469200988][/doublepost]Where is ma signature?
public override bool UseItem(Player player) Not returns boolean
 
I have a problem:
I am getting an error that says
c:\Users\...\Documents\My Games\Terraria\ModLoader\Mod Sources\LegendOfMutater\Items\Summoner\SuspiciousLookingCloud.cs(27,24) : error CS0161: 'LegendOfMutater.Items.Summoner.SuspiciousLookingCloud.UseItem(Terraria.Player)': not all code paths return a value

My code is:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace LegendOfMutater.Items.Summoner
{
    public class SuspiciousLookingCloud : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Suspicious Looking Cloud";
            item.width = 20;
            item.height = 20;
            item.maxStack = 1;
            AddTooltip("Summons the Sky Lord");
            item.value = 1000;
            item.rare = 1;
            item.useAnimation = 30;
            item.useTime = 30;
            item.useStyle = 4;
            item.consumable = true;
        }
        public override bool CanUseItem(Player player)
        {
            return !NPC.AnyNPCs(mod.NPCType("SkyLord"));
        }
        public override bool UseItem(Player player)
        {
            NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("SkyLord"));
            Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
        }
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(2, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
[doublepost=1469201177,1469200988][/doublepost]Where is ma signature?
That doesn't help at all. Can you tell me any way to fix it?
 
2 questions:
1. whats the code for healing like healing potions?
2. what the code to make an enemy spawn after hardmode?
thanks for answering^^
 
So, is it updated? 1.3.1.1 is written all over, but the To Do section says updating to 1.3.2 is complete. Such mystery!
 
Back
Top Bottom