本文整理汇总了C++中PlayerPointer::GetPositionX方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::GetPositionX方法的具体用法?C++ PlayerPointer::GetPositionX怎么用?C++ PlayerPointer::GetPositionX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::GetPositionX方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Carcass
bool Carcass(uint32 i, SpellPointer pSpell) // Becoming a Shadoweave Tailor
{
if(!pSpell->u_caster->IsPlayer())
return true;
PlayerPointer pPlayer = TO_PLAYER(pSpell->u_caster);
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10804 );
CreaturePointer NetherDrake = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 21648);
GameObjectPointer FlayerCarcass = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 185155);
if ( FlayerCarcass == NULLGOB )
{
FlayerCarcass = sEAS.SpawnGameobject(pPlayer, 185155, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, 1, 0, 0, 0, 0);
FlayerCarcass->Despawn(60000);
}
if ( NetherDrake == NULL )
return true;
if ( NetherDrake->HasActiveAura(38502) )
return true;
if( pQuest!=NULL && pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
{
NetherDrake->CastSpell(NetherDrake, dbcSpell.LookupEntry( 38502 ), true);
NetherDrake->GetAIInterface()->m_moveFly = true;
NetherDrake->GetAIInterface()->MoveTo(pPlayer->GetPositionX(), pPlayer->GetPositionY()+2, pPlayer->GetPositionZ(), 0);
pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 )+1);
pQuest->SendUpdateAddKill( 0 );
pQuest->UpdatePlayerFields();
}
return true;
}
示例2: OnQuestComplete
void OnQuestComplete( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
{
if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
return;
float SSX = mTarget->GetPositionX();
float SSY = mTarget->GetPositionY();
float SSZ = mTarget->GetPositionZ();
CreaturePointer Zealot = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 1931);
if(Zealot == NULL)
return;
Zealot->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I. . . I. . .don't. . .feel. . .right. . .");
sEAS.EventCastSpell(Zealot, Zealot, 3287, 3000);
Zealot->GetAIInterface()->setMoveType(11);
Zealot->GetAIInterface()->StopMovement(3000);
sEAS.CreateCustomWaypointMap(Zealot);
sEAS.WaypointCreate(Zealot, 2289.649658f, 237.001389f, 27.089531f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2291.700928f, 235.561844f, 27.089531f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2292.835693f, 240.636948f, 27.089531f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2288.737305f, 240.503952f, 27.088022f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2287.812744f, 236.320938f, 27.088022f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2292.643033f, 240.513489f, 27.088022f, 1.323f, 0, 256, 0);
sEAS.WaypointCreate(Zealot, 2289.628418f, 239.908279f, 27.088022f, 1.323f, 0, 256, 0);
}
示例3: OnQuestComplete
void OnQuestComplete( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
{
if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
return;
float SSX = mTarget->GetPositionX();
float SSY = mTarget->GetPositionY();
float SSZ = mTarget->GetPositionZ();
GameObjectPointer skull1 = mTarget->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(SSX, SSY, SSZ, 2551);
if(skull1)
return;
CreaturePointer Kin_weelay = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 2519);
if(Kin_weelay == NULL)
return;
string msg1 = "Ah. Good ";
msg1 += mTarget->GetName();
msg1 += ". Now let us see what tale these heads tell...";
Kin_weelay->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, msg1.c_str());
Kin_weelay->CastSpell(Kin_weelay, dbcSpell.LookupEntry(3644), false);
skull1->Despawn(5000);
GameObjectPointer skull2 = mTarget->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(SSX, SSY, SSZ, 2551);
if(skull2)
skull2->Despawn(5000);
if(Kin_weelay == NULL)
return;
string msg = "There, ";
msg += mTarget->GetName();
msg += ". You may now speak to the Bloodscalp chief and his witchdoctor.";
sEventMgr.AddEvent(TO_UNIT(Kin_weelay), &Creature::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL, msg.c_str(), EVENT_UNIT_CHAT_MSG, 500, 1, 1);
}
示例4: OnQuestStart
void OnQuestStart( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
{
if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
return;
float SSX = mTarget->GetPositionX();
float SSY = mTarget->GetPositionY();
float SSZ = mTarget->GetPositionZ();
CreaturePointer Dashel = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 4961);
if(Dashel == NULL)
return;
Dashel->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 72);
Dashel->GetAIInterface()->disable_melee = false;
Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);
uint32 chance = RandomUInt(100);
if(chance < 15)
{
string say = "Now you're gonna get it good, ";
say+=(TO_PLAYER(mTarget))->GetName();
say+="!";
Dashel->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say.c_str());
}
CreaturePointer Thug1 = sEAS.SpawnCreature(mTarget, 4969, -8686.803711, 445.267792, 99.789223, 5.461184, 300000);
CreaturePointer Thug2 = sEAS.SpawnCreature(mTarget, 4969, -8675.571289, 444.162262, 99.644737, 3.834103, 300000);
}
示例5: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
if(!pPlayer)
return;
GameObjectPointer barel = sEAS.SpawnGameobject(pPlayer, 177491, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation(), 1, 0, 0, 0, 0);
sEAS.GameobjectDelete(barel, 2*60*1000);
}
示例6: 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;
}
示例7: HandleRecallAddCommand
bool ChatHandler::HandleRecallAddCommand(const char* args, WorldSession *m_session)
{
if(!*args)
return false;
QueryResult *result = WorldDatabase.Query( "SELECT name FROM recall" );
if(!result)
return false;
do
{
Field *fields = result->Fetch();
const char * locname = fields[0].GetString();
if (strncmp((char*)args,locname,strlen(locname))==0)
{
RedSystemMessage(m_session, "Name in use, please use another name for your location.");
delete result;
return true;
}
}while (result->NextRow());
delete result;
PlayerPointer plr = m_session->GetPlayer();
std::stringstream ss;
string rc_locname = string(args);
ss << "INSERT INTO recall (name, mapid, positionX, positionY, positionZ) VALUES ('"
<< WorldDatabase.EscapeString(rc_locname).c_str() << "' , "
<< plr->GetMapId() << ", "
<< plr->GetPositionX() << ", "
<< plr->GetPositionY() << ", "
<< plr->GetPositionZ() << ");";
WorldDatabase.Execute( ss.str( ).c_str( ) );
char buf[256];
snprintf((char*)buf, 256, "Added location to DB with MapID: %d, X: %f, Y: %f, Z: %f",
(unsigned int)plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ());
GreenSystemMessage(m_session, buf);
sGMLog.writefromsession(m_session, "used recall add, added \"%s\" location to database.", rc_locname.c_str());
return true;
}
示例8: 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);
}
示例9: 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();
};
示例10: OnQuestStart
void OnQuestStart( PlayerPointer mTarget, QuestLogEntry * qLogEntry)
{
if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
return;
float SSX = mTarget->GetPositionX();
float SSY = mTarget->GetPositionY();
float SSZ = mTarget->GetPositionZ();
CreaturePointer Dashel = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 6784);
if(Dashel == NULL)
return;
Dashel->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 28);
Dashel->GetAIInterface()->disable_melee = false;
Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);
}
示例11: CastScriptSpell
void CastScriptSpell( ScriptSpell* spell )
{
_unit->Root();
uint32 spellid = heroic ? spell->heroic_spellid : spell->normal_spellid;
UnitPointer spelltarget = NULLUNIT;
switch( spell->target )
{
case SPELL_TARGET_SELF:
{
spelltarget = _unit;
}break;
case SPELL_TARGET_GENERATE:
{
spelltarget = NULLUNIT;
}break;
case SPELL_TARGET_CURRENT_ENEMY:
{
spelltarget = _unit->GetAIInterface()->GetNextTarget();
}break;
case SPELL_TARGET_RANDOM_PLAYER:
{
spelltarget = GetRandomPlayerTarget();
}break;
case SPELL_TARGET_RANDOM_PLAYER_POSITION:
{
PlayerPointer target = GetRandomPlayerTarget();
if( target )
{
SpellPointer sp(new Spell(_unit,dbcSpell.LookupEntry( spellid ),true,NULLAURA));
SpellCastTargets targets;
targets.m_destX = target->GetPositionX();
targets.m_destY = target->GetPositionY();
targets.m_destZ = target->GetPositionZ();
targets.m_targetMask = TARGET_FLAG_DEST_LOCATION;
sp->prepare(&targets);
_unit->UnRoot();
return;
}
}break;
}
_unit->CastSpell( spelltarget , spellid, false );
_unit->UnRoot();
}
示例12: ToLegionHold
bool ToLegionHold(uint32 i, AuraPointer pAura, bool apply)
{
if ( pAura == NULL || pAura->GetUnitCaster() == NULL || !pAura->GetUnitCaster()->IsPlayer() )
return true;
PlayerPointer pPlayer = TO_PLAYER( pAura->GetUnitCaster() );
CreaturePointer pJovaanCheck = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(-3310.743896f, 2951.929199f, 171.132538f, 21633);
if ( pJovaanCheck != NULL )
return true;
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10563 );
if ( pQuest == NULL )
{
pQuest = pPlayer->GetQuestLogForEntry( 10596 );
if ( pQuest == NULL )
return true;
}
if ( apply )
{
pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, 20366 );
pPlayer->Root();
CreaturePointer pJovaan = sEAS.SpawnCreature( pPlayer, 21633, -3310.743896f, 2951.929199f, 171.132538f, 5.054039f, 0 ); // Spawn Jovaan
if ( pJovaan != NULL )
{
pJovaan->SetUInt64Value( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 );
if ( pJovaan->GetAIInterface() != NULL )
{
pJovaan->GetAIInterface()->SetAllowedToEnterCombat( false );
}
}
GameObjectPointer pGameObject = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 184834);
if ( pGameObject != NULL )
{
pGameObject->Despawn(60000);
pPlayer->UpdateNearbyGameObjects();
}
}
else
{
if ( pQuest->GetMobCount( 2 ) < pQuest->GetQuest()->required_mobcount[2] )
{
pQuest->SetMobCount( 2, pQuest->GetMobCount( 2 ) + 1 );
pQuest->SendUpdateAddKill( 2 );
pQuest->UpdatePlayerFields();
}
pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, pPlayer->GetUInt32Value( UNIT_FIELD_NATIVEDISPLAYID ) );
pPlayer->UnRoot();
}
return true;
}
示例13: DropFlag
void DropFlag(PlayerPointer pPlayer, uint32 spellID)
{
if(!pPlayer || spellID != SILITHYST_SPELL)
return;
uint32 triggerID = pPlayer->GetTeam() == ALLIANCE ? ALLIANCE_RETURN : HORDE_RETURN;
// we have to use AreaTrigger.dbc here
AreaTrigger* pAreaTrigger = AreaTriggerStorage.LookupEntry(triggerID);
if(pAreaTrigger)
if(pPlayer->CalcDistance(pAreaTrigger->x, pAreaTrigger->y, pAreaTrigger->z) > 10.0f)
{
GameObjectPointer pGo = pPlayer->GetMapMgr()->GetInterface()->SpawnGameObject(SILITHYST_MOUND, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, true, 0, 0);
if(pGo == NULL)
{
pGo->Destructor();
pGo = NULLGOB;
}
};
}