mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-03-28 23:50:02 +00:00
Nanocom Boosters and Authentic FM-Taro Scale Logic (#315)
* Groundwork for nanocom boosters * The item use handler now has a switch for multiple item types (currently gumballs, and a stub for boosters) * All item types are now checked for expiration, not just vehicles * implement nanocom booster helpers, save and expiry * implement authentic taro and fm modfication * magic number and code refactor * make sure only close by group members are counted * add safe taro fm handling, rate command, race and mission booster logic * add config option to disable authentic group scaling * rename for consistency * make rates percentages, fix chat message, add config options * add config option to the ini file * add index guard for hasBoost functions * reorder config ini options * add bank item expiry option * fix trade oversight --------- Co-authored-by: CakeLancelot <CakeLancelot@users.noreply.github.com>
This commit is contained in:
@@ -808,18 +808,17 @@ void MobAI::onDeath(CombatNPC* npc, EntityRef src) {
|
||||
Items::DropRoll rolled;
|
||||
Items::DropRoll eventRolled;
|
||||
std::map<int, int> qitemRolls;
|
||||
std::vector<EntityRef> playersInRange;
|
||||
std::vector<Player*> playerRefs;
|
||||
|
||||
if (plr->group == nullptr) {
|
||||
playerRefs.push_back(plr);
|
||||
Combat::genQItemRolls(playerRefs, qitemRolls);
|
||||
Items::giveMobDrop(src.sock, self, rolled, eventRolled);
|
||||
Items::giveMobDrop(src.sock, self, rolled, eventRolled, 1);
|
||||
Missions::mobKilled(src.sock, self->type, qitemRolls);
|
||||
}
|
||||
else {
|
||||
auto players = plr->group->filter(EntityKind::PLAYER);
|
||||
for (EntityRef pRef : players) playerRefs.push_back(PlayerManager::getPlayer(pRef.sock));
|
||||
Combat::genQItemRolls(playerRefs, qitemRolls);
|
||||
for (int i = 0; i < players.size(); i++) {
|
||||
CNSocket* sockTo = players[i].sock;
|
||||
Player* otherPlr = PlayerManager::getPlayer(sockTo);
|
||||
@@ -829,7 +828,14 @@ void MobAI::onDeath(CombatNPC* npc, EntityRef src) {
|
||||
if (dist > 5000)
|
||||
continue;
|
||||
|
||||
Items::giveMobDrop(sockTo, self, rolled, eventRolled);
|
||||
playersInRange.push_back(players[i]);
|
||||
}
|
||||
|
||||
for (EntityRef pRef : playersInRange) playerRefs.push_back(PlayerManager::getPlayer(pRef.sock));
|
||||
Combat::genQItemRolls(playerRefs, qitemRolls);
|
||||
for (int i = 0; i < playersInRange.size(); i++) {
|
||||
CNSocket* sockTo = playersInRange[i].sock;
|
||||
Items::giveMobDrop(sockTo, self, rolled, eventRolled, playersInRange.size());
|
||||
Missions::mobKilled(sockTo, self->type, qitemRolls);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user