Jump to content

c++ remove polymorphe dmg


Recommended Posts

char_battle.cpp

Check:


 

Spoiler

bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)

Check this now:

Spoiler

    DWORD dwCurrentTime = get_dword_time();

    if (IsPC())
    {

add this:

Spoiler

    if (IsPolymorphed() == true)
       return false;

Looks like it:

Spoiler

bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
{
    if (test_server)
        sys_log(0, "[TEST_SERVER] Attack : %s type %d, MobBattleType %d", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
    //PROF_UNIT puAttack("Attack");
    if (!CanMove())
        return false;

    // CASTLE
    if (IS_CASTLE_MAP(GetMapIndex()) && false == castle_can_attack(this, pkVictim))
        return false;
    // CASTLE

    DWORD dwCurrentTime = get_dword_time();

    if (IsPC())
    {

    if (IsPolymorphed())
        return false;

        if (IS_SPEED_HACK(this, pkVictim, dwCurrentTime))
            return false;

        if (bType == 0 && dwCurrentTime < GetSkipComboAttackByTime())
            return false;
    }
    else .. // ..etc etc etc

 

Link to comment
Share on other sites

[File: src/game/char_battle.cpp -> Functionbool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)]

	if (!IsGM() && IsPolymorphed() && pkVictim->IsPC()) // If you are GM, you can attack other player when u are polymorphed, but if you not are a GM, cannot make this.
	{	
		ChatPacket(CHAT_TYPE_INFO, "<<Debug>> Victim %s is a player, you cannot attack him!", pkVictim->GetName());
		return false;
	}	

 

6b364c94b2a74987a4d1e5f85fab55a4.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

 

	int m_nCheckMyLevel = 15, m_nCheckVictimLevel = 15;
		
	if (!IsGM() && IsPolymorphed() && pkVictim->IsPC()) /** If you are GM, you can attack other player when u are polymorphed, but if you not are a GM, cannot make this. **/
	{
		if (GetLevel() < m_nCheckMyLevel && pkVictim->GetLevel() >= m_nCheckVictimLevel) /** If you have level the lesser 15 and your victim the level as high as 15, you will not be able to attack him. **/
		{	
			ChatPacket(CHAT_TYPE_INFO, "<<Debug>> Informations about victim <Name: %s> <Level: %d>, cannot make that.", pkVictim->GetName(), pkVictim->GetLevel());
			return false;
		}
	}

m_nCheckMyLevel = /** Check if you have the lesser 15 **/
m_nCheckVictimLevel = /** Check if the victim is greater than or equal to 15. **/
Link to comment
Share on other sites

19 hours ago, VegaS said:

 


	int m_nCheckMyLevel = 15, m_nCheckVictimLevel = 15;
		
	if (!IsGM() && IsPolymorphed() && pkVictim->IsPC()) /** If you are GM, you can attack other player when u are polymorphed, but if you not are a GM, cannot make this. **/
	{
		if (GetLevel() < m_nCheckMyLevel && pkVictim->GetLevel() >= m_nCheckVictimLevel) /** If you have level the lesser 15 and your victim the level as high as 15, you will not be able to attack him. **/
		{	
			ChatPacket(CHAT_TYPE_INFO, "<<Debug>> Informations about victim <Name: %s> <Level: %d>, cannot make that.", pkVictim->GetName(), pkVictim->GetLevel());
			return false;
		}
	}

 


m_nCheckMyLevel = /** Check if you have the lesser 15 **/
m_nCheckVictimLevel = /** Check if the victim is greater than or equal to 15. **/

 

I don't want that, I want, when a player level 5-15, in his empire, can't attack anymore another player of another empire.

Link to comment
Share on other sites

	if (!IsGM() && IsPolymorphed() && pkVictim->IsPC() && 5 <= GetLevel() && GetLevel() <= 15)
	{
		if (GetEmpire() != pkVictim->GetEmpire()){
			const char * m_nEmpire[EMPIRE_MAX_NUM] = {"", "Red", "Yellow", "Jinno"};
				
			for (int index = 1; index < 3; index++) {	
				if (pkVictim->GetEmpire() == index) {	
					ChatPacket(CHAT_TYPE_INFO, "<<Debug>> Informations about victim <Name: %s> <Level: %d> <Empire %s> cannot make that!", pkVictim->GetName(), pkVictim->GetLevel(), m_nEmpire[index]);
					return false;
				}	
			}
		}	
	}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.