Jump to content

Noblesse Monsters


Recommended Posts

Hello ive made a code for my srv and i thought to share it so. What does the code do? When you kill the mob with party or alone only the killer  (the one with the agro) will take Noblesse Statues with skills for ever. Also there will be an announce for the kills.

Create a class L2NBInstance in com.l2jserver.gameserver.model.actor.instance;

and add this code:

/*
 * Copyright (C) 2004-2014 L2J Server
 * 
 * This file is part of L2J Server.
 * 
 * L2J Server is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * L2J Server is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jserver.gameserver.model.actor.instance;

import com.l2jserver.Config;
import com.l2jserver.gameserver.Announcements;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.instancemanager.RaidBossPointsManager;
import com.l2jserver.gameserver.instancemanager.RaidBossSpawnManager;
import com.l2jserver.gameserver.model.L2Spawn;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jserver.gameserver.model.entity.Hero;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.util.Rnd;

/**
 * This class manages all RaidBoss.<br>
 * In a group mob, there are one master called RaidBoss and several slaves called Minions.
 */
public class L2NBInstance extends L2MonsterInstance
{
	private static final int RAIDBOSS_MAINTENANCE_INTERVAL = 30000; // 30 sec
	
	private RaidBossSpawnManager.StatusEnum _raidStatus;
	
	/**
	 * Constructor of L2RaidBossInstance (use L2Character and L2NpcInstance constructor).<br>
	 * <B><U>Actions</U>:</B>
	 * <ul>
	 * <li>Call the L2Character constructor to set the _template of the L2RaidBossInstance (copy skills from template to object and link _calculators to NPC_STD_CALCULATOR)</li>
	 * <li>Set the name of the L2RaidBossInstance</li>
	 * <li>Create a RandomAnimation Task that will be launched after the calculated delay if the server allow it</li>
	 * </ul>
	 * @param objectId the identifier of the object to initialized
	 * @param template to apply to the NPC
	 */
	public L2NBInstance(int objectId, L2NpcTemplate template)
	{
		super(objectId, template);
		setInstanceType(InstanceType.L2NBInstance);
		setIsRaid(true);
		setLethalable(false);
	}
	
	@Override
	public void onSpawn()
	{
		setIsNoRndWalk(true);
		super.onSpawn();
	}
	
	@Override
	protected int getMaintenanceInterval()
	{
		return RAIDBOSS_MAINTENANCE_INTERVAL;
	}
	
	@Override
	public boolean doDie(L2Character killer)
	{
		if (!super.doDie(killer))
		{
			return false;
		}
		
		final L2PcInstance player = killer.getActingPlayer();
		if (player != null)
		{
			broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL));
			if (player.getParty() != null)
			{
				for (L2PcInstance member : player.getParty().getMembers())
				{
					player.setNoble(true);
					Announcements.getInstance().announceToAll(getName() + " has been defeated by " + player.getName());
					
					RaidBossPointsManager.getInstance().addPoints(member, getId(), (getLevel() / 2) + Rnd.get(-5, 5));
					
				}
			}
			else
			{
				RaidBossPointsManager.getInstance().addPoints(player, getId(), (getLevel() / 2) + Rnd.get(-5, 5));
				if (player.isNoble())
				{
					Hero.getInstance().setRBkilled(player.getObjectId(), getId());
				}
			}
		}
		
		return true;
	}
	
	/**
	 * Spawn all minions at a regular interval Also if boss is too far from home location at the time of this check, teleport it home.
	 */
	@Override
	protected void startMaintenanceTask()
	{
		_maintenanceTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(() -> checkAndReturnToSpawn(), 60000, getMaintenanceInterval() + Rnd.get(5000));
	}
	
	protected void checkAndReturnToSpawn()
	{
		if (isDead() || isMovementDisabled() || !canReturnToSpawnPoint())
		{
			return;
		}
		
		final L2Spawn spawn = getSpawn();
		if (spawn == null)
		{
			return;
		}
		
		final int spawnX = spawn.getX();
		final int spawnY = spawn.getY();
		final int spawnZ = spawn.getZ();
		
		if (!isInCombat() && !isMovementDisabled())
		{
			if (!isInsideRadius(spawnX, spawnY, spawnZ, Math.max(Config.MAX_DRIFT_RANGE, 200), true, false))
			{
				teleToLocation(spawnX, spawnY, spawnZ, false);
			}
		}
	}
	
	public void setRaidStatus(RaidBossSpawnManager.StatusEnum status)
	{
		_raidStatus = status;
	}
	
	public RaidBossSpawnManager.StatusEnum getRaidStatus()
	{
		return _raidStatus;
	}
	
	@SuppressWarnings("unused")
	protected void taunt()
	{
		L2PcInstance target = getAI().getAttackTarget().getActingPlayer();
		
		if (target == null)
		{
			target = getAI().getFollowTarget().getActingPlayer();
		}
		
		if (target == null)
		{
			target = getTarget().getActingPlayer();
		}
		
		if (target == null)
		{
			return;
		}
		
		if (target.isGM())
		{
			return;
		}
		
		if (getId() == 3425)
		{
			target.setPvpFlag(1);
		}
		
		if (getId() == 25632)
		{
			target.setPvpFlag(1);
		}
		
		if (getId() == 3452234)
		{
			target.setPvpFlag(1);
		}
		
		final String name = target.getName();
		
		final String[] msgs =
		{
			name + "! You think you can defeat me?",
			"Enjoy the hells " + name + "!",
			name + "! I will show you my power, and then you can tremble before my might as I crush your puny bones to bits!",
			"You are really stupid to have challenged me... " + name + "!" + " Get ready!",
			"I really have no items, I swear!",
			name + "! I will destroy you!",
			name + "! I will make you realize what true power is!",
			name + ", You are on the way to destruction.",
			name + "! You have no chance to survive make your time.",
			"So we meet again, " + name + "! This time you die!",
			"Vegeta! What does the scouter say about " + name + "'s powerlevel?",
			"How brave of you to walk straight into death, " + name,
			name + "! I've braved the fires of hell, stood against the attrition of time, and single-handedly unified this region, you think a little scrub like you can defeat me?",
			name + "! How inconsiderate of you, won't your friends miss you after you die?",
			"Start the clock! " + name + ", you will die in 5 minutes!",
			"It's time to sharpen my blade with human flesh!",
			name + "! You will not win! Get out of here while you can!",
			name + "! Even with all this zerg here I will still kill you all by myself!",
			"This one here named " + name + " will be no more soon...",
			name + "! You will die here like the rest before you!",
			name + "! I will show you the punishment that follows folly!",
			"Why do you attempt the futile, " + name + "?" + " Throwing your life away carelessly like this...",
			"Today is a sad day for you! " + name + "!",
			"Today is a good day to die!... for " + name + "!",
			"Haha! The ant is trying to fight the lion!",
			name + " is a fool! Fools die!",
			"Death looms near for " + name,
			"I **** YOUR MOTHER " + name.toUpperCase() + "!",
			name + "! You should be proud that you will die by my hands!",
			name + "! What is the meaning of death? well, I'll show it to you!",
			name + ", I think you need more healers!",
			name + ", You sure the loot is set on finders keepers?",
			name + "! I will kill you with my left hand and your friends with my right! Muhahaha!",
			"Brethren prior to WENCHES!",
			"I hath ninety-nine difficulties, nary a wench among them!",
			"HALT! The hour of the hammer has begun!",
			"Compelling tale, male sibling.",
			"Bare thy bosoms or make hasty egress!",
			"Relocate yourself, hound of the female gender. Be certain not to block the direction of which I am travelling.",
			"Fornicate this excrement!",
			"Cease all activities thou art engaged in - The hour of the hammer is upon us.",
			"Female canine I beg of you!",
			"Allow the carcasses to make contact with the ground!",
			"Advance towards me in an aggressive manner, male sibling!",
			"I so happen to be attracted to large posteriors, and I am inclined to be completely factual on the matter.",
			"Make thy brethren a priority before enjoying the company of loose women.",
			"Fecal matter tends to occur..."
		};
		
		if (target.getName().equalsIgnoreCase("GMREBELGMREBEL"))
		{
			target.sendMessage("You have killed a boss");
		}
		else
		{
			target.sendMessage("You have killed a boss");
		}
	}
	
	@Override
	public float getVitalityPoints(int damage)
	{
		return -super.getVitalityPoints(damage) / 100;
	}
	
	@Override
	public boolean useVitalityRate()
	{
		return false;
	}
	
}

Then, go to: com.l2jserver.gameserver.enums.InstanceType;

Fine:

    L2EventMobInstance(L2Npc);

and delete it, then add

 

    L2EventMobInstance(L2Npc),
    L2NBInstance(L2MonsterInstance);

 

  • Downvote 1
Link to comment
Share on other sites

The main logic setNoble is wrong. Try harder and then open server.

Already shared. Stop sharing already shared things over and over again.

 

Locked.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • - lost love spells caster in, Amsterdam,Brazil,London,Kuwait .Egypt, Atlanta, Latvia, Lithuania, Sweden۞۩ஜ???? +256704892479  Results are 100% s=ure and guaranteed, spell casting specialist, , black magic death spells that work overnight or by accident. I Cast these strongest black magic revenge death spells that work fast overnight to kill ex-lover, husband, wife girlfriend Enemies overnight Https://nativelovespellscaster.com or she is in a far location, I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells that work, guaranteed black magic love spells, guaranteed voodoo spells, spell to make someone sick and die, revenge spells that work instantly, real witches for hire, revenge spells on an ex- lover, how to put a Black magic death spells on ex-lover, Revenge instant death spells on toxic uncles powerful instant death spells online instant spell that work fast in USA, UK, Kuwait, Germany, Asian, Europe, Philippines, Canada, South Africa, Italy, Peru, India, Iran, Gambia. Sweden, Australia, Nigeria, Spain, Ghana, California, Greece. Death spell on someone, death spells that Death Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex-lover, Revenge instant death spells on toxic uncles powerful instant death spells online instant spell that work fast in USA, UK, Kuwait, Germany, Asian, Europe, Philippines, Canada, revenge spells, most powerful death spell, spell to die in your sleep, successful death spell, most powerful voodoo spell caster, voodoo spell casters in new Orleans, voodoo love spells reviews, proven authentic voodoo spell casters, most powerful voodoo priest in world, black magic tricks to destroy enemy. Results are 100% sure and guaranteed whatapp or cal, Europe, Philippines, Canada, South Africa, Italy, Peru, India, Iran, Gambia. spells, guaranteed voodoo spells, spell to make someone sick and die, revenge spells that work instantly, real witches for hire, revenge spells on an ex- lover, how to put a spell on someone who hurts you, spell to make someone sick, voodoo spells to hurt someone, spells to curse someone, powerful revenge spells, most powerful death spell, spell to die in your sleep, successful death spell, most powerful voodoo spell caster, voodoo spell casters in new Orleans, voodoo love spells reviews, proven authentic voodoo spell casters, most powerful voodoo priest in world, black magic tricks to destroy enemy. Results are 100% sure and guaranteed whatapp or call  ஜ۩۞۩ஜ ??? + 256704892479ஜ۩۞۩ஜ ??Https://nativelovespellscaster.com
    • Hello, my discord is : misanthropic1085           I am selling Frintezza Aq Baium     Reborn origins x1    
    • L2Topzone has a lower traffic ranking than every other website! We spent over 160 Euro for listing server and banner and we've got only 4 download conversions!  Proof: https://prnt.sc/YeJudEKFov1m
    • Any WTS code global chat for this? 
    • Hi, I see what you mean, but I do it differently.   I don't want some features from Hi5 in my project, so I gradually add Ai, zones, items, etc... manually.   And again I want some features from Classic.   So I'm continuing the Classic storyline up to High Five.   My project runs on the client's Prelude of War.   I will release the first public test version soon, which will still be without some "hi5" stuff, because first I need to test for example Fortress Siege, pets and some instances/quests. In the future, I also want to "unlock" new locations from the GoD story.   And what I like most about Classic is that you don't have SA in weapons and it goes back to the roots of Lineage 2. Also you can connect to my discord and talk about with me.
  • Topics

×
×
  • Create New...