Schlumpf write a nice script, but the script is to old for Trinity Core Rev. 7331 (3.2.2a). I try to edit the script, but i havent success.
Can someone help me by the Script editing?
/*
* Copyright (C) 2010 schlumpf
*/
#include "ScriptPCH.h"
#include "Channel.h"
#include "Player.h"
class Guild;
class Group;
class ChatXPScript : public PlayerScript
{
public:
ChatXPScript() : PlayerScript("ChatXPScript") { }
void OnChat(Player* player, uint32 type, uint32 /*lang*/, std::string msg)
// CHAT_MSG_ADDON, CHAT_MSG_SAY, CHAT_MSG_EMOTE, CHAT_MSG_YELL
{
if( type == CHAT_MSG_EMOTE ) return;
if( type == CHAT_MSG_ADDON ) return;
int xpGain = 10;
// modify:
xpGain += msg.length();
player->GiveXP( xpGain, NULL, 1.0f );
}
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string msg, Player *receiver)
// CHAT_MSG_WHISPER
{
int xpGain1 = 5;
int xpGain2 = 2;
// modify:
xpGain1 *= msg.length();
xpGain2 *= msg.length();
player->GiveXP( xpGain1, NULL, 1.0f );
receiver->GiveXP( xpGain2, NULL, 1.0f );
}
void OnChat(Player *player, uint32 type, uint32 /*lang*/, std::string msg, Group */*group*/)
// CHAT_MSG_PARTY, CHAT_MSG_PARTY_LEADER, CHAT_MSG_RAID, CHAT_MSG_RAID_LEADER, CHAT_MSG_RAID_WARNING, CHAT_MSG_BATTLEGROUND, CHAT_MSG_BATTLEGROUND_LEADER
{
if( type == CHAT_MSG_PARTY ) return;
if( type == CHAT_MSG_RAID ) return;
if( type == CHAT_MSG_BATTLEGROUND ) return;
int xpGain = 100;
// modify:
xpGain += msg.length();
player->GiveXP( xpGain, NULL, 1.0f );
}
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string msg, Guild */*guild*/)
// CHAT_MSG_GUILD, CHAT_MSG_OFFICER
{
if( type == CHAT_MSG_OFFICER ) return;
int xpGain = 10;
// modify:
xpGain += msg.length();
player->GiveXP( xpGain, NULL, 1.0f );
}
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string msg, Channel *channel)
{
if( !channel ) return;
if( channel->HasFlag(CHANNEL_FLAG_TRADE) ) return;
if( channel->HasFlag(CHANNEL_FLAG_LFG) ) return;
int xpGain = 0;
// modify:
xpGain += msg.length();
player->GiveXP( xpGain, NULL, 1.0f );
}
};
void AddSC_ChatXPScript()
{
new ChatXPScript();
}