Jump to content
  • 0

Making A New Clan Manager (Can't Add Skills; Acis)


Question

Posted

Hi guys, i'm reworking some old's clan managers; I got a problem making the scripts give full clan skills; 

 

If u clan is lvl 0-1-2-3-4-5-6-7 make it 8; give u 10.000k Rep (This work FINE) ; But can't make it give skills too.

 

Any help guys?

int[] clanSkills =
       {
               370,
               371,
               372,
               373,
               374,
               375,
               376,
               377,
               378,
               379,
               380,
               381,
               382,
               383,
               384,
               385,
               386,
               387,
               388,
               389,
               390,
               391
       };
if (((player.getClan().getLevel() <= 1) || (player.getClan().getLevel() == 2) || (player.getClan().getLevel() == 3) || (player.getClan().getLevel() == 4) || (player.getClan().getLevel() == 5) || (player.getClan().getLevel() == 6) || (player.getClan().getLevel() == 7)))
                {
                    if (st.getQuestItemsCount(clanLevelItemsId[2]) >= clanLevelItemsCount[2])
                    {
                        st.takeItems(clanLevelItemsId[2], clanLevelItemsCount[2]);
                        player.getClan().changeLevel(8);
                        player.getClan().addReputationScore(100000);
                        player.getClan().addNewSkill(clanSkill);
                        player.getClan().broadcastClanStatus();
                        player.sendMessage("Your clan is now level " + player.getClan().getLevel() + ".");
                        player.sendMessage("Your reputation score is now " + player.getClan().getReputationScore() + ".");
                        player.sendMessage("Your clan has learned all clan skills.");
                        player.setTarget(player);
                        player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0));
                        
                        return "ClanLevelUp.htm";
                    }
                    return "ClanLevelUp-NoItems.htm";
                }
                
                player.getClan().broadcastClanStatus();
                return "ClanLevelUp.htm";
        	}

Recommended Posts

  • 0
Posted (edited)

You have to make a for loop.

 

Edit 1:

 

if (((player.getClan().getLevel() <= 1) || (player.getClan().getLevel() == 2) || (player.getClan().getLevel() == 3) || (player.getClan().getLevel() == 4) || (player.getClan().getLevel() == 5) || (player.getClan().getLevel() == 6) || (player.getClan().getLevel() == 7)))

 

change to

 

if (player.getClan().getLevel() > 1 && player.getClan().getLevel() < 8 )

 

Edit 2:

 

About skills add the following codes:

 

http://pastebin.com/z9V28JyU

Edited by Devlin
  • 0
Posted (edited)

Even better, change this

if (((player.getClan().getLevel() <= 1) || (player.getClan().getLevel() == 2) || (player.getClan().getLevel() == 3) || (player.getClan().getLevel() == 4) || (player.getClan().getLevel() == 5) || (player.getClan().getLevel() == 6) || (player.getClan().getLevel() == 7)))

to

if (player.getClan().getLevel() < 8 )

About skills, if you want to load it inside core, then do it properly (no offense Devlin) :P

Index: java/net/sf/l2j/gameserver/datatables/SkillTable.java

+    private static final L2Skill[] _clanSkills = new L2Skill[22];
+    private static final int[] _clanSkillsId =
+    {
+        370,371,372,373,374,375,376,377,378,379,
+        380,381,382,383,384,385,386,387,388,389,
+        390,391
+    };
+    
     private static final L2Skill[] _nobleSkills = new L2Skill[8];
@@ -99,6 +107,9 @@
         for (int i = 0; i < _heroSkillsId.length; i++)
             _heroSkills[i] = getInfo(_heroSkillsId[i], 1);
         
+        for (int i = 0; i < _clanSkillsId.length; i++)
+            _clanSkills[i] = getInfo(_clanSkillsId[i], 1);
+        
         for (int i = 0; i < _nobleSkills.length; i++)

     }

@@ -175,6 +186,11 @@
+    public static L2Skill[] getClanSkills()
+    {
+        return _clanSkills;
+    }

and then call this method inside your bypass to give the clan skills

for (L2Skill cs : SkillTable.getClanSkills())
   player.getClan().addNewSkill(cs);
Edited by SweeTs
  • 0
Posted (edited)

Yup :D

 

Else, if you want to call it from script, then do like Devlin did inside this clan manager http://pastebin.com/n4kY3kbJ . As you can see, you miss the for loop and such. Compare.

 

 

@Devlin

if (!(sk == null))

Why not simply sk != null :D

Edited by SweeTs
  • 0
Posted

Yup :D

 

Else, if you want to call it from script, then do like Devlin did inside this clan manager http://pastebin.com/n4kY3kbJ . As you can see, you miss the for loop and such. Compare.

 

 

@Devlin

if (!(sk == null))

Why not simply sk != null :D

2014 stuff :p

  • 0
Posted

Don't use Vector (which is synchronized), but ArrayList (or even L2Skill[])

 

-----------

 

Writing style

 if (!(sk == null))

>

if (sk != null)

----------------

 

You probably can use directly

if (player.getClan().getLevel() < 8)

because I doubt it works for academy, knight and etc. Otherwise use (for 0 to 7)

if (player.getClan().getLevel() >= 0 && player.getClan().getLevel() <= 7) 
  • 0
Posted

Hi guys, thanks for helping me;

 

I got 2 errors; Maybe i put it wrong on java script;

 else if (event.equals("levelUpClan"))
			for (L2Skill cs : SkillTable.getClanSkills())
        {
        	if (player.getClan() == null)
            {
            	return "ClanLevelUp-NoClan.htm";
            }
        	else if (!player.isClanLeader())
        	{
        		return "ClanLevelUp-NoLeader.htm";
        	}
        	else
        	{
				
				if (player.getClan().getLevel() < 8 )
				{
					if (st.getQuestItemsCount(clanLevelItemsId[2]) >= clanLevelItemsCount[2])
					{
						st.takeItems(clanLevelItemsId[2], clanLevelItemsCount[2]);
						player.getClan().changeLevel(8);
						player.getClan().addReputationScore(100000);
						player.getClan().addNewSkill(cs);
						player.getClan().broadcastClanStatus();
						player.sendMessage("Your clan is now level " + player.getClan().getLevel() + ".");
						player.sendMessage("Your reputation score is now " + player.getClan().getReputationScore() + ".");
						player.sendMessage("Your clan has learned all clan skills.");
				        player.setTarget(player);
				        player.broadcastPacket(new MagicSkillUse(player, 5103, 1, 1000, 0));
				        
				        return "ClanLevelUp.htm";
					}
					return "ClanLevelUp-NoItems.htm";
				}
				
				player.getClan().broadcastClanStatus();
				return "ClanLevelUp.htm";
        	}
        }

1449081065_error%20consola.png

  • 0
Posted (edited)

The code is a mess.. fix it

else if (event.equals("levelUpClan"))
            for (L2Skill cs : SkillTable.getClanSkills())

wuut.. wrong place. You have everything you need in this topic. Check the pastebin above..

Edited by SweeTs
  • 0
Posted

@Sweets ; 

 

Yeah, i see the pastebin;  But i wanna 

if (event.equals("levelUpClan"))

Make clan lvl 8 ; give reputation score and skills, is posible give skills to, or i need make another event? 

  • 0
Posted

Ofc it's possible, you only put the "execute" part. Just.. you have to use it properly. Atm, it's one big mess.

  • 0
Posted

Ofc it's possible, you only put the "execute" part. Just.. you have to use it properly. Atm, it's one big mess.

 

I do it too;

Index: java/net/sf/l2j/gameserver/datatables/SkillTable.java

+    private static final L2Skill[] _clanSkills = new L2Skill[22];
+    private static final int[] _clanSkillsId =
+    {
+        370,371,372,373,374,375,376,377,378,379,
+        380,381,382,383,384,385,386,387,388,389,
+        390,391
+    };
+    
     private static final L2Skill[] _nobleSkills = new L2Skill[8];
@@ -99,6 +107,9 @@
         for (int i = 0; i < _heroSkillsId.length; i++)
             _heroSkills[i] = getInfo(_heroSkillsId[i], 1);
         
+        for (int i = 0; i < _clanSkillsId.length; i++)
+            _clanSkills[i] = getInfo(_clanSkillsId[i], 1);
+        
         for (int i = 0; i < _nobleSkills.length; i++)

     }

@@ -175,6 +186,11 @@
+    public static L2Skill[] getClanSkills()
+    {
+        return _clanSkills;
+    }

I think i missing the part on .java , to "call" the skills, right ?

  • 0
Posted (edited)

I think i missing the part on .java , to "call" the skills, right ?

Nop, you already call it on your script. But while you cay this, you have no idea what you have c/p there and so, you have no idea why its not working.. :P

Edited by SweeTs
  • 0
Posted

I dont say it, but is my first time with "code part"; on the past  just use custom packs, with tons of this shits; 

Yep i download it and copy paste to make it to my need. I can't move on so, i ask for help . I dont wanna any make it for me; i wanna someone say to me, wath i doing wrong... So i can learn.

 

So... u have time, to be my mentor on this script? :) Thanks

  • 0
Posted (edited)

I showed you 2 posts before.

        else if (event.equals("levelUpClan"))
        {
            if (player.getClan() == null)
                return "ClanLevelUp-NoClan.htm";
            else if (!player.isClanLeader())
                return "ClanLevelUp-NoLeader.htm";
            else if (player.getClan().getLevel() == 8)
                return "ClanLevelUp-Limit.htm"; // CREATE THIS FILE, IF YOU DON'T HAVE IT
            else if (st.getQuestItemsCount(clanLevelItemsId[2]) < clanLevelItemsCount[2])
                return "ClanLevelUp-NoItems.htm";
            else
            {
                    st.takeItems(clanLevelItemsId[2], clanLevelItemsCount[2]);
                    player.getClan().changeLevel(8);
                    player.getClan().addReputationScore(100000);
                    for (L2Skill cs : SkillTable.getClanSkills())
                        player.getClan().addNewSkill(cs);
                    player.getClan().broadcastClanStatus();
                    player.sendMessage("Your clan is now level " + player.getClan().getLevel() + ".");
                    player.sendMessage("Your reputation score is now " + player.getClan().getReputationScore() + ".");
                    player.sendMessage("Your clan has learned all clan skills.");
                    player.broadcastPacket(new MagicSkillUse(player, player, 5103, 1, 1000, 0));
                    
                    return "ClanLevelUp.htm";    
            }
        }

Your code, if you compare, is messy, don't follow the order. Notably the for loop :D

Edited by SweeTs
Guest
This topic is now closed to further replies.


  • Posts

    • A huge amount of goods at free prices, for some reason, is idle in the warehouse. What, have you all gone to the factory or something?) CAN'T GO TO THE ONLINE STORE? OPEN THE SITE VIA VPN OR TOR BROWSER. Payments-system / Crypto-Exchange ☑ Account Airbnb 🗂 1 in stock ☑ Account AlchemyPay 🗂 2 in stock ☑ Account Astropay 🗂 1 in stock ☑ Account Anycoin 🗂 2 in stock ☑ Account 4x4 io 🗂 1 in stock ☑ Account Bunq 🗂 1 in stock ☑ Account Bilderlings 🗂 1 in stock ☑ Account BitPay 🗂 3 in stock ☑ Account Bitinvestor / swapped 🗂 1 in stock ☑ Account Bitmex 🗂 1 in stock ☑ Account Bitsa 🗂 2 in stock ☑ Account Blackcatcard 🗂 1 in stock ☑ Account Blockchain 🗂 1 in stock ☑ Account Btcdirect 🗂 1 in stock ☑ Account BBVA 🗂 1 in stock ☑ Account Binance 🗂 4 in stock ☑ Account Bitget 🗂 1 in stock ☑ Account Blackwell Global 🗂 1 in stock ☑ Account Brighty app 🗂 1 in stock ☑ Account Bankera 🗂 2 in stock ☑ Account Cent.app 🗂 1 in stock ☑ Account Coinbase card 🗂 2 in stock ☑ Account Coinfinity 🗂 1 in stock ☑ Account Capitalist 🗂 1 in stock ☑ Account CoinW 🗂 1 in stock ☑ Account Coinmetro 🗂 1 in stock ☑ Account Coinpayments 🗂 3 in stock ☑ Account Cryptomus 🗂 1 in stock ☑ Account Curve 🗂 1 in stock ☑ Account Coinzoom 🗂 1 in stock ☑ Account Cryptopay 🗂 1 in stock ☑ Account Egera 🗂 2 in stock ☑ Account Eldorado gg 🗂 1 in stock ☑ Account e PN 🗂 1 in stock ☑ Account FasterPay 🗂 1 in stock ☑ Account Fragment 🗂 1 in stock ☑ Account Finci 🗂 1 in stock ☑ Account fillit eu 🗂 2 in stock ☑ Account Gate 🗂 1 in stock ☑ Account Grey 🗂 1 in stock ☑ Account HTX (Huobi) 🗂 3 in stock ☑ Account IN1 🗂 1 in stock ☑ Account Imagenpay 🗂 1 in stock ☑ Account ICard 🗂 1 in stock ☑ Account IPRoyal 🗂 1 in stock ☑ Account Kraken 🗂 2 in stock ☑ Account Kucoin 🗂 1 in stock ☑ Account Kauri Finance 🗂 1 in stock ☑ Account Kriptomat 🗂 1 in stock ☑ Account Luno 🗂 2 in stock ☑ Account LuxonPay 🗂 1 in stock ☑ Account MEXC 🗂 1 in stock ☑ Account MyBrocard 🗂 1 in stock ☑ Account Moonpay 🗂 1 in stock ☑ Account Monzo 🗂 1 in stock ☑ Account moneyjar world 🗂 1 in stock ☑ Account Naga Pay 🗂 1 in stock ☑ Account Nash 🗂 1 in stock ☑ Account Nebeus 🗂 1 in stock ☑ Account Nexo 🗂 3 in stock ☑ Account Nearpay 🗂 1 in stock ☑ Account Neteller 🗂 2 in stock ☑ Account NiceHash 🗂 1 in stock ☑ Account N26 🗂 2 in stock ☑ Account OKX 🗂 1 in stock ☑ Account PayDo 🗂 1 in stock ☑ Account Paypal 🗂 1 in stock ☑ Account Paysera 🗂 2 in stock ☑ Account PST 🗂 1 in stock ☑ Account Paybis 🗂 1 in stock ☑ Account Payoneer 🗂 1 in stock ☑ Account Paysafecard 🗂 1 in stock ☑ Account Paytend 🗂 1 in stock ☑ Account Quppy 🗂 2 in stock ☑ Account RedotPay 🗂 1 in stock ☑ Account Ramp 🗂 1 in stock ☑ Account Revolut 🗂 2 in stock ☑ Account Santander 🗂 1 in stock ☑ Account Spendl 🗂 2 in stock ☑ Account Skrill 🗂 1 in stock ☑ Account Swapin 🗂 1 in stock ☑ Account Trustee Plus 🗂 2 in stock ☑ Account Valora 🗂 1 in stock ☑ Account Volet 🗂 1 in stock ☑ Account W1TTY 🗂 1 in stock ☑ Account Wallet Telegram 🗂 3 in stock ☑ Account Weststein 🗂 1 in stock ☑ Account Wirex 🗂 1 in stock ☑ Account Wise 🗂 3 in stock ☑ Account Whitebit 🗂 1 in stock ☑ Account Wittix 🗂 1 in stock ☑ Account XGo 🗂 1 in stock ☑ Account Zeply 🗂 1 in stock ☑ Account gekkard 🗂 1 in stock +There are kits with a physical payment card Business-Accounts ☑ Account Blackcatcard Business 🗂 1 in stock ☑ Account Mistertango Business 🗂 1 in stock ☑ Account Payset Business 🗂 1 in stock ☑ Account Wise Business 🗂 1 in stock ☑ Account Finom Business 🗂 1 in stock ☑ Account PayPal Business 🗂 3 in stock ☑ Account Wallester Business 🗂 1 in stock ☑ Account Stripe Business 🗂 2 in stock ☑ Account Wittix Business 🗂 1 in stock ☑ Account Ebay com Seller US|EU, new 🗂 2 in stock If you need account that we don't have in a list contact us. Contact via telegram - in the first post of the topic!
    • What problems are you having? DM me on Discord: l2mid.com or you can write here too i also use Strix.
    • How can i increase the HP of a summon ? specifically Summon Mechanic Golem from warsmith ..   thx.
    • We invite you all, our dear community, to the Facebook groups Lu4 Global and Latam https://www.facebook.com/share/g/1DBF55fMXG/ Global Community https://www.facebook.com/share/g/1ApVygvr8R/ Global Community Los inviatamos a todos querida comunidad a los grupos de Facebook Lu4 Global y Latam https://www.facebook.com/share/g/1DBF55fMXG/   Comunidad Global https://www.facebook.com/share/g/1ApVygvr8R/   Comunidad Latam
    • TOP support you can get. Create all system so i can transfere all users from mmoweb to his platform
  • 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