[Patch] Custom Scripted C++ NPC that can spawn a Mob/Mobs with Badges (item ID & Amount)

Hey guys,

I’m new to C++, and applying myself as much as I can with the little time that I have. I’ve been working on a few different scripts, and I came up with an idea that I would love to try, but I don’t know where to start with this one.

The basic idea is to script an NPC in C++ that will allow players to summon “Bosses” (using Entry ID from DB) with say 50 Badges of Justice for example. Basically if they had the badges they would talk to the NPC, and have a small list of bosses they could summon by using their badges of justice from the NPC Menu. I know it should be a small piece of code. Could I get some help with this one?

Thanks guys!

Sure …

But you want to code it yourself and get some pointers to good info sources or …?

For starters…

Gossip script examples:




Now just follow the examples and create gossip menus.

You should be able to create a basic gossip menu with boss names (Tip: use the boss entries as action IDs)

player->HasItemCount(entry, amount) // check this when a player clicks an option (on gossip select)

if true, use player->SummonCreature(action, x,y,z,o) // action is the entry of the summoned NPC, which makes it pretty simple code.

also use player->DestroyItemCount(entry, amount) to delete the badges.

There is one thing though …

How are you going to handle situations where 2 players spawn NPCs … etc.

Thanks for the input. The NPC is going to be instanced. Hopefully that will solve the problem.

I have my nephew working on the script with me, and I’m at work. He’s at home so I’m not exactly sure how far he is with it.

Are you able to code it Rochet2? I’ll take it, and learn from it easier.

Also, thanks for your Transmogrification script. I compiled that last night, and it works wonderfully!

I would rather go with “help” than “do it” :3

post script → * overlooks it, makes suggestions, fixes weird stuff etc.

Haha, okay. I’ll post it when I get home if my nephew has it done. That won’t be for about 9 hours though.

It would be nice to have it done though, that way I can use it as a reference if I get stuck. It makes learning way easier for me. /emoticons/default_smile.png

Any continuation going on …?

Cleaned Code up a bit from old script.


You know? summoning bosses outside their places is a REALLY BAD IDEA (they can crash core).

I’m aware of that, maybe he wanted to use custom scripted bosses.

I just used those as examples.

Just to be safe i will remove them.

edit Went back and edited out the boss enums and put placeholders for users to edit

Also added in a brief notice about summoning bosses that are linked to instance scripts

Actually, we have the script complete. Sorry I haven’t replied about it. It was more simple than I thought, but you’re code is cleaner than ours.

Thanks for that input. I’ll fix mine up a bit Bloodfangx!

Your welcome, glad you got the script resolved.

Cleaned up old script looks a lot better now, edited previous post with a pastebin url instead.