Tbol
Well-Known Member
- Joined
- Apr 7, 2019
- Messages
- 529
- Reaction score
- 56
TFS 1.2
MYACC 0.7.9
Hello so right now i have last kills like this
- Killed at level 30 by a minotaur ...... or ...... Killed at level 30 by Player (a)
But I want to show the whole list. like this \/
- Killed at level 30 by Player (a), Player (b) and a minotaur
this is my
lastkills.php
and this is
ondeath in creature.cpp
MYACC 0.7.9
Hello so right now i have last kills like this
- Killed at level 30 by a minotaur ...... or ...... Killed at level 30 by Player (a)
But I want to show the whole list. like this \/
- Killed at level 30 by Player (a), Player (b) and a minotaur
this is my
lastkills.php
<?php/** * Last kills * * @package MyAAC * @author Gesior <jerzys - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
pastebin.com
and this is
ondeath in creature.cpp
C++:
void Creature::onDeath()
{
bool lastHitUnjustified = false;
bool mostDamageUnjustified = false;
Creature* _lastHitCreature = g_game.getCreatureByID(lastHitCreature);
Creature* lastHitCreatureMaster;
if (_lastHitCreature) {
lastHitUnjustified = _lastHitCreature->onKilledCreature(this);
lastHitCreatureMaster = _lastHitCreature->getMaster();
} else {
lastHitCreatureMaster = nullptr;
}
Creature* mostDamageCreature = nullptr;
const int64_t timeNow = OTSYS_TIME();
const uint32_t inFightTicks = g_config.getNumber(ConfigManager::PZ_LOCKED);
int32_t mostDamage = 0;
std::map<Creature*, uint64_t> experienceMap;
uint16_t deathAssists = 0;
uint16_t deathAssistsConfig = g_config.getNumber(ConfigManager::DEATH_ASSIST_COUNT);
for (const auto& it : damageMap) {
if (Creature* attacker = g_game.getCreatureByID(it.first)) {
CountBlock_t cb = it.second;
if ((cb.total > mostDamage && (timeNow - cb.ticks <= inFightTicks))) {
mostDamage = cb.total;
mostDamageCreature = attacker;
}
if (attacker != this) {
if (Player* victimPlayer = getPlayer()) {
if (Player* attackerPlayer = attacker->getPlayer()) {
if (deathAssists < deathAssistsConfig) {
attackerPlayer->addUnjustifiedDead(victimPlayer);
deathAssists++;
}
}
}
uint64_t gainExp = getGainedExperience(attacker);
if (Player* player = attacker->getPlayer()) {
Party* party = player->getParty();
if (party && party->getLeader() && party->isSharedExperienceActive() && party->isSharedExperienceEnabled()) {
attacker = party->getLeader();
}
}
auto tmpIt = experienceMap.find(attacker);
if (tmpIt == experienceMap.end()) {
experienceMap[attacker] = gainExp;
} else {
tmpIt->second += gainExp;
}
}
}
}
for (const auto& it : experienceMap) {
it.first->onGainExperience(it.second, this);
}
if (mostDamageCreature) {
if (mostDamageCreature != _lastHitCreature && mostDamageCreature != lastHitCreatureMaster) {
Creature* mostDamageCreatureMaster = mostDamageCreature->getMaster();
if (_lastHitCreature != mostDamageCreatureMaster && (lastHitCreatureMaster == nullptr || mostDamageCreatureMaster != lastHitCreatureMaster)) {
mostDamageUnjustified = mostDamageCreature->onKilledCreature(this, false);
}
}
}
bool droppedCorpse = dropCorpse(_lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
death(_lastHitCreature);
if (master) {
master->removeSummon(this);
}
if (droppedCorpse) {
g_game.removeCreature(this, false);
}
}