Jump to content
  • 0

Stackable SubClass Npc (Need Help)


Question

Posted

i use last rev l2jserver.

i have this script Stackable Skills.

http://pastebin.com/MjPS9FxW upload for me. created by Allen.

and this post in MaxCheaters its same.

http://maxcheaters.com/forum/index.php?topic=80123.0

 

SQL_PART:

DROP TABLE IF EXISTS `subclass_list`;
CREATE TABLE `subclass_list` (
  `player_id` varchar(40) NOT NULL,
  `currentsub` int(3) NOT NULL DEFAULT '0',
  `sub_index` int(3) NOT NULL DEFAULT '0',
  `subclassid0` int(3) NOT NULL DEFAULT '-1',
  `subclassid1` int(3) NOT NULL DEFAULT '-1',
  `subclassid2` int(3) NOT NULL DEFAULT '-1',
  `subclassid3` int(3) NOT NULL DEFAULT '-1'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

Problems:

 

1.- When delete any subclass (ex: Paladin) skills not remove, only remove ID of Class from (SQLTABLE: subclass_list), and the character continues with these skills (ex: Paladin) (Not Solved)

 

2.-when first character get subclass (ex: Overlord) , other character no see in list subclass overlord, warsmith and others disappear (temporarily solved)

 

3.-Can not see the name of the class (Unknow Class) (Solved Thanks Zoey76)

 

4.- When character rise level (ex: 76), get subclass and back to level 40, but problem with expertise skills, (S-Grade Expertise for reach to level 76), when character back to level 40 Expertise is not remove, and character not get grade penalty. (Not Soved minor importance)

 

my list of fixes to work in the last revision:

 

Solution for problem (2) i think so is not correct solution :P but work

 

 
@@ -411,1 +411,1 @@
def FORBBIDEN_LIST(st,data):
-    val = CONFIG_FORBBIDEN_SUBCLASSES
+    val = []
    val.append(st.player.getClassId().getId())
    if data == None: data = DATA(st)
    for i in range(CONFIG_MAX_SUBS_IN_DB + 1):
        if data[i+2] != -1:
            val.append(data[i+2])
    if not CONFIG_ALLOW_SUBCLASS_DUPLICATION:
        if st.player.getBaseClass() not in val:
            val.append(st.player.getBaseClass())
        for subClass in st.player.getSubClasses().values():
            val.append(subClass.getClassId())
    return val

 

Solution for problem (3) Thanks Zoey76

 

 
@@ -15 +15 @@
-   from com.l2jserver.gameserver.datatables            import CharTemplateTable
+   from com.l2jserver.gameserver.datatables import ClassListData

@@ -493,1 +493,1 @@
def CLASS_NAME(case):
    val = "Unknow Class"
-    try: val = CharTemplateTable.getInstance().getClassNameById(int(case))
+    try: val = ClassListData.getInstance().getClass(int(case)).getClassName()
    except: val = "Unknow Class"
    return val

 

And the problem (1) I think in these lines is the solution.

 

 
@@ -655, +655 @@

elif event == "delete":
            info = DATA(st)
            if not ALLOW_ACTION(st): return
            elif not SLOT_ALLOWED(info,event2): return ERRORS_HTML(st,"11","0")
            elif info[1]!= player.getClassIndex(): return ERRORS_HTML(st,"13",event1)
            elif st.getPlayer().getClassId().level() < CONFIG_CLASS_TRANSFER_LEVEL: return ERRORS_HTML(st,"5","0")
            elif st.getQuestItemsCount(CONFIG_DELETE_ITEM_REQUIRED) < CONFIG_DELETE_ITEM_A-beep-T and CONFIG_ENABLE_FEE_FOR_SUBCLASS: return ERRORS_HTML(st,"3","0")
            elif event2 == "0" and not CONFIG_ALLOW_DELETE_MAIN_CLASS: return ERRORS_HTML(st,"9","0")    
            else:
                conn=L2DatabaseFactory.getInstance().getConnection()
                pcid = player.getClassId()
                upd=conn.prepareStatement("UPDATE subclass_list SET subclassid%s=%s WHERE player_id=%s" % (info[0],pcid.getId(),STRING_PART(st)))
                try :
                    upd.executeUpdate()
                    upd.close()
                    conn.close()
                except :
                    try : conn.close()
                    except : pass
                if event2 == `info[0]` and SUB_COUNT(info) > 0:
                    j=0
                    for i in range(CONFIG_MAX_SUBS_IN_DB + 1):
                        if CID_LEVEL(info[i+2]) >= Math.min(2,CONFIG_CLASS_TRANSFER_LEVEL) and j == 0 and i != info[0]:
                            j+=1; temp = info[i+2]; info[0] = i
                    player.setTarget(player)
                    player.setClassId(temp)
                    if not player.isSubClassActive(): player.setBaseClass(temp)
                    player.sendMessage("Your class has changed to " + player.getTemplate().className)
                    if not CONFIG_ENABLE_RESTART_PROTECTION:
                        player.store()
                        player.broadcastUserInfo()
                con=L2DatabaseFactory.getInstance().getConnection()
                if SUB_COUNT(info) <= 1: rem=con.prepareStatement("DELETE FROM subclass_list WHERE player_id=%s" % STRING_PART(st))
                else: rem = con.prepareStatement("UPDATE subclass_list SET subclassid%s=-1 ,currentsub=%s WHERE player_id=%s" % (event2,info[0],STRING_PART(st)))
                try : rem.executeUpdate()
                except : pass
                try :
                    rem.close()
                    con.close()
                except : pass
                if RESET_SKILLS(st) == 1: pass
                if CONFIG_ENABLE_FEE_FOR_SUBCLASS: st.takeItems(CONFIG_DELETE_ITEM_REQUIRED,CONFIG_DELETE_ITEM_A-beep-T)
                if CONFIG_ENABLE_RESTART_PROTECTION and BLOCK_TIME(st,CONFIG_RESTART_TIME_PROTECTION):
                    self.startQuestTimer("dorestart 0 0", CONFIG_RESTART_TIME_PROTECTION*1000, npc, player)
                    AttackStanceTaskManager.getInstance().addAttackStanceTask(player)
                elif CONFIG_ENABLE_FLOOD_PROTECTION and BLOCK_TIME(st,CONFIG_FLOOD_PROTECTION_TIME): pass
                return COMPLETE_HTML(st,event1,`pcid.getId()`)

 

thanks for you help

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

    • I think that solves the freeze thing, anyway great share! 
    • Introducing: Daily & Weekly Missions!   I've released a major panel update with a new Missions system and expanded language support.   Players can now complete daily and weekly missions directly through the panel and claim rewards such as balance or items. Mission progress is tied to in-game activity and supported panel actions, and the update also adds a dedicated Missions page, dashboard mission previews, claimable mission indicators, and full admin tools for creating and managing missions.   The Roll page now shows the potential reward drops below the roll container.   Alongside this, I’ve expanded the panel’s language support with new locale options, including Bulgarian, Czech, Georgian, Lithuanian, Polish, Romanian, Japanese, Simplified Chinese, and Traditional Chinese.     The Demo is now updated with the new features for you to try out!
    • I sell complete packs. If you want to add an item, NPC, etc., you have to do that yourselves. Your friend bought the pack; he's the one who needs to configure his server type. He received what he bought as agreed, and I'm saying this without knowing who you're talking about, because anyone who buys something receives what was agreed upon.   Regards. mmmmm L2Velmore ????   If that's the one, I see everything went well... if I remember correctly you were crying over $100, I gave you a better price, and I suppose you made thousands with that... And you're still coming back to complain? :=)
    • I know many people have struggled with this specific issue and had trouble setting up the correct behavior for Toggle skills in aCis. By default, toggles interrupt the player's movement (retail-like), which often feels clunky to players who prefer a smoother, more modern experience. I've prepared a clean solution that eliminates this "freeze" and allows for fluid movement while toggling your auras. Below is the code on how to achieve this. Hope it helps! Changes in PlayerAI.java: Modified doActiveIntention to properly update the active state without stalling. Removed the forced stop() during toggle casting. Added a MoveToLocation broadcast to ensure other players see your movement correctly (prevents visual "teleporting" or desync). Best regards 😃 diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java index ba0425a..1b2658d 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java @@ -28,6 +28,7 @@  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;  import net.sf.l2j.gameserver.network.serverpackets.AutoAttackStart;  import net.sf.l2j.gameserver.network.serverpackets.ChairSit; +import net.sf.l2j.gameserver.network.serverpackets.MoveToLocation;  import net.sf.l2j.gameserver.network.serverpackets.MoveToLocationInVehicle;  import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;  import net.sf.l2j.gameserver.network.serverpackets.StopMove; @@ -159,7 +160,10 @@      @Override      public synchronized void doActiveIntention()      { -        doIdleIntention(); +        prepareIntention(); +        _currentIntention.updateAsActive(); +        if (!getActor().isMoving()) +            thinkIdle();      }            @Override @@ -280,8 +284,9 @@                    if (skill.isToggle())          { -            getActor().getMove().stop();              getActor().getCast().doToggleCast(skill, target); +            if (getActor().isMoving()) +                getActor().broadcastPacket(new MoveToLocation(getActor()));          }          else          { https://pastebin.com/twZujZ3Y
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..