Jump to content
  • 0
OMGhixD

C++ error - Instant Enchant / Scrolls

Question

So i've got some issues with my small unit.cpp modification

 

		// Instant Enchants / Scrolls
	if (SpellProto->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM || SpellProto->Effects[0].Effect == SPELL_EFFECT_APPLY_GLYPH || SpellProto->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC)
    castTime = 1;

^ Script

 

Error	1	error C2059: syntax error : '->'	Unit.cpp	14497	1	game


^ Error

 

Thank you in any advance :)

 

Sincerely

OMGhixD

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Change:

SpellProto->Effects[0].Effect

to:

spellInfo->Effects[0].Effect

 

You end up with:

if (spellInfo->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM || spellInfo->Effects[0].Effect == SPELL_EFFECT_APPLY_GLYPH || spellInfo->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC)
    castTime = 1;

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Death said:

Change:


SpellProto->Effects[0].Effect

to:


spellInfo->Effects[0].Effect

 

You end up with:


if (spellInfo->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM || spellInfo->Effects[0].Effect == SPELL_EFFECT_APPLY_GLYPH || spellInfo->Effects[0].Effect == SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC)
    castTime = 1;

 

I shall give it an attempt :)

 

Error	1	error C2065: 'spellInfo' : undeclared identifier	Unit.cpp	14497	1	game
Error	2	error C2227: left of '->Effects' must point to generic type	Unit.cpp	14497	1	game
Error	3	error C2228: left of '.Effect' must have Unit.cpp	14497	1	game

Now i got these errors

Share this post


Link to post
Share on other sites
  • 0

I think trying to put this in unit.cpp is incorrect. I don't have the emucoach source to look at. So I used https://github.com/TrinityCoreLegacy/TrinityCore/blob/4.3.4/src/server/game/Spells/Spell.cpp instead.

Since there is a command .cheat casttime (CHEAT_CASTTIME), we know that the core is already triggers to accept the override to cast time. Working off this and the modification by @Death in Spell.cpp might do what you are looking for. 

This is untested

 

~hope this helps

Share this post


Link to post
Share on other sites
  • 0

The question(s) in this support topic have been answered and the topic author has resolved their issue. This topic is now closed. If you have other questions, please open a new topic.

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

About us

MMO-Society is the Forum former known as Lordcraft, MMO-Society offers various of Resources to help you evolve your knowledge within Emulation, In the process we make sure to form a strong community bond in-between each other and thus we are proud to can admit that MMO-Society is possibly the friendliest Community Forum to currently exist.

Useful Quick-Links

×
×
  • Create New...