Jump to content

Lightguard

Members
  • Posts

    208
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Lightguard

  1. No, no, it looks i wasn't clear enough. Look at the declaraion of bool is_sspt. You'll see that it is done by the function called IsSingleFromSpellSpecificRanksPerTarget and the 2 arguments are spellspec and i_spellspec which are defined by the function GetSpellSpecific. You'll have to somewhat modify these functions, i'll explain it with an example. Paladin Greater Blessing don't stack as u can see in the latest core. In RemoveNoStackAurasDueToAura the server has an aura (that we check stacking for) and the auramap of the aura's target. While iterating through th auramap it compares the araus to each other in many ways. The one you'll need is sspt. For both spells it determines their spellspecific in spellspecific and i_spellspecific (you'll see both clearly declared) by calling GetSpellSpecific for both the aura we check and the current aura in the iterator. In GetSpellSpecific there is a simple check that returns SpellSpecific that is from enum SpellSpecific. In thi enum you'll see many spells besides the paladin blessing well as a first step you should add totems here with something like SPELL_TOTEM. If you did that let's get back to GetSpellSpecific. In this funciton you'll have to create a case for totem spells. For this you'll have to find something that clearly and exactly identifies totem spells and do not affect more than required. It is clear what it does if you look at the code (SpellMgr.cpp). If that's done go back to is_sspt bool which will do the real work. In IsSingleFromSpellSpecificRanksPerTarget happens the real decision that spels _that have spellspecific_ can stack or not. Here you'll just have to declare that if both spells are SPELL_TOTEM, then it should return true, this way preventing stacking. I hope this'll be clear and detailed enough;)
  2. As 1 shaman can have only one totem at a time, the real problem is that totem effects stack _from different casters_. This could probably be solved usin the check in Unit::RemoveNoStackAurasDueToAura. Try to find an attribute or something in the dbc files that could properly identify those spells and try to add it to the spellspecific defines, and to GetSpellSpecific. If you were successful you have a good chance to make them don't stack using IsSingleFromSpellSpecificRanksPerTarget. I hope it solves it, at least it should.
  3. At least it will not crash;)
  4. True, that really looks to be a typo. THank you for your help.
  5. Then probably we should remove only daze effects that have triggeredbyaura?
  6. None of those auras should get removed on shapeshifting. It removes only movement impairing effects while the ones you mentioned with the exception of daze are loss of control effects. Daze is another story, but that shouldn't get removed too. It is working as intended.
  7. It is working how it is but, but only because of another bug... so nvm...
  8. Looks nice except the problem that you remove an aura while using AuraList::const_iterator. Take a look at other examples in the source how this should be done, there are many of them.
  9. Please look into the source and try to look at already existing examples. Btw. no, the correct form would be SpellFamilyFlags & UI64LIT(0x00002307)
  10. Well it is really some sort of specific case i think next time could you please print spellId, player, m_CastItem, pItem in the next function and *this everywhere? Sorry for asking this much but it would be really useful.
  11. yeah, that's exactly the problem:)
  12. Ice lance requires it for damage multiplication that is done in Unit::SpellDamageBonus Deep freeze has aurastate and there's something like shatter or what that adds some crit chance if the target is frozen so it is implemented in the corresponding function. But all of them somehow dependent of that aurastate, all of them ends up somehow at unit->HasAuraState(AURA_STATE_FROZEN);
  13. Fingers of frost affects spells that have AURA_STATE_FROZEN in their TargetAuraState in Spell.dbc.
  14. UI64LIT is a simple macro for handling 64 bit values.
  15. If you look into the soruce, you'll clearly see that the spellfamilyflag for all ranks of a spell is usually the same. These familyflags are collected from dbc files. There're 3 of them in dbc and 2 of them in the source as the first 2 are "put together". Getting them is pretty easy look around in the contrib directory of the source and you'll find a few useful tools.
  16. 1. It would be terribly hacky to do so becuse of the direct calls to HasAuraState on the target, which still can be solved but this cannot be the general solution. Also note that this aura is used to override combat requirement too, and simply overriding aurastate checks would never solve that. 2. Shadowdance uses 275 afaik that's ignore form aura.
  17. Ah, yes you're definetly right, and this sniff you've got is interesting. We could takea deeper look into it... This may also be the solution for spells that would require targetaurastate eg. Fingers of Frost, but implementing it in a way that we pretend the aurastate for the next target would be terribly hacky.
  18. I don't know if it is effective on characters that have learned rune strike before.
  19. Why? it is unsigned so it can't be negative, so zero check is enough.
  20. You're missing DB content INSERT INTO spell_learn_spell () VALUES (56815, 56816, 0);
  21. Well, while searching for a solution for the Hand of Salvation problem i found the general solution fot this spell... diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b8c0f80..e9b4218 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1190,7 +1190,8 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) return; } - unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + if(!isSpellBreakStealth(m_spellinfo)) + unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO)) { Patchfile
  22. Well, i updated and corrected the patch as much as i could for those who need it. It should also solve the cheating part (tried to cheat with it and i couldn't). The cheat fix part can be easilly separated if you want only that. rev. 8252 diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 0ac47c6..7ac271f 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -751,6 +751,16 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const { ItemPrototype const* proto = GetProto(); + // Enchant spells have only effect[0] + if(proto->IsVellum() && spellInfo->Effect[0] == SPELL_EFFECT_ENCHANT_ITEM && spellInfo->EffectItemType[0]) + { + if(proto->SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT && spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON) + return true; + else if(proto->SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT && spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR) + return true; + } + // Vellum enchant case should ignore everything below + if (spellInfo->EquippedItemClass != -1) // -1 == any item class { if(spellInfo->EquippedItemClass != int32(proto->Class)) @@ -1013,4 +1023,4 @@ bool ItemRequiredTarget::IsFitToRequirements( Unit* pUnitTarget ) const default: return false; } -} \\ No newline at end of file +} diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index 9974030..f9fb7da 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -115,6 +115,7 @@ enum ITEM_FLAGS ITEM_FLAGS_THROWABLE = 0x00400000, // not used in game for check trow possibility, only for item in game tooltip ITEM_FLAGS_SPECIALUSE = 0x00800000, // last used flag in 2.3.0 ITEM_FLAGS_BOA = 0x08000000, // bind on account (set in template for items that can binded in like way) + ITEM_FLAGS_SCROLL_ENCHANT = 0x10000000, ITEM_FLAGS_MILLABLE = 0x20000000 }; @@ -622,6 +623,7 @@ struct ItemPrototype bool IsPotion() const { return Class==ITEM_CLASS_CONSUMABLE && SubClass==ITEM_SUBCLASS_POTION; } bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAGS_CONJURED); } + bool IsVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && (0xC000 & (1<<SubClass)); } }; struct ItemLocale diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b8c0f80..c0f0019 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3521,6 +3521,10 @@ void Spell::TakeReagents() if (p_caster->CanNoReagentCast(m_spellInfo)) return; + // Vellum case, m_CastItem is consumable -> removed on use, vellum is deleted in DoCreateItem + if(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_SCROLL_ENCHANT) + return; + for(uint32 x = 0; x < 8; ++x) { if(m_spellInfo->Reagent[x] <= 0) @@ -4405,6 +4409,32 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_BAD_TARGETS; break; } + case SPELL_EFFECT_ENCHANT_ITEM: + { + if(Item* Target = m_targets.getItemTarget()) + { + // Check cheating case + if(!Target->IsFitToSpellRequirements(m_spellInfo)) + return SPELL_FAILED_BAD_TARGETS; + + // Do not enchant vellum with scroll + if(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_SCROLL_ENCHANT && Target->GetProto()->IsVellum()) + return SPELL_FAILED_BAD_TARGETS; + + // Check if we can store a new scroll + if(Target->GetProto()->IsVellum() && m_spellInfo->EffectItemType[i]) + { + ItemPosCountVec dest; + uint8 msg = ((Player*)m_caster)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, m_spellInfo->EffectItemType[i], 1 ); + if(msg != EQUIP_ERR_OK) + { + ((Player*)m_caster)->SendEquipError( msg, NULL, NULL ); + return SPELL_FAILED_DONT_REPORT; + } + } + } + break; + } default:break; } } @@ -5044,12 +5074,17 @@ SpellCastResult Spell::CheckItems() uint32 itemid = m_spellInfo->Reagent[i]; uint32 itemcount = m_spellInfo->ReagentCount[i]; + // If item is a scroll enchant we don't need reagents + if(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_SCROLL_ENCHANT) + break; + // if CastItem is also spell reagent if( m_CastItem && m_CastItem->GetEntry() == itemid ) { ItemPrototype const *proto = m_CastItem->GetProto(); if(!proto) return SPELL_FAILED_ITEM_NOT_READY; + for(int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s) { // CastItem will be used up and does not count as reagent @@ -5087,6 +5122,13 @@ SpellCastResult Spell::CheckItems() uint32 TotemCategory = 2; for(int i= 0; i < 2; ++i) { + // Skip for scroll enchant case + if(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_FLAGS_SCROLL_ENCHANT) + { + TotemCategory = 0; + break; + } + if(m_spellInfo->TotemCategory[i] != 0) { if( p_caster->HasItemTotemCategory(m_spellInfo->TotemCategory[i]) ) @@ -5839,4 +5881,4 @@ void Spell::FillRaidOrPartyHealthPriorityTargets( UnitList &TagUnitMap, Unit* me TagUnitMap.push_back(healthQueue.top().getUnit()); healthQueue.pop(); } -} \\ No newline at end of file +} diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 7a6ed0c..e60573e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2749,7 +2749,11 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype) // send info to the client if(pItem) + { + if(Item* ItemTarget = m_targets.getItemTarget()) + player->DestroyItemCount(ItemTarget->GetEntry(), 1, true); player->SendNewItem(pItem, num_to_add, true, true); + } // we succeeded in creating at least one item, so a levelup is possible player->UpdateCraftSkill(m_spellInfo->Id); @@ -3902,6 +3906,14 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx) if(!item_owner) return; + ItemPrototype const* targetProto = itemTarget->GetProto(); + if(m_spellInfo->EffectItemType[effect_idx] && targetProto->IsVellum()) + { + unitTarget = m_caster; + DoCreateItem(effect_idx,m_spellInfo->EffectItemType[effect_idx]); + return; + } + if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) { sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", Patchfile
  23. No, as i said i can't update it yet, i cannot compile mangos now.
  24. Sounds pretty nice... I'm sorry for lating this much but i cannot compile a new version of mangos for a while now. Anyways, probably this should solve this nice cheat... From d20622dc9cb298eca1ca3bcdf601025764612dae Mon Sep 17 00:00:00 2001 From: Lightguard <[email="[email protected]"][email protected][/email]> Date: Sat, 11 Jul 2009 09:09:32 +0200 Subject: [PATCH] - Make our beloved cheaters happy --- src/game/Spell.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4cd2aaf..603e6cb 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4360,6 +4360,16 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_BAD_TARGETS; break; } + case SPELL_EFFECT_ENCHANT_ITEM: + { + if(Item* targetItem = m_targets.getItemTarget()) + { + if(targetItem->GetProto()->Class != m_spellInfo->EquippedItemClass || + ((1<<targetItem->GetProto()->SubClass) & m_spellInfo->EquippedItemSubClassMask)==0) + return SPELL_FAILED_BAD_TARGETS; + } + break; + } default:break; } } -- 1.6.3.2.1299.gee46c I couldn't test it, so please be careful, but it should solve the problem mentioned now also here and on mangos.ru. Hopefully. ::Edit:: I hope it covers the part on mangos.ru too (for some reaason i have only 2 posts so i couldn't read it:D)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use