Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Tele_Trigger : public CreatureScript
- {
- public:
- Tele_Trigger() : CreatureScript("Tele_Trigger") { }
- struct Tele_TriggerAI : public ScriptedAI
- {
- Tele_TriggerAI(Creature * pCreature) : ScriptedAI(pCreature)
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFloatValue(OBJECT_FIELD_SCALE_X, 0);
- }
- void MoveInLineOfSight(Unit * who)
- {
- if(!who || (!who->isAlive()) && who->GetTypeId() != TYPEID_PLAYER)
- return;
- if(me->IsWithinDistInMap(who, 9.0f) && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) <= 9.0f && who->ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER)
- {
- me->MonsterSay("You cannot be up here!", LANG_UNIVERSAL, who->GetGUID());
- who->ToPlayer()->TeleportTo(0, -13246.55f, 194.03f, 31.00f, 1.09f);
- }
- }
- }
- CreatureAI * GetAI(Creature * c) const
- {
- return new Tele_TriggerAI(c);
- }
- }
- void AddSC_npc_tele_trigger()
- {
- new Tele_Trigger();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement