Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
__int64 __fastcall CNPC::AddUseSkillDesire(CNPC *this, CSharedCreatureData *pTarget, __int64 nSkillNameID, int skill_type, int action_move_type, float value)
{
__int64 result; // rax
unsigned __int8 v7; // [rsp+41h] [rbp-27h]
int v8; // [rsp+44h] [rbp-24h]
int v9; // [rsp+48h] [rbp-20h]
CNPC *v10; // [rsp+70h] [rbp+8h]
CSharedCreatureData *v11; // [rsp+78h] [rbp+10h]
__int64 nSkillNameIDa; // [rsp+80h] [rbp+18h]
int skill_typea; // [rsp+88h] [rbp+20h]
skill_typea = skill_type;
nSkillNameIDa = nSkillNameID;
v11 = pTarget;
v10 = this;
v8 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64);
v9 = GuardHelper::_callStackDepth[v8]++;
GuardHelper::_pszCallStack[1000 * v8 + v9] = _FUNC_NAME___1119;
GuardHelper::_dwCallStackStartTick[v8][v9] = GetTickCount();
if ( v11 )
{
v7 = CNPC::AddUseSkillDesireEx(v10, v11->m_nId, nSkillNameIDa, skill_typea, action_move_type, 1, value, 0);
--GuardHelper::_callStackDepth[v8];
result = v7;
}
else
{
--GuardHelper::_callStackDepth[v8];
result = 0i64;
}
return result;
}
__int64 __fastcall CNPC::AddUseSkillDesireEx(CNPC *this, int nTargetID, __int64 nSkillNameID, int skill_type, int action_move_type, int bForce, float value, int desireFlag)
{
wchar_t *v8; // rax
__int64 result; // rax
unsigned __int8 v10; // [rsp+51h] [rbp-27h]
int v11; // [rsp+54h] [rbp-24h]
int v12; // [rsp+58h] [rbp-20h]
CNPC *v13; // [rsp+80h] [rbp+8h]
int nTargetIDa; // [rsp+88h] [rbp+10h]
__int64 nSkillNameIDa; // [rsp+90h] [rbp+18h]
int skill_typea; // [rsp+98h] [rbp+20h]
skill_typea = skill_type;
nSkillNameIDa = nSkillNameID;
nTargetIDa = nTargetID;
v13 = this;
v11 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64);
v12 = GuardHelper::_callStackDepth[v11]++;
GuardHelper::_pszCallStack[1000 * v11 + v12] = _FUNC_NAME___1120;
GuardHelper::_dwCallStackStartTick[v11][v12] = GetTickCount();
if ( nSkillNameIDa >= 0 )
{
v10 = CNPC::AddUseSkillDesireEx2(
v13,
nTargetIDa,
nSkillNameIDa,
skill_typea,
action_move_type,
bForce,
value,
desireFlag,
0,
0);
--GuardHelper::_callStackDepth[v11];
result = v10;
}
else
{
v8 = v13->CCreature::GetName(v13);
CLog::Add(&Log, LOG_ERROR, L"[%s]SkillNameID[%I64d] is not Valid", v8, nSkillNameIDa);
--GuardHelper::_callStackDepth[v11];
result = 0i64;
}
return result;
}
}
__int64 __fastcall CNPC::AddUseSkillDesireEx2(CNPC *this, int nTargetID, __int64 nSkillNameID, int skill_type, int action_move_type, int bForce, float value, int desireFlag, int OriginId, int Idtype)
{
wchar_t *v10; // rax
wchar_t *v12; // rax
float v13; // xmm0_4
ReverseHateManager *v14; // rax
float boost; // [rsp+30h] [rbp-148h]
int v16; // [rsp+50h] [rbp-128h]
int v17; // [rsp+5Ch] [rbp-11Ch]
User *v18; // [rsp+60h] [rbp-118h]
float v19; // [rsp+78h] [rbp-100h]
CCreature *v20; // [rsp+80h] [rbp-F8h]
CDesire result; // [rsp+A0h] [rbp-D8h]
CNPC *v22; // [rsp+180h] [rbp+8h]
int sid; // [rsp+188h] [rbp+10h]
__int64 nSkillNameIDa; // [rsp+190h] [rbp+18h]
nSkillNameIDa = nSkillNameID;
sid = nTargetID;
v22 = this;
v16 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64);
v17 = GuardHelper::_callStackDepth[v16]++;
GuardHelper::_pszCallStack[1000 * v16 + v17] = _FUNC_NAME___1121;
GuardHelper::_dwCallStackStartTick[v16][v17] = GetTickCount();
if ( nSkillNameIDa < 0 )
{
v10 = v22->CCreature::GetName(v22);
CLog::Add(&Log, LOG_ERROR, L"[%s]SkillNameID[%I64d] is not Valid", v10, nSkillNameIDa);
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
if ( OriginId < 0 )
{
v12 = v22->CCreature::GetName(v22);
CLog::Add(&Log, LOG_ERROR, L"[%s]OriginID[%d] is not Valid", v12, OriginId);
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
if ( !sid )
{
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
if ( !CNPC::CanAct(v22) )
{
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
if ( !(unsigned int)CNPC::Skill_GetTargetType(v22, nSkillNameIDa) )
sid = v22->m_nId;
if ( (sid & 0xF8000000) >> 27 == 9 )
{
v20 = CSmartIdManager<CCreature,120000,8>::GetObjectW(&g_CreatureSmartIdManager, sid);
if ( !v20 )
{
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
if ( v22->m_nId != sid && !v20->CCreature::IsTargetable(v20) )
{
--GuardHelper::_callStackDepth[v16];
return 0i64;
}
}
v13 = COERCE_DOUBLE(*(unsigned __int64 *)&value & _xmm);
v19 = v13;
boost = CAIParameter::GetDesireBoostValue(&v22->m_AIParam, PS_USE_SKILL);
CDesireFactory::MakeUseSkill(
&result,
sid,
nSkillNameIDa,
(NpcAttackMoveType)action_move_type,
bForce,
value,
boost,
desireFlag,
OriginId,
Idtype);
v18 = User::GetObjectW(sid);
if ( v18 && (int)CNPC::Skill_GetEffectPoint(v22, nSkillNameIDa) < 0 )
{
if ( g_nMaxChaseCount <= 0 )
{
v18->CCreature::AddReverseHate(v18, v22->m_nId, (int)v19);
}
else
{
v14 = ReverseHateManager::inst();
ReverseHateManager::AddHate(v14, v18->m_nId, v22->m_nId);
}
}
CDesirePQ::AddValue(&v22->m_DesirePQ, &result);
--GuardHelper::_callStackDepth[v16];
return 1i64;
}
CDesire *__fastcall CDesireFactory::MakeUseSkill(CDesire *result, unsigned int TargetID, __int64 nSkillNameID, NpcAttackMoveType amt, int bForce, float v, float boost, unsigned int desireFlag, int Originid, int type)
{
int v11; // [rsp+24h] [rbp-F4h]
int v12; // [rsp+28h] [rbp-F0h]
CDesire o; // [rsp+40h] [rbp-D8h]
CDesire *v14; // [rsp+120h] [rbp+8h]
int v15; // [rsp+128h] [rbp+10h]
__int64 v16; // [rsp+130h] [rbp+18h]
NpcAttackMoveType v17; // [rsp+138h] [rbp+20h]
v17 = amt;
v16 = nSkillNameID;
v15 = TargetID;
v14 = result;
v11 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64);
v12 = GuardHelper::_callStackDepth[v11]++;
GuardHelper::_pszCallStack[1000 * v11 + v12] = _FUNC_NAME___378;
GuardHelper::_dwCallStackStartTick[v11][v12] = GetTickCount();
CDesire::CDesire(&o, PS_USE_SKILL);
o.m_nTargetID = v15;
o.m_nMethod = v16;
o.m_fValue = v;
o.m_fBoost = boost;
o.m_bBoost = 0;
o.m_nBoostCount = 0;
o.m_amt = v17;
o.m_bForce = bForce != 0;
o.m_DesireFlag = desireFlag;
o.m_FollowType = type;
o.m_FollowData1 = Originid;
CDesire::CDesire(v14, &o);
--GuardHelper::_callStackDepth[v11];
return v14;
}
FFFFFFFF ; enum NpcAttackMoveType, copyof_437
FFFFFFFF AMT_STAND = 0
FFFFFFFF AMT_MOVE_TO_TARGET = 1
В новых хрониках можно использовать умения в движение?Код:__int64 __fastcall CNPC::AddUseSkillDesire(CNPC *this, CSharedCreatureData *pTarget, __int64 nSkillNameID, int skill_type, int action_move_type, float value) { __int64 result; // rax unsigned __int8 v7; // [rsp+41h] [rbp-27h] int v8; // [rsp+44h] [rbp-24h] int v9; // [rsp+48h] [rbp-20h] CNPC *v10; // [rsp+70h] [rbp+8h] CSharedCreatureData *v11; // [rsp+78h] [rbp+10h] __int64 nSkillNameIDa; // [rsp+80h] [rbp+18h] int skill_typea; // [rsp+88h] [rbp+20h] skill_typea = skill_type; nSkillNameIDa = nSkillNameID; v11 = pTarget; v10 = this; v8 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64); v9 = GuardHelper::_callStackDepth[v8]++; GuardHelper::_pszCallStack[1000 * v8 + v9] = _FUNC_NAME___1119; GuardHelper::_dwCallStackStartTick[v8][v9] = GetTickCount(); if ( v11 ) { v7 = CNPC::AddUseSkillDesireEx(v10, v11->m_nId, nSkillNameIDa, skill_typea, action_move_type, 1, value, 0); --GuardHelper::_callStackDepth[v8]; result = v7; } else { --GuardHelper::_callStackDepth[v8]; result = 0i64; } return result; }
Код:__int64 __fastcall CNPC::AddUseSkillDesireEx(CNPC *this, int nTargetID, __int64 nSkillNameID, int skill_type, int action_move_type, int bForce, float value, int desireFlag) { wchar_t *v8; // rax __int64 result; // rax unsigned __int8 v10; // [rsp+51h] [rbp-27h] int v11; // [rsp+54h] [rbp-24h] int v12; // [rsp+58h] [rbp-20h] CNPC *v13; // [rsp+80h] [rbp+8h] int nTargetIDa; // [rsp+88h] [rbp+10h] __int64 nSkillNameIDa; // [rsp+90h] [rbp+18h] int skill_typea; // [rsp+98h] [rbp+20h] skill_typea = skill_type; nSkillNameIDa = nSkillNameID; nTargetIDa = nTargetID; v13 = this; v11 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64); v12 = GuardHelper::_callStackDepth[v11]++; GuardHelper::_pszCallStack[1000 * v11 + v12] = _FUNC_NAME___1120; GuardHelper::_dwCallStackStartTick[v11][v12] = GetTickCount(); if ( nSkillNameIDa >= 0 ) { v10 = CNPC::AddUseSkillDesireEx2( v13, nTargetIDa, nSkillNameIDa, skill_typea, action_move_type, bForce, value, desireFlag, 0, 0); --GuardHelper::_callStackDepth[v11]; result = v10; } else { v8 = v13->CCreature::GetName(v13); CLog::Add(&Log, LOG_ERROR, L"[%s]SkillNameID[%I64d] is not Valid", v8, nSkillNameIDa); --GuardHelper::_callStackDepth[v11]; result = 0i64; } return result; } }
Код:__int64 __fastcall CNPC::AddUseSkillDesireEx2(CNPC *this, int nTargetID, __int64 nSkillNameID, int skill_type, int action_move_type, int bForce, float value, int desireFlag, int OriginId, int Idtype) { wchar_t *v10; // rax wchar_t *v12; // rax float v13; // xmm0_4 ReverseHateManager *v14; // rax float boost; // [rsp+30h] [rbp-148h] int v16; // [rsp+50h] [rbp-128h] int v17; // [rsp+5Ch] [rbp-11Ch] User *v18; // [rsp+60h] [rbp-118h] float v19; // [rsp+78h] [rbp-100h] CCreature *v20; // [rsp+80h] [rbp-F8h] CDesire result; // [rsp+A0h] [rbp-D8h] CNPC *v22; // [rsp+180h] [rbp+8h] int sid; // [rsp+188h] [rbp+10h] __int64 nSkillNameIDa; // [rsp+190h] [rbp+18h] nSkillNameIDa = nSkillNameID; sid = nTargetID; v22 = this; v16 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64); v17 = GuardHelper::_callStackDepth[v16]++; GuardHelper::_pszCallStack[1000 * v16 + v17] = _FUNC_NAME___1121; GuardHelper::_dwCallStackStartTick[v16][v17] = GetTickCount(); if ( nSkillNameIDa < 0 ) { v10 = v22->CCreature::GetName(v22); CLog::Add(&Log, LOG_ERROR, L"[%s]SkillNameID[%I64d] is not Valid", v10, nSkillNameIDa); --GuardHelper::_callStackDepth[v16]; return 0i64; } if ( OriginId < 0 ) { v12 = v22->CCreature::GetName(v22); CLog::Add(&Log, LOG_ERROR, L"[%s]OriginID[%d] is not Valid", v12, OriginId); --GuardHelper::_callStackDepth[v16]; return 0i64; } if ( !sid ) { --GuardHelper::_callStackDepth[v16]; return 0i64; } if ( !CNPC::CanAct(v22) ) { --GuardHelper::_callStackDepth[v16]; return 0i64; } if ( !(unsigned int)CNPC::Skill_GetTargetType(v22, nSkillNameIDa) ) sid = v22->m_nId; if ( (sid & 0xF8000000) >> 27 == 9 ) { v20 = CSmartIdManager<CCreature,120000,8>::GetObjectW(&g_CreatureSmartIdManager, sid); if ( !v20 ) { --GuardHelper::_callStackDepth[v16]; return 0i64; } if ( v22->m_nId != sid && !v20->CCreature::IsTargetable(v20) ) { --GuardHelper::_callStackDepth[v16]; return 0i64; } } v13 = COERCE_DOUBLE(*(unsigned __int64 *)&value & _xmm); v19 = v13; boost = CAIParameter::GetDesireBoostValue(&v22->m_AIParam, PS_USE_SKILL); CDesireFactory::MakeUseSkill( &result, sid, nSkillNameIDa, (NpcAttackMoveType)action_move_type, bForce, value, boost, desireFlag, OriginId, Idtype); v18 = User::GetObjectW(sid); if ( v18 && (int)CNPC::Skill_GetEffectPoint(v22, nSkillNameIDa) < 0 ) { if ( g_nMaxChaseCount <= 0 ) { v18->CCreature::AddReverseHate(v18, v22->m_nId, (int)v19); } else { v14 = ReverseHateManager::inst(); ReverseHateManager::AddHate(v14, v18->m_nId, v22->m_nId); } } CDesirePQ::AddValue(&v22->m_DesirePQ, &result); --GuardHelper::_callStackDepth[v16]; return 1i64; }
Код:CDesire *__fastcall CDesireFactory::MakeUseSkill(CDesire *result, unsigned int TargetID, __int64 nSkillNameID, NpcAttackMoveType amt, int bForce, float v, float boost, unsigned int desireFlag, int Originid, int type) { int v11; // [rsp+24h] [rbp-F4h] int v12; // [rsp+28h] [rbp-F0h] CDesire o; // [rsp+40h] [rbp-D8h] CDesire *v14; // [rsp+120h] [rbp+8h] int v15; // [rsp+128h] [rbp+10h] __int64 v16; // [rsp+130h] [rbp+18h] NpcAttackMoveType v17; // [rsp+138h] [rbp+20h] v17 = amt; v16 = nSkillNameID; v15 = TargetID; v14 = result; v11 = *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->Reserved1[11] + tls_index) + 824736i64); v12 = GuardHelper::_callStackDepth[v11]++; GuardHelper::_pszCallStack[1000 * v11 + v12] = _FUNC_NAME___378; GuardHelper::_dwCallStackStartTick[v11][v12] = GetTickCount(); CDesire::CDesire(&o, PS_USE_SKILL); o.m_nTargetID = v15; o.m_nMethod = v16; o.m_fValue = v; o.m_fBoost = boost; o.m_bBoost = 0; o.m_nBoostCount = 0; o.m_amt = v17; o.m_bForce = bForce != 0; o.m_DesireFlag = desireFlag; o.m_FollowType = type; o.m_FollowData1 = Originid; CDesire::CDesire(v14, &o); --GuardHelper::_callStackDepth[v11]; return v14; }
Код:FFFFFFFF ; enum NpcAttackMoveType, copyof_437 FFFFFFFF AMT_STAND = 0 FFFFFFFF AMT_MOVE_TO_TARGET = 1
По факту skill_type не используется, в то время как action_move_type используется для определения кастовать с места или нет.
Код взят из свеже слитых файлов. Как раньше было хз.
кастовать с места или бежать к цели и потом кастоватьВ новых хрониках можно использовать умения в движение?
5 - это "вес" или по другому приоритет действия. в первую очередь пытаются выполниться действия с большим приоритетомИспользовать скилл.
Все что начинается на @, является предустановленной константой из файлов *_pch.txt
- чар
- скилл
- классификация скилла (@ST_HEAL - хороший)
- Метод кастования (@AMT_STAND - не двигаясь (не преследуя))
- Вероятно задержка, везде число одинаковое
Примеры:
myself.AddUseSkillDesire( talker, @s_pcbang_might3, @ST_HEAL, @AMT_STAND, 1000000 );
desire еще стакаются по весу при добавлении, если действия идентичны5 - это "вес" или по другому приоритет действия. в первую очередь пытаются выполниться действия с большим приоритетом
по сути, когда в аи приходит момент выполнять очередные действия (desire), то все запланированные действия сначала вот сортируются по этому самому приоритету в порядке убывания и уже после этого начинает пытаться выполнить их с начала этого отсортированного списка.
if (m_PState == other.m_PState) {
switch (m_PState) {
case IDLE:
case MOVE_AROUND:
case DO_NOTHING:
case DECAYING:
case PET_DEFAULT:
return true;
case ATTACK:
case MOVE_TO_TARGET:
return m_nTargetID == other.m_nTargetID;
case CHASE:
case FLEE:
case FOLLOW:
return m_nCreatureId == other.m_nCreatureId && m_nTargetCreatureId == other.m_nTargetCreatureId;
case GET_ITEM:
return m_spItem == other.m_spItem;
case MOVE_TO_WAY_POINT:
return m_pWayPoints == other.m_pWayPoints && m_pWayPointDelays == other.m_pWayPointDelays && m_nWayPointIndex == other.m_nWayPointIndex;
case USE_SKILL:
return m_nTargetID == other.m_nTargetID && m_nMethod == other.m_nMethod;
case MOVE_TO:
if ((m_vPos.x - other.m_vPos.x) * (m_vPos.x - other.m_vPos.x) + (m_vPos.y - other.m_vPos.y) * (m_vPos.y - other.m_vPos.y) >= 400.0 || Math.abs(m_vPos.z - other.m_vPos.z) >= 30.0)
return false;
else return true;
case EFFECT_ACTION:
return m_nCreatureId == other.m_nCreatureId && m_nMethod == other.m_nMethod;
case EFFECT_ACTION2:
return m_nCreatureId == other.m_nCreatureId && m_nMethod == other.m_nMethod && m_nRange == other.m_nRange;
case MOVE_SUPERPOINT:
return m_Name.equals(other.m_Name) && m_nMethod == other.m_nMethod;
case MOVE_FREEWAY:
return m_id == other.m_id;
case MOVE_FORMATION:
return m_nUniqueID == other.m_nUniqueID;
default:
return false;
}
}
return false;