Batch #18562 by ragnarok-clanker: forced by an admin (31 lower score(s), 132 changed function(s)); checked with 230 compiled unit(s), including every includer of Source/Client/Mode/CGameMode.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GameObject.h, Source/Contents/Actors/GndRiser.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/MousePointer.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObject.h, Source/Contents/Actors/Skill.h, Source/Contents/Effects/Core/DummyEffectLauncher.h, Source/Contents/Effects/Core/EffectActor.h, Source/Contents/Effects/Core/EffectMaker.h, Source/Contents/Effects/Core/MsgEffect.h, Source/Contents/Effects/Skills/ArrowEffect.h, Source/Contents/Effects/Skills/MandraAttackEffect.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/GraffiSkill.h, Source/Contents/Sound/SoundMaker.h.
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
#include "Contents/World/World.h"
|
|
#include "Client/Mode/ModeMessage.h"
|
|
#include "Contents/Actors/ActorEnums.h"
|
|
|
|
#include "Client/Mode/CGameMode.h"
|
|
#include "Contents/Effects/Core/EffectLists.h"
|
|
#include "Contents/Effects/Core/EffectMaker.h"
|
|
#include "Contents/Sound/SoundConfiguration.h"
|
|
#include "Contents/Sound/SoundMaker.h"
|
|
#include "Resource/ResourceMgr.h"
|
|
#include "Resource/World/WorldResource.h"
|
|
|
|
#include <string>
|
|
|
|
// GLOBAL: gl_25108
|
|
SoundConfiguration g_soundConfiguration;
|
|
|
|
// OFFSET: 0x00AC9040
|
|
// FUNCTION: fn_17682
|
|
void CWorld::LoadMapEffects() {
|
|
std::string name = reinterpret_cast<const char*>(this->gameMode->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0));
|
|
C3dWorldRes* resource = static_cast<C3dWorldRes*>(ResourceMgr::Instance().Load(name.c_str()));
|
|
|
|
for (auto it = resource->effects.begin(); it != resource->effects.end(); ++it) {
|
|
WorldEffectRecord* record = *it;
|
|
|
|
if (g_effectMgr->HasAllocator(record->id)) {
|
|
g_effectMgr->Spawn(0, record->id, record->position[0], record->position[1], record->position[2], 0, -1, 0, 0);
|
|
} else {
|
|
CEffectMaker* effect = new CEffectMaker;
|
|
const int address = reinterpret_cast<int>(record);
|
|
effect->SendMsg(nullptr, AM_SETPOS, address, 0, 0, 0, 0, 0);
|
|
this->objects.push_back(effect);
|
|
}
|
|
}
|
|
|
|
g_effectMgr->LoadMapEffectScript(true);
|
|
|
|
if (g_soundConfiguration.mode != 0) {
|
|
for (auto it = resource->sounds.begin(); it != resource->sounds.end(); ++it) {
|
|
WorldSoundRecord* record = *it;
|
|
CSoundMaker* sound = new CSoundMaker;
|
|
const int address = reinterpret_cast<int>(record);
|
|
sound->SendMsg(nullptr, AM_SETPOS, address, 0, 0, 0, 0, 0);
|
|
this->objects.push_back(sound);
|
|
}
|
|
}
|
|
}
|