Jump to content

Question

Posted

Hello guys!

 

So I am trying out the L2JHellas project but it seems that I have a problem adding ANY buffer...

I Changed the imports to com.l2jhellas.gameserver.etc.etc.etc like this

 

import sys

from com.l2jhellas import L2DatabaseFactory
from com.l2jhellas.gameserver.model.quest import State
from com.l2jhellas.gameserver.model.quest import QuestState
from com.l2jhellas.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jhellas.gameserver.model.actor.instance import L2PcInstance
from com.l2jhellas.gameserver.model import L2Skill
from java.util import Iterator
from com.l2jhellas.gameserver.datatables import SkillTable

BUT at every buffer I import to the server I get the same error at the error log.

Error on: C:\Users\CptDreamer\Desktop\L2jHellas Compiled V4\gameserver\data\scripts\custom\Buffer_by_Sydhe\__init__.py.error.log
Line: -1 - Column: -1
 
Traceback (innermost last):
  File "__init__.py", line 109, in ?
TypeError: com.l2jhellas.gameserver.model.quest.State(): expected 0 args; got 2

This is the source of the last buffer I tried.

import sys
from com.l2jhellas import L2DatabaseFactory
from com.l2jhellas.gameserver.model.quest import State
from com.l2jhellas.gameserver.model.quest import QuestState
from com.l2jhellas.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jhellas.gameserver.model.actor.instance import L2PcInstance
from com.l2jhellas.gameserver.model import L2Skill
from java.util import Iterator
from com.l2jhellas.gameserver.datatables import SkillTable
 
qn = "Buffer_by_Sydhe"
NPC = [50104]
ACCEPT_BUFF = [1040, 1068, 1035, 1043, 1077, 1078, 1085, 1311, 1032,
               1036, 1045, 1048, 4352, 4357, 4391, 4403, 4405, 1243,
               1388, 1389, 1087, 1259, 1059, 1268]
ACCEPT_DANCES = [271, 272, 273, 274, 275, 276, 277, 307, 309,
                 310, 311, 365]
ACCEPT_SONGS = [364, 264, 306, 269, 270, 265, 363, 349, 308,
                305, 304, 267, 266, 268]
ACCEPT_CHANTS = [1251, 1252, 1253, 1284, 1006, 1007, 1009, 1362,
                 1310, 1309, 1308, 1391, 1390]
ACCEPT_SPECIAL = [1364, 1356, 1355, 1357, 1413, 4702, 4703, 4700,
                  4699, 1323]
ACCEPT_RESISTS = [1393, 1392, 1182, 1189, 1191, 1073]
 
QuestId     = -1
QuestName   = "Buffer"
QuestDesc   = "custom"
 
print qn + " Buffer l2maxi.ru (KFan)"
 
class Quest (JQuest) :
 
 def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
 
 def onEvent(self, event, st):
    htmltext = "Sory, failed Event"
    ownerid = st.getPlayer().getObjectId()
    effects = st.getPlayer().getAllEffects()
    if event.startswith("page_") :
        page = int(event.replace("page_", ""))
        htmltext = str(page) + ".htm"
    elif event == "cancel" :
        st.getPlayer().stopAllEffects()
        htmltext = "1.htm"
        activePage = 1
    elif event == "reload" :
        st.getPlayer().restoreCP()
        st.getPlayer().restoreHP()
        st.getPlayer().restoreMP()
        htmltext = "1.htm"
    elif event.startswith("buff_") :
        id_lvl = event.replace("buff_", "")
        id_lvl = id_lvl.split("_")
        SkillTable.getInstance().getInfo(int(id_lvl[0]), int(id_lvl[1])).getEffects(st.getPlayer(), st.getPlayer())
        htmltext = str(int(id_lvl[2])) + ".htm"
    elif event.startswith("profile_") :
        act = event.replace("profile_", "")
        con = L2DatabaseFactory.getInstance().getConnection()
        if act.startswith("buff_") :
            act = str(int(act.replace("buff_", "")))
            sql = con.prepareStatement("SELECT * FROM profile_buff WHERE char_id = ? AND pindex = ?")
            sql.setInt(1, int(ownerid))
            sql.setInt(2, int(act))
            rs = sql.executeQuery()
            rs.next()
            full_buffs = rs.getString("skills").split(";")
            sql.close()
            rs.close()
            for buff in full_buffs :
if buff != "" :
buff = buff.split(",")
SkillTable.getInstance().getInfo(int(buff[0]), int(buff[1])).getEffects(st.getPlayer(), st.getPlayer())
 
            htmltext = "1.htm"
        elif act.startswith("save_") :
            act = str(int(act.replace("save_", "")))
            sqll = con.prepareStatement("DELETE FROM profile_buff WHERE char_id = ? AND pindex = ?")
            sqll.setInt(1, int(ownerid))
            sqll.setInt(2, int(act))
            sqll.execute()
            sqll.close()
            saving = "++"
            for eff in effects :
                eff_id = eff.getSkill().getId()
                eff_level = eff.getSkill().getLevel()
                if saving == "++" :
                    if (eff_id in ACCEPT_BUFF or eff_id in ACCEPT_DANCES or eff_id in ACCEPT_SONGS or eff_id in ACCEPT_CHANTS or eff_id in ACCEPT_SPECIAL or eff_id in ACCEPT_RESISTS) :
                        saving = str(eff_id) + "," + str(eff_level) + ";"
                else :
                    if (eff_id in ACCEPT_BUFF or eff_id in ACCEPT_DANCES or eff_id in ACCEPT_SONGS or eff_id in ACCEPT_CHANTS or eff_id in ACCEPT_SPECIAL or eff_id in ACCEPT_RESISTS) :
                        saving += str(eff_id) + "," + str(eff_level) + ";"
            sql = con.prepareStatement("INSERT INTO profile_buff (char_id, pindex, skills) VALUES ('" + str(ownerid) + "', '" + str(act) + "', '" + saving + "')")
            sql.execute()
            sql.close()
            htmltext = "8.htm"
        con.close()
    return htmltext
 
 def onTalk (self, npc, player):
    htmltext = "1.htm"
    st = player.getQuestState(qn)
    if not st : return htmltext
    npcId = npc.getNpcId()
    return htmltext
 
 
QUEST = Quest(QuestId, qn, QuestDesc)
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
 
for npcId in NPC:
 QUEST.addStartNpc(npcId)
 QUEST.addTalkId(npcId)

Any help please? <3
 
PS:Line 109 is at the "CREATED     = State('Start', QUEST)"

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.



  • Posts

    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click   🚀 Promo code: MEDIUM5 (5% Discount)   ➡️ Online Store: Click ✅ ➡️ Telegram Bot: Click ✅ ➡️ SMM Panel: Click ✅   Regular customers receive additional discounts and promo codes!   Support: ➡️ Telegram: https://t.me/solomon_bog ✅ ➡️ Discord: https://discord.gg/y9AStFFsrh ✅ ➡️ WhatsApp: https://wa.me/79051904467 ✅ ➡️ Email: solomonbog@socnet.store ✅   ➡️ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners )  — Becoming a supplier   SocNet — your store for digital goods and premium subscriptions ✅
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • Buying & Selling Torn City Cash
  • 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