public virtual void Attack(TileEntity TE)
 {
     if (TE is Mobs)
     {
         Mobs m = (Mobs)TE;
         if (m.hostile)
         {
             TE.hpv2 -= damage;
             if (TE.hpv2 <= 0)
             {
                 TE.Death();
             }
         }
     }
     else if (TE is Pnj)
     {
         Pnj m = (Pnj)TE;
         if (m.hostile)
         {
             TE.hpv2 -= damage;
             if (TE.hpv2 <= 0)
             {
                 TE.Death();
             }
         }
     }
     else if (TE is PanneauPnj)
     {
         PanneauPnj m = (PanneauPnj)TE;
         if (m.hostile)
         {
             TE.hpv2 -= damage;
             if (TE.hpv2 <= 0)
             {
                 TE.Death();
             }
         }
     }
     else if (TE is Player)
     {
         TE.hpv2 -= damage;
         if (TE.hpv2 <= 0)
         {
             TE.Death();
         }
     }
 }
    public void QuestComplete()
    {
        if (questId == 0 || questId == 3 || questId == 1 || questId == 5 || questId == 6 || questId == 7 || questId == 16)
        {
            GameObject.Find("Boussole").GetComponent <Boussole> ().TargetNext();
        }
        if (questId == 0 || questId == 3 || questId == 6)
        {
            TileEntity te = GameObject.Find("Pnj (Dadghost)").GetComponent <TileEntity> ();
            for (int i = 0; i < te.transform.childCount; i++)
            {
                te.transform.GetChild(i).GetComponent <MeshRenderer> ().enabled = false;
            }
            te.tile.entity = null;
            te.enabled     = false;
            te.GetComponent <MeshRenderer> ().enabled = false;
        }
        if (questId == 3)
        {
            QuestManager.Instance.indexQuest = 2;
        }
        if (questId == 1 || questId == 2)
        {
            QuestManager.Instance.IncreaseFood(100);
            if (QuestManager.Instance.indexQuest == 0)
            {
                QuestManager.Instance.indexQuest = 1;
                TileEntity te = GameObject.Find("Pnj (Dadghost)").GetComponent <TileEntity> ();
                te.tile = World.instance.GetTile(45, 52);
                te.transform.position = te.tile.transform.position;
                for (int i = 0; i < te.transform.childCount; i++)
                {
                    te.transform.GetChild(i).GetComponent <MeshRenderer> ().enabled = true;
                }
                te.tile.entity = te;
                te.enabled     = true;
                te.GetComponent <MeshRenderer> ().enabled = true;
            }
        }
        if (questId == 4)
        {
            GameObject.Find("Pnj (Soldier)").GetComponent <Pnj> ().moveText = "zddddddddddsssssdds";
            QuestManager.Instance.indexQuest = 3;
        }
        if (questId == 5 || questId == 16)
        {
            QuestManager.Instance.indexQuest = 5;
            TileEntity te = GameObject.Find("Pnj (Dadghost)").GetComponent <TileEntity> ();
            te.tile = World.instance.GetTile(45, 52);
            te.transform.position = te.tile.transform.position;
            for (int i = 0; i < te.transform.childCount; i++)
            {
                te.transform.GetChild(i).GetComponent <MeshRenderer> ().enabled = true;
            }
            te.tile.entity = te;
            te.enabled     = true;
            te.GetComponent <MeshRenderer> ().enabled = true;
            GameObject.Find("Player").GetComponent <Player> ().hasSword = true;
        }
        if (questId == 6)
        {
            QuestManager.Instance.indexQuest = 6;
        }
        if (questId == 7)
        {
            GameObject.Find("Pnj (Guard)").GetComponent <Pnj> ().moveText     = "odddddddddzzzzzd";
            GameObject.Find("Pnj (Guard) (1)").GetComponent <Pnj> ().moveText = "oosdddddddddzzzzzq";
            if (linkedNpcId == 3)
            {
                GameObject.Find("Player").GetComponent <Player> ().moveText = "sddddddddddzzzzzz";
            }
            else if (linkedNpcId == 4)
            {
                GameObject.Find("Player").GetComponent <Player> ().moveText = "oddddddddddzzzzzz";
            }
            QuestManager.Instance.indexQuest = 7;
        }
        if (questId == 8)
        {
            GameObject.Find("Pnj (King)").transform.Find("Child").gameObject.SetActive(true);
            QuestManager.Instance.indexQuest = 9;
            new Quest(5, 9);
        }
        if (questId == 9)
        {
            QuestManager.Instance.indexQuest = 10;
            GameObject.Find("Pnj (Guard)").GetComponent <Pnj> ().moveText     = "qssq";
            GameObject.Find("Pnj (Guard) (1)").GetComponent <Pnj> ().moveText = "odssd";
        }
        if (questId == 10)
        {
            QuestManager.Instance.indexQuest = 12;
            TileEntity te = GameObject.Find("Pnj (Dadghost)").GetComponent <TileEntity> ();
            te.tile.entity        = null;
            te.tile               = World.instance.GetTile(20, 90);
            te.transform.position = te.tile.transform.position;
            te.tile.entity        = te;

            GameObject.Find("Player").GetComponent <Player> ().targetCoord = new Vector2(13, 91);
        }
        if (questId == 11)
        {
            QuestManager.Instance.indexQuest = 15;
            TileEntity te = GameObject.Find("Pnj (Dadghost)").GetComponent <TileEntity> ();
            te.Death();
        }
        if (questId == 16)
        {
            GameObject.Find("Pnj (Soldier)").GetComponent <Pnj> ().ReallyDeath();
        }
        QuestManager.Instance.playerKarma += karmaModifier;
        QuestManager.Instance.finishQuest(this);
    }