コード例 #1
0
ファイル: Level2.cpp プロジェクト: Sylica2013/Antrix
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
0
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
0
ファイル: Level2.cpp プロジェクト: Sylica2013/Antrix
bool ChatHandler::HandleGOScale(const char* args, WorldSession* m_session)
{
	GameObject *go = m_session->GetPlayer()->m_GM_SelectedGO;
	if( !go )
	{
		RedSystemMessage(m_session, "No selected GameObject...");
		return true;
	}
	if(!args)
	{
		RedSystemMessage(m_session, "Invalid syntax. Should be .gobject scale 1.0");
		return false;
	}
	float scale = atof(args);
	if(!scale) scale = 1;
	go->SetFloatValue(OBJECT_FIELD_SCALE_X, scale);
	BlueSystemMessage(m_session, "Set scale to %.3f", scale);
	return true;
}
コード例 #4
0
ファイル: Level2.cpp プロジェクト: Sylica2013/Antrix
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;
}
コード例 #5
0
ファイル: Level2.cpp プロジェクト: Refuge89/Hearthstone
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;
}
コード例 #6
0
ファイル: Level1.cpp プロジェクト: Lbniese/ArcEmu_MoP
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;
}
コード例 #7
0
ファイル: Level2.cpp プロジェクト: Sylica2013/Antrix
bool ChatHandler::HandleGOExport(const char * args, WorldSession * m_session)
{
	if(!m_session->GetPlayer()->m_GM_SelectedGO)
		return false;
	
	std::stringstream name;
	if (*args)
	{
		name << "GO_" << args << ".sql";
	}
	else
	{
		name << "GO_" << m_session->GetPlayer()->m_GM_SelectedGO->GetEntry() << ".sql";
	}
   
	m_session->GetPlayer()->m_GM_SelectedGO->SaveToFile(name);

	BlueSystemMessage(m_session, "Go saved to: %s", name.str().c_str());
	return true;
}
コード例 #8
0
ファイル: Level2.cpp プロジェクト: Chero/abcwow
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;
}
コード例 #9
0
ファイル: Level2.cpp プロジェクト: Chero/abcwow
bool ChatHandler::HandleGOScale(const char* args, WorldSession* m_session)
{
	GameObject *go = m_session->GetPlayer()->GetSelectedGo();
	if( !go )
	{
		RedSystemMessage(m_session, "No selected GameObject...");
		return true;
	}
	if(!args)
	{
		RedSystemMessage(m_session, "Invalid syntax. Should be .gobject scale 1.0");
		return false;
	}
	float scale = (float)atof(args);
	if(!scale) scale = 1;
	go->SetFloatValue(OBJECT_FIELD_SCALE_X, scale);
	BlueSystemMessage(m_session, "Set scale to %.3f", scale);
	sGMLog.writefromsession(m_session,"set scale on gameobject %s to %.3f, entry %u",GameObjectNameStorage.LookupEntry(go->GetEntry())->Name,scale,go->GetEntry());
	return true;
}
コード例 #10
0
ファイル: GuildCommands.cpp プロジェクト: armm77/AscEmu
//.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;
}
コード例 #11
0
ファイル: Level1.cpp プロジェクト: pfchrono/rs-ascent
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;
}
コード例 #12
0
ファイル: Level2.cpp プロジェクト: Chero/abcwow
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;
}
コード例 #13
0
ファイル: Level1.cpp プロジェクト: dberga/arcbliz
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;
}
コード例 #14
0
ファイル: Level2.cpp プロジェクト: Ikesters/ArcPro
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;
}
コード例 #15
0
ファイル: Level2.cpp プロジェクト: Sylica2013/Antrix
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;
}
コード例 #16
0
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;
}
コード例 #17
0
ファイル: Level2.cpp プロジェクト: Refuge89/Hearthstone
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;
}
コード例 #18
0
ファイル: Level2.cpp プロジェクト: Chero/abcwow
bool ChatHandler::HandleGOActivate(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_STATE) == 1)
	{
		// Close/Deactivate
		GObj->SetUInt32Value(GAMEOBJECT_STATE, 0);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)-1));
	} else {
		// Open/Activate
		GObj->SetUInt32Value(GAMEOBJECT_STATE, 1);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)+1));
	}
	BlueSystemMessage(m_session, "Gameobject opened/closed.");
	sGMLog.writefromsession( m_session, "opened/closed gameobject %s, entry %u", GameObjectNameStorage.LookupEntry( GObj->GetEntry() )->Name, GObj->GetEntry() );
	return true;
}
コード例 #19
0
ファイル: Level1.cpp プロジェクト: Nupper/AscEmu_Vanilla
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;
}
コード例 #20
0
ファイル: Level1.cpp プロジェクト: Nupper/AscEmu_Vanilla
bool ChatHandler::HandleModifySpeedCommand(const char* args, WorldSession *m_session)
{
    WorldPacket data;

    if (!*args)
        return false;

    float Speed = (float)atof((char*)args);

    if (Speed > 255 || Speed < 1)
    {
        RedSystemMessage(m_session, "Incorrect value. Range is 1..255");
        return true;
    }

    Player *chr = getSelectedChar(m_session);
    if (chr == NULL)
        return true;

    if (chr != m_session->GetPlayer())
        sGMLog.writefromsession(m_session, "modified speed of %s to %2.2f.", chr->GetName(), Speed);


    char buf[256];

    // send message to user
    BlueSystemMessage(m_session, "You set the speed of %s to %2.2f.", chr->GetName(), Speed);

    // send message to player
    snprintf((char*)buf, 256, "%s set your speed to %2.2f.", m_session->GetPlayer()->GetName(), Speed);
    SystemMessage(chr->GetSession(), buf);

    chr->SetPlayerSpeed(RUN, Speed);
    chr->SetPlayerSpeed(SWIM, Speed);
    chr->SetPlayerSpeed(RUNBACK, Speed);
    chr->SetPlayerSpeed(FLY, Speed);

    return true;
}
コード例 #21
0
ファイル: Level1.cpp プロジェクト: Nupper/AscEmu_Vanilla
bool ChatHandler::HandleModifySkillCommand(const char *args, WorldSession *m_session)
{
    uint32 skill, min, max;
    min = max = 1;
    char *pSkill = strtok((char*)args, " ");
    if (!pSkill)
        return false;
    else
        skill = atol(pSkill);

    char *pMin = strtok(NULL, " ");
    uint32 cnt = 0;
    if (!pMin)
        cnt = 1;
    else
        cnt = atol(pMin);

    skill = atol(pSkill);

    BlueSystemMessage(m_session, "Modifying skill line %d. Advancing %d times.", skill, cnt);

    Player *plr = getSelectedChar(m_session, true);
    if (!plr) plr = m_session->GetPlayer();
    if (!plr) return false;
    sGMLog.writefromsession(m_session, "used modify skill of %u %u on %s", skill, cnt, plr->GetName());

    if (!plr->_HasSkillLine(skill))
    {
        SystemMessage(m_session, "Does not have skill line, adding.");
        plr->_AddSkillLine(skill, 1, 300);
    }
    else
    {
        plr->_AdvanceSkillLine(skill, cnt);
    }

    return true;
}
コード例 #22
0
bool ChatHandler::HandleDBItemSetNameCommand(const char* args, WorldSession *m_session)
{
    uint32 entry;
    char name[255];
    if(sscanf(args, "%u %s", &entry, &name) != 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 name from %s to %s", proto->Name1, (char*)name);
    proto->Name1 = name;
    WorldDatabase.Execute("UPDATE items SET name1 = '%s' WHERE entry = '%u'", (char*)name, entry);
    m_lock.Release();

    m_session->SendItemInfo(entry);
    return true;
}
コード例 #23
0
ファイル: Level2.cpp プロジェクト: Refuge89/Hearthstone
bool ChatHandler::HandleGOScale(const char* args, WorldSession* m_session)
{
    GameObject* go = m_session->GetPlayer()->m_GM_SelectedGO;
    if( !go )
    {
        RedSystemMessage(m_session, "No selected GameObject...");
        return true;
    }

    float scale = (float)atof(args);
    if(scale <= 0.0f)
        scale = 1; // Scale defaults to 1 on GO's, so its basically a reset.
    if(scale > 255.0f)
        scale = 255.0f;

    go->SetFloatValue(OBJECT_FIELD_SCALE_X, scale);
    BlueSystemMessage(m_session, "Set scale to %.3f", scale);
    go->RemoveFromWorld(false);
    go->SaveToDB();
    go->PushToWorld(m_session->GetPlayer()->GetMapMgr());
    sWorld.LogGM(m_session, "Scaled gameobject spawn id %u to %f", go->m_spawn ? go->m_spawn->id : 0, scale);
    return true;
}
コード例 #24
0
ファイル: HonorHandler.cpp プロジェクト: TheGhostGroup/AscEmu
bool ChatHandler::HandlePVPCreditCommand(const char* args, WorldSession* m_session)
{
    uint32 Rank, Points;
    if (sscanf(args, "%u %u", (unsigned int*)&Rank, (unsigned int*)&Points) != 2)
    {
        RedSystemMessage(m_session, "Command must be in format <rank> <points>.");
        return true;
    }
    Points *= 10;
    uint64 Guid = m_session->GetPlayer()->GetSelection();
    if (Guid == 0)
    {
        RedSystemMessage(m_session, "A selection of a unit or player is required.");
        return true;
    }

    BlueSystemMessage(m_session, "Building packet with Rank %u, Points %u, GUID " I64FMT ".", Rank, Points, Guid);

    WorldPacket data(SMSG_PVP_CREDIT, 12);
    data << Points << Guid << Rank;
    m_session->SendPacket(&data);
    return true;
}
コード例 #25
0
ファイル: Level2.cpp プロジェクト: Chero/abcwow
bool ChatHandler::HandleGOActivate(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_STATE) == 1)
	{
		// Close/Deactivate
		GObj->SetUInt32Value(GAMEOBJECT_STATE, 0);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)-1));
	} else {
		// Open/Activate
		GObj->SetUInt32Value(GAMEOBJECT_STATE, 1);
		GObj->SetUInt32Value(GAMEOBJECT_FLAGS, (GObj->GetUInt32Value(GAMEOBJECT_FLAGS)+1));
	}
	BlueSystemMessage(m_session, "Gameobject opened/closed.");
	return true;
}
コード例 #26
0
ファイル: Level1.cpp プロジェクト: pfchrono/rs-ascent
bool ChatHandler::HandleGMOffCommand(const char* args, WorldSession *m_session)
{
	uint8 race = m_session->GetPlayer()->getRace();
	//uint32 newbytes = m_session->GetPlayer( )->GetUInt32Value(PLAYER_BYTES_2) & ~(0x8);
	//m_session->GetPlayer( )->SetUInt32Value( PLAYER_BYTES_2, newbytes);

	//GreenSystemMessage(m_session, "GM Flag Unset.");
	GreenSystemMessage(m_session, "Unsetting GM Flag on yourself...");
	if(!m_session->GetPlayer()->bGMTagOn)
		RedSystemMessage(m_session, "GM Flag not set. Use !gmon to enable it.");
	else
	{
		m_session->GetPlayer()->setFaction(race);
		m_session->GetPlayer()->GodModeCheat = false;
		m_session->GetPlayer()->bInvincible = false;	
		m_session->GetPlayer()->bGMTagOn = false;
		m_session->GetPlayer()->bCTagOn = false;
		m_session->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAG_GM);	// <GM>
		BlueSystemMessage(m_session, "GM Flag Removed. <GM> Will no longer show in chat messages or above your name.");
	}

	return true;
}
コード例 #27
0
ファイル: cmd_gobject.cpp プロジェクト: lev1976g/NoxicCore
bool ChatHandler::HandleGODamageCommand(const char* args, WorldSession* session)
{
	GameObject* go = session->GetPlayer()->GetSelectedGo();
	if(!go)
	{
		RedSystemMessage(session, "You need to select a GO first!");
		return false;
	}

	if(go->GetInfo()->Type != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
	{
		RedSystemMessage(session, "The selected GO must be a destructible building!");
		return false;
	}

	if(*args == '\0')
	{
		RedSystemMessage(session, "You need to specify how much you want to damage the selected GO!");
		return false;
	}

	uint32 damage = 0;
	std::stringstream ss(args);

	ss >> damage;
	if(ss.fail())
	{
		RedSystemMessage(session, "You need to specify how much you want to damage the selected GO!");
		return false;
	}

	uint64 guid = session->GetPlayer()->GetGUID();
	BlueSystemMessage(session, "Attempting to damage GO...");
	go->Damage(damage, guid, guid, 0);

	return true;
}
コード例 #28
0
ファイル: GameMasterCommands.cpp プロジェクト: armm77/AscEmu
//.gm blockwhispers
bool ChatHandler::HandleGMBlockWhispersCommand(const char* args, WorldSession* m_session)
{
    if (args == 0)
    {
        RedSystemMessage(m_session, "No playername set.");
        RedSystemMessage(m_session, "Use .gm blockwhispers <playername>");
        return true;
    }

    auto player_cache = objmgr.GetPlayerCache(args, false);
    if (player_cache == nullptr)
    {
        RedSystemMessage(m_session, "Player %s not found.", args);
        return true;
    }

    m_session->GetPlayer()->m_cache->RemoveValue64(CACHE_GM_TARGETS, player_cache->GetUInt32Value(CACHE_PLAYER_LOWGUID));
    std::string name;
    player_cache->GetStringValue(CACHE_PLAYER_NAME, name);
    BlueSystemMessage(m_session, "Now blocking whispers from %s.", name.c_str());
    player_cache->DecRef();

    return true;
}
コード例 #29
0
ファイル: Level0.cpp プロジェクト: Nupper/AscEmu_Vanilla
bool ChatHandler::HandleDismountCommand(const char* args, WorldSession *m_session)
{
    Unit *m_target = NULL;

    Player *p_target = getSelectedChar(m_session, false);

    if (p_target)
        m_target = p_target;
    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 not mounted.");
        return true;
    }

    if (p_target && p_target->m_MountSpellId)
        p_target->RemoveAura(p_target->m_MountSpellId);

    m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
    //m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNTED_TAXI);

    BlueSystemMessage(m_session, "Now unmounted.");
    return true;
}
コード例 #30
0
ファイル: Level1.cpp プロジェクト: Nupper/AscEmu_Vanilla
bool ChatHandler::HandleTriggerCommand(const char* args, WorldSession* m_session)
{
    int32 instance_id;
    uint32 trigger_id;
    int valcount = sscanf(args, "%u %d", (unsigned int*)&trigger_id, (int*)&instance_id);
    if (!valcount)
        return false;
    if (valcount == 1)
        instance_id = 0;

    AreaTriggerEntry *entry = dbcAreaTrigger.LookupEntry(trigger_id);
    if (trigger_id == 0 || entry == NULL)
    {
        RedSystemMessage(m_session, "Could not find trigger %s", (args == NULL ? "NULL" : args));
        return true;
    }

    m_session->GetPlayer()->SafeTeleport(entry->mapid, instance_id, LocationVector(entry->x, entry->y,
        entry->z, entry->o));

    BlueSystemMessage(m_session, "Teleported to trigger %u on [%u][%.2f][%.2f][%.2f]", entry->id,
                      entry->mapid, entry->x, entry->y, entry->z);
    return true;
}