View difference between Paste ID: SB8btKM5 and 7KxSrdri
SHOW: | | - or go back to the newest paste.
1
#include "ScriptPCH.h"
2
3
class MageTable_SoulwellArena : public PlayerScript
4
{
5
public:
6-
	MageTable_SoulwellArena() : PlayerScript("MageTable_SoulwellArena") {  }
6+
    MageTable_SoulwellArena() : PlayerScript("MageTable_SoulwellArena") { }
7-
	
7+
8-
	void OnUpdateZone(Player* player, uint32 zone, uint32 area)
8+
    void OnUpdateZone(Player* player, uint32 zone, uint32 area)
9-
	{
9+
    {
10-
		float x = player->GetPositionX();
10+
        uint32 entry = 0;
11-
		float y = player->GetPositionY();
11+
        if (player->getClass() == CLASS_MAGE)
12-
		float z = player->GetPositionZ();
12+
            entry = 193061;
13-
		float ang = player->GetOrientation();
13+
        if (player->getClass() == CLASS_WARLOCK)
14-
		float rot2 = std::sin(ang/2);
14+
            entry = 193169;
15-
		float rot3 = std::cos(ang/2);
15+
16-
		
16+
        if (!entry)
17-
		switch (player->getClass())
17+
            return;
18-
		{
18+
19-
		case CLASS_MAGE:
19+
        if (zone == 3698 ||
20-
			{
20+
            zone == 3702 ||
21-
				if (zone == 3698)
21+
            zone == 4378 ||
22-
				{
22+
            zone == 3968 ||
23-
					player->SummonGameObject(193061, x, y, z, ang, 0, 0, rot2, rot3, 30);
23+
            zone == 4406)
24-
				}
24+
        {
25-
				if (zone == 3702)
25+
            if (player->FindNearestGameObject(entry, SIZE_OF_GRIDS))
26-
				{
26+
                return;
27-
					player->SummonGameObject(193061, x, y, z, ang, 0, 0, rot2, rot3, 30);
27+
28-
				}
28+
            float x, y, z, ang;
29-
				if (zone == 4378)
29+
            player->GetPosition(x, y, z, ang);
30-
				{
30+
            float rot2 = std::sin(ang / 2);
31-
					player->SummonGameObject(193061, x, y, z, ang, 0, 0, rot2, rot3, 30);
31+
            float rot3 = std::cos(ang / 2);
32-
				}
32+
33-
				if (zone == 3968)
33+
            player->SummonGameObject(entry, x, y, z, ang, 0, 0, rot2, rot3, 30);
34-
				{
34+
        }
35-
					player->SummonGameObject(193061, x, y, z, ang, 0, 0, rot2, rot3, 30);
35+
    }
36-
				}
36+
37-
				if (zone == 4406)
37+
38-
				{
38+
39-
					player->SummonGameObject(193061, x, y, z, ang, 0, 0, rot2, rot3, 30);
39+
40-
				}
40+
    new MageTable_SoulwellArena;
41-
				break;
41+