Skip to content

Commit

Permalink
Merge pull request liyunfan1223#315 from noisiver/summon-conditions
Browse files Browse the repository at this point in the history
Conditions for Summon
  • Loading branch information
liyunfan1223 authored Jul 10, 2024
2 parents 51d3b0e + c3ec1da commit 9d4c478
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/strategy/actions/UseMeetingStoneAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,28 @@ bool SummonAction::Teleport(Player* summoner, Player* player)

if (summoner->IsWithinLOS(x, y, z))
{
bool allowed = sPlayerbotAIConfig->botReviveWhenSummon == 2 || (sPlayerbotAIConfig->botReviveWhenSummon == 1 && !master->IsInCombat() && master->IsAlive());
if (allowed && bot->isDead())
if (sPlayerbotAIConfig->botReviveWhenSummon < 2)
{
if (master->IsInCombat())
{
botAI->TellError("You cannot summon me while you're in combat");
return false;
}

if (!master->IsAlive())
{
botAI->TellError("You cannot summon me while you're dead");
return false;
}

if (bot->isDead() && !bot->HasPlayerFlag(PLAYER_FLAGS_GHOST))
{
botAI->TellError("You cannot summon me while I'm dead, you need to release my spirit first");
return false;
}
}

if (sPlayerbotAIConfig->botReviveWhenSummon > 0 && bot->isDead())
{
bot->ResurrectPlayer(1.0f, false);
bot->DurabilityRepairAll(false, 1.0f, false);
Expand Down

0 comments on commit 9d4c478

Please sign in to comment.