本文整理汇总了C++中Creature::Emote方法的典型用法代码示例。如果您正苦于以下问题:C++ Creature::Emote方法的具体用法?C++ Creature::Emote怎么用?C++ Creature::Emote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature::Emote方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GossipSelectOption
void GossipSelectOption(Object* pObject, Player * plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
if(pObject->GetTypeId()!=TYPEID_UNIT)
return;
GossipMenu * Menu;
switch(IntId)
{
case 0: // Return to start
GossipHello(pCreature, plr, true);
break;
case 1: //Horde
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
Menu->SendTo(plr);
QuestLogEntry *qle = plr->GetQuestLogForEntry(6002);
if(qle == NULL)
return;
if(qle->GetMobCount(0) != 0)
return;
qle->SetMobCount(0, 1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
pCreature->Emote(EMOTE_ONESHOT_WAVE);
pCreature->Despawn(2000,0);
}
break;
case 2: //Ally
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
Menu->SendTo(plr);
QuestLogEntry *qle = plr->GetQuestLogForEntry(6001);
if(qle == NULL)
return;
if(qle->GetMobCount(0) != 0)
return;
qle->SetMobCount(0, 1);
qle->SendUpdateAddKill(0);
qle->UpdatePlayerFields();
pCreature->Emote(EMOTE_ONESHOT_WAVE);
pCreature->Despawn(2000,0);
}
break;
}
}
示例2: GossipSelectOption
void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char* Code)
{
if(!pObject->IsCreature())
return;
Creature* pCreature = static_cast<Creature*>(pObject);
GossipMenu* Menu;
switch(IntId)
{
case 0: // Return to start
GossipHello(pCreature, plr);
break;
case 1: //Horde
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
Menu->SendTo(plr);
QuestLogEntry* qle = plr->GetQuestLogForEntry(6002);
if(qle == NULL)
return;
if(qle->CanBeFinished())
return;
qle->Complete();
qle->SendQuestComplete();
qle->UpdatePlayerFields();
pCreature->Emote(EMOTE_ONESHOT_WAVE);
pCreature->Despawn(240000, 0);
}
break;
case 2: //Ally
{
objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 4715, plr);
Menu->SendTo(plr);
QuestLogEntry* qle = plr->GetQuestLogForEntry(6001);
if(qle == NULL)
return;
if(qle->CanBeFinished())
return;
qle->Complete();
qle->SendQuestComplete();
qle->UpdatePlayerFields();
pCreature->Emote(EMOTE_ONESHOT_WAVE);
pCreature->Despawn(240000, 0);
}
break;
}
}
示例3: GossipSelectOption
void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
{
Creature* pCreature = (pObject->GetTypeId()==TYPEID_UNIT) ? TO_CREATURE(pObject) : NULL;
if(pObject == NULL)
return;
switch(IntId)
{
case 0: // Return to start
GossipHello(pCreature, Plr, true);
break;
case 1: // Disciple of Naralex Casts Mark of the Wild on players.
{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Take this! It will be useful for you. I'll be waiting here when you have slain the 4 Fanglords to awake Naralex!");
pCreature->CastSpell(Plr, 5232, true);
pCreature->Emote(EMOTE_ONESHOT_CHEER);
Plr->Gossip_Complete();
}
break;
case 2: // Start Event
{
pCreature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
pCreature->GetAIInterface()->StopMovement(0);
pCreature->GetAIInterface()->SetAIState(STATE_SCRIPTMOVE);
pCreature->GetAIInterface()->setMoveType(MOVEMENTTYPE_WANTEDWP);
pCreature->GetAIInterface()->setWaypointToMove(2);
}
break;
}
}
示例4: OnSelectOption
void OnSelectOption(Object* pObject, Player* Plr, uint32 Id, const char* /*Code*/, uint32_t /*gossipId*/) override
{
Creature* pCreature = (pObject->isCreature()) ? static_cast<Creature*>(pObject) : nullptr;
if (pCreature == nullptr)
{
return;
}
switch (Id)
{
case 1: // Disciple of Naralex Casts Mark of the Wild on players.
{
pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Take this! It will be useful for you. I'll be waiting here when you have slain the 4 Fanglords to awake Naralex!");
pCreature->castSpell(Plr, 5232, true);
pCreature->Emote(EMOTE_ONESHOT_CHEER);
} break;
case 2: // Start Event
{
pCreature->setNpcFlags(UNIT_NPC_FLAG_NONE);
pCreature->GetAIInterface()->StopMovement(0);
pCreature->GetAIInterface()->setAiState(AI_STATE_SCRIPTMOVE);
pCreature->GetAIInterface()->setWaypointScriptType(Movement::WP_MOVEMENT_SCRIPT_WANTEDWP);
pCreature->GetAIInterface()->setWayPointToMove(2);
} break;
default:
break;
}
Arcemu::Gossip::Menu::Complete(Plr);
}
示例5: EatenRecently
bool EatenRecently(uint32 i, Aura* pAura, bool apply)
{
if(pAura == NULL)
return true;
Unit* caster = pAura->GetUnitCaster();
if(caster == NULL || caster->IsPlayer())
return true;
Creature* NetherDrake = TO_CREATURE(caster);
if(NetherDrake == NULL)
return true;
if(apply)
{
NetherDrake->GetAIInterface()->SetAllowedToEnterCombat(false);
NetherDrake->Emote(EMOTE_ONESHOT_EAT);
}
else
{
NetherDrake->GetAIInterface()->SetAllowedToEnterCombat(true);
NetherDrake->GetAIInterface()->SetFly();
NetherDrake->GetAIInterface()->MoveTo(NetherDrake->GetSpawnX(), NetherDrake->GetSpawnY(), NetherDrake->GetSpawnZ(), NetherDrake->GetSpawnO());
}
return true;
}
示例6: AwakenPeon
bool AwakenPeon(uint32 i, Spell* pSpell)
{
if ( pSpell == NULL || pSpell->p_caster == NULL )
return true;
Player *pPlayer = pSpell->p_caster;
Unit *pUnit = pSpell->GetUnitTarget();
if ( pUnit == NULL || !pUnit->IsCreature() )
return true;
Creature *pTarget = static_cast< Creature* >( pUnit );
if ( !pTarget->HasAura( 17743 ) )
return true;
if ( pTarget->GetEntry() == 10556 )
{
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 12);
data << uint32( 6197 ) << pTarget->GetGUID();
pPlayer->SendMessageToSet(&data, true);
pTarget->RemoveAllAuras();
string Text;
Text = "Ow! Ok, I'll get back to work, ";
Text += pPlayer->GetName();
Text += "!";
pTarget->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, Text.c_str() );
pTarget->Emote( EMOTE_STATE_WORK_NOSHEATHE_CHOPWOOD );
sQuestMgr.OnPlayerKill( pPlayer, pTarget );
}
return true;
}
示例7: OnDied
void OnDied(Unit* mKiller)
{
float SSX = mKiller->GetPositionX();
float SSY = mKiller->GetPositionY();
float SSZ = mKiller->GetPositionZ();
Creature* doctor = mKiller->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 1449);
if(doctor)
doctor->Emote(EMOTE_ONESHOT_CHEER);
}
示例8: OnQuestComplete
void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
{
float SSX = mTarget->GetPositionX();
float SSY = mTarget->GetPositionY();
float SSZ = mTarget->GetPositionZ();
Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 4452);
if(creat == NULL)
return;
string msg = "Hahah! ";
msg += mTarget->GetName();
msg += ", you make quite a partner!";
creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, msg.c_str());
creat->Emote(EMOTE_ONESHOT_LAUGH);
}
示例9: EatenRecently
bool EatenRecently(uint32 i, Aura* pAura, bool apply)
{
if ( pAura == NULL || pAura->GetUnitCaster() == NULL || pAura->GetUnitCaster()->IsPlayer() )
return true;
Creature *NetherDrake = static_cast<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;
}
示例10: AwakenPeon
bool AwakenPeon(uint32 i, Spell * pSpell)
{
if ( pSpell == NULL || pSpell->p_caster == NULL )
return true;
Player * pPlayer = pSpell->p_caster;
Unit * pUnit = pSpell->GetUnitTarget();
if ( pUnit == NULL || !pUnit->IsCreature() )
return true;
Creature * pTarget = TO_CREATURE( pUnit );
if ( !pTarget->HasAura( 17743 ) )
return true;
if ( pTarget->GetEntry() == 10556 )
{
QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 5441 );
if ( pQuest == NULL || pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
return true;
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 12);
data << uint32( 6197 ) << pTarget->GetGUID();
pPlayer->SendMessageToSet(&data, true);
pTarget->RemoveAllAuras();
string Text;
Text = "Ow! Ok, I'll get back to work, ";
Text += pPlayer->GetName();
Text += "!";
pTarget->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, Text.c_str() );
pTarget->Emote( EMOTE_STATE_WORK_CHOPWOOD );
pQuest->SetMobCount( 0, pQuest->GetMobCount(0)+1 );
pQuest->SendUpdateAddKill( 0 );
pQuest->UpdatePlayerFields();
}
return true;
}
示例11: ScriptedBackToOrig
void GameEventMgr::ScriptedBackToOrig(uint32 event_id)
{
GameEventScriptMap::iterator event_backup = m_GameEventScriptBackup.find(event_id);
if( event_backup == m_GameEventScriptBackup.end() )
return;
set<EventScript*>::iterator itr = event_backup->second.begin();
for( itr; itr != event_backup->second.end(); itr++ )
{
uint32 mapid = (*itr)->mapid;
uint32 sql_id = (*itr)->sql_id;
uint8 type = (*itr)->type;
uint32 data1 = (*itr)->data_1;
uint32 data2 = (*itr)->data_2;
uint32 data3 = (*itr)->data_3;
MapMgr * mapmgr = sInstanceMgr.GetMapMgr( mapid );
if( mapmgr == NULL )
return;
Creature *c;
GameObject *go;
if(type < GAMEOBJECT_CHANGE_STATE)
{
c = mapmgr->GetSqlIdCreature( sql_id );
if( c == NULL ) return;
}
else
{
go = mapmgr->GetSqlIdGameObject( sql_id );
if( go == NULL ) return;
}
switch( type )
{
case CREATURE_CHANGE_SCRIPTED_CHANGE:
{
CALL_SCRIPT_EVENT(c, GameEventFinish)(event_id);
} break;
case CREATURE_CHANGE_EMOTE:
{
c->Emote(EmoteType(data1));
c->SetEmoteState(data2);
c->SetStandState(static_cast<uint8>(data3));
} break;
case CREATURE_CHANGE_DISPLAYID:
{
c->SetDisplayId(data1);
c->SetNativeDisplayId(data2);
c->SetMount(data3);
c->EventModelChange();
} break;
case CREATURE_CHANGE_WEAPON:
{
c->SetEquippedItem(MELEE, data1);
c->SetEquippedItem(OFFHAND, data2);
c->SetEquippedItem(RANGED, data3);
} break;
case CREATURE_CHANGE_REACT:
{
c->SetFaction(data1);
c->SetUInt32Value(UNIT_NPC_FLAGS, data2);
c->SetUInt32Value(UNIT_FIELD_FLAGS, data3);
} break;
case CREATURE_CAST_SPELL_ON_EVENT_STOP:
{
SpellEntry * sp = dbcSpell.LookupEntryForced( data1 );
if( sp == NULL )
return;
SpellCastTime * casttime = dbcSpellCastTime.LookupEntry(sp->CastingTimeIndex);
Spell * spell = sSpellFactoryMgr.NewSpell(c, sp, false, NULL);
SpellCastTargets t(0);
// force self casting
if( data2 )
{
t.m_unitTarget = c->GetGUID();
}
else
{
spell->GenerateTargets(&t);
spell->m_targets = t;
}
if (objmgr.IsSpellDisabled(spell->GetProto()->Id) || spell->CanCast(false) != SPELL_CANCAST_OK || !spell->HasPower() || c->m_silenced || c->IsStunned() || c->IsFeared() )
{
delete spell;
return;
}
if( casttime->CastTime > 0 )
c->GetAIInterface()->StopMovement(casttime->CastTime);
//.........这里部分代码省略.........
示例12: DoScript
void GameEventMgr::DoScript(uint32 event_id, uint32 sql_id, uint8 type, uint32 data1, uint32 data2, uint32 data3, char * say, uint32 mapid)
{
MapMgr * mapmgr = sInstanceMgr.GetMapMgr( mapid );
if( mapmgr == NULL )
return;
Creature *c;
GameObject *go;
if(type < GAMEOBJECT_CHANGE_STATE)
{
c = mapmgr->GetSqlIdCreature( sql_id );
if( c == NULL ) return;
}
else
{
go = mapmgr->GetSqlIdGameObject( sql_id );
if( go == NULL ) return;
}
// create backup for original values
EventScript * es = new EventScript();
es->sql_id = sql_id;
es->mapid = mapid;
es->type = type;
es->data_1 = 0; // null them out first!
es->data_2 = 0;
es->data_3 = 0;
if( c && strlen(say) )
{
c->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say);
}
switch( type )
{
case CREATURE_CHANGE_SCRIPTED_CHANGE:
{
CALL_SCRIPT_EVENT(c, GameEventStart)(event_id);
} break;
case CREATURE_CHANGE_EMOTE:
{
// do not backup one-shoot emote
c->Emote(EmoteType(data1));
// backup emote state first
es->data_2 = c->GetEmoteState();
c->SetEmoteState(data2);
// backup stand state
es->data_3 = static_cast<uint32>(c->GetStandState());
c->SetStandState(static_cast<uint8>(data3));
} break;
case CREATURE_CHANGE_DISPLAYID:
{
es->data_1 = c->GetDisplayId();
c->SetDisplayId(data1);
es->data_2 = c->GetNativeDisplayId();
c->SetNativeDisplayId(data2);
es->data_3 = c->GetMount();
c->SetMount(data3);
c->EventModelChange();
} break;
case CREATURE_CHANGE_WEAPON:
{
es->data_1 = c->GetEquippedItem(MELEE);
es->data_2 = c->GetEquippedItem(OFFHAND);
es->data_3 = c->GetEquippedItem(RANGED);
c->SetEquippedItem(MELEE, data1);
c->SetEquippedItem(OFFHAND, data2);
c->SetEquippedItem(RANGED, data3);
} break;
case CREATURE_CHANGE_REACT:
{
es->data_1 = c->GetFaction();
c->SetFaction(data1);
es->data_2 = c->GetUInt32Value(UNIT_NPC_FLAGS);
c->SetUInt32Value(UNIT_NPC_FLAGS, data2);
es->data_3 = c->GetUInt32Value(UNIT_FIELD_FLAGS);
c->SetUInt32Value(UNIT_FIELD_FLAGS, data3);
} break;
case CREATURE_CAST_SPELL_ON_EVENT_START:
{
SpellEntry * sp = dbcSpell.LookupEntryForced( data1 );
if( sp == NULL )
return;
SpellCastTime * casttime = dbcSpellCastTime.LookupEntry(sp->CastingTimeIndex);
Spell * spell = sSpellFactoryMgr.NewSpell(c, sp, false, NULL);
SpellCastTargets t(0);
// force self casting
if( data2 )
{
t.m_unitTarget = c->GetGUID();
//.........这里部分代码省略.........