EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   PVP flag (https://www.eqemulator.org/forums/showthread.php?t=27602)

neiv2 03-02-2009 09:33 PM

PVP flag
 
I'm racking my brain trying to figure out a way to do this. Here's the scenario: On my server, when a player possesses a certain item, he is automatically flagged pvp so that other players can track him down and kill him to get the item. The goal is to take the item to your "king" to get a kingdom blessing before someone finds you and takes it. The problem is, although the player.pl script flags the bearer of the item as pvp, I can't think of a way to make those around him pvp as well. I don't think a proximity function would work here (would it?). Any suggestions would be appreciated.

trevius 03-02-2009 10:42 PM

I can't think of a way to do exactly that, but you could always make an NPC that they can speak with to toggle their PVP flag. If you really needed to, I am sure you could make a clicky item that summons an NPC (pet) that could be set to have a quest to toggle PVP flags in the default.pl or something.

Other than that, you could probably try running a client check and do some distance checks and other checks that could be used to set a PVP flag. Though, this type of script could be quite a hog and a pain to get setup in the first place. To check for clients in a zone, you can check out the custom Thanksgiving event I submitted into the custom quests section. I am sure you could probably do what you are wanting with that, but be warned, it would be rough on your server and probably hard to get working flawlessly.

At some point, I would like to add a new quest sub EVENT type for doing a client check in an entire zone. Then, it would allow you to run any checks against all clients in the zone at any given time. It would be triggered from other sub EVENTs similar to a timer. It would probably be quite a while before I could have time to implement this, but I do think it would be extremely useful. On Storm Haven, we already use my client check script for multiple events. It would just be nice to have a simpler and cleaner way of doing it so it didn't have to check all entities and just the clients in the zone. That would be alot easier on the server and alot easier to manage and write events for.

neiv2 03-02-2009 11:15 PM

The goal to get the newly found item to the king as quickly as possible would likely work against the requirement to speak with an NPC. The item-bearer's name being in red is really the only tip-off to a passerby that he has the ring. By the time the passerby has made it to the pvp npc, the item-bearer will have already turned in the item to his king.

I like the idea of the new client check sub EVENT. That could have lots of applications. I guess I'll have to wait till that comes out to implement this feature.

On a similar note, if I knew anything about developing and adding a new sub EVENT, I'd volunteer to add one that launches an mp3 upon entering a zone. I have played with the open file command (open FILE, "filename.txt" or die $!; ), but have not been successful in getting it to work.

trevius 03-02-2009 11:22 PM

If you are trying to do a sort of capture the flag idea, I there has been a decent conversation posted somewhere on how to implement something like that. But, basically, you would want all of your players to be flagged as PVP before the game begins. Then, instead of relying on a red name as the tip off, you could set the person with the flag to be a special race like werewolf or something and then people know who to go after. To make sure people don't just change their race with an illusion clicky, you could do a race check before letting them do their turn in at the king.

revloc02c 03-29-2011 12:07 PM

Make one zone pvp?
 
I can't find a better place to post this, and I can't find an answer.

Is there a way to make just one zone a pvp zone?

I thought there was something in the rule_values that set this, but I can't find it. I have concluded that I got the entry in the variables table confused with a rule_values entry (but the variables table entry changes the entire server). Anyone know?

Caryatis 03-29-2011 02:38 PM

sub EVENT_ENTERZONE
{
quest::pvp(on);
}

revloc02c 03-30-2011 05:27 PM

Quote:

Originally Posted by Caryatis (Post 197961)
sub EVENT_ENTERZONE
{
quest::pvp(on);
}

Thanks Caryatis. The answer is so simple I feel kinda sheepish (I was searching in the wrong place).

How do you turn it off when they leave the zone? Or die fighting someone in the zone? I don't want players spawning at their bind point with their PvP flag activated.

Does the following code work when you die too? Or evac out of a zone?
Code:

sub EVENT_ZONE
{
quest::pvp(off);
}


sorvani 03-30-2011 06:13 PM

Event zone fires when you enter a zone. I would hazard to guess that you could set player.pl in the templates folder to turn off pvp and then just turn it on in your specific zones player.pl files

Caryatis 03-30-2011 08:08 PM

EVENT_ZONE is for leaving a zone however it can be unreliable, so you can just put an EVENT_ENTERZONE in the player.pl in templates folder, with an if statement(like if($client->GetPVP()) {quest::pvp(off)}), that way people aren't spammed with "You no longer follow the ways of discord" every time they zone.

Secrets 03-31-2011 01:17 AM

Why not avoid perl altogether and do it on Client::CompleteConnect? Force PVP off if not in a specific zone.

You can use SetPVP in there and that'd work just fine. No perl needed and it's more flexible besides recompiling. There's always the rule system if you need it too.

revloc02c 03-31-2011 12:09 PM

I tried what I had submitted above (with EVENT_ENTERZONE and EVENT_ZONE) and it worked, so that's cool.

Quote:

Originally Posted by Caryatis (Post 198028)
EVENT_ZONE is for leaving a zone however it can be unreliable, so you can just put an EVENT_ENTERZONE in the player.pl in templates folder, with an if statement(like if($client->GetPVP()) {quest::pvp(off)}), that way people aren't spammed with "You no longer follow the ways of discord" every time they zone.

This is a really good idea, especially if EVENT_ZONE is unreliable. Thanks.

Quote:

Originally Posted by Secrets (Post 198067)
Why not avoid perl altogether and do it on Client::CompleteConnect? Force PVP off if not in a specific zone.

You can use SetPVP in there and that'd work just fine. No perl needed and it's more flexible besides recompiling. There's always the rule system if you need it too.

Secrets, I am not trying to be a smart aleck or anything, but this is way over my head. But I appreciate it though because now I know I need to go study some more to find out what you are talking about. I am sure I'll learn some things that will help me solve some of the other ideas I want to implement too. (I hope that didn't come of sounding sarcastic, I am being sincere--always a challenge when e-communicating.)


All times are GMT -4. The time now is 09:04 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.