Photogenic 24 Posted May 18, 2020 Share Posted May 18, 2020 I am writing a fight class in C# and got it to cast revive on dead party members but it will spam it. This is what I used Quote if (p.IsValid && p.IsDead) { SpellManager.CastSpellByNameOn("Revive", p.Name); Usefuls.WaitIsCasting(); } Btw, huge thanks to @Sye for taking his time to show me around on how to write a fight class in C# I am very grateful Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/ Share on other sites More sharing options...
Matenia 628 Posted May 18, 2020 Share Posted May 18, 2020 (edited) Use a timer you set when using SpellManager.CastSpellByName and add to the condiiton that the timer needs to be ready Edit: Ideally you want one timer per unit guid you tried to rezz Edited May 18, 2020 by Matenia Photogenic 1 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58257 Share on other sites More sharing options...
TheSmokie 242 Posted May 18, 2020 Share Posted May 18, 2020 @Matenia May I ask why a timer? I’ve always found waitiscasting to be the best way Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58258 Share on other sites More sharing options...
Talamin 138 Posted May 18, 2020 Share Posted May 18, 2020 Because you don´t have a cooldown on your revive ability and usefuls.waitiscast just wait until the Cast is done. So when the target don´t accept the ressurrection immediatly he get´s spammed over and over again. Therefore just use a timer for each target you already casted revive on, so it won´t spam revive on the same target again and again. Photogenic and Matenia 2 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58259 Share on other sites More sharing options...
Zan 99 Posted May 18, 2020 Share Posted May 18, 2020 Blacklist the target for an amount of time after use and use the !Blacklisted to cast on others. Photogenic 1 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58262 Share on other sites More sharing options...
TheSmokie 242 Posted May 18, 2020 Share Posted May 18, 2020 @Talamin interesting, isn’t there a lua bool to check of a toon was recently rezzed?? Photogenic 1 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58263 Share on other sites More sharing options...
Ordush 185 Posted May 18, 2020 Share Posted May 18, 2020 46 minutes ago, Sye said: @Talamin interesting, isn’t there a lua bool to check of a toon was recently rezzed?? no Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58264 Share on other sites More sharing options...
Pudge 24 Posted May 19, 2020 Share Posted May 19, 2020 Hey, does anyone know how to revive a player who has already released spirit? Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58265 Share on other sites More sharing options...
TheSmokie 242 Posted May 19, 2020 Share Posted May 19, 2020 using Timer = robotManager.Helpful.Timer; public Spell rezz = new Spell("revive"); if (p.IsDead && ObjectManager.Me.IsAlive && !Fight.InFight && _time.IsReady) { if (ObjectManager.Me.Target != p.Guid) Interact.InteractGameObject(p.GetBaseAddress); rezz.Launch(); Usefuls.WaitIsCasting(); _time.Reset(); } I helped him, Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58266 Share on other sites More sharing options...
Pudge 24 Posted May 19, 2020 Share Posted May 19, 2020 I mean revive player by his empty corpse Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58267 Share on other sites More sharing options...
Matenia 628 Posted May 19, 2020 Share Posted May 19, 2020 Get corpses from objectmanager instead of wowunit or wowplayer Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58270 Share on other sites More sharing options...
TheSmokie 242 Posted May 19, 2020 Share Posted May 19, 2020 https://marsbars.gitlab.io/unoffical-wrobot-api-docs/api/wManager.Wow.ObjectManager.WoWCorpse.html Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58271 Share on other sites More sharing options...
Pudge 24 Posted May 19, 2020 Share Posted May 19, 2020 Works, thanks var corpse = ObjectManager.GetObjectWoWCorpse().FirstOrDefault(); if (corpse.IsValid) { Lua.LuaDoString("print('corpse exists, name: ["+corpse.Name+"], guid: ["+corpse.Guid+"], baseadress: ["+corpse.GetBaseAddress+"]')"); SpellManager.CastSpellByNameLUA("Revive"); Interact.InteractGameObject(corpse.GetBaseAddress); } Photogenic and Talamin 1 1 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58276 Share on other sites More sharing options...
TheSmokie 242 Posted May 19, 2020 Share Posted May 19, 2020 You may want to interact with corpse before casting. Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58280 Share on other sites More sharing options...
Ordush 185 Posted May 19, 2020 Share Posted May 19, 2020 1 hour ago, Sye said: You may want to interact with corpse before casting. You can't interact with released corpses Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58284 Share on other sites More sharing options...
TheSmokie 242 Posted May 19, 2020 Share Posted May 19, 2020 You may need to do some testing with the offsets found Here @iMod used "uint mouseOverGUID = 0x00BD07A0;" or @Droidz used "uint s_MouseOver = 0x00BD0798;" other offsets Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58286 Share on other sites More sharing options...
Ordush 185 Posted May 19, 2020 Share Posted May 19, 2020 He already posted a method that works? Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58287 Share on other sites More sharing options...
TheSmokie 242 Posted May 19, 2020 Share Posted May 19, 2020 yes but this method uses mouseover instead of using interact with a corpse. Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58288 Share on other sites More sharing options...
Droidz 2738 Posted May 20, 2020 Share Posted May 20, 2020 13 hours ago, Sye said: This should work (untested) using System; using System.Linq; using wManager.Wow; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using Timer = robotManager.Helpful.Timer; public static class untested { public static Timer _time = new Timer(5000); public static void Revive(string spellname, int vector) { var corpse = ObjectManager.GetObjectWoWCorpse().FirstOrDefault(o => o.Name == o.Name && o.Position.DistanceTo(ObjectManager.Me.Position) < vector); uint mouseover = 0x00BD07A0; if (_time.IsReady) { Memory.WowMemory.Memory.WriteUInt64(mouseover, corpse.Guid); SpellManager.CastSpellByNameOn(spellname, "mouseover"); Usefuls.WaitIsCasting(); ObjectManager.BlackListGetUnitAttackPlayerGuidTime.Add(corpse.Guid, DateTime.Now + TimeSpan.FromMinutes(1)); _time.Reset(); } } } use this to call for it in your fightclass untested.Revive("Spellname", 25); your code is illogical, mouseover is in wrobot API you don't need to write in memory manually, why do "o.Name == o.Name" ? Why blacklist corpse in blacklist for hostile unit? (and search corpse without check if corpse is in this blacklist). It's nice to help, but this type of code can mislead users. Code (not tested) with target should look like: var revive = new Spell("Revive", false); if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !ObjectManager.Me.IsCast && revive.KnownSpell && revive.IsSpellUsable) { var corpse = ObjectManager.GetObjectWoWCorpse().Where(c => !wManager.wManagerSetting.IsBlackListed(c.Guid)).FirstOrDefault(); if (corpse != null && corpse.IsValid) { Interact.ClearTarget(); // or Interact.InteractGameObject(corpse.GetBaseAddress); revive.Launch(); Interact.InteractGameObject(corpse.GetBaseAddress); wManager.wManagerSetting.AddBlackList(corpse.Guid, 1000 * 60 * 10); } } with focus should look like: var revive = new Spell("Revive", false); if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !ObjectManager.Me.IsCast && revive.KnownSpell && revive.IsSpellUsable) { var corpse = ObjectManager.GetObjectWoWCorpse().Where(c => !wManager.wManagerSetting.IsBlackListed(c.Guid)).FirstOrDefault(); if (corpse != null && corpse.IsValid) { var old = ObjectManager.Me.FocusGuid; ObjectManager.Me.FocusGuid = corpse.Guid; revive.Launch(true, true, false, "focus"); ObjectManager.Me.FocusGuid = old; wManager.wManagerSetting.AddBlackList(corpse.Guid, 1000 * 60 * 10); } } Pudge, Talamin, Ordush and 2 others 5 Link to comment https://wrobot.eu/forums/topic/12172-how-to-cast-revive-once/#findComment-58293 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now