A Project for Chronicle 4 based on L2JServer.


    onCreatureSee ?

    Share
    avatar
    Karakan

    Posts : 421
    Join date : 2013-10-04

    onCreatureSee ?

    Post  Karakan on 25th March 2016, 17:30

    Struggling with jython/java ai files..

    Anyone has a clue why this works....


    .py


    Code:
       def onCreatureSee(self, npc, player, isPet):
            if npc.getNpcId() == TESTNPC:
       npc.broadcastPacket(CreatureSay(npc.getObjectId(),1,npc.getName(),"Npc text here."))
            return



    But this won't


    .java



    Code:

     @Override
     public String onCreatureSee(L2NpcInstance npc, L2PcInstance player, boolean isPet)
     {
     if (npc.getNpcId() == TESTNPC)
     {
     npc.broadcastPacket(new CreatureSay(npc.getObjectId(),1,npc.getName(),"Npc text here."));
     }
     return super.onCreatureSee(npc, player, isPet);
     }
    avatar
    DnR
    Admin
    Admin

    Posts : 1023
    Join date : 2012-12-03

    Re: onCreatureSee ?

    Post  DnR on 6th April 2016, 20:36

    May I take a look at the script?

      Current date/time is 23rd September 2017, 03:08