Jump to content
  • 0

Vip Skill Error


Question

Posted

I am with this mod vip vip skill but the skill so picks up where I put // setvip not taking this into sub class someone could see the code and see WHAT this faltano for vip skill handle in sub class also?

 

------------------------com/l2jfrozen/Config.java

+public static boolean ENABLE_VIP_SYSTEM;
+public static Map<Integer, Integer> VIP_SKILLS;


+ ENABLE_VIP_SYSTEM = Boolean.parseBoolean(otherSettings.getProperty("EnableAioSystem", "True"));
+if(ENABLE_VIP_SYSTEM) //create map if system is enabled
+ {
+ String[] VipSkillsSplit = otherSettings.getProperty("VipSkills", "").split(";");
+ VIP_SKILLS = new FastMap<Integer, Integer>(VipSkillsSplit.length);
+ for (String skill : VipSkillsSplit)
+ {
+ String[] skillSplit = skill.split(",");
+ if (skillSplit.length != 2)
+ {
+ System.out.println("[ViP System]: invalid config property in "+OTHER+" -> AioSkills \"" + skill + "\"");
+ }
+ else
+ {
+ try
+ {
+ VIP_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+ }
+ catch (NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if (!skill.equals(""))
+ {
+ System.out.println("[ViP System]: invalid config property in "+OTHER+" -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
+ }
+ }
+ }
+ }
+ }



-----------------------------------L2JFrozen/config/head/other.properties

+EnableVipSystem = True
+# List of Vip Skills
+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
+VipSkills = 395,1

com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminVip.java
public void doVip(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)

+_player.rewardVipSkills();
_player.broadcastUserInfo();
_player.sendPacket(new EtcStatusUpdate(_player));
+_player.sendSkillList();

public void removeVip(L2PcInstance activeChar, L2PcInstance _player, String _playername)

+_player.lostVipSkills();
_player.broadcastUserInfo();
_player.sendPacket(new EtcStatusUpdate(_player));
+_player.sendSkillList();

-------------------------------------com/l2jfrozen/gameserver/model/actors/instance/L2PcInstance.java

public void setVip(boolean val)
{
_isVip = val;
-
+
}
-
+
+ public void rewardVipSkills()
+ {
+ L2Skill skill;
+ for(Integer skillid : Config.VIP_SKILLS.keySet())
+ {
+ int skilllvl = Config.VIP_SKILLS.get(skillid);
+ skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
+ if(skill != null)
+ {
+ addSkill(skill, true);
+ }
+ }
+ sendMessage("GM give to you Vip's skills");
+ }
+
+ public void lostVipSkills()
+ {
+ L2Skill skill;
+ for(Integer skillid : Config.VIP_SKILLS.keySet())
+ {
+ int skilllvl = Config.VIP_SKILLS.get(skillid);
+ skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
+ removeSkill(skill);
+ }
+ }
+

13 answers to this question

Recommended Posts

  • 0
Posted

You should find this piece of code in head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java

		synchronized (getAllSkills())
		{
			
			for (final L2Skill oldSkill : getAllSkills())
			{
				super.removeSkill(oldSkill);
			}
			
		}
		
		// Yesod: Rebind CursedWeapon passive.
		if (isCursedWeaponEquiped())

And then add something like this in the loop:

		synchronized (getAllSkills())
		{
			
			for (final L2Skill oldSkill : getAllSkills())
			{
                                if (oldSkill.getId() == 395)
                                {
                                    continue;
                                }
				super.removeSkill(oldSkill);
			}
			
		}
		
		// Yesod: Rebind CursedWeapon passive.
		if (isCursedWeaponEquiped())

It's the ugliest way, but.. ^^

  • 0
Posted (edited)

Sorry for the double post, but I'm little stupid and didn't noticed that it can have more than one skill...

		synchronized (getAllSkills())
		{
			
			for (final L2Skill oldSkill : getAllSkills())
			{
                                if (Config.ENABLE_VIP_SYSTEM && Config.VIP_SKILLS.contains(oldSkill.getId()))
                                {
                                    continue;
                                }
				super.removeSkill(oldSkill);
			}
			
		}
		
		// Yesod: Rebind CursedWeapon passive.
		if (isCursedWeaponEquiped())

This should be better... ^_^

Edited by Tessa
  • 0
Posted

Sorry for the double post, but I'm little stupid and didn't noticed that it can have more than one skill...

		synchronized (getAllSkills())
		{
			
			for (final L2Skill oldSkill : getAllSkills())
			{
                                if (Config.ENABLE_VIP_SYSTEM && Config.VIP_SKILLS.contains(oldSkill.getId()))
                                {
                                    continue;
                                }
				super.removeSkill(oldSkill);
			}
			
		}
		
		// Yesod: Rebind CursedWeapon passive.
		if (isCursedWeaponEquiped())

This should be better... ^_^

 

if I change my class disappears and does not return. it should ta with a bug because if I FALSE for this option.
 
# Checks skills During World Enter, Subclass and Class change.
# If the player is multiskiller or got illegal skill it will be automatically removed.
# IMPORTANT: Put True for server security.
CheckSkillsOnEnter = True
 
it works and works in the sub class also but when class switching it disappears again
=============================================================================================================
 
this mod is working right in this rev but do not know use the decompiler and look for mold you can take a look at that to help
 
  • 0
Posted (edited)

You should check for vip status first, and then add the skills as a reward skills, I think..

Edited by Tessa
  • 0
Posted

You should check for vip status first, and then add the skills as a reward skills, I think..

might have to create something to check the vip skill think the game is seeing skill vip as illegal have no idea how to do this?

  • 0
Posted

might have to create something to check the vip skill think the game is seeing skill vip as illegal have no idea how to do this?

I've never checked l2jfrozen pack to become familiar, and i don't know how their vip system works..

  • 0
Posted

I've never checked l2jfrozen pack to become familiar, and i don't know how their vip system works..

you would not know to create a simple mod when he wins vip also gain skill and or too complicated?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...