NightDevil ???

11/09/2008 21:29 stephanyd#1
Hi... i'm trying to make NightDevil skill working but i think there is an error in the code... if someone can fix it , it will be cool. It is based on DivineHare code from Kinshi.

Quote:
public bool NightDevil = false;
public uint NDEquipUID = new uint[9];
public string[] NDEquip = new string[9];
public ushort NDModel = 0;
public byte NDLevel = 0;
public bool NDBuff = false;
public DateTime NDBuffed = DateTime.Now;



SkillAttributes[1360] = new ushort[5][];
SkillAttributes[1360][0] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
SkillAttributes[1360][1] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
SkillAttributes[1360][2] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
SkillAttributes[1360][3] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
SkillAttributes[1360][4] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
SkillsDone.Add(1360, 4);



if (SkillId == 1360 && Stamina >= 100)//NightDevil
{
if (!NightDevil)
{
Stamina = 0;
MyClient.SendPacket(General.MyPackets.Vital(UID, 9, Stamina));
NDModel = Model;
if (Equips[1] != null && Equips[1] != "0")
{
NDEquipUID[0] = Equips_UIDs[1];
NDEquip[0] = Equips[1];
UnEquip(1);
RemoveItem(NDEquipUID[0]);
}
if (Equips[2] != null && Equips[2] != "0")
{
NDEquipUID[1] = Equips_UIDs[2];
NDEquip[1] = Equips[2];
UnEquip(2);
RemoveItem(NDEquipUID[1]);
}
if (Equips[3] != null && Equips[3] != "0")
{
NDEquipUID[2] = Equips_UIDs[3];
NDEquip[2] = Equips[3];
UnEquip(3);
RemoveItem(NDEquipUID[2]);
}
if (Equips[4] != null && Equips[4] != "0")
{
NDEquipUID[3] = Equips_UIDs[4];
NDEquip[3] = Equips[4];
UnEquip(4);
RemoveItem(NDEquipUID[3]);
}
if (Equips[5] != null && Equips[5] != "0")
{
NDEquipUID[4] = Equips_UIDs[5];
NDEquip[4] = Equips[5];
UnEquip(5);
RemoveItem(NDEquipUID[4]);
}
if (Equips[6] != null && Equips[6] != "0")
{
NDEquipUID[5] = Equips_UIDs[6];
NDEquip[5] = Equips[6];
UnEquip(6);
RemoveItem(NDEquipUID[5]);
}
if (Equips[7] != null && Equips[7] != "0")
{
NDEquipUID[6] = Equips_UIDs[7];
NDEquip[6] = Equips[7];
UnEquip(7);
RemoveItem(DHEquipUID[6]);
}
if (Equips[8] != null && Equips[8] != "0")
{
NDEquipUID[7] = Equips_UIDs[8];
NDEquip[7] = Equips[8];
UnEquip(8);
RemoveItem(NDEquipUID[7]);
}
if (Equips[9] != null && Equips[9] != "0")
{
NDEquipUID[8] = Equips_UIDs[9];
NDEquip[8] = Equips[9];
UnEquip(9);
RemoveItem(NDEquipUID[8]);
}
if (SkillLvl == 0)
{
NDLevel = 0;
Model = 207;
}
if (SkillLvl == 1)
{
NDLevel = 1;
Model = 207;
}
if (SkillLvl == 2)
{
NDLevel = 2;
Model = 207;
}
if (SkillLvl == 3)
{
NDLevel = 3;
Model = 207;
}
if (SkillLvl == 4)
{
NDLevel = 4;
Model = 207;
}
NightDevil = true;

MyClient.SendPacket(General.MyPackets.Vital(UID, 12, ulong.Parse(Avatar.ToString() + Model.ToString())));
World.UpdateSpawn(this);
}
}




if (NightDevil)
if (DateTime.Now > NDBuffed.AddSeconds(40 + (NDLevel * 10)))
{
ND_ReEquip();
}



if (MyChar.NightDevil)
MyChar.ND_ReEquip();





foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;
if (Char.NightDevil)
Char.ND_ReEquip();
}



public void ND_ReEquip()
{
NightDevil = false;
Model = NDModel;

if (NDEquip[0] != null && NDEquip[0] != "")
{
AddItem(NDEquip[0], 1, NDEquipUID[0]);
GetEquipStats(1, true);
}
if (NDEquip[1] != null && NDEquip[1] != "")
{
AddItem(NDEquip[1], 2, NDEquipUID[1]);
GetEquipStats(2, true);
}
if (NDEquip[2] != null && NDEquip[2] != "")
{
AddItem(NDEquip[2], 3, NDEquipUID[2]);
GetEquipStats(3, true);
}
if (NDEquip[3] != null && NDEquip[3] != "")
{
AddItem(NDEquip[3], 4, NDEquipUID[3]);
GetEquipStats(4, true);
}
if (NDEquip[4] != null && NDEquip[4] != "")
{
AddItem(NDEquip[4], 5, NDEquipUID[4]);
GetEquipStats(5, true);
}
if (NDEquip[5] != null && NDEquip[5] != "")
{
AddItem(NDEquip[5], 6, NDEquipUID[5]);
GetEquipStats(6, true);
}
if (NDEquip[6] != null && NDEquip[6] != "")
{
AddItem(NDEquip[6], 7, NDEquipUID[6]);
GetEquipStats(7, true);
}
if (NDEquip[7] != null && NDEquip[7] != "")
{
AddItem(NDEquip[7], 8, NDEquipUID[7]);
GetEquipStats(8, true);
}
if (NDEquip[8] != null && NDEquip[8] != "")
{
AddItem(NDEquip[8], 9, NDEquipUID[8]);
GetEquipStats(9, true);
}
NDEquip[0] = "";
NDEquip[1] = "";
NDEquip[2] = "";
NDEquip[3] = "";
NDEquip[4] = "";
NDEquip[5] = "";
NDEquip[6] = "";
NDEquip[7] = "";
NDEquip[8] = "";
NDEquipUID[0] = 0;
NDEquipUID[1] = 0;
NDEquipUID[2] = 0;
NDEquipUID[3] = 0;
NDEquipUID[4] = 0;
NEEquipUID[5] = 0;
NDEquipUID[6] = 0;
NDEquipUID[7] = 0;
NDEquipUID[8] = 0;

World.SpawnMeToOthers(this, false);
World.SpawnOthersToMe(this, false);
SendEquips(true);

MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
MyClient.SendPacket(General.MyPackets.Vital(UID, 12, ulong.Parse(Avatar.ToString() + Model.ToString())));
World.UpdateSpawn(this);

World.SpawnMeToOthers(this, false);
World.SpawnOthersToMe(this, false);
SendEquips(true);
}
11/09/2008 21:57 _Emme_#2
Why are you stupid to make a new DHReEquip and such stuffs? Just make something like TransformReEquip and use it for all transforms. Besides,this is the NOOBY way,just learn to code right and be smart,and you dont even need to unequip.
11/09/2008 21:59 tao4229#3
Quote:
Originally Posted by EmmeTheCoder View Post
Why are you stupid to make a new DHReEquip and such stuffs? Just make something like TransformReEquip and use it for all transforms. Besides,this is the NOOBY way,just learn to code right and be smart,and you dont even need to unequip.
This is the nooby way of doing it and is probably 5000 times harder than the real way x.x
11/09/2008 22:13 _Emme_#4
It is. But,it looks more and sounds more simple to noobs,thats why their using it !:)
11/09/2008 22:23 taylor2846#5
well if u are so smart tell us the pro way
11/09/2008 22:29 Valkmax#6
If they tell you, you learn nothing and keep leaching and not learning.
11/09/2008 22:49 tanelipe#7
If you tell them, they learn. If you show them full code they won't. I really think people should just start to 'teach' people who have coded less instead of posting smart ass comments.
11/09/2008 22:57 tao4229#8
Sorry, the person who told me what the actual way is told me not to tell anyone, I'll just stfu now.
11/10/2008 00:44 taylor2846#9
i don't really like people uploading codes so all people do is copy and past because it don't help people to learn just makes them more lazy but i don't like how most people just call people noob's or something when they ask for help i understand if they are asking u to code for them but if tray are trying to code it but they just need a little help people should help them but not do it for them
11/10/2008 00:48 InfamousNoone#10
Too bad nobody will understand or be able to use this;

Code:
        public static void Transform(GameClient Attacker, IBaseEntity Opponent, MAttackData* Data, ref Dictionary<uint, int> Targets)
        {
            Targets = new Dictionary<uint, int>(1);
            Targets.Add(Attacker.AuthId, 0);

            Attacker.Transformation.MDefence = Attacker.Entity.MDefence;
            Attacker.Transformation.Dodge = Attacker.Entity.Dodge;
            Attacker.Transformation.Defence = Attacker.Entity.Defence;
            Attacker.Transformation.TransformID = Data->SpellID;
            string Section = Data->SpellID.ToString() + "-" + Data->SpellLevel.ToString();
            ushort Mesh = Database.Transformation.ReadUInt16(Section, "Mesh", 0);
            if (Mesh != 0)
            {
                Attacker.Stamps.TransformTimeUp = Native.timeGetTime().AddSeconds(Data->SecondsTimer);
                Attacker.Entity.OverlappingMesh = Mesh;
                float Factor = (float)(Attacker.Entity.Hitpoints / Attacker.Entity.MaxHitpoints);
                Attacker.Entity.MaxHitpoints = Database.Transformation.ReadInt32(Section, "HP", 0);
                Attacker.Entity.Hitpoints = Math.Max((int)(Attacker.Entity.MaxHitpoints * Factor), 1);
                Attacker.Entity.MaxAttack = Database.Transformation.ReadUInt32(Section, "MaxAttack", 0);
                Attacker.Entity.MinAttack = Database.Transformation.ReadUInt32(Section, "MinAttack", 0);
                Attacker.Entity.Defence = Database.Transformation.ReadUInt16(Section, "Defence", 0);
                Attacker.Entity.Dodge = Database.Transformation.ReadSByte(Section, "Dodge", 0);
                Attacker.Entity.MDefence = Database.Transformation.ReadUInt16(Section, "MDefence", 0);

                BigUpdatePacket big = new BigUpdatePacket(3);
                big.UID = Attacker.AuthId;
                big[0] = new BigUpdatePacket.Data(UpdateID.Mesh, Attacker.Entity.Data.Model);
                big[1] = new BigUpdatePacket.Data(UpdateID.MaxHitpoints, (uint)Attacker.Entity.MaxHitpoints);
                big[2] = new BigUpdatePacket.Data(UpdateID.Hitpoints, (uint)Attacker.Entity.Hitpoints);
                SendRangePacket.Add(Attacker.Entity, Constants.ViewDistance, 0, big, null);
            }
        }
11/10/2008 02:03 kinshi88#11
I lol'd hard when I saw people we're using my shitty DH code!!!
11/10/2008 09:12 alexbigfoot#12
Quote:
Originally Posted by InfamousNoone View Post
Code:
[B]ushort Mesh = Database.Transformation.ReadUInt16(Section, "Mesh", 0);[/B]
all u need in a transf skill, is the mesh :D,

BY Inf: and is in ur source

Quote:
Originally Posted by kinshi88 View Post
I lol'd hard when I saw people we're using my shitty DH code!!!
i`d never use urs :D
11/10/2008 12:32 Exia13#13
I just lol'd when i saw Kinshi's Sigy :D LOL LOL LOL
So True
11/10/2008 13:21 tao4229#14
Quote:
Originally Posted by alexbigfoot View Post
all u need in a transf skill, is the mesh :D,

BY Inf: and is in ur source


i`d never use urs :D
If you want it the real way, you load the defense and shit of the actual spell, like the official servers.
11/10/2008 18:27 alexbigfoot#15
lol, i didnt ment about the hp and things like that or attack, i mean about the model, without dealing with all that unequip stuff.