hello, i compile this script in tfs 0.4 3777 but dont work, no have error and exp again with same ip
Feature - No exp from same IP when killing another player (PVP - Enforced/Hardcore).
I love Teh Evil Hero
otland.net
player.cpp: In member function ‘virtual double Player::getGainedExperience(Creature*) const’:
player.cpp:3552:98: error: expected primary-expression before ‘)’ token
if(attackerPlayer->getIP() == getIP() && !g_config.getBool(ConfigManager::GAIN_EXP_FROM_SAME_IP)))
^
player.cpp:3552:98: error: expected ‘;’ before ‘)’ token
make[1]: *** [player.o] Error 1
make[1]: Leaving directory `/home/total/sources/src'
make: *** [all] Error 2
show me ur getGainedExperiencedont work, player gain exp
double Player::getGainedExperience(Creature* attacker) const
{
if(!skillLoss)
return 0;
double rate = g_config.getDouble(ConfigManager::RATE_PVP_EXPERIENCE);
if(rate <= 0)
return 0;
Player* attackerPlayer = attacker->getPlayer();
if(!attackerPlayer || attackerPlayer == this){
return 0;
}
if(attackerPlayer->getIP() == getIP() && !g_config.getBool(ConfigManager::GAIN_EXP_FROM_SAME_IP))
{
return 0;
}
gainExpFromSameIp = falseHave you got GAIN_EXP_FROM_SAME_IP in config.lua set to false?
show me this in player.cppsorry did not understand
i use hardcore in pvp style
bool Player::gainExperience(double& gainExp, bool fromMonster)
{
if(!rateExperience(gainExp, fromMonster))
return false;
//soul regeneration
if(gainExp >= level)
{
if(Condition* condition = Condition::createCondition(
CONDITIONID_DEFAULT, CONDITION_SOUL, 4 * 60 * 1000))
{
condition->setParam(CONDITIONPARAM_SOULGAIN,
vocation->getGainAmount(GAIN_SOUL));
condition->setParam(CONDITIONPARAM_SOULTICKS,
(vocation->getGainTicks(GAIN_SOUL) * 1000));
addCondition(condition);
}
}
addExperience((uint64_t)gainExp);
return true;
}
player.cpp:3964:6: error: prototype for ‘bool Player::gainExperience(double&, Creature*)’ does not match any in class ‘Player’
bool Player::gainExperience(double& gainExp, Creature* target)
^
In file included from player.cpp:20:0:
player.h:1049:8: error: candidate is: bool Player::gainExperience(double&, bool)
bool gainExperience(double& gainExp, bool fromMonster);
^
player.cpp:3987:6: error: prototype for ‘bool Player::rateExperience(double&, Creature*)’ does not match any in class ‘Player’
bool Player::rateExperience(double& gainExp, Creature* target)
^
In file included from player.cpp:20:0:
player.h:1050:8: error: candidate is: bool Player::rateExperience(double&, bool)
bool rateExperience(double& gainExp, bool fromMonster);
^
player.cpp:4016:6: error: prototype for ‘void Player::onGainExperience(double&, Creature*, bool)’ does not match any in class ‘Player’
void Player::onGainExperience(double& gainExp, Creature* target, bool multiplied)
^
In file included from player.cpp:20:0:
player.h:649:16: error: candidate is: virtual void Player::onGainExperience(double&, bool, bool)
virtual void onGainExperience(double& gainExp, bool fromMonster, bool multiplied);
^
player.cpp:4029:6: error: prototype for ‘void Player::onGainSharedExperience(double&, Creature*, bool)’ does not match any in class ‘Player’
void Player::onGainSharedExperience(double& gainExp, Creature* target, bool)
^
In file included from player.cpp:20:0:
player.h:650:16: error: candidate is: virtual void Player::onGainSharedExperience(double&, bool, bool)
virtual void onGainSharedExperience(double& gainExp, bool fromMonster, bool multiplied);
^
make[1]: *** [player.o] Error 1
make[1]: Leaving directory `/home/total/sources/src'
make: *** [all] Error 2
change
bool Player::gainExperience(double& gainExp, bool fromMonster)
for
bool Player::gainExperience(double& gainExp, Creature* target)
if(!rateExperience(gainExp, fromMonster))
for
if(!rateExperience(gainExp, target))
bool Player::rateExperience(double& gainExp, bool fromMonster)
for
bool Player::rateExperience(double& gainExp, Creature* target)
if(!fromMonster)
return true;
for
if(target->getPlayer())
return true;
void Player::eek:nGainExperience(double& gainExp, bool fromMonster, bool multiplied)
{
if(party && party->isSharedExperienceEnabled() && party->isSharedExperienceActive())
{
party->shareExperience(gainExp, fromMonster, multiplied);
rateExperience(gainExp, fromMonster);
return; //we will get a share of the experience through the sharing mechanism
}
if(gainExperience(gainExp, fromMonster))
Creature::eek:nGainExperience(gainExp, fromMonster, true);
}
for
void Player::eek:nGainExperience(double& gainExp, Creature* target, bool multiplied)
{
if(party && party->isSharedExperienceEnabled() && party->isSharedExperienceActive())
{
party->shareExperience(gainExp, target, multiplied);
rateExperience(gainExp, target);
return; //we will get a share of the experience through the sharing mechanism
}
if(gainExperience(gainExp, target))
Creature::eek:nGainExperience(gainExp, target, true);
}
void Player::eek:nGainSharedExperience(double& gainExp, bool fromMonster, bool)
{
if(gainExperience(gainExp, target))
Creature::eek:nGainSharedExperience(gainExp, fromMonster, true);
}
for
void Player::eek:nGainSharedExperience(double& gainExp, Creature* target, bool)
{
if(gainExperience(gainExp, target))
Creature::eek:nGainSharedExperience(gainExp, target, true);
}
monster.o:(.rodata._ZTC7Monster0_8Creature[_ZTV7Monster]+0x2b0): undefined refer ence to `Creature::onGainExperience(double&, Creature*, bool)'
monster.o:(.rodata._ZTC7Monster0_8Creature[_ZTV7Monster]+0x2b8): undefined refer ence to `Creature::onGainSharedExperience(double&, Creature*, bool)'
monster.o:(.rodata._ZTV7Monster[_ZTV7Monster]+0x2b0): undefined reference to `Cr eature::onGainExperience(double&, Creature*, bool)'
monster.o:(.rodata._ZTV7Monster[_ZTV7Monster]+0x2b8): undefined reference to `Cr eature::onGainSharedExperience(double&, Creature*, bool)'
npc.o:(.rodata._ZTC3Npc0_8Creature[_ZTV3Npc]+0x2b0): undefined reference to `Cre ature::onGainExperience(double&, Creature*, bool)'
npc.o:(.rodata._ZTC3Npc0_8Creature[_ZTV3Npc]+0x2b8): undefined reference to `Cre ature::onGainSharedExperience(double&, Creature*, bool)'
npc.o:(.rodata._ZTV3Npc[_ZTV3Npc]+0x2b0): undefined reference to `Creature::onGa inExperience(double&, Creature*, bool)'
npc.o:(.rodata._ZTV3Npc[_ZTV3Npc]+0x2b8): undefined reference to `Creature::onGa inSharedExperience(double&, Creature*, bool)'
collect2: error: ld returned 1 exit status
make[1]: *** [theforgottenserver] Error 1
make[1]: Leaving directory `/home/total/sources/src'
make: *** [all] Error 2