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

    • Trustworthy person; hope you find what you're looking for!
    • Customs being added to systextures/animation/texture influences the increase in virtual ram by a very small amount, which means you won't have a headache in the future with critical error issues, unless it's a dubious custom, there are 2 custom weapon packs available for H5 that are "compromised", they didn't make a very good adaptation, one of the packages is the weapons from the goddess of destruction for H5, another is the hero weapons from the goddess of destruction for H5, avoid these customs for your H5 server if you see it on any forum.   Now coming back to your question; one thing that the NCSoft developers never did was add files to their system, probably because they were aware of what could happen when doing that, now think about one thing: the game's system retail itself is no more than 70MB, every time there was an update made by NCSoft they always added the equipment/items/cloaks etc. in their folders intended for that, so why do we do this? I still have my client containing a system with almost 1GB, 1-2h online is the time I can stay online before the ram memory limit, but I have already redone my entire client with customs being destined for textures/systexture/animations, almost all the customs that I had on that client containing a 1GB system I have on my current server, with the difference that I removed everything from the system and critical error is now nothing more than legends, my current server has a total of 220MB in the system folder And theoretically speaking, based on what I've seen, especially on many forums, I believe that the heavier the system folder is, the faster we accelerate the consumption of the client's virtual ram memory, causing countless different types of critical error in one short period of time, in many forums that I've seen on topics involving critical, the solution that stands out the most is about downloading a new clean "system"
    • Do you think that everything on the system is loaded regardless if you use it or not ? or even worst, are they loaded even if they exist as textures/meshes but not defined on the DAT files ?
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
    • Yes, it is, it's not hard to do (if you know what you're doing); just time consuming.   To make some things clear: 1. You can not create .ukx files with animated skeletalmeshes inside, by using any of the freeshared L2Editors (basically, no support for .psa files) 2. You need a patched UT2003/UT2004. You can either get your own ut2004 and download Gildor's patch from his web, or use any of these: When you use these, you should be able to import both .psk and .psa animations > link the skeletalmesh to the psa > save as .ukx > use ut2down to convert the file to l2 format > encrypt the .ukx with standard l2 encryption (you can use mxc encdec, you can find it in the folder of the l2editor i shared). Your best bet is to use pawnviewer (aka dev mode) to test that. If you have troubles with that process then leave a reply here, otherwise, if it works correctly, you can move on to adding missing animnotify classes to you unrealed, then proper animnotifies, sounds, effects or w/e is missing from your .ukx files. Keep in mind that this is overall not difficult but a huge amount of work (unless you're good at scripting/macros) since you'd need to manually re-create every single animnotify, by hand. If you have doubts or i wasn't clear enough let me know here. (in case you don't know what an animnotify is: UDN - Two - AnimNotifies (unrealengine.com) )  
  • Topics

×
×
  • Create New...