Jump to content
  • 0
Sign in to follow this  
drakthuro

Private, objects, NPC's And tiles for players.

Question

Hi there, I was wondering. Is it possible to make objects and npc's some of them, Appear only for the player who has completed the required quest or anything you assign. Such as Lighting a lantern for a quest.

Lets say we have player L33tkiller and player Fairstone

* this is just to show you what i mean*

In player.java we have private booleans

[CODE] public boolean startedLightLantern = false;
public boolean inProgressLightLantern = false;
public boolean completedLightLantern = false;[/CODE]

Both players can see a npc called, Lantern lighter.

Once you talk to him you can start the quest which will make [CODE]public boolean startedLightLantern = true;[/CODE]

So lets say. Player l33tkiller started the quest which makes the boolean set true for him.
But for player fairstone its still false.

So i want for player l33tkiller, If the Boolean is True to spawn certain npc's As example
[CODE]World.spawnNPC(133, new WorldTile(3602, 3339, 0), -1, true);[/CODE]

So i do not want player Fairstone be able to see it Since he is still on false.
Now for an object Such as a lantern.

There are lanterns across runescape. Take as example lantern ID 6413. I already got them ready so you can light them.

But, i only want the player be able to light them if they are true with the boolean.

If you are false with it i want the player fairstone not be able to see nor activate it.

And as last.

_________________________________________________________________________________________________________________

Lets take the fightcaves, The tzhaar fight caves once you start them, takes a certain part. Copy's it to an empty space, And makes it an private space for just the player. So you cant multiplay there.

Is it possible to make it for more area's? To make it copy a certain zone/region and make it private in an empty space.

Thanks in advance i hope that it was not a bad explanation.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
As for the part where the player can't see the NPC, I have no clue, but you can make the player without the boolean not be able to talk to him really easily.

[CODE]
if (startedLanternLighter) {
startdialogue blah blah)
} else {
player.getPackets().sendGameMessage("you've not started this quest.");

}
[/CODE]

^edit that to whatever. That will work for using the item too.
[CODE]
if (itemId == 6413) {
if (startedLanternLighter) {
//do stuff
} else {
//you can't do this
}

}
[/CODE]
Yes you can make a private or instanced dungeon as it's called. (I think that's proper terminology)

Share this post


Link to post
Share on other sites
  • 0
If I'm not mistaken it's in your NPC Update masks, there should just be a while loop, you can just add a check for the npc id like
[code]
if (!player.startedLightLantern && npc.getId() == id) {
continue;
}
[/code]
You've gotta locate your own NPCUpdate file though, I'm adapted to 639s hierarchy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×