Skip to content

Commit

Permalink
Ticket fixes (azerothcore#71)
Browse files Browse the repository at this point in the history
* Fix escort quest
* Fix specific boss health issues
  • Loading branch information
fischerlol committed Aug 4, 2022
1 parent 036f4f2 commit 50b8573
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions modules/mod-player-settings/src/PlayerSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,12 @@ class PlayerSettingsAllCreatureScript : public AllCreatureScript

uint32 scaledCurrentHealth = previousHealth && previousMaxHealth ? float(scaledHealth) / float(previousMaxHealth) * float(previousHealth) : 0;

creature->SetHealth(scaledCurrentHealth);
creature->UpdateAllStats();
static bool initialized;
if (!initialized) {
initialized = true;
creature->SetHealth(scaledCurrentHealth);
creature->UpdateAllStats();
}
}
};

Expand Down
12 changes: 10 additions & 2 deletions src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,24 @@ class npc_rinji : public CreatureScript
{
npc_rinjiAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
_IsByOutrunner = false;
spawnId = 0;
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
}

void Reset() override
void Initialize()
{
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetFaction(35);
postEventCount = 0;
postEventTimer = 3000;
}

void Reset() override
{
Initialize();
}

void JustRespawned() override
{
_IsByOutrunner = false;
Expand Down Expand Up @@ -137,6 +144,7 @@ class npc_rinji : public CreatureScript
void sQuestAccept(Player* player, Quest const* quest) override
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE);
me->SetFaction(126);
if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
{
if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
Expand Down

0 comments on commit 50b8573

Please sign in to comment.