本文整理汇总了C++中PlayerPointer::GetOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::GetOrientation方法的具体用法?C++ PlayerPointer::GetOrientation怎么用?C++ PlayerPointer::GetOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::GetOrientation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLootTaken
void OnLootTaken(PlayerPointer pLooter, ItemPrototype *pItemInfo)
{
float SSX = pLooter->GetPositionX();
float SSY = pLooter->GetPositionY();
float SSZ = pLooter->GetPositionZ();
float SSO = pLooter->GetOrientation();
CreaturePointer NewCreature = pLooter->GetMapMgr()->GetInterface()->SpawnCreature(11120, SSX, SSY, SSZ, SSO, true, false, 0, 0);
if ( NewCreature != NULL )
NewCreature->Despawn(600000, 0);
}
示例2: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
float SSX = pPlayer->GetPositionX();
float SSY = pPlayer->GetPositionY();
float SSZ = pPlayer->GetPositionZ();
float SSO = pPlayer->GetOrientation();
CreaturePointer NewCreature = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(10882, SSX, SSY, SSZ, SSO, true, false, 0, 0);
if ( NewCreature != NULL )
NewCreature->Despawn(600000, 0);
}
示例3: HandleGOSpawn
bool ChatHandler::HandleGOSpawn(const char *args, WorldSession *m_session)
{
std::stringstream sstext;
char* pEntryID = strtok((char*)args, " ");
if (!pEntryID)
return false;
uint32 EntryID = atoi(pEntryID);
bool Save = false;
char* pSave = strtok(NULL, " ");
if (pSave)
Save = (atoi(pSave)>0?true:false);
OUT_DEBUG("Spawning GameObject By Entry '%u'", EntryID);
sstext << "Spawning GameObject By Entry '" << EntryID << "'" << '\0';
SystemMessage(m_session, sstext.str().c_str());
GameObjectPointer go = m_session->GetPlayer()->GetMapMgr()->CreateGameObject(EntryID);
if(go == NULL)
{
sstext << "GameObject Info '" << EntryID << "' Not Found" << '\0';
SystemMessage(m_session, sstext.str().c_str());
return true;
}
PlayerPointer chr = m_session->GetPlayer();
uint32 mapid = chr->GetMapId();
float x = chr->GetPositionX();
float y = chr->GetPositionY();
float z = chr->GetPositionZ();
float o = chr->GetOrientation();
go->SetInstanceID(chr->GetInstanceID());
go->CreateFromProto(EntryID,mapid,x,y,z,o,0.0f,0.0f,0.0f,0.0f);
go->SetRotation(o);
go->PushToWorld(m_session->GetPlayer()->GetMapMgr());
// Create sapwn instance
GOSpawn * gs = new GOSpawn;
gs->entry = go->GetEntry();
gs->facing = go->GetOrientation();
gs->faction = go->GetUInt32Value(GAMEOBJECT_FACTION);
gs->flags = go->GetUInt32Value(GAMEOBJECT_FLAGS);
gs->id = objmgr.GenerateGameObjectSpawnID();
gs->orientation1 = go->GetFloatValue(GAMEOBJECT_ROTATION);
gs->orientation2 = go->GetFloatValue(GAMEOBJECT_ROTATION_01);
gs->orientation3 = go->GetFloatValue(GAMEOBJECT_ROTATION_02);
gs->orientation4 = go->GetFloatValue(GAMEOBJECT_ROTATION_03);
gs->scale = go->GetFloatValue(OBJECT_FIELD_SCALE_X);
gs->x = go->GetPositionX();
gs->y = go->GetPositionY();
gs->z = go->GetPositionZ();
gs->state = go->GetByte(GAMEOBJECT_BYTES_1, GAMEOBJECT_BYTES_STATE);
//gs->stateNpcLink = 0;
uint32 cx = m_session->GetPlayer()->GetMapMgr()->GetPosX(m_session->GetPlayer()->GetPositionX());
uint32 cy = m_session->GetPlayer()->GetMapMgr()->GetPosY(m_session->GetPlayer()->GetPositionY());
m_session->GetPlayer()->GetMapMgr()->GetBaseMap()->GetSpawnsListAndCreate(cx,cy)->GOSpawns.push_back(gs);
go->m_spawn = gs;
//go->AddToWorld();
if(Save == true)
{
// If we're saving, create template and add index
go->SaveToDB();
}
return true;
}
示例4: GossipHello
void GossipHello( ObjectPointer pObject, PlayerPointer pPlayer, bool AutoSend )
{
if ( pObject == NULL || pObject->GetTypeId() != TYPEID_ITEM || pPlayer == NULL )
return;
QuestLogEntry* QuestEntry = pPlayer->GetQuestLogForEntry( 9452 );
if ( QuestEntry == NULL )
return;
#ifndef BLIZZLIKE
//if ( QuestEntry->GetMobCount( 0 ) >= QuestEntry->GetQuest()->required_mobcount[ 0 ] )
// return;
#endif
if ( pPlayer->GetMapMgr() == NULLMAPMGR )
return;
// Meh, double object looking - we should find a way to remove this
GameObjectPointer School = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 181616 );
if ( School == NULLGOB || pPlayer->CalcDistance( School ) > 5.0f )
return;
#ifdef BLIZZLIKE
sEventMgr.AddEvent( School, &GameObject::Despawn, static_cast< uint32 >( 20000 ), EVENT_GAMEOBJECT_ITEM_SPAWN, 1000, 1, 0 );
#else
School->Despawn( 20000 );
#endif
pPlayer->CastSpell( pPlayer, dbcSpell.LookupEntry( TO_ITEM( pObject )->GetProto()->Spells[ 0 ].Id ), false );
uint32 Chance = RandomUInt( 10 );
if ( Chance <= 3 )
{
CreaturePointer NewCreature = sEAS.SpawnCreature( pPlayer, 17102, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 180000 );
if ( NewCreature != NULLCREATURE )
{
NewCreature->GetAIInterface()->StopMovement( 500 );
NewCreature->setAttackTimer( 1000, false );
NewCreature->m_noRespawn = true;
};
return;
};
sEAS.AddItem( 23614, pPlayer );
QuestEntry->SendUpdateAddKill( 1 );
QuestEntry->UpdatePlayerFields();
pPlayer->Gossip_Complete();
};
示例5: HandleNpcComeCommand
bool ChatHandler::HandleNpcComeCommand(const char* args, WorldSession* m_session)
{
// moves npc to players location
PlayerPointer plr = m_session->GetPlayer();
CreaturePointer crt = getSelectedCreature(m_session, true);
if(!crt) return true;
crt->GetAIInterface()->MoveTo(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetOrientation());
return true;
}