Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guild Town Features
Author Message
Fronz
Apprentice
*

Posts: 36
Likes Given: 2
Likes Received: 0 in 0 posts
Joined: Apr 2016
Reputation: 0



Post: #1
Guild Town Features
Hello again.

I'm requesting two scripts that shouldn't be that hard. I'm not the most skilled scripter, that's why I'm asking for your help.

One Script for an NPC and another script for something else.


First the NPC script:

The purpose of this NPC is that you can say "Open" to him and he will lower a UID and after some time it will nudge it up again to normality.

What I want from this NPC is to have a timer. So when you say Open it will open and after some time it closes. But when you say Open again to him he will say that you have to wait X minutes to open the gates again. Let's say 30 minutes.

Now I managed to make everything work, except the ItemDef m_traitor_wall_5hoursdelay. Everything else works fine if I remove that ID.

The following code DOESN'T work but I think the structure of it is correct.


Nevermind this one has been fixed!






The Second Script might be a little bit more complicated. I'll try to explain my best.


I need a function, it can be for the command .expel , that if you are in a specific area, let's say Moonglow, you can use it to Expel players out of that area.

I want everyone to be able to use that command. But ONLY in that area. If you are outside that Area it says a message saying you can't use this command here or something.

Now. I don't want the .expel to be used on everyone. I want only to be used on people that have a "tag?" (not sure if I'm using the right word). If you try to use it on people that don't have a Tag it says you can't use it on them.

Also if possible, can it be made so that it can't target Incognito players? "You can't expel incognito players".


And to get that tag, people need to trigger a telepad.


This Telepad will give you 2 tags and not just 1.

The First Tag is the one that makes you a candidate to be used the command .expel on you. It should have a timer of 48 hours.
Also the tag is removed when someone uses .expel on you

The Second Tag is a tag that lasts 30 minutes and prevents you from being .expel .
Meaning when you use the telepad, for 30minutes you can't be expelled. But after that time you can be expelled.



Thank's for the help,
Fronz
(This post was last modified: 05-18-2016 04:18 AM by Fronz.)
05-18-2016 01:29 AM
Find all posts by this user Like Post Quote this message in a reply
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #2
RE: Guild Town Features
This hasn't been tested, is not as efficient as it could be, and isn't complete but hopefully it gives you an idea how I would approach it...

You first need to take care of putting a tag GUILDTOWN on your player when they enter their own guild town. I think you should take care of this is the @RegionEnter and @RegionExit triggers for your Guild Town areadef.


E.G.
[AREADEF GUILDTOWN]
bla
bla
bla

ON=@REGIONENTER
SRC.TAG.GUILDTOWN 1

ON=@REGIONLEAVE /REGIONEXIT whatever it is
SRC.TAG.GUILDTOWN


You might want to consider adding a check to the above, to ensure the GUILDTOWN tag is only given to members of the guild town? Otherwise the raiders will also be able to expel although they can only expel their fellow raiders really.


[FUNCTION expel]
IF !<ISEMPTY <TAG.GUILDTOWN>> //HAS GUILDTOWN TAG
SYSMESSAGE @,,1 Who do you want to expel?
TARGETF f_expel
RETURN 1
ENDIF
SYSMESSAGE @,,1 You need to be in a Guild Town to use this command.
RETURN 1

[FUNCTION f_expel]
IF !<ARGO.ISPLAYER> //TARGET MUST BE A PLAYER
SRC.SYSMESSAGE @,,1 You can only use this on players.
RETURN 1
ELIF <ARGO.FINDID.i_rune_incognito> //PLAYER IS INCOGNITO
SRC.SYSMESSAGE @,,1 That player is incognito and cannot be expelled.
RETURN 1
ELIF <ARGO.FINDID.i_raider> //IS PLAYER //IS RAIDER //NOT INCOGNITO
IF <ARGO.FINDID.i_raider_immune> //HAS IMMUNITY
SRC.SYSMESSAGE @,,1 They are still immune from being expelled.
RETURN 1
ENDIF
ARGO.GO <Wherever you want to expel them to>
ARGO.SYSMESSAGE @,,1 You have been expelled from the guild town raid by <SRC.NAME>.
SRC.SYSMESSAGE @,,1 You have expelled <ARGO.NAME>.
ARGO.FINDID.i_raider.REMOVE //REMOVE RAIDER TAG
RETURN 1
ENDIF
RETURN 1


[TYPEDEF t_guildtown_telepad]
ON=@STEP
IF <SRC.ISPLAYER> //MAKE SURE IT IS A PLAYER
IF <SRC.IS_NOT_A_MEMBER_OF_THIS_GUILD_TOWN> // Need to script your check to make sure the player is not a guild town member.
IF !<SRC.FINDID.i_raider> //NOT ALREADY RAIDING
SERV.NEWITEM i_raider_immune
NEW.CONT <SRC>
SERV.NEWITEM i_raider
NEW.CONT <SRC>
ENDIF
ENDIF
SRC.GO <WHEREVER>
ENDIF

[ITEMDEF i_raider_immune]
ID=i_memory
NAME=Raider Immunity
WEIGHT=0
TYPE=t_eq_script

ON=@CREATE
TIMER = 1800 //30 mins
ATTR=attr_invis|attr_decay

ON=@TIMER
CONT.SYSMESSAGE @,,1 You are no longer immune from being expelled.
REMOVE
RETURN 1

[ITEMDEF i_raider]
ID=i_memory
NAME=Raider
WEIGHT=0
TYPE=t_eq_script

ON=@CREATE
TIMER = 172800 //48 hours
ATTR=attr_invis|attr_decay

ON=@TIMER
REMOVE
RETURN 1
05-18-2016 05:08 AM
Find all posts by this user Like Post Quote this message in a reply
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #3
RE: Guild Town Features
(05-18-2016 05:08 AM)richm Wrote:  You might want to consider adding a check to the above, to ensure the GUILDTOWN tag is only given to members of the guild town? Otherwise the raiders will also be able to expel although they can only expel their fellow raiders really.


[FUNCTION expel]
IF !<ISEMPTY <TAG.GUILDTOWN>> && !<FINDID.i_raider> //HAS GUILDTOWN TAG
SYSMESSAGE @,,1 Who do you want to expel?
TARGETF f_expel
RETURN 1
ENDIF
SYSMESSAGE @,,1 You need to be in your own Guild Town to use this command.
RETURN 1

Adding the && !<FINDID.i_raider> should do what you said I guess. Even having the GUILDTOWN tag, they won't be able to expel anyone because they are raiders. Guess it's way easier than trying to check to which guild does someone belong when entering a guild town.

Depending on the case, expelling people automatically through timerf after X time inside the guildtown could possible be a better option than giving the power for someone to do so. Since there are no counters or any other features attached to it, it's just a "had to come here just to kick you out". With automatic expel people would know they wouldnt have to bother with others nearby they place after X time upon doors have been opened.
(This post was last modified: 05-18-2016 06:25 AM by pointhz.)
05-18-2016 06:17 AM
Find all posts by this user Like Post Quote this message in a reply
richm
Journeyman
*

Posts: 58
Likes Given: 4
Likes Received: 4 in 3 posts
Joined: Aug 2014
Reputation: 0



Post: #4
RE: Guild Town Features
Yeah or you could also add cont.p <wherever> in the raider timer I guess

Sent from my SM-N910F using Tapatalk
(This post was last modified: 05-18-2016 06:35 AM by richm.)
05-18-2016 06:35 AM
Find all posts by this user Like Post Quote this message in a reply
Fronz
Apprentice
*

Posts: 36
Likes Given: 2
Likes Received: 0 in 0 posts
Joined: Apr 2016
Reputation: 0



Post: #5
RE: Guild Town Features
It works! Everything works as it should.

Thanks so much!

Sorry for the late reply but I've been pretty busy.

Kudos,
Fronz
05-28-2016 02:06 PM
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)