Events L2J 

Status
Not open for further replies.
For event Glittering medals:
1)Enable JBForth Engine
2)Ingame as GM type medals-start
 
Upvote 0
It's working for me.
Enable JBForth engine from C:\Server\l2j\gameserver\config\custom.properties file

end then in game as GM type medals-start
 
Upvote 0
Check when you start server if in the command window says that JBForth engine is enabled.
 
Upvote 0
You dont need jbforth to make a script work.

Here is an example of a xml that is zipped and added to the script folder
This will make the added drops, drop between the dates.
I didnt find out how to make the npc's trade with it, so I used a jscript for that part.
Code:
<Event ID="Christmas Event" Active="11 Nov 2005-24 Dec 2005">
	<Droplist>
		<AllDrop Items="5556-5557-5558-5559"
			Count="1,1,1,1"
			Chance="2%">
		</AllDrop>
	</Droplist>
	<Message 
		Type="OnJoin"
		Msg="Christmas Event:\nCollect all 4 Chritmas ornaments to recieve a gift!\n(Quest Item.. All monster's have a chance to drop.)">
	</Message>
	<Npc ID="12617-12618">
		<Condition>
			<Inventory Items="5556-5557-5558-5559" Count="1" Operation=">="></Inventory>
		</Condition>
		<Take>
			<Item Items="5556-5557-5558-5559" Count="1" Type="OfEach"></Item>
		</Take>
		<Give>
			<Item ItemID="5561" Count="1"></Item>
			<Item ItemID="2136" Count="5"></Item>
		</Give>
		<SystemMessage
			Msg="Congratulations. Receive your gift.">
		</SystemMessage>
	</Npc>
	<EventEnd>
		<Take From="AllPlayers">
			<Item ItemID="5556-5557-5558-5559"></Item>
		</Take>
	</EventEnd>
</Event>

the jscript:
Code:
print "importing custom data: 5007_santa"
import sys
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

class Quest (JQuest) :

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

 def onEvent (self,event,st) :
    htmltext = event

# Christmas
    if event == "1":
        if st.getQuestItemsCount(5556) >= 1 and st.getQuestItemsCount(5557) >= 1 and st.getQuestItemsCount(5558) >= 1 and st.getQuestItemsCount(5559) >= 1:
            st.takeItems(5556,1)
            st.takeItems(5557,1)
            st.takeItems(5558,1)
            st.takeItems(5559,1)		
            st.giveItems(5283,3)
            htmltext = "Merry Christmas."
	else:
             htmltext = "You do not have all four ornaments."

    if event == "0":
      htmltext = "Trade has been canceled."
    
    if htmltext != event:
      st.setState(COMPLETED)
      st.exitQuest(1)

    return htmltext

 def onTalk (Self,npc,st):

   npcId = npc.getNpcId()
   htmltext = "<html><head><body>I have nothing to say to you.</body></html>"
   st.setState(STARTED)
   return "1.htm"

QUEST       = Quest(5007,"5007_santa","custom")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(12617)
QUEST.addStartNpc(12618)

STARTED.addTalkId(12617)
STARTED.addTalkId(12618)

and html:
Code:
<html>
<body>
<font color="LEVEL">So you got them for me?</font>
<table width=270>
<tr>
<td width=90> </td>
<td width=90><button value="OK" action="bypass -h Quest 5007_santa 1" width=60 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td width=90><button value="Cancel" action="bypass -h Quest 5007_santa 1 0" width=60 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
</tr>
</table>
<br>
</body>
</html>

Then you add code to the quest in the npc's html folder, default if it is L2Npc in the database.
 
Upvote 0
Status
Not open for further replies.
Back