prod1gy
New Member
- Joined
- Feb 1, 2009
- Messages
- 3
- Reaction score
- 0
Hi, i`m trying to make it so players get "reputation points" when they kill someone and lose reputation points when they die, i don`t want to use lua functions and storage values, I prefer doing it on sources because it will be faster to edit on sql and many functions will use it for multipliers, the dying and losing "rep points" is done:
but I can`t find the function to add fame, i can`t use addUnjustifiedKill() because it will be pvp-enforced, tried creature:
nKilledCreature and it didn`t work, tried Creature:
nDeath() and it also didn`t work, help, where should I add it ?
here is what i`m trying to add ( when it`s on players.cpp obv)
Code:
bool Player::onDeath()
{
removeConditions(CONDITIONEND_DEATH);
//fame lost.
std::stringstream msg;
int32_t famelost;
if(fame > 0){
famelost = (int32_t) fame * 0.025;
}
else
famelost = 0;
fame = fame - famelost;
msg << "Current fame: " << fame << ". Current medals: 0. Current rank: 0. Class rank: 0.";
sendTextMessage(MSG_STATUS_CONSOLE_RED, msg.str());
[...]
but I can`t find the function to add fame, i can`t use addUnjustifiedKill() because it will be pvp-enforced, tried creature:
here is what i`m trying to add ( when it`s on players.cpp obv)
Code:
std::stringstream msg;
int32_t famegain;
if(attacked->fame >= 20){
famegain = (int32_t) attacked->fame * 0.03;
}
else
famegain = 20;
fame = fame + famegain;
msg << "Current fame: " << fame << ". Current medals: 0. Current rank: 0. Class rank: 0.";
sendTextMessage(MSG_STATUS_CONSOLE_RED, msg.str());