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

    • Hundreds of players have already jumped into the world of L2Elixir x3, and the server grows bigger every day! A truly international community is forming — EU, NA, LATAM, Asia — all gathering for the same purpose: To relive the L2Elixir era the right way. Join now and be part of the early wave!   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs   🎄 Christmas Event Activated! 🎄 Craft your Ordinary or Special Christmas Tree, place it outside of a peace zone, and enjoy festive outfits, boosted EXP/SP, Adena, and Drop Rates, plus the Holiday Festival buff  (more HP/MP/CP, higher P.Def/P.Atk/M.Atk, faster movement, reduced MP cost!) every 12-hours! 🎁 Santa’s Hourly Gifts While you’re actively farming, Santa appears worldwide to drop special rewards such as: Special Christmas Tree Christmas Red Sock Santa’s Weapon Exchange Ticket (12h) Gift from Santa Santa Hats & Rudolph accessories Agathion: Rudolph Chest of Experience Shadow Hats Scrolls Event b.soe / b.rez Loot Crates 🔥 Santa’s Weapon Ticket Gives you a D/C/B-grade weapon based on your level, randomly enchanted +4 to +10!  4-hour expiration time. Celebrate, fight, farm — and let Santa upgrade your holidays! 🎅✨
    • what do u mean i want to change the normal weapons some weapons are working perftect some not getting th effect and the arcana has the effect above the weapons as u see ... i dont what is the probkenm
    • Stop paying for files that are already public and free. Here you can download a fully working Interlude server with C4-like gameplay, including source code so you can compile it yourself and verify everything. People will try to convince you that free releases are “broken”, “full of backdoors”, etc. That’s exactly why I’m also providing the SVN with the full source – so you can: Review the code yourself Remove / modify whatever you don’t like Compile your own binaries What’s included GX-EXT Interlude server (C4-style gameplay) – L2Off Client Interlude tweaked for C4 gameplay Public SVN with source code Downloads: Server GX-EXT: https://www.mediafire.com/file/q5ipkjd36tnhfxv/L2OFF_C4_C4_ACU_GXEXT.rar/file Client Interlude C4 Gameplay: https://www.mediafire.com/file/rdkfc8wwau042oh/Cliente_Interlude_Jugabilidad_C4.rar/file SVN (source code, delayed a couple of months to avoid reselling fresh work): https://svn.l2servers.com.ar/!/#GX-EXT_INTERLUDE User: gx Pass: gx How to compile To compile the source you will need: Visual Studio 2005 (x64 toolset) (Classic L2Off toolchain – yes, it’s old, but that’s what the original server uses.) Use this as you want: learn, test, open your own server, or just audit the code. But please, stop buying the same leaked/resold files over and over when you can get them here for free, with source, and actually know what you’re running.  
    • @GX-Ext Please reupload the pack+web+client because all the links inside that post or in the https://l2servers.com.ar/ are dead
    • Weapon dat is not the same for all, since you have custom things for sure no. You can contact @NevesOma
  • 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