mirror of
https://github.com/ornfelt/azerothcore_lua_scripts
synced 2026-08-22 06:26:03 -04:00
34 lines
985 B
C
34 lines
985 B
C
|
|
#ifndef _CUSTOMCOUPONSYSTEM_H
|
||
|
|
#define _CUSTOMCOUPONSYSTEM_H
|
||
|
|
|
||
|
|
class CustomCouponSystem {
|
||
|
|
|
||
|
|
private:
|
||
|
|
std::string createNewCouponCode();
|
||
|
|
void insertNewCouponCodeinDB(std::string code, int itemid, int itemquantity, int used, int useablequantity);
|
||
|
|
bool isItemCodeStillValid(std::string couponcode);
|
||
|
|
void updateCouponCodeUsed(int used, std::string couponcode);
|
||
|
|
int getFortuneItem();
|
||
|
|
int getCouponRewardbyID(int modulo);
|
||
|
|
void insertNewPlayerUsedCode(std::string charactername, int accountid, std::string couponcode);
|
||
|
|
PreparedQueryResult getRequestedCodeData(std::string couponcode);
|
||
|
|
bool hasPlayeralreadyUsedCode(std::string couponcode, int accountid);
|
||
|
|
|
||
|
|
public:
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
void playerRedeemCommand(Player * player, const char* args);
|
||
|
|
void couponGenerationperCommand(Player * player, const char* args);
|
||
|
|
void playerCouponGenerationAndRedeeming(Player * player, std::string logmessage);
|
||
|
|
void playerCouponGerationForAFriend(Player * player, std::string logmessage);
|
||
|
|
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|