Is this code correctly implemented.

Hi all, I wrote code that implemented 4 spells for the battered hilt quest line.

First of all I want to know if it is done in the proper way.

Spells Implemented here:

http://old.wowhead.com/spell=70971 --Female Silver Covenant disguise

http://old.wowhead.com/spell=70972 --Male Silver Covenant Disguise

http://old.wowhead.com/spell=70973 --Female Sunreaver disguise

http://old.wowhead.com/spell=70974 --Male Sunreaver disguise

Full code: Dalaran.cpp


            switch (me->GetEntry())

            {

                case 29254:

                    if (pPlayer->GetTeam() == HORDE)              // Horde unit found in Alliance area

                    {

						if (pPlayer->HasAura(70971) || pPlayer->HasAura(70972)) // Check if player has Silver covenant disguise on

						{

							break;

						}

                        if (GetClosestCreatureWithEntry(me, NPC_APPLEBOUGH_A, 32.0f))

                        {

                            if (me->isInBackInMap(pWho, 12.0f))   // In my line of sight, "outdoors", and behind me

                                DoCast(pWho, SPELL_TRESPASSER_A); // Teleport the Horde unit out

                        }

                        else                                      // In my line of sight, and "indoors"

                            DoCast(pWho, SPELL_TRESPASSER_A);     // Teleport the Horde unit out

                    }

                    break;

                case 29255:

                    if (pPlayer->GetTeam() == ALLIANCE)           // Alliance unit found in Horde area

                    {

						if (pPlayer->HasAura(70973) || pPlayer->HasAura(70974)) // Check if player has Sunreaver disguise on

						{

							break;

						}

                        if (GetClosestCreatureWithEntry(me, NPC_SWEETBERRY_H, 32.0f))

                        {

                            if (me->isInBackInMap(pWho, 12.0f))   // In my line of sight, "outdoors", and behind me

                                DoCast(pWho, SPELL_TRESPASSER_H); // Teleport the Alliance unit out

                        }

                        else                                      // In my line of sight, and "indoors"

                            DoCast(pWho, SPELL_TRESPASSER_H);     // Teleport the Alliance unit out

                    }

                    break;

            }

The code that I added


						if (pPlayer->HasAura(70971) || pPlayer->HasAura(70972)) // Check if player has Silver covenant disguise on

						{

							break;

						}

And


						if (pPlayer->HasAura(70973) || pPlayer->HasAura(70974)) // Check if player has Sunreaver disguise on

						{

							break;

						}

And now for my second question. How to write a Patch for this code ? and how to apply it ? --My server is set up exactly like the tutorial said.

2nd question: Google is amazing → http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/

Also your topic name shouldn’t be so general. Please change it to reflect what your post is about.