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! |
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 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. |
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 :) |
Quote:
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! |
All times are GMT -4. The time now is 12:48 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.