Jump to content
  • 0

How to guild war map NPC fixing?


kaJaMrSimple

Question

I want to fix npc to guild war arena. 

 

/map/metin2_map_t3 what I do this way is not working.

how can I do it?

 

edit:

war_map.cpp in my source kod;

CHARACTER_MANAGER::instance().SpawnMob(20375, GetMapIndex(), 130, 99, 2, false, -1, true);

Syserr

SpawnMob: cannot create monster at non-exist sectree 130 x 99
Edited by kaJaMrSimple (see edit history)
Link to post

16 answers to this question

Recommended Posts

  • 0

Syserr is self explanatory, 130,99 are not valid coordinates, because you are passing local coords to the function while:

LPSECTREE SECTREE_MANAGER::Get(DWORD dwIndex, DWORD x, DWORD y)
{
	SECTREEID id;
	id.coord.x = x / SECTREE_SIZE;
	id.coord.y = y / SECTREE_SIZE;
	return Get(dwIndex, id.package);
}

you can see it goes to divide the cords with the sectree_size

 

Also, we can check, for example, do_mob_ld where it uses SpawnMob and:

	CHARACTER_MANAGER::instance().SpawnMob(vnum, 
		ch->GetMapIndex(),
		x*100, 
		y*100, 
		ch->GetZ(),
		pkMob->m_table.bType == CHAR_TYPE_STONE,
		dir);

So, to be sure, recalculate the coords doing /warp charactername.

Link to post
  • 0
56 minutes ago, xXIntelXx said:

Syserr is self explanatory, 130,99 are not valid coordinates, because you are passing local coords to the function while:


LPSECTREE SECTREE_MANAGER::Get(DWORD dwIndex, DWORD x, DWORD y)
{
	SECTREEID id;
	id.coord.x = x / SECTREE_SIZE;
	id.coord.y = y / SECTREE_SIZE;
	return Get(dwIndex, id.package);
}

you can see it goes to divide the cords with the sectree_size

 

Also, we can check, for example, do_mob_ld where it uses SpawnMob and:


	CHARACTER_MANAGER::instance().SpawnMob(vnum, 
		ch->GetMapIndex(),
		x*100, 
		y*100, 
		ch->GetZ(),
		pkMob->m_table.bType == CHAR_TYPE_STONE,
		dir);

So, to be sure, recalculate the coords doing /warp charactername.

 

quest warp begin
	state start begin
		when letter with pc.is_gm() begin
			send_letter("GM: Warp")
		end
		when button or info with pc.is_gm() begin
			setskin(0)
			send_letter("GM: Warp")
			syschat(pc.get_map_index().."-"..pc.get_x().."-"..pc.get_y().."-"..pc.get_local_x().."-"..pc.get_local_y())
		end
	end
end

I have a quest like this. but not working in guild warp map. I can't find coords. 
but I can spawn mob like this

regen_in_map(pc . get_map_index ( ), "locale/turkey/map/metin2_map_t3/cit.txt")

I want mobs (20375) to spawn every time a war starts. I have a countdown feature. When the time is up, the mobs on the map purge all and the war begins.

Edited by kaJaMrSimple (see edit history)
Link to post
  • 0

yeah but you said you spawn it from sources:

CHARACTER_MANAGER::instance().SpawnMob(20375, GetMapIndex(), 130, 99, 2, false, -1, true);

now, I don't know if the coords are random or not, but if they are not, just go into the map, and get the coords with the warp command warping to yourself.

Otherwise, in a quest, mob_spawn uses global coords, dungeon_spawn_mob uses local coords

Link to post
  • 0
3 minutes ago, xXIntelXx said:

evet ama onu kaynaklardan çıkardığını söyledin:

       

şimdi, koordinatların rastgele olup olmadığını bilmiyorum, ama değilse, sadece haritaya gidin ve warp komutunun kendinize çarptığı koordinatları alın.

Aksi takdirde, bir görevde mob_spawn küresel koordinatları kullanır, dungeon_spawn_mob yerel koordinatları kullanır

Okayyy I understand. I find global coords. I'll try now. I'll tell the result

Link to post
  • 0
31 minutes ago, xXIntelXx said:

usually you could just add *100

 

also my bad, mob_spawn (lua) uses local coords (no sleep vision problems lol)

Dec 19 19:29:18 :: SpawnMob: cannot create monster at non-exist sectree 450 x 99 (map 1100001)

 

Same syserr although I give global coords. (130x99 is local, 450x99 global coords)

 

mob_spawn (lua) is useless for me. but I want mobs (20375) to spawn every time a war starts. I have a countdown feature. When the time is up, the mobs on the map purge all and the war begins.

 

If I do it with lua, won't it spawn mobs again when the new player enters after the battle has started (i.e. after purge all)? This is a situation I don't want.

Link to post
  • 0

wait, how 130x99 are local and 450*99 are global? No way my dude ahah

130x99 are the coords u see in the minimap I suppose. Just add *100 + the basecoords of the map at those coords. Let's say the map has coordinates 153600*1203200

 

CHARACTER_MANAGER::instance().SpawnMob(20375, GetMapIndex(), 130*100 + 153600 , 99*100 + 1203200, 2, false, -1, true);
/*
130 = local_x
*100 = "global"
153600 = base_x of the map, the one in Settings.txt

99 = local_y
*100 = "global"
1203200 = base_y of the map, the one in Settings.txt
*/

which basically are the coordinates when you do /warp

Edited by xXIntelXx
I definitely need some sleep (see edit history)
  • Love 1
Link to post
  • 0
43 minutes ago, xXIntelXx said:

wait, how 130x99 are local and 450*99 are global? No way my dude ahah

130x99 are the coords u see in the minimap I suppose. Just add *100 + the basecoords of the map at those coords. Let's say the map has coordinates 153600*1203200

 

CHARACTER_MANAGER::instance().SpawnMob(20375, GetMapIndex(), 130*100 + 153600 , 99*100 + 1203200, 2, false, -1, true);
/*
130 = local_x
*100 = "global"
153600 = base_x of the map, the one in Settings.txt

99 = local_x
*100 = "global"
1203200 = base_y of the map, the one in Settings.txt
*/

which basically are the coordinates when you do /warp

 

Yeahh its work! but there is a small problem. 2 of them come from this and although the z coord is 2 it is not like 2

 

spacer.png

Link to post
  • 0
1 hour ago, kaJaMrSimple said:

 

Yeahh its work! but there is a small problem. 2 of them come from this and although the z coord is 2 it is not like 2

 

spacer.png

probably 2 is too low of a number but I have no idea why that thing would go up in the air ahah

Link to post
  • 0
Posted (edited)

I specify the z coordinate as 2, it reacts as if the coordinate is random.

my code;

    CHARACTER_MANAGER::instance().SpawnMob(20387, GetMapIndex(), 135 * 100 + 32000, 104  * 100 + 0, 2, false, -1, true);

 

I want to set the direction of mob.

 

What should I do?

Edited by kaJaMrSimple (see edit history)
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Activity

    1. 62

      Shop Ex Renewal

    2. 0

      [Problem] : System war between kingdoom

    3. 2

      DDos attacks

    4. 7

      Dynamic Weather

    5. 7

      How to avoid getting flooded in 2021

    6. 47

      Multiple Login Saver System

    7. 0

      BUG SKILL SURA

  • Recently Browsing

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.