mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-18 01:24:35 +00: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))
|
if (summoner->IsWithinLOS(x, y, z))
|
||||||
{
|
{
|
||||||
bool allowed = sPlayerbotAIConfig->botReviveWhenSummon == 2 || (sPlayerbotAIConfig->botReviveWhenSummon == 1 && !master->IsInCombat() && master->IsAlive());
|
if (sPlayerbotAIConfig->botReviveWhenSummon < 2)
|
||||||
if (allowed && bot->isDead())
|
{
|
||||||
|
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->ResurrectPlayer(1.0f, false);
|
||||||
bot->DurabilityRepairAll(false, 1.0f, false);
|
bot->DurabilityRepairAll(false, 1.0f, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user