View difference between Paste ID: KieSxH5H and V9ScZfpp
SHOW: | | - or go back to the newest paste.
1
class Tele_Trigger : public CreatureScript
2
{
3-
  public:
3+
	public:
4-
	  Tele_Trigger() : CreatureScript("Tele_Trigger") { }
4+
	Tele_Trigger() : CreatureScript("Tele_Trigger") { }
5
	struct Tele_TriggerAI : public ScriptedAI
6-
	  struct Tele_TriggerAI : public ScriptedAI
6+
	{
7-
	  {
7+
		Tele_TriggerAI(Creature * pCreature) : ScriptedAI(pCreature)
8-
		  Tele_TriggerAI(Creature * pCreature) : ScriptedAI(pCreature)
8+
		{
9-
		  {
9+
			me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
10-
			 me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
10+
			me->SetFloatValue(OBJECT_FIELD_SCALE_X, 0);
11-
			 me->SetFloatValue(OBJECT_FIELD_SCALE_X, 0);
11+
		}
12-
			 Reset();
12+
		
13-
		  }
13+
		void MoveInLineOfSight(Unit * who)
14
		{
15-
		  uint64 PlayerGUID;
15+
			if(!who || (!who->isAlive()) && who->GetTypeId() != TYPEID_PLAYER)
16
				return;
17-
		  void Reset()
17+
18-
		  {
18+
			if(me->IsWithinDistInMap(who, 9.0f) && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) <= 9.0f && who->ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER)
19-
			  PlayerGUID = 0;
19+
			{
20-
		  }
20+
				me->MonsterSay("You cannot be up here!", LANG_UNIVERSAL, who->GetGUID());      
21
				who->ToPlayer()->TeleportTo(0, -13246.55f, 194.03f, 31.00f, 1.09f);
22-
		  void MoveInLineOfSight(Unit * who)
22+
			}
23-
		  {
23+
		}
24-
			  if(!who || (!who->isAlive()) && who->GetTypeId() != TYPEID_PLAYER)
24+
	}
25-
				  return;
25+
	
26
	CreatureAI * GetAI(Creature * c) const
27-
			  if(me->IsWithinDistInMap(who, 9.0f))
27+
	{
28-
			  {
28+
		return new Tele_TriggerAI(c);
29-
			     if(who->GetTypeId() == TYPEID_PLAYER)
29+
	}
30-
			      if(me->GetDistance(who) <= 9.0f)
30+
}
31-
				  {
31+
 
32-
				    PlayerGUID = who->GetGUID();
32+
33
{
34-
				    if(who->ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER)
34+
35-
					{
35+