the pvptoken in extrascripts folder only give out golds not token..
look at the code
Code:
int32 gold_check_p = plr->GetUInt32Value( PLAYER_FIELD_COINAGE );
int32 gold_check_v = victim->GetUInt32Value( PLAYER_FIELD_COINAGE );
int32 new_gold_p = gold_check_p + 10000;
int32 new_gold_v;
if(gold_check_v < 5000)
{
new_gold_v = 0;
so use this if u want add token
Code:
#include "StdAfx.h"
#include "Setup.h"
void onPvpKill(Player* plr, Player* victim)
{
int itemID;
uint32 tokenItem = Config.MainConfig.GetInt("NCDB", "PvPTokenID", &itemID);
sLog.outColor(TGREEN,"n[NCDB] (%u)%s killed (%u)%s", plr->getLevel(), plr->GetName(), victim->getLevel(), victim->GetName());
char onkill[1024];
snprintf((char*)onkill, 1024, "|cffFFFF00[PVP]|r |cff00FF00%s|r |cffFFFF00has killed|r |cff00FF00%s|r", plr->GetName(), victim->GetName());
sWorld.SendWorldWideScreenText(onkill);
if(plr->getLevel() >= 1 && victim->getLevel() >= 70 && plr->GetTeam() != victim->GetTeam())
{
sLog.outColor(TGREEN,"n[NCDB] Adding token to %s", plr->GetName());
sLog.outColor(TNORMAL,"n");
ItemPrototype *proto = ItemPrototypeStorage.LookupEntry(itemID);
SlotResult slotresult;
slotresult = plr->GetItemInterface()->FindFreeInventorySlot(proto);
if(!slotresult.Result)
{
plr->GetItemInterface()->BuildInventoryChangeError(NULL, NULL, INV_ERR_INVENTORY_FULL);
}
else
{
Item *itm = objmgr.CreateItem(itemID, plr);
itm->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 1);
plr->GetItemInterface()->SafeAddItem(itm,slotresult.ContainerSlot, slotresult.Slot);
plr->SaveToDB(false);
}
}
else
{
sLog.outColor(TGREEN,"n[NCDB] Not adding token since they both are not level 70");
sLog.outColor(TNORMAL,"n");
}
}
void SetupPvPToken(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, onPvpKill);
}