Jump to content

[Patch] Traitor!


Guest BThallid

Recommended Posts

What's it do?

This patch allows for players to become a traitor to their original race's team. Imagine running around as a Tauren for the Alliance or a Gnome in the Horde. It is intended as a fun modification. The healing, quests, vendors, and most things work for the traitor players.

How to use it?

The patch requires AllowTwoSide.Interaction.Guild = 1 in the config to allow a player to change without GM intervention by joining the enemy guild. You may want to enable a couple of the other AllowTwoSide options such as chat. The GM command is .character switchteam for manual switching. The player will not be teleported to a safe zone, so once they are switched, they will be attacked if there are guards. There is an additional column added to the characters table in the db to store the faction code of the race. If it doesn't match their original faction or zero, they are considered a traitor. I originally intended it to be used to switch between any of the factions. Be sure to add it from the sql/updates/patchtraitor_characters_characters.sql.

What's wrong with it?

Apart from the fact that the Horde races might be running around in the Alliance, there are a couple of bugs. Ones that are mostly clientside to the best of my knowledge. I don't believe there is a work around for them, but have not thoroughly checked myself.

* Mages cannot get portal training for enemy team (data is sent)

* Some NPC text appears in different language even though you might know the language (a flag for the NPC?)

* Client will not show other languages as a choice to chat with (even with the language skill)

* While in PvP mode, the original team is display on your own portrait instead of the team you are a member of (shows correctly for others)

* PvP achievements may not work correctly (haven't tested)

* Mount vendor NPC gossip for scriptdev requires a work around inside of /scripts/world/npcs_special.cpp to allow mounts to be purchased

Other Caveats

Upon switching sides, it will clear out the current reputation. Technically, this doesn't have to be done, but I thought it a good punishment for becoming a traitor.

Remember, I am still learning.

If anyone has ways to improve upon this, have at it! Have fun!

Where to get it?

For current core:

With git or browse:

git pull git://github.com/BThallid/mangos.git traitor

For Zero:

With git or browse:

git pull git://github.com/BThallid/mangos-zero.git traitor-zero

For One:

With git or browse:

git pull git://github.com/BThallid/mangos-one.git traitor

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

next thing to do is try to put it into a slash command so that we can allow normal accounts to run it or maybe go to an NPC and have them set the command on you...I know I can't do this from a DB standpoint so it ether has to be done in the patch or a script...

Link to comment
Share on other sites

while i am not usually one to condone funserver like functions (with the exception of playerbots) i too see some very useful applications for this.. for instance if you made a special quest that can be picked up by anyone, to become a traitor or smth... yeah this could be a fun mod to play with.

Link to comment
Share on other sites

You could just set the security level for .character switchteam to from 3 to 0.

This command does need to be added to the SQL update for this patch:

DELETE FROM command WHERE name IN('character switchteam');
INSERT INTO command (name, security, help) VALUES
('character switchteam',3,'Syntax: .character switchteam\\r\\n\\r\\nSwitches selected character over to opposing faction.');

Just change the 3 in the query if you want all players to use it.

Link to comment
Share on other sites

The original design was to make it so that when Alliance players joined a guild lead by a Horde player it would then make them switch when they joined.

Thats a good one and I suppose it could also go the other way too....I also remember one of the Devleopers comenting once about finding things Blizzard hasn't even thought of yet and implementing them( I know they were spouting off about coding) but this playerbot and ahbot are three shinning examples of that very same comment plus if handled right would give Mangos users something unique.

Just got done formatting a new patch complete with the sql suggested by UnkleNuke and a brand new shinny Read Me, look here: http://daviper.pastebin.org/361780

Link to comment
Share on other sites

I completely understood the original design. Adding the command does not change that unless a server admin wishes to do so.

To be honest, I prefer the idea of joining an enemy guild, especially because of the system messages informing everyone and his brother that a character has turned traitor.

So much for the element of surprise. lol

@DaViper:

Thanks for feeling my small little bit of SQL was worthy of addition. That makes it officially my first code contribution! Whoo-hoo! :)

Link to comment
Share on other sites

ALL HAIL BThallid! :)

I am too humble to accept any praise. I have posted it to show that anyone willing to try can learn. I am only a beginner with C++; if there are better ways to do anything that I have done, please improve upon it. The client is still restricting quite a bit, hence the bugs that may rear their ugly heads.

Link to comment
Share on other sites

I am too humble to accept any praise. I have posted it to show that anyone willing to try can learn. I am only a beginner with C++; if there are better ways to do anything that I have done, please improve upon it. The client is still restricting quite a bit, hence the bugs that may rear their ugly heads.

Yes there are always better ways, and I'm right now knee deep in them looking...and praise you deserve some but don't let it stop you from learning and improving yourself. Just take it say thank you and keep going! the biggest praise and kindest words I have ever recieve was the guy on the corner Telling me I was number one but I did have to tell him he was using the wrong finger!

Link to comment
Share on other sites

  • 1 month later...
git pul git://github.com/BThallid/mangos.git

More specifically from the 'traitor' branch. So it would be 'git pull git://github.com/BThallid/mangos.git traitor'

BTW: Branch recently updated to allow riding training while a traitor. I had to do a hack so to speak to work around the client's restriction of not allowing the use of the item that teaches the mount. It will teach the purchased mount upon purchase and destroy the item, unless they already know the mount, then it will not destroy the item. In case someone buys the mount over and over.

Link to comment
Share on other sites

Thank you. I finally got this to work on my server. One question though. I noticed on your original post that you said the clearing of reputation did not have to be done.

Other Caveats

Upon switching sides, it will clear out the current reputation. Technically, this doesn't have to be done, but I thought it a good punishment for becoming a traitor.

Could you point me at what would be needed to modify your patch to not clear rep? Again thank you, this is a fun patch.

Link to comment
Share on other sites

In src/game/ReputationMgr.cpp, I added a function called SetBaseDefaults that is called before and after the player's faction is changed. Comment out the section:

               if (faction->Standing != 0)
               {
                   faction->Standing = 0;
                   faction->Changed = true;
               }

You will need to keep the section below that though to make sure the flags for AtWar and such are set.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

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. Privacy Policy Terms of Use