View Full Version : enabling pvp within zones.
Branks
08-30-2004, 06:19 PM
so ive got my little server up and decided to enable pvp in a few zones just to give people more options of things to do. the problem is everything works perfectly except for combat abilities such as kick, slam and archery and others like that. AA skills work just fine as well as spells but i simply cannot find any way to make combat skills work, they simply do nothing at all when the button is pushed. ive tried various things from completely commenting out all of the pvp checks and other methods of making sure pvp is enabled and it seems as though the client doesnt even send a pakcet unless the the other players name is red, however i know this to be incorrect since useing /duel doesnt make your name red and these skills work in zones like the arena.
so my questions is to the other servers who have enabled pvp within zones how exactly did you do it or what am i missing? yes ive searched and yes ive read through most/all of the guildwars code but im apparently still missing something. also what does pvp2 in the player profile do exactly? i havent noticed it effecting anything at all. thanks in advance
killspree
08-31-2004, 02:39 AM
Zoning into the arena makes your name red doesn't it? Used to on eqemu at least.
Cisyouc
08-31-2004, 03:15 AM
Zoning into the arena makes your name red doesn't it? Used to on eqemu at least. Not on live. Your name is only red when you go to a Priest of Discord.
-edit-
OR if you are on an all-PvP server.
killspree
08-31-2004, 04:41 AM
Yeah I meant on the emu.
Branks
09-04-2004, 04:44 PM
yeah seems names have to be red =( if i find a way to do this without the red names ill post but currently heres the code for it
zone\client_process.cpp do a search for
"else if ((app->opcode == OP_ClientUpdate)" and alter the exsisting to this.
else if ((app->opcode == OP_ClientUpdate) || (app->opcode == OP_ClientReady)) {
CompleteConnect();
//Dook- PVP zones
if((zone->GetZoneID()==22)||(zone->GetZoneID()==106)
||(zone->GetZoneID()==151))
{
m_pp.pvp = 1;
m_pp.pvp2 = 1;
SendAppearancePacket(AT_PVP, GetPVP());
Message(0, "This zone is PVP enabled! you have been warned!");
}
else
{
m_pp.pvp = 0;
m_pp.pvp2 = 0;
SendAppearancePacket(AT_PVP, GetPVP());
}
//end pvp zones code
}
else if (app->opcode == OP_SpawnAppearance) {
of course changing or adding the zones you want in place of mine.
monalin crusader
09-05-2004, 06:58 PM
Ok now if u dont want red titles do this, Forget about branks code (no offence i just dont use it since mine is a complete different way of doing it)
goto mob.cpp
search for // if they're dueling they can go at it
*EDIT** This is the one around line 2129 there are 2 places in this code where its got it make sure to get the right one or it will not work.
go a couple lines down and after
else if // if they're dueling they can go at it
(
c1->IsDueling() &&
c2->IsDueling() &&
c1->GetDuelTarget() == c2->GetID() &&
c2->GetDuelTarget() == c1->GetID()
)
return true;
insert in this
// Monalin: PvP in certian zones only replace zone ID's with zones you want
else if ((zone->GetZoneID() == 21) || (zone->GetZoneID() == 6))
{
int c1_level = c1->GetLevel(); // Level of client 1
int c2_level = c2->GetLevel(); // Level of client 2
// If they are within 4 levels of each other fight.
if(((c1_level + 4) >= c2_level) && ((c2_level + 4) >= c1_level))
return true;
else
return false;
}
Insert in whatever zoneid's ou like u can have as many as you like also, if u want to change the level ranges u can attack in.
Alternate code if u would like to use it instead it hasent been tested but its a little easier to change the level range u can attack in i dont care what you use.
// Monalin: PvP in certian zones only replace zone ID's with zones you want
else if ((zone->GetZoneID() == 21) || (zone->GetZoneID() == 6))
{
int c1_level = c1->GetLevel(); // Level of client 1
int c2_level = c2->GetLevel(); // Level of client 2
unsigned int level_diff;
level_diff = c1_level - c2_level;
// If they are within 4 levels of each other fight.
if(level_diff > 4)
return true;
else
return false;
}
Branks
09-06-2004, 02:45 AM
you mean mob.cpp, and yes i had tried this also, i found several dozen ways to enable pvp, my problem is that the client seems to block attack requests from innate skills if the targets name is not a certain color. my code has proven to have issues also as every 15th of so person to zone in somehow skips the code and is not pvp enabled for whatever reason, or at random people will not see other people in the zone to have a red name and thus they are prevented from useing archery and other innate attacks.
i put my code where i did due to previous attempts of attaching to to zone change requests which yielded no results as the name change color packet or whatever is sent to the client to make it change colors was recieved during zoneing so pvp was enabled however the name change is not. im still trying to work out a better way of doing this but currently have none. but im 99% sure the client has some "IsAttackAllowed" function of its own to check the color of the targets name, so there are more options than red as we know from pvp servers on live however im still working out a way to reliably send the color change request and prevent random clients from being skipped or not seeing it, then ill work on determining the name colors which are allowed to attack for the client unless the devs maybe have a list somewhere already, or if i find it in the guildwars code.
monalin crusader
09-06-2004, 03:22 AM
Most of the guildwar source is built into the cvs isnt it?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.