Jump to content
  • 0

[help] python script help!!!!!


Question

Posted

hi all exw auto to scriptaki gia na kanoun oi caln leader antalagh festival adena me reputation points

import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jserver.gameserver.network.serverpackets import SystemMessage

qn = "9995_ReputationManager"

#NPC
BRICE = 9995

#ITEMS
EUROS = 6673

#HTML

HTMLEXPLAIN = "<html><body>Brice:<BR>Wow ! You have some Event Coins for me ? You can exchange them for Clan Reputation points. But be careful, I'll take 3 Coins, 3 for 5000 Clan Reputation Points. Do you really want to continue ?<BR><a action=\"bypass -h Quest 9995_ReputationManager 1\">Yes, I need Clan Reputation points</a></body></html>"
HTMLNOLEADER = "<html><body>Brice:<BR>Hey, you're not a clan leader at all. Go away from me, liar !</body></html>"
HTMLCLANLVL = "<html><body>Brice:<BR>Hum, it seems your clan is not strong enough to receive my benediction. Come back when your clan level is lv5.</body></html>"
HTMLNOGOLD = "<html><body>Brice:<BR>What do you want to do ? Do you want to receive my benediction for free ? Bring me back some Coins, and maybe, I will trade with you.</body></html>"
HTMLOK = "<html><body>Brice:<BR>Thanks to you for this present, I give you Clan Reputation Points. Please, come again if you have any Coins to exchange.</body></html>"

class Quest (JQuest) :
    def __init__(self,id,name,descr) :

       JQuest.__init__(self,id,name,descr)
        
    def onEvent (self,event,st) :
      htmltext = "<html><body>I have no task right for you now.</body></html>"
      if event == "1" :
        if st.getPlayer().getClan() == None or st.getPlayer().isClanLeader() == 0 :
          # player is not in clan or is not clan leader
          htmltext = HTMLNOLEADER
          st.exitQuest(1)
          return htmltext
        else :
          if st.getPlayer().getClan().getLevel() < 5 :
            # player's clan is under lv5
            htmltext = HTMLCLANLVL
            st.exitQuest(1)
            return htmltext
          else :
           if st.getQuestItemsCount(EUROS) == 3:
              # player have some EUROS, the script take all of them
              st.getPlayer().sendPacket(SystemMessage(1777).addNumber( st.getQuestItemsCount(EUROS)+ 5000 ))
              st.getPlayer().getClan().setReputationScore( st.getPlayer().getClan().getReputationScore() + st.getQuestItemsCount(EUROS)+ 5000 , True)
              st.takeItems(EUROS, st.getQuestItemsCount(EUROS))
              htmltext = HTMLOK
              st.exitQuest(1)
              return htmltext
           else :
              # player haven't EUROS
              htmltext = HTMLNOGOLD
              st.exitQuest(1)
              return htmltext
      return htmltext


    def onTalk(self,npc,player) :
      st = player.getQuestState(qn)
      if not st :
        return "<html><body>I have nothing to say to you.</body></html>"
      npcId = npc.getNpcId()
      if npcId == BRICE :
        # first click, default script text after the first in /html/default/ folder
        st.set("cond","0")
        htmltext = HTMLEXPLAIN
      return htmltext


QUEST = Quest(9995,qn,"ReputationManager")

QUEST.addStartNpc(BRICE)
QUEST.addTalkId(BRICE)

 

alla otan milaw sto npc exw auto sto  gameserver console :

 

  File "__init__.py", line 46, in onEvent
AttributeError: setReputationScore

       at org.python.core.Py.AttributeError(Unknown Source)
       at org.python.core.PyInstance.invoke(Unknown Source)
       at org.python.pycode.serializable._pyx1280312495656.onEvent$3(__init__.p
y:46)
       at org.python.pycode.serializable._pyx1280312495656.call_function(__init
__.py)
       at org.python.core.PyTableCode.call(Unknown Source)
       at org.python.core.PyTableCode.call(Unknown Source)
       at org.python.core.PyTableCode.call(Unknown Source)
       at org.python.core.PyFunction.__call__(Unknown Source)
       at org.python.core.PyMethod.__call__(Unknown Source)
       at org.python.core.PyObject.__call__(Unknown Source)
       at org.python.core.PyObject._jcallexc(Unknown Source)
       at org.python.core.PyObject._jcall(Unknown Source)
       at org.python.proxies.main$Quest$427.onEvent(Unknown Source)
       at com.l2jserver.gameserver.model.quest.Quest.onAdvEvent(Quest.java:674)

       at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:405
)
       at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQue
stEvent(L2PcInstance.java:1823)
       at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.
runImpl(RequestBypassToServer.java:238)
       at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run
(L2GameClientPacket.java:93)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)

Mporei Kaneis na helparei???

4 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • We are not back on 2005, life in our days is harder than before, in complection with other things yes, L2 has not the same look.
    • 🌍 https://l2origins.org/ 🛡️ LINEAGE II ORIGINS — SEASON 1 🛡️ 🌑 High Five Classic | True Old-School Experience 🌑 ⚠️ Opening on March 6th at 16:00 Welcome back to the origins of Lineage II. ⚔️ ABOUT THE SERVER Lineage2 Origins is built for players who miss the true retail feeling. Classic progression, real challenges, fair competition — enhanced only with carefully selected QoL features, never breaking the original gameplay. 🌿 PHASED GEAR PROGRESSION 🟢 Month 1: Vesper max 🟢 Month 2: Vorpal unlocked 🟢 Month 3+: Top-grade & Elegia released 🚫 NO AUTO-FARM ✔️ External auto-clicker allowed (1 per client, download page only) ❌ Bots & illegal automation forbidden 🛡️ Strong anti-bot + captcha system ⚠️ AFK players will be punished — stay active or logout 📊 RATES & CORE SETTINGS 🔹 Adena: x5 🔹 Drop / Spoil: x5 🔹 Skill EXP: x15 🔹 Max Windows: 2 per PC 🔹 Subclass: Lv 85 (no quest required) 🔹 Party Level Diff: 30 (55–85) 🔹 No custom items (armors / weapons / jewelry) 🔥 FEATURES ✨ Global & Raid Teleport ✨ NPC Buffer (34 buffs) ✨ Auto Events & PvP Zones ✨ Ranking & Clan Progression ✨ GM Shop & Premium System ✨ All-In-One Community Board ✨ Party & Solo Instances ✨ Siege & Territory War Rewards ✨ RaidBoss Kill Rewards ✨ Lucky Creature Event ✨ Daily Login Rewards ✨ Advanced DDoS Protection & Backups ⚔️ ENCHANTMENTS 🔸 Safe: +3 🔸 Max: +12 (Month 2: +14 | Month 3: +16) 🔸 Blessed: 50% (Premium 65%) 🔸 Normal: 45% (Premium 60%) 🏟️ OLYMPIAD 🔹 Max Enchant: +6 🔹 Start Players: 4 🔹 Period: 1st & 15th 🏰 SIEGE & TW 🔹 Siege Time: 16:00 & 20:00 🔹 Territory War: 20:00 🔹 Max Wards: 3 per Castle 🌌 Lineage2 Origins Fair. Competitive. Nostalgic. A true return to the origins of Lineage II.
    • Bastante confiable, ya trabaje en varios proyectos con el y la verdad te da confianza que hoy en dia poca gente hay asi lo  recomiendo 100%  Gracias por todo amigo ! seguiremos trabajando juntos segurisimamente! 
  • 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..