Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. void __fastcall CCreature::EnterWorldImpl(CCreature *this)
  2. {
  3.   int v2; // r12d
  4.   CSharedCreatureData *m_data; // rax
  5.   CSharedCreatureData *v4; // rax
  6.   CSharedCreatureData *v5; // rcx
  7.   unsigned int v6; // r8d
  8.   FVector *v7; // rax
  9.   int z; // ecx
  10.   CSharedCreatureData *v9; // rax
  11.   int v10; // ecx
  12.   __int64 v11; // rdx
  13.   __int64 v12; // rax
  14.   __int64 v13; // rbx
  15.   CSharedCreatureData *v14; // rax
  16.   __int64 v15; // rcx
  17.   BOOL v16; // r8d
  18.   CCreature_vtbl *v17; // rax
  19.   CSharedCreatureData *v18; // rax
  20.   __int64 m_Race; // rcx
  21.   FVector *m_vPassingPos; // rbx
  22.   __int64 v21; // rdi
  23.   const FVector *v22; // rax
  24.   CWorld *v23; // r14
  25.   int v24; // esi
  26.   unsigned int y; // edi
  27.   unsigned int x; // ebx
  28.   CGeoData *v27; // rax
  29.   CWorld *v28; // rax
  30.   int v29; // edi
  31.   int v30; // ebx
  32.   CGeoData *v31; // rax
  33.   CGeoZone *Zone; // rax
  34.   CGeoZone *v33; // rbx
  35.   CSharedGeoZone *Sector; // rax
  36.   int v35; // ebx
  37.   double v36; // [rsp+38h] [rbp-D0h] BYREF
  38.   double v37; // [rsp+40h] [rbp-C8h]
  39.   FVector v; // [rsp+48h] [rbp-C0h] BYREF
  40.   FVector v39; // [rsp+60h] [rbp-A8h] BYREF
  41.   __int64 v40; // [rsp+78h] [rbp-90h]
  42.   FVector v41; // [rsp+80h] [rbp-88h] BYREF
  43.   FVector v42; // [rsp+98h] [rbp-70h] BYREF
  44.   FVector v43; // [rsp+B0h] [rbp-58h] BYREF
  45.   char v44[24]; // [rsp+C8h] [rbp-40h] BYREF
  46.   char v45[24]; // [rsp+E0h] [rbp-28h] BYREF
  47.   InfectedSkillType v46; // [rsp+F8h] [rbp-10h] BYREF
  48.  
  49.   v2 = 1;
  50.   _InterlockedAdd(&g_nHeartbeatingCreatureNum, 1u);
  51.   _InterlockedAdd(&g_nExistingCreatureNum, 1u);
  52.   m_data = this->m_data;
  53.   this->m_bIsFreezing = 0;
  54.   m_data->m_nPKTimeStamp = 0;
  55.   this->m_data->m_cIsGuilty = 0;
  56.   v4 = this->m_data;
  57.   this->m_bIsGMKill = 0;
  58.   this->m_nDead = 0;
  59.   v4->m_bGMInvisible = 0;
  60.   this->m_data->m_nSoulShot = 0;
  61.   this->m_data->m_nFishingShot = 0;
  62.   this->m_data->m_bSpiritShot = 0;
  63.   this->m_data->m_bCanBeResurrected = 1;
  64.   this->m_data->m_bCanResurrection = 0;
  65.   this->m_data->m_nResurrectExp = 0i64;
  66.   this->m_data->m_nResurrectRatio = 0;
  67.   this->m_data->m_dwResurrectTime = GetTickCount();
  68.   this->m_data->m_MovingStatus = MSTE_NOT_MOVING;
  69.   this->m_data->m_StopMode = STP_STAND;
  70.   this->m_data->m_MoveMode = MT_FAST;
  71.   v5 = this->m_data;
  72.   if ( v5->m_moveType == CMT_FLY )
  73.     v6 = 2;
  74.   else
  75.     v6 = 0;
  76.   CVariableBitSet::SetIntValue_IfModifed(&v5->m_NeedUpdatePacketBitSet, (unsigned int *)&v5->m_Environment, v6, 0x53u);
  77.   this->m_data->m_FirstAttackerServerID = 0;
  78.   this->m_data->m_LastAttackerServerID = 0;
  79.   this->m_BuilderCmdMod.m_nAbnormalChangeType = 3;
  80.   *(_WORD *)&this->m_ItemMod.m_bOnlyUseEquipedWeaponActiveSkill = 0;
  81.   this->m_ItemMod.m_bHpLimitBreak = 0;
  82.   CCreature::InitializeSkillMod(this);
  83.   *(_QWORD *)&this->m_AreaMod.m_bIsUnderMotherTree = 0i64;
  84.   this->m_AreaMod.m_dSpeedModByArea = 1.0;
  85.   *(_WORD *)&this->m_AreaMod.m_bWasFrozen = 0;
  86.   *(_QWORD *)&this->m_AreaMod.m_bIsInBattleField = 0i64;
  87.   *(_WORD *)&this->m_AreaMod.m_bWasUnderWater = 0;
  88.   this->m_AreaMod.m_bIsNearUnderWater = 0;
  89.   this->m_AreaMod.m_bIsInInstantSkill = 0;
  90.   this->m_AreaMod.m_dHpRegenAreaBonus = 0.0;
  91.   this->m_AreaMod.m_dMpRegenAreaBonus = 0.0;
  92.   this->m_AreaMod.m_nLeavingMessageNO = 0;
  93.   this->m_AreaMod.m_dHeightDamage = 0.0;
  94.   CCreatureSkillDurationMod::Clear(&this->m_SkillDurationMod);
  95.   *(_QWORD *)&this->m_inv.m_nEXPRuneCount = 0i64;
  96.   this->m_inv.m_nRPRuneCount = 0;
  97.   this->m_inv.m_RuneItemClassIds._Mypair._Myval2._Mylast = this->m_inv.m_RuneItemClassIds._Mypair._Myval2._Myfirst;
  98.   v7 = this->GetPos(this, v44);
  99.   v39.x = 0.0;
  100.   z = (int)v7->z;
  101.   this->m_nCurrentWeight = 0;
  102.   *(_OWORD *)&v.y = 0i64;
  103.   this->m_AreaMod.m_nWaterSurfaceHeight = z;
  104.   FVector::operator=(&this->m_vSrcPos, (FVector *)&v.y);
  105.   v40 = 0i64;
  106.   *(_OWORD *)&v39.y = 0i64;
  107.   FVector::operator=(&this->m_vMoveSkillDest, (FVector *)&v39.y);
  108.   this->m_bDecExp = 1;
  109.   this->m_nSetItemClassId = 0;
  110.   std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const,int>>,0>>::clear(&this->m_mapNewSetItem);
  111.   std::_Tree<std::_Tmap_traits<int,int,std::less<int>,std::allocator<std::pair<int const,int>>,0>>::clear(&this->m_mapShapeShiftedSetItem);
  112.   v9 = this->m_data;
  113.   v10 = 0;
  114.   *(_WORD *)&this->m_bIsInitiativeViolet = 0;
  115.   v11 = 0i64;
  116.   this->m_dHPRegenModByWeight = 1.0;
  117.   this->m_dMPRegenModByWeight = 1.0;
  118.   this->m_dCPRegenModByWeight = 1.0;
  119.   this->m_dSpeedModByWeight = 1.0;
  120.   *(_QWORD *)&this->m_nEnergyCount = 0i64;
  121.   this->m_dwFakeDeathStartTime = 0;
  122.   v9->m_bIsSpoil = 0;
  123.   this->m_data->m_nCanSweeper = 0;
  124.   this->m_data->m_nSpoilerSmartID = 0;
  125.   do
  126.     *(&this->m_data->m_bIsPlunded + v11++) = v10++;
  127.   while ( v10 < 2 );
  128.   this->m_data->m_bIsSeed2 = 0;
  129.   this->m_data->m_nCanHarvest = 0;
  130.   this->m_data->m_nSowerSmartID = 0;
  131.   this->m_data->m_dOverHitBonus = 1.0;
  132.   this->m_maxCubic = 1;
  133.   InfectedSkillType::InfectedSkillType(&v46);
  134.   v13 = v12;
  135.   this->m_InstantDurationSkill.pSkillInfo = *(const CSkillInfo **)v12;
  136.   this->m_InstantDurationSkill.nStartTime = *(_DWORD *)(v12 + 8);
  137.   this->m_InstantDurationSkill.bSelfCast = *(_BYTE *)(v12 + 12);
  138.   this->m_InstantDurationSkill.nSourceCreatureId = *(_DWORD *)(v12 + 16);
  139.   this->m_InstantDurationSkill.m_pChannellingSkillInfo = *(CSkillInfo **)(v12 + 24);
  140.   std::list<int,std::xallocator<int>>::operator=(
  141.     &this->m_InstantDurationSkill.m_SourceCreatureIds,
  142.     (std::list<int,std::xallocator<int> > *)(v12 + 32));
  143.   this->m_InstantDurationSkill.nDuration = *(_DWORD *)(v13 + 48);
  144.   this->m_InstantDurationSkill.nReduceCount = *(_DWORD *)(v13 + 52);
  145.   this->m_InstantDurationSkill.dReduceDamage = *(long double *)(v13 + 56);
  146.   std::list<int,std::xallocator<int>>::~list<int,std::xallocator<int>>(&v46.m_SourceCreatureIds);
  147.   this->m_InstantDurationSkill.pSkillInfo = 0i64;
  148.   this->m_dSpiritShotHealBonus = 0.0;
  149.   this->m_sNowSoulShot = 0;
  150.   this->m_bIsSysMsg = 1;
  151.   *(_WORD *)&this->m_bIsHP1SysMsg = 0;
  152.   this->m_bIsNight = g_L2Time.m_bIsNight;
  153.   v14 = this->m_data;
  154.   if ( v14->m_dBaseHP * 0.3 < v14->m_dHP )
  155.   {
  156.     this->m_bIsLowHPLevel1 = 0;
  157.   }
  158.   else
  159.   {
  160.     this->m_bIsHP1SysMsg = 1;
  161.     this->m_bIsLowHPLevel1 = 1;
  162.   }
  163.   if ( v14->m_dBaseHP * 0.6 < v14->m_dHP )
  164.   {
  165.     this->m_bIsLowHPLevel2 = 0;
  166.   }
  167.   else
  168.   {
  169.     this->m_bIsHP2SysMsg = 1;
  170.     this->m_bIsLowHPLevel2 = 1;
  171.   }
  172.   this->m_dwMPowerStorage = 0;
  173.   this->m_sPowerCount = -1;
  174.   v15 = 0i64;
  175.   this->m_bIsRestarting = 0;
  176.   do
  177.     *(&this->m_data->m_bIsFakeDeath + v15++) = 0;
  178.   while ( v15 < 2 );
  179.   this->m_data->m_nMaxMagicLevel = 0;
  180.   if ( this->IsPC(this) )
  181.   {
  182.     v16 = this->m_nDownExp == 0;
  183. LABEL_19:
  184.     CVariableBitSet::SetIntValue_IfModifed(
  185.       &this->m_data->m_NeedUpdatePacketBitSet,
  186.       (unsigned int *)&this->m_data->m_bIsAlive,
  187.       v16,
  188.       0x61u);
  189.     goto LABEL_20;
  190.   }
  191.   if ( !this->IsPet(this) )
  192.   {
  193.     this->m_nDownExp = 0i64;
  194.     v16 = 1;
  195.     goto LABEL_19;
  196.   }
  197.   CVariableBitSet::SetIntValue_IfModifed(
  198.     &this->m_data->m_NeedUpdatePacketBitSet,
  199.     (unsigned int *)&this->m_data->m_bIsAlive,
  200.     this->m_bIsPetAlive == 1,
  201.     0x61u);
  202.   this->m_bIsPetAlive = 1;
  203. LABEL_20:
  204.   if ( this->IsPet(this) && !this->IsAlive(this) && this->m_nDeathCount > 0 )
  205.     this->m_data->m_bDecayComplete = 1;
  206.   this->m_bLeft = 0;
  207.   *(_QWORD *)&this->m_nAuraTick = 0i64;
  208.   *(_QWORD *)&this->m_nCommitTick = 0i64;
  209.   _InterlockedExchange(&this->m_bParamChanged, 0);
  210.   v17 = this->__vftable;
  211.   this->m_nValidateChanged = 0x2000;
  212.   *(_WORD *)&this->m_bAbnormalStatusChanged = 0;
  213.   this->m_bValidateExChanged = 0;
  214.   this->m_nValidateExChanged = 4;
  215.   v17->SetInCombatMode(this, 0);
  216.   this->m_nCombatModeTimeStamp = 0;
  217.   this->m_nSummonLifeLastTick = GetTickCount();
  218.   this->m_nBowDelay = 0;
  219.   CIOObject::SetShortTimeStamp(&this->m_nBowDelay, 0);
  220.   this->m_data->m_nLastAttackTick = 0;
  221.   v18 = this->m_data;
  222.   this->m_eDeadDamage = 1;
  223.   CCreature::_AcquireSkills(
  224.     this,
  225.     (const std::vector<SkillAcquireInfo *,std::xallocator<SkillAcquireInfo *> > *)((char *)g_SkillAcquireDB.m_vectorClsSkill
  226.                                                                                  + 16 * v18->m_nClass
  227.                                                                                  + 8 * v18->m_nClass),
  228.     1,
  229.     0);
  230.   m_Race = this->m_data->m_Race;
  231.   CCreature::_AcquireSkills(
  232.     this,
  233.     (const std::vector<SkillAcquireInfo *,std::xallocator<SkillAcquireInfo *> > *)((char *)g_SkillAcquireDB.m_vectorRaceSkill
  234.                                                                                  + 16 * m_Race
  235.                                                                                  + 8 * m_Race),
  236.     1,
  237.     0);
  238.   this->ValidateChanged(this, 0x2000);
  239.   std::_Tree<std::_Tmap_traits<int,double,std::less<int>,std::xallocator<std::pair<int const,double>>,0>>::clear(&this->m_PledgeContributes);
  240.   this->m_nPledgeContributeSaveTick = 0;
  241.   m_vPassingPos = this->m_vPassingPos;
  242.   *(_DWORD *)&this->m_nCurrentPassingPos = 0;
  243.   v21 = 15i64;
  244.   do
  245.   {
  246.     v22 = this->GetPos(this, v45);
  247.     FVector::operator=(m_vPassingPos++, v22);
  248.     --v21;
  249.   }
  250.   while ( v21 );
  251.   CCreature::InitMes(this);
  252.   if ( nHeartBeat != 666 )
  253.   {
  254.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHeartBeat!=666!");
  255.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHeartBeat!=666!");
  256.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHeartBeat!=666!");
  257.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHeartBeat!=666!");
  258.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHeartBeat!=666!");
  259.     nHeartBeat = 666;
  260.   }
  261.   v23 = CWorld::Inst();
  262.   FVector::FVector(&v41, &this->m_data->m_Pos);
  263.   v24 = (int)v41.z;
  264.   FVector::FVector(&v42, &this->m_data->m_Pos);
  265.   y = (int)v42.y;
  266.   FVector::FVector(&v43, &this->m_data->m_Pos);
  267.   x = (int)v43.x;
  268.   v27 = v23->GetGeo(v23);
  269.   this->m_data->m_bIsFreezed = CGeoData::IsField(v27, x, y, v24, GEO_FIELD_FREEZE);
  270.   this->GetPos(this, (FVector *)&v36);
  271.   v28 = CWorld::Inst();
  272.   v29 = ((int)v37 + 0x40000) >> 15;
  273.   v30 = ((int)v36 + 327680) >> 15;
  274.   v31 = v28->GetGeo(v28);
  275.   Zone = CGeoData::GetZone(v31, v30 + 10, v29 + 10);
  276.   v33 = Zone;
  277.   if ( Zone )
  278.   {
  279.     Sector = CGeoZone::GetSector(Zone, (unsigned __int8)((int)v36 >> 7), (unsigned __int8)((int)v37 >> 7));
  280.     if ( Sector )
  281.       CCreature::AreaCheckForEveryTick(this, v33, (CGeoSector *)Sector, -1);
  282.   }
  283.   v35 = nHeartBeat;
  284.   if ( nHeartBeat > 0 )
  285.     v2 = (int)(genrand64_real2() * (double)v35 + 1.0);
  286.   else
  287.     CLog::Add(&Log, LOG_ERROR, (wchar_t *)L"nHigh [%d] in Random", (unsigned int)nHeartBeat);
  288.   CIOObject::AddTimer(this, v2 + nHeartBeat, 0);
  289. }