Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there easy way to know if player is in a city?
Author Message
fabiohvp
Apprentice
*

Posts: 19
Likes Given: 11
Likes Received: 3 in 2 posts
Joined: Jul 2018
Reputation: 0



Post: #1
Is there easy way to know if player is in a city?
1 - I want to forbid players from hiding and walk stealth inside cities if their skill is below 90.0, is there an easy way to know if the player is inside a city?
I could use region_flag_nobuilding but it would forbid to use inside houses and I don't want that.

2 - Also if is there a way to know if the player is inside a forest/swamp/desert would also be good to know.
(This post was last modified: 08-01-2018 03:28 PM by fabiohvp.)
08-01-2018 03:11 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,646
Likes Given: 229
Likes Received: 152 in 143 posts
Joined: Mar 2012
Reputation: 33



Post: #2
RE: Is there easy way to know if player is in a city?
Try this way open sphere_map0 and search for region blocks that starts with "a_town*", for each of these region add a tag like this:
Code:
[AREADEF a_townOcclo]
NAME=Ocllo
GROUP=Ocllo
P=3650,2519,0,0
RECT=3588,2460,3707,2685,0
RECT=3695,2558,3760,2705,0
FLAGS=region_flag_nobuilding|region_flag_guarded
EVENTS=r_default,r_default_rock,r_default_water,r_default_tree,r_default_grass
TAG.MUSIC=midi_ocllo
tag.city = 1

Then inside the @start (maybe better @prestart?) trigger of the hiding skill add this check
Code:
if <region.tag.city>  && <hiding> < 900
    sysmessage You can't hide here.


Same for wilderness region
08-01-2018 05:30 PM
Find all posts by this user Like Post Quote this message in a reply
fabiohvp
Apprentice
*

Posts: 19
Likes Given: 11
Likes Received: 3 in 2 posts
Joined: Jul 2018
Reputation: 0



Post: #3
RE: Is there easy way to know if player is in a city?
Thanks
08-02-2018 11:16 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.