Jump to content

Question

Posted (edited)

Hello, i'm sorry if i distract anybody with these silly questions, i starter in l2java i wanted to make 2 different things but it's a bit dificult to do it so i would love

somebody to give me a hand just a clue no 100% solution.

 

 

Notorious code

When someone gets karma when he enter inside guard region and if geodata allow they attack him by AI. This region is declared some files like 1900.

I wanted to make some code (i start it alone) like this

 

L2PcInstance.java

setKarma(getKarma() + newKarma);if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))
setPkKills(getPkKills() + 1);


Notorious(this);
//Notorious begin
public static void Notorious(final L2PcInstance killer)
{
if (killer.getKarma() >= 1);
{
killer.sendMessage("Your Notorious level: 1");
}
if (killer.getKarma() >= 1500);
{
killer.sendMessage("Your Notorious level: 2");
}
if (killer.getKarma() >= 4500);
{
killer.sendMessage("Your Notorious level: 3");
}
if (killer.getKarma() >= 7500);
{
killer.sendMessage("Your Notorious level: 4");
}
if (killer.getKarma() >= 9999);
{
killer.sendMessage("You are now most wanted!");
}
}

I have to do like in case 1 guards distance 500 in case 2 guard distance 1000 in case 3 guard distance 1500 in case 4 guard distance 3000 e.t.c

And also when killer insert in area 500 range before the area that AI start attack him i want a social effect or something on guards like a red circle that

warning the killer that if he go closer to guards they will attack him.

So the problem is that i can't locate the file that i do these actions about range e.t.c i searchd in L2GuardInstance.java and L2AIAttack.java (btw i use ct2.5).

If someone can locate me or give me en example i would appreciate

 

 

Wedding skill code

I had an idea to create a skill passive or active (in SkillHandlers) that when you are married and your parther is in range of 1500 X-Y  your HP or P.attack increased by 5% this is no problem the idea is to make the SkillHandler.

I'm sure is something like this

 

public class MarriedSkillHelp implements ISkillHandler
{
private static final L2SkillType[] SKILL_IDS = { L2SkillType.MARRIED_SUPPORT };


@Override
public void useSkill(final L2Character activeChar, final L2Skill skill, final L2Object[] targets)
{
          
final L2PcInstance target = (L2PcInstance) player.getPartherId();
final L2Object firstTarget = target;
??????
????
??
}


@Override
public L2SkillType[] getSkillIds()
{
return SKILL_IDS;
}
}

If someone can help me with these two, i know these are few lines but im starter and i love editing the server instead of just make him alive.

Appreciate any comment...

Edited by OTzimakosKaiToTeras

6 answers to this question

Recommended Posts

  • 0
Posted

Regarding your wedding skill, forget what you thought : you only have to create a passive skill in datapack and reward it if isMarried() in rewardSkills() method, when a player enters in the world.

 

Regarding your karma stuff, I guess you already cared about setKarma(, which needs to be custom (because 10k karma is almost nothing). By "they attack" I guess you mean guards ? It's an AI thing, you can take a look on autoAttackCondition( on L2AttackableAI. This is where regular behavior of guards regarding PKs is made.

  • 0
Posted (edited)

Regarding your wedding skill, forget what you thought : you only have to create a passive skill in datapack and reward it if isMarried() in rewardSkills() method, when a player enters in the world.

 

Regarding your karma stuff, I guess you already cared about setKarma(, which needs to be custom (because 10k karma is almost nothing). By "they attack" I guess you mean guards ? It's an AI thing, you can take a look on autoAttackCondition( on L2AttackableAI. This is where regular behavior of guards regarding PKs is made.

Yeah i already notice that im searching in L2AttackableAI.java but i don't know how the lines should be i mean if target.isNotorious1() e.t.c this.

and about wedding system again don't forget i'm not professional a little more detail i would appreciate about the passive skill how it should be

if parther is in range of 1500 e.t.c 

 

anyway thanks

 

Ps. i see this code 

// Check if the actor is a L2GuardInstance
		if (getActiveChar() instanceof L2GuardInstance)
		{
			
			// Check if the L2PcInstance target has karma (=PK)
			if (target instanceof L2PcInstance && ((L2PcInstance) target).getKarma() > 0)
				// Los Check
				return GeoData.getInstance().canSeeTarget(me, target);
			
			//if (target instanceof L2Summon)
			//	return ((L2Summon)target).getKarma() > 0;
			
			// Check if the L2MonsterInstance target is aggressive
			if (target instanceof L2MonsterInstance && Config.GUARD_ATTACK_AGGRO_MOB)
				return ((L2MonsterInstance) target).isAggressive() && GeoData.getInstance().canSeeTarget(me, target);
			
			return false;

but i can't understand how to make it.

Edited by OTzimakosKaiToTeras
  • 0
Posted (edited)

About the range thing on your wedding skill, you need to create a listener system on knownlists. You have to edit the knownlist system which can be server breaking if you make it bad. I'm not even sure it's the most appropriate option... I would suggest to forget your initial idea, until postIL L2J servers got an appropriate answers which I don't know. You can also launch a task when a character is new married or just logged in as a married ppl, but well... It's fat.

 

About your guard thing, if it has to use different ranges you also have to make something regarding knownlists of the guards. Editing the location I said won't be enough.

 

Basically don't mess with range things if you're a total newcomer. And ranges are based on knownlists.

 

If someone wants to help more, he is welcomed.

Edited by Tryskell
  • 0
Posted

1st of all thanks for your answers on my posts
2nd i made them work now i have a new problem in a new
code i make. This code understand if your parthner (marriage) is inside radius of 500 and on pvp kill it addxp or restore HP (whatever) the idea is this what i did is this:

 

public void increasePvpKills(final L2Character target)
{
if (vs == null)
vs = new Versus(this);
else
vs.increaseKills();
if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))
{
// Add karma to attacker and increase its PK counter

PvpClanPoints();
CoupleSupport(this);


// Increase the kill count for a special hero aura
heroConsecutiveKillCount++;


// Ignore this
if (heroConsecutiveKillCount > 999)
setHero(true);


L2MultiFunctionZone.givereward(this);


// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
sendPacket(new UserInfo(this));
sendPacket(new ExBrExtraUserInfo(this));
}
}


/**
* If Player has partner and he/her inside X zone, restore HP points
*/

public static void CoupleSupport(final L2PcInstance player)
{


//Repeat
for (L2Character target : player.getKnownList().getKnownCharactersInRadius(500))//Gia kathe xaraktira entos 500 radius(xaraktires einai kai ta summon kai ta terata ktlp)
{
if(target instanceof L2PcInstance)//An o xaraktiras einai pektis 
{


if(((L2PcInstance) target).getPartnerId() == player.getObjectId());
{
player.sendMessage("Your parthner is inside Zone!");
target.addExpAndSp(50000000, 500000); //something


//player.sendPacket(new RadarControl(0, 2, 186214, 61591, -4152));


//target.setIsParalyzed(true);
           }
}
}
}

It work but it also give EXP and SP to victim(the player get killed). how to avoid this? I want only parthner get EXP (if inside zone)

Thanks in advance <3

  • 0
Posted

 

1st of all thanks for your answers on my posts

2nd i made them work now i have a new problem in a new

code i make. This code understand if your parthner (marriage) is inside radius of 500 and on pvp kill it addxp or restore HP (whatever) the idea is this what i did is this:

 

 

public void increasePvpKills(final L2Character target)

{

if (vs == null)

vs = new Versus(this);

else

vs.increaseKills();

if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))

{

// Add karma to attacker and increase its PK counter

 

PvpClanPoints();

CoupleSupport(this);

 

 

// Increase the kill count for a special hero aura

heroConsecutiveKillCount++;

 

 

// Ignore this

if (heroConsecutiveKillCount > 999)

setHero(true);

 

 

L2MultiFunctionZone.givereward(this);

 

 

// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

sendPacket(new UserInfo(this));

sendPacket(new ExBrExtraUserInfo(this));

}

}

 

 

/**

* If Player has partner and he/her inside X zone, restore HP points

*/

public static void CoupleSupport(final L2PcInstance player)

{

 

 

//Repeat

for (L2Character target : player.getKnownList().getKnownCharactersInRadius(500))//Gia kathe xaraktira entos 500 radius(xaraktires einai kai ta summon kai ta terata ktlp)

{

if(target instanceof L2PcInstance)//An o xaraktiras einai pektis 

{

 

 

if(((L2PcInstance) target).getPartnerId() == player.getObjectId());

{

player.sendMessage("Your parthner is inside Zone!");

target.addExpAndSp(50000000, 500000); //something

 

 

//player.sendPacket(new RadarControl(0, 2, 186214, 61591, -4152));

 

 

//target.setIsParalyzed(true);

           }

}

}

}

It work but it also give EXP and SP to victim(the player get killed). how to avoid this? I want only parthner get EXP (if inside zone)

Thanks in advance <3

 

shame on you , i fixed it up  for you :(

  • 0
Posted (edited)

shame on you , i fixed it up  for you :(

Afcourse you are the best i know since i start working with l2j. Most of them here are wannabe child like xdem but you are real good :) appreciate

Thumbs up for L2j developer :)

 

And basicaly u the reason i loved l2j :P

Edited by OTzimakosKaiToTeras

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

    • Telegram gifts are once again showing growth. This is associated with a possible pause in the gift release pipeline by Pavel Durov, as well as the approaching New Year, when demand traditionally increases. Against this backdrop, Telegram Stars, the platform’s internal currency, are once again coming to the forefront. With their help, users send gifts, subscribe to Telegram Premium, and use paid features within the Telegram ecosystem. Buy Telegram Stars with maximum benefit in our bot
    • Telegram gifts are once again showing growth. This is associated with a possible pause in the gift release pipeline by Pavel Durov, as well as the approaching New Year, when demand traditionally increases. Against this backdrop, Telegram Stars, the platform’s internal currency, are once again coming to the forefront. With their help, users send gifts, subscribe to Telegram Premium, and use paid features within the Telegram ecosystem. Buy Telegram Stars with maximum benefit in our bot
    • 流量套利 + SMM 面板 — 强大的增长组合. 通过社交信号加强推广活动,提高信任度和转化率,加速扩张。 为套利专员和 SMM 提供的所有工具 — 在一个地方. 有效链接: SMM 面板: 前往 – 推广您的社交媒体账户。 其他服务和产品: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前促销和特别优惠列表,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销代码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣——只需在我们网站注册后按以下模板填写您的用户名:"SEND ME BONUS, MY USERNAME IS..." ——您需要在我们的论坛主题中发布! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人中每周都会赠送 Telegram Stars! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Traffic arbitrage + SMM panel — a powerful combination for growth. Strengthen campaigns with social signals, increase trust and conversion, scale faster. All tools for arbitrage specialists and SMM — in one place. Active links: SMM Panel: Go to – promotion of your social media accounts. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Traffic arbitrage + SMM panel — a powerful combination for growth. Strengthen campaigns with social signals, increase trust and conversion, scale faster. All tools for arbitrage specialists and SMM — in one place. Active links: SMM Panel: Go to – promotion of your social media accounts. Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock