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. 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • I'll stop playing, so I'll sell my (DC) Donator Coins  for cheap. Ask around; I have plenty. Here's the price list. Contact phone: +56 9 5429 4317    
    • Hi, im selling adena/items reborn signature C4   500kk  - 1kk = $2,90 ic set        pm here or discord  _flamber 
    • Want more engagement, reach, and traffic on Discord? Automate promotion of your server, members, reactions, and messages in minutes — no bots, no hassle, no overpayments. SocNet’s SMM Panel — fast launch, fair prices, real results. Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, SoundCloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, Trustpilot, Apple Music, TripAdvisor, Snapchat, and more digital services. Followers, likes, views, reposts, plays, viewers, reactions, comments. Get $1 bonus for your first trial order! Just open a ticket with the subject “Get Trial Bonus” on our website (Support) ➡ Go to SMM Panel (clickable) or contact our bot support How to order: ➡ SMM Panel: Click ➡ SMM Panel directly in our Telegram bot: Click (Menu ➡ SMM Panel) Our Digital Goods Store: ➡ Online Store: Click ➡ Telegram Bot: Click Regular customers get extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Get wholesale consultations — Discuss partnership deals (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your source for digital goods and premium subscriptions
    • Price and Assortment Update: List of newly added products ➡ WhatsApp Real Account | USA (+1 phone) | High Quality Accounts | Account with age from a few days | QR-Code or Phone-Code | Price from: 3.5$ ➡ Facebook Old Italy account | Created in 2022 | FanPage created in 2022 | Advertising account created in 2022 | Farm 30 days | Friends 100+ | Mail included+active 2FA | Price from: 29$ ➡ OLD Instagram Accounts | Age: 2023-2024 | QUALITY Premium Autoregs (API FRESH) | Registered via SMS | Format: login | password | cookies (for InstAccountsManager) | IAM format | Price from: 0.45$ ➡ ChatGPT Plus Team subscription to your Own Email For 1 Month | Price from: 5$ ➡ Google Voice Accounts (GMAIL US NEW) | Age/Year: Random 2024 | Phone Verified: Yes | Price from: 13$ Prices have been reduced for the following products ➡ Discord Nitro Classic (Basic) GIFT | 1/12 MONTHS | NO NEED YOUR LOGIN AND PASSWORD FROM ACCOUNT | Warranty on full time of subscription | Price from: 3.15$ ➡ Discord Nitro FULL | 1/12 MONTHS | NO NEED YOUR LOGIN AND PASSWORD FROM ACCOUNT | Warranty on full time of subscription | Price from: 6.8$ ➡ Spotify Premium Individual Personal Plan for 1 month ON YOUR ACCOUNT | Available in all countries | Price from: 2.49$ ➡ Spotify Premium Family Account for 1 month ON YOUR ACCOUNT | Working in any countries | Price from: 3.75$ ➡ Youtube Premium Music Personal Account ON YOUR ACCOUNT | 1 month | YouTube without ads | Price from: 3.75$ ➡ Youtube Premium Music Family Account ON YOUR ACCOUNT | 1 month | YouTube without ads | Price from: 4.35$ ➡ Telegram Premium subscription for 1 month to your account | Authorization in your account is required (via TDATA or phone number) | Price from: 6$ ➡ Telegram Premium subscription for 3 months on your account | No authorization required in your account | Guarantee for the entire subscription period | Price from: 17$ ➡ Telegram Premium subscription for 6 months on your account | No authorization required in your account | Guarantee for the entire subscription period | Price from: 22$ ➡ Telegram Premium subscription for 12 months on your account | No authorization required in your account | Guarantee for the entire subscription period | Price from: 37$ ➡ Netflix Premium 1 month on your personal account for any country, renewable after expiration | Price from: 10$ ➡ Old Twitter Accounts 2010-2020 with real followers 1,000–20,000+ (followers on your choice) | Email included, Password and Token access | Refill: 30 days | Price from: 10$ And many other digital products! Full range of our online store: ➡ Accounts: Telegram, Facebook, Reddit, Twitter (X), Instagram, YouTube, TikTok, Discord, VK, LinkedIn, GitHub, Snapchat, Gmail, emails (Outlook, Firstmail, Rambler, Onet, Gazeta, GMX, Yahoo, Proton, Web.de), Google Voice, Google Ads ➡ Premium Subscriptions: Telegram Premium, Twitter Premium X, YouTube Premium, Spotify Premium, Netflix Premium, Discord Nitro, ChatGPT Plus/PRO, XBOX Game Pass ➡ Additional services: Telegram Stars, proxies (IPv4, IPv6, ISP, Mobile), VPN (Outline, WireGuard, others), VDS/RDP servers Promo code: AUGUST2025 (10% Discount) Payment: bank cards · cryptocurrency · other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Regular customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale consultation — Partnership agreements (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — digital goods and premium subscriptions store
    • write me https://t.me/lin2web
  • Topics

×
×
  • Create New...

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