Some of you know that i am working on an rift system for flyff.
Well i need an bit of help once again xD.
I thought i finished it but then i noticed an little bug.
Ok here it goes.
.lua file contains
AddWorld(WorldID, TotalMonster, StartPosition)
SetMonsterSpawn(WorldID, Position)
SetMonsterSpawn(WorldID, Position)
SetMonsterSpawn(WorldID, Position)
now for test its filled like this
AddWorld(1, 5, 123, 100, 20)
SetMonsterSpawn(1, 127,100,25)
SetMonsterSpawn(1, 50,100,300)
SetMonsterSpawn(2, 150,100,500)
Ok so far so good.
The problem is when i enter the rift at world id 1 instead of random 5 monsters it sometimes set just 2 monsters at 2 diff locations.
That is because its also using the SetMonsterSpawn (2).
So my question is how can i make it so that it only loops true the RIFT_SPAWN vector if the WorldId is the same as SetMonsterSpawn(WorldId).
Atm i have it like this
Code:
D3DXVECTOR3 CRiftMatch::GetMoverSpawnPoints(DWORD dwWorldId)
{
vector<RIFT_MONSTER_SPAWN> vecSpawn = CRiftMng::GetInstance()->m_vecMSpawnPoint;
for (int i = 0; i < vecSpawn.size(); i++)
{
if (vecSpawn[i].dwWorldId == dwWorldId)
{
OUTPUTDEBUGSTRING("\n GetSpawnPoints %d", vecSpawn.size());
}
}
int nRand = rand() % vecSpawn.size();
return vecSpawn[nRand].vPos;
}
@
i will tag you to cause you already have helped me an lot in understanding vectors. but i can't seem to solve this one.With kind regards/.






