• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] C++ Reward as group loot (Virtual Currency)

Status
Not open for further replies.

Visa

Sexy Member
I have a piece of code that I have a small question about wondering if anyone could help me out.

This script tested and works, will reward x amount of "points" to players as virtual currency (table in the DB)

OnCreatureKill = Ingame "You receive: 10 Points."

But the problem is, even if the player that kills the creature is in a group the whole group doesn't get loot and I was wondering If there was a way to register such a function

Kind of like item_template Flags: 2048 (0x0800) "Item is party loot and can be looted by all"
Code:
[URL="http://collab.kpsn.org/display/tc/item_template#item_template-Flags"]Source - Reference (TrinityCore)[/URL]


partial code
Code:
void OnCreatureKill(Player* player, Creature* creature)
{
    if (creature->GetEntry() == CREATURE_ENTRY)
        {
                ..add the currency..
        }
        else
        {
                ..add the currency..
        }
}

If there was something like
Code:
void OnCreatureKill(Player* player, Creature* creature)
{
    if (creature->GetEntry() == CREATURE_ENTRY)
      {
       if (player->GetSession()->IsInParty() == True) ???
        {
               ..add the currency..
        }
        else
        {
                ..add the currency..
        }
      }
}

"..add the currency.." is just a placeholder for really long SQL UPDATE statements that got cluttered in the
Code:
 so I just omitted it.

Any help is appreciated,
Thanks.
 
Status
Not open for further replies.
Top