hi all. i ahve this phase out dueling script it works fine in core and so, but when i duel in-game it phase out the falg too so it will be like ppl and fleeing and can i get help to fix it?
i saw on ******* that someon had post a V2 but that one did not work i get error on complite. here is my script.
thx for all your help and support^^
i saw on ******* that someon had post a V2 but that one did not work i get error on complite. here is my script.
#include "MapManager.h"
class PhasedDueling : public PlayerScript
{
public:
PhasedDueling() : PlayerScript("PhasedDueling") { }
void OnDuelStart(Player* firstplayer, Player* secondplayer)
{
uint32 PlayersInsidePhase = 0;
uint32 PhaseToCheck = 1;
Map* map = sMapMgr->FindMap(firstplayer->GetMapId(), firstplayer->GetInstanceId());
if (!map)
return;
Map:layerList const& players = map->GetPlayers();
for (Map:layerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
Player* check = itr->GetSource();
if (!check || !check->GetSession())
continue;
if (check->GetPhaseMask() == PhaseToCheck)
{
++PlayersInsidePhase;
++PhaseToCheck;
PlayersInsidePhase = 0;
}
}
if (PlayersInsidePhase == 0)
{
firstplayer->SetPhaseMask(PhaseToCheck, true);
secondplayer->SetPhaseMask(PhaseToCheck, true);
}
}
};
void AddSC_PhasedDueling()
{
new PhasedDueling();
}
thx for all your help and support^^