Jump to content
  • 0

[HELP] Spawnlist heading field


Question

Posted

Hey Everybody,

 

I'm wondering if anybody can explain a bit how the field 'heading' in spawnlists works. I understand it has to do with it's orentation in the world, but I'm a bit confused as to exactly how. I've come across http://l2jserver.com/old-forum/print.php?threadid=19502&page=1&sid=89e0e7b2d6409b8bb9e1ad26aeff132e but that doesn't really shed any light.

 

0OdsZ.jpg

 

Obviously I'd like to have the npc as flush against the wall as possible, so I want to manually put the values in instead of just spawning it haphazardly in the world.

7 answers to this question

Recommended Posts

  • 0
Posted

An easy way to spawn something with good heading is to use //spawn command ingame. If you target nothing, it will spawn according your actual heading.

 

About heading, that's just degrees, and so far (from what I rem) that goes from 0 to 65000. Following that rule, you can expect the following to be true.

 

              32500 (back)

16250(right side)      48750 (left side)

          0    65000 (face)

 

If the max heading value isn't 65k, well do changes according... You got the point.

 

About what direction is supposed to show 0 (east west north south) to be honest, I have no idea. Just test ingame.

 

PS : config.developer setted to true show your actual position (and heading). It can be useful to you if you don't want to use //spawn.

 

Regards, Tk.

  • 0
Posted

An easy way to spawn something with good heading is to use //spawn command ingame. If you target nothing, it will spawn according your actual heading.

 

About heading, that's just degrees, and so far (from what I rem) that goes from 0 to 65000. Following that rule, you can expect the following to be true.

 

              32500 (back)

16250(right side)      48750 (left side)

          0    65000 (face)

 

If the max heading value isn't 65k, well do changes according... You got the point.

 

About what direction is supposed to show 0 (east west north south) to be honest, I have no idea. Just test ingame.

 

PS : config.developer setted to true show your actual position (and heading). It can be useful to you if you don't want to use //spawn.

 

Regards, Tk.

 

Hi Tryskell,

 

Thanks for the help. Afterwards I searched for heading in the project and found:

// Calculate and set the heading of the L2Character
int heading = (int) (Math.atan2(-sin, -cos) * 10430.378350470452724949566316381);
heading += 32768;
setHeading(heading);

 

Discovering yea, the heading is polar coordinates. The max here I believe is 32768, when I do half of that the rotation is 180 degrees. I'm trying to place my buffers flush with the church in Dion where it's not on 90 degree angles, so I guess I have to do a bit of math first.

 

Thanks again for the reply.

  • 0
Posted

Well, I confirm with a player you can obtain 65303 and such number. I'm bad on math so don't speak of polar, sinus or cosinus :D.

 

On L2Npc you got such formulas :

mob.setHeading(Rnd.nextInt(61794));

which means too the number is around 60k max for NPC too.

 

You can too simply check spawnlist.sql and check what is the biggest heading written inside. Lol.

 

Btw, my formula about heading is as following :

 

	public final static int calculateHeadingFrom(int obj1X, int obj1Y, int obj2X, int obj2Y)
{
	double angleTarget = Math.toDegrees(Math.atan2(obj2Y - obj1Y, obj2X - obj1X));
	if (angleTarget < 0)
		angleTarget = 360 + angleTarget;
	return (int) (angleTarget * 182.044444444);
}

 

And guess what, 360 * 182,044444444 equals 65536.

  • 0
Posted

Well, I confirm with a player you can obtain 65303 and such number. I'm bad on math so don't speak of polar, sinus or cosinus :D.

 

On L2Npc you got such formulas :

mob.setHeading(Rnd.nextInt(61794));

which means too the number is around 60k max for NPC too.

 

You can too simply check spawnlist.sql and check what is the biggest heading written inside. Lol.

 

Btw, my formula about heading is as following :

 

	public final static int calculateHeadingFrom(int obj1X, int obj1Y, int obj2X, int obj2Y)
{
	double angleTarget = Math.toDegrees(Math.atan2(obj2Y - obj1Y, obj2X - obj1X));
	if (angleTarget < 0)
		angleTarget = 360 + angleTarget;
	return (int) (angleTarget * 182.044444444);
}

 

And guess what, 360 * 182,044444444 equals 65536.

 

Well that makes sense too, but it's still weird. I actually did my math based on (degree) * 91.02; 360 * 91.02 = 32768 and 720 * 91.02 = 65534.4 (close nuff); Though your example is basically mine doubled. I'll just assume that yours is correct. By my values I manged to line the buffers up ok:

 

J9BPl.jpg

 

  • 0
Posted

Well dunno which pack you're using, my calcul came from my IL pack refactored using L2J Freya (8 months old).

 

Seems you use old IL not refactored.

 

Yea, it's just the normal l2j interlude distro from the old nightlies folder.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2 Runestone Interlude C6 · 5x · Open since 10 August 2026 · No wipe, ever l2runestone.com · Discord Most servers die the same way. They sell power, the market dries up, and the people who actually play leave. This one is built not to do that, and everything below is the actual configuration rather than a wishlist.   Rates Experience 5x · Skill points 5x Party experience and SP 6x Drop 5x · Spoil 5x · Quest reward 5x Adena 7x Raid boss, Grand boss and epic jewels: 1x, untouched Special herbs 1x Adena sits above item drop on purpose, so shots stay affordable without flooding the economy. Epics are deliberately not multiplied: the strongest gear in the game should be the hardest to hold.   Enchant Safe to +3 (+4 full body). +1 per scroll, and a failed scroll destroys the item. Scrolls are not sold by any NPC.   Normal Blessed Crystal +4 96% 97% 98% +6 88% 91% 94% +8 80% 85% 90% +10 72% 79% 86% +12 64% 73% 82% +15 52% 64% 76%     Not retail 66% flat. It is gentler than retail early and harsher late, which is a choice, not an accident. Max +15 weapons and armor, +12 jewellery.   What is not here No autofarm. No command, no macro engine, nothing plays for you. Adena auto-loots; items do not. No gear above D grade from NPCs. Starter equipment is sold as it is at retail. Everything from C grade up drops, is crafted, or is traded between players. The dwarf is the heart of the economy, not a side character. Nothing that matters for sale. Power is never purchasable. Convenience and cosmetics are the only things that will ever be. No wipe. Ever. If a bug is found we fix the bug and remove what it produced, instead of resetting the world because that is easier.   Retail where it counts Pure retail class balance. Casts keep a real interrupt window, crowd control never exceeds 90% Olympiad weekly, starting 18:00, six hour competition period Sieges and epic bosses on retail mechanics Buff slots 24 · Subclass to 81 · First and second class change at NPC, third class is earned Offline trade and craft, including in peace zones, restored across restarts   Technical The client is patched by one byte to protocol 748, so a client that has not been through our launcher is refused at the door Full geodata, 163 regions, with pathfinding enabled. No walking through walls, no mobs pulled through geometry Anti-bot with an in-game check, and anti-advertising covering chat, whispers, private store titles and character names InnoDB with binary logging, verified daily backups kept in two places, and a weekly restore test that actually restores   Honest part It opened on 10 August 2026 and it is small. There is no countdown, no launch event, no fake population counter, and nobody is going to hand you gear. If you log in tonight you will find a quiet world. That is the trade: you are early, and everything you build from here stays yours.   Getting in You need a Lineage II Interlude (Chronicle 6) client already on your PC. The launcher downloads and repairs the system folder on its own and verifies every file before the game starts; it touches nothing else and will not patch Gracia or later. Launcher and account: l2runestone.com Discord: discord.gg/NJDeffApmc  
    • Although I don't know how to use it, thank you for sharing
    • Did you try run as extender to any version where Source no needed? Coz not everyone use Mobius 😃
    • Very nice progress. At some point you will need the bots to travel long distances. Geodata and A* path finding on it won't be suitable. They will exhaust budget and memory/cpu. I think the human bot was hitting this ceiling that's why it couldn't find the bridge. aCis has recently made a low granularity geo Pathfinder that can help.  One approach I did successfully and you can do is to replace geodata with 3D nav mesh for bots and use the Detour algorithm for pathfinding. This will give you very cheap long distance path finding. 
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..