Page 1 of 1

Champion Chest

Posted: Sat Jul 03, 2010 3:32 pm
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); 

Re: Champion Chest

Posted: Sat Jul 03, 2010 3:42 pm
by JIV
&& !(mob instanceof L2ChestInstance)

Re: Champion Chest

Posted: Sat Jul 03, 2010 3:48 pm
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); 

Re: Champion Chest

Posted: Sat Jul 03, 2010 7:17 pm
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
}

Re: Champion Chest

Posted: Sat Jul 03, 2010 8:41 pm
by jurchiks
omg...
don't say you don't understand what "int random = Rnd.get(100);" means?

Re: Champion Chest

Posted: Sun Jul 04, 2010 6:59 am
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.......

Re: Champion Chest

Posted: Sun Jul 04, 2010 10:24 am
by Vith
If you don't know, you shouldn't probably be touching L2j code at all (-;

Re: Champion Chest

Posted: Sun Jul 04, 2010 10:39 am
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...

Re: Champion Chest

Posted: Sun Jul 04, 2010 1:39 pm
by jurchiks
What's the point if you don't even understand the code?

Re: Champion Chest

Posted: Sun Jul 04, 2010 3:09 pm
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

Re: Champion Chest

Posted: Sun Jul 04, 2010 4:20 pm
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.

Re: Champion Chest

Posted: Sun Jul 04, 2010 4:29 pm
by bauwbas
Thank you nonom and janiii you really helped me.. Big thanks.