Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2018, 10:54 AM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default Code for zone control pvp

So I have an idea, and I know generally how to connect it via quest commands, but no idea how to get the syntax correct.

The core of the idea is that when a certain pvp team captures a control point (this can be a zone or a particular camp, like the commonlands orc tents.)
They gain ownership over the point and npcs.

To do this I was thinking you have a quest that changes the faction of the npcs in the zone or area to that if the team. The quest is triggered by killing the "boss" of the camp. Doing this sets the global quest flag for your team as "owner", depops the old npcs and repops them with the updated faction.

If anyone had a little time and wanted to help show me what that would look like I'd be really grateful!
Reply With Quote
  #2  
Old 01-21-2018, 01:07 AM
Lane
Sarnak
 
Join Date: Dec 2010
Posts: 62
Default

I would put something like this in the NPC's .pl file.

For killer_Id, it would change based on your database. For me, my GM is 82,289 so anything 82,290 and higher is a regular player. I'm sure there's a better way to code this, but I'm a novice.

The GM Say will also broadcast the name of who's taken over the orcs. I think the code below is in red. Could easily change it to yellow or whatever.

For faction... it couldn’t be a part of the code below. I’m not sure how to do a quest::faction to $killer... if you add quest::faction to below it won’t work because below is triggered on death, so the killer wouldn’t get the faction hit. maybe have to edit the player.pl to somehow register killing = faction.

Code:
sub EVENT_DEATH_COMPLETE
{
$entity_list -->GetClientByID($killer_id) ;
	if($killer_id > 82,290) {
	quest::gmsay("$entity_list->GetClientByID($killer_id)->GetName() . " has taken over the orcs in the Commonlands! ", 335, 1, 0, 250);
        quest::spawn(npc_type_id, grid, guildwarset, x, y, z) # Spawn 'npc_type_id' on 'grid' with 'guildwarset' (use 0) at 'x', 'y', and 'z);
}
}
Another idea I had would to be to use the code above, edit the database to make all players KOS to the NPC faction, also change the DB value to give maximum faction on kill. Then you could add a sub EVENT_ENTER_ZONE to the player.pl that calls for quest::faction to go completely negative. This way when the player dies or zones and re-enters the zone, they would be KOS again.

This would require the player to kill the NPC to get a maximum faction hit and it would be the player who is allied to try and stop you from killing it.

The only downside I see to the above approach is what if players sit in the zone or hide after killing NPC, then all players kill NPC and are max faction? Shrug just some thoughts. Good luck and let me know if you figure out how to give faction on kill with quest::faction. I’m designing a custom PvP server as well and I just gave in and do a ground spawn on player kill for a turn in for faction.
Reply With Quote
  #3  
Old 01-21-2018, 01:09 AM
Lane
Sarnak
 
Join Date: Dec 2010
Posts: 62
Default

I was thinking and another way to do this would require more database work than Perl. If you have a port in NPC that allows you to be ported to Commons with Team 1 or Team 2, you could make custom NPC versions in the database.

An example would be...

Quest NPC has a if text = “Good Team”

Quest::movepc (to zone to Commons)
Quest::faction (to X amount corresponding to the NPC values you want for good or evil team NPCs.)

Then having a Perl event on the NPC that says if $killer = guild good team ... quest::spawn good team version of mobs... and vise versa. Anyway, there’s a ton of ways to do this so some more information about your server set up would allow people to help you more
Reply With Quote
  #4  
Old 01-21-2018, 03:54 AM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

Quote:
Originally Posted by Lane View Post
I would put something like this in the NPC's .pl file.

For killer_Id, it would change based on your database. For me, my GM is 82,289 so anything 82,290 and higher is a regular player. I'm sure there's a better way to code this, but I'm a novice.

The GM Say will also broadcast the name of who's taken over the orcs. I think the code below is in red. Could easily change it to yellow or whatever.

For faction... it couldn’t be a part of the code below. I’m not sure how to do a quest::faction to $killer... if you add quest::faction to below it won’t work because below is triggered on death, so the killer wouldn’t get the faction hit. maybe have to edit the player.pl to somehow register killing = faction.

Code:
sub EVENT_DEATH_COMPLETE
{
$entity_list -->GetClientByID($killer_id) ;
	if($killer_id > 82,290) {
	quest::gmsay("$entity_list->GetClientByID($killer_id)->GetName() . " has taken over the orcs in the Commonlands! ", 335, 1, 0, 250);
        quest::spawn(npc_type_id, grid, guildwarset, x, y, z) # Spawn 'npc_type_id' on 'grid' with 'guildwarset' (use 0) at 'x', 'y', and 'z);
}
}
Another idea I had would to be to use the code above, edit the database to make all players KOS to the NPC faction, also change the DB value to give maximum faction on kill. Then you could add a sub EVENT_ENTER_ZONE to the player.pl that calls for quest::faction to go completely negative. This way when the player dies or zones and re-enters the zone, they would be KOS again.

This would require the player to kill the NPC to get a maximum faction hit and it would be the player who is allied to try and stop you from killing it.

The only downside I see to the above approach is what if players sit in the zone or hide after killing NPC, then all players kill NPC and are max faction? Shrug just some thoughts. Good luck and let me know if you figure out how to give faction on kill with quest::faction. I’m designing a custom PvP server as well and I just gave in and do a ground spawn on player kill for a turn in for faction.
Ohhhh yeah great point - not replacing the mobs at all but instead changing the faction for the team losing control of the npc would be the best way to do it.
Orrrr - if it was a race/diety pvp system. You make the quest change the database value for the faction entry -2000 for losing team classes and races, +2000 for winning team. That's way easier ty!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:13 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3