Criando um Conquer
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Novos Skil e itens Tro

3 participantes

Ir para baixo

Novos Skil e itens Tro Empty Novos Skil e itens Tro

Mensagem por Planet-CO Qui maio 29, 2014 7:39 pm

packethandler.cs
Preucure =public static Positions GetPositionFromID(UInt32 itemid)
coloque

public static Positions GetPositionFromID(UInt32 itemid)
       {
           UInt32 iType = itemid / 1000;
           if (iType == 614)
               return Positions.Right;
           if (iType >= 111 && iType <= 118 || iType == 123 || iType >= 141 && iType <= 144)
               return Positions.Head;
           else if (iType >= 120 && iType <= 121)
               return Positions.Necklace;
           else if (iType >= 130 && iType <= 139)
               return Positions.Armor;
           else if (iType >= 150 && iType <= 152)
               return Positions.Ring;
           else if (iType == 160)
               return Positions.Boots;
           else if (iType >= 181 && iType <= 194)
               return Positions.Garment;
           else if (iType == 201)
               return Positions.AttackTalisman;
           else if (iType == 202)
               return Positions.DefenceTalisman;
           else if (iType == 203)
               return Positions.SteedTalisman;
           else if (iType == 200)
               return Positions.SteedArmor;
           else if (iType == 300)
               return Positions.Steed;
           else if (iType == 2100)
               return Positions.Bottle;
           else if (iType == 1050 || iType == 900)
               return Positions.Left;
           else if ((iType >= 410 && iType <= 490) || (iType >= 500 && iType <= 580) || (iType >= 601 && iType <= 613))
               return Positions.Right;
           else if (iType >= 350 && iType <= 370)
               return Positions.RightAccessory;
           else if (iType == 380)
               return Positions.LeftAccessory;



           else return (Positions)0;
       }
       public static ushort ItemPosition(uint ID)
       {
           UInt32 iType = ID / 1000;
           if (iType == 614)
               return ConquerItem.RightWeapon;
           if (ID == 134155 || ID == 131155 || ID == 133155 || ID == 130155)
               return ConquerItem.Garment;

           if ((ID >= 111003 && ID <= 118309) || (ID >= 123000 && ID <= 123309) || (ID >= 141003 && ID <= 144309))
               return ConquerItem.Head;

           else if (ID >= 120001 && ID <= 121269)
               return ConquerItem.Necklace;

           else if (ID >= 130003 && ID <= 139309)
               return ConquerItem.Armor;

           else if (ID >= 150000 && ID <= 152279)
               return ConquerItem.Ring;

           else if (ID >= 160013 && ID <= 160249)
               return ConquerItem.Boots;

           else if (ID >= 181305 && ID <= 194300)
               return ConquerItem.Garment;

           else if (ID >= 201003 && ID <= 201009)
               return ConquerItem.Fan;

           else if (ID >= 202003 && ID <= 202009)
               return ConquerItem.Tower;

           else if (ID >= 203003 && ID <= 203009)
               return ConquerItem.SteedCrop;

           else if (ID == 300000)
               return ConquerItem.Steed;
           else if (ID >= 410003 && ID <= 613439)
               return ConquerItem.RightWeapon;
           else if ((ID >= 900000 && ID <= 900309) || (ID >= 1050000 && ID <= 1051000))
               return ConquerItem.LeftWeapon;
           else if (ID >= 2100025 && ID <= 2100095)
               return ConquerItem.Bottle;
           else if (ID >= 350001 && ID <= 380015)
               return ConquerItem.LeftWeaponAccessory;
           else if (ID >= 350001 && ID <= 380015)
               return ConquerItem.RightWeaponAccessory;
           else if (ID >= 200000 && ID <= 200500)
               return ConquerItem.SteedArmor;
           return 0;
       }


agora em handle adicona os Skil

#region New Trojan
                               #region SuperCyclone
                               case 11970:  
                                   {                                      
                                       SpellUse suse = new SpellUse(true);
                                       suse.Attacker = attacker.UID;
                                       suse.SpellID = spell.ID;
                                       suse.SpellLevel = spell.Level;
                                       suse.X = X;
                                       suse.Y = Y;
                                       if (attacker.OnSuperCyclone())
                                           return;
                                       if (attacker.ContainsFlag(Update.Flags.XPList))
                                       {
                                           attacker.AddFlag3((uint)Update.Flags3.SuperCyclone);
                                           attacker.SuperCycloneStamp = Time32.Now;
                                           attacker.RemoveFlag(Update.Flags.XPList);
                                       }                                        
                                       attacker.Owner.SendScreen(suse, true);
                                       break;
                                   }
                               #endregion
                               #region FatalCross
                               case 11980:
                                   {
                                       if (CanUseSpell(spell, attacker.Owner))
                                       {
                                           PrepareSpell(spell, attacker.Owner);
                                           SpellUse suse = new SpellUse(true);
                                           suse.Attacker = attacker.UID;
                                           suse.SpellID = spell.ID;
                                           suse.SpellLevel = spell.Level;
                                           ushort _X = attacker.X, _Y = attacker.Y;
                                           ushort _tX = X, _tY = Y;
                                           byte dist = (byte)spell.Distance;
                                           var Array = attacker.Owner.Screen.Objects;
                                           InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                              InLineAlgorithm.Algorithm.DDA);
                                          // X = attacker.X;
                                         //  Y = attacker.Y;
                                           int i = algo.lcoords.Count;
                                          /* for (i = 0; i < algo.lcoords.Count; i++)
                                           {
                                               if  (attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y,  MapObjectType.Player]
                                                   && !attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                               {
                                                   X = (ushort)algo.lcoords[i].X;
                                                   Y = (ushort)algo.lcoords[i].Y;
                                               }
                                               else
                                               {
                                                   break;
                                               }
                                           }*/
                                           double disth = 1.5;
                                           if (attacker.MapID == DeathMatch.MAPID) disth = 1;                                
                                           suse.X = X;
                                           suse.Y = Y;  
                                           foreach (Interfaces.IMapObject _obj in Array)
                                           {
                                               bool hit = false;
                                               for (int j = 0; j < i; j++)
                                                   if  (Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X,  (ushort)algo.lcoords[j].Y) <= disth)
                                                       hit = true;
                                               if (hit)
                                               {
                                                   if (_obj.MapObjType == MapObjectType.Monster)
                                                   {
                                                       attacked = _obj as Entity;
                                                       if  (CanAttack(attacker, attacked, spell, attack.AttackType ==  Attack.Melee))
                                                       {
                                                           var damage =  Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);

                                                           ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                           suse.AddTarget(attacked.UID, damage, attack);
                                                       }
                                                   }
                                                   else if (_obj.MapObjType == MapObjectType.Player)
                                                   {
                                                       attacked = _obj as Entity;
                                                       if  (CanAttack(attacker, attacked, spell, attack.AttackType ==  Attack.Melee))
                                                       {
                                                           var damage =  Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);

                                                           ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                           suse.AddTarget(attacked.UID, damage, attack);
                                                       }
                                                   }
                                                   else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                   {
                                                       attackedsob = _obj as SobNpcSpawn;
                                                       if (CanAttack(attacker, attackedsob, spell))
                                                       {
                                                           var damage =  Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

                                                           ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                           suse.AddTarget(attackedsob.UID, damage, attack);
                                                       }
                                                   }
                                               }
                                           }                                          
                                           attacker.Owner.SendScreen(suse, true);
                                           
                                       }
                                       break;
                                   }
                               #endregion
                               #region BreathFocus
                               case 11960:
                                   {
                                       SpellUse suse = new SpellUse(true);
                                       suse.Attacker = attacker.UID;
                                       suse.SpellID = spell.ID;
                                       suse.X = attacker.X;
                                       suse.Y = attacker.Y;                                        
                                       suse.Targets.Add(attacker.UID, 0);
                                       attacker.Owner.SendScreen(suse, true);
                                       attacker.Stamina +=  (byte)spell.Power;                                                                              
                                       break;
                                   }
                               #endregion
                               #region MortalStrike
                               case 11990:
                                   {
                                       if (CanUseSpell(spell, attacker.Owner))
                                       {
                                           PrepareSpell(spell, attacker.Owner);

                                           SpellUse suse = new SpellUse(true);
                                           suse.Attacker = attacker.UID;
                                           suse.SpellID = spell.ID;
                                           suse.SpellLevel = spell.Level;
                                           suse.X = X;
                                           suse.Y = Y;
                                           Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                           sector.Arrange(spell.Sector, spell.Range);
                                           if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
                                           {
                                               foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                               {
                                                   if (_obj == null)
                                                       continue;
                                                   if (_obj.MapObjType  == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                   {
                                                       attacked = _obj as Entity;

                                                       if (sector.Inside(attacked.X, attacked.Y))
                                                       {
                                                           if  (CanAttack(attacker, attacked, spell, attack.AttackType ==  Attack.Melee))
                                                           {
                                                               attack.Effect1 = Attack.AttackEffects1.None;
                                                               uint  damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref  attack);
                                                               suse.Effect1 = attack.Effect1;

                                                               ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                               suse.AddTarget(attacked.UID, damage, attack);
                                                           }
                                                       }
                                                   }
                                                   else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                   {
                                                       attackedsob = _obj as SobNpcSpawn;

                                                       if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                       {
                                                           if (CanAttack(attacker, attackedsob, spell))
                                                           {
                                                               attack.Effect1 = Attack.AttackEffects1.None;
                                                               uint  damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref  attack);
                                                               damage = (uint)(damage * spell.PowerPercent);
                                                               ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                               suse.AddTarget(attackedsob.UID, damage, attack);
                                                           }
                                                       }
                                                   }
                                               }
                                           }
                                           else
                                           {
                                               attacker.AttackPacket = null;
                                           }
                                           attacker.Owner.SendScreen(suse, true);
                                       }
                                       break;
                                   }
                               #endregion                                
                               #endregion

em Entity.cs adicione

public bool OnSuperCyclone()
       {
           return ContainsFlag3((uint)Network.GamePackets.Update.Flags3.SuperCyclone);
       }

em spelluse.cs adicone

public class DamageClass
       {
           public uint Damage;
           public bool Hit;
           public ushort newX, newY;
           public Attack.AttackEffects1 Eff1;
           public Attack.AttackEffects2 Eff2;

           public static implicit operator uint(SpellUse.DamageClass dmg)
           {
               return dmg.Damage;
           }

           public static implicit operator SpellUse.DamageClass(uint dmg)
           {
               return new SpellUse.DamageClass { Damage = dmg, Hit = true };
           }
       }
Planet-CO
Planet-CO
Membro
Membro

Mensagens : 7
Data de inscrição : 28/05/2014
Idade : 30
Localização : aracaju-segipe

Ir para o topo Ir para baixo

Novos Skil e itens Tro Empty Re: Novos Skil e itens Tro

Mensagem por PauloMasterCo Seg Jun 02, 2014 1:44 am

as armas e as skills ta full ?
PauloMasterCo
PauloMasterCo
Membro
Membro

Mensagens : 17
Data de inscrição : 30/05/2014
Idade : 28
Localização : Junqueiropolis

Ir para o topo Ir para baixo

Novos Skil e itens Tro Empty Re: Novos Skil e itens Tro

Mensagem por Planet-CO Seg Jun 02, 2014 3:39 pm

sim
Planet-CO
Planet-CO
Membro
Membro

Mensagens : 7
Data de inscrição : 28/05/2014
Idade : 30
Localização : aracaju-segipe

Ir para o topo Ir para baixo

Novos Skil e itens Tro Empty Re: Novos Skil e itens Tro

Mensagem por ArnaldoPrieto Qua Jun 25, 2014 3:27 am

Mano, detalha melhor ai, pq ta dando varios erros de variaveis sem definiçao, organizado melhor o topico é otimo

ArnaldoPrieto
Membro
Membro

Mensagens : 5
Data de inscrição : 28/05/2014

Ir para o topo Ir para baixo

Novos Skil e itens Tro Empty Re: Novos Skil e itens Tro

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos