// In miliseconds
#define FIRST_TELEDELAY 10000 // Teleport delay to first place 这里都是设置传送的时间间隔的地方,。都是以毫秒来计算的
#define SECOND_TELEDELAY 20000 // Teleport delay to second place
#define THIRD_TELEDELAY 30000 // Teleport delay to third place
#define FOURTH_TELEDELAY 40000 // Teleport delay to fourth place
#define BACK_TELEDELAY 50000 // Teleport delay to back
class FirstTeleport : public BasicEvent
{
public:
FirstTeleport(Player* player) : _Plr(player) {}
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_Plr->TeleportTo(530, -1880.0f, 5381.0f, -12.0f, 1.0f); // Here you can define the coordenates 传送地址的填写咯
_Plr->GetSession()->SendAreaTriggerMessage("Here is Shattrath, this place you can buy itens, join bgs, blablabla..."); // Any description you want...
return true;
}
Player* _Plr;
};
class SecondTeleport : public BasicEvent
{
public:
SecondTeleport(Player* player) : _Plr(player) {}
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_Plr->TeleportTo(0, -13196.0f, 283.0f, 22.0f, 2.0f); // Here you can define the coordenates 这个也是执行传送的地方。。传送地址你就自己定义了
_Plr->GetSession()->SendAreaTriggerMessage("Here is Gurubashi, this place is a great pvp area, blablabla..."); // Any description you want...
return true;
}
Player* _Plr;
};
class ThirdTeleport : public BasicEvent
{
public:
ThirdTeleport(Player* player) : _Plr(player) {}
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_Plr->TeleportTo(0, -14285.0f, 557.5f, 9.0f, 4.0f); // Here you can define the coordenates
_Plr->GetSession()->SendAreaTriggerMessage("Here is Booty Bay, blablabla..."); // Any description you want...
return true;
}
Player* _Plr;
};
class FourthTeleport : public BasicEvent
{
public:
FourthTeleport(Player* player) : _Plr(player) {}
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_Plr->TeleportTo(1, 16224.0f, 16254.0f, 13.0f, 2.0f); // Here you can define the coordenates
_Plr->GetSession()->SendAreaTriggerMessage("Here is GmIsland, blablablabla..."); // Any description you want...
return true;
}
Player* _Plr;
};
class BackTeleport : public BasicEvent
{
public:
BackTeleport(Player* player) : _Plr(player) {}
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_Plr->TeleportTo(_Plr->GetStartPosition()); // Back to start location
_Plr->GetSession()->SendAreaTriggerMessage("Presentation finished, Enjoy!"); // Any description you want...
return true;
}
Player* _Plr;
};
class PresentationOfTheServer : public PlayerScript
{
public:
PresentationOfTheServer() : PlayerScript("PresentationOfTheServer") {}
void OnLogin(Player* player)
{
if(player->GetTotalPlayedTime() < 5) //下面的这些就是重要的地方了。主要是设置系统事件来执行对应的事件和任务。。类似单机版中的计划任务了吧
{
player->GetSession()->SendAreaTriggerMessage("The system will teleport you in few seconds to present some things!"); // Initial message before starting...
player->m_Events.AddEvent(new FirstTeleport(player), player->m_Events.CalculateTime(FIRST_TELEDELAY));
player->m_Events.AddEvent(new SecondTeleport(player), player->m_Events.CalculateTime(SECOND_TELEDELAY));
player->m_Events.AddEvent(new ThirdTeleport(player), player->m_Events.CalculateTime(THIRD_TELEDELAY));
player->m_Events.AddEvent(new FourthTeleport(player), player->m_Events.CalculateTime(FOURTH_TELEDELAY));
player->m_Events.AddEvent(new BackTeleport(player), player->m_Events.CalculateTime(BACK_TELEDELAY));
}
}
};
void AddSC_PresentationOfTheServer()
{
new PresentationOfTheServer;
}