Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerApi.Hooks.DropBossBag Is Unavailable #252

Open
ACaiCat opened this issue Dec 9, 2023 · 0 comments
Open

ServerApi.Hooks.DropBossBag Is Unavailable #252

ACaiCat opened this issue Dec 9, 2023 · 0 comments

Comments

@ACaiCat
Copy link

ACaiCat commented Dec 9, 2023

It can just hook the drop of Defender Medals rather than Boss Bag

public override void Initialize()
{

    ServerApi.Hooks.DropBossBag.Register(this, test);

}

private void test(DropBossBagEventArgs args)
{
    TSPlayer.All.SendSuccessMessage($"Npc: {Lang.GetNPCName(args.NpcId)} {args.NpcId} " +
        $"=> {TShock.Utils.ItemTag(new Item() { netID = args.ItemId, stack = args.Stack })}");
}

protected override void Dispose(bool disposing)
{
    if (disposing)
    {
        //GetDataHandlers.NpcTalk.UnRegister(TalkNPC);
        ServerApi.Hooks.DropBossBag.Deregister(this, test);
    }
    base.Dispose(disposing);
}

Defeat the Slimes King:
image
Defeat the Old One's Army
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant