|
You last visited: Today at 12:00
Advertisement
[FIX] HP Bar doesnt fill up 100%
Discussion on [FIX] HP Bar doesnt fill up 100% within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
07/06/2010, 01:24
|
#1
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
[FIX] HP Bar doesnt fill up 100%
Hey guys I know a few people around this forum are having some trouble with their HP bars not filling up properly when you put something on like a Gold Cup or Trophy or something. This is a very easy fix as I will show you below.
Hit the thanks if you like this or use it.
100% coded by me.... Not leeched from anywhere.
Search for
Code:
if (I.ID == 137310 || I.ID == 137410 || I.ID == 137410 || I.ID == 137610 || I.ID == 137710 || I.ID == 137810 || I.ID == 137910)
In character.cs
Under that there should be code that looks like this
Code:
{
E.MaxHP += 30000;
E.defense += 30000;
E.MDef1 += 30000;
}
Under that place this
Code:
if (I.ID == 2100095) //GoldCup
{
E.MaxHP += 1500;
E.MaxMP += 1500;
E.defense += 1000;
E.MagicDamageIncrease += 1000;
E.minatk = 1000;
E.maxatk = 1000;
}
if (I.ID == 2100085) //Gold Trophy
{
E.MaxHP += 1500;
E.MaxMP += 1500;
}
if (I.ID == 2100075) //Gold Prize
{
E.MaxHP += 1500;
E.MaxMP += 1500;
E.defense += 1000;
E.MagicDamageIncrease += 1000;
E.minatk = 1000;
E.maxatk = 1000;
}
if (I.ID == 2100065) //Silver Prize
{
E.MaxHP += 1200;
E.MaxMP += 1200;
}
if (I.ID == 2100055) //Bronze Prize
{
E.MaxHP += 900;
E.MaxMP += 900;
}
Done all of them will now work
|
|
|
07/06/2010, 01:51
|
#2
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
Why not just read the itemtype.dat file? It contains all the item's info, including hp bonuses.
|
|
|
07/06/2010, 02:00
|
#3
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by kinshi88
Why not just read the itemtype.dat file? It contains all the item's info, including hp bonuses.
|
Yes but I added this for people to help them. I have had alot of people ask me how to fix this and I have explained it many many times and I am bored of explaining so I released this.
I know the Itemtype.dat file holds all that information thats how I done this code.
|
|
|
07/06/2010, 02:18
|
#4
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
You don't need to hard-code anything.
Get the info from the itemtype.txt (decrypted itemtype.dat)
Code:
StreamReader sr = new StreamReader("./Database/itemtype.txt");
while (!sr.EndOfStream)
{
string[] data = sr.ReadLine().Split(' ');
BaseItem i = new BaseItem();
i.ID = uint.Parse(data[0]);
i.Name = data[1];
i.ReqJob = byte.Parse(data[2]);
i.ReqProfLvl = byte.Parse(data[3]);
i.ReqLvl = byte.Parse(data[4]);
i.ReqSex = byte.Parse(data[5]);
i.ReqStr = ushort.Parse(data[6]);
i.ReqAgi = ushort.Parse(data[7]);
i.ReqVit = ushort.Parse(data[8]);
i.ReqSpi = ushort.Parse(data[9]);
i.Tradability = byte.Parse(data[10]);
i.Weight = ushort.Parse(data[11]);
i.ShopBuyPrice = uint.Parse(data[12]);
i.Action = uint.Parse(data[13]);
i.MaxPhysAtk = uint.Parse(data[14]);
i.MinPhysAtk = uint.Parse(data[15]);
i.PhysDefence = uint.Parse(data[16]);
i.Dexerity = uint.Parse(data[17]);
i.Dodge = uint.Parse(data[18]);
i.PotAddHP = ushort.Parse(data[19]);
i.PotAddMP = ushort.Parse(data[20]);
i.Durability = ushort.Parse(data[21]);
i.Arrows = ushort.Parse(data[22]);
i.MAttack = uint.Parse(data[30]);
i.Range = ushort.Parse(data[32]);
i.Frequency = uint.Parse(data[33]);
i.ShopCPPrice = uint.Parse(data[37]);
i.Description = data[53];
Kernel.BaseItems.ThreadSafeAdd<uint, BaseItem>(i.ID, i);
}
Then when you're calculating hp, or attacking, take into account the BaseItem info.
Code:
Hitpoints += BaseItem[id].PotAddHP;
Then EVERY item ever is taken into account.
|
|
|
07/06/2010, 02:34
|
#5
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by kinshi88
You don't need to hard-code anything.
Get the info from the itemtype.txt (decrypted itemtype.dat)
Code:
StreamReader sr = new StreamReader("./Database/itemtype.txt");
while (!sr.EndOfStream)
{
string[] data = sr.ReadLine().Split(' ');
BaseItem i = new BaseItem();
i.ID = uint.Parse(data[0]);
i.Name = data[1];
i.ReqJob = byte.Parse(data[2]);
i.ReqProfLvl = byte.Parse(data[3]);
i.ReqLvl = byte.Parse(data[4]);
i.ReqSex = byte.Parse(data[5]);
i.ReqStr = ushort.Parse(data[6]);
i.ReqAgi = ushort.Parse(data[7]);
i.ReqVit = ushort.Parse(data[8]);
i.ReqSpi = ushort.Parse(data[9]);
i.Tradability = byte.Parse(data[10]);
i.Weight = ushort.Parse(data[11]);
i.ShopBuyPrice = uint.Parse(data[12]);
i.Action = uint.Parse(data[13]);
i.MaxPhysAtk = uint.Parse(data[14]);
i.MinPhysAtk = uint.Parse(data[15]);
i.PhysDefence = uint.Parse(data[16]);
i.Dexerity = uint.Parse(data[17]);
i.Dodge = uint.Parse(data[18]);
i.PotAddHP = ushort.Parse(data[19]);
i.PotAddMP = ushort.Parse(data[20]);
i.Durability = ushort.Parse(data[21]);
i.Arrows = ushort.Parse(data[22]);
i.MAttack = uint.Parse(data[30]);
i.Range = ushort.Parse(data[32]);
i.Frequency = uint.Parse(data[33]);
i.ShopCPPrice = uint.Parse(data[37]);
i.Description = data[53];
Kernel.BaseItems.ThreadSafeAdd<uint, BaseItem>(i.ID, i);
}
Then when you're calculating hp, or attacking, take into account the BaseItem info.
Code:
Hitpoints += BaseItem[id].PotAddHP;
Then EVERY item ever is taken into account.
|
Oh didn't understand what you were saying 
Yeah thats a better way of doing it. I am still learning C# though
|
|
|
07/06/2010, 04:22
|
#6
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
Quote:
Originally Posted by mattyc2580
Oh didn't understand what you were saying 
Yeah thats a better way of doing it. I am still learning C# though 
|
Yup, just trying to help
|
|
|
07/06/2010, 11:31
|
#7
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
nice kinshi
|
|
|
07/06/2010, 12:11
|
#8
|
elite*gold: 0
Join Date: May 2007
Posts: 35
Received Thanks: 6
|
Quote:
Originally Posted by kinshi88
You don't need to hard-code anything.
Get the info from the itemtype.txt (decrypted itemtype.dat)
Code:
StreamReader sr = new StreamReader("./Database/itemtype.txt");
while (!sr.EndOfStream)
{
string[] data = sr.ReadLine().Split(' ');
BaseItem i = new BaseItem();
i.ID = uint.Parse(data[0]);
i.Name = data[1];
i.ReqJob = byte.Parse(data[2]);
i.ReqProfLvl = byte.Parse(data[3]);
i.ReqLvl = byte.Parse(data[4]);
i.ReqSex = byte.Parse(data[5]);
i.ReqStr = ushort.Parse(data[6]);
i.ReqAgi = ushort.Parse(data[7]);
i.ReqVit = ushort.Parse(data[8]);
i.ReqSpi = ushort.Parse(data[9]);
i.Tradability = byte.Parse(data[10]);
i.Weight = ushort.Parse(data[11]);
i.ShopBuyPrice = uint.Parse(data[12]);
i.Action = uint.Parse(data[13]);
i.MaxPhysAtk = uint.Parse(data[14]);
i.MinPhysAtk = uint.Parse(data[15]);
i.PhysDefence = uint.Parse(data[16]);
i.Dexerity = uint.Parse(data[17]);
i.Dodge = uint.Parse(data[18]);
i.PotAddHP = ushort.Parse(data[19]);
i.PotAddMP = ushort.Parse(data[20]);
i.Durability = ushort.Parse(data[21]);
i.Arrows = ushort.Parse(data[22]);
i.MAttack = uint.Parse(data[30]);
i.Range = ushort.Parse(data[32]);
i.Frequency = uint.Parse(data[33]);
i.ShopCPPrice = uint.Parse(data[37]);
i.Description = data[53];
Kernel.BaseItems.ThreadSafeAdd<uint, BaseItem>(i.ID, i);
}
Then when you're calculating hp, or attacking, take into account the BaseItem info.
Code:
Hitpoints += BaseItem[id].PotAddHP;
Then EVERY item ever is taken into account.
|
It's not for 5165 LOTF?
Becose 5165 read Items.txt and don't use the same names ID.
|
|
|
07/06/2010, 12:40
|
#9
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
no its not for NewestCoServer Source. its an example. and **** its not called LOTF when do ppl learn that finally
|
|
|
07/06/2010, 13:34
|
#10
|
elite*gold: 0
Join Date: May 2007
Posts: 35
Received Thanks: 6
|
Quote:
Originally Posted by ~Yuki~
no its not for NewestCoServer Source. its an example. and **** its not called LOTF when do ppl learn that finally
|
You don't need to get angry for that, we're not all pro of Conquer PS..
|
|
|
07/06/2010, 14:18
|
#11
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Mine is for NewestCoServer Source. But the other one is just an example for people to work off.
|
|
|
07/06/2010, 19:01
|
#12
|
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
|
Few things,
1. Good work Kinishi.
2. Yuki your very right.
3.
Quote:
It's not for 5165 LOTF?
Becose 5165 read Items.txt and don't use the same names ID.
|
Of course thats not for "lotf" but can very easily be converted or the original to be changed.
Mattyc2580 - Just if every coder for newestcoserver source had common sence like you. :P
|
|
|
07/07/2010, 08:15
|
#13
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
thanks kinishi I finish to convert read of itemtype
|
|
|
07/07/2010, 08:21
|
#14
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
Same here but for my 5017 Lotfie^^
|
|
|
 |
Similar Threads
|
Fill me in
06/15/2010 - Mabinogi - 2 Replies
So I heard DR was banned but I never got to figure out how
I got the jist it was because of CP....
That one guys thread with the comic made me lol
so what happened?
hate to stir up old news but I still don't know
|
how add fill in pack.d00?
01/27/2010 - Dekaron Private Server - 11 Replies
how add file in pack.d00?
|
i need fill Game 2MOONS Action7 & fill Server Action7
12/16/2009 - Dekaron Private Server - 15 Replies
i need fill Game 2MOONS Action7 & fill Server Action7
don't Tellme Go in thees link Category Index - DKundergroud.org File Database
not working
any man help plz
|
hp+ap+ammo fill up work after 9.may.08
05/17/2008 - GunZ - 10 Replies
i have made this myself not leeched from H.C this is totaly different you will see if you know about editing mrs and gunz the duel.
you can swear...
hp+ap fill up.....
ammo fill up from world items....
quest monsters move and hit you {so not like his} ..
no skills or shootin....
works with others...
also i have edited dungeon maps for quest only skeletons spawn with you {it same place were every 1 spawns open your gunz folder quest maps save the dungeon mrs to somewhere on your computer...
|
All times are GMT +1. The time now is 12:01.
|
|