Pārlūkot izejas kodu

BETA: Airship controller improvements:
* Fixed bug when on server startup airship wasn't set on dock.
* When reloading it wont spawn multiple airships.

Rumen Nikiforov 12 gadi atpakaļ
vecāks
revīzija
8968b0cd59

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/vehicles/AirShipGludioGracia/32607.htm

@@ -1,6 +1,6 @@
 <html><body>Airship Controller:<br>
 You see a floating piece of stone filled with a mysterious power. The green light is flashing, so there doesn't appear to be anything wrong with its function.<br>
 Using this should allow you to board the Airship headed for the continent of Gracia.<br>
-<a action="bypass -h Quest AirShipGludioGracia">Board the Airship.</a><br>
+<a action="bypass -h Quest AirShipGludioGracia board">Board the Airship.</a><br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a>
 </body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/vehicles/AirShipGludioGracia/32609.htm

@@ -1,6 +1,6 @@
 <html><body>Airship Controller:<br>
 You see a floating piece of stone filled with a mysterious power. The green light is flashing, so there doesn't appear to be anything wrong with its function.<br>
 Using this should allow you to board the Airship headed for the continent of Gracia.<br>
-<a action="bypass -h Quest AirShipGludioGracia">Board the Airship.</a><br>
+<a action="bypass -h Quest AirShipGludioGracia board">Board the Airship.</a><br>
 <a action="bypass -h npc_%objectId%_Quest">Quest</a>
 </body></html>

+ 20 - 7
L2J_DataPack_BETA/dist/game/data/scripts/vehicles/AirShipGludioGracia/AirShipGludioGracia.java

@@ -164,28 +164,41 @@ public class AirShipGludioGracia extends Quest implements Runnable
 			return null;
 		}
 		else if (_ship.isInDock() && _ship.isInsideRadius(player, 600, true, false))
+		{
 			_ship.addPassenger(player);
+		}
 		
 		return null;
 	}
 	
 	@Override
 	public final String onFirstTalk(L2Npc npc, L2PcInstance player)
-	{		
+	{
 		return npc.getNpcId() + ".htm";
 	}
 	
-	public AirShipGludioGracia(int questId, String name, String descr)
+	@Override
+	public boolean unload(boolean removeFromList)
 	{
-		super(questId, name, descr);
-		for (int id : CONTROLLERS)
+		if (_ship != null)
 		{
-			addStartNpc(id);
-			addFirstTalkId(id);
-			addTalkId(id);
+			_ship.oustPlayers();
+			_ship.deleteMe();
 		}
+		return super.unload(removeFromList);
+	}
+	
+	public AirShipGludioGracia(int questId, String name, String descr)
+	{
+		super(questId, name, descr);
+		
+		addStartNpc(CONTROLLERS);
+		addFirstTalkId(CONTROLLERS);
+		addTalkId(CONTROLLERS);
+		
 		_ship = AirShipManager.getInstance().getNewAirShip(-149378, 252552, 198, 33837);
 		_ship.setOustLoc(OUST_GLUDIO);
+		_ship.setInDock(GLUDIO_DOCK_ID);
 		_ship.registerEngine(this);
 		_ship.runEngine(60000);
 	}