Skip to content

Npc spanw debuff

Featured Replies

Hi all.

 

I ve been all day looking for the way to do it but I could not, cans give me a suggestion on how to do it?

 

I want an NPC that when spawn, the zone becomes debuff and when the NPC is death, the debuff disappears.

 

L2jServer HF

Create a new zone type (if none fits your needs) -> create a new zone based on the npc's coordinates on spawn -> add the zone to the manager -> remove the zone from the manager when the npc get killed.

DamageZone type can be enabled/disabled, it's your best go.

  • Create a DamageZone, disable it by default.
  • Create a script, put your npcId on addKillId / addSpawnId, and on onSpawn / onKill, affect the given zoneId (exemple with onSpawn, onKill owuld be simply false)
Quote

final DamageZone zone = ZoneManager.getInstance().getZoneById(110000, DamageZone.class);
if (zone != null)
    zone.setEnabled(true);

 

For a debuff, use EffectZone instead. You can affect enable/disable statut with editStatus.

Edited by Tryskell

  • Author

I work, ty :cheer:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.