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, Item* item, SpellCastTargets const& /*targets*/) override
- {
- 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
- };
- if (item)
- {
- switch (itementryid)
- {
- case RHINO_HAIR:
- if (player->GetItemCount(RHINO_HAIR, 10))
- {
- player->DestroyItemCount(RHINO_HAIR, 10, true);
- player->AddItem(WOOL_THREAD, 1);
- }
- else
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, nullptr);
- break;
- case SPIDER_HAIR:
- if (player->GetItemCount(SPIDER_HAIR, 10))
- {
- player->DestroyItemCount(SPIDER_HAIR, 10, true);
- player->AddItem(SILK_THREAD, 1);
- }
- else
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, nullptr);
- break;
- case BODY_HAIR:
- if (player->GetItemCount(BODY_HAIR, 10))
- {
- player->DestroyItemCount(BODY_HAIR, 10, true);
- player->AddItem(OTHER_THREAD, 1);
- }
- else
- player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, item, nullptr);
- break;
- //in case you get no itemid at all, fuck if i know how though lol
- default:
- break;
- return true;
- }
- }
- }
- };
Add Comment
Please, Sign In to add comment