Jump to content
×
×
  • Create New...
  • 0

Help Simple function in C++


DeYaN.

Question

Hei everybody. I try to disable the polymorph in PVP. 

 

I make this in char_battle.cpp:

Spoiler

 

if (IsPolymorphed() == true && IsPC())

   RemoveAffect(AFFECT_POLYMORPH);

   ChatPacket(CHAT_TYPE_INFO, "Transformarea in modul PVP este interzisa!");

 

 

 

But this is work for all atack :)) (monster/player) So now if i atack a monster/player the polymorph effect are remove :)), i want only to players

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
11 minutes ago, Tasho said:
if (IsPC() && IsPolymorphed() && pkVictim->IsPC())

 

Thx you for reply , already test this , is working but if i kill a mob (don`t remove the polymorph) but i receive in chat the message: " Transformarea in modul PVP este interzisa! " and i dont understand why :)))

Link to comment
Share on other sites

  • 0

Because you need to use a block condition. ( { } )

if (IsPC() && IsPolymorphed() && pkVictim->IsPC())
{
	RemoveAffect(AFFECT_POLYMORPH);
	ChatPacket(CHAT_TYPE_INFO, "Transformarea in modul PVP este interzisa!");
}

 

  • Love 1
Link to comment
Share on other sites

  • 0

Yeaahh you have right , i forgotten to use the   { } :D

 

And for another system , to dezvolte this function ...  It is work for the hit  but who i make it to work for the player skill ? 

Link to comment
Share on other sites

  • 0

Is same code.

//char_skill.cpp
bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaster)
{
	if (IsPC() && IsPolymorphed() && pkVictim->IsPC())
	{
		RemoveAffect(AFFECT_POLYMORPH);
		ChatPacket(CHAT_TYPE_INFO, "Transformarea in modul PVP este interzisa!");
	}

	[..........................................]
}
  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.