Boss Summoning Item Help?

Discussion in 'Released Mods' started by EATERofSOULS, Dec 13, 2012.

  1. EATERofSOULS

    EATERofSOULS Bunny

    im working on my own mod although for some reason the .cs file will never work for the boss AND the item. Can someone tell me how to properly arrange the .cs files for the boss and item. Or even better, give me a tutorial. I found that surfpup's TConfig wikia wasn't that descriptive :/
     
  2. Corvus Sevenbranch

    Corvus Sevenbranch Green Slime

    Can you post a copy of your .cs files?
     
  3. SonicR

    SonicR Bone Serpent

    Put the following in your item's cs file:

    Code:
    public static void UseItem(Player player, int playerID)
    {
        NPC.NewNPC((int)player.position.X-700,(int)player.position.Y,"Boss name here",0);
    }
    You can change the values for player.position.X and player.position.Y to whatever you want. If you want your boss to spawn on specific conditions, say hardmode, then:

    Code:
    public static void UseItem(Player player, int playerID)
    {
        if(Main.hardMode == true)
        {
            NPC.NewNPC((int)player.position.X-700,(int)player.position.Y,"Boss name here",0);
        }
    }
    You can substitute the Main.hardMode for Main.dayTime if you so wish. Hope this helps.
     
  4. EATERofSOULS

    EATERofSOULS Bunny

    thank you :D
     
  5. MiraiMai

    MiraiMai Hell Bat

    A correction for you, don't put that check in UseItem, instead put it in CanUse() so that the item isn't wasted. You can also use Main.NewText() to give the player a message for why they can't use it(or give them a hint)
     

Share This Page