Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnPVPKill(Player* killer, Player* killed) override
- {
- QueryResult charResult = CharacterDatabase.PQuery("SELECT reward, reward_type FROM bounty_rewards WHERE guid %u", killed->GetGUID().GetCounter());
- if (!charResult)
- return;
- Field* charFields = charResult->Fetch();
- uint32 reward = charFields[0].GetUInt32();
- uint32 reward_type = charFields[1].GetUInt32();
- CharacterDatabase.PExecute("DELETE FROM bounty_rewards WHERE guid = %u", killed->GetGUID().GetCounter());
- std::ostringstream ss;
- switch (reward_type)
- {
- case 0:
- {
- killer->ModifyMoney(reward*GOLD);
- ss << "|cffFF0000[Bounty System]|r ""Bounty of " << reward << " Gold has been claimed by " << killed->GetName();
- }
- break;
- //case 1:
- // killer->ModifyHonor(reward*HONOR);
- // break;
- case 2:
- {
- killer->AddItem(LOYALTY_POINT, reward);
- ss << "|cffFF0000[Bounty System]|r ""Bounty on " << static_cast<uint32>(killed->getLevel()) << " of " << reward << " " << TOKEN_NAME << " has been claimed by " << killed->GetName();
- }
- break;
- }
- sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement