It's very simple as an idea and it wouldn't take much time to implement.
This is with a
packet filter.
You're gonna work at
0x3012 | AGENT_CLIENT_GAME_READY after specifying character region from database or
0x3013 | AGENT_SERVER_ENTITY_SPAWN, you're gonna prevent the character from doing anything that would cancel the cape like using (pvp cape options,movement,exchange,pick,stall,wearing a job suit...etc), some of them might be already blocked with wearing the cape in usual, but taking precautions... Then start wearing the pvp cape using
0x7516 | AGENT_FRPVP_UPDATE with the pvp cape color flag and after the cape is worn, allow him some stuff, like walking.. picking, whatever you want.
OFC, you're gonna need some flags at your packets to prevent them from doing stuff like exchange, you're gonna have to do something like this at your exchange packet section:
Code:
if (this.BlockExchange)
{
this.SendNotice("You are not allowed to use exchange.");
this.continue;
}
And to implement this you can basically do something like this at your
0x3012 | AGENT_CLIENT_GAME_READY section:
Code:
if (this.CurrentRegion == myspecificregion)
{
PrepareWearingCape(true);
}
else
{
PrepareWearingCape(false);
}
While you're having these functions:
Code:
public async void PrepareWearingCape(bool dojobflag)
{
this.BlockMovement = dojobflag;
this.BlockPvPCape = dojobflag;
this.BlockExchange = dojobflag;
this.BlockStall = dojobflag;
this.BlockPick = dojobflag;
this.BlockInventoryControl = dojobflag;
if (dojobflag)
{
this.OpenCape("Yellow");
await Task.Delay(10500); // cape takes 10 seconds to finish, so we're gonna wait 10.5 seconds. We can do it with receiving the server packet but this easier.
this.BlockMovement = false;
this.BlockPick = false;
}
}
public void OpenCape(string color)
{
try
{
int capeindex = 0;
switch (color)
{
case "Red":
capeindex = 1;
break;
case "Black":
capeindex = 2;
break;
case "Blue":
capeindex = 3;
break;
case "White":
capeindex = 4;
break;
case "Yellow":
capeindex = 5;
break;
}
Packet cape = new Packet(0x7516, true);
cape.WriteUInt8(capeindex);
this.LocalSecuirity.Send(cape);
this.SendToHost(true);
}
catch { }
}