Nobless NPC
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 76
- Joined: Thu Oct 07, 2010 9:03 pm
Nobless NPC
Hey guys, can someone give me an NPC that does me noble for a Caradine letter?
Thanks
Thanks
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Nobless NPC
Create the default htm for the npc 700001 and done:
Code: Select all
### Eclipse Workspace Patch 1.0#P datapack_developmentIndex: data/scripts/custom/FreeNoble/FreeNoble.java===================================================================--- data/scripts/custom/FreeNoble/FreeNoble.java (revision 0)+++ data/scripts/custom/FreeNoble/FreeNoble.java (revision 0)@@ -0,0 +1,78 @@+package custom.FreeNoble;++import com.l2jserver.gameserver.instancemanager.QuestManager;+import com.l2jserver.gameserver.model.actor.L2Npc;+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;+import com.l2jserver.gameserver.model.quest.Quest;+import com.l2jserver.gameserver.model.quest.QuestState;++/**+ * @author LasTravel+ */+ +public class FreeNoble extends Quest+{+ private static final int NPCID = 700001;+ private static final int LevelMin = 80;+ private static final int ItemId = 7678; //Caradine's Letter + private static final int Amount = 1;+ + private static final String qn = "FreeNoble";+ + public FreeNoble(int questId, String name, String descr)+ {+ super(questId, name, descr);+ addStartNpc(NPCID);+ addTalkId(NPCID);+ }+ + @Override+ public String onTalk(L2Npc npc, L2PcInstance player)+ {+ String htmltext ="";+ QuestState st = player.getQuestState(getName());+ if (st == null)+ {+ Quest q = QuestManager.getInstance().getQuest(getName());+ st = q.newQuestState(player);+ }+ if (npc.getNpcId() == NPCID)+ htmltext = "1.htm";+ return htmltext;+ }+ + private boolean CheckCondition(L2PcInstance player)+ {+ if (player == null)+ return false;+ + else if (player.isHero() || player.isNoble())+ return false;+ else if (player.getLevel() < LevelMin)+ return false;+ else if (!(player.getQuestState(qn).getQuestItemsCount(ItemId) >= Amount))+ return false;+ else+ return true;+ }+ + @Override+ public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)+ {+ //Give Noble Status+ if (event.equalsIgnoreCase("getnoble"))+ if (CheckCondition(player))+ { + player.getQuestState(qn).takeItems(ItemId, Amount);+ player.setNoble(true);+ player.sendMessage("Congrats you are noble now!");+ } + else+ player.sendMessage("You can't use this, go away!");+ return "";+ }+ + public static void main(String[] args)+ {+ new FreeNoble(-1, qn, "custom");+ }+}Index: data/scripts/custom/FreeNoble/1.htm===================================================================--- data/scripts/custom/FreeNoble/1.htm (revision 0)+++ data/scripts/custom/FreeNoble/1.htm (revision 0)@@ -0,0 +1,5 @@+<html>+<body>+<a action="bypass -h Quest FreeNoble getnoble">TEST</a><br>+</body>+</html>\ No newline at end of file
-
- Posts: 76
- Joined: Thu Oct 07, 2010 9:03 pm
Re: Nobless NPC
Should i do "Apply patch" and copy from clipboard?LasTravel wrote:Create the default htm for the npc 700001 and done:
Code: Select all
### Eclipse Workspace Patch 1.0#P datapack_developmentIndex: data/scripts/custom/FreeNoble/FreeNoble.java===================================================================--- data/scripts/custom/FreeNoble/FreeNoble.java (revision 0)+++ data/scripts/custom/FreeNoble/FreeNoble.java (revision 0)@@ -0,0 +1,78 @@+package custom.FreeNoble;++import com.l2jserver.gameserver.instancemanager.QuestManager;+import com.l2jserver.gameserver.model.actor.L2Npc;+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;+import com.l2jserver.gameserver.model.quest.Quest;+import com.l2jserver.gameserver.model.quest.QuestState;++/**+ * @author LasTravel+ */+ +public class FreeNoble extends Quest+{+ private static final int NPCID = 700001;+ private static final int LevelMin = 80;+ private static final int ItemId = 7678; //Caradine's Letter + private static final int Amount = 1;+ + private static final String qn = "FreeNoble";+ + public FreeNoble(int questId, String name, String descr)+ {+ super(questId, name, descr);+ addStartNpc(NPCID);+ addTalkId(NPCID);+ }+ + @Override+ public String onTalk(L2Npc npc, L2PcInstance player)+ {+ String htmltext ="";+ QuestState st = player.getQuestState(getName());+ if (st == null)+ {+ Quest q = QuestManager.getInstance().getQuest(getName());+ st = q.newQuestState(player);+ }+ if (npc.getNpcId() == NPCID)+ htmltext = "1.htm";+ return htmltext;+ }+ + private boolean CheckCondition(L2PcInstance player)+ {+ if (player == null)+ return false;+ + else if (player.isHero() || player.isNoble())+ return false;+ else if (player.getLevel() < LevelMin)+ return false;+ else if (!(player.getQuestState(qn).getQuestItemsCount(ItemId) >= Amount))+ return false;+ else+ return true;+ }+ + @Override+ public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)+ {+ //Give Noble Status+ if (event.equalsIgnoreCase("getnoble"))+ if (CheckCondition(player))+ { + player.getQuestState(qn).takeItems(ItemId, Amount);+ player.setNoble(true);+ player.sendMessage("Congrats you are noble now!");+ } + else+ player.sendMessage("You can't use this, go away!");+ return "";+ }+ + public static void main(String[] args)+ {+ new FreeNoble(-1, qn, "custom");+ }+}Index: data/scripts/custom/FreeNoble/1.htm===================================================================--- data/scripts/custom/FreeNoble/1.htm (revision 0)+++ data/scripts/custom/FreeNoble/1.htm (revision 0)@@ -0,0 +1,5 @@+<html>+<body>+<a action="bypass -h Quest FreeNoble getnoble">TEST</a><br>+</body>+</html>\ No newline at end of file
if yes, to gameserver right?
- Zoey76
- L2j Inner Circle
- Posts: 7005
- Joined: Tue Aug 11, 2009 3:36 am
Re: Nobless NPC
# ### Eclipse Workspace Patch 1.0
# #P datapack_development
Apply to datapack, and yes, you can copy the patch and use from clipboard option.
Be careful when you copy the patch from forum, check you don't add extra lines.
# #P datapack_development
Apply to datapack, and yes, you can copy the patch and use from clipboard option.
Be careful when you copy the patch from forum, check you don't add extra lines.
Powered by Eclipse 4.30 | Eclipse Temurin 21 | MariaDB 11.3.2 | L2J Server 2.6.3.0 - High Five
Join our Discord!
Join our Discord!
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Nobless NPC
Don't forget add it to scripts.cfg
-
- Posts: 76
- Joined: Thu Oct 07, 2010 9:03 pm
Re: Nobless NPC
Hey.LasTravel wrote:Don't forget add it to scripts.cfg
If i understood right, i need to open a directory at gameserver\data\scripts\custom
named freenoble, put there the 1.htm file,
open scripts.cfg
write there:
custom/freenoble/1.htm
double click at caradine letter in-game and im noble ?
- LasTravel
- Posts: 888
- Joined: Tue Jan 05, 2010 12:08 am
- Location: Spain
Re: Nobless NPC
Why you do one request if you don't know what do with it?returNix wrote:Hey.LasTravel wrote:Don't forget add it to scripts.cfg
If i understood right, i need to open a directory at gameserver\data\scripts\custom
named freenoble, put there the 1.htm file,
open scripts.cfg
write there:
custom/freenoble/1.htm
double click at caradine letter in-game and im noble ?
1- Copy the folder FreeNoble to data/scripts/custom/, then open scripts.cfg and add custom/FreeNoble/FreeNoble.java
2- Create one npc with id 700001
3- Create the default html for the npc 700001 and put it on data/html/default
Add this link on the default html
Code: Select all
<a action="bypass -h npc_%objectId%_Quest FreeNoble">FreeNoble</a><br>
-
- Posts: 76
- Joined: Thu Oct 07, 2010 9:03 pm
Re: Nobless NPC
The allowed range is from 1 to 65553 :XLasTravel wrote:Why you do one request if you don't know what do with it?returNix wrote:Hey.LasTravel wrote:Don't forget add it to scripts.cfg
If i understood right, i need to open a directory at gameserver\data\scripts\custom
named freenoble, put there the 1.htm file,
open scripts.cfg
write there:
custom/freenoble/1.htm
double click at caradine letter in-game and im noble ?
1- Copy the folder FreeNoble to data/scripts/custom/, then open scripts.cfg and add custom/FreeNoble/FreeNoble.java
2- Create one npc with id 700001
3- Create the default html for the npc 700001 and put it on data/html/default
Add this link on the default html
Code: Select all
<a action="bypass -h npc_%objectId%_Quest FreeNoble">FreeNoble</a><br>
I will try other.
-
- Posts: 76
- Joined: Thu Oct 07, 2010 9:03 pm
Re: Nobless NPC
The allowed range is from 1 to 65553 :XLasTravel wrote:Why you do one request if you don't know what do with it?returNix wrote:Hey.LasTravel wrote:Don't forget add it to scripts.cfg
If i understood right, i need to open a directory at gameserver\data\scripts\custom
named freenoble, put there the 1.htm file,
open scripts.cfg
write there:
custom/freenoble/1.htm
double click at caradine letter in-game and im noble ?
1- Copy the folder FreeNoble to data/scripts/custom/, then open scripts.cfg and add custom/FreeNoble/FreeNoble.java
2- Create one npc with id 700001
3- Create the default html for the npc 700001 and put it on data/html/default
Add this link on the default html
Code: Select all
<a action="bypass -h npc_%objectId%_Quest FreeNoble">FreeNoble</a><br>
I will try other.
Ok i changed npc ID and all, I needed to add them 1.htm to make this work in quest folder, and its wroking.
THANKS ALOT FOR EVERONE WHO HELPED , even if you were pretty angry about me
Thanks. now i learned more thing