• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[TC]Battleground Forts!

frost

Banned
COMING SOON!

I'm currently working on a donor battleground fort system!
when it is done ill release it here with a guide how to use it etc.

Features it will have:

1)Npc to summon a fort in a battleground, activated by donors items.
2)Timer so it can only be used 1 time per BG.
3)Battleground demolishers to break down forts, activated by donors items.
4)teleport feature to teleport same faction members inside the fort to heal/buff or wtfe you want
5)teleport all non faction players out of your fort if the fort is summoned on a baddie!
6)gunner stations to fight off attacking demolishers
7)Rewards for destroying a team that used a fort.
8)Rewards for winning a bg without using a fort.


COMING SOON!

if you would like to help this project along send me a private message for more details!


Update: well i got the forts partially working in warsong gultch so far but having a few issues with the forts
de-spawning randomly and only summoning half the raid to home locations. after i get this working ill release
what i have so far with a guide to add more bgs to it.


Ok so what i have sofar: and it is not working code do not use this code. it is for referance ONLY:


3 to 5 % done give or take lol
Code:
class BG_Forts : public CreatureScript
{
public:
    BG_Forts() : CreatureScript("BG_Forts_npc") { }
    struct npc_BG_FortsAI : public ScriptedAI
    {
        npc_BG_FortsAI(Creature* creature) : ScriptedAI(creature) { }

	    bool OnGossipHello(Player* player, Creature* creature)
		{

			player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "Activate Fort!"          , GOSSIP_SENDER_MAIN, 1);
			player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, "Teleport Group"            , GOSSIP_SENDER_MAIN, 2);
			player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Summon Demolishers"  , GOSSIP_SENDER_MAIN, 3);
			player->SEND_GOSSIP_MENU(1, creature->GetGUID());
			return true;
		}

		bool OnGossipSelect(Player* player, Creature* creature, uint32 /* sender */, uint32 actions)
		{
			player->PlayerTalkClass->ClearMenus();
			switch (actions)
			{
			case 1:
				// activate fort(spawn fort)
				if (player->GetTeam() == HORDE)
				{
					Horde_Fort();
				}
				else
				{
					Ally_Fort();
				}
				break;
[COLOR="#FF0000"]			case 2:
				if (player->GetTeam() == HORDE)
				{
					if (who->GetTypeId() == TYPEID_PLAYER)
					{
						Player* firstPlayer = who->ToPlayer();
						if (Group* group = firstPlayer->GetGroup())
						{
							for (Group::MemberSlotList::const_iterator itr = group->GetMemberSlots().begin(); itr != group->GetMemberSlots().end(); ++itr)
							{
								Group::MemberSlot const& slot = *itr;
								Player* groupMember = sObjectAccessor->FindPlayer((*itr).guid);
							}
							return true;
						}
						else
							Teleport()
					}
				}
				else
				{

				}

				break;[/COLOR]
			case 3:
				// spawn demolishers
				if (player->GetTeam() == HORDE)
				{

				}
				else
				{

				}
				break;
			}
			return true;
		}

		void Reset()
		{
			PlayersInRaid.clear();
		}

		void Horde_Fort()
		{
			me->MonsterYell("Oh, it seems the Horde are summoning their fortifacation! prepare yourselves Ally their walls are up!", LANG_UNIVERSAL, NULL);
			timer = 80000;
			//walls
			me->SummonGameObject(190370, 116.92517f, 1462.48181f, 316.491455f, 4.8f, 0, 0, 0, 0, 0);
			me->SummonGameObject(190370, 1051.43176f, 1537.91003f, 232.045532f, 2.2f, 0, 0, 0, 0, 0);
			//cannons
			me->SummonCreature(34935, 1075.01928f, 1510.82104f, 340.702576f, 6.3f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34935, 1087.58630f, 1475.36391f, 341.953278f, 6.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34935, 1083.52075f, 1451.50573f, 345.178009f, 6.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34935, 1055.22766f, 1395.45837f, 339.431458f, 6.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34935, 1069.27734f, 1375.13574f, 340.452057f, 6.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			//demolishers
		}
		void Ally_Fort()
		{
			//set a timer that tells them the team activated forts 1 min till spawn!
			me->MonsterYell("Oh, it seems the Ally are summoning their fortifacation! prepare yourselves Horde their walls are up!", LANG_UNIVERSAL, NULL);
			timer = 80000;
			//walls
			me->SummonGameObject(190370, 1364.400269f, 1461.437256f, 324.549896f, 4.6f, 0, 0, 0, 0, 0);
			me->SummonGameObject(190370, 1397.39794f, 1400.10022f, 339.063049f, 5.3f, 0, 0, 0, 0, 0);
			//cannons
			me->SummonCreature(34929, 1413.16369f, 1543.62390f, 342.964294f, 3.5f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34929, 1401.82690f, 1565.86181f, 343.421753f, 3.5f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34929, 1391.05017f, 1477.570076f, 348.804291f, 3.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34929, 1378.68078f, 1432.63256f, 344.227325f, 3.0f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			me->SummonCreature(34929, 1386.34509f, 1416.67272f, 351.61673f, 3.5f, TEMPSUMMON_MANUAL_DESPAWN, 0);
			//demolishers
		}

[COLOR="#FF0000"]		void Teleport()
		{
			for (std::vector<Player*>::const_iterator itr = PlayersInRaid.begin(); itr != PlayersInRaid.end(); ++itr)
				if ((*itr) && (*itr)->IsInWorld() && (*itr)->IsAlive() && (*itr)->GetMapId() == me->GetMapId())
					(*itr)->TeleportTo(me->GetMapId(), me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ(), 0);
		}

[/COLOR]

	private:
		std::vector<Player*> PlayersInRaid;
		uint32 timer;
	};

	CreatureAI* GetAI(Creature* creature) const
	{
		return new npc_BG_FortsAI(creature);
	}
};

void AddSC_BG_Forts()
{
	new BG_Forts();
}
 
Last edited:

callmephil

Respected Member
What do you mean by fort?
What can you do it's doing a npc who's building bareer around the base in battleground with tower defense.
if you are a donor you can buy special bareer for you're team so it will give you advantage to win the battleground.

For Warsong you can buy multiple amelioration like flag career jumper or graveyard defender etc.
For Arathi you can buy base defense like wall or something.
anw nice idea.
 

frost

Banned
What do you mean by fort?
What can you do it's doing a npc who's building bareer around the base in battleground with tower defense.
if you are a donor you can buy special bareer for you're team so it will give you advantage to win the battleground.

For Warsong you can buy multiple amelioration like flag career jumper or graveyard defender etc.
For Arathi you can buy base defense like wall or something.
anw nice idea.

yes. it will have destructable walls in the forts so u can use seige wepons to tear down the walls :)
 

frost

Banned
well im having issues getting the forts to spawn all at 1 time. but it is not. im still working on it. its not very easy since i had to spawn the objects manually lol
 

frost

Banned
coming very close to a release of the warsong script
i think i might redo it as im having issues with my current code lol


this is my teleport code and i dont understand why it is only summoning half the raid. i put 7 ppl in a raid and only 5 was summoned
and oddly it only works sometimes. sometimes it dont summon anyone lol

Code:
		void Teleport()
		{
			for (std::vector<Player*>::const_iterator itr = PlayersInRaid.begin(); itr != PlayersInRaid.end(); ++itr)
				if ((*itr) && (*itr)->IsInWorld() && (*itr)->IsAlive() && (*itr)->GetMapId() == me->GetMapId())
					(*itr)->TeleportTo(me->GetMapId(), me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ(), 0);
		}

	private:
		std::vector<Player*> PlayersInRaid;
		uint32 timer;
	};

thankyou tommy for the idea to use the vector to itr though players in a raid!
 
Last edited:

Tommy

Founder
coming very close to a release of the warsong script
i think i might redo it as im having issues with my current code lol


this is my teleport code and i dont understand why it is only summoning half the raid. i put 7 ppl in a raid and only 5 was summoned
and oddly it only works sometimes. sometimes it dont summon anyone lol

Code:
		void Teleport()
		{
			for (std::vector<Player*>::const_iterator itr = PlayersInRaid.begin(); itr != PlayersInRaid.end(); ++itr)
				if ((*itr) && (*itr)->IsInWorld() && (*itr)->IsAlive() && (*itr)->GetMapId() == me->GetMapId())
					(*itr)->TeleportTo(me->GetMapId(), me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ(), 0);
		}

	private:
		std::vector<Player*> PlayersInRaid;
		uint32 timer;
	};

thankyou tommy for the idea to use the vector to itr though players in a raid!

Are the players you're Teleporting in the 'Map' and 'IsAlive()'?

Would be nice to know how you're inputting the elements in the vector.
 

Rochet2

Moderator / Eluna Dev
Note that its dangerous to store pointers (Player* etc.) overtime. (unless you know what you are doing)
If a player logs out, a pointer doesnt magically turn into NULL. Crashes will result.
Store guids or make sure the pointers will never be invalid.

You have used the name "raid", but are the areas instanced?
 
Last edited:

frost

Banned
Note that its dangerous to store pointers (Player* etc.) overtime. (unless you know what you are doing)
If a player logs out, a pointer doesnt magically turn into NULL. Crashes will result.
Store guids or make sure the pointers will never be invalid.

You have used the name "raid", but are the areas instanced?

yes it is in warsong gultch. a battleground and i think i know the issue.

some of the people in the raid was dead so (*itr)->IsAlive() is not summoning them lol
back to the drawing board.

and when someone goes offline in a bg they are removed from the raid right?
 
Last edited:

frost

Banned
It is not the whole code?
PlayersInRaid is not filled anywhere, just used and cleared.



Yes, but it depends on what you mean with that.
Not from the vector currently.

sorry i pasted the old file i repasted it and highlited it in red :/

im a noob what do you expect? lol
 
Top