mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 02:23:49 +00:00
refactor(Scripts/EasternKingdoms): code cleanup (part 5) - also fix potential crash (#6923)
This commit is contained in:
@@ -100,8 +100,7 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
Talk(SAY_SPIDER_SPAWN);
|
||||
Creature* Spider = nullptr;
|
||||
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Spider)
|
||||
Spider->AI()->AttackStart(target);
|
||||
Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
|
||||
@@ -91,8 +91,7 @@ public:
|
||||
{
|
||||
if (Ambush_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
{
|
||||
me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation());
|
||||
@@ -127,14 +126,17 @@ public:
|
||||
{
|
||||
if (Aggro_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
|
||||
if (DoGetThreat(me->GetVictim()))
|
||||
{
|
||||
DoModifyThreatPercent(me->GetVictim(), -50);
|
||||
}
|
||||
|
||||
if (target)
|
||||
{
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
Aggro_Timer = urand(7000, 20000);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
|
||||
@@ -102,22 +102,16 @@ public:
|
||||
{
|
||||
case DATA_LORKHAN:
|
||||
return _zealotLorkhanGUID;
|
||||
break;
|
||||
case DATA_ZATH:
|
||||
return _zealotZathGUID;
|
||||
break;
|
||||
case DATA_THEKAL:
|
||||
return _highPriestTekalGUID;
|
||||
break;
|
||||
case DATA_JINDO:
|
||||
return _jindoTheHexxerGUID;
|
||||
break;
|
||||
case NPC_ARLOKK:
|
||||
return _arlokkGUID;
|
||||
break;
|
||||
case GO_GONG_OF_BETHEKK:
|
||||
return _goGongOfBethekkGUID;
|
||||
break;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
|
||||
Reference in New Issue
Block a user