Ejemplo n.º 1
0
bool CPathOfExile::GetPlayerExp(PLAYEREXP* exp)
{
	DWORD dwPlayerBase = GetPlayerBase();
	if ( dwPlayerBase )
	{
		DWORD arOffsets[] = { 0x14 };
		DWORD dwStatsPtr = GetMultiLevelPointer32(dwPlayerBase + 0x4, arOffsets);
		if ( dwStatsPtr )
		{
			DWORD dwValue = 0;

			ReadMemory(dwStatsPtr + 0x34, &dwValue, sizeof(dwValue));
			exp->Current = dwValue;

			ReadMemory(dwStatsPtr + 0x44, &dwValue, sizeof(dwValue));
			exp->CurrentLevel = dwValue;

			exp->Minimum = s_ExperienceThresholds[exp->CurrentLevel];
			exp->Maximum = s_ExperienceThresholds[exp->CurrentLevel + 1];

			return true;
		}
	}

	return false;
}
Ejemplo n.º 2
0
bool CPathOfExile::GetPlayerHealth(PLAYERHEALTH* health)
{
	DWORD dwPlayerBase = GetPlayerBase();
	if ( dwPlayerBase )
	{
		DWORD arOffsets[] = {  0xC };
		DWORD dwHealthPtr = GetMultiLevelPointer32(dwPlayerBase + 0x4, arOffsets);
		if ( dwHealthPtr )
		{
			return ReadMemory(dwHealthPtr + 0x50, (LPVOID)health, sizeof(PLAYERHEALTH));
		}
	}

	return false;
}
Ejemplo n.º 3
0
BOOL CGetPlayerDataCMD::GetData(SGDP::ISDDBConnection* poDBConn, UINT32 dwPlayerID, DT_PLAYER_NOPVP_DATA& stPlayerNoPvpData, DT_PLAYER_PVP_DATA& stPlayerPvpData, UINT16& wErrCode)
{
    //CAutoCycle oAutoCycle(__FUNCTION__);

    wErrCode = FAIL;

    if(!GetPlayerBase(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        wErrCode = GET_NODATA;
        //USR_INFO(_SDT("[%s: %d]: GetPlayerBase failed! playerid:%d"), MSG_MARK, dwPlayerID);    //新增玩家肯定没有
        return FALSE;
    }

    if(!GetPlayerTodayConsume(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        wErrCode = GET_NODATA;
        //USR_INFO(_SDT("[%s: %d]: GetPlayerBase failed! playerid:%d"), MSG_MARK, dwPlayerID);    //新增玩家肯定没有
        return FALSE;
    }

    if(!GetPlayerExt(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetPlayerExt failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetBag(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetBag failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetBuild(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetBuild failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetHeroBase(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetHeroBase failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetHeroExt(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetBag GetHeroExt! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetInstance(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetInstance failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetTask(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetTask failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetRelationData(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetRelationData failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetEvenData(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetEvenData failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetSendFlowerLog(poDBConn, dwPlayerID, stPlayerNoPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetSendFlowerLog failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    if(!GetPvp(poDBConn, dwPlayerID, stPlayerPvpData))
    {
        SYS_CRITICAL(_SDT("[%s: %d]: GetPvp failed! playerid:%d"), MSG_MARK, dwPlayerID);
        return FALSE;
    }

    wErrCode = SUCCESS;

    return TRUE;
}
Ejemplo n.º 4
0
void Siege::SiegeGunDeploy(uint client, const wstring &args)
{
	// Abort processing if this is not a "heavy lifter"
	uint shiparch;
	pub::Player::GetShipID(client, shiparch);
	if (set_construction_shiparch != 0 && shiparch != set_construction_shiparch)
	{
		PrintUserCmdText(client, L"ERR Need deployment ship");
		return;
	}

	uint ship;
	pub::Player::GetShip(client, ship);
	if (!ship)
	{
		PrintUserCmdText(client, L"ERR Not in space");
		return;
	}

	// If the ship is moving, abort the processing.
	Vector dir1;
	Vector dir2;
	pub::SpaceObj::GetMotion(ship, dir1, dir2);
	if (dir1.x>5 || dir1.y>5 || dir1.z>5)
	{
		PrintUserCmdText(client, L"ERR Ship is moving");
		return;
	}

	int min = 100;
	int max = 5000;
	int randomsiegeint = min + (rand() % (int)(max - min + 1));

	string randomname = "Siege Cannon AX-" + randomsiegeint;

	// Check for conflicting base name
	if (GetPlayerBase(CreateID(PlayerBase::CreateBaseNickname(randomname).c_str())))
	{
		PrintUserCmdText(client, L"ERR Deployment error, please reiterate.");
		return;
	}

	// Check that the ship has the requires commodities.
	int hold_size;
	list<CARGO_INFO> cargo;
	HkEnumCargo((const wchar_t*)Players.GetActiveCharacterName(client), cargo, hold_size);
	for (map<uint, uint>::iterator i = construction_items.begin(); i != construction_items.end(); ++i)
	{
		bool material_available = false;
		uint good = i->first;
		uint quantity = i->second;
		for (list<CARGO_INFO>::iterator ci = cargo.begin(); ci != cargo.end(); ++ci)
		{
			if (ci->iArchID == good && ci->iCount >= (int)quantity)
			{
				material_available = true;
				pub::Player::RemoveCargo(client, ci->iID, quantity);
			}
		}
		if (material_available == false)
		{
			PrintUserCmdText(client, L"ERR Construction failed due to insufficient raw material.");
			for (i = construction_items.begin(); i != construction_items.end(); ++i)
			{
				const GoodInfo *gi = GoodList::find_by_id(i->first);
				if (gi)
				{
					PrintUserCmdText(client, L"|  %ux %s", i->second, HkGetWStringFromIDS(gi->iIDSName).c_str());
				}
			}
			return;
		}
	}

	wstring charname = (const wchar_t*)Players.GetActiveCharacterName(client);
	AddLog("NOTICE: Base created %s by %s (%s)",
		randomname.c_str(),
		wstos(charname).c_str(),
		wstos(HkGetAccountID(HkGetAccountByCharname(charname))).c_str());

	wstring password = L"hastesucks";
	wstring basename = stows(randomname);

	PlayerBase *newbase = new PlayerBase(client, password, basename);
	player_bases[newbase->base] = newbase;
	newbase->basetype = "siegegun";
	newbase->basesolar = "depot";
	newbase->baseloadout = "depot";
	newbase->defense_mode = 1;

	for (map<string, ARCHTYPE_STRUCT>::iterator iter = mapArchs.begin(); iter!=mapArchs.end(); iter++)
	{

		ARCHTYPE_STRUCT &thearch = iter->second;
		if (iter->first == newbase->basetype) 
		{					
			newbase->invulnerable = thearch.invulnerable;
			newbase->logic = thearch.logic;
		}
	}

	newbase->Spawn();
	newbase->Save();

	PrintUserCmdText(client, L"OK: Siege Cannon deployed");
	PrintUserCmdText(client, L"Default administration password is %s", password.c_str());
}