Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class item_generic_thread : public ItemScript
- {
- public:
- item_generic_thread() : ItemScript("item_generic_thread") {}
- bool OnUse(Player* player, Unit* /*unit*/, SpellInfo const* spellInfo, Item* item)
- {
- uint32 itementryid = item->GetEntry();
- enum reagantList
- {
- RHINO_HAIR = 123,
- SPIDER_HAIR = 124,
- BODY_HAIR = 125
- };
- enum threadtypes
- {
- WOOL_THREAD = 12345,
- SILK_THREAD = 12346,
- OTHER_THREAD = 12347
- };
- switch (itementryid)
- {
- case RHINO_HAIR:
- if (player->GetItemCount(RHINO_HAIR, 10))
- {
- player->DestroyItemCount(RHINO_HAIR, 10, true);
- player->AddItem(WOOL_THREAD, 1);
- }
- break;
- case SPIDER_HAIR:
- if (player->GetItemCount(SPIDER_HAIR, 10))
- {
- player->DestroyItemCount(SPIDER_HAIR, 10, true);
- player->AddItem(SILK_THREAD, 1);
- }
- break;
- case BODY_HAIR:
- if (player->GetItemCount(BODY_HAIR), 10)
- {
- player->DestroyItemCount(BODY_HAIR, 10, true);
- player->AddItem(OTHER_THREAD, 1);
- }
- break;
- //in case you get no itemid at all, fuck if i know how though lol
- default:
- return;
- break;
- }
- }
- };
Add Comment
Please, Sign In to add comment