help with hellbound script

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
bigbro
Posts: 215
Joined: Mon Apr 30, 2007 10:00 pm
Location: Bulgaria

help with hellbound script

Post by bigbro »

Code: Select all

 Index: data/scripts/ai/individual/Leodas.java===================================================================--- data/scripts/ai/individual/Leodas.java	(revision 0)+++ data/scripts/ai/individual/Leodas.java	(revision 0)@@ -0,0 +1,119 @@+/* This program is free software: you can redistribute it and/or modify it under+ * the terms of the GNU General Public License as published by the Free Software+ * Foundation, either version 3 of the License, or (at your option) any later+ * version.+ *+ * This program is distributed in the hope that it will be useful, but WITHOUT+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more+ * details.+ *+ * You should have received a copy of the GNU General Public License along with+ * this program. If not, see <http://www.gnu.org/licenses/>.+ */+package ai.individual;++import ai.group_template.L2AttackableAIScript;++import com.l2jserver.gameserver.datatables.DoorTable;+import com.l2jserver.gameserver.instancemanager.HellboundManager;+import com.l2jserver.gameserver.model.L2Skill;+import com.l2jserver.gameserver.model.actor.L2Npc;+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;+import com.l2jserver.gameserver.network.serverpackets.CreatureSay;++/**+ * @author theOne+ */+public class Leodas extends L2AttackableAIScript+{+	private static final int leodas = 22448;+	private static final int traitor = 32364;++	private static final int[] doors = {+			19250003, 19250004+	};++	private boolean leodasOnAttack = false;++	public Leodas(int questId, String name, String descr)+	{+		super(questId, name, descr);+		addAttackId(leodas);+		addKillId(leodas);+		addTalkId(traitor);+		addFirstTalkId(traitor);+		addStartNpc(traitor);+	}++	@Override+	public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isPet, L2Skill skill)+	{+		for (int i : doors)+			DoorTable.getInstance().getDoor(i).closeMe();++		return super.onAttack(npc, player, damage, isPet);+	}++	@Override+	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)+	{+		for (int i : doors)+		{+			DoorTable.getInstance().getDoor(i).openMe();+			DoorTable.getInstance().getDoor(i).onOpen();+		}++		HellboundManager.getInstance().increaseTrust(-1000); //value needs to be updated+		leodasOnAttack = false;++		return super.onKill(npc, player, isPet);+	}++	@Override+	public String onFirstTalk(L2Npc npc, L2PcInstance player)+	{+		if (leodasOnAttack)+			return "<html><body>Hellbound Traitor:<br>Leodas already attacked!</body></html>";++		int hellboundLevel = HellboundManager.getInstance().getLevel();+		if (hellboundLevel < 5 && hellboundLevel > 6)+			return null;++		npc.showChatWindow(player);++		return super.onFirstTalk(npc, player);+	}++	@Override+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)+	{+		String htmltext = "";+		if (event.equalsIgnoreCase("meetLeodas"))+		{+			long marksCount = player.getInventory().getItemByItemId(9676).getCount();+			if (marksCount == 0)+				htmltext = "<html><body>Hellbound Traitor:<br>I need <font color=\"LEVEL\">10 Mark of Betrayal</font>. But you did not bring one! Do not attempt to deceive me - bring to me that I was requested!</body></html>";+			else if (marksCount >= 1 && marksCount < 10)+				htmltext = "<html><body>Hellbound Traitor:<br>Yeah! You have a <font color=\"LEVEL\">Mark of Betrayal</font>. Unfortunately, I can in no way help you, if you do not bring to me 10 Marks. Bring all Marks to me, and I will immediately open door.</body></html>";+			else if (marksCount >= 10)+			{+				player.destroyItemByItemId("item", 9676, 10, player, true);+				npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), "Brothers! This stranger wants to kill our Commander!!!"));+				startQuestTimer("Leodas", 3000, npc, null, false);+				leodasOnAttack = true;+				for (int i : doors)+					DoorTable.getInstance().getDoor(i).openMe();+			}+		}+		else if (event.equalsIgnoreCase("Leodas"))+			HellboundManager.getInstance().addSpawn(leodas, -27807, 252740, -3520, 0, 0);++		return htmltext;+	}++	public static void main(String[] args)+	{+		new Leodas(-1, "Leodas", "ai");+	}+} 
and recieve error in console

-------
1. ERROR in /Leodas.java (at line 67)
HellboundManager.getInstance().increaseTrust(-1000);

I think it is missing script from core? Can you help with advice?
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: help with hellbound script

Post by jurchiks »

do you even have the HellboundManager?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
LasTravel
Posts: 888
Joined: Tue Jan 05, 2010 12:08 am
Location: Spain

Re: help with hellbound script

Post by LasTravel »

HellboundManager exists on the actual core, but not the trust points part.
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: help with hellbound script

Post by hope »

HellboundManager.getInstance().increaseTrust(-1000);
HellboundManager.getInstance();

try remoing the trust part
User avatar
Shaka
Posts: 277
Joined: Wed Jun 13, 2007 7:43 pm
Location: VENEZUELA
Contact:

Re: help with hellbound script

Post by Shaka »

not remove the trust point, that's correct.
first you have all the hellbound engine to work, but even at L2J not fully implemented.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: help with hellbound script

Post by jurchiks »

hope wrote:HellboundManager.getInstance().increaseTrust(-1000);
HellboundManager.getInstance();

try remoing the trust part
wtf dude?
do you even know what you're talking about?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
bigbro
Posts: 215
Joined: Mon Apr 30, 2007 10:00 pm
Location: Bulgaria

Re: help with hellbound script

Post by bigbro »

thanks for help guys.. I miss the core changes...
viewtopic.php?f=69&t=18034
Post Reply