Jump to content
  • 0

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


Miracles

Question

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";
        	}
Link to comment
Share on other sites

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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) 
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

@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? 

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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 ?

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Yes, it is, it's not hard to do (if you know what you're doing); just time consuming.   To make some things clear: 1. You can not create .ukx files with animated skeletalmeshes inside, by using any of the freeshared L2Editors (basically, no support for .psa files) 2. You need a patched UT2003/UT2004. You can either get your own ut2004 and download Gildor's patch from his web, or use any of these: When you use these, you should be able to import both .psk and .psa animations > link the skeletalmesh to the psa > save as .ukx > use ut2down to convert the file to l2 format > encrypt the .ukx with standard l2 encryption (you can use mxc encdec, you can find it in the folder of the l2editor i shared). Your best bet is to use pawnviewer (aka dev mode) to test that. If you have troubles with that process then leave a reply here, otherwise, if it works correctly, you can move on to adding missing animnotify classes to you unrealed, then proper animnotifies, sounds, effects or w/e is missing from your .ukx files. Keep in mind that this is overall not difficult but a huge amount of work (unless you're good at scripting/macros) since you'd need to manually re-create every single animnotify, by hand. If you have doubts or i wasn't clear enough let me know here. (in case you don't know what an animnotify is: UDN - Two - AnimNotifies (unrealengine.com) )  
    • Welcome to JewStor Service!!!   ❖Ready-made verified wallets, exchanges, business banks and to order accounts. ❖EU/UK/US/DE Stuff: 100% Verified! Reliable financial tools for your business. ❖Popular items available include: Stripe business + Payoneer, Deutshce Bank, BBVA ES, Xapo Bank, Revolut business / personal, Santander Bank, Wallester business, Bitsa EU, Binance EU, Qonto Business, Blackcatcard EU, Shopify Payments, ICard EU, N26 EU, Naga Pay EU, Paysera EU, Mistertango Business and many others.
    • Custom = everything that is not part of my H5 client, such as Aegis skin, Death Knight skin, Constructor skin, Golden Valakas skin, an example is the pack containing 3 Golden Valakas skins+cloaks, to give you an idea, this pack consumes almost 200MB within the system, another example of custom is the Hunter Head set made by Asuki, almost 100MB within the system, every custom item added to the client, specifically within the system folder will increase the consumption of your client's virtual ram memory, the more custom added there, the faster your client will close due to critical. Around 4 to 5 custom packs that I removed from the system and made my client reach the ram virtual limit only after more than 40 hours online, in other words; It is only worth adding custom items to the system folder if it is very well compressed, maximum up to 10MB per custom pack (This pack below in the photo, only it inside your client - system consumes almost 200MB, when I removed this pack inside the system it increased the game's lifespan by almost 4h during my tests)
    • ready pack for sale with lucera files made from scratch price is 350 euros without the license the server is x30 rate the server is there to see everything test ie.. there have been several changes everything works there will be support for everything for as long as possible please, can you send me a message here, there is complete transparency in everything
    • The author has been using an alternate account under the name @project166 to promote their services, which violates our RULES. Additionally, the author does not adhere to our guidelines regarding the inclusion of pricing information.     Topic Locked.
  • Topics

×
×
  • Create New...