ah, yea SafeTeleport uses mapid, instanceid, x, y, z, o.
Code:
//EventSystem coded by Cyanide
//Copyright (c) Cyanide 2009
#include "StdAfx.h"
#include "Setup.h"
#include <string>
#include <iostream>
using namespace std;
static string infoHelp, join, start, end;
float sx,sy,sz,so;
uint32 smapid,sinstanceid;
bool evon;
bool EventSystem(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
{
join = "#join";
start = "#eventstart";
end = "#eventend";
if(Message == join)
{
if(evon)
{
if(pPlayer->CombatStatus.IsInCombat())
{
pPlayer->BroadcastMessage("You cannot teleport in combat.");
return true;
}
else
{
pPlayer->SafeTeleport(smapid, sinstanceid, sx, sy, sz, so);
return true;
}
return false;
}
else
{
return true;
}
return false;
}
if(Message == start && pPlayer->GetSession()->CanUseCommand('a'))
{
if(evon)
{
pPlayer->BroadcastMessage("There is already an event summoning wait for it to finish.");
return true;
}
else
{
evon = true;
char Msg[255];
sprintf(Msg, "|cff0066cc[Event System]|r |cff00ff00%s has started an event! Type #join to join!|r", pPlayer->GetName());
sWorld.SendWorldText(Msg);
return true;
sx = pPlayer->GetPositionX();
sy = pPlayer->GetPositionY();
sz = pPlayer->GetPositionZ();
so = pPlayer->GetOrientation();
smapid = pPlayer->GetMapId();
sinstanceid = pPlayer->GetInstanceID();
return true;
}
return false;
}
else
{
return true;
}
if(Message == end && pPlayer->GetSession()->CanUseCommand('a'))
{
if(evon)
{
evon = false;
char Msg[255];
sprintf(Msg, "|cff0066cc[Event System]|r |cff00ff00%s has ended summons to the event.", pPlayer->GetName());
sWorld.SendWorldText(Msg);
return true;
}
else
{
pPlayer->BroadcastMessage("There is no event summoning going on right now.");
return true;
}
return false;
}
else
{
return true;
}
return false;
}
void SetupEventCmd(ScriptMgr * mgr)
{
evon = false;
mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, (bool *) EventSystem);
}