Jump to content

[QUESTION] Ian Drake redeeming code


Guest xarly

Recommended Posts

HI!

I'm using rev.9025 and I've seen that Ian Drake ask for a code. In Offi, participants of the 2008 Blizzard Worldwide Invitational in France were given a code that unlocked a pet in-game. (Tyrael's Hilt)

I wonder if this codes and their rewards can be customizable in mangos. It would be very interesting, don't you think?

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

This is indeed very possible: I've implemented it myself for my server.

I set up a couple of tables (one for possible codes, one for codes redeemed) and then made various checks. If the character passed these, the item was mailed to them.

Unfortunately, I will not release this code at this time, for a number of reasons:

- It reads/writes the tables in the mangos database (should be moved to characters).

- It needs a sender for the mail, but the behaviour was odd when an ID was chosen that was valid both for an NPC and a character.

- It was written some time ago (around 0.15), since I tend to stay a bit behind the bleeding edge versions. I have no idea how compatible it is with current sources.

- Some smaller fixes that I would have liked to added never made it.

However, if you are interested in fixing it yourself, look in game/NPCHandler.cpp:337:

if (_player->PlayerTalkClass->GossipOptionCoded(gossipListId))
   {
       recv_data >> code;
       DEBUG_LOG("Gossip code: %s", code.c_str());
   }

The code recieved from the client is stored in code (and can be quite long!). Make whatever checks and take whatever actions you'd like.

Good luck!

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use