本文整理汇总了C++中BlueSystemMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ BlueSystemMessage函数的具体用法?C++ BlueSystemMessage怎么用?C++ BlueSystemMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BlueSystemMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RedSystemMessage
bool ChatHandler::HandleMountCommand(const char *args, WorldSession *m_session)
{
if(!args)
{
RedSystemMessage(m_session, "No model specified");
return true;
}
uint32 modelid = atol(args);
if(!modelid)
{
RedSystemMessage(m_session, "No model specified");
return true;
}
Unit *m_target = NULL;
Player *m_plyr = getSelectedChar(m_session, false);
if(m_plyr)
m_target = m_plyr;
else
{
Creature *m_crt = getSelectedCreature(m_session, false);
if(m_crt)
m_target = m_crt;
}
if(!m_target)
{
RedSystemMessage(m_session, "No target found.");
return true;
}
if(m_target->GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID) != 0)
{
RedSystemMessage(m_session, "Target is already mounted.");
return true;
}
m_target->SetUInt32Value( UNIT_FIELD_MOUNTDISPLAYID , modelid);
if(!m_target->HasFlag(UNIT_FIELD_FLAGS, U_FIELD_FLAG_MOUNT_SIT)) m_target->SetFlag( UNIT_FIELD_FLAGS , U_FIELD_FLAG_MOUNT_SIT );
BlueSystemMessage(m_session, "Now mounted with model %d.", modelid);
return true;
}
示例2: atol
bool ChatHandler::HandleDBItemCreateCommand(const char* args, WorldSession *m_session)
{
uint32 entry = atol(args);
if(entry == 0)
return false;
ItemPrototype* proto = ItemPrototypeStorage.LookupEntry(entry);
if(proto)
RedSystemMessage(m_session, "That item already exists");
else
{
BlueSystemMessage(m_session, "Created item %u", entry);
WorldDatabase.Execute("INSERT INTO items(entry, name1) VALUES(%u, \"New Item\")", entry);
ItemPrototypeStorage.Reload();
}
m_session->SendItemInfo(entry);
return true;
}
示例3: BlueSystemMessage
bool ChatHandler::HandleNpcExport(const char * args, WorldSession * m_session)
{
Creature* target = m_session->GetPlayer()->GetMapMgr()->GetCreature(m_session->GetPlayer()->GetSelection());
if (!target)
return false;
std::stringstream name;
if (*args)
{
name << "NPC_" << args << ".sql";
}
else
{
name << "NPC_" << target->GetEntry() << ".sql";
}
target->SaveToFile(name);
BlueSystemMessage(m_session, "Creature/npc saved to: %s", name.str().c_str());
return true;
}
示例4: getSelectedUnit
bool ChatHandler::HandleCastSpellNECommand(const char* args, WorldSession *m_session)
{
Unit* caster = m_session->GetPlayer();
Unit* target = getSelectedUnit(m_session, false);
if(!target)
target = caster;
uint32 spellId = atol(args);
SpellEntry *spellentry = dbcSpell.LookupEntryForced(spellId);
if(spellentry == NULL)
{
RedSystemMessage(m_session, "Invalid spell id!");
return false;
}
BlueSystemMessage(m_session, "Casting spell %d on target.", spellId);
WorldPacket data;
data.Initialize( SMSG_SPELL_START );
data << caster->GetNewGUID();
data << caster->GetNewGUID();
data << spellId;
data << uint8(0);
data << uint16(0);
data << uint32(0);
data << uint16(2);
data << target->GetGUID();
m_session->SendPacket( &data );
data.clear();
data.Initialize( SMSG_SPELL_GO );
data << caster->GetNewGUID();
data << caster->GetNewGUID();
data << spellId;
data << uint8(0) << uint8(1) << uint8(1);
data << target->GetGUID();
data << uint8(0);
data << uint16(2);
data << target->GetGUID();
m_session->SendPacket( &data );
return true;
}
示例5: RedSystemMessage
bool ChatHandler::HandleGMOnCommand(const char* args, WorldSession* m_session)
{
Player* _player = m_session->GetPlayer();
if(_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM))
RedSystemMessage(m_session, "GM Flag is already set on.");
else
{
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_GM); // <GM>
_player->SetFaction(35);
_player->RemovePvPFlag();
_player->TriggerpassCheat = true;
BlueSystemMessage(m_session, "GM flag set.");
_player->UpdateVisibility();
}
return true;
}
示例6: RedSystemMessage
bool ChatHandler::HandleGOEnable(const char *args, WorldSession *m_session)
{
GameObject *GObj = m_session->GetPlayer()->GetSelectedGo();
if( !GObj )
{
RedSystemMessage(m_session, "No selected GameObject...");
return true;
}
if(GObj->GetUInt32Value(GAMEOBJECT_DYN_FLAGS) == 1)
{
// Deactivate
GObj->SetUInt32Value(GAMEOBJECT_DYN_FLAGS, 0);
} else {
// /Activate
GObj->SetUInt32Value(GAMEOBJECT_DYN_FLAGS, 1);
}
BlueSystemMessage(m_session, "Gameobject activate/deactivated.");
sGMLog.writefromsession( m_session, "activated/deactivated gameobject %s, entry %u", GameObjectNameStorage.LookupEntry( GObj->GetEntry() )->Name, GObj->GetEntry() );
return true;
}
示例7: GetSelectedPlayer
//.guild listmembers
bool ChatHandler::HandleGuildListMembersCommand(const char* /*args*/, WorldSession* m_session)
{
Player* selected_player = GetSelectedPlayer(m_session, true, true);
if (selected_player == nullptr)
return true;
#if VERSION_STRING != Cata
if (selected_player->IsInGuild())
{
RedSystemMessage(m_session, "%s not in a guild.", selected_player->GetName());
return true;
}
#else
if (selected_player->GetGuild())
{
RedSystemMessage(m_session, "%s not in a guild.", selected_player->GetName());
return true;
}
#endif
#if VERSION_STRING != Cata
GreenSystemMessage(m_session, "Now showing guild members for %s", selected_player->GetGuild()->getGuildName());
#else
GreenSystemMessage(m_session, "Now showing guild members for %s", selected_player->GetGuild()->getName().c_str());
#endif
#if VERSION_STRING != Cata
selected_player->GetGuild()->Lock();
for (GuildMemberMap::iterator itr = selected_player->GetGuild()->GetGuildMembersBegin(); itr != selected_player->GetGuild()->GetGuildMembersEnd(); ++itr)
{
GuildMember* member = itr->second;
if (!member || !member->pPlayer)
continue;
BlueSystemMessage(m_session, "%s (Rank: %s)", member->pPlayer->name, member->pRank->szRankName);
}
selected_player->GetGuild()->Unlock();
#endif
return true;
}
示例8: GreenSystemMessage
bool ChatHandler::HandleGMOnCommand(const char* args, WorldSession *m_session)
{
/*uint32 newbytes = m_session->GetPlayer( )->GetUInt32Value(PLAYER_BYTES_2) | 0x8;
m_session->GetPlayer( )->SetUInt32Value( PLAYER_BYTES_2, newbytes);
GreenSystemMessage(m_session, "GM Flag Set.");*/
if(m_session->GetPlayer()->bGMTagOn)
RedSystemMessage(m_session, "GM Status Is Already On. Use !gmoff To Disable It.");
else
{
m_session->GetPlayer()->setFaction(35);
m_session->GetPlayer()->GodModeCheat = true;
m_session->GetPlayer()->bInvincible = true;
m_session->GetPlayer()->bGMTagOn = true;
m_session->GetPlayer()->bCTagOn = true;
m_session->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_GM); // <GM>
BlueSystemMessage(m_session, "GM Flag Set. It will appear above your name and in chat messages until you use !gmoff.");
}
return true;
}
示例9: RedSystemMessage
bool ChatHandler::HandleGOEnable(const char *args, WorldSession *m_session)
{
GameObject *GObj = NULL;
GObj = m_session->GetPlayer()->m_GM_SelectedGO;
if( !GObj )
{
RedSystemMessage(m_session, "No selected GameObject...");
return true;
}
if(GObj->GetUInt32Value(GAMEOBJECT_DYN_FLAGS) == 1)
{
// Deactivate
GObj->SetUInt32Value(GAMEOBJECT_DYN_FLAGS, 0);
} else {
// /Activate
GObj->SetUInt32Value(GAMEOBJECT_DYN_FLAGS, 1);
}
BlueSystemMessage(m_session, "Gameobject activate/deactivated.");
return true;
}
示例10: GreenSystemMessage
bool ChatHandler::HandleGMOnCommand(const char* args, WorldSession* m_session)
{
GreenSystemMessage(m_session, "Setting GM Flag on yourself.");
Player* _player = m_session->GetPlayer();
if(_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM))
RedSystemMessage(m_session, "GM Flag is already set on. Use .gm off to disable it.");
else
{
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_GM); // <GM>
_player->SetFaction(35);
_player->RemovePvPFlag();
BlueSystemMessage(m_session, "GM flag set. It will now appear above your name and in chat messages until you use .gm off.");
_player->UpdateVisibility();
}
return true;
}
示例11: getSelectedChar
bool ChatHandler::HandleCastSpellCommand(const char* args, WorldSession* m_session)
{
Unit* caster = m_session->GetPlayer();
Unit* target = getSelectedChar(m_session, false);
if(!target)
target = getSelectedCreature(m_session, false);
if(!target)
{
RedSystemMessage(m_session, "Must select a char or creature.");
return false;
}
uint32 spellid = atol(args);
SpellEntry* spellentry = dbcSpell.LookupEntryForced(spellid);
if(!spellentry)
{
RedSystemMessage(m_session, "Invalid spell id!");
return false;
}
Spell* sp = sSpellFactoryMgr.NewSpell(caster, spellentry, false, NULL);
BlueSystemMessage(m_session, "Casting spell %d on target.", spellid);
SpellCastTargets targets;
targets.m_unitTarget = target->GetGUID();
sp->prepare(&targets);
switch(target->GetTypeId())
{
case TYPEID_PLAYER:
if(caster != target)
sGMLog.writefromsession(m_session, "cast spell %d on PLAYER %s", spellid, TO< Player* >(target)->GetName());
break;
case TYPEID_UNIT:
sGMLog.writefromsession(m_session, "cast spell %d on CREATURE %u [%s], sqlid %u", spellid, TO< Creature* >(target)->GetEntry(), TO< Creature* >(target)->GetCreatureInfo()->Name, TO< Creature* >(target)->GetSQL_id());
break;
}
return true;
}
示例12: SystemMessage
bool ChatHandler::HandleDeleteCommand(const char* args, WorldSession *m_session)
{
uint64 guid = m_session->GetPlayer()->GetSelection();
if (guid == 0)
{
SystemMessage(m_session, "No selection.");
return true;
}
Creature *unit = m_session->GetPlayer()->GetMapMgr()->GetCreature(guid);
if(!unit)
{
SystemMessage(m_session, "You should select a creature.");
return true;
}
sGMLog.writefromsession(m_session, "used npc delete, sqlid %u, creature %s, pos %f %f %f",
unit->GetSQL_id(), unit->GetCreatureName()->Name, unit->GetPositionX(), unit->GetPositionY(),
unit->GetPositionZ());
if(unit->m_spawn == 0)
return false;
BlueSystemMessage(m_session, "Deleted creature ID %u", unit->spawnid);
if(unit->IsInWorld())
{
if(unit->m_spawn)
{
uint32 cellx=float2int32(((_maxX-unit->m_spawn->x)/_cellSize));
uint32 celly=float2int32(((_maxY-unit->m_spawn->y)/_cellSize));
unit->GetMapMgr()->GetBaseMap()->GetSpawnsListAndCreate(cellx, celly)->CreatureSpawns.erase(unit->m_spawn);
}
unit->RemoveFromWorld(false);
}
unit->DeleteFromDB();
delete unit;
return true;
}
示例13: RedSystemMessage
bool ChatHandler::HandleDBItemSetBondingCommand(const char* args, WorldSession *m_session)
{
uint32 entry, subclass;
if(sscanf(args, "%u %u", &entry, &subclass) != 2)
return false;
ItemPrototype* proto = ItemPrototypeStorage.LookupEntry(entry);
if(proto == NULL)
{
RedSystemMessage(m_session, "Item does not exist.");
return true;
}
m_lock.Acquire();
BlueSystemMessage(m_session, "Changing item subclass from %u to %u", proto->SubClass, subclass);
proto->SubClass = subclass;
WorldDatabase.Execute("UPDATE items SET subclass = '%u' WHERE entry = '%u'", subclass, entry);
m_lock.Release();
m_session->SendItemInfo(entry);
return true;
}
示例14: getSelectedCreature
bool ChatHandler::HandleNPCSetOnObjectCommand(const char * args, WorldSession * m_session)
{
Creature* crt = getSelectedCreature(m_session, false);
if(crt == NULL)
{
RedSystemMessage(m_session, "Please select a creature before using this command.");
return true;
}
if(crt->m_spawn == NULL)
{
RedSystemMessage(m_session, "Creature must be a valid spawn.");
return true;
}
crt->m_spawn->CanMove |= LIMIT_ON_OBJ;
crt->SaveToDB();
BlueSystemMessage(m_session, "Setting creature on Object(%u)", crt->GetCanMove());
sWorld.LogGM(m_session, "Set npc %s, spawn id %u on object", crt->GetName(), crt->m_spawn->id);
return true;
}
示例15: sscanf
bool ChatHandler::HandleNpcSpawnLinkCommand(const char* args, WorldSession *m_session)
{
uint32 id;
char sql[512];
Creature* target = m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(m_session->GetPlayer()->GetSelection()));
if (!target)
return false;
int valcount = sscanf(args, "%u", (unsigned int*)&id);
if (valcount)
{
snprintf(sql, 512, "UPDATE creature_spawns SET npc_respawn_link = '%u' WHERE id = '%u'", (unsigned int)id, (unsigned int)target->GetSQL_id());
WorldDatabase.Execute(sql);
BlueSystemMessage(m_session, "Spawn linking for this NPC has been updated: %u", id);
}
else
{
RedSystemMessage(m_session, "Sql entry invalid %u", id);
}
return true;
}