Champion Chest

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
bauwbas
Posts: 60
Joined: Wed Nov 18, 2009 12:44 pm
Location: Lithuania

Champion Chest

Post by bauwbas »

L2J Revision Latest:
L2JDP Revision Latest:

How need to remove champion mob from Treasure Chest ??? If player open with key treasure chest which is champion mob like, so it will drop about +- 25 armor enchants... Normal chest +- 3... So how i need to remove?

In L2Spawn.java i found this, what i need to change? Or maybe I am looking not at this file.

Code: Select all

        mob.setChampion(false);		if (Config.L2JMOD_CHAMPION_ENABLE)		{			// Set champion on next spawn			if			(				mob instanceof L2MonsterInstance				&& !getTemplate().isQuestMonster				&& !mob.isRaid()				&& !mob.isRaidMinion()				&& Config.L2JMOD_CHAMPION_FREQUENCY > 0 				&& mob.getLevel()>=Config.L2JMOD_CHAMP_MIN_LVL 				&& mob.getLevel()<=Config.L2JMOD_CHAMP_MAX_LVL				&& (Config.L2JMOD_CHAMPION_ENABLE_IN_INSTANCES || getInstanceId() == 0) 			)			{				int random = Rnd.get(100); 				if (random < Config.L2JMOD_CHAMPION_FREQUENCY)					mob.setChampion(true); 
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Champion Chest

Post by JIV »

&& !(mob instanceof L2ChestInstance)
User avatar
nonom
L2j Veteran
L2j Veteran
Posts: 649
Joined: Wed Mar 11, 2009 10:34 pm
Location: Magmeld

Re: Champion Chest

Post by nonom »

It's old, could not be committed?

Code: Select all

Index: java/com/l2jserver/gameserver/model/L2Spawn.java===================================================================--- java/com/l2jserver/gameserver/model/L2Spawn.java	(revision 4322)+++ java/com/l2jserver/gameserver/model/L2Spawn.java	(working copy)@@ -26,6 +26,7 @@ import com.l2jserver.gameserver.idfactory.IdFactory; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc;+import com.l2jserver.gameserver.model.actor.instance.L2ChestInstance; import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jserver.gameserver.templates.chars.L2NpcTemplate; import com.l2jserver.util.Rnd;@@ -551,6 +552,7 @@ 				&& mob.getLevel()>=Config.L2JMOD_CHAMP_MIN_LVL  				&& mob.getLevel()<=Config.L2JMOD_CHAMP_MAX_LVL 				&& (Config.L2JMOD_CHAMPION_ENABLE_IN_INSTANCES || getInstanceId() == 0) +				&& !(mob instanceof L2ChestInstance) 			) 			{ 				int random = Rnd.get(100); 
Image
"There are three kinds of people in this world, those who can count and those who can't"
User avatar
bauwbas
Posts: 60
Joined: Wed Nov 18, 2009 12:44 pm
Location: Lithuania

Re: Champion Chest

Post by bauwbas »

Thank you, i changed to && mob instanceof L2ChestInstance and working for me... I have two more question:

1) How can i change Chest % that it's now will open and drop enchant, but explode for e.g.
2) What mean rnd?
E.g.

if (getTemplate().level >= 61)
{
if (rnd >= 90) trapSkillId = 4139;//explosion
else if (rnd >= 50) trapSkillId = 4118;//area paralysys
else if (rnd >= 20) trapSkillId = 1167;//poison cloud
else trapSkillId = 223;//sting
}
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Champion Chest

Post by jurchiks »

omg...
don't say you don't understand what "int random = Rnd.get(100);" means?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
bauwbas
Posts: 60
Joined: Wed Nov 18, 2009 12:44 pm
Location: Lithuania

Re: Champion Chest

Post by bauwbas »

jurchiks wrote:omg...
don't say you don't understand what "int random = Rnd.get(100);" means?
omg, i don't know, if i know i don't ask mr genius.......
User avatar
Vith
Posts: 11
Joined: Mon Jun 28, 2010 2:17 pm
Location: Poland
Contact:

Re: Champion Chest

Post by Vith »

If you don't know, you shouldn't probably be touching L2j code at all (-;
me = new Geek();
while (me.getSpareTime() > 0)
{
me.playLineage();
}
printf("Another nonconstructive day (-;\n");
User avatar
bauwbas
Posts: 60
Joined: Wed Nov 18, 2009 12:44 pm
Location: Lithuania

Re: Champion Chest

Post by bauwbas »

Vith wrote:If you don't know, you shouldn't probably be touching L2j code at all (-;
You should not flood this topic...

What point of help forum if nobody don't help? So explane Vith if you so smart too...
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Champion Chest

Post by jurchiks »

What's the point if you don't even understand the code?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
nonom
L2j Veteran
L2j Veteran
Posts: 649
Joined: Wed Mar 11, 2009 10:34 pm
Location: Magmeld

Re: Champion Chest

Post by nonom »

bauwbas wrote:Thank you, i changed to && mob instanceof L2ChestInstance and working for me... I have two more question:

1) How can i change Chest % that it's now will open and drop enchant, but explode for e.g.
2) What mean rnd?
E.g.

if (getTemplate().level >= 61)
{
if (rnd >= 90) trapSkillId = 4139;//explosion
else if (rnd >= 50) trapSkillId = 4118;//area paralysys
else if (rnd >= 20) trapSkillId = 1167;//poison cloud
else trapSkillId = 223;//sting
}
1) You can change the number/chance of each npc/item in droplist.sql.
2) Rnd is normally used to get random values :)

I hope help you
Image
"There are three kinds of people in this world, those who can count and those who can't"
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Champion Chest

Post by janiii »

i think he ment the chance between mob chest and npc chest -> data/scripts/ai/group_template/Chests.java -> check variable IS_BOX value (in script is now 40, that means 40% it is a npc chest and not a mob chest)

rnd is a variable, so you have to check where it was initialized. most probably with something like Rnd.get(50) or some other number. but that means, it will return you a random number from 0 to 50. random numbers are used for a chance. so e.g. you want something to be done with chance 20% (20/100) so you get a random number Rnd.get(100) and compare it to less 20, because with a 20% probability you get a number under 20 from 100.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
bauwbas
Posts: 60
Joined: Wed Nov 18, 2009 12:44 pm
Location: Lithuania

Re: Champion Chest

Post by bauwbas »

Thank you nonom and janiii you really helped me.. Big thanks.
Post Reply