Jump to content
  • 0

Slow teleport


remigas

Question

Hello, i have an streange idea maybe some of you can help me, im using acis pack  for c6 and i want to make that people who are using teleport will dissapear slowly not instant. Maybe someone know what code and where need to add to java to have this effect?

thanks a lot for those who help me solve this 🙂
 

hope so understand what i mean 

Edited by remigas
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
33 minutes ago, remigas said:

Hello, i have an streange idea maybe some of you can help me, im using acis pack  for c6 and i want to make that people who are using teleport will dissapear slowly not instant. Maybe someone know what code and where need to add to java to have this effect?

thanks a lot for those who help me solve this 🙂
 

hope so understand what i mean 

 

Define "slowly". Like a slow motion nuclear fission ? Like entropy is affecting you in a faster way than the rest and break down your atoms? 

 

Basically if you open up the Teleporter.java (i don't really remember the instance type in aCis of teleporters), you will realise that it uses teleToLocation() now depending on what "delay" mean you have to approach this method in a different way.

 

If you want to teleport after 5 second(s) you have to use a ThreadPoolExecutor for example.

Edited by Kara
  • Haha 1
Link to comment
Share on other sites

  • 0

Create one new Skill preferrably the one called during /unstuck of type

 

Modify L2SkillTeleport.java

Add this:

Quote


    private static final HashMap<L2Character, L2TeleportLocation> _values = new HashMap<>();

And this

Quote

    public static void initTeleport(L2PcInstance player, int teleId)
    {
        final L2TeleportLocation temp = TeleportLocationTable.getInstance().getTemplate(teleId);
        if (temp == null || player.isCastingNow() || player.isSitting() || player.isMovementDisabled() || player.isOutOfControl() || player.isInOlympiadMode() || player.inObserverMode() || player.isInJail())
        {
            player.sendMessage("Your current state doesn't allow you to cast a teleport!");
            return;
        }
        int id = 7066;
        if (player.isGM() || player.isInsideZone(L2Character.ZONE_PEACE))
            id = 7065;
        else if (player.isInCombat() || player.getPvpFlag() > 0 || player.getKarma() > 0)
            id = 7067;
        player.doCast(SkillTable.getInstance().getInfo(id, 1));
        _values.put(player, temp);
    }

edit useSkill

 

add this 

Quote


                final L2TeleportLocation teleport = _values.get(activeChar);

null check it, make your checks

and call this 

Quote


                        activeChar.teleToLocation(teleport.getLocX(), teleport.getLocY(), teleport.getLocZ(), 30);

 

Now, you have the logic you need to change L2TeleporterInstance

 

change your teleportTo location methods with 

Quote

L2SkillTeleport.initTeleport( ........ )

 

 

Now you have a mechanism that instead of instant teleport your character casts a skill of defined duration that will do the actual teleportation

Edited by xdem
Link to comment
Share on other sites

  • 0
player.disableAllSkills();
player.sendPacket(new ShowBoard());
player.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, player, true);
player.setInstanceById(0);
player.sendMessage("You will be teleported in 20 seconds");
ThreadPool.schedule(() -> player.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0), 20000);
ThreadPool.schedule(player::enableAllSkills, 20000);

 

 

this is what i use on L2j Mobius using CB teleport. You can get an idea and there is no need to edit anything.

 

no animations though, u just stand still and tp after 20 sec.

im sure there a re better ways to write this my java knowledge is bellow beginner but i hope it helps..

 

change:

player.disableAllSkills();--- to--- player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);

player.doCast(SkillData.getInstance().getSkill(2013, 1));   << add this to add SoE effect. but if you Esc cancel it it will just cancel the skill animation and the tp will occur after 20sec. cant figure out how to cancel tp as well.

Link to comment
Share on other sites

  • 0

If you need only delay w/o any additionally wffects then find this lines in Npc.java

 

        if (Config.FREE_TELEPORT || teleport.getPriceCount() == 0 || player.destroyItemByItemId("InstantTeleport", teleport.getPriceId(), teleport.getPriceCount(), this, true))
            player.teleportTo(teleport, 20);

 

and replace to this

 

        if (Config.FREE_TELEPORT || teleport.getPriceCount() == 0 || player.destroyItemByItemId("InstantTeleport", teleport.getPriceId(), teleport.getPriceCount(), this, true))
        {
		ThreadPool.schedule(() -> 
		{
			player.teleportTo(teleport, 20);
		}, 2000);
	}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • totally agree, the problem started with professionals who made easy to open a server, specially interlude has been abused unstoppably since you can open a server with few clicks now days making fewer players for many servers, while back in time when "compile" was a secret and opening a server was going max players but true things are changing and this has become a job but dont lie everyone knows what is going on, lying is showing desperation, better go and work. i've worked with lots of people with kids that invest huge amounts of money into this and fail while they needed the money its an addiction.
    • well,we all know that everyone is doing it for money. And it's acceptable since you put much more effort than the usual admins. If you're proffesional on l2 servers,i don't find a reason to not see it as a job. Ofc it's job,but all jobs has their own prides. I'll talk about me,i'm a guy that working 10 +/- hours per day. I have 2-3 free hours on my daily activity and sometimes i enjoy playing Lineage because nostalgia hits me everyday. If you are many years on scene,u'll understand that lineage will never be the same like old days. Days that we was gathering at internet cafes,and the battle was daily. Anyway, some people perfer to pay big clans and provide them black market with special prices and benefits that a casual player wont have. Also big clans means big wars,so server will have population even if you have zero quality. And there is some projects that wont pay those d1ckheads,so they wont join them and project need to find other ways to increase the population. So,i'm a player that i'll donate 20-40-50 euros on every server i play,and usually i'm getting "scammed" since they re-open their server every 2 months. And the problem is that,i personally don't mind to donate few money every 2 months for my joy,but the majority of owners has zero knowledge about L2 gaming. That's why they can't fix a sh1t,and when the problems pile up,they slowly close the server and starting advertising for another one. Actually,on high rate scene mostly,is the same guy that doing it everytime. He opens his project for 1-2 months,he close it and before he shut down the server,he has already started the advertising on his next server with different name. It's just crazy and that part shouldn't be acceptable. So yes,i perfer to support a project with honest admin team,and somewhere they have the knowledge to implent things. Business is business,but at least as community,we should enjoy our game that we love, cheers. 
    • thanks for sharing !! any guide to install this? it would be great!!
  • Topics

×
×
  • Create New...