void CreatureManager::ShowCreatureInfo()
{
	Block block = App::sInstance().GetMouseBlock();
	if (block.xpos!=-1 && block.ypos!=-1)
	{
		Character* cha = GetEnemy(block.xpos,block.ypos);
		if(cha == NULL)
		{
			cha = GetFriend(block.xpos,block.ypos);
			if(cha == NULL)
			{
				TipWnd::sInstance().Clear();
				TipWnd::sInstance().SetShow(false);
				return;
			}
		}
		//得到单位,显示其信息
		char temp[256] = {0};
		TipWnd::sInstance().Clear();
		sprintf(temp," ID   : %d",cha->GetID());
		TipWnd::sInstance().AddText(temp,0xFFFFFFFF,-1,-1,eFontType_MSYaHei,eFontSize_FontMiddle);
		sprintf(temp," 坐标 : %d , %d",cha->GetBlock().xpos,cha->GetBlock().ypos);
		TipWnd::sInstance().AddText(temp,0xFFFFFFFF,-1,-1,eFontType_MSYaHei,eFontSize_FontMiddle);
		sprintf(temp," 生命值:%d",cha->GetHP());
		TipWnd::sInstance().AddText(temp,0xFFFFFFFF,-1,-1,eFontType_MSYaHei,eFontSize_FontMiddle);
		TipWnd::sInstance().SetShow(true);
		TipWnd::sInstance().SetPos(block.xpos,block.ypos);
	}
	else
	{
		TipWnd::sInstance().Clear();
		TipWnd::sInstance().SetShow(false);
	}

}
Exemple #2
0
void CTibia::AttackTarget(int nTarget)
{
	SCreature *c = 0;
	switch(nTarget)
	{
	case HotkeyCreature::Self:
		c = (SCreature*)GetPlayer();
		break;
	case HotkeyCreature::Target:
		if(PlayerTarget == 0)
			return;
		c = (SCreature*)GetPlayer(PlayerTarget, true);
		break;
	case HotkeyCreature::Friend:
		c = (SCreature*)GetFriend(100); 
		break;
	case HotkeyCreature::Enemy:
		c = (SCreature*)GetEnemy(100); 
		break;
	}

	if(c > 0)
	{
		*(unsigned int*)Address::PLAYER_ATTACK_ID = c->CreatureID;
	}
}
Exemple #3
0
BOOL	CRTMessenger::IsBlock( u_long idFriend )
{
	Friend* pFriend		= GetFriend( idFriend );
	if( pFriend )
		return pFriend->bBlock;
	return TRUE;
}
Character* CreatureManager::GetCreature(int num)
{
	Character* temp = GetEnemy(num);
	if(temp == NULL)
		temp = GetFriend(num);

	return temp;
}
Character* CreatureManager::GetCreature(int x,int  y)
{
	Character* temp = GetEnemy(x,y);
	if(temp == NULL)
		temp = GetFriend(x,y);

	return temp;
}
bool FOnlineFriendsFacebook::IsFriend(int32 LocalUserNum, const FUniqueNetId& FriendId, const FString& ListName)
{
	TSharedPtr<FOnlineFriend> Friend = GetFriend(LocalUserNum, FriendId, ListName);
	if (Friend.IsValid() &&
		Friend->GetInviteStatus() == EInviteStatus::Accepted)
	{
		return true;
	}
	return false;
}
Exemple #7
0
void CTibia::ShootMagwall(int nTarget, int nSqm)
{
	SCreature *c = 0;
	switch(nTarget)
	{
	case HotkeyCreature::Self:
		c = (SCreature*)GetPlayer();
		break;
	case HotkeyCreature::Target:
		if(PlayerTarget == 0)
			return;
		c = (SCreature*)GetPlayer(PlayerTarget, true);
		break;
	case HotkeyCreature::Friend:
		c = (SCreature*)GetFriend(100); 
		break;
	case HotkeyCreature::Enemy:
		c = (SCreature*)GetEnemy(100); 
		break;
	}

	SContainerInfo cInfo;
	if(c > 0)
	{
		int x = c->X, y = c->Y;
		switch(c->Direction)
		{
		case Direction::North:
			y = y - nSqm;
			break;
		case Direction::East:
			x = x + nSqm;
			break;
		case Direction::South:
			y = y + nSqm;
			break;
		case Direction::West:
			x = x - nSqm;
			break;
		}
		if(bShootFromClosedBp == true)
		{
			CPacket::UseOnXYZ(Items::MagicwallRune, 0, 0, x, y, c->Z);
		}
		else if(FindItem(Items::MagicwallRune, &cInfo) == true)
		{
			CPacket::UseOnXYZ(Items::MagicwallRune, 0x40 + cInfo.Container, cInfo.Position, x, y, c->Z);
		}
	}
}
Exemple #8
0
bool mc::Terrain::Create( ds::Size Size )
{
	Objects = mc::Allocator::NewArray< mc::Core::Object* >( OBJECT_MAX );
	ZeroMemory( Objects, sizeof( mc::Core::Object* ) * OBJECT_MAX );

	Hex = mc::Allocator::NewArray< mc::Hex >( Size.X * Size.Y );

	if( !Hex )
		return false;

	Count = Size.X * Size.Y;
	this->Size = Size;

	ds::VertexArray Verts( Count );

	for(int x = 0; x < Count; x++)
	{
		Hex[ x ].Terrain = this;
		Hex[ x ].Number = x;
		Hex[ x ].Z = ( float )ROW_TO_VEC( x ).Y / ( float )Size.Y + x / ( ( float )Size.X * 100.0f );

		Hex[ x ].Friend[ mc::FriendRightTop ] = GetHex( GetFriend( x, mc::FriendRightTop ) );
		Hex[ x ].Friend[ mc::FriendRight ] = GetHex( GetFriend( x, mc::FriendRight ) );
		Hex[ x ].Friend[ mc::FriendRightBottom ] = GetHex( GetFriend( x, mc::FriendRightBottom ) );
		Hex[ x ].Friend[ mc::FriendLeftBottom ] = GetHex( GetFriend( x, mc::FriendLeftBottom ) );
		Hex[ x ].Friend[ mc::FriendLeft ] = GetHex( GetFriend( x, mc::FriendLeft ) );
		Hex[ x ].Friend[ mc::FriendLeftTop ] = GetHex( GetFriend( x, mc::FriendLeftTop ) );

		Hex[ x ].Center = GetCenterByNumber( x );

		Verts[ x ] = ds::Vertex( Hex[ x ].Center, CL_Green );

		Hex[ x ].Center.Y *= ( float )sin( ConvertDegToRad( ISO_PROJ ) );
	}

	Dot.Create( Verts );

	//LoadHeightMap( "" );

	return true;
}
Exemple #9
0
void CTibia::HotkeyShoot(int nItemID, int nTarget, int nMinHealth)
{
	SContainerInfo cInfo;
	SCreature *c = 0;
	switch(nTarget)
	{
	case HotkeyCreature::Self:
		{
			unsigned int *health = (unsigned int*)Address::PLAYER_HEALTH;
			unsigned int *maxHealth = (unsigned int*)Address::PLAYER_HEALTH_MAX;
			unsigned int *playerID = (unsigned int*)Address::PLAYER_ID;
			if(*health == *maxHealth)
				return;
			if(bShootFromClosedBp == true)
			{
				CPacket::UseOnTarget(nItemID, 0, 0, *playerID);
			}
			else if(FindItem(nItemID, &cInfo) == true)
			{
				CPacket::UseOnTarget(nItemID, 0x40 + cInfo.Container, cInfo.Position, *playerID);
			}
		}break;
	case HotkeyCreature::Target:
		{
			if(PlayerTarget == 0)
				return;
			c = (SCreature*)GetPlayer(PlayerTarget, true);
			if(c == 0)
				return;
			if(c->Health > nMinHealth)
				return;
			if(bShootFromClosedBp == true)
			{
				CPacket::UseOnTarget(nItemID, 0, 0, c->CreatureID);
			}
			else if(FindItem(nItemID, &cInfo) == true)
			{
				CPacket::UseOnTarget(nItemID, 0x40 + cInfo.Container, cInfo.Position, c->CreatureID);
			}
		}break;
	case HotkeyCreature::Friend:
		{
			c = (SCreature*)GetFriend(nMinHealth);
			if(c == 0)
				return;
			if(bShootFromClosedBp == true)
			{
				CPacket::UseOnTarget(nItemID, 0, 0, c->CreatureID);
			}
			else if(FindItem(nItemID, &cInfo) == true)
			{
				CPacket::UseOnTarget(nItemID, 0x40 + cInfo.Container, cInfo.Position, c->CreatureID);
			}
		}break;
	case HotkeyCreature::Enemy:
		{
			c = (SCreature*)GetEnemy(nMinHealth); 
			if(c == 0)
				return;
			if(bShootFromClosedBp == true)
			{
				CPacket::UseOnTarget(nItemID, 0, 0, c->CreatureID);
			}
			else if(FindItem(nItemID, &cInfo) == true)
			{
				CPacket::UseOnTarget(nItemID, 0x40 + cInfo.Container, cInfo.Position, c->CreatureID);
			}
		}break;
	}
}
Exemple #10
0
void	CRTMessenger::SetBlock( u_long idFriend, BOOL bBlock )
{
	Friend* pFriend		= GetFriend( idFriend );
	if( pFriend )
		pFriend->bBlock		= bBlock;
}