Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bueno esto es Algo UNICO! y Exclusivo!
- 1.- Handler.cs bool CanUseSpell Agregaran :
- if (spell.CanUseSkill(spell.ID)) return false;
- ==========================================================
- 2.- Handler.cs void PrepareSpell Agregaran:
- if (spell.CoolDown > 0)
- spell.RemoveCooldown(spell.ID);
- Tener en cuenta: OJO DEBEN PROBAR! SI LES DA ERROR O NO LES DEJA USAR LAS SKILLS NO LO AGREGUEN!
- ==========================================================
- 3.- Handler.cs EN TODAS LAS HABILIDADES! RECUERDEN BIEN! EN TODAS LAS SKILLS AGREGARAN :
- Se Agrega en el If de CanUseSpell, en esa parte osea dentro de esas llaves, por ejemplo:
- if(CanUseSpell(attacker,Owner)
- {
- Codigo de Spell.
- }
- y dentro de eso pegan esto :
- if (spell.CoolDown > 0)
- {
- spell.AddCooldown(spell.ID, (int)spell.CoolDown);
- }
- ===========================================
- 4.- En SpellTable.cs en la class SpellInformation Agregaremos:
- private System.Collections.Concurrent.ConcurrentDictionary<ushort, Native.TIME> Cooldowns;
- public bool RemoveCooldown(ushort skillid)
- {
- KinSocket.Native.TIME time;
- return this.Cooldowns.TryRemove(skillid, out time);
- }
- public void AddCooldown(ushort skillid, int miliseconds)
- {
- if (this.Cooldowns.ContainsKey(skillid))
- {
- Native.TIME time;
- this.Cooldowns.TryRemove(skillid, out time);
- }
- this.Cooldowns.TryAdd(skillid, Native.TIME.Now.AddMilliseconds(miliseconds));
- }
- public bool CanUseSkill(ushort skillid)
- {
- if (this.Cooldowns.ContainsKey(skillid))
- {
- return (Native.TIME.Now >= this.Cooldowns[skillid]);
- }
- return true;
- }
- ARRIBA DEL TODO EN LA PARTE DE LOS USING`S AGREGAREMOS :
- using KinSocket;
- SI NO TIENEN EL DLL KinSocket Referenciado, Referencienlo.
- Despues debajo de lo que agregamos, ponemos :
- public uint CoolDown;
- en el Load :
- information.CoolDown = Convert.ToUInt32(strArray2[47]);
- SI USAN EL "Spells" de Navicat dudo mucho que esto les funque. les recomiendo cambiar al Spell Load de MagicType.txt
- ==========================================
- GUIA FINALIZADA TODOS LOS DERECHOS RESERVADOS Pezzi Tomas (C) 2018!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement