Sir Prototype
New Member
- Joined
- May 12, 2017
- Messages
- 3
- Reaction score
- 0
Hello guys, please could anyone tell me how do I set the minimum server level to 550? Do I do it through creaturescripts or player.cpp?
I'm using Canary 13.21 data
player.cpp
and how can I set it to earn 5k gold when killing a player?
I think you could insert the line here
or we can do in creaturescripts converting it to canary?
Thanks for all
I'm using Canary 13.21 data
player.cpp
C++:
if (oldLevel != level) {
std:stringstream ss;
ss << "You were downgraded from Level " << oldLevel << " to Level " << level << '.';
sendTextMessage(MESSAGE_EVENT_ADVANCE, ss.str());
}
uint64_t currLevelExp = Player::getExpForLevel(level);
uint64_t nextLevelExp = Player::getExpForLevel(level + 1);
if (nextLevelExp > currLevelExp) {
levelPercent = Player::getPercentLevel(experience - currLevelExp, nextLevelExp - currLevelExp);
} else {
levelPercent = 0;
}
}
and how can I set it to earn 5k gold when killing a player?
I think you could insert the line here
C++:
uint64_t Player::getGainedExperience(std::shared_ptr<Creature> attacker) const {
if (g_configManager().getBoolean(EXPERIENCE_FROM_PLAYERS)) {
auto attackerPlayer = attacker->getPlayer();
if (attackerPlayer && attackerPlayer.get() != this && skillLoss && std::abs(static_cast<int32_t>(attackerPlayer->getLevel() - level)) <= g_configManager().getNumber(EXP_FROM_PLAYERS_LEVEL_RANGE)) {
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 7.75));
}
}
return 0;
}
or we can do in creaturescripts converting it to canary?
Lua:
function onKill(cid, target, lastHitKiller)
if(isPlayer(target) and isPlayer(lastHitKiller)) then
doPlayerSendTextMessage(cid, 22, "Parabens, voce matou o jogador "..getCreatureName(target).." e ganhou gold")
function additem()
local aditi = doPlayerAddItem(lastHitKiller, 2160, 50)
end
addEvent(additem, 1000)
end
Thanks for all
Last edited: