Marty-v58/source-server/Srcs/Server/game/src/questlua_danceevent.cpp
2024-06-01 15:59:51 -05:00

53 lines
976 B
C++

#include "stdafx.h"
#include "questmanager.h"
#include "sectree_manager.h"
#include "char.h"
namespace quest
{
struct FWarpToHome
{
void operator() ( LPENTITY ent )
{
if ( ent->IsType(ENTITY_CHARACTER) )
{
LPCHARACTER ch = (LPCHARACTER) ent;
if ( ch->IsPC() == true && ch->IsGM() != true )
{
if ( ((ch->GetX() >= 764503 && ch->GetX() <= 772362) && (ch->GetY() >= 22807 && ch->GetY() <= 26499)) == false )
{
ch->GoHome();
}
}
}
};
};
ALUA(dance_event_go_home)
{
LPSECTREE_MAP pSecMap = SECTREE_MANAGER::instance().GetMap( 115 );
if ( pSecMap != NULL )
{
FWarpToHome f;
pSecMap->for_each( f );
}
return 0;
}
void RegisterDanceEventFunctionTable()
{
luaL_reg dance_event_functions[] =
{
{ "gohome", dance_event_go_home },
{ NULL, NULL}
};
CQuestManager::instance().AddLuaFunctionTable("dance_event", dance_event_functions);
}
}
//martysama0134's 623a0779c74cb7565145d45548376308