[Guide]Remove GM protction-send blackname to jail

09/07/2008 16:02 elragal_30#1
# Update 1
Fix dieing into jail again - add message has killed by xx

#Update 2
1-Add NPC To jail to let u out for 4kk or 54 Cps
2- Change points from 99 to 29(you must change code again)


hi
it is first help i make here
plz don't flam , i just send for some newbies that don't know(I'm also noob lol)
and I'm don't take from any one i just make it
and Hint for all beginners don't aim to publish source on line quickly ,but try to learn C# and practice for make any thing yourself
it works for me at shadow server
lets go

First : How to remove GM protection on guards :

Go to "entities.cs" go to line 334
u should find some thing like that :
Quote:
if (MType == 1)
if (Target != null)
if (Target.MyClient.Status == 15)
Target = null;
u may delete it or put protection on type u want
(i just know Status ==8 >> GM / 7 >>>PM )
sorry i'm just starter ,so if u have some thing best tell here for all

Second : How to Make Black Name Send to jail on (Now Working on die so u can't revive him with skill or command):

1-go to "character.cs" go to Line 827 or Search for
Quote:
public void Die()
{
try
{

DeathSent = true;
World.UpdateSpawn(this);


int EModel;
if (Model == 1003 || Model == 1004)
EModel = 15099;
else
EModel = 15199;

XpList = false;
SMOn = false;
CycloneOn = false;
XpCircle = 0;

MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
MyClient.SendPacket(General.MyPackets.Status1(UID, EModel));
MyClient.SendPacket(General.MyPackets.Death(this)) ;

}
}
add
Quote:
if (PKPoints >29)
{
World.SendMsgToAll("Player "+Name+" has Killed Too Much And has been but into Jail at Last ", " Kfa2a[GM]", 2011);
Teleport(6000 ,60 ,60);

}
2-go to "Character.cs" go to Line 795 (Press Ctrl+G):
or search for
[quote]if (Tele)
{
foreach (ushort[] revp in DataBase.RevPoints)
{[QUOTE]
after " { "

and before
Quote:
if (revp[0] == LocMap)
{
Teleport(revp[1], revp[2], revp[3]);
break;
}
add
Quote:
if(PKPoints>29)
{
Teleport(6000,60,60);
}
**Adding Jail NPC

go to ur [Only registered and activated users can see links. Click Here To Register...]
then go to conquer database >> Table >> Npc
Click Insert and fill fields as follow :
Quote:
UID 1250
Type 1160
Name JailWarden (or name u want but must not have space just one word)
Flags 2
Direction 2
X 60
Y 60
Map 1002
Sobtype 0
then go to Your Source >>> Client.Cs
Go to NPC Section>>
and Search for
Quote:
if (CurrentNPC == 211)
{
SendPacket(General.MyPackets.NPCSay("Do you want to leave the market? I can teleport you for free."));
SendPacket(General.MyPackets.NPCLink("Yeah. Thanks.", 1));
SendPacket(General.MyPackets.NPCLink("No, I shall stay here.", 2));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
after it add this :

Quote:
if (CurrentNPC == 1250)
{
SendPacket(General.MyPackets.NPCSay("Hello,I'm Jail Telporter"));
SendPacket(General.MyPackets.NPCSay("i can telport u ,what u want"));
SendPacket(General.MyPackets.NPCLink("Iwant to go out.", 1));
SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
then search for
Quote:
if (CurrentNPC == 211 || CurrentNPC == 180)
{
if (Control == 1)
{
ushort XTo = 429;
ushort YTo = 378;

if (MyChar.PrevMap == 1015)
{
XTo = 717;
YTo = 571;
}
if (MyChar.PrevMap == 1000)
{
XTo = 500;
YTo = 650;
}
if (MyChar.PrevMap == 1011)
{
XTo = 188;
YTo = 264;
}
if (MyChar.PrevMap == 1020)
{
XTo = 565;
YTo = 562;
}

MyChar.Teleport(MyChar.PrevMap, XTo, YTo);
}
}
After it add

Quote:
if (CurrentNPC == 1250)
{
if(Control == 1)
{
SendPacket(General.MyPackets.NPCSay("if You Want to Go out,you must be not red name or Black name."));
SendPacket(General.MyPackets.NPCSay("if You Want to Gou out,you must have PK point Less than 30."));
SendPacket(General.MyPackets.NPCLink("Let me out.", 11));
SendPacket(General.MyPackets.NPCLink("What about me??.", 22));
SendPacket(General.MyPackets.NPCLink("just Passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());

}
if (Control == 11)
{
if (MyChar.PKPoints<30)
{
MyChar.Teleport(1002,350,320);
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry,Your Pk points is more 29 u can't out yet."));
SendPacket(General.MyPackets.NPCLink("How I can get out.", 22));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());

}

}
if (Control == 22)
{
if (MyChar.PKPoints < 30)
{
SendPacket(General.MyPackets.NPCSay("You are free now ,i will telport you."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
MyChar.Teleport(1002, 429, 378);
}
else if (MyChar.PKPoints > 29 && MyChar.PKPoints < 99)
{
SendPacket(General.MyPackets.NPCSay("Sorry,You are Red name, you can't out until Your pk points Less than 29."));
SendPacket(General.MyPackets.NPCSay("or You Can Pay 4,000,000 Cash,it will award to your Killer."));
SendPacket(General.MyPackets.NPCLink("Ok, i will pay.", 40));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());

}
else if (MyChar.PKPoints > 100)
{
SendPacket(General.MyPackets.NPCSay("Sorry,You are Black name, you can't out until Your pk points Less than 29."));
SendPacket(General.MyPackets.NPCSay("or You Can Pay 54 Cps Cash,it will award to your Killer."));
SendPacket(General.MyPackets.NPCLink("Ok, i will pay.", 54));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());

}
}
if (Control == 40)
{
MyChar.Teleport(1002, 427, 378);
MyChar.Silvers -= 4000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));

if (MyChar.Silvers > 3999999)
{
MyChar.Silvers -= 4000000;
MyChar.Teleport(1002, 427, 378);
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Teleport(1002, 350, 320);
World.SendMsgToAll("The Killer " + MyChar.Name + "has pay for his crimes and donate 4,000,000", " Kfa2a[GM]", 2011);
SendPacket(General.MyPackets.NPCSay("i will take 4,000,000 and teleport you."));
SendPacket(General.MyPackets.NPCSay("the money will go to Your Killer."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());


}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry You don't have Enought Silvers"));
SendPacket(General.MyPackets.NPCLink("damn.",255)) ;
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 54)
{
if (MyChar.CPs>53)
{
MyChar.Teleport(1002, 427, 378);
MyChar.CPs -= 54;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
World.SendMsgToAll("The Killer \"" + MyChar.Name + "has payfor his crimes and donate 54 Cps", " Kfa2a[GM]", 2011);

SendPacket(General.MyPackets.NPCSay("i will take 54 cps and teleport you."));
SendPacket(General.MyPackets.NPCSay("the money will go to Your Killer."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());

}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry You don't have Enought Cps"));
SendPacket(General.MyPackets.NPCLink("damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}


}
Wait for update to make money go to killer


Now To Prevent using city Scrolls to use in Jail (ty For @tao4229 for remind me) :
go to Character.cs and search for (Near Line 2808)

Quote:
else if (ItemParts[0] == "1060020")
{
Teleport(1002, 429, 378);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060021")
{
Teleport(1000, 500, 650);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060022")
{
Teleport(1020, 565, 562);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060023")
{
Teleport(1011, 188, 264);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060024")
{
Teleport(1015, 717, 571);
RemoveItem(ItemUID);
}
and exchange with this Code (Make Backup for character.Cs be4 changing it) :

Quote:
else if (ItemParts[0] == "1060020")
{
if(LocMap == 6000 && PKPoints > 29)
return;
Teleport(1002, 429, 378);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060021")
{
if(LocMap == 6000 && PKPoints > 29)
return;
Teleport(1000, 500, 650);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060022")
{
if(LocMap == 6000 && PKPoints > 29)
return;
Teleport(1020, 565, 562);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060023")
{
if(LocMap == 6000 && PKPoints > 29)
return;
Teleport(1011, 188, 264);
RemoveItem(ItemUID);
}
else if (ItemParts[0] == "1060024")
{
if(LocMap == 6000 && PKPoints > 29)
return;
Teleport(1015, 717, 571);
RemoveItem(ItemUID);
}
and now if u want also prevent using "/Scroll " command into jail
go To Client.Cs and Search for
Quote:
if (Splitter[0] == "/scroll")
{
if (Splitter[1] == "pc")
MyChar.Teleport(1011, 188, 264);
if (Splitter[1] == "dc")
MyChar.Teleport(1000, 500, 650);
if (Splitter[1] == "bi")
MyChar.Teleport(1015, 723, 573);
if (Splitter[1] == "ac")
MyChar.Teleport(1020, 565, 562);
if (Splitter[1] == "mk")
MyChar.Teleport(1036, 198, 194);
if (Splitter[1] == "tc")
MyChar.Teleport(1002, 429, 378);
if (Splitter[1] == "jail")
MyChar.Teleport(6000, 50, 50);
if (Splitter[1] == "boss")
MyChar.Teleport(1076, 360, 020);
}
and exchange with :
Quote:
if (Splitter[0] == "/scroll")
{

if (Splitter[1] == "tc")
{

if(MyChar.LocMap == 6000 &&MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1002, 429, 378);
}
if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scroll Command here untill your Pk points less than 99 " , 2005));
}
}
if (Splitter[1] == "mk")
{

if(MyChar.LocMap == 6000 &&MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1036, 198, 194);
}
if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scroll Command here untill your Pk points less than 29 " , 2005));
}
}



if (Splitter[1] == "dc")
{
if(MyChar.LocMap == 6000 && MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1000, 500, 650);

}

if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scrolls Command here untill your Pk points less than 29 " , 2005));
}

}
if (Splitter[1] == "ac")
{
if(MyChar.LocMap == 6000 && MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1020, 565, 562);

}

if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scrolls Command here untill your Pk points less than 29 " , 2005));
}

}
if (Splitter[1] == "pc")
{
if(MyChar.LocMap == 6000 && MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1011, 188, 264);

}

if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scrolls Command here untill your Pk points less than 29 " , 2005));
}

}
if (Splitter[1] == "bi")
{
if(MyChar.LocMap == 6000 && MyChar.PKPoints < 29 || MyChar.LocMap != 6000)
{
MyChar.Teleport(1015, 717, 571);

}

if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scrolls Command here untill your Pk points less than 29 " , 2005));
}

}
}
sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
09/07/2008 18:41 tao4229#2
TBH, I got like the latest version of LOTF out there, so the jail thing was already in mine, but if you do it this way, you can scroll out of jail... so... You may want to look in the scroll Item usage and add some if statements =]
09/07/2008 19:07 nTL3fTy#3
What about protection against XP Revive and Pray - reviving the dead blackname, thus not using revive points..?
09/07/2008 19:42 YukiXian#4
[quote=elragal_30;1416754]hi
it is first help i make here
plz don't flam , i just send for some newbies that don't know(I'm also noob lol)
and I'm don't take from any one i just make it
and Hint for all beginners don't aim to publish source on line quickly ,but try to learn C# and practice for make any thing yourself
it works for me at shadow server
lets go

First : How to remove GM protection on guards :

Go to "entities.cs" go to line 334
u should find some thing like that :

u may delete it or put protection on type u want
(i just know Status ==8 >> GM / 7 >>>PM )
sorry i'm just starter ,so if u have some thing best tell here for all

Second : How to Make Blue Name Send to jail on (revive not on die):

go to "Character.cs" go to Line 795 (Press Ctrl+G):
or search for
[QUOTE]if (Tele)
{
foreach (ushort[] revp in DataBase.RevPoints)
{
Quote:
after " { "

and before
add

sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
Just make the Jail System when you Die, Very easy to code, ...
09/07/2008 22:06 elragal_30#5
@nTL3fTy
u mean u want black name don't revive
idk because i don't have revive work on my source yet
but i think that solve that u but this on Die Void not at Revive , i'll try when i get Revive Skill work
##EDIT##Fixed now when u die u sent to jail immediately and when revive also sent to jail
so u'll not be able to revive him
@YukiXian
yes i will be already more useful ,but i can't code it yet ,if u know post it
##Edit##i aready Fix it Now and update Topic
09/07/2008 23:55 nTL3fTy#6
Quote:
Originally Posted by elragal_30 View Post
sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
For checking if the character is in jail with more than 99 PK Points:
Code:
                if (LocMap == 6000 && PKPoints > 99)
                    return;
That goes before anything happens of course:
Code:
            else if (ItemParts[0] == "1060020")
            {
                if (LocMap == 6000 && PKPoints > 99)
                    return;
                Teleport(1002, 429, 378);
                RemoveItem(ItemUID);
            }
09/08/2008 03:20 elragal_30#7
Quote:
Originally Posted by nTL3fTy View Post
For checking if the character is in jail with more than 99 PK Points:
Code:
                if (LocMap == 6000 && PKPoints > 99)
                    return;
That goes before anything happens of course:
Code:
            else if (ItemParts[0] == "1060020")
            {
                if (LocMap == 6000 && PKPoints > 99)
                    return;
                Teleport(1002, 429, 378);
                RemoveItem(ItemUID);
            }
mm yes
it is more better i think it save memory
r u good at c# coding ??
can u help me in some things ???
09/08/2008 03:38 pegaeu#8
the players leaves the NPC how i fix it?...
if (CurrentNPC == 104801)
{

if (Control == 1)
{
if (MyChar.LocMap == 6000 && MyChar.PKPoints > 99)
{
MyChar.Teleport(1002, 514, 355);
}
}
}
and, the players die in jail when they are taken again get jail ..:(
09/08/2008 04:32 elragal_30#9
Quote:
Originally Posted by pegaeu View Post
the players leaves the NPC how i fix it?...
if (CurrentNPC == 104801)
{

if (Control == 1)
{
if (MyChar.LocMap == 6000 && MyChar.PKPoints > 99)
{
MyChar.Teleport(1002, 514, 355);
}
}
}
and, the players die in jail when they are taken again get jail ..:(
sorry idk what u mean ??
u want make Jail Npc let pepople to leave jail when the lost them pk points ??
and what u mean by
Quote:
and, the players die in jail when they are taken again get jail
09/08/2008 04:57 pegaeu#10
1º Yes, the players leaving the jail blackname
2º when a player die inside the jail he sends dagain to prison*
09/09/2008 07:43 ~Yuki~#11
Hmm nice guide^^
09/09/2008 15:28 glupkotrup#12
Well basically yes, but you should do some editing first... When you got killed you are being sent to Jail, but you can leave it when you have 100+ pkp (Black named). Also I got request where players want to pay dbs to get out of jail, so actually you can add a NPC which will ask you for X CPs or X DBs to let you go out of jail (working similar like conductress but requires items or cps for it). And I think there should be rewards for those who'll capture black named players, so they code have a motive to kill them (or it will be pointless killing them)
09/10/2008 01:14 tao4229#13
Quote:
Originally Posted by glupkotrup View Post
Well basically yes, but you should do some editing first... When you got killed you are being sent to Jail, but you can leave it when you have 100+ pkp (Black named). Also I got request where players want to pay dbs to get out of jail, so actually you can add a NPC which will ask you for X CPs or X DBs to let you go out of jail (working similar like conductress but requires items or cps for it). And I think there should be rewards for those who'll capture black named players, so they code have a motive to kill them (or it will be pointless killing them)
Make it so black/rednames drop equips?
09/10/2008 14:32 glupkotrup#14
Well that will work too but like I did on official co... I killed a black named and won 50 cps :D
09/10/2008 22:15 tao4229#15
Quote:
Originally Posted by glupkotrup View Post
Well that will work too but like I did on official co... I killed a black named and won 50 cps :D
That's not hard to code either x.x