Jump to content
  • 0

Question

Posted (edited)

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

7 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted (edited)

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
  • 0
Posted
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.

  • 0
Posted

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);
	}

 

Guest
This topic is now closed to further replies.


  • Posts

    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store ✅ ➡ Our SMM-Boosting Panel: https://socnet.pro ✅ ➡ Telegram Shop Bot: https://socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: https://wa.me/79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
    • Hey. I've been looking all over the internet about this but not being able to find anything about it. I have edited systemmsg using MSG editor changing colors etc. But now I want to change and add some of the sounds as well. But I need the sound IDs for each audiofile and I dont know how to find them. Ive found all the audio files but I cant use the filename as someone said in a thread here, it only seem to take numbers. I have looked into every guide about systemmsg on this website and no one mention anything about the sound, just that its possible to add sound but nothing more. So, do anyone know how to find these sound IDs? Preferably together with the soundname of the audio file that it plays so I know which ID to use for each soundfile. Thanks in advance!
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...