Skip to content

Commit

Permalink
Merge pull request #16 from dongkui555/奥杜尔BOSS修复
Browse files Browse the repository at this point in the history
奥杜尔boss修复-修复霍迪尔H宝箱一次消失
  • Loading branch information
dongkui555 authored Jan 17, 2024
2 parents 5dd691e + e48488f commit 3df5a4b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
19 changes: 14 additions & 5 deletions src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ class boss_thorim : public CreatureScript
bool _hardMode;
bool _isHitAllowed;
bool _isAlly;
bool _isBUG;
uint8 _trashCounter;

InstanceScript* m_pInstance;
Expand Down Expand Up @@ -469,15 +470,11 @@ class boss_thorim : public CreatureScript
_hardMode = false;
_isArenaEmpty = false;
_hitByLightning = false;
_isBUG = true;

if (Player* t = SelectTargetFromPlayerList(1000))
if (t->GetTeamId() == TEAM_HORDE)
_isAlly = false;
const Map::PlayerList& pl = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
if (Player* p = itr->GetSource())
if (!p->IsGameMaster() && p->GetExactDist(2227.6055f, -381.212555f, 412.133575f) < 140.5f && (p->GetExactDist(2170.8400f, -262.182f, 419.361f) > 33.6f || p->GetPositionZ() > 430))
p->TeleportTo(603, 2075.286621, -106.205582, 412.298859, 5.607742); //传送BUG玩家

SpawnAllNPCs();

Expand Down Expand Up @@ -510,6 +507,7 @@ class boss_thorim : public CreatureScript
events.SetPhase(EVENT_PHASE_START);
events.ScheduleEvent(EVENT_THORIM_START_PHASE1, 20s);
_trashCounter = 0;
_isBUG = false;
}
}
else if (param == ACTION_ALLOW_HIT)
Expand Down Expand Up @@ -571,6 +569,17 @@ class boss_thorim : public CreatureScript

if (who && who->GetPositionZ() > 430 && who->GetTypeId() == TYPEID_PLAYER)
damage = 0;
if (who && _isBUG && who->GetTypeId() == TYPEID_PLAYER)
{
const Map::PlayerList& bug = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = bug.begin(); itr != bug.end(); ++itr)
if (Player* p = itr->GetSource())
{
Unit::Kill(me, p); //秒杀BUG玩家
std::string pname = p->GetPlayerName();
LOG_ERROR("module", "{}尝试BUG托里姆,杀", pname.c_str());
}
}

if (damage >= me->GetHealth())
{
Expand Down
15 changes: 15 additions & 0 deletions src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,21 @@ class instance_ulduar : public InstanceMapScript
m_hodirHardmodeChest.Clear();
}
break;
case TYPE_HODIR_HM_RESET:
if (GameObject* go = instance->GetGameObject(m_hodirHardmodeChest))
{
LOG_ERROR("module", "发现宝箱未损坏,跳过");
break;
}
if (m_auiEncounter[TYPE_HODIR] != DONE)
{
if (Creature* hodir = instance->GetCreature(m_uiHodirGUID))
{
LOG_ERROR("module", "发现宝箱损坏,重新召唤");
SpawnHodirChests(instance->GetDifficulty(), hodir);
}
}
break;
case TYPE_WATCHERS:
m_auiEncounter[type] |= 1 << data;
break;
Expand Down
3 changes: 2 additions & 1 deletion src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ enum UlduarEncounters
TYPE_ALGALON = 13,
TYPE_WATCHERS = 14,
TYPE_HODIR_HM_FAIL = 15,
TYPE_WINTER_CACHE = 16
TYPE_WINTER_CACHE = 16,
TYPE_HODIR_HM_RESET = 17
};

enum UlduarData
Expand Down

0 comments on commit 3df5a4b

Please sign in to comment.