Jump to content
  • 0

Add Effect When Player Insideradius


Meikis

Question

I want to add abnormal effect when player is inside xx radius of object, I've tried to use in L2Pcinstance something like - 

if(isInsideRadius(objX,objY,objZ,500, false, false))
		{
			startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
			sendMessage("You have entered artefact area");
		}

but it doesn't work, how to do it right?

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

You can do the trick with for loop.

 

 

for (L2PcInstance player : getKnownList().getKnownTypeInRadius(L2PcInstance.class, 300))
Link to comment
Share on other sites

  • 0

nope

You do... I've checked, there are two methods checkIfInShortRadius() and checkIfInRange(): java/net/sf/l2j/gameserver/util/Util.java

They are documented, so check them.

Link to comment
Share on other sites

  • 0

You do... I've checked, there are two methods checkIfInShortRadius() and checkIfInRange(): java/net/sf/l2j/gameserver/util/Util.java

They are documented, so check them.

I'm using L2j Acis 3xx, there is no such methods in Util class

Link to comment
Share on other sites

  • 0

If you want to add effect on the people that are INSIDE an area, you dont really need to check radius but just check if the player is in that zone.

So, while he is in that zone he receives the effect.

 

snippet ex.

while(player.isInsidePvPZone()){ // i do not know if the method exists in your pack.
startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);} //this will give non stop magic_circle effect  on the player while he is inside the pvp zone.

   

 

If you want to add effect on the people that get close to a NPC for example, there you need to use isInsideRadius method of the npc and the player.

And then of course invoke the effect on the player that is actually inside the radius.

int _range = 800;
if(isInsideRadius(player,npc,_range)) // i do not know if the method exists in your pack.
{
    startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
}

Last, i do not know if these methods exist or not, but thats a logic approach i believe.

Link to comment
Share on other sites

  • 0

What do you want to do, EXACTLY ?

 

Your idea looks more like a custom script where you have to define onAggroRange. All answers previously said go from "wrong" to "terribly bad" (no offense).

Link to comment
Share on other sites

  • 0

What do you want to do, EXACTLY ?

 

Your idea looks more like a custom script where you have to define onAggroRange. All answers previously said go from "wrong" to "terribly bad" (no offense).

I want to add effect on the people that get close to a NPC.

Link to comment
Share on other sites

  • 0

while(player.isInsidePvPZone()){ // i do not know if the method exists in your pack.

startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);} //this will give non stop magic_circle effect  on the player while he is inside the pvp zone.

 

XD

 

 

 

PS: If you throw the dedi box off the 3rd floor it will pain less than running that "snippet"

Link to comment
Share on other sites

  • 0

I want to add effect on the people that get close to a NPC.

Consider to read PrimevalIsle.java, Sprigant got a similar feature. As I said, onAggroRange method.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • thats 26_21... i have it and 26_19... only 26_20 missing is the town arcan part
    • his link still working here , or are they different ?
    • Hello everyone,   We're shifting our focus away from implementing as much as possible from the Essence gameplay. Instead, the server will now be Interlude, but using the Essence client.   This should be good news for everyone.   The Beta phase will most likely take place in November, with the grand opening to follow shortly after.   Cheers!
    • We remind you that the opening will take place today, on September 28 at: 19:00 (UTC+3) - server time Check current server time(UTC +3) On 17:00 (UTC +3) We allow you login to create character! Dear friends, this topic important! So please take time to read it. First we want to thank all players who took part in the Open Beta testing, was good activity and nice Olympiad Event yesterday, we all get a lot of fun  Thanks to all who conducted tests with us and prepared this game world! You are amazing!  On 17:00 (UTC +3) We allow you to login for create character! To restrict your name and transfer ToDs/Season Pack to your character. Make it before start! On start, we can have problems with WEB! Everything you need to start on the server: It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project, and you simply can not register. - Registration and files Download archive unzip it, run launcher, choose SEASON x25 server and press FULL CHECK What you need to know at the start: Registration for 7 seals from Monday, September 30, full cycle 1 week. First Mammons on Friday October 4 All Epic Raid Bosses dead on start. First epic QA will appear on Monday, next day Core + Zaken + QA and so on by schedule All other RBs alive on server start (including Sub and Nobl RB) - Full RoadMap   About possible attacks on server start. We have prepared as good as we can. We will control the start of the server together with you. Want to ask you, in the case of a problem, don't panic, panic is the worst possible thing that could be, even worse than any attack. We have enough specialists to solve any problems, all that will need from you is patience and trust. Wish you all a smooth start and months of enjoyable play in new Season Interlude x25! Have a fun!
  • Topics

×
×
  • Create New...