本文整理汇总了C++中CreaturePointer::GetAIInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ CreaturePointer::GetAIInterface方法的具体用法?C++ CreaturePointer::GetAIInterface怎么用?C++ CreaturePointer::GetAIInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreaturePointer
的用法示例。
在下文中一共展示了CreaturePointer::GetAIInterface方法的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: OnQuestStart
void OnQuestStart(PlayerPointer pPlayer, QuestLogEntry *pQuest)
{
if ( pPlayer == NULL || pPlayer->GetMapMgr() == NULL || pPlayer->GetMapMgr()->GetInterface() == NULL )
return;
CreaturePointer pAkida = sEAS.SpawnCreature( pPlayer, 17379, -4183.043457f, -12511.419922f, 44.361786f, 6.05629f, 0 );
if ( pAkida == NULL )
return;
pAkida->m_escorter = pPlayer;
pAkida->GetAIInterface()->setMoveType( RUN );
pAkida->GetAIInterface()->StopMovement( 1000 );
pAkida->GetAIInterface()->SetAllowedToEnterCombat( false );
pAkida->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Follow me I shall result you on a place!" );
pAkida->SetUInt32Value( UNIT_NPC_FLAGS, 0 );
pAkida->CastSpell( pAkida, 25035, true ); // Apparition Effect
sEAS.CreateCustomWaypointMap( pAkida );
sEAS.WaypointCreate( pAkida, -4174.025879f, -12512.800781f, 44.361458f, 2.827430f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -4078.135986f, -12535.500977f, 43.066765f, 5.949394f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -4040.495361f, -12565.537109f, 43.698250f, 5.592041f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -4009.526367f, -12598.929688f, 53.168480f, 5.434962f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -3981.581543f, -12635.541602f, 63.896046f, 5.332861f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -3953.170410f, -12680.391602f, 75.433006f, 5.218981f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -3924.324951f, -12741.846680f, 95.187035f, 5.124734f, 0, 256, 16995 );
sEAS.WaypointCreate( pAkida, -3920.791260f, -12746.218750f, 96.887978f, 3.271200f, 0, 256, 16995 );
sEAS.EnableWaypoints( pAkida );
mAkidas.push_back( std::make_pair( pPlayer->GetGUID(), pAkida ) );
}
示例3: 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);
}
示例4: 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);
}
示例5: 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;
}
示例6: OnCombatStart
void OnCombatStart(UnitPointer mTarget)
{
_unit->SendChatMessage( CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You wish to confront the master? You must weather the storm!");
spark_timer = 0;
last_creation_hp = 100;
RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
for( uint8 i=0; i<SPARKS_COUNT; i++)
{
CreatureProto *cp = CreatureProtoStorage.LookupEntry(28926);
CreatureInfo *ci = CreatureNameStorage.LookupEntry(28926);
CreaturePointer c = NULLCREATURE;
if (cp && ci)
{
c = _unit->GetMapMgr()->CreateCreature( 28926 );
if (c)
{
c->Load(cp,_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation());
c->PushToWorld(_unit->GetMapMgr());
sparks[i] = c->GetGUID();
c->Root();
c->GetAIInterface()->disable_combat = true;
for( uint8 i=0; i<7; i++ )
c->SchoolImmunityList[i] = 1;
}
}
}
}
示例7: GossipSelectOption
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * EnteredCode)
{
if(!plr)
return;
CreaturePointer doctor = TO_CREATURE(pObject);
if (doctor == NULL)
return;
switch (IntId)
{
case 0:
GossipHello(pObject, plr, true);
break;
case 1:
{
plr->GetItemInterface()->RemoveItemAmt(2799, 1);
doctor->CastSpell(doctor, dbcSpell.LookupEntry(12380), true);
if( !plr || !plr->GetMapMgr() || !plr->GetMapMgr()->GetInterface() )
return;
CreaturePointer firstenemy = sEAS.SpawnCreature(plr, 1511, -13770.5, -6.79, 42.8, 5.7 , 0);
firstenemy->GetAIInterface()->MoveTo(-13727.8, -26.2, 46.15, 4.07);
firstenemy->Despawn(10*60*1000, 0);
}break;
}
}
示例8: OnQuestComplete
void OnQuestComplete(PlayerPointer pPlayer, QuestLogEntry *qLogEntry)
{
if (!pPlayer)
return;
GameObjectPointer obj = NULLGOB;
for(uint8 i = 0; i < 9; i++)
{
obj = sEAS.SpawnGameobject(pPlayer, GO_MEAT, MeatSpawnPoints[i].x, MeatSpawnPoints[i].y, MeatSpawnPoints[i].z, MeatSpawnPoints[i].o, 1, 0, 0, 0, 0);
sEAS.GameobjectDelete(obj, 2*60*1000);
}
for(uint8 i = 0; i < 5; i++)
{
obj = sEAS.SpawnGameobject(pPlayer, GO_BOTTLE, BottleSpawnPoints[i].x, BottleSpawnPoints[i].y, BottleSpawnPoints[i].z, BottleSpawnPoints[i].o, 1, 0, 0, 0, 0);
sEAS.GameobjectDelete(obj, 2*60*1000);
}
for(uint8 i = 0; i < 3; i++)
{
obj = sEAS.SpawnGameobject(pPlayer, GO_BREAD, BreadSpawnPoints[i].x, BreadSpawnPoints[i].y, BreadSpawnPoints[i].z, BreadSpawnPoints[i].o, 1, 0, 0, 0, 0);
sEAS.GameobjectDelete(obj, 2*60*1000);
}
CreaturePointer Negolash = sEAS.SpawnCreature(pPlayer, 1494, -14657.400391, 155.115997, 4.081050, 0.353429);
Negolash->GetAIInterface()->MoveTo(-14647.526367, 143.710052, 1.164550, 1.909);
}
示例9: 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);
}
示例10: 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;
}
示例11: OnActivate
void OnActivate(PlayerPointer pPlayer)
{
CreaturePointer Ulag = NULLCREATURE;
GameObjectPointer pDoor = NULLGOB;
Ulag = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(2390.101807f, 336.676788f, 40.015614f, 6390);
pDoor = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2388.480029f, 338.3901f, 40.092899f, 176594);
QuestLogEntry * en = pPlayer->GetQuestLogForEntry(1819);
if(!en || pDoor==NULL || Ulag)
return;
CreaturePointer NewCreature = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(6390, 2390.101807f, 336.676788f, 40.015614f, 2.259590f, true, false, 0, 0);
if ( NewCreature != NULL )
{
NewCreature->Despawn(180000, 0);
NewCreature->GetAIInterface()->SetNextTarget(pPlayer);
NewCreature->GetAIInterface()->AttackReaction(pPlayer, 1);
pDoor->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
pDoor->SetByte(GAMEOBJECT_BYTES_1, 0, 0);
};
}
示例12: EatenRecently
bool EatenRecently(uint32 i, AuraPointer pAura, bool apply)
{
if ( pAura == NULL || pAura->GetUnitCaster() == NULL || pAura->GetUnitCaster()->IsPlayer() )
return true;
CreaturePointer NetherDrake = TO_CREATURE( pAura->GetUnitCaster() );
if (NetherDrake == NULL)
return true;
if ( apply )
{
NetherDrake->GetAIInterface()->SetAllowedToEnterCombat(false);
NetherDrake->Emote(EMOTE_ONESHOT_EAT);
}
else
{
NetherDrake->GetAIInterface()->SetAllowedToEnterCombat(true);
NetherDrake->GetAIInterface()->m_moveFly = true;
NetherDrake->GetAIInterface()->MoveTo(NetherDrake->GetSpawnX(), NetherDrake->GetSpawnY(), NetherDrake->GetSpawnZ(), NetherDrake->GetSpawnO());
}
return true;
}
示例13: 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();
};