本文整理汇总了C++中GetMapId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMapId函数的具体用法?C++ GetMapId怎么用?C++ GetMapId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMapId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetHeightStatic
GridMapLiquidStatus TerrainInfo::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, GridMapLiquidData* data) const
{
GridMapLiquidStatus result = LIQUID_MAP_NO_WATER;
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
uint32 liquid_type = 0;
float liquid_level = INVALID_HEIGHT_VALUE;
float ground_level = GetHeightStatic(x, y, z, true, DEFAULT_WATER_SEARCH);
if (vmgr->GetLiquidLevel(GetMapId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type))
{
// DEBUG_LOG("getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type);
// Check water level and ground level
if (liquid_level > ground_level && z > ground_level - 2)
{
// All ok in water -> store data
if (data)
{
// hardcoded in client like this
if (GetMapId() == 530 && liquid_type == 2)
liquid_type = 15;
uint32 liquidFlagType = 0;
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquid_type))
liquidFlagType = liq->Type;
if (liquid_type && liquid_type < 21)
{
if (AreaTableEntry const* area = GetAreaEntryByAreaFlagAndMap(GetAreaFlag(x, y, z), GetMapId()))
{
uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType];
if (!overrideLiquid && area->zone)
{
area = GetAreaEntryByAreaID(area->zone);
if (area)
overrideLiquid = area->LiquidTypeOverride[liquidFlagType];
}
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid))
{
liquid_type = overrideLiquid;
liquidFlagType = liq->Type;
}
}
}
data->level = liquid_level;
data->depth_level = ground_level;
data->entry = liquid_type;
data->type_flags = 1 << liquidFlagType;
}
// For speed check as int values
int delta = int((liquid_level - z) * 10);
// Get position delta
if (delta > 20) // Under water
return LIQUID_MAP_UNDER_WATER;
if (delta > 0) // In water
return LIQUID_MAP_IN_WATER;
if (delta > -1) // Walk on water
return LIQUID_MAP_WATER_WALK;
result = LIQUID_MAP_ABOVE_WATER;
}
}
else if (GridMap* gmap = const_cast<TerrainInfo*>(this)->GetGrid(x, y))
{
GridMapLiquidData map_data;
GridMapLiquidStatus map_result = gmap->getLiquidStatus(x, y, z, ReqLiquidType, &map_data);
// Not override LIQUID_MAP_ABOVE_WATER with LIQUID_MAP_NO_WATER:
if (map_result != LIQUID_MAP_NO_WATER && (map_data.level > ground_level))
{
if (data)
{
// hardcoded in client like this
if (GetMapId() == 530 && map_data.entry == 2)
map_data.entry = 15;
*data = map_data;
}
return map_result;
}
}
return result;
}
示例2: HandlePlayerUnderMap
bool BattlegroundNA::HandlePlayerUnderMap(Player *player)
{
player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation(), false);
return true;
}
示例3: HandlePlayerUnderMap
bool BattleGroundDS::HandlePlayerUnderMap(Player *player)
{
player->TeleportTo(GetMapId(),1299.046f,784.825f,9.338f,player->GetOrientation(),false);
return true;
}
示例4: GetTemplate
// to cache or not to cache, that is the question
InstanceTemplate const* DungeonPersistentState::GetTemplate() const
{
return ObjectMgr::GetInstanceTemplate(GetMapId());
}
示例5: HandlePlayerUnderMap
bool BattleGroundBE::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation());
return true;
}
示例6: GetArenaMatchmakerRating
void Arena::EndBattleground(uint32 winner)
{
// arena rating calculation
if (isRated())
{
uint32 loserTeamRating = 0;
uint32 loserMatchmakerRating = 0;
int32 loserChange = 0;
int32 loserMatchmakerChange = 0;
uint32 winnerTeamRating = 0;
uint32 winnerMatchmakerRating = 0;
int32 winnerChange = 0;
int32 winnerMatchmakerChange = 0;
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner));
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
{
loserTeamRating = loserArenaTeam->GetRating();
loserMatchmakerRating = GetArenaMatchmakerRating(GetOtherTeam(winner));
winnerTeamRating = winnerArenaTeam->GetRating();
winnerMatchmakerRating = GetArenaMatchmakerRating(winner);
if (winner != 0)
{
winnerMatchmakerChange = winnerArenaTeam->WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange);
loserMatchmakerChange = loserArenaTeam->LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange);
TC_LOG_DEBUG("bg.arena", "match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---",
GetArenaType(), winnerTeamRating, winnerChange, winnerMatchmakerRating, winnerMatchmakerChange,
loserTeamRating, loserChange, loserMatchmakerRating, loserMatchmakerChange);
SetArenaMatchmakerRating(winner, winnerMatchmakerRating + winnerMatchmakerChange);
SetArenaMatchmakerRating(GetOtherTeam(winner), loserMatchmakerRating + loserMatchmakerChange);
// bg team that the client expects is different to TeamId
// alliance 1, horde 0
uint8 winnerTeam = winner == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE;
uint8 loserTeam = winner == ALLIANCE ? BG_TEAM_HORDE : BG_TEAM_ALLIANCE;
_arenaTeamScores[winnerTeam].Assign(winnerChange, winnerMatchmakerRating, winnerArenaTeam->GetName());
_arenaTeamScores[loserTeam].Assign(loserChange, loserMatchmakerRating, loserArenaTeam->GetName());
TC_LOG_DEBUG("bg.arena", "Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d",
GetArenaType(), GetArenaTeamIdByIndex(TEAM_ALLIANCE), GetArenaTeamIdByIndex(TEAM_HORDE), winnerArenaTeam->GetId(), winnerChange, loserChange);
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
for (auto const& score : PlayerScores)
if (Player* player = ObjectAccessor::FindConnectedPlayer(ObjectGuid(HighGuid::Player, score.first)))
{
TC_LOG_DEBUG("bg.arena", "Statistics match Type: %u for %s (GUID: %u, Team: %d, IP: %s): %s",
GetArenaType(), player->GetName().c_str(), score.first, player->GetArenaTeamId(GetArenaType() == 5 ? 2 : GetArenaType() == 3),
player->GetSession()->GetRemoteAddress().c_str(), score.second->ToString().c_str());
}
}
// Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes
else
{
_arenaTeamScores[BG_TEAM_ALLIANCE].Assign(ARENA_TIMELIMIT_POINTS_LOSS, winnerMatchmakerRating, winnerArenaTeam->GetName());
_arenaTeamScores[BG_TEAM_HORDE].Assign(ARENA_TIMELIMIT_POINTS_LOSS, loserMatchmakerRating, loserArenaTeam->GetName());
winnerArenaTeam->FinishGame(ARENA_TIMELIMIT_POINTS_LOSS);
loserArenaTeam->FinishGame(ARENA_TIMELIMIT_POINTS_LOSS);
}
uint8 aliveWinners = GetAlivePlayersCountByTeam(winner);
for (auto const& i : GetPlayers())
{
uint32 team = i.second.Team;
if (i.second.OfflineRemoveTime)
{
// if rated arena match - make member lost!
if (team == winner)
winnerArenaTeam->OfflineMemberLost(i.first, loserMatchmakerRating, winnerMatchmakerChange);
else
loserArenaTeam->OfflineMemberLost(i.first, winnerMatchmakerRating, loserMatchmakerChange);
continue;
}
Player* player = _GetPlayer(i.first, i.second.OfflineRemoveTime != 0, "Arena::EndBattleground");
if (!player)
continue;
// per player calculation
if (team == winner)
{
// update achievement BEFORE personal rating update
uint32 rating = player->GetArenaPersonalRating(winnerArenaTeam->GetSlot());
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1);
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA, GetMapId());
// Last standing - Rated 5v5 arena & be solely alive player
if (GetArenaType() == ARENA_TYPE_5v5 && aliveWinners == 1 && player->IsAlive())
player->CastSpell(player, SPELL_LAST_MAN_STANDING, true);
winnerArenaTeam->MemberWon(player, loserMatchmakerRating, winnerMatchmakerChange);
}
//.........这里部分代码省略.........
示例7: DEBUG_LOG
DungeonPersistentState::~DungeonPersistentState()
{
DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());
UnbindThisState();
}
示例8: GetMapId
bool Game_Vehicle::IsInCurrentMap() const {
return GetMapId() == Game_Map::GetMapId();
}
示例9: if
//.........这里部分代码省略.........
if( plObj )
plObj->RemoveIfVisible(curObj);
if( curObj->IsPlayer() )
static_cast< Player* >( curObj )->RemoveIfVisible(obj);
curObj->RemoveInRangeObject(obj);
if( obj->GetMapMgr() != this )
{
/* Something removed us. */
return;
}
obj->RemoveInRangeObject(iter2);
}
}
}
///////////////////////////
// Get new cell coordinates
///////////////////////////
if(obj->GetMapMgr() != this)
{
/* Something removed us. */
return;
}
if(obj->GetPositionX() >= _maxX || obj->GetPositionX() <= _minX ||
obj->GetPositionY() >= _maxY || obj->GetPositionY() <= _minY)
{
if(obj->IsPlayer())
{
Player* plr = static_cast< Player* >( obj );
if(plr->GetBindMapId() != GetMapId())
{
plr->SafeTeleport(plr->GetBindMapId(),0,plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
return;
}
else
{
obj->GetPositionV()->ChangeCoords(plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
WorldPacket * data = plr->BuildTeleportAckMsg(plr->GetPosition());
plr->GetSession()->SendPacket(data);
delete data;
}
}
else
{
obj->GetPositionV()->ChangeCoords(0,0,0,0);
}
}
uint32 cellX = GetPosX(obj->GetPositionX());
uint32 cellY = GetPosY(obj->GetPositionY());
if(cellX >= _sizeX || cellY >= _sizeY)
{
return;
}
MapCell *objCell = GetCell(cellX, cellY);
MapCell * pOldCell = obj->GetMapCell();
if (!objCell)
{
示例10: urand
void BattleGroundDS::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
// push people from the tubes
if (pushbackCheck)
{
// knockback
if (m_uiKnockback < diff)
{
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
continue;
if (GameObject* obj = plr->GetGameObject(48018)) // Remove Demonic Circle
obj->Delete();
if (plr->GetPositionZ() < 11.0f)
continue;
float angle = (plr->GetBGTeam() == ALLIANCE /*gold*/) ? plr->GetAngle(1259.58f, 764.43f) : plr->GetAngle(1325.84f, 817.304f);
plr->KnockBackPlayerWithAngle(angle, 45, 7);
if (plr->IsWithinDist2d(1214, 765, 50) && plr->IsWithinLOS(1214, 765, 14))
plr->KnockBackPlayerWithAngle(6.40f,55,7);
if (plr->IsWithinDist2d(1369, 817, 50) && plr->IsWithinLOS(1369, 817, 14))
plr->KnockBackPlayerWithAngle(3.03f,55,7);
}
pushbackCheck = false;
m_uiKnockback = 1000;
}
else
m_uiKnockback -= diff;
}
// in case pushback failed
if (teleportCheck)
{
if (m_uiTeleport < diff)
{
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
{
if (plr->GetPositionZ() < 11.0f)
continue;
float x, y;
if (plr->GetBGTeam() == ALLIANCE)
{
x = 1259.58f;
y = 764.43f;
}
else
{
x = 1325.84f;
y = 817.304f;
}
plr->TeleportTo(GetMapId(), x + urand(0,2), y + urand(0,2), 3.15f, plr->GetOrientation());
}
}
teleportCheck = false;
// close the gate
OpenDoorEvent(BG_EVENT_DOOR);
}
else
m_uiTeleport -= diff;
}
// Waterfall
if (m_uiWaterfall < diff)
{
if (waterfallActivated)
{
SpawnEvent(WATERFALL_EVENT, 0, false);
waterfallActivated = false;
}
else
{
SpawnEvent(WATERFALL_EVENT, 0, true);
waterfallActivated = true;
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player * plr = sObjectMgr.GetPlayer(itr->first);
if (plr && plr->GetDistance2d(1291, 790) <= 6)
plr->KnockBackFrom(plr, -20.0f, 9.0f);
}
}
m_uiWaterfall = urand(30,45)*IN_MILLISECONDS;
}
else
m_uiWaterfall -= diff;
//.........这里部分代码省略.........
示例11: SetThreadName
bool MapMgr::Do()
{
#ifdef WIN32
threadid=GetCurrentThreadId();
#endif
thread_running = true;
ThreadState =THREADSTATE_BUSY;
SetThreadName("Map mgr - M%u|I%u",this->_mapId ,this->m_instanceID);
ObjectSet::iterator i;
uint32 last_exec=getMSTime();
/* create static objects */
for(GOSpawnList::iterator itr = _map->staticSpawns.GOSpawns.begin(); itr != _map->staticSpawns.GOSpawns.end(); ++itr)
{
GameObject * obj = CreateGameObject((*itr)->entry);
obj->Load((*itr));
_mapWideStaticObjects.insert(obj);
}
for(CreatureSpawnList::iterator itr = _map->staticSpawns.CreatureSpawns.begin(); itr != _map->staticSpawns.CreatureSpawns.end(); ++itr)
{
Creature * obj = CreateCreature((*itr)->entry);
obj->Load(*itr, 0, pMapInfo);
_mapWideStaticObjects.insert(obj);
}
/* add static objects */
for(set<Object*>::iterator itr = _mapWideStaticObjects.begin(); itr != _mapWideStaticObjects.end(); ++itr)
PushStaticObject(*itr);
/* load corpses */
objmgr.LoadCorpses(this);
// always declare local variables outside of the loop!
// otherwise theres a lot of sub esp; going on.
uint32 exec_time, exec_start;
#ifdef WIN32
HANDLE hThread = GetCurrentThread();
#endif
while((ThreadState != THREADSTATE_TERMINATE) && !_shutdown)
{
exec_start=getMSTime();
//first push to world new objects
m_objectinsertlock.Acquire();//<<<<<<<<<<<<<<<<
if(m_objectinsertpool.size())
{
for(i=m_objectinsertpool.begin();i!=m_objectinsertpool.end();i++)
{
//PushObject(*i);
(*i)->PushToWorld(this);
}
m_objectinsertpool.clear();
}
m_objectinsertlock.Release();//>>>>>>>>>>>>>>>>
//-------------------------------------------------------
//Now update sessions of this map + objects
_PerformObjectDuties();
last_exec=getMSTime();
exec_time=last_exec-exec_start;
if(exec_time<MAP_MGR_UPDATE_PERIOD)
{
/*
The common place I see this is waiting for a Win32 thread to exit. I used to come up with all sorts of goofy,
elaborate event-based systems to do this myself until I discovered that thread handles are waitable. Just use
WaitForSingleObject() on the thread handle and you're done. No risking race conditions with the thread exit code.
I think pthreads has pthread_join() for this too.
- http://www.virtualdub.org/blog/pivot/entry.php?id=62
*/
#ifdef WIN32
WaitForSingleObject(hThread, MAP_MGR_UPDATE_PERIOD-exec_time);
#else
Sleep(MAP_MGR_UPDATE_PERIOD-exec_time);
#endif
}
//////////////////////////////////////////////////////////////////////////
// Check if we have to die :P
//////////////////////////////////////////////////////////////////////////
if(InactiveMoveTime && UNIXTIME >= InactiveMoveTime)
break;
}
// Clear the instance's reference to us.
if(m_battleground)
{
BattlegroundManager.DeleteBattleground(m_battleground);
sInstanceMgr.DeleteBattlegroundInstance( GetMapId(), GetInstanceID() );
}
if(pInstance)
{
// check for a non-raid instance, these expire after 10 minutes.
if(GetMapInfo()->type == INSTANCE_NONRAID || pInstance->m_isBattleground)
{
pInstance->m_mapMgr = NULL;
//.........这里部分代码省略.........
示例12: ASSERT
void MapMgr::PushObject(Object *obj)
{
/////////////
// Assertions
/////////////
ASSERT(obj);
// That object types are not map objects. TODO: add AI groups here?
if(obj->GetTypeId() == TYPEID_ITEM || obj->GetTypeId() == TYPEID_CONTAINER)
{
// mark object as updatable and exit
return;
}
if(obj->GetTypeId() == TYPEID_CORPSE)
{
m_corpses.insert(((Corpse*)obj));
}
obj->ClearInRangeSet();
ASSERT(obj->GetMapId() == _mapId);
if(!(obj->GetPositionX() < _maxX && obj->GetPositionX() > _minX) ||
!(obj->GetPositionY() < _maxY && obj->GetPositionY() > _minY))
{
if(obj->IsPlayer())
{
Player * plr = static_cast< Player* >( obj );
if(plr->GetBindMapId() != GetMapId())
{
plr->SafeTeleport(plr->GetBindMapId(),0,plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
return;
}
else
{
obj->GetPositionV()->ChangeCoords(plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
WorldPacket * data = plr->BuildTeleportAckMsg(plr->GetPosition());
plr->GetSession()->SendPacket(data);
delete data;
}
}
else
{
obj->GetPositionV()->ChangeCoords(0,0,0,0);
}
}
ASSERT(obj->GetPositionY() < _maxY && obj->GetPositionY() > _minY);
ASSERT(_cells);
///////////////////////
// Get cell coordinates
///////////////////////
uint32 x = GetPosX(obj->GetPositionX());
uint32 y = GetPosY(obj->GetPositionY());
if(x >= _sizeX || y >= _sizeY)
{
if(obj->IsPlayer())
{
Player * plr = static_cast< Player* >( obj );
if(plr->GetBindMapId() != GetMapId())
{
plr->SafeTeleport(plr->GetBindMapId(),0,plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
return;
}
else
{
obj->GetPositionV()->ChangeCoords(plr->GetBindPositionX(),plr->GetBindPositionY(),plr->GetBindPositionZ(),0);
plr->GetSession()->SystemMessage("Teleported you to your hearthstone location as you were out of the map boundaries.");
WorldPacket * data = plr->BuildTeleportAckMsg(plr->GetPosition());
plr->GetSession()->SendPacket(data);
delete data;
}
}
else
{
obj->GetPositionV()->ChangeCoords(0,0,0,0);
}
x = GetPosX(obj->GetPositionX());
y = GetPosY(obj->GetPositionY());
}
MapCell *objCell = GetCell(x,y);
if (!objCell)
{
objCell = Create(x,y);
objCell->Init(x, y, _mapId, this);
}
uint32 endX = (x <= _sizeX) ? x + 1 : (_sizeX-1);
uint32 endY = (y <= _sizeY) ? y + 1 : (_sizeY-1);
uint32 startX = x > 0 ? x - 1 : 0;
uint32 startY = y > 0 ? y - 1 : 0;
uint32 posX, posY;
MapCell *cell;
//.........这里部分代码省略.........
示例13: GetCaster
void DynamicObject::Update(uint32 p_time)
{
// caster can be not in world at time dynamic object update, but dynamic object not yet deleted in Unit destructor
Unit* caster = GetCaster();
if(!caster)
{
Delete();
return;
}
bool deleteThis = false;
if(m_aliveDuration > int32(p_time))
m_aliveDuration -= p_time;
else
deleteThis = true;
// TODO: make a timer and update this in larger intervals
CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
Cell cell = RedZone::GetZone(p);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
MaNGOS::DynamicObjectUpdater notifier(*this,caster);
TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, WorldTypeMapContainer > world_object_notifier(notifier);
TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, GridTypeMapContainer > grid_object_notifier(notifier);
CellLock<GridReadGuard> cell_lock(cell, p);
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(GetMapId(), this));
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(GetMapId(), this));
if(deleteThis)
{
caster->RemoveDynObjectWithGUID(GetGUID());
Delete();
}
}
示例14: switch
//.........这里部分代码省略.........
{
case GAMEOBJECT_TYPE_FISHINGNODE: // can't fish now
{
Unit* caster = GetOwner();
if(caster && caster->GetTypeId()==TYPEID_PLAYER)
{
if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL])
{
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->SendChannelUpdate(0);
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->finish(false);
}
WorldPacket data(SMSG_FISH_NOT_HOOKED,0);
((Player*)caster)->GetSession()->SendPacket(&data);
}
// can be delete
m_lootState = GO_JUST_DEACTIVATED;
return;
}
case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON:
//we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds)
if( !GetGoState() )
SwitchDoorOrButton(false);
//flags in AB are type_button and we need to add them here so no break!
default:
if(!m_spawnedByDefault) // despawn timer
{
// can be despawned or destroyed
SetLootState(GO_JUST_DEACTIVATED);
return;
}
// respawn timer
MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
break;
}
}
}
// traps can have time and can not have
GameObjectInfo const* goInfo = GetGOInfo();
if(goInfo->type == GAMEOBJECT_TYPE_TRAP)
{
// traps
Unit* owner = GetOwner();
Unit* ok = NULL; // pointer to appropriate target if found any
if(m_cooldownTime >= time(NULL))
return;
bool IsBattleGroundTrap = false;
//FIXME: this is activation radius (in different casting radius that must be selected from spell data)
//TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state
float radius = goInfo->trap.radius;
if(!radius)
{
if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call)
{
// try to read radius from trap spell
if(const SpellEntry *spellEntry = sSpellStore.LookupEntry(goInfo->trap.spellId))
radius = GetSpellRadius(spellEntry,0,false);
// radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[0]));
if(!radius)
break;
示例15: HandlePlayerUnderMap
bool BattleGroundRV::HandlePlayerUnderMap(Player *player)
{
player->TeleportTo(GetMapId(), 763.5f, -284, 28.276f, player->GetOrientation(), false);
return true;
}