[Classic] 1.13.5.35753 Spell_CancelChannel menu

User Tag List

Results 1 to 4 of 4
  1. #1
    scimmy's Avatar Active Member
    Reputation
    52
    Join Date
    Jul 2020
    Posts
    54
    Thanks G/R
    1/33
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    [Classic] 1.13.5.35753 Spell_CancelChannel

    You want more lua functions reversed? I got you some more lua functions reversed.

    I wanted to cancel channeling when I hit the "stop" button. So I needed to find a function that stops channeling, without doing something dumb like forcing movement to stop the channeled spell or pressing "escape". These solutions are straight up ass.

    Code:
    uint64_t CancelChannelOffset = 0x779D50;
    Usage:
    Code:
    bool cancel_channel(int spell_id) {
        return reinterpret_cast<bool(__fastcall*)(int id, int flags)>(baseAddress + CancelChannelOffset)(spell_id, 40);
    }
    Two ways to get spell ID:
    Code:
    int spell_id = ActivePlayer + 0x188] + 0xA8]
    OR
    Code:
    int spell_id = ActivePlayer + 0x19C0]
    Why do I pass 40 as the second parameter? Fuck if i know, im guessing its some flags. Just pass 40 cuz that's what the game code does.

    [Classic] 1.13.5.35753 Spell_CancelChannel
  2. #2
    air999's Avatar Contributor
    Reputation
    131
    Join Date
    Nov 2014
    Posts
    102
    Thanks G/R
    9/62
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It's not flag, it's code SPELL_FAILED_REASON.Interrupted = 40, used in spellcasts.

    Code:
    	public enum SPELL_FAILED_REASON: byte 
    	{
    		Success = 0,
    		AffectingCombat = 1,
    		AlreadyAtFullHealth = 2,
    		AlreadyAtFullMana = 3,
    		AlreadyAtFullPower = 4,
    		AlreadyBeingTamed = 5,
    		AlreadyHaveCharm = 6,
    		AlreadyHaveSummon = 7,
    		AlreadyOpen = 8,
    		AuraBounced = 9,
    		AutotrackInterrupted = 10,
    		BadImplicitTargets = 11,
    		BadTargets = 12,
    		CantBeCharmed = 13,
    		CantBeDisenchanted = 14,
    		CantBeDisenchantedSkill = 15,
    		CantBeMilled = 16,
    		CantBeProspected = 17,
    		CantCastOnTapped = 18,
    		CantDuelWhileInvisible = 19,
    		CantDuelWhileStealthed = 20,
    		CantStealth = 21,
    		CasterAurastate = 22,
    		CasterDead = 23,
    		Charmed = 24,
    		ChestInUse = 25,
    		Confused = 26,
    		DontReport = 27,
    		EquippedItem = 28,
    		EquippedItemClass = 29,
    		EquippedItemClassMainhand = 30,
    		EquippedItemClassOffhand = 31,
    		Error = 32,
    		Fizzle = 33,
    		Fleeing = 34,
    		FoodLowlevel = 35,
    		Highlevel = 36,
    		HungerSatiated = 37,
    		Immune = 38,
    		IncorrectArea = 39,
    		Interrupted = 40,
    		InterruptedCombat = 41,
    		ItemAlreadyEnchanted = 42,
    		ItemGone = 43,
    		ItemNotFound = 44,
    		ItemNotReady = 45,
    		LevelRequirement = 46,
    		LineOfSight = 47,
    		TargetLowlevel = 48,
    		LowCastlevel = 49,
    		MainhandEmpty = 50,
    		Moving = 51,
    		NeedAmmo = 52,
    		NeedAmmoPouch = 53,
    		NeedExoticAmmo = 54,
    		NeedMoreItems = 55,
    		Nopath = 56,
    		NotBehind = 57,
    		NotFishable = 58,
    		NotFlying = 59,
    		NotHere = 60,
    		NotInfront = 61,
    		NotInControl = 62,
    		NotKnown = 63,
    		NotMounted = 64,
    		NotOnTaxi = 65,
    		NotOnTransport = 66,
    		NotReady = 67,
    		NotShapeshift = 68,
    		NotStanding = 69,
    		NotTradeable = 70,
    		NotTrading = 71,
    		NotUnsheathed = 72,
    		NotWhileGhost = 73,
    		NotWhileLooting = 74,
    		NoAmmo = 75,
    		NoChargesRemain = 76,
    		NoChampion = 77,
    		NoComboPoints = 78,
    		NoDueling = 79,
    		NoEndurance = 80,
    		NoFish = 81,
    		NoItemsWhileShapeshifted = 82,
    		NoMountsAllowed = 83,
    		NoPet = 84,
    		NoPower = 85,
    		NothingToDispel = 86,
    		NothingToSteal = 87,
    		OnlyAbovewater = 88,
    		OnlyDaytime = 89,
    		OnlyIndoors = 90,
    		OnlyMounted = 91,
    		OnlyNighttime = 92,
    		OnlyOutdoors = 93,
    		OnlyShapeshift = 94,
    		OnlyStealthed = 95,
    		OnlyUnderwater = 96,
    		OutOfRange = 97,
    		Pacified = 98,
    		Possessed = 99,
    		Reagents = 100,
    		RequiresArea = 101,
    		RequiresSpellFocus = 102,
    		Rooted = 103,
    		Silenced = 104,
    		SpellInProgress = 105,
    		SpellLearned = 106,
    		SpellUnavailable = 107,
    		Stunned = 108,
    		TargetsDead = 109,
    		TargetAffectingCombat = 110,
    		TargetAurastate = 111,
    		TargetDueling = 112,
    		TargetEnemy = 113,
    		TargetEnraged = 114,
    		TargetFriendly = 115,
    		TargetInCombat = 116,
    		TargetIsPlayer = 117,
    		TargetIsPlayerControlled = 118,
    		TargetNotDead = 119,
    		TargetNotInParty = 120,
    		TargetNotLooted = 121,
    		TargetNotPlayer = 122,
    		TargetNoPockets = 123,
    		TargetNoWeapons = 124,
    		TargetNoRangedWeapons = 125,
    		TargetUnskinnable = 126,
    		ThirstSatiated = 127,
    		TooClose = 128,
    		TooManyOfItem = 129,
    		TotemCategory = 130,
    		Totems = 131,
    		TryAgain = 132,
    		UnitNotBehind = 133,
    		UnitNotInfront = 134,
    		WrongPetFood = 135,
    		NotWhileFatigued = 136,
    		TargetNotInInstance = 137,
    		NotWhileTrading = 138,
    		TargetNotInRaid = 139,
    		TargetFreeforall = 140,
    		NoEdibleCorpses = 141,
    		OnlyBattlegrounds = 142,
    		TargetNotGhost = 143,
    		TransformUnusable = 144,
    		WrongWeather = 145,
    		DamageImmune = 146,
    		PreventedByMechanic = 147,
    		PlayTime = 148,
    		Reputation = 149,
    		MinSkill = 150,
    		NotInArena = 151,
    		NotOnShapeshift = 152,
    		NotOnStealthed = 153,
    		NotOnDamageImmune = 154,
    		NotOnMounted = 155,
    		TooShallow = 156,
    		TargetNotInSanctuary = 157,
    		TargetIsTrivial = 158,
    		BmOrInvisgod = 159,
    		ExpertRidingRequirement = 160,
    		ArtisanRidingRequirement = 161,
    		NotIdle = 162,
    		NotInactive = 163,
    		PartialPlaytime = 164,
    		NoPlaytime = 165,
    		NotInBattleground = 166,
    		NotInRaidInstance = 167,
    		OnlyInArena = 168,
    		TargetLockedToRaidInstance = 169,
    		OnUseEnchant = 170,
    		NotOnGround = 171,
    		CustomError = 172,
    		TooManySockets = 173,
    		CantDoThatRightNow = 173,
    		InvalidGlyph = 175,
    		UniqueGlyph = 176,
    		GlyphSocketLocked = 177,
    		NoValidTargets = 178,
    		ItemAtMaxCharges = 179,
    		NotInBarbershop = 180,
    		FishingTooLow = 181,
    		ItemEnchantTradeWindow = 182,
    		SummonPending = 183,
    		MaxSockets = 184,
    		PetCanRename = 185,
    		TargetCannotBeResurrected = 186,
    		Unknown = 187,
    		Ok = 0xFF
    	}

  3. Thanks ejt (1 members gave Thanks to air999 for this useful post)
  4. #3
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    This is what I got from my research:

    Code:
    			if (Player_LeaveCombatMode())
    				return true;
    
    			if (!unit_->CastSpellId)
    			{
    				if (channeldata())
    					return Spell_CancelChannel(channeldata(), 40);
    				if (*AutoRepeatSpellId)
    					return Spell_CancelAutoRepeat(true);
    			}
    			else
    			{
    				uint64_t v10 = Spell_SomeInfo(reinterpret_cast<object_guid**>(&unit_->SomeSpellGuid), unit_->CastSpellId, &guid(), true);
    
    				auto v11 = *reinterpret_cast<uint32_t*>(v10 + 0x48);
    				auto v12 = SpellDB_GetRow(v11);
    				if (SpellDB_HasAttribute(v12, 10, 0x40000000))
    					return false;
    
    				Spell_CancelCast(v10, 1, 1, 0x1Eu);
    
    				return true;
    			}
    It works well but I didn't complete my research into these functions.

  5. #4
    scimmy's Avatar Active Member
    Reputation
    52
    Join Date
    Jul 2020
    Posts
    54
    Thanks G/R
    1/33
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ejt View Post
    This is what I got from my research:

    Code:
    			if (Player_LeaveCombatMode())
    				return true;
    
    			if (!unit_->CastSpellId)
    			{
    				if (channeldata())
    					return Spell_CancelChannel(channeldata(), 40);
    				if (*AutoRepeatSpellId)
    					return Spell_CancelAutoRepeat(true);
    			}
    			else
    			{
    				uint64_t v10 = Spell_SomeInfo(reinterpret_cast<object_guid**>(&unit_->SomeSpellGuid), unit_->CastSpellId, &guid(), true);
    
    				auto v11 = *reinterpret_cast<uint32_t*>(v10 + 0x48);
    				auto v12 = SpellDB_GetRow(v11);
    				if (SpellDB_HasAttribute(v12, 10, 0x40000000))
    					return false;
    
    				Spell_CancelCast(v10, 1, 1, 0x1Eu);
    
    				return true;
    			}
    It works well but I didn't complete my research into these functions.
    Nice, I've basically reversed the same functions as you, but only to the point where I can call them to achieve the actions I want. Do you generally reimplement the entire lua function and call it as if you were using the Lua API?

Similar Threads

  1. [Classic] 1.13.5.35753 CGItem_C::Use
    By scimmy in forum WoW Memory Editing
    Replies: 2
    Last Post: 09-06-2020, 03:14 AM
  2. [Classic] - 1.13.2.30112 - (Beta)
    By Icesythe7 in forum WoW Memory Editing
    Replies: 0
    Last Post: 04-18-2019, 12:26 AM
  3. [Question] Simple bot for right clicking at xyz position Wow classic 1.13/Arctium
    By Andrehoejmark in forum WoW Bots Questions & Requests
    Replies: 2
    Last Post: 02-11-2019, 04:50 AM
  4. WoW Classic 1.13 Sandbox
    By raido in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 10-24-2018, 06:23 PM
  5. [Selling] Level 60 Hunter. Classic Rank 13 Warlord
    By Tschaenter in forum WoW-EU Account Buy Sell Trade
    Replies: 1
    Last Post: 11-04-2013, 03:21 PM
All times are GMT -5. The time now is 05:59 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search