Jump to content
  • 0

[HELP] onEnter fee for instance


estaz

Question

13 answers to this question

Recommended Posts

  • 0

Sorry, every file, except Gracia_heart in teleports are rewritten in java  :-\

After a fev. sec. i will upload the .py error..

And this is the error, when i load the instance not in py file but in java, because i have it in java too, but still:

1. ERROR in \BloodShedParty.java (at line 72)
        public BSPWorld()
               ^^^^^^^^^^
No enclosing instance of type InstanceManager is accessible to invoke the super
constructor. Must define a constructor and explicitly qualify its super construc
tor invocation with an instance of InstanceManager (e.g. x.super() where x is an
instance of InstanceManager).
----------
2. WARNING in \BloodShedParty.java (at line 374)
        private int GetKilledMobs(int npcId)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
The method GetKilledMobs(int) from the type BloodShedParty is never used locally

Link to comment
Share on other sites

  • 0

Sorry that i didnt posted the error, that i get from .py file, its just a syntax error because i use private static final. I just ask for a example code, that would check onenter to instance if the player has the required item and onteleport, teleporter would take it (in .py file)..

Link to comment
Share on other sites

  • 0

bump

 

---- edited

Okey, here is the .py file, error and the lines i edited :

 

The File

Red lines - the edited

 

 

qn = "Bloodshedparty"

 

#Items

E_APIGA = 14720

ADENA = 57

STONE = 9576

STONE82 = 10486

STONE84 = 14169

SCROLL = 960

SCROLLB = 6577

GOLDDRAGON = 3481

ECCACOIN        = 4037

 

#NPCs

ROSE = 2009001

CHEST = 2010010

 

#FIRST CHAMBER MOBS

GUARD = 2010001

KEYKEEPER = 2010013

PROTECTOR = 2010005

 

BELETH = 2010007

BAYLOR = 2010008

TIAT = 2010009

 

#Doors

DOOR = 20240001

class PyObject:

pass

 

def openDoor(doorId,instanceId):

for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():

if door.getDoorId() == doorId:

door.openMe()

 

def closeDoor(doorId,instanceId):

for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():

if door.getDoorId() == doorId:

door.closeMe()

 

def checkConditions(player, new):

party = player.getParty()

if not party:

player.sendPacket(ExShowScreenMessage("You are not currently in a party, so you cannot enter.", 8000))

return False

if party and party.getMemberCount() < 2:

player.sendPacket(ExShowScreenMessage("You cannot enter because there is too less people in your party. Minimum is 6 people.", 8000))

return False

 

for partyMember in party.getPartyMembers().toArray():

if partyMember.getLevel() < 80:

player.sendPacket(SystemMessage.sendString(partyMember.getName()+"s level is too low and cannot be entered."))

return False

if not Util.checkIfInRange(1000, player, partyMember, True) and new:

player.sendPacket(SystemMessage.sendString(partyMember.getName()+" is too far away ask him to come here."))

return False

 

return True

 

def teleportplayer(self,player,teleto):

player.setInstanceId(teleto.instanceId)

player.teleToLocation(teleto.x, teleto.y, teleto.z)

pet = player.getPet()

if pet != None :

pet.setInstanceId(teleto.instanceId)

pet.teleToLocation(teleto.x, teleto.y, teleto.z)

return

 

def enterInstance(self,player,template,teleto):

instanceId = 0

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

st = partyMember.getQuestState(qn)

if not st : st = self.newQuestState(partyMember)

if partyMember.getInstanceId()!=0:

instanceId = partyMember.getInstanceId()

else :

if player.getInstanceId()!=0:

instanceId = player.getInstanceId()

if instanceId != 0:

if not checkConditions(player,False):

return 0

foundworld = False

for worldid in self.world_ids:

if worldid == instanceId:

foundworld = True

if not foundworld:

player.sendPacket(SystemMessage.sendString("You have entered another zone, therefore you cannot enter this one."))

return 0

teleto.instanceId = instanceId

teleportplayer(self,player,teleto)

return instanceId

else:

if not checkConditions(player,True):

return 0

instanceId = InstanceManager.getInstance().createDynamicInstance(template)

if not instanceId in self.world_ids:

world = PyObject()

world.rewarded=[]

world.instanceId = instanceId

self.worlds[instanceId]=world

self.world_ids.append(instanceId)

print "Instance: Started " + template + " Instance: " +str(instanceId) + " created by " + str(player.getName())

teleto.instanceId = instanceId

for partyMember in party.getPartyMembers().toArray():

teleportplayer(self,partyMember,teleto)

return instanceId

return instanceId

 

def exitInstance(player,tele):

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

partyMember.setInstanceId(0)

partyMember.teleToLocation(tele.x, tele.y, tele.z)

pet = partyMember.getPet()

if pet != None :

pet.setInstanceId(0)

pet.teleToLocation(tele.x, tele.y, tele.z)

else :

player.setInstanceId(0)

player.teleToLocation(tele.x, tele.y, tele.z)

pet = player.getPet()

if pet != None :

pet.setInstanceId(0)

pet.teleToLocation(tele.x, tele.y, tele.z)

InstanceManager.getInstance().destroyInstance(player.getInstanceId())

 

class Bloodshedparty(JQuest):

def __init__(self,id,name,descr):

JQuest.__init__(self,id,name,descr)

self.worlds = {}

self.world_ids = []

 

def onTalk (self,npc,player):

st = player.getQuestState(qn)

npcId = npc.getNpcId()

if npcId == ROSE :

              if st.getQuestItemsCount(ECCACOIN) >= 4 :

                htmltext =  "2009002.htm"

                    else :

                        st.takeItems(ECCACOIN,5)

tele = PyObject()

tele.x = 16345

tele.y = 209051

tele.z = -9357

enterInstance(self, player, "Bloodshedparty.xml", tele)

st.playSound("ItemSound.quest_middle")

elif npcId == CHEST :

npc.decayMe()

tele = PyObject()

tele.x = 82200

tele.y = 148347

tele.z = -3467

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

exitInstance(partyMember,tele)

else:

exitInstance(player,tele)

st.giveItems(ADENA,10000)

if Rnd.get(100) < 10 :

st.giveItems(STONE84,1)

if Rnd.get(100) < 15 :

st.giveItems(STONE82,1)

if Rnd.get(100) < 25 :

st.giveItems(STONE,1)

if Rnd.get(100) < 25 :

st.giveItems(SCROLLB,1)

if Rnd.get(100) < 50 :

st.giveItems(SCROLL,1)

st.playSound("ItemSound.quest_finish")

player.sendPacket(ExShowScreenMessage("This world was destroyed: Completed", 8000))

player.sendPacket(ExShowScreenMessage("Baylor: You fools, We will meet in your world soon.....Aha ha ha", 15000))

return

 

def onKill(self,npc,player,isPet):

st = player.getQuestState(qn)

npcId = npc.getNpcId()

if npcId == GUARD :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Master, Forgive Me! I failed"))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(PROTECTOR,16658,211498,-9357,0,False,0,False,npc.instanceId)

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "You fools, here's your end"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Ooo...It is a good day to die"))

openDoor(DOOR,npc.instanceId)

elif npcId == PROTECTOR :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Master, Forgive Me!"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I failed, give me another chance to protect you"))

st.giveItems(E_APIGA,2)

player.sendPacket(ExShowScreenMessage("Fools, here's your end!", 8000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(BELETH,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,20,5))

elif npcId == BELETH :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "My world....."))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Baylorrrrr"))

st.giveItems(E_APIGA,2)

player.sendPacket(ExShowScreenMessage("Baylor:My Brother, I will avenge you!", 12000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(BAYLOR,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,20,5))

elif npcId == BAYLOR :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "My death is nothing, your end is near"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "You fools ....Aha ha ha ha"))

st.giveItems(E_APIGA,1)

player.sendPacket(ExShowScreenMessage("..............kill them all!", 8000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(TIAT,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,80,5))

elif npcId == TIAT :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Ugh.... Defeated.. How!?"))

player.sendPacket(ExShowScreenMessage("Congratulations! You Have Defeated Demonic Lord.", 12000))

st.playSound("ItemSound.quest_finish")

st.giveItems(E_APIGA,4)

st.giveItems(GOLDDRAGON,4)

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(CHEST,16225,213040,-9357,0,False,0,False,npc.instanceId)

return

 

QUEST = Bloodshedparty(-1, qn, "Bloodshedparty")

QUEST.addStartNpc(ROSE)

QUEST.addTalkId(ROSE)

QUEST.addTalkId(CHEST)

 

QUEST.addKillId(GUARD)

QUEST.addKillId(PROTECTOR)

QUEST.addKillId(BELETH)

QUEST.addKillId(BAYLOR)

QUEST.addKillId(TIAT)

 

 

the error:

Line: -1 - Column: -1

Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('__init__.py', 160, 17, '                if st.getQuestItemsCount(ECCACOIN) >= 4 :'))

 

Why does this error appear? Do i need to add something in the checkConditions section or what?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • /data/attachments/4/4519-0e10f165cf34562cd44d346d47967752.jpg Dear friends! September 27 we start Event for Olympiad games on Open Beta server Start Olympiad games in 19:00 (UTC +3) September 27 Fights will be till 23:40, then we get Heroes (after 00:00) All who get Hero status, will receive 500 ToDs. Best 5 Hero, who will get the most PTS, will get 800 ToDs instead of 500. ToDs you will get on your Master Account balance No class vs class fights Enchant Level Restrictions: S gr +6, A gr + 7, C/B gr + 16. On Olympiad, all items that higher than restriction level will be removed, and you won't be able to use them or wear them Talent Tree avaible only Tier 1 (same like will be on 1st Oly cycle on Live server) Skill enchant lvl: 15 max for 2nd profession, 7 for 3rd profession - its global rules for all Beta Good luck to Everyone!  
    • I'm currently working on an advanced auto-farm compatible with older chronicles (C4, IL, HF, etc) and older L2J-Mobius builds. https://imgur.com/a/LJS2OMC
    • GamezAION 4.8 High Quality Relaunch Coming Friday 4th October 2024   All Latest Retail Skin Appearances Unique RvR Battlegrounds (Guardian) (Battle of Gods) Added New PvPvE Map with Seasonal Ranking System Active Anticheat System & Shugo Console Support   Download links available on website   https://gamezaion.com Join the Action!
    • 🌟 Step Into Lin2Age C4 – Your Nostalgic Journey Awaits! 🌟 Get ready for an unforgettable adventure filled with fierce battles ⚔️, mighty clans 👑, and epic quests 🌍! Lin2Age is a custom Lineage 2 server designed to bring you the ultimate classic experience, enriched with modern features. Whether you're a battle-hardened veteran or a fresh-faced newcomer, there's a place for everyone in our world! 🛡️✨   🔥 Why Lin2Age is Your Best Choice 🔥 ✅ Dynamic Events & Rewards: Enjoy thrilling features like TVT, Magic Roulette, Daily Rewards, measures to enhance your gameplay. ✅ Advanced Security Features: Enjoy robust protections with Anti-Bot measures, Password Lock, and Raid Boss Information to keep your adventures safe and secure. ✅ Balanced Gameplay for All: Dive into a harmonious blend of PvP, PvE, and crafting! Lin2Age combines the finest elements from Scions of Destiny MasterWork and Interlude, ensuring an immersive experience for every playstyle! 🛡️⚔️ ✅ Epic Gear & AIO Buffer: Equip Legendary Armor and powerful jewels! Our All-In-One Buffer is at your service, empowering you to dominate the battlefield! 💎💪 ✅ Unique Custom Features: Embark on exclusive quests 📜 and take on formidable raid bosses 🐉! Lin2Age is filled with thrilling content that keeps your adventures lively and exciting. 🎯🎮 ✅ Thriving Community: Join a vibrant community where teamwork and friendship thrive! Whether leading a clan or joining one, support is always at your fingertips! 🤝👑 ✅ Regular Updates & Events: Experience continuous excitement! With frequent updates, fresh custom content, and epic events, Lin2Age is always evolving, thanks to your invaluable feedback! 🔄🏆 ✅ Smooth, Lag-Free Experience: Enjoy uninterrupted gameplay on our top-tier servers—say goodbye to lag! 🚀⚡   💎 Fair Play Above All 💎 At Lin2Age, we champion a balanced and equitable gaming experience. Our No Pay-to-Win policy ensures that success comes from skill, strategy, and teamwork, not your wallet! 💪 Everything you need to thrive can be earned through quests, crafting, and epic battles! 🏆🎮   🔑 Key Features You’ll Love 🔑 🔹 Rates: EXP x45, SP x45, ADENA x300—meticulously balanced for your enjoyment! 🔹 Custom Classes & Skills: Discover unique classes and skills that make PvP combat dynamic! ⚔️ 🔹 Epic Raid Bosses: Challenge yourself against custom bosses for legendary loot! 💀🏹 🔹 Clan Wars & Sieges: Test your strength in exhilarating clan wars and castle sieges! 🏰⚔️ 🔹 Dedicated Support Team: Our active Game Masters are committed to ensuring fairness and smooth gameplay! 👥🛡️ ⚔️ Join the Lin2Age Beta Test – Adventurers Needed! 🛡️ Are you ready to experience the glory of Lineage 2, reimagined for a new generation? 🌍 Become part of our exclusive beta test and help shape the future of Lin2Age! 🚀✨ Start your epic journey today. Welcome to Lin2Age C4! 💬 Connect with Us on Discord Join our community, stay updated, and take part in the latest events! Discord: https://discord.gg/qKJnQ7Kp5X Youtube: https://www.youtube.com/watch?v=nnO-J_uAqvg https://prnt.sc/b3tRHlxT6YS7
  • Topics

×
×
  • Create New...