Les thèmes d'une zone
Bonjour à tous !

Je me suis mis dans ma petite tête de réaliser un script qui permet de changer de "thème" d'une zone tous les X minutes. C'est le même principe qu'un certain script pour changer l'arène de gurubashi en un lac/foret/glace...

Par exemple, d'une zone "forêt" la zone passe à une zone "de glace" au bout de X minutes, etc.

Ma question est: Quelle fonction utiliser ? Et surtout quelle classe ? Car je ne vois pas du tout quelle class/fonction peut me permettre de réaliser ceci, car je rappel que le script dont j'ai parlé légèrement plus haut, utilise un PNJ, alors que j'aimerai, pour ma part réaliser le changement automatiquement.

Si je n'ai pas été assez claire, dites le moi !

PS : Excusez-moi des fautes, je viens de me réveiller ^^'

Cordialement,
Crisou
Alors regarde au niveau du World.cpp pour les timers, comment ils sont créez et tout.

Et ensuite recherche au niveau de la commande .event start, pour trouver des classes qui permettent de spawns et despawns des gameobjetcs/creature (normalement on devrait te parler de grid et tout)

Ensuite, tu creer une nouvelle classe avec un timer, une fonction pour spawn despawn (pense que un guid est toujours positif, donc si il est négatif pourquoi pas faire despawn *siffle*) une fonction load et hop Big Grin

Bonne chance Smile
Je viens pas pour aider mais pour te souhaiter bon courage, j'suis curieux de voir ça Big Grin
Merci totomakers je vais aller examiner ses fichiers !
Pour t'aider :

void FreeForAll::spawnGameObjectEntity(bool remove)
{
    for (std::vector<int32>::iterator itr = this->gameobjectGuidList.begin(); itr != this->gameobjectGuidList.end(); ++itr)
    {
        int32 guid = *itr;

        //Suppresion 
        //On inverse les guid
        if (remove)
        {
            if (*itr < 0)
                guid = abs(guid);
            else
                guid = -guid;
        }

        // Guid Positif
        // Ajout sur la carte
        if (guid > 0)
        {
            if (GameObjectData const* data = sObjectMgr->GetGOData(guid))
            {
                TC_LOG_INFO("server.loading", "[FreeForAll] Add gameobject %u...", guid);
                sObjectMgr->AddGameobjectToGrid(guid, data);

                // Spawn if necessary (loaded grids only)
                // this base map checked as non-instanced and then only existed
                Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));

                // We use current coords to unspawn, not spawn coords since creature can have changed grid
                if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
                {
                    GameObject* pGameobject = new GameObject;
                    //sLog->outDebug("Spawning gameobject %u", *itr);
                    if (!pGameobject->LoadFromDB(guid, map))
                        delete pGameobject;
                    else
                    {
                        if (pGameobject->isSpawnedByDefault())
                            map->AddToMap(pGameobject);
                    }
                }
            }
        }
        else
        {
            guid = abs(guid);
            TC_LOG_INFO("server.loading", "[FreeForAll] Remove gameobject %u...", guid);

            if (GameObjectData const* data = sObjectMgr->GetGOData(guid))
            {
                sObjectMgr->RemoveGameobjectFromGrid(guid, data);

                if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
                    pGameobject->AddObjectToRemoveList();
            }
        }
    }
}

void FreeForAll::spawnCreatureEntity(bool remove)
{
    for (std::vector<int32>::iterator itr = this->creatureGuidList.begin(); itr != this->creatureGuidList.end(); ++itr)
    {
        int32 guid = *itr;

        //Suppresion 
        //On inverse les guid
        if (remove)
        {
            if (*itr < 0)
                guid = abs(guid);
            else
                guid = -guid;
        }

        // Guid Positif
        // Ajout sur la carte
        if (guid > 0)
        {
            if (CreatureData const* data = sObjectMgr->GetCreatureData(guid))
            {
                TC_LOG_INFO("server.loading", "[FreeForAll] Add creature  %u...", guid);
                sObjectMgr->AddCreatureToGrid(guid, data);

                // Spawn if necessary (loaded grids only)
                Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));

                // We use spawn coords to spawn
                if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
                {
                    Creature* pCreature = new Creature;

                    if (!pCreature->LoadFromDB(guid, map))
                        delete pCreature;
                    else
                        map->AddToMap(pCreature);
                }
            }
        }
        // Guid Négatif
        // On supprime de la carte
        else
        {
            guid = abs(guid);
            TC_LOG_INFO("server.loading", "[FreeForAll] Remove creature  %u...", guid);

            if (CreatureData const* data = sObjectMgr->GetCreatureData(guid))
            {
                sObjectMgr->RemoveCreatureFromGrid(guid, data);

                if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
                    pCreature->AddObjectToRemoveList();
            }
        }
    }
}
Merci Totomakers, mais mon pc a atteint la fin de sa vie, et j'ai fais aucune sauvegarde de mon travail, donc je suis un peu démoralisé pour le moment.

Je reprendrais mon apprentissage sur l'ému et etc vers septembre/octobre quand j'aurai eu mon budget pour monter mon propre PC Tongue
Dois je considérer cette demande comme résolue ?
Oui, pour le moment, après, si je reprend mon projet, je demanderai de le repasser eb bormal
Très bien, merci !

Retourner en haut WoW-Emu