mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Conditions for Summon
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user