Jump to content
  • 0

[HELP] Augment shop for interlude


Question

Posted

063dcc8a5bcfdefce4912b9963fd87b7888.png

 

 

.../L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java.error.log

Error on: /lproject/L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java.error.log
Line: -1 - Column: -1

no main method in custom.AugmentShop.AugmentShop

 

.../L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java:

package custom.AugmentShop;

import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.gameserver.model.quest.QuestState;
import com.l2jfrozen.gameserver.model.Inventory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import com.l2jfrozen.util.database.L2DatabaseFactory;
import java.util.logging.Level;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;

/**
* 
* @author adapted by Samar 2011 RUSSIA
* 
*/
public class AugmentShop extends Quest
{
private final static int ITEM_ID = 57;
private final static int ITEM_COUNT = 1000000;
private final static String qn = "AugmentShop";
private final static int NPC = 91000;

public AugmentShop(int questId, String name, String descr) 
{
	super(questId, name, descr);
	addFirstTalkId(NPC);
	addStartNpc(NPC);
	addTalkId(NPC);
}

@Override
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";

	if (event.equalsIgnoreCase("active"))
	{
		htmltext = "active.htm";
	}

	else if (event.equalsIgnoreCase("passive"))
	{
		htmltext = "passive.htm";
	}

	else if (event.equalsIgnoreCase("chance"))
	{
		htmltext = "chance.htm";
	}

	else
	{

		updateAugment(player, Integer.parseInt(event.substring(0,5)), Integer.parseInt(event.substring(6,10)), Integer.parseInt(event.substring(11,13)));
	}


	return htmltext;
}

@Override
public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";
	QuestState qs = player.getQuestState(qn);
	if (qs == null)
		qs = newQuestState(player);
	htmltext = "main.htm";
	return htmltext;
}

public static void main(String[] args)
{
	new AugmentShop(-1, qn, "AugmentShop");
}


private static void updateAugment(L2PcInstance player, int attributes, int skill, int level)
{
	L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null)

	{
		player.sendMessage("You have to equip a weapon.");
		return;
	}

	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented())
	{
		player.sendMessage("The weapon is already augmented.");
		return;
	}

	if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT)
	{
		player.sendMessage("You dont have enough item.");
		return;
	}

	Connection con = null;
	try
	{
		player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true);
		con = L2DatabaseFactory.getInstance().getConnection();
		PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)");
		statement.setInt(1, item.getObjectId());

			statement.setInt(2, attributes*65536+1);
			statement.setInt(3, skill);
			statement.setInt(4, level);

		statement.executeUpdate();
		player.sendMessage("Succesfully augmented. You have to relog now.");
		statement.close();

	}
	catch (Exception e)
	{
		_log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e);
	}
	finally
	{
	try
	{

		/*L2DatabaseFactory.close(con);*/
		con.close();
		}
		catch (Exception e)
		{
		}
	}
}


}

 

Maybe someone can help me to solve this error?

13 answers to this question

Recommended Posts

  • 0
Posted

Try to remove

package custom.AugmentShop;

and try to put

import sys

btw i think imports are not written by this way

Ps basic imports are

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

  • 0
Posted

This is java

check if you have all the { closed

try to move the main function to the end of the class

blind ?

look at photo -> import scripts

  • 0
Posted

Try to remove

package custom.AugmentShop;

and try to put

import sys

btw i think imports are not written by this way

Ps basic imports are

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

 

 

 

 

 

 

Still get error

===================================================================-[ Scripts ]
start loading Individual AI
start loading Group template AI
Nobless Trader (66666) Enabled...
Clan Manager (66667) Enabled...
----------
1. ERROR in /AugmentShop.java (at line 1)
import sys
       ^^^
The import sys cannot be resolved
----------
2. ERROR in /AugmentShop.java (at line 2)
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
^^^^
Syntax error on token "from", . expected
----------
3. ERROR in /AugmentShop.java (at line 2)
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
                                          ^^^^^^^^
Syntax error on token "instance", ; expected after this token
----------
4. ERROR in /AugmentShop.java (at line 2)
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
                                                          ^^^^^^^^^^^^^
The import L2NpcInstance cannot be resolved
----------
5. ERROR in /AugmentShop.java (at line 3)
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
^^^^
Syntax error on token "from", . expected
----------
6. ERROR in /AugmentShop.java (at line 3)
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
                                          ^^^^^^^^
Syntax error on token "instance", ; expected after this token
----------
7. ERROR in /AugmentShop.java (at line 3)
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
                                                          ^^^^^^^^^^^^
The import L2PcInstance cannot be resolved
----------
8. ERROR in /AugmentShop.java (at line 4)
from com.l2jfrozen.gameserver.model.quest import Quest
^^^^
Syntax error on token "from", . expected
----------
9. ERROR in /AugmentShop.java (at line 4)
from com.l2jfrozen.gameserver.model.quest import Quest
                                    ^^^^^
Syntax error on token "quest", ; expected after this token
----------
10. ERROR in /AugmentShop.java (at line 4)
from com.l2jfrozen.gameserver.model.quest import Quest
                                                 ^^^^^
The import Quest cannot be resolved
----------
11. ERROR in /AugmentShop.java (at line 5)
from com.l2jfrozen.gameserver.model.quest import QuestState
^^^^
Syntax error on token "from", . expected
----------
12. ERROR in /AugmentShop.java (at line 5)
from com.l2jfrozen.gameserver.model.quest import QuestState
                                    ^^^^^
Syntax error on token "quest", ; expected after this token
----------
13. ERROR in /AugmentShop.java (at line 5)
from com.l2jfrozen.gameserver.model.quest import QuestState
                                                 ^^^^^^^^^^
The import QuestState cannot be resolved
----------
14. ERROR in /AugmentShop.java (at line 6)
from com.l2jfrozen.gameserver.model import Inventory
^^^^
Syntax error on token "from", . expected
----------
15. ERROR in /AugmentShop.java (at line 6)
from com.l2jfrozen.gameserver.model import Inventory
                              ^^^^^
Syntax error on token "model", ; expected after this token
----------
16. ERROR in /AugmentShop.java (at line 6)
from com.l2jfrozen.gameserver.model import Inventory
                                           ^^^^^^^^^
The import Inventory cannot be resolved
----------
17. ERROR in /AugmentShop.java (at line 7)
from java.sql import Connection
^^^^
Syntax error on token "from", . expected
----------
18. ERROR in /AugmentShop.java (at line 7)
from java.sql import Connection
          ^^^
Syntax error on token "sql", ; expected after this token
----------
19. ERROR in /AugmentShop.java (at line 7)
from java.sql import Connection
                     ^^^^^^^^^^
The import Connection cannot be resolved
----------
20. ERROR in /AugmentShop.java (at line 8)
from java.sql import PreparedStatement
^^^^
Syntax error on token "from", . expected
----------
21. ERROR in /AugmentShop.java (at line 8)
from java.sql import PreparedStatement
          ^^^
Syntax error on token "sql", ; expected after this token
----------
22. ERROR in /AugmentShop.java (at line 8)
from java.sql import PreparedStatement
                     ^^^^^^^^^^^^^^^^^
The import PreparedStatement cannot be resolved
----------
23. ERROR in /AugmentShop.java (at line 9)
from com.l2jfrozen.util.database import L2DatabaseFactory
^^^^
Syntax error on token "from", . expected
----------
24. ERROR in /AugmentShop.java (at line 9)
from com.l2jfrozen.util.database import L2DatabaseFactory
                        ^^^^^^^^
Syntax error on token "database", ; expected after this token
----------
25. ERROR in /AugmentShop.java (at line 9)
from com.l2jfrozen.util.database import L2DatabaseFactory
                                        ^^^^^^^^^^^^^^^^^
The import L2DatabaseFactory cannot be resolved
----------
26. ERROR in /AugmentShop.java (at line 10)
from java.util.logging import Level
^^^^
Syntax error on token "from", . expected
----------
27. ERROR in /AugmentShop.java (at line 10)
from java.util.logging import Level
               ^^^^^^^
Syntax error on token "logging", ; expected after this token
----------
28. ERROR in /AugmentShop.java (at line 10)
from java.util.logging import Level
                              ^^^^^
The import Level cannot be resolved
----------
29. ERROR in /AugmentShop.java (at line 11)
from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance
^^^^
Syntax error on token "from", . expected
----------
30. ERROR in /AugmentShop.java (at line 11)
from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance
                                          ^^^^^^^^
Syntax error on token "instance", ; expected after this token
----------
31. ERROR in /AugmentShop.java (at line 11)
from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance
                                                          ^^^^^^^^^^^^^^
Syntax error on token "L2ItemInstance", ; expected after this token
----------
32. ERROR in /AugmentShop.java (at line 11)
from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance
                                                          ^^^^^^^^^^^^^^
The import L2ItemInstance cannot be resolved
----------
33. ERROR in /AugmentShop.java (at line 18)
public class AugmentShop extends Quest
                                 ^^^^^
Quest cannot be resolved to a type
----------
34. ERROR in /AugmentShop.java (at line 28)
addFirstTalkId(NPC);
^^^^^^^^^^^^^^
The method addFirstTalkId(int) is undefined for the type AugmentShop
----------
35. ERROR in /AugmentShop.java (at line 29)
addStartNpc(NPC);
^^^^^^^^^^^
The method addStartNpc(int) is undefined for the type AugmentShop
----------
36. ERROR in /AugmentShop.java (at line 30)
addTalkId(NPC);
^^^^^^^^^
The method addTalkId(int) is undefined for the type AugmentShop
----------
37. ERROR in /AugmentShop.java (at line 34)
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
                                       ^^^^^^^^^^^^^
L2NpcInstance cannot be resolved to a type
----------
38. ERROR in /AugmentShop.java (at line 34)
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
                                                          ^^^^^^^^^^^^
L2PcInstance cannot be resolved to a type
----------
39. ERROR in /AugmentShop.java (at line 64)
public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
                          ^^^^^^^^^^^^^
L2NpcInstance cannot be resolved to a type
----------
40. ERROR in /AugmentShop.java (at line 64)
public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
                                             ^^^^^^^^^^^^
L2PcInstance cannot be resolved to a type
----------
41. ERROR in /AugmentShop.java (at line 67)
QuestState qs = player.getQuestState(qn);
^^^^^^^^^^
QuestState cannot be resolved to a type
----------
42. ERROR in /AugmentShop.java (at line 80)
private static void updateAugment(L2PcInstance player, int attributes, int skill, int level)
                                  ^^^^^^^^^^^^
L2PcInstance cannot be resolved to a type
----------
43. ERROR in /AugmentShop.java (at line 82)
L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
^^^^^^^^^^^^^^
L2ItemInstance cannot be resolved to a type
----------
44. ERROR in /AugmentShop.java (at line 82)
L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
                                                             ^^^^^^^^^
Inventory cannot be resolved to a variable
----------
45. ERROR in /AugmentShop.java (at line 83)
if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null)
                                           ^^^^^^^^^
Inventory cannot be resolved to a variable
----------
46. ERROR in /AugmentShop.java (at line 90)
if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented())
                                           ^^^^^^^^^
Inventory cannot be resolved to a variable
----------
47. ERROR in /AugmentShop.java (at line 102)
Connection con = null;
^^^^^^^^^^
Connection cannot be resolved to a type
----------
48. ERROR in /AugmentShop.java (at line 106)
con = L2DatabaseFactory.getInstance().getConnection();
      ^^^^^^^^^^^^^^^^^
L2DatabaseFactory cannot be resolved
----------
49. ERROR in /AugmentShop.java (at line 107)
PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)");
^^^^^^^^^^^^^^^^^
PreparedStatement cannot be resolved to a type
----------
50. ERROR in /AugmentShop.java (at line 121)
_log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e);
^^^^
_log cannot be resolved
----------
51. ERROR in /AugmentShop.java (at line 121)
_log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e);
         ^^^^^
Level cannot be resolved to a variable
----------
51 problems (51 errors)Syntax error on token "from", . expected
Syntax error on token "instance", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "instance", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "quest", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "quest", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "model", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "sql", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "sql", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "database", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "logging", ; expected after this token
Syntax error on token "from", . expected
Syntax error on token "instance", ; expected after this token
Syntax error on token "L2ItemInstance", ; expected after this token
Quest cannot be resolved to a type
The import sys cannot be resolved
The import L2NpcInstance cannot be resolved
The import L2PcInstance cannot be resolved
The import Quest cannot be resolved
The import QuestState cannot be resolved
The import Inventory cannot be resolved
The import Connection cannot be resolved
The import PreparedStatement cannot be resolved
The import L2DatabaseFactory cannot be resolved
The import Level cannot be resolved
The import L2ItemInstance cannot be resolved
L2NpcInstance cannot be resolved to a type
L2PcInstance cannot be resolved to a type
L2NpcInstance cannot be resolved to a type
L2PcInstance cannot be resolved to a type
L2PcInstance cannot be resolved to a type
The method addFirstTalkId(int) is undefined for the type AugmentShop
The method addStartNpc(int) is undefined for the type AugmentShop
The method addTalkId(int) is undefined for the type AugmentShop
QuestState cannot be resolved to a type
L2ItemInstance cannot be resolved to a type
Inventory cannot be resolved to a variable
Inventory cannot be resolved to a variable
Inventory cannot be resolved to a variable
Connection cannot be resolved to a type
L2DatabaseFactory cannot be resolved
PreparedStatement cannot be resolved to a type
_log cannot be resolved
Level cannot be resolved to a variable
Failed executing script: /lproject/L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java. See AugmentShop.java.error.log for details.
Replaced: SagasSuperclass with a new version
Compiled Scripts Cache is disabled.
[FeanorScriptEngine] Loading Packages ...
[FeanorScriptEngine] No Packages Loaded ...
===============================================================-[ Game Server ]

 

 

 

.../L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.quest import Quest
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model import Inventory
from java.sql import Connection
from java.sql import PreparedStatement
from com.l2jfrozen.util.database import L2DatabaseFactory
from java.util.logging import Level
from com.l2jfrozen.gameserver.model.actor.instance import L2ItemInstance

/**
* 
* @author adapted by Samar 2011 RUSSIA
* 
*/
public class AugmentShop extends Quest
{
private final static int ITEM_ID = 57;
private final static int ITEM_COUNT = 1000000;
private final static String qn = "AugmentShop";
private final static int NPC = 91000;

public AugmentShop(int questId, String name, String descr) 
{
	super(questId, name, descr);
	addFirstTalkId(NPC);
	addStartNpc(NPC);
	addTalkId(NPC);
}

@Override
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";

	if (event.equalsIgnoreCase("active"))
	{
		htmltext = "active.htm";
	}

	else if (event.equalsIgnoreCase("passive"))
	{
		htmltext = "passive.htm";
	}

	else if (event.equalsIgnoreCase("chance"))
	{
		htmltext = "chance.htm";
	}

	else
	{

		updateAugment(player, Integer.parseInt(event.substring(0,5)), Integer.parseInt(event.substring(6,10)), Integer.parseInt(event.substring(11,13)));
	}


	return htmltext;
}

@Override
public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";
	QuestState qs = player.getQuestState(qn);
	if (qs == null)
		qs = newQuestState(player);
	htmltext = "main.htm";
	return htmltext;
}

public static void main(String[] args)
{
	new AugmentShop(-1, qn, "AugmentShop");
}


private static void updateAugment(L2PcInstance player, int attributes, int skill, int level)
{
	L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null)

	{
		player.sendMessage("You have to equip a weapon.");
		return;
	}

	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented())
	{
		player.sendMessage("The weapon is already augmented.");
		return;
	}

	if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT)
	{
		player.sendMessage("You dont have enough item.");
		return;
	}

	Connection con = null;
	try
	{
		player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true);
		con = L2DatabaseFactory.getInstance().getConnection();
		PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)");
		statement.setInt(1, item.getObjectId());

			statement.setInt(2, attributes*65536+1);
			statement.setInt(3, skill);
			statement.setInt(4, level);

		statement.executeUpdate();
		player.sendMessage("Succesfully augmented. You have to relog now.");
		statement.close();

	}
	catch (Exception e)
	{
		_log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e);
	}
	finally
	{
	try
	{

		/*L2DatabaseFactory.close(con);*/
		con.close();
		}
		catch (Exception e)
		{
		}
	}
}


}

 

Got even more errors :/

  • 0
Posted

u trolling? or dont know that u can use java scripts?

u blind? or cant see ".java"?

anyways, gl with your problems

stupid? its in scripts, you must use the correct imports/methods

  • 0
Posted

import sys is for jython script, it's a java script.

 

B00D, try to keep a "friendly" chat, it's not like adenaman insulted you or is even wrong. And even if you were right, you don't have to insult ppl. You're the one "stupid" and "blind" in the story.

 

Revert all B00D stuff. If not already made, you should follow that link : it will allow you to see java errors in  java DP scripts. You will be able to get rid of errors really easily directly on Eclipse.

 

Script seems correct, I would say you got error with package.

 

package custom.AugmentShop;

  • 0
Posted

import sys is for jython script, it's a java script.

 

B00D, try to keep a "friendly" chat, it's not like adenaman insulted you or is even wrong. And even if you were right, you don't have to insult ppl. You're the one "stupid" and "blind" in the story.

 

Revert all B00D stuff. If not already made, you should follow that link : it will allow you to see java errors in  java DP scripts. You will be able to get rid of errors really easily directly on Eclipse.

 

Script seems correct, I would say you got error with package.

 

package custom.AugmentShop;

by the way he has this into scripts, its a jscript. If he put it into java and then into imports then , yes , it must be like this

  • 0
Posted

by the way he has this into scripts, its a jscript. If he put it into java and then into imports then , yes , it must be like this

 

I dunno since when you stopped L2J dev, but since around 2 or 3 years, a java engine has been implemented for scripts.

 

That's one of the reason on aCis (Interlude pack by the way, as Frozen) I decided to port all python scripts to java scripts (all quests, Ais, etc can be ported from python to java).

 

And yes, it's on -beep-ing scripts folder. You can have java on scripts.

 

Time to checkout latest versions ? :P.

 

PS : "scripts" folder was named "jscript" before. It means it has been reworked, because from the time of "jscript" only python was possible. That time is gone, since 2-3 years (perhaps even more).

  • 0
Posted

063dcc8a5bcfdefce4912b9963fd87b7888.png

 

 

.../L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java.error.log

Error on: /lproject/L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java.error.log
Line: -1 - Column: -1

no main method in custom.AugmentShop.AugmentShop

 

.../L2jFrozen_GameServer/gameserver/data/scripts/custom/AugmentShop/AugmentShop.java:

package custom.AugmentShop;

import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.gameserver.model.quest.QuestState;
import com.l2jfrozen.gameserver.model.Inventory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import com.l2jfrozen.util.database.L2DatabaseFactory;
import java.util.logging.Level;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;

/**
* 
* @author adapted by Samar 2011 RUSSIA
* 
*/
public class AugmentShop extends Quest
{
private final static int ITEM_ID = 57;
private final static int ITEM_COUNT = 1000000;
private final static String qn = "AugmentShop";
private final static int NPC = 91000;

public AugmentShop(int questId, String name, String descr) 
{
	super(questId, name, descr);
	addFirstTalkId(NPC);
	addStartNpc(NPC);
	addTalkId(NPC);
}

@Override
public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";

	if (event.equalsIgnoreCase("active"))
	{
		htmltext = "active.htm";
	}

	else if (event.equalsIgnoreCase("passive"))
	{
		htmltext = "passive.htm";
	}

	else if (event.equalsIgnoreCase("chance"))
	{
		htmltext = "chance.htm";
	}

	else
	{

		updateAugment(player, Integer.parseInt(event.substring(0,5)), Integer.parseInt(event.substring(6,10)), Integer.parseInt(event.substring(11,13)));
	}


	return htmltext;
}

@Override
public String onFirstTalk(L2NpcInstance npc, L2PcInstance player)
{
	String htmltext = "";
	QuestState qs = player.getQuestState(qn);
	if (qs == null)
		qs = newQuestState(player);
	htmltext = "main.htm";
	return htmltext;
}

public static void main(String[] args)
{
	new AugmentShop(-1, qn, "AugmentShop");
}


private static void updateAugment(L2PcInstance player, int attributes, int skill, int level)
{
	L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) == null)

	{
		player.sendMessage("You have to equip a weapon.");
		return;
	}

	if (player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND).isAugmented())
	{
		player.sendMessage("The weapon is already augmented.");
		return;
	}

	if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < ITEM_COUNT)
	{
		player.sendMessage("You dont have enough item.");
		return;
	}

	Connection con = null;
	try
	{
		player.destroyItemByItemId("Consume", ITEM_ID, ITEM_COUNT, player, true);
		con = L2DatabaseFactory.getInstance().getConnection();
		PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)");
		statement.setInt(1, item.getObjectId());

			statement.setInt(2, attributes*65536+1);
			statement.setInt(3, skill);
			statement.setInt(4, level);

		statement.executeUpdate();
		player.sendMessage("Succesfully augmented. You have to relog now.");
		statement.close();

	}
	catch (Exception e)
	{
		_log.log(Level.SEVERE, "Could not augment item: "+item.getObjectId()+" ", e);
	}
	finally
	{
	try
	{

		/*L2DatabaseFactory.close(con);*/
		con.close();
		}
		catch (Exception e)
		{
		}
	}
}


}

 

Maybe someone can help me to solve this error?

 

So okey everythings alright with imports, but why it writes "no main method in custom.AugmentShop.AugmentShop"? There is a main method

  • 0
Posted
2 hours ago, imcreator said:

I have same problem. No main method? Anyone solved this?

 

27 minutes ago, imcreator said:

I have same problem. No main method? Anyone solved this?

 

26 minutes ago, imcreator said:

up

 

lol with that spam. 

 

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

    • 🚀 L2JOne Website System — Features & Security Overview 📌 Overview The L2JOne Website System is a complete platform designed for Lineage 2 servers, providing account management, donation processing, game integration, automation tools, and advanced security protections.   Built with a focus on: Security Performance Automation Scalability Easy Administration 🎮 Player Features ✔ Account Registration Direct account creation from the website Game database integration Data validation Optional email verification Google reCAPTCHA protection ✔ Secure Login System Protected user sessions Automatic Session ID regeneration Session Fixation protection Secure logout ✔ Player Control Panel Ticket balance management Purchase history Transfer history Character selection Automatic item delivery ✔ Account Recovery Email-based recovery Temporary recovery tokens Automatic token expiration 💰 Donation System Supported Payment Gateways Mercado Pago PIX Credit Card Debit Card Stripe International credit cards PayPal Worldwide payments Binance Pay Cryptocurrency payments ⚡ Automated Credit Delivery Once a payment is confirmed: Gateway validates the transaction. Webhook signature is verified. Order is marked as completed. Credits are added to the player's balance. Player transfers credits to a character. Items are automatically delivered in-game. No manual intervention required. 🎁 Coupon System Percentage discounts Fixed value discounts Usage limits Expiration dates Minimum purchase requirements 🎟 Ticket System Internal virtual currency Item conversion system Administrative adjustments Full transaction history Balance management 📊 Administrative Dashboard Real-Time Statistics Total revenue Daily revenue New registrations Total purchases Pending payments Approved payments Reports Sales reports Financial reports Player activity reports Transfer history Interactive Charts Revenue growth Daily earnings Monthly earnings Visitors by country Payment distribution 🌍 Analytics System Visitor countries Browser statistics Operating systems Device tracking Access history 📰 News Management System Unlimited news posts Featured images HTML editor support Homepage highlights 🎥 Video & Streaming System Supports: YouTube Twitch Kick Custom stream embeds ⏳ Countdown System Launch countdown timer Configurable date and time Timezone support Homepage integration 📥 Download Center Fully configurable: Game Client Official Patch Mirror Downloads Torrent Downloads External Download Links 📱 Social Media Integration Discord Facebook Instagram Telegram YouTube 🔒 Security Layer CSRF Protection All forms include: Unique security tokens Mandatory validation Automatic expiration Protects against: Cross-Site Request Forgery (CSRF) Google reCAPTCHA Protection Integrated Google reCAPTCHA v3 Protects against: Bots Automated registrations Brute-force attacks Session Security Session ID regeneration HttpOnly cookies SameSite cookie protection Secure cookie support Protects against: Session hijacking Session fixation attacks Upload Protection Sensitive file types are blocked: .sql .sqlite .log .pem .key Directory Protection Direct access denied to: config/ private/ storage/ cli/ database/ Unauthorized access is blocked. Anti-Replay Protection Financial callbacks include: Signed timestamps Expiration windows One-time validation Protects against: Payment replay attacks Duplicate transaction processing Webhook Security HMAC signature validation Shared secret verification Mandatory request authentication Protects against: Fake payment notifications Fraudulent credit generation Duplicate Payment Prevention Built-in: Idempotency control Transaction reference validation Payment status verification Prevents: Double credits Repeated processing SQL Injection Protection Secure database layer using: PDO Prepared Statements Parameter Binding No unsafe SQL concatenation. XSS Protection Output sanitization through: HTML escaping Input filtering Protects against: Cross-Site Scripting (XSS) Session theft Licensing Protection Centralized licensing system with: Unique license key Unique secret key Remote validation Domain verification Heartbeat monitoring Anti-Cloning Protection Licenses are linked to: Authorized domain Unique credentials Central validation server Unauthorized domain usage can be automatically blocked. ⚙ Administrative Tools User Management Create accounts Edit accounts Suspend users Adjust balances Financial Management Approve transactions Cancel orders Financial reports Content Management News management Download management Video management Social media management Global Settings Rates configuration Countdown management Payment gateway settings License management 🚀 Technology Stack PHP 8+ MySQL 9+ / MariaDB 11+ Bootstrap 5.3.8 AdminLTE 4..0.2 Mercado Pago SDK Stripe SDK PayPal API Binance Pay API Google reCAPTCHA v3 PDO Secure Database Layer 🛡 Final Result The L2JOne Website System delivers a professional-grade solution for Lineage 2 servers, combining: ✅ Modern Administrative Dashboard ✅ Advanced Donation System ✅ Automatic In-Game Delivery ✅ Real-Time Statistics ✅ Centralized Licensing Platform ✅ Financial Fraud Protection ✅ SQL Injection Protection ✅ XSS Protection ✅ CSRF Protection ✅ Anti-Replay Security ✅ Anti-Cloning Protection A complete, secure, and scalable platform built for professional Lineage 2 server operations DEMO SITE: "My Site" - Lineage II I am currently studying programming in Trybe | Cursos de Inteligência Artificial e Tecnologia Price: 150 USDT Payment methods: Crypto using the Tron network or PayPal (you pay an administrative fee). You can choose to pay a monthly fee to get new features or stick with your current version with security updates! The maintenance fee is only 30 USDT per month. Customers currently using my website: http://www.l2shadowwars.com/                                                                                                        Panel Admin:            Database WebSIte     PANEL PLAYER     StartPack    
    • Fixed a lot of null crashes, damn vanganth 🤣 Added engine that you can create your custom quests Extender dungeon systen so u can create as many dungeons as you like       Possibility to create a server from scratch its possible just is the work + the license/month , many ask for the creation.. i can do everything u like, i can even implement UFOs to fly over gym so.. whatever your dream is i can be as close as possible!
    • Hello, it is someone here to help me to make multiskill on helios pack? ( Not stacksub ) i want. On Hi5 i have this config .   # When enabled, the following will be true: # All classes can learn all skills. # Skills of another class costs x2 SP to learn. # Skills of another race costs x2 SP to learn. # Skills of fighters/mages costs x3 SP to learn. # Default: False AltGameSkillLearn = True
    • Thank you Mobius, and thank you to everybody that has helped this project making it the easiest platform to work on even if new. GGZ
  • 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..