Changed Potion giver to stand still while Potion recived message is up.
Changed Potion giver to stand still while Potion recived message is up.

--- a/res/Events.json
+++ b/res/Events.json
@@ -23,6 +23,7 @@
 		"questionTextID":1,
 		"yesEventChain":0,
 		"noEventChain":-1,
+		"nextEvent":-1,
 		"id":2
 	},
 	{
@@ -215,9 +216,8 @@
 		"id":32
 	},
 	{
-		"class":"com.dryerzinia.pokemon.event.PersonTextEvent",
+		"class":"com.dryerzinia.pokemon.event.TextEvent",
 		"textID":42,
-		"actorID":222,
 		"nextEvent":34,
 		"id":33
 	},
@@ -231,7 +231,7 @@
 			"number":1
 		},
 		"textID":43,
-		"nextEvent":-1,
+		"nextEvent":77,
 		"id":34
 	},
 	{
@@ -519,6 +519,26 @@
 		"actorID":274,
 		"nextEvent":-1,
 		"id":75
+	},
+	{
+		"class":"com.dryerzinia.pokemon.event.DisableEnableAnimationEvent",
+		"nextEvent":78,
+		"actorID":222,
+		"isEnabled":false,
+		"id":76
+	},
+	{
+		"class":"com.dryerzinia.pokemon.event.DisableEnableAnimationEvent",
+		"nextEvent":-1,
+		"actorID":222,
+		"isEnabled":true,
+		"id":77
+	},
+	{
+		"class":"com.dryerzinia.pokemon.event.FacePlayerEvent",
+		"nextEvent":33,
+		"actorID":222,
+		"id":78
 	}
 ]
 

--- /dev/null
+++ b/src/com/dryerzinia/pokemon/event/DisableEnableAnimationEvent.java
@@ -1,1 +1,32 @@
+package com.dryerzinia.pokemon.event;
 
+import java.util.HashMap;
+
+import com.dryerzinia.pokemon.obj.GameState;
+
+public class DisableEnableAnimationEvent extends Event {
+
+	protected boolean isEnabled = false;
+	protected int actorID;
+
+	public DisableEnableAnimationEvent(){}
+
+	@Override
+	public void fire() {
+
+		GameState.people.get(actorID).animationEnabled = isEnabled;
+		EventCore.fireEvent(nextEvent);
+
+	}
+
+	@Override
+	public void fromJSON(HashMap<String, Object> json) {
+
+		super.fromJSON(json);
+		isEnabled = ((Boolean) json.get("isEnabled")).booleanValue();
+		actorID = ((Float) json.get("actorID")).intValue();
+
+	}
+
+}
+

--- a/src/com/dryerzinia/pokemon/event/Event.java
+++ b/src/com/dryerzinia/pokemon/event/Event.java
@@ -10,6 +10,8 @@
 	public int id;

 

 	public abstract void fire();

+

+	protected int nextEvent;

 

 	public int getID(){

 		return id;

@@ -26,6 +28,7 @@
 	public void fromJSON(HashMap<String, Object> json) {

 

 		id = ((Float) json.get("id")).intValue();

+		nextEvent = ((Float) json.get("nextEvent")).intValue();

 

 	}

 


--- /dev/null
+++ b/src/com/dryerzinia/pokemon/event/FacePlayerEvent.java
@@ -1,1 +1,30 @@
+package com.dryerzinia.pokemon.event;
 
+import java.util.HashMap;
+
+import com.dryerzinia.pokemon.obj.GameState;
+
+public class FacePlayerEvent extends Event {
+
+	protected int actorID;
+
+	public FacePlayerEvent(){}
+
+	@Override
+	public void fire() {
+
+		GameState.people.get(actorID).facePlayer();
+		EventCore.fireEvent(nextEvent);
+
+	}
+
+	@Override
+	public void fromJSON(HashMap<String, Object> json) {
+
+		super.fromJSON(json);
+		actorID = ((Float) json.get("actorID")).intValue();
+
+	}
+
+}
+

--- a/src/com/dryerzinia/pokemon/event/ItemEvent.java
+++ b/src/com/dryerzinia/pokemon/event/ItemEvent.java
@@ -18,7 +18,6 @@
 

 	private Item item;

 	private int textID;

-	private int nextEvent;

 	private transient boolean soundPlayed, textFinished;

 	

 	public ItemEvent(){}


--- a/src/com/dryerzinia/pokemon/event/PersonTextEvent.java
+++ b/src/com/dryerzinia/pokemon/event/PersonTextEvent.java
@@ -3,7 +3,6 @@
 import java.util.HashMap;
 
 import com.dryerzinia.pokemon.map.Direction;
-import com.dryerzinia.pokemon.obj.ClientState;
 import com.dryerzinia.pokemon.obj.GameState;
 import com.dryerzinia.pokemon.obj.tiles.Person;
 
@@ -21,22 +20,12 @@
 		Person person = GameState.people.get(actorID);
 		oldDirection = person.getPose().facing();
 
-		Direction newDirection = Direction.NONE;
-
-		if(ClientState.player.getPose().getX() > person.getPose().getX())
-			newDirection = Direction.RIGHT;
-		else if(ClientState.player.getPose().getX() < person.getPose().getX())
-			newDirection = Direction.LEFT;
-		else if(ClientState.player.getPose().getY() > person.getPose().getY())
-			newDirection = Direction.DOWN;
-		else if(ClientState.player.getPose().getY() < person.getPose().getY())
-			newDirection = Direction.UP;
-
-		person.getPose().changeDirection(newDirection);
+		person.facePlayer();
 
 		person.animationEnabled = false;
 
 		super.fire();
+
 	}
 
 	@Override

--- a/src/com/dryerzinia/pokemon/event/TextEvent.java
+++ b/src/com/dryerzinia/pokemon/event/TextEvent.java
@@ -14,7 +14,6 @@
 

 	private int textID;

 

-	private int nextEvent;

 	protected transient boolean complete;

 

 	public TextEvent(){}


--- a/src/com/dryerzinia/pokemon/event/conditional/ConditionalCore.java
+++ b/src/com/dryerzinia/pokemon/event/conditional/ConditionalCore.java
@@ -9,7 +9,7 @@
 
 	static {
 
-		conditions.put(0, new BooleanConditional(0, false, 33, 35));
+		conditions.put(0, new BooleanConditional(0, false, 76, 35));
 
 	}
 

--- a/src/com/dryerzinia/pokemon/obj/MovementAnimator.java
+++ b/src/com/dryerzinia/pokemon/obj/MovementAnimator.java
@@ -241,15 +241,19 @@
         	 * they are coming out of Fog of War
         	 */
         	if(level == null){
+
         		if(newPosition.getLevel() != -1){
         			position.setLevel(newPosition.getLevel());
         			level = GameState.getMap().getLevel(position.getLevel());
         		} else
         			return null;
+
         	} else {
-            	LevelChange levelChange = level.grid.changeLevel(futurePoint.getX(), futurePoint.getY());
+
+        		LevelChange levelChange = level.grid.changeLevel(futurePoint.getX(), futurePoint.getY());
             	if(levelChange != null)
             		levelChanged = true;
+
         	}
 
         	boolean canStepNew = level.canStepOn(futurePoint.getX(), futurePoint.getY(), isPlayer);

--- a/src/com/dryerzinia/pokemon/obj/tiles/Person.java
+++ b/src/com/dryerzinia/pokemon/obj/tiles/Person.java
@@ -10,6 +10,7 @@
 import com.dryerzinia.pokemon.ui.menu.GMenu;

 import com.dryerzinia.pokemon.util.ResourceLoader;

 import com.dryerzinia.pokemon.obj.Actor;

+import com.dryerzinia.pokemon.obj.ClientState;

 import com.dryerzinia.pokemon.obj.MovementAnimator;

 

 public class Person extends Tile implements Actor, OnClick {

@@ -132,6 +133,23 @@
         return false;

     }

 

+    public void facePlayer(){

+

+    	Direction newDirection = Direction.NONE;

+

+		if(ClientState.player.getPose().getX() > location.getX())

+			newDirection = Direction.RIGHT;

+		else if(ClientState.player.getPose().getX() < location.getX())

+			newDirection = Direction.LEFT;

+		else if(ClientState.player.getPose().getY() > location.getY())

+			newDirection = Direction.DOWN;

+		else if(ClientState.player.getPose().getY() < location.getY())

+			newDirection = Direction.UP;

+

+		location.changeDirection(newDirection);

+

+    }

+

     public void addMovement(Pose position){

 

     	movement.addMovement(position);


--- a/src/com/dryerzinia/pokemon/obj/tiles/WanderingPerson.java
+++ b/src/com/dryerzinia/pokemon/obj/tiles/WanderingPerson.java
@@ -23,9 +23,12 @@
     }

 

     public WanderingPerson(String imgName, boolean cbso, int w, int h, int rx, int ry, Pose location, Grid g) {

-        this.imgName = imgName;

-        pixelOffsetX = 0;

+

+    	this.imgName = imgName;

+

+    	pixelOffsetX = 0;

         pixelOffsetY = 0;

+

         canBeSteppedOn = cbso;

 

         this.w = w;

@@ -64,23 +67,32 @@
         pos = (int) (Math.random() * 20);

 

         if (pos > 2 && con % 4 == 0) {

-            if (dir == Direction.UP) {

-                if (!PokemonServer.isPlayer(x, y - 1, level)

+

+        	if (dir == Direction.UP) {

+

+        		if (!PokemonServer.isPlayer(x, y - 1, level)

                         && g.canStepOn(x, y - 1))

                     canMove = true;

-            } else if (dir == Direction.DOWN) {

-                if (!PokemonServer.isPlayer(x, y + 1, level)

+

+        	} else if (dir == Direction.DOWN) {

+

+        		if (!PokemonServer.isPlayer(x, y + 1, level)

                         && g.canStepOn(x, y + 1))

                     canMove = true;

-            } else if (dir == Direction.LEFT) {

-                if (!PokemonServer.isPlayer(x - 1, y, level)

+

+        	} else if (dir == Direction.LEFT) {

+

+        		if (!PokemonServer.isPlayer(x - 1, y, level)

                         && g.canStepOn(x - 1, y))

                     canMove = true;

-            } else if (dir == Direction.RIGHT) {

-                if (!PokemonServer.isPlayer(x + 1, y, level)

+

+        	} else if (dir == Direction.RIGHT) {

+

+        		if (!PokemonServer.isPlayer(x + 1, y, level)

                         && g.canStepOn(x + 1, y))

                     canMove = true;

-            }

+

+        	}

         }

 

         if (canMove && con % 7 == 0) {