Skip to content

Instantly share code, notes, and snippets.

@irancore
Created December 13, 2019 10:45
Show Gist options
  • Save irancore/6c618e5ba26478b0d612362c4b1074f2 to your computer and use it in GitHub Desktop.
Save irancore/6c618e5ba26478b0d612362c4b1074f2 to your computer and use it in GitHub Desktop.
// Developed By IranCore.Ir
#include "ScriptPCH.h"
#include "AccountMgr.h"
class item_vip_active : public ItemScript
{
public:
item_vip_active() : ItemScript("item_vip_active") {}
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
{
QueryResult Exitdata = LoginDatabase.PQuery("SELECT acc_id FROM account_vip WHERE acc_id = %u", player->GetSession()->GetAccountId());
if (!Exitdata)
LoginDatabase.PQuery("INSERT INTO account_vip (acc_id, viplevel) VALUES ('%u', '1')", player->GetSession()->GetAccountId());
else
LoginDatabase.PQuery("Update account_vip Set viplevel = viplevel + '1' WHERE acc_id = '%u'", player->GetSession()->GetAccountId());
player->DestroyItemCount(694800,1,true); // 694800 = Entry Item Ke Vip Active Ra Anjam Midahad
ChatHandler(player->GetSession()).SendSysMessage("|cffFF4500[Harmez Server]:|r Vip Level successfully Added!");
return true;
}
};
void AddSC_item_vip_active()
{
new item_vip_active();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment