Jump to content
  • 0

[Help] Not compatible with L2jfree?


Question

Posted

hi I am using an eventscript that has this code

 


import math
import sys
from net.sf.l2j.gameserver              import Announcements
from net.sf.l2j.util                    import Rnd
from java.lang                      import System
from net.sf.l2j.gameserver.model.actor.appearance   import PcAppearance
from net.sf.l2j.gameserver              import GameTimeController
from net.sf.l2j.gameserver.model.quest          import State
from net.sf.l2j.gameserver.model.quest          import QuestState
from net.sf.l2j.gameserver.model.quest.jython       import QuestJython as JQuest
from net.sf.l2j.gameserver.model.actor.instance     import L2PcInstance
from net.sf.l2j.gameserver.model.actor.instance     import L2NpcInstance

 

I added the "free" part because I saw in other scripts they had them and the old files did not.

 


import math
import sys
from net.sf.l2jfree.gameserver              import Announcements
from net.sf.l2jfree.util                    import Rnd
from java.lang                      import System
from net.sf.l2jfree.gameserver.model.actor.appearance   import PcAppearance
from net.sf.l2jfree.gameserver              import GameTimeController
from net.sf.l2jfree.gameserver.model.quest          import State
from net.sf.l2jfree.gameserver.model.quest          import QuestState
from net.sf.l2jfree.gameserver.model.quest.jython       import QuestJython as JQuest
from net.sf.l2jfree.gameserver.model.actor.instance     import L2PcInstance
from net.sf.l2jfree.gameserver.model.actor.instance     import L2NpcInstance

 

But it does not work, does anyone know how to make it work?

 

I use the latest gracia l2jfree rev

8 answers to this question

Recommended Posts

  • 0
Posted

in l2jfree they dont use net.sf.l2j ,they use com.l2jfree, try changing the imports

  • 0
Posted

ok I tried this

 


import math
import sys
from com.l2jfree.gameserver              import Announcements
from com.l2jfree.tools.random              import Rnd
from java.lang                      import System
from com.l2jfree.gameserver.model.actor.appearance   import PcAppearance
from com.l2jfree.gameserver              import GameTimeController
from com.l2jfree.gameserver.model.quest          import State
from com.l2jfree.gameserver.model.quest          import QuestState
from com.l2jfree.gameserver.model.quest.jython       import QuestJython as JQuest
from com.l2jfree.gameserver.model.actor.instance     import L2PcInstance
from com.l2jfree.gameserver.model.actor.instance     import L2NpcInstance

 

The server console says its executed successfully with no errors but the NPC that is suppose to spawn does not :S

 

 

Here is the full script

 


import math
import sys
from com.l2jfree.gameserver              import Announcements
from com.l2jfree.tools.random              import Rnd
from java.lang                      import System
from com.l2jfree.gameserver.model.actor.appearance   import PcAppearance
from com.l2jfree.gameserver              import GameTimeController
from com.l2jfree.gameserver.model.quest          import State
from com.l2jfree.gameserver.model.quest          import QuestState
from com.l2jfree.gameserver.model.quest.jython       import QuestJython as JQuest
from com.l2jfree.gameserver.model.actor.instance     import L2PcInstance
from com.l2jfree.gameserver.model.actor.instance     import L2NpcInstance


MANAGER = 100400
TOPNPC  = 100401
Raids =  [ 25514,22216,25286,25283,25319 ]

#Mountain protected zone
MX  = 55312
MY  = 219168
MZ  = -3223

#Mountain top NPC coords
MNPCX   = 144291
MNPCY   = 157446
MNPCZ   = -466

#Mountain bottom and giran NPC coords
MBX1    = 82698
MBY1    = 148638
MBZ1    = -3468
MBX = 143370
MBY = 161135
MBZ = -1925

#number of participants
MountainMinPlayers = 1
MountainMaxPlayers = 30

EventNpcs = [ 100400, 100401 ]

#time between events in milliseconds
eventInterval = 7200000  # 2 hours after the first event there is the second one and the others after are 2 hours too
FirstStart = 2700000  #45 minutes after each restart there is the first event


class eventmanager (JQuest):

    def __init__(self,id,name,descr):
        JQuest.__init__(self,id,name,descr)
        self.RaidBosses ={
                0: {'name':"Queen Shyeed" , 'id':25514},
                1: {'name':"Tyrannosaurus" , 'id':22216},
                2: {'name':"Anakim" , 'id':25286},
                3: {'name':"Lilith" , 'id':25283},  
                4: {'name':"Ember" , 'id':25319},
                }
        self.RbCoords ={
                0: {'name':"in the colliseum" , 'X':150086 , 'Y':46733 , 'Z':-3407},  
                1: {'name':"near the entrance of the Garden of Eva" , 'X':84805 , 'Y':233832 , 'Z':-3669},
                2: {'name':"close to the western entrance of the Cemetary" , 'X':161385 , 'Y':21032 , 'Z':-3671},
                3: {'name':"at Gludin's Harbor" , 'X':89199 , 'Y':149962 , 'Z':-3581},
                }
        self.startQuestTimer("EventTrigger", FirstStart, None, None)
        self.RbSpawn = []
        self.rewards ={
                0: {'prize':57 , 'number':1}, #King of the hill event, dont forget to change the reward
                }
        self.Teams = []
        self.Event = []
        self.True = True
        self.False = False
        self.Group = []
        self.EventManager1 = []
        self.EventManager = []
        self.Registration = []
        self.numberPlayers = []
        self.One = 1
        self.Team1 = []
        self.Team2 = []
        self.numberOfTeams = []
        self.Trigger = 1
        self.Count = 2
        self.Add = 1
        self.Full = False
        self.TopNpc = []
        self.EventNames = {0:"King of the hill", 1:"kill the Raidboss"}


    def onAdvEvent (self,event,npc,player):
        if event == "EventTrigger" :
            rr = int(Rnd.get(2))
            Announcestart = "The " + self.EventNames[rr] + " event is about to start!!!"
            Announcements.getInstance().announceToAll(Announcestart)
            if rr == 0:
                self.Event = 0
                eventmanager1 = self.addSpawn(MANAGER,MBX1,MBY1,MBZ1,0,False,0)
                self.EventManager1 = eventmanager1
                topnpc = self.addSpawn(TOPNPC,MNPCX,MNPCY,MNPCZ,0,False,0)
                self.TopNpc = topnpc
                Announcements.getInstance().announceToAll("All those who wish to participate should come to meet me in Giran town")
                Announcements.getInstance().announceToAll("Registration will last 15 minutes")
                self.startQuestTimer("MountainSelect", 900000, npc, player)                            
                self.startQuestTimer("10minutes", 300000, npc, player)                            
                self.startQuestTimer("5minutes", 600000, npc, player)                            
                self.startQuestTimer("2minutes", 780000, npc, player)                            
                self.startQuestTimer("1minute", 840000, npc, player)                            
            if rr == 1:
                self.Event = 1
                #the spawn coords and which raidboss are both random and
                #independant from each other
                ra = int(Rnd.get(5))
                rb = int(Rnd.get(4))
                self.RbSpawn = []
                raidboss = self.RaidBosses[ra]['name']
                location = self.RbCoords[rb]['name']
                Announcements.getInstance().announceToAll(raidboss + " has just been spawned " + location + " and will disappear in 2 hours, hurry!")
                self.RbSpawn = self.addSpawn(self.RaidBosses[ra]['id'],self.RbCoords[rb]['X'],self.RbCoords[rb]['Y'],self.RbCoords[rb]['Z'],0,False,0)
                self.startQuestTimer("RbDespawn", 7150000, npc, player)                            
                self.startQuestTimer("EventTrigger", eventInterval, npc, player)                          
        if event == "10minutes":
            Announcements.getInstance().announceToAll("10 minutes left for event registration in Giran")
        if event == "5minutes":
            Announcements.getInstance().announceToAll("5 minutes left for event registration in Giran")
        if event == "2minutes":
            Announcements.getInstance().announceToAll("2 minutes left for event registration in Giran")
        if event == "1minutes":
            Announcements.getInstance().announceToAll("1 minute left for event registration in Giran")
        if event == "MountainSelect" :
                self.EventManager1.deleteMe()
                self.startQuestTimer("MountainStart", 60000, npc, player)                            
                totalplayers = len(self.Registration)
                if totalplayers >= MountainMinPlayers:
                    #5 players per team, max 6 teams can participate
                    self.numberOfTeams = int((len(self.Registration))/2)
                    numberOfTeams = int((len(self.Registration))/2)
                    playerList = list(self.Registration)
                    Team1 = []
                    Team2 = []
                    for i in range(len(playerList)/2) :
                        Team1.append(playerList.pop(Rnd.get(len(playerList))))
                    Team2 = playerList
                    for i in Team1:
                        i.teleToLocation(MNPCX,MNPCY,MNPCZ)#tele to top of mountain
                        i.getAppearance().setNameColor(0x005de2) #orange
                        i.getAppearance().setTitleColor(0x005de2) #orange
                        i.getQuestState("eventmanager").set("cond","3")
                    for i in Team2:
                        i.teleToLocation(144428,161151,-2460)#tele to location A
                        i.getAppearance().setNameColor(0xd5e200) #yellow
                        i.getAppearance().setTitleColor(0xd5e200) #yellow
                        i.getQuestState("eventmanager").set("cond","4")
                    Announcements.getInstance().announceToAll("Team 1 - blue - has 20 minutes to take control of the mountain and talk to the Flag NPC to win this event.")
                    Announcements.getInstance().announceToAll("Team 2 - orange - has to defend the mountain to win.  Event starts in 1 minute, wait for the signal.")
                    self.Team1 = Team1
                    self.Team2 = Team2
                    self.numberOfTeams = numberOfTeams
                else:
                    Announcements.getInstance().announceToAll("Event cancelled due to lack of participation.")
                    self.EventManager1.deleteMe()
                    self.TopNpc.deleteMe()
                    self.cancelQuestTimer("round_finish", None, None)
                    self.cancelQuestTimer("15Tofinish", None, None)
                    self.cancelQuestTimer("10Tofinish", None, None)
                    self.cancelQuestTimer("5Tofinish", None, None)
                    self.cancelQuestTimer("1Tofinish", None, None)
        if event == "MountainStart":
            for i in self.Team2:
                i.teleToLocation(MBX,MBY,MBZ)#tele to location A
            Announcements.getInstance().announceToAll("Start the event!!! Team 2, ATTACK!!! Good luck to both teams!")
            self.Attacker = self.Team2
            self.Defender = self.Team1
            self.startQuestTimer("round_finish", 1200000, npc, player) #sera 1200000                            
            self.startQuestTimer("15Tofinish", 300000, npc, player)                            
            self.startQuestTimer("10Tofinish", 600000, npc, player)                            
            self.startQuestTimer("5Tofinish", 900000, npc, player)                            
            self.startQuestTimer("1Tofinish", 1140000, npc, player)                            
        if event == "15Tofinish":
            Announcements.getInstance().announceToAll("15 minutes until the end of the event")
        if event == "10Tofinish":
            Announcements.getInstance().announceToAll("10 minutes until the end of the event")
        if event == "5Tofinish":
            Announcements.getInstance().announceToAll("5 minutes until the end of the event")
        if event == "1Tofinish":
            Announcements.getInstance().announceToAll("1 minute until the end of the event")
        if event == "round_finish" and npc and player:
            self.TopNpc.deleteMe()
            self.startQuestTimer("EventTrigger", eventInterval, npc, player)                          
            self.cancelQuestTimer("15Tofinish", None, None)
            self.cancelQuestTimer("10Tofinish", None, None)
            self.cancelQuestTimer("5Tofinish", None, None)
            self.cancelQuestTimer("1Tofinish", None, None)
            Announcements.getInstance().announceToAll("Orange team wins!")
            rr = self.Event
            reward = self.rewards
            for i in self.Team2:
                i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town
                i.getAppearance().setNameColor(0xffffff)
                i.getAppearance().setTitleColor(0xffffff)
                i.getQuestState("eventmanager").set("cond","0")
            for i in self.Team1:
                i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town
                i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number'])
                i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1")
                i.getAppearance().setNameColor(0xffffff)
                i.getAppearance().setTitleColor(0xffffff)
                i.getQuestState("eventmanager").set("cond","0")
        if event == "RbDespawn":
            self.RbSpawn.deleteMe()

    def onTalk (self,npc,player) :
        npcId = npc.getNpcId()
        cond = player.getQuestState("eventmanager").getInt("cond")
        if npcId == MANAGER :
            if not cond == 2:
                if self.Event == 0:
                    if len(self.Registration) < MountainMaxPlayers:
                        player.getQuestState("eventmanager").set("cond","2")
                        self.Registration.append(player)
                        Reg = list(self.Registration)
                        return "<html><body>You have been added to the event list, teams will be made randomly 1 minute before the start of the event</body></html>"
                    else:
                        Announcements.getInstance().announceToAll("Event is now full, no more registration accepted.")
                        self.Full = True
                        return "<html><body>Event is full, try again next time</body></html>"
            else:
                return "<html><body>You are already registered</body></html>"
        if npcId == TOPNPC :
            if not cond == 3:
                self.TopNpc.deleteMe()
                self.cancelQuestTimer("round_finish", None, None)
                self.cancelQuestTimer("15Tofinish", None, None)
                self.cancelQuestTimer("10Tofinish", None, None)
                self.cancelQuestTimer("5Tofinish", None, None)
                self.cancelQuestTimer("1Tofinish", None, None)
                Announcements.getInstance().announceToAll("Blue team wins!")
                rr = self.Event
                reward = self.rewards
                self.startQuestTimer("EventTrigger", eventInterval, npc, player)                          
                for i in self.Team1:
                    i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town
                    i.getAppearance().setNameColor(0xffffff)
                    i.getAppearance().setTitleColor(0xffffff)
                    i.getQuestState("eventmanager").set("cond","0")
                for i in self.Team2:
                    i.teleToLocation(MBX1,MBY1,MBZ1)#tele back to town
                    i.getQuestState("eventmanager").playSound("ItemSound.quest_fanfare_1")
                    i.getQuestState("eventmanager").giveItems(reward[rr]['prize'],reward[rr]['number'])
                    i.getAppearance().setNameColor(0xffffff)
                    i.getAppearance().setTitleColor(0xffffff)
                    i.getQuestState("eventmanager").set("cond","0")
            else:
                return "<html><body>You are on the defending team!!! defend me, stop talking!</body></html>"

    def onKill (self,npc,player,isPet):
        if npc in self.RbSpawn:
            self.cancelQuestTimer("RbDespawn", None, None)

# Quest class and state definition
QUEST       = eventmanager(-1, "eventmanager", "ai")

for i in Raids:
    QUEST.addKillId(i)

for i in EventNpcs:
    QUEST.addTalkId(i)
    QUEST.addStartNpc(i)

print "Event Manager loaded!!!"

 

  • 0
Posted

in l2jfree they dont use net.sf.l2j ,they use com.l2jfree, try changing the imports

when Finish and add the codes . need to compile again ?? ...because if i put something custom

on com/l2jfree/ and i try to compile I always have errors...

  • 0
Posted

 

Tell me something that works on l2jfree ... with com/l2jfree folder.. I want to try it..

 

since the l2jfree trunk is unsupported nothing works on l2jfree :D

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

    • Hi everyone, Since I’m no longer interested in L2 servers, if anyone is willing to continue the project, let me know. I’m currently selling the entire project. DM me for more information if you’re genuinely interested. I can offer limited free support for the first couple of months. It is not cheap. The sale includes the domain, the recently fully redesigned website, the updater, the interface, server files with Lucera ext source, and the database (excluding account passwords, emails, and other private information; character data can remain).   Server for test: https://lineage2.gold/download Server Info: https://lineage2.gold/info Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113  
    • You invent yourself a life - bad for you, one of the inner core dev, fernandopm, which worked hard over aCis quests from 2011 to 2016 is argentinian. I teached him back in time to work and make proper quests. My dev team comes from 10+ countries and I'm myself french. "Racist/nationalist" card ? Not working bro.   Not sure why I should thank you to send me questions, and regarding bug reports, so far, I got none of yours in either discord, gitlab, or forums. I'm sorry if you feel "ignored", but that's more a psychanalyst you need to speak with if you put emotions towards someones' appreciation over a forum. I never ignore a bug report, and if so (like skills reports), it's because I got a bigger plan (skills refactor, in that case). In any case, I delivered cookies for the bug report/fix, even if it dated of months, with proper credits over changesets. "Victim card" ? Not really working, but ok, maybe you're "emotional".   I barely make money out of aCis, for the spent time - simply selling my services, or even coding/administrating a minecraft/L2J server would make far more money. Breaking intentionally things would be stupid. If you don't understand I'm not the only one working on that pack, I can't help you. Also, the scale of edits is sometimes extreme - AI L2OFF ? 1800 files added. How do you want everything works in a single shot ? "Exploiting noobz for money" card ? Still not working, or I'm a terrible businessman.   Meanwhile - you shadow advertise your project, L2JOne (since 2017 btw) - you should maybe start by the beginning saying you're a competitor and aCis is actually a spike in your foot. That also explains why you act like that. RusAcis got the exact same strategy, speaking bad of me, saying they got unique fixes (you speak about I break things, they break and recode things 4 times sometimes, btw), but successfully reselling latest revision with poorly executed stuff. "aCis is good, Tryskell is ok, but I solve all issues in extreme low time so I can piss over him" card ? Mmmmhhhh.   Our conversation ends here if you want, I don't force ppl to speak with me if they don't want - hopefully, people would understand I'm not the arrogant one and the one who doesn't want to talk, or even collaborate. :). I understand you got your own project and got no will to improve aCis.   NOTE : I'm extremely happy for your call of ExShowServerPrimitive with getValidGeoLocation, extremely impressive. Arrogant, no. Sarcastic ? Maybe.   Good night everyone.
    • Hi. @GX-Ext, svn does not work. is there anywhere else where we can get source code? Thank you so much.
  • 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..

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