Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----- (000000000077CE20) ----------------------------------------------------
- char __fastcall CMoveToTargetAction::SetMoving(CMoveToTargetAction *this)
- {
- __int64 ThreadID; // rbx
- __int64 m_nID; // rdi
- CCreature *Shuttle; // rsi
- CWorldObject *WorldObject; // rax
- CWorldObject *v6; // r15
- char v7; // r13
- __m128d v8; // xmm6
- CWorld *v9; // rbx
- unsigned int v10; // edi
- CGeoData *v11; // rax
- int m_nDistance; // ebx
- CCreatureController *v13; // rax
- const FVector *TargetDestination; // rax
- char v15; // di
- int *v16; // r13
- FVector *v17; // r12
- FVector *v18; // rax
- unsigned int nInstantZoneID; // ebx
- double v20; // xmm0_8
- char v21; // al
- int *v22; // rax
- bool v23; // zf
- CCreature_vtbl *v24; // rax
- CCreatureController *v25; // rax
- FVector *v26; // rdx
- int v27; // ebx
- CCreatureController *v28; // rax
- long double v29; // xmm2_8
- long double v30; // xmm1_8
- FVector *p_v; // rdx
- CCreatureController *v32; // rax
- long double v33; // xmm2_8
- long double v34; // xmm1_8
- FVector *v35; // rdx
- __int64 m_nTick; // rdx
- __m128d v37; // xmm6
- long double v38; // xmm0_8
- CWorld *v39; // rax
- int z; // ebx
- CGeoData *v41; // rax
- int Ground; // eax
- int v43; // ebx
- CCreatureController *v44; // rax
- CCreatureController *v45; // rax
- FVector *v46; // r12
- FVector *v47; // rax
- double v48; // xmm0_8
- unsigned __int32 v49; // ebx
- int *v50; // rcx
- CCreature_vtbl *v51; // rax
- CCreatureController *v52; // rax
- FVector *v53; // rdx
- int v54; // ebx
- CCreatureController *v55; // rax
- CCreatureController *v56; // rax
- long double v57; // xmm2_8
- long double v58; // xmm1_8
- CWorldObject_vtbl *v59; // rax
- CCreature *v60; // rax
- FVector *PassingPosOnSight; // rax
- PathFindResult v62; // eax
- FVector *v63; // rbx
- FVector *v64; // rax
- CSharedCreatureData *m_data; // rax
- _BOOL8 v66; // rdx
- CCreature *v67; // rbx
- int *p_m_nTick; // r12
- FVector *p_m_vMidDest; // r15
- FVector *v70; // rax
- unsigned int v71; // ebx
- double v72; // xmm0_8
- int *v73; // rcx
- int *v74; // rax
- CCreatureController *v75; // rcx
- FVector *p_result; // r8
- long double v77; // xmm2_8
- long double v78; // xmm1_8
- int v79; // ebx
- CCreatureController *v80; // rax
- FVector vFrom; // [rsp+50h] [rbp-B0h] BYREF
- FVector result; // [rsp+68h] [rbp-98h] BYREF
- FAngle a[2]; // [rsp+80h] [rbp-80h] BYREF
- FAngle v85; // [rsp+88h] [rbp-78h] BYREF
- FAngle v86[2]; // [rsp+90h] [rbp-70h] BYREF
- FVector v87; // [rsp+98h] [rbp-68h] BYREF
- int v88; // [rsp+D4h] [rbp-2Ch] BYREF
- __int64 v89; // [rsp+E0h] [rbp-20h]
- __int128 v90; // [rsp+E8h] [rbp-18h]
- FVector v91; // [rsp+F8h] [rbp-8h] BYREF
- int v92; // [rsp+114h] [rbp+14h] BYREF
- __int64 v93; // [rsp+120h] [rbp+20h]
- __int128 v94; // [rsp+128h] [rbp+28h]
- FVector v95; // [rsp+138h] [rbp+38h] BYREF
- FVector v; // [rsp+150h] [rbp+50h] BYREF
- FVector v97; // [rsp+168h] [rbp+68h] BYREF
- FVector v98; // [rsp+180h] [rbp+80h] BYREF
- FVector v99; // [rsp+198h] [rbp+98h] BYREF
- __int64 v100[3]; // [rsp+1B0h] [rbp+B0h] BYREF
- __int64 v101[3]; // [rsp+1C8h] [rbp+C8h] BYREF
- FVector v102; // [rsp+1E0h] [rbp+E0h] BYREF
- __int64 v103; // [rsp+1F8h] [rbp+F8h]
- JOB *v104; // [rsp+200h] [rbp+100h]
- FVector v105; // [rsp+208h] [rbp+108h] BYREF
- FVector v106; // [rsp+220h] [rbp+120h] BYREF
- FVector v107; // [rsp+238h] [rbp+138h] BYREF
- FVector v108; // [rsp+250h] [rbp+150h] BYREF
- FVector v109; // [rsp+268h] [rbp+168h] BYREF
- FVector v110; // [rsp+280h] [rbp+180h] BYREF
- FVector v111; // [rsp+298h] [rbp+198h] BYREF
- FVector v112; // [rsp+2B0h] [rbp+1B0h] BYREF
- FVector v113; // [rsp+2C8h] [rbp+1C8h] BYREF
- FVector v114; // [rsp+2E0h] [rbp+1E0h] BYREF
- int v115; // [rsp+300h] [rbp+200h]
- char v116[2048]; // [rsp+308h] [rbp+208h] BYREF
- int v117; // [rsp+B10h] [rbp+A10h]
- char v118[2048]; // [rsp+B18h] [rbp+A18h] BYREF
- bool v119; // [rsp+1398h] [rbp+1298h] BYREF
- PathFindResult r; // [rsp+13A0h] [rbp+12A0h] BYREF
- int v121; // [rsp+13A8h] [rbp+12A8h] BYREF
- v103 = -2i64;
- v104 = &JOB_NEWACTION__MOVETOTARGET_SETMOVING;
- ThreadID = (int)CThreadManager::GetThreadID();
- m_nID = JOB_NEWACTION__MOVETOTARGET_SETMOVING.m_nID;
- g_Timer.m_EachJobBeginTimes[ThreadID]._Mypair._Myval2._Myfirst[m_nID] = GetTickCount();
- Shuttle = (CCreature *)CSmartID::GetShuttle((__crt_locale_data *)&this->m_spActor);
- WorldObject = CSmartID::GetWorldObject(&this->m_spTarget);
- v6 = WorldObject;
- *(_QWORD *)&a[0].Yaw = WorldObject;
- v7 = 0;
- if ( !Shuttle || !WorldObject )
- goto LABEL_76;
- Shuttle->ValidateMoveToTargetSpeedAndSendInfo(Shuttle);
- FVector::FVector(&vFrom, &Shuttle->m_data->m_Pos);
- CMoveActionBase::GetTargetPos(&result, Shuttle, v6);
- v8 = (__m128d)*(unsigned __int64 *)&Shuttle->m_data->m_dParam[11];
- if ( !CMoveActionBase::NeedMove(Shuttle, v6, (double)this->m_Data.m_nAcceptableDistance) )
- {
- if ( Shuttle->IsPC(Shuttle)
- || (v9 = CWorld::Inst(),
- v10 = Shuttle->GetInZoneID(Shuttle),
- v11 = v9->GetGeo(v9),
- CGeoData::CanSee(v11, &vFrom, &result, v10, 0)) )
- {
- Shuttle->m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- m_nDistance = this->m_Data.m_nDistance;
- v13 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMoveToTarget(v13, v6, m_nDistance);
- LABEL_76:
- v15 = 0;
- goto LABEL_77;
- }
- }
- if ( this->m_MoveToTargetType )
- TargetDestination = CMoveToTargetActionBase::GetTargetDestination(this, &v106, Shuttle, v6);
- else
- TargetDestination = v6->GetMeleeAttackPosition(v6, &v105, Shuttle);
- FVector::operator=(&result, TargetDestination);
- if ( Shuttle->IsInVehicle(Shuttle) || Shuttle->IsInAirShip(Shuttle) || Shuttle->IsInShuttle(Shuttle) )
- {
- v79 = this->m_Data.m_nDistance;
- v80 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMoveToTarget(v80, v6, v79);
- this->m_nTick = 800;
- this->AddTimer(this, 800, 0, 0);
- v15 = 1;
- goto LABEL_77;
- }
- v15 = 1;
- if ( Shuttle->m_data->m_moveType != CMT_FLY )
- {
- if ( !Shuttle->IsCameraMode(Shuttle) )
- {
- if ( !Shuttle->IsPC(Shuttle) )
- {
- v23 = !v6->IsCreature(v6);
- v59 = v6->__vftable;
- if ( v23 )
- {
- v63 = v59->GetPos(v6, &v112);
- FVector::FVector(&v113, &vFrom);
- v62 = (unsigned int)CPathNodeWorld::PathFind(&g_pnWorld, v64, v63, &result, 0x3E8u);
- r = v62;
- }
- else
- {
- v60 = v59->CastCreature(v6);
- PassingPosOnSight = CCreature::GetPassingPosOnSight(v60, &v111, &vFrom, &result, &r, Shuttle);
- FVector::operator=(&result, PassingPosOnSight);
- v62 = r;
- }
- v23 = v62 == PFR_ERROR;
- m_data = Shuttle->m_data;
- if ( v23 )
- {
- m_data->m_bMoveTrouble = 1;
- ++Shuttle->m_data->m_dwPathFindFailCount;
- }
- else
- {
- m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- if ( g_bMoveToLeader )
- {
- v67 = v6->CastCreature(v6);
- if ( v67 )
- {
- if ( CCreature::IsValidAttackLeaderCandidate(Shuttle, v66) )
- {
- CCreature::GetMyPositionFrom(Shuttle, v67);
- CCreature::SetAttackLeaderRelated(v67, Shuttle, 0i64);
- }
- }
- }
- }
- p_m_nTick = &this->m_nTick;
- p_m_vMidDest = &this->m_vMidDest;
- FVector::FVector(&v114, &result);
- CMoveActionBase::CalcMidDest(
- this,
- &vFrom,
- v70,
- v8.m128d_f64[0],
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- &v119,
- 0,
- Shuttle);
- v86[0].Yaw = (int)(atan2(this->m_vMidDest.y - vFrom.y, this->m_vMidDest.x - vFrom.x)
- * 65535.0
- / 6.283185307179586);
- CSharedObject::SetDir(Shuttle->m_data, v86);
- if ( (g_CheckCollisionForNPCMove || Shuttle->IsPet(Shuttle)) && !Shuttle->m_data->m_bPassableDoor )
- {
- v71 = Shuttle->GetInZoneID(Shuttle);
- v72 = Shuttle->GetCollisionRadius(Shuttle);
- v7 = CWorldPlaneCollision::CheckCollision(
- &g_WorldPlaneCollision,
- &vFrom,
- &this->m_vMidDest,
- v72,
- &this->m_vMidDest,
- v71,
- 0);
- }
- Shuttle->GetContainerIndex(Shuttle);
- CContainerDB::Inst();
- CContainerDB::Inst();
- v117 = 0;
- memset(v118, 0, sizeof(v118));
- v121 = 0;
- v94 = 0i64;
- v93 = 0i64;
- memset(&v95, 0, sizeof(v95));
- v92 = 800;
- FVector::operator=(&v95, p_m_vMidDest);
- FVector::operator=(p_m_vMidDest, &v95);
- v73 = &v92;
- if ( v92 >= *p_m_nTick )
- v73 = &this->m_nTick;
- *p_m_nTick = *v73;
- v121 = 700;
- v74 = &v121;
- if ( *p_m_nTick >= 700 )
- v74 = &this->m_nTick;
- *p_m_nTick = *v74;
- v75 = Shuttle->GetController(Shuttle);
- p_result = &this->m_vMidDest;
- if ( !v7 )
- p_result = &result;
- CCreatureController::ActionBroadcastMove(v75, &vFrom, p_result);
- FVector::operator=(&Shuttle->m_vMovingDest, p_m_vMidDest);
- Shuttle->m_bMoving = 1;
- v77 = this->m_vMidDest.z - vFrom.z;
- v78 = this->m_vMidDest.y - vFrom.y;
- v102.x = p_m_vMidDest->x - vFrom.x;
- v102.y = v78;
- v102.z = v77;
- FVector::operator=(&Shuttle->m_vMovingDirection, &v102);
- Shuttle->m_nMoveTick = *p_m_nTick;
- Shuttle->m_nLastTick = GetTickCount();
- this->m_bPathFinding = 1;
- this->m_bMoving = 1;
- m_nTick = (unsigned int)*p_m_nTick;
- goto LABEL_28;
- }
- v16 = &this->m_nTick;
- v46 = &this->m_vMidDest;
- FVector::FVector(&v109, &result);
- CMoveActionBase::CalcMidDest(
- this,
- &vFrom,
- v47,
- v8.m128d_f64[0],
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- &v119,
- 0,
- Shuttle);
- v85.Yaw = (int)(atan2(this->m_vMidDest.y - vFrom.y, this->m_vMidDest.x - vFrom.x) * 65535.0 / 6.283185307179586);
- CSharedObject::SetDir(Shuttle->m_data, &v85);
- v49 = Shuttle->GetInZoneID(Shuttle);
- v48 = Shuttle->GetCollisionRadius(Shuttle);
- LOBYTE(v49) = CWorldPlaneCollision::CheckCollision(
- &g_WorldPlaneCollision,
- &vFrom,
- &this->m_vMidDest,
- v48,
- &this->m_vMidDest,
- v49,
- 0);
- r = v49;
- Shuttle->GetContainerIndex(Shuttle);
- CContainerDB::Inst();
- CContainerDB::Inst();
- v115 = 0;
- memset(v116, 0, sizeof(v116));
- v121 = 0;
- if ( v119 && !(_BYTE)v49 )
- {
- v90 = 0i64;
- v89 = 0i64;
- memset(&v91, 0, sizeof(v91));
- v88 = 800;
- FVector::operator=(&v91, v46);
- if ( !this->m_bMoving )
- {
- FVector::operator=(v46, &v91);
- v50 = &v88;
- if ( v88 >= *v16 )
- v50 = &this->m_nTick;
- *v16 = *v50;
- v23 = !v6->IsItem(v6);
- v51 = Shuttle->__vftable;
- if ( v23 )
- {
- v54 = this->m_Data.m_nDistance;
- v55 = v51->GetController(Shuttle);
- CCreatureController::ActionBroadcastMoveToTarget(v55, v6, v54);
- v53 = v6->GetPos(v6, &v110);
- }
- else
- {
- v52 = v51->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v52, &vFrom, &result);
- v53 = &result;
- }
- FVector::operator=(&Shuttle->m_vMovingDest, v53);
- this->m_bMoving = 1;
- }
- Shuttle->m_bMoving = 1;
- *(double *)v100 = v91.x - vFrom.x;
- *(double *)&v100[1] = v91.y - vFrom.y;
- *(double *)&v100[2] = v91.z - vFrom.z;
- p_v = (FVector *)v100;
- goto LABEL_24;
- }
- v56 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v56, &vFrom, v46);
- FVector::operator=(&Shuttle->m_vMovingDest, v46);
- v57 = this->m_vMidDest.z - vFrom.z;
- v58 = this->m_vMidDest.y - vFrom.y;
- *(double *)v101 = v46->x - vFrom.x;
- *(long double *)&v101[1] = v58;
- *(long double *)&v101[2] = v57;
- v35 = (FVector *)v101;
- LABEL_26:
- FVector::operator=(&Shuttle->m_vMovingDirection, v35);
- Shuttle->m_bMoving = 1;
- *v16 = 800;
- goto LABEL_27;
- }
- v8.m128d_f64[0] = v8.m128d_f64[0] * 800.0 / 1000.0;
- v37 = _mm_unpacklo_pd(v8, v8);
- if ( (vFrom.y - result.y) * (vFrom.y - result.y)
- + (vFrom.x - result.x) * (vFrom.x - result.x)
- + (vFrom.z - result.z) * (vFrom.z - result.z) >= 10.0 )
- {
- v87.x = result.x - vFrom.x;
- v87.y = result.y - vFrom.y;
- v87.z = result.z - vFrom.z;
- FVector::NormalizeCube(&v87);
- *(__m128d *)&v98.x = _mm_mul_pd(*(__m128d *)&v87.x, v37);
- v98.z = v87.z * v37.m128d_f64[0];
- FVector::operator=(&v87, &v98);
- v38 = (vFrom.y - result.y) * (vFrom.y - result.y)
- + (vFrom.x - result.x) * (vFrom.x - result.x)
- + (vFrom.z - result.z) * (vFrom.z - result.z);
- if ( v37.m128d_f64[0] > v38 )
- {
- this->m_bArrived = 1;
- this->m_nTick = (int)(sqrt(v38) / v37.m128d_f64[0] * 800.0);
- FVector::operator=(&this->m_vMidDest, &result);
- goto LABEL_37;
- }
- this->m_bArrived = 0;
- this->m_nTick = 800;
- v99.x = v87.x + vFrom.x;
- v99.y = v87.y + vFrom.y;
- v99.z = v87.z + vFrom.z;
- FVector::operator=(&this->m_vMidDest, &v99);
- if ( Shuttle->m_AreaMod.m_bIsUnderWater )
- goto LABEL_37;
- v39 = CWorld::Inst();
- z = (int)this->m_vMidDest.z;
- v41 = v39->GetGeo(v39);
- Ground = CGeoData::FindGround(v41, (int)this->m_vMidDest.x, (int)this->m_vMidDest.y, (int)this->m_vMidDest.z);
- if ( abs(Ground - z) >= 100 )
- goto LABEL_37;
- }
- else
- {
- FVector::operator=(&this->m_vMidDest, &vFrom);
- this->m_nTick = 80;
- }
- this->m_bArrived = 1;
- LABEL_37:
- if ( v6->IsItem(v6) || v6->IsStaticObject(v6) )
- {
- if ( !this->m_bMoving )
- {
- v45 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v45, &vFrom, &result);
- FVector::operator=(&Shuttle->m_vMovingDest, &result);
- }
- }
- else
- {
- v43 = this->m_Data.m_nDistance;
- v44 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMoveToTarget(v44, v6, v43);
- }
- this->m_bMoving = 1;
- m_nTick = (unsigned int)this->m_nTick;
- goto LABEL_28;
- }
- v16 = &this->m_nTick;
- v17 = &this->m_vMidDest;
- FVector::FVector(&v107, &result);
- CMoveActionBase::CalcMidDest(
- this,
- &vFrom,
- v18,
- v8.m128d_f64[0],
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- &v119,
- 0,
- Shuttle);
- a[0].Yaw = (int)(atan2(this->m_vMidDest.y - vFrom.y, this->m_vMidDest.x - vFrom.x) * 65535.0 / 6.283185307179586);
- CSharedObject::SetDir(Shuttle->m_data, a);
- nInstantZoneID = Shuttle->GetInZoneID(Shuttle);
- v20 = Shuttle->GetCollisionRadius(Shuttle);
- v21 = CWorldPlaneCollision::CheckCollision(
- &g_WorldPlaneCollision,
- &vFrom,
- &this->m_vMidDest,
- v20,
- &this->m_vMidDest,
- nInstantZoneID,
- 0);
- if ( !v119 || v21 )
- {
- v32 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v32, &vFrom, &this->m_vMidDest);
- FVector::operator=(&Shuttle->m_vMovingDest, &this->m_vMidDest);
- v33 = this->m_vMidDest.z - vFrom.z;
- v34 = this->m_vMidDest.y - vFrom.y;
- v97.x = v17->x - vFrom.x;
- v97.y = v34;
- v97.z = v33;
- v35 = &v97;
- goto LABEL_26;
- }
- if ( !this->m_bMoving )
- {
- v22 = &this->m_nTick;
- if ( *v16 > 800 )
- v22 = (int *)&CMoveActionBase::MoveTick;
- *v16 = *v22;
- v23 = CSmartID::GetItem(&this->m_spTarget) == 0i64;
- v24 = Shuttle->__vftable;
- if ( v23 )
- {
- v27 = this->m_Data.m_nDistance;
- v28 = v24->GetController(Shuttle);
- CCreatureController::ActionBroadcastMoveToTarget(v28, v6, v27);
- v26 = v6->GetPos(v6, &v108);
- }
- else
- {
- v25 = v24->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v25, &vFrom, &result);
- v26 = &result;
- }
- FVector::operator=(&Shuttle->m_vMovingDest, v26);
- this->m_bMoving = 1;
- }
- Shuttle->m_bMoving = 1;
- v29 = this->m_vMidDest.z - vFrom.z;
- v30 = this->m_vMidDest.y - vFrom.y;
- v.x = v17->x - vFrom.x;
- v.y = v30;
- v.z = v29;
- p_v = &v;
- LABEL_24:
- FVector::operator=(&Shuttle->m_vMovingDirection, p_v);
- Shuttle->m_nLastTick = GetTickCount();
- Shuttle->m_nMoveTick = *v16;
- LABEL_27:
- m_nTick = (unsigned int)*v16;
- LABEL_28:
- this->AddTimer(this, m_nTick, 0, 0);
- LABEL_77:
- CTimer::EndJob(&g_Timer, &JOB_NEWACTION__MOVETOTARGET_SETMOVING);
- return v15;
- }
- //----- (000000000077C518) ----------------------------------------------------
- char __fastcall CMoveAction::SetMoving(CMoveAction *this)
- {
- __int64 ThreadID; // rbx
- __int64 m_nID; // rdi
- CCreature *Shuttle; // r12
- char v5; // r13
- char v6; // al
- double v7; // xmm7_8
- FVector *v8; // rax
- FVector *v9; // rax
- FVector *v10; // rbx
- FVector *v11; // rax
- int v12; // eax
- FVector *v13; // rax
- FVector *v14; // rbx
- const FVector *v15; // rax
- FVector *v16; // rax
- FVector *v17; // rbx
- const FVector *v18; // rax
- FVector *v19; // rax
- FVector *v20; // rbx
- const FVector *v21; // rax
- FVector *v22; // rax
- FVector *p_m_vMidDest; // rdi
- double v24; // xmm0_8
- unsigned int nInstantZoneID; // ebx
- int *p_m_nTick; // rcx
- CCreature_vtbl *v27; // rax
- CCreatureController *v28; // rax
- FVector *p_v; // rdx
- CCreatureController *v30; // rax
- long double v31; // xmm2_8
- long double v32; // xmm1_8
- FVector vStart; // [rsp+58h] [rbp-B0h] BYREF
- FAngle a[2]; // [rsp+70h] [rbp-98h] BYREF
- FVector v; // [rsp+78h] [rbp-90h] BYREF
- CCreature *v37; // [rsp+A0h] [rbp-68h]
- int v38; // [rsp+ACh] [rbp-5Ch] BYREF
- __int64 v39; // [rsp+B8h] [rbp-50h]
- __int128 v40; // [rsp+C0h] [rbp-48h]
- FVector v41; // [rsp+D0h] [rbp-38h] BYREF
- FVector v42; // [rsp+E8h] [rbp-20h] BYREF
- __int64 v43; // [rsp+100h] [rbp-8h]
- JOB *v44; // [rsp+108h] [rbp+0h]
- FVector v45; // [rsp+110h] [rbp+8h] BYREF
- FVector v46; // [rsp+128h] [rbp+20h] BYREF
- FVector v47; // [rsp+140h] [rbp+38h] BYREF
- FVector v48; // [rsp+158h] [rbp+50h] BYREF
- FVector v49; // [rsp+170h] [rbp+68h] BYREF
- FVector v50; // [rsp+188h] [rbp+80h] BYREF
- FVector v51; // [rsp+1A0h] [rbp+98h] BYREF
- FVector v52; // [rsp+1B8h] [rbp+B0h] BYREF
- FVector v53; // [rsp+1D0h] [rbp+C8h] BYREF
- FVector v54; // [rsp+1E8h] [rbp+E0h] BYREF
- int v55; // [rsp+208h] [rbp+100h]
- char v56[2048]; // [rsp+210h] [rbp+108h] BYREF
- char v57; // [rsp+A90h] [rbp+988h] BYREF
- bool v58; // [rsp+A98h] [rbp+990h] BYREF
- unsigned int v59; // [rsp+AA0h] [rbp+998h]
- v43 = -2i64;
- v44 = &JOB_NEWACTION__MOVE_SETMOVING;
- ThreadID = (int)CThreadManager::GetThreadID();
- m_nID = JOB_NEWACTION__MOVE_SETMOVING.m_nID;
- g_Timer.m_EachJobBeginTimes[ThreadID]._Mypair._Myval2._Myfirst[m_nID] = GetTickCount();
- Shuttle = (CCreature *)CSmartID::GetShuttle((__crt_locale_data *)&this->m_spActor);
- v37 = Shuttle;
- if ( Shuttle->IsInVehicle(Shuttle) || Shuttle->IsInAirShip(Shuttle) || Shuttle->IsInShuttle(Shuttle) )
- {
- v6 = CMoveAction::SetMovingRelativeImpl(this);
- goto LABEL_45;
- }
- v5 = 1;
- if ( Shuttle->m_data->m_moveType == CMT_FLY )
- {
- v6 = CMoveAction::SetMovingFlyingImpl(this);
- LABEL_45:
- v5 = v6;
- goto LABEL_46;
- }
- if ( Shuttle->IsCameraMode(Shuttle) )
- {
- v6 = CMoveAction::SetMovingCameraModeImpl(this);
- goto LABEL_45;
- }
- FVector::FVector(&vStart, &Shuttle->m_data->m_Pos);
- v7 = Shuttle->m_data->m_dParam[11];
- memset(&v, 0, sizeof(v));
- v57 = 1;
- if ( g_bUserPathFind && this->m_bPathFind )
- {
- if ( this->m_bPathFinding
- && (vStart.x - this->m_vPathFindMidDest.x) * (vStart.x - this->m_vPathFindMidDest.x)
- + (vStart.y - this->m_vPathFindMidDest.y) * (vStart.y - this->m_vPathFindMidDest.y) > 1.0 )
- {
- Shuttle->m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- FVector::FVector(&v45, &this->m_vPathFindMidDest);
- CMoveActionBase::CalcMidDest(
- this,
- &vStart,
- v8,
- v7,
- &this->m_vMidDest,
- &this->m_nTick,
- &v58,
- (bool *)&v57,
- 0,
- Shuttle);
- }
- else
- {
- FVector::FVector(&v46, &this->m_vDest);
- v10 = v9;
- v11 = Shuttle->GetPos(Shuttle, &v47);
- v12 = CPathNodeWorld::PathFind(&g_pnWorld, v11, v10, &v, 0x190u);
- if ( v12 )
- {
- if ( v12 == 1 )
- {
- this->m_bPathFinding = 1;
- Shuttle->m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- FVector::operator=(&this->m_vPathFindMidDest, &v);
- FVector::FVector(&v50, &v);
- v17 = v16;
- v18 = Shuttle->GetPos(Shuttle, &v51);
- CMoveActionBase::CalcMidDest(
- this,
- v18,
- v17,
- v7,
- &this->m_vMidDest,
- &this->m_nTick,
- &v58,
- (bool *)&v57,
- 0,
- Shuttle);
- this->m_bResetDest = 1;
- }
- else if ( v12 == 2 )
- {
- FVector::FVector(&v52, &this->m_vDest);
- v20 = v19;
- v21 = Shuttle->GetPos(Shuttle, &v53);
- CMoveActionBase::CalcMidDest(
- this,
- v21,
- v20,
- v7,
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- (bool *)&v57,
- 0,
- Shuttle);
- *(_WORD *)&this->m_bPathFinding = 256;
- Shuttle->m_data->m_bMoveTrouble = 1;
- ++Shuttle->m_data->m_dwPathFindFailCount;
- }
- }
- else
- {
- FVector::FVector(&v48, &this->m_vDest);
- v14 = v13;
- v15 = Shuttle->GetPos(Shuttle, &v49);
- CMoveActionBase::CalcMidDest(
- this,
- v15,
- v14,
- v7,
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- (bool *)&v57,
- 0,
- Shuttle);
- if ( this->m_bPathFinding )
- this->m_bResetDest = 1;
- this->m_bPathFinding = 0;
- Shuttle->m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- }
- }
- }
- else
- {
- FVector::FVector(&v54, &this->m_vDest);
- CMoveActionBase::CalcMidDest(
- this,
- &vStart,
- v22,
- v7,
- &this->m_vMidDest,
- &this->m_nTick,
- &this->m_bArrived,
- (bool *)&v57,
- 0,
- Shuttle);
- }
- p_m_vMidDest = &this->m_vMidDest;
- nInstantZoneID = Shuttle->GetInZoneID(Shuttle);
- v24 = Shuttle->GetCollisionRadius(Shuttle);
- LOBYTE(nInstantZoneID) = CWorldPlaneCollision::CheckCollision(
- &g_WorldPlaneCollision,
- &vStart,
- &this->m_vMidDest,
- v24,
- &this->m_vMidDest,
- nInstantZoneID,
- 0);
- v59 = nInstantZoneID;
- Shuttle->GetContainerIndex(Shuttle);
- CContainerDB::Inst();
- CContainerDB::Inst();
- v55 = 0;
- memset(v56, 0, sizeof(v56));
- if ( !v57 || (_BYTE)nInstantZoneID )
- {
- FVector::operator=(&this->m_vDest, p_m_vMidDest);
- *(_WORD *)&this->m_bPathFinding = 256;
- this->m_bArrived = 1;
- }
- v40 = 0i64;
- v39 = 0i64;
- memset(&v41, 0, sizeof(v41));
- v38 = 800;
- FVector::operator=(&v41, p_m_vMidDest);
- if ( this->m_bResetDest )
- {
- if ( (vStart.x - this->m_vDest.x) * (vStart.x - this->m_vDest.x)
- + (vStart.y - this->m_vDest.y) * (vStart.y - this->m_vDest.y)
- + (vStart.z - this->m_vDest.z) * (vStart.z - this->m_vDest.z) <= 0.1 )
- {
- Shuttle->ActionFailed(Shuttle, 1);
- }
- else
- {
- FVector::operator=(p_m_vMidDest, &v41);
- p_m_nTick = &v38;
- if ( v38 >= this->m_nTick )
- p_m_nTick = &this->m_nTick;
- this->m_nTick = *p_m_nTick;
- v27 = Shuttle->__vftable;
- if ( this->m_bPathFinding )
- {
- v28 = v27->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v28, &vStart, &v);
- p_v = &v;
- }
- else
- {
- v30 = v27->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v30, &vStart, &this->m_vDest);
- p_v = &this->m_vDest;
- }
- FVector::operator=(&Shuttle->m_vMovingDest, p_v);
- }
- this->m_bResetDest = 0;
- }
- if ( !this->m_bPathFinding
- && v7 * 800.0 / 1000.0 > sqrt(
- (this->m_vDest.x - vStart.x) * (this->m_vDest.x - vStart.x)
- + (this->m_vDest.y - vStart.y) * (this->m_vDest.y - vStart.y)
- + (this->m_vDest.z - vStart.z) * (this->m_vDest.z - vStart.z)) )
- {
- this->m_bArrived = 1;
- }
- v31 = this->m_vMidDest.z - vStart.z;
- v32 = this->m_vMidDest.y - vStart.y;
- v42.x = p_m_vMidDest->x - vStart.x;
- v42.y = v32;
- v42.z = v31;
- FVector::operator=(&Shuttle->m_vMovingDirection, &v42);
- if ( fabs(Shuttle->m_vMovingDirection.x) >= 0.000009999999747378752
- || fabs(Shuttle->m_vMovingDirection.y) >= 0.000009999999747378752
- || fabs(Shuttle->m_vMovingDirection.z) >= 0.000009999999747378752 )
- {
- a[0].Yaw = (int)(atan2(Shuttle->m_vMovingDirection.y, Shuttle->m_vMovingDirection.x) * 65535.0 / 6.283185307179586);
- CSharedObject::SetDir(Shuttle->m_data, a);
- }
- Shuttle->m_bMoving = 1;
- Shuttle->m_nLastTick = GetTickCount();
- Shuttle->m_nMoveTick = this->m_nTick;
- this->AddTimer(this, this->m_nTick, 0, 0);
- LABEL_46:
- CTimer::EndJob(&g_Timer, &JOB_NEWACTION__MOVE_SETMOVING);
- return v5;
- }
- //----- (000000000077A128) ----------------------------------------------------
- void __fastcall CMoveToTargetAction::OnEnd(CMoveToTargetAction *this, bool bFinishedWell)
- {
- __int64 ThreadID; // rbx
- __int64 m_nID; // rdi
- CCreature *Shuttle; // rsi
- double v7; // xmm2_8
- signed int v8; // edx
- double *v9; // rcx
- double *v10; // rax
- double v11; // xmm1_8
- double v12; // xmm2_8
- double v13; // xmm0_8
- double *m_data; // rax
- long double v15; // xmm2_8
- long double v16; // xmm0_8
- FVector *p_vTo; // rdx
- FVector *v18; // rcx
- signed int v19; // eax
- double *v20; // rcx
- double *v21; // rax
- double v22; // xmm1_8
- double v23; // xmm2_8
- double v24; // xmm0_8
- double *v25; // rax
- long double v26; // xmm2_8
- long double v27; // xmm0_8
- CAreaDB *v28; // rbx
- CAreaDB_vtbl *v29; // rdi
- unsigned int v30; // eax
- CSharedCreatureData *v31; // rax
- double z; // xmm2_8
- CWorld *v33; // rax
- CGeoData *v34; // rax
- CWorld *v35; // rax
- CGeoData *v36; // rax
- int v37; // eax
- double *v38; // rax
- long double v39; // xmm0_8
- CWorld *v40; // rax
- CSharedCreatureData *v41; // rbx
- CGeoData *v42; // rax
- CSharedCreatureData *v43; // rbx
- CCreatureController *v44; // rax
- FVector *v45; // rax
- FVector *v46; // rbx
- CWorld *v47; // rax
- __int64 m_nSkillId; // r8
- FVector vTo; // [rsp+38h] [rbp-79h] BYREF
- __int64 v50; // [rsp+50h] [rbp-61h] BYREF
- double v51; // [rsp+58h] [rbp-59h] BYREF
- long double v52; // [rsp+60h] [rbp-51h] BYREF
- __int64 v53; // [rsp+68h] [rbp-49h] BYREF
- __int64 v54[5]; // [rsp+70h] [rbp-41h] BYREF
- char v55; // [rsp+98h] [rbp-19h] BYREF
- FVector v56; // [rsp+B0h] [rbp-1h] BYREF
- char v57; // [rsp+118h] [rbp+67h] BYREF
- double v58; // [rsp+128h] [rbp+77h] BYREF
- long double v59; // [rsp+130h] [rbp+7Fh] BYREF
- v54[3] = -2i64;
- CMoveActionBase::OnEnd(this, bFinishedWell);
- v54[4] = (__int64)&JOB_NEWACTION__MOVETOTARGET_ONEND;
- ThreadID = (int)CThreadManager::GetThreadID();
- m_nID = JOB_NEWACTION__MOVETOTARGET_ONEND.m_nID;
- g_Timer.m_EachJobBeginTimes[ThreadID]._Mypair._Myval2._Myfirst[m_nID] = GetTickCount();
- Shuttle = (CCreature *)CSmartID::GetShuttle((__crt_locale_data *)&this->m_spActor);
- if ( !Shuttle->IsInVehicle(Shuttle)
- && !Shuttle->IsInAirShip(Shuttle)
- && !Shuttle->IsInShuttle(Shuttle)
- && !Shuttle->IsCameraMode(Shuttle)
- && !bFinishedWell )
- {
- v7 = Shuttle->m_vMovingDirection.x * Shuttle->m_vMovingDirection.x
- + Shuttle->m_vMovingDirection.y * Shuttle->m_vMovingDirection.y
- + Shuttle->m_vMovingDirection.z * Shuttle->m_vMovingDirection.z;
- if ( Shuttle->m_data->m_moveType == CMT_FLY && v7 < 250000.0 )
- {
- v8 = GetTickCount() - Shuttle->m_nLastTick;
- if ( v8 >= 0 )
- {
- if ( v8 > 800 )
- v8 = 800;
- }
- else
- {
- v8 = 0;
- }
- if ( !Shuttle->m_nMoveTick )
- Shuttle->m_nMoveTick = 1;
- v58 = (double)v8 / (double)(int)Shuttle->m_nMoveTick;
- v59 = DOUBLE_1_0;
- v50 = 0i64;
- v9 = &v58;
- if ( v58 >= 1.0 )
- v9 = &v59;
- v10 = (double *)&v50;
- if ( *v9 > 0.0 )
- v10 = v9;
- v11 = *v10;
- v12 = *v10;
- v13 = *v10;
- m_data = (double *)Shuttle->m_data;
- v15 = v12 * Shuttle->m_vMovingDirection.z + m_data[3];
- v16 = v13 * Shuttle->m_vMovingDirection.y + m_data[2];
- *(double *)v54 = v11 * Shuttle->m_vMovingDirection.x + m_data[1];
- *(long double *)&v54[1] = v16;
- *(long double *)&v54[2] = v15;
- p_vTo = (FVector *)v54;
- v18 = (FVector *)&v55;
- LABEL_43:
- FVector::FVector(v18, p_vTo);
- v46 = v45;
- v47 = CWorld::Inst();
- CWorld::MoveTo(v47, Shuttle, v46, 0);
- goto LABEL_44;
- }
- if ( v7 < 90000.0 )
- {
- v19 = GetTickCount() - Shuttle->m_nLastTick;
- if ( !Shuttle->m_nMoveTick )
- Shuttle->m_nMoveTick = 1;
- v51 = (double)v19 / (double)(int)Shuttle->m_nMoveTick;
- v52 = DOUBLE_1_0;
- v53 = 0i64;
- v20 = &v51;
- if ( v51 >= 1.0 )
- v20 = &v52;
- v21 = (double *)&v53;
- if ( *v20 > 0.0 )
- v21 = v20;
- v22 = *v21;
- v23 = *v21;
- v24 = *v21;
- v25 = (double *)Shuttle->m_data;
- v26 = v23 * Shuttle->m_vMovingDirection.z + v25[3];
- v27 = v24 * Shuttle->m_vMovingDirection.y + v25[2];
- vTo.x = v22 * Shuttle->m_vMovingDirection.x + v25[1];
- vTo.y = v27;
- vTo.z = v26;
- if ( !Shuttle->m_AreaMod.m_bIsUnderWater )
- {
- if ( !Shuttle->m_AreaMod.m_bIsNearUnderWater
- || (v28 = Singleton<CAreaDB>::inst(),
- v29 = v28->__vftable,
- v30 = Shuttle->GetInZoneID(Shuttle),
- !v29->IsUnderWater(v28, &vTo, (int *)&v57, v30)) )
- {
- Shuttle->m_bFloatingMoveMode = 0;
- v31 = Shuttle->m_data;
- z = v31->m_Pos.z;
- if ( z <= this->m_vMidDest.z )
- z = this->m_vMidDest.z;
- vTo.z = z;
- if ( v31->m_moveType == CMT_FLY )
- goto LABEL_36;
- v33 = CWorld::Inst();
- v34 = v33->GetGeo(v33);
- z = (double)(int)CGeoData::FindNearGround(v34, (int)vTo.x, (int)vTo.y, (int)vTo.z);
- LABEL_35:
- vTo.z = z;
- LABEL_36:
- v38 = (double *)Shuttle->m_data;
- v39 = sqrt(
- (vTo.x - v38[1]) * (vTo.x - v38[1])
- + (vTo.y - v38[2]) * (vTo.y - v38[2])
- + (z - v38[3]) * (z - v38[3]));
- v40 = CWorld::Inst();
- v41 = Shuttle->m_data;
- v42 = v40->GetGeo(v40);
- if ( !CGeoData::MoveStraightTest(v42, &v41->m_Pos, &vTo, v39, 0, 0) )
- FVector::operator=(&vTo, &Shuttle->m_data->m_Pos);
- if ( Shuttle->m_SkillMod.m_nBlockMoveCount || !Shuttle->m_data->m_bCanMove || !Shuttle->m_SkillMod.m_bCanAct )
- {
- v43 = Shuttle->m_data;
- v44 = Shuttle->GetController(Shuttle);
- CCreatureController::ActionBroadcastMove(v44, &v43->m_Pos, &vTo);
- }
- p_vTo = &vTo;
- v18 = &v56;
- goto LABEL_43;
- }
- Shuttle->m_bFloatingMoveMode = 1;
- }
- v35 = CWorld::Inst();
- v36 = v35->GetGeo(v35);
- v37 = CGeoData::FindNearGround(v36, (int)vTo.x, (int)vTo.y, (int)vTo.z);
- z = fmax(vTo.z, (double)v37);
- goto LABEL_35;
- }
- }
- LABEL_44:
- if ( Shuttle->m_SkillMod.m_nBlockMoveCount || !Shuttle->m_data->m_bCanMove || !Shuttle->m_SkillMod.m_bCanAct )
- {
- m_nSkillId = (unsigned int)this->m_Data.m_nSkillId;
- if ( (_DWORD)m_nSkillId )
- Shuttle->OnUseSkillFinished(
- Shuttle,
- Shuttle->m_spTarget.sid,
- m_nSkillId,
- this->m_nSkillLevel,
- this->m_nSkillSubLevel,
- 0);
- Shuttle->m_data->m_bMoveTrouble = 0;
- }
- Shuttle->ActionFailed(Shuttle, 0);
- if ( Shuttle->m_SkillMod.m_nBlockMoveCount || !Shuttle->m_data->m_bCanMove || !Shuttle->m_SkillMod.m_bCanAct )
- {
- Shuttle->m_data->m_bMoveTrouble = 0;
- Shuttle->m_data->m_dwPathFindFailCount = 0;
- }
- Shuttle->m_data->m_MovingStatus = MSTE_NOT_MOVING;
- Shuttle->m_bMoving = 0;
- CTimer::EndJob(&g_Timer, &JOB_NEWACTION__MOVETOTARGET_ONEND);
- }
- void __fastcall CMoveAction::OnEnd(CMoveAction *this, bool bFinishedWell)
- {
- __int64 ThreadID; // rbx
- __int64 m_nID; // rdi
- __int64 Shuttle; // rax
- CCreature *v7; // r14
- double v8; // xmm6_8
- signed int v9; // edx
- double *v10; // rcx
- double *v11; // rax
- double v12; // xmm1_8
- double v13; // xmm2_8
- double v14; // xmm0_8
- double *m_data; // rax
- long double v16; // xmm2_8
- long double v17; // xmm0_8
- FVector *p_vTo; // rdx
- char *v19; // rcx
- signed int v20; // ebx
- double *v21; // rcx
- double *v22; // rax
- double v23; // xmm1_8
- double v24; // xmm2_8
- double v25; // xmm0_8
- double *v26; // rax
- long double v27; // xmm2_8
- long double v28; // xmm0_8
- signed int v29; // edx
- double *v30; // rcx
- double *v31; // rax
- double v32; // xmm1_8
- double v33; // xmm2_8
- double v34; // xmm0_8
- double *v35; // rax
- double z; // xmm2_8
- long double v37; // xmm0_8
- char bIsFloating; // di
- int nSurfaceHeight; // esi
- CAreaDB *v40; // rbx
- unsigned __int8 (__fastcall **p_IsUnderWater)(CAreaDB *, FVector *, char *, _QWORD); // rdi
- unsigned int v42; // eax
- CWorld *v43; // rax
- CGeoData *v44; // rax
- int v45; // eax
- CSharedCreatureData *v46; // rax
- CWorld *v47; // rax
- CGeoData *v48; // rax
- double *v49; // rax
- long double v50; // xmm0_8
- CWorld *v51; // rax
- CSharedCreatureData *v52; // rbx
- CGeoData *v53; // rax
- CSharedCreatureData *v54; // rbx
- CCreatureController *v55; // rax
- ActionType m_eInterruptActionType; // ebx
- CSharedCreatureData *v57; // rbx
- CCreatureController *v58; // rax
- FVector *v59; // rax
- FVector *v60; // rbx
- CWorld *v61; // rax
- CAreaDB *v62; // rdi
- CAreaDB_vtbl *v63; // rsi
- unsigned int v64; // ebx
- __int64 v65; // rax
- FVector vTo; // [rsp+30h] [rbp-D0h] BYREF
- long double v67; // [rsp+48h] [rbp-B8h] BYREF
- __int64 v68; // [rsp+50h] [rbp-B0h] BYREF
- double v69; // [rsp+58h] [rbp-A8h] BYREF
- long double v70; // [rsp+60h] [rbp-A0h] BYREF
- __int64 v71; // [rsp+68h] [rbp-98h] BYREF
- double v72; // [rsp+70h] [rbp-90h] BYREF
- long double v73; // [rsp+78h] [rbp-88h] BYREF
- __int64 v74; // [rsp+80h] [rbp-80h] BYREF
- __int64 v75[3]; // [rsp+88h] [rbp-78h] BYREF
- __int64 v76[5]; // [rsp+A0h] [rbp-60h] BYREF
- FVector v; // [rsp+C8h] [rbp-38h] BYREF
- char v78; // [rsp+E0h] [rbp-20h] BYREF
- char v79; // [rsp+F8h] [rbp-8h] BYREF
- FVector v80; // [rsp+110h] [rbp+10h] BYREF
- char v81; // [rsp+128h] [rbp+28h] BYREF
- char v82; // [rsp+1A0h] [rbp+A0h] BYREF
- char v83; // [rsp+1B0h] [rbp+B0h] BYREF
- double v84; // [rsp+1B8h] [rbp+B8h] BYREF
- v76[3] = -2i64;
- CMoveActionBase::OnEnd(this, bFinishedWell);
- v76[4] = (__int64)&JOB_NEWACTION__MOVE_ONEND;
- ThreadID = (int)CThreadManager::GetThreadID();
- m_nID = JOB_NEWACTION__MOVE_ONEND.m_nID;
- g_Timer.m_EachJobBeginTimes[ThreadID]._Mypair._Myval2._Myfirst[m_nID] = GetTickCount();
- Shuttle = CSmartID::GetShuttle((__crt_locale_data *)&this->m_spActor);
- v7 = (CCreature *)Shuttle;
- if ( !Shuttle )
- {
- CTimer::EndJob(&g_Timer, &JOB_NEWACTION__MOVE_ONEND);
- return;
- }
- if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)Shuttle + 1024i64))(Shuttle)
- && !v7->IsInAirShip(v7)
- && !v7->IsInShuttle(v7)
- && !v7->IsCameraMode(v7) )
- {
- if ( bFinishedWell )
- {
- if ( !v7->m_AreaMod.m_bIsUnderWater )
- v7->m_bFloatingMoveMode = v7->m_AreaMod.m_bIsNearUnderWater
- && (v62 = Singleton<CAreaDB>::inst(),
- v63 = v62->__vftable,
- v64 = v7->GetInZoneID(v7),
- v65 = (__int64)v7->GetPos(v7, (FVector *)&v81),
- v63->IsUnderWater(v62, (const FVector *)v65, (int *)&v83, v64));
- goto LABEL_75;
- }
- v8 = v7->m_vMovingDirection.x * v7->m_vMovingDirection.x
- + v7->m_vMovingDirection.y * v7->m_vMovingDirection.y
- + v7->m_vMovingDirection.z * v7->m_vMovingDirection.z;
- if ( v7->IsNPC(v7) && v7->m_data->m_moveType == CMT_FLY && v8 < 160000.0 )
- {
- v9 = GetTickCount() - v7->m_nLastTick;
- if ( v9 >= 0 )
- {
- if ( v9 > 800 )
- v9 = 800;
- }
- else
- {
- v9 = 0;
- }
- if ( !v7->m_nMoveTick )
- v7->m_nMoveTick = 1;
- v84 = (double)v9 / (double)(int)v7->m_nMoveTick;
- v67 = DOUBLE_1_0;
- v68 = 0i64;
- v10 = &v84;
- if ( v84 >= 1.0 )
- v10 = &v67;
- v11 = (double *)&v68;
- if ( *v10 > 0.0 )
- v11 = v10;
- v12 = *v11;
- v13 = *v11;
- v14 = *v11;
- m_data = (double *)v7->m_data;
- v16 = v13 * v7->m_vMovingDirection.z + m_data[3];
- v17 = v14 * v7->m_vMovingDirection.y + m_data[2];
- *(double *)v75 = v12 * v7->m_vMovingDirection.x + m_data[1];
- *(long double *)&v75[1] = v17;
- *(long double *)&v75[2] = v16;
- p_vTo = (FVector *)v75;
- v19 = &v78;
- LABEL_69:
- FVector::FVector((FVector *)v19, p_vTo);
- v60 = v59;
- v61 = CWorld::Inst();
- CWorld::MoveTo(v61, v7, v60, 0);
- goto LABEL_75;
- }
- if ( v7->m_data->m_moveType == CMT_FLY && v8 < 250000.0 )
- {
- v20 = GetTickCount() - v7->m_nLastTick;
- if ( v20 >= 0 )
- {
- if ( v20 > 800 )
- v20 = 800;
- }
- else
- {
- v20 = 0;
- }
- if ( !v7->m_nMoveTick )
- v7->m_nMoveTick = 1;
- if ( v7->IsPC(v7) && v7->CastUser(v7)->m_bRestartState )
- goto LABEL_75;
- v69 = (double)v20 / (double)(int)v7->m_nMoveTick;
- v70 = DOUBLE_1_0;
- v71 = 0i64;
- v21 = &v69;
- if ( v69 >= 1.0 )
- v21 = &v70;
- v22 = (double *)&v71;
- if ( *v21 > 0.0 )
- v22 = v21;
- v23 = *v22;
- v24 = *v22;
- v25 = *v22;
- v26 = (double *)v7->m_data;
- v27 = v24 * v7->m_vMovingDirection.z + v26[3];
- v28 = v25 * v7->m_vMovingDirection.y + v26[2];
- *(double *)v76 = v23 * v7->m_vMovingDirection.x + v26[1];
- *(long double *)&v76[1] = v28;
- *(long double *)&v76[2] = v27;
- p_vTo = (FVector *)v76;
- v19 = &v79;
- goto LABEL_69;
- }
- if ( v8 >= 90000.0 )
- goto LABEL_75;
- v29 = GetTickCount() - v7->m_nLastTick;
- if ( v29 >= 0 )
- {
- if ( v29 > 800 )
- v29 = 800;
- }
- else
- {
- v29 = 0;
- }
- if ( !v7->m_nMoveTick )
- v7->m_nMoveTick = 1;
- v72 = (double)v29 / (double)(int)v7->m_nMoveTick;
- v73 = DOUBLE_1_0;
- v74 = 0i64;
- v30 = &v72;
- if ( v72 >= 1.0 )
- v30 = &v73;
- v31 = (double *)&v74;
- if ( *v30 > 0.0 )
- v31 = v30;
- v32 = *v31;
- v33 = *v31;
- v34 = *v31;
- v35 = (double *)v7->m_data;
- z = v33 * v7->m_vMovingDirection.z + v35[3];
- v37 = v34 * v7->m_vMovingDirection.y + v35[2];
- vTo.x = v32 * v7->m_vMovingDirection.x + v35[1];
- vTo.y = v37;
- vTo.z = z;
- bIsFloating = v7->m_AreaMod.m_bIsUnderWater;
- nSurfaceHeight = v7->m_AreaMod.m_nWaterSurfaceHeight;
- if ( !bIsFloating )
- {
- if ( v7->m_AreaMod.m_bIsNearUnderWater
- && (v40 = Singleton<CAreaDB>::inst(),
- p_IsUnderWater = (unsigned __int8 (__fastcall **)(CAreaDB *, FVector *, char *, _QWORD))&v40->IsUnderWater,
- v42 = v7->GetInZoneID(v7),
- (*p_IsUnderWater)(v40, &vTo, &v82, v42)) )
- {
- v7->m_bFloatingMoveMode = 1;
- bIsFloating = 1;
- v43 = CWorld::Inst();
- v44 = v43->GetGeo(v43);
- v45 = CGeoData::FindNearGround(v44, (int)vTo.x, (int)vTo.y, (int)vTo.z);
- z = fmax(vTo.z, (double)v45);
- }
- else
- {
- v7->m_bFloatingMoveMode = 0;
- bIsFloating = 0;
- nSurfaceHeight = 0;
- v46 = v7->m_data;
- z = v46->m_Pos.z;
- if ( z <= this->m_vMidDest.z )
- z = this->m_vMidDest.z;
- vTo.z = z;
- if ( v46->m_moveType == CMT_FLY )
- goto LABEL_57;
- v47 = CWorld::Inst();
- v48 = v47->GetGeo(v47);
- z = (double)(int)CGeoData::FindNearGround(v48, (int)vTo.x, (int)vTo.y, (int)vTo.z);
- }
- vTo.z = z;
- }
- LABEL_57:
- v49 = (double *)v7->m_data;
- v50 = sqrt((vTo.x - v49[1]) * (vTo.x - v49[1]) + (vTo.y - v49[2]) * (vTo.y - v49[2]) + (z - v49[3]) * (z - v49[3]));
- v51 = CWorld::Inst();
- v52 = v7->m_data;
- v53 = v51->GetGeo(v51);
- if ( !CGeoData::MoveStraightTest(v53, &v52->m_Pos, &vTo, v50, bIsFloating, nSurfaceHeight) )
- FVector::operator=(&vTo, &v7->m_data->m_Pos);
- if ( v7->IsPC(v7) && v7->CastUser(v7)->m_bRestartState )
- goto LABEL_75;
- if ( v7->m_SkillMod.m_nBlockMoveCount || !v7->m_data->m_bCanMove || !v7->m_SkillMod.m_bCanAct )
- {
- v54 = v7->m_data;
- v55 = v7->GetController(v7);
- CCreatureController::ActionBroadcastMove(v55, &v54->m_Pos, &vTo);
- }
- m_eInterruptActionType = this->m_eInterruptActionType;
- if ( v7->IsPC(v7) && m_eInterruptActionType == ACT_SKILL )
- {
- v57 = v7->m_data;
- v58 = v7->GetController(v7);
- CCreatureController::ActionBroadcastMove(v58, &v57->m_Pos, &vTo);
- this->m_eInterruptActionType = ACT_MAX;
- }
- p_vTo = &vTo;
- v19 = (char *)&v80;
- goto LABEL_69;
- }
- LABEL_75:
- if ( v7->m_SkillMod.m_nBlockMoveCount || !v7->m_data->m_bCanMove || !v7->m_SkillMod.m_bCanAct )
- {
- v7->m_data->m_bMoveTrouble = 0;
- v7->m_data->m_dwPathFindFailCount = 0;
- }
- v7->m_bMoving = 0;
- memset(&v, 0, sizeof(v));
- FVector::operator=(&v7->m_vMovingDirection, &v);
- v7->m_nLastTick = GetTickCount();
- v7->m_nMoveTick = 0;
- v7->m_data->m_MovingStatus = MSTE_NOT_MOVING;
- this->m_bPathFinding = 0;
- CTimer::EndJob(&g_Timer, &JOB_NEWACTION__MOVE_ONEND);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement