mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-10 10:40:47 +00:00
Group warping & mob movement smoothing
* Warping into IZs and Fusion Lairs now will also take into account your group members. * MobManager lerp does not confusingly divide speed by 2 anymore. * Mobs pursue their targets more smoothly, they will avoid phasing into the player during combat. * Nerfed retreat speed by a factor of 1.5, normal mobs retreated way too quickly however mobs like Don Doom and Bad Max do not retreat fast enough. * Bugfixed sendPlayerTo, it did not call updatePlayerPosition leaving undesirable anomalies.
This commit is contained in:
@@ -596,9 +596,32 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) {
|
||||
ChunkManager::createInstance(instanceID);
|
||||
}
|
||||
|
||||
PlayerManager::sendPlayerTo(sock, Warps[warpId].x, Warps[warpId].y, Warps[warpId].z, instanceID);
|
||||
} else {
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_WARP_USE_NPC_SUCC, resp); // Can only be used for exiting instances because it sets the instance flag to false
|
||||
if (plrv.plr->iID == plrv.plr->iIDGroup && plrv.plr->groupCnt == 1)
|
||||
PlayerManager::sendPlayerTo(sock, Warps[warpId].x, Warps[warpId].y, Warps[warpId].z, instanceID);
|
||||
else {
|
||||
Player* leaderPlr = PlayerManager::getPlayerFromID(plrv.plr->iIDGroup);
|
||||
|
||||
for (int i = 0; i < leaderPlr->groupCnt; i++) {
|
||||
Player* otherPlr = PlayerManager::getPlayerFromID(leaderPlr->groupIDs[i]);
|
||||
CNSocket* sockTo = PlayerManager::getSockFromID(leaderPlr->groupIDs[i]);
|
||||
|
||||
if (otherPlr == nullptr || sockTo == nullptr)
|
||||
continue;
|
||||
|
||||
if (otherPlr->instanceID == 0) {
|
||||
otherPlr->lastX = otherPlr->x;
|
||||
otherPlr->lastY = otherPlr->y;
|
||||
otherPlr->lastZ = otherPlr->z;
|
||||
otherPlr->lastAngle = otherPlr->angle;
|
||||
}
|
||||
|
||||
PlayerManager::sendPlayerTo(sockTo, Warps[warpId].x, Warps[warpId].y, Warps[warpId].z, instanceID);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
INITSTRUCT(sP_FE2CL_REP_PC_WARP_USE_NPC_SUCC, resp); //Can only be used for exiting instances because it sets the instance flag to false
|
||||
resp.iX = Warps[warpId].x;
|
||||
resp.iY = Warps[warpId].y;
|
||||
resp.iZ = Warps[warpId].z;
|
||||
|
||||
Reference in New Issue
Block a user